@agent-phonon/protocol 0.9.0 → 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 +22195 -2371
  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 +61 -2
  82. package/dist/schemas/policy.d.ts.map +1 -1
  83. package/dist/schemas/policy.js +33 -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 +14653 -4527
  98. package/dist/schemas/schedule.d.ts.map +1 -1
  99. package/dist/schemas/schedule.js +55 -8
  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 +33 -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 +63 -8
  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
@@ -60,8 +60,8 @@ export declare const SessionCreateParams: z.ZodObject<{
60
60
  clientTag: z.ZodOptional<z.ZodString>;
61
61
  }, "strip", z.ZodTypeAny, {
62
62
  agent: string & z.BRAND<"AgentId">;
63
- project: string & z.BRAND<"ProjectId">;
64
63
  model: string;
64
+ project: string & z.BRAND<"ProjectId">;
65
65
  verbosity: "final" | "messages" | "tools" | "trace";
66
66
  clientRequestId?: string | undefined;
67
67
  worktreeId?: string | undefined;
@@ -73,8 +73,8 @@ export declare const SessionCreateParams: z.ZodObject<{
73
73
  clientTag?: string | undefined;
74
74
  }, {
75
75
  agent: string;
76
- project: string;
77
76
  model: string;
77
+ project: string;
78
78
  clientRequestId?: string | undefined;
79
79
  worktreeId?: string | undefined;
80
80
  agentConfig?: Record<string, unknown> | undefined;
@@ -95,18 +95,18 @@ export declare const SessionCreateResult: z.ZodObject<{
95
95
  status: z.ZodEnum<["idle", "running", "paused", "terminated"]>;
96
96
  createdAt: z.ZodString;
97
97
  }, "strip", z.ZodTypeAny, {
98
- status: "idle" | "running" | "paused" | "terminated";
98
+ status: "running" | "idle" | "paused" | "terminated";
99
99
  sessionId: string & z.BRAND<"SessionId">;
100
100
  agent: string & z.BRAND<"AgentId">;
101
- project: string & z.BRAND<"ProjectId">;
102
101
  model: string;
102
+ project: string & z.BRAND<"ProjectId">;
103
103
  createdAt: string;
104
104
  }, {
105
- status: "idle" | "running" | "paused" | "terminated";
105
+ status: "running" | "idle" | "paused" | "terminated";
106
106
  sessionId: string;
107
107
  agent: string;
108
- project: string;
109
108
  model: string;
109
+ project: string;
110
110
  createdAt: string;
111
111
  }>;
112
112
  export type SessionCreateResult = z.infer<typeof SessionCreateResult>;
@@ -122,6 +122,13 @@ export declare const WhenBusy: z.ZodEnum<["queue", "interrupt", "inject"]>;
122
122
  export type WhenBusy = z.infer<typeof WhenBusy>;
123
123
  export declare const SessionSendParams: z.ZodObject<{
124
124
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
125
+ reasoning: z.ZodOptional<z.ZodObject<{
126
+ level: z.ZodNullable<z.ZodEnum<["low", "standard", "high", "xhigh", "max"]>>;
127
+ }, "strict", z.ZodTypeAny, {
128
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
129
+ }, {
130
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
131
+ }>>;
125
132
  /** 用户输入 / 任务内容。 */
126
133
  input: z.ZodString;
127
134
  /**
@@ -135,21 +142,27 @@ export declare const SessionSendParams: z.ZodObject<{
135
142
  * phonon 保证:(1) skill 在 agent 能访问到的位置;(2) 上下文注入强制加载指令。
136
143
  * 优先级:send 指定 > project skill > global skill。
137
144
  */
138
- skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
139
- name: z.ZodString;
140
- version: z.ZodOptional<z.ZodString>;
145
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
146
+ name: z.ZodEffects<z.ZodString, string, string>;
147
+ version: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
141
148
  scope: z.ZodOptional<z.ZodEnum<["global", "project"]>>;
142
149
  force: z.ZodOptional<z.ZodBoolean>;
143
- }, "strip", z.ZodTypeAny, {
150
+ revision: z.ZodOptional<z.ZodString>;
151
+ installationId: z.ZodOptional<z.ZodString>;
152
+ }, "strict", z.ZodTypeAny, {
144
153
  name: string;
145
154
  version?: string | undefined;
146
155
  scope?: "project" | "global" | undefined;
147
156
  force?: boolean | undefined;
157
+ revision?: string | undefined;
158
+ installationId?: string | undefined;
148
159
  }, {
149
160
  name: string;
150
161
  version?: string | undefined;
151
162
  scope?: "project" | "global" | undefined;
152
163
  force?: boolean | undefined;
164
+ revision?: string | undefined;
165
+ installationId?: string | undefined;
153
166
  }>]>, "many">>;
154
167
  /** 可选:覆盖本轮详细度。 */
155
168
  verbosity: z.ZodOptional<z.ZodEnum<["final", "messages", "tools", "trace"]>>;
@@ -166,36 +179,47 @@ export declare const SessionSendParams: z.ZodObject<{
166
179
  /**
167
180
  * 可选:本轮关联 id。phonon 会把该轮所有 stream.event 标上同一 turnId,
168
181
  * 调用方据此聚合流式输出。缺省由 phonon 生成并在 ack 中返回。
182
+ * whenBusy=inject 不创建新轮;如显式提供 turnId,必须等于当前 turn。
169
183
  */
170
184
  turnId: z.ZodOptional<z.ZodString>;
171
185
  }, "strip", z.ZodTypeAny, {
172
186
  sessionId: string & z.BRAND<"SessionId">;
173
187
  input: string;
174
188
  whenBusy: "interrupt" | "queue" | "inject";
189
+ turnId?: string | undefined;
175
190
  clientRequestId?: string | undefined;
176
- verbosity?: "final" | "messages" | "tools" | "trace" | undefined;
177
191
  skills?: (string | {
178
192
  name: string;
179
193
  version?: string | undefined;
180
194
  scope?: "project" | "global" | undefined;
181
195
  force?: boolean | undefined;
196
+ revision?: string | undefined;
197
+ installationId?: string | undefined;
182
198
  })[] | undefined;
199
+ verbosity?: "final" | "messages" | "tools" | "trace" | undefined;
200
+ reasoning?: {
201
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
202
+ } | undefined;
183
203
  fallback?: "interrupt" | "queue" | "inject" | undefined;
184
- turnId?: string | undefined;
185
204
  }, {
186
205
  sessionId: string;
187
206
  input: string;
207
+ turnId?: string | undefined;
188
208
  clientRequestId?: string | undefined;
189
- verbosity?: "final" | "messages" | "tools" | "trace" | undefined;
190
209
  skills?: (string | {
191
210
  name: string;
192
211
  version?: string | undefined;
193
212
  scope?: "project" | "global" | undefined;
194
213
  force?: boolean | undefined;
214
+ revision?: string | undefined;
215
+ installationId?: string | undefined;
195
216
  })[] | undefined;
217
+ verbosity?: "final" | "messages" | "tools" | "trace" | undefined;
218
+ reasoning?: {
219
+ level: "low" | "standard" | "high" | "xhigh" | "max" | null;
220
+ } | undefined;
196
221
  whenBusy?: "interrupt" | "queue" | "inject" | undefined;
197
222
  fallback?: "interrupt" | "queue" | "inject" | undefined;
198
- turnId?: string | undefined;
199
223
  }>;
200
224
  export type SessionSendParams = z.infer<typeof SessionSendParams>;
201
225
  /** send 的同步 ack(真正的内容走 stream.event 异步推)。 */
@@ -208,7 +232,8 @@ export declare const SessionSendAck: z.ZodObject<{
208
232
  * - started :立即开始执行(session 空闲)
209
233
  * - queued :已排队(whenBusy=queue 且正忙)
210
234
  * - interrupted:已中断上一轮并开始本轮(whenBusy=interrupt)
211
- * - injected :将在下一 tool call 边界插入(whenBusy=inject)
235
+ * - injected :已在当前 turn 的工具边界应用输入(whenBusy=inject),turnId 是当前 turn,不创建新轮。
236
+ * 未应用前不回 injected;窗口关闭必须拒绝,不能自动排队。
212
237
  */
213
238
  disposition: z.ZodEnum<["started", "queued", "interrupted", "injected"]>;
214
239
  /** queued 时的队列位置(从 1 起)。 */
@@ -216,14 +241,14 @@ export declare const SessionSendAck: z.ZodObject<{
216
241
  }, "strip", z.ZodTypeAny, {
217
242
  sessionId: string & z.BRAND<"SessionId">;
218
243
  turnId: string;
219
- accepted: true;
220
244
  disposition: "started" | "queued" | "interrupted" | "injected";
245
+ accepted: true;
221
246
  queuePosition?: number | undefined;
222
247
  }, {
223
248
  sessionId: string;
224
249
  turnId: string;
225
- accepted: true;
226
250
  disposition: "started" | "queued" | "interrupted" | "injected";
251
+ accepted: true;
227
252
  queuePosition?: number | undefined;
228
253
  }>;
229
254
  export type SessionSendAck = z.infer<typeof SessionSendAck>;
@@ -240,18 +265,84 @@ export declare const SessionInterruptParams: z.ZodObject<{
240
265
  }>;
241
266
  export type SessionInterruptParams = z.infer<typeof SessionInterruptParams>;
242
267
  export declare const SessionInterruptResult: z.ZodObject<{
268
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
269
+ version: z.ZodLiteral<1>;
270
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
271
+ turnId: z.ZodOptional<z.ZodString>;
272
+ nodeId: z.ZodOptional<z.ZodString>;
273
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
274
+ observedAt: z.ZodString;
275
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
276
+ reasonCode: z.ZodOptional<z.ZodString>;
277
+ }, "strict", z.ZodTypeAny, {
278
+ sessionId: string & z.BRAND<"SessionId">;
279
+ version: 1;
280
+ state: "unknown" | "pending" | "confirmed";
281
+ observedAt: string;
282
+ turnId?: string | undefined;
283
+ nodeId?: string | undefined;
284
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
285
+ reasonCode?: string | undefined;
286
+ }, {
287
+ sessionId: string;
288
+ version: 1;
289
+ state: "unknown" | "pending" | "confirmed";
290
+ observedAt: string;
291
+ turnId?: string | undefined;
292
+ nodeId?: string | undefined;
293
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
294
+ reasonCode?: string | undefined;
295
+ }>, {
296
+ sessionId: string & z.BRAND<"SessionId">;
297
+ version: 1;
298
+ state: "unknown" | "pending" | "confirmed";
299
+ observedAt: string;
300
+ turnId?: string | undefined;
301
+ nodeId?: string | undefined;
302
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
303
+ reasonCode?: string | undefined;
304
+ }, {
305
+ sessionId: string;
306
+ version: 1;
307
+ state: "unknown" | "pending" | "confirmed";
308
+ observedAt: string;
309
+ turnId?: string | undefined;
310
+ nodeId?: string | undefined;
311
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
312
+ reasonCode?: string | undefined;
313
+ }>>;
243
314
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
244
315
  /** 被中断的 turn(若当时有在跑的)。 */
245
316
  interruptedTurnId: z.ZodOptional<z.ZodString>;
246
317
  /** 中断后 session 状态(通常回到 active 空闲)。 */
247
318
  status: z.ZodEnum<["idle", "running", "paused", "terminated"]>;
248
319
  }, "strip", z.ZodTypeAny, {
249
- status: "idle" | "running" | "paused" | "terminated";
320
+ status: "running" | "idle" | "paused" | "terminated";
250
321
  sessionId: string & z.BRAND<"SessionId">;
322
+ nativeStop?: {
323
+ sessionId: string & z.BRAND<"SessionId">;
324
+ version: 1;
325
+ state: "unknown" | "pending" | "confirmed";
326
+ observedAt: string;
327
+ turnId?: string | undefined;
328
+ nodeId?: string | undefined;
329
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
330
+ reasonCode?: string | undefined;
331
+ } | undefined;
251
332
  interruptedTurnId?: string | undefined;
252
333
  }, {
253
- status: "idle" | "running" | "paused" | "terminated";
334
+ status: "running" | "idle" | "paused" | "terminated";
254
335
  sessionId: string;
336
+ nativeStop?: {
337
+ sessionId: string;
338
+ version: 1;
339
+ state: "unknown" | "pending" | "confirmed";
340
+ observedAt: string;
341
+ turnId?: string | undefined;
342
+ nodeId?: string | undefined;
343
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
344
+ reasonCode?: string | undefined;
345
+ } | undefined;
255
346
  interruptedTurnId?: string | undefined;
256
347
  }>;
257
348
  export type SessionInterruptResult = z.infer<typeof SessionInterruptResult>;
@@ -296,6 +387,8 @@ export declare const CompressMode: z.ZodEnum<["native", "custom"]>;
296
387
  export type CompressMode = z.infer<typeof CompressMode>;
297
388
  export declare const SessionCompressParams: z.ZodObject<{
298
389
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
390
+ clientRequestId: z.ZodOptional<z.ZodString>;
391
+ background: z.ZodOptional<z.ZodBoolean>;
299
392
  /** native = 透传 agent 原生压缩;custom = phonon 自有压缩引擎。 */
300
393
  mode: z.ZodEnum<["native", "custom"]>;
301
394
  /**
@@ -308,35 +401,80 @@ export declare const SessionCompressParams: z.ZodObject<{
308
401
  }, "strip", z.ZodTypeAny, {
309
402
  sessionId: string & z.BRAND<"SessionId">;
310
403
  mode: "custom" | "native";
404
+ clientRequestId?: string | undefined;
405
+ background?: boolean | undefined;
311
406
  strategy?: string | undefined;
312
407
  keepRecentToolCalls?: number | undefined;
313
408
  }, {
314
409
  sessionId: string;
315
410
  mode: "custom" | "native";
411
+ clientRequestId?: string | undefined;
412
+ background?: boolean | undefined;
316
413
  strategy?: string | undefined;
317
414
  keepRecentToolCalls?: number | undefined;
318
415
  }>;
319
416
  export type SessionCompressParams = z.infer<typeof SessionCompressParams>;
320
417
  export declare const SessionCompressResult: z.ZodObject<{
418
+ operationId: z.ZodOptional<z.ZodString>;
419
+ requestHash: z.ZodOptional<z.ZodString>;
420
+ state: z.ZodOptional<z.ZodEnum<["running", "succeeded", "noop", "failed", "unknown"]>>;
421
+ agent: z.ZodOptional<z.ZodString>;
422
+ model: z.ZodOptional<z.ZodString>;
423
+ project: z.ZodOptional<z.ZodString>;
424
+ errorCode: z.ZodOptional<z.ZodOptional<z.ZodString>>;
425
+ tokensBefore: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
426
+ tokensAfter: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
427
+ filesChanged: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
428
+ recordsChanged: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
429
+ blocksRemoved: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
430
+ bytesBefore: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
431
+ bytesAfter: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
432
+ createdAt: z.ZodOptional<z.ZodString>;
433
+ updatedAt: z.ZodOptional<z.ZodString>;
434
+ } & {
321
435
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
322
436
  mode: z.ZodEnum<["native", "custom"]>;
323
- /** 压缩前后的 token 估算(若可得)。 */
324
- tokensBefore: z.ZodOptional<z.ZodNumber>;
325
- tokensAfter: z.ZodOptional<z.ZodNumber>;
326
- /** 简短摘要/说明。 */
327
437
  summary: z.ZodOptional<z.ZodString>;
328
438
  }, "strip", z.ZodTypeAny, {
329
439
  sessionId: string & z.BRAND<"SessionId">;
330
440
  mode: "custom" | "native";
441
+ agent?: string | undefined;
442
+ operationId?: string | undefined;
443
+ requestHash?: string | undefined;
444
+ state?: "unknown" | "running" | "succeeded" | "noop" | "failed" | undefined;
445
+ model?: string | undefined;
446
+ project?: string | undefined;
447
+ summary?: string | undefined;
448
+ errorCode?: string | undefined;
331
449
  tokensBefore?: number | undefined;
332
450
  tokensAfter?: number | undefined;
333
- summary?: string | undefined;
451
+ filesChanged?: number | undefined;
452
+ recordsChanged?: number | undefined;
453
+ blocksRemoved?: number | undefined;
454
+ bytesBefore?: number | undefined;
455
+ bytesAfter?: number | undefined;
456
+ createdAt?: string | undefined;
457
+ updatedAt?: string | undefined;
334
458
  }, {
335
459
  sessionId: string;
336
460
  mode: "custom" | "native";
461
+ agent?: string | undefined;
462
+ operationId?: string | undefined;
463
+ requestHash?: string | undefined;
464
+ state?: "unknown" | "running" | "succeeded" | "noop" | "failed" | undefined;
465
+ model?: string | undefined;
466
+ project?: string | undefined;
467
+ summary?: string | undefined;
468
+ errorCode?: string | undefined;
337
469
  tokensBefore?: number | undefined;
338
470
  tokensAfter?: number | undefined;
339
- summary?: string | undefined;
471
+ filesChanged?: number | undefined;
472
+ recordsChanged?: number | undefined;
473
+ blocksRemoved?: number | undefined;
474
+ bytesBefore?: number | undefined;
475
+ bytesAfter?: number | undefined;
476
+ createdAt?: string | undefined;
477
+ updatedAt?: string | undefined;
340
478
  }>;
341
479
  export type SessionCompressResult = z.infer<typeof SessionCompressResult>;
342
480
  export declare const SessionTerminateParams: z.ZodObject<{
@@ -418,9 +556,202 @@ export declare const SessionSwitchModelResult: z.ZodObject<{
418
556
  }>;
419
557
  export type SessionSwitchModelResult = z.infer<typeof SessionSwitchModelResult>;
420
558
  export declare const SessionMeta: z.ZodObject<{
559
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
560
+ version: z.ZodLiteral<1>;
561
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
562
+ turnId: z.ZodOptional<z.ZodString>;
563
+ nodeId: z.ZodOptional<z.ZodString>;
564
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
565
+ observedAt: z.ZodString;
566
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
567
+ reasonCode: z.ZodOptional<z.ZodString>;
568
+ }, "strict", z.ZodTypeAny, {
569
+ sessionId: string & z.BRAND<"SessionId">;
570
+ version: 1;
571
+ state: "unknown" | "pending" | "confirmed";
572
+ observedAt: string;
573
+ turnId?: string | undefined;
574
+ nodeId?: string | undefined;
575
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
576
+ reasonCode?: string | undefined;
577
+ }, {
578
+ sessionId: string;
579
+ version: 1;
580
+ state: "unknown" | "pending" | "confirmed";
581
+ observedAt: string;
582
+ turnId?: string | undefined;
583
+ nodeId?: string | undefined;
584
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
585
+ reasonCode?: string | undefined;
586
+ }>, {
587
+ sessionId: string & z.BRAND<"SessionId">;
588
+ version: 1;
589
+ state: "unknown" | "pending" | "confirmed";
590
+ observedAt: string;
591
+ turnId?: string | undefined;
592
+ nodeId?: string | undefined;
593
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
594
+ reasonCode?: string | undefined;
595
+ }, {
596
+ sessionId: string;
597
+ version: 1;
598
+ state: "unknown" | "pending" | "confirmed";
599
+ observedAt: string;
600
+ turnId?: string | undefined;
601
+ nodeId?: string | undefined;
602
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
603
+ reasonCode?: string | undefined;
604
+ }>>;
605
+ recovery: z.ZodOptional<z.ZodObject<{
606
+ detached: z.ZodBoolean;
607
+ canAttempt: z.ZodBoolean;
608
+ reason: z.ZodOptional<z.ZodString>;
609
+ }, "strict", z.ZodTypeAny, {
610
+ detached: boolean;
611
+ canAttempt: boolean;
612
+ reason?: string | undefined;
613
+ }, {
614
+ detached: boolean;
615
+ canAttempt: boolean;
616
+ reason?: string | undefined;
617
+ }>>;
618
+ streamNextSeq: z.ZodOptional<z.ZodNumber>;
619
+ proactive: z.ZodOptional<z.ZodObject<{
620
+ supported: z.ZodBoolean;
621
+ ready: z.ZodBoolean;
622
+ errorCode: z.ZodOptional<z.ZodString>;
623
+ }, "strict", z.ZodTypeAny, {
624
+ supported: boolean;
625
+ ready: boolean;
626
+ errorCode?: string | undefined;
627
+ }, {
628
+ supported: boolean;
629
+ ready: boolean;
630
+ errorCode?: string | undefined;
631
+ }>>;
632
+ compression: z.ZodOptional<z.ZodObject<{
633
+ native: z.ZodBoolean;
634
+ custom: z.ZodBoolean;
635
+ blocked: z.ZodBoolean;
636
+ operation: z.ZodOptional<z.ZodObject<{
637
+ operationId: z.ZodString;
638
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
639
+ requestHash: z.ZodString;
640
+ state: z.ZodEnum<["running", "succeeded", "noop", "failed", "unknown"]>;
641
+ mode: z.ZodEnum<["native", "custom"]>;
642
+ agent: z.ZodString;
643
+ model: z.ZodString;
644
+ project: z.ZodString;
645
+ summary: z.ZodOptional<z.ZodString>;
646
+ errorCode: z.ZodOptional<z.ZodString>;
647
+ tokensBefore: z.ZodOptional<z.ZodNumber>;
648
+ tokensAfter: z.ZodOptional<z.ZodNumber>;
649
+ filesChanged: z.ZodOptional<z.ZodNumber>;
650
+ recordsChanged: z.ZodOptional<z.ZodNumber>;
651
+ blocksRemoved: z.ZodOptional<z.ZodNumber>;
652
+ bytesBefore: z.ZodOptional<z.ZodNumber>;
653
+ bytesAfter: z.ZodOptional<z.ZodNumber>;
654
+ createdAt: z.ZodString;
655
+ updatedAt: z.ZodString;
656
+ }, "strip", z.ZodTypeAny, {
657
+ sessionId: string & z.BRAND<"SessionId">;
658
+ agent: string;
659
+ operationId: string;
660
+ requestHash: string;
661
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
662
+ mode: "custom" | "native";
663
+ model: string;
664
+ project: string;
665
+ createdAt: string;
666
+ updatedAt: string;
667
+ summary?: string | undefined;
668
+ errorCode?: string | undefined;
669
+ tokensBefore?: number | undefined;
670
+ tokensAfter?: number | undefined;
671
+ filesChanged?: number | undefined;
672
+ recordsChanged?: number | undefined;
673
+ blocksRemoved?: number | undefined;
674
+ bytesBefore?: number | undefined;
675
+ bytesAfter?: number | undefined;
676
+ }, {
677
+ sessionId: string;
678
+ agent: string;
679
+ operationId: string;
680
+ requestHash: string;
681
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
682
+ mode: "custom" | "native";
683
+ model: string;
684
+ project: string;
685
+ createdAt: string;
686
+ updatedAt: string;
687
+ summary?: string | undefined;
688
+ errorCode?: string | undefined;
689
+ tokensBefore?: number | undefined;
690
+ tokensAfter?: number | undefined;
691
+ filesChanged?: number | undefined;
692
+ recordsChanged?: number | undefined;
693
+ blocksRemoved?: number | undefined;
694
+ bytesBefore?: number | undefined;
695
+ bytesAfter?: number | undefined;
696
+ }>>;
697
+ }, "strip", z.ZodTypeAny, {
698
+ custom: boolean;
699
+ native: boolean;
700
+ blocked: boolean;
701
+ operation?: {
702
+ sessionId: string & z.BRAND<"SessionId">;
703
+ agent: string;
704
+ operationId: string;
705
+ requestHash: string;
706
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
707
+ mode: "custom" | "native";
708
+ model: string;
709
+ project: string;
710
+ createdAt: string;
711
+ updatedAt: string;
712
+ summary?: string | undefined;
713
+ errorCode?: string | undefined;
714
+ tokensBefore?: number | undefined;
715
+ tokensAfter?: number | undefined;
716
+ filesChanged?: number | undefined;
717
+ recordsChanged?: number | undefined;
718
+ blocksRemoved?: number | undefined;
719
+ bytesBefore?: number | undefined;
720
+ bytesAfter?: number | undefined;
721
+ } | undefined;
722
+ }, {
723
+ custom: boolean;
724
+ native: boolean;
725
+ blocked: boolean;
726
+ operation?: {
727
+ sessionId: string;
728
+ agent: string;
729
+ operationId: string;
730
+ requestHash: string;
731
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
732
+ mode: "custom" | "native";
733
+ model: string;
734
+ project: string;
735
+ createdAt: string;
736
+ updatedAt: string;
737
+ summary?: string | undefined;
738
+ errorCode?: string | undefined;
739
+ tokensBefore?: number | undefined;
740
+ tokensAfter?: number | undefined;
741
+ filesChanged?: number | undefined;
742
+ recordsChanged?: number | undefined;
743
+ blocksRemoved?: number | undefined;
744
+ bytesBefore?: number | undefined;
745
+ bytesAfter?: number | undefined;
746
+ } | undefined;
747
+ }>>;
748
+ employeeId: z.ZodOptional<z.ZodString>;
749
+ employeeRevision: z.ZodOptional<z.ZodNumber>;
421
750
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
422
751
  /** 绑定的项目(一等身份,D23)。 */
423
752
  project: z.ZodBranded<z.ZodString, "ProjectId">;
753
+ /** Original worktree binding, retained through status/list/recover parsing. */
754
+ worktreeId: z.ZodOptional<z.ZodString>;
424
755
  /** 绑定的 agent 身份,全程携带。 */
425
756
  agent: z.ZodBranded<z.ZodString, "AgentId">;
426
757
  model: z.ZodString;
@@ -459,39 +790,139 @@ export declare const SessionMeta: z.ZodObject<{
459
790
  /** phonon 自存的会话快照 JSONL 路径(可观测/审计;device 本地路径)。 */
460
791
  transcriptPath: z.ZodOptional<z.ZodString>;
461
792
  }, "strip", z.ZodTypeAny, {
462
- status: "idle" | "running" | "paused" | "terminated";
793
+ status: "running" | "idle" | "paused" | "terminated";
463
794
  sessionId: string & z.BRAND<"SessionId">;
464
795
  agent: string & z.BRAND<"AgentId">;
465
- project: string & z.BRAND<"ProjectId">;
466
796
  model: string;
467
- verbosity: "final" | "messages" | "tools" | "trace";
797
+ project: string & z.BRAND<"ProjectId">;
468
798
  createdAt: string;
799
+ verbosity: "final" | "messages" | "tools" | "trace";
800
+ recovery?: {
801
+ detached: boolean;
802
+ canAttempt: boolean;
803
+ reason?: string | undefined;
804
+ } | undefined;
805
+ worktreeId?: string | undefined;
469
806
  clientTag?: string | undefined;
807
+ nativeStop?: {
808
+ sessionId: string & z.BRAND<"SessionId">;
809
+ version: 1;
810
+ state: "unknown" | "pending" | "confirmed";
811
+ observedAt: string;
812
+ turnId?: string | undefined;
813
+ nodeId?: string | undefined;
814
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
815
+ reasonCode?: string | undefined;
816
+ } | undefined;
470
817
  context?: {
471
818
  contextWindow?: number | undefined;
472
819
  usedTokens?: number | undefined;
473
820
  usagePercent?: number | undefined;
474
821
  compactions?: number | undefined;
475
822
  } | undefined;
823
+ streamNextSeq?: number | undefined;
824
+ proactive?: {
825
+ supported: boolean;
826
+ ready: boolean;
827
+ errorCode?: string | undefined;
828
+ } | undefined;
829
+ compression?: {
830
+ custom: boolean;
831
+ native: boolean;
832
+ blocked: boolean;
833
+ operation?: {
834
+ sessionId: string & z.BRAND<"SessionId">;
835
+ agent: string;
836
+ operationId: string;
837
+ requestHash: string;
838
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
839
+ mode: "custom" | "native";
840
+ model: string;
841
+ project: string;
842
+ createdAt: string;
843
+ updatedAt: string;
844
+ summary?: string | undefined;
845
+ errorCode?: string | undefined;
846
+ tokensBefore?: number | undefined;
847
+ tokensAfter?: number | undefined;
848
+ filesChanged?: number | undefined;
849
+ recordsChanged?: number | undefined;
850
+ blocksRemoved?: number | undefined;
851
+ bytesBefore?: number | undefined;
852
+ bytesAfter?: number | undefined;
853
+ } | undefined;
854
+ } | undefined;
855
+ employeeId?: string | undefined;
856
+ employeeRevision?: number | undefined;
476
857
  currentTurnId?: string | undefined;
477
858
  queuedCount?: number | undefined;
478
859
  lastActiveAt?: string | undefined;
479
860
  transcriptPath?: string | undefined;
480
861
  }, {
481
- status: "idle" | "running" | "paused" | "terminated";
862
+ status: "running" | "idle" | "paused" | "terminated";
482
863
  sessionId: string;
483
864
  agent: string;
484
- project: string;
485
865
  model: string;
486
- verbosity: "final" | "messages" | "tools" | "trace";
866
+ project: string;
487
867
  createdAt: string;
868
+ verbosity: "final" | "messages" | "tools" | "trace";
869
+ recovery?: {
870
+ detached: boolean;
871
+ canAttempt: boolean;
872
+ reason?: string | undefined;
873
+ } | undefined;
874
+ worktreeId?: string | undefined;
488
875
  clientTag?: string | undefined;
876
+ nativeStop?: {
877
+ sessionId: string;
878
+ version: 1;
879
+ state: "unknown" | "pending" | "confirmed";
880
+ observedAt: string;
881
+ turnId?: string | undefined;
882
+ nodeId?: string | undefined;
883
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
884
+ reasonCode?: string | undefined;
885
+ } | undefined;
489
886
  context?: {
490
887
  contextWindow?: number | undefined;
491
888
  usedTokens?: number | undefined;
492
889
  usagePercent?: number | undefined;
493
890
  compactions?: number | undefined;
494
891
  } | undefined;
892
+ streamNextSeq?: number | undefined;
893
+ proactive?: {
894
+ supported: boolean;
895
+ ready: boolean;
896
+ errorCode?: string | undefined;
897
+ } | undefined;
898
+ compression?: {
899
+ custom: boolean;
900
+ native: boolean;
901
+ blocked: boolean;
902
+ operation?: {
903
+ sessionId: string;
904
+ agent: string;
905
+ operationId: string;
906
+ requestHash: string;
907
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
908
+ mode: "custom" | "native";
909
+ model: string;
910
+ project: string;
911
+ createdAt: string;
912
+ updatedAt: string;
913
+ summary?: string | undefined;
914
+ errorCode?: string | undefined;
915
+ tokensBefore?: number | undefined;
916
+ tokensAfter?: number | undefined;
917
+ filesChanged?: number | undefined;
918
+ recordsChanged?: number | undefined;
919
+ blocksRemoved?: number | undefined;
920
+ bytesBefore?: number | undefined;
921
+ bytesAfter?: number | undefined;
922
+ } | undefined;
923
+ } | undefined;
924
+ employeeId?: string | undefined;
925
+ employeeRevision?: number | undefined;
495
926
  currentTurnId?: string | undefined;
496
927
  queuedCount?: number | undefined;
497
928
  lastActiveAt?: string | undefined;
@@ -507,9 +938,202 @@ export declare const SessionStatusParams: z.ZodObject<{
507
938
  }>;
508
939
  export type SessionStatusParams = z.infer<typeof SessionStatusParams>;
509
940
  export declare const SessionStatusResult: z.ZodObject<{
941
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
942
+ version: z.ZodLiteral<1>;
943
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
944
+ turnId: z.ZodOptional<z.ZodString>;
945
+ nodeId: z.ZodOptional<z.ZodString>;
946
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
947
+ observedAt: z.ZodString;
948
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
949
+ reasonCode: z.ZodOptional<z.ZodString>;
950
+ }, "strict", z.ZodTypeAny, {
951
+ sessionId: string & z.BRAND<"SessionId">;
952
+ version: 1;
953
+ state: "unknown" | "pending" | "confirmed";
954
+ observedAt: string;
955
+ turnId?: string | undefined;
956
+ nodeId?: string | undefined;
957
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
958
+ reasonCode?: string | undefined;
959
+ }, {
960
+ sessionId: string;
961
+ version: 1;
962
+ state: "unknown" | "pending" | "confirmed";
963
+ observedAt: string;
964
+ turnId?: string | undefined;
965
+ nodeId?: string | undefined;
966
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
967
+ reasonCode?: string | undefined;
968
+ }>, {
969
+ sessionId: string & z.BRAND<"SessionId">;
970
+ version: 1;
971
+ state: "unknown" | "pending" | "confirmed";
972
+ observedAt: string;
973
+ turnId?: string | undefined;
974
+ nodeId?: string | undefined;
975
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
976
+ reasonCode?: string | undefined;
977
+ }, {
978
+ sessionId: string;
979
+ version: 1;
980
+ state: "unknown" | "pending" | "confirmed";
981
+ observedAt: string;
982
+ turnId?: string | undefined;
983
+ nodeId?: string | undefined;
984
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
985
+ reasonCode?: string | undefined;
986
+ }>>;
987
+ recovery: z.ZodOptional<z.ZodObject<{
988
+ detached: z.ZodBoolean;
989
+ canAttempt: z.ZodBoolean;
990
+ reason: z.ZodOptional<z.ZodString>;
991
+ }, "strict", z.ZodTypeAny, {
992
+ detached: boolean;
993
+ canAttempt: boolean;
994
+ reason?: string | undefined;
995
+ }, {
996
+ detached: boolean;
997
+ canAttempt: boolean;
998
+ reason?: string | undefined;
999
+ }>>;
1000
+ streamNextSeq: z.ZodOptional<z.ZodNumber>;
1001
+ proactive: z.ZodOptional<z.ZodObject<{
1002
+ supported: z.ZodBoolean;
1003
+ ready: z.ZodBoolean;
1004
+ errorCode: z.ZodOptional<z.ZodString>;
1005
+ }, "strict", z.ZodTypeAny, {
1006
+ supported: boolean;
1007
+ ready: boolean;
1008
+ errorCode?: string | undefined;
1009
+ }, {
1010
+ supported: boolean;
1011
+ ready: boolean;
1012
+ errorCode?: string | undefined;
1013
+ }>>;
1014
+ compression: z.ZodOptional<z.ZodObject<{
1015
+ native: z.ZodBoolean;
1016
+ custom: z.ZodBoolean;
1017
+ blocked: z.ZodBoolean;
1018
+ operation: z.ZodOptional<z.ZodObject<{
1019
+ operationId: z.ZodString;
1020
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1021
+ requestHash: z.ZodString;
1022
+ state: z.ZodEnum<["running", "succeeded", "noop", "failed", "unknown"]>;
1023
+ mode: z.ZodEnum<["native", "custom"]>;
1024
+ agent: z.ZodString;
1025
+ model: z.ZodString;
1026
+ project: z.ZodString;
1027
+ summary: z.ZodOptional<z.ZodString>;
1028
+ errorCode: z.ZodOptional<z.ZodString>;
1029
+ tokensBefore: z.ZodOptional<z.ZodNumber>;
1030
+ tokensAfter: z.ZodOptional<z.ZodNumber>;
1031
+ filesChanged: z.ZodOptional<z.ZodNumber>;
1032
+ recordsChanged: z.ZodOptional<z.ZodNumber>;
1033
+ blocksRemoved: z.ZodOptional<z.ZodNumber>;
1034
+ bytesBefore: z.ZodOptional<z.ZodNumber>;
1035
+ bytesAfter: z.ZodOptional<z.ZodNumber>;
1036
+ createdAt: z.ZodString;
1037
+ updatedAt: z.ZodString;
1038
+ }, "strip", z.ZodTypeAny, {
1039
+ sessionId: string & z.BRAND<"SessionId">;
1040
+ agent: string;
1041
+ operationId: string;
1042
+ requestHash: string;
1043
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1044
+ mode: "custom" | "native";
1045
+ model: string;
1046
+ project: string;
1047
+ createdAt: string;
1048
+ updatedAt: string;
1049
+ summary?: string | undefined;
1050
+ errorCode?: string | undefined;
1051
+ tokensBefore?: number | undefined;
1052
+ tokensAfter?: number | undefined;
1053
+ filesChanged?: number | undefined;
1054
+ recordsChanged?: number | undefined;
1055
+ blocksRemoved?: number | undefined;
1056
+ bytesBefore?: number | undefined;
1057
+ bytesAfter?: number | undefined;
1058
+ }, {
1059
+ sessionId: string;
1060
+ agent: string;
1061
+ operationId: string;
1062
+ requestHash: string;
1063
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1064
+ mode: "custom" | "native";
1065
+ model: string;
1066
+ project: string;
1067
+ createdAt: string;
1068
+ updatedAt: string;
1069
+ summary?: string | undefined;
1070
+ errorCode?: string | undefined;
1071
+ tokensBefore?: number | undefined;
1072
+ tokensAfter?: number | undefined;
1073
+ filesChanged?: number | undefined;
1074
+ recordsChanged?: number | undefined;
1075
+ blocksRemoved?: number | undefined;
1076
+ bytesBefore?: number | undefined;
1077
+ bytesAfter?: number | undefined;
1078
+ }>>;
1079
+ }, "strip", z.ZodTypeAny, {
1080
+ custom: boolean;
1081
+ native: boolean;
1082
+ blocked: boolean;
1083
+ operation?: {
1084
+ sessionId: string & z.BRAND<"SessionId">;
1085
+ agent: string;
1086
+ operationId: string;
1087
+ requestHash: string;
1088
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1089
+ mode: "custom" | "native";
1090
+ model: string;
1091
+ project: string;
1092
+ createdAt: string;
1093
+ updatedAt: string;
1094
+ summary?: string | undefined;
1095
+ errorCode?: string | undefined;
1096
+ tokensBefore?: number | undefined;
1097
+ tokensAfter?: number | undefined;
1098
+ filesChanged?: number | undefined;
1099
+ recordsChanged?: number | undefined;
1100
+ blocksRemoved?: number | undefined;
1101
+ bytesBefore?: number | undefined;
1102
+ bytesAfter?: number | undefined;
1103
+ } | undefined;
1104
+ }, {
1105
+ custom: boolean;
1106
+ native: boolean;
1107
+ blocked: boolean;
1108
+ operation?: {
1109
+ sessionId: string;
1110
+ agent: string;
1111
+ operationId: string;
1112
+ requestHash: string;
1113
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1114
+ mode: "custom" | "native";
1115
+ model: string;
1116
+ project: string;
1117
+ createdAt: string;
1118
+ updatedAt: string;
1119
+ summary?: string | undefined;
1120
+ errorCode?: string | undefined;
1121
+ tokensBefore?: number | undefined;
1122
+ tokensAfter?: number | undefined;
1123
+ filesChanged?: number | undefined;
1124
+ recordsChanged?: number | undefined;
1125
+ blocksRemoved?: number | undefined;
1126
+ bytesBefore?: number | undefined;
1127
+ bytesAfter?: number | undefined;
1128
+ } | undefined;
1129
+ }>>;
1130
+ employeeId: z.ZodOptional<z.ZodString>;
1131
+ employeeRevision: z.ZodOptional<z.ZodNumber>;
510
1132
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
511
1133
  /** 绑定的项目(一等身份,D23)。 */
512
1134
  project: z.ZodBranded<z.ZodString, "ProjectId">;
1135
+ /** Original worktree binding, retained through status/list/recover parsing. */
1136
+ worktreeId: z.ZodOptional<z.ZodString>;
513
1137
  /** 绑定的 agent 身份,全程携带。 */
514
1138
  agent: z.ZodBranded<z.ZodString, "AgentId">;
515
1139
  model: z.ZodString;
@@ -548,45 +1172,537 @@ export declare const SessionStatusResult: z.ZodObject<{
548
1172
  /** phonon 自存的会话快照 JSONL 路径(可观测/审计;device 本地路径)。 */
549
1173
  transcriptPath: z.ZodOptional<z.ZodString>;
550
1174
  }, "strip", z.ZodTypeAny, {
551
- status: "idle" | "running" | "paused" | "terminated";
1175
+ status: "running" | "idle" | "paused" | "terminated";
552
1176
  sessionId: string & z.BRAND<"SessionId">;
553
1177
  agent: string & z.BRAND<"AgentId">;
554
- project: string & z.BRAND<"ProjectId">;
555
1178
  model: string;
1179
+ project: string & z.BRAND<"ProjectId">;
1180
+ createdAt: string;
556
1181
  verbosity: "final" | "messages" | "tools" | "trace";
1182
+ recovery?: {
1183
+ detached: boolean;
1184
+ canAttempt: boolean;
1185
+ reason?: string | undefined;
1186
+ } | undefined;
1187
+ worktreeId?: string | undefined;
1188
+ clientTag?: string | undefined;
1189
+ nativeStop?: {
1190
+ sessionId: string & z.BRAND<"SessionId">;
1191
+ version: 1;
1192
+ state: "unknown" | "pending" | "confirmed";
1193
+ observedAt: string;
1194
+ turnId?: string | undefined;
1195
+ nodeId?: string | undefined;
1196
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1197
+ reasonCode?: string | undefined;
1198
+ } | undefined;
1199
+ context?: {
1200
+ contextWindow?: number | undefined;
1201
+ usedTokens?: number | undefined;
1202
+ usagePercent?: number | undefined;
1203
+ compactions?: number | undefined;
1204
+ } | undefined;
1205
+ streamNextSeq?: number | undefined;
1206
+ proactive?: {
1207
+ supported: boolean;
1208
+ ready: boolean;
1209
+ errorCode?: string | undefined;
1210
+ } | undefined;
1211
+ compression?: {
1212
+ custom: boolean;
1213
+ native: boolean;
1214
+ blocked: boolean;
1215
+ operation?: {
1216
+ sessionId: string & z.BRAND<"SessionId">;
1217
+ agent: string;
1218
+ operationId: string;
1219
+ requestHash: string;
1220
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1221
+ mode: "custom" | "native";
1222
+ model: string;
1223
+ project: string;
1224
+ createdAt: string;
1225
+ updatedAt: string;
1226
+ summary?: string | undefined;
1227
+ errorCode?: string | undefined;
1228
+ tokensBefore?: number | undefined;
1229
+ tokensAfter?: number | undefined;
1230
+ filesChanged?: number | undefined;
1231
+ recordsChanged?: number | undefined;
1232
+ blocksRemoved?: number | undefined;
1233
+ bytesBefore?: number | undefined;
1234
+ bytesAfter?: number | undefined;
1235
+ } | undefined;
1236
+ } | undefined;
1237
+ employeeId?: string | undefined;
1238
+ employeeRevision?: number | undefined;
1239
+ currentTurnId?: string | undefined;
1240
+ queuedCount?: number | undefined;
1241
+ lastActiveAt?: string | undefined;
1242
+ transcriptPath?: string | undefined;
1243
+ }, {
1244
+ status: "running" | "idle" | "paused" | "terminated";
1245
+ sessionId: string;
1246
+ agent: string;
1247
+ model: string;
1248
+ project: string;
557
1249
  createdAt: string;
1250
+ verbosity: "final" | "messages" | "tools" | "trace";
1251
+ recovery?: {
1252
+ detached: boolean;
1253
+ canAttempt: boolean;
1254
+ reason?: string | undefined;
1255
+ } | undefined;
1256
+ worktreeId?: string | undefined;
558
1257
  clientTag?: string | undefined;
1258
+ nativeStop?: {
1259
+ sessionId: string;
1260
+ version: 1;
1261
+ state: "unknown" | "pending" | "confirmed";
1262
+ observedAt: string;
1263
+ turnId?: string | undefined;
1264
+ nodeId?: string | undefined;
1265
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1266
+ reasonCode?: string | undefined;
1267
+ } | undefined;
559
1268
  context?: {
560
1269
  contextWindow?: number | undefined;
561
1270
  usedTokens?: number | undefined;
562
1271
  usagePercent?: number | undefined;
563
1272
  compactions?: number | undefined;
564
1273
  } | undefined;
1274
+ streamNextSeq?: number | undefined;
1275
+ proactive?: {
1276
+ supported: boolean;
1277
+ ready: boolean;
1278
+ errorCode?: string | undefined;
1279
+ } | undefined;
1280
+ compression?: {
1281
+ custom: boolean;
1282
+ native: boolean;
1283
+ blocked: boolean;
1284
+ operation?: {
1285
+ sessionId: string;
1286
+ agent: string;
1287
+ operationId: string;
1288
+ requestHash: string;
1289
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1290
+ mode: "custom" | "native";
1291
+ model: string;
1292
+ project: string;
1293
+ createdAt: string;
1294
+ updatedAt: string;
1295
+ summary?: string | undefined;
1296
+ errorCode?: string | undefined;
1297
+ tokensBefore?: number | undefined;
1298
+ tokensAfter?: number | undefined;
1299
+ filesChanged?: number | undefined;
1300
+ recordsChanged?: number | undefined;
1301
+ blocksRemoved?: number | undefined;
1302
+ bytesBefore?: number | undefined;
1303
+ bytesAfter?: number | undefined;
1304
+ } | undefined;
1305
+ } | undefined;
1306
+ employeeId?: string | undefined;
1307
+ employeeRevision?: number | undefined;
565
1308
  currentTurnId?: string | undefined;
566
1309
  queuedCount?: number | undefined;
567
1310
  lastActiveAt?: string | undefined;
568
1311
  transcriptPath?: string | undefined;
1312
+ }>;
1313
+ export type SessionStatusResult = z.infer<typeof SessionStatusResult>;
1314
+ /** Reopen a verified, settled native Session. Never sends input or resumes a workflow. */
1315
+ export declare const SessionRecoverParams: z.ZodObject<{
1316
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1317
+ project: z.ZodBranded<z.ZodString, "ProjectId">;
1318
+ agent: z.ZodBranded<z.ZodString, "AgentId">;
1319
+ model: z.ZodString;
1320
+ }, "strict", z.ZodTypeAny, {
1321
+ sessionId: string & z.BRAND<"SessionId">;
1322
+ agent: string & z.BRAND<"AgentId">;
1323
+ model: string;
1324
+ project: string & z.BRAND<"ProjectId">;
569
1325
  }, {
570
- status: "idle" | "running" | "paused" | "terminated";
571
1326
  sessionId: string;
572
1327
  agent: string;
1328
+ model: string;
573
1329
  project: string;
1330
+ }>;
1331
+ export type SessionRecoverParams = z.infer<typeof SessionRecoverParams>;
1332
+ export declare const SessionRecoverResult: z.ZodObject<{
1333
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1334
+ version: z.ZodLiteral<1>;
1335
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1336
+ turnId: z.ZodOptional<z.ZodString>;
1337
+ nodeId: z.ZodOptional<z.ZodString>;
1338
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
1339
+ observedAt: z.ZodString;
1340
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
1341
+ reasonCode: z.ZodOptional<z.ZodString>;
1342
+ }, "strict", z.ZodTypeAny, {
1343
+ sessionId: string & z.BRAND<"SessionId">;
1344
+ version: 1;
1345
+ state: "unknown" | "pending" | "confirmed";
1346
+ observedAt: string;
1347
+ turnId?: string | undefined;
1348
+ nodeId?: string | undefined;
1349
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1350
+ reasonCode?: string | undefined;
1351
+ }, {
1352
+ sessionId: string;
1353
+ version: 1;
1354
+ state: "unknown" | "pending" | "confirmed";
1355
+ observedAt: string;
1356
+ turnId?: string | undefined;
1357
+ nodeId?: string | undefined;
1358
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1359
+ reasonCode?: string | undefined;
1360
+ }>, {
1361
+ sessionId: string & z.BRAND<"SessionId">;
1362
+ version: 1;
1363
+ state: "unknown" | "pending" | "confirmed";
1364
+ observedAt: string;
1365
+ turnId?: string | undefined;
1366
+ nodeId?: string | undefined;
1367
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1368
+ reasonCode?: string | undefined;
1369
+ }, {
1370
+ sessionId: string;
1371
+ version: 1;
1372
+ state: "unknown" | "pending" | "confirmed";
1373
+ observedAt: string;
1374
+ turnId?: string | undefined;
1375
+ nodeId?: string | undefined;
1376
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1377
+ reasonCode?: string | undefined;
1378
+ }>>;
1379
+ recovery: z.ZodOptional<z.ZodObject<{
1380
+ detached: z.ZodBoolean;
1381
+ canAttempt: z.ZodBoolean;
1382
+ reason: z.ZodOptional<z.ZodString>;
1383
+ }, "strict", z.ZodTypeAny, {
1384
+ detached: boolean;
1385
+ canAttempt: boolean;
1386
+ reason?: string | undefined;
1387
+ }, {
1388
+ detached: boolean;
1389
+ canAttempt: boolean;
1390
+ reason?: string | undefined;
1391
+ }>>;
1392
+ streamNextSeq: z.ZodOptional<z.ZodNumber>;
1393
+ proactive: z.ZodOptional<z.ZodObject<{
1394
+ supported: z.ZodBoolean;
1395
+ ready: z.ZodBoolean;
1396
+ errorCode: z.ZodOptional<z.ZodString>;
1397
+ }, "strict", z.ZodTypeAny, {
1398
+ supported: boolean;
1399
+ ready: boolean;
1400
+ errorCode?: string | undefined;
1401
+ }, {
1402
+ supported: boolean;
1403
+ ready: boolean;
1404
+ errorCode?: string | undefined;
1405
+ }>>;
1406
+ compression: z.ZodOptional<z.ZodObject<{
1407
+ native: z.ZodBoolean;
1408
+ custom: z.ZodBoolean;
1409
+ blocked: z.ZodBoolean;
1410
+ operation: z.ZodOptional<z.ZodObject<{
1411
+ operationId: z.ZodString;
1412
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1413
+ requestHash: z.ZodString;
1414
+ state: z.ZodEnum<["running", "succeeded", "noop", "failed", "unknown"]>;
1415
+ mode: z.ZodEnum<["native", "custom"]>;
1416
+ agent: z.ZodString;
1417
+ model: z.ZodString;
1418
+ project: z.ZodString;
1419
+ summary: z.ZodOptional<z.ZodString>;
1420
+ errorCode: z.ZodOptional<z.ZodString>;
1421
+ tokensBefore: z.ZodOptional<z.ZodNumber>;
1422
+ tokensAfter: z.ZodOptional<z.ZodNumber>;
1423
+ filesChanged: z.ZodOptional<z.ZodNumber>;
1424
+ recordsChanged: z.ZodOptional<z.ZodNumber>;
1425
+ blocksRemoved: z.ZodOptional<z.ZodNumber>;
1426
+ bytesBefore: z.ZodOptional<z.ZodNumber>;
1427
+ bytesAfter: z.ZodOptional<z.ZodNumber>;
1428
+ createdAt: z.ZodString;
1429
+ updatedAt: z.ZodString;
1430
+ }, "strip", z.ZodTypeAny, {
1431
+ sessionId: string & z.BRAND<"SessionId">;
1432
+ agent: string;
1433
+ operationId: string;
1434
+ requestHash: string;
1435
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1436
+ mode: "custom" | "native";
1437
+ model: string;
1438
+ project: string;
1439
+ createdAt: string;
1440
+ updatedAt: string;
1441
+ summary?: string | undefined;
1442
+ errorCode?: string | undefined;
1443
+ tokensBefore?: number | undefined;
1444
+ tokensAfter?: number | undefined;
1445
+ filesChanged?: number | undefined;
1446
+ recordsChanged?: number | undefined;
1447
+ blocksRemoved?: number | undefined;
1448
+ bytesBefore?: number | undefined;
1449
+ bytesAfter?: number | undefined;
1450
+ }, {
1451
+ sessionId: string;
1452
+ agent: string;
1453
+ operationId: string;
1454
+ requestHash: string;
1455
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1456
+ mode: "custom" | "native";
1457
+ model: string;
1458
+ project: string;
1459
+ createdAt: string;
1460
+ updatedAt: string;
1461
+ summary?: string | undefined;
1462
+ errorCode?: string | undefined;
1463
+ tokensBefore?: number | undefined;
1464
+ tokensAfter?: number | undefined;
1465
+ filesChanged?: number | undefined;
1466
+ recordsChanged?: number | undefined;
1467
+ blocksRemoved?: number | undefined;
1468
+ bytesBefore?: number | undefined;
1469
+ bytesAfter?: number | undefined;
1470
+ }>>;
1471
+ }, "strip", z.ZodTypeAny, {
1472
+ custom: boolean;
1473
+ native: boolean;
1474
+ blocked: boolean;
1475
+ operation?: {
1476
+ sessionId: string & z.BRAND<"SessionId">;
1477
+ agent: string;
1478
+ operationId: string;
1479
+ requestHash: string;
1480
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1481
+ mode: "custom" | "native";
1482
+ model: string;
1483
+ project: string;
1484
+ createdAt: string;
1485
+ updatedAt: string;
1486
+ summary?: string | undefined;
1487
+ errorCode?: string | undefined;
1488
+ tokensBefore?: number | undefined;
1489
+ tokensAfter?: number | undefined;
1490
+ filesChanged?: number | undefined;
1491
+ recordsChanged?: number | undefined;
1492
+ blocksRemoved?: number | undefined;
1493
+ bytesBefore?: number | undefined;
1494
+ bytesAfter?: number | undefined;
1495
+ } | undefined;
1496
+ }, {
1497
+ custom: boolean;
1498
+ native: boolean;
1499
+ blocked: boolean;
1500
+ operation?: {
1501
+ sessionId: string;
1502
+ agent: string;
1503
+ operationId: string;
1504
+ requestHash: string;
1505
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1506
+ mode: "custom" | "native";
1507
+ model: string;
1508
+ project: string;
1509
+ createdAt: string;
1510
+ updatedAt: string;
1511
+ summary?: string | undefined;
1512
+ errorCode?: string | undefined;
1513
+ tokensBefore?: number | undefined;
1514
+ tokensAfter?: number | undefined;
1515
+ filesChanged?: number | undefined;
1516
+ recordsChanged?: number | undefined;
1517
+ blocksRemoved?: number | undefined;
1518
+ bytesBefore?: number | undefined;
1519
+ bytesAfter?: number | undefined;
1520
+ } | undefined;
1521
+ }>>;
1522
+ employeeId: z.ZodOptional<z.ZodString>;
1523
+ employeeRevision: z.ZodOptional<z.ZodNumber>;
1524
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1525
+ /** 绑定的项目(一等身份,D23)。 */
1526
+ project: z.ZodBranded<z.ZodString, "ProjectId">;
1527
+ /** Original worktree binding, retained through status/list/recover parsing. */
1528
+ worktreeId: z.ZodOptional<z.ZodString>;
1529
+ /** 绑定的 agent 身份,全程携带。 */
1530
+ agent: z.ZodBranded<z.ZodString, "AgentId">;
1531
+ model: z.ZodString;
1532
+ status: z.ZodEnum<["idle", "running", "paused", "terminated"]>;
1533
+ /** 当 status=running 时,正在执行的 turnId(服务端据此知道「在跑哪一轮」)。 */
1534
+ currentTurnId: z.ZodOptional<z.ZodString>;
1535
+ /** 队列中等待的 send 数(whenBusy=queue 积压,D18)。 */
1536
+ queuedCount: z.ZodOptional<z.ZodNumber>;
1537
+ /**
1538
+ * 上下文信息(D33)——adapter 能提供时填,便于 server 监控上下文压力。
1539
+ */
1540
+ context: z.ZodOptional<z.ZodObject<{
1541
+ /** 上下文窗口总容量(token)。 */
1542
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1543
+ /** 已用上下文(token,若可估)。 */
1544
+ usedTokens: z.ZodOptional<z.ZodNumber>;
1545
+ /** 已用上下文占比 0-100。 */
1546
+ usagePercent: z.ZodOptional<z.ZodNumber>;
1547
+ /** 已发生的压缩次数。 */
1548
+ compactions: z.ZodOptional<z.ZodNumber>;
1549
+ }, "strip", z.ZodTypeAny, {
1550
+ contextWindow?: number | undefined;
1551
+ usedTokens?: number | undefined;
1552
+ usagePercent?: number | undefined;
1553
+ compactions?: number | undefined;
1554
+ }, {
1555
+ contextWindow?: number | undefined;
1556
+ usedTokens?: number | undefined;
1557
+ usagePercent?: number | undefined;
1558
+ compactions?: number | undefined;
1559
+ }>>;
1560
+ verbosity: z.ZodEnum<["final", "messages", "tools", "trace"]>;
1561
+ clientTag: z.ZodOptional<z.ZodString>;
1562
+ createdAt: z.ZodString;
1563
+ lastActiveAt: z.ZodOptional<z.ZodString>;
1564
+ /** phonon 自存的会话快照 JSONL 路径(可观测/审计;device 本地路径)。 */
1565
+ transcriptPath: z.ZodOptional<z.ZodString>;
1566
+ }, "strip", z.ZodTypeAny, {
1567
+ status: "running" | "idle" | "paused" | "terminated";
1568
+ sessionId: string & z.BRAND<"SessionId">;
1569
+ agent: string & z.BRAND<"AgentId">;
574
1570
  model: string;
1571
+ project: string & z.BRAND<"ProjectId">;
1572
+ createdAt: string;
575
1573
  verbosity: "final" | "messages" | "tools" | "trace";
1574
+ recovery?: {
1575
+ detached: boolean;
1576
+ canAttempt: boolean;
1577
+ reason?: string | undefined;
1578
+ } | undefined;
1579
+ worktreeId?: string | undefined;
1580
+ clientTag?: string | undefined;
1581
+ nativeStop?: {
1582
+ sessionId: string & z.BRAND<"SessionId">;
1583
+ version: 1;
1584
+ state: "unknown" | "pending" | "confirmed";
1585
+ observedAt: string;
1586
+ turnId?: string | undefined;
1587
+ nodeId?: string | undefined;
1588
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1589
+ reasonCode?: string | undefined;
1590
+ } | undefined;
1591
+ context?: {
1592
+ contextWindow?: number | undefined;
1593
+ usedTokens?: number | undefined;
1594
+ usagePercent?: number | undefined;
1595
+ compactions?: number | undefined;
1596
+ } | undefined;
1597
+ streamNextSeq?: number | undefined;
1598
+ proactive?: {
1599
+ supported: boolean;
1600
+ ready: boolean;
1601
+ errorCode?: string | undefined;
1602
+ } | undefined;
1603
+ compression?: {
1604
+ custom: boolean;
1605
+ native: boolean;
1606
+ blocked: boolean;
1607
+ operation?: {
1608
+ sessionId: string & z.BRAND<"SessionId">;
1609
+ agent: string;
1610
+ operationId: string;
1611
+ requestHash: string;
1612
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1613
+ mode: "custom" | "native";
1614
+ model: string;
1615
+ project: string;
1616
+ createdAt: string;
1617
+ updatedAt: string;
1618
+ summary?: string | undefined;
1619
+ errorCode?: string | undefined;
1620
+ tokensBefore?: number | undefined;
1621
+ tokensAfter?: number | undefined;
1622
+ filesChanged?: number | undefined;
1623
+ recordsChanged?: number | undefined;
1624
+ blocksRemoved?: number | undefined;
1625
+ bytesBefore?: number | undefined;
1626
+ bytesAfter?: number | undefined;
1627
+ } | undefined;
1628
+ } | undefined;
1629
+ employeeId?: string | undefined;
1630
+ employeeRevision?: number | undefined;
1631
+ currentTurnId?: string | undefined;
1632
+ queuedCount?: number | undefined;
1633
+ lastActiveAt?: string | undefined;
1634
+ transcriptPath?: string | undefined;
1635
+ }, {
1636
+ status: "running" | "idle" | "paused" | "terminated";
1637
+ sessionId: string;
1638
+ agent: string;
1639
+ model: string;
1640
+ project: string;
576
1641
  createdAt: string;
1642
+ verbosity: "final" | "messages" | "tools" | "trace";
1643
+ recovery?: {
1644
+ detached: boolean;
1645
+ canAttempt: boolean;
1646
+ reason?: string | undefined;
1647
+ } | undefined;
1648
+ worktreeId?: string | undefined;
577
1649
  clientTag?: string | undefined;
1650
+ nativeStop?: {
1651
+ sessionId: string;
1652
+ version: 1;
1653
+ state: "unknown" | "pending" | "confirmed";
1654
+ observedAt: string;
1655
+ turnId?: string | undefined;
1656
+ nodeId?: string | undefined;
1657
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1658
+ reasonCode?: string | undefined;
1659
+ } | undefined;
578
1660
  context?: {
579
1661
  contextWindow?: number | undefined;
580
1662
  usedTokens?: number | undefined;
581
1663
  usagePercent?: number | undefined;
582
1664
  compactions?: number | undefined;
583
1665
  } | undefined;
1666
+ streamNextSeq?: number | undefined;
1667
+ proactive?: {
1668
+ supported: boolean;
1669
+ ready: boolean;
1670
+ errorCode?: string | undefined;
1671
+ } | undefined;
1672
+ compression?: {
1673
+ custom: boolean;
1674
+ native: boolean;
1675
+ blocked: boolean;
1676
+ operation?: {
1677
+ sessionId: string;
1678
+ agent: string;
1679
+ operationId: string;
1680
+ requestHash: string;
1681
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1682
+ mode: "custom" | "native";
1683
+ model: string;
1684
+ project: string;
1685
+ createdAt: string;
1686
+ updatedAt: string;
1687
+ summary?: string | undefined;
1688
+ errorCode?: string | undefined;
1689
+ tokensBefore?: number | undefined;
1690
+ tokensAfter?: number | undefined;
1691
+ filesChanged?: number | undefined;
1692
+ recordsChanged?: number | undefined;
1693
+ blocksRemoved?: number | undefined;
1694
+ bytesBefore?: number | undefined;
1695
+ bytesAfter?: number | undefined;
1696
+ } | undefined;
1697
+ } | undefined;
1698
+ employeeId?: string | undefined;
1699
+ employeeRevision?: number | undefined;
584
1700
  currentTurnId?: string | undefined;
585
1701
  queuedCount?: number | undefined;
586
1702
  lastActiveAt?: string | undefined;
587
1703
  transcriptPath?: string | undefined;
588
1704
  }>;
589
- export type SessionStatusResult = z.infer<typeof SessionStatusResult>;
1705
+ export type SessionRecoverResult = z.infer<typeof SessionRecoverResult>;
590
1706
  export declare const SessionListParams: z.ZodObject<{
591
1707
  /** 可选:按项目过滤。 */
592
1708
  project: z.ZodOptional<z.ZodBranded<z.ZodString, "ProjectId">>;
@@ -599,13 +1715,13 @@ export declare const SessionListParams: z.ZodObject<{
599
1715
  /** 可选:分页游标(上一页返回的 nextCursor)。 */
600
1716
  cursor: z.ZodOptional<z.ZodString>;
601
1717
  }, "strip", z.ZodTypeAny, {
602
- status?: "idle" | "running" | "paused" | "terminated" | undefined;
1718
+ status?: "running" | "idle" | "paused" | "terminated" | undefined;
603
1719
  agent?: (string & z.BRAND<"AgentId">) | undefined;
604
1720
  project?: (string & z.BRAND<"ProjectId">) | undefined;
605
1721
  limit?: number | undefined;
606
1722
  cursor?: string | undefined;
607
1723
  }, {
608
- status?: "idle" | "running" | "paused" | "terminated" | undefined;
1724
+ status?: "running" | "idle" | "paused" | "terminated" | undefined;
609
1725
  agent?: string | undefined;
610
1726
  project?: string | undefined;
611
1727
  limit?: number | undefined;
@@ -614,9 +1730,202 @@ export declare const SessionListParams: z.ZodObject<{
614
1730
  export type SessionListParams = z.infer<typeof SessionListParams>;
615
1731
  export declare const SessionListResult: z.ZodObject<{
616
1732
  sessions: z.ZodArray<z.ZodObject<{
1733
+ nativeStop: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1734
+ version: z.ZodLiteral<1>;
1735
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1736
+ turnId: z.ZodOptional<z.ZodString>;
1737
+ nodeId: z.ZodOptional<z.ZodString>;
1738
+ state: z.ZodEnum<["pending", "confirmed", "unknown"]>;
1739
+ observedAt: z.ZodString;
1740
+ confirmation: z.ZodOptional<z.ZodEnum<["not_started", "process_tree_exit", "native_terminal"]>>;
1741
+ reasonCode: z.ZodOptional<z.ZodString>;
1742
+ }, "strict", z.ZodTypeAny, {
1743
+ sessionId: string & z.BRAND<"SessionId">;
1744
+ version: 1;
1745
+ state: "unknown" | "pending" | "confirmed";
1746
+ observedAt: string;
1747
+ turnId?: string | undefined;
1748
+ nodeId?: string | undefined;
1749
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1750
+ reasonCode?: string | undefined;
1751
+ }, {
1752
+ sessionId: string;
1753
+ version: 1;
1754
+ state: "unknown" | "pending" | "confirmed";
1755
+ observedAt: string;
1756
+ turnId?: string | undefined;
1757
+ nodeId?: string | undefined;
1758
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1759
+ reasonCode?: string | undefined;
1760
+ }>, {
1761
+ sessionId: string & z.BRAND<"SessionId">;
1762
+ version: 1;
1763
+ state: "unknown" | "pending" | "confirmed";
1764
+ observedAt: string;
1765
+ turnId?: string | undefined;
1766
+ nodeId?: string | undefined;
1767
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1768
+ reasonCode?: string | undefined;
1769
+ }, {
1770
+ sessionId: string;
1771
+ version: 1;
1772
+ state: "unknown" | "pending" | "confirmed";
1773
+ observedAt: string;
1774
+ turnId?: string | undefined;
1775
+ nodeId?: string | undefined;
1776
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1777
+ reasonCode?: string | undefined;
1778
+ }>>;
1779
+ recovery: z.ZodOptional<z.ZodObject<{
1780
+ detached: z.ZodBoolean;
1781
+ canAttempt: z.ZodBoolean;
1782
+ reason: z.ZodOptional<z.ZodString>;
1783
+ }, "strict", z.ZodTypeAny, {
1784
+ detached: boolean;
1785
+ canAttempt: boolean;
1786
+ reason?: string | undefined;
1787
+ }, {
1788
+ detached: boolean;
1789
+ canAttempt: boolean;
1790
+ reason?: string | undefined;
1791
+ }>>;
1792
+ streamNextSeq: z.ZodOptional<z.ZodNumber>;
1793
+ proactive: z.ZodOptional<z.ZodObject<{
1794
+ supported: z.ZodBoolean;
1795
+ ready: z.ZodBoolean;
1796
+ errorCode: z.ZodOptional<z.ZodString>;
1797
+ }, "strict", z.ZodTypeAny, {
1798
+ supported: boolean;
1799
+ ready: boolean;
1800
+ errorCode?: string | undefined;
1801
+ }, {
1802
+ supported: boolean;
1803
+ ready: boolean;
1804
+ errorCode?: string | undefined;
1805
+ }>>;
1806
+ compression: z.ZodOptional<z.ZodObject<{
1807
+ native: z.ZodBoolean;
1808
+ custom: z.ZodBoolean;
1809
+ blocked: z.ZodBoolean;
1810
+ operation: z.ZodOptional<z.ZodObject<{
1811
+ operationId: z.ZodString;
1812
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
1813
+ requestHash: z.ZodString;
1814
+ state: z.ZodEnum<["running", "succeeded", "noop", "failed", "unknown"]>;
1815
+ mode: z.ZodEnum<["native", "custom"]>;
1816
+ agent: z.ZodString;
1817
+ model: z.ZodString;
1818
+ project: z.ZodString;
1819
+ summary: z.ZodOptional<z.ZodString>;
1820
+ errorCode: z.ZodOptional<z.ZodString>;
1821
+ tokensBefore: z.ZodOptional<z.ZodNumber>;
1822
+ tokensAfter: z.ZodOptional<z.ZodNumber>;
1823
+ filesChanged: z.ZodOptional<z.ZodNumber>;
1824
+ recordsChanged: z.ZodOptional<z.ZodNumber>;
1825
+ blocksRemoved: z.ZodOptional<z.ZodNumber>;
1826
+ bytesBefore: z.ZodOptional<z.ZodNumber>;
1827
+ bytesAfter: z.ZodOptional<z.ZodNumber>;
1828
+ createdAt: z.ZodString;
1829
+ updatedAt: z.ZodString;
1830
+ }, "strip", z.ZodTypeAny, {
1831
+ sessionId: string & z.BRAND<"SessionId">;
1832
+ agent: string;
1833
+ operationId: string;
1834
+ requestHash: string;
1835
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1836
+ mode: "custom" | "native";
1837
+ model: string;
1838
+ project: string;
1839
+ createdAt: string;
1840
+ updatedAt: string;
1841
+ summary?: string | undefined;
1842
+ errorCode?: string | undefined;
1843
+ tokensBefore?: number | undefined;
1844
+ tokensAfter?: number | undefined;
1845
+ filesChanged?: number | undefined;
1846
+ recordsChanged?: number | undefined;
1847
+ blocksRemoved?: number | undefined;
1848
+ bytesBefore?: number | undefined;
1849
+ bytesAfter?: number | undefined;
1850
+ }, {
1851
+ sessionId: string;
1852
+ agent: string;
1853
+ operationId: string;
1854
+ requestHash: string;
1855
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1856
+ mode: "custom" | "native";
1857
+ model: string;
1858
+ project: string;
1859
+ createdAt: string;
1860
+ updatedAt: string;
1861
+ summary?: string | undefined;
1862
+ errorCode?: string | undefined;
1863
+ tokensBefore?: number | undefined;
1864
+ tokensAfter?: number | undefined;
1865
+ filesChanged?: number | undefined;
1866
+ recordsChanged?: number | undefined;
1867
+ blocksRemoved?: number | undefined;
1868
+ bytesBefore?: number | undefined;
1869
+ bytesAfter?: number | undefined;
1870
+ }>>;
1871
+ }, "strip", z.ZodTypeAny, {
1872
+ custom: boolean;
1873
+ native: boolean;
1874
+ blocked: boolean;
1875
+ operation?: {
1876
+ sessionId: string & z.BRAND<"SessionId">;
1877
+ agent: string;
1878
+ operationId: string;
1879
+ requestHash: string;
1880
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1881
+ mode: "custom" | "native";
1882
+ model: string;
1883
+ project: string;
1884
+ createdAt: string;
1885
+ updatedAt: string;
1886
+ summary?: string | undefined;
1887
+ errorCode?: string | undefined;
1888
+ tokensBefore?: number | undefined;
1889
+ tokensAfter?: number | undefined;
1890
+ filesChanged?: number | undefined;
1891
+ recordsChanged?: number | undefined;
1892
+ blocksRemoved?: number | undefined;
1893
+ bytesBefore?: number | undefined;
1894
+ bytesAfter?: number | undefined;
1895
+ } | undefined;
1896
+ }, {
1897
+ custom: boolean;
1898
+ native: boolean;
1899
+ blocked: boolean;
1900
+ operation?: {
1901
+ sessionId: string;
1902
+ agent: string;
1903
+ operationId: string;
1904
+ requestHash: string;
1905
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
1906
+ mode: "custom" | "native";
1907
+ model: string;
1908
+ project: string;
1909
+ createdAt: string;
1910
+ updatedAt: string;
1911
+ summary?: string | undefined;
1912
+ errorCode?: string | undefined;
1913
+ tokensBefore?: number | undefined;
1914
+ tokensAfter?: number | undefined;
1915
+ filesChanged?: number | undefined;
1916
+ recordsChanged?: number | undefined;
1917
+ blocksRemoved?: number | undefined;
1918
+ bytesBefore?: number | undefined;
1919
+ bytesAfter?: number | undefined;
1920
+ } | undefined;
1921
+ }>>;
1922
+ employeeId: z.ZodOptional<z.ZodString>;
1923
+ employeeRevision: z.ZodOptional<z.ZodNumber>;
617
1924
  sessionId: z.ZodBranded<z.ZodString, "SessionId">;
618
1925
  /** 绑定的项目(一等身份,D23)。 */
619
1926
  project: z.ZodBranded<z.ZodString, "ProjectId">;
1927
+ /** Original worktree binding, retained through status/list/recover parsing. */
1928
+ worktreeId: z.ZodOptional<z.ZodString>;
620
1929
  /** 绑定的 agent 身份,全程携带。 */
621
1930
  agent: z.ZodBranded<z.ZodString, "AgentId">;
622
1931
  model: z.ZodString;
@@ -655,39 +1964,139 @@ export declare const SessionListResult: z.ZodObject<{
655
1964
  /** phonon 自存的会话快照 JSONL 路径(可观测/审计;device 本地路径)。 */
656
1965
  transcriptPath: z.ZodOptional<z.ZodString>;
657
1966
  }, "strip", z.ZodTypeAny, {
658
- status: "idle" | "running" | "paused" | "terminated";
1967
+ status: "running" | "idle" | "paused" | "terminated";
659
1968
  sessionId: string & z.BRAND<"SessionId">;
660
1969
  agent: string & z.BRAND<"AgentId">;
661
- project: string & z.BRAND<"ProjectId">;
662
1970
  model: string;
663
- verbosity: "final" | "messages" | "tools" | "trace";
1971
+ project: string & z.BRAND<"ProjectId">;
664
1972
  createdAt: string;
1973
+ verbosity: "final" | "messages" | "tools" | "trace";
1974
+ recovery?: {
1975
+ detached: boolean;
1976
+ canAttempt: boolean;
1977
+ reason?: string | undefined;
1978
+ } | undefined;
1979
+ worktreeId?: string | undefined;
665
1980
  clientTag?: string | undefined;
1981
+ nativeStop?: {
1982
+ sessionId: string & z.BRAND<"SessionId">;
1983
+ version: 1;
1984
+ state: "unknown" | "pending" | "confirmed";
1985
+ observedAt: string;
1986
+ turnId?: string | undefined;
1987
+ nodeId?: string | undefined;
1988
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
1989
+ reasonCode?: string | undefined;
1990
+ } | undefined;
666
1991
  context?: {
667
1992
  contextWindow?: number | undefined;
668
1993
  usedTokens?: number | undefined;
669
1994
  usagePercent?: number | undefined;
670
1995
  compactions?: number | undefined;
671
1996
  } | undefined;
1997
+ streamNextSeq?: number | undefined;
1998
+ proactive?: {
1999
+ supported: boolean;
2000
+ ready: boolean;
2001
+ errorCode?: string | undefined;
2002
+ } | undefined;
2003
+ compression?: {
2004
+ custom: boolean;
2005
+ native: boolean;
2006
+ blocked: boolean;
2007
+ operation?: {
2008
+ sessionId: string & z.BRAND<"SessionId">;
2009
+ agent: string;
2010
+ operationId: string;
2011
+ requestHash: string;
2012
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
2013
+ mode: "custom" | "native";
2014
+ model: string;
2015
+ project: string;
2016
+ createdAt: string;
2017
+ updatedAt: string;
2018
+ summary?: string | undefined;
2019
+ errorCode?: string | undefined;
2020
+ tokensBefore?: number | undefined;
2021
+ tokensAfter?: number | undefined;
2022
+ filesChanged?: number | undefined;
2023
+ recordsChanged?: number | undefined;
2024
+ blocksRemoved?: number | undefined;
2025
+ bytesBefore?: number | undefined;
2026
+ bytesAfter?: number | undefined;
2027
+ } | undefined;
2028
+ } | undefined;
2029
+ employeeId?: string | undefined;
2030
+ employeeRevision?: number | undefined;
672
2031
  currentTurnId?: string | undefined;
673
2032
  queuedCount?: number | undefined;
674
2033
  lastActiveAt?: string | undefined;
675
2034
  transcriptPath?: string | undefined;
676
2035
  }, {
677
- status: "idle" | "running" | "paused" | "terminated";
2036
+ status: "running" | "idle" | "paused" | "terminated";
678
2037
  sessionId: string;
679
2038
  agent: string;
680
- project: string;
681
2039
  model: string;
682
- verbosity: "final" | "messages" | "tools" | "trace";
2040
+ project: string;
683
2041
  createdAt: string;
2042
+ verbosity: "final" | "messages" | "tools" | "trace";
2043
+ recovery?: {
2044
+ detached: boolean;
2045
+ canAttempt: boolean;
2046
+ reason?: string | undefined;
2047
+ } | undefined;
2048
+ worktreeId?: string | undefined;
684
2049
  clientTag?: string | undefined;
2050
+ nativeStop?: {
2051
+ sessionId: string;
2052
+ version: 1;
2053
+ state: "unknown" | "pending" | "confirmed";
2054
+ observedAt: string;
2055
+ turnId?: string | undefined;
2056
+ nodeId?: string | undefined;
2057
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
2058
+ reasonCode?: string | undefined;
2059
+ } | undefined;
685
2060
  context?: {
686
2061
  contextWindow?: number | undefined;
687
2062
  usedTokens?: number | undefined;
688
2063
  usagePercent?: number | undefined;
689
2064
  compactions?: number | undefined;
690
2065
  } | undefined;
2066
+ streamNextSeq?: number | undefined;
2067
+ proactive?: {
2068
+ supported: boolean;
2069
+ ready: boolean;
2070
+ errorCode?: string | undefined;
2071
+ } | undefined;
2072
+ compression?: {
2073
+ custom: boolean;
2074
+ native: boolean;
2075
+ blocked: boolean;
2076
+ operation?: {
2077
+ sessionId: string;
2078
+ agent: string;
2079
+ operationId: string;
2080
+ requestHash: string;
2081
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
2082
+ mode: "custom" | "native";
2083
+ model: string;
2084
+ project: string;
2085
+ createdAt: string;
2086
+ updatedAt: string;
2087
+ summary?: string | undefined;
2088
+ errorCode?: string | undefined;
2089
+ tokensBefore?: number | undefined;
2090
+ tokensAfter?: number | undefined;
2091
+ filesChanged?: number | undefined;
2092
+ recordsChanged?: number | undefined;
2093
+ blocksRemoved?: number | undefined;
2094
+ bytesBefore?: number | undefined;
2095
+ bytesAfter?: number | undefined;
2096
+ } | undefined;
2097
+ } | undefined;
2098
+ employeeId?: string | undefined;
2099
+ employeeRevision?: number | undefined;
691
2100
  currentTurnId?: string | undefined;
692
2101
  queuedCount?: number | undefined;
693
2102
  lastActiveAt?: string | undefined;
@@ -697,20 +2106,70 @@ export declare const SessionListResult: z.ZodObject<{
697
2106
  nextCursor: z.ZodOptional<z.ZodString>;
698
2107
  }, "strip", z.ZodTypeAny, {
699
2108
  sessions: {
700
- status: "idle" | "running" | "paused" | "terminated";
2109
+ status: "running" | "idle" | "paused" | "terminated";
701
2110
  sessionId: string & z.BRAND<"SessionId">;
702
2111
  agent: string & z.BRAND<"AgentId">;
703
- project: string & z.BRAND<"ProjectId">;
704
2112
  model: string;
705
- verbosity: "final" | "messages" | "tools" | "trace";
2113
+ project: string & z.BRAND<"ProjectId">;
706
2114
  createdAt: string;
2115
+ verbosity: "final" | "messages" | "tools" | "trace";
2116
+ recovery?: {
2117
+ detached: boolean;
2118
+ canAttempt: boolean;
2119
+ reason?: string | undefined;
2120
+ } | undefined;
2121
+ worktreeId?: string | undefined;
707
2122
  clientTag?: string | undefined;
2123
+ nativeStop?: {
2124
+ sessionId: string & z.BRAND<"SessionId">;
2125
+ version: 1;
2126
+ state: "unknown" | "pending" | "confirmed";
2127
+ observedAt: string;
2128
+ turnId?: string | undefined;
2129
+ nodeId?: string | undefined;
2130
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
2131
+ reasonCode?: string | undefined;
2132
+ } | undefined;
708
2133
  context?: {
709
2134
  contextWindow?: number | undefined;
710
2135
  usedTokens?: number | undefined;
711
2136
  usagePercent?: number | undefined;
712
2137
  compactions?: number | undefined;
713
2138
  } | undefined;
2139
+ streamNextSeq?: number | undefined;
2140
+ proactive?: {
2141
+ supported: boolean;
2142
+ ready: boolean;
2143
+ errorCode?: string | undefined;
2144
+ } | undefined;
2145
+ compression?: {
2146
+ custom: boolean;
2147
+ native: boolean;
2148
+ blocked: boolean;
2149
+ operation?: {
2150
+ sessionId: string & z.BRAND<"SessionId">;
2151
+ agent: string;
2152
+ operationId: string;
2153
+ requestHash: string;
2154
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
2155
+ mode: "custom" | "native";
2156
+ model: string;
2157
+ project: string;
2158
+ createdAt: string;
2159
+ updatedAt: string;
2160
+ summary?: string | undefined;
2161
+ errorCode?: string | undefined;
2162
+ tokensBefore?: number | undefined;
2163
+ tokensAfter?: number | undefined;
2164
+ filesChanged?: number | undefined;
2165
+ recordsChanged?: number | undefined;
2166
+ blocksRemoved?: number | undefined;
2167
+ bytesBefore?: number | undefined;
2168
+ bytesAfter?: number | undefined;
2169
+ } | undefined;
2170
+ } | undefined;
2171
+ employeeId?: string | undefined;
2172
+ employeeRevision?: number | undefined;
714
2173
  currentTurnId?: string | undefined;
715
2174
  queuedCount?: number | undefined;
716
2175
  lastActiveAt?: string | undefined;
@@ -719,20 +2178,70 @@ export declare const SessionListResult: z.ZodObject<{
719
2178
  nextCursor?: string | undefined;
720
2179
  }, {
721
2180
  sessions: {
722
- status: "idle" | "running" | "paused" | "terminated";
2181
+ status: "running" | "idle" | "paused" | "terminated";
723
2182
  sessionId: string;
724
2183
  agent: string;
725
- project: string;
726
2184
  model: string;
727
- verbosity: "final" | "messages" | "tools" | "trace";
2185
+ project: string;
728
2186
  createdAt: string;
2187
+ verbosity: "final" | "messages" | "tools" | "trace";
2188
+ recovery?: {
2189
+ detached: boolean;
2190
+ canAttempt: boolean;
2191
+ reason?: string | undefined;
2192
+ } | undefined;
2193
+ worktreeId?: string | undefined;
729
2194
  clientTag?: string | undefined;
2195
+ nativeStop?: {
2196
+ sessionId: string;
2197
+ version: 1;
2198
+ state: "unknown" | "pending" | "confirmed";
2199
+ observedAt: string;
2200
+ turnId?: string | undefined;
2201
+ nodeId?: string | undefined;
2202
+ confirmation?: "not_started" | "process_tree_exit" | "native_terminal" | undefined;
2203
+ reasonCode?: string | undefined;
2204
+ } | undefined;
730
2205
  context?: {
731
2206
  contextWindow?: number | undefined;
732
2207
  usedTokens?: number | undefined;
733
2208
  usagePercent?: number | undefined;
734
2209
  compactions?: number | undefined;
735
2210
  } | undefined;
2211
+ streamNextSeq?: number | undefined;
2212
+ proactive?: {
2213
+ supported: boolean;
2214
+ ready: boolean;
2215
+ errorCode?: string | undefined;
2216
+ } | undefined;
2217
+ compression?: {
2218
+ custom: boolean;
2219
+ native: boolean;
2220
+ blocked: boolean;
2221
+ operation?: {
2222
+ sessionId: string;
2223
+ agent: string;
2224
+ operationId: string;
2225
+ requestHash: string;
2226
+ state: "unknown" | "running" | "succeeded" | "noop" | "failed";
2227
+ mode: "custom" | "native";
2228
+ model: string;
2229
+ project: string;
2230
+ createdAt: string;
2231
+ updatedAt: string;
2232
+ summary?: string | undefined;
2233
+ errorCode?: string | undefined;
2234
+ tokensBefore?: number | undefined;
2235
+ tokensAfter?: number | undefined;
2236
+ filesChanged?: number | undefined;
2237
+ recordsChanged?: number | undefined;
2238
+ blocksRemoved?: number | undefined;
2239
+ bytesBefore?: number | undefined;
2240
+ bytesAfter?: number | undefined;
2241
+ } | undefined;
2242
+ } | undefined;
2243
+ employeeId?: string | undefined;
2244
+ employeeRevision?: number | undefined;
736
2245
  currentTurnId?: string | undefined;
737
2246
  queuedCount?: number | undefined;
738
2247
  lastActiveAt?: string | undefined;