@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
@@ -22,17 +22,44 @@ import { z } from "zod";
22
22
  export declare const StreamOrigin: z.ZodEnum<["solicited", "unsolicited"]>;
23
23
  export type StreamOrigin = z.infer<typeof StreamOrigin>;
24
24
  /** 事件种类。 */
25
- export declare const StreamEventType: z.ZodEnum<["message", "thinking", "tool_call", "tool_result", "token", "result", "error"]>;
25
+ export declare const StreamEventType: z.ZodEnum<["runtime_settings", "message", "thinking", "tool_call", "tool_result", "token", "result", "error"]>;
26
26
  export type StreamEventType = z.infer<typeof StreamEventType>;
27
27
  export declare const StreamMessageEvent: z.ZodObject<{
28
28
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
29
29
  turnId: z.ZodString;
30
30
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
31
31
  source: z.ZodOptional<z.ZodString>;
32
+ sourceEventId: z.ZodOptional<z.ZodString>;
33
+ nativeProactive: z.ZodOptional<z.ZodObject<{
34
+ anchorRunId: z.ZodString;
35
+ employeeId: z.ZodString;
36
+ employeeRevision: z.ZodNumber;
37
+ upstreamId: z.ZodString;
38
+ project: z.ZodString;
39
+ agent: z.ZodString;
40
+ model: z.ZodString;
41
+ }, "strict", z.ZodTypeAny, {
42
+ agent: string;
43
+ model: string;
44
+ project: string;
45
+ employeeId: string;
46
+ employeeRevision: number;
47
+ anchorRunId: string;
48
+ upstreamId: string;
49
+ }, {
50
+ agent: string;
51
+ model: string;
52
+ project: string;
53
+ employeeId: string;
54
+ employeeRevision: number;
55
+ anchorRunId: string;
56
+ upstreamId: string;
57
+ }>>;
32
58
  seq: z.ZodNumber;
33
59
  at: z.ZodString;
34
60
  workflowId: z.ZodOptional<z.ZodString>;
35
61
  nodeId: z.ZodOptional<z.ZodString>;
62
+ nativeRunId: z.ZodOptional<z.ZodString>;
36
63
  } & {
37
64
  type: z.ZodLiteral<"message">;
38
65
  role: z.ZodDefault<z.ZodEnum<["assistant", "user", "system"]>>;
@@ -42,15 +69,26 @@ export declare const StreamMessageEvent: z.ZodObject<{
42
69
  at: string;
43
70
  type: "message";
44
71
  sessionId: string & z.BRAND<"SessionId">;
45
- role: "system" | "user" | "assistant";
46
72
  turnId: string;
73
+ role: "system" | "user" | "assistant";
47
74
  origin: "solicited" | "unsolicited";
48
75
  seq: number;
49
76
  text: string;
50
77
  delta: boolean;
78
+ nodeId?: string | undefined;
51
79
  source?: string | undefined;
80
+ sourceEventId?: string | undefined;
81
+ nativeProactive?: {
82
+ agent: string;
83
+ model: string;
84
+ project: string;
85
+ employeeId: string;
86
+ employeeRevision: number;
87
+ anchorRunId: string;
88
+ upstreamId: string;
89
+ } | undefined;
52
90
  workflowId?: string | undefined;
53
- nodeId?: string | undefined;
91
+ nativeRunId?: string | undefined;
54
92
  }, {
55
93
  at: string;
56
94
  type: "message";
@@ -58,11 +96,22 @@ export declare const StreamMessageEvent: z.ZodObject<{
58
96
  turnId: string;
59
97
  seq: number;
60
98
  text: string;
99
+ nodeId?: string | undefined;
100
+ source?: string | undefined;
61
101
  role?: "system" | "user" | "assistant" | undefined;
62
102
  origin?: "solicited" | "unsolicited" | undefined;
63
- source?: string | undefined;
103
+ sourceEventId?: string | undefined;
104
+ nativeProactive?: {
105
+ agent: string;
106
+ model: string;
107
+ project: string;
108
+ employeeId: string;
109
+ employeeRevision: number;
110
+ anchorRunId: string;
111
+ upstreamId: string;
112
+ } | undefined;
64
113
  workflowId?: string | undefined;
65
- nodeId?: string | undefined;
114
+ nativeRunId?: string | undefined;
66
115
  delta?: boolean | undefined;
67
116
  }>;
68
117
  export declare const StreamThinkingEvent: z.ZodObject<{
@@ -76,6 +125,33 @@ export declare const StreamThinkingEvent: z.ZodObject<{
76
125
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
77
126
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
78
127
  source: z.ZodOptional<z.ZodString>;
128
+ /** Native harness output identity; not a caller-selected conversation or sender. */
129
+ sourceEventId: z.ZodOptional<z.ZodString>;
130
+ nativeProactive: z.ZodOptional<z.ZodObject<{
131
+ anchorRunId: z.ZodString;
132
+ employeeId: z.ZodString;
133
+ employeeRevision: z.ZodNumber;
134
+ upstreamId: z.ZodString;
135
+ project: z.ZodString;
136
+ agent: z.ZodString;
137
+ model: z.ZodString;
138
+ }, "strict", z.ZodTypeAny, {
139
+ agent: string;
140
+ model: string;
141
+ project: string;
142
+ employeeId: string;
143
+ employeeRevision: number;
144
+ anchorRunId: string;
145
+ upstreamId: string;
146
+ }, {
147
+ agent: string;
148
+ model: string;
149
+ project: string;
150
+ employeeId: string;
151
+ employeeRevision: number;
152
+ anchorRunId: string;
153
+ upstreamId: string;
154
+ }>>;
79
155
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
80
156
  seq: z.ZodNumber;
81
157
  at: z.ZodString;
@@ -88,6 +164,8 @@ export declare const StreamThinkingEvent: z.ZodObject<{
88
164
  workflowId: z.ZodOptional<z.ZodString>;
89
165
  nodeId: z.ZodOptional<z.ZodString>;
90
166
  role: z.ZodOptional<z.ZodString>;
167
+ /** Server-generated native conversation run correlation, stamped by core. */
168
+ nativeRunId: z.ZodOptional<z.ZodString>;
91
169
  } & {
92
170
  type: z.ZodLiteral<"thinking">;
93
171
  text: z.ZodString;
@@ -101,10 +179,21 @@ export declare const StreamThinkingEvent: z.ZodObject<{
101
179
  seq: number;
102
180
  text: string;
103
181
  delta: boolean;
104
- role?: string | undefined;
182
+ nodeId?: string | undefined;
105
183
  source?: string | undefined;
184
+ role?: string | undefined;
185
+ sourceEventId?: string | undefined;
186
+ nativeProactive?: {
187
+ agent: string;
188
+ model: string;
189
+ project: string;
190
+ employeeId: string;
191
+ employeeRevision: number;
192
+ anchorRunId: string;
193
+ upstreamId: string;
194
+ } | undefined;
106
195
  workflowId?: string | undefined;
107
- nodeId?: string | undefined;
196
+ nativeRunId?: string | undefined;
108
197
  }, {
109
198
  at: string;
110
199
  type: "thinking";
@@ -112,11 +201,22 @@ export declare const StreamThinkingEvent: z.ZodObject<{
112
201
  turnId: string;
113
202
  seq: number;
114
203
  text: string;
204
+ nodeId?: string | undefined;
205
+ source?: string | undefined;
115
206
  role?: string | undefined;
116
207
  origin?: "solicited" | "unsolicited" | undefined;
117
- source?: string | undefined;
208
+ sourceEventId?: string | undefined;
209
+ nativeProactive?: {
210
+ agent: string;
211
+ model: string;
212
+ project: string;
213
+ employeeId: string;
214
+ employeeRevision: number;
215
+ anchorRunId: string;
216
+ upstreamId: string;
217
+ } | undefined;
118
218
  workflowId?: string | undefined;
119
- nodeId?: string | undefined;
219
+ nativeRunId?: string | undefined;
120
220
  delta?: boolean | undefined;
121
221
  }>;
122
222
  export declare const StreamToolCallEvent: z.ZodObject<{
@@ -130,6 +230,33 @@ export declare const StreamToolCallEvent: z.ZodObject<{
130
230
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
131
231
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
132
232
  source: z.ZodOptional<z.ZodString>;
233
+ /** Native harness output identity; not a caller-selected conversation or sender. */
234
+ sourceEventId: z.ZodOptional<z.ZodString>;
235
+ nativeProactive: z.ZodOptional<z.ZodObject<{
236
+ anchorRunId: z.ZodString;
237
+ employeeId: z.ZodString;
238
+ employeeRevision: z.ZodNumber;
239
+ upstreamId: z.ZodString;
240
+ project: z.ZodString;
241
+ agent: z.ZodString;
242
+ model: z.ZodString;
243
+ }, "strict", z.ZodTypeAny, {
244
+ agent: string;
245
+ model: string;
246
+ project: string;
247
+ employeeId: string;
248
+ employeeRevision: number;
249
+ anchorRunId: string;
250
+ upstreamId: string;
251
+ }, {
252
+ agent: string;
253
+ model: string;
254
+ project: string;
255
+ employeeId: string;
256
+ employeeRevision: number;
257
+ anchorRunId: string;
258
+ upstreamId: string;
259
+ }>>;
133
260
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
134
261
  seq: z.ZodNumber;
135
262
  at: z.ZodString;
@@ -142,6 +269,8 @@ export declare const StreamToolCallEvent: z.ZodObject<{
142
269
  workflowId: z.ZodOptional<z.ZodString>;
143
270
  nodeId: z.ZodOptional<z.ZodString>;
144
271
  role: z.ZodOptional<z.ZodString>;
272
+ /** Server-generated native conversation run correlation, stamped by core. */
273
+ nativeRunId: z.ZodOptional<z.ZodString>;
145
274
  } & {
146
275
  type: z.ZodLiteral<"tool_call">;
147
276
  toolName: z.ZodString;
@@ -157,10 +286,21 @@ export declare const StreamToolCallEvent: z.ZodObject<{
157
286
  origin: "solicited" | "unsolicited";
158
287
  seq: number;
159
288
  toolName: string;
160
- role?: string | undefined;
289
+ nodeId?: string | undefined;
161
290
  source?: string | undefined;
291
+ role?: string | undefined;
292
+ sourceEventId?: string | undefined;
293
+ nativeProactive?: {
294
+ agent: string;
295
+ model: string;
296
+ project: string;
297
+ employeeId: string;
298
+ employeeRevision: number;
299
+ anchorRunId: string;
300
+ upstreamId: string;
301
+ } | undefined;
162
302
  workflowId?: string | undefined;
163
- nodeId?: string | undefined;
303
+ nativeRunId?: string | undefined;
164
304
  args?: unknown;
165
305
  toolCallId?: string | undefined;
166
306
  }, {
@@ -170,11 +310,22 @@ export declare const StreamToolCallEvent: z.ZodObject<{
170
310
  turnId: string;
171
311
  seq: number;
172
312
  toolName: string;
313
+ nodeId?: string | undefined;
314
+ source?: string | undefined;
173
315
  role?: string | undefined;
174
316
  origin?: "solicited" | "unsolicited" | undefined;
175
- source?: string | undefined;
317
+ sourceEventId?: string | undefined;
318
+ nativeProactive?: {
319
+ agent: string;
320
+ model: string;
321
+ project: string;
322
+ employeeId: string;
323
+ employeeRevision: number;
324
+ anchorRunId: string;
325
+ upstreamId: string;
326
+ } | undefined;
176
327
  workflowId?: string | undefined;
177
- nodeId?: string | undefined;
328
+ nativeRunId?: string | undefined;
178
329
  args?: unknown;
179
330
  toolCallId?: string | undefined;
180
331
  }>;
@@ -189,6 +340,33 @@ export declare const StreamToolResultEvent: z.ZodObject<{
189
340
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
190
341
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
191
342
  source: z.ZodOptional<z.ZodString>;
343
+ /** Native harness output identity; not a caller-selected conversation or sender. */
344
+ sourceEventId: z.ZodOptional<z.ZodString>;
345
+ nativeProactive: z.ZodOptional<z.ZodObject<{
346
+ anchorRunId: z.ZodString;
347
+ employeeId: z.ZodString;
348
+ employeeRevision: z.ZodNumber;
349
+ upstreamId: z.ZodString;
350
+ project: z.ZodString;
351
+ agent: z.ZodString;
352
+ model: z.ZodString;
353
+ }, "strict", z.ZodTypeAny, {
354
+ agent: string;
355
+ model: string;
356
+ project: string;
357
+ employeeId: string;
358
+ employeeRevision: number;
359
+ anchorRunId: string;
360
+ upstreamId: string;
361
+ }, {
362
+ agent: string;
363
+ model: string;
364
+ project: string;
365
+ employeeId: string;
366
+ employeeRevision: number;
367
+ anchorRunId: string;
368
+ upstreamId: string;
369
+ }>>;
192
370
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
193
371
  seq: z.ZodNumber;
194
372
  at: z.ZodString;
@@ -201,6 +379,8 @@ export declare const StreamToolResultEvent: z.ZodObject<{
201
379
  workflowId: z.ZodOptional<z.ZodString>;
202
380
  nodeId: z.ZodOptional<z.ZodString>;
203
381
  role: z.ZodOptional<z.ZodString>;
382
+ /** Server-generated native conversation run correlation, stamped by core. */
383
+ nativeRunId: z.ZodOptional<z.ZodString>;
204
384
  } & {
205
385
  type: z.ZodLiteral<"tool_result">;
206
386
  toolName: z.ZodString;
@@ -217,10 +397,21 @@ export declare const StreamToolResultEvent: z.ZodObject<{
217
397
  seq: number;
218
398
  toolName: string;
219
399
  ok: boolean;
220
- role?: string | undefined;
400
+ nodeId?: string | undefined;
221
401
  source?: string | undefined;
402
+ role?: string | undefined;
403
+ sourceEventId?: string | undefined;
404
+ nativeProactive?: {
405
+ agent: string;
406
+ model: string;
407
+ project: string;
408
+ employeeId: string;
409
+ employeeRevision: number;
410
+ anchorRunId: string;
411
+ upstreamId: string;
412
+ } | undefined;
222
413
  workflowId?: string | undefined;
223
- nodeId?: string | undefined;
414
+ nativeRunId?: string | undefined;
224
415
  toolCallId?: string | undefined;
225
416
  output?: unknown;
226
417
  }, {
@@ -231,11 +422,22 @@ export declare const StreamToolResultEvent: z.ZodObject<{
231
422
  seq: number;
232
423
  toolName: string;
233
424
  ok: boolean;
425
+ nodeId?: string | undefined;
426
+ source?: string | undefined;
234
427
  role?: string | undefined;
235
428
  origin?: "solicited" | "unsolicited" | undefined;
236
- source?: string | undefined;
429
+ sourceEventId?: string | undefined;
430
+ nativeProactive?: {
431
+ agent: string;
432
+ model: string;
433
+ project: string;
434
+ employeeId: string;
435
+ employeeRevision: number;
436
+ anchorRunId: string;
437
+ upstreamId: string;
438
+ } | undefined;
237
439
  workflowId?: string | undefined;
238
- nodeId?: string | undefined;
440
+ nativeRunId?: string | undefined;
239
441
  toolCallId?: string | undefined;
240
442
  output?: unknown;
241
443
  }>;
@@ -250,6 +452,33 @@ export declare const StreamTokenEvent: z.ZodObject<{
250
452
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
251
453
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
252
454
  source: z.ZodOptional<z.ZodString>;
455
+ /** Native harness output identity; not a caller-selected conversation or sender. */
456
+ sourceEventId: z.ZodOptional<z.ZodString>;
457
+ nativeProactive: z.ZodOptional<z.ZodObject<{
458
+ anchorRunId: z.ZodString;
459
+ employeeId: z.ZodString;
460
+ employeeRevision: z.ZodNumber;
461
+ upstreamId: z.ZodString;
462
+ project: z.ZodString;
463
+ agent: z.ZodString;
464
+ model: z.ZodString;
465
+ }, "strict", z.ZodTypeAny, {
466
+ agent: string;
467
+ model: string;
468
+ project: string;
469
+ employeeId: string;
470
+ employeeRevision: number;
471
+ anchorRunId: string;
472
+ upstreamId: string;
473
+ }, {
474
+ agent: string;
475
+ model: string;
476
+ project: string;
477
+ employeeId: string;
478
+ employeeRevision: number;
479
+ anchorRunId: string;
480
+ upstreamId: string;
481
+ }>>;
253
482
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
254
483
  seq: z.ZodNumber;
255
484
  at: z.ZodString;
@@ -262,6 +491,8 @@ export declare const StreamTokenEvent: z.ZodObject<{
262
491
  workflowId: z.ZodOptional<z.ZodString>;
263
492
  nodeId: z.ZodOptional<z.ZodString>;
264
493
  role: z.ZodOptional<z.ZodString>;
494
+ /** Server-generated native conversation run correlation, stamped by core. */
495
+ nativeRunId: z.ZodOptional<z.ZodString>;
265
496
  } & {
266
497
  type: z.ZodLiteral<"token">;
267
498
  text: z.ZodString;
@@ -273,10 +504,21 @@ export declare const StreamTokenEvent: z.ZodObject<{
273
504
  origin: "solicited" | "unsolicited";
274
505
  seq: number;
275
506
  text: string;
276
- role?: string | undefined;
507
+ nodeId?: string | undefined;
277
508
  source?: string | undefined;
509
+ role?: string | undefined;
510
+ sourceEventId?: string | undefined;
511
+ nativeProactive?: {
512
+ agent: string;
513
+ model: string;
514
+ project: string;
515
+ employeeId: string;
516
+ employeeRevision: number;
517
+ anchorRunId: string;
518
+ upstreamId: string;
519
+ } | undefined;
278
520
  workflowId?: string | undefined;
279
- nodeId?: string | undefined;
521
+ nativeRunId?: string | undefined;
280
522
  }, {
281
523
  at: string;
282
524
  type: "token";
@@ -284,11 +526,150 @@ export declare const StreamTokenEvent: z.ZodObject<{
284
526
  turnId: string;
285
527
  seq: number;
286
528
  text: string;
529
+ nodeId?: string | undefined;
530
+ source?: string | undefined;
287
531
  role?: string | undefined;
288
532
  origin?: "solicited" | "unsolicited" | undefined;
533
+ sourceEventId?: string | undefined;
534
+ nativeProactive?: {
535
+ agent: string;
536
+ model: string;
537
+ project: string;
538
+ employeeId: string;
539
+ employeeRevision: number;
540
+ anchorRunId: string;
541
+ upstreamId: string;
542
+ } | undefined;
543
+ workflowId?: string | undefined;
544
+ nativeRunId?: string | undefined;
545
+ }>;
546
+ export declare const StreamRuntimeSettingsEvent: z.ZodObject<{
547
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
548
+ /**
549
+ * 本轮关联 id。solicited 事件用 send 返回的 turnId;
550
+ * unsolicited(自发)事件由 phonon 生成,server 从事件中首次见到。
551
+ */
552
+ turnId: z.ZodString;
553
+ /** 输出来源:默认 solicited;agent 自发为 unsolicited。 */
554
+ origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
555
+ /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
556
+ source: z.ZodOptional<z.ZodString>;
557
+ /** Native harness output identity; not a caller-selected conversation or sender. */
558
+ sourceEventId: z.ZodOptional<z.ZodString>;
559
+ nativeProactive: z.ZodOptional<z.ZodObject<{
560
+ anchorRunId: z.ZodString;
561
+ employeeId: z.ZodString;
562
+ employeeRevision: z.ZodNumber;
563
+ upstreamId: z.ZodString;
564
+ project: z.ZodString;
565
+ agent: z.ZodString;
566
+ model: z.ZodString;
567
+ }, "strict", z.ZodTypeAny, {
568
+ agent: string;
569
+ model: string;
570
+ project: string;
571
+ employeeId: string;
572
+ employeeRevision: number;
573
+ anchorRunId: string;
574
+ upstreamId: string;
575
+ }, {
576
+ agent: string;
577
+ model: string;
578
+ project: string;
579
+ employeeId: string;
580
+ employeeRevision: number;
581
+ anchorRunId: string;
582
+ upstreamId: string;
583
+ }>>;
584
+ /** 单调递增序号(按 session),保证调用方可排序/去重。 */
585
+ seq: z.ZodNumber;
586
+ at: z.ZodString;
587
+ /**
588
+ * L3 编排归属(review P0-1,2026-06-23)。
589
+ * session 由 workflow node 创建时,phonon 自动给该 session 所有事件打上这些字段,
590
+ * 服务端按 workflowId 筛流、按 nodeId/role 区分来源。
591
+ * 没有归属的普通 session 留空,向后兼容。
592
+ */
593
+ workflowId: z.ZodOptional<z.ZodString>;
594
+ nodeId: z.ZodOptional<z.ZodString>;
595
+ role: z.ZodOptional<z.ZodString>;
596
+ /** Server-generated native conversation run correlation, stamped by core. */
597
+ nativeRunId: z.ZodOptional<z.ZodString>;
598
+ } & {
599
+ type: z.ZodLiteral<"runtime_settings">;
600
+ agent: z.ZodString;
601
+ model: z.ZodString;
602
+ reasoning: z.ZodObject<{
603
+ requestedLevel: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
604
+ nativeValue: z.ZodNullable<z.ZodEnum<["off", "none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "auto", "adaptive"]>>;
605
+ effectiveLevel: z.ZodOptional<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
606
+ }, "strict", z.ZodTypeAny, {
607
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
608
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
609
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
610
+ }, {
611
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
612
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
613
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
614
+ }>;
615
+ }, "strip", z.ZodTypeAny, {
616
+ at: string;
617
+ type: "runtime_settings";
618
+ sessionId: string & z.BRAND<"SessionId">;
619
+ agent: string;
620
+ model: string;
621
+ turnId: string;
622
+ reasoning: {
623
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
624
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
625
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
626
+ };
627
+ origin: "solicited" | "unsolicited";
628
+ seq: number;
629
+ nodeId?: string | undefined;
289
630
  source?: string | undefined;
631
+ role?: string | undefined;
632
+ sourceEventId?: string | undefined;
633
+ nativeProactive?: {
634
+ agent: string;
635
+ model: string;
636
+ project: string;
637
+ employeeId: string;
638
+ employeeRevision: number;
639
+ anchorRunId: string;
640
+ upstreamId: string;
641
+ } | undefined;
290
642
  workflowId?: string | undefined;
643
+ nativeRunId?: string | undefined;
644
+ }, {
645
+ at: string;
646
+ type: "runtime_settings";
647
+ sessionId: string;
648
+ agent: string;
649
+ model: string;
650
+ turnId: string;
651
+ reasoning: {
652
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
653
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
654
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
655
+ };
656
+ seq: number;
291
657
  nodeId?: string | undefined;
658
+ source?: string | undefined;
659
+ role?: string | undefined;
660
+ origin?: "solicited" | "unsolicited" | undefined;
661
+ sourceEventId?: string | undefined;
662
+ nativeProactive?: {
663
+ agent: string;
664
+ model: string;
665
+ project: string;
666
+ employeeId: string;
667
+ employeeRevision: number;
668
+ anchorRunId: string;
669
+ upstreamId: string;
670
+ } | undefined;
671
+ workflowId?: string | undefined;
672
+ nativeRunId?: string | undefined;
292
673
  }>;
293
674
  export declare const StreamResultEvent: z.ZodObject<{
294
675
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
@@ -301,6 +682,33 @@ export declare const StreamResultEvent: z.ZodObject<{
301
682
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
302
683
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
303
684
  source: z.ZodOptional<z.ZodString>;
685
+ /** Native harness output identity; not a caller-selected conversation or sender. */
686
+ sourceEventId: z.ZodOptional<z.ZodString>;
687
+ nativeProactive: z.ZodOptional<z.ZodObject<{
688
+ anchorRunId: z.ZodString;
689
+ employeeId: z.ZodString;
690
+ employeeRevision: z.ZodNumber;
691
+ upstreamId: z.ZodString;
692
+ project: z.ZodString;
693
+ agent: z.ZodString;
694
+ model: z.ZodString;
695
+ }, "strict", z.ZodTypeAny, {
696
+ agent: string;
697
+ model: string;
698
+ project: string;
699
+ employeeId: string;
700
+ employeeRevision: number;
701
+ anchorRunId: string;
702
+ upstreamId: string;
703
+ }, {
704
+ agent: string;
705
+ model: string;
706
+ project: string;
707
+ employeeId: string;
708
+ employeeRevision: number;
709
+ anchorRunId: string;
710
+ upstreamId: string;
711
+ }>>;
304
712
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
305
713
  seq: z.ZodNumber;
306
714
  at: z.ZodString;
@@ -313,6 +721,8 @@ export declare const StreamResultEvent: z.ZodObject<{
313
721
  workflowId: z.ZodOptional<z.ZodString>;
314
722
  nodeId: z.ZodOptional<z.ZodString>;
315
723
  role: z.ZodOptional<z.ZodString>;
724
+ /** Server-generated native conversation run correlation, stamped by core. */
725
+ nativeRunId: z.ZodOptional<z.ZodString>;
316
726
  } & {
317
727
  type: z.ZodLiteral<"result">;
318
728
  /** 本轮最终文本结果。 */
@@ -342,17 +752,28 @@ export declare const StreamResultEvent: z.ZodObject<{
342
752
  }, "strip", z.ZodTypeAny, {
343
753
  at: string;
344
754
  type: "result";
345
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
755
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
346
756
  final: true;
347
757
  sessionId: string & z.BRAND<"SessionId">;
348
758
  turnId: string;
349
759
  origin: "solicited" | "unsolicited";
350
760
  seq: number;
351
761
  text: string;
352
- role?: string | undefined;
762
+ nodeId?: string | undefined;
353
763
  source?: string | undefined;
764
+ role?: string | undefined;
765
+ sourceEventId?: string | undefined;
766
+ nativeProactive?: {
767
+ agent: string;
768
+ model: string;
769
+ project: string;
770
+ employeeId: string;
771
+ employeeRevision: number;
772
+ anchorRunId: string;
773
+ upstreamId: string;
774
+ } | undefined;
354
775
  workflowId?: string | undefined;
355
- nodeId?: string | undefined;
776
+ nativeRunId?: string | undefined;
356
777
  usage?: {
357
778
  inputTokens?: number | undefined;
358
779
  outputTokens?: number | undefined;
@@ -365,12 +786,23 @@ export declare const StreamResultEvent: z.ZodObject<{
365
786
  turnId: string;
366
787
  seq: number;
367
788
  text: string;
368
- status?: "aborted" | "interrupted" | "completed" | "failed" | "timeout" | undefined;
789
+ status?: "aborted" | "failed" | "interrupted" | "completed" | "timeout" | undefined;
790
+ nodeId?: string | undefined;
791
+ source?: string | undefined;
369
792
  role?: string | undefined;
370
793
  origin?: "solicited" | "unsolicited" | undefined;
371
- source?: string | undefined;
794
+ sourceEventId?: string | undefined;
795
+ nativeProactive?: {
796
+ agent: string;
797
+ model: string;
798
+ project: string;
799
+ employeeId: string;
800
+ employeeRevision: number;
801
+ anchorRunId: string;
802
+ upstreamId: string;
803
+ } | undefined;
372
804
  workflowId?: string | undefined;
373
- nodeId?: string | undefined;
805
+ nativeRunId?: string | undefined;
374
806
  usage?: {
375
807
  inputTokens?: number | undefined;
376
808
  outputTokens?: number | undefined;
@@ -387,6 +819,33 @@ export declare const StreamErrorEvent: z.ZodObject<{
387
819
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
388
820
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
389
821
  source: z.ZodOptional<z.ZodString>;
822
+ /** Native harness output identity; not a caller-selected conversation or sender. */
823
+ sourceEventId: z.ZodOptional<z.ZodString>;
824
+ nativeProactive: z.ZodOptional<z.ZodObject<{
825
+ anchorRunId: z.ZodString;
826
+ employeeId: z.ZodString;
827
+ employeeRevision: z.ZodNumber;
828
+ upstreamId: z.ZodString;
829
+ project: z.ZodString;
830
+ agent: z.ZodString;
831
+ model: z.ZodString;
832
+ }, "strict", z.ZodTypeAny, {
833
+ agent: string;
834
+ model: string;
835
+ project: string;
836
+ employeeId: string;
837
+ employeeRevision: number;
838
+ anchorRunId: string;
839
+ upstreamId: string;
840
+ }, {
841
+ agent: string;
842
+ model: string;
843
+ project: string;
844
+ employeeId: string;
845
+ employeeRevision: number;
846
+ anchorRunId: string;
847
+ upstreamId: string;
848
+ }>>;
390
849
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
391
850
  seq: z.ZodNumber;
392
851
  at: z.ZodString;
@@ -399,6 +858,8 @@ export declare const StreamErrorEvent: z.ZodObject<{
399
858
  workflowId: z.ZodOptional<z.ZodString>;
400
859
  nodeId: z.ZodOptional<z.ZodString>;
401
860
  role: z.ZodOptional<z.ZodString>;
861
+ /** Server-generated native conversation run correlation, stamped by core. */
862
+ nativeRunId: z.ZodOptional<z.ZodString>;
402
863
  } & {
403
864
  type: z.ZodLiteral<"error">;
404
865
  message: z.ZodString;
@@ -411,17 +872,28 @@ export declare const StreamErrorEvent: z.ZodObject<{
411
872
  at: string;
412
873
  message: string;
413
874
  type: "error";
414
- status: "aborted" | "interrupted" | "failed" | "timeout";
875
+ status: "aborted" | "failed" | "interrupted" | "timeout";
415
876
  final: true;
416
877
  sessionId: string & z.BRAND<"SessionId">;
417
878
  turnId: string;
418
879
  origin: "solicited" | "unsolicited";
419
880
  seq: number;
420
881
  appCode?: string | undefined;
421
- role?: string | undefined;
882
+ nodeId?: string | undefined;
422
883
  source?: string | undefined;
884
+ role?: string | undefined;
885
+ sourceEventId?: string | undefined;
886
+ nativeProactive?: {
887
+ agent: string;
888
+ model: string;
889
+ project: string;
890
+ employeeId: string;
891
+ employeeRevision: number;
892
+ anchorRunId: string;
893
+ upstreamId: string;
894
+ } | undefined;
423
895
  workflowId?: string | undefined;
424
- nodeId?: string | undefined;
896
+ nativeRunId?: string | undefined;
425
897
  }, {
426
898
  at: string;
427
899
  message: string;
@@ -430,37 +902,230 @@ export declare const StreamErrorEvent: z.ZodObject<{
430
902
  sessionId: string;
431
903
  turnId: string;
432
904
  seq: number;
433
- status?: "aborted" | "interrupted" | "failed" | "timeout" | undefined;
905
+ status?: "aborted" | "failed" | "interrupted" | "timeout" | undefined;
434
906
  appCode?: string | undefined;
907
+ nodeId?: string | undefined;
908
+ source?: string | undefined;
435
909
  role?: string | undefined;
436
910
  origin?: "solicited" | "unsolicited" | undefined;
437
- source?: string | undefined;
911
+ sourceEventId?: string | undefined;
912
+ nativeProactive?: {
913
+ agent: string;
914
+ model: string;
915
+ project: string;
916
+ employeeId: string;
917
+ employeeRevision: number;
918
+ anchorRunId: string;
919
+ upstreamId: string;
920
+ } | undefined;
438
921
  workflowId?: string | undefined;
439
- nodeId?: string | undefined;
922
+ nativeRunId?: string | undefined;
440
923
  }>;
441
924
  export declare const StreamAckParams: z.ZodObject<{
442
- /** 按 session 确认;缺省表示该连接全局。 */
443
- sessionId: z.ZodOptional<z.ZodBranded<z.ZodString, "SessionId">>;
925
+ /** 必须按 session 确认;单一标量无法安全表达连接全局水位。 */
926
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
444
927
  /** 已收到的最大连续 seq(含);phonon 可清理 <= 此值的 outbox。 */
445
928
  lastSeq: z.ZodNumber;
446
929
  }, "strip", z.ZodTypeAny, {
930
+ sessionId: string & z.BRAND<"SessionId">;
447
931
  lastSeq: number;
448
- sessionId?: (string & z.BRAND<"SessionId">) | undefined;
449
932
  }, {
933
+ sessionId: string;
450
934
  lastSeq: number;
451
- sessionId?: string | undefined;
452
935
  }>;
453
936
  export type StreamAckParams = z.infer<typeof StreamAckParams>;
937
+ export declare const StreamReplayParams: z.ZodObject<{
938
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
939
+ fromSeq: z.ZodDefault<z.ZodNumber>;
940
+ limit: z.ZodDefault<z.ZodNumber>;
941
+ }, "strip", z.ZodTypeAny, {
942
+ sessionId: string & z.BRAND<"SessionId">;
943
+ limit: number;
944
+ fromSeq: number;
945
+ }, {
946
+ sessionId: string;
947
+ limit?: number | undefined;
948
+ fromSeq?: number | undefined;
949
+ }>;
950
+ export type StreamReplayParams = z.infer<typeof StreamReplayParams>;
951
+ export declare const StreamReplayResult: z.ZodObject<{
952
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
953
+ replayed: z.ZodNumber;
954
+ nextSeq: z.ZodOptional<z.ZodNumber>;
955
+ }, "strip", z.ZodTypeAny, {
956
+ sessionId: string & z.BRAND<"SessionId">;
957
+ replayed: number;
958
+ nextSeq?: number | undefined;
959
+ }, {
960
+ sessionId: string;
961
+ replayed: number;
962
+ nextSeq?: number | undefined;
963
+ }>;
964
+ export type StreamReplayResult = z.infer<typeof StreamReplayResult>;
454
965
  /** 流式事件联合体(phonon → server,方法名 stream.event)。 */
455
966
  export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
456
967
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
968
+ /**
969
+ * 本轮关联 id。solicited 事件用 send 返回的 turnId;
970
+ * unsolicited(自发)事件由 phonon 生成,server 从事件中首次见到。
971
+ */
457
972
  turnId: z.ZodString;
973
+ /** 输出来源:默认 solicited;agent 自发为 unsolicited。 */
458
974
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
975
+ /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
459
976
  source: z.ZodOptional<z.ZodString>;
977
+ /** Native harness output identity; not a caller-selected conversation or sender. */
978
+ sourceEventId: z.ZodOptional<z.ZodString>;
979
+ nativeProactive: z.ZodOptional<z.ZodObject<{
980
+ anchorRunId: z.ZodString;
981
+ employeeId: z.ZodString;
982
+ employeeRevision: z.ZodNumber;
983
+ upstreamId: z.ZodString;
984
+ project: z.ZodString;
985
+ agent: z.ZodString;
986
+ model: z.ZodString;
987
+ }, "strict", z.ZodTypeAny, {
988
+ agent: string;
989
+ model: string;
990
+ project: string;
991
+ employeeId: string;
992
+ employeeRevision: number;
993
+ anchorRunId: string;
994
+ upstreamId: string;
995
+ }, {
996
+ agent: string;
997
+ model: string;
998
+ project: string;
999
+ employeeId: string;
1000
+ employeeRevision: number;
1001
+ anchorRunId: string;
1002
+ upstreamId: string;
1003
+ }>>;
1004
+ /** 单调递增序号(按 session),保证调用方可排序/去重。 */
460
1005
  seq: z.ZodNumber;
461
1006
  at: z.ZodString;
1007
+ /**
1008
+ * L3 编排归属(review P0-1,2026-06-23)。
1009
+ * session 由 workflow node 创建时,phonon 自动给该 session 所有事件打上这些字段,
1010
+ * 服务端按 workflowId 筛流、按 nodeId/role 区分来源。
1011
+ * 没有归属的普通 session 留空,向后兼容。
1012
+ */
462
1013
  workflowId: z.ZodOptional<z.ZodString>;
463
1014
  nodeId: z.ZodOptional<z.ZodString>;
1015
+ role: z.ZodOptional<z.ZodString>;
1016
+ /** Server-generated native conversation run correlation, stamped by core. */
1017
+ nativeRunId: z.ZodOptional<z.ZodString>;
1018
+ } & {
1019
+ type: z.ZodLiteral<"runtime_settings">;
1020
+ agent: z.ZodString;
1021
+ model: z.ZodString;
1022
+ reasoning: z.ZodObject<{
1023
+ requestedLevel: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
1024
+ nativeValue: z.ZodNullable<z.ZodEnum<["off", "none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra", "auto", "adaptive"]>>;
1025
+ effectiveLevel: z.ZodOptional<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
1026
+ }, "strict", z.ZodTypeAny, {
1027
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
1028
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
1029
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
1030
+ }, {
1031
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
1032
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
1033
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
1034
+ }>;
1035
+ }, "strip", z.ZodTypeAny, {
1036
+ at: string;
1037
+ type: "runtime_settings";
1038
+ sessionId: string & z.BRAND<"SessionId">;
1039
+ agent: string;
1040
+ model: string;
1041
+ turnId: string;
1042
+ reasoning: {
1043
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
1044
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
1045
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
1046
+ };
1047
+ origin: "solicited" | "unsolicited";
1048
+ seq: number;
1049
+ nodeId?: string | undefined;
1050
+ source?: string | undefined;
1051
+ role?: string | undefined;
1052
+ sourceEventId?: string | undefined;
1053
+ nativeProactive?: {
1054
+ agent: string;
1055
+ model: string;
1056
+ project: string;
1057
+ employeeId: string;
1058
+ employeeRevision: number;
1059
+ anchorRunId: string;
1060
+ upstreamId: string;
1061
+ } | undefined;
1062
+ workflowId?: string | undefined;
1063
+ nativeRunId?: string | undefined;
1064
+ }, {
1065
+ at: string;
1066
+ type: "runtime_settings";
1067
+ sessionId: string;
1068
+ agent: string;
1069
+ model: string;
1070
+ turnId: string;
1071
+ reasoning: {
1072
+ requestedLevel: "low" | "standard" | "high" | "xhigh" | "max" | null;
1073
+ nativeValue: "low" | "high" | "xhigh" | "max" | "off" | "none" | "minimal" | "medium" | "ultra" | "auto" | "adaptive" | null;
1074
+ effectiveLevel?: "low" | "standard" | "high" | "xhigh" | "max" | undefined;
1075
+ };
1076
+ seq: number;
1077
+ nodeId?: string | undefined;
1078
+ source?: string | undefined;
1079
+ role?: string | undefined;
1080
+ origin?: "solicited" | "unsolicited" | undefined;
1081
+ sourceEventId?: string | undefined;
1082
+ nativeProactive?: {
1083
+ agent: string;
1084
+ model: string;
1085
+ project: string;
1086
+ employeeId: string;
1087
+ employeeRevision: number;
1088
+ anchorRunId: string;
1089
+ upstreamId: string;
1090
+ } | undefined;
1091
+ workflowId?: string | undefined;
1092
+ nativeRunId?: string | undefined;
1093
+ }>, z.ZodObject<{
1094
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1095
+ turnId: z.ZodString;
1096
+ origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
1097
+ source: z.ZodOptional<z.ZodString>;
1098
+ sourceEventId: z.ZodOptional<z.ZodString>;
1099
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1100
+ anchorRunId: z.ZodString;
1101
+ employeeId: z.ZodString;
1102
+ employeeRevision: z.ZodNumber;
1103
+ upstreamId: z.ZodString;
1104
+ project: z.ZodString;
1105
+ agent: z.ZodString;
1106
+ model: z.ZodString;
1107
+ }, "strict", z.ZodTypeAny, {
1108
+ agent: string;
1109
+ model: string;
1110
+ project: string;
1111
+ employeeId: string;
1112
+ employeeRevision: number;
1113
+ anchorRunId: string;
1114
+ upstreamId: string;
1115
+ }, {
1116
+ agent: string;
1117
+ model: string;
1118
+ project: string;
1119
+ employeeId: string;
1120
+ employeeRevision: number;
1121
+ anchorRunId: string;
1122
+ upstreamId: string;
1123
+ }>>;
1124
+ seq: z.ZodNumber;
1125
+ at: z.ZodString;
1126
+ workflowId: z.ZodOptional<z.ZodString>;
1127
+ nodeId: z.ZodOptional<z.ZodString>;
1128
+ nativeRunId: z.ZodOptional<z.ZodString>;
464
1129
  } & {
465
1130
  type: z.ZodLiteral<"message">;
466
1131
  role: z.ZodDefault<z.ZodEnum<["assistant", "user", "system"]>>;
@@ -470,15 +1135,26 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
470
1135
  at: string;
471
1136
  type: "message";
472
1137
  sessionId: string & z.BRAND<"SessionId">;
473
- role: "system" | "user" | "assistant";
474
1138
  turnId: string;
1139
+ role: "system" | "user" | "assistant";
475
1140
  origin: "solicited" | "unsolicited";
476
1141
  seq: number;
477
1142
  text: string;
478
1143
  delta: boolean;
1144
+ nodeId?: string | undefined;
479
1145
  source?: string | undefined;
1146
+ sourceEventId?: string | undefined;
1147
+ nativeProactive?: {
1148
+ agent: string;
1149
+ model: string;
1150
+ project: string;
1151
+ employeeId: string;
1152
+ employeeRevision: number;
1153
+ anchorRunId: string;
1154
+ upstreamId: string;
1155
+ } | undefined;
480
1156
  workflowId?: string | undefined;
481
- nodeId?: string | undefined;
1157
+ nativeRunId?: string | undefined;
482
1158
  }, {
483
1159
  at: string;
484
1160
  type: "message";
@@ -486,11 +1162,22 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
486
1162
  turnId: string;
487
1163
  seq: number;
488
1164
  text: string;
1165
+ nodeId?: string | undefined;
1166
+ source?: string | undefined;
489
1167
  role?: "system" | "user" | "assistant" | undefined;
490
1168
  origin?: "solicited" | "unsolicited" | undefined;
491
- source?: string | undefined;
1169
+ sourceEventId?: string | undefined;
1170
+ nativeProactive?: {
1171
+ agent: string;
1172
+ model: string;
1173
+ project: string;
1174
+ employeeId: string;
1175
+ employeeRevision: number;
1176
+ anchorRunId: string;
1177
+ upstreamId: string;
1178
+ } | undefined;
492
1179
  workflowId?: string | undefined;
493
- nodeId?: string | undefined;
1180
+ nativeRunId?: string | undefined;
494
1181
  delta?: boolean | undefined;
495
1182
  }>, z.ZodObject<{
496
1183
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
@@ -503,6 +1190,33 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
503
1190
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
504
1191
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
505
1192
  source: z.ZodOptional<z.ZodString>;
1193
+ /** Native harness output identity; not a caller-selected conversation or sender. */
1194
+ sourceEventId: z.ZodOptional<z.ZodString>;
1195
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1196
+ anchorRunId: z.ZodString;
1197
+ employeeId: z.ZodString;
1198
+ employeeRevision: z.ZodNumber;
1199
+ upstreamId: z.ZodString;
1200
+ project: z.ZodString;
1201
+ agent: z.ZodString;
1202
+ model: z.ZodString;
1203
+ }, "strict", z.ZodTypeAny, {
1204
+ agent: string;
1205
+ model: string;
1206
+ project: string;
1207
+ employeeId: string;
1208
+ employeeRevision: number;
1209
+ anchorRunId: string;
1210
+ upstreamId: string;
1211
+ }, {
1212
+ agent: string;
1213
+ model: string;
1214
+ project: string;
1215
+ employeeId: string;
1216
+ employeeRevision: number;
1217
+ anchorRunId: string;
1218
+ upstreamId: string;
1219
+ }>>;
506
1220
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
507
1221
  seq: z.ZodNumber;
508
1222
  at: z.ZodString;
@@ -515,6 +1229,8 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
515
1229
  workflowId: z.ZodOptional<z.ZodString>;
516
1230
  nodeId: z.ZodOptional<z.ZodString>;
517
1231
  role: z.ZodOptional<z.ZodString>;
1232
+ /** Server-generated native conversation run correlation, stamped by core. */
1233
+ nativeRunId: z.ZodOptional<z.ZodString>;
518
1234
  } & {
519
1235
  type: z.ZodLiteral<"thinking">;
520
1236
  text: z.ZodString;
@@ -528,10 +1244,21 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
528
1244
  seq: number;
529
1245
  text: string;
530
1246
  delta: boolean;
531
- role?: string | undefined;
1247
+ nodeId?: string | undefined;
532
1248
  source?: string | undefined;
1249
+ role?: string | undefined;
1250
+ sourceEventId?: string | undefined;
1251
+ nativeProactive?: {
1252
+ agent: string;
1253
+ model: string;
1254
+ project: string;
1255
+ employeeId: string;
1256
+ employeeRevision: number;
1257
+ anchorRunId: string;
1258
+ upstreamId: string;
1259
+ } | undefined;
533
1260
  workflowId?: string | undefined;
534
- nodeId?: string | undefined;
1261
+ nativeRunId?: string | undefined;
535
1262
  }, {
536
1263
  at: string;
537
1264
  type: "thinking";
@@ -539,11 +1266,22 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
539
1266
  turnId: string;
540
1267
  seq: number;
541
1268
  text: string;
1269
+ nodeId?: string | undefined;
1270
+ source?: string | undefined;
542
1271
  role?: string | undefined;
543
1272
  origin?: "solicited" | "unsolicited" | undefined;
544
- source?: string | undefined;
1273
+ sourceEventId?: string | undefined;
1274
+ nativeProactive?: {
1275
+ agent: string;
1276
+ model: string;
1277
+ project: string;
1278
+ employeeId: string;
1279
+ employeeRevision: number;
1280
+ anchorRunId: string;
1281
+ upstreamId: string;
1282
+ } | undefined;
545
1283
  workflowId?: string | undefined;
546
- nodeId?: string | undefined;
1284
+ nativeRunId?: string | undefined;
547
1285
  delta?: boolean | undefined;
548
1286
  }>, z.ZodObject<{
549
1287
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
@@ -556,6 +1294,33 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
556
1294
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
557
1295
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
558
1296
  source: z.ZodOptional<z.ZodString>;
1297
+ /** Native harness output identity; not a caller-selected conversation or sender. */
1298
+ sourceEventId: z.ZodOptional<z.ZodString>;
1299
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1300
+ anchorRunId: z.ZodString;
1301
+ employeeId: z.ZodString;
1302
+ employeeRevision: z.ZodNumber;
1303
+ upstreamId: z.ZodString;
1304
+ project: z.ZodString;
1305
+ agent: z.ZodString;
1306
+ model: z.ZodString;
1307
+ }, "strict", z.ZodTypeAny, {
1308
+ agent: string;
1309
+ model: string;
1310
+ project: string;
1311
+ employeeId: string;
1312
+ employeeRevision: number;
1313
+ anchorRunId: string;
1314
+ upstreamId: string;
1315
+ }, {
1316
+ agent: string;
1317
+ model: string;
1318
+ project: string;
1319
+ employeeId: string;
1320
+ employeeRevision: number;
1321
+ anchorRunId: string;
1322
+ upstreamId: string;
1323
+ }>>;
559
1324
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
560
1325
  seq: z.ZodNumber;
561
1326
  at: z.ZodString;
@@ -568,6 +1333,8 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
568
1333
  workflowId: z.ZodOptional<z.ZodString>;
569
1334
  nodeId: z.ZodOptional<z.ZodString>;
570
1335
  role: z.ZodOptional<z.ZodString>;
1336
+ /** Server-generated native conversation run correlation, stamped by core. */
1337
+ nativeRunId: z.ZodOptional<z.ZodString>;
571
1338
  } & {
572
1339
  type: z.ZodLiteral<"tool_call">;
573
1340
  toolName: z.ZodString;
@@ -583,10 +1350,21 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
583
1350
  origin: "solicited" | "unsolicited";
584
1351
  seq: number;
585
1352
  toolName: string;
586
- role?: string | undefined;
1353
+ nodeId?: string | undefined;
587
1354
  source?: string | undefined;
1355
+ role?: string | undefined;
1356
+ sourceEventId?: string | undefined;
1357
+ nativeProactive?: {
1358
+ agent: string;
1359
+ model: string;
1360
+ project: string;
1361
+ employeeId: string;
1362
+ employeeRevision: number;
1363
+ anchorRunId: string;
1364
+ upstreamId: string;
1365
+ } | undefined;
588
1366
  workflowId?: string | undefined;
589
- nodeId?: string | undefined;
1367
+ nativeRunId?: string | undefined;
590
1368
  args?: unknown;
591
1369
  toolCallId?: string | undefined;
592
1370
  }, {
@@ -596,11 +1374,22 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
596
1374
  turnId: string;
597
1375
  seq: number;
598
1376
  toolName: string;
1377
+ nodeId?: string | undefined;
1378
+ source?: string | undefined;
599
1379
  role?: string | undefined;
600
1380
  origin?: "solicited" | "unsolicited" | undefined;
601
- source?: string | undefined;
1381
+ sourceEventId?: string | undefined;
1382
+ nativeProactive?: {
1383
+ agent: string;
1384
+ model: string;
1385
+ project: string;
1386
+ employeeId: string;
1387
+ employeeRevision: number;
1388
+ anchorRunId: string;
1389
+ upstreamId: string;
1390
+ } | undefined;
602
1391
  workflowId?: string | undefined;
603
- nodeId?: string | undefined;
1392
+ nativeRunId?: string | undefined;
604
1393
  args?: unknown;
605
1394
  toolCallId?: string | undefined;
606
1395
  }>, z.ZodObject<{
@@ -614,6 +1403,33 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
614
1403
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
615
1404
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
616
1405
  source: z.ZodOptional<z.ZodString>;
1406
+ /** Native harness output identity; not a caller-selected conversation or sender. */
1407
+ sourceEventId: z.ZodOptional<z.ZodString>;
1408
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1409
+ anchorRunId: z.ZodString;
1410
+ employeeId: z.ZodString;
1411
+ employeeRevision: z.ZodNumber;
1412
+ upstreamId: z.ZodString;
1413
+ project: z.ZodString;
1414
+ agent: z.ZodString;
1415
+ model: z.ZodString;
1416
+ }, "strict", z.ZodTypeAny, {
1417
+ agent: string;
1418
+ model: string;
1419
+ project: string;
1420
+ employeeId: string;
1421
+ employeeRevision: number;
1422
+ anchorRunId: string;
1423
+ upstreamId: string;
1424
+ }, {
1425
+ agent: string;
1426
+ model: string;
1427
+ project: string;
1428
+ employeeId: string;
1429
+ employeeRevision: number;
1430
+ anchorRunId: string;
1431
+ upstreamId: string;
1432
+ }>>;
617
1433
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
618
1434
  seq: z.ZodNumber;
619
1435
  at: z.ZodString;
@@ -626,6 +1442,8 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
626
1442
  workflowId: z.ZodOptional<z.ZodString>;
627
1443
  nodeId: z.ZodOptional<z.ZodString>;
628
1444
  role: z.ZodOptional<z.ZodString>;
1445
+ /** Server-generated native conversation run correlation, stamped by core. */
1446
+ nativeRunId: z.ZodOptional<z.ZodString>;
629
1447
  } & {
630
1448
  type: z.ZodLiteral<"tool_result">;
631
1449
  toolName: z.ZodString;
@@ -642,10 +1460,21 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
642
1460
  seq: number;
643
1461
  toolName: string;
644
1462
  ok: boolean;
645
- role?: string | undefined;
1463
+ nodeId?: string | undefined;
646
1464
  source?: string | undefined;
1465
+ role?: string | undefined;
1466
+ sourceEventId?: string | undefined;
1467
+ nativeProactive?: {
1468
+ agent: string;
1469
+ model: string;
1470
+ project: string;
1471
+ employeeId: string;
1472
+ employeeRevision: number;
1473
+ anchorRunId: string;
1474
+ upstreamId: string;
1475
+ } | undefined;
647
1476
  workflowId?: string | undefined;
648
- nodeId?: string | undefined;
1477
+ nativeRunId?: string | undefined;
649
1478
  toolCallId?: string | undefined;
650
1479
  output?: unknown;
651
1480
  }, {
@@ -656,11 +1485,22 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
656
1485
  seq: number;
657
1486
  toolName: string;
658
1487
  ok: boolean;
1488
+ nodeId?: string | undefined;
1489
+ source?: string | undefined;
659
1490
  role?: string | undefined;
660
1491
  origin?: "solicited" | "unsolicited" | undefined;
661
- source?: string | undefined;
1492
+ sourceEventId?: string | undefined;
1493
+ nativeProactive?: {
1494
+ agent: string;
1495
+ model: string;
1496
+ project: string;
1497
+ employeeId: string;
1498
+ employeeRevision: number;
1499
+ anchorRunId: string;
1500
+ upstreamId: string;
1501
+ } | undefined;
662
1502
  workflowId?: string | undefined;
663
- nodeId?: string | undefined;
1503
+ nativeRunId?: string | undefined;
664
1504
  toolCallId?: string | undefined;
665
1505
  output?: unknown;
666
1506
  }>, z.ZodObject<{
@@ -674,6 +1514,33 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
674
1514
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
675
1515
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
676
1516
  source: z.ZodOptional<z.ZodString>;
1517
+ /** Native harness output identity; not a caller-selected conversation or sender. */
1518
+ sourceEventId: z.ZodOptional<z.ZodString>;
1519
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1520
+ anchorRunId: z.ZodString;
1521
+ employeeId: z.ZodString;
1522
+ employeeRevision: z.ZodNumber;
1523
+ upstreamId: z.ZodString;
1524
+ project: z.ZodString;
1525
+ agent: z.ZodString;
1526
+ model: z.ZodString;
1527
+ }, "strict", z.ZodTypeAny, {
1528
+ agent: string;
1529
+ model: string;
1530
+ project: string;
1531
+ employeeId: string;
1532
+ employeeRevision: number;
1533
+ anchorRunId: string;
1534
+ upstreamId: string;
1535
+ }, {
1536
+ agent: string;
1537
+ model: string;
1538
+ project: string;
1539
+ employeeId: string;
1540
+ employeeRevision: number;
1541
+ anchorRunId: string;
1542
+ upstreamId: string;
1543
+ }>>;
677
1544
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
678
1545
  seq: z.ZodNumber;
679
1546
  at: z.ZodString;
@@ -686,6 +1553,8 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
686
1553
  workflowId: z.ZodOptional<z.ZodString>;
687
1554
  nodeId: z.ZodOptional<z.ZodString>;
688
1555
  role: z.ZodOptional<z.ZodString>;
1556
+ /** Server-generated native conversation run correlation, stamped by core. */
1557
+ nativeRunId: z.ZodOptional<z.ZodString>;
689
1558
  } & {
690
1559
  type: z.ZodLiteral<"token">;
691
1560
  text: z.ZodString;
@@ -697,10 +1566,21 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
697
1566
  origin: "solicited" | "unsolicited";
698
1567
  seq: number;
699
1568
  text: string;
700
- role?: string | undefined;
1569
+ nodeId?: string | undefined;
701
1570
  source?: string | undefined;
1571
+ role?: string | undefined;
1572
+ sourceEventId?: string | undefined;
1573
+ nativeProactive?: {
1574
+ agent: string;
1575
+ model: string;
1576
+ project: string;
1577
+ employeeId: string;
1578
+ employeeRevision: number;
1579
+ anchorRunId: string;
1580
+ upstreamId: string;
1581
+ } | undefined;
702
1582
  workflowId?: string | undefined;
703
- nodeId?: string | undefined;
1583
+ nativeRunId?: string | undefined;
704
1584
  }, {
705
1585
  at: string;
706
1586
  type: "token";
@@ -708,11 +1588,22 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
708
1588
  turnId: string;
709
1589
  seq: number;
710
1590
  text: string;
1591
+ nodeId?: string | undefined;
1592
+ source?: string | undefined;
711
1593
  role?: string | undefined;
712
1594
  origin?: "solicited" | "unsolicited" | undefined;
713
- source?: string | undefined;
1595
+ sourceEventId?: string | undefined;
1596
+ nativeProactive?: {
1597
+ agent: string;
1598
+ model: string;
1599
+ project: string;
1600
+ employeeId: string;
1601
+ employeeRevision: number;
1602
+ anchorRunId: string;
1603
+ upstreamId: string;
1604
+ } | undefined;
714
1605
  workflowId?: string | undefined;
715
- nodeId?: string | undefined;
1606
+ nativeRunId?: string | undefined;
716
1607
  }>, z.ZodObject<{
717
1608
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
718
1609
  /**
@@ -724,6 +1615,33 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
724
1615
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
725
1616
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
726
1617
  source: z.ZodOptional<z.ZodString>;
1618
+ /** Native harness output identity; not a caller-selected conversation or sender. */
1619
+ sourceEventId: z.ZodOptional<z.ZodString>;
1620
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1621
+ anchorRunId: z.ZodString;
1622
+ employeeId: z.ZodString;
1623
+ employeeRevision: z.ZodNumber;
1624
+ upstreamId: z.ZodString;
1625
+ project: z.ZodString;
1626
+ agent: z.ZodString;
1627
+ model: z.ZodString;
1628
+ }, "strict", z.ZodTypeAny, {
1629
+ agent: string;
1630
+ model: string;
1631
+ project: string;
1632
+ employeeId: string;
1633
+ employeeRevision: number;
1634
+ anchorRunId: string;
1635
+ upstreamId: string;
1636
+ }, {
1637
+ agent: string;
1638
+ model: string;
1639
+ project: string;
1640
+ employeeId: string;
1641
+ employeeRevision: number;
1642
+ anchorRunId: string;
1643
+ upstreamId: string;
1644
+ }>>;
727
1645
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
728
1646
  seq: z.ZodNumber;
729
1647
  at: z.ZodString;
@@ -736,6 +1654,8 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
736
1654
  workflowId: z.ZodOptional<z.ZodString>;
737
1655
  nodeId: z.ZodOptional<z.ZodString>;
738
1656
  role: z.ZodOptional<z.ZodString>;
1657
+ /** Server-generated native conversation run correlation, stamped by core. */
1658
+ nativeRunId: z.ZodOptional<z.ZodString>;
739
1659
  } & {
740
1660
  type: z.ZodLiteral<"result">;
741
1661
  /** 本轮最终文本结果。 */
@@ -765,17 +1685,28 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
765
1685
  }, "strip", z.ZodTypeAny, {
766
1686
  at: string;
767
1687
  type: "result";
768
- status: "aborted" | "interrupted" | "completed" | "failed" | "timeout";
1688
+ status: "aborted" | "failed" | "interrupted" | "completed" | "timeout";
769
1689
  final: true;
770
1690
  sessionId: string & z.BRAND<"SessionId">;
771
1691
  turnId: string;
772
1692
  origin: "solicited" | "unsolicited";
773
1693
  seq: number;
774
1694
  text: string;
775
- role?: string | undefined;
1695
+ nodeId?: string | undefined;
776
1696
  source?: string | undefined;
1697
+ role?: string | undefined;
1698
+ sourceEventId?: string | undefined;
1699
+ nativeProactive?: {
1700
+ agent: string;
1701
+ model: string;
1702
+ project: string;
1703
+ employeeId: string;
1704
+ employeeRevision: number;
1705
+ anchorRunId: string;
1706
+ upstreamId: string;
1707
+ } | undefined;
777
1708
  workflowId?: string | undefined;
778
- nodeId?: string | undefined;
1709
+ nativeRunId?: string | undefined;
779
1710
  usage?: {
780
1711
  inputTokens?: number | undefined;
781
1712
  outputTokens?: number | undefined;
@@ -788,12 +1719,23 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
788
1719
  turnId: string;
789
1720
  seq: number;
790
1721
  text: string;
791
- status?: "aborted" | "interrupted" | "completed" | "failed" | "timeout" | undefined;
1722
+ status?: "aborted" | "failed" | "interrupted" | "completed" | "timeout" | undefined;
1723
+ nodeId?: string | undefined;
1724
+ source?: string | undefined;
792
1725
  role?: string | undefined;
793
1726
  origin?: "solicited" | "unsolicited" | undefined;
794
- source?: string | undefined;
1727
+ sourceEventId?: string | undefined;
1728
+ nativeProactive?: {
1729
+ agent: string;
1730
+ model: string;
1731
+ project: string;
1732
+ employeeId: string;
1733
+ employeeRevision: number;
1734
+ anchorRunId: string;
1735
+ upstreamId: string;
1736
+ } | undefined;
795
1737
  workflowId?: string | undefined;
796
- nodeId?: string | undefined;
1738
+ nativeRunId?: string | undefined;
797
1739
  usage?: {
798
1740
  inputTokens?: number | undefined;
799
1741
  outputTokens?: number | undefined;
@@ -809,6 +1751,33 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
809
1751
  origin: z.ZodDefault<z.ZodEnum<["solicited", "unsolicited"]>>;
810
1752
  /** unsolicited 时的冲泡来源标签,如 "cron" / "scheduled" / "heartbeat"。 */
811
1753
  source: z.ZodOptional<z.ZodString>;
1754
+ /** Native harness output identity; not a caller-selected conversation or sender. */
1755
+ sourceEventId: z.ZodOptional<z.ZodString>;
1756
+ nativeProactive: z.ZodOptional<z.ZodObject<{
1757
+ anchorRunId: z.ZodString;
1758
+ employeeId: z.ZodString;
1759
+ employeeRevision: z.ZodNumber;
1760
+ upstreamId: z.ZodString;
1761
+ project: z.ZodString;
1762
+ agent: z.ZodString;
1763
+ model: z.ZodString;
1764
+ }, "strict", z.ZodTypeAny, {
1765
+ agent: string;
1766
+ model: string;
1767
+ project: string;
1768
+ employeeId: string;
1769
+ employeeRevision: number;
1770
+ anchorRunId: string;
1771
+ upstreamId: string;
1772
+ }, {
1773
+ agent: string;
1774
+ model: string;
1775
+ project: string;
1776
+ employeeId: string;
1777
+ employeeRevision: number;
1778
+ anchorRunId: string;
1779
+ upstreamId: string;
1780
+ }>>;
812
1781
  /** 单调递增序号(按 session),保证调用方可排序/去重。 */
813
1782
  seq: z.ZodNumber;
814
1783
  at: z.ZodString;
@@ -821,6 +1790,8 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
821
1790
  workflowId: z.ZodOptional<z.ZodString>;
822
1791
  nodeId: z.ZodOptional<z.ZodString>;
823
1792
  role: z.ZodOptional<z.ZodString>;
1793
+ /** Server-generated native conversation run correlation, stamped by core. */
1794
+ nativeRunId: z.ZodOptional<z.ZodString>;
824
1795
  } & {
825
1796
  type: z.ZodLiteral<"error">;
826
1797
  message: z.ZodString;
@@ -833,17 +1804,28 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
833
1804
  at: string;
834
1805
  message: string;
835
1806
  type: "error";
836
- status: "aborted" | "interrupted" | "failed" | "timeout";
1807
+ status: "aborted" | "failed" | "interrupted" | "timeout";
837
1808
  final: true;
838
1809
  sessionId: string & z.BRAND<"SessionId">;
839
1810
  turnId: string;
840
1811
  origin: "solicited" | "unsolicited";
841
1812
  seq: number;
842
1813
  appCode?: string | undefined;
843
- role?: string | undefined;
1814
+ nodeId?: string | undefined;
844
1815
  source?: string | undefined;
1816
+ role?: string | undefined;
1817
+ sourceEventId?: string | undefined;
1818
+ nativeProactive?: {
1819
+ agent: string;
1820
+ model: string;
1821
+ project: string;
1822
+ employeeId: string;
1823
+ employeeRevision: number;
1824
+ anchorRunId: string;
1825
+ upstreamId: string;
1826
+ } | undefined;
845
1827
  workflowId?: string | undefined;
846
- nodeId?: string | undefined;
1828
+ nativeRunId?: string | undefined;
847
1829
  }, {
848
1830
  at: string;
849
1831
  message: string;
@@ -852,13 +1834,24 @@ export declare const StreamEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
852
1834
  sessionId: string;
853
1835
  turnId: string;
854
1836
  seq: number;
855
- status?: "aborted" | "interrupted" | "failed" | "timeout" | undefined;
1837
+ status?: "aborted" | "failed" | "interrupted" | "timeout" | undefined;
856
1838
  appCode?: string | undefined;
1839
+ nodeId?: string | undefined;
1840
+ source?: string | undefined;
857
1841
  role?: string | undefined;
858
1842
  origin?: "solicited" | "unsolicited" | undefined;
859
- source?: string | undefined;
1843
+ sourceEventId?: string | undefined;
1844
+ nativeProactive?: {
1845
+ agent: string;
1846
+ model: string;
1847
+ project: string;
1848
+ employeeId: string;
1849
+ employeeRevision: number;
1850
+ anchorRunId: string;
1851
+ upstreamId: string;
1852
+ } | undefined;
860
1853
  workflowId?: string | undefined;
861
- nodeId?: string | undefined;
1854
+ nativeRunId?: string | undefined;
862
1855
  }>]>;
863
1856
  export type StreamEvent = z.infer<typeof StreamEvent>;
864
1857
  //# sourceMappingURL=stream.d.ts.map