Skip to content

This content is not available in your language yet.

Action 是可被模型和用户调用的命名任务入口。每个 action 封装固定执行逻辑,不承担通用工作流 DSL 职责。

最小结构:

actions/
test-run/
ACTION.yaml

完整结构:

actions/
test-run/
ACTION.yaml
scripts/ # 内部脚本
references/ # 补充文档
assets/ # 资源文件和静态资源
name: test.run
description: Run project tests
expose:
to_llm: true
callable_by_user: true
callable_by_api: true
recovery:
retry_policy: manual
input_schema:
type: object
properties:
watch:
type: boolean
additionalProperties: false
entry:
command: npm test
字段必填说明
name是Action 名称
description是简短说明
expose否暴露策略(to_llm / callable_by_user / callable_by_api)
input_schema否JSON Schema 输入约束
recovery否重试策略
entry是执行入口
entry:
command: npm test
environment:
CI: "true"
cwd: ./
timeout_seconds: 300
字段必填说明
command是Shell 命令字符串
environment否追加环境变量
cwd否工作目录
timeout_seconds否执行超时
recovery:
retry_policy: safe
值说明
manual默认值。只允许人工或外部调用方显式重试
safe仅用于已确认幂等的 action,为自动恢复提供信号
  • 一个 action 只有一个入口,统一使用 command
  • Shell 命令、脚本、解释器调用都通过 command 表达
  • 复杂编排逻辑放在被调用的脚本或程序中
  • 不提供 steps / if / loop / matrix / DAG 语义
# Shell
entry:
command: npm test
# Python
entry:
command: python ./scripts/run_tests.py --watch
# Node.js
entry:
command: node ./scripts/run-tests.js
# TypeScript
entry:
command: npx tsx ./scripts/code-review.ts