dsh-plugin-dev-kb 1.0.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 (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/cordis.patch.yml +12 -0
  4. package/kb/INDEX.md +210 -0
  5. package/kb/README.md +69 -0
  6. package/kb/extra/AGENTS.md +75 -0
  7. package/kb/extra/api-gateway.md +164 -0
  8. package/kb/extra/api-gateway.zh.md +164 -0
  9. package/kb/extra/cookbook/adding-a-vendored-package.md +59 -0
  10. package/kb/extra/cookbook/adding-a-vendored-package.zh.md +59 -0
  11. package/kb/extra/cookbook/maintaining-dsh-code-review.md +64 -0
  12. package/kb/extra/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  13. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  14. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  15. package/kb/extra/defensive-patterns.md +33 -0
  16. package/kb/extra/defensive-patterns.zh.md +33 -0
  17. package/kb/extra/development.md +171 -0
  18. package/kb/extra/development.zh.md +171 -0
  19. package/kb/extra/event-producer-consumer.md +76 -0
  20. package/kb/extra/event-producer-consumer.zh.md +78 -0
  21. package/kb/extra/glossary.md +45 -0
  22. package/kb/extra/glossary.zh.md +45 -0
  23. package/kb/extra/graph-atlas.md +24 -0
  24. package/kb/extra/graph-atlas.zh.md +26 -0
  25. package/kb/extra/i18n/README.md +60 -0
  26. package/kb/extra/i18n/README.zh.md +60 -0
  27. package/kb/extra/i18n/style-samples.md +87 -0
  28. package/kb/extra/i18n/terminology.md +214 -0
  29. package/kb/extra/i18n/translation-prompt.md +263 -0
  30. package/kb/extra/i18n/translation-rules.md +69 -0
  31. package/kb/extra/i18n/translation-rules.zh.md +69 -0
  32. package/kb/extra/module-graph.md +1641 -0
  33. package/kb/extra/module-graph.zh.md +1643 -0
  34. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  35. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  36. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  37. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  38. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  39. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  40. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  41. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  42. package/kb/extra/postmortem/README.md +18 -0
  43. package/kb/extra/postmortem/README.zh.md +18 -0
  44. package/kb/extra/rescope.md +53 -0
  45. package/kb/extra/rescope.zh.md +53 -0
  46. package/kb/extra/subsystems/attachment.md +125 -0
  47. package/kb/extra/subsystems/attachment.zh.md +125 -0
  48. package/kb/extra/subsystems/extensions.md +364 -0
  49. package/kb/extra/subsystems/extensions.zh.md +364 -0
  50. package/kb/extra/subsystems/feedback.md +266 -0
  51. package/kb/extra/subsystems/feedback.zh.md +266 -0
  52. package/kb/extra/testing.md +49 -0
  53. package/kb/extra/testing.zh.md +49 -0
  54. package/kb/extra/web-styling.md +25 -0
  55. package/kb/extra/web-styling.zh.md +25 -0
  56. package/kb/meta/search-index.json +1328 -0
  57. package/kb/meta/site-pages.txt +168 -0
  58. package/kb/meta/source.json +13 -0
  59. package/kb/meta/topics.md +75 -0
  60. package/kb/site/develop/basic/config.md +108 -0
  61. package/kb/site/develop/basic/index.md +146 -0
  62. package/kb/site/develop/basic/publish.md +185 -0
  63. package/kb/site/develop/basic/tool.md +54 -0
  64. package/kb/site/develop/cordis-tutorial/01-first-plugin.md +95 -0
  65. package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  66. package/kb/site/develop/cordis-tutorial/03-services.md +98 -0
  67. package/kb/site/develop/cordis-tutorial/04-events.md +144 -0
  68. package/kb/site/develop/cordis-tutorial/05-config.md +84 -0
  69. package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
  70. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +107 -0
  71. package/kb/site/develop/cordis-tutorial/index.md +62 -0
  72. package/kb/site/develop/framework/events.md +145 -0
  73. package/kb/site/develop/framework/index.md +139 -0
  74. package/kb/site/develop/framework/service.md +152 -0
  75. package/kb/site/develop/practice/index.md +157 -0
  76. package/kb/site/develop/practice/llm-adapter.md +190 -0
  77. package/kb/site/en/develop/basic/config.md +108 -0
  78. package/kb/site/en/develop/basic/index.md +146 -0
  79. package/kb/site/en/develop/basic/publish.md +185 -0
  80. package/kb/site/en/develop/basic/tool.md +54 -0
  81. package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +95 -0
  82. package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  83. package/kb/site/en/develop/cordis-tutorial/03-services.md +98 -0
  84. package/kb/site/en/develop/cordis-tutorial/04-events.md +144 -0
  85. package/kb/site/en/develop/cordis-tutorial/05-config.md +84 -0
  86. package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
  87. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +107 -0
  88. package/kb/site/en/develop/cordis-tutorial/index.md +60 -0
  89. package/kb/site/en/develop/framework/events.md +145 -0
  90. package/kb/site/en/develop/framework/index.md +139 -0
  91. package/kb/site/en/develop/framework/service.md +150 -0
  92. package/kb/site/en/develop/practice/index.md +157 -0
  93. package/kb/site/en/develop/practice/llm-adapter.md +190 -0
  94. package/kb/site/en/guide/providers-custom-form.png +0 -0
  95. package/kb/site/en/guide/providers-models-page.png +0 -0
  96. package/kb/site/en/guide/providers.md +100 -0
  97. package/kb/site/en/guide/python-sdk.md +106 -0
  98. package/kb/site/en/guide/quickstart.md +32 -0
  99. package/kb/site/en/index.md +8 -0
  100. package/kb/site/en/reference/agent-lifecycle.md +86 -0
  101. package/kb/site/en/reference/capability-seams.md +475 -0
  102. package/kb/site/en/reference/config-catalog.md +3155 -0
  103. package/kb/site/en/reference/cookbook/adding-a-conversation-node.md +235 -0
  104. package/kb/site/en/reference/cookbook/adding-a-package.md +120 -0
  105. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +102 -0
  106. package/kb/site/en/reference/cookbook/adding-a-tool.md +96 -0
  107. package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +45 -0
  108. package/kb/site/en/reference/cookbook/extension-cookbook.md +131 -0
  109. package/kb/site/en/reference/cordis-api/context.md +368 -0
  110. package/kb/site/en/reference/cordis-api/events.md +211 -0
  111. package/kb/site/en/reference/cordis-api/fiber.md +379 -0
  112. package/kb/site/en/reference/cordis-api/inherited.md +43 -0
  113. package/kb/site/en/reference/cordis-api/registry.md +156 -0
  114. package/kb/site/en/reference/cordis-api/service.md +106 -0
  115. package/kb/site/en/reference/cordis-primer.md +46 -0
  116. package/kb/site/en/reference/index.md +131 -0
  117. package/kb/site/en/reference/persistence-catalog.md +949 -0
  118. package/kb/site/en/reference/subsystems/approval.md +173 -0
  119. package/kb/site/en/reference/subsystems/client-modules.md +121 -0
  120. package/kb/site/en/reference/subsystems/code-runtime.md +194 -0
  121. package/kb/site/en/reference/subsystems/commands.md +190 -0
  122. package/kb/site/en/reference/subsystems/compaction.md +241 -0
  123. package/kb/site/en/reference/subsystems/core.md +1073 -0
  124. package/kb/site/en/reference/subsystems/credentials.md +136 -0
  125. package/kb/site/en/reference/subsystems/filesystem.md +498 -0
  126. package/kb/site/en/reference/subsystems/goal.md +280 -0
  127. package/kb/site/en/reference/subsystems/index.md +58 -0
  128. package/kb/site/en/reference/subsystems/invariants.md +91 -0
  129. package/kb/site/en/reference/subsystems/jobs.md +293 -0
  130. package/kb/site/en/reference/subsystems/llm-streaming.md +920 -0
  131. package/kb/site/en/reference/subsystems/lsp.md +205 -0
  132. package/kb/site/en/reference/subsystems/permission-presets.md +134 -0
  133. package/kb/site/en/reference/subsystems/persistence.md +388 -0
  134. package/kb/site/en/reference/subsystems/plan.md +90 -0
  135. package/kb/site/en/reference/subsystems/sandbox.md +221 -0
  136. package/kb/site/en/reference/subsystems/schedule.md +189 -0
  137. package/kb/site/en/reference/subsystems/scope.md +62 -0
  138. package/kb/site/en/reference/subsystems/session-projection.md +265 -0
  139. package/kb/site/en/reference/subsystems/session-query.md +498 -0
  140. package/kb/site/en/reference/subsystems/session-reference.md +111 -0
  141. package/kb/site/en/reference/subsystems/session-telemetry.md +197 -0
  142. package/kb/site/en/reference/subsystems/session-title.md +207 -0
  143. package/kb/site/en/reference/subsystems/session.md +852 -0
  144. package/kb/site/en/reference/subsystems/settings.md +313 -0
  145. package/kb/site/en/reference/subsystems/shell.md +306 -0
  146. package/kb/site/en/reference/subsystems/skills.md +334 -0
  147. package/kb/site/en/reference/subsystems/spill.md +120 -0
  148. package/kb/site/en/reference/subsystems/storage.md +232 -0
  149. package/kb/site/en/reference/subsystems/subagent.md +737 -0
  150. package/kb/site/en/reference/subsystems/subprocess.md +327 -0
  151. package/kb/site/en/reference/subsystems/system-prompt.md +210 -0
  152. package/kb/site/en/reference/subsystems/terminal.md +187 -0
  153. package/kb/site/en/reference/subsystems/token-meter.md +93 -0
  154. package/kb/site/en/reference/subsystems/tools.md +723 -0
  155. package/kb/site/en/reference/subsystems/typert.md +339 -0
  156. package/kb/site/en/reference/subsystems/user-questions.md +181 -0
  157. package/kb/site/en/reference/subsystems/web-server.md +111 -0
  158. package/kb/site/en/reference/subsystems/web.md +202 -0
  159. package/kb/site/en/reference/subsystems/workflow.md +281 -0
  160. package/kb/site/en/reference/subsystems/workspace.md +231 -0
  161. package/kb/site/en/reference/tool-catalog.md +1877 -0
  162. package/kb/site/en/reference/tool-execution-pipeline.md +66 -0
  163. package/kb/site/guide/providers-custom-form.zh.png +0 -0
  164. package/kb/site/guide/providers-models-page.zh.png +0 -0
  165. package/kb/site/guide/providers.md +100 -0
  166. package/kb/site/guide/python-sdk.md +106 -0
  167. package/kb/site/guide/quickstart.md +32 -0
  168. package/kb/site/index.md +8 -0
  169. package/kb/site/reference/agent-lifecycle.md +86 -0
  170. package/kb/site/reference/capability-seams.md +475 -0
  171. package/kb/site/reference/config-catalog.md +3154 -0
  172. package/kb/site/reference/cookbook/adding-a-conversation-node.md +235 -0
  173. package/kb/site/reference/cookbook/adding-a-package.md +120 -0
  174. package/kb/site/reference/cookbook/adding-a-settings-card.md +102 -0
  175. package/kb/site/reference/cookbook/adding-a-tool.md +98 -0
  176. package/kb/site/reference/cookbook/adding-an-llm-adapter.md +45 -0
  177. package/kb/site/reference/cookbook/extension-cookbook.md +133 -0
  178. package/kb/site/reference/cordis-api/context.md +368 -0
  179. package/kb/site/reference/cordis-api/events.md +211 -0
  180. package/kb/site/reference/cordis-api/fiber.md +379 -0
  181. package/kb/site/reference/cordis-api/inherited.md +43 -0
  182. package/kb/site/reference/cordis-api/registry.md +156 -0
  183. package/kb/site/reference/cordis-api/service.md +106 -0
  184. package/kb/site/reference/cordis-primer.md +52 -0
  185. package/kb/site/reference/index.md +135 -0
  186. package/kb/site/reference/persistence-catalog.md +949 -0
  187. package/kb/site/reference/subsystems/approval.md +173 -0
  188. package/kb/site/reference/subsystems/client-modules.md +121 -0
  189. package/kb/site/reference/subsystems/code-runtime.md +194 -0
  190. package/kb/site/reference/subsystems/commands.md +190 -0
  191. package/kb/site/reference/subsystems/compaction.md +241 -0
  192. package/kb/site/reference/subsystems/core.md +1081 -0
  193. package/kb/site/reference/subsystems/credentials.md +136 -0
  194. package/kb/site/reference/subsystems/filesystem.md +498 -0
  195. package/kb/site/reference/subsystems/goal.md +280 -0
  196. package/kb/site/reference/subsystems/index.md +58 -0
  197. package/kb/site/reference/subsystems/invariants.md +91 -0
  198. package/kb/site/reference/subsystems/jobs.md +293 -0
  199. package/kb/site/reference/subsystems/llm-streaming.md +926 -0
  200. package/kb/site/reference/subsystems/lsp.md +205 -0
  201. package/kb/site/reference/subsystems/permission-presets.md +134 -0
  202. package/kb/site/reference/subsystems/persistence.md +388 -0
  203. package/kb/site/reference/subsystems/plan.md +90 -0
  204. package/kb/site/reference/subsystems/sandbox.md +221 -0
  205. package/kb/site/reference/subsystems/schedule.md +189 -0
  206. package/kb/site/reference/subsystems/scope.md +62 -0
  207. package/kb/site/reference/subsystems/session-projection.md +265 -0
  208. package/kb/site/reference/subsystems/session-query.md +498 -0
  209. package/kb/site/reference/subsystems/session-reference.md +111 -0
  210. package/kb/site/reference/subsystems/session-telemetry.md +197 -0
  211. package/kb/site/reference/subsystems/session-title.md +207 -0
  212. package/kb/site/reference/subsystems/session.md +854 -0
  213. package/kb/site/reference/subsystems/settings.md +313 -0
  214. package/kb/site/reference/subsystems/shell.md +306 -0
  215. package/kb/site/reference/subsystems/skills.md +334 -0
  216. package/kb/site/reference/subsystems/spill.md +120 -0
  217. package/kb/site/reference/subsystems/storage.md +232 -0
  218. package/kb/site/reference/subsystems/subagent.md +739 -0
  219. package/kb/site/reference/subsystems/subprocess.md +327 -0
  220. package/kb/site/reference/subsystems/system-prompt.md +210 -0
  221. package/kb/site/reference/subsystems/terminal.md +187 -0
  222. package/kb/site/reference/subsystems/token-meter.md +93 -0
  223. package/kb/site/reference/subsystems/tools.md +723 -0
  224. package/kb/site/reference/subsystems/typert.md +339 -0
  225. package/kb/site/reference/subsystems/user-questions.md +181 -0
  226. package/kb/site/reference/subsystems/web-server.md +111 -0
  227. package/kb/site/reference/subsystems/web.md +202 -0
  228. package/kb/site/reference/subsystems/workflow.md +281 -0
  229. package/kb/site/reference/subsystems/workspace.md +231 -0
  230. package/kb/site/reference/tool-catalog.md +1880 -0
  231. package/kb/site/reference/tool-execution-pipeline.md +66 -0
  232. package/package.json +40 -0
  233. package/scripts/rebuild-index.mjs +88 -0
  234. package/skills/dsh-plugin-dev-kb.md +66 -0
@@ -0,0 +1,949 @@
1
+ ---
2
+ editSource: "docs/persistence-catalog.zh.md"
3
+ outline: "deep"
4
+ ---
5
+
6
+ <!-- 英文源文件由 scripts/gen-persistence-catalog.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
7
+ 更新时先运行 `pnpm run gen-persistence-catalog` 更新英文,再更新本文件并运行 `pnpm run verify-translation-pairing --write docs/persistence-catalog.md` 重新记录配对。 -->
8
+
9
+ # 会话持久化事件目录
10
+
11
+ 会话持久事件日志中可能出现的所有事件类型:完整持久化的 `SessionEvent` 信封,以及可通过合并扩展的 `SessionEventMap` 中的每个成员,包括 `@deepseek-ai/dsh-session` 所属的词汇和本仓库中每个插件对 `@deepseek-ai/dsh-session/types` 的声明合并,并附有源 JSDoc、完整 payload 声明、surface 标记和声明位置。本文档是 [session.md](./subsystems/session.md)(surface 排序与 `deriveMessages()` 投影)、[persistence.md](./subsystems/persistence.md)(如何让日志持久化)和 [session.md](./subsystems/session.md#cordis-surface) 中生成区域(实时总线接线;日志事件**不是** cordis 事件,它通过唯一的 `session/event` emit 到达监听器)的补充。
12
+
13
+ 英文源文件根据源码生成(`scripts/gen-persistence-catalog.ts`),并由 `pnpm run verify-persistence-catalog`(`doc-sync`(文档同步门禁)的一部分)验证新鲜度;本中文文件作为经评审对侧通过双语配对维护。声明块保留源码声明和嵌套属性的 JSDoc,只移除其所在接口/模块带来的缩进,并使用 `ts persistence-catalog` 围栏(doc-typecheck 会跳过这些围栏,因为声明引用了其所属模块中的类型)。payload 中的类型名称会链接到记录该类型的页面。参见 [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)。
14
+
15
+ 以下信封声明组合了每个事件的 `type`、单调递增的 `seq`、以 epoch 毫秒表示的 `time`、`data`、可选的未知类型跳过标记 `ignorable`,以及条件字段 `surfaceOp`/`sourceEventSeqs`。**surface** 表示 `SurfaceEventType` 成员:它会生成一条 LLM(大语言模型)消息,并声明该事件如何加入 surface 列表。**log-only** 表示其他所有事件:这类记录可持久化、可回放,但不参与派生历史。每个 payload 均可进行 JSON 序列化(在 `Session.append` 处强制执行),整个格式固定为 `SESSION_FORMAT_VERSION = 0`:这是预发布格式,不暗示任何兼容性(参见[版本立场](./subsystems/persistence.md))。范围仅限本仓库中的包;下游插件可以继续合并其他事件类型,而这些类型按设计不属于本目录。
16
+
17
+ ## 事件信封
18
+
19
+ ```ts persistence-catalog
20
+ /** The appendable event-type keys of {@link SessionEventMap}, plugin-merged extensions included. */
21
+ export type SessionEventType = keyof SessionEventMap
22
+
23
+ /**
24
+ * The subset of {@link SessionEventType} values whose events produce LLM
25
+ * messages and are eligible to appear on the ordered surface. Only these
26
+ * event types may carry {@link SurfaceOp} and {@link SessionEvent.sourceEventSeqs}.
27
+ */
28
+ export type SurfaceEventType =
29
+ | 'user/message'
30
+ | 'assistant/message'
31
+ | 'tool/result'
32
+
33
+ /**
34
+ * How a session event entered the ordered surface. Only valid on
35
+ * {@link SurfaceEventType} events.
36
+ *
37
+ * - `'append'`: added to the tail — normal path for user/assistant/tool
38
+ * 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
42
+ * node. The node's {@link SessionEvent.sourceEventSeqs} must include every
43
+ * shadowed surface node. Used by compaction; any surface-replacing producer
44
+ * may use it.
45
+ */
46
+ export type SurfaceOp =
47
+ | 'append'
48
+ | { op: 'replace'; start: number; end: number }
49
+
50
+ /**
51
+ * One immutable entry in the session log.
52
+ *
53
+ * A proper discriminated union over `type` (not independent `type`/`data`
54
+ * unions), so `switch (event.type)` narrows `event.data` without casts.
55
+ *
56
+ * The {@link sourceEventSeqs} and {@link surfaceOp} fields are conditional:
57
+ * they only exist on {@link SurfaceEventType} variants (`user/message`,
58
+ * `assistant/message`, `tool/result`).
59
+ * Non-surface events (boundary markers, chunks, usage, errors) never carry
60
+ * surface metadata — the compiler enforces this at `Session.append()`
61
+ * call sites.
62
+ */
63
+ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
64
+ [K in SessionEventType]: {
65
+ type: K
66
+ /** Monotonic sequence number within the session. */
67
+ seq: number
68
+ /** Unix epoch milliseconds. */
69
+ time: number
70
+ data: SessionEventMap[K]
71
+ /**
72
+ * Marks an event a reader may safely skip when it does not recognize
73
+ * `type`. Absent means required: a reader meeting an unrecognized type
74
+ * without this marker MUST refuse to reconstruct the session instead of
75
+ * silently dropping the event, because an unrecognized required event may
76
+ * change how the rest of the log is interpreted. A writer sets `true` only
77
+ * on purely informational records whose loss cannot affect reconstruction;
78
+ * defaulting to required means a forgotten marker over-refuses (an
79
+ * inconvenience) rather than silently resuming a gutted session.
80
+ */
81
+ ignorable?: true
82
+ } & (K extends SurfaceEventType ? {
83
+ /**
84
+ * Seq numbers of earlier events that this event cites as sources
85
+ * (e.g. the `assistant/chunk` seqs that built an `assistant/message`,
86
+ * or the surface nodes shadowed by a compaction replace node). An
87
+ * `assistant/message` may carry a present empty array for a known empty
88
+ * provider stream; when the field is absent, the event does not record which
89
+ * earlier events produced the message.
90
+ */
91
+ sourceEventSeqs?: number[]
92
+ /** How this event entered the surface; absent for non-surface events. */
93
+ surfaceOp?: SurfaceOp
94
+ } : object)
95
+ }[T]
96
+ ```
97
+
98
+ 来源:[`packages/core/session/src/types.ts:336`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:343`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:372`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:404`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
99
+
100
+ ## 事件
101
+
102
+ ### `agent/*`
103
+
104
+ <a id="agentinboxspliced--log-only"></a>
105
+
106
+ #### `agent/inbox/spliced` — log-only
107
+
108
+ ```ts persistence-catalog
109
+ /**
110
+ * One normalized mutation of an agent's durable pending-message lists.
111
+ * Live dispatch precedes projection mutation, so synchronous observers may
112
+ * read the pre-splice inbox to recover the removed messages.
113
+ */
114
+ 'agent/inbox/spliced': {
115
+ target: InboxTarget
116
+ start: number
117
+ removedCount?: number
118
+ inserted: UserMessage[]
119
+ outcome?: 'canceled'
120
+ }
121
+ ```
122
+
123
+ 来源:[`packages/core/agent/src/types.ts:19`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent/src/types.ts)
124
+
125
+ ### `agent-preset/*`
126
+
127
+ <a id="agent-presetselected--log-only"></a>
128
+
129
+ #### `agent-preset/selected` — log-only
130
+
131
+ ```ts persistence-catalog
132
+ /**
133
+ * The session's agent preset was chosen after creation, while the session
134
+ * was still blank. Log-only: it records the composition later turns ran
135
+ * under, so a resumed or forked session rebuilds the same one instead of
136
+ * the header's creation-time value.
137
+ */
138
+ 'agent-preset/selected': { agentPreset: string }
139
+ ```
140
+
141
+ 来源:[`packages/preset/agent-presets/src/session.ts:26`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/preset/agent-presets/src/session.ts)
142
+
143
+ ### `approval/*`
144
+
145
+ <a id="approvalasked--log-only"></a>
146
+
147
+ #### `approval/asked` — log-only
148
+
149
+ ```ts persistence-catalog
150
+ /**
151
+ * An approval question was put to the answerer chain — log-only audit
152
+ * (like `hook/*`; NOT a surface event, carries no `surfaceOp`). `id` pairs
153
+ * it with the `approval/decided` that always follows; `toolName` is the
154
+ * tool the question is about, `callId` the exact tool call when the asker
155
+ * had one, `reason` the asker's human-readable explanation (e.g. a hook's
156
+ * permission-decision reason).
157
+ */
158
+ 'approval/asked': {
159
+ id: ApprovalRequestId
160
+ toolName: string
161
+ callId?: CallId
162
+ reason?: string
163
+ }
164
+ ```
165
+
166
+ 类型:[CallId](./subsystems/core.md)
167
+
168
+ 来源:[`packages/interaction/user-approval/src/index.ts:44`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/user-approval/src/index.ts)
169
+
170
+ <a id="approvaldecided--log-only"></a>
171
+
172
+ #### `approval/decided` — log-only
173
+
174
+ ```ts persistence-catalog
175
+ /**
176
+ * The outcome of a prior `approval/asked` (same `id`) — log-only audit.
177
+ * Exactly one per ask, appended when the outcome is known: a decision, a
178
+ * cancellation, or the fail-closed `'unavailable'`.
179
+ */
180
+ 'approval/decided': {
181
+ id: ApprovalRequestId
182
+ outcome: ApprovalOutcome
183
+ }
184
+ ```
185
+
186
+ 来源:[`packages/interaction/user-approval/src/index.ts:55`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/user-approval/src/index.ts)
187
+
188
+ <a id="approvalpolicy--log-only"></a>
189
+
190
+ #### `approval/policy` — log-only
191
+
192
+ ```ts persistence-catalog
193
+ /**
194
+ * The session's approval policy was switched — log-only, durable,
195
+ * replayable, never in the model transcript (the model learns the policy
196
+ * from the runtime-context snapshot and live switch notices). The LAST
197
+ * such event is the session's override ({@link effectiveApprovalPolicy}).
198
+ * `source: 'delegation'` marks an override seeded into a child; an absent
199
+ * source is a runtime switch.
200
+ */
201
+ 'approval/policy': {
202
+ policy: ApprovalPolicy
203
+ /** Marks an override seeded into a child at delegation. */
204
+ source?: 'delegation'
205
+ }
206
+ ```
207
+
208
+ 来源:[`packages/interaction/user-approval/src/index.ts:67`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/user-approval/src/index.ts)
209
+
210
+ ### `assistant/*`
211
+
212
+ <a id="assistantchunk--log-only"></a>
213
+
214
+ #### `assistant/chunk` — log-only
215
+
216
+ ```ts persistence-catalog
217
+ /** Raw stream chunk — token-level replay fidelity. */
218
+ 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk }
219
+ ```
220
+
221
+ 类型:[StreamChunk](./subsystems/llm-streaming.md)
222
+
223
+ 来源:[`packages/core/session/src/types.ts:266`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
224
+
225
+ <a id="assistantmessage--surface"></a>
226
+
227
+ #### `assistant/message` — surface
228
+
229
+ ```ts persistence-catalog
230
+ /**
231
+ * Assembled assistant message for one step (derived history uses this).
232
+ * Carries the step's `usage` when the adapter reported token accounting, so
233
+ * the model output and its accounting travel together (there is no separate
234
+ * usage record). `usage` is absent when the adapter reported none.
235
+ */
236
+ 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage }
237
+ ```
238
+
239
+ 类型:[TokenUsage](./subsystems/llm-streaming.md)
240
+
241
+ 来源:[`packages/core/session/src/types.ts:273`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
242
+
243
+ ### `command/*`
244
+
245
+ <a id="commanddone--log-only"></a>
246
+
247
+ #### `command/done` — log-only
248
+
249
+ ```ts persistence-catalog
250
+ /**
251
+ * The paired command settled. `kind`/`text` carry the handler's verbatim
252
+ * outcome (a thrown/aborted handler settles as `kind: 'error'` with the
253
+ * rendered failure). A successful command may identify the earlier
254
+ * authoritative domain event for a richer client-computed presentation.
255
+ */
256
+ 'command/done': {
257
+ commandId: CommandId
258
+ kind: 'success' | 'error'
259
+ text?: string
260
+ sourceEventSeq?: number
261
+ }
262
+ ```
263
+
264
+ 来源:[`packages/interaction/commands/src/types.ts:95`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
265
+
266
+ <a id="commandrun--log-only"></a>
267
+
268
+ #### `command/run` — log-only
269
+
270
+ ```ts persistence-catalog
271
+ /**
272
+ * A resolved slash command entered its handler. Log-only (never model
273
+ * surface); paired with `command/done` by `commandId`, mirroring the
274
+ * `tool/call`↔`tool/result` pairing. The payload is structured — `name`
275
+ * and `args` are `parseCommand`'s own split (name and verbatim rawInput,
276
+ * separator whitespace included), so a consumer (a projection unit
277
+ * folding its own command records, a rich command card) never re-parses
278
+ * a line. `args` is absent when the definition sets `recordInput: false`
279
+ * because an authoritative domain event owns the input payload.
280
+ */
281
+ 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource }
282
+ ```
283
+
284
+ 来源:[`packages/interaction/commands/src/types.ts:88`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
285
+
286
+ ### `compaction/*`
287
+
288
+ <a id="compactionend--log-only"></a>
289
+
290
+ #### `compaction/end` — log-only
291
+
292
+ ```ts persistence-catalog
293
+ /**
294
+ * Marks the end of a compaction — log-only, releases the lock. Its owner
295
+ * matches `compaction/start`; `error` records an unsuccessful attempt.
296
+ */
297
+ 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string }
298
+ ```
299
+
300
+ 来源:[`packages/compaction/compaction/src/types.ts:71`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
301
+
302
+ <a id="compactionprune--log-only"></a>
303
+
304
+ #### `compaction/prune` — log-only
305
+
306
+ ```ts persistence-catalog
307
+ /**
308
+ * Shadow price of one model-free prune replacement — log-only, no
309
+ * surfaceOp. The shared shadow-price protocol: a surface `replace` event
310
+ * is priced by the metering event immediately before it (`compaction/summary`
311
+ * for a summarizing compaction, this event for a prune), which states the
312
+ * heuristic token price of the exact replaced range so a pure consumer
313
+ * can subtract it without retaining per-node prices. The replacement MUST
314
+ * be appended synchronously right after this event.
315
+ */
316
+ 'compaction/prune': {
317
+ /** The replaced range's first and last surface-node seqs (a surface-position span, like {@link CompactionResult.shadowedRange}). */
318
+ shadowedRange: { start: number; end: number }
319
+ /** The seqs of all shadowed surface nodes, in surface order. */
320
+ shadowedSeqs: number[]
321
+ /** Heuristic price of the shadowed content under the token-meter's fixed estimator. */
322
+ shadowedTokenCount: number
323
+ }
324
+ ```
325
+
326
+ 来源:[`packages/compaction/compaction/src/types.ts:81`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
327
+
328
+ <a id="compactionstart--log-only"></a>
329
+
330
+ #### `compaction/start` — log-only
331
+
332
+ ```ts persistence-catalog
333
+ /**
334
+ * Marks the start of a compaction — log-only, holds the lock until
335
+ * `compaction/end`. A numbered owner is strictly enclosed by that open turn;
336
+ * `null` identifies a standalone manual transaction between turns.
337
+ */
338
+ 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null }
339
+ ```
340
+
341
+ 来源:[`packages/compaction/compaction/src/types.ts:23`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
342
+
343
+ <a id="compactionsummary--log-only"></a>
344
+
345
+ #### `compaction/summary` — log-only
346
+
347
+ ```ts persistence-catalog
348
+ /**
349
+ * Completed summary, its inputs, and its model call facts — log-only, no surfaceOp.
350
+ * The summary content is in `data.summary`; the actual surface replacement
351
+ * is performed by the immediately following `user/message` event that
352
+ * shadows the compacted range. That adjacency is contractual — the
353
+ * shadowed pricing fields are the replacement's shadow price, so a
354
+ * consumer may pair a replacement with the metering event directly
355
+ * before it (`compaction/prune` documents the shared protocol).
356
+ */
357
+ 'compaction/summary': {
358
+ compactionId: CompactionId
359
+ sourceCommandId?: CommandId
360
+ summary: ContentBlock[]
361
+ shadowedRange: { start: number; end: number }
362
+ shadowedSeqs: number[]
363
+ shadowedTokenCount: number
364
+ /** The provider route that wrote the summary. */
365
+ provider: string
366
+ /**
367
+ * The model that wrote the summary — the summarize call's envelope,
368
+ * reported by the backend that made the call, logged so the one-shot
369
+ * request is reconstructable from log + code and "which model wrote
370
+ * this summary" has a durable answer (the reconstructability Agent Note).
371
+ */
372
+ model: string
373
+ /** The generation cap the summarize call sent, when one applied. */
374
+ maxTokens?: number
375
+ /** Provider-reported token usage for the summarization request, when emitted. */
376
+ usage?: TokenUsage
377
+ } & (
378
+ | {
379
+ /** Complete provider output before the backend's safe summary projection. */
380
+ rawOutput: ContentBlock[]
381
+ /** Identifies exactly one call through this context's `ctx.llm.stream()`. */
382
+ llmStreamCall: true
383
+ }
384
+ | {
385
+ /** Optional complete output from an unmarked template, remote, or other summarizer. */
386
+ rawOutput?: ContentBlock[]
387
+ /** An unmarked summary does not identify a call through this context's LLM seam. */
388
+ llmStreamCall?: never
389
+ }
390
+ )
391
+ ```
392
+
393
+ 类型:[ContentBlock](./subsystems/core.md) · [TokenUsage](./subsystems/llm-streaming.md)
394
+
395
+ 来源:[`packages/compaction/compaction/src/types.ts:33`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
396
+
397
+ ### `feedback/*`
398
+
399
+ <a id="feedbackrecord--log-only"></a>
400
+
401
+ #### `feedback/record` — log-only
402
+
403
+ ```ts persistence-catalog
404
+ /**
405
+ * One recorded human remark about this session. Log-only and independent
406
+ * of its trigger; it never enters model context or derived history.
407
+ */
408
+ 'feedback/record': { text: string }
409
+ ```
410
+
411
+ 来源:[`packages/feedback/command-feedback/src/index.ts:62`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/feedback/command-feedback/src/index.ts)
412
+
413
+ ### `goal/*`
414
+
415
+ <a id="goalchange--log-only"></a>
416
+
417
+ #### `goal/change` — log-only
418
+
419
+ ```ts persistence-catalog
420
+ /**
421
+ * Complete post-mutation goal state or clear tombstone.
422
+ */
423
+ 'goal/change': GoalChangeMeta
424
+ ```
425
+
426
+ 来源:[`packages/goal/goal/src/domain.ts:66`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/goal/goal/src/domain.ts)
427
+
428
+ ### `hook/*`
429
+
430
+ <a id="hookinvoked--log-only"></a>
431
+
432
+ #### `hook/invoked` — log-only
433
+
434
+ ```ts persistence-catalog
435
+ /**
436
+ * A hook command was invoked at a hook point — a log-only record (like
437
+ * `compaction/*`; NOT a {@link SurfaceEventType}, carries no `surfaceOp`).
438
+ * `dialect` is the bridge that ran it (`claude`/`codex`), `point`
439
+ * the hook point (`PreToolUse`, `Stop`, …), `matcher` the matcher-group
440
+ * pattern that selected it (absent for match-all), `handlerId` a stable id
441
+ * for the command (so an invoked/result pair correlates). `turn` is the open
442
+ * turn the invocation lives inside.
443
+ */
444
+ 'hook/invoked': {
445
+ turn: number
446
+ point: string
447
+ dialect: HookDialect
448
+ matcher?: string
449
+ handlerId: string
450
+ }
451
+ ```
452
+
453
+ 来源:[`packages/hooks/hook-protocol/src/types.ts:19`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/hooks/hook-protocol/src/types.ts)
454
+
455
+ <a id="hookresult--log-only"></a>
456
+
457
+ #### `hook/result` — log-only
458
+
459
+ ```ts persistence-catalog
460
+ /**
461
+ * Log-only outcome paired to `hook/invoked` by `handlerId`. Decision is the
462
+ * parsed permission result, `stop` for `continue:false`, or `pass`; exit code
463
+ * may be absent, stderr is bounded, and duration is wall-clock runtime.
464
+ */
465
+ 'hook/result': {
466
+ turn: number
467
+ point: string
468
+ handlerId: string
469
+ decision: string
470
+ exitCode?: number
471
+ stderrSummary?: string
472
+ durationMs: number
473
+ }
474
+ ```
475
+
476
+ 来源:[`packages/hooks/hook-protocol/src/types.ts:31`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/hooks/hook-protocol/src/types.ts)
477
+
478
+ ### `llm/*`
479
+
480
+ <a id="llmretry--log-only"></a>
481
+
482
+ #### `llm/retry` — log-only
483
+
484
+ ```ts persistence-catalog
485
+ /** Durable, non-surface record of one provider-routed retry scheduled after a failed request attempt. */
486
+ 'llm/retry': LlmRetryEventData
487
+ ```
488
+
489
+ 来源:[`packages/llm/llm-retry/src/types.ts:9`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-retry/src/types.ts)
490
+
491
+ <a id="llmretry-started--log-only"></a>
492
+
493
+ #### `llm/retry-started` — log-only
494
+
495
+ ```ts persistence-catalog
496
+ /** Durable transition written after a retry wait succeeds and before the next request attempt starts. */
497
+ 'llm/retry-started': LlmRetryStartedEventData
498
+ ```
499
+
500
+ 来源:[`packages/llm/llm-retry/src/types.ts:11`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-retry/src/types.ts)
501
+
502
+ ### `permission/*`
503
+
504
+ <a id="permissionpreset--log-only"></a>
505
+
506
+ #### `permission/preset` — log-only
507
+
508
+ ```ts persistence-catalog
509
+ /**
510
+ * Records the selected preset as durable, log-only user intent. The knob
511
+ * events follow in the same turn and control execution; this event stays
512
+ * out of the model transcript and lets {@link effectivePermissionPreset}
513
+ * preserve a selection when bundles match.
514
+ */
515
+ 'permission/preset': { preset: string }
516
+ ```
517
+
518
+ 来源:[`packages/interaction/permission-presets/src/index.ts:50`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/permission-presets/src/index.ts)
519
+
520
+ ### `plan/*`
521
+
522
+ <a id="planmode--log-only"></a>
523
+
524
+ #### `plan/mode` — log-only
525
+
526
+ ```ts persistence-catalog
527
+ /**
528
+ * Whether plan mode is in force from this point on: log-only, non-surface,
529
+ * whole-value replace. The last `plan/mode` wins; a log with none folds to
530
+ * inactive through {@link foldPlanMode}.
531
+ */
532
+ 'plan/mode': { active: boolean }
533
+ ```
534
+
535
+ 来源:[`packages/plan/plan-mode/src/index.ts:53`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/src/index.ts)
536
+
537
+ ### `request/*`
538
+
539
+ <a id="requestcontext--log-only"></a>
540
+
541
+ #### `request/context` — log-only
542
+
543
+ ```ts persistence-catalog
544
+ /**
545
+ * Route metadata for the next request, logged only when the route or capacity
546
+ * changes. It does not participate in request reconstruction or header equality.
547
+ */
548
+ 'request/context': RequestContext
549
+ ```
550
+
551
+ 来源:[`packages/core/session/src/types.ts:309`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
552
+
553
+ <a id="requestheader--log-only"></a>
554
+
555
+ #### `request/header` — log-only
556
+
557
+ ```ts persistence-catalog
558
+ /**
559
+ * Full header for the next request, appended inside its step before dispatch.
560
+ * It is log-only; the latest snapshot reconstructs the request header.
561
+ */
562
+ 'request/header': { header: EpochHeader; reason: RequestHeaderReason }
563
+ ```
564
+
565
+ 来源:[`packages/core/session/src/types.ts:304`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
566
+
567
+ ### `sandbox/*`
568
+
569
+ <a id="sandboxmode--log-only"></a>
570
+
571
+ #### `sandbox/mode` — log-only
572
+
573
+ ```ts persistence-catalog
574
+ /**
575
+ * The session's sandbox mode was switched — log-only (like `approval/*`;
576
+ * NOT a surface event, carries no `surfaceOp`): durable and replayable,
577
+ * never in the model transcript. The LAST such event is the session's
578
+ * override ({@link effectiveSandboxMode}). `source: 'delegation'` marks
579
+ * an override seeded into a child; an absent source is a runtime switch.
580
+ */
581
+ 'sandbox/mode': {
582
+ mode: SandboxMode
583
+ /** Marks an override seeded into a child at delegation. */
584
+ source?: 'delegation'
585
+ }
586
+ ```
587
+
588
+ 来源:[`packages/sandbox/sandbox-policy/src/session-mode.ts:33`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/sandbox/sandbox-policy/src/session-mode.ts)
589
+
590
+ ### `schedule/*`
591
+
592
+ <a id="schedulechange--log-only"></a>
593
+
594
+ #### `schedule/change` — log-only
595
+
596
+ ```ts persistence-catalog
597
+ /**
598
+ * Versioned Schedule mutation. The owning package validates the complete
599
+ * session-local transition stream before accepting a candidate event.
600
+ */
601
+ 'schedule/change': ScheduleChange
602
+ ```
603
+
604
+ 类型:[ScheduleChange](./subsystems/schedule.md)
605
+
606
+ 来源:[`packages/schedule/schedule/src/types.ts:219`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/schedule/schedule/src/types.ts)
607
+
608
+ ### `session/*`
609
+
610
+ <a id="sessionend-seed--log-only"></a>
611
+
612
+ #### `session/end-seed` — log-only
613
+
614
+ ```ts persistence-catalog
615
+ /**
616
+ * Marks the end of a constructor seed. Events before it have smaller seq
617
+ * values and came from the seed (resume, fork, or replay); this lifecycle
618
+ * produced none of them. This log-only event is the durable projection of
619
+ * {@link Session.firstLiveSeq}. Its payload is empty — position and `time`
620
+ * carry the meaning.
621
+ *
622
+ * Locate the LAST one in stored history. A seed already ending in one is not
623
+ * re-marked, so reopening an untouched session does not grow its log per
624
+ * pickup and the event need not be at the current `firstLiveSeq`.
625
+ *
626
+ * `Session`'s constructor is the only legitimate writer. The invariant
627
+ * companion deliberately constrains nothing here, so a plugin appending one
628
+ * would silently classify every live bracket before it as seed history.
629
+ *
630
+ * An owner of a standalone open/close bracket (`compaction/start` …
631
+ * `compaction/end`) reads it because seed history and live work are otherwise
632
+ * byte-identical: an unmatched opening marker before this event belongs to
633
+ * an ended lifecycle, whatever ended it. NOT a liveness signal about other
634
+ * writers — a concurrently live session holds its own boundary elsewhere,
635
+ * so tolerating concurrent writers needs a signal beyond the log.
636
+ */
637
+ 'session/end-seed': Record<string, never>
638
+ ```
639
+
640
+ 来源:[`packages/core/session/src/types.ts:332`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
641
+
642
+ <a id="sessiontitle--log-only"></a>
643
+
644
+ #### `session/title` — log-only
645
+
646
+ ```ts persistence-catalog
647
+ /**
648
+ * Latest-wins session title snapshot. Log-only: it never enters the model
649
+ * surface or derived history.
650
+ */
651
+ 'session/title': SessionTitleEventData
652
+ ```
653
+
654
+ 类型:[SessionTitleEventData](./subsystems/session-title.md)
655
+
656
+ 来源:[`packages/session/session-title/src/index.ts:100`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title/src/index.ts)
657
+
658
+ <a id="sessiontitle-llm-request--log-only"></a>
659
+
660
+ #### `session/title-llm-request` — log-only
661
+
662
+ ```ts persistence-catalog
663
+ /** Log-only pre-dispatch record of one session-title model request. */
664
+ 'session/title-llm-request': SessionTitleLlmRequestEventData
665
+ ```
666
+
667
+ 类型:[SessionTitleLlmRequestEventData](./subsystems/session-title.md)
668
+
669
+ 来源:[`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)
670
+
671
+ ### `step/*`
672
+
673
+ <a id="stepend--log-only"></a>
674
+
675
+ #### `step/end` — log-only
676
+
677
+ ```ts persistence-catalog
678
+ /** Closes step `step` of turn `turn`. */
679
+ 'step/end': { turn: number; step: number }
680
+ ```
681
+
682
+ 来源:[`packages/core/session/src/types.ts:256`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
683
+
684
+ <a id="stepstart--log-only"></a>
685
+
686
+ #### `step/start` — log-only
687
+
688
+ ```ts persistence-catalog
689
+ /** Opens step `step` of turn `turn` — one model call plus the tool executions it requested. */
690
+ 'step/start': { turn: number; step: number }
691
+ ```
692
+
693
+ 来源:[`packages/core/session/src/types.ts:254`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
694
+
695
+ ### `subagent/*`
696
+
697
+ <a id="subagentdescriptor--log-only"></a>
698
+
699
+ #### `subagent/descriptor` — log-only
700
+
701
+ ```ts persistence-catalog
702
+ /**
703
+ * Durable identity and lifecycle mode of a session-backed subagent child,
704
+ * appended once by the establishing provider inside the child's initial
705
+ * turn, before its first request. Continuable records also carry their
706
+ * resumable composition. Log-only: it carries no `surfaceOp`, never enters
707
+ * model history, and survives compaction.
708
+ */
709
+ 'subagent/descriptor': SubagentDescriptorData
710
+ ```
711
+
712
+ 来源:[`packages/subagent/subagent/src/descriptor.ts:37`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/descriptor.ts)
713
+
714
+ ### `todo/*`
715
+
716
+ <a id="todowrite--log-only"></a>
717
+
718
+ #### `todo/write` — log-only
719
+
720
+ ```ts persistence-catalog
721
+ /** Whole-list snapshot; latest write wins on replay. Log-only UI state; never derived history. */
722
+ 'todo/write': { todos: TodoItem[] }
723
+ ```
724
+
725
+ 类型:[TodoItem](./subsystems/session.md)
726
+
727
+ 来源:[`packages/core/session/src/types.ts:299`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
728
+
729
+ ### `tool/*`
730
+
731
+ <a id="toolcall--log-only"></a>
732
+
733
+ #### `tool/call` — log-only
734
+
735
+ ```ts persistence-catalog
736
+ /**
737
+ * The model requested one tool invocation: `name` with the raw `arguments`
738
+ * JSON string exactly as the model produced it (unparsed). `callId` pairs the
739
+ * call with its `tool/result`.
740
+ */
741
+ 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string }
742
+ ```
743
+
744
+ 类型:[CallId](./subsystems/core.md)
745
+
746
+ 来源:[`packages/core/session/src/types.ts:279`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
747
+
748
+ <a id="toolcode-dispatch--log-only"></a>
749
+
750
+ #### `tool/code-dispatch` — log-only
751
+
752
+ ```ts persistence-catalog
753
+ /**
754
+ * One bridged sub-dispatch SETTLING: the pairing ids (matching the
755
+ * `tool/code-dispatch-start` with the same `subCallId`), the tool `name`
756
+ * with the same JSON-normalized `arguments`, and the sub-call's complete
757
+ * model-facing outcome in `tool/result`'s own vocabulary
758
+ * (`content` + `isError`), so UIs render a sub-call through the exact
759
+ * code path that renders a native call. Every started sub-call settles
760
+ * with exactly one of these (abort included: the aborted pipeline result
761
+ * is an `isError` outcome).
762
+ * Log-only: `deriveMessages()` ignores it, so sub-calls never re-enter
763
+ * model context; persistence and UIs get every call. Appended inside the
764
+ * parent `run_code`'s execution (the bridge drains in-flight dispatches
765
+ * before returning), so its execution-enclosure relation holds by
766
+ * construction.
767
+ */
768
+ 'tool/code-dispatch': CodeDispatchEventData
769
+ ```
770
+
771
+ 来源:[`packages/core/tools/src/types.ts:56`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/types.ts)
772
+
773
+ <a id="toolcode-dispatch-start--log-only"></a>
774
+
775
+ #### `tool/code-dispatch-start` — log-only
776
+
777
+ ```ts persistence-catalog
778
+ /**
779
+ * One sub-dispatch STARTING inside a `run_code` program: the parent
780
+ * `run_code` call id, the deterministic sub-call id (`<parent>:code:<n>`,
781
+ * numbered in submission order), and the tool `name` with its
782
+ * JSON-normalized `arguments` — the exact value dispatched, normalized
783
+ * BEFORE dispatch, so this append can never fail on payload shape.
784
+ * Appended when the scheduler actually starts the call (not at
785
+ * submission), so a start means the tool body pipeline was entered; a
786
+ * call abandoned in the queue logs nothing. Log-only: `deriveMessages()`
787
+ * ignores it; UIs use it for live per-sub-call running state and pair it
788
+ * with `tool/code-dispatch` by `subCallId` (timing = the two events'
789
+ * `time` fields).
790
+ */
791
+ 'tool/code-dispatch-start': CodeDispatchStartEventData
792
+ ```
793
+
794
+ 来源:[`packages/core/tools/src/types.ts:40`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/types.ts)
795
+
796
+ <a id="toolresult--surface"></a>
797
+
798
+ #### `tool/result` — surface
799
+
800
+ ```ts persistence-catalog
801
+ /**
802
+ * A completed tool call's model-facing result, optional internal failure
803
+ * identity, and optional tool-private `meta` presentation payload. `meta` is
804
+ * opaque to the core (the producing tool owns its shape and reads it back in
805
+ * `presentResult`) but MUST be JSON-serializable: `Session.append`
806
+ * runtime-validates all event data with `isJsonValue`, so a non-serializable
807
+ * `meta` is rejected at the source, and the durable log reproduces the
808
+ * identical card on replay. Absent
809
+ * unless the tool attaches one (e.g. `dsh-tool-fs` carries its result-time
810
+ * contextual diff here).
811
+ */
812
+ 'tool/result': {
813
+ turn: number
814
+ step: number
815
+ message: ToolResultMessage
816
+ error?: { name: string; code: string }
817
+ meta?: JsonValue
818
+ }
819
+ ```
820
+
821
+ 来源:[`packages/core/session/src/types.ts:291`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
822
+
823
+ ### `tool-workflow/*`
824
+
825
+ <a id="tool-workflowagent-end--log-only"></a>
826
+
827
+ #### `tool-workflow/agent-end` — log-only
828
+
829
+ ```ts persistence-catalog
830
+ /**
831
+ * Records one member settlement.
832
+ * @param data - run identity, paired member sequence, and outcome.
833
+ */
834
+ 'tool-workflow/agent-end': ToolWorkflowAgentEndData
835
+ ```
836
+
837
+ 来源:[`packages/workflow/tool-workflow/src/types.ts:57`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/tool-workflow/src/types.ts)
838
+
839
+ <a id="tool-workflowagent-start--log-only"></a>
840
+
841
+ #### `tool-workflow/agent-start` — log-only
842
+
843
+ ```ts persistence-catalog
844
+ /**
845
+ * Records one published workflow member.
846
+ * @param data - run identity, member sequence, display identity, and child Session.
847
+ */
848
+ 'tool-workflow/agent-start': ToolWorkflowAgentStartData
849
+ ```
850
+
851
+ 来源:[`packages/workflow/tool-workflow/src/types.ts:52`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/tool-workflow/src/types.ts)
852
+
853
+ <a id="tool-workflowrun-end--log-only"></a>
854
+
855
+ #### `tool-workflow/run-end` — log-only
856
+
857
+ ```ts persistence-catalog
858
+ /**
859
+ * Closes one workflow record after cleanup.
860
+ * @param data - stable run identity and terminal reason.
861
+ */
862
+ 'tool-workflow/run-end': ToolWorkflowRunEndData
863
+ ```
864
+
865
+ 来源:[`packages/workflow/tool-workflow/src/types.ts:62`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/tool-workflow/src/types.ts)
866
+
867
+ <a id="tool-workflowrun-start--log-only"></a>
868
+
869
+ #### `tool-workflow/run-start` — log-only
870
+
871
+ ```ts persistence-catalog
872
+ /**
873
+ * Opens one top-level workflow record.
874
+ * @param data - stable run identity and display name.
875
+ */
876
+ 'tool-workflow/run-start': ToolWorkflowRunStartData
877
+ ```
878
+
879
+ 来源:[`packages/workflow/tool-workflow/src/types.ts:47`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/tool-workflow/src/types.ts)
880
+
881
+ ### `turn/*`
882
+
883
+ <a id="turnend--log-only"></a>
884
+
885
+ #### `turn/end` — log-only
886
+
887
+ ```ts persistence-catalog
888
+ /**
889
+ * Closes turn `turn` with the {@link TurnEndReason} that ended it. A turn
890
+ * with no entered step has no `step/start` or `step/end`. The loop does not await a
891
+ * flush at turn boundaries: `dsh-session-checkpoint-policy` owns the
892
+ * per-request durability checkpoint, and consumers that read storage after
893
+ * `whenIdle()` flush themselves. Success commits the turn; rejection is
894
+ * reported live and does not prevent later work.
895
+ */
896
+ 'turn/end': { turn: number; reason: TurnEndReason }
897
+ ```
898
+
899
+ 类型:[TurnEndReason](./subsystems/session.md)
900
+
901
+ 来源:[`packages/core/session/src/types.ts:252`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
902
+
903
+ <a id="turnstart--log-only"></a>
904
+
905
+ #### `turn/start` — log-only
906
+
907
+ ```ts persistence-catalog
908
+ /**
909
+ * Opens turn `turn` before the loop claims queued input or runs pre-step.
910
+ * Rejection, empty input, cancellation, or failure may close it with no
911
+ * step; otherwise the following identified `user/message` event or batch
912
+ * records the messages entering the step.
913
+ */
914
+ 'turn/start': { turn: number }
915
+ ```
916
+
917
+ 来源:[`packages/core/session/src/types.ts:243`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
918
+
919
+ ### `user/*`
920
+
921
+ <a id="usermessage--surface"></a>
922
+
923
+ #### `user/message` — surface
924
+
925
+ ```ts persistence-catalog
926
+ /**
927
+ * A user-role message on the model-visible surface: a direct human prompt
928
+ * (the queued message claimed for this turn), a synthetic `agent.inject()`
929
+ * context (file-change notices, subdir AGENTS.md, skill content, cron
930
+ * notifications, …), or an entered goal continuation round. All three
931
+ * project their `content` verbatim; `source` tells them apart.
932
+ */
933
+ 'user/message': UserMessage
934
+ ```
935
+
936
+ 来源:[`packages/core/session/src/types.ts:264`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
937
+
938
+ ### `web/*`
939
+
940
+ <a id="webdeepseek-search-llm-request--log-only"></a>
941
+
942
+ #### `web/deepseek-search-llm-request` — log-only
943
+
944
+ ```ts persistence-catalog
945
+ /** Secret-free auxiliary DeepSeek search request recorded before dispatch. */
946
+ 'web/deepseek-search-llm-request': DeepSeekSearchLlmRequest
947
+ ```
948
+
949
+ 来源:[`packages/web/web-search-deepseek/src/provider.ts:83`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/web/web-search-deepseek/src/provider.ts)