Release v1.0.122: document Action enumNames and column-bound static enum labels
All checks were successful
技能自动化发布 / release (push) Successful in 9s
All checks were successful
技能自动化发布 / release (push) Successful in 9s
This commit is contained in:
51
assets/examples/enum-names-action.example.json
Normal file
51
assets/examples/enum-names-action.example.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"_comment": "形状参考:Action 静态枚举用 enum + enumNames 显示中文;提交仍是 enum value。有对应表列时优先 column 绑列复用 options_json。完整契约见 references/ACTIONS.md「静态枚举 label」。",
|
||||
"schemaVersion": 1,
|
||||
"skill": "your-skill-slug",
|
||||
"actions": [
|
||||
{
|
||||
"id": "create-ticket",
|
||||
"label": "新建工单(示例)",
|
||||
"description": "演示 enumNames:界面显示中文,CLI 仍收到英文枚举值。",
|
||||
"placements": ["toolbar", "agent"],
|
||||
"executionProfile": "sync",
|
||||
"interaction": "form",
|
||||
"bind": {
|
||||
"tables": ["tickets"]
|
||||
},
|
||||
"entrypoint": {
|
||||
"type": "cli",
|
||||
"command": "ticket-create",
|
||||
"args": [
|
||||
"--category", "{{category}}",
|
||||
"--priority", "{{priority}}",
|
||||
"--title", "{{title}}"
|
||||
]
|
||||
},
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"required": ["title", "category"],
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"title": "标题"
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"title": "类型",
|
||||
"column": "category",
|
||||
"enum": ["incident", "request", "consult", "other"],
|
||||
"enumNames": ["故障", "需求", "咨询", "其他"]
|
||||
},
|
||||
"priority": {
|
||||
"type": "string",
|
||||
"title": "优先级",
|
||||
"enum": ["low", "medium", "high", "urgent"],
|
||||
"enumNames": ["低", "中", "高", "紧急"],
|
||||
"description": "无对应列时仅靠 enumNames 展示中文"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -147,7 +147,13 @@
|
||||
"default": {},
|
||||
"enum": {
|
||||
"type": "array",
|
||||
"minItems": 1
|
||||
"minItems": 1,
|
||||
"description": "静态枚举取值(提交/存库用)。展示中文时配 enumNames,或绑列复用 options_json;勿用 Lookup 冒充固定小枚举。"
|
||||
},
|
||||
"enumNames": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"description": "可选。与 enum 一一对应的展示文案(JSON Schema / OpenAPI 风格)。缺项或空串时宿主回退为对应 enum 原文。有对应表列时优先绑列复用 options_json(见 ACTIONS.md「静态枚举 label」)。"
|
||||
},
|
||||
"sensitive": { "type": "boolean" },
|
||||
"readOnly": {
|
||||
@@ -162,7 +168,7 @@
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"pattern": "^[a-z][a-z0-9_]*$",
|
||||
"description": "可选。绑定业务表物理列名;Action 弹窗(toolbar/batch)与 replaces create/update 抽屉均可复用该列的中文名与 lookup 下拉"
|
||||
"description": "可选。绑定业务表物理列名;Action 弹窗(toolbar/batch)与 replaces create/update 抽屉可复用该列的中文名与 options(静态枚举 options_json 数组,或已解析的 lookup)。"
|
||||
},
|
||||
"display_type": {
|
||||
"type": "string",
|
||||
|
||||
Reference in New Issue
Block a user