dsh-plugin-dev-kb 1.0.9 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.en.md +14 -8
  3. package/README.md +14 -8
  4. package/docs/banner.svg +25 -0
  5. package/kb/INDEX.md +8 -2
  6. package/kb/README.md +4 -4
  7. package/kb/extra/AGENTS.md +3 -3
  8. package/kb/extra/cookbook/adding-a-remote-api.md +197 -0
  9. package/kb/extra/cookbook/adding-a-remote-api.zh.md +197 -0
  10. package/kb/extra/cookbook/adding-a-session-format-version.md +109 -0
  11. package/kb/extra/cookbook/adding-a-session-format-version.zh.md +109 -0
  12. package/kb/extra/cookbook/adding-a-vendored-package.md +1 -1
  13. package/kb/extra/cookbook/adding-a-vendored-package.zh.md +1 -1
  14. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +1 -1
  15. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  16. package/kb/extra/deepseek-llm-api-wire-extensions.md +19 -15
  17. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +19 -15
  18. package/kb/extra/development.md +13 -3
  19. package/kb/extra/development.zh.md +13 -3
  20. package/kb/extra/event-producer-consumer.md +49 -46
  21. package/kb/extra/event-producer-consumer.zh.md +52 -49
  22. package/kb/extra/i18n/README.md +2 -1
  23. package/kb/extra/i18n/README.zh.md +3 -2
  24. package/kb/extra/i18n/style-samples.md +2 -2
  25. package/kb/extra/i18n/translation-prompt.md +1 -1
  26. package/kb/extra/module-graph.md +493 -1002
  27. package/kb/extra/module-graph.zh.md +495 -1004
  28. package/kb/extra/rescope.md +1 -1
  29. package/kb/extra/rescope.zh.md +1 -1
  30. package/kb/extra/session-format-status.md +47 -0
  31. package/kb/extra/session-format-status.zh.md +47 -0
  32. package/kb/extra/subsystems/agent-team.md +3 -2
  33. package/kb/extra/subsystems/agent-team.zh.md +3 -2
  34. package/kb/extra/subsystems/attachment.md +157 -4
  35. package/kb/extra/subsystems/attachment.zh.md +157 -4
  36. package/kb/extra/subsystems/feedback.md +164 -30
  37. package/kb/extra/subsystems/feedback.zh.md +164 -30
  38. package/kb/extra/testing.md +9 -4
  39. package/kb/extra/testing.zh.md +9 -4
  40. package/kb/extra/web-styling.md +5 -0
  41. package/kb/extra/web-styling.zh.md +5 -0
  42. package/kb/meta/search-index.json +223 -151
  43. package/kb/meta/site-pages.txt +187 -181
  44. package/kb/meta/source.json +5 -5
  45. package/kb/meta/topics.md +5 -5
  46. package/kb/site/develop/basic/publish.md +1 -1
  47. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +3 -2
  48. package/kb/site/develop/practice/llm-adapter.md +4 -3
  49. package/kb/site/en/develop/basic/publish.md +1 -1
  50. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +3 -2
  51. package/kb/site/en/develop/practice/llm-adapter.md +4 -3
  52. package/kb/site/en/guide/network-proxy.md +87 -0
  53. package/kb/site/en/guide/providers.md +70 -17
  54. package/kb/site/en/guide/python-sdk.md +19 -3
  55. package/kb/site/en/guide/schedule.md +2 -0
  56. package/kb/site/en/reference/agent-lifecycle.md +17 -8
  57. package/kb/site/en/reference/api-gateway.md +2 -2
  58. package/kb/site/en/reference/capability-seams.md +24 -10
  59. package/kb/site/en/reference/config-catalog.md +322 -264
  60. package/kb/site/en/reference/cookbook/adding-a-package.md +1 -2
  61. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +10 -8
  62. package/kb/site/en/reference/cookbook/adding-a-tool.md +1 -1
  63. package/kb/site/en/reference/cookbook/extension-cookbook.md +16 -13
  64. package/kb/site/en/reference/index.md +26 -9
  65. package/kb/site/en/reference/persistence-catalog.md +189 -95
  66. package/kb/site/en/reference/subsystems/approval.md +1 -1
  67. package/kb/site/en/reference/subsystems/client-modules.md +9 -0
  68. package/kb/site/en/reference/subsystems/client-resources.md +94 -0
  69. package/kb/site/en/reference/subsystems/code-runtime.md +7 -3
  70. package/kb/site/en/reference/subsystems/commands.md +25 -16
  71. package/kb/site/en/reference/subsystems/compaction.md +10 -10
  72. package/kb/site/en/reference/subsystems/conversation.md +11 -4
  73. package/kb/site/en/reference/subsystems/core.md +173 -29
  74. package/kb/site/en/reference/subsystems/credentials.md +5 -4
  75. package/kb/site/en/reference/subsystems/filesystem.md +15 -0
  76. package/kb/site/en/reference/subsystems/goal.md +38 -2
  77. package/kb/site/en/reference/subsystems/index.md +3 -1
  78. package/kb/site/en/reference/subsystems/invariants.md +1 -1
  79. package/kb/site/en/reference/subsystems/llm-streaming.md +43 -12
  80. package/kb/site/en/reference/subsystems/lsp.md +1 -1
  81. package/kb/site/en/reference/subsystems/permission-presets.md +5 -5
  82. package/kb/site/en/reference/subsystems/persistence.md +211 -199
  83. package/kb/site/en/reference/subsystems/plan.md +3 -3
  84. package/kb/site/en/reference/subsystems/sandbox.md +2 -0
  85. package/kb/site/en/reference/subsystems/schedule.md +9 -3
  86. package/kb/site/en/reference/subsystems/scope.md +1 -1
  87. package/kb/site/en/reference/subsystems/session-projection.md +50 -24
  88. package/kb/site/en/reference/subsystems/session-query.md +19 -13
  89. package/kb/site/en/reference/subsystems/session-reference.md +29 -1
  90. package/kb/site/en/reference/subsystems/session-telemetry.md +27 -10
  91. package/kb/site/en/reference/subsystems/session-title.md +6 -6
  92. package/kb/site/en/reference/subsystems/session.md +208 -103
  93. package/kb/site/en/reference/subsystems/settings.md +30 -12
  94. package/kb/site/en/reference/subsystems/shell.md +9 -6
  95. package/kb/site/en/reference/subsystems/sidebar-right.md +151 -0
  96. package/kb/site/en/reference/subsystems/skills.md +1 -1
  97. package/kb/site/en/reference/subsystems/slots.md +41 -32
  98. package/kb/site/en/reference/subsystems/spill.md +13 -6
  99. package/kb/site/en/reference/subsystems/storage.md +28 -5
  100. package/kb/site/en/reference/subsystems/subagent.md +58 -105
  101. package/kb/site/en/reference/subsystems/subprocess.md +25 -26
  102. package/kb/site/en/reference/subsystems/system-prompt.md +18 -3
  103. package/kb/site/en/reference/subsystems/token-meter.md +4 -3
  104. package/kb/site/en/reference/subsystems/tools.md +5 -5
  105. package/kb/site/en/reference/subsystems/typert.md +18 -18
  106. package/kb/site/en/reference/subsystems/web-client.md +1 -1
  107. package/kb/site/en/reference/subsystems/workspace.md +88 -9
  108. package/kb/site/en/reference/tool-catalog.md +56 -66
  109. package/kb/site/en/reference/tool-execution-pipeline.md +2 -2
  110. package/kb/site/guide/network-proxy.md +87 -0
  111. package/kb/site/guide/providers.md +70 -17
  112. package/kb/site/guide/python-sdk.md +19 -3
  113. package/kb/site/guide/schedule.md +2 -0
  114. package/kb/site/reference/agent-lifecycle.md +17 -8
  115. package/kb/site/reference/api-gateway.md +2 -2
  116. package/kb/site/reference/capability-seams.md +24 -10
  117. package/kb/site/reference/config-catalog.md +321 -263
  118. package/kb/site/reference/cookbook/adding-a-package.md +1 -2
  119. package/kb/site/reference/cookbook/adding-a-settings-card.md +10 -8
  120. package/kb/site/reference/cookbook/adding-a-tool.md +1 -1
  121. package/kb/site/reference/cookbook/extension-cookbook.md +16 -13
  122. package/kb/site/reference/index.md +26 -9
  123. package/kb/site/reference/persistence-catalog.md +190 -96
  124. package/kb/site/reference/subsystems/approval.md +1 -1
  125. package/kb/site/reference/subsystems/client-modules.md +9 -0
  126. package/kb/site/reference/subsystems/client-resources.md +94 -0
  127. package/kb/site/reference/subsystems/code-runtime.md +7 -3
  128. package/kb/site/reference/subsystems/commands.md +25 -16
  129. package/kb/site/reference/subsystems/compaction.md +10 -10
  130. package/kb/site/reference/subsystems/conversation.md +11 -4
  131. package/kb/site/reference/subsystems/core.md +173 -29
  132. package/kb/site/reference/subsystems/credentials.md +5 -4
  133. package/kb/site/reference/subsystems/filesystem.md +15 -0
  134. package/kb/site/reference/subsystems/goal.md +38 -2
  135. package/kb/site/reference/subsystems/index.md +14 -12
  136. package/kb/site/reference/subsystems/invariants.md +1 -1
  137. package/kb/site/reference/subsystems/llm-streaming.md +43 -12
  138. package/kb/site/reference/subsystems/lsp.md +1 -1
  139. package/kb/site/reference/subsystems/permission-presets.md +5 -5
  140. package/kb/site/reference/subsystems/persistence.md +210 -198
  141. package/kb/site/reference/subsystems/plan.md +3 -3
  142. package/kb/site/reference/subsystems/schedule.md +9 -3
  143. package/kb/site/reference/subsystems/scope.md +1 -1
  144. package/kb/site/reference/subsystems/session-projection.md +50 -24
  145. package/kb/site/reference/subsystems/session-query.md +19 -13
  146. package/kb/site/reference/subsystems/session-reference.md +29 -1
  147. package/kb/site/reference/subsystems/session-telemetry.md +27 -10
  148. package/kb/site/reference/subsystems/session-title.md +6 -6
  149. package/kb/site/reference/subsystems/session.md +208 -103
  150. package/kb/site/reference/subsystems/settings.md +30 -12
  151. package/kb/site/reference/subsystems/shell.md +9 -6
  152. package/kb/site/reference/subsystems/sidebar-right.md +151 -0
  153. package/kb/site/reference/subsystems/skills.md +1 -1
  154. package/kb/site/reference/subsystems/slots.md +41 -32
  155. package/kb/site/reference/subsystems/spill.md +13 -6
  156. package/kb/site/reference/subsystems/storage.md +28 -5
  157. package/kb/site/reference/subsystems/subagent.md +58 -105
  158. package/kb/site/reference/subsystems/subprocess.md +25 -26
  159. package/kb/site/reference/subsystems/system-prompt.md +18 -3
  160. package/kb/site/reference/subsystems/token-meter.md +4 -3
  161. package/kb/site/reference/subsystems/tools.md +5 -5
  162. package/kb/site/reference/subsystems/typert.md +18 -18
  163. package/kb/site/reference/subsystems/web-client.md +1 -1
  164. package/kb/site/reference/subsystems/workspace.md +88 -9
  165. package/kb/site/reference/tool-catalog.md +55 -65
  166. package/kb/site/reference/tool-execution-pipeline.md +2 -2
  167. package/lib/index.js +25 -44
  168. package/package.json +3 -2
  169. package/skills/dsh-plugin-dev-kb.md +4 -4
@@ -10,9 +10,9 @@ outline: "deep"
10
10
 
11
11
  Every event type that can appear in a session's durable event log: the complete persisted `SessionEvent` envelope and each member of the merge-extensible `SessionEventMap` — the owning vocabulary in `@deepseek-ai/dsh-session` plus every plugin declaration merge into `@deepseek-ai/dsh-session/types` in this repo — with source JSDoc, full payload declaration, surface badge, and declaration site. It complements [session.md](./subsystems/session.md) (surface ordering and the `deriveMessages()` projection), [persistence.md](./subsystems/persistence.md) (how the log is made durable), and the generated region of [session.md](./subsystems/session.md#cordis-surface) (the live bus wiring — a log event is NOT a cordis event; it reaches listeners via the single `session/event` emit).
12
12
 
13
- This file is GENERATED from source (`scripts/gen-persistence-catalog.ts`) and verified fresh by `pnpm run verify-persistence-catalog` (part of `doc-sync`) — do not edit it by hand. Declaration blocks retain the source declaration and nested property JSDoc, removing only the indentation imposed by a containing interface/module, and use a `ts persistence-catalog` fence (skipped by doc-typecheck because declarations reference types from their owning modules). Type names in a payload link to the page that documents them. See [the persistence-log-catalog Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/archived/process/2026-07-04-persistence-log-catalog.md).
13
+ This file is GENERATED from source (`scripts/gen-persistence-catalog.ts`) and verified fresh by `pnpm run verify-persistence-catalog` (part of `doc-sync`) — do not edit it by hand. Declaration blocks retain the source declaration and nested property JSDoc, removing only the indentation imposed by a containing interface/module, and use a `ts persistence-catalog` fence (skipped by doc-typecheck because declarations reference types from their owning modules). Type names in a payload link to the page that documents them. The archived [persistence-log-catalog record](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/archived/process/2026-07-04-persistence-log-catalog.md) documents the original catalog decision.
14
14
 
15
- The envelope declarations below compose each event's `type`, monotonic `seq`, epoch-ms `time`, `data`, and the conditional `surfaceOp`/`sourceEventSeqs` fields. **surface** marks a `SurfaceEventType` member: it produces an LLM message and declares how it joins the surface list. **log-only** marks everything else: a durable, replayable record with no derived-history contribution. Every payload is JSON-serializable (enforced at `Session.append`), and the whole format is pinned at `SESSION_FORMAT_VERSION = 0` pre-release, no compatibility implied ([the version stance](./subsystems/persistence.md)). Scope: the packages in this repo; a downstream plugin can merge further event types, which are outside this catalog by construction.
15
+ The envelope declarations below compose each event's `type`, monotonic `seq`, epoch-ms `time`, `data`, the optional `ignorable` unknown-type skip marker, and the conditional `surfaceOp`/`sourceEventSeqs` fields. **surface** marks a `SurfaceEventType` member: it produces an LLM message and declares how it joins the surface list. **log-only** marks everything else: a durable, replayable record with no derived-history contribution. Every payload is JSON-serializable (enforced at `Session.append`). Current writers stamp `SESSION_FORMAT_VERSION`; supported historical artifacts reach this current vocabulary through the build-static adjacent migration catalog ([the version lifecycle](./subsystems/persistence.md)). Scope: the packages in this repo; a downstream plugin can merge further current-version event types, which are outside this catalog by construction and require an explicit disposition at a later format edge.
16
16
 
17
17
  ## Event envelope
18
18
 
@@ -23,9 +23,11 @@ export type SessionEventType = keyof SessionEventMap
23
23
  /**
24
24
  * The subset of {@link SessionEventType} values whose events produce LLM
25
25
  * messages and are eligible to appear on the ordered surface. Only these
26
- * event types may carry {@link SurfaceOp} and {@link SessionEvent.sourceEventSeqs}.
26
+ * event types may carry {@link SurfaceOp}; system, user, and tool events may also cite
27
+ * earlier sources through {@link SessionEvent.sourceEventSeqs}.
27
28
  */
28
29
  export type SurfaceEventType =
30
+ | 'system/message'
29
31
  | 'user/message'
30
32
  | 'assistant/message'
31
33
  | 'tool/result'
@@ -36,16 +38,16 @@ export type SurfaceEventType =
36
38
  *
37
39
  * - `'append'`: added to the tail — normal path for user/assistant/tool
38
40
  * messages.
39
- * - `{ op: 'replace', start, end }`: replaces surface nodes from `start`
40
- * (inclusive) through `end` (inclusive) with this node. Both must exist as
41
- * surface nodes in the current surface. `start === end` replaces a single
41
+ * - `{ op: 'replace', startSeq, endSeq }`: replaces surface nodes from `startSeq`
42
+ * (inclusive) through `endSeq` (inclusive) with this node. Both must exist as
43
+ * surface nodes in the current surface. `startSeq === endSeq` replaces a single
42
44
  * node. The node's {@link SessionEvent.sourceEventSeqs} must include every
43
45
  * shadowed surface node. Used by compaction; any surface-replacing producer
44
46
  * may use it.
45
47
  */
46
48
  export type SurfaceOp =
47
49
  | 'append'
48
- | { op: 'replace'; start: number; end: number }
50
+ | { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq }
49
51
 
50
52
  /**
51
53
  * One immutable entry in the session log.
@@ -54,9 +56,9 @@ export type SurfaceOp =
54
56
  * unions), so `switch (event.type)` narrows `event.data` without casts.
55
57
  *
56
58
  * The {@link sourceEventSeqs} and {@link surfaceOp} fields are conditional:
57
- * they only exist on {@link SurfaceEventType} variants (`user/message`,
59
+ * they only exist on {@link SurfaceEventType} variants (`system/message`, `user/message`,
58
60
  * `assistant/message`, `tool/result`).
59
- * Non-surface events (boundary markers, chunks, usage, errors) never carry
61
+ * Non-surface events (boundary markers, attempts, errors) never carry
60
62
  * surface metadata — the compiler enforces this at `Session.append()`
61
63
  * call sites.
62
64
  */
@@ -64,27 +66,29 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
64
66
  [K in SessionEventType]: {
65
67
  type: K
66
68
  /** Monotonic sequence number within the session. */
67
- seq: number
69
+ seq: SessionSeq
68
70
  /** Unix epoch milliseconds. */
69
71
  time: number
70
72
  data: SessionEventMap[K]
71
- } & (K extends SurfaceEventType ? {
72
73
  /**
73
- * Seq numbers of earlier events that this event cites as sources
74
- * (e.g. the `assistant/chunk` seqs that built an `assistant/message`,
75
- * or the surface nodes shadowed by a compaction replace node). An
76
- * `assistant/message` may carry a present empty array for a known empty
77
- * provider stream; when the field is absent, the event does not record which
78
- * earlier events produced the message.
74
+ * Marks an event a reader may safely skip when it does not recognize
75
+ * `type`. Absent means required: a reader meeting an unrecognized type
76
+ * without this marker MUST refuse to reconstruct the session instead of
77
+ * silently dropping the event, because an unrecognized required event may
78
+ * change how the rest of the log is interpreted. A writer sets `true` only
79
+ * on purely informational records whose loss cannot affect reconstruction;
80
+ * defaulting to required means a forgotten marker over-refuses (an
81
+ * inconvenience) rather than silently resuming a gutted session.
79
82
  */
80
- sourceEventSeqs?: number[]
81
- /** How this event entered the surface; absent for non-surface events. */
82
- surfaceOp?: SurfaceOp
83
- } : object)
83
+ ignorable?: true
84
+ } & (K extends SurfaceEventType ? SurfaceIntent<K> : {
85
+ surfaceOp?: never
86
+ sourceEventSeqs?: never
87
+ })
84
88
  }[T]
85
89
  ```
86
90
 
87
- Sources: [`packages/core/session/src/types.ts:328`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:335`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:364`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:396`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
91
+ Sources: [`packages/core/session/src/types.ts:404`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:412`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:434`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:465`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
88
92
 
89
93
  ## Events
90
94
 
@@ -97,8 +101,8 @@ Sources: [`packages/core/session/src/types.ts:328`](https://github.com/deepseek-
97
101
  ```ts persistence-catalog
98
102
  /**
99
103
  * One normalized mutation of an agent's durable pending-message lists.
100
- * Live dispatch precedes projection mutation, so synchronous observers may
101
- * read the pre-splice inbox to recover the removed messages.
104
+ * The session-projection registry applies the committed event before
105
+ * `Session.append()` returns; Inbox live notifications follow that commit.
102
106
  */
103
107
  'agent/inbox/spliced': {
104
108
  target: InboxTarget
@@ -109,7 +113,7 @@ Sources: [`packages/core/session/src/types.ts:328`](https://github.com/deepseek-
109
113
  }
110
114
  ```
111
115
 
112
- Source: [`packages/core/agent/src/types.ts:38`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent/src/types.ts)
116
+ Source: [`packages/core/agent/src/types.ts:87`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent/src/types.ts)
113
117
 
114
118
  ### `agent-preset/*`
115
119
 
@@ -183,7 +187,7 @@ Source: [`packages/interaction/user-approval/src/types.ts:55`](https://github.co
183
187
  * The session's approval policy was switched — log-only, durable,
184
188
  * replayable, never in the model transcript (the model learns the policy
185
189
  * from the runtime-context snapshot and live switch notices). The LAST
186
- * such event is the session's override ({@link effectiveApprovalPolicy}).
190
+ * such event is the session's override.
187
191
  * `source: 'delegation'` marks an override seeded into a child; an absent
188
192
  * source is a runtime switch.
189
193
  */
@@ -194,22 +198,24 @@ Source: [`packages/interaction/user-approval/src/types.ts:55`](https://github.co
194
198
  }
195
199
  ```
196
200
 
197
- Source: [`packages/interaction/user-approval/src/index.ts:32`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/user-approval/src/index.ts)
201
+ Source: [`packages/interaction/user-approval/src/index.ts:33`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/user-approval/src/index.ts)
198
202
 
199
203
  ### `assistant/*`
200
204
 
201
- <a id="assistantchunk--log-only"></a>
205
+ <a id="assistantattempt--log-only"></a>
202
206
 
203
- #### `assistant/chunk` — log-only
207
+ #### `assistant/attempt` — log-only
204
208
 
205
209
  ```ts persistence-catalog
206
- /** Raw stream chunk — token-level replay fidelity. */
207
- 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk }
210
+ /**
211
+ * One model attempt that committed no surface message. The embedded stream
212
+ * preserves a failed, retried, cancelled, or stream-error attempt that
213
+ * reached settlement without fabricating model-visible history.
214
+ */
215
+ 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[] }
208
216
  ```
209
217
 
210
- Types: [StreamChunk](./subsystems/llm-streaming.md)
211
-
212
- Source: [`packages/core/session/src/types.ts:251`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
218
+ Source: [`packages/core/session/src/types.ts:335`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
213
219
 
214
220
  <a id="assistantmessage--surface"></a>
215
221
 
@@ -226,12 +232,20 @@ Source: [`packages/core/session/src/types.ts:251`](https://github.com/deepseek-a
226
232
  * marker distinguishes that prefix without re-deriving interruption from turn
227
233
  * boundaries. An aborted turn with no such event streamed no visible content.
228
234
  */
229
- 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true }
235
+ 'assistant/message': {
236
+ turn: number
237
+ step: number
238
+ message: AssistantMessage
239
+ /** Exact timed model stream, compacted without joining delta boundaries. */
240
+ stream: AssistantStreamRecord[]
241
+ usage?: TokenUsage
242
+ interrupted?: true
243
+ }
230
244
  ```
231
245
 
232
246
  Types: [TokenUsage](./subsystems/llm-streaming.md)
233
247
 
234
- Source: [`packages/core/session/src/types.ts:262`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
248
+ Source: [`packages/core/session/src/types.ts:321`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
235
249
 
236
250
  ### `command/*`
237
251
 
@@ -250,11 +264,11 @@ Source: [`packages/core/session/src/types.ts:262`](https://github.com/deepseek-a
250
264
  commandId: CommandId
251
265
  kind: 'success' | 'error'
252
266
  text?: string
253
- sourceEventSeq?: number
267
+ sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq
254
268
  }
255
269
  ```
256
270
 
257
- Source: [`packages/interaction/commands/src/types.ts:103`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
271
+ Source: [`packages/interaction/commands/src/types.ts:110`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
258
272
 
259
273
  <a id="commandrun--log-only"></a>
260
274
 
@@ -274,7 +288,7 @@ Source: [`packages/interaction/commands/src/types.ts:103`](https://github.com/de
274
288
  'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource }
275
289
  ```
276
290
 
277
- Source: [`packages/interaction/commands/src/types.ts:96`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
291
+ Source: [`packages/interaction/commands/src/types.ts:103`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
278
292
 
279
293
  ### `compaction/*`
280
294
 
@@ -290,7 +304,7 @@ Source: [`packages/interaction/commands/src/types.ts:96`](https://github.com/dee
290
304
  'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string }
291
305
  ```
292
306
 
293
- Source: [`packages/compaction/compaction/src/types.ts:71`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
307
+ Source: [`packages/compaction/compaction/src/types.ts:72`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
294
308
 
295
309
  <a id="compactionprune--log-only"></a>
296
310
 
@@ -308,15 +322,15 @@ Source: [`packages/compaction/compaction/src/types.ts:71`](https://github.com/de
308
322
  */
309
323
  'compaction/prune': {
310
324
  /** The replaced range's first and last surface-node seqs (a surface-position span, like {@link CompactionResult.shadowedRange}). */
311
- shadowedRange: { start: number; end: number }
325
+ shadowedRange: { start: SessionSeq; end: SessionSeq }
312
326
  /** The seqs of all shadowed surface nodes, in surface order. */
313
- shadowedSeqs: number[]
327
+ shadowedSeqs: SessionSeq[]
314
328
  /** Heuristic price of the shadowed content under the token-meter's fixed estimator. */
315
329
  shadowedTokenCount: number
316
330
  }
317
331
  ```
318
332
 
319
- Source: [`packages/compaction/compaction/src/types.ts:81`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
333
+ Source: [`packages/compaction/compaction/src/types.ts:82`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
320
334
 
321
335
  <a id="compactionstart--log-only"></a>
322
336
 
@@ -331,7 +345,7 @@ Source: [`packages/compaction/compaction/src/types.ts:81`](https://github.com/de
331
345
  'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null }
332
346
  ```
333
347
 
334
- Source: [`packages/compaction/compaction/src/types.ts:23`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
348
+ Source: [`packages/compaction/compaction/src/types.ts:24`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
335
349
 
336
350
  <a id="compactionsummary--log-only"></a>
337
351
 
@@ -351,8 +365,8 @@ Source: [`packages/compaction/compaction/src/types.ts:23`](https://github.com/de
351
365
  compactionId: CompactionId
352
366
  sourceCommandId?: CommandId
353
367
  summary: ContentBlock[]
354
- shadowedRange: { start: number; end: number }
355
- shadowedSeqs: number[]
368
+ shadowedRange: { start: SessionSeq; end: SessionSeq }
369
+ shadowedSeqs: SessionSeq[]
356
370
  shadowedTokenCount: number
357
371
  /** The provider route that wrote the summary. */
358
372
  provider: string
@@ -385,10 +399,47 @@ Source: [`packages/compaction/compaction/src/types.ts:23`](https://github.com/de
385
399
 
386
400
  Types: [ContentBlock](./subsystems/core.md) · [TokenUsage](./subsystems/llm-streaming.md)
387
401
 
388
- Source: [`packages/compaction/compaction/src/types.ts:33`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
402
+ Source: [`packages/compaction/compaction/src/types.ts:34`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
403
+
404
+ ### `deliverables/*`
405
+
406
+ <a id="deliverablespresented--log-only"></a>
407
+
408
+ #### `deliverables/presented` — log-only
409
+
410
+ ```ts persistence-catalog
411
+ /** Declared filesystem files from a successful final present result, including nested calls. */
412
+ 'deliverables/presented': { turn: number; callId: ToolCallId; files: PresentedFile[] }
413
+ ```
414
+
415
+ Types: [ToolCallId](./subsystems/core.md)
416
+
417
+ Source: [`packages/fs/tool-present/src/types.ts:15`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-present/src/types.ts)
389
418
 
390
419
  ### `feedback/*`
391
420
 
421
+ <a id="feedbackmessage-delete--log-only"></a>
422
+
423
+ #### `feedback/message-delete` — log-only
424
+
425
+ ```ts persistence-catalog
426
+ /** Log-only deletion; earlier ratings and notes remain in the log. */
427
+ 'feedback/message-delete': MessageFeedbackDelete
428
+ ```
429
+
430
+ Source: [`packages/feedback/message-feedback/src/types.ts:58`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/feedback/message-feedback/src/types.ts)
431
+
432
+ <a id="feedbackmessage-put--log-only"></a>
433
+
434
+ #### `feedback/message-put` — log-only
435
+
436
+ ```ts persistence-catalog
437
+ /** Log-only human feedback; never enters model history. */
438
+ 'feedback/message-put': MessageFeedbackPut
439
+ ```
440
+
441
+ Source: [`packages/feedback/message-feedback/src/types.ts:56`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/feedback/message-feedback/src/types.ts)
442
+
392
443
  <a id="feedbackrecord--log-only"></a>
393
444
 
394
445
  #### `feedback/record` — log-only
@@ -398,10 +449,10 @@ Source: [`packages/compaction/compaction/src/types.ts:33`](https://github.com/de
398
449
  * One recorded human remark about this session. Log-only and independent
399
450
  * of its trigger; it never enters model context or derived history.
400
451
  */
401
- 'feedback/record': { text: string }
452
+ 'feedback/record': FeedbackRecord
402
453
  ```
403
454
 
404
- Source: [`packages/feedback/command-feedback/src/index.ts:62`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/feedback/command-feedback/src/index.ts)
455
+ Source: [`packages/feedback/command-feedback/src/types.ts:40`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/feedback/command-feedback/src/types.ts)
405
456
 
406
457
  ### `goal/*`
407
458
 
@@ -518,13 +569,13 @@ Source: [`packages/api/session-controller/src/types.ts:40`](https://github.com/d
518
569
  /**
519
570
  * Records the selected preset as durable, log-only user intent. The knob
520
571
  * events follow in the same turn and control execution; this event stays
521
- * out of the model transcript and lets {@link effectivePermissionPreset}
572
+ * out of the model transcript and lets the permission projection unit
522
573
  * preserve a selection when bundles match.
523
574
  */
524
575
  'permission/preset': { preset: string }
525
576
  ```
526
577
 
527
- Source: [`packages/interaction/permission-presets/src/index.ts:50`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/permission-presets/src/index.ts)
578
+ Source: [`packages/interaction/permission-presets/src/index.ts:53`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/permission-presets/src/index.ts)
528
579
 
529
580
  ### `plan/*`
530
581
 
@@ -536,12 +587,12 @@ Source: [`packages/interaction/permission-presets/src/index.ts:50`](https://gith
536
587
  /**
537
588
  * Whether plan mode is in force from this point on: log-only, non-surface,
538
589
  * whole-value replace. The last `plan/mode` wins; a log with none folds to
539
- * inactive through {@link foldPlanMode}.
590
+ * inactive through the projection unit's fold.
540
591
  */
541
592
  'plan/mode': { active: boolean }
542
593
  ```
543
594
 
544
- Source: [`packages/plan/plan-mode/src/index.ts:53`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/src/index.ts)
595
+ Source: [`packages/plan/plan-mode/src/index.ts:46`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/src/index.ts)
545
596
 
546
597
  ### `request/*`
547
598
 
@@ -551,13 +602,15 @@ Source: [`packages/plan/plan-mode/src/index.ts:53`](https://github.com/deepseek-
551
602
 
552
603
  ```ts persistence-catalog
553
604
  /**
554
- * Route metadata for the next request, logged only when the route or capacity
555
- * changes. It does not participate in request reconstruction or header equality.
605
+ * Route metadata for the next request, logged only when the route, capacity,
606
+ * or system prompt update mode changes. It does not participate in request
607
+ * reconstruction or header equality. Prompt admission uses the bound prepared
608
+ * call's capability, not this snapshot from an earlier request.
556
609
  */
557
610
  'request/context': RequestContext
558
611
  ```
559
612
 
560
- Source: [`packages/core/session/src/types.ts:301`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
613
+ Source: [`packages/core/session/src/types.ts:377`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
561
614
 
562
615
  <a id="requestheader--log-only"></a>
563
616
 
@@ -576,7 +629,7 @@ Source: [`packages/core/session/src/types.ts:301`](https://github.com/deepseek-a
576
629
  }
577
630
  ```
578
631
 
579
- Source: [`packages/core/session/src/types.ts:291`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
632
+ Source: [`packages/core/session/src/types.ts:365`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
580
633
 
581
634
  ### `sandbox/*`
582
635
 
@@ -589,7 +642,7 @@ Source: [`packages/core/session/src/types.ts:291`](https://github.com/deepseek-a
589
642
  * The session's sandbox mode was switched — log-only (like `approval/*`;
590
643
  * NOT a surface event, carries no `surfaceOp`): durable and replayable,
591
644
  * never in the model transcript. The LAST such event is the session's
592
- * override ({@link effectiveSandboxMode}). `source: 'delegation'` marks
645
+ * override (folded by the sandboxMode projection unit). `source: 'delegation'` marks
593
646
  * an override seeded into a child; an absent source is a runtime switch.
594
647
  */
595
648
  'sandbox/mode': {
@@ -630,12 +683,12 @@ Source: [`packages/schedule/schedule/src/types.ts:219`](https://github.com/deeps
630
683
  * Marks the end of a constructor seed. Events before it have smaller seq
631
684
  * values and came from the seed (resume, fork, or replay); this lifecycle
632
685
  * produced none of them. This log-only event is the durable projection of
633
- * {@link Session.firstLiveSeq}. Its payload is empty — position and `time`
634
- * carry the meaning.
686
+ * {@link Session.firstLiveSeq}.
635
687
  *
636
- * Locate the LAST one in stored history. A seed already ending in one is not
637
- * re-marked, so reopening an untouched session does not grow its log per
638
- * pickup and the event need not be at the current `firstLiveSeq`.
688
+ * A fresh fork child owns one `{ inherited: true }` marker at its exact
689
+ * inherited-prefix cut, even when that prefix ends in an ancestor marker.
690
+ * The last tagged marker is the current Session's cut; untagged markers keep
691
+ * ordinary restore and replay lifecycle boundaries.
639
692
  *
640
693
  * `Session`'s constructor is the only legitimate writer. The invariant
641
694
  * companion deliberately constrains nothing here, so a plugin appending one
@@ -648,10 +701,10 @@ Source: [`packages/schedule/schedule/src/types.ts:219`](https://github.com/deeps
648
701
  * writers — a concurrently live session holds its own boundary elsewhere,
649
702
  * so tolerating concurrent writers needs a signal beyond the log.
650
703
  */
651
- 'session/end-seed': Record<string, never>
704
+ 'session/end-seed': { inherited?: true }
652
705
  ```
653
706
 
654
- Source: [`packages/core/session/src/types.ts:324`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
707
+ Source: [`packages/core/session/src/types.ts:400`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
655
708
 
656
709
  <a id="sessiontitle--log-only"></a>
657
710
 
@@ -667,7 +720,7 @@ Source: [`packages/core/session/src/types.ts:324`](https://github.com/deepseek-a
667
720
 
668
721
  Types: [SessionTitleEventData](./subsystems/session-title.md)
669
722
 
670
- Source: [`packages/session/session-title/src/index.ts:100`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title/src/index.ts)
723
+ Source: [`packages/session/session-title/src/index.ts:77`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title/src/index.ts)
671
724
 
672
725
  <a id="sessiontitle-llm-request--log-only"></a>
673
726
 
@@ -680,7 +733,7 @@ Source: [`packages/session/session-title/src/index.ts:100`](https://github.com/d
680
733
 
681
734
  Types: [SessionTitleLlmRequestEventData](./subsystems/session-title.md)
682
735
 
683
- Source: [`packages/session/session-title-llm/src/index.ts:43`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title-llm/src/index.ts)
736
+ Source: [`packages/session/session-title-llm/src/index.ts:45`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title-llm/src/index.ts)
684
737
 
685
738
  ### `session-log-deepseek/*`
686
739
 
@@ -693,12 +746,14 @@ Source: [`packages/session/session-title-llm/src/index.ts:43`](https://github.co
693
746
  'session-log-deepseek/delivery-accepted': {
694
747
  /** Session identity the accepted delivery carried; inherited fork markers retain the parent's id. */
695
748
  sessionId: import('@deepseek-ai/dsh-session/types').SessionId
749
+ /** Accepted Session format generation; absence identifies version 0. */
750
+ sessionFormatVersion?: number
696
751
  /** Last canonical event included in the accepted request. */
697
- throughSeq: number
752
+ throughSeq: import('@deepseek-ai/dsh-session/types').SessionSeq
698
753
  }
699
754
  ```
700
755
 
701
- Source: [`packages/session/session-log-deepseek/src/types.ts:26`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-log-deepseek/src/types.ts)
756
+ Source: [`packages/session/session-log-deepseek/src/types.ts:81`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-log-deepseek/src/types.ts)
702
757
 
703
758
  ### `step/*`
704
759
 
@@ -711,7 +766,7 @@ Source: [`packages/session/session-log-deepseek/src/types.ts:26`](https://github
711
766
  'step/end': { turn: number; step: number }
712
767
  ```
713
768
 
714
- Source: [`packages/core/session/src/types.ts:241`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
769
+ Source: [`packages/core/session/src/types.ts:289`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
715
770
 
716
771
  <a id="stepstart--log-only"></a>
717
772
 
@@ -722,10 +777,24 @@ Source: [`packages/core/session/src/types.ts:241`](https://github.com/deepseek-a
722
777
  'step/start': { turn: number; step: number }
723
778
  ```
724
779
 
725
- Source: [`packages/core/session/src/types.ts:239`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
780
+ Source: [`packages/core/session/src/types.ts:287`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
726
781
 
727
782
  ### `subagent/*`
728
783
 
784
+ <a id="subagentcatalog--log-only"></a>
785
+
786
+ #### `subagent/catalog` — log-only
787
+
788
+ ```ts persistence-catalog
789
+ /**
790
+ * A direct child's complete discovery fact.
791
+ * @param data - versioned parent-owned catalog entry.
792
+ */
793
+ 'subagent/catalog': SubagentCatalogEvent
794
+ ```
795
+
796
+ Source: [`packages/subagent/subagent/src/catalog.ts:40`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/catalog.ts)
797
+
729
798
  <a id="subagentdescriptor--log-only"></a>
730
799
 
731
800
  #### `subagent/descriptor` — log-only
@@ -760,7 +829,31 @@ Source: [`packages/subagent/subagent/src/descriptor.ts:38`](https://github.com/d
760
829
  }
761
830
  ```
762
831
 
763
- Source: [`packages/subagent/tool-subagent/src/model-selection-state.ts:14`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/tool-subagent/src/model-selection-state.ts)
832
+ Source: [`packages/subagent/tool-subagent/src/model-selection-state.ts:17`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/tool-subagent/src/model-selection-state.ts)
833
+
834
+ ### `system/*`
835
+
836
+ <a id="systemmessage--surface"></a>
837
+
838
+ #### `system/message` — surface
839
+
840
+ ```ts persistence-catalog
841
+ /**
842
+ * The rendered system prompt on the model-visible surface. The loop appends
843
+ * the first one as surface node 0 before the step's first `user/message`.
844
+ * A prepared in-history route can append nonempty changes in a continuing
845
+ * series. An incapable route or new series normalizes text to the first system
846
+ * node. Normalization empties nonempty later nodes, then rewrites the head if
847
+ * needed, through logged per-node replacements. An empty rendering always
848
+ * clears all active system nodes, leaving no older instructions model-visible.
849
+ * Empty later nodes are dormant and project to no message; an empty head with
850
+ * no active later node records "no system prompt". Restored nonempty text follows
851
+ * the same route and series rule; empty nodes never restore older text.
852
+ */
853
+ 'system/message': { turn: number; step: number; message: SystemMessage }
854
+ ```
855
+
856
+ Source: [`packages/core/session/src/types.ts:310`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
764
857
 
765
858
  ### `team/*`
766
859
 
@@ -770,12 +863,12 @@ Source: [`packages/subagent/tool-subagent/src/model-selection-state.ts:14`](http
770
863
 
771
864
  ```ts persistence-catalog
772
865
  /** Whole teammate lifecycle value, stored only in the Team Lead Session. */
773
- 'team/member': { version: 1; teamId: TeamId; member: TeamMemberSnapshot }
866
+ 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot }
774
867
  ```
775
868
 
776
869
  Types: [TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) · [TeamMemberSnapshot](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md)
777
870
 
778
- Source: [`packages/experimental/agent-team/src/types.ts:223`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
871
+ Source: [`packages/experimental/agent-team/src/types.ts:221`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
779
872
 
780
873
  <a id="teammessagedelivered--log-only"></a>
781
874
 
@@ -784,7 +877,7 @@ Source: [`packages/experimental/agent-team/src/types.ts:223`](https://github.com
784
877
  ```ts persistence-catalog
785
878
  /** Durable acknowledgement that the target Session recorded the message. */
786
879
  'team/message/delivered': {
787
- version: 1
880
+ version: 2
788
881
  teamId: TeamId
789
882
  messageId: TeamMessageId
790
883
  targetId: SessionId
@@ -793,7 +886,7 @@ Source: [`packages/experimental/agent-team/src/types.ts:223`](https://github.com
793
886
 
794
887
  Types: [TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) · [TeamMessageId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md)
795
888
 
796
- Source: [`packages/experimental/agent-team/src/types.ts:229`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
889
+ Source: [`packages/experimental/agent-team/src/types.ts:227`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
797
890
 
798
891
  <a id="teammessagequeued--log-only"></a>
799
892
 
@@ -801,12 +894,12 @@ Source: [`packages/experimental/agent-team/src/types.ts:229`](https://github.com
801
894
 
802
895
  ```ts persistence-catalog
803
896
  /** Durable mailbox enqueue, stored before delivery is attempted. */
804
- 'team/message/queued': { version: 1; teamId: TeamId; message: TeamMessageSnapshot }
897
+ 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot }
805
898
  ```
806
899
 
807
900
  Types: [TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) · [TeamMessageSnapshot](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md)
808
901
 
809
- Source: [`packages/experimental/agent-team/src/types.ts:227`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
902
+ Source: [`packages/experimental/agent-team/src/types.ts:225`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
810
903
 
811
904
  <a id="teamtask--log-only"></a>
812
905
 
@@ -814,12 +907,12 @@ Source: [`packages/experimental/agent-team/src/types.ts:227`](https://github.com
814
907
 
815
908
  ```ts persistence-catalog
816
909
  /** Whole shared-task value, stored only in the Team Lead Session. */
817
- 'team/task': { version: 1; teamId: TeamId; task: TeamTaskSnapshot }
910
+ 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot }
818
911
  ```
819
912
 
820
913
  Types: [TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) · [TeamTaskSnapshot](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md)
821
914
 
822
- Source: [`packages/experimental/agent-team/src/types.ts:225`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
915
+ Source: [`packages/experimental/agent-team/src/types.ts:223`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
823
916
 
824
917
  ### `todo/*`
825
918
 
@@ -853,16 +946,16 @@ Source: [`packages/todo/tool-todo/src/types.ts:31`](https://github.com/deepseek-
853
946
 
854
947
  Types: [ToolCallId](./subsystems/core.md)
855
948
 
856
- Source: [`packages/core/session/src/types.ts:268`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
949
+ Source: [`packages/core/session/src/types.ts:341`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
857
950
 
858
- <a id="toolcode-dispatch--log-only"></a>
951
+ <a id="toolptc-dispatch--log-only"></a>
859
952
 
860
- #### `tool/code-dispatch` — log-only
953
+ #### `tool/ptc-dispatch` — log-only
861
954
 
862
955
  ```ts persistence-catalog
863
956
  /**
864
957
  * One bridged sub-dispatch SETTLING: the pairing ids (matching the
865
- * `tool/code-dispatch-start` with the same `subCallId`), the tool `name`
958
+ * `tool/ptc-dispatch-start` with the same `subCallId`), the tool `name`
866
959
  * with the same JSON-normalized `arguments`, and the sub-call's complete
867
960
  * model-facing outcome in `tool/result`'s own vocabulary
868
961
  * (`content` + `isError`), so UIs render a sub-call through the exact
@@ -875,30 +968,30 @@ Source: [`packages/core/session/src/types.ts:268`](https://github.com/deepseek-a
875
968
  * before returning), so its execution-enclosure relation holds by
876
969
  * construction.
877
970
  */
878
- 'tool/code-dispatch': PtcDispatchEventData
971
+ 'tool/ptc-dispatch': PtcDispatchEventData
879
972
  ```
880
973
 
881
974
  Source: [`packages/core/tools/src/types.ts:56`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/types.ts)
882
975
 
883
- <a id="toolcode-dispatch-start--log-only"></a>
976
+ <a id="toolptc-dispatch-start--log-only"></a>
884
977
 
885
- #### `tool/code-dispatch-start` — log-only
978
+ #### `tool/ptc-dispatch-start` — log-only
886
979
 
887
980
  ```ts persistence-catalog
888
981
  /**
889
982
  * One sub-dispatch STARTING inside a `run_code` program: the parent
890
- * `run_code` call id, the deterministic sub-call id (`<parent>:code:<n>`,
891
- * numbered in submission order), and the tool `name` with its
983
+ * `run_code` call id, the opaque sub-call id (new calls use
984
+ * `<parent>:ptc:<n>`, numbered in submission order), and the tool `name` with its
892
985
  * JSON-normalized `arguments` — the exact value dispatched, normalized
893
986
  * BEFORE dispatch, so this append can never fail on payload shape.
894
987
  * Appended when the scheduler actually starts the call (not at
895
988
  * submission), so a start means the tool body pipeline was entered; a
896
989
  * call abandoned in the queue logs nothing. Log-only: `deriveMessages()`
897
990
  * ignores it; UIs use it for live per-sub-call running state and pair it
898
- * with `tool/code-dispatch` by `subCallId` (timing = the two events'
991
+ * with `tool/ptc-dispatch` by `subCallId` (timing = the two events'
899
992
  * `time` fields).
900
993
  */
901
- 'tool/code-dispatch-start': PtcDispatchStartEventData
994
+ 'tool/ptc-dispatch-start': PtcDispatchStartEventData
902
995
  ```
903
996
 
904
997
  Source: [`packages/core/tools/src/types.ts:40`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/types.ts)
@@ -923,12 +1016,13 @@ Source: [`packages/core/tools/src/types.ts:40`](https://github.com/deepseek-ai/d
923
1016
  turn: number
924
1017
  step: number
925
1018
  message: ToolResultMessage
1019
+ /** Optional failure identity; allowed only when the tool-result block has `isError: true`. */
926
1020
  error?: { name: string; code: string }
927
1021
  meta?: JsonValue
928
1022
  }
929
1023
  ```
930
1024
 
931
- Source: [`packages/core/session/src/types.ts:280`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1025
+ Source: [`packages/core/session/src/types.ts:353`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
932
1026
 
933
1027
  ### `tool-workflow/*`
934
1028
 
@@ -1008,7 +1102,7 @@ Source: [`packages/workflow/tool-workflow/src/types.ts:47`](https://github.com/d
1008
1102
 
1009
1103
  Types: [TurnEndReason](./subsystems/session.md)
1010
1104
 
1011
- Source: [`packages/core/session/src/types.ts:237`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1105
+ Source: [`packages/core/session/src/types.ts:285`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1012
1106
 
1013
1107
  <a id="turnstart--log-only"></a>
1014
1108
 
@@ -1024,7 +1118,7 @@ Source: [`packages/core/session/src/types.ts:237`](https://github.com/deepseek-a
1024
1118
  'turn/start': { turn: number }
1025
1119
  ```
1026
1120
 
1027
- Source: [`packages/core/session/src/types.ts:228`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1121
+ Source: [`packages/core/session/src/types.ts:276`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1028
1122
 
1029
1123
  ### `user/*`
1030
1124
 
@@ -1043,7 +1137,7 @@ Source: [`packages/core/session/src/types.ts:228`](https://github.com/deepseek-a
1043
1137
  'user/message': UserMessage
1044
1138
  ```
1045
1139
 
1046
- Source: [`packages/core/session/src/types.ts:249`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1140
+ Source: [`packages/core/session/src/types.ts:297`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
1047
1141
 
1048
1142
  ### `web/*`
1049
1143