tinet-agent-cli 0.1.0.dev36__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. taco/__init__.py +1 -0
  2. taco/agent_openapi/__init__.py +1 -0
  3. taco/agent_openapi/catalog.py +198 -0
  4. taco/agent_openapi/models.py +47 -0
  5. taco/agent_openapi/parameters.py +111 -0
  6. taco/agent_openapi/service.py +73 -0
  7. taco/aikb/__init__.py +4 -0
  8. taco/aikb/catalog.py +380 -0
  9. taco/aikb/executors.py +157 -0
  10. taco/aikb/file_input.py +55 -0
  11. taco/aikb/models.py +42 -0
  12. taco/aikb/parameters.py +135 -0
  13. taco/aikb/service.py +68 -0
  14. taco/assets/__init__.py +1 -0
  15. taco/assets/agent_openapi/catalog.json +14 -0
  16. taco/assets/agent_openapi/operations/conversation/list-conversations.json +67 -0
  17. taco/assets/agent_openapi/operations/message/list-conversation-messages.json +80 -0
  18. taco/assets/agent_openapi/operations/trace/list-message-traces.json +72 -0
  19. taco/assets/aikb/catalog.json +41 -0
  20. taco/assets/aikb/operations/conversation/chat-conversation-on-open.json +99 -0
  21. taco/assets/aikb/operations/directory/delete-directory.json +81 -0
  22. taco/assets/aikb/operations/directory/edit-directory.json +97 -0
  23. taco/assets/aikb/operations/directory/list-directory-tree.json +106 -0
  24. taco/assets/aikb/operations/directory/save-directory.json +109 -0
  25. taco/assets/aikb/operations/faq/create-faq.json +193 -0
  26. taco/assets/aikb/operations/faq/delete-faq.json +81 -0
  27. taco/assets/aikb/operations/faq/describe-faq.json +82 -0
  28. taco/assets/aikb/operations/faq/edit-faq.json +193 -0
  29. taco/assets/aikb/operations/faq/list-faqs.json +136 -0
  30. taco/assets/aikb/operations/file/create-file.json +145 -0
  31. taco/assets/aikb/operations/file/delete-files.json +110 -0
  32. taco/assets/aikb/operations/file/describe-file.json +82 -0
  33. taco/assets/aikb/operations/file/get-file-upload-url.json +154 -0
  34. taco/assets/aikb/operations/file/list-files.json +146 -0
  35. taco/assets/aikb/operations/media/describe-faq-media-url.json +98 -0
  36. taco/assets/aikb/operations/media/describe-file-media-url.json +90 -0
  37. taco/assets/aikb/operations/oss/signature-for-upload.json +85 -0
  38. taco/assets/aikb/operations/recycle-bin/list-recycled-items.json +151 -0
  39. taco/assets/aikb/operations/repository/describe-bot-repository.json +71 -0
  40. taco/assets/aikb/operations/repository/list-private-repositories.json +75 -0
  41. taco/assets/aikb/operations/repository/list-public-repositories.json +75 -0
  42. taco/assets/aikb/operations/search/search-knowledge-on-open.json +180 -0
  43. taco/assets/examples/README.md +3 -0
  44. taco/assets/examples/agent-basic.json +16 -0
  45. taco/assets/examples/agent-builtin-tool.json +28 -0
  46. taco/assets/examples/agent-workflow-tool.json +30 -0
  47. taco/assets/examples/chatflow-basic.json +24 -0
  48. taco/assets/examples/workflow-http.json +34 -0
  49. taco/assets/manifest.json +12 -0
  50. taco/assets/scenarios/README.md +3 -0
  51. taco/assets/scenarios/agent-basic.json +80 -0
  52. taco/assets/scenarios/agent-builtin-tool.json +116 -0
  53. taco/assets/scenarios/agent-workflow-tool.json +277 -0
  54. taco/assets/schemas/README.md +3 -0
  55. taco/assets/schemas/agent-tool.json +71 -0
  56. taco/assets/schemas/agent.json +199 -0
  57. taco/assets/schemas/chatflow.json +1048 -0
  58. taco/assets/schemas/workflow.http.json +1052 -0
  59. taco/assets/schemas/workflow.json +1052 -0
  60. taco/assets/skills/README.md +3 -0
  61. taco/assets/skills/taco/SKILL.md +68 -0
  62. taco/assets/skills/taco/manifest.json +10 -0
  63. taco/cli.py +127 -0
  64. taco/commands/__init__.py +1 -0
  65. taco/commands/agent.py +760 -0
  66. taco/commands/aikb.py +132 -0
  67. taco/commands/app.py +151 -0
  68. taco/commands/category.py +37 -0
  69. taco/commands/chatflow.py +183 -0
  70. taco/commands/credential.py +222 -0
  71. taco/commands/discovery.py +409 -0
  72. taco/commands/model.py +55 -0
  73. taco/commands/profile.py +124 -0
  74. taco/commands/tool.py +61 -0
  75. taco/commands/workflow.py +714 -0
  76. taco/core/__init__.py +1 -0
  77. taco/core/access_token_manager.py +98 -0
  78. taco/core/api_client.py +263 -0
  79. taco/core/assets.py +81 -0
  80. taco/core/config_store.py +209 -0
  81. taco/core/context.py +19 -0
  82. taco/core/developer_center_client.py +165 -0
  83. taco/core/errors.py +19 -0
  84. taco/core/file_lock.py +80 -0
  85. taco/core/http_headers.py +21 -0
  86. taco/core/openapi_signer.py +221 -0
  87. taco/core/output.py +72 -0
  88. taco/core/profile_manager.py +217 -0
  89. taco/core/profile_resolver.py +151 -0
  90. taco/core/secure_file.py +76 -0
  91. taco/release.py +363 -0
  92. taco/services/__init__.py +1 -0
  93. taco/services/agent_service.py +314 -0
  94. taco/services/app_service.py +153 -0
  95. taco/services/category_service.py +57 -0
  96. taco/services/model_service.py +117 -0
  97. taco/services/tool_service.py +482 -0
  98. taco/services/workflow_compiler.py +1665 -0
  99. taco/services/workflow_service.py +652 -0
  100. taco/services/workflow_tool_service.py +439 -0
  101. tinet_agent_cli-0.1.0.dev36.dist-info/METADATA +158 -0
  102. tinet_agent_cli-0.1.0.dev36.dist-info/RECORD +104 -0
  103. tinet_agent_cli-0.1.0.dev36.dist-info/WHEEL +4 -0
  104. tinet_agent_cli-0.1.0.dev36.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,34 @@
1
+ {
2
+ "kind": "workflow",
3
+ "name": "HTTP 客户查询",
4
+ "description": "根据手机号调用 HTTP 接口并返回响应。",
5
+ "inputs": {
6
+ "phone": {
7
+ "type": "string",
8
+ "required": true,
9
+ "description": "客户手机号",
10
+ "max_length": 32
11
+ }
12
+ },
13
+ "nodes": [
14
+ {
15
+ "id": "query_customer",
16
+ "type": "http",
17
+ "method": "GET",
18
+ "url": "https://example.com/api/customers",
19
+ "query": {
20
+ "phone": "{{ inputs.phone }}"
21
+ },
22
+ "headers": {
23
+ "Accept": "application/json"
24
+ }
25
+ }
26
+ ],
27
+ "outputs": {
28
+ "customer": "{{ query_customer.body }}",
29
+ "status": "{{ query_customer.status_code }}"
30
+ },
31
+ "publish": {
32
+ "asTool": true
33
+ }
34
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "format_version": 1,
3
+ "cli_version": "0.1.0.dev36",
4
+ "resource_groups": [
5
+ "skills",
6
+ "schemas",
7
+ "scenarios",
8
+ "examples",
9
+ "aikb",
10
+ "agent_openapi"
11
+ ]
12
+ }
@@ -0,0 +1,3 @@
1
+ # TACO Scenarios
2
+
3
+ 场景步骤、风险和验收元数据位于此目录。
@@ -0,0 +1,80 @@
1
+ {
2
+ "id": "agent-basic",
3
+ "title": "创建、调试并发布基础智能体",
4
+ "description": "适用于提示词、模型、开场白、关联问题以及分类扩展配置的基础 Agent 场景。",
5
+ "requirements": [
6
+ "已配置可用的 TACO profile",
7
+ "使用专用测试应用执行调试和发布"
8
+ ],
9
+ "risks": [
10
+ {
11
+ "operation": "agent create",
12
+ "level": "write",
13
+ "confirmation": "--yes",
14
+ "note": "会在远端创建应用;本地输出已存在时还需 --overwrite。"
15
+ },
16
+ {
17
+ "operation": "agent publish",
18
+ "level": "write",
19
+ "confirmation": "--yes",
20
+ "note": "成功后默认删除本地 DSL;需要保留时传 --keep-dsl。"
21
+ }
22
+ ],
23
+ "steps": [
24
+ {
25
+ "id": "discover-category",
26
+ "command": "taco --json --no-input agent category list",
27
+ "purpose": "发现真实分类 code,不得猜测。"
28
+ },
29
+ {
30
+ "id": "discover-model",
31
+ "command": "taco --json --no-input agent model list --category <category-code>",
32
+ "purpose": "发现该分类可用模型。"
33
+ },
34
+ {
35
+ "id": "describe-model",
36
+ "command": "taco --json --no-input agent model describe --provider <provider-id> --model <model-id> --category <category-code>",
37
+ "purpose": "读取参数规则,不得猜 completion_params。"
38
+ },
39
+ {
40
+ "id": "create",
41
+ "command": "taco --json --no-input agent create --name <name> --category <category-code> --output agent.json --yes",
42
+ "purpose": "创建 agent-chat 并把服务端默认 model_config 写入本地。"
43
+ },
44
+ {
45
+ "id": "read-schema",
46
+ "command": "taco --json --no-input agent schema show agent -o json",
47
+ "purpose": "读取当前版本 DSL schema 后再编辑。"
48
+ },
49
+ {
50
+ "id": "validate",
51
+ "command": "taco --json --no-input agent validate --dsl agent.json --category <category-code>",
52
+ "purpose": "在调用服务端前校验本地 DSL 和真实模型。"
53
+ },
54
+ {
55
+ "id": "run",
56
+ "command": "taco --json --no-input agent run <app-id> --dsl agent.json --query <query>",
57
+ "purpose": "通过 SSE 调试并读取 answer、conversation_id 和 task_id。"
58
+ },
59
+ {
60
+ "id": "continue-run",
61
+ "command": "taco --json --no-input agent run <app-id> --dsl agent.json --query <query> --conversation-id <conversation-id>",
62
+ "purpose": "复用上一轮会话进行多轮调试。"
63
+ },
64
+ {
65
+ "id": "stream-run",
66
+ "command": "taco --json --no-input agent run <app-id> --dsl agent.json --query <query> --stream-events",
67
+ "purpose": "实时读取 task_id。"
68
+ },
69
+ {
70
+ "id": "stop",
71
+ "command": "taco --json --no-input agent stop <app-id> --task-id <task-id>",
72
+ "purpose": "从另一进程停止正在运行的调试任务。"
73
+ },
74
+ {
75
+ "id": "publish",
76
+ "command": "taco --json --no-input agent publish <app-id> --dsl agent.json --yes",
77
+ "purpose": "显式确认后覆盖服务端有效配置。"
78
+ }
79
+ ]
80
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "id": "agent-builtin-tool",
3
+ "title": "为语音 Agent 挂载内置工具",
4
+ "description": "在基础 Agent 场景上发现工具、配置 Provider 凭据,并把工具挂载到本地 DSL 后调试发布。",
5
+ "requirements": [
6
+ "已完成 agent-basic 场景并持有本地 agent.json",
7
+ "已配置可用的 TACO profile",
8
+ "凭据仅通过 stdin 或环境变量传入"
9
+ ],
10
+ "risks": [
11
+ {
12
+ "operation": "credential set",
13
+ "level": "secret-write",
14
+ "confirmation": "--yes",
15
+ "note": "写入工作区共享凭据;禁止把凭据放入命令参数、DSL、日志或 Agent 提示词。"
16
+ },
17
+ {
18
+ "operation": "credential delete",
19
+ "level": "destructive",
20
+ "confirmation": "--yes",
21
+ "note": "删除工作区共享凭据,可能影响其他应用。"
22
+ },
23
+ {
24
+ "operation": "agent tool add/remove",
25
+ "level": "local-write",
26
+ "confirmation": "--yes",
27
+ "note": "会修改本地 Agent DSL;工具参数不得包含 Provider 凭据。"
28
+ },
29
+ {
30
+ "operation": "agent publish",
31
+ "level": "write",
32
+ "confirmation": "--yes",
33
+ "note": "会覆盖远端有效配置。"
34
+ }
35
+ ],
36
+ "steps": [
37
+ {
38
+ "id": "discover-provider",
39
+ "command": "taco --json --no-input agent tool catalog provider list",
40
+ "purpose": "发现真实 Provider ID,不得猜测。"
41
+ },
42
+ {
43
+ "id": "discover-tool",
44
+ "command": "taco --json --no-input agent tool catalog list --provider <provider-id>",
45
+ "purpose": "发现 Provider 下的真实工具 action。"
46
+ },
47
+ {
48
+ "id": "describe-tool",
49
+ "command": "taco --json --no-input agent tool catalog describe --provider <provider-id> --tool <tool-name>",
50
+ "purpose": "读取工具 form 参数与凭据 schema。"
51
+ },
52
+ {
53
+ "id": "credential-status",
54
+ "command": "taco --json --no-input agent tool credential status <provider-id>",
55
+ "purpose": "只读取服务端脱敏值与 schema。"
56
+ },
57
+ {
58
+ "id": "credential-set",
59
+ "command": "taco --json --no-input agent tool credential set <provider-id> --from-env TACO_TOOL_CREDENTIALS --yes",
60
+ "purpose": "从预先安全设置的 JSON 环境变量写入凭据,输出仅包含字段名。",
61
+ "when": "credential-status.configured == false",
62
+ "approval_required": true
63
+ },
64
+ {
65
+ "id": "read-tool-schema",
66
+ "command": "taco --json --no-input agent schema show agent-tool -o json",
67
+ "purpose": "读取当前版本 Agent 工具结构。"
68
+ },
69
+ {
70
+ "id": "read-example",
71
+ "command": "taco --json --no-input agent example describe agent-builtin-tool -o json",
72
+ "purpose": "读取不含真实 ID 和凭据的工具挂载示例。"
73
+ },
74
+ {
75
+ "id": "attach-tool",
76
+ "command": "taco --json --no-input agent tool add --dsl agent.json --provider <provider-id> --tool <tool-name> --parameters tool-parameters.json --yes",
77
+ "purpose": "只把 form 参数挂载到本地 DSL。",
78
+ "approval_required": true
79
+ },
80
+ {
81
+ "id": "list-attached-tools",
82
+ "command": "taco --json --no-input agent tool list --dsl agent.json",
83
+ "purpose": "确认本地工具结构不含 Provider 凭据。"
84
+ },
85
+ {
86
+ "id": "validate",
87
+ "command": "taco --json --no-input agent validate --dsl agent.json --category <category-code>",
88
+ "purpose": "调试前校验完整 Agent DSL。"
89
+ },
90
+ {
91
+ "id": "run-tool-positive",
92
+ "command": "taco --json --no-input agent run <app-id> --dsl agent.json --query <应调用工具的问题> --stream-events",
93
+ "purpose": "验证 Agent 在满足调用条件时真实调用工具。",
94
+ "expected_events": [
95
+ "agent_thought",
96
+ "message_end"
97
+ ],
98
+ "expected_tool_call": true
99
+ },
100
+ {
101
+ "id": "run-tool-negative",
102
+ "command": "taco --json --no-input agent run <app-id> --dsl agent.json --query <不应调用工具的问题> --stream-events",
103
+ "purpose": "验证 Agent 不会在普通问题上滥用工具。",
104
+ "expected_events": [
105
+ "message_end"
106
+ ],
107
+ "expected_tool_call": false
108
+ },
109
+ {
110
+ "id": "publish",
111
+ "command": "taco --json --no-input agent publish <app-id> --dsl agent.json --yes",
112
+ "purpose": "显式确认后发布。",
113
+ "approval_required": true
114
+ }
115
+ ]
116
+ }
@@ -0,0 +1,277 @@
1
+ {
2
+ "id": "agent-workflow-tool",
3
+ "title": "创建 Workflow Tool 并挂载到 Agent",
4
+ "description": "在专用测试 workspace 中创建、校验、调试并发布 HTTP Workflow,再发布为 Tool,发现真实 Tool 身份后挂载到 Agent 进行正反向调试和发布。",
5
+ "requirements": [
6
+ "Zenava 或 TACO 中已配置包含 endpoint 与 AccessKey 的 profile;profile list 展示两个来源及其 current 状态,但不验证在线认证",
7
+ "TACO 当前不暴露 workspace identity;执行者必须通过 UI/组织流程独立确认当前是专用测试 workspace,不能仅凭 profile list",
8
+ "Workflow HTTP 节点只能指向专用非生产 mock/test endpoint,禁止生产客户接口;即使 HTTP 方法为 GET 也按外部调用处理",
9
+ "持有已有 Agent DSL,或具备从专用测试 Agent 拉取 DSL 的条件",
10
+ "执行者必须通过 UI/组织流程独立确认当前账号具备 admin/owner 发布 Workflow Tool 的权限"
11
+ ],
12
+ "invariants": [
13
+ "Workflow 必须先 publish,之后才能执行 workflow tool publish;后者不会自动发布 Workflow。",
14
+ "Workflow Tool 参数由 Workflow DSL 的 inputs(Dify Start 输入)派生,不得手写参数定义。",
15
+ "Agent 工具项的 provider_id 必须使用 workflow_tool_id,不能使用 workflow_app_id。",
16
+ "Workflow secret 只能通过 --from-env 读取,真实值不得进入命令参数、DSL、stdout、stderr 或报告。",
17
+ "workflow run 及挂载 Workflow Tool 后的 Agent run 可能触发外部 HTTP;只允许已确认的非生产 endpoint,并须逐次取得用户批准。"
18
+ ],
19
+ "risks": [
20
+ {
21
+ "operation": "workspace/admin preflight",
22
+ "level": "external-precondition",
23
+ "confirmation": "UI/组织流程",
24
+ "note": "TACO 当前不暴露 workspace identity,profile list 也不返回 workspace 或权限;必须在 UI/组织流程独立确认专用测试 workspace 和 admin/owner 权限。"
25
+ },
26
+ {
27
+ "operation": "workflow create",
28
+ "level": "write",
29
+ "confirmation": "--yes",
30
+ "note": "会在远端创建 Workflow 应用,并在本地写入 DSL。"
31
+ },
32
+ {
33
+ "operation": "workflow apply",
34
+ "level": "write",
35
+ "confirmation": "--yes",
36
+ "note": "--dry-run 只生成计划;真正同步远端 draft 必须单独执行并显式确认 --yes。"
37
+ },
38
+ {
39
+ "operation": "workflow run",
40
+ "level": "external-side-effect",
41
+ "confirmation": "用户批准(CLI 无 --yes)",
42
+ "note": "调试会真实触发 Workflow 的外部 HTTP 调用;即使方法为 GET 也可能产生副作用,只能使用已确认的专用非生产 mock/test endpoint。"
43
+ },
44
+ {
45
+ "operation": "workflow secret set",
46
+ "level": "secret-write",
47
+ "confirmation": "--yes",
48
+ "note": "仅允许使用 --from-env;真实 secret 不得出现在命令参数、DSL、日志或报告中。"
49
+ },
50
+ {
51
+ "operation": "workflow publish",
52
+ "level": "write",
53
+ "confirmation": "--yes",
54
+ "note": "会发布当前远端 draft;必须在 validate、dry-run、apply 和 run 均通过后执行。"
55
+ },
56
+ {
57
+ "operation": "workflow tool publish",
58
+ "level": "workspace-write",
59
+ "confirmation": "--yes",
60
+ "note": "需要 admin/owner 权限;只能在 Workflow 已发布后注册 Tool,命令不会自动发布 Workflow。"
61
+ },
62
+ {
63
+ "operation": "workflow tool update",
64
+ "level": "workspace-write",
65
+ "confirmation": "--yes",
66
+ "note": "会更新 workspace 中已存在的 Workflow Tool;仅在元数据或 Start 输入变化时执行。"
67
+ },
68
+ {
69
+ "operation": "agent tool add",
70
+ "level": "local-write",
71
+ "confirmation": "--yes",
72
+ "note": "会修改本地 Agent DSL;必须让命令动态解析 Workflow Tool,禁止手写 agent_mode.tools。"
73
+ },
74
+ {
75
+ "operation": "agent run with workflow tool",
76
+ "level": "external-side-effect",
77
+ "confirmation": "用户批准(CLI 无 --yes)",
78
+ "note": "挂载 Workflow Tool 后的 Agent 调试可能真实触发外部 HTTP;正向或负向问题都必须使用非生产 endpoint 并逐次批准,即使下游方法为 GET。"
79
+ },
80
+ {
81
+ "operation": "agent publish",
82
+ "level": "write",
83
+ "confirmation": "--yes",
84
+ "note": "会覆盖远端 Agent 有效配置;场景使用 --keep-dsl 保留本地验收文件。"
85
+ }
86
+ ],
87
+ "steps": [
88
+ {
89
+ "id": "auth-status",
90
+ "command": "taco --json --no-input profile list",
91
+ "purpose": "展示业务命令最终采用的 profile、来源、endpoint、脱敏凭证和 access token 缓存状态;不验证在线认证或权限。"
92
+ },
93
+ {
94
+ "id": "read-workflow-schema",
95
+ "command": "taco --json --no-input agent schema show workflow -o json",
96
+ "purpose": "动态读取当前版本 Workflow DSL 契约。"
97
+ },
98
+ {
99
+ "id": "read-workflow-example",
100
+ "command": "taco --json --no-input agent example describe workflow-http -o json",
101
+ "purpose": "读取无真实 ID 和密钥的 HTTP Workflow DSL 示例。"
102
+ },
103
+ {
104
+ "id": "read-agent-schema",
105
+ "command": "taco --json --no-input agent schema show agent -o json",
106
+ "purpose": "动态读取当前版本 Agent DSL 契约。"
107
+ },
108
+ {
109
+ "id": "read-agent-tool-schema",
110
+ "command": "taco --json --no-input agent schema show agent-tool -o json",
111
+ "purpose": "确认 Workflow Tool 的 provider_id 必须是 workflow_tool_id。"
112
+ },
113
+ {
114
+ "id": "read-agent-example",
115
+ "command": "taco --json --no-input agent example describe agent-workflow-tool -o json",
116
+ "purpose": "读取 schema 合法的 Workflow Tool Agent 示例;示例中的发现占位符不能直接发布。"
117
+ },
118
+ {
119
+ "id": "workflow-create",
120
+ "command": "taco --json --no-input agent workflow create --name <workflow-name> --description <workflow-description> --output workflow.yaml --yes",
121
+ "purpose": "在专用测试 workspace 创建 Workflow 并生成本地 DSL。",
122
+ "approval_required": true,
123
+ "captures": {
124
+ "workflow_app_id": "data.app_id",
125
+ "workflow_dsl_path": "data.path"
126
+ }
127
+ },
128
+ {
129
+ "id": "edit-workflow-dsl",
130
+ "action": "edit_file",
131
+ "path": "workflow.yaml",
132
+ "purpose": "由人工或 Agent 严格按已发现 schema 编辑;inputs 将编译为 Start 输入并派生 Tool 参数,secret 只写 selector 引用。",
133
+ "instructions": [
134
+ "以 workflow-http 示例为起点,只使用 schema 支持的 HTTP 节点。",
135
+ "按 inputs 创建 workflow-inputs.json 测试数据,不得包含真实 secret。",
136
+ "真实 secret 只保存在后续 --from-env 指定的环境变量中。"
137
+ ],
138
+ "approval_required": true
139
+ },
140
+ {
141
+ "id": "workflow-validate",
142
+ "command": "taco --json --no-input agent workflow validate -f workflow.yaml",
143
+ "purpose": "仅在本地校验并编译 DSL,不产生远端写入。"
144
+ },
145
+ {
146
+ "id": "workflow-apply-dry-run",
147
+ "command": "taco --json --no-input agent workflow apply <workflow-app-id> -f workflow.yaml --dry-run",
148
+ "purpose": "读取远端 draft 并检查变更计划;不得把 dry-run 当作已同步。"
149
+ },
150
+ {
151
+ "id": "workflow-apply",
152
+ "command": "taco --json --no-input agent workflow apply <workflow-app-id> -f workflow.yaml --yes",
153
+ "purpose": "在单独批准后同步远端 draft。",
154
+ "approval_required": true
155
+ },
156
+ {
157
+ "id": "workflow-secret-set",
158
+ "command": "taco --json --no-input agent workflow secret set <workflow-app-id> <secret-selector> --from-env TACO_WORKFLOW_SECRET --yes",
159
+ "purpose": "仅在 DSL 引用了尚未配置的 secret 时,从安全环境变量写入远端。",
160
+ "when": "workflow.secret.required == true && workflow.secret.configured == false",
161
+ "approval_required": true
162
+ },
163
+ {
164
+ "id": "workflow-run",
165
+ "command": "taco --json --no-input agent workflow run <workflow-app-id> --inputs-file workflow-inputs.json --stream-events",
166
+ "purpose": "在确认专用非生产 endpoint 并取得用户批准后调试 draft;该操作会真实触发外部 HTTP,最终成功 envelope 才包含 outputs。",
167
+ "when": "external_http.approved == true && external_http.endpoint_verified_non_production == true",
168
+ "approval_required": true,
169
+ "expected_events": [
170
+ "workflow_started",
171
+ "node_started",
172
+ "node_finished",
173
+ "workflow_finished"
174
+ ],
175
+ "expected_outputs": [
176
+ "customer",
177
+ "status"
178
+ ]
179
+ },
180
+ {
181
+ "id": "workflow-publish",
182
+ "command": "taco --json --no-input agent workflow publish <workflow-app-id> --title <version-title> --notes <release-notes> --yes",
183
+ "purpose": "发布已完成本地校验、同步和真实调试的 Workflow draft。",
184
+ "approval_required": true
185
+ },
186
+ {
187
+ "id": "workflow-tool-publish",
188
+ "command": "taco --json --no-input agent workflow tool publish <workflow-app-id> -f workflow.yaml --name <workflow-tool-name> --yes",
189
+ "purpose": "在 Workflow 已发布后,将 DSL inputs(Start 输入)派生为 Tool 参数并注册到 workspace。",
190
+ "requires": [
191
+ "workflow-publish"
192
+ ],
193
+ "approval_required": true
194
+ },
195
+ {
196
+ "id": "workflow-tool-get",
197
+ "command": "taco --json --no-input agent workflow tool get --app-id <workflow-app-id>",
198
+ "purpose": "按 Workflow app ID 获取服务端真实 workflow_tool_id 和机器名,禁止猜测。",
199
+ "captures": {
200
+ "workflow_tool_id": "data.workflow_tool_id",
201
+ "workflow_tool_name": "data.name"
202
+ }
203
+ },
204
+ {
205
+ "id": "workflow-tool-update",
206
+ "command": "taco --json --no-input agent workflow tool update <workflow-tool-id> -f workflow.yaml --name <workflow-tool-name> --yes",
207
+ "purpose": "仅在 Tool 元数据或由 Start 输入派生的参数发生变化时,使用已发现 ID 更新。",
208
+ "when": "workflow_tool.metadata_or_start_inputs_changed == true",
209
+ "requires": [
210
+ "workflow-tool-get"
211
+ ],
212
+ "approval_required": true
213
+ },
214
+ {
215
+ "id": "agent-pull",
216
+ "command": "taco --json --no-input agent pull <agent-app-id> --output agent.json",
217
+ "purpose": "仅在没有本地 Agent DSL 时,从专用测试 Agent 拉取配置。",
218
+ "when": "agent.dsl.exists == false",
219
+ "approval_required": true
220
+ },
221
+ {
222
+ "id": "use-existing-agent-dsl",
223
+ "action": "use_file",
224
+ "path": "agent.json",
225
+ "purpose": "已有 DSL 时直接使用,且不得用示例占位符覆盖真实模型配置。",
226
+ "when": "agent.dsl.exists == true"
227
+ },
228
+ {
229
+ "id": "agent-tool-add",
230
+ "command": "taco --json --no-input agent tool add --type workflow --dsl agent.json --provider <workflow-tool-id> --tool <workflow-tool-name> --yes",
231
+ "purpose": "动态解析并挂载 Workflow Tool;provider 会写入 workflow_tool_id,LLM 参数从 Start 输入解析为空字符串占位。",
232
+ "requires": [
233
+ "workflow-tool-get"
234
+ ],
235
+ "approval_required": true
236
+ },
237
+ {
238
+ "id": "agent-tool-list",
239
+ "command": "taco --json --no-input agent tool list --dsl agent.json",
240
+ "purpose": "确认挂载项 provider_type 为 workflow、provider_id 为真实 workflow_tool_id。"
241
+ },
242
+ {
243
+ "id": "agent-validate",
244
+ "command": "taco --json --no-input agent validate --dsl agent.json",
245
+ "purpose": "调试前校验完整 Agent DSL。"
246
+ },
247
+ {
248
+ "id": "agent-run-tool-positive",
249
+ "command": "taco --json --no-input agent run <agent-app-id> --dsl agent.json --query <应调用-workflow-tool-的问题> --stream-events",
250
+ "purpose": "在确认非生产 endpoint 并取得用户批准后,验证满足提示词条件时真实调用 Workflow Tool;该操作可能触发外部 HTTP。",
251
+ "when": "external_http.approved == true && external_http.endpoint_verified_non_production == true",
252
+ "approval_required": true,
253
+ "expected_events": [
254
+ "agent_thought",
255
+ "message_end"
256
+ ],
257
+ "expected_tool_call": true
258
+ },
259
+ {
260
+ "id": "agent-run-tool-negative",
261
+ "command": "taco --json --no-input agent run <agent-app-id> --dsl agent.json --query <不应调用-workflow-tool-的问题> --stream-events",
262
+ "purpose": "在确认非生产 endpoint 并取得用户批准后验证负向问题;模型仍可能意外调用工具并触发外部 HTTP,因此同样受门禁保护。",
263
+ "when": "external_http.approved == true && external_http.endpoint_verified_non_production == true",
264
+ "approval_required": true,
265
+ "expected_events": [
266
+ "message_end"
267
+ ],
268
+ "expected_tool_call": false
269
+ },
270
+ {
271
+ "id": "agent-publish",
272
+ "command": "taco --json --no-input agent publish <agent-app-id> --dsl agent.json --keep-dsl --yes",
273
+ "purpose": "仅在正向和负向调试均通过后,显式批准并发布 Agent。",
274
+ "approval_required": true
275
+ }
276
+ ]
277
+ }
@@ -0,0 +1,3 @@
1
+ # TACO Schemas
2
+
3
+ CLI 可发现的 DSL schema 资源位于此目录。
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://taco.local/schemas/agent-tool.json",
4
+ "title": "TACO Agent Tool Entry",
5
+ "description": "Agent DSL 中的 builtin 或 Workflow Tool 挂载项。",
6
+ "x-taco": {
7
+ "example": "agent-builtin-tool",
8
+ "commands": [
9
+ "tool provider list",
10
+ "tool list",
11
+ "tool describe",
12
+ "workflow tool get",
13
+ "workflow tool publish",
14
+ "workflow tool update",
15
+ "agent tool add",
16
+ "agent tool remove"
17
+ ],
18
+ "risks": [
19
+ "agent tool add/remove 会修改本地 DSL,必须显式确认。",
20
+ "Provider 凭据和 secret-input 不得写入 tool_parameters。",
21
+ "Workflow Tool 挂载必须使用 workflow_tool_id,不能使用 workflow_app_id。",
22
+ "workflow tool publish/update 不会自动发布 Workflow。"
23
+ ]
24
+ },
25
+ "type": "object",
26
+ "required": [
27
+ "provider_type",
28
+ "provider_id",
29
+ "provider_name",
30
+ "tool_name",
31
+ "tool_label",
32
+ "tool_parameters",
33
+ "enabled"
34
+ ],
35
+ "properties": {
36
+ "provider_type": {
37
+ "enum": [
38
+ "builtin",
39
+ "workflow"
40
+ ]
41
+ },
42
+ "provider_id": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "provider_name": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "tool_name": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ },
54
+ "tool_label": {
55
+ "type": "string",
56
+ "minLength": 1
57
+ },
58
+ "tool_parameters": {
59
+ "type": "object",
60
+ "description": "builtin 保存安全 form 参数;workflow 同时包含空字符串 LLM 参数和安全 form 参数,不得保存 Provider 凭据。"
61
+ },
62
+ "enabled": {
63
+ "type": "boolean"
64
+ },
65
+ "plugin_unique_identifier": {
66
+ "type": "string",
67
+ "minLength": 1
68
+ }
69
+ },
70
+ "additionalProperties": true
71
+ }