docs: clarify shared Python, CLI vs Action, and Task Center rules
All checks were successful
技能自动化发布 / release (push) Successful in 11s
All checks were successful
技能自动化发布 / release (push) Successful in 11s
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
# Skill Action Manifest(匠厂宿主)
|
||||
|
||||
本文件说明 `assets/actions.json` 与 `scripts/main.py` CLI 的对应关系,供 Agent 编排与宿主 **Skill Action Runtime** 使用。
|
||||
本文件说明 `assets/actions.json` 与 `scripts/main.py` CLI 的对应关系,供 **Agent 编排**与宿主 **Skill Action Runtime** 使用。这是 Agent 侧关于 Action / 任务中心的**主契约**;实现细节与开发规范见 [`../development/SKILL_ACTION_RUNTIME.md`](../development/SKILL_ACTION_RUNTIME.md)。
|
||||
|
||||
**权威运行时契约(sync/async、任务中心、单内核编排)见 [`../development/SKILL_ACTION_RUNTIME.md`](../development/SKILL_ACTION_RUNTIME.md)。**
|
||||
**边界:** 用户市场说明见根目录 [`README.md`](../README.md);CLI 参数见 [`CLI.md`](CLI.md)。
|
||||
|
||||
**边界:** 用户市场说明见根目录 [`README.md`](../README.md);CLI 参数与错误码细节见 [`CLI.md`](CLI.md)。
|
||||
## Agent 何时用 Action(与 CLI 的分工)
|
||||
|
||||
| 场景 | 做法 |
|
||||
|------|------|
|
||||
| 短查询 / 只读 / 秒级 | bash + 共享 Python CLI(见 [`CLI.md`](CLI.md));**不必**强行走 Action |
|
||||
| 数据管理按钮 / 定时任务 / 技能详情按钮 | **必须**在 `actions.json` 声明对应 Action |
|
||||
| 长耗时 / RPA / 需要进度与取消 | **必须** `run_skill_action`;对应 Action 一般为 `executionProfile: "async"` |
|
||||
| 已声明的 `sync` Action | `run_skill_action` 当场返回结果,**不进**任务中心 |
|
||||
| 已声明的 `async` Action | `run_skill_action` 立即返回 `jobId`,**进入**任务中心 |
|
||||
|
||||
**进不进任务中心只取决于该 Action 的 `executionProfile`,与从数据管理、定时任务还是 Agent 触发无关。**
|
||||
|
||||
禁止对长任务 `exec`/`bash` + `process poll` 干等 CLI。禁止 `uv run python` 跑技能脚本。
|
||||
|
||||
## 模板严格规范 vs 宿主向后兼容
|
||||
|
||||
@@ -117,10 +129,10 @@ Action 是**可选能力**:
|
||||
|
||||
## 执行模型
|
||||
|
||||
宿主将 action 转为 argv,再执行:
|
||||
宿主将 action 转为 argv,再用**共享 Python** 执行(与 Agent CLI 同一解释器契约):
|
||||
|
||||
```text
|
||||
python {skill_root}/scripts/main.py <command> <args...>
|
||||
{JIANGCHANG_PYTHON_EXE} {skill_root}/scripts/main.py <command> <args...>
|
||||
```
|
||||
|
||||
- `entrypoint.type` 当前只支持 `cli`
|
||||
@@ -132,7 +144,7 @@ python {skill_root}/scripts/main.py <command> <args...>
|
||||
|
||||
### `executionProfile`(仅 sync / async)
|
||||
|
||||
模板与新技能**只允许**这两种值;禁止发明 `auto` / `background` / `deferred` 等第三种模式。
|
||||
模板与新技能**只允许**这两种值;每个 Action **必须**显式写出;禁止发明 `auto` / `background` / `deferred`;**禁止**依赖宿主「省略字段时的兼容默认」。
|
||||
|
||||
| 值 | 宿主行为 | 任务中心 |
|
||||
|----|----------|----------|
|
||||
@@ -141,9 +153,9 @@ python {skill_root}/scripts/main.py <command> <args...>
|
||||
|
||||
合法组合(全部允许):`sync|async` × `toolbar|cron|agent|skill-detail`。
|
||||
|
||||
经验建议(**不是** placement 硬限制):耗时不可预测、需要暂停/停止/进度展示的任务,建议用 `async`。
|
||||
经验建议(**不是** placement 硬限制):耗时不可预测、需要暂停/停止/进度展示的任务,用 `async`。
|
||||
|
||||
直接执行 CLI 时,终端自然等待进程结束;宿主通过 Action 调用同一 CLI 时,再按 `executionProfile` 决定同步等待还是建 Job。技能**不得**自行实现第二套任务中心或后台队列。
|
||||
直接执行短 CLI 时,终端自然等待进程结束。宿主通过 Action 调用同一 CLI 时,再按 `executionProfile` 决定同步等待还是建 Job。技能**不得**自行实现第二套任务中心或后台队列。
|
||||
|
||||
### CLI 输出契约
|
||||
|
||||
|
||||
Reference in New Issue
Block a user