dsh-auto-flow 0.1.0 → 0.1.2

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.
@@ -1,65 +1,255 @@
1
1
  /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
2
  import { z } from 'zod'
3
3
 
4
- const dsh_auto_flow_autoFlow_exec_parameter_0$schema = z.object({
5
- 'command': z.string(),
6
- 'workdir': z.union([z.undefined(), z.string()]).optional(),
7
- 'timeoutMs': z.union([z.undefined(), z.number()]).optional(),
8
- 'stdoutMaxBytes': z.union([z.undefined(), z.number()]).optional(),
9
- 'runInBackground': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
4
+ const FlowDataValueRemoteCodec$schema = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema))])
5
+ const FlowDataValueRemoteCodec$schema2 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema2))])
6
+ const FlowDataValueRemoteCodec$schema3 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema3))])
7
+ const FlowDataValueRemoteCodec$schema4 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema4))])
8
+ const FlowDataValueRemoteCodec$schema5 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema5))])
9
+ const FlowDataValueRemoteCodec$schema6 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema6)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema6))])
10
+ const FlowDataValueRemoteCodec$schema7 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema7))])
11
+ const FlowDataValueRemoteCodec$schema8 = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema8)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema8))])
12
+ const dsh_auto_flow_autoFlow_approveRun_parameter_0$schema = z.string()
13
+ const dsh_auto_flow_autoFlow_approveRun_parameter_1$schema = z.string()
14
+ const dsh_auto_flow_autoFlow_approveRun_result$schema = z.object({
15
+ 'runId': z.string(),
16
+ 'workflowId': z.string(),
17
+ 'name': z.string(),
18
+ 'sessionId': z.union([z.undefined(), z.string()]).optional(),
19
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("completed"), z.literal("failed"), z.literal("cancelled")]),
20
+ 'workspaceDir': z.string(),
21
+ 'steps': z.array(z.object({
22
+ 'nodeId': z.string(),
23
+ 'nodeType': z.string(),
24
+ 'label': z.string(),
25
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("failed"), z.literal("pending"), z.literal("success"), z.literal("skipped")]),
26
+ 'script': z.union([z.undefined(), z.string()]).optional(),
27
+ 'stepDir': z.union([z.undefined(), z.string()]).optional(),
28
+ 'result': z.union([z.undefined(), z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema))])), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema))]).optional(),
29
+ 'error': z.union([z.undefined(), z.string()]).optional(),
30
+ 'errorCode': z.union([z.undefined(), z.string()]).optional(),
31
+ 'durationMs': z.union([z.undefined(), z.number()]).optional(),
32
+ })),
33
+ 'createdAt': z.number(),
34
+ 'updatedAt': z.number(),
10
35
  })
11
- const dsh_auto_flow_autoFlow_exec_result$schema = z.union([z.object({
12
- 'kind': z.literal("foreground"),
13
- 'exitCode': z.union([z.literal(null), z.number()]),
14
- 'signal': z.union([z.literal(null), z.string()]),
15
- 'timedOut': z.boolean(),
16
- 'aborted': z.boolean(),
17
- 'timeoutMs': z.number(),
18
- 'stdout': z.object({
19
- 'text': z.string(),
20
- 'truncated': z.boolean(),
21
- 'spillPath': z.union([z.undefined(), z.string()]).optional(),
22
- }),
23
- 'stderr': z.object({
24
- 'text': z.string(),
25
- 'truncated': z.boolean(),
26
- 'spillPath': z.union([z.undefined(), z.string()]).optional(),
27
- }),
28
- 'sandbox': z.union([z.undefined(), z.object({
29
- 'mode': z.string(),
30
- 'denied': z.boolean(),
31
- 'enforcement': z.union([z.undefined(), z.string()]).optional(),
32
- 'runnerFailed': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
36
+ const dsh_auto_flow_autoFlow_cancelRun_parameter_0$schema = z.string()
37
+ const dsh_auto_flow_autoFlow_cancelRun_result$schema = z.object({
38
+ 'runId': z.string(),
39
+ 'workflowId': z.string(),
40
+ 'name': z.string(),
41
+ 'sessionId': z.union([z.undefined(), z.string()]).optional(),
42
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("completed"), z.literal("failed"), z.literal("cancelled")]),
43
+ 'workspaceDir': z.string(),
44
+ 'steps': z.array(z.object({
45
+ 'nodeId': z.string(),
46
+ 'nodeType': z.string(),
47
+ 'label': z.string(),
48
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("failed"), z.literal("pending"), z.literal("success"), z.literal("skipped")]),
49
+ 'script': z.union([z.undefined(), z.string()]).optional(),
50
+ 'stepDir': z.union([z.undefined(), z.string()]).optional(),
51
+ 'result': z.union([z.undefined(), z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema8)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema8))])), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema8))]).optional(),
52
+ 'error': z.union([z.undefined(), z.string()]).optional(),
53
+ 'errorCode': z.union([z.undefined(), z.string()]).optional(),
54
+ 'durationMs': z.union([z.undefined(), z.number()]).optional(),
55
+ })),
56
+ 'createdAt': z.number(),
57
+ 'updatedAt': z.number(),
58
+ })
59
+ const dsh_auto_flow_autoFlow_deleteFlow_parameter_0$schema = z.string()
60
+ const dsh_auto_flow_autoFlow_deleteFlow_result$schema = z.object({
61
+ 'deleted': z.boolean(),
62
+ })
63
+ const dsh_auto_flow_autoFlow_listFlows_result$schema = z.array(z.object({
64
+ 'id': z.string(),
65
+ 'name': z.string(),
66
+ 'description': z.string(),
67
+ 'nodeCount': z.number(),
68
+ 'inputs': z.array(z.string()),
69
+ }))
70
+ const dsh_auto_flow_autoFlow_listLlmRoutes_result$schema = z.object({
71
+ 'routes': z.array(z.object({
72
+ 'provider': z.string(),
73
+ 'displayName': z.string(),
74
+ })),
75
+ })
76
+ const dsh_auto_flow_autoFlow_listRouteModels_parameter_0$schema = z.object({
77
+ 'provider': z.string(),
78
+ })
79
+ const dsh_auto_flow_autoFlow_listRouteModels_result$schema = z.object({
80
+ 'models': z.array(z.object({
81
+ 'id': z.string(),
82
+ 'name': z.string(),
83
+ })),
84
+ 'error': z.union([z.undefined(), z.string()]).optional(),
85
+ })
86
+ const dsh_auto_flow_autoFlow_listRuns_parameter_0$schema = z.object({
87
+ 'sessionId': z.union([z.undefined(), z.string()]).optional(),
88
+ 'workflowId': z.union([z.undefined(), z.string()]).optional(),
89
+ })
90
+ const dsh_auto_flow_autoFlow_listRuns_result$schema = z.array(z.object({
91
+ 'runId': z.string(),
92
+ 'workflowId': z.string(),
93
+ 'name': z.string(),
94
+ 'sessionId': z.union([z.undefined(), z.string()]).optional(),
95
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("completed"), z.literal("failed"), z.literal("cancelled")]),
96
+ 'nodeCount': z.number(),
97
+ 'createdAt': z.number(),
98
+ 'updatedAt': z.number(),
99
+ }))
100
+ const dsh_auto_flow_autoFlow_listScripts_result$schema = z.array(z.object({
101
+ 'name': z.string(),
102
+ 'label': z.string(),
103
+ 'description': z.string(),
104
+ 'params': z.array(z.object({
105
+ 'key': z.string(),
106
+ 'label': z.string(),
107
+ 'type': z.union([z.literal("string"), z.literal("number"), z.literal("boolean"), z.literal("object"), z.literal("select"), z.literal("datetime"), z.literal("array")]),
108
+ 'required': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
109
+ 'defaultValue': z.union([z.undefined(), z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema5))])), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema5))]).optional(),
110
+ 'options': z.union([z.undefined(), z.array(z.object({
111
+ 'label': z.string(),
112
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema5)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema5))]),
113
+ }))]).optional(),
114
+ 'format': z.union([z.undefined(), z.string()]).optional(),
115
+ 'placeholder': z.union([z.undefined(), z.string()]).optional(),
116
+ 'description': z.union([z.undefined(), z.string()]).optional(),
117
+ })),
118
+ 'artifacts': z.union([z.undefined(), z.object({
119
+ 'filesKey': z.union([z.undefined(), z.string()]).optional(),
120
+ 'filesShape': z.union([z.undefined(), z.literal("paths"), z.literal("vidu-imgs")]).optional(),
121
+ 'filesPromptKey': z.union([z.undefined(), z.string()]).optional(),
33
122
  })]).optional(),
34
- }), z.object({
35
- 'kind': z.literal("background"),
36
- 'jobId': z.string(),
123
+ }))
124
+ const dsh_auto_flow_autoFlow_loadFlow_parameter_0$schema = z.string()
125
+ const dsh_auto_flow_autoFlow_loadFlow_result$schema = z.union([z.literal(null), z.object({
126
+ 'formatVersion': z.number(),
127
+ 'name': z.string(),
128
+ 'description': z.string(),
129
+ 'nodes': z.array(z.object({
130
+ 'id': z.string(),
131
+ 'type': z.string(),
132
+ 'position': z.object({
133
+ 'x': z.number(),
134
+ 'y': z.number(),
135
+ }),
136
+ 'data': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema2))])),
137
+ 'style': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema2))]))]).optional(),
138
+ })),
139
+ 'edges': z.array(z.object({
140
+ 'id': z.string(),
141
+ 'source': z.string(),
142
+ 'target': z.string(),
143
+ 'sourceHandle': z.union([z.undefined(), z.string()]).optional(),
144
+ 'targetHandle': z.union([z.undefined(), z.string()]).optional(),
145
+ 'type': z.union([z.undefined(), z.string()]).optional(),
146
+ 'animated': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
147
+ 'data': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema2))]))]).optional(),
148
+ })),
37
149
  })])
38
- const dsh_auto_flow_autoFlow_execKill_parameter_0$schema = z.string()
39
- const dsh_auto_flow_autoFlow_execKill_result$schema = z.object({
40
- 'kind': z.union([z.literal("requested"), z.literal("already-finished")]),
150
+ const dsh_auto_flow_autoFlow_runFlow_parameter_0$schema = z.object({
151
+ 'flow': z.object({
152
+ 'nodes': z.array(z.object({
153
+ 'id': z.string(),
154
+ 'type': z.string(),
155
+ 'position': z.object({
156
+ 'x': z.number(),
157
+ 'y': z.number(),
158
+ }),
159
+ 'data': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema6)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema6))])),
160
+ 'style': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema6)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema6))]))]).optional(),
161
+ })),
162
+ 'edges': z.array(z.object({
163
+ 'id': z.string(),
164
+ 'source': z.string(),
165
+ 'target': z.string(),
166
+ 'sourceHandle': z.union([z.undefined(), z.string()]).optional(),
167
+ 'targetHandle': z.union([z.undefined(), z.string()]).optional(),
168
+ 'type': z.union([z.undefined(), z.string()]).optional(),
169
+ 'animated': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
170
+ 'data': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema6)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema6))]))]).optional(),
171
+ })),
172
+ }),
173
+ 'workflowId': z.union([z.undefined(), z.string()]).optional(),
174
+ 'name': z.union([z.undefined(), z.string()]).optional(),
175
+ 'sessionId': z.union([z.undefined(), z.string()]).optional(),
41
176
  })
42
- const dsh_auto_flow_autoFlow_execRead_parameter_0$schema = z.string()
43
- const dsh_auto_flow_autoFlow_execRead_result$schema = z.object({
44
- 'text': z.string(),
45
- 'status': z.string(),
46
- 'detail': z.union([z.undefined(), z.string()]).optional(),
177
+ const dsh_auto_flow_autoFlow_runFlow_result$schema = z.object({
178
+ 'runId': z.string(),
47
179
  })
48
- const dsh_auto_flow_autoFlow_last_result$schema = z.union([z.literal(null), z.object({
49
- 'id': z.number(),
50
- 'text': z.string(),
180
+ const dsh_auto_flow_autoFlow_runState_parameter_0$schema = z.string()
181
+ const dsh_auto_flow_autoFlow_runState_result$schema = z.union([z.literal(null), z.object({
182
+ 'runId': z.string(),
183
+ 'workflowId': z.string(),
184
+ 'name': z.string(),
185
+ 'sessionId': z.union([z.undefined(), z.string()]).optional(),
186
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("completed"), z.literal("failed"), z.literal("cancelled")]),
187
+ 'workspaceDir': z.string(),
188
+ 'steps': z.array(z.object({
189
+ 'nodeId': z.string(),
190
+ 'nodeType': z.string(),
191
+ 'label': z.string(),
192
+ 'status': z.union([z.literal("running"), z.literal("waiting"), z.literal("failed"), z.literal("pending"), z.literal("success"), z.literal("skipped")]),
193
+ 'script': z.union([z.undefined(), z.string()]).optional(),
194
+ 'stepDir': z.union([z.undefined(), z.string()]).optional(),
195
+ 'result': z.union([z.undefined(), z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema7)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema7))])), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema7))]).optional(),
196
+ 'error': z.union([z.undefined(), z.string()]).optional(),
197
+ 'errorCode': z.union([z.undefined(), z.string()]).optional(),
198
+ 'durationMs': z.union([z.undefined(), z.number()]).optional(),
199
+ })),
51
200
  'createdAt': z.number(),
201
+ 'updatedAt': z.number(),
52
202
  })])
53
- const dsh_auto_flow_autoFlow_list_result$schema = z.array(z.object({
54
- 'id': z.number(),
55
- 'text': z.string(),
56
- 'createdAt': z.number(),
57
- }))
58
- const dsh_auto_flow_autoFlow_send_parameter_0$schema = z.string()
59
- const dsh_auto_flow_autoFlow_send_result$schema = z.object({
60
- 'id': z.number(),
61
- 'text': z.string(),
62
- 'createdAt': z.number(),
203
+ const dsh_auto_flow_autoFlow_saveFlow_parameter_0$schema = z.string()
204
+ const dsh_auto_flow_autoFlow_saveFlow_parameter_1$schema = z.object({
205
+ 'formatVersion': z.number(),
206
+ 'name': z.string(),
207
+ 'description': z.string(),
208
+ 'nodes': z.array(z.object({
209
+ 'id': z.string(),
210
+ 'type': z.string(),
211
+ 'position': z.object({
212
+ 'x': z.number(),
213
+ 'y': z.number(),
214
+ }),
215
+ 'data': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema3))])),
216
+ 'style': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema3))]))]).optional(),
217
+ })),
218
+ 'edges': z.array(z.object({
219
+ 'id': z.string(),
220
+ 'source': z.string(),
221
+ 'target': z.string(),
222
+ 'sourceHandle': z.union([z.undefined(), z.string()]).optional(),
223
+ 'targetHandle': z.union([z.undefined(), z.string()]).optional(),
224
+ 'type': z.union([z.undefined(), z.string()]).optional(),
225
+ 'animated': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
226
+ 'data': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema3))]))]).optional(),
227
+ })),
228
+ })
229
+ const dsh_auto_flow_autoFlow_saveFlow_result$schema = z.object({
230
+ 'formatVersion': z.number(),
231
+ 'name': z.string(),
232
+ 'description': z.string(),
233
+ 'nodes': z.array(z.object({
234
+ 'id': z.string(),
235
+ 'type': z.string(),
236
+ 'position': z.object({
237
+ 'x': z.number(),
238
+ 'y': z.number(),
239
+ }),
240
+ 'data': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema4))])),
241
+ 'style': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema4))]))]).optional(),
242
+ })),
243
+ 'edges': z.array(z.object({
244
+ 'id': z.string(),
245
+ 'source': z.string(),
246
+ 'target': z.string(),
247
+ 'sourceHandle': z.union([z.undefined(), z.string()]).optional(),
248
+ 'targetHandle': z.union([z.undefined(), z.string()]).optional(),
249
+ 'type': z.union([z.undefined(), z.string()]).optional(),
250
+ 'animated': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
251
+ 'data': z.union([z.undefined(), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => FlowDataValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => FlowDataValueRemoteCodec$schema4))]))]).optional(),
252
+ })),
63
253
  })
64
254
 
65
255
  export const TYPERT = {
@@ -69,10 +259,125 @@ export const TYPERT = {
69
259
  ],
70
260
  invocations: [
71
261
  {
72
- id: 'dsh-auto-flow#autoFlow/exec',
262
+ id: 'dsh-auto-flow#autoFlow/approveRun',
263
+ service: 'autoFlow',
264
+ namespace: 'autoFlow',
265
+ method: 'approveRun',
266
+ invocation: { kind: 'direct' },
267
+ parameters: [
268
+ {
269
+ name: 'runId',
270
+ wire: 'runId',
271
+ source: 'json',
272
+ codec: {
273
+ mode: 'strict',
274
+ typeSymbol: 'dsh-auto-flow#autoFlow/approveRun:runId',
275
+ schema: dsh_auto_flow_autoFlow_approveRun_parameter_0$schema,
276
+ },
277
+ },
278
+ {
279
+ name: 'choice',
280
+ wire: 'choice',
281
+ source: 'json',
282
+ codec: {
283
+ mode: 'strict',
284
+ typeSymbol: 'dsh-auto-flow#autoFlow/approveRun:choice',
285
+ schema: dsh_auto_flow_autoFlow_approveRun_parameter_1$schema,
286
+ },
287
+ },
288
+ ],
289
+ result: {
290
+ mode: 'strict',
291
+ typeSymbol: 'dsh-auto-flow/types#RunState',
292
+ schema: dsh_auto_flow_autoFlow_approveRun_result$schema,
293
+ },
294
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":1019,"column":9},
295
+ },
296
+ {
297
+ id: 'dsh-auto-flow#autoFlow/cancelRun',
298
+ service: 'autoFlow',
299
+ namespace: 'autoFlow',
300
+ method: 'cancelRun',
301
+ invocation: { kind: 'direct' },
302
+ parameters: [
303
+ {
304
+ name: 'runId',
305
+ wire: 'runId',
306
+ source: 'json',
307
+ codec: {
308
+ mode: 'strict',
309
+ typeSymbol: 'dsh-auto-flow#autoFlow/cancelRun:runId',
310
+ schema: dsh_auto_flow_autoFlow_cancelRun_parameter_0$schema,
311
+ },
312
+ },
313
+ ],
314
+ result: {
315
+ mode: 'strict',
316
+ typeSymbol: 'dsh-auto-flow/types#RunState',
317
+ schema: dsh_auto_flow_autoFlow_cancelRun_result$schema,
318
+ },
319
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":988,"column":9},
320
+ },
321
+ {
322
+ id: 'dsh-auto-flow#autoFlow/deleteFlow',
73
323
  service: 'autoFlow',
74
324
  namespace: 'autoFlow',
75
- method: 'exec',
325
+ method: 'deleteFlow',
326
+ invocation: { kind: 'direct' },
327
+ parameters: [
328
+ {
329
+ name: 'flowId',
330
+ wire: 'flowId',
331
+ source: 'json',
332
+ codec: {
333
+ mode: 'strict',
334
+ typeSymbol: 'dsh-auto-flow#autoFlow/deleteFlow:flowId',
335
+ schema: dsh_auto_flow_autoFlow_deleteFlow_parameter_0$schema,
336
+ },
337
+ },
338
+ ],
339
+ result: {
340
+ mode: 'strict',
341
+ typeSymbol: 'dsh-auto-flow#autoFlow/deleteFlow:result',
342
+ schema: dsh_auto_flow_autoFlow_deleteFlow_result$schema,
343
+ },
344
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":420,"column":9},
345
+ },
346
+ {
347
+ id: 'dsh-auto-flow#autoFlow/listFlows',
348
+ service: 'autoFlow',
349
+ namespace: 'autoFlow',
350
+ method: 'listFlows',
351
+ invocation: { kind: 'direct' },
352
+ parameters: [
353
+ ],
354
+ result: {
355
+ mode: 'strict',
356
+ typeSymbol: 'dsh-auto-flow#autoFlow/listFlows:result',
357
+ schema: dsh_auto_flow_autoFlow_listFlows_result$schema,
358
+ },
359
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":365,"column":3},
360
+ },
361
+ {
362
+ id: 'dsh-auto-flow#autoFlow/listLlmRoutes',
363
+ service: 'autoFlow',
364
+ namespace: 'autoFlow',
365
+ method: 'listLlmRoutes',
366
+ invocation: { kind: 'direct' },
367
+ parameters: [
368
+ ],
369
+ result: {
370
+ mode: 'strict',
371
+ typeSymbol: 'dsh-auto-flow/types#WorkflowListLlmRoutesResult',
372
+ schema: dsh_auto_flow_autoFlow_listLlmRoutes_result$schema,
373
+ },
374
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":435,"column":3},
375
+ },
376
+ {
377
+ id: 'dsh-auto-flow#autoFlow/listRouteModels',
378
+ service: 'autoFlow',
379
+ namespace: 'autoFlow',
380
+ method: 'listRouteModels',
76
381
  invocation: { kind: 'direct' },
77
382
  parameters: [
78
383
  {
@@ -81,232 +386,395 @@ export const TYPERT = {
81
386
  source: 'json',
82
387
  codec: {
83
388
  mode: 'strict',
84
- typeSymbol: 'dsh-auto-flow/types#ExecRequest',
85
- schema: dsh_auto_flow_autoFlow_exec_parameter_0$schema,
389
+ typeSymbol: 'dsh-auto-flow/types#WorkflowListRouteModelsRequest',
390
+ schema: dsh_auto_flow_autoFlow_listRouteModels_parameter_0$schema,
86
391
  },
87
392
  },
88
393
  ],
89
394
  result: {
90
395
  mode: 'strict',
91
- typeSymbol: 'dsh-auto-flow/types#ExecResult',
92
- schema: dsh_auto_flow_autoFlow_exec_result$schema,
396
+ typeSymbol: 'dsh-auto-flow/types#WorkflowListRouteModelsResult',
397
+ schema: dsh_auto_flow_autoFlow_listRouteModels_result$schema,
93
398
  },
94
- sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":511,"column":9},
399
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":445,"column":9},
95
400
  },
96
401
  {
97
- id: 'dsh-auto-flow#autoFlow/execKill',
402
+ id: 'dsh-auto-flow#autoFlow/listRuns',
98
403
  service: 'autoFlow',
99
404
  namespace: 'autoFlow',
100
- method: 'execKill',
405
+ method: 'listRuns',
101
406
  invocation: { kind: 'direct' },
102
407
  parameters: [
103
408
  {
104
- name: 'jobId',
105
- wire: 'jobId',
409
+ name: 'request',
410
+ wire: 'request',
106
411
  source: 'json',
107
412
  codec: {
108
413
  mode: 'strict',
109
- typeSymbol: 'dsh-auto-flow#autoFlow/execKill:jobId',
110
- schema: dsh_auto_flow_autoFlow_execKill_parameter_0$schema,
414
+ typeSymbol: 'dsh-auto-flow/types#WorkflowListRunsRequest',
415
+ schema: dsh_auto_flow_autoFlow_listRuns_parameter_0$schema,
111
416
  },
112
417
  },
113
418
  ],
114
419
  result: {
115
420
  mode: 'strict',
116
- typeSymbol: 'dsh-auto-flow/types#ExecKillResult',
117
- schema: dsh_auto_flow_autoFlow_execKill_result$schema,
421
+ typeSymbol: 'dsh-auto-flow#autoFlow/listRuns:result',
422
+ schema: dsh_auto_flow_autoFlow_listRuns_result$schema,
118
423
  },
119
- sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":585,"column":9},
424
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":384,"column":9},
120
425
  },
121
426
  {
122
- id: 'dsh-auto-flow#autoFlow/execRead',
427
+ id: 'dsh-auto-flow#autoFlow/listScripts',
123
428
  service: 'autoFlow',
124
429
  namespace: 'autoFlow',
125
- method: 'execRead',
430
+ method: 'listScripts',
431
+ invocation: { kind: 'direct' },
432
+ parameters: [
433
+ ],
434
+ result: {
435
+ mode: 'strict',
436
+ typeSymbol: 'dsh-auto-flow#autoFlow/listScripts:result',
437
+ schema: dsh_auto_flow_autoFlow_listScripts_result$schema,
438
+ },
439
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":427,"column":9},
440
+ },
441
+ {
442
+ id: 'dsh-auto-flow#autoFlow/loadFlow',
443
+ service: 'autoFlow',
444
+ namespace: 'autoFlow',
445
+ method: 'loadFlow',
126
446
  invocation: { kind: 'direct' },
127
447
  parameters: [
128
448
  {
129
- name: 'jobId',
130
- wire: 'jobId',
449
+ name: 'flowId',
450
+ wire: 'flowId',
131
451
  source: 'json',
132
452
  codec: {
133
453
  mode: 'strict',
134
- typeSymbol: 'dsh-auto-flow#autoFlow/execRead:jobId',
135
- schema: dsh_auto_flow_autoFlow_execRead_parameter_0$schema,
454
+ typeSymbol: 'dsh-auto-flow#autoFlow/loadFlow:flowId',
455
+ schema: dsh_auto_flow_autoFlow_loadFlow_parameter_0$schema,
136
456
  },
137
457
  },
138
458
  ],
139
459
  result: {
140
460
  mode: 'strict',
141
- typeSymbol: 'dsh-auto-flow/types#ExecReadResult',
142
- schema: dsh_auto_flow_autoFlow_execRead_result$schema,
461
+ typeSymbol: 'dsh-auto-flow#autoFlow/loadFlow:result',
462
+ schema: dsh_auto_flow_autoFlow_loadFlow_result$schema,
143
463
  },
144
- sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":559,"column":9},
464
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":403,"column":3},
145
465
  },
146
466
  {
147
- id: 'dsh-auto-flow#autoFlow/last',
467
+ id: 'dsh-auto-flow#autoFlow/runFlow',
148
468
  service: 'autoFlow',
149
469
  namespace: 'autoFlow',
150
- method: 'last',
470
+ method: 'runFlow',
151
471
  invocation: { kind: 'direct' },
152
472
  parameters: [
473
+ {
474
+ name: 'request',
475
+ wire: 'request',
476
+ source: 'json',
477
+ codec: {
478
+ mode: 'strict',
479
+ typeSymbol: 'dsh-auto-flow#autoFlow/runFlow:request',
480
+ schema: dsh_auto_flow_autoFlow_runFlow_parameter_0$schema,
481
+ },
482
+ },
153
483
  ],
154
484
  result: {
155
485
  mode: 'strict',
156
- typeSymbol: 'dsh-auto-flow#autoFlow/last:result',
157
- schema: dsh_auto_flow_autoFlow_last_result$schema,
486
+ typeSymbol: 'dsh-auto-flow#autoFlow/runFlow:result',
487
+ schema: dsh_auto_flow_autoFlow_runFlow_result$schema,
158
488
  },
159
- sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":487,"column":3},
489
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":470,"column":9},
160
490
  },
161
491
  {
162
- id: 'dsh-auto-flow#autoFlow/list',
492
+ id: 'dsh-auto-flow#autoFlow/runState',
163
493
  service: 'autoFlow',
164
494
  namespace: 'autoFlow',
165
- method: 'list',
495
+ method: 'runState',
166
496
  invocation: { kind: 'direct' },
167
497
  parameters: [
498
+ {
499
+ name: 'runId',
500
+ wire: 'runId',
501
+ source: 'json',
502
+ codec: {
503
+ mode: 'strict',
504
+ typeSymbol: 'dsh-auto-flow#autoFlow/runState:runId',
505
+ schema: dsh_auto_flow_autoFlow_runState_parameter_0$schema,
506
+ },
507
+ },
168
508
  ],
169
509
  result: {
170
510
  mode: 'strict',
171
- typeSymbol: 'dsh-auto-flow#autoFlow/list:result',
172
- schema: dsh_auto_flow_autoFlow_list_result$schema,
511
+ typeSymbol: 'dsh-auto-flow#autoFlow/runState:result',
512
+ schema: dsh_auto_flow_autoFlow_runState_result$schema,
173
513
  },
174
- sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":481,"column":3},
514
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":979,"column":9},
175
515
  },
176
516
  {
177
- id: 'dsh-auto-flow#autoFlow/send',
517
+ id: 'dsh-auto-flow#autoFlow/saveFlow',
178
518
  service: 'autoFlow',
179
519
  namespace: 'autoFlow',
180
- method: 'send',
520
+ method: 'saveFlow',
181
521
  invocation: { kind: 'direct' },
182
522
  parameters: [
183
523
  {
184
- name: 'text',
185
- wire: 'text',
524
+ name: 'flowId',
525
+ wire: 'flowId',
186
526
  source: 'json',
187
527
  codec: {
188
528
  mode: 'strict',
189
- typeSymbol: 'dsh-auto-flow#autoFlow/send:text',
190
- schema: dsh_auto_flow_autoFlow_send_parameter_0$schema,
529
+ typeSymbol: 'dsh-auto-flow#autoFlow/saveFlow:flowId',
530
+ schema: dsh_auto_flow_autoFlow_saveFlow_parameter_0$schema,
531
+ },
532
+ },
533
+ {
534
+ name: 'flow',
535
+ wire: 'flow',
536
+ source: 'json',
537
+ codec: {
538
+ mode: 'strict',
539
+ typeSymbol: 'dsh-auto-flow/types#WorkflowDefinition',
540
+ schema: dsh_auto_flow_autoFlow_saveFlow_parameter_1$schema,
191
541
  },
192
542
  },
193
543
  ],
194
544
  result: {
195
545
  mode: 'strict',
196
- typeSymbol: 'dsh-auto-flow/types#Greeting',
197
- schema: dsh_auto_flow_autoFlow_send_result$schema,
546
+ typeSymbol: 'dsh-auto-flow/types#WorkflowDefinition',
547
+ schema: dsh_auto_flow_autoFlow_saveFlow_result$schema,
198
548
  },
199
- sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":453,"column":9},
549
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/host/service.ts","line":411,"column":9},
200
550
  },
201
551
  ],
202
552
  model: {
203
553
  "services": [
204
554
  {
205
- "description": "示例服务:类本身就是插件——static inject / Config 是 Cordis 类插件的约定, 构造器里的注册(工具/事件/设置/命令)随插件卸载自动回收。 平台服务消费方式(跨插件协作走 Cordis 服务、禁止互相 import): - 必需依赖用 `static inject`(tools); - 可选依赖用 `ctx.inject([...], cb)`(settings / commands / systemPrompt / autoFlowFormatter)——服务缺失时插件照常加载; - shell / sandboxPolicy 是可选服务:用 `ctx.get(...)` 读取,未组合时 `exec` 报错、插件其余部分照常工作; - 持久层异步打开走 `[Service.init]`(storageDomain 可选:缺省退化为内存态)。",
206
- "summary": "示例服务:类本身就是插件——static inject / Config 是 Cordis 类插件的约定, 构造器里的注册(工具/事件/设置/命令)随插件卸载自动回收。 平台服务消费方式(跨插件协作走 Cordis 服务、禁止互相 import): - 必需依赖用 `static inject`(tools); - 可选依赖用 `ctx.inject([...], cb)`(settings / commands / systemPrompt / autoFlowFormatter)——服务缺失时插件照常加载; - shell / sandboxPolicy 是可选服务:用 `ctx.get(...)` 读取,未组合时 `exec` 报错、插件其余部分照常工作; - 持久层异步打开走 `[Service.init]`(storageDomain 可选:缺省退化为内存态)。",
555
+ "description": "服务类即插件。依赖消费约定: - 可选依赖用 ctx.inject(settings),缺失照常加载; - storageDomain 是硬依赖,[Service.init] 缺失时大声失败(不静默内存态); - playwrightAg 用 ctx.get 读取,未组合时 runFlow 报 playwright-missing; - 持久层在 [Service.init] 异步打开。",
556
+ "summary": "服务类即插件。依赖消费约定: - 可选依赖用 ctx.inject(settings),缺失照常加载; - storageDomain 是硬依赖,[Service.init] 缺失时大声失败(不静默内存态); - playwrightAg 用 ctx.get 读取,未组合时 runFlow 报 playwright-missing; - 持久层在 [Service.init] 异步打开。",
207
557
  "tags": [],
208
- "jsDoc": "/**\n * 示例服务:类本身就是插件——static inject / Config 是 Cordis 类插件的约定,\n * 构造器里的注册(工具/事件/设置/命令)随插件卸载自动回收。\n *\n * 平台服务消费方式(跨插件协作走 Cordis 服务、禁止互相 import):\n * - 必需依赖用 `static inject`(tools);\n * - 可选依赖用 `ctx.inject([...], cb)`(settings / commands / systemPrompt /\n * autoFlowFormatter)——服务缺失时插件照常加载;\n * - shell / sandboxPolicy 是可选服务:用 `ctx.get(...)` 读取,未组合时\n * `exec` 报错、插件其余部分照常工作;\n * - 持久层异步打开走 `[Service.init]`(storageDomain 可选:缺省退化为内存态)。\n */",
558
+ "jsDoc": "/**\n * 服务类即插件。依赖消费约定:\n * - 可选依赖用 ctx.inject(settings),缺失照常加载;\n * - storageDomain 是硬依赖,[Service.init] 缺失时大声失败(不静默内存态);\n * - playwrightAg 用 ctx.get 读取,未组合时 runFlow 报 playwright-missing;\n * - 持久层在 [Service.init] 异步打开。\n */",
209
559
  "key": "autoFlow",
210
- "exportName": "AutoFlowService",
560
+ "exportName": "default",
211
561
  "members": [
212
562
  {
213
563
  "kind": "method",
214
- "name": "send",
215
- "signature": "@Remote('send') async send(text: string): Promise<Greeting>",
216
- "summary": "追加一条问候并返回记录(写透 domain storage;若有第二包则先格式化;提交后发域事件)。 不追加自定义会话事件:harness 的 session 持久化读路径会拒绝 `KNOWN_SESSION_EVENT_TYPES` 之外的事件类型(除非信封标记 `ignorable`,而 `Session.append` 无此参数),把插件 自定义事件写进会话日志会导致该会话在重启后无法打开。",
217
- "jsDoc": "/**\n * 追加一条问候并返回记录(写透 domain storage;若有第二包则先格式化;提交后发域事件)。\n *\n * 不追加自定义会话事件:harness 的 session 持久化读路径会拒绝 `KNOWN_SESSION_EVENT_TYPES`\n * 之外的事件类型(除非信封标记 `ignorable`,而 `Session.append` 无此参数),把插件\n * 自定义事件写进会话日志会导致该会话在重启后无法打开。\n */"
564
+ "name": "listFlows",
565
+ "signature": "@Remote('listFlows') listFlows(): Promise<FlowSummary[]>",
566
+ "summary": "列举全部工作流摘要(id + 名称 + 描述 + 节点数 + 输入键;按 id 升序)。",
567
+ "jsDoc": "/** 列举全部工作流摘要(id + 名称 + 描述 + 节点数 + 输入键;按 id 升序)。 */"
568
+ },
569
+ {
570
+ "kind": "method",
571
+ "name": "listRuns",
572
+ "signature": "@Remote('listRuns') async listRuns(request: WorkflowListRunsRequest): Promise<RunSummary[]>",
573
+ "summary": "列举历史运行摘要(按 updatedAt 倒序,来自插件自持运行日志;支持按会话/工作流过滤,含归属标签)。",
574
+ "jsDoc": "/** 列举历史运行摘要(按 updatedAt 倒序,来自插件自持运行日志;支持按会话/工作流过滤,含归属标签)。\n * @param request - 可选过滤:发起会话与工作流(两个条件可同时使用)。 */"
575
+ },
576
+ {
577
+ "kind": "method",
578
+ "name": "loadFlow",
579
+ "signature": "@Remote('loadFlow') loadFlow(flowId: string): Promise<WorkflowDefinition | null>",
580
+ "summary": "按 id 读取工作流文档(不存在或未组合 storageDomain 时返回 null)。",
581
+ "jsDoc": "/** 按 id 读取工作流文档(不存在或未组合 storageDomain 时返回 null)。 */"
582
+ },
583
+ {
584
+ "kind": "method",
585
+ "name": "saveFlow",
586
+ "signature": "@Remote('saveFlow') async saveFlow(flowId: string, flow: WorkflowDefinition): Promise<WorkflowDefinition>",
587
+ "summary": "按 id 保存工作流文档(domain 打开时落盘,否则仅返回原样;失败大声抛出)。",
588
+ "jsDoc": "/** 按 id 保存工作流文档(domain 打开时落盘,否则仅返回原样;失败大声抛出)。 */"
589
+ },
590
+ {
591
+ "kind": "method",
592
+ "name": "deleteFlow",
593
+ "signature": "@Remote('deleteFlow') async deleteFlow(flowId: string): Promise<{ deleted: boolean }>",
594
+ "summary": "按 id 删除工作流。",
595
+ "jsDoc": "/** 按 id 删除工作流。 */"
596
+ },
597
+ {
598
+ "kind": "method",
599
+ "name": "listScripts",
600
+ "signature": "@Remote('listScripts') async listScripts(): Promise<ScriptInfo[]>",
601
+ "summary": "列出可运行脚本清单(展示名/描述/参数/产物装配规则;playwright-ag 为准,缺失时返回空)。",
602
+ "jsDoc": "/** 列出可运行脚本清单(展示名/描述/参数/产物装配规则;playwright-ag 为准,缺失时返回空)。 */"
603
+ },
604
+ {
605
+ "kind": "method",
606
+ "name": "listLlmRoutes",
607
+ "signature": "@Remote('listLlmRoutes') listLlmRoutes(): WorkflowListLlmRoutesResult",
608
+ "summary": "列出实时 LLM 模型路由(llm/vision/agent 节点的 provider 下拉)。",
609
+ "jsDoc": "/** 列出实时 LLM 模型路由(llm/vision/agent 节点的 provider 下拉)。 */"
218
610
  },
219
611
  {
220
612
  "kind": "method",
221
- "name": "list",
222
- "signature": "@Remote('list') list(): Promise<Greeting[]>",
223
- "summary": "返回全部问候记录(内存视图,已由 domain storage 水合)。",
224
- "jsDoc": "/** 返回全部问候记录(内存视图,已由 domain storage 水合)。 */"
613
+ "name": "listRouteModels",
614
+ "signature": "@Remote('listRouteModels') async listRouteModels( request: WorkflowListRouteModelsRequest, ): Promise<WorkflowListRouteModelsResult>",
615
+ "summary": "列出某实时模型路由上的模型目录(llm/vision/agent 节点的 model 下拉)。",
616
+ "jsDoc": "/** 列出某实时模型路由上的模型目录(llm/vision/agent 节点的 model 下拉)。 */"
225
617
  },
226
618
  {
227
619
  "kind": "method",
228
- "name": "last",
229
- "signature": "@Remote('last') last(): Promise<Greeting | null>",
230
- "summary": "返回最近一次提交的问候(由域事件监听器维护),首次提交前为 null。",
231
- "jsDoc": "/** 返回最近一次提交的问候(由域事件监听器维护),首次提交前为 null。 */"
620
+ "name": "runFlow",
621
+ "signature": "@Remote('runFlow') async runFlow(request: { flow: FlowGraph workflowId?: string name?: string sessionId?: string }): Promise<{ runId: string }>",
622
+ "summary": "启动一次工作流运行(@Remote,画布触发):按层级并发执行 表单→脚本→审批,审批经画布 approveRun/cancelRun 放行。 返回 runId 即返回,进度经 runState 轮询;校验失败抛 invalid-flow(含诊断项)。 sessionId 用于把产物落到「当前会话工作区」(缺省回退配置 workspaceDir)。",
623
+ "jsDoc": "/**\n * 启动一次工作流运行(@Remote,画布触发):按层级并发执行 表单→脚本→审批,审批经画布 approveRun/cancelRun 放行。\n * 返回 runId 即返回,进度经 runState 轮询;校验失败抛 invalid-flow(含诊断项)。\n * sessionId 用于把产物落到「当前会话工作区」(缺省回退配置 workspaceDir)。\n */"
232
624
  },
233
625
  {
234
626
  "kind": "method",
235
- "name": "exec",
236
- "signature": "@Remote('exec') async exec(request: ExecRequest): Promise<ExecResult>",
237
- "summary": "执行一条命令行(宿主内经 ctx.shell,与 bash 工具同一执行器,绝不经过模型)。 输出只回调用方、不进会话日志。@Remote 严格契约保证浏览器端完整类型与校验。 相比模型工具(@deepseek-ai/dsh-tool-bash)的 shell 面,@Remote 轻执行只能拿到 能映射过来的子集:timeoutMs / stdoutMaxBytes / sandboxPolicy / 后台任务 / 结果保真。 模型工具专属的 seam(shellEnv.collect 需要 ToolExecution、sandbox 升级需要 approval + callId、abort 需要 ToolExecution.signal)不适用于",
238
- "jsDoc": "/**\n * 执行一条命令行(宿主内经 ctx.shell,与 bash 工具同一执行器,绝不经过模型)。\n * 输出只回调用方、不进会话日志。@Remote 严格契约保证浏览器端完整类型与校验。\n *\n * 相比模型工具(@deepseek-ai/dsh-tool-bash)的 shell 面,@Remote 轻执行只能拿到\n * 能映射过来的子集:timeoutMs / stdoutMaxBytes / sandboxPolicy / 后台任务 / 结果保真。\n * 模型工具专属的 seam(shellEnv.collect 需要 ToolExecution、sandbox 升级需要 approval\n * + callId、abort 需要 ToolExecution.signal)不适用于 @Remote,此处不做。\n *\n * 注意:@Remote 方法不能带 `agent: Agent` 参数——第三方仓库的 typert 生成器无法解析\n * `agent` lookup(其 wire 类型 SessionId 是 branded 类型,官方 monorepo 内才可用)。\n * 因此沙箱策略退化为「部署默认」(`sandboxPolicy.resolve()` 无 session)。\n *\n * 后台执行不走 ctx.jobs(那是给模型工具 job_output/job_kill 用的,需要 agent owner +\n * dsh-tool-jobs 控制器,@Remote 里拿不到):直接用 `shell.start()` 拿 ShellProcess\n * 句柄,自管在 this.background Map 里,execRead/execKill 直接操作句柄;卸载时统一 kill。\n *\n * shell / sandboxPolicy 是可选依赖:未组合时抛对应 RemoteError,插件其余照常。\n */"
627
+ "name": "runForAgent",
628
+ "signature": "async runForAgent( flowId: string, args: Record<string, FlowDataValue>, agent: unknown, signal?: AbortSignal, ): Promise<RunOutcome>",
629
+ "summary": "供模型工具:按 flowId 加载并运行,args 覆盖表单默认值,等待完成返回结算结果。 同时把最近一条用户消息的图片/文本补填进缺失的 image/task 输入(会话上下文注入)。",
630
+ "jsDoc": "/** 供模型工具:按 flowId 加载并运行,args 覆盖表单默认值,等待完成返回结算结果。\n * 同时把最近一条用户消息的图片/文本补填进缺失的 image/task 输入(会话上下文注入)。 */"
239
631
  },
240
632
  {
241
633
  "kind": "method",
242
- "name": "execRead",
243
- "signature": "@Remote('execRead') async execRead(jobId: string): Promise<ExecReadResult>",
244
- "summary": "读后台进程的下一次增量/终态输出(自管 ShellProcess 句柄,不依赖 ctx.jobs)。",
245
- "jsDoc": "/** 读后台进程的下一次增量/终态输出(自管 ShellProcess 句柄,不依赖 ctx.jobs)。 */"
634
+ "name": "runWorkflowCommand",
635
+ "signature": "async runWorkflowCommand(invocation: { agent: unknown rawInput: string signal: AbortSignal }): Promise<{ kind: 'success'; text?: string } | { kind: 'error'; text: string }>",
636
+ "summary": "执行 /workflow 命令:不带参数列出工作流;/workflow <id> [key=value ...] 运行并等待结算。",
637
+ "jsDoc": "/** 执行 /workflow 命令:不带参数列出工作流;/workflow <id> [key=value ...] 运行并等待结算。 */"
246
638
  },
247
639
  {
248
640
  "kind": "method",
249
- "name": "execKill",
250
- "signature": "@Remote('execKill') async execKill(jobId: string): Promise<ExecKillResult>",
251
- "summary": "请求取消后台进程(自管 ShellProcess 句柄,不依赖 ctx.jobs)。",
252
- "jsDoc": "/** 请求取消后台进程(自管 ShellProcess 句柄,不依赖 ctx.jobs)。 */"
641
+ "name": "runState",
642
+ "signature": "@Remote('runState') async runState(runId: string): Promise<RunState | null>",
643
+ "summary": "轮询运行状态(内存权威;未在内存中时读运行日志兜底)。",
644
+ "jsDoc": "/** 轮询运行状态(内存权威;未在内存中时读运行日志兜底)。 */"
645
+ },
646
+ {
647
+ "kind": "method",
648
+ "name": "cancelRun",
649
+ "signature": "@Remote('cancelRun') async cancelRun(runId: string): Promise<RunState>",
650
+ "summary": "取消运行:协作式取消,中止在飞的脚本/LLM/shell/HTTP,引擎在下一个步骤边界停下;若正等待审批则放行让引擎退出。 画布面向的根运行取消时会连带取消其整个审批上抛队列中的嵌套运行。",
651
+ "jsDoc": "/** 取消运行:协作式取消,中止在飞的脚本/LLM/shell/HTTP,引擎在下一个步骤边界停下;若正等待审批则放行让引擎退出。\n * 画布面向的根运行取消时会连带取消其整个审批上抛队列中的嵌套运行。 */"
652
+ },
653
+ {
654
+ "kind": "method",
655
+ "name": "approveRun",
656
+ "signature": "@Remote('approveRun') async approveRun(runId: string, choice: string): Promise<RunState>",
657
+ "summary": "审批选择:choice = 审批节点的某个选项标签;画布用根 runId 操作时,自动作用于当前待处理的嵌套审批(队首)。",
658
+ "jsDoc": "/** 审批选择:choice = 审批节点的某个选项标签;画布用根 runId 操作时,自动作用于当前待处理的嵌套审批(队首)。 */"
253
659
  }
254
660
  ],
255
661
  "types": [
256
662
  {
257
- "name": "ExecBackgroundResult",
258
- "declaration": "export interface ExecBackgroundResult {\n kind: 'background';\n jobId: string;\n}"
663
+ "name": "FlowDataValue",
664
+ "declaration": "export type FlowDataValue = string | number | boolean | null | FlowDataValue[] | { [key: string]: FlowDataValue; };"
665
+ },
666
+ {
667
+ "name": "FlowEdge",
668
+ "declaration": "export interface FlowEdge {\n id: string;\n source: string;\n target: string;\n sourceHandle?: string | undefined;\n targetHandle?: string | undefined;\n type?: string | undefined;\n animated?: boolean | undefined;\n data?: Record<string, FlowDataValue> | undefined;\n}"
669
+ },
670
+ {
671
+ "name": "FlowGraph",
672
+ "declaration": "export interface FlowGraph {\n nodes: FlowNode[];\n edges: FlowEdge[];\n}"
673
+ },
674
+ {
675
+ "name": "FlowNode",
676
+ "declaration": "export interface FlowNode {\n id: string;\n type: string;\n position: { x: number; y: number; };\n data: FlowNodeData;\n style?: Record<string, FlowDataValue> | undefined;\n}"
677
+ },
678
+ {
679
+ "name": "FlowNodeData",
680
+ "declaration": "export type FlowNodeData = Record<string, FlowDataValue>;"
681
+ },
682
+ {
683
+ "name": "FlowSummary",
684
+ "declaration": "export interface FlowSummary {\n id: string;\n name: string;\n description: string;\n nodeCount: number;\n inputs: string[];\n}"
685
+ },
686
+ {
687
+ "name": "PropertyType",
688
+ "declaration": "export type PropertyType = 'string' | 'number' | 'boolean' | 'select' | 'datetime' | 'array' | 'object';"
689
+ },
690
+ {
691
+ "name": "RunOutcome",
692
+ "declaration": "export interface RunOutcome {\n runId: string;\n ok: boolean;\n result?: FlowDataValue | undefined;\n error?: string | undefined;\n steps: RunState['steps'];\n}"
693
+ },
694
+ {
695
+ "name": "RunState",
696
+ "declaration": "export interface RunState {\n runId: string;\n workflowId: string;\n name: string;\n sessionId?: string | undefined;\n status: 'running' | 'waiting' | 'completed' | 'failed' | 'cancelled';\n workspaceDir: string;\n steps: RunStep[];\n createdAt: number;\n updatedAt: number;\n}"
697
+ },
698
+ {
699
+ "name": "RunStep",
700
+ "declaration": "export interface RunStep {\n nodeId: string;\n nodeType: string;\n label: string;\n status: 'pending' | 'running' | 'waiting' | 'success' | 'failed' | 'skipped';\n script?: string | undefined;\n stepDir?: string | undefined;\n result?: FlowDataValue | undefined;\n error?: string | undefined;\n errorCode?: string | undefined;\n durationMs?: number | undefined;\n}"
259
701
  },
260
702
  {
261
- "name": "ExecForegroundResult",
262
- "declaration": "export interface ExecForegroundResult {\n kind: 'foreground';\n exitCode: number | null;\n signal: string | null;\n timedOut: boolean;\n aborted: boolean;\n timeoutMs: number;\n stdout: ExecOutput;\n stderr: ExecOutput;\n sandbox?: ExecSandboxInfo;\n}"
703
+ "name": "RunSummary",
704
+ "declaration": "export interface RunSummary {\n runId: string;\n workflowId: string;\n name: string;\n sessionId?: string | undefined;\n status: RunState['status'];\n nodeCount: number;\n createdAt: number;\n updatedAt: number;\n}"
263
705
  },
264
706
  {
265
- "name": "ExecKillResult",
266
- "declaration": "export interface ExecKillResult {\n kind: 'requested' | 'already-finished';\n}"
707
+ "name": "ScriptArtifactSpec",
708
+ "declaration": "export interface ScriptArtifactSpec {\n filesKey?: string | undefined;\n filesShape?: 'paths' | 'vidu-imgs' | undefined;\n filesPromptKey?: string | undefined;\n}"
267
709
  },
268
710
  {
269
- "name": "ExecOutput",
270
- "declaration": "export interface ExecOutput {\n text: string;\n truncated: boolean;\n spillPath?: string;\n}"
711
+ "name": "ScriptInfo",
712
+ "declaration": "export interface ScriptInfo {\n name: string;\n label: string;\n description: string;\n params: ScriptParamField[];\n artifacts?: ScriptArtifactSpec | undefined;\n}"
271
713
  },
272
714
  {
273
- "name": "ExecReadResult",
274
- "declaration": "export interface ExecReadResult {\n text: string;\n status: string;\n detail?: string;\n}"
715
+ "name": "ScriptParamField",
716
+ "declaration": "export interface ScriptParamField {\n key: string;\n label: string;\n type: PropertyType;\n required?: boolean | undefined;\n defaultValue?: FlowDataValue | undefined;\n options?: SelectOption[] | undefined;\n format?: string | undefined;\n placeholder?: string | undefined;\n description?: string | undefined;\n}"
275
717
  },
276
718
  {
277
- "name": "ExecRequest",
278
- "declaration": "export interface ExecRequest {\n command: string;\n workdir?: string;\n timeoutMs?: number;\n stdoutMaxBytes?: number;\n runInBackground?: boolean;\n}"
719
+ "name": "SelectOption",
720
+ "declaration": "export interface SelectOption {\n label: string;\n value: FlowDataValue;\n}"
279
721
  },
280
722
  {
281
- "name": "ExecResult",
282
- "declaration": "export type ExecResult = ExecForegroundResult | ExecBackgroundResult;"
723
+ "name": "WorkflowDefinition",
724
+ "declaration": "export interface WorkflowDefinition {\n formatVersion: number;\n name: string;\n description: string;\n nodes: FlowNode[];\n edges: FlowEdge[];\n}"
283
725
  },
284
726
  {
285
- "name": "ExecSandboxInfo",
286
- "declaration": "export interface ExecSandboxInfo {\n mode: string;\n denied: boolean;\n enforcement?: string;\n runnerFailed?: boolean;\n}"
727
+ "name": "WorkflowListLlmRoutesResult",
728
+ "declaration": "export interface WorkflowListLlmRoutesResult {\n routes: WorkflowLlmRoute[];\n}"
287
729
  },
288
730
  {
289
- "name": "Greeting",
290
- "declaration": "export interface Greeting {\n id: number;\n text: string;\n createdAt: number;\n}"
731
+ "name": "WorkflowListRouteModelsRequest",
732
+ "declaration": "export interface WorkflowListRouteModelsRequest {\n provider: string;\n}"
733
+ },
734
+ {
735
+ "name": "WorkflowListRouteModelsResult",
736
+ "declaration": "export interface WorkflowListRouteModelsResult {\n models: WorkflowRouteModel[];\n error?: string | undefined;\n}"
737
+ },
738
+ {
739
+ "name": "WorkflowListRunsRequest",
740
+ "declaration": "export interface WorkflowListRunsRequest {\n sessionId?: string | undefined;\n workflowId?: string | undefined;\n}"
741
+ },
742
+ {
743
+ "name": "WorkflowLlmRoute",
744
+ "declaration": "export interface WorkflowLlmRoute {\n provider: string;\n displayName: string;\n}"
745
+ },
746
+ {
747
+ "name": "WorkflowRouteModel",
748
+ "declaration": "export interface WorkflowRouteModel {\n id: string;\n name: string;\n}"
291
749
  }
292
750
  ]
293
751
  }
294
752
  ],
295
753
  "events": [
296
754
  {
297
- "description": "一次问候已提交(域事件,跨插件实时通知 seam)。发出方在 `send` 提交后 emit;其它插件可 `ctx.on('autoFlow/recorded', ...)` 订阅。",
298
- "summary": "一次问候已提交(域事件,跨插件实时通知 seam)。发出方在 `send` 提交后 emit;其它插件可 `ctx.on('autoFlow/recorded', ...)` 订阅。",
299
- "tags": [
300
- {
301
- "name": "mode",
302
- "comment": "emit",
303
- "text": "@mode emit"
304
- }
305
- ],
306
- "jsDoc": "/**\n * 一次问候已提交(域事件,跨插件实时通知 seam)。发出方在 `send` 提交后\n * emit;其它插件可 `ctx.on('autoFlow/recorded', ...)` 订阅。\n * @mode emit\n */",
307
- "name": "autoFlow/recorded",
308
- "mode": "emit",
309
- "signature": "'autoFlow/recorded'(payload: { readonly greeting: Greeting; }): void"
755
+ "tags": [],
756
+ "name": "auto-flow/node-result",
757
+ "signature": "'auto-flow/node-result'(data: RunNodeResultEvent): void"
758
+ },
759
+ {
760
+ "tags": [],
761
+ "name": "auto-flow/node-start",
762
+ "signature": "'auto-flow/node-start'(data: RunNodeEvent): void"
763
+ },
764
+ {
765
+ "tags": [],
766
+ "name": "auto-flow/run-end",
767
+ "signature": "'auto-flow/run-end'(data: RunEndEvent): void"
768
+ },
769
+ {
770
+ "tags": [],
771
+ "name": "auto-flow/run-need-approval",
772
+ "signature": "'auto-flow/run-need-approval'(data: RunNeedApprovalEvent): void"
773
+ },
774
+ {
775
+ "tags": [],
776
+ "name": "auto-flow/run-start",
777
+ "signature": "'auto-flow/run-start'(data: RunStartEvent): void"
310
778
  }
311
779
  ],
312
780
  "objects": []