better-dsh 0.2.3 → 0.2.4

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