tinet-agent-cli 0.1.1.dev40__py3-none-any.whl → 0.2.0.dev45__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 (74) hide show
  1. taco/__init__.py +5 -1
  2. taco/assets/__init__.py +1 -1
  3. taco/assets/manifest.json +1 -3
  4. taco/assets/schemas/README.md +5 -1
  5. taco/assets/schemas/draft.agent.json +342 -0
  6. taco/assets/schemas/draft.chat.json +292 -0
  7. taco/assets/schemas/draft.chatflow.json +25 -0
  8. taco/assets/schemas/draft.graph-defs.json +442 -0
  9. taco/assets/schemas/draft.workflow.json +25 -0
  10. taco/cli.py +202 -69
  11. taco/commands/agent.py +15 -802
  12. taco/commands/aikb.py +63 -32
  13. taco/commands/app.py +156 -30
  14. taco/commands/app_draft.py +487 -0
  15. taco/commands/app_secret.py +194 -0
  16. taco/commands/app_version.py +119 -0
  17. taco/commands/category.py +30 -20
  18. taco/commands/data.py +224 -0
  19. taco/commands/dataset.py +210 -0
  20. taco/commands/draft_discovery.py +70 -0
  21. taco/commands/model.py +35 -11
  22. taco/commands/platform_credential.py +401 -0
  23. taco/commands/platform_tool.py +291 -0
  24. taco/commands/profile.py +56 -22
  25. taco/core/api_client.py +197 -14
  26. taco/core/assets.py +35 -21
  27. taco/core/context.py +0 -2
  28. taco/core/diagnostic_logging.py +336 -0
  29. taco/core/errors.py +8 -3
  30. taco/core/help_rendering.py +15 -0
  31. taco/core/help_text.py +77 -0
  32. taco/core/json_document.py +99 -0
  33. taco/core/json_input.py +73 -0
  34. taco/core/output.py +36 -24
  35. taco/core/redaction.py +54 -0
  36. taco/release.py +5 -13
  37. taco/services/agent_service.py +67 -44
  38. taco/services/app_service.py +371 -16
  39. taco/services/app_types.py +70 -0
  40. taco/services/category_service.py +89 -24
  41. taco/services/dataset_service.py +297 -0
  42. taco/services/draft_service.py +1221 -0
  43. taco/services/draft_validation_service.py +869 -0
  44. taco/services/model_service.py +111 -46
  45. taco/services/tool_service.py +504 -1
  46. taco/services/version_service.py +434 -0
  47. taco/services/workflow_tool_service.py +224 -0
  48. tinet_agent_cli-0.2.0.dev45.dist-info/METADATA +173 -0
  49. {tinet_agent_cli-0.1.1.dev40.dist-info → tinet_agent_cli-0.2.0.dev45.dist-info}/RECORD +51 -49
  50. {tinet_agent_cli-0.1.1.dev40.dist-info → tinet_agent_cli-0.2.0.dev45.dist-info}/WHEEL +1 -1
  51. taco/assets/examples/README.md +0 -3
  52. taco/assets/examples/agent-basic.json +0 -16
  53. taco/assets/examples/agent-builtin-tool.json +0 -28
  54. taco/assets/examples/agent-workflow-tool.json +0 -30
  55. taco/assets/examples/chatflow-basic.json +0 -24
  56. taco/assets/examples/workflow-http.json +0 -34
  57. taco/assets/scenarios/README.md +0 -3
  58. taco/assets/scenarios/agent-basic.json +0 -80
  59. taco/assets/scenarios/agent-builtin-tool.json +0 -116
  60. taco/assets/scenarios/agent-workflow-tool.json +0 -277
  61. taco/assets/schemas/agent-tool.json +0 -71
  62. taco/assets/schemas/agent.json +0 -199
  63. taco/assets/schemas/chatflow.json +0 -1048
  64. taco/assets/schemas/workflow.http.json +0 -1052
  65. taco/assets/schemas/workflow.json +0 -1052
  66. taco/commands/chatflow.py +0 -183
  67. taco/commands/credential.py +0 -222
  68. taco/commands/discovery.py +0 -211
  69. taco/commands/tool.py +0 -61
  70. taco/commands/workflow.py +0 -714
  71. taco/services/workflow_compiler.py +0 -1665
  72. taco/services/workflow_service.py +0 -652
  73. tinet_agent_cli-0.1.1.dev40.dist-info/METADATA +0 -170
  74. {tinet_agent_cli-0.1.1.dev40.dist-info → tinet_agent_cli-0.2.0.dev45.dist-info}/entry_points.txt +0 -0
taco/__init__.py CHANGED
@@ -1 +1,5 @@
1
- __version__ = "0.1.1.dev40"
1
+ from taco.core.help_rendering import disable_help_colors as _disable_help_colors
2
+
3
+ __version__ = "0.2.0.dev45"
4
+
5
+ _disable_help_colors()
taco/assets/__init__.py CHANGED
@@ -1 +1 @@
1
- """Packaged schemas, scenarios, examples, and API catalogs."""
1
+ """Packaged schemas and API catalogs."""
taco/assets/manifest.json CHANGED
@@ -1,10 +1,8 @@
1
1
  {
2
2
  "format_version": 1,
3
- "cli_version": "0.1.1.dev40",
3
+ "cli_version": "0.2.0.dev45",
4
4
  "resource_groups": [
5
5
  "schemas",
6
- "scenarios",
7
- "examples",
8
6
  "aikb",
9
7
  "agent_openapi"
10
8
  ]
@@ -1,3 +1,7 @@
1
1
  # TACO Schemas
2
2
 
3
- CLI 可发现的 DSL schema 资源位于此目录。
3
+ CLI 可发现的远端 Draft Schema 位于此目录。
4
+
5
+ - `draft.agent.json` / `draft.chat.json` / `draft.chatflow.json` / `draft.workflow.json` 是公开 Schema。
6
+ - `draft.graph-defs.json` 是 chatflow/workflow 共用的 graph 节点定义,由 `schema get` 内联进完整 Schema。
7
+ - 未知节点类型与未知字段默认放行;已知节点补齐旧版 P0 范围(开始、结束/回答、HTTP、大模型、知识检索、代码、分支、迭代、模板转换、变量聚合、工具)以及随路变量绑定。
@@ -0,0 +1,342 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tinet.local/schemas/taco/draft.agent.json",
4
+ "title": "TACO Agent Draft",
5
+ "x-taco": {
6
+ "app_type": "agent",
7
+ "schema_version": "0.2.0",
8
+ "cli_version": "0.2.0"
9
+ },
10
+ "type": "object",
11
+ "required": [
12
+ "model",
13
+ "agent_mode"
14
+ ],
15
+ "properties": {
16
+ "model": {
17
+ "type": "object",
18
+ "required": [
19
+ "provider",
20
+ "name",
21
+ "mode",
22
+ "completion_params"
23
+ ],
24
+ "properties": {
25
+ "provider": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "name": {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "mode": {
34
+ "enum": [
35
+ "chat",
36
+ "completion"
37
+ ]
38
+ },
39
+ "completion_params": {
40
+ "type": "object"
41
+ }
42
+ },
43
+ "additionalProperties": true
44
+ },
45
+ "agent_mode": {
46
+ "type": "object",
47
+ "required": [
48
+ "enabled",
49
+ "tools"
50
+ ],
51
+ "properties": {
52
+ "enabled": {
53
+ "type": "boolean"
54
+ },
55
+ "strategy": {
56
+ "enum": [
57
+ null,
58
+ "router",
59
+ "react_router",
60
+ "react",
61
+ "function_call"
62
+ ]
63
+ },
64
+ "max_iteration": {
65
+ "type": "integer",
66
+ "minimum": 1
67
+ },
68
+ "tools": {
69
+ "type": "array",
70
+ "items": {
71
+ "$ref": "#/$defs/agentTool"
72
+ }
73
+ },
74
+ "prompt": {
75
+ "type": [
76
+ "object",
77
+ "null"
78
+ ]
79
+ }
80
+ },
81
+ "allOf": [
82
+ {
83
+ "if": {
84
+ "required": [
85
+ "enabled"
86
+ ],
87
+ "properties": {
88
+ "enabled": {
89
+ "const": true
90
+ }
91
+ }
92
+ },
93
+ "then": {
94
+ "required": [
95
+ "strategy"
96
+ ],
97
+ "properties": {
98
+ "strategy": {
99
+ "enum": [
100
+ "router",
101
+ "react_router",
102
+ "react",
103
+ "function_call"
104
+ ]
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ],
110
+ "additionalProperties": true
111
+ },
112
+ "pre_prompt": {
113
+ "type": [
114
+ "string",
115
+ "null"
116
+ ]
117
+ },
118
+ "opening_statement": {
119
+ "type": [
120
+ "string",
121
+ "null"
122
+ ]
123
+ },
124
+ "suggested_questions": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "string"
128
+ }
129
+ },
130
+ "user_input_form": {
131
+ "type": "array",
132
+ "items": {
133
+ "$ref": "#/$defs/userInputFormItem"
134
+ }
135
+ },
136
+ "dataset_configs": {
137
+ "type": [
138
+ "object",
139
+ "null"
140
+ ],
141
+ "properties": {
142
+ "retrieval_model": {
143
+ "enum": [
144
+ "single",
145
+ "multiple"
146
+ ]
147
+ },
148
+ "datasets": {
149
+ "type": "object",
150
+ "additionalProperties": true
151
+ },
152
+ "t_retrieval_config": {
153
+ "$ref": "#/$defs/tinetRetrievalConfigs"
154
+ },
155
+ "t_retrieval_tools": {
156
+ "$ref": "#/$defs/tinetRetrievalTools"
157
+ }
158
+ },
159
+ "additionalProperties": true
160
+ }
161
+ },
162
+ "additionalProperties": true,
163
+ "$defs": {
164
+ "selector": {
165
+ "type": "array",
166
+ "minItems": 2,
167
+ "items": {
168
+ "type": "string",
169
+ "minLength": 1
170
+ }
171
+ },
172
+ "parameterBinding": {
173
+ "type": "object",
174
+ "required": [
175
+ "type",
176
+ "value"
177
+ ],
178
+ "properties": {
179
+ "type": {
180
+ "enum": [
181
+ "variable",
182
+ "constant",
183
+ "mixed"
184
+ ]
185
+ },
186
+ "value": true
187
+ },
188
+ "allOf": [
189
+ {
190
+ "if": {
191
+ "required": [
192
+ "type"
193
+ ],
194
+ "properties": {
195
+ "type": {
196
+ "const": "variable"
197
+ }
198
+ }
199
+ },
200
+ "then": {
201
+ "properties": {
202
+ "value": {
203
+ "$ref": "#/$defs/selector"
204
+ }
205
+ }
206
+ }
207
+ }
208
+ ],
209
+ "additionalProperties": true
210
+ },
211
+ "toolParameterValue": {
212
+ "if": {
213
+ "type": "object",
214
+ "required": ["type"],
215
+ "properties": {
216
+ "type": {
217
+ "enum": [
218
+ "variable",
219
+ "constant",
220
+ "mixed"
221
+ ]
222
+ }
223
+ }
224
+ },
225
+ "then": {
226
+ "$ref": "#/$defs/parameterBinding"
227
+ },
228
+ "else": {
229
+ "type": [
230
+ "string",
231
+ "number",
232
+ "boolean",
233
+ "array",
234
+ "object",
235
+ "null"
236
+ ]
237
+ }
238
+ },
239
+ "agentTool": {
240
+ "type": "object",
241
+ "properties": {
242
+ "provider_type": {
243
+ "type": "string",
244
+ "minLength": 1
245
+ },
246
+ "provider_id": {
247
+ "type": "string",
248
+ "minLength": 1
249
+ },
250
+ "tool_name": {
251
+ "type": "string",
252
+ "minLength": 1
253
+ },
254
+ "tool_parameters": {
255
+ "type": "object",
256
+ "additionalProperties": {
257
+ "$ref": "#/$defs/toolParameterValue"
258
+ }
259
+ }
260
+ },
261
+ "additionalProperties": true
262
+ },
263
+ "userInputFormItem": {
264
+ "type": "object",
265
+ "minProperties": 1,
266
+ "additionalProperties": {
267
+ "type": "object",
268
+ "required": [
269
+ "variable"
270
+ ],
271
+ "properties": {
272
+ "variable": {
273
+ "type": "string",
274
+ "minLength": 1
275
+ },
276
+ "label": {
277
+ "type": "string"
278
+ },
279
+ "required": {
280
+ "type": "boolean"
281
+ },
282
+ "max_length": {
283
+ "type": "integer",
284
+ "minimum": 1
285
+ },
286
+ "options": {
287
+ "type": "array"
288
+ },
289
+ "default": true
290
+ },
291
+ "additionalProperties": true
292
+ }
293
+ },
294
+ "tinetAikbSelectItem": {
295
+ "type": "object",
296
+ "properties": {
297
+ "id": { "type": "integer" },
298
+ "name": { "type": "string" },
299
+ "type": { "enum": ["repository", "directory"] },
300
+ "knowledgeType": { "enum": ["customer", "industry"] },
301
+ "selectAll": { "type": "boolean" }
302
+ },
303
+ "additionalProperties": true
304
+ },
305
+ "tinetRetrievalConfig": {
306
+ "type": "object",
307
+ "properties": {
308
+ "select_list": {
309
+ "type": "array",
310
+ "items": { "$ref": "#/$defs/tinetAikbSelectItem" }
311
+ }
312
+ },
313
+ "additionalProperties": true
314
+ },
315
+ "tinetRetrievalConfigs": {
316
+ "type": "object",
317
+ "additionalProperties": { "$ref": "#/$defs/tinetRetrievalConfig" }
318
+ },
319
+ "tinetRetrievalTools": {
320
+ "type": "object",
321
+ "properties": {
322
+ "tools": {
323
+ "type": "array",
324
+ "items": {
325
+ "type": "object",
326
+ "required": ["dataset_id"],
327
+ "properties": {
328
+ "dataset_id": { "type": "string", "minLength": 1 },
329
+ "enabled": { "type": "boolean" },
330
+ "name": { "type": "string" },
331
+ "label": { "type": "string" },
332
+ "description": { "type": "string" },
333
+ "retrieval_config": { "$ref": "#/$defs/tinetRetrievalConfig" }
334
+ },
335
+ "additionalProperties": true
336
+ }
337
+ }
338
+ },
339
+ "additionalProperties": true
340
+ }
341
+ }
342
+ }
@@ -0,0 +1,292 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tinet.local/schemas/taco/draft.chat.json",
4
+ "title": "TACO Chat Draft",
5
+ "x-taco": {
6
+ "app_type": "chat",
7
+ "schema_version": "0.2.0",
8
+ "cli_version": "0.2.0"
9
+ },
10
+ "type": "object",
11
+ "required": [
12
+ "model"
13
+ ],
14
+ "properties": {
15
+ "model": {
16
+ "type": "object",
17
+ "required": [
18
+ "provider",
19
+ "name",
20
+ "mode",
21
+ "completion_params"
22
+ ],
23
+ "properties": {
24
+ "provider": {
25
+ "type": "string",
26
+ "minLength": 1
27
+ },
28
+ "name": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "mode": {
33
+ "enum": [
34
+ "chat",
35
+ "completion"
36
+ ]
37
+ },
38
+ "completion_params": {
39
+ "type": "object"
40
+ }
41
+ },
42
+ "additionalProperties": true
43
+ },
44
+ "pre_prompt": {
45
+ "type": [
46
+ "string",
47
+ "null"
48
+ ]
49
+ },
50
+ "prompt_type": {
51
+ "type": "string"
52
+ },
53
+ "chat_prompt_config": {
54
+ "type": [
55
+ "object",
56
+ "null"
57
+ ]
58
+ },
59
+ "completion_prompt_config": {
60
+ "type": [
61
+ "object",
62
+ "null"
63
+ ]
64
+ },
65
+ "opening_statement": {
66
+ "type": [
67
+ "string",
68
+ "null"
69
+ ]
70
+ },
71
+ "suggested_questions": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string"
75
+ }
76
+ },
77
+ "user_input_form": {
78
+ "type": "array",
79
+ "items": {
80
+ "$ref": "#/$defs/userInputFormItem"
81
+ }
82
+ },
83
+ "dataset_configs": {
84
+ "type": [
85
+ "object",
86
+ "null"
87
+ ],
88
+ "properties": {
89
+ "retrieval_model": {
90
+ "enum": ["single", "multiple"]
91
+ },
92
+ "datasets": {
93
+ "type": "object",
94
+ "additionalProperties": true
95
+ },
96
+ "t_retrieval_config": {
97
+ "$ref": "#/$defs/tinetRetrievalConfigs"
98
+ },
99
+ "t_retrieval_tools": {
100
+ "$ref": "#/$defs/tinetRetrievalTools"
101
+ }
102
+ },
103
+ "additionalProperties": true
104
+ },
105
+ "tools": {
106
+ "type": "array",
107
+ "items": {
108
+ "$ref": "#/$defs/agentTool"
109
+ }
110
+ }
111
+ },
112
+ "additionalProperties": true,
113
+ "$defs": {
114
+ "selector": {
115
+ "type": "array",
116
+ "minItems": 2,
117
+ "items": {
118
+ "type": "string",
119
+ "minLength": 1
120
+ }
121
+ },
122
+ "parameterBinding": {
123
+ "type": "object",
124
+ "required": [
125
+ "type",
126
+ "value"
127
+ ],
128
+ "properties": {
129
+ "type": {
130
+ "enum": [
131
+ "variable",
132
+ "constant",
133
+ "mixed"
134
+ ]
135
+ },
136
+ "value": true
137
+ },
138
+ "allOf": [
139
+ {
140
+ "if": {
141
+ "required": [
142
+ "type"
143
+ ],
144
+ "properties": {
145
+ "type": {
146
+ "const": "variable"
147
+ }
148
+ }
149
+ },
150
+ "then": {
151
+ "properties": {
152
+ "value": {
153
+ "$ref": "#/$defs/selector"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ ],
159
+ "additionalProperties": true
160
+ },
161
+ "toolParameterValue": {
162
+ "if": {
163
+ "type": "object",
164
+ "required": ["type"],
165
+ "properties": {
166
+ "type": {
167
+ "enum": [
168
+ "variable",
169
+ "constant",
170
+ "mixed"
171
+ ]
172
+ }
173
+ }
174
+ },
175
+ "then": {
176
+ "$ref": "#/$defs/parameterBinding"
177
+ },
178
+ "else": {
179
+ "type": [
180
+ "string",
181
+ "number",
182
+ "boolean",
183
+ "array",
184
+ "object",
185
+ "null"
186
+ ]
187
+ }
188
+ },
189
+ "agentTool": {
190
+ "type": "object",
191
+ "properties": {
192
+ "provider_type": {
193
+ "type": "string",
194
+ "minLength": 1
195
+ },
196
+ "provider_id": {
197
+ "type": "string",
198
+ "minLength": 1
199
+ },
200
+ "tool_name": {
201
+ "type": "string",
202
+ "minLength": 1
203
+ },
204
+ "tool_parameters": {
205
+ "type": "object",
206
+ "additionalProperties": {
207
+ "$ref": "#/$defs/toolParameterValue"
208
+ }
209
+ }
210
+ },
211
+ "additionalProperties": true
212
+ },
213
+ "userInputFormItem": {
214
+ "type": "object",
215
+ "minProperties": 1,
216
+ "additionalProperties": {
217
+ "type": "object",
218
+ "required": [
219
+ "variable"
220
+ ],
221
+ "properties": {
222
+ "variable": {
223
+ "type": "string",
224
+ "minLength": 1
225
+ },
226
+ "label": {
227
+ "type": "string"
228
+ },
229
+ "required": {
230
+ "type": "boolean"
231
+ },
232
+ "max_length": {
233
+ "type": "integer",
234
+ "minimum": 1
235
+ },
236
+ "options": {
237
+ "type": "array"
238
+ },
239
+ "default": true
240
+ },
241
+ "additionalProperties": true
242
+ }
243
+ },
244
+ "tinetAikbSelectItem": {
245
+ "type": "object",
246
+ "properties": {
247
+ "id": { "type": "integer" },
248
+ "name": { "type": "string" },
249
+ "type": { "enum": ["repository", "directory"] },
250
+ "knowledgeType": { "enum": ["customer", "industry"] },
251
+ "selectAll": { "type": "boolean" }
252
+ },
253
+ "additionalProperties": true
254
+ },
255
+ "tinetRetrievalConfig": {
256
+ "type": "object",
257
+ "properties": {
258
+ "select_list": {
259
+ "type": "array",
260
+ "items": { "$ref": "#/$defs/tinetAikbSelectItem" }
261
+ }
262
+ },
263
+ "additionalProperties": true
264
+ },
265
+ "tinetRetrievalConfigs": {
266
+ "type": "object",
267
+ "additionalProperties": { "$ref": "#/$defs/tinetRetrievalConfig" }
268
+ },
269
+ "tinetRetrievalTools": {
270
+ "type": "object",
271
+ "properties": {
272
+ "tools": {
273
+ "type": "array",
274
+ "items": {
275
+ "type": "object",
276
+ "required": ["dataset_id"],
277
+ "properties": {
278
+ "dataset_id": { "type": "string", "minLength": 1 },
279
+ "enabled": { "type": "boolean" },
280
+ "name": { "type": "string" },
281
+ "label": { "type": "string" },
282
+ "description": { "type": "string" },
283
+ "retrieval_config": { "$ref": "#/$defs/tinetRetrievalConfig" }
284
+ },
285
+ "additionalProperties": true
286
+ }
287
+ }
288
+ },
289
+ "additionalProperties": true
290
+ }
291
+ }
292
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tinet.local/schemas/taco/draft.chatflow.json",
4
+ "title": "TACO Chatflow Draft",
5
+ "x-taco": {
6
+ "app_type": "chatflow",
7
+ "schema_version": "0.2.0",
8
+ "cli_version": "0.2.0"
9
+ },
10
+ "type": "object",
11
+ "required": ["graph"],
12
+ "properties": {
13
+ "graph": { "$ref": "#/$defs/graph" },
14
+ "features": { "type": "object" },
15
+ "environment_variables": {
16
+ "type": "array",
17
+ "items": { "type": "object", "additionalProperties": true }
18
+ },
19
+ "conversation_variables": {
20
+ "type": "array",
21
+ "items": { "type": "object", "additionalProperties": true }
22
+ }
23
+ },
24
+ "additionalProperties": true
25
+ }