@agent-phonon/protocol 0.9.1 → 0.10.0

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 (145) hide show
  1. package/README.md +35 -1
  2. package/dist/index.d.ts +12 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +12 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/native-version.d.ts +6 -0
  7. package/dist/native-version.d.ts.map +1 -0
  8. package/dist/native-version.js +41 -0
  9. package/dist/native-version.js.map +1 -0
  10. package/dist/schemas/capabilities.d.ts +9 -0
  11. package/dist/schemas/capabilities.d.ts.map +1 -1
  12. package/dist/schemas/capabilities.js +3 -0
  13. package/dist/schemas/capabilities.js.map +1 -1
  14. package/dist/schemas/common.d.ts +4 -4
  15. package/dist/schemas/common.d.ts.map +1 -1
  16. package/dist/schemas/common.js +9 -0
  17. package/dist/schemas/common.js.map +1 -1
  18. package/dist/schemas/compression.d.ts +191 -0
  19. package/dist/schemas/compression.d.ts.map +1 -0
  20. package/dist/schemas/compression.js +18 -0
  21. package/dist/schemas/compression.js.map +1 -0
  22. package/dist/schemas/conversation-archive.d.ts +1021 -0
  23. package/dist/schemas/conversation-archive.d.ts.map +1 -0
  24. package/dist/schemas/conversation-archive.js +148 -0
  25. package/dist/schemas/conversation-archive.js.map +1 -0
  26. package/dist/schemas/conversation-board.d.ts +428 -0
  27. package/dist/schemas/conversation-board.d.ts.map +1 -0
  28. package/dist/schemas/conversation-board.js +32 -0
  29. package/dist/schemas/conversation-board.js.map +1 -0
  30. package/dist/schemas/conversation-message.d.ts +658 -0
  31. package/dist/schemas/conversation-message.d.ts.map +1 -0
  32. package/dist/schemas/conversation-message.js +42 -0
  33. package/dist/schemas/conversation-message.js.map +1 -0
  34. package/dist/schemas/conversation-workflow.d.ts +1201 -0
  35. package/dist/schemas/conversation-workflow.d.ts.map +1 -0
  36. package/dist/schemas/conversation-workflow.js +68 -0
  37. package/dist/schemas/conversation-workflow.js.map +1 -0
  38. package/dist/schemas/device.d.ts +198 -2
  39. package/dist/schemas/device.d.ts.map +1 -1
  40. package/dist/schemas/device.js +29 -1
  41. package/dist/schemas/device.js.map +1 -1
  42. package/dist/schemas/discovery.d.ts +107 -0
  43. package/dist/schemas/discovery.d.ts.map +1 -1
  44. package/dist/schemas/discovery.js +2 -0
  45. package/dist/schemas/discovery.js.map +1 -1
  46. package/dist/schemas/document.d.ts +56 -26
  47. package/dist/schemas/document.d.ts.map +1 -1
  48. package/dist/schemas/document.js +11 -0
  49. package/dist/schemas/document.js.map +1 -1
  50. package/dist/schemas/employee.d.ts +139 -0
  51. package/dist/schemas/employee.d.ts.map +1 -0
  52. package/dist/schemas/employee.js +17 -0
  53. package/dist/schemas/employee.js.map +1 -0
  54. package/dist/schemas/env.d.ts +15 -15
  55. package/dist/schemas/env.d.ts.map +1 -1
  56. package/dist/schemas/env.js +1 -1
  57. package/dist/schemas/env.js.map +1 -1
  58. package/dist/schemas/file.d.ts +6 -6
  59. package/dist/schemas/hook.d.ts +4 -4
  60. package/dist/schemas/interaction.d.ts +363 -2
  61. package/dist/schemas/interaction.d.ts.map +1 -1
  62. package/dist/schemas/interaction.js +28 -1
  63. package/dist/schemas/interaction.js.map +1 -1
  64. package/dist/schemas/jsonrpc.d.ts +19 -19
  65. package/dist/schemas/maintenance.d.ts +822 -0
  66. package/dist/schemas/maintenance.d.ts.map +1 -0
  67. package/dist/schemas/maintenance.js +166 -0
  68. package/dist/schemas/maintenance.js.map +1 -0
  69. package/dist/schemas/managed-mcp.d.ts +116 -0
  70. package/dist/schemas/managed-mcp.d.ts.map +1 -0
  71. package/dist/schemas/managed-mcp.js +23 -0
  72. package/dist/schemas/managed-mcp.js.map +1 -0
  73. package/dist/schemas/methods.d.ts +22186 -2362
  74. package/dist/schemas/methods.d.ts.map +1 -1
  75. package/dist/schemas/methods.js +181 -6
  76. package/dist/schemas/methods.js.map +1 -1
  77. package/dist/schemas/native-stop.d.ts +162 -0
  78. package/dist/schemas/native-stop.d.ts.map +1 -0
  79. package/dist/schemas/native-stop.js +14 -0
  80. package/dist/schemas/native-stop.js.map +1 -0
  81. package/dist/schemas/policy.d.ts +42 -2
  82. package/dist/schemas/policy.d.ts.map +1 -1
  83. package/dist/schemas/policy.js +20 -0
  84. package/dist/schemas/policy.js.map +1 -1
  85. package/dist/schemas/project-coordination.d.ts +1956 -0
  86. package/dist/schemas/project-coordination.d.ts.map +1 -0
  87. package/dist/schemas/project-coordination.js +81 -0
  88. package/dist/schemas/project-coordination.js.map +1 -0
  89. package/dist/schemas/project.d.ts +771 -53
  90. package/dist/schemas/project.d.ts.map +1 -1
  91. package/dist/schemas/project.js +60 -5
  92. package/dist/schemas/project.js.map +1 -1
  93. package/dist/schemas/reasoning.d.ts +26 -0
  94. package/dist/schemas/reasoning.d.ts.map +1 -0
  95. package/dist/schemas/reasoning.js +10 -0
  96. package/dist/schemas/reasoning.js.map +1 -0
  97. package/dist/schemas/schedule.d.ts +15148 -5022
  98. package/dist/schemas/schedule.d.ts.map +1 -1
  99. package/dist/schemas/schedule.js +46 -5
  100. package/dist/schemas/schedule.js.map +1 -1
  101. package/dist/schemas/session.d.ts +1558 -49
  102. package/dist/schemas/session.d.ts.map +1 -1
  103. package/dist/schemas/session.js +27 -16
  104. package/dist/schemas/session.js.map +1 -1
  105. package/dist/schemas/skill.d.ts +1009 -8
  106. package/dist/schemas/skill.d.ts.map +1 -1
  107. package/dist/schemas/skill.js +39 -0
  108. package/dist/schemas/skill.js.map +1 -1
  109. package/dist/schemas/stream.d.ts +1060 -67
  110. package/dist/schemas/stream.d.ts.map +1 -1
  111. package/dist/schemas/stream.js +18 -3
  112. package/dist/schemas/stream.js.map +1 -1
  113. package/dist/schemas/workflow.d.ts +2764 -255
  114. package/dist/schemas/workflow.d.ts.map +1 -1
  115. package/dist/schemas/workflow.js +69 -1
  116. package/dist/schemas/workflow.js.map +1 -1
  117. package/package.json +1 -1
  118. package/src/index.ts +12 -0
  119. package/src/native-version.ts +30 -0
  120. package/src/schemas/capabilities.ts +3 -0
  121. package/src/schemas/common.ts +9 -0
  122. package/src/schemas/compression.ts +19 -0
  123. package/src/schemas/conversation-archive.ts +155 -0
  124. package/src/schemas/conversation-board.ts +36 -0
  125. package/src/schemas/conversation-message.ts +46 -0
  126. package/src/schemas/conversation-workflow.ts +62 -0
  127. package/src/schemas/device.ts +32 -1
  128. package/src/schemas/discovery.ts +2 -0
  129. package/src/schemas/document.ts +13 -0
  130. package/src/schemas/employee.ts +19 -0
  131. package/src/schemas/env.ts +1 -1
  132. package/src/schemas/interaction.ts +32 -1
  133. package/src/schemas/maintenance.ts +204 -0
  134. package/src/schemas/managed-mcp.ts +25 -0
  135. package/src/schemas/methods.ts +208 -1
  136. package/src/schemas/native-stop.ts +16 -0
  137. package/src/schemas/policy.ts +20 -0
  138. package/src/schemas/project-coordination.ts +90 -0
  139. package/src/schemas/project.ts +72 -5
  140. package/src/schemas/reasoning.ts +13 -0
  141. package/src/schemas/schedule.ts +54 -5
  142. package/src/schemas/session.ts +30 -18
  143. package/src/schemas/skill.ts +52 -0
  144. package/src/schemas/stream.ts +22 -3
  145. package/src/schemas/workflow.ts +82 -1
@@ -14,6 +14,35 @@ export declare const WorkflowNode: z.ZodObject<{
14
14
  nodeId: z.ZodString;
15
15
  agent: z.ZodBranded<z.ZodString, "AgentId">;
16
16
  model: z.ZodString;
17
+ reasoning: z.ZodOptional<z.ZodObject<{
18
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
19
+ }, "strict", z.ZodTypeAny, {
20
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
21
+ }, {
22
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
23
+ }>>;
24
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
25
+ name: z.ZodEffects<z.ZodString, string, string>;
26
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
27
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
28
+ force: z.ZodOptional<z.ZodBoolean>;
29
+ revision: z.ZodOptional<z.ZodString>;
30
+ installationId: z.ZodOptional<z.ZodString>;
31
+ }, "strict", z.ZodTypeAny, {
32
+ name: string;
33
+ version?: string | undefined;
34
+ scope?: "project" | "global" | undefined;
35
+ force?: boolean | undefined;
36
+ revision?: string | undefined;
37
+ installationId?: string | undefined;
38
+ }, {
39
+ name: string;
40
+ version?: string | undefined;
41
+ scope?: "project" | "global" | undefined;
42
+ force?: boolean | undefined;
43
+ revision?: string | undefined;
44
+ installationId?: string | undefined;
45
+ }>]>, "many">>;
17
46
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
18
47
  role: z.ZodOptional<z.ZodString>;
19
48
  input: z.ZodOptional<z.ZodString>;
@@ -51,28 +80,50 @@ export declare const WorkflowNode: z.ZodObject<{
51
80
  model: string;
52
81
  nodeId: string;
53
82
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
54
- role?: string | undefined;
55
83
  project?: (string & z.BRAND<"ProjectId">) | undefined;
84
+ skills?: (string | {
85
+ name: string;
86
+ version?: string | undefined;
87
+ scope?: "project" | "global" | undefined;
88
+ force?: boolean | undefined;
89
+ revision?: string | undefined;
90
+ installationId?: string | undefined;
91
+ })[] | undefined;
92
+ role?: string | undefined;
56
93
  worktreeId?: string | undefined;
57
94
  agentConfig?: Record<string, unknown> | undefined;
95
+ reasoning?: {
96
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
97
+ } | undefined;
58
98
  input?: string | undefined;
99
+ dependsOn?: string[] | undefined;
59
100
  branch?: string | undefined;
60
101
  systemPrompt?: string | undefined;
61
- dependsOn?: string[] | undefined;
62
102
  metadata?: Record<string, unknown> | undefined;
63
103
  }, {
64
104
  agent: string;
65
105
  model: string;
66
106
  nodeId: string;
67
107
  sessionId?: string | undefined;
68
- role?: string | undefined;
69
108
  project?: string | undefined;
109
+ skills?: (string | {
110
+ name: string;
111
+ version?: string | undefined;
112
+ scope?: "project" | "global" | undefined;
113
+ force?: boolean | undefined;
114
+ revision?: string | undefined;
115
+ installationId?: string | undefined;
116
+ })[] | undefined;
117
+ role?: string | undefined;
70
118
  worktreeId?: string | undefined;
71
119
  agentConfig?: Record<string, unknown> | undefined;
120
+ reasoning?: {
121
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
122
+ } | undefined;
72
123
  input?: string | undefined;
124
+ dependsOn?: string[] | undefined;
73
125
  branch?: string | undefined;
74
126
  systemPrompt?: string | undefined;
75
- dependsOn?: string[] | undefined;
76
127
  metadata?: Record<string, unknown> | undefined;
77
128
  }>;
78
129
  export type WorkflowNode = z.infer<typeof WorkflowNode>;
@@ -105,6 +156,35 @@ export declare const WorkflowDagPlan: z.ZodObject<{
105
156
  nodeId: z.ZodString;
106
157
  agent: z.ZodBranded<z.ZodString, "AgentId">;
107
158
  model: z.ZodString;
159
+ reasoning: z.ZodOptional<z.ZodObject<{
160
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
161
+ }, "strict", z.ZodTypeAny, {
162
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
163
+ }, {
164
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
165
+ }>>;
166
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
167
+ name: z.ZodEffects<z.ZodString, string, string>;
168
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
169
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
170
+ force: z.ZodOptional<z.ZodBoolean>;
171
+ revision: z.ZodOptional<z.ZodString>;
172
+ installationId: z.ZodOptional<z.ZodString>;
173
+ }, "strict", z.ZodTypeAny, {
174
+ name: string;
175
+ version?: string | undefined;
176
+ scope?: "project" | "global" | undefined;
177
+ force?: boolean | undefined;
178
+ revision?: string | undefined;
179
+ installationId?: string | undefined;
180
+ }, {
181
+ name: string;
182
+ version?: string | undefined;
183
+ scope?: "project" | "global" | undefined;
184
+ force?: boolean | undefined;
185
+ revision?: string | undefined;
186
+ installationId?: string | undefined;
187
+ }>]>, "many">>;
108
188
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
109
189
  role: z.ZodOptional<z.ZodString>;
110
190
  input: z.ZodOptional<z.ZodString>;
@@ -142,28 +222,50 @@ export declare const WorkflowDagPlan: z.ZodObject<{
142
222
  model: string;
143
223
  nodeId: string;
144
224
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
145
- role?: string | undefined;
146
225
  project?: (string & z.BRAND<"ProjectId">) | undefined;
226
+ skills?: (string | {
227
+ name: string;
228
+ version?: string | undefined;
229
+ scope?: "project" | "global" | undefined;
230
+ force?: boolean | undefined;
231
+ revision?: string | undefined;
232
+ installationId?: string | undefined;
233
+ })[] | undefined;
234
+ role?: string | undefined;
147
235
  worktreeId?: string | undefined;
148
236
  agentConfig?: Record<string, unknown> | undefined;
237
+ reasoning?: {
238
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
239
+ } | undefined;
149
240
  input?: string | undefined;
241
+ dependsOn?: string[] | undefined;
150
242
  branch?: string | undefined;
151
243
  systemPrompt?: string | undefined;
152
- dependsOn?: string[] | undefined;
153
244
  metadata?: Record<string, unknown> | undefined;
154
245
  }, {
155
246
  agent: string;
156
247
  model: string;
157
248
  nodeId: string;
158
249
  sessionId?: string | undefined;
159
- role?: string | undefined;
160
250
  project?: string | undefined;
251
+ skills?: (string | {
252
+ name: string;
253
+ version?: string | undefined;
254
+ scope?: "project" | "global" | undefined;
255
+ force?: boolean | undefined;
256
+ revision?: string | undefined;
257
+ installationId?: string | undefined;
258
+ })[] | undefined;
259
+ role?: string | undefined;
161
260
  worktreeId?: string | undefined;
162
261
  agentConfig?: Record<string, unknown> | undefined;
262
+ reasoning?: {
263
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
264
+ } | undefined;
163
265
  input?: string | undefined;
266
+ dependsOn?: string[] | undefined;
164
267
  branch?: string | undefined;
165
268
  systemPrompt?: string | undefined;
166
- dependsOn?: string[] | undefined;
167
269
  metadata?: Record<string, unknown> | undefined;
168
270
  }>, "many">;
169
271
  edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -196,14 +298,25 @@ export declare const WorkflowDagPlan: z.ZodObject<{
196
298
  model: string;
197
299
  nodeId: string;
198
300
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
199
- role?: string | undefined;
200
301
  project?: (string & z.BRAND<"ProjectId">) | undefined;
302
+ skills?: (string | {
303
+ name: string;
304
+ version?: string | undefined;
305
+ scope?: "project" | "global" | undefined;
306
+ force?: boolean | undefined;
307
+ revision?: string | undefined;
308
+ installationId?: string | undefined;
309
+ })[] | undefined;
310
+ role?: string | undefined;
201
311
  worktreeId?: string | undefined;
202
312
  agentConfig?: Record<string, unknown> | undefined;
313
+ reasoning?: {
314
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
315
+ } | undefined;
203
316
  input?: string | undefined;
317
+ dependsOn?: string[] | undefined;
204
318
  branch?: string | undefined;
205
319
  systemPrompt?: string | undefined;
206
- dependsOn?: string[] | undefined;
207
320
  metadata?: Record<string, unknown> | undefined;
208
321
  }[];
209
322
  edges?: {
@@ -222,14 +335,25 @@ export declare const WorkflowDagPlan: z.ZodObject<{
222
335
  model: string;
223
336
  nodeId: string;
224
337
  sessionId?: string | undefined;
225
- role?: string | undefined;
226
338
  project?: string | undefined;
339
+ skills?: (string | {
340
+ name: string;
341
+ version?: string | undefined;
342
+ scope?: "project" | "global" | undefined;
343
+ force?: boolean | undefined;
344
+ revision?: string | undefined;
345
+ installationId?: string | undefined;
346
+ })[] | undefined;
347
+ role?: string | undefined;
227
348
  worktreeId?: string | undefined;
228
349
  agentConfig?: Record<string, unknown> | undefined;
350
+ reasoning?: {
351
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
352
+ } | undefined;
229
353
  input?: string | undefined;
354
+ dependsOn?: string[] | undefined;
230
355
  branch?: string | undefined;
231
356
  systemPrompt?: string | undefined;
232
- dependsOn?: string[] | undefined;
233
357
  metadata?: Record<string, unknown> | undefined;
234
358
  }[];
235
359
  edges?: {
@@ -296,6 +420,35 @@ export declare const WorkflowExecutorNode: z.ZodObject<{
296
420
  nodeId: z.ZodString;
297
421
  agent: z.ZodBranded<z.ZodString, "AgentId">;
298
422
  model: z.ZodString;
423
+ reasoning: z.ZodOptional<z.ZodObject<{
424
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
425
+ }, "strict", z.ZodTypeAny, {
426
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
427
+ }, {
428
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
429
+ }>>;
430
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
431
+ name: z.ZodEffects<z.ZodString, string, string>;
432
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
433
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
434
+ force: z.ZodOptional<z.ZodBoolean>;
435
+ revision: z.ZodOptional<z.ZodString>;
436
+ installationId: z.ZodOptional<z.ZodString>;
437
+ }, "strict", z.ZodTypeAny, {
438
+ name: string;
439
+ version?: string | undefined;
440
+ scope?: "project" | "global" | undefined;
441
+ force?: boolean | undefined;
442
+ revision?: string | undefined;
443
+ installationId?: string | undefined;
444
+ }, {
445
+ name: string;
446
+ version?: string | undefined;
447
+ scope?: "project" | "global" | undefined;
448
+ force?: boolean | undefined;
449
+ revision?: string | undefined;
450
+ installationId?: string | undefined;
451
+ }>]>, "many">>;
299
452
  input: z.ZodOptional<z.ZodString>;
300
453
  systemPrompt: z.ZodOptional<z.ZodString>;
301
454
  dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -309,31 +462,53 @@ export declare const WorkflowExecutorNode: z.ZodObject<{
309
462
  role: z.ZodDefault<z.ZodLiteral<"executor">>;
310
463
  }, "strip", z.ZodTypeAny, {
311
464
  agent: string & z.BRAND<"AgentId">;
312
- role: "executor";
313
465
  model: string;
314
466
  nodeId: string;
467
+ role: "executor";
315
468
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
316
469
  project?: (string & z.BRAND<"ProjectId">) | undefined;
470
+ skills?: (string | {
471
+ name: string;
472
+ version?: string | undefined;
473
+ scope?: "project" | "global" | undefined;
474
+ force?: boolean | undefined;
475
+ revision?: string | undefined;
476
+ installationId?: string | undefined;
477
+ })[] | undefined;
317
478
  worktreeId?: string | undefined;
318
479
  agentConfig?: Record<string, unknown> | undefined;
480
+ reasoning?: {
481
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
482
+ } | undefined;
319
483
  input?: string | undefined;
484
+ dependsOn?: string[] | undefined;
320
485
  branch?: string | undefined;
321
486
  systemPrompt?: string | undefined;
322
- dependsOn?: string[] | undefined;
323
487
  metadata?: Record<string, unknown> | undefined;
324
488
  }, {
325
489
  agent: string;
326
490
  model: string;
327
491
  nodeId: string;
328
492
  sessionId?: string | undefined;
329
- role?: "executor" | undefined;
330
493
  project?: string | undefined;
494
+ skills?: (string | {
495
+ name: string;
496
+ version?: string | undefined;
497
+ scope?: "project" | "global" | undefined;
498
+ force?: boolean | undefined;
499
+ revision?: string | undefined;
500
+ installationId?: string | undefined;
501
+ })[] | undefined;
502
+ role?: "executor" | undefined;
331
503
  worktreeId?: string | undefined;
332
504
  agentConfig?: Record<string, unknown> | undefined;
505
+ reasoning?: {
506
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
507
+ } | undefined;
333
508
  input?: string | undefined;
509
+ dependsOn?: string[] | undefined;
334
510
  branch?: string | undefined;
335
511
  systemPrompt?: string | undefined;
336
- dependsOn?: string[] | undefined;
337
512
  metadata?: Record<string, unknown> | undefined;
338
513
  }>;
339
514
  export type WorkflowExecutorNode = z.infer<typeof WorkflowExecutorNode>;
@@ -343,6 +518,35 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
343
518
  nodeId: z.ZodString;
344
519
  agent: z.ZodBranded<z.ZodString, "AgentId">;
345
520
  model: z.ZodString;
521
+ reasoning: z.ZodOptional<z.ZodObject<{
522
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
523
+ }, "strict", z.ZodTypeAny, {
524
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
525
+ }, {
526
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
527
+ }>>;
528
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
529
+ name: z.ZodEffects<z.ZodString, string, string>;
530
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
531
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
532
+ force: z.ZodOptional<z.ZodBoolean>;
533
+ revision: z.ZodOptional<z.ZodString>;
534
+ installationId: z.ZodOptional<z.ZodString>;
535
+ }, "strict", z.ZodTypeAny, {
536
+ name: string;
537
+ version?: string | undefined;
538
+ scope?: "project" | "global" | undefined;
539
+ force?: boolean | undefined;
540
+ revision?: string | undefined;
541
+ installationId?: string | undefined;
542
+ }, {
543
+ name: string;
544
+ version?: string | undefined;
545
+ scope?: "project" | "global" | undefined;
546
+ force?: boolean | undefined;
547
+ revision?: string | undefined;
548
+ installationId?: string | undefined;
549
+ }>]>, "many">>;
346
550
  input: z.ZodOptional<z.ZodString>;
347
551
  systemPrompt: z.ZodOptional<z.ZodString>;
348
552
  dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -356,37 +560,88 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
356
560
  role: z.ZodDefault<z.ZodLiteral<"executor">>;
357
561
  }, "strip", z.ZodTypeAny, {
358
562
  agent: string & z.BRAND<"AgentId">;
359
- role: "executor";
360
563
  model: string;
361
564
  nodeId: string;
565
+ role: "executor";
362
566
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
363
567
  project?: (string & z.BRAND<"ProjectId">) | undefined;
568
+ skills?: (string | {
569
+ name: string;
570
+ version?: string | undefined;
571
+ scope?: "project" | "global" | undefined;
572
+ force?: boolean | undefined;
573
+ revision?: string | undefined;
574
+ installationId?: string | undefined;
575
+ })[] | undefined;
364
576
  worktreeId?: string | undefined;
365
577
  agentConfig?: Record<string, unknown> | undefined;
578
+ reasoning?: {
579
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
580
+ } | undefined;
366
581
  input?: string | undefined;
582
+ dependsOn?: string[] | undefined;
367
583
  branch?: string | undefined;
368
584
  systemPrompt?: string | undefined;
369
- dependsOn?: string[] | undefined;
370
585
  metadata?: Record<string, unknown> | undefined;
371
586
  }, {
372
587
  agent: string;
373
588
  model: string;
374
589
  nodeId: string;
375
590
  sessionId?: string | undefined;
376
- role?: "executor" | undefined;
377
591
  project?: string | undefined;
592
+ skills?: (string | {
593
+ name: string;
594
+ version?: string | undefined;
595
+ scope?: "project" | "global" | undefined;
596
+ force?: boolean | undefined;
597
+ revision?: string | undefined;
598
+ installationId?: string | undefined;
599
+ })[] | undefined;
600
+ role?: "executor" | undefined;
378
601
  worktreeId?: string | undefined;
379
602
  agentConfig?: Record<string, unknown> | undefined;
603
+ reasoning?: {
604
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
605
+ } | undefined;
380
606
  input?: string | undefined;
607
+ dependsOn?: string[] | undefined;
381
608
  branch?: string | undefined;
382
609
  systemPrompt?: string | undefined;
383
- dependsOn?: string[] | undefined;
384
610
  metadata?: Record<string, unknown> | undefined;
385
611
  }>;
386
612
  workers: z.ZodArray<z.ZodObject<{
387
613
  nodeId: z.ZodString;
388
614
  agent: z.ZodBranded<z.ZodString, "AgentId">;
389
615
  model: z.ZodString;
616
+ reasoning: z.ZodOptional<z.ZodObject<{
617
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
618
+ }, "strict", z.ZodTypeAny, {
619
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
620
+ }, {
621
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
622
+ }>>;
623
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
624
+ name: z.ZodEffects<z.ZodString, string, string>;
625
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
626
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
627
+ force: z.ZodOptional<z.ZodBoolean>;
628
+ revision: z.ZodOptional<z.ZodString>;
629
+ installationId: z.ZodOptional<z.ZodString>;
630
+ }, "strict", z.ZodTypeAny, {
631
+ name: string;
632
+ version?: string | undefined;
633
+ scope?: "project" | "global" | undefined;
634
+ force?: boolean | undefined;
635
+ revision?: string | undefined;
636
+ installationId?: string | undefined;
637
+ }, {
638
+ name: string;
639
+ version?: string | undefined;
640
+ scope?: "project" | "global" | undefined;
641
+ force?: boolean | undefined;
642
+ revision?: string | undefined;
643
+ installationId?: string | undefined;
644
+ }>]>, "many">>;
390
645
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
391
646
  role: z.ZodOptional<z.ZodString>;
392
647
  input: z.ZodOptional<z.ZodString>;
@@ -424,28 +679,50 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
424
679
  model: string;
425
680
  nodeId: string;
426
681
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
427
- role?: string | undefined;
428
682
  project?: (string & z.BRAND<"ProjectId">) | undefined;
683
+ skills?: (string | {
684
+ name: string;
685
+ version?: string | undefined;
686
+ scope?: "project" | "global" | undefined;
687
+ force?: boolean | undefined;
688
+ revision?: string | undefined;
689
+ installationId?: string | undefined;
690
+ })[] | undefined;
691
+ role?: string | undefined;
429
692
  worktreeId?: string | undefined;
430
693
  agentConfig?: Record<string, unknown> | undefined;
694
+ reasoning?: {
695
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
696
+ } | undefined;
431
697
  input?: string | undefined;
698
+ dependsOn?: string[] | undefined;
432
699
  branch?: string | undefined;
433
700
  systemPrompt?: string | undefined;
434
- dependsOn?: string[] | undefined;
435
701
  metadata?: Record<string, unknown> | undefined;
436
702
  }, {
437
703
  agent: string;
438
704
  model: string;
439
705
  nodeId: string;
440
706
  sessionId?: string | undefined;
441
- role?: string | undefined;
442
707
  project?: string | undefined;
708
+ skills?: (string | {
709
+ name: string;
710
+ version?: string | undefined;
711
+ scope?: "project" | "global" | undefined;
712
+ force?: boolean | undefined;
713
+ revision?: string | undefined;
714
+ installationId?: string | undefined;
715
+ })[] | undefined;
716
+ role?: string | undefined;
443
717
  worktreeId?: string | undefined;
444
718
  agentConfig?: Record<string, unknown> | undefined;
719
+ reasoning?: {
720
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
721
+ } | undefined;
445
722
  input?: string | undefined;
723
+ dependsOn?: string[] | undefined;
446
724
  branch?: string | undefined;
447
725
  systemPrompt?: string | undefined;
448
- dependsOn?: string[] | undefined;
449
726
  metadata?: Record<string, unknown> | undefined;
450
727
  }>, "many">;
451
728
  communicationGraph: z.ZodObject<{
@@ -499,17 +776,28 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
499
776
  }, "strip", z.ZodTypeAny, {
500
777
  executor: {
501
778
  agent: string & z.BRAND<"AgentId">;
502
- role: "executor";
503
779
  model: string;
504
780
  nodeId: string;
781
+ role: "executor";
505
782
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
506
783
  project?: (string & z.BRAND<"ProjectId">) | undefined;
784
+ skills?: (string | {
785
+ name: string;
786
+ version?: string | undefined;
787
+ scope?: "project" | "global" | undefined;
788
+ force?: boolean | undefined;
789
+ revision?: string | undefined;
790
+ installationId?: string | undefined;
791
+ })[] | undefined;
507
792
  worktreeId?: string | undefined;
508
793
  agentConfig?: Record<string, unknown> | undefined;
794
+ reasoning?: {
795
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
796
+ } | undefined;
509
797
  input?: string | undefined;
798
+ dependsOn?: string[] | undefined;
510
799
  branch?: string | undefined;
511
800
  systemPrompt?: string | undefined;
512
- dependsOn?: string[] | undefined;
513
801
  metadata?: Record<string, unknown> | undefined;
514
802
  };
515
803
  mode: "graph";
@@ -518,14 +806,25 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
518
806
  model: string;
519
807
  nodeId: string;
520
808
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
521
- role?: string | undefined;
522
809
  project?: (string & z.BRAND<"ProjectId">) | undefined;
810
+ skills?: (string | {
811
+ name: string;
812
+ version?: string | undefined;
813
+ scope?: "project" | "global" | undefined;
814
+ force?: boolean | undefined;
815
+ revision?: string | undefined;
816
+ installationId?: string | undefined;
817
+ })[] | undefined;
818
+ role?: string | undefined;
523
819
  worktreeId?: string | undefined;
524
820
  agentConfig?: Record<string, unknown> | undefined;
821
+ reasoning?: {
822
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
823
+ } | undefined;
525
824
  input?: string | undefined;
825
+ dependsOn?: string[] | undefined;
526
826
  branch?: string | undefined;
527
827
  systemPrompt?: string | undefined;
528
- dependsOn?: string[] | undefined;
529
828
  metadata?: Record<string, unknown> | undefined;
530
829
  }[];
531
830
  communicationGraph: {
@@ -546,14 +845,25 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
546
845
  model: string;
547
846
  nodeId: string;
548
847
  sessionId?: string | undefined;
549
- role?: "executor" | undefined;
550
848
  project?: string | undefined;
849
+ skills?: (string | {
850
+ name: string;
851
+ version?: string | undefined;
852
+ scope?: "project" | "global" | undefined;
853
+ force?: boolean | undefined;
854
+ revision?: string | undefined;
855
+ installationId?: string | undefined;
856
+ })[] | undefined;
857
+ role?: "executor" | undefined;
551
858
  worktreeId?: string | undefined;
552
859
  agentConfig?: Record<string, unknown> | undefined;
860
+ reasoning?: {
861
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
862
+ } | undefined;
553
863
  input?: string | undefined;
864
+ dependsOn?: string[] | undefined;
554
865
  branch?: string | undefined;
555
866
  systemPrompt?: string | undefined;
556
- dependsOn?: string[] | undefined;
557
867
  metadata?: Record<string, unknown> | undefined;
558
868
  };
559
869
  mode: "graph";
@@ -562,14 +872,25 @@ export declare const WorkflowGraphPlan: z.ZodObject<{
562
872
  model: string;
563
873
  nodeId: string;
564
874
  sessionId?: string | undefined;
565
- role?: string | undefined;
566
875
  project?: string | undefined;
876
+ skills?: (string | {
877
+ name: string;
878
+ version?: string | undefined;
879
+ scope?: "project" | "global" | undefined;
880
+ force?: boolean | undefined;
881
+ revision?: string | undefined;
882
+ installationId?: string | undefined;
883
+ })[] | undefined;
884
+ role?: string | undefined;
567
885
  worktreeId?: string | undefined;
568
886
  agentConfig?: Record<string, unknown> | undefined;
887
+ reasoning?: {
888
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
889
+ } | undefined;
569
890
  input?: string | undefined;
891
+ dependsOn?: string[] | undefined;
570
892
  branch?: string | undefined;
571
893
  systemPrompt?: string | undefined;
572
- dependsOn?: string[] | undefined;
573
894
  metadata?: Record<string, unknown> | undefined;
574
895
  }[];
575
896
  communicationGraph: {
@@ -595,6 +916,35 @@ export declare const WorkflowDiscussionPlan: z.ZodObject<{
595
916
  nodeId: z.ZodString;
596
917
  agent: z.ZodBranded<z.ZodString, "AgentId">;
597
918
  model: z.ZodString;
919
+ reasoning: z.ZodOptional<z.ZodObject<{
920
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
921
+ }, "strict", z.ZodTypeAny, {
922
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
923
+ }, {
924
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
925
+ }>>;
926
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
927
+ name: z.ZodEffects<z.ZodString, string, string>;
928
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
929
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
930
+ force: z.ZodOptional<z.ZodBoolean>;
931
+ revision: z.ZodOptional<z.ZodString>;
932
+ installationId: z.ZodOptional<z.ZodString>;
933
+ }, "strict", z.ZodTypeAny, {
934
+ name: string;
935
+ version?: string | undefined;
936
+ scope?: "project" | "global" | undefined;
937
+ force?: boolean | undefined;
938
+ revision?: string | undefined;
939
+ installationId?: string | undefined;
940
+ }, {
941
+ name: string;
942
+ version?: string | undefined;
943
+ scope?: "project" | "global" | undefined;
944
+ force?: boolean | undefined;
945
+ revision?: string | undefined;
946
+ installationId?: string | undefined;
947
+ }>]>, "many">>;
598
948
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
599
949
  role: z.ZodOptional<z.ZodString>;
600
950
  input: z.ZodOptional<z.ZodString>;
@@ -632,28 +982,50 @@ export declare const WorkflowDiscussionPlan: z.ZodObject<{
632
982
  model: string;
633
983
  nodeId: string;
634
984
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
635
- role?: string | undefined;
636
985
  project?: (string & z.BRAND<"ProjectId">) | undefined;
986
+ skills?: (string | {
987
+ name: string;
988
+ version?: string | undefined;
989
+ scope?: "project" | "global" | undefined;
990
+ force?: boolean | undefined;
991
+ revision?: string | undefined;
992
+ installationId?: string | undefined;
993
+ })[] | undefined;
994
+ role?: string | undefined;
637
995
  worktreeId?: string | undefined;
638
996
  agentConfig?: Record<string, unknown> | undefined;
997
+ reasoning?: {
998
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
999
+ } | undefined;
639
1000
  input?: string | undefined;
1001
+ dependsOn?: string[] | undefined;
640
1002
  branch?: string | undefined;
641
1003
  systemPrompt?: string | undefined;
642
- dependsOn?: string[] | undefined;
643
1004
  metadata?: Record<string, unknown> | undefined;
644
1005
  }, {
645
1006
  agent: string;
646
1007
  model: string;
647
1008
  nodeId: string;
648
1009
  sessionId?: string | undefined;
649
- role?: string | undefined;
650
1010
  project?: string | undefined;
1011
+ skills?: (string | {
1012
+ name: string;
1013
+ version?: string | undefined;
1014
+ scope?: "project" | "global" | undefined;
1015
+ force?: boolean | undefined;
1016
+ revision?: string | undefined;
1017
+ installationId?: string | undefined;
1018
+ })[] | undefined;
1019
+ role?: string | undefined;
651
1020
  worktreeId?: string | undefined;
652
1021
  agentConfig?: Record<string, unknown> | undefined;
1022
+ reasoning?: {
1023
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1024
+ } | undefined;
653
1025
  input?: string | undefined;
1026
+ dependsOn?: string[] | undefined;
654
1027
  branch?: string | undefined;
655
1028
  systemPrompt?: string | undefined;
656
- dependsOn?: string[] | undefined;
657
1029
  metadata?: Record<string, unknown> | undefined;
658
1030
  }>, "many">;
659
1031
  /** Chairman 必须是 participants 之一的 nodeId,每轮所有 participant 发完它再 review + 决定续/停。 */
@@ -682,14 +1054,25 @@ export declare const WorkflowDiscussionPlan: z.ZodObject<{
682
1054
  model: string;
683
1055
  nodeId: string;
684
1056
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
685
- role?: string | undefined;
686
1057
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1058
+ skills?: (string | {
1059
+ name: string;
1060
+ version?: string | undefined;
1061
+ scope?: "project" | "global" | undefined;
1062
+ force?: boolean | undefined;
1063
+ revision?: string | undefined;
1064
+ installationId?: string | undefined;
1065
+ })[] | undefined;
1066
+ role?: string | undefined;
687
1067
  worktreeId?: string | undefined;
688
1068
  agentConfig?: Record<string, unknown> | undefined;
1069
+ reasoning?: {
1070
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1071
+ } | undefined;
689
1072
  input?: string | undefined;
1073
+ dependsOn?: string[] | undefined;
690
1074
  branch?: string | undefined;
691
1075
  systemPrompt?: string | undefined;
692
- dependsOn?: string[] | undefined;
693
1076
  metadata?: Record<string, unknown> | undefined;
694
1077
  }[];
695
1078
  chairman: string;
@@ -706,14 +1089,25 @@ export declare const WorkflowDiscussionPlan: z.ZodObject<{
706
1089
  model: string;
707
1090
  nodeId: string;
708
1091
  sessionId?: string | undefined;
709
- role?: string | undefined;
710
1092
  project?: string | undefined;
1093
+ skills?: (string | {
1094
+ name: string;
1095
+ version?: string | undefined;
1096
+ scope?: "project" | "global" | undefined;
1097
+ force?: boolean | undefined;
1098
+ revision?: string | undefined;
1099
+ installationId?: string | undefined;
1100
+ })[] | undefined;
1101
+ role?: string | undefined;
711
1102
  worktreeId?: string | undefined;
712
1103
  agentConfig?: Record<string, unknown> | undefined;
1104
+ reasoning?: {
1105
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1106
+ } | undefined;
713
1107
  input?: string | undefined;
1108
+ dependsOn?: string[] | undefined;
714
1109
  branch?: string | undefined;
715
1110
  systemPrompt?: string | undefined;
716
- dependsOn?: string[] | undefined;
717
1111
  metadata?: Record<string, unknown> | undefined;
718
1112
  }[];
719
1113
  chairman: string;
@@ -730,6 +1124,35 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
730
1124
  nodeId: z.ZodString;
731
1125
  agent: z.ZodBranded<z.ZodString, "AgentId">;
732
1126
  model: z.ZodString;
1127
+ reasoning: z.ZodOptional<z.ZodObject<{
1128
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
1129
+ }, "strict", z.ZodTypeAny, {
1130
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1131
+ }, {
1132
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1133
+ }>>;
1134
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
1135
+ name: z.ZodEffects<z.ZodString, string, string>;
1136
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1137
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
1138
+ force: z.ZodOptional<z.ZodBoolean>;
1139
+ revision: z.ZodOptional<z.ZodString>;
1140
+ installationId: z.ZodOptional<z.ZodString>;
1141
+ }, "strict", z.ZodTypeAny, {
1142
+ name: string;
1143
+ version?: string | undefined;
1144
+ scope?: "project" | "global" | undefined;
1145
+ force?: boolean | undefined;
1146
+ revision?: string | undefined;
1147
+ installationId?: string | undefined;
1148
+ }, {
1149
+ name: string;
1150
+ version?: string | undefined;
1151
+ scope?: "project" | "global" | undefined;
1152
+ force?: boolean | undefined;
1153
+ revision?: string | undefined;
1154
+ installationId?: string | undefined;
1155
+ }>]>, "many">>;
733
1156
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
734
1157
  role: z.ZodOptional<z.ZodString>;
735
1158
  input: z.ZodOptional<z.ZodString>;
@@ -767,28 +1190,50 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
767
1190
  model: string;
768
1191
  nodeId: string;
769
1192
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
770
- role?: string | undefined;
771
1193
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1194
+ skills?: (string | {
1195
+ name: string;
1196
+ version?: string | undefined;
1197
+ scope?: "project" | "global" | undefined;
1198
+ force?: boolean | undefined;
1199
+ revision?: string | undefined;
1200
+ installationId?: string | undefined;
1201
+ })[] | undefined;
1202
+ role?: string | undefined;
772
1203
  worktreeId?: string | undefined;
773
1204
  agentConfig?: Record<string, unknown> | undefined;
1205
+ reasoning?: {
1206
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1207
+ } | undefined;
774
1208
  input?: string | undefined;
1209
+ dependsOn?: string[] | undefined;
775
1210
  branch?: string | undefined;
776
1211
  systemPrompt?: string | undefined;
777
- dependsOn?: string[] | undefined;
778
1212
  metadata?: Record<string, unknown> | undefined;
779
1213
  }, {
780
1214
  agent: string;
781
1215
  model: string;
782
1216
  nodeId: string;
783
1217
  sessionId?: string | undefined;
784
- role?: string | undefined;
785
1218
  project?: string | undefined;
1219
+ skills?: (string | {
1220
+ name: string;
1221
+ version?: string | undefined;
1222
+ scope?: "project" | "global" | undefined;
1223
+ force?: boolean | undefined;
1224
+ revision?: string | undefined;
1225
+ installationId?: string | undefined;
1226
+ })[] | undefined;
1227
+ role?: string | undefined;
786
1228
  worktreeId?: string | undefined;
787
1229
  agentConfig?: Record<string, unknown> | undefined;
1230
+ reasoning?: {
1231
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1232
+ } | undefined;
788
1233
  input?: string | undefined;
1234
+ dependsOn?: string[] | undefined;
789
1235
  branch?: string | undefined;
790
1236
  systemPrompt?: string | undefined;
791
- dependsOn?: string[] | undefined;
792
1237
  metadata?: Record<string, unknown> | undefined;
793
1238
  }>, "many">;
794
1239
  edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -821,14 +1266,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
821
1266
  model: string;
822
1267
  nodeId: string;
823
1268
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
824
- role?: string | undefined;
825
1269
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1270
+ skills?: (string | {
1271
+ name: string;
1272
+ version?: string | undefined;
1273
+ scope?: "project" | "global" | undefined;
1274
+ force?: boolean | undefined;
1275
+ revision?: string | undefined;
1276
+ installationId?: string | undefined;
1277
+ })[] | undefined;
1278
+ role?: string | undefined;
826
1279
  worktreeId?: string | undefined;
827
1280
  agentConfig?: Record<string, unknown> | undefined;
1281
+ reasoning?: {
1282
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1283
+ } | undefined;
828
1284
  input?: string | undefined;
1285
+ dependsOn?: string[] | undefined;
829
1286
  branch?: string | undefined;
830
1287
  systemPrompt?: string | undefined;
831
- dependsOn?: string[] | undefined;
832
1288
  metadata?: Record<string, unknown> | undefined;
833
1289
  }[];
834
1290
  edges?: {
@@ -847,14 +1303,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
847
1303
  model: string;
848
1304
  nodeId: string;
849
1305
  sessionId?: string | undefined;
850
- role?: string | undefined;
851
1306
  project?: string | undefined;
1307
+ skills?: (string | {
1308
+ name: string;
1309
+ version?: string | undefined;
1310
+ scope?: "project" | "global" | undefined;
1311
+ force?: boolean | undefined;
1312
+ revision?: string | undefined;
1313
+ installationId?: string | undefined;
1314
+ })[] | undefined;
1315
+ role?: string | undefined;
852
1316
  worktreeId?: string | undefined;
853
1317
  agentConfig?: Record<string, unknown> | undefined;
1318
+ reasoning?: {
1319
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1320
+ } | undefined;
854
1321
  input?: string | undefined;
1322
+ dependsOn?: string[] | undefined;
855
1323
  branch?: string | undefined;
856
1324
  systemPrompt?: string | undefined;
857
- dependsOn?: string[] | undefined;
858
1325
  metadata?: Record<string, unknown> | undefined;
859
1326
  }[];
860
1327
  edges?: {
@@ -872,6 +1339,35 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
872
1339
  nodeId: z.ZodString;
873
1340
  agent: z.ZodBranded<z.ZodString, "AgentId">;
874
1341
  model: z.ZodString;
1342
+ reasoning: z.ZodOptional<z.ZodObject<{
1343
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
1344
+ }, "strict", z.ZodTypeAny, {
1345
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1346
+ }, {
1347
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1348
+ }>>;
1349
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
1350
+ name: z.ZodEffects<z.ZodString, string, string>;
1351
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1352
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
1353
+ force: z.ZodOptional<z.ZodBoolean>;
1354
+ revision: z.ZodOptional<z.ZodString>;
1355
+ installationId: z.ZodOptional<z.ZodString>;
1356
+ }, "strict", z.ZodTypeAny, {
1357
+ name: string;
1358
+ version?: string | undefined;
1359
+ scope?: "project" | "global" | undefined;
1360
+ force?: boolean | undefined;
1361
+ revision?: string | undefined;
1362
+ installationId?: string | undefined;
1363
+ }, {
1364
+ name: string;
1365
+ version?: string | undefined;
1366
+ scope?: "project" | "global" | undefined;
1367
+ force?: boolean | undefined;
1368
+ revision?: string | undefined;
1369
+ installationId?: string | undefined;
1370
+ }>]>, "many">>;
875
1371
  input: z.ZodOptional<z.ZodString>;
876
1372
  systemPrompt: z.ZodOptional<z.ZodString>;
877
1373
  dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -885,37 +1381,88 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
885
1381
  role: z.ZodDefault<z.ZodLiteral<"executor">>;
886
1382
  }, "strip", z.ZodTypeAny, {
887
1383
  agent: string & z.BRAND<"AgentId">;
888
- role: "executor";
889
1384
  model: string;
890
1385
  nodeId: string;
1386
+ role: "executor";
891
1387
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
892
1388
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1389
+ skills?: (string | {
1390
+ name: string;
1391
+ version?: string | undefined;
1392
+ scope?: "project" | "global" | undefined;
1393
+ force?: boolean | undefined;
1394
+ revision?: string | undefined;
1395
+ installationId?: string | undefined;
1396
+ })[] | undefined;
893
1397
  worktreeId?: string | undefined;
894
1398
  agentConfig?: Record<string, unknown> | undefined;
1399
+ reasoning?: {
1400
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1401
+ } | undefined;
895
1402
  input?: string | undefined;
1403
+ dependsOn?: string[] | undefined;
896
1404
  branch?: string | undefined;
897
1405
  systemPrompt?: string | undefined;
898
- dependsOn?: string[] | undefined;
899
1406
  metadata?: Record<string, unknown> | undefined;
900
1407
  }, {
901
1408
  agent: string;
902
1409
  model: string;
903
1410
  nodeId: string;
904
1411
  sessionId?: string | undefined;
905
- role?: "executor" | undefined;
906
1412
  project?: string | undefined;
1413
+ skills?: (string | {
1414
+ name: string;
1415
+ version?: string | undefined;
1416
+ scope?: "project" | "global" | undefined;
1417
+ force?: boolean | undefined;
1418
+ revision?: string | undefined;
1419
+ installationId?: string | undefined;
1420
+ })[] | undefined;
1421
+ role?: "executor" | undefined;
907
1422
  worktreeId?: string | undefined;
908
1423
  agentConfig?: Record<string, unknown> | undefined;
1424
+ reasoning?: {
1425
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1426
+ } | undefined;
909
1427
  input?: string | undefined;
1428
+ dependsOn?: string[] | undefined;
910
1429
  branch?: string | undefined;
911
1430
  systemPrompt?: string | undefined;
912
- dependsOn?: string[] | undefined;
913
1431
  metadata?: Record<string, unknown> | undefined;
914
1432
  }>;
915
1433
  workers: z.ZodArray<z.ZodObject<{
916
1434
  nodeId: z.ZodString;
917
1435
  agent: z.ZodBranded<z.ZodString, "AgentId">;
918
1436
  model: z.ZodString;
1437
+ reasoning: z.ZodOptional<z.ZodObject<{
1438
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
1439
+ }, "strict", z.ZodTypeAny, {
1440
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1441
+ }, {
1442
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1443
+ }>>;
1444
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
1445
+ name: z.ZodEffects<z.ZodString, string, string>;
1446
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1447
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
1448
+ force: z.ZodOptional<z.ZodBoolean>;
1449
+ revision: z.ZodOptional<z.ZodString>;
1450
+ installationId: z.ZodOptional<z.ZodString>;
1451
+ }, "strict", z.ZodTypeAny, {
1452
+ name: string;
1453
+ version?: string | undefined;
1454
+ scope?: "project" | "global" | undefined;
1455
+ force?: boolean | undefined;
1456
+ revision?: string | undefined;
1457
+ installationId?: string | undefined;
1458
+ }, {
1459
+ name: string;
1460
+ version?: string | undefined;
1461
+ scope?: "project" | "global" | undefined;
1462
+ force?: boolean | undefined;
1463
+ revision?: string | undefined;
1464
+ installationId?: string | undefined;
1465
+ }>]>, "many">>;
919
1466
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
920
1467
  role: z.ZodOptional<z.ZodString>;
921
1468
  input: z.ZodOptional<z.ZodString>;
@@ -953,28 +1500,50 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
953
1500
  model: string;
954
1501
  nodeId: string;
955
1502
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
956
- role?: string | undefined;
957
1503
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1504
+ skills?: (string | {
1505
+ name: string;
1506
+ version?: string | undefined;
1507
+ scope?: "project" | "global" | undefined;
1508
+ force?: boolean | undefined;
1509
+ revision?: string | undefined;
1510
+ installationId?: string | undefined;
1511
+ })[] | undefined;
1512
+ role?: string | undefined;
958
1513
  worktreeId?: string | undefined;
959
1514
  agentConfig?: Record<string, unknown> | undefined;
1515
+ reasoning?: {
1516
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1517
+ } | undefined;
960
1518
  input?: string | undefined;
1519
+ dependsOn?: string[] | undefined;
961
1520
  branch?: string | undefined;
962
1521
  systemPrompt?: string | undefined;
963
- dependsOn?: string[] | undefined;
964
1522
  metadata?: Record<string, unknown> | undefined;
965
1523
  }, {
966
1524
  agent: string;
967
1525
  model: string;
968
1526
  nodeId: string;
969
1527
  sessionId?: string | undefined;
970
- role?: string | undefined;
971
1528
  project?: string | undefined;
1529
+ skills?: (string | {
1530
+ name: string;
1531
+ version?: string | undefined;
1532
+ scope?: "project" | "global" | undefined;
1533
+ force?: boolean | undefined;
1534
+ revision?: string | undefined;
1535
+ installationId?: string | undefined;
1536
+ })[] | undefined;
1537
+ role?: string | undefined;
972
1538
  worktreeId?: string | undefined;
973
1539
  agentConfig?: Record<string, unknown> | undefined;
1540
+ reasoning?: {
1541
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1542
+ } | undefined;
974
1543
  input?: string | undefined;
1544
+ dependsOn?: string[] | undefined;
975
1545
  branch?: string | undefined;
976
1546
  systemPrompt?: string | undefined;
977
- dependsOn?: string[] | undefined;
978
1547
  metadata?: Record<string, unknown> | undefined;
979
1548
  }>, "many">;
980
1549
  communicationGraph: z.ZodObject<{
@@ -1028,17 +1597,28 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1028
1597
  }, "strip", z.ZodTypeAny, {
1029
1598
  executor: {
1030
1599
  agent: string & z.BRAND<"AgentId">;
1031
- role: "executor";
1032
1600
  model: string;
1033
1601
  nodeId: string;
1602
+ role: "executor";
1034
1603
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1035
1604
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1605
+ skills?: (string | {
1606
+ name: string;
1607
+ version?: string | undefined;
1608
+ scope?: "project" | "global" | undefined;
1609
+ force?: boolean | undefined;
1610
+ revision?: string | undefined;
1611
+ installationId?: string | undefined;
1612
+ })[] | undefined;
1036
1613
  worktreeId?: string | undefined;
1037
1614
  agentConfig?: Record<string, unknown> | undefined;
1615
+ reasoning?: {
1616
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1617
+ } | undefined;
1038
1618
  input?: string | undefined;
1619
+ dependsOn?: string[] | undefined;
1039
1620
  branch?: string | undefined;
1040
1621
  systemPrompt?: string | undefined;
1041
- dependsOn?: string[] | undefined;
1042
1622
  metadata?: Record<string, unknown> | undefined;
1043
1623
  };
1044
1624
  mode: "graph";
@@ -1047,14 +1627,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1047
1627
  model: string;
1048
1628
  nodeId: string;
1049
1629
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1050
- role?: string | undefined;
1051
1630
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1631
+ skills?: (string | {
1632
+ name: string;
1633
+ version?: string | undefined;
1634
+ scope?: "project" | "global" | undefined;
1635
+ force?: boolean | undefined;
1636
+ revision?: string | undefined;
1637
+ installationId?: string | undefined;
1638
+ })[] | undefined;
1639
+ role?: string | undefined;
1052
1640
  worktreeId?: string | undefined;
1053
1641
  agentConfig?: Record<string, unknown> | undefined;
1642
+ reasoning?: {
1643
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1644
+ } | undefined;
1054
1645
  input?: string | undefined;
1646
+ dependsOn?: string[] | undefined;
1055
1647
  branch?: string | undefined;
1056
1648
  systemPrompt?: string | undefined;
1057
- dependsOn?: string[] | undefined;
1058
1649
  metadata?: Record<string, unknown> | undefined;
1059
1650
  }[];
1060
1651
  communicationGraph: {
@@ -1075,14 +1666,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1075
1666
  model: string;
1076
1667
  nodeId: string;
1077
1668
  sessionId?: string | undefined;
1078
- role?: "executor" | undefined;
1079
1669
  project?: string | undefined;
1670
+ skills?: (string | {
1671
+ name: string;
1672
+ version?: string | undefined;
1673
+ scope?: "project" | "global" | undefined;
1674
+ force?: boolean | undefined;
1675
+ revision?: string | undefined;
1676
+ installationId?: string | undefined;
1677
+ })[] | undefined;
1678
+ role?: "executor" | undefined;
1080
1679
  worktreeId?: string | undefined;
1081
1680
  agentConfig?: Record<string, unknown> | undefined;
1681
+ reasoning?: {
1682
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1683
+ } | undefined;
1082
1684
  input?: string | undefined;
1685
+ dependsOn?: string[] | undefined;
1083
1686
  branch?: string | undefined;
1084
1687
  systemPrompt?: string | undefined;
1085
- dependsOn?: string[] | undefined;
1086
1688
  metadata?: Record<string, unknown> | undefined;
1087
1689
  };
1088
1690
  mode: "graph";
@@ -1091,14 +1693,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1091
1693
  model: string;
1092
1694
  nodeId: string;
1093
1695
  sessionId?: string | undefined;
1094
- role?: string | undefined;
1095
1696
  project?: string | undefined;
1697
+ skills?: (string | {
1698
+ name: string;
1699
+ version?: string | undefined;
1700
+ scope?: "project" | "global" | undefined;
1701
+ force?: boolean | undefined;
1702
+ revision?: string | undefined;
1703
+ installationId?: string | undefined;
1704
+ })[] | undefined;
1705
+ role?: string | undefined;
1096
1706
  worktreeId?: string | undefined;
1097
1707
  agentConfig?: Record<string, unknown> | undefined;
1708
+ reasoning?: {
1709
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1710
+ } | undefined;
1098
1711
  input?: string | undefined;
1712
+ dependsOn?: string[] | undefined;
1099
1713
  branch?: string | undefined;
1100
1714
  systemPrompt?: string | undefined;
1101
- dependsOn?: string[] | undefined;
1102
1715
  metadata?: Record<string, unknown> | undefined;
1103
1716
  }[];
1104
1717
  communicationGraph: {
@@ -1122,6 +1735,35 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1122
1735
  nodeId: z.ZodString;
1123
1736
  agent: z.ZodBranded<z.ZodString, "AgentId">;
1124
1737
  model: z.ZodString;
1738
+ reasoning: z.ZodOptional<z.ZodObject<{
1739
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
1740
+ }, "strict", z.ZodTypeAny, {
1741
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1742
+ }, {
1743
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1744
+ }>>;
1745
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
1746
+ name: z.ZodEffects<z.ZodString, string, string>;
1747
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1748
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
1749
+ force: z.ZodOptional<z.ZodBoolean>;
1750
+ revision: z.ZodOptional<z.ZodString>;
1751
+ installationId: z.ZodOptional<z.ZodString>;
1752
+ }, "strict", z.ZodTypeAny, {
1753
+ name: string;
1754
+ version?: string | undefined;
1755
+ scope?: "project" | "global" | undefined;
1756
+ force?: boolean | undefined;
1757
+ revision?: string | undefined;
1758
+ installationId?: string | undefined;
1759
+ }, {
1760
+ name: string;
1761
+ version?: string | undefined;
1762
+ scope?: "project" | "global" | undefined;
1763
+ force?: boolean | undefined;
1764
+ revision?: string | undefined;
1765
+ installationId?: string | undefined;
1766
+ }>]>, "many">>;
1125
1767
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
1126
1768
  role: z.ZodOptional<z.ZodString>;
1127
1769
  input: z.ZodOptional<z.ZodString>;
@@ -1159,28 +1801,50 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1159
1801
  model: string;
1160
1802
  nodeId: string;
1161
1803
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1162
- role?: string | undefined;
1163
1804
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1805
+ skills?: (string | {
1806
+ name: string;
1807
+ version?: string | undefined;
1808
+ scope?: "project" | "global" | undefined;
1809
+ force?: boolean | undefined;
1810
+ revision?: string | undefined;
1811
+ installationId?: string | undefined;
1812
+ })[] | undefined;
1813
+ role?: string | undefined;
1164
1814
  worktreeId?: string | undefined;
1165
1815
  agentConfig?: Record<string, unknown> | undefined;
1816
+ reasoning?: {
1817
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1818
+ } | undefined;
1166
1819
  input?: string | undefined;
1820
+ dependsOn?: string[] | undefined;
1167
1821
  branch?: string | undefined;
1168
1822
  systemPrompt?: string | undefined;
1169
- dependsOn?: string[] | undefined;
1170
1823
  metadata?: Record<string, unknown> | undefined;
1171
1824
  }, {
1172
1825
  agent: string;
1173
1826
  model: string;
1174
1827
  nodeId: string;
1175
1828
  sessionId?: string | undefined;
1176
- role?: string | undefined;
1177
1829
  project?: string | undefined;
1830
+ skills?: (string | {
1831
+ name: string;
1832
+ version?: string | undefined;
1833
+ scope?: "project" | "global" | undefined;
1834
+ force?: boolean | undefined;
1835
+ revision?: string | undefined;
1836
+ installationId?: string | undefined;
1837
+ })[] | undefined;
1838
+ role?: string | undefined;
1178
1839
  worktreeId?: string | undefined;
1179
1840
  agentConfig?: Record<string, unknown> | undefined;
1841
+ reasoning?: {
1842
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1843
+ } | undefined;
1180
1844
  input?: string | undefined;
1845
+ dependsOn?: string[] | undefined;
1181
1846
  branch?: string | undefined;
1182
1847
  systemPrompt?: string | undefined;
1183
- dependsOn?: string[] | undefined;
1184
1848
  metadata?: Record<string, unknown> | undefined;
1185
1849
  }>, "many">;
1186
1850
  /** Chairman 必须是 participants 之一的 nodeId,每轮所有 participant 发完它再 review + 决定续/停。 */
@@ -1209,14 +1873,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1209
1873
  model: string;
1210
1874
  nodeId: string;
1211
1875
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1212
- role?: string | undefined;
1213
1876
  project?: (string & z.BRAND<"ProjectId">) | undefined;
1877
+ skills?: (string | {
1878
+ name: string;
1879
+ version?: string | undefined;
1880
+ scope?: "project" | "global" | undefined;
1881
+ force?: boolean | undefined;
1882
+ revision?: string | undefined;
1883
+ installationId?: string | undefined;
1884
+ })[] | undefined;
1885
+ role?: string | undefined;
1214
1886
  worktreeId?: string | undefined;
1215
1887
  agentConfig?: Record<string, unknown> | undefined;
1888
+ reasoning?: {
1889
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1890
+ } | undefined;
1216
1891
  input?: string | undefined;
1892
+ dependsOn?: string[] | undefined;
1217
1893
  branch?: string | undefined;
1218
1894
  systemPrompt?: string | undefined;
1219
- dependsOn?: string[] | undefined;
1220
1895
  metadata?: Record<string, unknown> | undefined;
1221
1896
  }[];
1222
1897
  chairman: string;
@@ -1233,14 +1908,25 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1233
1908
  model: string;
1234
1909
  nodeId: string;
1235
1910
  sessionId?: string | undefined;
1236
- role?: string | undefined;
1237
1911
  project?: string | undefined;
1912
+ skills?: (string | {
1913
+ name: string;
1914
+ version?: string | undefined;
1915
+ scope?: "project" | "global" | undefined;
1916
+ force?: boolean | undefined;
1917
+ revision?: string | undefined;
1918
+ installationId?: string | undefined;
1919
+ })[] | undefined;
1920
+ role?: string | undefined;
1238
1921
  worktreeId?: string | undefined;
1239
1922
  agentConfig?: Record<string, unknown> | undefined;
1923
+ reasoning?: {
1924
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
1925
+ } | undefined;
1240
1926
  input?: string | undefined;
1927
+ dependsOn?: string[] | undefined;
1241
1928
  branch?: string | undefined;
1242
1929
  systemPrompt?: string | undefined;
1243
- dependsOn?: string[] | undefined;
1244
1930
  metadata?: Record<string, unknown> | undefined;
1245
1931
  }[];
1246
1932
  chairman: string;
@@ -1251,9 +1937,9 @@ export declare const WorkflowPlan: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<
1251
1937
  } | undefined;
1252
1938
  }>]>;
1253
1939
  export type WorkflowPlan = z.infer<typeof WorkflowPlan>;
1254
- export declare const WorkflowStatus: z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>;
1940
+ export declare const WorkflowStatus: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
1255
1941
  export type WorkflowStatus = z.infer<typeof WorkflowStatus>;
1256
- export declare const WorkflowNodeStatus: z.ZodEnum<["pending", "ready", "running", "completed", "failed", "skipped", "cancelled"]>;
1942
+ export declare const WorkflowNodeStatus: z.ZodEnum<["pending", "ready", "running", "paused", "completed", "failed", "skipped", "cancelled"]>;
1257
1943
  export type WorkflowNodeStatus = z.infer<typeof WorkflowNodeStatus>;
1258
1944
  export declare const WorkflowPolicy: z.ZodObject<{
1259
1945
  timeoutSeconds: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
@@ -1262,14 +1948,14 @@ export declare const WorkflowPolicy: z.ZodObject<{
1262
1948
  maxParallel: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1263
1949
  }, "strip", z.ZodTypeAny, {
1264
1950
  timeoutSeconds?: number | undefined;
1951
+ maxParallel?: number | undefined;
1265
1952
  perNodeTimeoutSeconds?: number | undefined;
1266
1953
  onNodeFailure?: "continue" | "fail_workflow" | "skip_dependents" | undefined;
1267
- maxParallel?: number | undefined;
1268
1954
  }, {
1269
1955
  timeoutSeconds?: number | undefined;
1956
+ maxParallel?: number | undefined;
1270
1957
  perNodeTimeoutSeconds?: number | undefined;
1271
1958
  onNodeFailure?: "continue" | "fail_workflow" | "skip_dependents" | undefined;
1272
- maxParallel?: number | undefined;
1273
1959
  }>;
1274
1960
  export type WorkflowPolicy = z.infer<typeof WorkflowPolicy>;
1275
1961
  export declare const WorkflowSharedContext: z.ZodObject<{
@@ -1281,33 +1967,37 @@ export declare const WorkflowSharedContext: z.ZodObject<{
1281
1967
  placement: z.ZodDefault<z.ZodEnum<["prepend", "append"]>>;
1282
1968
  }, "strip", z.ZodTypeAny, {
1283
1969
  placement: "prepend" | "append";
1284
- text?: string | undefined;
1285
1970
  files?: string[] | undefined;
1286
- }, {
1287
1971
  text?: string | undefined;
1972
+ }, {
1288
1973
  files?: string[] | undefined;
1974
+ text?: string | undefined;
1289
1975
  placement?: "prepend" | "append" | undefined;
1290
1976
  }>;
1291
1977
  export type WorkflowSharedContext = z.infer<typeof WorkflowSharedContext>;
1292
1978
  export declare const WorkflowResumeFrom: z.ZodObject<{
1293
1979
  /** 要恢复的 workflowId(必须先前 run 过,并有 checkpoint)。 */
1294
1980
  workflowId: z.ZodString;
1981
+ /** Reject a fresh resume if the observed native event cursor has changed. */
1982
+ expectedSeq: z.ZodOptional<z.ZodNumber>;
1295
1983
  /**
1296
1984
  * 起点策略:
1297
1985
  * - "last_success_dependents" : 从最后成功节点的下游开始(DAG 默认)
1298
1986
  * - "failed_node" : 重跑失败的那个 node(其他成功 node 不重做)
1299
1987
  * - "node:<nodeId>" : 显式指定从某 node 开始
1300
1988
  */
1301
- strategy: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"last_success_dependents">, z.ZodLiteral<"failed_node">, z.ZodString]>>;
1989
+ strategy: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"continue">, z.ZodLiteral<"last_success_dependents">, z.ZodLiteral<"failed_node">, z.ZodString]>>;
1302
1990
  /** 可选:重置某些 node 的状态(让它们重跑),覆盖默认策略。 */
1303
1991
  rerunNodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1304
1992
  }, "strip", z.ZodTypeAny, {
1305
1993
  strategy: string;
1306
1994
  workflowId: string;
1995
+ expectedSeq?: number | undefined;
1307
1996
  rerunNodes?: string[] | undefined;
1308
1997
  }, {
1309
1998
  workflowId: string;
1310
1999
  strategy?: string | undefined;
2000
+ expectedSeq?: number | undefined;
1311
2001
  rerunNodes?: string[] | undefined;
1312
2002
  }>;
1313
2003
  export type WorkflowResumeFrom = z.infer<typeof WorkflowResumeFrom>;
@@ -1317,7 +2007,7 @@ export type WorkflowResumeFrom = z.infer<typeof WorkflowResumeFrom>;
1317
2007
  */
1318
2008
  export declare const WorkflowResumeParams: z.ZodObject<{
1319
2009
  workflowId: z.ZodString;
1320
- strategy: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"last_success_dependents">, z.ZodLiteral<"failed_node">, z.ZodString]>>;
2010
+ strategy: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"continue">, z.ZodLiteral<"last_success_dependents">, z.ZodLiteral<"failed_node">, z.ZodString]>>;
1321
2011
  rerunNodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1322
2012
  /** 可选:附加给 executor 的反馈文本(HITL 后特别有用) */
1323
2013
  feedback: z.ZodOptional<z.ZodString>;
@@ -1331,11 +2021,11 @@ export declare const WorkflowResumeParams: z.ZodObject<{
1331
2021
  placement: z.ZodDefault<z.ZodEnum<["prepend", "append"]>>;
1332
2022
  }, "strip", z.ZodTypeAny, {
1333
2023
  placement: "prepend" | "append";
1334
- text?: string | undefined;
1335
2024
  files?: string[] | undefined;
1336
- }, {
1337
2025
  text?: string | undefined;
2026
+ }, {
1338
2027
  files?: string[] | undefined;
2028
+ text?: string | undefined;
1339
2029
  placement?: "prepend" | "append" | undefined;
1340
2030
  }>>;
1341
2031
  }, "strip", z.ZodTypeAny, {
@@ -1345,8 +2035,8 @@ export declare const WorkflowResumeParams: z.ZodObject<{
1345
2035
  feedback?: string | undefined;
1346
2036
  sharedContextPatch?: {
1347
2037
  placement: "prepend" | "append";
1348
- text?: string | undefined;
1349
2038
  files?: string[] | undefined;
2039
+ text?: string | undefined;
1350
2040
  } | undefined;
1351
2041
  }, {
1352
2042
  workflowId: string;
@@ -1354,8 +2044,8 @@ export declare const WorkflowResumeParams: z.ZodObject<{
1354
2044
  rerunNodes?: string[] | undefined;
1355
2045
  feedback?: string | undefined;
1356
2046
  sharedContextPatch?: {
1357
- text?: string | undefined;
1358
2047
  files?: string[] | undefined;
2048
+ text?: string | undefined;
1359
2049
  placement?: "prepend" | "append" | undefined;
1360
2050
  } | undefined;
1361
2051
  }>;
@@ -1376,6 +2066,35 @@ export declare const WorkflowRunParams: z.ZodObject<{
1376
2066
  nodeId: z.ZodString;
1377
2067
  agent: z.ZodBranded<z.ZodString, "AgentId">;
1378
2068
  model: z.ZodString;
2069
+ reasoning: z.ZodOptional<z.ZodObject<{
2070
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
2071
+ }, "strict", z.ZodTypeAny, {
2072
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2073
+ }, {
2074
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2075
+ }>>;
2076
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
2077
+ name: z.ZodEffects<z.ZodString, string, string>;
2078
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2079
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
2080
+ force: z.ZodOptional<z.ZodBoolean>;
2081
+ revision: z.ZodOptional<z.ZodString>;
2082
+ installationId: z.ZodOptional<z.ZodString>;
2083
+ }, "strict", z.ZodTypeAny, {
2084
+ name: string;
2085
+ version?: string | undefined;
2086
+ scope?: "project" | "global" | undefined;
2087
+ force?: boolean | undefined;
2088
+ revision?: string | undefined;
2089
+ installationId?: string | undefined;
2090
+ }, {
2091
+ name: string;
2092
+ version?: string | undefined;
2093
+ scope?: "project" | "global" | undefined;
2094
+ force?: boolean | undefined;
2095
+ revision?: string | undefined;
2096
+ installationId?: string | undefined;
2097
+ }>]>, "many">>;
1379
2098
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
1380
2099
  role: z.ZodOptional<z.ZodString>;
1381
2100
  input: z.ZodOptional<z.ZodString>;
@@ -1413,28 +2132,50 @@ export declare const WorkflowRunParams: z.ZodObject<{
1413
2132
  model: string;
1414
2133
  nodeId: string;
1415
2134
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1416
- role?: string | undefined;
1417
2135
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2136
+ skills?: (string | {
2137
+ name: string;
2138
+ version?: string | undefined;
2139
+ scope?: "project" | "global" | undefined;
2140
+ force?: boolean | undefined;
2141
+ revision?: string | undefined;
2142
+ installationId?: string | undefined;
2143
+ })[] | undefined;
2144
+ role?: string | undefined;
1418
2145
  worktreeId?: string | undefined;
1419
2146
  agentConfig?: Record<string, unknown> | undefined;
2147
+ reasoning?: {
2148
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2149
+ } | undefined;
1420
2150
  input?: string | undefined;
2151
+ dependsOn?: string[] | undefined;
1421
2152
  branch?: string | undefined;
1422
2153
  systemPrompt?: string | undefined;
1423
- dependsOn?: string[] | undefined;
1424
2154
  metadata?: Record<string, unknown> | undefined;
1425
2155
  }, {
1426
2156
  agent: string;
1427
2157
  model: string;
1428
2158
  nodeId: string;
1429
2159
  sessionId?: string | undefined;
1430
- role?: string | undefined;
1431
2160
  project?: string | undefined;
2161
+ skills?: (string | {
2162
+ name: string;
2163
+ version?: string | undefined;
2164
+ scope?: "project" | "global" | undefined;
2165
+ force?: boolean | undefined;
2166
+ revision?: string | undefined;
2167
+ installationId?: string | undefined;
2168
+ })[] | undefined;
2169
+ role?: string | undefined;
1432
2170
  worktreeId?: string | undefined;
1433
2171
  agentConfig?: Record<string, unknown> | undefined;
2172
+ reasoning?: {
2173
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2174
+ } | undefined;
1434
2175
  input?: string | undefined;
2176
+ dependsOn?: string[] | undefined;
1435
2177
  branch?: string | undefined;
1436
2178
  systemPrompt?: string | undefined;
1437
- dependsOn?: string[] | undefined;
1438
2179
  metadata?: Record<string, unknown> | undefined;
1439
2180
  }>, "many">;
1440
2181
  edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1467,14 +2208,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1467
2208
  model: string;
1468
2209
  nodeId: string;
1469
2210
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1470
- role?: string | undefined;
1471
2211
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2212
+ skills?: (string | {
2213
+ name: string;
2214
+ version?: string | undefined;
2215
+ scope?: "project" | "global" | undefined;
2216
+ force?: boolean | undefined;
2217
+ revision?: string | undefined;
2218
+ installationId?: string | undefined;
2219
+ })[] | undefined;
2220
+ role?: string | undefined;
1472
2221
  worktreeId?: string | undefined;
1473
2222
  agentConfig?: Record<string, unknown> | undefined;
2223
+ reasoning?: {
2224
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2225
+ } | undefined;
1474
2226
  input?: string | undefined;
2227
+ dependsOn?: string[] | undefined;
1475
2228
  branch?: string | undefined;
1476
2229
  systemPrompt?: string | undefined;
1477
- dependsOn?: string[] | undefined;
1478
2230
  metadata?: Record<string, unknown> | undefined;
1479
2231
  }[];
1480
2232
  edges?: {
@@ -1493,14 +2245,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1493
2245
  model: string;
1494
2246
  nodeId: string;
1495
2247
  sessionId?: string | undefined;
1496
- role?: string | undefined;
1497
2248
  project?: string | undefined;
2249
+ skills?: (string | {
2250
+ name: string;
2251
+ version?: string | undefined;
2252
+ scope?: "project" | "global" | undefined;
2253
+ force?: boolean | undefined;
2254
+ revision?: string | undefined;
2255
+ installationId?: string | undefined;
2256
+ })[] | undefined;
2257
+ role?: string | undefined;
1498
2258
  worktreeId?: string | undefined;
1499
2259
  agentConfig?: Record<string, unknown> | undefined;
2260
+ reasoning?: {
2261
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2262
+ } | undefined;
1500
2263
  input?: string | undefined;
2264
+ dependsOn?: string[] | undefined;
1501
2265
  branch?: string | undefined;
1502
2266
  systemPrompt?: string | undefined;
1503
- dependsOn?: string[] | undefined;
1504
2267
  metadata?: Record<string, unknown> | undefined;
1505
2268
  }[];
1506
2269
  edges?: {
@@ -1518,6 +2281,35 @@ export declare const WorkflowRunParams: z.ZodObject<{
1518
2281
  nodeId: z.ZodString;
1519
2282
  agent: z.ZodBranded<z.ZodString, "AgentId">;
1520
2283
  model: z.ZodString;
2284
+ reasoning: z.ZodOptional<z.ZodObject<{
2285
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
2286
+ }, "strict", z.ZodTypeAny, {
2287
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2288
+ }, {
2289
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2290
+ }>>;
2291
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
2292
+ name: z.ZodEffects<z.ZodString, string, string>;
2293
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2294
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
2295
+ force: z.ZodOptional<z.ZodBoolean>;
2296
+ revision: z.ZodOptional<z.ZodString>;
2297
+ installationId: z.ZodOptional<z.ZodString>;
2298
+ }, "strict", z.ZodTypeAny, {
2299
+ name: string;
2300
+ version?: string | undefined;
2301
+ scope?: "project" | "global" | undefined;
2302
+ force?: boolean | undefined;
2303
+ revision?: string | undefined;
2304
+ installationId?: string | undefined;
2305
+ }, {
2306
+ name: string;
2307
+ version?: string | undefined;
2308
+ scope?: "project" | "global" | undefined;
2309
+ force?: boolean | undefined;
2310
+ revision?: string | undefined;
2311
+ installationId?: string | undefined;
2312
+ }>]>, "many">>;
1521
2313
  input: z.ZodOptional<z.ZodString>;
1522
2314
  systemPrompt: z.ZodOptional<z.ZodString>;
1523
2315
  dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1531,37 +2323,88 @@ export declare const WorkflowRunParams: z.ZodObject<{
1531
2323
  role: z.ZodDefault<z.ZodLiteral<"executor">>;
1532
2324
  }, "strip", z.ZodTypeAny, {
1533
2325
  agent: string & z.BRAND<"AgentId">;
1534
- role: "executor";
1535
2326
  model: string;
1536
2327
  nodeId: string;
2328
+ role: "executor";
1537
2329
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1538
2330
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2331
+ skills?: (string | {
2332
+ name: string;
2333
+ version?: string | undefined;
2334
+ scope?: "project" | "global" | undefined;
2335
+ force?: boolean | undefined;
2336
+ revision?: string | undefined;
2337
+ installationId?: string | undefined;
2338
+ })[] | undefined;
1539
2339
  worktreeId?: string | undefined;
1540
2340
  agentConfig?: Record<string, unknown> | undefined;
2341
+ reasoning?: {
2342
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2343
+ } | undefined;
1541
2344
  input?: string | undefined;
2345
+ dependsOn?: string[] | undefined;
1542
2346
  branch?: string | undefined;
1543
2347
  systemPrompt?: string | undefined;
1544
- dependsOn?: string[] | undefined;
1545
2348
  metadata?: Record<string, unknown> | undefined;
1546
2349
  }, {
1547
2350
  agent: string;
1548
2351
  model: string;
1549
2352
  nodeId: string;
1550
2353
  sessionId?: string | undefined;
1551
- role?: "executor" | undefined;
1552
2354
  project?: string | undefined;
2355
+ skills?: (string | {
2356
+ name: string;
2357
+ version?: string | undefined;
2358
+ scope?: "project" | "global" | undefined;
2359
+ force?: boolean | undefined;
2360
+ revision?: string | undefined;
2361
+ installationId?: string | undefined;
2362
+ })[] | undefined;
2363
+ role?: "executor" | undefined;
1553
2364
  worktreeId?: string | undefined;
1554
2365
  agentConfig?: Record<string, unknown> | undefined;
2366
+ reasoning?: {
2367
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2368
+ } | undefined;
1555
2369
  input?: string | undefined;
2370
+ dependsOn?: string[] | undefined;
1556
2371
  branch?: string | undefined;
1557
2372
  systemPrompt?: string | undefined;
1558
- dependsOn?: string[] | undefined;
1559
2373
  metadata?: Record<string, unknown> | undefined;
1560
2374
  }>;
1561
2375
  workers: z.ZodArray<z.ZodObject<{
1562
2376
  nodeId: z.ZodString;
1563
2377
  agent: z.ZodBranded<z.ZodString, "AgentId">;
1564
2378
  model: z.ZodString;
2379
+ reasoning: z.ZodOptional<z.ZodObject<{
2380
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
2381
+ }, "strict", z.ZodTypeAny, {
2382
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2383
+ }, {
2384
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2385
+ }>>;
2386
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
2387
+ name: z.ZodEffects<z.ZodString, string, string>;
2388
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2389
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
2390
+ force: z.ZodOptional<z.ZodBoolean>;
2391
+ revision: z.ZodOptional<z.ZodString>;
2392
+ installationId: z.ZodOptional<z.ZodString>;
2393
+ }, "strict", z.ZodTypeAny, {
2394
+ name: string;
2395
+ version?: string | undefined;
2396
+ scope?: "project" | "global" | undefined;
2397
+ force?: boolean | undefined;
2398
+ revision?: string | undefined;
2399
+ installationId?: string | undefined;
2400
+ }, {
2401
+ name: string;
2402
+ version?: string | undefined;
2403
+ scope?: "project" | "global" | undefined;
2404
+ force?: boolean | undefined;
2405
+ revision?: string | undefined;
2406
+ installationId?: string | undefined;
2407
+ }>]>, "many">>;
1565
2408
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
1566
2409
  role: z.ZodOptional<z.ZodString>;
1567
2410
  input: z.ZodOptional<z.ZodString>;
@@ -1599,28 +2442,50 @@ export declare const WorkflowRunParams: z.ZodObject<{
1599
2442
  model: string;
1600
2443
  nodeId: string;
1601
2444
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1602
- role?: string | undefined;
1603
2445
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2446
+ skills?: (string | {
2447
+ name: string;
2448
+ version?: string | undefined;
2449
+ scope?: "project" | "global" | undefined;
2450
+ force?: boolean | undefined;
2451
+ revision?: string | undefined;
2452
+ installationId?: string | undefined;
2453
+ })[] | undefined;
2454
+ role?: string | undefined;
1604
2455
  worktreeId?: string | undefined;
1605
2456
  agentConfig?: Record<string, unknown> | undefined;
2457
+ reasoning?: {
2458
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2459
+ } | undefined;
1606
2460
  input?: string | undefined;
2461
+ dependsOn?: string[] | undefined;
1607
2462
  branch?: string | undefined;
1608
2463
  systemPrompt?: string | undefined;
1609
- dependsOn?: string[] | undefined;
1610
2464
  metadata?: Record<string, unknown> | undefined;
1611
2465
  }, {
1612
2466
  agent: string;
1613
2467
  model: string;
1614
2468
  nodeId: string;
1615
2469
  sessionId?: string | undefined;
1616
- role?: string | undefined;
1617
2470
  project?: string | undefined;
2471
+ skills?: (string | {
2472
+ name: string;
2473
+ version?: string | undefined;
2474
+ scope?: "project" | "global" | undefined;
2475
+ force?: boolean | undefined;
2476
+ revision?: string | undefined;
2477
+ installationId?: string | undefined;
2478
+ })[] | undefined;
2479
+ role?: string | undefined;
1618
2480
  worktreeId?: string | undefined;
1619
2481
  agentConfig?: Record<string, unknown> | undefined;
2482
+ reasoning?: {
2483
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2484
+ } | undefined;
1620
2485
  input?: string | undefined;
2486
+ dependsOn?: string[] | undefined;
1621
2487
  branch?: string | undefined;
1622
2488
  systemPrompt?: string | undefined;
1623
- dependsOn?: string[] | undefined;
1624
2489
  metadata?: Record<string, unknown> | undefined;
1625
2490
  }>, "many">;
1626
2491
  communicationGraph: z.ZodObject<{
@@ -1674,17 +2539,28 @@ export declare const WorkflowRunParams: z.ZodObject<{
1674
2539
  }, "strip", z.ZodTypeAny, {
1675
2540
  executor: {
1676
2541
  agent: string & z.BRAND<"AgentId">;
1677
- role: "executor";
1678
2542
  model: string;
1679
2543
  nodeId: string;
2544
+ role: "executor";
1680
2545
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1681
2546
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2547
+ skills?: (string | {
2548
+ name: string;
2549
+ version?: string | undefined;
2550
+ scope?: "project" | "global" | undefined;
2551
+ force?: boolean | undefined;
2552
+ revision?: string | undefined;
2553
+ installationId?: string | undefined;
2554
+ })[] | undefined;
1682
2555
  worktreeId?: string | undefined;
1683
2556
  agentConfig?: Record<string, unknown> | undefined;
2557
+ reasoning?: {
2558
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2559
+ } | undefined;
1684
2560
  input?: string | undefined;
2561
+ dependsOn?: string[] | undefined;
1685
2562
  branch?: string | undefined;
1686
2563
  systemPrompt?: string | undefined;
1687
- dependsOn?: string[] | undefined;
1688
2564
  metadata?: Record<string, unknown> | undefined;
1689
2565
  };
1690
2566
  mode: "graph";
@@ -1693,14 +2569,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1693
2569
  model: string;
1694
2570
  nodeId: string;
1695
2571
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1696
- role?: string | undefined;
1697
2572
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2573
+ skills?: (string | {
2574
+ name: string;
2575
+ version?: string | undefined;
2576
+ scope?: "project" | "global" | undefined;
2577
+ force?: boolean | undefined;
2578
+ revision?: string | undefined;
2579
+ installationId?: string | undefined;
2580
+ })[] | undefined;
2581
+ role?: string | undefined;
1698
2582
  worktreeId?: string | undefined;
1699
2583
  agentConfig?: Record<string, unknown> | undefined;
2584
+ reasoning?: {
2585
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2586
+ } | undefined;
1700
2587
  input?: string | undefined;
2588
+ dependsOn?: string[] | undefined;
1701
2589
  branch?: string | undefined;
1702
2590
  systemPrompt?: string | undefined;
1703
- dependsOn?: string[] | undefined;
1704
2591
  metadata?: Record<string, unknown> | undefined;
1705
2592
  }[];
1706
2593
  communicationGraph: {
@@ -1721,14 +2608,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1721
2608
  model: string;
1722
2609
  nodeId: string;
1723
2610
  sessionId?: string | undefined;
1724
- role?: "executor" | undefined;
1725
2611
  project?: string | undefined;
2612
+ skills?: (string | {
2613
+ name: string;
2614
+ version?: string | undefined;
2615
+ scope?: "project" | "global" | undefined;
2616
+ force?: boolean | undefined;
2617
+ revision?: string | undefined;
2618
+ installationId?: string | undefined;
2619
+ })[] | undefined;
2620
+ role?: "executor" | undefined;
1726
2621
  worktreeId?: string | undefined;
1727
2622
  agentConfig?: Record<string, unknown> | undefined;
2623
+ reasoning?: {
2624
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2625
+ } | undefined;
1728
2626
  input?: string | undefined;
2627
+ dependsOn?: string[] | undefined;
1729
2628
  branch?: string | undefined;
1730
2629
  systemPrompt?: string | undefined;
1731
- dependsOn?: string[] | undefined;
1732
2630
  metadata?: Record<string, unknown> | undefined;
1733
2631
  };
1734
2632
  mode: "graph";
@@ -1737,14 +2635,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1737
2635
  model: string;
1738
2636
  nodeId: string;
1739
2637
  sessionId?: string | undefined;
1740
- role?: string | undefined;
1741
2638
  project?: string | undefined;
2639
+ skills?: (string | {
2640
+ name: string;
2641
+ version?: string | undefined;
2642
+ scope?: "project" | "global" | undefined;
2643
+ force?: boolean | undefined;
2644
+ revision?: string | undefined;
2645
+ installationId?: string | undefined;
2646
+ })[] | undefined;
2647
+ role?: string | undefined;
1742
2648
  worktreeId?: string | undefined;
1743
2649
  agentConfig?: Record<string, unknown> | undefined;
2650
+ reasoning?: {
2651
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2652
+ } | undefined;
1744
2653
  input?: string | undefined;
2654
+ dependsOn?: string[] | undefined;
1745
2655
  branch?: string | undefined;
1746
2656
  systemPrompt?: string | undefined;
1747
- dependsOn?: string[] | undefined;
1748
2657
  metadata?: Record<string, unknown> | undefined;
1749
2658
  }[];
1750
2659
  communicationGraph: {
@@ -1768,6 +2677,35 @@ export declare const WorkflowRunParams: z.ZodObject<{
1768
2677
  nodeId: z.ZodString;
1769
2678
  agent: z.ZodBranded<z.ZodString, "AgentId">;
1770
2679
  model: z.ZodString;
2680
+ reasoning: z.ZodOptional<z.ZodObject<{
2681
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
2682
+ }, "strict", z.ZodTypeAny, {
2683
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2684
+ }, {
2685
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2686
+ }>>;
2687
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
2688
+ name: z.ZodEffects<z.ZodString, string, string>;
2689
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2690
+ scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
2691
+ force: z.ZodOptional<z.ZodBoolean>;
2692
+ revision: z.ZodOptional<z.ZodString>;
2693
+ installationId: z.ZodOptional<z.ZodString>;
2694
+ }, "strict", z.ZodTypeAny, {
2695
+ name: string;
2696
+ version?: string | undefined;
2697
+ scope?: "project" | "global" | undefined;
2698
+ force?: boolean | undefined;
2699
+ revision?: string | undefined;
2700
+ installationId?: string | undefined;
2701
+ }, {
2702
+ name: string;
2703
+ version?: string | undefined;
2704
+ scope?: "project" | "global" | undefined;
2705
+ force?: boolean | undefined;
2706
+ revision?: string | undefined;
2707
+ installationId?: string | undefined;
2708
+ }>]>, "many">>;
1771
2709
  /** 该节点在 workflow 中扮演的角色(由调用方定义,phonon 仅回显)。 */
1772
2710
  role: z.ZodOptional<z.ZodString>;
1773
2711
  input: z.ZodOptional<z.ZodString>;
@@ -1805,28 +2743,50 @@ export declare const WorkflowRunParams: z.ZodObject<{
1805
2743
  model: string;
1806
2744
  nodeId: string;
1807
2745
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1808
- role?: string | undefined;
1809
2746
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2747
+ skills?: (string | {
2748
+ name: string;
2749
+ version?: string | undefined;
2750
+ scope?: "project" | "global" | undefined;
2751
+ force?: boolean | undefined;
2752
+ revision?: string | undefined;
2753
+ installationId?: string | undefined;
2754
+ })[] | undefined;
2755
+ role?: string | undefined;
1810
2756
  worktreeId?: string | undefined;
1811
2757
  agentConfig?: Record<string, unknown> | undefined;
2758
+ reasoning?: {
2759
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2760
+ } | undefined;
1812
2761
  input?: string | undefined;
2762
+ dependsOn?: string[] | undefined;
1813
2763
  branch?: string | undefined;
1814
2764
  systemPrompt?: string | undefined;
1815
- dependsOn?: string[] | undefined;
1816
2765
  metadata?: Record<string, unknown> | undefined;
1817
2766
  }, {
1818
2767
  agent: string;
1819
2768
  model: string;
1820
2769
  nodeId: string;
1821
2770
  sessionId?: string | undefined;
1822
- role?: string | undefined;
1823
2771
  project?: string | undefined;
2772
+ skills?: (string | {
2773
+ name: string;
2774
+ version?: string | undefined;
2775
+ scope?: "project" | "global" | undefined;
2776
+ force?: boolean | undefined;
2777
+ revision?: string | undefined;
2778
+ installationId?: string | undefined;
2779
+ })[] | undefined;
2780
+ role?: string | undefined;
1824
2781
  worktreeId?: string | undefined;
1825
2782
  agentConfig?: Record<string, unknown> | undefined;
2783
+ reasoning?: {
2784
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2785
+ } | undefined;
1826
2786
  input?: string | undefined;
2787
+ dependsOn?: string[] | undefined;
1827
2788
  branch?: string | undefined;
1828
2789
  systemPrompt?: string | undefined;
1829
- dependsOn?: string[] | undefined;
1830
2790
  metadata?: Record<string, unknown> | undefined;
1831
2791
  }>, "many">;
1832
2792
  /** Chairman 必须是 participants 之一的 nodeId,每轮所有 participant 发完它再 review + 决定续/停。 */
@@ -1855,14 +2815,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1855
2815
  model: string;
1856
2816
  nodeId: string;
1857
2817
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1858
- role?: string | undefined;
1859
2818
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2819
+ skills?: (string | {
2820
+ name: string;
2821
+ version?: string | undefined;
2822
+ scope?: "project" | "global" | undefined;
2823
+ force?: boolean | undefined;
2824
+ revision?: string | undefined;
2825
+ installationId?: string | undefined;
2826
+ })[] | undefined;
2827
+ role?: string | undefined;
1860
2828
  worktreeId?: string | undefined;
1861
2829
  agentConfig?: Record<string, unknown> | undefined;
2830
+ reasoning?: {
2831
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2832
+ } | undefined;
1862
2833
  input?: string | undefined;
2834
+ dependsOn?: string[] | undefined;
1863
2835
  branch?: string | undefined;
1864
2836
  systemPrompt?: string | undefined;
1865
- dependsOn?: string[] | undefined;
1866
2837
  metadata?: Record<string, unknown> | undefined;
1867
2838
  }[];
1868
2839
  chairman: string;
@@ -1879,14 +2850,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1879
2850
  model: string;
1880
2851
  nodeId: string;
1881
2852
  sessionId?: string | undefined;
1882
- role?: string | undefined;
1883
2853
  project?: string | undefined;
2854
+ skills?: (string | {
2855
+ name: string;
2856
+ version?: string | undefined;
2857
+ scope?: "project" | "global" | undefined;
2858
+ force?: boolean | undefined;
2859
+ revision?: string | undefined;
2860
+ installationId?: string | undefined;
2861
+ })[] | undefined;
2862
+ role?: string | undefined;
1884
2863
  worktreeId?: string | undefined;
1885
2864
  agentConfig?: Record<string, unknown> | undefined;
2865
+ reasoning?: {
2866
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2867
+ } | undefined;
1886
2868
  input?: string | undefined;
2869
+ dependsOn?: string[] | undefined;
1887
2870
  branch?: string | undefined;
1888
2871
  systemPrompt?: string | undefined;
1889
- dependsOn?: string[] | undefined;
1890
2872
  metadata?: Record<string, unknown> | undefined;
1891
2873
  }[];
1892
2874
  chairman: string;
@@ -1904,14 +2886,14 @@ export declare const WorkflowRunParams: z.ZodObject<{
1904
2886
  maxParallel: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1905
2887
  }, "strip", z.ZodTypeAny, {
1906
2888
  timeoutSeconds?: number | undefined;
2889
+ maxParallel?: number | undefined;
1907
2890
  perNodeTimeoutSeconds?: number | undefined;
1908
2891
  onNodeFailure?: "continue" | "fail_workflow" | "skip_dependents" | undefined;
1909
- maxParallel?: number | undefined;
1910
2892
  }, {
1911
2893
  timeoutSeconds?: number | undefined;
2894
+ maxParallel?: number | undefined;
1912
2895
  perNodeTimeoutSeconds?: number | undefined;
1913
2896
  onNodeFailure?: "continue" | "fail_workflow" | "skip_dependents" | undefined;
1914
- maxParallel?: number | undefined;
1915
2897
  }>>;
1916
2898
  /** 共享上下文(v0.5 新增)。 */
1917
2899
  sharedContext: z.ZodOptional<z.ZodObject<{
@@ -1923,33 +2905,37 @@ export declare const WorkflowRunParams: z.ZodObject<{
1923
2905
  placement: z.ZodDefault<z.ZodEnum<["prepend", "append"]>>;
1924
2906
  }, "strip", z.ZodTypeAny, {
1925
2907
  placement: "prepend" | "append";
1926
- text?: string | undefined;
1927
2908
  files?: string[] | undefined;
1928
- }, {
1929
2909
  text?: string | undefined;
2910
+ }, {
1930
2911
  files?: string[] | undefined;
2912
+ text?: string | undefined;
1931
2913
  placement?: "prepend" | "append" | undefined;
1932
2914
  }>>;
1933
2915
  /** 断点续跑(v0.5 新增)。传入则跳过 plan 重新规划,从 checkpoint 恢复。 */
1934
2916
  resumeFrom: z.ZodOptional<z.ZodObject<{
1935
2917
  /** 要恢复的 workflowId(必须先前 run 过,并有 checkpoint)。 */
1936
2918
  workflowId: z.ZodString;
2919
+ /** Reject a fresh resume if the observed native event cursor has changed. */
2920
+ expectedSeq: z.ZodOptional<z.ZodNumber>;
1937
2921
  /**
1938
2922
  * 起点策略:
1939
2923
  * - "last_success_dependents" : 从最后成功节点的下游开始(DAG 默认)
1940
2924
  * - "failed_node" : 重跑失败的那个 node(其他成功 node 不重做)
1941
2925
  * - "node:<nodeId>" : 显式指定从某 node 开始
1942
2926
  */
1943
- strategy: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"last_success_dependents">, z.ZodLiteral<"failed_node">, z.ZodString]>>;
2927
+ strategy: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"continue">, z.ZodLiteral<"last_success_dependents">, z.ZodLiteral<"failed_node">, z.ZodString]>>;
1944
2928
  /** 可选:重置某些 node 的状态(让它们重跑),覆盖默认策略。 */
1945
2929
  rerunNodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1946
2930
  }, "strip", z.ZodTypeAny, {
1947
2931
  strategy: string;
1948
2932
  workflowId: string;
2933
+ expectedSeq?: number | undefined;
1949
2934
  rerunNodes?: string[] | undefined;
1950
2935
  }, {
1951
2936
  workflowId: string;
1952
2937
  strategy?: string | undefined;
2938
+ expectedSeq?: number | undefined;
1953
2939
  rerunNodes?: string[] | undefined;
1954
2940
  }>>;
1955
2941
  clientRequestId: z.ZodOptional<z.ZodString>;
@@ -1962,14 +2948,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
1962
2948
  model: string;
1963
2949
  nodeId: string;
1964
2950
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1965
- role?: string | undefined;
1966
2951
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2952
+ skills?: (string | {
2953
+ name: string;
2954
+ version?: string | undefined;
2955
+ scope?: "project" | "global" | undefined;
2956
+ force?: boolean | undefined;
2957
+ revision?: string | undefined;
2958
+ installationId?: string | undefined;
2959
+ })[] | undefined;
2960
+ role?: string | undefined;
1967
2961
  worktreeId?: string | undefined;
1968
2962
  agentConfig?: Record<string, unknown> | undefined;
2963
+ reasoning?: {
2964
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
2965
+ } | undefined;
1969
2966
  input?: string | undefined;
2967
+ dependsOn?: string[] | undefined;
1970
2968
  branch?: string | undefined;
1971
2969
  systemPrompt?: string | undefined;
1972
- dependsOn?: string[] | undefined;
1973
2970
  metadata?: Record<string, unknown> | undefined;
1974
2971
  }[];
1975
2972
  edges?: {
@@ -1984,17 +2981,28 @@ export declare const WorkflowRunParams: z.ZodObject<{
1984
2981
  } | {
1985
2982
  executor: {
1986
2983
  agent: string & z.BRAND<"AgentId">;
1987
- role: "executor";
1988
2984
  model: string;
1989
2985
  nodeId: string;
2986
+ role: "executor";
1990
2987
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
1991
2988
  project?: (string & z.BRAND<"ProjectId">) | undefined;
2989
+ skills?: (string | {
2990
+ name: string;
2991
+ version?: string | undefined;
2992
+ scope?: "project" | "global" | undefined;
2993
+ force?: boolean | undefined;
2994
+ revision?: string | undefined;
2995
+ installationId?: string | undefined;
2996
+ })[] | undefined;
1992
2997
  worktreeId?: string | undefined;
1993
2998
  agentConfig?: Record<string, unknown> | undefined;
2999
+ reasoning?: {
3000
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3001
+ } | undefined;
1994
3002
  input?: string | undefined;
3003
+ dependsOn?: string[] | undefined;
1995
3004
  branch?: string | undefined;
1996
3005
  systemPrompt?: string | undefined;
1997
- dependsOn?: string[] | undefined;
1998
3006
  metadata?: Record<string, unknown> | undefined;
1999
3007
  };
2000
3008
  mode: "graph";
@@ -2003,14 +3011,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
2003
3011
  model: string;
2004
3012
  nodeId: string;
2005
3013
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2006
- role?: string | undefined;
2007
3014
  project?: (string & z.BRAND<"ProjectId">) | undefined;
3015
+ skills?: (string | {
3016
+ name: string;
3017
+ version?: string | undefined;
3018
+ scope?: "project" | "global" | undefined;
3019
+ force?: boolean | undefined;
3020
+ revision?: string | undefined;
3021
+ installationId?: string | undefined;
3022
+ })[] | undefined;
3023
+ role?: string | undefined;
2008
3024
  worktreeId?: string | undefined;
2009
3025
  agentConfig?: Record<string, unknown> | undefined;
3026
+ reasoning?: {
3027
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3028
+ } | undefined;
2010
3029
  input?: string | undefined;
3030
+ dependsOn?: string[] | undefined;
2011
3031
  branch?: string | undefined;
2012
3032
  systemPrompt?: string | undefined;
2013
- dependsOn?: string[] | undefined;
2014
3033
  metadata?: Record<string, unknown> | undefined;
2015
3034
  }[];
2016
3035
  communicationGraph: {
@@ -2033,14 +3052,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
2033
3052
  model: string;
2034
3053
  nodeId: string;
2035
3054
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2036
- role?: string | undefined;
2037
3055
  project?: (string & z.BRAND<"ProjectId">) | undefined;
3056
+ skills?: (string | {
3057
+ name: string;
3058
+ version?: string | undefined;
3059
+ scope?: "project" | "global" | undefined;
3060
+ force?: boolean | undefined;
3061
+ revision?: string | undefined;
3062
+ installationId?: string | undefined;
3063
+ })[] | undefined;
3064
+ role?: string | undefined;
2038
3065
  worktreeId?: string | undefined;
2039
3066
  agentConfig?: Record<string, unknown> | undefined;
3067
+ reasoning?: {
3068
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3069
+ } | undefined;
2040
3070
  input?: string | undefined;
3071
+ dependsOn?: string[] | undefined;
2041
3072
  branch?: string | undefined;
2042
3073
  systemPrompt?: string | undefined;
2043
- dependsOn?: string[] | undefined;
2044
3074
  metadata?: Record<string, unknown> | undefined;
2045
3075
  }[];
2046
3076
  chairman: string;
@@ -2050,27 +3080,28 @@ export declare const WorkflowRunParams: z.ZodObject<{
2050
3080
  consensusSignal?: string | undefined;
2051
3081
  };
2052
3082
  };
2053
- clientRequestId?: string | undefined;
2054
3083
  project?: (string & z.BRAND<"ProjectId">) | undefined;
3084
+ clientRequestId?: string | undefined;
2055
3085
  worktreeId?: string | undefined;
2056
3086
  input?: string | undefined;
2057
3087
  branch?: string | undefined;
2058
3088
  resumeFrom?: {
2059
3089
  strategy: string;
2060
3090
  workflowId: string;
3091
+ expectedSeq?: number | undefined;
2061
3092
  rerunNodes?: string[] | undefined;
2062
3093
  } | undefined;
2063
3094
  metadata?: Record<string, unknown> | undefined;
2064
3095
  policy?: {
2065
3096
  timeoutSeconds?: number | undefined;
3097
+ maxParallel?: number | undefined;
2066
3098
  perNodeTimeoutSeconds?: number | undefined;
2067
3099
  onNodeFailure?: "continue" | "fail_workflow" | "skip_dependents" | undefined;
2068
- maxParallel?: number | undefined;
2069
3100
  } | undefined;
2070
3101
  sharedContext?: {
2071
3102
  placement: "prepend" | "append";
2072
- text?: string | undefined;
2073
3103
  files?: string[] | undefined;
3104
+ text?: string | undefined;
2074
3105
  } | undefined;
2075
3106
  }, {
2076
3107
  plan: {
@@ -2080,14 +3111,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
2080
3111
  model: string;
2081
3112
  nodeId: string;
2082
3113
  sessionId?: string | undefined;
2083
- role?: string | undefined;
2084
3114
  project?: string | undefined;
3115
+ skills?: (string | {
3116
+ name: string;
3117
+ version?: string | undefined;
3118
+ scope?: "project" | "global" | undefined;
3119
+ force?: boolean | undefined;
3120
+ revision?: string | undefined;
3121
+ installationId?: string | undefined;
3122
+ })[] | undefined;
3123
+ role?: string | undefined;
2085
3124
  worktreeId?: string | undefined;
2086
3125
  agentConfig?: Record<string, unknown> | undefined;
3126
+ reasoning?: {
3127
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3128
+ } | undefined;
2087
3129
  input?: string | undefined;
3130
+ dependsOn?: string[] | undefined;
2088
3131
  branch?: string | undefined;
2089
3132
  systemPrompt?: string | undefined;
2090
- dependsOn?: string[] | undefined;
2091
3133
  metadata?: Record<string, unknown> | undefined;
2092
3134
  }[];
2093
3135
  edges?: {
@@ -2105,14 +3147,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
2105
3147
  model: string;
2106
3148
  nodeId: string;
2107
3149
  sessionId?: string | undefined;
2108
- role?: "executor" | undefined;
2109
3150
  project?: string | undefined;
3151
+ skills?: (string | {
3152
+ name: string;
3153
+ version?: string | undefined;
3154
+ scope?: "project" | "global" | undefined;
3155
+ force?: boolean | undefined;
3156
+ revision?: string | undefined;
3157
+ installationId?: string | undefined;
3158
+ })[] | undefined;
3159
+ role?: "executor" | undefined;
2110
3160
  worktreeId?: string | undefined;
2111
3161
  agentConfig?: Record<string, unknown> | undefined;
3162
+ reasoning?: {
3163
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3164
+ } | undefined;
2112
3165
  input?: string | undefined;
3166
+ dependsOn?: string[] | undefined;
2113
3167
  branch?: string | undefined;
2114
3168
  systemPrompt?: string | undefined;
2115
- dependsOn?: string[] | undefined;
2116
3169
  metadata?: Record<string, unknown> | undefined;
2117
3170
  };
2118
3171
  mode: "graph";
@@ -2121,14 +3174,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
2121
3174
  model: string;
2122
3175
  nodeId: string;
2123
3176
  sessionId?: string | undefined;
2124
- role?: string | undefined;
2125
3177
  project?: string | undefined;
3178
+ skills?: (string | {
3179
+ name: string;
3180
+ version?: string | undefined;
3181
+ scope?: "project" | "global" | undefined;
3182
+ force?: boolean | undefined;
3183
+ revision?: string | undefined;
3184
+ installationId?: string | undefined;
3185
+ })[] | undefined;
3186
+ role?: string | undefined;
2126
3187
  worktreeId?: string | undefined;
2127
3188
  agentConfig?: Record<string, unknown> | undefined;
3189
+ reasoning?: {
3190
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3191
+ } | undefined;
2128
3192
  input?: string | undefined;
3193
+ dependsOn?: string[] | undefined;
2129
3194
  branch?: string | undefined;
2130
3195
  systemPrompt?: string | undefined;
2131
- dependsOn?: string[] | undefined;
2132
3196
  metadata?: Record<string, unknown> | undefined;
2133
3197
  }[];
2134
3198
  communicationGraph: {
@@ -2151,14 +3215,25 @@ export declare const WorkflowRunParams: z.ZodObject<{
2151
3215
  model: string;
2152
3216
  nodeId: string;
2153
3217
  sessionId?: string | undefined;
2154
- role?: string | undefined;
2155
3218
  project?: string | undefined;
3219
+ skills?: (string | {
3220
+ name: string;
3221
+ version?: string | undefined;
3222
+ scope?: "project" | "global" | undefined;
3223
+ force?: boolean | undefined;
3224
+ revision?: string | undefined;
3225
+ installationId?: string | undefined;
3226
+ })[] | undefined;
3227
+ role?: string | undefined;
2156
3228
  worktreeId?: string | undefined;
2157
3229
  agentConfig?: Record<string, unknown> | undefined;
3230
+ reasoning?: {
3231
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
3232
+ } | undefined;
2158
3233
  input?: string | undefined;
3234
+ dependsOn?: string[] | undefined;
2159
3235
  branch?: string | undefined;
2160
3236
  systemPrompt?: string | undefined;
2161
- dependsOn?: string[] | undefined;
2162
3237
  metadata?: Record<string, unknown> | undefined;
2163
3238
  }[];
2164
3239
  chairman: string;
@@ -2168,43 +3243,44 @@ export declare const WorkflowRunParams: z.ZodObject<{
2168
3243
  consensusSignal?: string | undefined;
2169
3244
  } | undefined;
2170
3245
  };
2171
- clientRequestId?: string | undefined;
2172
3246
  project?: string | undefined;
3247
+ clientRequestId?: string | undefined;
2173
3248
  worktreeId?: string | undefined;
2174
3249
  input?: string | undefined;
2175
3250
  branch?: string | undefined;
2176
3251
  resumeFrom?: {
2177
3252
  workflowId: string;
2178
3253
  strategy?: string | undefined;
3254
+ expectedSeq?: number | undefined;
2179
3255
  rerunNodes?: string[] | undefined;
2180
3256
  } | undefined;
2181
3257
  metadata?: Record<string, unknown> | undefined;
2182
3258
  policy?: {
2183
3259
  timeoutSeconds?: number | undefined;
3260
+ maxParallel?: number | undefined;
2184
3261
  perNodeTimeoutSeconds?: number | undefined;
2185
3262
  onNodeFailure?: "continue" | "fail_workflow" | "skip_dependents" | undefined;
2186
- maxParallel?: number | undefined;
2187
3263
  } | undefined;
2188
3264
  sharedContext?: {
2189
- text?: string | undefined;
2190
3265
  files?: string[] | undefined;
3266
+ text?: string | undefined;
2191
3267
  placement?: "prepend" | "append" | undefined;
2192
3268
  } | undefined;
2193
3269
  }>;
2194
3270
  export type WorkflowRunParams = z.infer<typeof WorkflowRunParams>;
2195
3271
  export declare const WorkflowRunResult: z.ZodObject<{
2196
3272
  workflowId: z.ZodString;
2197
- status: z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>;
3273
+ status: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
2198
3274
  createdAt: z.ZodString;
2199
3275
  /** 是否走的 resume 路径。 */
2200
3276
  resumed: z.ZodDefault<z.ZodBoolean>;
2201
3277
  }, "strip", z.ZodTypeAny, {
2202
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
3278
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2203
3279
  createdAt: string;
2204
3280
  workflowId: string;
2205
3281
  resumed: boolean;
2206
3282
  }, {
2207
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
3283
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2208
3284
  createdAt: string;
2209
3285
  workflowId: string;
2210
3286
  resumed?: boolean | undefined;
@@ -2254,7 +3330,7 @@ export declare const WorkflowNodeResult: z.ZodObject<{
2254
3330
  } | undefined;
2255
3331
  }>>;
2256
3332
  }, "strip", z.ZodTypeAny, {
2257
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3333
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2258
3334
  text?: string | undefined;
2259
3335
  usage?: {
2260
3336
  inputTokens?: number | undefined;
@@ -2269,7 +3345,7 @@ export declare const WorkflowNodeResult: z.ZodObject<{
2269
3345
  } | undefined;
2270
3346
  } | undefined;
2271
3347
  }, {
2272
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3348
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2273
3349
  text?: string | undefined;
2274
3350
  usage?: {
2275
3351
  inputTokens?: number | undefined;
@@ -2287,7 +3363,7 @@ export declare const WorkflowNodeResult: z.ZodObject<{
2287
3363
  export type WorkflowNodeResult = z.infer<typeof WorkflowNodeResult>;
2288
3364
  export declare const WorkflowNodeRuntime: z.ZodObject<{
2289
3365
  nodeId: z.ZodString;
2290
- status: z.ZodEnum<["pending", "ready", "running", "completed", "failed", "skipped", "cancelled"]>;
3366
+ status: z.ZodEnum<["pending", "ready", "running", "paused", "completed", "failed", "skipped", "cancelled"]>;
2291
3367
  agent: z.ZodBranded<z.ZodString, "AgentId">;
2292
3368
  model: z.ZodString;
2293
3369
  role: z.ZodOptional<z.ZodString>;
@@ -2340,7 +3416,7 @@ export declare const WorkflowNodeRuntime: z.ZodObject<{
2340
3416
  } | undefined;
2341
3417
  }>>;
2342
3418
  }, "strip", z.ZodTypeAny, {
2343
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3419
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2344
3420
  text?: string | undefined;
2345
3421
  usage?: {
2346
3422
  inputTokens?: number | undefined;
@@ -2355,7 +3431,7 @@ export declare const WorkflowNodeRuntime: z.ZodObject<{
2355
3431
  } | undefined;
2356
3432
  } | undefined;
2357
3433
  }, {
2358
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3434
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2359
3435
  text?: string | undefined;
2360
3436
  usage?: {
2361
3437
  inputTokens?: number | undefined;
@@ -2372,16 +3448,44 @@ export declare const WorkflowNodeRuntime: z.ZodObject<{
2372
3448
  }>>;
2373
3449
  /** 该节点完成的轮次计数(discussion 用;DAG/Graph 一次执行 = 1)。 */
2374
3450
  iterations: z.ZodOptional<z.ZodNumber>;
3451
+ /** 每次执行的 session/turn 映射;用于崩溃恢复、审计和 late-event fencing。 */
3452
+ attempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
3453
+ attempt: z.ZodNumber;
3454
+ iteration: z.ZodOptional<z.ZodNumber>;
3455
+ sessionId: z.ZodOptional<z.ZodBranded<z.ZodString, "SessionId">>;
3456
+ turnId: z.ZodOptional<z.ZodString>;
3457
+ status: z.ZodEnum<["running", "completed", "failed", "interrupted", "timeout", "cancelled"]>;
3458
+ startedAt: z.ZodString;
3459
+ completedAt: z.ZodOptional<z.ZodString>;
3460
+ error: z.ZodOptional<z.ZodString>;
3461
+ }, "strip", z.ZodTypeAny, {
3462
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3463
+ startedAt: string;
3464
+ attempt: number;
3465
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3466
+ turnId?: string | undefined;
3467
+ error?: string | undefined;
3468
+ completedAt?: string | undefined;
3469
+ iteration?: number | undefined;
3470
+ }, {
3471
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3472
+ startedAt: string;
3473
+ attempt: number;
3474
+ sessionId?: string | undefined;
3475
+ turnId?: string | undefined;
3476
+ error?: string | undefined;
3477
+ completedAt?: string | undefined;
3478
+ iteration?: number | undefined;
3479
+ }>, "many">>;
2375
3480
  }, "strip", z.ZodTypeAny, {
2376
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
3481
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2377
3482
  agent: string & z.BRAND<"AgentId">;
2378
3483
  model: string;
2379
3484
  nodeId: string;
2380
3485
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2381
- role?: string | undefined;
2382
3486
  turnId?: string | undefined;
2383
3487
  result?: {
2384
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3488
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2385
3489
  text?: string | undefined;
2386
3490
  usage?: {
2387
3491
  inputTokens?: number | undefined;
@@ -2396,20 +3500,30 @@ export declare const WorkflowNodeRuntime: z.ZodObject<{
2396
3500
  } | undefined;
2397
3501
  } | undefined;
2398
3502
  } | undefined;
3503
+ role?: string | undefined;
2399
3504
  error?: string | undefined;
2400
3505
  startedAt?: string | undefined;
2401
3506
  completedAt?: string | undefined;
2402
3507
  iterations?: number | undefined;
3508
+ attempts?: {
3509
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3510
+ startedAt: string;
3511
+ attempt: number;
3512
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3513
+ turnId?: string | undefined;
3514
+ error?: string | undefined;
3515
+ completedAt?: string | undefined;
3516
+ iteration?: number | undefined;
3517
+ }[] | undefined;
2403
3518
  }, {
2404
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
3519
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2405
3520
  agent: string;
2406
3521
  model: string;
2407
3522
  nodeId: string;
2408
3523
  sessionId?: string | undefined;
2409
- role?: string | undefined;
2410
3524
  turnId?: string | undefined;
2411
3525
  result?: {
2412
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3526
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2413
3527
  text?: string | undefined;
2414
3528
  usage?: {
2415
3529
  inputTokens?: number | undefined;
@@ -2424,10 +3538,21 @@ export declare const WorkflowNodeRuntime: z.ZodObject<{
2424
3538
  } | undefined;
2425
3539
  } | undefined;
2426
3540
  } | undefined;
3541
+ role?: string | undefined;
2427
3542
  error?: string | undefined;
2428
3543
  startedAt?: string | undefined;
2429
3544
  completedAt?: string | undefined;
2430
3545
  iterations?: number | undefined;
3546
+ attempts?: {
3547
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3548
+ startedAt: string;
3549
+ attempt: number;
3550
+ sessionId?: string | undefined;
3551
+ turnId?: string | undefined;
3552
+ error?: string | undefined;
3553
+ completedAt?: string | undefined;
3554
+ iteration?: number | undefined;
3555
+ }[] | undefined;
2431
3556
  }>;
2432
3557
  export type WorkflowNodeRuntime = z.infer<typeof WorkflowNodeRuntime>;
2433
3558
  export declare const WorkflowStatusParams: z.ZodObject<{
@@ -2438,15 +3563,275 @@ export declare const WorkflowStatusParams: z.ZodObject<{
2438
3563
  workflowId: string;
2439
3564
  }>;
2440
3565
  export type WorkflowStatusParams = z.infer<typeof WorkflowStatusParams>;
3566
+ export declare const WorkflowInputParams: z.ZodObject<{
3567
+ workflowId: z.ZodString;
3568
+ nodeId: z.ZodString;
3569
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
3570
+ turnId: z.ZodString;
3571
+ inputId: z.ZodString;
3572
+ input: z.ZodEffects<z.ZodString, string, string>;
3573
+ }, "strict", z.ZodTypeAny, {
3574
+ sessionId: string & z.BRAND<"SessionId">;
3575
+ turnId: string;
3576
+ nodeId: string;
3577
+ input: string;
3578
+ workflowId: string;
3579
+ inputId: string;
3580
+ }, {
3581
+ sessionId: string;
3582
+ turnId: string;
3583
+ nodeId: string;
3584
+ input: string;
3585
+ workflowId: string;
3586
+ inputId: string;
3587
+ }>;
3588
+ export type WorkflowInputParams = z.infer<typeof WorkflowInputParams>;
3589
+ export declare const WorkflowInputStatusParams: z.ZodObject<{
3590
+ workflowId: z.ZodString;
3591
+ inputId: z.ZodString;
3592
+ }, "strict", z.ZodTypeAny, {
3593
+ workflowId: string;
3594
+ inputId: string;
3595
+ }, {
3596
+ workflowId: string;
3597
+ inputId: string;
3598
+ }>;
3599
+ export type WorkflowInputStatusParams = z.infer<typeof WorkflowInputStatusParams>;
3600
+ export declare const WorkflowInputReceipt: z.ZodObject<{
3601
+ workflowId: z.ZodString;
3602
+ nodeId: z.ZodString;
3603
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
3604
+ turnId: z.ZodString;
3605
+ inputId: z.ZodString;
3606
+ contentHash: z.ZodString;
3607
+ state: z.ZodEnum<["inserting", "inserted", "unknown"]>;
3608
+ createdAt: z.ZodString;
3609
+ updatedAt: z.ZodString;
3610
+ errorCode: z.ZodOptional<z.ZodString>;
3611
+ }, "strict", z.ZodTypeAny, {
3612
+ sessionId: string & z.BRAND<"SessionId">;
3613
+ state: "unknown" | "inserting" | "inserted";
3614
+ createdAt: string;
3615
+ updatedAt: string;
3616
+ turnId: string;
3617
+ nodeId: string;
3618
+ workflowId: string;
3619
+ inputId: string;
3620
+ contentHash: string;
3621
+ errorCode?: string | undefined;
3622
+ }, {
3623
+ sessionId: string;
3624
+ state: "unknown" | "inserting" | "inserted";
3625
+ createdAt: string;
3626
+ updatedAt: string;
3627
+ turnId: string;
3628
+ nodeId: string;
3629
+ workflowId: string;
3630
+ inputId: string;
3631
+ contentHash: string;
3632
+ errorCode?: string | undefined;
3633
+ }>;
3634
+ export type WorkflowInputReceipt = z.infer<typeof WorkflowInputReceipt>;
3635
+ export declare const WorkflowInputStatusResult: z.ZodDiscriminatedUnion<"found", [z.ZodObject<{
3636
+ found: z.ZodLiteral<false>;
3637
+ workflowId: z.ZodString;
3638
+ inputId: z.ZodString;
3639
+ }, "strict", z.ZodTypeAny, {
3640
+ found: false;
3641
+ workflowId: string;
3642
+ inputId: string;
3643
+ }, {
3644
+ found: false;
3645
+ workflowId: string;
3646
+ inputId: string;
3647
+ }>, z.ZodObject<{
3648
+ found: z.ZodLiteral<true>;
3649
+ receipt: z.ZodObject<{
3650
+ workflowId: z.ZodString;
3651
+ nodeId: z.ZodString;
3652
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
3653
+ turnId: z.ZodString;
3654
+ inputId: z.ZodString;
3655
+ contentHash: z.ZodString;
3656
+ state: z.ZodEnum<["inserting", "inserted", "unknown"]>;
3657
+ createdAt: z.ZodString;
3658
+ updatedAt: z.ZodString;
3659
+ errorCode: z.ZodOptional<z.ZodString>;
3660
+ }, "strict", z.ZodTypeAny, {
3661
+ sessionId: string & z.BRAND<"SessionId">;
3662
+ state: "unknown" | "inserting" | "inserted";
3663
+ createdAt: string;
3664
+ updatedAt: string;
3665
+ turnId: string;
3666
+ nodeId: string;
3667
+ workflowId: string;
3668
+ inputId: string;
3669
+ contentHash: string;
3670
+ errorCode?: string | undefined;
3671
+ }, {
3672
+ sessionId: string;
3673
+ state: "unknown" | "inserting" | "inserted";
3674
+ createdAt: string;
3675
+ updatedAt: string;
3676
+ turnId: string;
3677
+ nodeId: string;
3678
+ workflowId: string;
3679
+ inputId: string;
3680
+ contentHash: string;
3681
+ errorCode?: string | undefined;
3682
+ }>;
3683
+ }, "strict", z.ZodTypeAny, {
3684
+ found: true;
3685
+ receipt: {
3686
+ sessionId: string & z.BRAND<"SessionId">;
3687
+ state: "unknown" | "inserting" | "inserted";
3688
+ createdAt: string;
3689
+ updatedAt: string;
3690
+ turnId: string;
3691
+ nodeId: string;
3692
+ workflowId: string;
3693
+ inputId: string;
3694
+ contentHash: string;
3695
+ errorCode?: string | undefined;
3696
+ };
3697
+ }, {
3698
+ found: true;
3699
+ receipt: {
3700
+ sessionId: string;
3701
+ state: "unknown" | "inserting" | "inserted";
3702
+ createdAt: string;
3703
+ updatedAt: string;
3704
+ turnId: string;
3705
+ nodeId: string;
3706
+ workflowId: string;
3707
+ inputId: string;
3708
+ contentHash: string;
3709
+ errorCode?: string | undefined;
3710
+ };
3711
+ }>]>;
3712
+ export type WorkflowInputStatusResult = z.infer<typeof WorkflowInputStatusResult>;
2441
3713
  export declare const WorkflowStatusResult: z.ZodObject<{
3714
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
3715
+ version: z.ZodLiteral<1>;
3716
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
3717
+ targets: z.ZodArray<z.ZodEffects<z.ZodObject<{
3718
+ version: z.ZodLiteral<1>;
3719
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
3720
+ turnId: z.ZodOptional<z.ZodString>;
3721
+ nodeId: z.ZodOptional<z.ZodString>;
3722
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
3723
+ observedAt: z.ZodString;
3724
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
3725
+ reasonCode: z.ZodOptional<z.ZodString>;
3726
+ }, "strict", z.ZodTypeAny, {
3727
+ sessionId: string & z.BRAND<"SessionId">;
3728
+ version: 1;
3729
+ state: "unknown" | "pending" | "confirmed";
3730
+ observedAt: string;
3731
+ turnId?: string | undefined;
3732
+ nodeId?: string | undefined;
3733
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3734
+ reasonCode?: string | undefined;
3735
+ }, {
3736
+ sessionId: string;
3737
+ version: 1;
3738
+ state: "unknown" | "pending" | "confirmed";
3739
+ observedAt: string;
3740
+ turnId?: string | undefined;
3741
+ nodeId?: string | undefined;
3742
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3743
+ reasonCode?: string | undefined;
3744
+ }>, {
3745
+ sessionId: string & z.BRAND<"SessionId">;
3746
+ version: 1;
3747
+ state: "unknown" | "pending" | "confirmed";
3748
+ observedAt: string;
3749
+ turnId?: string | undefined;
3750
+ nodeId?: string | undefined;
3751
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3752
+ reasonCode?: string | undefined;
3753
+ }, {
3754
+ sessionId: string;
3755
+ version: 1;
3756
+ state: "unknown" | "pending" | "confirmed";
3757
+ observedAt: string;
3758
+ turnId?: string | undefined;
3759
+ nodeId?: string | undefined;
3760
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3761
+ reasonCode?: string | undefined;
3762
+ }>, "many">;
3763
+ observedAt: z.ZodString;
3764
+ reasonCode: z.ZodOptional<z.ZodString>;
3765
+ }, "strict", z.ZodTypeAny, {
3766
+ version: 1;
3767
+ state: "unknown" | "pending" | "confirmed";
3768
+ observedAt: string;
3769
+ targets: {
3770
+ sessionId: string & z.BRAND<"SessionId">;
3771
+ version: 1;
3772
+ state: "unknown" | "pending" | "confirmed";
3773
+ observedAt: string;
3774
+ turnId?: string | undefined;
3775
+ nodeId?: string | undefined;
3776
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3777
+ reasonCode?: string | undefined;
3778
+ }[];
3779
+ reasonCode?: string | undefined;
3780
+ }, {
3781
+ version: 1;
3782
+ state: "unknown" | "pending" | "confirmed";
3783
+ observedAt: string;
3784
+ targets: {
3785
+ sessionId: string;
3786
+ version: 1;
3787
+ state: "unknown" | "pending" | "confirmed";
3788
+ observedAt: string;
3789
+ turnId?: string | undefined;
3790
+ nodeId?: string | undefined;
3791
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3792
+ reasonCode?: string | undefined;
3793
+ }[];
3794
+ reasonCode?: string | undefined;
3795
+ }>, {
3796
+ version: 1;
3797
+ state: "unknown" | "pending" | "confirmed";
3798
+ observedAt: string;
3799
+ targets: {
3800
+ sessionId: string & z.BRAND<"SessionId">;
3801
+ version: 1;
3802
+ state: "unknown" | "pending" | "confirmed";
3803
+ observedAt: string;
3804
+ turnId?: string | undefined;
3805
+ nodeId?: string | undefined;
3806
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3807
+ reasonCode?: string | undefined;
3808
+ }[];
3809
+ reasonCode?: string | undefined;
3810
+ }, {
3811
+ version: 1;
3812
+ state: "unknown" | "pending" | "confirmed";
3813
+ observedAt: string;
3814
+ targets: {
3815
+ sessionId: string;
3816
+ version: 1;
3817
+ state: "unknown" | "pending" | "confirmed";
3818
+ observedAt: string;
3819
+ turnId?: string | undefined;
3820
+ nodeId?: string | undefined;
3821
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
3822
+ reasonCode?: string | undefined;
3823
+ }[];
3824
+ reasonCode?: string | undefined;
3825
+ }>>;
3826
+ dispatchKey: z.ZodOptional<z.ZodString>;
2442
3827
  workflowId: z.ZodString;
2443
- status: z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>;
3828
+ status: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
2444
3829
  /** workflow 默认 project;v0.6 起可选。 */
2445
3830
  project: z.ZodOptional<z.ZodBranded<z.ZodString, "ProjectId">>;
2446
3831
  mode: z.ZodEnum<["dag", "graph", "discussion"]>;
2447
3832
  nodes: z.ZodArray<z.ZodObject<{
2448
3833
  nodeId: z.ZodString;
2449
- status: z.ZodEnum<["pending", "ready", "running", "completed", "failed", "skipped", "cancelled"]>;
3834
+ status: z.ZodEnum<["pending", "ready", "running", "paused", "completed", "failed", "skipped", "cancelled"]>;
2450
3835
  agent: z.ZodBranded<z.ZodString, "AgentId">;
2451
3836
  model: z.ZodString;
2452
3837
  role: z.ZodOptional<z.ZodString>;
@@ -2499,7 +3884,7 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2499
3884
  } | undefined;
2500
3885
  }>>;
2501
3886
  }, "strip", z.ZodTypeAny, {
2502
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3887
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2503
3888
  text?: string | undefined;
2504
3889
  usage?: {
2505
3890
  inputTokens?: number | undefined;
@@ -2514,7 +3899,7 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2514
3899
  } | undefined;
2515
3900
  } | undefined;
2516
3901
  }, {
2517
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3902
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2518
3903
  text?: string | undefined;
2519
3904
  usage?: {
2520
3905
  inputTokens?: number | undefined;
@@ -2531,16 +3916,44 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2531
3916
  }>>;
2532
3917
  /** 该节点完成的轮次计数(discussion 用;DAG/Graph 一次执行 = 1)。 */
2533
3918
  iterations: z.ZodOptional<z.ZodNumber>;
3919
+ /** 每次执行的 session/turn 映射;用于崩溃恢复、审计和 late-event fencing。 */
3920
+ attempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
3921
+ attempt: z.ZodNumber;
3922
+ iteration: z.ZodOptional<z.ZodNumber>;
3923
+ sessionId: z.ZodOptional<z.ZodBranded<z.ZodString, "SessionId">>;
3924
+ turnId: z.ZodOptional<z.ZodString>;
3925
+ status: z.ZodEnum<["running", "completed", "failed", "interrupted", "timeout", "cancelled"]>;
3926
+ startedAt: z.ZodString;
3927
+ completedAt: z.ZodOptional<z.ZodString>;
3928
+ error: z.ZodOptional<z.ZodString>;
3929
+ }, "strip", z.ZodTypeAny, {
3930
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3931
+ startedAt: string;
3932
+ attempt: number;
3933
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3934
+ turnId?: string | undefined;
3935
+ error?: string | undefined;
3936
+ completedAt?: string | undefined;
3937
+ iteration?: number | undefined;
3938
+ }, {
3939
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3940
+ startedAt: string;
3941
+ attempt: number;
3942
+ sessionId?: string | undefined;
3943
+ turnId?: string | undefined;
3944
+ error?: string | undefined;
3945
+ completedAt?: string | undefined;
3946
+ iteration?: number | undefined;
3947
+ }>, "many">>;
2534
3948
  }, "strip", z.ZodTypeAny, {
2535
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
3949
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2536
3950
  agent: string & z.BRAND<"AgentId">;
2537
3951
  model: string;
2538
3952
  nodeId: string;
2539
3953
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2540
- role?: string | undefined;
2541
3954
  turnId?: string | undefined;
2542
3955
  result?: {
2543
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3956
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2544
3957
  text?: string | undefined;
2545
3958
  usage?: {
2546
3959
  inputTokens?: number | undefined;
@@ -2555,20 +3968,30 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2555
3968
  } | undefined;
2556
3969
  } | undefined;
2557
3970
  } | undefined;
3971
+ role?: string | undefined;
2558
3972
  error?: string | undefined;
2559
3973
  startedAt?: string | undefined;
2560
3974
  completedAt?: string | undefined;
2561
3975
  iterations?: number | undefined;
3976
+ attempts?: {
3977
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
3978
+ startedAt: string;
3979
+ attempt: number;
3980
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3981
+ turnId?: string | undefined;
3982
+ error?: string | undefined;
3983
+ completedAt?: string | undefined;
3984
+ iteration?: number | undefined;
3985
+ }[] | undefined;
2562
3986
  }, {
2563
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
3987
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2564
3988
  agent: string;
2565
3989
  model: string;
2566
3990
  nodeId: string;
2567
3991
  sessionId?: string | undefined;
2568
- role?: string | undefined;
2569
3992
  turnId?: string | undefined;
2570
3993
  result?: {
2571
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
3994
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2572
3995
  text?: string | undefined;
2573
3996
  usage?: {
2574
3997
  inputTokens?: number | undefined;
@@ -2583,34 +4006,44 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2583
4006
  } | undefined;
2584
4007
  } | undefined;
2585
4008
  } | undefined;
4009
+ role?: string | undefined;
2586
4010
  error?: string | undefined;
2587
4011
  startedAt?: string | undefined;
2588
4012
  completedAt?: string | undefined;
2589
4013
  iterations?: number | undefined;
2590
- }>, "many">;
2591
- createdAt: z.ZodString;
2592
- updatedAt: z.ZodString;
2593
- completedAt: z.ZodOptional<z.ZodString>;
4014
+ attempts?: {
4015
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4016
+ startedAt: string;
4017
+ attempt: number;
4018
+ sessionId?: string | undefined;
4019
+ turnId?: string | undefined;
4020
+ error?: string | undefined;
4021
+ completedAt?: string | undefined;
4022
+ iteration?: number | undefined;
4023
+ }[] | undefined;
4024
+ }>, "many">;
4025
+ createdAt: z.ZodString;
4026
+ updatedAt: z.ZodString;
4027
+ completedAt: z.ZodOptional<z.ZodString>;
2594
4028
  error: z.ZodOptional<z.ZodString>;
2595
4029
  finalText: z.ZodOptional<z.ZodString>;
2596
4030
  /** 是否可 resume:phonon 持有该 workflow 的 checkpoint。 */
2597
4031
  resumable: z.ZodDefault<z.ZodBoolean>;
2598
4032
  }, "strip", z.ZodTypeAny, {
2599
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
2600
- createdAt: string;
4033
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2601
4034
  mode: "dag" | "graph" | "discussion";
2602
- workflowId: string;
4035
+ createdAt: string;
2603
4036
  updatedAt: string;
4037
+ workflowId: string;
2604
4038
  nodes: {
2605
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
4039
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2606
4040
  agent: string & z.BRAND<"AgentId">;
2607
4041
  model: string;
2608
4042
  nodeId: string;
2609
4043
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2610
- role?: string | undefined;
2611
4044
  turnId?: string | undefined;
2612
4045
  result?: {
2613
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4046
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2614
4047
  text?: string | undefined;
2615
4048
  usage?: {
2616
4049
  inputTokens?: number | undefined;
@@ -2625,32 +4058,59 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2625
4058
  } | undefined;
2626
4059
  } | undefined;
2627
4060
  } | undefined;
4061
+ role?: string | undefined;
2628
4062
  error?: string | undefined;
2629
4063
  startedAt?: string | undefined;
2630
4064
  completedAt?: string | undefined;
2631
4065
  iterations?: number | undefined;
4066
+ attempts?: {
4067
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4068
+ startedAt: string;
4069
+ attempt: number;
4070
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
4071
+ turnId?: string | undefined;
4072
+ error?: string | undefined;
4073
+ completedAt?: string | undefined;
4074
+ iteration?: number | undefined;
4075
+ }[] | undefined;
2632
4076
  }[];
2633
4077
  resumable: boolean;
2634
4078
  project?: (string & z.BRAND<"ProjectId">) | undefined;
4079
+ nativeStop?: {
4080
+ version: 1;
4081
+ state: "unknown" | "pending" | "confirmed";
4082
+ observedAt: string;
4083
+ targets: {
4084
+ sessionId: string & z.BRAND<"SessionId">;
4085
+ version: 1;
4086
+ state: "unknown" | "pending" | "confirmed";
4087
+ observedAt: string;
4088
+ turnId?: string | undefined;
4089
+ nodeId?: string | undefined;
4090
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4091
+ reasonCode?: string | undefined;
4092
+ }[];
4093
+ reasonCode?: string | undefined;
4094
+ } | undefined;
2635
4095
  error?: string | undefined;
2636
4096
  completedAt?: string | undefined;
4097
+ dispatchKey?: string | undefined;
2637
4098
  finalText?: string | undefined;
2638
4099
  }, {
2639
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
2640
- createdAt: string;
4100
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2641
4101
  mode: "dag" | "graph" | "discussion";
2642
- workflowId: string;
4102
+ createdAt: string;
2643
4103
  updatedAt: string;
4104
+ workflowId: string;
2644
4105
  nodes: {
2645
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
4106
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2646
4107
  agent: string;
2647
4108
  model: string;
2648
4109
  nodeId: string;
2649
4110
  sessionId?: string | undefined;
2650
- role?: string | undefined;
2651
4111
  turnId?: string | undefined;
2652
4112
  result?: {
2653
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4113
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2654
4114
  text?: string | undefined;
2655
4115
  usage?: {
2656
4116
  inputTokens?: number | undefined;
@@ -2665,18 +4125,123 @@ export declare const WorkflowStatusResult: z.ZodObject<{
2665
4125
  } | undefined;
2666
4126
  } | undefined;
2667
4127
  } | undefined;
4128
+ role?: string | undefined;
2668
4129
  error?: string | undefined;
2669
4130
  startedAt?: string | undefined;
2670
4131
  completedAt?: string | undefined;
2671
4132
  iterations?: number | undefined;
4133
+ attempts?: {
4134
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4135
+ startedAt: string;
4136
+ attempt: number;
4137
+ sessionId?: string | undefined;
4138
+ turnId?: string | undefined;
4139
+ error?: string | undefined;
4140
+ completedAt?: string | undefined;
4141
+ iteration?: number | undefined;
4142
+ }[] | undefined;
2672
4143
  }[];
2673
4144
  project?: string | undefined;
4145
+ nativeStop?: {
4146
+ version: 1;
4147
+ state: "unknown" | "pending" | "confirmed";
4148
+ observedAt: string;
4149
+ targets: {
4150
+ sessionId: string;
4151
+ version: 1;
4152
+ state: "unknown" | "pending" | "confirmed";
4153
+ observedAt: string;
4154
+ turnId?: string | undefined;
4155
+ nodeId?: string | undefined;
4156
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4157
+ reasonCode?: string | undefined;
4158
+ }[];
4159
+ reasonCode?: string | undefined;
4160
+ } | undefined;
2674
4161
  error?: string | undefined;
2675
4162
  completedAt?: string | undefined;
4163
+ dispatchKey?: string | undefined;
2676
4164
  finalText?: string | undefined;
2677
4165
  resumable?: boolean | undefined;
2678
4166
  }>;
2679
4167
  export type WorkflowStatusResult = z.infer<typeof WorkflowStatusResult>;
4168
+ export declare const WorkflowResultParams: z.ZodObject<{
4169
+ workflowId: z.ZodString;
4170
+ nodeId: z.ZodOptional<z.ZodString>;
4171
+ offset: z.ZodDefault<z.ZodNumber>;
4172
+ version: z.ZodOptional<z.ZodString>;
4173
+ knownVersion: z.ZodOptional<z.ZodString>;
4174
+ }, "strict", z.ZodTypeAny, {
4175
+ offset: number;
4176
+ workflowId: string;
4177
+ version?: string | undefined;
4178
+ nodeId?: string | undefined;
4179
+ knownVersion?: string | undefined;
4180
+ }, {
4181
+ workflowId: string;
4182
+ offset?: number | undefined;
4183
+ version?: string | undefined;
4184
+ nodeId?: string | undefined;
4185
+ knownVersion?: string | undefined;
4186
+ }>;
4187
+ export type WorkflowResultParams = z.infer<typeof WorkflowResultParams>;
4188
+ export declare const WorkflowResultPage: z.ZodEffects<z.ZodObject<{
4189
+ workflowId: z.ZodString;
4190
+ project: z.ZodOptional<z.ZodBranded<z.ZodString, "ProjectId">>;
4191
+ nodeId: z.ZodOptional<z.ZodString>;
4192
+ status: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
4193
+ version: z.ZodString;
4194
+ offset: z.ZodNumber;
4195
+ end: z.ZodNumber;
4196
+ totalLength: z.ZodNumber;
4197
+ text: z.ZodOptional<z.ZodString>;
4198
+ omitted: z.ZodOptional<z.ZodLiteral<true>>;
4199
+ }, "strict", z.ZodTypeAny, {
4200
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
4201
+ offset: number;
4202
+ version: string;
4203
+ workflowId: string;
4204
+ end: number;
4205
+ totalLength: number;
4206
+ project?: (string & z.BRAND<"ProjectId">) | undefined;
4207
+ nodeId?: string | undefined;
4208
+ text?: string | undefined;
4209
+ omitted?: true | undefined;
4210
+ }, {
4211
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
4212
+ offset: number;
4213
+ version: string;
4214
+ workflowId: string;
4215
+ end: number;
4216
+ totalLength: number;
4217
+ project?: string | undefined;
4218
+ nodeId?: string | undefined;
4219
+ text?: string | undefined;
4220
+ omitted?: true | undefined;
4221
+ }>, {
4222
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
4223
+ offset: number;
4224
+ version: string;
4225
+ workflowId: string;
4226
+ end: number;
4227
+ totalLength: number;
4228
+ project?: (string & z.BRAND<"ProjectId">) | undefined;
4229
+ nodeId?: string | undefined;
4230
+ text?: string | undefined;
4231
+ omitted?: true | undefined;
4232
+ }, {
4233
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
4234
+ offset: number;
4235
+ version: string;
4236
+ workflowId: string;
4237
+ end: number;
4238
+ totalLength: number;
4239
+ project?: string | undefined;
4240
+ nodeId?: string | undefined;
4241
+ text?: string | undefined;
4242
+ omitted?: true | undefined;
4243
+ }>;
4244
+ export type WorkflowResultPage = z.infer<typeof WorkflowResultPage>;
2680
4245
  export declare const WorkflowCancelParams: z.ZodObject<{
2681
4246
  workflowId: z.ZodString;
2682
4247
  reason: z.ZodOptional<z.ZodString>;
@@ -2688,50 +4253,507 @@ export declare const WorkflowCancelParams: z.ZodObject<{
2688
4253
  reason?: string | undefined;
2689
4254
  }>;
2690
4255
  export type WorkflowCancelParams = z.infer<typeof WorkflowCancelParams>;
4256
+ export declare const WorkflowDispatchCancelParams: z.ZodObject<{
4257
+ dispatchKey: z.ZodString;
4258
+ project: z.ZodBranded<z.ZodString, "ProjectId">;
4259
+ reason: z.ZodOptional<z.ZodString>;
4260
+ }, "strip", z.ZodTypeAny, {
4261
+ project: string & z.BRAND<"ProjectId">;
4262
+ dispatchKey: string;
4263
+ reason?: string | undefined;
4264
+ }, {
4265
+ project: string;
4266
+ dispatchKey: string;
4267
+ reason?: string | undefined;
4268
+ }>;
4269
+ export type WorkflowDispatchCancelParams = z.infer<typeof WorkflowDispatchCancelParams>;
4270
+ export declare const WorkflowDispatchCancelResult: z.ZodObject<{
4271
+ dispatchKey: z.ZodString;
4272
+ workflowId: z.ZodOptional<z.ZodString>;
4273
+ status: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
4274
+ cancelledBeforeStart: z.ZodBoolean;
4275
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
4276
+ version: z.ZodLiteral<1>;
4277
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
4278
+ targets: z.ZodArray<z.ZodEffects<z.ZodObject<{
4279
+ version: z.ZodLiteral<1>;
4280
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
4281
+ turnId: z.ZodOptional<z.ZodString>;
4282
+ nodeId: z.ZodOptional<z.ZodString>;
4283
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
4284
+ observedAt: z.ZodString;
4285
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
4286
+ reasonCode: z.ZodOptional<z.ZodString>;
4287
+ }, "strict", z.ZodTypeAny, {
4288
+ sessionId: string & z.BRAND<"SessionId">;
4289
+ version: 1;
4290
+ state: "unknown" | "pending" | "confirmed";
4291
+ observedAt: string;
4292
+ turnId?: string | undefined;
4293
+ nodeId?: string | undefined;
4294
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4295
+ reasonCode?: string | undefined;
4296
+ }, {
4297
+ sessionId: string;
4298
+ version: 1;
4299
+ state: "unknown" | "pending" | "confirmed";
4300
+ observedAt: string;
4301
+ turnId?: string | undefined;
4302
+ nodeId?: string | undefined;
4303
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4304
+ reasonCode?: string | undefined;
4305
+ }>, {
4306
+ sessionId: string & z.BRAND<"SessionId">;
4307
+ version: 1;
4308
+ state: "unknown" | "pending" | "confirmed";
4309
+ observedAt: string;
4310
+ turnId?: string | undefined;
4311
+ nodeId?: string | undefined;
4312
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4313
+ reasonCode?: string | undefined;
4314
+ }, {
4315
+ sessionId: string;
4316
+ version: 1;
4317
+ state: "unknown" | "pending" | "confirmed";
4318
+ observedAt: string;
4319
+ turnId?: string | undefined;
4320
+ nodeId?: string | undefined;
4321
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4322
+ reasonCode?: string | undefined;
4323
+ }>, "many">;
4324
+ observedAt: z.ZodString;
4325
+ reasonCode: z.ZodOptional<z.ZodString>;
4326
+ }, "strict", z.ZodTypeAny, {
4327
+ version: 1;
4328
+ state: "unknown" | "pending" | "confirmed";
4329
+ observedAt: string;
4330
+ targets: {
4331
+ sessionId: string & z.BRAND<"SessionId">;
4332
+ version: 1;
4333
+ state: "unknown" | "pending" | "confirmed";
4334
+ observedAt: string;
4335
+ turnId?: string | undefined;
4336
+ nodeId?: string | undefined;
4337
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4338
+ reasonCode?: string | undefined;
4339
+ }[];
4340
+ reasonCode?: string | undefined;
4341
+ }, {
4342
+ version: 1;
4343
+ state: "unknown" | "pending" | "confirmed";
4344
+ observedAt: string;
4345
+ targets: {
4346
+ sessionId: string;
4347
+ version: 1;
4348
+ state: "unknown" | "pending" | "confirmed";
4349
+ observedAt: string;
4350
+ turnId?: string | undefined;
4351
+ nodeId?: string | undefined;
4352
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4353
+ reasonCode?: string | undefined;
4354
+ }[];
4355
+ reasonCode?: string | undefined;
4356
+ }>, {
4357
+ version: 1;
4358
+ state: "unknown" | "pending" | "confirmed";
4359
+ observedAt: string;
4360
+ targets: {
4361
+ sessionId: string & z.BRAND<"SessionId">;
4362
+ version: 1;
4363
+ state: "unknown" | "pending" | "confirmed";
4364
+ observedAt: string;
4365
+ turnId?: string | undefined;
4366
+ nodeId?: string | undefined;
4367
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4368
+ reasonCode?: string | undefined;
4369
+ }[];
4370
+ reasonCode?: string | undefined;
4371
+ }, {
4372
+ version: 1;
4373
+ state: "unknown" | "pending" | "confirmed";
4374
+ observedAt: string;
4375
+ targets: {
4376
+ sessionId: string;
4377
+ version: 1;
4378
+ state: "unknown" | "pending" | "confirmed";
4379
+ observedAt: string;
4380
+ turnId?: string | undefined;
4381
+ nodeId?: string | undefined;
4382
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4383
+ reasonCode?: string | undefined;
4384
+ }[];
4385
+ reasonCode?: string | undefined;
4386
+ }>>;
4387
+ }, "strip", z.ZodTypeAny, {
4388
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
4389
+ dispatchKey: string;
4390
+ cancelledBeforeStart: boolean;
4391
+ nativeStop?: {
4392
+ version: 1;
4393
+ state: "unknown" | "pending" | "confirmed";
4394
+ observedAt: string;
4395
+ targets: {
4396
+ sessionId: string & z.BRAND<"SessionId">;
4397
+ version: 1;
4398
+ state: "unknown" | "pending" | "confirmed";
4399
+ observedAt: string;
4400
+ turnId?: string | undefined;
4401
+ nodeId?: string | undefined;
4402
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4403
+ reasonCode?: string | undefined;
4404
+ }[];
4405
+ reasonCode?: string | undefined;
4406
+ } | undefined;
4407
+ workflowId?: string | undefined;
4408
+ }, {
4409
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
4410
+ dispatchKey: string;
4411
+ cancelledBeforeStart: boolean;
4412
+ nativeStop?: {
4413
+ version: 1;
4414
+ state: "unknown" | "pending" | "confirmed";
4415
+ observedAt: string;
4416
+ targets: {
4417
+ sessionId: string;
4418
+ version: 1;
4419
+ state: "unknown" | "pending" | "confirmed";
4420
+ observedAt: string;
4421
+ turnId?: string | undefined;
4422
+ nodeId?: string | undefined;
4423
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4424
+ reasonCode?: string | undefined;
4425
+ }[];
4426
+ reasonCode?: string | undefined;
4427
+ } | undefined;
4428
+ workflowId?: string | undefined;
4429
+ }>;
4430
+ export type WorkflowDispatchCancelResult = z.infer<typeof WorkflowDispatchCancelResult>;
2691
4431
  export declare const WorkflowCancelResult: z.ZodObject<{
2692
4432
  workflowId: z.ZodString;
2693
- status: z.ZodLiteral<"cancelled">;
4433
+ status: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
4434
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
4435
+ version: z.ZodLiteral<1>;
4436
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
4437
+ targets: z.ZodArray<z.ZodEffects<z.ZodObject<{
4438
+ version: z.ZodLiteral<1>;
4439
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
4440
+ turnId: z.ZodOptional<z.ZodString>;
4441
+ nodeId: z.ZodOptional<z.ZodString>;
4442
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
4443
+ observedAt: z.ZodString;
4444
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
4445
+ reasonCode: z.ZodOptional<z.ZodString>;
4446
+ }, "strict", z.ZodTypeAny, {
4447
+ sessionId: string & z.BRAND<"SessionId">;
4448
+ version: 1;
4449
+ state: "unknown" | "pending" | "confirmed";
4450
+ observedAt: string;
4451
+ turnId?: string | undefined;
4452
+ nodeId?: string | undefined;
4453
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4454
+ reasonCode?: string | undefined;
4455
+ }, {
4456
+ sessionId: string;
4457
+ version: 1;
4458
+ state: "unknown" | "pending" | "confirmed";
4459
+ observedAt: string;
4460
+ turnId?: string | undefined;
4461
+ nodeId?: string | undefined;
4462
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4463
+ reasonCode?: string | undefined;
4464
+ }>, {
4465
+ sessionId: string & z.BRAND<"SessionId">;
4466
+ version: 1;
4467
+ state: "unknown" | "pending" | "confirmed";
4468
+ observedAt: string;
4469
+ turnId?: string | undefined;
4470
+ nodeId?: string | undefined;
4471
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4472
+ reasonCode?: string | undefined;
4473
+ }, {
4474
+ sessionId: string;
4475
+ version: 1;
4476
+ state: "unknown" | "pending" | "confirmed";
4477
+ observedAt: string;
4478
+ turnId?: string | undefined;
4479
+ nodeId?: string | undefined;
4480
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4481
+ reasonCode?: string | undefined;
4482
+ }>, "many">;
4483
+ observedAt: z.ZodString;
4484
+ reasonCode: z.ZodOptional<z.ZodString>;
4485
+ }, "strict", z.ZodTypeAny, {
4486
+ version: 1;
4487
+ state: "unknown" | "pending" | "confirmed";
4488
+ observedAt: string;
4489
+ targets: {
4490
+ sessionId: string & z.BRAND<"SessionId">;
4491
+ version: 1;
4492
+ state: "unknown" | "pending" | "confirmed";
4493
+ observedAt: string;
4494
+ turnId?: string | undefined;
4495
+ nodeId?: string | undefined;
4496
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4497
+ reasonCode?: string | undefined;
4498
+ }[];
4499
+ reasonCode?: string | undefined;
4500
+ }, {
4501
+ version: 1;
4502
+ state: "unknown" | "pending" | "confirmed";
4503
+ observedAt: string;
4504
+ targets: {
4505
+ sessionId: string;
4506
+ version: 1;
4507
+ state: "unknown" | "pending" | "confirmed";
4508
+ observedAt: string;
4509
+ turnId?: string | undefined;
4510
+ nodeId?: string | undefined;
4511
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4512
+ reasonCode?: string | undefined;
4513
+ }[];
4514
+ reasonCode?: string | undefined;
4515
+ }>, {
4516
+ version: 1;
4517
+ state: "unknown" | "pending" | "confirmed";
4518
+ observedAt: string;
4519
+ targets: {
4520
+ sessionId: string & z.BRAND<"SessionId">;
4521
+ version: 1;
4522
+ state: "unknown" | "pending" | "confirmed";
4523
+ observedAt: string;
4524
+ turnId?: string | undefined;
4525
+ nodeId?: string | undefined;
4526
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4527
+ reasonCode?: string | undefined;
4528
+ }[];
4529
+ reasonCode?: string | undefined;
4530
+ }, {
4531
+ version: 1;
4532
+ state: "unknown" | "pending" | "confirmed";
4533
+ observedAt: string;
4534
+ targets: {
4535
+ sessionId: string;
4536
+ version: 1;
4537
+ state: "unknown" | "pending" | "confirmed";
4538
+ observedAt: string;
4539
+ turnId?: string | undefined;
4540
+ nodeId?: string | undefined;
4541
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4542
+ reasonCode?: string | undefined;
4543
+ }[];
4544
+ reasonCode?: string | undefined;
4545
+ }>>;
2694
4546
  }, "strip", z.ZodTypeAny, {
2695
- status: "cancelled";
4547
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2696
4548
  workflowId: string;
4549
+ nativeStop?: {
4550
+ version: 1;
4551
+ state: "unknown" | "pending" | "confirmed";
4552
+ observedAt: string;
4553
+ targets: {
4554
+ sessionId: string & z.BRAND<"SessionId">;
4555
+ version: 1;
4556
+ state: "unknown" | "pending" | "confirmed";
4557
+ observedAt: string;
4558
+ turnId?: string | undefined;
4559
+ nodeId?: string | undefined;
4560
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4561
+ reasonCode?: string | undefined;
4562
+ }[];
4563
+ reasonCode?: string | undefined;
4564
+ } | undefined;
2697
4565
  }, {
2698
- status: "cancelled";
4566
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2699
4567
  workflowId: string;
4568
+ nativeStop?: {
4569
+ version: 1;
4570
+ state: "unknown" | "pending" | "confirmed";
4571
+ observedAt: string;
4572
+ targets: {
4573
+ sessionId: string;
4574
+ version: 1;
4575
+ state: "unknown" | "pending" | "confirmed";
4576
+ observedAt: string;
4577
+ turnId?: string | undefined;
4578
+ nodeId?: string | undefined;
4579
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4580
+ reasonCode?: string | undefined;
4581
+ }[];
4582
+ reasonCode?: string | undefined;
4583
+ } | undefined;
2700
4584
  }>;
2701
4585
  export type WorkflowCancelResult = z.infer<typeof WorkflowCancelResult>;
4586
+ export declare const WorkflowPauseParams: z.ZodObject<{
4587
+ workflowId: z.ZodString;
4588
+ reason: z.ZodOptional<z.ZodString>;
4589
+ }, "strip", z.ZodTypeAny, {
4590
+ workflowId: string;
4591
+ reason?: string | undefined;
4592
+ }, {
4593
+ workflowId: string;
4594
+ reason?: string | undefined;
4595
+ }>;
4596
+ export type WorkflowPauseParams = z.infer<typeof WorkflowPauseParams>;
4597
+ export declare const WorkflowPauseResult: z.ZodObject<{
4598
+ workflowId: z.ZodString;
4599
+ status: z.ZodLiteral<"paused">;
4600
+ }, "strip", z.ZodTypeAny, {
4601
+ status: "paused";
4602
+ workflowId: string;
4603
+ }, {
4604
+ status: "paused";
4605
+ workflowId: string;
4606
+ }>;
4607
+ export type WorkflowPauseResult = z.infer<typeof WorkflowPauseResult>;
2702
4608
  export declare const WorkflowListParams: z.ZodObject<{
2703
- status: z.ZodOptional<z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>>;
4609
+ dispatchKey: z.ZodOptional<z.ZodString>;
4610
+ status: z.ZodOptional<z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>>;
2704
4611
  projectId: z.ZodOptional<z.ZodBranded<z.ZodString, "ProjectId">>;
2705
4612
  since: z.ZodOptional<z.ZodString>;
2706
4613
  until: z.ZodOptional<z.ZodString>;
2707
4614
  limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2708
4615
  cursor: z.ZodOptional<z.ZodString>;
2709
4616
  }, "strip", z.ZodTypeAny, {
2710
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled" | undefined;
4617
+ status?: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled" | undefined;
4618
+ projectId?: (string & z.BRAND<"ProjectId">) | undefined;
2711
4619
  limit?: number | undefined;
2712
4620
  cursor?: string | undefined;
2713
- projectId?: (string & z.BRAND<"ProjectId">) | undefined;
2714
4621
  since?: string | undefined;
2715
4622
  until?: string | undefined;
4623
+ dispatchKey?: string | undefined;
2716
4624
  }, {
2717
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled" | undefined;
4625
+ status?: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled" | undefined;
4626
+ projectId?: string | undefined;
2718
4627
  limit?: number | undefined;
2719
4628
  cursor?: string | undefined;
2720
- projectId?: string | undefined;
2721
4629
  since?: string | undefined;
2722
4630
  until?: string | undefined;
4631
+ dispatchKey?: string | undefined;
2723
4632
  }>;
2724
4633
  export type WorkflowListParams = z.infer<typeof WorkflowListParams>;
2725
4634
  export declare const WorkflowListResult: z.ZodObject<{
2726
4635
  workflows: z.ZodArray<z.ZodObject<{
4636
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
4637
+ version: z.ZodLiteral<1>;
4638
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
4639
+ targets: z.ZodArray<z.ZodEffects<z.ZodObject<{
4640
+ version: z.ZodLiteral<1>;
4641
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
4642
+ turnId: z.ZodOptional<z.ZodString>;
4643
+ nodeId: z.ZodOptional<z.ZodString>;
4644
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
4645
+ observedAt: z.ZodString;
4646
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
4647
+ reasonCode: z.ZodOptional<z.ZodString>;
4648
+ }, "strict", z.ZodTypeAny, {
4649
+ sessionId: string & z.BRAND<"SessionId">;
4650
+ version: 1;
4651
+ state: "unknown" | "pending" | "confirmed";
4652
+ observedAt: string;
4653
+ turnId?: string | undefined;
4654
+ nodeId?: string | undefined;
4655
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4656
+ reasonCode?: string | undefined;
4657
+ }, {
4658
+ sessionId: string;
4659
+ version: 1;
4660
+ state: "unknown" | "pending" | "confirmed";
4661
+ observedAt: string;
4662
+ turnId?: string | undefined;
4663
+ nodeId?: string | undefined;
4664
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4665
+ reasonCode?: string | undefined;
4666
+ }>, {
4667
+ sessionId: string & z.BRAND<"SessionId">;
4668
+ version: 1;
4669
+ state: "unknown" | "pending" | "confirmed";
4670
+ observedAt: string;
4671
+ turnId?: string | undefined;
4672
+ nodeId?: string | undefined;
4673
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4674
+ reasonCode?: string | undefined;
4675
+ }, {
4676
+ sessionId: string;
4677
+ version: 1;
4678
+ state: "unknown" | "pending" | "confirmed";
4679
+ observedAt: string;
4680
+ turnId?: string | undefined;
4681
+ nodeId?: string | undefined;
4682
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4683
+ reasonCode?: string | undefined;
4684
+ }>, "many">;
4685
+ observedAt: z.ZodString;
4686
+ reasonCode: z.ZodOptional<z.ZodString>;
4687
+ }, "strict", z.ZodTypeAny, {
4688
+ version: 1;
4689
+ state: "unknown" | "pending" | "confirmed";
4690
+ observedAt: string;
4691
+ targets: {
4692
+ sessionId: string & z.BRAND<"SessionId">;
4693
+ version: 1;
4694
+ state: "unknown" | "pending" | "confirmed";
4695
+ observedAt: string;
4696
+ turnId?: string | undefined;
4697
+ nodeId?: string | undefined;
4698
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4699
+ reasonCode?: string | undefined;
4700
+ }[];
4701
+ reasonCode?: string | undefined;
4702
+ }, {
4703
+ version: 1;
4704
+ state: "unknown" | "pending" | "confirmed";
4705
+ observedAt: string;
4706
+ targets: {
4707
+ sessionId: string;
4708
+ version: 1;
4709
+ state: "unknown" | "pending" | "confirmed";
4710
+ observedAt: string;
4711
+ turnId?: string | undefined;
4712
+ nodeId?: string | undefined;
4713
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4714
+ reasonCode?: string | undefined;
4715
+ }[];
4716
+ reasonCode?: string | undefined;
4717
+ }>, {
4718
+ version: 1;
4719
+ state: "unknown" | "pending" | "confirmed";
4720
+ observedAt: string;
4721
+ targets: {
4722
+ sessionId: string & z.BRAND<"SessionId">;
4723
+ version: 1;
4724
+ state: "unknown" | "pending" | "confirmed";
4725
+ observedAt: string;
4726
+ turnId?: string | undefined;
4727
+ nodeId?: string | undefined;
4728
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4729
+ reasonCode?: string | undefined;
4730
+ }[];
4731
+ reasonCode?: string | undefined;
4732
+ }, {
4733
+ version: 1;
4734
+ state: "unknown" | "pending" | "confirmed";
4735
+ observedAt: string;
4736
+ targets: {
4737
+ sessionId: string;
4738
+ version: 1;
4739
+ state: "unknown" | "pending" | "confirmed";
4740
+ observedAt: string;
4741
+ turnId?: string | undefined;
4742
+ nodeId?: string | undefined;
4743
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
4744
+ reasonCode?: string | undefined;
4745
+ }[];
4746
+ reasonCode?: string | undefined;
4747
+ }>>;
4748
+ dispatchKey: z.ZodOptional<z.ZodString>;
2727
4749
  workflowId: z.ZodString;
2728
- status: z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>;
4750
+ status: z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>;
2729
4751
  /** workflow 默认 project;v0.6 起可选。 */
2730
4752
  project: z.ZodOptional<z.ZodBranded<z.ZodString, "ProjectId">>;
2731
4753
  mode: z.ZodEnum<["dag", "graph", "discussion"]>;
2732
4754
  nodes: z.ZodArray<z.ZodObject<{
2733
4755
  nodeId: z.ZodString;
2734
- status: z.ZodEnum<["pending", "ready", "running", "completed", "failed", "skipped", "cancelled"]>;
4756
+ status: z.ZodEnum<["pending", "ready", "running", "paused", "completed", "failed", "skipped", "cancelled"]>;
2735
4757
  agent: z.ZodBranded<z.ZodString, "AgentId">;
2736
4758
  model: z.ZodString;
2737
4759
  role: z.ZodOptional<z.ZodString>;
@@ -2784,7 +4806,7 @@ export declare const WorkflowListResult: z.ZodObject<{
2784
4806
  } | undefined;
2785
4807
  }>>;
2786
4808
  }, "strip", z.ZodTypeAny, {
2787
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4809
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2788
4810
  text?: string | undefined;
2789
4811
  usage?: {
2790
4812
  inputTokens?: number | undefined;
@@ -2799,7 +4821,7 @@ export declare const WorkflowListResult: z.ZodObject<{
2799
4821
  } | undefined;
2800
4822
  } | undefined;
2801
4823
  }, {
2802
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4824
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2803
4825
  text?: string | undefined;
2804
4826
  usage?: {
2805
4827
  inputTokens?: number | undefined;
@@ -2816,16 +4838,44 @@ export declare const WorkflowListResult: z.ZodObject<{
2816
4838
  }>>;
2817
4839
  /** 该节点完成的轮次计数(discussion 用;DAG/Graph 一次执行 = 1)。 */
2818
4840
  iterations: z.ZodOptional<z.ZodNumber>;
4841
+ /** 每次执行的 session/turn 映射;用于崩溃恢复、审计和 late-event fencing。 */
4842
+ attempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
4843
+ attempt: z.ZodNumber;
4844
+ iteration: z.ZodOptional<z.ZodNumber>;
4845
+ sessionId: z.ZodOptional<z.ZodBranded<z.ZodString, "SessionId">>;
4846
+ turnId: z.ZodOptional<z.ZodString>;
4847
+ status: z.ZodEnum<["running", "completed", "failed", "interrupted", "timeout", "cancelled"]>;
4848
+ startedAt: z.ZodString;
4849
+ completedAt: z.ZodOptional<z.ZodString>;
4850
+ error: z.ZodOptional<z.ZodString>;
4851
+ }, "strip", z.ZodTypeAny, {
4852
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4853
+ startedAt: string;
4854
+ attempt: number;
4855
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
4856
+ turnId?: string | undefined;
4857
+ error?: string | undefined;
4858
+ completedAt?: string | undefined;
4859
+ iteration?: number | undefined;
4860
+ }, {
4861
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4862
+ startedAt: string;
4863
+ attempt: number;
4864
+ sessionId?: string | undefined;
4865
+ turnId?: string | undefined;
4866
+ error?: string | undefined;
4867
+ completedAt?: string | undefined;
4868
+ iteration?: number | undefined;
4869
+ }>, "many">>;
2819
4870
  }, "strip", z.ZodTypeAny, {
2820
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
4871
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2821
4872
  agent: string & z.BRAND<"AgentId">;
2822
4873
  model: string;
2823
4874
  nodeId: string;
2824
4875
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2825
- role?: string | undefined;
2826
4876
  turnId?: string | undefined;
2827
4877
  result?: {
2828
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4878
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2829
4879
  text?: string | undefined;
2830
4880
  usage?: {
2831
4881
  inputTokens?: number | undefined;
@@ -2840,20 +4890,30 @@ export declare const WorkflowListResult: z.ZodObject<{
2840
4890
  } | undefined;
2841
4891
  } | undefined;
2842
4892
  } | undefined;
4893
+ role?: string | undefined;
2843
4894
  error?: string | undefined;
2844
4895
  startedAt?: string | undefined;
2845
4896
  completedAt?: string | undefined;
2846
4897
  iterations?: number | undefined;
4898
+ attempts?: {
4899
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4900
+ startedAt: string;
4901
+ attempt: number;
4902
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
4903
+ turnId?: string | undefined;
4904
+ error?: string | undefined;
4905
+ completedAt?: string | undefined;
4906
+ iteration?: number | undefined;
4907
+ }[] | undefined;
2847
4908
  }, {
2848
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
4909
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2849
4910
  agent: string;
2850
4911
  model: string;
2851
4912
  nodeId: string;
2852
4913
  sessionId?: string | undefined;
2853
- role?: string | undefined;
2854
4914
  turnId?: string | undefined;
2855
4915
  result?: {
2856
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4916
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2857
4917
  text?: string | undefined;
2858
4918
  usage?: {
2859
4919
  inputTokens?: number | undefined;
@@ -2868,10 +4928,21 @@ export declare const WorkflowListResult: z.ZodObject<{
2868
4928
  } | undefined;
2869
4929
  } | undefined;
2870
4930
  } | undefined;
4931
+ role?: string | undefined;
2871
4932
  error?: string | undefined;
2872
4933
  startedAt?: string | undefined;
2873
4934
  completedAt?: string | undefined;
2874
4935
  iterations?: number | undefined;
4936
+ attempts?: {
4937
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4938
+ startedAt: string;
4939
+ attempt: number;
4940
+ sessionId?: string | undefined;
4941
+ turnId?: string | undefined;
4942
+ error?: string | undefined;
4943
+ completedAt?: string | undefined;
4944
+ iteration?: number | undefined;
4945
+ }[] | undefined;
2875
4946
  }>, "many">;
2876
4947
  createdAt: z.ZodString;
2877
4948
  updatedAt: z.ZodString;
@@ -2881,21 +4952,20 @@ export declare const WorkflowListResult: z.ZodObject<{
2881
4952
  /** 是否可 resume:phonon 持有该 workflow 的 checkpoint。 */
2882
4953
  resumable: z.ZodDefault<z.ZodBoolean>;
2883
4954
  }, "strip", z.ZodTypeAny, {
2884
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
2885
- createdAt: string;
4955
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2886
4956
  mode: "dag" | "graph" | "discussion";
2887
- workflowId: string;
4957
+ createdAt: string;
2888
4958
  updatedAt: string;
4959
+ workflowId: string;
2889
4960
  nodes: {
2890
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
4961
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2891
4962
  agent: string & z.BRAND<"AgentId">;
2892
4963
  model: string;
2893
4964
  nodeId: string;
2894
4965
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2895
- role?: string | undefined;
2896
4966
  turnId?: string | undefined;
2897
4967
  result?: {
2898
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
4968
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2899
4969
  text?: string | undefined;
2900
4970
  usage?: {
2901
4971
  inputTokens?: number | undefined;
@@ -2910,32 +4980,59 @@ export declare const WorkflowListResult: z.ZodObject<{
2910
4980
  } | undefined;
2911
4981
  } | undefined;
2912
4982
  } | undefined;
4983
+ role?: string | undefined;
2913
4984
  error?: string | undefined;
2914
4985
  startedAt?: string | undefined;
2915
4986
  completedAt?: string | undefined;
2916
4987
  iterations?: number | undefined;
4988
+ attempts?: {
4989
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
4990
+ startedAt: string;
4991
+ attempt: number;
4992
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
4993
+ turnId?: string | undefined;
4994
+ error?: string | undefined;
4995
+ completedAt?: string | undefined;
4996
+ iteration?: number | undefined;
4997
+ }[] | undefined;
2917
4998
  }[];
2918
4999
  resumable: boolean;
2919
5000
  project?: (string & z.BRAND<"ProjectId">) | undefined;
5001
+ nativeStop?: {
5002
+ version: 1;
5003
+ state: "unknown" | "pending" | "confirmed";
5004
+ observedAt: string;
5005
+ targets: {
5006
+ sessionId: string & z.BRAND<"SessionId">;
5007
+ version: 1;
5008
+ state: "unknown" | "pending" | "confirmed";
5009
+ observedAt: string;
5010
+ turnId?: string | undefined;
5011
+ nodeId?: string | undefined;
5012
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5013
+ reasonCode?: string | undefined;
5014
+ }[];
5015
+ reasonCode?: string | undefined;
5016
+ } | undefined;
2920
5017
  error?: string | undefined;
2921
5018
  completedAt?: string | undefined;
5019
+ dispatchKey?: string | undefined;
2922
5020
  finalText?: string | undefined;
2923
5021
  }, {
2924
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
2925
- createdAt: string;
5022
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2926
5023
  mode: "dag" | "graph" | "discussion";
2927
- workflowId: string;
5024
+ createdAt: string;
2928
5025
  updatedAt: string;
5026
+ workflowId: string;
2929
5027
  nodes: {
2930
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
5028
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2931
5029
  agent: string;
2932
5030
  model: string;
2933
5031
  nodeId: string;
2934
5032
  sessionId?: string | undefined;
2935
- role?: string | undefined;
2936
5033
  turnId?: string | undefined;
2937
5034
  result?: {
2938
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5035
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2939
5036
  text?: string | undefined;
2940
5037
  usage?: {
2941
5038
  inputTokens?: number | undefined;
@@ -2950,35 +5047,62 @@ export declare const WorkflowListResult: z.ZodObject<{
2950
5047
  } | undefined;
2951
5048
  } | undefined;
2952
5049
  } | undefined;
5050
+ role?: string | undefined;
2953
5051
  error?: string | undefined;
2954
5052
  startedAt?: string | undefined;
2955
5053
  completedAt?: string | undefined;
2956
5054
  iterations?: number | undefined;
5055
+ attempts?: {
5056
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
5057
+ startedAt: string;
5058
+ attempt: number;
5059
+ sessionId?: string | undefined;
5060
+ turnId?: string | undefined;
5061
+ error?: string | undefined;
5062
+ completedAt?: string | undefined;
5063
+ iteration?: number | undefined;
5064
+ }[] | undefined;
2957
5065
  }[];
2958
5066
  project?: string | undefined;
5067
+ nativeStop?: {
5068
+ version: 1;
5069
+ state: "unknown" | "pending" | "confirmed";
5070
+ observedAt: string;
5071
+ targets: {
5072
+ sessionId: string;
5073
+ version: 1;
5074
+ state: "unknown" | "pending" | "confirmed";
5075
+ observedAt: string;
5076
+ turnId?: string | undefined;
5077
+ nodeId?: string | undefined;
5078
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5079
+ reasonCode?: string | undefined;
5080
+ }[];
5081
+ reasonCode?: string | undefined;
5082
+ } | undefined;
2959
5083
  error?: string | undefined;
2960
5084
  completedAt?: string | undefined;
5085
+ dispatchKey?: string | undefined;
2961
5086
  finalText?: string | undefined;
2962
5087
  resumable?: boolean | undefined;
2963
5088
  }>, "many">;
2964
5089
  nextCursor: z.ZodOptional<z.ZodString>;
2965
5090
  }, "strip", z.ZodTypeAny, {
2966
5091
  workflows: {
2967
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
2968
- createdAt: string;
5092
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
2969
5093
  mode: "dag" | "graph" | "discussion";
2970
- workflowId: string;
5094
+ createdAt: string;
2971
5095
  updatedAt: string;
5096
+ workflowId: string;
2972
5097
  nodes: {
2973
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
5098
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
2974
5099
  agent: string & z.BRAND<"AgentId">;
2975
5100
  model: string;
2976
5101
  nodeId: string;
2977
5102
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
2978
- role?: string | undefined;
2979
5103
  turnId?: string | undefined;
2980
5104
  result?: {
2981
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5105
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
2982
5106
  text?: string | undefined;
2983
5107
  usage?: {
2984
5108
  inputTokens?: number | undefined;
@@ -2993,35 +5117,62 @@ export declare const WorkflowListResult: z.ZodObject<{
2993
5117
  } | undefined;
2994
5118
  } | undefined;
2995
5119
  } | undefined;
5120
+ role?: string | undefined;
2996
5121
  error?: string | undefined;
2997
5122
  startedAt?: string | undefined;
2998
5123
  completedAt?: string | undefined;
2999
5124
  iterations?: number | undefined;
5125
+ attempts?: {
5126
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
5127
+ startedAt: string;
5128
+ attempt: number;
5129
+ sessionId?: (string & z.BRAND<"SessionId">) | undefined;
5130
+ turnId?: string | undefined;
5131
+ error?: string | undefined;
5132
+ completedAt?: string | undefined;
5133
+ iteration?: number | undefined;
5134
+ }[] | undefined;
3000
5135
  }[];
3001
5136
  resumable: boolean;
3002
5137
  project?: (string & z.BRAND<"ProjectId">) | undefined;
5138
+ nativeStop?: {
5139
+ version: 1;
5140
+ state: "unknown" | "pending" | "confirmed";
5141
+ observedAt: string;
5142
+ targets: {
5143
+ sessionId: string & z.BRAND<"SessionId">;
5144
+ version: 1;
5145
+ state: "unknown" | "pending" | "confirmed";
5146
+ observedAt: string;
5147
+ turnId?: string | undefined;
5148
+ nodeId?: string | undefined;
5149
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5150
+ reasonCode?: string | undefined;
5151
+ }[];
5152
+ reasonCode?: string | undefined;
5153
+ } | undefined;
3003
5154
  error?: string | undefined;
3004
5155
  completedAt?: string | undefined;
5156
+ dispatchKey?: string | undefined;
3005
5157
  finalText?: string | undefined;
3006
5158
  }[];
3007
5159
  nextCursor?: string | undefined;
3008
5160
  }, {
3009
5161
  workflows: {
3010
- status: "running" | "queued" | "completed" | "failed" | "timeout" | "cancelled";
3011
- createdAt: string;
5162
+ status: "running" | "failed" | "paused" | "queued" | "completed" | "timeout" | "cancelled";
3012
5163
  mode: "dag" | "graph" | "discussion";
3013
- workflowId: string;
5164
+ createdAt: string;
3014
5165
  updatedAt: string;
5166
+ workflowId: string;
3015
5167
  nodes: {
3016
- status: "running" | "completed" | "failed" | "pending" | "cancelled" | "ready" | "skipped";
5168
+ status: "running" | "failed" | "pending" | "paused" | "ready" | "completed" | "cancelled" | "skipped";
3017
5169
  agent: string;
3018
5170
  model: string;
3019
5171
  nodeId: string;
3020
5172
  sessionId?: string | undefined;
3021
- role?: string | undefined;
3022
5173
  turnId?: string | undefined;
3023
5174
  result?: {
3024
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5175
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3025
5176
  text?: string | undefined;
3026
5177
  usage?: {
3027
5178
  inputTokens?: number | undefined;
@@ -3036,14 +5187,42 @@ export declare const WorkflowListResult: z.ZodObject<{
3036
5187
  } | undefined;
3037
5188
  } | undefined;
3038
5189
  } | undefined;
5190
+ role?: string | undefined;
3039
5191
  error?: string | undefined;
3040
5192
  startedAt?: string | undefined;
3041
5193
  completedAt?: string | undefined;
3042
5194
  iterations?: number | undefined;
5195
+ attempts?: {
5196
+ status: "running" | "failed" | "interrupted" | "completed" | "timeout" | "cancelled";
5197
+ startedAt: string;
5198
+ attempt: number;
5199
+ sessionId?: string | undefined;
5200
+ turnId?: string | undefined;
5201
+ error?: string | undefined;
5202
+ completedAt?: string | undefined;
5203
+ iteration?: number | undefined;
5204
+ }[] | undefined;
3043
5205
  }[];
3044
5206
  project?: string | undefined;
5207
+ nativeStop?: {
5208
+ version: 1;
5209
+ state: "unknown" | "pending" | "confirmed";
5210
+ observedAt: string;
5211
+ targets: {
5212
+ sessionId: string;
5213
+ version: 1;
5214
+ state: "unknown" | "pending" | "confirmed";
5215
+ observedAt: string;
5216
+ turnId?: string | undefined;
5217
+ nodeId?: string | undefined;
5218
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5219
+ reasonCode?: string | undefined;
5220
+ }[];
5221
+ reasonCode?: string | undefined;
5222
+ } | undefined;
3045
5223
  error?: string | undefined;
3046
5224
  completedAt?: string | undefined;
5225
+ dispatchKey?: string | undefined;
3047
5226
  finalText?: string | undefined;
3048
5227
  resumable?: boolean | undefined;
3049
5228
  }[];
@@ -3051,6 +5230,118 @@ export declare const WorkflowListResult: z.ZodObject<{
3051
5230
  }>;
3052
5231
  export type WorkflowListResult = z.infer<typeof WorkflowListResult>;
3053
5232
  export declare const WorkflowEvent: z.ZodObject<{
5233
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
5234
+ version: z.ZodLiteral<1>;
5235
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
5236
+ targets: z.ZodArray<z.ZodEffects<z.ZodObject<{
5237
+ version: z.ZodLiteral<1>;
5238
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
5239
+ turnId: z.ZodOptional<z.ZodString>;
5240
+ nodeId: z.ZodOptional<z.ZodString>;
5241
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
5242
+ observedAt: z.ZodString;
5243
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
5244
+ reasonCode: z.ZodOptional<z.ZodString>;
5245
+ }, "strict", z.ZodTypeAny, {
5246
+ sessionId: string & z.BRAND<"SessionId">;
5247
+ version: 1;
5248
+ state: "unknown" | "pending" | "confirmed";
5249
+ observedAt: string;
5250
+ turnId?: string | undefined;
5251
+ nodeId?: string | undefined;
5252
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5253
+ reasonCode?: string | undefined;
5254
+ }, {
5255
+ sessionId: string;
5256
+ version: 1;
5257
+ state: "unknown" | "pending" | "confirmed";
5258
+ observedAt: string;
5259
+ turnId?: string | undefined;
5260
+ nodeId?: string | undefined;
5261
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5262
+ reasonCode?: string | undefined;
5263
+ }>, {
5264
+ sessionId: string & z.BRAND<"SessionId">;
5265
+ version: 1;
5266
+ state: "unknown" | "pending" | "confirmed";
5267
+ observedAt: string;
5268
+ turnId?: string | undefined;
5269
+ nodeId?: string | undefined;
5270
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5271
+ reasonCode?: string | undefined;
5272
+ }, {
5273
+ sessionId: string;
5274
+ version: 1;
5275
+ state: "unknown" | "pending" | "confirmed";
5276
+ observedAt: string;
5277
+ turnId?: string | undefined;
5278
+ nodeId?: string | undefined;
5279
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5280
+ reasonCode?: string | undefined;
5281
+ }>, "many">;
5282
+ observedAt: z.ZodString;
5283
+ reasonCode: z.ZodOptional<z.ZodString>;
5284
+ }, "strict", z.ZodTypeAny, {
5285
+ version: 1;
5286
+ state: "unknown" | "pending" | "confirmed";
5287
+ observedAt: string;
5288
+ targets: {
5289
+ sessionId: string & z.BRAND<"SessionId">;
5290
+ version: 1;
5291
+ state: "unknown" | "pending" | "confirmed";
5292
+ observedAt: string;
5293
+ turnId?: string | undefined;
5294
+ nodeId?: string | undefined;
5295
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5296
+ reasonCode?: string | undefined;
5297
+ }[];
5298
+ reasonCode?: string | undefined;
5299
+ }, {
5300
+ version: 1;
5301
+ state: "unknown" | "pending" | "confirmed";
5302
+ observedAt: string;
5303
+ targets: {
5304
+ sessionId: string;
5305
+ version: 1;
5306
+ state: "unknown" | "pending" | "confirmed";
5307
+ observedAt: string;
5308
+ turnId?: string | undefined;
5309
+ nodeId?: string | undefined;
5310
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5311
+ reasonCode?: string | undefined;
5312
+ }[];
5313
+ reasonCode?: string | undefined;
5314
+ }>, {
5315
+ version: 1;
5316
+ state: "unknown" | "pending" | "confirmed";
5317
+ observedAt: string;
5318
+ targets: {
5319
+ sessionId: string & z.BRAND<"SessionId">;
5320
+ version: 1;
5321
+ state: "unknown" | "pending" | "confirmed";
5322
+ observedAt: string;
5323
+ turnId?: string | undefined;
5324
+ nodeId?: string | undefined;
5325
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5326
+ reasonCode?: string | undefined;
5327
+ }[];
5328
+ reasonCode?: string | undefined;
5329
+ }, {
5330
+ version: 1;
5331
+ state: "unknown" | "pending" | "confirmed";
5332
+ observedAt: string;
5333
+ targets: {
5334
+ sessionId: string;
5335
+ version: 1;
5336
+ state: "unknown" | "pending" | "confirmed";
5337
+ observedAt: string;
5338
+ turnId?: string | undefined;
5339
+ nodeId?: string | undefined;
5340
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5341
+ reasonCode?: string | undefined;
5342
+ }[];
5343
+ reasonCode?: string | undefined;
5344
+ }>>;
3054
5345
  workflowId: z.ZodString;
3055
5346
  seq: z.ZodNumber;
3056
5347
  type: z.ZodEnum<["workflow.status", "node.status", "edge.route", "executor.decision", "round.started", "round.completed", "discussion.terminated", "human_review.requested", "human_review.resolved", "artifact.written", "node.diagnostic"]>;
@@ -3060,7 +5351,9 @@ export declare const WorkflowEvent: z.ZodObject<{
3060
5351
  agent: z.ZodOptional<z.ZodBranded<z.ZodString, "AgentId">>;
3061
5352
  model: z.ZodOptional<z.ZodString>;
3062
5353
  role: z.ZodOptional<z.ZodString>;
3063
- status: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>, z.ZodEnum<["pending", "ready", "running", "completed", "failed", "skipped", "cancelled"]>]>>;
5354
+ /** Scheduling/orchestration correlation metadata. */
5355
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5356
+ status: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>, z.ZodEnum<["pending", "ready", "running", "paused", "completed", "failed", "skipped", "cancelled"]>]>>;
3064
5357
  result: z.ZodOptional<z.ZodObject<{
3065
5358
  text: z.ZodOptional<z.ZodString>;
3066
5359
  status: z.ZodEnum<["completed", "interrupted", "aborted", "failed", "timeout"]>;
@@ -3105,7 +5398,7 @@ export declare const WorkflowEvent: z.ZodObject<{
3105
5398
  } | undefined;
3106
5399
  }>>;
3107
5400
  }, "strip", z.ZodTypeAny, {
3108
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5401
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3109
5402
  text?: string | undefined;
3110
5403
  usage?: {
3111
5404
  inputTokens?: number | undefined;
@@ -3120,7 +5413,7 @@ export declare const WorkflowEvent: z.ZodObject<{
3120
5413
  } | undefined;
3121
5414
  } | undefined;
3122
5415
  }, {
3123
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5416
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3124
5417
  text?: string | undefined;
3125
5418
  usage?: {
3126
5419
  inputTokens?: number | undefined;
@@ -3143,14 +5436,14 @@ export declare const WorkflowEvent: z.ZodObject<{
3143
5436
  seq: number;
3144
5437
  workflowId: string;
3145
5438
  timestamp: string;
3146
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "pending" | "cancelled" | "ready" | "skipped" | undefined;
5439
+ status?: "running" | "failed" | "pending" | "paused" | "queued" | "ready" | "completed" | "timeout" | "cancelled" | "skipped" | undefined;
3147
5440
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3148
5441
  agent?: (string & z.BRAND<"AgentId">) | undefined;
3149
- role?: string | undefined;
3150
5442
  model?: string | undefined;
3151
5443
  turnId?: string | undefined;
5444
+ nodeId?: string | undefined;
3152
5445
  result?: {
3153
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5446
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3154
5447
  text?: string | undefined;
3155
5448
  usage?: {
3156
5449
  inputTokens?: number | undefined;
@@ -3165,21 +5458,38 @@ export declare const WorkflowEvent: z.ZodObject<{
3165
5458
  } | undefined;
3166
5459
  } | undefined;
3167
5460
  } | undefined;
3168
- nodeId?: string | undefined;
5461
+ role?: string | undefined;
5462
+ nativeStop?: {
5463
+ version: 1;
5464
+ state: "unknown" | "pending" | "confirmed";
5465
+ observedAt: string;
5466
+ targets: {
5467
+ sessionId: string & z.BRAND<"SessionId">;
5468
+ version: 1;
5469
+ state: "unknown" | "pending" | "confirmed";
5470
+ observedAt: string;
5471
+ turnId?: string | undefined;
5472
+ nodeId?: string | undefined;
5473
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5474
+ reasonCode?: string | undefined;
5475
+ }[];
5476
+ reasonCode?: string | undefined;
5477
+ } | undefined;
3169
5478
  payload?: Record<string, unknown> | undefined;
5479
+ metadata?: Record<string, unknown> | undefined;
3170
5480
  }, {
3171
5481
  type: "workflow.status" | "node.status" | "edge.route" | "executor.decision" | "round.started" | "round.completed" | "discussion.terminated" | "human_review.requested" | "human_review.resolved" | "artifact.written" | "node.diagnostic";
3172
5482
  seq: number;
3173
5483
  workflowId: string;
3174
5484
  timestamp: string;
3175
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "pending" | "cancelled" | "ready" | "skipped" | undefined;
5485
+ status?: "running" | "failed" | "pending" | "paused" | "queued" | "ready" | "completed" | "timeout" | "cancelled" | "skipped" | undefined;
3176
5486
  sessionId?: string | undefined;
3177
5487
  agent?: string | undefined;
3178
- role?: string | undefined;
3179
5488
  model?: string | undefined;
3180
5489
  turnId?: string | undefined;
5490
+ nodeId?: string | undefined;
3181
5491
  result?: {
3182
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5492
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3183
5493
  text?: string | undefined;
3184
5494
  usage?: {
3185
5495
  inputTokens?: number | undefined;
@@ -3194,8 +5504,25 @@ export declare const WorkflowEvent: z.ZodObject<{
3194
5504
  } | undefined;
3195
5505
  } | undefined;
3196
5506
  } | undefined;
3197
- nodeId?: string | undefined;
5507
+ role?: string | undefined;
5508
+ nativeStop?: {
5509
+ version: 1;
5510
+ state: "unknown" | "pending" | "confirmed";
5511
+ observedAt: string;
5512
+ targets: {
5513
+ sessionId: string;
5514
+ version: 1;
5515
+ state: "unknown" | "pending" | "confirmed";
5516
+ observedAt: string;
5517
+ turnId?: string | undefined;
5518
+ nodeId?: string | undefined;
5519
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5520
+ reasonCode?: string | undefined;
5521
+ }[];
5522
+ reasonCode?: string | undefined;
5523
+ } | undefined;
3198
5524
  payload?: Record<string, unknown> | undefined;
5525
+ metadata?: Record<string, unknown> | undefined;
3199
5526
  }>;
3200
5527
  export type WorkflowEvent = z.infer<typeof WorkflowEvent>;
3201
5528
  export declare const WorkflowAckParams: z.ZodObject<{
@@ -3225,6 +5552,118 @@ export declare const WorkflowEventsListParams: z.ZodObject<{
3225
5552
  export type WorkflowEventsListParams = z.infer<typeof WorkflowEventsListParams>;
3226
5553
  export declare const WorkflowEventsListResult: z.ZodObject<{
3227
5554
  events: z.ZodArray<z.ZodObject<{
5555
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
5556
+ version: z.ZodLiteral<1>;
5557
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
5558
+ targets: z.ZodArray<z.ZodEffects<z.ZodObject<{
5559
+ version: z.ZodLiteral<1>;
5560
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
5561
+ turnId: z.ZodOptional<z.ZodString>;
5562
+ nodeId: z.ZodOptional<z.ZodString>;
5563
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
5564
+ observedAt: z.ZodString;
5565
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
5566
+ reasonCode: z.ZodOptional<z.ZodString>;
5567
+ }, "strict", z.ZodTypeAny, {
5568
+ sessionId: string & z.BRAND<"SessionId">;
5569
+ version: 1;
5570
+ state: "unknown" | "pending" | "confirmed";
5571
+ observedAt: string;
5572
+ turnId?: string | undefined;
5573
+ nodeId?: string | undefined;
5574
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5575
+ reasonCode?: string | undefined;
5576
+ }, {
5577
+ sessionId: string;
5578
+ version: 1;
5579
+ state: "unknown" | "pending" | "confirmed";
5580
+ observedAt: string;
5581
+ turnId?: string | undefined;
5582
+ nodeId?: string | undefined;
5583
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5584
+ reasonCode?: string | undefined;
5585
+ }>, {
5586
+ sessionId: string & z.BRAND<"SessionId">;
5587
+ version: 1;
5588
+ state: "unknown" | "pending" | "confirmed";
5589
+ observedAt: string;
5590
+ turnId?: string | undefined;
5591
+ nodeId?: string | undefined;
5592
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5593
+ reasonCode?: string | undefined;
5594
+ }, {
5595
+ sessionId: string;
5596
+ version: 1;
5597
+ state: "unknown" | "pending" | "confirmed";
5598
+ observedAt: string;
5599
+ turnId?: string | undefined;
5600
+ nodeId?: string | undefined;
5601
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5602
+ reasonCode?: string | undefined;
5603
+ }>, "many">;
5604
+ observedAt: z.ZodString;
5605
+ reasonCode: z.ZodOptional<z.ZodString>;
5606
+ }, "strict", z.ZodTypeAny, {
5607
+ version: 1;
5608
+ state: "unknown" | "pending" | "confirmed";
5609
+ observedAt: string;
5610
+ targets: {
5611
+ sessionId: string & z.BRAND<"SessionId">;
5612
+ version: 1;
5613
+ state: "unknown" | "pending" | "confirmed";
5614
+ observedAt: string;
5615
+ turnId?: string | undefined;
5616
+ nodeId?: string | undefined;
5617
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5618
+ reasonCode?: string | undefined;
5619
+ }[];
5620
+ reasonCode?: string | undefined;
5621
+ }, {
5622
+ version: 1;
5623
+ state: "unknown" | "pending" | "confirmed";
5624
+ observedAt: string;
5625
+ targets: {
5626
+ sessionId: string;
5627
+ version: 1;
5628
+ state: "unknown" | "pending" | "confirmed";
5629
+ observedAt: string;
5630
+ turnId?: string | undefined;
5631
+ nodeId?: string | undefined;
5632
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5633
+ reasonCode?: string | undefined;
5634
+ }[];
5635
+ reasonCode?: string | undefined;
5636
+ }>, {
5637
+ version: 1;
5638
+ state: "unknown" | "pending" | "confirmed";
5639
+ observedAt: string;
5640
+ targets: {
5641
+ sessionId: string & z.BRAND<"SessionId">;
5642
+ version: 1;
5643
+ state: "unknown" | "pending" | "confirmed";
5644
+ observedAt: string;
5645
+ turnId?: string | undefined;
5646
+ nodeId?: string | undefined;
5647
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5648
+ reasonCode?: string | undefined;
5649
+ }[];
5650
+ reasonCode?: string | undefined;
5651
+ }, {
5652
+ version: 1;
5653
+ state: "unknown" | "pending" | "confirmed";
5654
+ observedAt: string;
5655
+ targets: {
5656
+ sessionId: string;
5657
+ version: 1;
5658
+ state: "unknown" | "pending" | "confirmed";
5659
+ observedAt: string;
5660
+ turnId?: string | undefined;
5661
+ nodeId?: string | undefined;
5662
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5663
+ reasonCode?: string | undefined;
5664
+ }[];
5665
+ reasonCode?: string | undefined;
5666
+ }>>;
3228
5667
  workflowId: z.ZodString;
3229
5668
  seq: z.ZodNumber;
3230
5669
  type: z.ZodEnum<["workflow.status", "node.status", "edge.route", "executor.decision", "round.started", "round.completed", "discussion.terminated", "human_review.requested", "human_review.resolved", "artifact.written", "node.diagnostic"]>;
@@ -3234,7 +5673,9 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3234
5673
  agent: z.ZodOptional<z.ZodBranded<z.ZodString, "AgentId">>;
3235
5674
  model: z.ZodOptional<z.ZodString>;
3236
5675
  role: z.ZodOptional<z.ZodString>;
3237
- status: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["queued", "running", "completed", "failed", "cancelled", "timeout"]>, z.ZodEnum<["pending", "ready", "running", "completed", "failed", "skipped", "cancelled"]>]>>;
5676
+ /** Scheduling/orchestration correlation metadata. */
5677
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5678
+ status: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["queued", "running", "paused", "completed", "failed", "cancelled", "timeout"]>, z.ZodEnum<["pending", "ready", "running", "paused", "completed", "failed", "skipped", "cancelled"]>]>>;
3238
5679
  result: z.ZodOptional<z.ZodObject<{
3239
5680
  text: z.ZodOptional<z.ZodString>;
3240
5681
  status: z.ZodEnum<["completed", "interrupted", "aborted", "failed", "timeout"]>;
@@ -3279,7 +5720,7 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3279
5720
  } | undefined;
3280
5721
  }>>;
3281
5722
  }, "strip", z.ZodTypeAny, {
3282
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5723
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3283
5724
  text?: string | undefined;
3284
5725
  usage?: {
3285
5726
  inputTokens?: number | undefined;
@@ -3294,7 +5735,7 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3294
5735
  } | undefined;
3295
5736
  } | undefined;
3296
5737
  }, {
3297
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5738
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3298
5739
  text?: string | undefined;
3299
5740
  usage?: {
3300
5741
  inputTokens?: number | undefined;
@@ -3317,14 +5758,14 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3317
5758
  seq: number;
3318
5759
  workflowId: string;
3319
5760
  timestamp: string;
3320
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "pending" | "cancelled" | "ready" | "skipped" | undefined;
5761
+ status?: "running" | "failed" | "pending" | "paused" | "queued" | "ready" | "completed" | "timeout" | "cancelled" | "skipped" | undefined;
3321
5762
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3322
5763
  agent?: (string & z.BRAND<"AgentId">) | undefined;
3323
- role?: string | undefined;
3324
5764
  model?: string | undefined;
3325
5765
  turnId?: string | undefined;
5766
+ nodeId?: string | undefined;
3326
5767
  result?: {
3327
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5768
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3328
5769
  text?: string | undefined;
3329
5770
  usage?: {
3330
5771
  inputTokens?: number | undefined;
@@ -3339,21 +5780,38 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3339
5780
  } | undefined;
3340
5781
  } | undefined;
3341
5782
  } | undefined;
3342
- nodeId?: string | undefined;
5783
+ role?: string | undefined;
5784
+ nativeStop?: {
5785
+ version: 1;
5786
+ state: "unknown" | "pending" | "confirmed";
5787
+ observedAt: string;
5788
+ targets: {
5789
+ sessionId: string & z.BRAND<"SessionId">;
5790
+ version: 1;
5791
+ state: "unknown" | "pending" | "confirmed";
5792
+ observedAt: string;
5793
+ turnId?: string | undefined;
5794
+ nodeId?: string | undefined;
5795
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5796
+ reasonCode?: string | undefined;
5797
+ }[];
5798
+ reasonCode?: string | undefined;
5799
+ } | undefined;
3343
5800
  payload?: Record<string, unknown> | undefined;
5801
+ metadata?: Record<string, unknown> | undefined;
3344
5802
  }, {
3345
5803
  type: "workflow.status" | "node.status" | "edge.route" | "executor.decision" | "round.started" | "round.completed" | "discussion.terminated" | "human_review.requested" | "human_review.resolved" | "artifact.written" | "node.diagnostic";
3346
5804
  seq: number;
3347
5805
  workflowId: string;
3348
5806
  timestamp: string;
3349
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "pending" | "cancelled" | "ready" | "skipped" | undefined;
5807
+ status?: "running" | "failed" | "pending" | "paused" | "queued" | "ready" | "completed" | "timeout" | "cancelled" | "skipped" | undefined;
3350
5808
  sessionId?: string | undefined;
3351
5809
  agent?: string | undefined;
3352
- role?: string | undefined;
3353
5810
  model?: string | undefined;
3354
5811
  turnId?: string | undefined;
5812
+ nodeId?: string | undefined;
3355
5813
  result?: {
3356
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5814
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3357
5815
  text?: string | undefined;
3358
5816
  usage?: {
3359
5817
  inputTokens?: number | undefined;
@@ -3368,8 +5826,25 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3368
5826
  } | undefined;
3369
5827
  } | undefined;
3370
5828
  } | undefined;
3371
- nodeId?: string | undefined;
5829
+ role?: string | undefined;
5830
+ nativeStop?: {
5831
+ version: 1;
5832
+ state: "unknown" | "pending" | "confirmed";
5833
+ observedAt: string;
5834
+ targets: {
5835
+ sessionId: string;
5836
+ version: 1;
5837
+ state: "unknown" | "pending" | "confirmed";
5838
+ observedAt: string;
5839
+ turnId?: string | undefined;
5840
+ nodeId?: string | undefined;
5841
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5842
+ reasonCode?: string | undefined;
5843
+ }[];
5844
+ reasonCode?: string | undefined;
5845
+ } | undefined;
3372
5846
  payload?: Record<string, unknown> | undefined;
5847
+ metadata?: Record<string, unknown> | undefined;
3373
5848
  }>, "many">;
3374
5849
  nextSeq: z.ZodOptional<z.ZodNumber>;
3375
5850
  }, "strip", z.ZodTypeAny, {
@@ -3378,14 +5853,14 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3378
5853
  seq: number;
3379
5854
  workflowId: string;
3380
5855
  timestamp: string;
3381
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "pending" | "cancelled" | "ready" | "skipped" | undefined;
5856
+ status?: "running" | "failed" | "pending" | "paused" | "queued" | "ready" | "completed" | "timeout" | "cancelled" | "skipped" | undefined;
3382
5857
  sessionId?: (string & z.BRAND<"SessionId">) | undefined;
3383
5858
  agent?: (string & z.BRAND<"AgentId">) | undefined;
3384
- role?: string | undefined;
3385
5859
  model?: string | undefined;
3386
5860
  turnId?: string | undefined;
5861
+ nodeId?: string | undefined;
3387
5862
  result?: {
3388
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5863
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3389
5864
  text?: string | undefined;
3390
5865
  usage?: {
3391
5866
  inputTokens?: number | undefined;
@@ -3400,8 +5875,25 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3400
5875
  } | undefined;
3401
5876
  } | undefined;
3402
5877
  } | undefined;
3403
- nodeId?: string | undefined;
5878
+ role?: string | undefined;
5879
+ nativeStop?: {
5880
+ version: 1;
5881
+ state: "unknown" | "pending" | "confirmed";
5882
+ observedAt: string;
5883
+ targets: {
5884
+ sessionId: string & z.BRAND<"SessionId">;
5885
+ version: 1;
5886
+ state: "unknown" | "pending" | "confirmed";
5887
+ observedAt: string;
5888
+ turnId?: string | undefined;
5889
+ nodeId?: string | undefined;
5890
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5891
+ reasonCode?: string | undefined;
5892
+ }[];
5893
+ reasonCode?: string | undefined;
5894
+ } | undefined;
3404
5895
  payload?: Record<string, unknown> | undefined;
5896
+ metadata?: Record<string, unknown> | undefined;
3405
5897
  }[];
3406
5898
  nextSeq?: number | undefined;
3407
5899
  }, {
@@ -3410,14 +5902,14 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3410
5902
  seq: number;
3411
5903
  workflowId: string;
3412
5904
  timestamp: string;
3413
- status?: "running" | "queued" | "completed" | "failed" | "timeout" | "pending" | "cancelled" | "ready" | "skipped" | undefined;
5905
+ status?: "running" | "failed" | "pending" | "paused" | "queued" | "ready" | "completed" | "timeout" | "cancelled" | "skipped" | undefined;
3414
5906
  sessionId?: string | undefined;
3415
5907
  agent?: string | undefined;
3416
- role?: string | undefined;
3417
5908
  model?: string | undefined;
3418
5909
  turnId?: string | undefined;
5910
+ nodeId?: string | undefined;
3419
5911
  result?: {
3420
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
5912
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
3421
5913
  text?: string | undefined;
3422
5914
  usage?: {
3423
5915
  inputTokens?: number | undefined;
@@ -3432,8 +5924,25 @@ export declare const WorkflowEventsListResult: z.ZodObject<{
3432
5924
  } | undefined;
3433
5925
  } | undefined;
3434
5926
  } | undefined;
3435
- nodeId?: string | undefined;
5927
+ role?: string | undefined;
5928
+ nativeStop?: {
5929
+ version: 1;
5930
+ state: "unknown" | "pending" | "confirmed";
5931
+ observedAt: string;
5932
+ targets: {
5933
+ sessionId: string;
5934
+ version: 1;
5935
+ state: "unknown" | "pending" | "confirmed";
5936
+ observedAt: string;
5937
+ turnId?: string | undefined;
5938
+ nodeId?: string | undefined;
5939
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
5940
+ reasonCode?: string | undefined;
5941
+ }[];
5942
+ reasonCode?: string | undefined;
5943
+ } | undefined;
3436
5944
  payload?: Record<string, unknown> | undefined;
5945
+ metadata?: Record<string, unknown> | undefined;
3437
5946
  }[];
3438
5947
  nextSeq?: number | undefined;
3439
5948
  }>;