Files
skill-template/assets/examples/visible-when-action.example.json
chendelian 3738f0bea2
All checks were successful
技能自动化发布 / release (push) Successful in 5s
docs: 沉淀 Action 表单 visibleWhen 条件显隐契约
2026-08-16 14:26:56 +08:00

73 lines
2.2 KiB
JSON

{
"_comment": "形状参考:互斥模式用 inputSchema.properties.*.visibleWhen 联动显隐,勿只靠 description 灰字。完整契约见 references/ACTIONS.md「字段条件显隐」。勿与 POLICY.md L3 行态 visibleWhen 混淆。",
"schemaVersion": 1,
"skill": "your-skill-slug",
"actions": [
{
"id": "scrape-links-demo",
"label": "采集链接(示例)",
"description": "演示按采集方式切换参数:关键词路径 vs 作者主页路径。",
"placements": ["toolbar"],
"executionProfile": "async",
"interaction": "form",
"bind": {
"tables": ["demo_items"]
},
"confirmation": {
"message": "将按所选方式采集链接(示例确认文案)。是否继续?"
},
"entrypoint": {
"type": "cli",
"command": "run",
"args": [
"--collect-mode",
"{{collectMode}}",
"--keyword",
"{{keyword}}",
"--author-url",
"{{authorUrl}}",
"--max-count",
"{{maxCount}}"
]
},
"inputSchema": {
"type": "object",
"required": ["collectMode"],
"properties": {
"collectMode": {
"type": "string",
"title": "采集方式",
"description": "先选方式,下方只出现对应参数。",
"enum": ["按关键词采集", "按作者主页采集"],
"default": "按关键词采集"
},
"keyword": {
"type": "string",
"title": "关键词",
"description": "例如 rpa。",
"visibleWhen": {
"field": "collectMode",
"equals": "按关键词采集"
}
},
"authorUrl": {
"type": "string",
"title": "作者主页链接",
"description": "例如 https://example.com/author/...",
"display_type": "url",
"visibleWhen": {
"collectMode": "按作者主页采集"
}
},
"maxCount": {
"type": "number",
"title": "数量上限",
"default": 50,
"minimum": 1
}
}
}
}
]
}