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
All checks were successful
技能自动化发布 / release (push) Successful in 14s
This commit is contained in:
@@ -564,6 +564,9 @@ class TestActionsManifest(unittest.TestCase):
|
||||
bind_props = schema["$defs"]["bind"]["properties"]
|
||||
self.assertIn("visibleWhen", bind_props)
|
||||
self.assertIn("visibleWhenRule", schema["$defs"])
|
||||
rule_desc = schema["$defs"]["visibleWhenRule"].get("description") or ""
|
||||
self.assertIn("equalsFrom", rule_desc)
|
||||
self.assertIn("notEqualsFrom", rule_desc)
|
||||
manifest = {
|
||||
"schemaVersion": 1,
|
||||
"skill": "your-skill-slug",
|
||||
@@ -600,6 +603,54 @@ class TestActionsManifest(unittest.TestCase):
|
||||
}
|
||||
jsonschema.validate(instance=manifest, schema=schema)
|
||||
|
||||
def test_schema_allows_visible_when_equals_from_and_all(self) -> None:
|
||||
try:
|
||||
import jsonschema
|
||||
except ImportError:
|
||||
self.fail("jsonschema is required")
|
||||
schema = _load_actions_schema()
|
||||
manifest = {
|
||||
"schemaVersion": 1,
|
||||
"skill": "your-skill-slug",
|
||||
"actions": [
|
||||
{
|
||||
"id": "probe-owner-delete",
|
||||
"label": "删除",
|
||||
"description": "验证 equalsFrom 与 all 可通过 Schema",
|
||||
"replaces": "delete",
|
||||
"placements": [],
|
||||
"executionProfile": "sync",
|
||||
"interaction": "confirm",
|
||||
"confirmation": {"message": "确认删除?"},
|
||||
"bind": {
|
||||
"tables": ["demo_items"],
|
||||
"visibleWhen": {
|
||||
"all": [
|
||||
{
|
||||
"field": "owner_user_id",
|
||||
"equalsFrom": "currentUser.userId",
|
||||
},
|
||||
{"field": "status", "in": ["open", "draft"]},
|
||||
]
|
||||
},
|
||||
"inputMapping": {"itemId": "$row.$pk"},
|
||||
},
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"itemId": {"type": "string", "readOnly": True},
|
||||
},
|
||||
},
|
||||
"entrypoint": {
|
||||
"type": "cli",
|
||||
"command": "item-delete",
|
||||
"args": ["--id", "{{itemId}}"],
|
||||
},
|
||||
}
|
||||
],
|
||||
}
|
||||
jsonschema.validate(instance=manifest, schema=schema)
|
||||
|
||||
def test_action_examples_user_facing_copy_avoids_jargon(self) -> None:
|
||||
"""示例 Action 的用户可见字符串不得含常见开发黑话(属性名本身除外)。"""
|
||||
examples_dir = os.path.join(get_skill_root(), "assets", "examples")
|
||||
|
||||
Reference in New Issue
Block a user