> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 编译画布

> 校验并将技能构建器编译为 SkillManifest 和 WorkflowSteps。

```http theme={null}
POST /api/v1/evi/canvases/{id}/compile
Authorization: Bearer theo_sk_...
```

校验画布图，并将其编译为两种输出：

1. **SkillManifest** — 供技能系统用于市场列表、安装和提示词注入。
2. **WorkflowSteps** — 供工作流引擎在运行时执行使用。

编译后的输出会保存到该画布记录上。画布状态会切换为 `"testing"`。

## 校验检查

* 恰好 1 个 Input 节点
* 至少 1 个可达的 Output 节点
* 执行路径中不得存在循环
* 所有节点都必须可从 Input 节点到达
* Model 节点必须有上游的 Prompt 节点
* 所有节点类型都必须合法（`input`、`prompt`、`model`、`tool`、`knowledge`、`condition`、`output`、`vision`）

## 响应（成功）

```json theme={null}
{
  "compiled": true,
  "manifest": { "name": "...", "slug": "...", "version": "1.0.0", "..." },
  "steps": [{ "type": "ai_transform", "name": "...", "config": { "..." } }],
  "errors": []
}
```

## 响应（校验错误）

```json theme={null}
{
  "compiled": false,
  "errors": [
    { "code": "cycle_detected", "message": "Canvas graph contains a cycle." },
    { "code": "model_no_prompt", "message": "Model node has no Prompt node upstream.", "nodeId": "model-1" }
  ]
}
```

校验失败时返回状态码 `422`。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.