docs: align host placements (row/batch), Gitea clone, developer_ids QA
All checks were successful
技能自动化发布 / release (push) Successful in 16s
All checks were successful
技能自动化发布 / release (push) Successful in 16s
This commit is contained in:
@@ -80,7 +80,7 @@ Action 是**可选能力**:
|
||||
|
||||
| 字段 / 层 | 只决定什么 | 不决定什么 |
|
||||
|-----------|------------|------------|
|
||||
| **`placements`** | Action **出现在哪里**(toolbar / cron / agent / skill-detail …) | 不决定 sync/async |
|
||||
| **`placements`** | Action **出现在哪里**(toolbar / row / batch / cron / agent / skill-detail) | 不决定 sync/async |
|
||||
| **`bind.tables`** | 数据管理里出现在**哪些业务表** | 不决定业务实现 |
|
||||
| **`executionProfile`** | 宿主是**同步等待**还是**异步 Job** | 不限制可展示入口 |
|
||||
| **`entrypoint`** | 实际执行哪个 CLI 命令与参数 | 不写业务逻辑 |
|
||||
@@ -95,9 +95,9 @@ Action 是**可选能力**:
|
||||
| 顶层 | `schemaVersion`、`skill`、`actions` |
|
||||
| action | `id`、`label`、`description`、`placements`、`entrypoint`、**`executionProfile`(必填)**;可选 `inputSchema`、`confirmation`、**`bind`** |
|
||||
| entrypoint | `type = cli`、`command`、`args`(**必填** JSON 数组,项为 `string` / `number` / `boolean`) |
|
||||
| placements | `toolbar`、`skill-detail`、`agent`、`cron` |
|
||||
| **bind** | `{ "tables": ["business_table"] }`(见下节) |
|
||||
| inputSchema | 根 `type: object`;properties 使用 `string` / `number` / `boolean`;支持 `enum`、`default`、`required`、`sensitive` |
|
||||
| placements | `toolbar`、`row`、`batch`、`skill-detail`、`agent`、`cron` |
|
||||
| **bind** | `{ "tables": ["business_table"] }`;可选 `inputMapping`(行内/批量预填,见下节) |
|
||||
| inputSchema | 根 `type: object`;properties 使用 `string` / `number` / `boolean`;支持 `enum`、`default`、`required`、`sensitive`、`readOnly` |
|
||||
| confirmation | `{ "message": "..." }` |
|
||||
| **executionProfile** | `"sync"` \| `"async"`(**必须显式写出**,禁止依赖缺省) |
|
||||
|
||||
@@ -113,14 +113,16 @@ Action 是**可选能力**:
|
||||
|
||||
规则:
|
||||
|
||||
- `bind` 为 object,`additionalProperties: false`;当前只允许 `tables`。
|
||||
- `bind` 为 object,`additionalProperties: false`;当前允许 `tables`(必填键当存在 bind 时)与可选 `inputMapping`。
|
||||
- `tables` 非空数组、元素唯一、英文 **snake_case**、不得为空字符串。
|
||||
- **`placements` 含 `toolbar` 时必须显式声明非空 `bind.tables`**(模板 Schema `if/then` + 自动测试强制)。
|
||||
- `row` / `batch` **建议**同样声明 `bind.tables`,避免在无关表上露出按钮;未声明时宿主可能按兼容逻辑在更多表上展示。
|
||||
- 表名须真实存在于技能 SQLite 与 `_jiangchang_tables`。
|
||||
- 希望出现在多张表时,显式列出所有表;**不要**依赖「无 bind 则全表展示」——那是宿主对**旧技能**的兼容,不是新技能标准。
|
||||
- 本阶段**不**扩展 `selection` / `inputMapping` / `columns` / row binding / concurrency / locks。
|
||||
- **`inputMapping`(可选)**:把行/勾选映射到 `inputSchema` 字段,例如 `"leadId": "$row.$pk"`、`"ids": "$selection.ids"`。适合 `row` / `batch`。宿主仍会提交这些字段;可用 `inputSchema.properties.*.readOnly: true` 在表单中只读展示。
|
||||
- `concurrency` / `locks` 仍未稳定,**不要**写入新技能 manifest。
|
||||
|
||||
默认模板 `actions.json` 仅含 `health` / `version` / `config-path`,不放在 toolbar,故无需 `bind` 示例污染默认 manifest。业务示例:
|
||||
默认模板 `actions.json` 仅含 `health` / `version` / `config-path`,不放在 toolbar/row/batch,故无需 `bind` 示例污染默认 manifest。业务示例:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -134,16 +136,42 @@ Action 是**可选能力**:
|
||||
}
|
||||
```
|
||||
|
||||
行内示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "retry-one",
|
||||
"label": "重试本行",
|
||||
"description": "对当前行执行一次业务重试。",
|
||||
"placements": ["row"],
|
||||
"executionProfile": "async",
|
||||
"bind": {
|
||||
"tables": ["business_records"],
|
||||
"inputMapping": { "recordId": "$row.$pk" }
|
||||
},
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"required": ["recordId"],
|
||||
"properties": {
|
||||
"recordId": { "type": "string", "title": "记录 ID", "readOnly": true }
|
||||
}
|
||||
},
|
||||
"entrypoint": {
|
||||
"type": "cli",
|
||||
"command": "retry",
|
||||
"args": ["--id", "{{recordId}}"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 预留能力(当前不可当作已实现能力)
|
||||
|
||||
| 类别 | 预留项 | 说明 |
|
||||
|------|--------|------|
|
||||
| placements | `row`、`batch` | 行内 / 批量入口,未来扩展;新技能示例不得使用 |
|
||||
| action 字段 | `concurrency`、`locks` | 并发与锁控制,未稳定开放 |
|
||||
| inputSchema | `array`、nested `object`、`oneOf` 等 | 复杂表单,不属于当前推荐范围 |
|
||||
|
||||
`bind` **不是**保留字段;已作为 Phase 1 表级绑定正式能力。
|
||||
|
||||
`bind`、`row`、`batch` **不是**保留能力;已按匠厂宿主正式支持写入本规范。
|
||||
## 执行模型
|
||||
|
||||
宿主将 action 转为 argv,再用**共享 Python**(用户数据目录下 `python-runtime/.venv`)执行:
|
||||
@@ -168,7 +196,7 @@ python {skill_root}/scripts/main.py <command> <args...>
|
||||
| `sync`(或省略时的宿主缺省) | 调用方等待结束,直接返回结构化结果或结构化错误;**不**创建后台 Job | 不进 |
|
||||
| `async`(须显式声明) | 宿主创建后台 Job,立即返回 `jobId`;用 `emit` / `checkpoint` / `finish` 报告进度与终态 | **进入** |
|
||||
|
||||
合法组合(全部允许):`sync|async` × `toolbar|cron|agent|skill-detail`。
|
||||
合法组合(全部允许):`sync|async` × `toolbar|row|batch|cron|agent|skill-detail`。
|
||||
|
||||
经验建议(**不是** placement 硬限制):耗时不可预测、需要暂停/停止/进度展示的任务,用 `async`;其余默认写 `sync`。
|
||||
|
||||
@@ -199,26 +227,27 @@ HINT: <next step>
|
||||
|
||||
| 值 | 含义 |
|
||||
|----|------|
|
||||
| `toolbar` | 数据管理第一排技能按钮(须配合 `bind.tables`) |
|
||||
| `skill-detail` | 技能详情或技能市场详情页 |
|
||||
| `toolbar` | 数据管理表顶栏技能按钮(须配合 `bind.tables`) |
|
||||
| `row` | 数据管理行内操作(建议 `bind.tables` + `inputMapping`;表需有主键) |
|
||||
| `batch` | 数据管理批量操作(需勾选行;无勾选时宿主禁用按钮) |
|
||||
| `skill-detail` | 技能详情页直调(与安装/四 Tab 同属技能市场详情;已声明则须自测) |
|
||||
| `agent` | Agent 可直接调用(`run_skill_action`) |
|
||||
| `cron` | 定时任务可直接调用 |
|
||||
|
||||
**预留(模板示例请勿使用):** `row`、`batch`。
|
||||
| `cron` | 定时任务「技能直调」 |
|
||||
|
||||
### Action 类型 × placements(常见示例,不是限制)
|
||||
|
||||
下表只表示**常见用法示例**。实际 `placements` 以 manifest 配置为准;**`sync` / `async` 不影响展示入口**。
|
||||
下表只表示**常见用法示例**。实际 `placements` 以 manifest 配置为准;**`sync` / `async` 不影响展示入口**。已声明的入口都要在宿主自测,不要只测其中一条。
|
||||
|
||||
| Action 类型 | 常见 executionProfile | 常见 placements | confirmation |
|
||||
|-------------|----------------------|-----------------|--------------|
|
||||
| health / version / config-path | sync | skill-detail, agent | 无 |
|
||||
| 统计 / 只读查询 | sync | skill-detail, agent | 无 |
|
||||
| 数据同步(外源 → 本地库) | sync 或 async | toolbar + cron + agent + skill-detail(按需) | 可选 |
|
||||
| 单行重试 / 行内处理 | sync 或 async | row(可加 agent) | 可选 |
|
||||
| 批量处理勾选行 | sync 或 async | batch(可加 toolbar/cron) | 可选 |
|
||||
| 导入 / 重置 | sync 或 async | skill-detail, agent | 可选 |
|
||||
| 单条副作用 RPA | async(建议) | agent, skill-detail | **建议** |
|
||||
| 批量顺序 pick RPA | async(建议) | toolbar, cron, agent | **建议** |
|
||||
|
||||
## 同步数据 vs 导出当前表 vs 特殊业务报告
|
||||
|
||||
不要混用「导出」一词:
|
||||
@@ -236,7 +265,7 @@ HINT: <next step>
|
||||
当前宿主稳定支持:
|
||||
|
||||
- `object` / `string` / `number` / `boolean`
|
||||
- `enum` / `default` / `required` / `sensitive`
|
||||
- `enum` / `default` / `required` / `sensitive` / `readOnly`
|
||||
- 简单模板替换(`{{fieldName}}`)
|
||||
|
||||
示例:
|
||||
@@ -281,6 +310,8 @@ HINT: <next step>
|
||||
- `enum` 在宿主中渲染为选择框
|
||||
- `required` 字段在提交前校验
|
||||
- `sensitive` 字段不得出现在低信任入口
|
||||
- `readOnly: true` 时数据管理表单只读展示该字段(仍随提交传入);适合行内/勾选预填的主键、编号列表
|
||||
- `placements` 含 `batch` 的动作在数据管理表顶常驻,无勾选时禁用(与表删除一致)
|
||||
- 需要确认的副作用操作使用 `confirmation.message`
|
||||
- 模板参数使用 `{{fieldName}}`,且必须在 `inputSchema.properties` 中声明
|
||||
- `entrypoint.args` 项当前只允许 `string`、`number`、`boolean`;不允许对象或 `null`
|
||||
|
||||
Reference in New Issue
Block a user