> ## 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.