@deepseek-ai/dsh-api-session-controller 0.1.6-alpha.2 → 0.1.7-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +34 -9
  3. package/README.zh.md +34 -9
  4. package/lib/client.js +774 -641
  5. package/lib/index.js +318 -143
  6. package/lib/typert.host.js +384 -186
  7. package/lib/typert.remote-client.d.ts +10 -5
  8. package/lib/typert.remote-client.js +225 -125
  9. package/lib/types/archived-session-gate.d.ts +30 -0
  10. package/lib/types/archived-session-gate.js +52 -0
  11. package/lib/types/client/contract/session.d.ts +11 -4
  12. package/lib/types/client/contract/sessions.d.ts +11 -16
  13. package/lib/types/client/contract/snapshot.d.ts +1 -1
  14. package/lib/types/client/index.d.ts +1 -1
  15. package/lib/types/client/sessions/lineage.d.ts +4 -1
  16. package/lib/types/client/sessions/lineage.js +2 -1
  17. package/lib/types/client/sessions/manager.d.ts +66 -59
  18. package/lib/types/client/sessions/manager.js +249 -277
  19. package/lib/types/client/sessions/projection-store.d.ts +38 -13
  20. package/lib/types/client/sessions/projection-store.js +54 -13
  21. package/lib/types/client/sessions/remotes.d.ts +1 -2
  22. package/lib/types/client/sessions/service.d.ts +23 -35
  23. package/lib/types/client/sessions/service.js +35 -47
  24. package/lib/types/client/sessions/session.d.ts +23 -19
  25. package/lib/types/client/sessions/session.js +158 -59
  26. package/lib/types/client/transport.js +5 -2
  27. package/lib/types/commands.d.ts +4 -2
  28. package/lib/types/commands.js +72 -36
  29. package/lib/types/control.d.ts +2 -4
  30. package/lib/types/control.js +2 -44
  31. package/lib/types/history.js +25 -10
  32. package/lib/types/index.d.ts +32 -5
  33. package/lib/types/index.js +117 -13
  34. package/lib/types/list.js +24 -15
  35. package/lib/types/skill-catalog.js +60 -50
  36. package/lib/types/types.d.ts +45 -25
  37. package/lib/types/types.js +0 -1
  38. package/package.json +71 -76
@@ -1,46 +1,6 @@
1
1
  /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
2
  import { z } from 'zod'
3
3
 
4
- let ContentBlockRemoteCodec$schema$value
5
- const ContentBlockRemoteCodec$schema = () => (ContentBlockRemoteCodec$schema$value ??= z.union([z.object({
6
- 'type': z.literal("file"),
7
- 'attachment': z.object({
8
- 'attachmentId': z.intersection(z.string(), z.unknown()),
9
- 'name': z.string(),
10
- 'bytes': z.number(),
11
- }),
12
- }), z.object({
13
- 'type': z.literal("text"),
14
- 'text': z.string(),
15
- }), z.object({
16
- 'type': z.literal("image"),
17
- 'attachment': z.object({
18
- 'attachmentId': z.intersection(z.string(), z.unknown()),
19
- 'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]),
20
- 'bytes': z.number(),
21
- 'width': z.number(),
22
- 'height': z.number(),
23
- 'name': z.string().optional(),
24
- 'originalDimensions': z.object({
25
- 'width': z.number(),
26
- 'height': z.number(),
27
- }).optional(),
28
- }),
29
- 'offloaded': z.literal(true).optional(),
30
- }), z.object({
31
- 'type': z.literal("reasoning"),
32
- 'text': z.string(),
33
- }), z.object({
34
- 'type': z.literal("tool-call"),
35
- 'id': z.intersection(z.string(), z.unknown()),
36
- 'name': z.string(),
37
- 'arguments': z.string(),
38
- }), z.object({
39
- 'type': z.literal("tool-result"),
40
- 'toolCallId': z.intersection(z.string(), z.unknown()),
41
- 'content': z.array(z.lazy(() => ContentBlockRemoteCodec$schema())),
42
- 'isError': z.boolean().optional(),
43
- })]))
44
4
  let JsonValueRemoteCodec$schema$value
45
5
  const JsonValueRemoteCodec$schema = () => (JsonValueRemoteCodec$schema$value ??= z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema()))]))
46
6
  let JsonValueRemoteCodec$schema2$value
@@ -49,6 +9,8 @@ let JsonValueRemoteCodec$schema3$value
49
9
  const JsonValueRemoteCodec$schema3 = () => (JsonValueRemoteCodec$schema3$value ??= z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3()))]))
50
10
  let JsonValueRemoteCodec$schema4$value
51
11
  const JsonValueRemoteCodec$schema4 = () => (JsonValueRemoteCodec$schema4$value ??= z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))]))
12
+ let JsonValueRemoteCodec$schema5$value
13
+ const JsonValueRemoteCodec$schema5 = () => (JsonValueRemoteCodec$schema5$value ??= z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))]))
52
14
  let _deepseek_ai_dsh_api_session_controller_fileReferences_list_parameter_0$schema$value
53
15
  const _deepseek_ai_dsh_api_session_controller_fileReferences_list_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_fileReferences_list_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
54
16
  let _deepseek_ai_dsh_api_session_controller_fileReferences_list_parameter_1$schema$value
@@ -93,27 +55,18 @@ let _deepseek_ai_dsh_api_session_controller_session_control_result$schema$value
93
55
  const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_control_result$schema$value ??= z.union([z.object({
94
56
  'type': z.literal("baseline").readonly(),
95
57
  'value': z.object({
96
- 'jobs': z.record(z.intersection(z.string(), z.unknown()), z.array(z.object({
97
- 'id': z.intersection(z.string(), z.unknown()).readonly(),
98
- 'kind': z.string().readonly(),
99
- 'label': z.string().readonly(),
100
- 'status': z.union([z.literal("completed"), z.literal("running"), z.literal("stopping"), z.literal("killed"), z.literal("failed")]).readonly(),
101
- 'detail': z.string().readonly().optional(),
102
- 'startedAt': z.number().readonly(),
103
- 'finishedAt': z.number().readonly().optional(),
104
- }))).readonly().readonly(),
105
58
  'projections': z.record(z.intersection(z.string(), z.unknown()), z.object({
106
59
  'asOfSeq': z.number().readonly(),
107
60
  'values': z.intersection(z.object({
108
61
  'inbox': z.object({
109
- 'next-turn': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly(),
110
- 'next-step': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly(),
62
+ 'next-turn': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))])).readonly(),
63
+ 'next-step': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))])).readonly(),
111
64
  }).optional(),
112
65
  'agentPreset': z.union([z.literal(null), z.string()]).optional(),
113
66
  'title': z.union([z.literal(null), z.string()]).optional(),
114
67
  'todos': z.union([z.literal(null), z.array(z.object({
115
68
  'content': z.string(),
116
- 'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed")]),
69
+ 'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
117
70
  }))]).optional(),
118
71
  'sessionListMetadata': z.object({
119
72
  'blank': z.boolean().readonly(),
@@ -154,6 +107,12 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
154
107
  }), z.object({
155
108
  'mode': z.literal("continuable").readonly(),
156
109
  'label': z.string().readonly(),
110
+ })), z.intersection(z.object({
111
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
112
+ 'createdAt': z.number().readonly(),
113
+ }), z.object({
114
+ 'mode': z.literal("unknown").readonly(),
115
+ 'label': z.string().readonly().optional(),
157
116
  }))])).optional(),
158
117
  'subagentTiming': z.object({
159
118
  'settledMs': z.number(),
@@ -161,6 +120,7 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
161
120
  'since': z.number(),
162
121
  'through': z.number(),
163
122
  }).optional(),
123
+ 'lastTurnCompleted': z.boolean().optional(),
164
124
  }).optional(),
165
125
  'subagent': z.union([z.literal(null), z.object({
166
126
  'mode': z.literal("one-shot"),
@@ -187,27 +147,15 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
187
147
  'createdAt': z.number().readonly(),
188
148
  'updatedAt': z.number().readonly(),
189
149
  })]).optional(),
190
- }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly()).readonly(),
150
+ }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))])).readonly()).readonly(),
191
151
  })).readonly().readonly(),
192
152
  }).readonly(),
193
- }), z.object({
194
- 'type': z.literal("jobs").readonly(),
195
- 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
196
- 'jobs': z.array(z.object({
197
- 'id': z.intersection(z.string(), z.unknown()).readonly(),
198
- 'kind': z.string().readonly(),
199
- 'label': z.string().readonly(),
200
- 'status': z.union([z.literal("completed"), z.literal("running"), z.literal("stopping"), z.literal("killed"), z.literal("failed")]).readonly(),
201
- 'detail': z.string().readonly().optional(),
202
- 'startedAt': z.number().readonly(),
203
- 'finishedAt': z.number().readonly().optional(),
204
- })).readonly(),
205
153
  }), z.intersection(z.object({
206
154
  'type': z.literal("projection").readonly(),
207
155
  }), z.object({
208
156
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
209
157
  'key': z.string().readonly(),
210
- 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))]).readonly(),
158
+ 'value': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))]).readonly(),
211
159
  'seq': z.number().readonly(),
212
160
  }))]))
213
161
  let _deepseek_ai_dsh_api_session_controller_session_create_parameter_0$schema$value
@@ -231,10 +179,14 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_parameter_0$schema
231
179
  'kind': z.literal("subagent").readonly(),
232
180
  'parentSessionId': z.intersection(z.string(), z.unknown()).readonly(),
233
181
  'childSessionId': z.intersection(z.string(), z.unknown()).readonly(),
234
- 'mode': z.union([z.literal("one-shot"), z.literal("continuable")]).readonly(),
182
+ 'mode': z.union([z.literal("one-shot"), z.literal("continuable"), z.literal("unknown")]).readonly(),
235
183
  })]).readonly(),
236
- 'maxMessages': z.number().readonly().optional(),
237
184
  'assistantStream': z.literal(true).readonly().optional(),
185
+ 'maxMessages': z.number().readonly().optional(),
186
+ 'turnWindow': z.object({
187
+ 'minMessages': z.number().readonly(),
188
+ 'minTurns': z.number().readonly(),
189
+ }).readonly().optional(),
238
190
  }))
239
191
  let _deepseek_ai_dsh_api_session_controller_session_follow_result$schema$value
240
192
  const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_follow_result$schema$value ??= z.union([z.object({
@@ -286,7 +238,7 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
286
238
  'title': z.union([z.literal(null), z.string()]).optional(),
287
239
  'todos': z.union([z.literal(null), z.array(z.object({
288
240
  'content': z.string(),
289
- 'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed")]),
241
+ 'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
290
242
  }))]).optional(),
291
243
  'sessionListMetadata': z.object({
292
244
  'blank': z.boolean().readonly(),
@@ -327,6 +279,12 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
327
279
  }), z.object({
328
280
  'mode': z.literal("continuable").readonly(),
329
281
  'label': z.string().readonly(),
282
+ })), z.intersection(z.object({
283
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
284
+ 'createdAt': z.number().readonly(),
285
+ }), z.object({
286
+ 'mode': z.literal("unknown").readonly(),
287
+ 'label': z.string().readonly().optional(),
330
288
  }))])).optional(),
331
289
  'subagentTiming': z.object({
332
290
  'settledMs': z.number(),
@@ -334,6 +292,7 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
334
292
  'since': z.number(),
335
293
  'through': z.number(),
336
294
  }).optional(),
295
+ 'lastTurnCompleted': z.boolean().optional(),
337
296
  }).optional(),
338
297
  'subagent': z.union([z.literal(null), z.object({
339
298
  'mode': z.literal("one-shot"),
@@ -419,6 +378,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_parameter_0$schema =
419
378
  let _deepseek_ai_dsh_api_session_controller_session_list_result$schema$value
420
379
  const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_list_result$schema$value ??= z.object({
421
380
  'items': z.array(z.object({
381
+ 'agentAvailable': z.boolean().readonly(),
422
382
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
423
383
  'updatedAt': z.number().readonly(),
424
384
  'running': z.boolean().readonly(),
@@ -427,6 +387,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
427
387
  'origin': z.literal("subagent").readonly().optional(),
428
388
  'cwd': z.string().readonly().optional(),
429
389
  'projections': z.object({
390
+ 'kind': z.union([z.literal("cached"), z.literal("sequenced")]).readonly(),
430
391
  'asOfSeq': z.number().readonly(),
431
392
  'values': z.intersection(z.object({
432
393
  'inbox': z.object({
@@ -437,7 +398,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
437
398
  'title': z.union([z.literal(null), z.string()]).optional(),
438
399
  'todos': z.union([z.literal(null), z.array(z.object({
439
400
  'content': z.string(),
440
- 'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed")]),
401
+ 'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
441
402
  }))]).optional(),
442
403
  'sessionListMetadata': z.object({
443
404
  'blank': z.boolean().readonly(),
@@ -478,6 +439,12 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
478
439
  }), z.object({
479
440
  'mode': z.literal("continuable").readonly(),
480
441
  'label': z.string().readonly(),
442
+ })), z.intersection(z.object({
443
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
444
+ 'createdAt': z.number().readonly(),
445
+ }), z.object({
446
+ 'mode': z.literal("unknown").readonly(),
447
+ 'label': z.string().readonly().optional(),
481
448
  }))])).optional(),
482
449
  'subagentTiming': z.object({
483
450
  'settledMs': z.number(),
@@ -485,6 +452,7 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
485
452
  'since': z.number(),
486
453
  'through': z.number(),
487
454
  }).optional(),
455
+ 'lastTurnCompleted': z.boolean().optional(),
488
456
  }).optional(),
489
457
  'subagent': z.union([z.literal(null), z.object({
490
458
  'mode': z.literal("one-shot"),
@@ -549,6 +517,7 @@ const _deepseek_ai_dsh_api_session_controller_session_modelCatalog_result$schema
549
517
  let _deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_parameter_0$schema$value
550
518
  const _deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_parameter_0$schema$value ??= z.object({
551
519
  'action': z.literal("reveal").readonly().optional(),
520
+ 'application': z.string().readonly().optional(),
552
521
  'path': z.string().readonly(),
553
522
  }))
554
523
  let _deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_result$schema$value
@@ -564,11 +533,15 @@ const _deepseek_ai_dsh_api_session_controller_session_page_parameter_0$schema =
564
533
  'kind': z.literal("subagent").readonly(),
565
534
  'parentSessionId': z.intersection(z.string(), z.unknown()).readonly(),
566
535
  'childSessionId': z.intersection(z.string(), z.unknown()).readonly(),
567
- 'mode': z.union([z.literal("one-shot"), z.literal("continuable")]).readonly(),
536
+ 'mode': z.union([z.literal("one-shot"), z.literal("continuable"), z.literal("unknown")]).readonly(),
568
537
  })]).readonly(),
569
538
  'throughSeq': z.number().readonly(),
570
539
  'beforeSeq': z.number().readonly().optional(),
571
540
  'maxMessages': z.number().readonly().optional(),
541
+ 'turnWindow': z.object({
542
+ 'minMessages': z.number().readonly(),
543
+ 'minTurns': z.number().readonly(),
544
+ }).readonly().optional(),
572
545
  }))
573
546
  let _deepseek_ai_dsh_api_session_controller_session_page_result$schema$value
574
547
  const _deepseek_ai_dsh_api_session_controller_session_page_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_page_result$schema$value ??= z.object({
@@ -586,6 +559,105 @@ const _deepseek_ai_dsh_api_session_controller_session_page_result$schema = () =>
586
559
  })).readonly(),
587
560
  'hasMore': z.boolean().readonly(),
588
561
  }))
562
+ let _deepseek_ai_dsh_api_session_controller_session_projections_parameter_0$schema$value
563
+ const _deepseek_ai_dsh_api_session_controller_session_projections_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_session_projections_parameter_0$schema$value ??= z.object({
564
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
565
+ }))
566
+ let _deepseek_ai_dsh_api_session_controller_session_projections_result$schema$value
567
+ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_projections_result$schema$value ??= z.union([z.literal(null), z.object({
568
+ 'asOfSeq': z.number().readonly(),
569
+ 'values': z.intersection(z.object({
570
+ 'inbox': z.object({
571
+ 'next-turn': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly(),
572
+ 'next-step': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly(),
573
+ }).optional(),
574
+ 'agentPreset': z.union([z.literal(null), z.string()]).optional(),
575
+ 'title': z.union([z.literal(null), z.string()]).optional(),
576
+ 'todos': z.union([z.literal(null), z.array(z.object({
577
+ 'content': z.string(),
578
+ 'status': z.union([z.literal("completed"), z.literal("pending"), z.literal("in_progress")]),
579
+ }))]).optional(),
580
+ 'sessionListMetadata': z.object({
581
+ 'blank': z.boolean().readonly(),
582
+ 'lastPromptAt': z.union([z.literal(null), z.number()]).readonly(),
583
+ }).optional(),
584
+ 'imageLimits': z.object({
585
+ 'maxImageBytes': z.number(),
586
+ 'maxImagesPerMessage': z.number(),
587
+ 'maxMessageImageBytes': z.number(),
588
+ 'maxImagePixels': z.number(),
589
+ 'maxImageDimension': z.number(),
590
+ 'mediaTypes': z.array(z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")])),
591
+ }).optional(),
592
+ 'modelSelection': z.object({
593
+ 'lastUsed': z.union([z.literal(null), z.object({
594
+ 'provider': z.string().readonly(),
595
+ 'model': z.string().readonly(),
596
+ 'reasoningEffort': z.string().readonly().optional(),
597
+ })]).readonly(),
598
+ 'next': z.union([z.literal(null), z.object({
599
+ 'provider': z.string().readonly(),
600
+ 'model': z.string().readonly(),
601
+ 'reasoningEffort': z.string().readonly().optional(),
602
+ })]).readonly(),
603
+ }).optional(),
604
+ 'permissions': z.object({
605
+ 'currentValue': z.string(),
606
+ }).optional(),
607
+ 'subagentCatalog': z.array(z.union([z.intersection(z.object({
608
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
609
+ 'createdAt': z.number().readonly(),
610
+ }), z.object({
611
+ 'mode': z.literal("one-shot").readonly(),
612
+ 'label': z.string().readonly().optional(),
613
+ })), z.intersection(z.object({
614
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
615
+ 'createdAt': z.number().readonly(),
616
+ }), z.object({
617
+ 'mode': z.literal("continuable").readonly(),
618
+ 'label': z.string().readonly(),
619
+ })), z.intersection(z.object({
620
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
621
+ 'createdAt': z.number().readonly(),
622
+ }), z.object({
623
+ 'mode': z.literal("unknown").readonly(),
624
+ 'label': z.string().readonly().optional(),
625
+ }))])).optional(),
626
+ 'subagentTiming': z.object({
627
+ 'settledMs': z.number(),
628
+ 'active': z.object({
629
+ 'since': z.number(),
630
+ 'through': z.number(),
631
+ }).optional(),
632
+ 'lastTurnCompleted': z.boolean().optional(),
633
+ }).optional(),
634
+ 'subagent': z.union([z.literal(null), z.object({
635
+ 'mode': z.literal("one-shot"),
636
+ 'label': z.string().optional(),
637
+ 'seq': z.intersection(z.number(), z.unknown()),
638
+ }), z.object({
639
+ 'mode': z.literal("continuable"),
640
+ 'label': z.string(),
641
+ 'seq': z.intersection(z.number(), z.unknown()),
642
+ })]).optional(),
643
+ 'goal': z.union([z.literal(null), z.object({
644
+ 'goal': z.object({
645
+ 'objective': z.string().readonly(),
646
+ 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
647
+ 'blockedReason': z.object({
648
+ 'code': z.string().readonly(),
649
+ 'message': z.string().readonly(),
650
+ }).readonly().optional(),
651
+ 'maxGoalRounds': z.number().readonly(),
652
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
653
+ 'revision': z.number().readonly(),
654
+ }).readonly(),
655
+ 'roundsStarted': z.number().readonly(),
656
+ 'createdAt': z.number().readonly(),
657
+ 'updatedAt': z.number().readonly(),
658
+ })]).optional(),
659
+ }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly()).readonly(),
660
+ })]))
589
661
  let _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema$value
590
662
  const _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema$value ??= z.object({
591
663
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -652,45 +724,10 @@ const _deepseek_ai_dsh_api_session_controller_session_updateQueue_parameter_0$sc
652
724
  'itemId': z.intersection(z.string(), z.unknown()).readonly(),
653
725
  'action': z.union([z.object({
654
726
  'kind': z.literal("edit").readonly(),
655
- 'content': z.array(z.union([z.object({
656
- 'type': z.literal("file"),
657
- 'attachment': z.object({
658
- 'attachmentId': z.intersection(z.string(), z.unknown()),
659
- 'name': z.string(),
660
- 'bytes': z.number(),
661
- }),
662
- }), z.object({
727
+ 'content': z.array(z.object({
663
728
  'type': z.literal("text"),
664
729
  'text': z.string(),
665
- }), z.object({
666
- 'type': z.literal("image"),
667
- 'attachment': z.object({
668
- 'attachmentId': z.intersection(z.string(), z.unknown()),
669
- 'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]),
670
- 'bytes': z.number(),
671
- 'width': z.number(),
672
- 'height': z.number(),
673
- 'name': z.string().optional(),
674
- 'originalDimensions': z.object({
675
- 'width': z.number(),
676
- 'height': z.number(),
677
- }).optional(),
678
- }),
679
- 'offloaded': z.literal(true).optional(),
680
- }), z.object({
681
- 'type': z.literal("reasoning"),
682
- 'text': z.string(),
683
- }), z.object({
684
- 'type': z.literal("tool-call"),
685
- 'id': z.intersection(z.string(), z.unknown()),
686
- 'name': z.string(),
687
- 'arguments': z.string(),
688
- }), z.object({
689
- 'type': z.literal("tool-result"),
690
- 'toolCallId': z.intersection(z.string(), z.unknown()),
691
- 'content': z.array(z.lazy(() => ContentBlockRemoteCodec$schema())),
692
- 'isError': z.boolean().optional(),
693
- })])).readonly(),
730
+ })).readonly(),
694
731
  }), z.object({
695
732
  'kind': z.literal("remove").readonly(),
696
733
  }), z.object({
@@ -701,6 +738,17 @@ let _deepseek_ai_dsh_api_session_controller_session_updateQueue_result$schema$va
701
738
  const _deepseek_ai_dsh_api_session_controller_session_updateQueue_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_updateQueue_result$schema$value ??= z.object({
702
739
  'accepted': z.literal(true).readonly(),
703
740
  }))
741
+ let _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_parameter_0$schema$value
742
+ const _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_parameter_0$schema$value ??= z.object({
743
+ 'path': z.string().readonly(),
744
+ }))
745
+ let _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_result$schema$value
746
+ const _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_result$schema = () => (_deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_result$schema$value ??= z.array(z.object({
747
+ 'id': z.string().readonly(),
748
+ 'name': z.string().readonly(),
749
+ 'default': z.boolean().readonly(),
750
+ 'icon': z.union([z.literal(null), z.string()]).readonly(),
751
+ })))
704
752
  let _deepseek_ai_dsh_api_session_controller_skills_list_parameter_0$schema$value
705
753
  const _deepseek_ai_dsh_api_session_controller_skills_list_parameter_0$schema = () => (_deepseek_ai_dsh_api_session_controller_skills_list_parameter_0$schema$value ??= z.object({
706
754
  'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -786,7 +834,7 @@ export const TYPERT = {
786
834
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionAttachmentValue',
787
835
  create: _deepseek_ai_dsh_api_session_controller_session_attachment_result$schema,
788
836
  },
789
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":358,"column":3},
837
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":419,"column":3},
790
838
  },
791
839
  {
792
840
  id: '@deepseek-ai/dsh-api-session-controller#session/cancel',
@@ -811,7 +859,7 @@ export const TYPERT = {
811
859
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionCancelValue',
812
860
  create: _deepseek_ai_dsh_api_session_controller_session_cancel_result$schema,
813
861
  },
814
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":378,"column":3},
862
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":439,"column":3},
815
863
  },
816
864
  {
817
865
  id: '@deepseek-ai/dsh-api-session-controller#session/canOpenWorkspacePath',
@@ -826,7 +874,7 @@ export const TYPERT = {
826
874
  typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/canOpenWorkspacePath:result',
827
875
  create: _deepseek_ai_dsh_api_session_controller_session_canOpenWorkspacePath_result$schema,
828
876
  },
829
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":273,"column":3},
877
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":301,"column":3},
830
878
  },
831
879
  {
832
880
  id: '@deepseek-ai/dsh-api-session-controller#session/control',
@@ -843,7 +891,7 @@ export const TYPERT = {
843
891
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionControlFrame',
844
892
  create: _deepseek_ai_dsh_api_session_controller_session_control_result$schema,
845
893
  },
846
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":411,"column":3},
894
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":502,"column":3},
847
895
  },
848
896
  {
849
897
  id: '@deepseek-ai/dsh-api-session-controller#session/create',
@@ -868,7 +916,7 @@ export const TYPERT = {
868
916
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionCreateValue',
869
917
  create: _deepseek_ai_dsh_api_session_controller_session_create_result$schema,
870
918
  },
871
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":245,"column":3},
919
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":273,"column":3},
872
920
  },
873
921
  {
874
922
  id: '@deepseek-ai/dsh-api-session-controller#session/follow',
@@ -895,7 +943,7 @@ export const TYPERT = {
895
943
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionFollowFrame',
896
944
  create: _deepseek_ai_dsh_api_session_controller_session_follow_result$schema,
897
945
  },
898
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":401,"column":3},
946
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":462,"column":3},
899
947
  },
900
948
  {
901
949
  id: '@deepseek-ai/dsh-api-session-controller#session/fork',
@@ -920,7 +968,7 @@ export const TYPERT = {
920
968
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionForkValue',
921
969
  create: _deepseek_ai_dsh_api_session_controller_session_fork_result$schema,
922
970
  },
923
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":336,"column":3},
971
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":397,"column":3},
924
972
  },
925
973
  {
926
974
  id: '@deepseek-ai/dsh-api-session-controller#session/list',
@@ -946,7 +994,7 @@ export const TYPERT = {
946
994
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionListValue',
947
995
  create: _deepseek_ai_dsh_api_session_controller_session_list_result$schema,
948
996
  },
949
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":224,"column":9},
997
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":252,"column":9},
950
998
  },
951
999
  {
952
1000
  id: '@deepseek-ai/dsh-api-session-controller#session/modelCatalog',
@@ -961,7 +1009,7 @@ export const TYPERT = {
961
1009
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#ModelCatalog',
962
1010
  create: _deepseek_ai_dsh_api_session_controller_session_modelCatalog_result$schema,
963
1011
  },
964
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":264,"column":3},
1012
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":292,"column":3},
965
1013
  },
966
1014
  {
967
1015
  id: '@deepseek-ai/dsh-api-session-controller#session/openWorkspacePath',
@@ -987,7 +1035,7 @@ export const TYPERT = {
987
1035
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionOpenWorkspacePathValue',
988
1036
  create: _deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_result$schema,
989
1037
  },
990
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":294,"column":9},
1038
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":322,"column":9},
991
1039
  },
992
1040
  {
993
1041
  id: '@deepseek-ai/dsh-api-session-controller#session/page',
@@ -1013,7 +1061,33 @@ export const TYPERT = {
1013
1061
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionPage',
1014
1062
  create: _deepseek_ai_dsh_api_session_controller_session_page_result$schema,
1015
1063
  },
1016
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":389,"column":3},
1064
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":450,"column":3},
1065
+ },
1066
+ {
1067
+ id: '@deepseek-ai/dsh-api-session-controller#session/projections',
1068
+ service: 'sessionController',
1069
+ namespace: 'session',
1070
+ method: 'projections',
1071
+ invocation: { kind: 'direct' },
1072
+ parameters: [
1073
+ {
1074
+ name: 'request',
1075
+ wire: 'request',
1076
+ source: 'json',
1077
+ codec: {
1078
+ mode: 'strict',
1079
+ typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionProjectionsRequest',
1080
+ create: _deepseek_ai_dsh_api_session_controller_session_projections_parameter_0$schema,
1081
+ },
1082
+ },
1083
+ ],
1084
+ cancellation: { parameter: 'signal' },
1085
+ result: {
1086
+ mode: 'strict',
1087
+ typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionProjectionsValue',
1088
+ create: _deepseek_ai_dsh_api_session_controller_session_projections_result$schema,
1089
+ },
1090
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":473,"column":9},
1017
1091
  },
1018
1092
  {
1019
1093
  id: '@deepseek-ai/dsh-api-session-controller#session/prompt',
@@ -1039,7 +1113,7 @@ export const TYPERT = {
1039
1113
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionPromptValue',
1040
1114
  create: _deepseek_ai_dsh_api_session_controller_session_prompt_result$schema,
1041
1115
  },
1042
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":347,"column":3},
1116
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":408,"column":3},
1043
1117
  },
1044
1118
  {
1045
1119
  id: '@deepseek-ai/dsh-api-session-controller#session/rename',
@@ -1064,7 +1138,7 @@ export const TYPERT = {
1064
1138
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionRenameValue',
1065
1139
  create: _deepseek_ai_dsh_api_session_controller_session_rename_result$schema,
1066
1140
  },
1067
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":326,"column":3},
1141
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":385,"column":3},
1068
1142
  },
1069
1143
  {
1070
1144
  id: '@deepseek-ai/dsh-api-session-controller#session/search',
@@ -1090,7 +1164,7 @@ export const TYPERT = {
1090
1164
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionSearchValue',
1091
1165
  create: _deepseek_ai_dsh_api_session_controller_session_search_result$schema,
1092
1166
  },
1093
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":235,"column":3},
1167
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":263,"column":3},
1094
1168
  },
1095
1169
  {
1096
1170
  id: '@deepseek-ai/dsh-api-session-controller#session/selectModel',
@@ -1115,7 +1189,7 @@ export const TYPERT = {
1115
1189
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionSelectModelValue',
1116
1190
  create: _deepseek_ai_dsh_api_session_controller_session_selectModel_result$schema,
1117
1191
  },
1118
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":255,"column":3},
1192
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":283,"column":3},
1119
1193
  },
1120
1194
  {
1121
1195
  id: '@deepseek-ai/dsh-api-session-controller#session/updateQueue',
@@ -1140,7 +1214,33 @@ export const TYPERT = {
1140
1214
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionUpdateQueueValue',
1141
1215
  create: _deepseek_ai_dsh_api_session_controller_session_updateQueue_result$schema,
1142
1216
  },
1143
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":368,"column":3},
1217
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":429,"column":3},
1218
+ },
1219
+ {
1220
+ id: '@deepseek-ai/dsh-api-session-controller#session/workspacePathApplications',
1221
+ service: 'sessionController',
1222
+ namespace: 'session',
1223
+ method: 'workspacePathApplications',
1224
+ invocation: { kind: 'direct' },
1225
+ parameters: [
1226
+ {
1227
+ name: 'request',
1228
+ wire: 'request',
1229
+ source: 'json',
1230
+ codec: {
1231
+ mode: 'strict',
1232
+ typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/workspacePathApplications:request',
1233
+ create: _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_parameter_0$schema,
1234
+ },
1235
+ },
1236
+ ],
1237
+ cancellation: { parameter: 'signal' },
1238
+ result: {
1239
+ mode: 'strict',
1240
+ typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/workspacePathApplications:result',
1241
+ create: _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_result$schema,
1242
+ },
1243
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":352,"column":9},
1144
1244
  },
1145
1245
  {
1146
1246
  id: '@deepseek-ai/dsh-api-session-controller#skills/list',
@@ -1166,7 +1266,7 @@ export const TYPERT = {
1166
1266
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SkillListValue',
1167
1267
  create: _deepseek_ai_dsh_api_session_controller_skills_list_result$schema,
1168
1268
  },
1169
- sourceLocation: {"file":"packages/api/session-controller/src/skill-catalog.ts","line":36,"column":9},
1269
+ sourceLocation: {"file":"packages/api/session-controller/src/skill-catalog.ts","line":35,"column":9},
1170
1270
  },
1171
1271
  ],
1172
1272
  model: {
@@ -1246,8 +1346,15 @@ export const TYPERT = {
1246
1346
  "kind": "method",
1247
1347
  "name": "openWorkspacePath",
1248
1348
  "signature": "@Remote('openWorkspacePath') async openWorkspacePath( request: SessionOpenWorkspacePathRequest, signal: AbortSignal, ): Promise<SessionOpenWorkspacePathValue>",
1249
- "summary": "Open one path prepared by a Session-aware caller on the Host desktop.",
1250
- "jsDoc": "/**\n * Open one path prepared by a Session-aware caller on the Host desktop.\n * @param request - path after best-effort Session workspace resolution.\n * @param signal - caller lifetime; abort terminates the native command.\n * @returns confirmation after the native opener accepts the path.\n * @throws RemoteError when the request is invalid, cancelled, or the opener fails.\n */"
1349
+ "summary": "Verify one path through the composed filesystem and open it on the Host desktop.",
1350
+ "jsDoc": "/**\n * Verify one path through the composed filesystem and open it on the Host desktop.\n * @param request - path after best-effort Session workspace resolution.\n * @param signal - caller lifetime; abort terminates the native command.\n * @returns confirmation after the native opener accepts the path.\n * @throws RemoteError when the request is invalid, has no verified Host mapping, is cancelled, or the opener fails.\n */"
1351
+ },
1352
+ {
1353
+ "kind": "method",
1354
+ "name": "workspacePathApplications",
1355
+ "signature": "@Remote('workspacePathApplications') async workspacePathApplications( request: { readonly path: string }, signal: AbortSignal, ): Promise<readonly SessionWorkspacePathApplication[]>",
1356
+ "summary": "Query current file handlers on the serving desktop without activating an Agent.",
1357
+ "jsDoc": "/**\n * Query current file handlers on the serving desktop without activating an Agent.\n * @param request - file path in Host filesystem syntax.\n * @param signal - caller lifetime, propagated to filesystem and desktop queries.\n * @returns OS application names, icons, and default selection; empty when desktop opening is unavailable.\n * @throws RemoteError when the path is invalid, the query is cancelled, or native discovery fails.\n */"
1251
1358
  },
1252
1359
  {
1253
1360
  "kind": "method",
@@ -1260,8 +1367,8 @@ export const TYPERT = {
1260
1367
  "kind": "method",
1261
1368
  "name": "fork",
1262
1369
  "signature": "@Remote('fork') fork(request: SessionForkRequest): Promise<SessionForkValue>",
1263
- "summary": "Fork one cold-readable completed-turn prefix into a new Session.",
1264
- "jsDoc": "/**\n * Fork one cold-readable completed-turn prefix into a new Session.\n * @param request - source Session and optional event anchor.\n * @returns the new Session identity.\n */"
1370
+ "summary": "Fork one cold-readable exact event prefix into a new Session.",
1371
+ "jsDoc": "/**\n * Fork one cold-readable exact event prefix into a new Session. An omitted\n * boundary selects the latest completed-turn prefix; an open cut receives\n * synthetic fork closers.\n * @param request - source Session and optional exact inclusive event boundary.\n * @returns the new Session identity.\n */"
1265
1372
  },
1266
1373
  {
1267
1374
  "kind": "method",
@@ -1305,6 +1412,13 @@ export const TYPERT = {
1305
1412
  "summary": "Follow one Session log from its opening or resume cursor.",
1306
1413
  "jsDoc": "/**\n * Follow one Session log from its opening or resume cursor.\n * @param request - durable address and last committed sequence already held by the caller.\n * @param signal - cancellation owned by the Remote stream carrier.\n * @returns a complete opening snapshot followed by gap-free durable event\n * frames and optional cursorless assistant-stream frames.\n */"
1307
1414
  },
1415
+ {
1416
+ "kind": "method",
1417
+ "name": "projections",
1418
+ "signature": "@Remote('projections') async projections(request: SessionProjectionsRequest, signal: AbortSignal): Promise<SessionProjectionsValue>",
1419
+ "summary": "Read all registered projections without activating an Agent.",
1420
+ "jsDoc": "/**\n * Read all registered projections without activating an Agent.\n * @param request - Session whose current values are required.\n * @param signal - cancellation for the Session observation.\n * @returns complete baseline, or null when the Session does not exist.\n */"
1421
+ },
1308
1422
  {
1309
1423
  "kind": "method",
1310
1424
  "name": "control",
@@ -1356,7 +1470,7 @@ export const TYPERT = {
1356
1470
  },
1357
1471
  {
1358
1472
  "name": "AssistantMessage",
1359
- "declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
1473
+ "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
1360
1474
  },
1361
1475
  {
1362
1476
  "name": "AssistantProviderMetadata",
@@ -1394,6 +1508,10 @@ export const TYPERT = {
1394
1508
  "name": "CommandSourceMap",
1395
1509
  "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
1396
1510
  },
1511
+ {
1512
+ "name": "CompactionCheckpointSource",
1513
+ "declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
1514
+ },
1397
1515
  {
1398
1516
  "name": "CompactionId",
1399
1517
  "declaration": "export type CompactionId = Branded<'CompactionId'>;"
@@ -1404,7 +1522,7 @@ export const TYPERT = {
1404
1522
  },
1405
1523
  {
1406
1524
  "name": "ContentBlockMap",
1407
- "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
1525
+ "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-addition': ToolAdditionBlock;\n 'tool-removal': ToolRemovalBlock;\n}"
1408
1526
  },
1409
1527
  {
1410
1528
  "name": "ContentBlockType",
@@ -1422,9 +1540,13 @@ export const TYPERT = {
1422
1540
  "name": "ContinuableSubagentDescriptorData",
1423
1541
  "declaration": "export interface ContinuableSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'continuable';\n readonly label: string;\n readonly agentProvider?: string;\n readonly agentModel?: string;\n readonly agentReasoningEffort?: ReasoningEffortId;\n readonly persona?: string;\n readonly toolFilter?: ToolRestriction;\n}"
1424
1542
  },
1543
+ {
1544
+ "name": "DeveloperMessage",
1545
+ "declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
1546
+ },
1425
1547
  {
1426
1548
  "name": "EpochHeader",
1427
- "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n}"
1549
+ "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
1428
1550
  },
1429
1551
  {
1430
1552
  "name": "FeedbackCategory",
@@ -1534,6 +1656,10 @@ export const TYPERT = {
1534
1656
  "name": "JsonValue",
1535
1657
  "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
1536
1658
  },
1659
+ {
1660
+ "name": "KnownCatalogMode",
1661
+ "declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
1662
+ },
1537
1663
  {
1538
1664
  "name": "LlmAttemptId",
1539
1665
  "declaration": "export type LlmAttemptId = Branded<'LlmAttemptId'>;"
@@ -1552,7 +1678,11 @@ export const TYPERT = {
1552
1678
  },
1553
1679
  {
1554
1680
  "name": "Message",
1555
- "declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
1681
+ "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
1682
+ },
1683
+ {
1684
+ "name": "MessageBase",
1685
+ "declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
1556
1686
  },
1557
1687
  {
1558
1688
  "name": "MessageFeedbackDelete",
@@ -1578,13 +1708,17 @@ export const TYPERT = {
1578
1708
  "name": "MessageId",
1579
1709
  "declaration": "export type MessageId = Branded<'MessageId'>;"
1580
1710
  },
1711
+ {
1712
+ "name": "MessageRoleMap",
1713
+ "declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
1714
+ },
1581
1715
  {
1582
1716
  "name": "MessageSource",
1583
1717
  "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
1584
1718
  },
1585
1719
  {
1586
1720
  "name": "MessageSourceMap",
1587
- "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
1721
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n}"
1588
1722
  },
1589
1723
  {
1590
1724
  "name": "ModelCatalog",
@@ -1622,6 +1756,10 @@ export const TYPERT = {
1622
1756
  "name": "ModelSelectionProjection",
1623
1757
  "declaration": "export interface ModelSelectionProjection {\n readonly lastUsed: ModelSelection | null;\n readonly next: ModelSelection | null;\n}"
1624
1758
  },
1759
+ {
1760
+ "name": "NativeFileApplication",
1761
+ "declaration": "export interface NativeFileApplication {\n readonly id: string;\n readonly name: string;\n readonly default: boolean;\n readonly icon: string | null;\n}"
1762
+ },
1625
1763
  {
1626
1764
  "name": "OfficeToPdfErrorCode",
1627
1765
  "declaration": "export type OfficeToPdfErrorCode = 'input-too-large' | 'output-too-large' | 'invalid-document' | 'unsupported-format' | 'invalid-output' | 'timeout' | 'unavailable' | 'failed' | 'busy' | 'source-changed';"
@@ -1656,7 +1794,7 @@ export const TYPERT = {
1656
1794
  },
1657
1795
  {
1658
1796
  "name": "QueueAction",
1659
- "declaration": "export type QueueAction = { readonly kind: 'edit'; readonly content: readonly ContentBlock[]; } | { readonly kind: 'remove'; } | { readonly kind: 'steer'; };"
1797
+ "declaration": "export type QueueAction = { readonly kind: 'edit'; readonly content: readonly TextBlock[]; } | { readonly kind: 'remove'; } | { readonly kind: 'steer'; };"
1660
1798
  },
1661
1799
  {
1662
1800
  "name": "ReasoningBlock",
@@ -1676,7 +1814,7 @@ export const TYPERT = {
1676
1814
  },
1677
1815
  {
1678
1816
  "name": "RemoteErrorDetailsMap",
1679
- "declaration": "export interface RemoteErrorDetailsMap {\n 'gateway/bad-request': { readonly issues?: readonly object[]; };\n 'gateway/cancelled': {};\n 'gateway/internal': {};\n 'llm/model-discovery-rejected': { readonly settingsNs: string; readonly baseURL?: string; };\n 'session/not-found': { readonly sessionId: SessionId; };\n 'agent-preset/not-found': { readonly agentPreset: string; readonly available: readonly string[]; };\n 'agent-preset/invalid': { readonly agentPreset: string; readonly reason: string; };\n 'agent-preset/read-only': { readonly agentPreset: string; readonly reason: string; };\n 'agent-preset/locked': { readonly sessionId: SessionId; readonly agentPreset: string; };\n 'workspace/not-found': { readonly workspaceId: WorkspaceId; };\n 'session/model-unavailable': { readonly provider: string; readonly model: string; };\n 'session/conflict': { readonly sessionId: SessionId; readonly requestedCwd: string; readonly existingCwd?: string; };\n 'session/writer-held': { readonly sessionId: SessionId; };\n 'session/agent-busy': { readonly reason: string; };\n 'session/invalid-time-zone': { readonly value: string; };\n 'session/workspace-attach-failed': { readonly sessionId: SessionId; readonly workspaceId: string; };\n 'agent-preset/conflict': { readonly sessionId: SessionId; readonly requestedPreset: string; readonly existingPreset?: string; };\n 'session/attachment-invalid': { readonly reason: string; };\n 'session/queue-item-not-found': { readonly itemId: MessageId; };\n 'session/steer-unavailable': { readonly itemId: MessageId; };\n 'session/title-invalid': { readonly sessionId: SessionId; };\n 'session/fork-unavailable': { readonly sessionId: SessionId; };\n 'subagent/not-found': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; };\n 'subagent/catalog-diagnostic': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; readonly reason: 'corrupt' | 'unsupported' | 'unavailable'; };\n 'subagent/invalid-time-zone': { readonly value: string; };\n 'subagent/parent-unavailable': { readonly parentSessionId: SessionId; };\n 'subagent/not-resumable': { readonly childSessionId: SessionId; };\n 'subagent/unauthorized': { readonly childSessionId: SessionId; };\n 'subagent/attachment-invalid': { readonly reason: string; };\n 'subagent/delivery-unavailable': { readonly childSessionId: SessionId; };\n 'subagent/projections-unavailable': {};\n 'settings/rejected': { readonly ns: string; };\n 'settings/conflict': { readonly ns: string; readonly expected: number; readonly actual: number; };\n 'credential/rejected': { readonly ref: string; };\n 'terminal/unavailable': Record<string, never>;\n 'terminal/control-unavailable': { readonly reason: 'read-only' | 'not-running'; };\n 'terminal/limit-reached': { readonly limit: number; };\n 'workspace/invalid-path': { readonly path: string; };\n 'workspace/name-conflict': { readonly name: string; };\n 'workspace/move-invalid': { readonly workspaceId: WorkspaceId; readonly sessionId: SessionId; readonly beforeSessionId?: SessionId; };\n 'directory-picker/unavailable': { readonly capability: string; };\n 'directory-picker/unreadable': { readonly path: string; };\n 'directory-picker/exists': { readonly path: string; };\n 'directory-picker/create-failed': { readonly path: string; };\n 'workspace-file/not-found': { readonly path: string; };\n 'workspace-file/outside-workspace': { readonly path: string; };\n 'workspace-file/too-large': { readonly path: string; readonly limit: number; };\n 'workspace-file/not-text': { readonly path: string; };\n 'workspace-file/not-regular-file': { readonly path: string; readonly kind: 'directory' | 'symlink' | 'other'; };\n 'workspace-file/not-directory': { readonly path: string; readonly kind: 'file' | 'symlink' | 'other'; };\n 'document-render/failed': { readonly reason: OfficeToPdfErrorCode; };\n}"
1817
+ "declaration": "export interface RemoteErrorDetailsMap {\n 'gateway/bad-request': { readonly issues?: readonly object[]; };\n 'gateway/cancelled': {};\n 'gateway/internal': {};\n 'llm/model-discovery-rejected': { readonly settingsNs: string; readonly baseURL?: string; };\n 'session/not-found': { readonly sessionId: SessionId; };\n 'workspace/not-found': { readonly workspaceId: WorkspaceId; };\n 'agent-preset/not-found': { readonly agentPreset: string; readonly available: readonly string[]; };\n 'agent-preset/invalid': { readonly agentPreset: string; readonly reason: string; };\n 'agent-preset/locked': { readonly sessionId: SessionId; readonly agentPreset: string; };\n 'job/not-found': { readonly sessionId: SessionId; readonly jobId: JobId; };\n 'session/model-unavailable': { readonly provider: string; readonly model: string; };\n 'session/conflict': { readonly sessionId: SessionId; readonly requestedCwd: string; readonly existingCwd?: string; };\n 'session/projections-unavailable': Record<string, never>;\n 'session/writer-held': { readonly sessionId: SessionId; };\n 'session/agent-busy': { readonly reason: string; };\n 'session/invalid-time-zone': { readonly value: string; };\n 'session/workspace-attach-failed': { readonly sessionId: SessionId; readonly workspaceId: string; };\n 'agent-preset/conflict': { readonly sessionId: SessionId; readonly requestedPreset: string; readonly existingPreset?: string; };\n 'session/attachment-invalid': { readonly reason: string; };\n 'session/queue-item-not-found': { readonly itemId: MessageId; };\n 'session/steer-unavailable': { readonly itemId: MessageId; };\n 'session/title-invalid': { readonly sessionId: SessionId; };\n 'session/fork-unavailable': { readonly sessionId: SessionId; };\n 'subagent/not-found': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; };\n 'subagent/catalog-diagnostic': { readonly parentSessionId: SessionId; readonly childSessionId: SessionId; readonly reason: 'corrupt' | 'unsupported' | 'unavailable'; };\n 'subagent/invalid-time-zone': { readonly value: string; };\n 'subagent/parent-unavailable': { readonly parentSessionId: SessionId; };\n 'subagent/not-resumable': { readonly childSessionId: SessionId; };\n 'subagent/unauthorized': { readonly childSessionId: SessionId; };\n 'subagent/attachment-invalid': { readonly reason: string; };\n 'subagent/delivery-unavailable': { readonly childSessionId: SessionId; };\n 'settings/rejected': { readonly ns: string; };\n 'settings/conflict': { readonly ns: string; readonly expected: number; readonly actual: number; };\n 'credential/rejected': { readonly ref: string; };\n 'terminal/unavailable': Record<string, never>;\n 'terminal/control-unavailable': { readonly reason: 'read-only' | 'not-running'; };\n 'terminal/limit-reached': { readonly limit: number; };\n 'workspace/invalid-path': { readonly path: string; };\n 'workspace/name-conflict': { readonly name: string; };\n 'workspace/session-active': { readonly sessionId: SessionId; readonly activity: readonly SessionActivity[]; };\n 'workspace/move-invalid': { readonly workspaceId: WorkspaceId; readonly sessionId: SessionId; readonly beforeSessionId?: SessionId; };\n 'directory-picker/unavailable': { readonly capability: string; };\n 'directory-picker/unreadable': { readonly path: string; };\n 'directory-picker/exists': { readonly path: string; };\n 'directory-picker/create-failed': { readonly path: string; };\n 'workspace-file/watch-unsupported': { readonly path: string; };\n 'workspace-file/not-found': { readonly path: string; };\n 'workspace-file/outside-workspace': { readonly path: string; };\n 'workspace-file/too-large': { readonly path: string; readonly limit: number; };\n 'workspace-file/not-text': { readonly path: string; };\n 'workspace-file/not-regular-file': { readonly path: string; readonly kind: 'directory' | 'symlink' | 'other'; };\n 'workspace-file/not-directory': { readonly path: string; readonly kind: 'file' | 'symlink' | 'other'; };\n 'speech/invalid-audio': { readonly reason: string; };\n 'speech/transcription-failed': { readonly reason: string; };\n 'document-render/failed': { readonly reason: OfficeToPdfErrorCode; };\n}"
1680
1818
  },
1681
1819
  {
1682
1820
  "name": "ReplayEnvelope",
@@ -1696,11 +1834,27 @@ export const TYPERT = {
1696
1834
  },
1697
1835
  {
1698
1836
  "name": "Session",
1699
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
1837
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
1838
+ },
1839
+ {
1840
+ "name": "SessionActivity",
1841
+ "declaration": "export interface SessionActivity {\n readonly kind: SessionActivityKind;\n readonly items?: readonly SessionActivityItem[];\n}"
1842
+ },
1843
+ {
1844
+ "name": "SessionActivityItem",
1845
+ "declaration": "export interface SessionActivityItem {\n readonly id: string;\n readonly label?: string;\n}"
1846
+ },
1847
+ {
1848
+ "name": "SessionActivityKind",
1849
+ "declaration": "export type SessionActivityKind = keyof SessionActivityKindMap;"
1850
+ },
1851
+ {
1852
+ "name": "SessionActivityKindMap",
1853
+ "declaration": "export interface SessionActivityKindMap {\n turn: true;\n job: true;\n subagent: true;\n}"
1700
1854
  },
1701
1855
  {
1702
1856
  "name": "SessionAddress",
1703
- "declaration": "export type SessionAddress = { readonly kind: 'session'; readonly sessionId: SessionId; } | { readonly kind: 'subagent'; readonly parentSessionId: SessionId; readonly childSessionId: SessionId; readonly mode: 'one-shot' | 'continuable'; };"
1857
+ "declaration": "export type SessionAddress = { readonly kind: 'session'; readonly sessionId: SessionId; } | { readonly kind: 'subagent'; readonly parentSessionId: SessionId; readonly childSessionId: SessionId; readonly mode: 'one-shot' | 'continuable' | 'unknown'; };"
1704
1858
  },
1705
1859
  {
1706
1860
  "name": "SessionAssistantStreamAttempt",
@@ -1732,11 +1886,11 @@ export const TYPERT = {
1732
1886
  },
1733
1887
  {
1734
1888
  "name": "SessionControlBaseline",
1735
- "declaration": "export interface SessionControlBaseline {\n readonly jobs: Readonly<Record<SessionId, readonly SessionJob[]>>;\n readonly projections: Readonly<Record<SessionId, SessionProjectionBaseline>>;\n}"
1889
+ "declaration": "export interface SessionControlBaseline {\n readonly projections: Readonly<Record<SessionId, SessionProjectionBaseline>>;\n}"
1736
1890
  },
1737
1891
  {
1738
1892
  "name": "SessionControlFrame",
1739
- "declaration": "export type SessionControlFrame = { readonly type: 'baseline'; readonly value: SessionControlBaseline; } | { readonly type: 'jobs'; readonly sessionId: SessionId; readonly jobs: readonly SessionJob[]; } | ({ readonly type: 'projection'; } & SessionProjectionUpdate);"
1893
+ "declaration": "export type SessionControlFrame = { readonly type: 'baseline'; readonly value: SessionControlBaseline; } | ({ readonly type: 'projection'; } & SessionProjectionUpdate);"
1740
1894
  },
1741
1895
  {
1742
1896
  "name": "SessionCreateRequest",
@@ -1756,7 +1910,7 @@ export const TYPERT = {
1756
1910
  },
1757
1911
  {
1758
1912
  "name": "SessionEventMap",
1759
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
1913
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
1760
1914
  },
1761
1915
  {
1762
1916
  "name": "SessionEventType",
@@ -1768,7 +1922,7 @@ export const TYPERT = {
1768
1922
  },
1769
1923
  {
1770
1924
  "name": "SessionFollowRequest",
1771
- "declaration": "export interface SessionFollowRequest {\n readonly address: SessionAddress;\n readonly maxMessages?: number;\n readonly assistantStream?: true;\n}"
1925
+ "declaration": "export interface SessionFollowRequest extends Pick<SessionPageRequest, 'maxMessages' | 'turnWindow'> {\n readonly address: SessionAddress;\n readonly assistantStream?: true;\n}"
1772
1926
  },
1773
1927
  {
1774
1928
  "name": "SessionForkRequest",
@@ -1794,10 +1948,6 @@ export const TYPERT = {
1794
1948
  "name": "SessionInspection",
1795
1949
  "declaration": "export interface SessionInspection extends SessionStorageMetadata {\n readonly events: readonly SessionEvent[];\n}"
1796
1950
  },
1797
- {
1798
- "name": "SessionJob",
1799
- "declaration": "export interface SessionJob {\n readonly id: JobId;\n readonly kind: string;\n readonly label: string;\n readonly status: 'running' | 'stopping' | 'completed' | 'killed' | 'failed';\n readonly detail?: string;\n readonly startedAt: number;\n readonly finishedAt?: number;\n}"
1800
- },
1801
1951
  {
1802
1952
  "name": "SessionListMetadata",
1803
1953
  "declaration": "export interface SessionListMetadata {\n readonly blank: boolean;\n readonly lastPromptAt: number | null;\n}"
@@ -1816,7 +1966,7 @@ export const TYPERT = {
1816
1966
  },
1817
1967
  {
1818
1968
  "name": "SessionOpenWorkspacePathRequest",
1819
- "declaration": "export interface SessionOpenWorkspacePathRequest {\n readonly action?: 'reveal';\n readonly path: string;\n}"
1969
+ "declaration": "export interface SessionOpenWorkspacePathRequest {\n readonly action?: 'reveal';\n readonly application?: string;\n readonly path: string;\n}"
1820
1970
  },
1821
1971
  {
1822
1972
  "name": "SessionOpenWorkspacePathValue",
@@ -1828,7 +1978,7 @@ export const TYPERT = {
1828
1978
  },
1829
1979
  {
1830
1980
  "name": "SessionPageRequest",
1831
- "declaration": "export interface SessionPageRequest {\n readonly address: SessionAddress;\n readonly throughSeq: number;\n readonly beforeSeq?: number;\n readonly maxMessages?: number;\n}"
1981
+ "declaration": "export interface SessionPageRequest {\n readonly address: SessionAddress;\n readonly throughSeq: number;\n readonly beforeSeq?: number;\n readonly maxMessages?: number;\n readonly turnWindow?: { readonly minMessages: number; readonly minTurns: number; };\n}"
1832
1982
  },
1833
1983
  {
1834
1984
  "name": "SessionProjectionBaseline",
@@ -1836,12 +1986,20 @@ export const TYPERT = {
1836
1986
  },
1837
1987
  {
1838
1988
  "name": "SessionProjectionHints",
1839
- "declaration": "export interface SessionProjectionHints {\n readonly asOfSeq: number;\n readonly values: SessionProjectionValues;\n}"
1989
+ "declaration": "export interface SessionProjectionHints {\n readonly kind: 'cached' | 'sequenced';\n readonly asOfSeq: number;\n readonly values: SessionProjectionValues;\n}"
1840
1990
  },
1841
1991
  {
1842
1992
  "name": "SessionProjectionMap",
1843
1993
  "declaration": "export interface SessionProjectionMap {\n inbox: InboxWireState;\n agentPreset: string | null;\n title: string | null;\n todos: TodoItem[] | null;\n sessionListMetadata: SessionListMetadata;\n imageLimits: ImageAttachmentLimits;\n modelSelection: ModelSelectionProjection;\n permissions: PermissionSelection;\n subagentCatalog: SubagentCatalogEntry[];\n subagentTiming: SubagentTimingProjection;\n subagent: SubagentIdentityProjection | null;\n goal: GoalProjection | null;\n}"
1844
1994
  },
1995
+ {
1996
+ "name": "SessionProjectionsRequest",
1997
+ "declaration": "export interface SessionProjectionsRequest {\n readonly sessionId: SessionId;\n}"
1998
+ },
1999
+ {
2000
+ "name": "SessionProjectionsValue",
2001
+ "declaration": "export type SessionProjectionsValue = SessionProjectionBaseline | null;"
2002
+ },
1845
2003
  {
1846
2004
  "name": "SessionProjectionUpdate",
1847
2005
  "declaration": "export interface SessionProjectionUpdate {\n readonly sessionId: SessionId;\n readonly key: string;\n readonly value: JsonValue;\n readonly seq: number;\n}"
@@ -1912,7 +2070,7 @@ export const TYPERT = {
1912
2070
  },
1913
2071
  {
1914
2072
  "name": "SessionSummary",
1915
- "declaration": "export interface SessionSummary {\n readonly sessionId: SessionId;\n readonly updatedAt: number;\n readonly running: boolean;\n readonly blank: boolean;\n readonly parentSessionId?: SessionId;\n readonly origin?: 'subagent';\n readonly cwd?: string;\n readonly projections?: SessionProjectionHints;\n}"
2073
+ "declaration": "export interface SessionSummary {\n readonly agentAvailable: boolean;\n readonly sessionId: SessionId;\n readonly updatedAt: number;\n readonly running: boolean;\n readonly blank: boolean;\n readonly parentSessionId?: SessionId;\n readonly origin?: 'subagent';\n readonly cwd?: string;\n readonly projections?: SessionProjectionHints;\n}"
1916
2074
  },
1917
2075
  {
1918
2076
  "name": "SessionSurface",
@@ -1950,6 +2108,10 @@ export const TYPERT = {
1950
2108
  "name": "SessionWireHeader",
1951
2109
  "declaration": "export interface SessionWireHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded: boolean;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
1952
2110
  },
2111
+ {
2112
+ "name": "SessionWorkspacePathApplication",
2113
+ "declaration": "export type SessionWorkspacePathApplication = NativeFileApplication;"
2114
+ },
1953
2115
  {
1954
2116
  "name": "SkillInvocationSource",
1955
2117
  "declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
@@ -1960,11 +2122,11 @@ export const TYPERT = {
1960
2122
  },
1961
2123
  {
1962
2124
  "name": "SubagentCatalogEntry",
1963
- "declaration": "export type SubagentCatalogEntry = { readonly id: SessionId; readonly createdAt: number; } & ({ readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; });"
2125
+ "declaration": "export type SubagentCatalogEntry = { readonly id: SessionId; readonly createdAt: number; } & ({ readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; } | { readonly mode: 'unknown'; readonly label?: string; });"
1964
2126
  },
1965
2127
  {
1966
2128
  "name": "SubagentCatalogEvent",
1967
- "declaration": "export type SubagentCatalogEvent = { readonly version: 0; readonly childId: SessionId; readonly childCreatedAt: number; } & ({ readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; });"
2129
+ "declaration": "export type SubagentCatalogEvent = { readonly childId: SessionId; readonly childCreatedAt: number; } & (({ readonly version: 0; } & KnownCatalogMode) | ({ readonly version: 1; } & (KnownCatalogMode | { readonly mode: 'unknown'; readonly label?: string; })));"
1968
2130
  },
1969
2131
  {
1970
2132
  "name": "SubagentDescriptorBase",
@@ -1984,11 +2146,11 @@ export const TYPERT = {
1984
2146
  },
1985
2147
  {
1986
2148
  "name": "SubagentTimingProjection",
1987
- "declaration": "export interface SubagentTimingProjection {\n settledMs: number;\n active?: { since: number; through: number; };\n}"
2149
+ "declaration": "export interface SubagentTimingProjection {\n settledMs: number;\n active?: { since: number; through: number; };\n lastTurnCompleted?: boolean;\n}"
1988
2150
  },
1989
2151
  {
1990
2152
  "name": "SurfaceEventType",
1991
- "declaration": "export type SurfaceEventType = 'system/message' | 'user/message' | 'assistant/message' | 'tool/result';"
2153
+ "declaration": "export type SurfaceEventType = 'system/message' | 'developer/message' | 'user/message' | 'assistant/message' | 'tool/result';"
1992
2154
  },
1993
2155
  {
1994
2156
  "name": "SurfaceIntent",
@@ -2000,7 +2162,11 @@ export const TYPERT = {
2000
2162
  },
2001
2163
  {
2002
2164
  "name": "SystemMessage",
2003
- "declaration": "export interface SystemMessage extends Message {\n readonly role: 'system';\n readonly source: MessageSourceMap['plugin'];\n}"
2165
+ "declaration": "export interface SystemMessage extends MessageBase {\n readonly role: 'system';\n readonly source: MessageSourceMap['system-prompt'];\n}"
2166
+ },
2167
+ {
2168
+ "name": "SystemPromptMessageSource",
2169
+ "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
2004
2170
  },
2005
2171
  {
2006
2172
  "name": "SystemPromptUpdate",
@@ -2054,6 +2220,10 @@ export const TYPERT = {
2054
2220
  "name": "TokenUsage",
2055
2221
  "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
2056
2222
  },
2223
+ {
2224
+ "name": "ToolAdditionBlock",
2225
+ "declaration": "export interface ToolAdditionBlock {\n type: 'tool-addition';\n toolName: string;\n tool?: never;\n}"
2226
+ },
2057
2227
  {
2058
2228
  "name": "ToolCallBlock",
2059
2229
  "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
@@ -2067,20 +2237,20 @@ export const TYPERT = {
2067
2237
  "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
2068
2238
  },
2069
2239
  {
2070
- "name": "ToolRestriction",
2071
- "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
2240
+ "name": "ToolRemovalBlock",
2241
+ "declaration": "export interface ToolRemovalBlock {\n type: 'tool-removal';\n toolName: string;\n}"
2072
2242
  },
2073
2243
  {
2074
- "name": "ToolResultBlock",
2075
- "declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: ToolCallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
2244
+ "name": "ToolRestriction",
2245
+ "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
2076
2246
  },
2077
2247
  {
2078
2248
  "name": "ToolResultMessage",
2079
- "declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
2249
+ "declaration": "export interface ToolResultMessage extends MessageBase {\n readonly role: 'tool';\n readonly source: ToolMessageSource;\n readonly toolCallId: ToolCallId;\n readonly isError?: boolean;\n}"
2080
2250
  },
2081
2251
  {
2082
2252
  "name": "ToolSchema",
2083
- "declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
2253
+ "declaration": "export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
2084
2254
  },
2085
2255
  {
2086
2256
  "name": "TurnEndCancelCause",
@@ -2092,11 +2262,11 @@ export const TYPERT = {
2092
2262
  },
2093
2263
  {
2094
2264
  "name": "TurnEndReasonMap",
2095
- "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n}"
2265
+ "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n forked: { kind: 'forked'; };\n}"
2096
2266
  },
2097
2267
  {
2098
2268
  "name": "UserMessage",
2099
- "declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
2269
+ "declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
2100
2270
  },
2101
2271
  {
2102
2272
  "name": "WorkspaceId",
@@ -2155,7 +2325,7 @@ export const TYPERT = {
2155
2325
  },
2156
2326
  {
2157
2327
  "name": "AssistantMessage",
2158
- "declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
2328
+ "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
2159
2329
  },
2160
2330
  {
2161
2331
  "name": "AssistantProviderMetadata",
@@ -2193,6 +2363,10 @@ export const TYPERT = {
2193
2363
  "name": "CommandSourceMap",
2194
2364
  "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
2195
2365
  },
2366
+ {
2367
+ "name": "CompactionCheckpointSource",
2368
+ "declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
2369
+ },
2196
2370
  {
2197
2371
  "name": "CompactionId",
2198
2372
  "declaration": "export type CompactionId = Branded<'CompactionId'>;"
@@ -2203,7 +2377,7 @@ export const TYPERT = {
2203
2377
  },
2204
2378
  {
2205
2379
  "name": "ContentBlockMap",
2206
- "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
2380
+ "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-addition': ToolAdditionBlock;\n 'tool-removal': ToolRemovalBlock;\n}"
2207
2381
  },
2208
2382
  {
2209
2383
  "name": "ContentBlockType",
@@ -2221,9 +2395,13 @@ export const TYPERT = {
2221
2395
  "name": "ContinuableSubagentDescriptorData",
2222
2396
  "declaration": "export interface ContinuableSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'continuable';\n readonly label: string;\n readonly agentProvider?: string;\n readonly agentModel?: string;\n readonly agentReasoningEffort?: ReasoningEffortId;\n readonly persona?: string;\n readonly toolFilter?: ToolRestriction;\n}"
2223
2397
  },
2398
+ {
2399
+ "name": "DeveloperMessage",
2400
+ "declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
2401
+ },
2224
2402
  {
2225
2403
  "name": "EpochHeader",
2226
- "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n}"
2404
+ "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
2227
2405
  },
2228
2406
  {
2229
2407
  "name": "FeedbackCategory",
@@ -2321,6 +2499,10 @@ export const TYPERT = {
2321
2499
  "name": "JsonValue",
2322
2500
  "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
2323
2501
  },
2502
+ {
2503
+ "name": "KnownCatalogMode",
2504
+ "declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
2505
+ },
2324
2506
  {
2325
2507
  "name": "LlmCallConfig",
2326
2508
  "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
@@ -2335,7 +2517,11 @@ export const TYPERT = {
2335
2517
  },
2336
2518
  {
2337
2519
  "name": "Message",
2338
- "declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
2520
+ "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
2521
+ },
2522
+ {
2523
+ "name": "MessageBase",
2524
+ "declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
2339
2525
  },
2340
2526
  {
2341
2527
  "name": "MessageFeedbackDelete",
@@ -2361,13 +2547,17 @@ export const TYPERT = {
2361
2547
  "name": "MessageId",
2362
2548
  "declaration": "export type MessageId = Branded<'MessageId'>;"
2363
2549
  },
2550
+ {
2551
+ "name": "MessageRoleMap",
2552
+ "declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
2553
+ },
2364
2554
  {
2365
2555
  "name": "MessageSource",
2366
2556
  "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
2367
2557
  },
2368
2558
  {
2369
2559
  "name": "MessageSourceMap",
2370
- "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
2560
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n}"
2371
2561
  },
2372
2562
  {
2373
2563
  "name": "ModelMessageSource",
@@ -2423,7 +2613,7 @@ export const TYPERT = {
2423
2613
  },
2424
2614
  {
2425
2615
  "name": "Session",
2426
- "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
2616
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
2427
2617
  },
2428
2618
  {
2429
2619
  "name": "SessionEvent",
@@ -2431,7 +2621,7 @@ export const TYPERT = {
2431
2621
  },
2432
2622
  {
2433
2623
  "name": "SessionEventMap",
2434
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
2624
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
2435
2625
  },
2436
2626
  {
2437
2627
  "name": "SessionEventType",
@@ -2491,7 +2681,7 @@ export const TYPERT = {
2491
2681
  },
2492
2682
  {
2493
2683
  "name": "SubagentCatalogEvent",
2494
- "declaration": "export type SubagentCatalogEvent = { readonly version: 0; readonly childId: SessionId; readonly childCreatedAt: number; } & ({ readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; });"
2684
+ "declaration": "export type SubagentCatalogEvent = { readonly childId: SessionId; readonly childCreatedAt: number; } & (({ readonly version: 0; } & KnownCatalogMode) | ({ readonly version: 1; } & (KnownCatalogMode | { readonly mode: 'unknown'; readonly label?: string; })));"
2495
2685
  },
2496
2686
  {
2497
2687
  "name": "SubagentDescriptorBase",
@@ -2507,7 +2697,7 @@ export const TYPERT = {
2507
2697
  },
2508
2698
  {
2509
2699
  "name": "SurfaceEventType",
2510
- "declaration": "export type SurfaceEventType = 'system/message' | 'user/message' | 'assistant/message' | 'tool/result';"
2700
+ "declaration": "export type SurfaceEventType = 'system/message' | 'developer/message' | 'user/message' | 'assistant/message' | 'tool/result';"
2511
2701
  },
2512
2702
  {
2513
2703
  "name": "SurfaceIntent",
@@ -2519,7 +2709,11 @@ export const TYPERT = {
2519
2709
  },
2520
2710
  {
2521
2711
  "name": "SystemMessage",
2522
- "declaration": "export interface SystemMessage extends Message {\n readonly role: 'system';\n readonly source: MessageSourceMap['plugin'];\n}"
2712
+ "declaration": "export interface SystemMessage extends MessageBase {\n readonly role: 'system';\n readonly source: MessageSourceMap['system-prompt'];\n}"
2713
+ },
2714
+ {
2715
+ "name": "SystemPromptMessageSource",
2716
+ "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
2523
2717
  },
2524
2718
  {
2525
2719
  "name": "SystemPromptUpdate",
@@ -2573,6 +2767,10 @@ export const TYPERT = {
2573
2767
  "name": "TokenUsage",
2574
2768
  "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
2575
2769
  },
2770
+ {
2771
+ "name": "ToolAdditionBlock",
2772
+ "declaration": "export interface ToolAdditionBlock {\n type: 'tool-addition';\n toolName: string;\n tool?: never;\n}"
2773
+ },
2576
2774
  {
2577
2775
  "name": "ToolCallBlock",
2578
2776
  "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
@@ -2586,20 +2784,20 @@ export const TYPERT = {
2586
2784
  "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
2587
2785
  },
2588
2786
  {
2589
- "name": "ToolRestriction",
2590
- "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
2787
+ "name": "ToolRemovalBlock",
2788
+ "declaration": "export interface ToolRemovalBlock {\n type: 'tool-removal';\n toolName: string;\n}"
2591
2789
  },
2592
2790
  {
2593
- "name": "ToolResultBlock",
2594
- "declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: ToolCallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
2791
+ "name": "ToolRestriction",
2792
+ "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
2595
2793
  },
2596
2794
  {
2597
2795
  "name": "ToolResultMessage",
2598
- "declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
2796
+ "declaration": "export interface ToolResultMessage extends MessageBase {\n readonly role: 'tool';\n readonly source: ToolMessageSource;\n readonly toolCallId: ToolCallId;\n readonly isError?: boolean;\n}"
2599
2797
  },
2600
2798
  {
2601
2799
  "name": "ToolSchema",
2602
- "declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
2800
+ "declaration": "export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
2603
2801
  },
2604
2802
  {
2605
2803
  "name": "TurnEndCancelCause",
@@ -2611,11 +2809,11 @@ export const TYPERT = {
2611
2809
  },
2612
2810
  {
2613
2811
  "name": "TurnEndReasonMap",
2614
- "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n}"
2812
+ "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n forked: { kind: 'forked'; };\n}"
2615
2813
  },
2616
2814
  {
2617
2815
  "name": "UserMessage",
2618
- "declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
2816
+ "declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
2619
2817
  }
2620
2818
  ]
2621
2819
  },
@@ -2688,8 +2886,8 @@ export const TYPERT = {
2688
2886
  "signature": "'api-session/activity'(sessionId: SessionId, updatedAt: number): void"
2689
2887
  },
2690
2888
  {
2691
- "description": "A Session became visible to Session list consumers.",
2692
- "summary": "A Session became visible to Session list consumers.",
2889
+ "description": "A Session became visible or its Agent was created or disposed. Consumers upsert the summary and replace its current running and availability state.",
2890
+ "summary": "A Session became visible or its Agent was created or disposed.",
2693
2891
  "tags": [
2694
2892
  {
2695
2893
  "name": "mode",
@@ -2699,11 +2897,11 @@ export const TYPERT = {
2699
2897
  {
2700
2898
  "name": "param",
2701
2899
  "argument": "summary",
2702
- "comment": "- initial list row for the Session.",
2703
- "text": "@param summary - initial list row for the Session."
2900
+ "comment": "- current list row for the Session.",
2901
+ "text": "@param summary - current list row for the Session."
2704
2902
  }
2705
2903
  ],
2706
- "jsDoc": "/**\n * A Session became visible to Session list consumers.\n * @mode emit\n * @param summary - initial list row for the Session.\n */",
2904
+ "jsDoc": "/**\n * A Session became visible or its Agent was created or disposed.\n * Consumers upsert the summary and replace its current running and availability state.\n * @mode emit\n * @param summary - current list row for the Session.\n */",
2707
2905
  "name": "api-session/added",
2708
2906
  "mode": "emit",
2709
2907
  "signature": "'api-session/added'(summary: SessionSummary): void"