Precipitate host contracts from task-plaza: visibleWhen equalsFrom, replaces gates, url openExternal, feishu data-sources (v1.0.128)
All checks were successful
技能自动化发布 / release (push) Successful in 14s

This commit is contained in:
2026-11-01 16:30:46 +08:00
parent d911bd28cd
commit 90eefc8653
15 changed files with 412 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
# 示例 JSON
- `data-sources.mysql.example.json`:MySQL 云库 `data-sources.json` 形状参考(复制到用户数据目录并配 `.env` 中 `MYSQL_DSN`;见 `references/DATA_SOURCES.md`)。
- `data-sources.feishu_bitable.example.json`:飞书多维表源 + `columns` 展示覆盖(`searchable` / `editable` / `displayType: url` / `defaultValueFrom` / `optionsWhen`;见同文档)。
- `version-response.json`:`python main.py version` 成功时 stdout 单行对象的形状参考。
- `skill-policy-snapshot.*.example.json`:Data Policy Snapshot 形状参考(见 `references/POLICY.md`)。
- `skill-cell-presentation.example.json`:数据管理单元格呈现文档形状参考(见 `references/CELL_PRESENTATION.md`)。
@@ -15,3 +16,4 @@
- `selection-label-column.action.example.json`:选择摘要 `bind.labelColumn` 形状参考(见 `references/ACTIONS.md`「选择摘要」)。
- `selection-mode-optional.action.example.json`:`bind.selectionMode: "optional"` 智能勾选/按数量合并形状参考(含 `cron`:配置页按无勾选分支,只见数量字段);用户可见文案为口语中文(见 `references/ACTIONS.md`「勾选驱动模式」「用户可见文案」)。
- `replaces-create.action.example.json` / `replaces-update.action.example.json` / `replaces-delete.action.example.json` / `replaces-import.action.example.json`:数据管理默认按钮接管(`replaces`)形状参考;**import 时 UI 仍用宿主「导入数据」面板**,确认后调技能写库(见 `references/ACTIONS.md`「`replaces`」)。实现 import 解析时复用 `scripts/service/table_file_import.py`(兼容宿主前缀 `*` 表头与 `{value} · {label}` lookup 单元格)。
- `replaces-delete-owner-visible.action.example.json`:`replaces: delete` + `visibleWhen.equalsFrom: currentUser.userId`——宿主行「删除」仅所有者可见(与技能行按钮同一求值;见 `references/ACTIONS.md`「行菜单显隐」)。

View File

@@ -0,0 +1,50 @@
{
"version": 1,
"sources": [
{
"id": "primary",
"kind": "feishu_bitable",
"displayName": "飞书业务表(示例)",
"appIdEnv": "FEISHU_APP_ID",
"appSecretEnv": "FEISHU_APP_SECRET",
"appTokenEnv": "FEISHU_BITABLE_APP_TOKEN",
"tableIdEnv": "FEISHU_TASK_TABLE_ID",
"columns": {
"record_id": {
"searchable": false
},
"标题": {
"requiredOnCreate": true,
"searchable": true
},
"状态": {
"editable": false,
"searchable": true,
"defaultValue": "可接"
},
"结果链接": {
"displayType": "url",
"editable": false,
"searchable": false
},
"发单人": {
"displayType": "userId",
"editable": false,
"formVisible": false,
"defaultValueFrom": "currentUser.userId",
"searchable": true
},
"平台": {
"searchable": true,
"optionsWhen": {
"dependsOn": "任务类型",
"map": {
"文章发布": ["头条号", "搜狐号"],
"视频发布": ["抖音", "视频号"]
}
}
}
}
}
]
}

View File

@@ -0,0 +1,53 @@
{
"id": "item-delete-own",
"label": "删除",
"description": "删除自己拥有的记录。用户点宿主「删除」:行上仅所有者=当前用户时显示;勾选批量时他人记录由技能跳过。",
"replaces": "delete",
"placements": ["agent"],
"executionProfile": "sync",
"interaction": "confirm",
"interactionByPlacement": {
"delete": "confirm",
"agent": "form"
},
"confirmation": {
"message": "确认删除?仅删除你拥有的记录,他人记录会跳过;删除后不可恢复。"
},
"bind": {
"tables": ["business_items"],
"selectionMode": "required",
"visibleWhen": {
"field": "owner_user_id",
"equalsFrom": "currentUser.userId"
},
"inputMapping": {
"itemId": "$row.$pk",
"itemIds": "$selection.ids"
}
},
"hostEffects": {
"onSuccess": ["reloadTable", "clearSelection"]
},
"inputSchema": {
"type": "object",
"properties": {
"itemId": {
"type": "string",
"title": "编号",
"description": "行内触发时自动填入",
"readOnly": true
},
"itemIds": {
"type": "string",
"title": "编号列表",
"description": "勾选时自动填入",
"readOnly": true
}
}
},
"entrypoint": {
"type": "cli",
"command": "item-delete",
"args": ["--id", "{{itemId}}", "--ids", "{{itemIds}}"]
}
}