dsh-plugin-guide 0.3.15 → 0.3.16

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 (423) hide show
  1. package/package.json +1 -1
  2. package/references/official-docs/AGENTS.md +74 -49
  3. package/references/official-docs/README.i18n.yaml +2 -2
  4. package/references/official-docs/README.zh.md +12 -0
  5. package/references/official-docs/SNAPSHOT.md +4 -4
  6. package/references/official-docs/THIRD_PARTY_NOTICES.md +86 -30
  7. package/references/official-docs/docs/AGENTS.md +7 -6
  8. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
  9. package/references/official-docs/docs/agent-lifecycle.md +12 -5
  10. package/references/official-docs/docs/agent-lifecycle.zh.md +12 -5
  11. package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
  12. package/references/official-docs/docs/api-gateway.md +2 -2
  13. package/references/official-docs/docs/api-gateway.zh.md +2 -2
  14. package/references/official-docs/docs/architecture.i18n.yaml +2 -2
  15. package/references/official-docs/docs/architecture.md +26 -12
  16. package/references/official-docs/docs/architecture.zh.md +28 -14
  17. package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
  18. package/references/official-docs/docs/capability-seams.md +111 -31
  19. package/references/official-docs/docs/capability-seams.zh.md +111 -31
  20. package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
  21. package/references/official-docs/docs/config-catalog.md +674 -202
  22. package/references/official-docs/docs/config-catalog.zh.md +691 -219
  23. package/references/official-docs/docs/cookbook/adding-a-session-format-version.i18n.yaml +6 -0
  24. package/references/official-docs/docs/cookbook/adding-a-session-format-version.md +111 -0
  25. package/references/official-docs/docs/cookbook/adding-a-session-format-version.zh.md +111 -0
  26. package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +1 -1
  27. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
  28. package/references/official-docs/docs/cookbook/adding-a-tool.md +2 -2
  29. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +4 -4
  30. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
  31. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +1 -1
  32. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +1 -1
  33. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +1 -1
  34. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
  35. package/references/official-docs/docs/cookbook/extension-cookbook.md +3 -3
  36. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +5 -5
  37. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +2 -2
  38. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +1 -1
  39. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  40. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.i18n.yaml +6 -0
  41. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.md +108 -0
  42. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.zh.md +108 -0
  43. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +2 -2
  44. package/references/official-docs/docs/cordis-api/fiber.md +3 -3
  45. package/references/official-docs/docs/cordis-api/fiber.zh.md +3 -3
  46. package/references/official-docs/docs/cordis-api/inherited.md +0 -3
  47. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +2 -2
  48. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +2 -2
  49. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +2 -2
  50. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +2 -2
  51. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +14 -15
  52. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +15 -16
  53. package/references/official-docs/docs/dependency-catalog.json +7312 -0
  54. package/references/official-docs/docs/development.i18n.yaml +2 -2
  55. package/references/official-docs/docs/development.md +13 -3
  56. package/references/official-docs/docs/development.zh.md +16 -6
  57. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
  58. package/references/official-docs/docs/event-producer-consumer.md +50 -39
  59. package/references/official-docs/docs/event-producer-consumer.zh.md +55 -44
  60. package/references/official-docs/docs/glossary.i18n.yaml +2 -2
  61. package/references/official-docs/docs/glossary.md +1 -1
  62. package/references/official-docs/docs/glossary.zh.md +1 -1
  63. package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
  64. package/references/official-docs/docs/i18n/README.md +8 -3
  65. package/references/official-docs/docs/i18n/README.zh.md +8 -3
  66. package/references/official-docs/docs/i18n/style-samples.md +1 -1
  67. package/references/official-docs/docs/i18n/translation-prompt.md +5 -5
  68. package/references/official-docs/docs/i18n/translation-rules.zh.md +2 -2
  69. package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
  70. package/references/official-docs/docs/module-graph.md +303 -120
  71. package/references/official-docs/docs/module-graph.zh.md +303 -120
  72. package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
  73. package/references/official-docs/docs/persistence-catalog.md +5699 -64
  74. package/references/official-docs/docs/persistence-catalog.zh.md +5708 -73
  75. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.i18n.yaml +6 -0
  76. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.md +280 -0
  77. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.schema.json +13557 -0
  78. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.zh.md +280 -0
  79. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.i18n.yaml +6 -0
  80. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
  81. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.schema.json +910 -0
  82. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
  83. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.i18n.yaml +6 -0
  84. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.md +96 -0
  85. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.schema.json +8478 -0
  86. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
  87. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.i18n.yaml +6 -0
  88. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
  89. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.schema.json +72 -0
  90. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
  91. package/references/official-docs/docs/persistence-changes/README.i18n.yaml +6 -0
  92. package/references/official-docs/docs/persistence-changes/README.md +74 -0
  93. package/references/official-docs/docs/persistence-changes/README.zh.md +74 -0
  94. package/references/official-docs/docs/persistence-changes/historical-formats/README.i18n.yaml +6 -0
  95. package/references/official-docs/docs/persistence-changes/historical-formats/README.md +74 -0
  96. package/references/official-docs/docs/persistence-changes/historical-formats/README.zh.md +74 -0
  97. package/references/official-docs/docs/persistence-changes/historical-formats/v0.i18n.yaml +6 -0
  98. package/references/official-docs/docs/persistence-changes/historical-formats/v0.md +5105 -0
  99. package/references/official-docs/docs/persistence-changes/historical-formats/v0.schema.json +49308 -0
  100. package/references/official-docs/docs/persistence-changes/historical-formats/v0.zh.md +5105 -0
  101. package/references/official-docs/docs/persistence-changes/historical-formats/v1.i18n.yaml +6 -0
  102. package/references/official-docs/docs/persistence-changes/historical-formats/v1.md +5107 -0
  103. package/references/official-docs/docs/persistence-changes/historical-formats/v1.schema.json +49411 -0
  104. package/references/official-docs/docs/persistence-changes/historical-formats/v1.zh.md +5107 -0
  105. package/references/official-docs/docs/persistence-changes/historical-formats/v2.i18n.yaml +6 -0
  106. package/references/official-docs/docs/persistence-changes/historical-formats/v2.md +5362 -0
  107. package/references/official-docs/docs/persistence-changes/historical-formats/v2.schema.json +56466 -0
  108. package/references/official-docs/docs/persistence-changes/historical-formats/v2.zh.md +5362 -0
  109. package/references/official-docs/docs/persistence-changes/releases/README.i18n.yaml +6 -0
  110. package/references/official-docs/docs/persistence-changes/releases/README.md +103 -0
  111. package/references/official-docs/docs/persistence-changes/releases/README.zh.md +103 -0
  112. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.i18n.yaml +6 -0
  113. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
  114. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.schema.json +39868 -0
  115. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
  116. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.i18n.yaml +6 -0
  117. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
  118. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.schema.json +43342 -0
  119. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
  120. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.i18n.yaml +6 -0
  121. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
  122. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.schema.json +19452 -0
  123. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
  124. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.i18n.yaml +6 -0
  125. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
  126. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.schema.json +5 -0
  127. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
  128. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.i18n.yaml +6 -0
  129. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
  130. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.schema.json +5 -0
  131. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
  132. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.i18n.yaml +6 -0
  133. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
  134. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.schema.json +5 -0
  135. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
  136. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.i18n.yaml +6 -0
  137. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
  138. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.schema.json +5 -0
  139. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
  140. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.i18n.yaml +6 -0
  141. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
  142. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.schema.json +5 -0
  143. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
  144. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.i18n.yaml +6 -0
  145. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
  146. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.schema.json +5 -0
  147. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
  148. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.i18n.yaml +6 -0
  149. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
  150. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.schema.json +5 -0
  151. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
  152. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.i18n.yaml +6 -0
  153. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
  154. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.schema.json +5320 -0
  155. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
  156. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.i18n.yaml +6 -0
  157. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
  158. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.schema.json +21258 -0
  159. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
  160. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.i18n.yaml +6 -0
  161. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
  162. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.schema.json +417 -0
  163. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
  164. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.i18n.yaml +6 -0
  165. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
  166. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.schema.json +29672 -0
  167. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
  168. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.i18n.yaml +6 -0
  169. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
  170. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.schema.json +48429 -0
  171. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
  172. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.i18n.yaml +6 -0
  173. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
  174. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.schema.json +49347 -0
  175. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
  176. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.i18n.yaml +6 -0
  177. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
  178. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.schema.json +5 -0
  179. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
  180. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.i18n.yaml +6 -0
  181. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
  182. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.schema.json +17642 -0
  183. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
  184. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.i18n.yaml +6 -0
  185. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
  186. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.schema.json +5 -0
  187. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
  188. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.i18n.yaml +6 -0
  189. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
  190. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.schema.json +5 -0
  191. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
  192. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.i18n.yaml +6 -0
  193. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
  194. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.schema.json +38678 -0
  195. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
  196. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.i18n.yaml +6 -0
  197. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
  198. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.schema.json +783 -0
  199. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
  200. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.i18n.yaml +6 -0
  201. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
  202. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.schema.json +24597 -0
  203. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
  204. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.i18n.yaml +6 -0
  205. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
  206. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.schema.json +2132 -0
  207. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
  208. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.i18n.yaml +6 -0
  209. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
  210. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.schema.json +5 -0
  211. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
  212. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.i18n.yaml +6 -0
  213. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
  214. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.schema.json +5 -0
  215. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
  216. package/references/official-docs/docs/persistence-changes/releases/manifest.json +162 -0
  217. package/references/official-docs/docs/persistence-schema.json +61480 -0
  218. package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
  219. package/references/official-docs/docs/postmortem/README.md +1 -1
  220. package/references/official-docs/docs/postmortem/README.zh.md +1 -1
  221. package/references/official-docs/docs/rescope.i18n.yaml +2 -2
  222. package/references/official-docs/docs/rescope.md +2 -2
  223. package/references/official-docs/docs/rescope.zh.md +2 -2
  224. package/references/official-docs/docs/session-format-status.i18n.yaml +6 -0
  225. package/references/official-docs/docs/session-format-status.md +49 -0
  226. package/references/official-docs/docs/session-format-status.zh.md +49 -0
  227. package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
  228. package/references/official-docs/docs/subsystems/README.md +12 -3
  229. package/references/official-docs/docs/subsystems/README.zh.md +23 -14
  230. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +2 -2
  231. package/references/official-docs/docs/subsystems/agent-team.md +1 -1
  232. package/references/official-docs/docs/subsystems/agent-team.zh.md +2 -2
  233. package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
  234. package/references/official-docs/docs/subsystems/approval.md +1 -1
  235. package/references/official-docs/docs/subsystems/approval.zh.md +1 -1
  236. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
  237. package/references/official-docs/docs/subsystems/attachment.md +17 -7
  238. package/references/official-docs/docs/subsystems/attachment.zh.md +17 -7
  239. package/references/official-docs/docs/subsystems/{code-runtime.i18n.yaml → boot.i18n.yaml} +3 -3
  240. package/references/official-docs/docs/subsystems/boot.md +223 -0
  241. package/references/official-docs/docs/subsystems/boot.zh.md +223 -0
  242. package/references/official-docs/docs/subsystems/browser-use.i18n.yaml +6 -0
  243. package/references/official-docs/docs/subsystems/browser-use.md +67 -0
  244. package/references/official-docs/docs/subsystems/browser-use.zh.md +67 -0
  245. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
  246. package/references/official-docs/docs/subsystems/client-modules.md +20 -10
  247. package/references/official-docs/docs/subsystems/client-modules.zh.md +21 -11
  248. package/references/official-docs/docs/subsystems/client-resources.i18n.yaml +6 -0
  249. package/references/official-docs/docs/subsystems/client-resources.md +92 -0
  250. package/references/official-docs/docs/subsystems/client-resources.zh.md +92 -0
  251. package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
  252. package/references/official-docs/docs/subsystems/commands.md +4 -0
  253. package/references/official-docs/docs/subsystems/commands.zh.md +5 -1
  254. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
  255. package/references/official-docs/docs/subsystems/compaction.md +48 -2
  256. package/references/official-docs/docs/subsystems/compaction.zh.md +50 -4
  257. package/references/official-docs/docs/subsystems/computer-use.i18n.yaml +6 -0
  258. package/references/official-docs/docs/subsystems/computer-use.md +56 -0
  259. package/references/official-docs/docs/subsystems/computer-use.zh.md +56 -0
  260. package/references/official-docs/docs/subsystems/conversation.zh.md +1 -1
  261. package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
  262. package/references/official-docs/docs/subsystems/core.md +106 -60
  263. package/references/official-docs/docs/subsystems/core.zh.md +109 -63
  264. package/references/official-docs/docs/subsystems/deliverables.i18n.yaml +6 -0
  265. package/references/official-docs/docs/subsystems/deliverables.md +178 -0
  266. package/references/official-docs/docs/subsystems/deliverables.zh.md +178 -0
  267. package/references/official-docs/docs/subsystems/extensions.zh.md +1 -1
  268. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
  269. package/references/official-docs/docs/subsystems/feedback.md +165 -31
  270. package/references/official-docs/docs/subsystems/feedback.zh.md +165 -31
  271. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
  272. package/references/official-docs/docs/subsystems/filesystem.md +15 -0
  273. package/references/official-docs/docs/subsystems/filesystem.zh.md +16 -1
  274. package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
  275. package/references/official-docs/docs/subsystems/goal.md +37 -1
  276. package/references/official-docs/docs/subsystems/goal.zh.md +38 -2
  277. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
  278. package/references/official-docs/docs/subsystems/invariants.md +1 -1
  279. package/references/official-docs/docs/subsystems/invariants.zh.md +3 -3
  280. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +1 -1
  281. package/references/official-docs/docs/subsystems/jobs.md +1 -1
  282. package/references/official-docs/docs/subsystems/jobs.zh.md +1 -1
  283. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
  284. package/references/official-docs/docs/subsystems/llm-streaming.md +35 -15
  285. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +37 -17
  286. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
  287. package/references/official-docs/docs/subsystems/lsp.md +1 -1
  288. package/references/official-docs/docs/subsystems/lsp.zh.md +1 -1
  289. package/references/official-docs/docs/subsystems/mcp.i18n.yaml +6 -0
  290. package/references/official-docs/docs/subsystems/mcp.md +139 -0
  291. package/references/official-docs/docs/subsystems/mcp.zh.md +139 -0
  292. package/references/official-docs/docs/subsystems/office-to-pdf.i18n.yaml +6 -0
  293. package/references/official-docs/docs/subsystems/office-to-pdf.md +87 -0
  294. package/references/official-docs/docs/subsystems/office-to-pdf.zh.md +87 -0
  295. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
  296. package/references/official-docs/docs/subsystems/permission-presets.md +62 -27
  297. package/references/official-docs/docs/subsystems/permission-presets.zh.md +62 -27
  298. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
  299. package/references/official-docs/docs/subsystems/persistence.md +36 -15
  300. package/references/official-docs/docs/subsystems/persistence.zh.md +36 -15
  301. package/references/official-docs/docs/subsystems/plan.zh.md +2 -2
  302. package/references/official-docs/docs/subsystems/ptc-runtime.i18n.yaml +6 -0
  303. package/references/official-docs/docs/subsystems/ptc-runtime.md +232 -0
  304. package/references/official-docs/docs/subsystems/ptc-runtime.zh.md +232 -0
  305. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
  306. package/references/official-docs/docs/subsystems/sandbox.md +5 -4
  307. package/references/official-docs/docs/subsystems/sandbox.zh.md +7 -6
  308. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
  309. package/references/official-docs/docs/subsystems/schedule.md +2 -2
  310. package/references/official-docs/docs/subsystems/schedule.zh.md +3 -3
  311. package/references/official-docs/docs/subsystems/scope.i18n.yaml +2 -2
  312. package/references/official-docs/docs/subsystems/scope.md +1 -1
  313. package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
  314. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
  315. package/references/official-docs/docs/subsystems/session-projection.md +1 -1
  316. package/references/official-docs/docs/subsystems/session-projection.zh.md +2 -2
  317. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
  318. package/references/official-docs/docs/subsystems/session-reference.md +11 -6
  319. package/references/official-docs/docs/subsystems/session-reference.zh.md +11 -6
  320. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
  321. package/references/official-docs/docs/subsystems/session-telemetry.md +22 -6
  322. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +23 -7
  323. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
  324. package/references/official-docs/docs/subsystems/session-title.md +5 -5
  325. package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
  326. package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
  327. package/references/official-docs/docs/subsystems/session.md +149 -61
  328. package/references/official-docs/docs/subsystems/session.zh.md +150 -62
  329. package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
  330. package/references/official-docs/docs/subsystems/shell.md +19 -15
  331. package/references/official-docs/docs/subsystems/shell.zh.md +20 -16
  332. package/references/official-docs/docs/subsystems/sidebar-right.i18n.yaml +6 -0
  333. package/references/official-docs/docs/subsystems/sidebar-right.md +153 -0
  334. package/references/official-docs/docs/subsystems/sidebar-right.zh.md +153 -0
  335. package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
  336. package/references/official-docs/docs/subsystems/skills.md +4 -6
  337. package/references/official-docs/docs/subsystems/skills.zh.md +4 -6
  338. package/references/official-docs/docs/subsystems/slots.i18n.yaml +2 -2
  339. package/references/official-docs/docs/subsystems/slots.md +52 -38
  340. package/references/official-docs/docs/subsystems/slots.zh.md +53 -39
  341. package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
  342. package/references/official-docs/docs/subsystems/spill.md +13 -6
  343. package/references/official-docs/docs/subsystems/spill.zh.md +13 -6
  344. package/references/official-docs/docs/subsystems/ssh.i18n.yaml +6 -0
  345. package/references/official-docs/docs/subsystems/ssh.md +135 -0
  346. package/references/official-docs/docs/subsystems/ssh.zh.md +135 -0
  347. package/references/official-docs/docs/subsystems/storage.zh.md +2 -2
  348. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
  349. package/references/official-docs/docs/subsystems/subagent.md +33 -16
  350. package/references/official-docs/docs/subsystems/subagent.zh.md +32 -15
  351. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
  352. package/references/official-docs/docs/subsystems/subprocess.md +41 -44
  353. package/references/official-docs/docs/subsystems/subprocess.zh.md +41 -44
  354. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
  355. package/references/official-docs/docs/subsystems/system-prompt.md +6 -2
  356. package/references/official-docs/docs/subsystems/system-prompt.zh.md +7 -3
  357. package/references/official-docs/docs/subsystems/todo.zh.md +1 -1
  358. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
  359. package/references/official-docs/docs/subsystems/token-meter.md +2 -1
  360. package/references/official-docs/docs/subsystems/token-meter.zh.md +2 -1
  361. package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
  362. package/references/official-docs/docs/subsystems/tools.md +28 -12
  363. package/references/official-docs/docs/subsystems/tools.zh.md +28 -12
  364. package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
  365. package/references/official-docs/docs/subsystems/typert.md +6 -5
  366. package/references/official-docs/docs/subsystems/typert.zh.md +6 -5
  367. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
  368. package/references/official-docs/docs/subsystems/user-questions.md +2 -0
  369. package/references/official-docs/docs/subsystems/user-questions.zh.md +2 -0
  370. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +2 -2
  371. package/references/official-docs/docs/subsystems/web-client.md +5 -5
  372. package/references/official-docs/docs/subsystems/web-client.zh.md +6 -6
  373. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
  374. package/references/official-docs/docs/subsystems/web-server.md +64 -0
  375. package/references/official-docs/docs/subsystems/web-server.zh.md +65 -1
  376. package/references/official-docs/docs/subsystems/webhook.i18n.yaml +1 -1
  377. package/references/official-docs/docs/subsystems/webhook.md +2 -2
  378. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
  379. package/references/official-docs/docs/subsystems/workflow.md +8 -8
  380. package/references/official-docs/docs/subsystems/workflow.zh.md +10 -10
  381. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
  382. package/references/official-docs/docs/subsystems/workspace.md +199 -1
  383. package/references/official-docs/docs/subsystems/workspace.zh.md +199 -1
  384. package/references/official-docs/docs/testing.i18n.yaml +2 -2
  385. package/references/official-docs/docs/testing.md +5 -4
  386. package/references/official-docs/docs/testing.zh.md +5 -4
  387. package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
  388. package/references/official-docs/docs/tool-catalog.md +452 -187
  389. package/references/official-docs/docs/tool-catalog.zh.md +454 -189
  390. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
  391. package/references/official-docs/docs/tool-execution-pipeline.md +2 -2
  392. package/references/official-docs/docs/tool-execution-pipeline.zh.md +2 -2
  393. package/references/official-docs/docs/user/develop/basic/index.zh.md +1 -1
  394. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
  395. package/references/official-docs/docs/user/develop/basic/publish.md +2 -2
  396. package/references/official-docs/docs/user/develop/basic/publish.zh.md +5 -5
  397. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +2 -2
  398. package/references/official-docs/docs/user/develop/framework/index.md +1 -1
  399. package/references/official-docs/docs/user/develop/framework/index.zh.md +1 -1
  400. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +2 -2
  401. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +8 -8
  402. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +8 -8
  403. package/references/official-docs/docs/user/guide/index.zh.md +2 -2
  404. package/references/official-docs/docs/user/guide/mcp-memory.zh.md +1 -1
  405. package/references/official-docs/docs/user/guide/network-proxy.i18n.yaml +2 -2
  406. package/references/official-docs/docs/user/guide/network-proxy.md +1 -1
  407. package/references/official-docs/docs/user/guide/network-proxy.zh.md +1 -1
  408. package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
  409. package/references/official-docs/docs/user/guide/providers.md +12 -8
  410. package/references/official-docs/docs/user/guide/providers.zh.md +14 -10
  411. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
  412. package/references/official-docs/docs/user/guide/python-sdk.md +59 -23
  413. package/references/official-docs/docs/user/guide/python-sdk.zh.md +60 -24
  414. package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
  415. package/references/official-docs/docs/web-styling.md +2 -1
  416. package/references/official-docs/docs/web-styling.zh.md +3 -2
  417. package/references/official-docs/packages/AGENTS.md +1 -1
  418. package/references/official-docs/packages/README.md +12 -7
  419. package/references/official-docs/vendor/README.md +15 -11
  420. package/references/official-docs/website-docs.ts +4 -2
  421. package/scripts/sync-official-docs.ps1 +5 -5
  422. package/references/official-docs/docs/subsystems/code-runtime.md +0 -195
  423. package/references/official-docs/docs/subsystems/code-runtime.zh.md +0 -195
@@ -2,11 +2,11 @@
2
2
 
3
3
  [English](core.md) | 中文
4
4
 
5
- **核心**子系统即 [`packages/core`](../../packages/core/README-zh.md),包含每个组合都会启动的包:事件溯源的会话日志、系统提示词组装、工具注册表、agent(智能体)类型,以及驱动它们的具体循环。本页说明 `agent`/`agent-loop` 这对包所声明的内容:agent 如何被创建与拥有,以及 `Agent` 句柄的投递、取消与拦截约定;本页还说明每个子系统都遵循的两个类型模式。该组的专属页面与目录其余部分见[子系统 README](README-zh.md)。
5
+ **核心**子系统即 [`packages/core`](../../packages/core/README.zh.md),包含每个组合都会启动的包:事件溯源的会话日志、系统提示词组装、工具注册表、agent(智能体)类型,以及驱动它们的具体循环。本页说明 `agent`/`agent-loop` 这对包所声明的内容:agent 如何被创建与拥有,以及 `Agent` 句柄的投递、取消与拦截约定;本页还说明每个子系统都遵循的两个类型模式。该组的专属页面与目录其余部分见[子系统 README](README.zh.md)。
6
6
 
7
7
  ## 主干逐包速览
8
8
 
9
- 一个轮次按同一条循环流经六个包:[`agent-loop`](../../packages/core/agent-loop) 中的 driver 认领一条排队的提示词,在[会话日志](session.zh.md)(`ctx.sessions`)上开启轮次,通过 [system-prompt](system-prompt.zh.md)(`ctx.systemPrompt`)组装请求前缀并从日志派生历史,经 [LLM(大语言模型) seam](llm-streaming.zh.md) 流式获取模型响应,经[工具注册表](tools.zh.md)(`ctx.tools`)分发工具调用,并把每个模型可见的事实追加回日志,供下一步派生。循环搬运的对话词汇——`Message`、`ContentBlock`、`StreamChunk`、模型请求——由 [`packages/llm`](../../packages/llm/README-zh.md) 声明,记录在 [llm-streaming.md](llm-streaming.zh.md)。
9
+ 一个轮次按同一条循环流经六个包:[`agent-loop`](../../packages/core/agent-loop) 中的 driver 认领一条排队的提示词,在[会话日志](session.zh.md)(`ctx.sessions`)上开启轮次,通过 [system-prompt](system-prompt.zh.md)(`ctx.systemPrompt`)组装请求前缀并从日志派生历史,经 [LLM(大语言模型) seam](llm-streaming.zh.md) 流式获取模型响应,经[工具注册表](tools.zh.md)(`ctx.tools`)分发工具调用,并把每个模型可见的事实追加回日志,供下一步派生。循环搬运的对话词汇——`Message`、`ContentBlock`、`StreamChunk`、模型请求——由 [`packages/llm`](../../packages/llm/README.zh.md) 声明,记录在 [llm-streaming.md](llm-streaming.zh.md)。
10
10
 
11
11
  | 包 | 负责内容 | 页面 |
12
12
  |---|---|---|
@@ -17,7 +17,7 @@
17
17
  | `agent-loop/` | 实现公开 `Agent` 约定的具体 driver(`ctx.agentLoop`) | 本页 |
18
18
  | `scope/` | 注册表与循环用于构建按 agent 作用域的注册原语 | [scope.md](scope.zh.md) |
19
19
 
20
- `scope/` 是这里唯一的非服务包:一个零依赖库(`createScope`/`scopeOf`/`scopeTarget`),在模块图中位于 `session/` 与 `system-prompt/` 之下,正是为了让它们消费它而不形成环。`agent-loop` 是公开 `Agent` 约定的唯一具体实现,放在这里因为它是 harness 的默认产品循环;它在 `ctx.agents.withInitiator()` 内运行每个 driver。扩展插件依赖 `agent`——包括需要发起 Agent 时——而绝不直接依赖 `agent-loop`,因此循环保持可替换。[`dsh-base`](../../packages/bundle/base/README-zh.md) 是默认产品组合,[`dsh-sdk-minimal`](../../packages/bundle/sdk-minimal/README-zh.md) 则声明一棵更小的独立配置树。
20
+ `scope/` 是这里唯一的非服务包:一个零依赖库(`createScope`/`scopeOf`/`scopeTarget`),在模块图中位于 `session/` 与 `system-prompt/` 之下,正是为了让它们消费它而不形成环。`agent-loop` 是公开 `Agent` 约定的唯一具体实现,放在这里因为它是 harness 的默认产品循环;它在 `ctx.agents.withInitiator()` 内运行每个 driver。扩展插件依赖 `agent`——包括需要发起 Agent 时——而绝不直接依赖 `agent-loop`,因此循环保持可替换。[`dsh-base`](../../packages/bundle/base/README.zh.md) 是默认产品组合,[`dsh-sdk-minimal`](../../packages/bundle/sdk-minimal/README.zh.md) 则声明一棵更小的独立配置树。
21
21
 
22
22
  <a id="creation-and-ownership"></a>
23
23
 
@@ -48,9 +48,9 @@ interface AgentHandle {
48
48
  }
49
49
  ```
50
50
 
51
- `CreateAgentOptions` 携带共享标识以及新 agent 发布前所需的一切:会话元数据(`meta`——已校验的 `cwd`、fork 谱系、`isSeeded` 标记、来源分类、委派深度与 `agentPreset`)、同级字段 `inheritedEventCount` 所表示的精确 fork cut、可选的 `seed` 回放前缀、按 agent 的 `AgentOptions`、仅创建期有效的取消 `signal`,以及 `setup`。`ResumeAgentOptions` 是持久标识的对应项:`resumeSessionId`、`agentOptions`、`signal` 与 `setup`。`setup` 回调(`AgentSetup`)在两个 id 都尚未发布时组装 agent 的作用域世界——凡经 `agentCtx` 注册的内容都先于 `agent/created` 与第一次提示词组装存在——并可返回一个在发布前一刻调用的同步 commit;setup 拒绝、commit 抛出或所有者 dispose(资源释放)都会回滚事务,两个 id 均不发布。
51
+ `CreateAgentOptions` 携带共享标识以及新 agent 发布前所需的一切:可选的存活 `parentAgent`、会话元数据(`meta`——已校验的 `cwd`、fork 谱系、`isSeeded` 标记、来源分类、委派深度与 `agentPreset`)、同级字段 `inheritedEventCount` 所表示的精确 fork cut、可选的 `seed` 回放前缀、按 agent 的 `AgentOptions`、仅创建期有效的取消 `signal`,以及 `setup`。`ResumeAgentOptions` 是持久标识的对应项:`resumeSessionId`、`parentAgent`、`agentOptions`、`signal` 与 `setup`。`setup` 回调(`AgentSetup`)在两个 id 均未发布时接收 `(agentCtx, agent)`:上下文拥有作用域注册,显式 Agent 提供确切的子 Session,Context 无需反向属性。凡经 `agentCtx` 注册的内容都先于 `agent/created` 与第一次提示词组装存在。Setup 可以返回在发布前一刻调用的同步 commit;setup 拒绝、commit 抛出或所有者 dispose(资源释放)都会回滚事务,两个 id 均不发布。
52
52
 
53
- `AgentFactory` 是注册表背后的创建接口:循环经 `ctx.agents.setFactory()` 注册其工厂,因此消费方使用 `ctx.agents` 时无需依赖具体循环包。确切的 `create`/`resume` 签名及回滚约定见下方[生成区块](#ctxagents--agentregistry)。
53
+ `AgentFactory` 是注册表背后的创建接口:循环经 `ctx.agents.setFactory()` 注册其工厂,因此消费方使用 `ctx.agents` 时无需依赖具体循环包。运行时子 Agent 的创建方设置 `options.parentAgent`;注册表把 options 与调用方 Context 传给工厂,不从其中一项推导另一项。确切的 `create`/`resume` 签名及回滚约定见下方[生成区块](#ctxagents--agentregistry)。
54
54
 
55
55
  <a id="the-agent-handle"></a>
56
56
 
@@ -69,7 +69,7 @@ interface Agent {
69
69
  readonly options: AgentOptions
70
70
  /** The live session this agent drives; its log is the durable source of truth. */
71
71
  readonly session: Session
72
- /** The agent-owned projection of durable pending work. */
72
+ /** Agent-owned access to durable pending work. */
73
73
  readonly inbox: Inbox
74
74
  /** The current lifecycle state, mirrored on every `agent/status` transition. */
75
75
  readonly status: AgentStatus
@@ -210,16 +210,73 @@ interface AgentOptions {
210
210
  }
211
211
  ```
212
212
 
213
- 在 `agent/request` 之后,分发要求 `provider` 与 `model` 都存在。显式 `reasoningEffort` 会为该路由的首次请求提供初始值;确切模型解析会校验该值,省略时则允许填入适配器默认值。提供 `maxTokens` 时,它必须是正安全整数,并限制每次对话模型请求的输出;省略时,系统会在写入请求 header 前填入确切模型的适配器默认值,否则提供方行为保持不变。agent 作用域的 `deployment:persona` 提示词段落可以遮蔽全局默认 persona。
213
+ 在 `agent/request` 之后,分发要求 `provider` 与 `model` 都存在。显式 `reasoningEffort` 会为该路由的首次请求提供初始值;确切模型解析会校验该值,省略时则允许填入适配器默认值。提供 `maxTokens` 时,它必须是正安全整数,并限制每次对话模型请求的输出;省略时,系统会在写入请求 header 前填入确切模型的适配器默认值,否则提供方行为保持不变。agent 作用域的 `deployment:persona-prefix` 提示词段落可以遮蔽全局默认 persona。
214
214
 
215
215
  inbox 即投递词汇——agent 以持久投影形式拥有的两条有序待处理消息列表:
216
216
 
217
+ ```ts type-equiv
218
+ /** Agent-owned access to pending work; concrete storage belongs to the driver. */
219
+ interface Inbox {
220
+ /** Prompts awaiting individual turns. */
221
+ readonly nextTurn: readonly UserMessage[]
222
+ /** Input awaiting the next step boundary. */
223
+ readonly nextStep: readonly UserMessage[]
224
+
225
+ /** Durably cancel all pending input, clearing next-step before next-turn. */
226
+ clear(): void
227
+
228
+ /**
229
+ * Append one message to a pending list.
230
+ * @param target - pending list to extend.
231
+ * @param message - message to append.
232
+ */
233
+ append(target: InboxTarget, message: UserMessage): void
234
+
235
+ /**
236
+ * Prepend one message to a pending list.
237
+ * @param target - pending list to extend.
238
+ * @param message - message to prepend.
239
+ */
240
+ prepend(target: InboxTarget, message: UserMessage): void
241
+
242
+ /**
243
+ * Replace one pending message in place.
244
+ * @param messageId - identity of the pending message to replace.
245
+ * @param newMessage - replacement message.
246
+ * @returns whether the message was still pending.
247
+ */
248
+ replace(messageId: MessageId, newMessage: UserMessage): boolean
249
+
250
+ /**
251
+ * Remove one pending message.
252
+ * @param messageId - identity of the pending message to remove.
253
+ * @returns whether the message was still pending.
254
+ */
255
+ remove(messageId: MessageId): boolean
256
+
257
+ /**
258
+ * Apply standard splice semantics and durably record the normalized result.
259
+ * @param target - pending list to mutate.
260
+ * @param start - splice position.
261
+ * @param deleteCount - maximum number of messages to remove.
262
+ * @param inserted - messages to insert at the resolved position.
263
+ * @returns messages removed by the splice.
264
+ */
265
+ splice(
266
+ target: InboxTarget,
267
+ start: number,
268
+ deleteCount: number,
269
+ inserted: UserMessage[],
270
+ ): UserMessage[]
271
+ }
272
+ ```
273
+
217
274
  ```ts type-equiv
218
275
  /** One of the two ordered pending-message lists owned by an agent. */
219
276
  type InboxTarget = 'next-turn' | 'next-step'
220
277
  ```
221
278
 
222
- 每个待处理入队项就是其 `UserMessage`;`MessageId` 是唯一标识。`Inbox.append`、`prepend`、`replace`、`remove`、`clear`、`splice` `claim` 会记录规范化的持久 `agent/inbox/spliced` 变更,并拒绝重复的待处理 id。`replace(messageId, newMessage)` 与 `remove(messageId)` 通过 `MessageId` 跨两份列表定位待处理消息;替换可以改变标识,并先将旧消息作为 discarded 发布,再将新消息作为 inserted 发布。普通删除和 `clear()` 都表示取消。`claim(target)` 通过纯删除 splice 移除拟进入步骤的批次——全部 `next-step` 输入,外加轮次边界上的一条 `next-turn` 消息——且不发出 discarded 通知;循环另行逐条发出 claimed 通知。UI 投影等整体队列消费方通过持久 splice 重建 `nextTurn` `nextStep`,而跟踪单条消息的消费方使用精确的 `agent/inbox/inserted`、`claimed` 与 `discarded` 通知。
279
+ 每个待处理入队项就是其 `UserMessage`;`MessageId` 是唯一标识。结构化 `Inbox` 方法会记录规范化的持久 `agent/inbox/spliced` 变更,并拒绝重复的待处理 id。`replace(messageId, newMessage)` 与 `remove(messageId)` 通过 `MessageId` 跨两份列表定位待处理消息;替换可以改变标识,并先将旧消息作为 discarded 发布,再将新消息作为 inserted 发布。普通删除和 `clear()` 都表示取消。在步骤边界,dsh-agent-loop 包内部的 `ReactLoopInbox` 会通过纯删除 splice 移除拟进入步骤的批次——全部 `next-step` 输入,外加轮次边界上的一条 `next-turn` 消息——且不发出 discarded 通知,随后逐条发出 claimed 通知。仅供循环使用的待处理检测与领取操作不属于 `Agent.inbox`。`AgentLoop` 服务在发布工厂之前注册标准 `inbox` 投影;其 cell 是唯一 live 状态,同一份折叠在没有 Agent 时也服务于冷消费方。该 fold 会拒绝不安全或越界的 splice 坐标,以及跨两份列表重复的标识,并通过事件 seq 指出格式错误的持久历史。跟踪单条消息的消费方使用精确的 `agent/inbox/inserted`、`claimed` 与 `discarded` 通知。
223
280
 
224
281
  取消:
225
282
 
@@ -287,7 +344,7 @@ type RequestErrorAction = { kind: 'retry' } | undefined
287
344
 
288
345
  `agent/pre-step` 是请求推导前唯一的 waterfall(瀑布式)监听器链。`agent/turn-stopping` 在轮次没有工具或 steering(中途引导)后续时运行,先于最后一次 steering 排空。
289
346
 
290
- `agent/session-start` 携带 `SessionStartSource`(会话生命周期为何开始;桥接层据此匹配其 SessionStart):
347
+ `agent/created` 携带 `SessionStartSource`(会话生命周期为何开始;桥接层据此匹配其 SessionStart):
291
348
 
292
349
  ```ts type-equiv
293
350
  /** Why a session lifecycle began; seeded creates are `startup`, while persisted loads are `resume`. */
@@ -298,7 +355,7 @@ type SessionStartSource = 'startup' | 'resume' | 'clear' | 'compact'
298
355
 
299
356
  `Session` 是一份类型化 `SessionEvent` 的**仅追加日志**——唯一的真源。LLM 消息历史从日志*派生*(`deriveMessages()`),而非单独存储。每个条目携带单调的 `seq`、`time` 与按 `type` 判别的 `data` payload;surface 变体还可以在 `sourceEventSeqs` 中列出被引用的较早事件,并携带 `surfaceOp`。
300
357
 
301
- `SessionEvent` 信封的确切条件字段、十二种核心事件变体(`turn/start`、`turn/end`、`step/start`、`step/end`、`user/message`、`assistant/message`、`assistant/attempt`、`tool/call`、`tool/result`、`request/header`、`request/context`、`session/end-seed`)、`deriveMessages()` 投影规则、`TurnEndReason` 原因以及执行封闭和独立事件规则都在 **[session.md](session.zh.md)** 中。日志如何持久化——`SessionPersistence` 接口、JSONL provider、`session/flush` 检查点、崩溃恢复与 `SessionHeader`——则在 **[persistence.md](persistence.zh.md)** 中。
358
+ `SessionEvent` 信封的确切条件字段、十三种核心事件变体(`turn/start`、`turn/end`、`step/start`、`step/end`、`user/message`、`system/message`、`assistant/message`、`assistant/attempt`、`tool/call`、`tool/result`、`request/header`、`request/context`、`session/end-seed`)、`deriveMessages()` 投影规则、`TurnEndReason` 原因以及执行封闭和独立事件规则都在 **[session.md](session.zh.md)** 中。日志如何持久化——`SessionPersistence` 接口、JSONL provider、`session/flush` 检查点、崩溃恢复与 `SessionHeader`——则在 **[persistence.md](persistence.zh.md)** 中。
302
359
 
303
360
  ## `ToolDefinition`
304
361
 
@@ -416,7 +473,7 @@ async create(id: SessionId, options: AgentOptions = {}, meta: Pick<SessionHeader
416
473
  /**
417
474
  * Create an owned agent on a caller-supplied session id.
418
475
  * @param ownerCtx - caller context that structurally owns the lifecycle.
419
- * @param options - identities, session seed/metadata, loop options, setup, and cancellation.
476
+ * @param options - identities, optional live parent, session seed/metadata, loop options, setup, and cancellation.
420
477
  * @returns the published handle.
421
478
  */
422
479
  async createAgent(ownerCtx: Context, options: CreateAgentOptions): Promise<AgentHandle>
@@ -424,7 +481,7 @@ async createAgent(ownerCtx: Context, options: CreateAgentOptions): Promise<Agent
424
481
  /**
425
482
  * Resume an owned agent from the configured persistence service.
426
483
  * @param ownerCtx - caller context that owns load, setup, and the live lifecycle.
427
- * @param options - persisted identity, loop options, setup, and cancellation.
484
+ * @param options - persisted identity, optional live parent, loop options, setup, and cancellation.
428
485
  * @returns the published handle.
429
486
  */
430
487
  async resume(ownerCtx: Context, options: ResumeAgentOptions): Promise<AgentHandle>
@@ -451,11 +508,12 @@ async list(): Promise<AgentPreset[]>
451
508
 
452
509
  /**
453
510
  * The roster off the Host: {@link list} projected to path-free rows, with
454
- * the default marked and this deployment's authoring capability beside it.
511
+ * the policy-effective default marked, this deployment's authoring
512
+ * capability, and its mode-selection policy beside it.
455
513
  *
456
514
  * Whether a client can open a preset's directory is the Host's own opener
457
515
  * capability, not a roster property — a caller needing both joins them.
458
- * @returns the rows and the authoring capability.
516
+ * @returns the rows, authoring capability, and effective selection policy.
459
517
  */
460
518
  @Remote('list') async remoteExportList(): Promise<AgentPresetRoster>
461
519
 
@@ -689,7 +747,8 @@ Initiator methods provide same-process causal attribution only. Ambient presence
689
747
  * Read the Agent that initiated the inherited asynchronous driver chain.
690
748
  * Use this optional form for logging, tracing, metrics, or host attribution
691
749
  * that also supports agentless calls. When a parent creates a child, setup
692
- * reports the causal parent while `agentCtx.agent` identifies the child.
750
+ * reports the causal parent while the setup callback's Agent parameter
751
+ * identifies the child.
693
752
  * @returns the inherited Agent, or `undefined` outside an initiator boundary
694
753
  * and inside an explicit clearing boundary.
695
754
  * @throws when this service instance has been disposed.
@@ -754,7 +813,7 @@ setFactory(factory: AgentFactory): () => void
754
813
  * agent): this constructs the agent and its session. Rejects if no factory is
755
814
  * registered or creation/setup fails. The resolved {@link AgentHandle} lets
756
815
  * the owner tear down exactly this agent.
757
- * @param options - shared identity, session seed/metadata, and agent options.
816
+ * @param options - shared identity, optional live parent, session seed/metadata, and agent options.
758
817
  * @returns the handle after setup, rollback-covered publication, and loop start complete.
759
818
  */
760
819
  async create(options: CreateAgentOptions): Promise<AgentHandle>
@@ -763,21 +822,22 @@ async create(options: CreateAgentOptions): Promise<AgentHandle>
763
822
  * Load a persisted session and resume an agent on it through the registered
764
823
  * factory. Rejects if no factory is registered; the factory rejects if
765
824
  * session persistence is not configured or persistence/setup fails.
766
- * @param options - persisted identity, configuration, and optional setup.
825
+ * @param options - persisted identity, optional live parent, configuration, and setup.
767
826
  * @returns the handle after setup, rollback-covered publication, and loop start complete.
768
827
  */
769
828
  async resume(options: ResumeAgentOptions): Promise<AgentHandle>
770
829
 
771
830
  /**
772
- * Register a live agent. Throws if an agent with the same id is already
773
- * registered. Emits `agent/created` on registration and `agent/disposed`
831
+ * Register a live agent with source `startup`. Rejects if the id is already registered or a
832
+ * serial `agent/created` listener fails. Emits `agent/disposed`
774
833
  * when the calling fiber is disposed — both with the agent's scope carrier
775
834
  * (`scopeTarget(agent, agent)`): the subject is the agent in hand, so the
776
835
  * emits are scope-filtered regardless of which context invoked `register`
777
836
  * (calling through `agent.ctx` scopes EFFECTS; dispatch scoping always
778
- * requires passing the carrier). Returns the disposer.
837
+ * requires passing the carrier). The entry is a runtime root; factory-backed
838
+ * creation uses `options.parentAgent` for child ownership. Await the registration before using the agent.
779
839
  * @param agent - the already-constructed agent to record in the store.
780
- * @returns the EXACT Cordis effect disposer (single-shot; a repeat call
840
+ * @returns the awaitable Cordis effect disposer (single-shot; a repeat call
781
841
  * returns undefined without awaiting an in-flight teardown). Exact
782
842
  * identity is load-bearing: a composite (generator) effect that owns a
783
843
  * teardown ORDER — the agent factory's lifecycle chain — must yield THIS
@@ -786,7 +846,7 @@ async resume(options: ResumeAgentOptions): Promise<AgentHandle>
786
846
  * owner unload, unregistering the agent (and emitting `agent/disposed`)
787
847
  * while its final turn is still draining.
788
848
  */
789
- register(agent: Agent): () => void
849
+ register(agent: Agent): ReturnType<Context['effect']>
790
850
 
791
851
  /**
792
852
  * Insert an already-constructed agent without announcing it. This is the
@@ -795,24 +855,27 @@ register(agent: Agent): () => void
795
855
  * returned detach closure into its pre-installed composite teardown before
796
856
  * calling {@link announce}. Ordinary callers use {@link register}.
797
857
  * @param agent - the prepared, unpublished agent.
798
- * @param owner - live agent whose scoped context created this agent, or
858
+ * @param owner - explicitly supplied live runtime owner, or
799
859
  * undefined for a top-level runtime root. This is runtime ownership, not
800
860
  * the resumed session's durable parent lineage.
801
861
  * @returns an idempotent closure that removes this exact entry and emits
802
862
  * `agent/disposed` with listener failures contained. When called from a
803
- * synchronous `agent/created` listener, removal and disposal wait until
804
- * that creation dispatch unwinds.
863
+ * `agent/created` listener, removal and disposal wait until the serial
864
+ * creation dispatch settles.
805
865
  */
806
866
  enter(agent: Agent, owner: Agent | undefined): () => void
807
867
 
808
868
  /**
809
869
  * Announce an agent previously inserted with {@link enter}.
810
870
  * @param agent - the live inserted agent to announce.
871
+ * @param source - fresh creation, resume, clear, or compaction source.
872
+ * @param signal - optional factory initialization cancellation signal passed to listeners.
873
+ * @returns completion of the serial creation listeners; a listener failure rejects.
811
874
  * @throws if `agent` is not the exact live registry entry for its id, or its
812
875
  * creation announcement already began (including a reentrant call from a
813
876
  * creation listener).
814
877
  */
815
- announce(agent: Agent): void
878
+ async announce(agent: Agent, source: SessionStartSource, signal?: AbortSignal): Promise<void>
816
879
 
817
880
  /**
818
881
  * Look up a live agent.
@@ -875,24 +938,27 @@ Types: [Scoped](scope.zh.md)
875
938
 
876
939
  Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
877
940
 
878
- <a id="agentcreated--emit"></a>
941
+ <a id="agentcreated--serial"></a>
879
942
 
880
- #### `agent/created` — emit
943
+ #### `agent/created` — serial
881
944
 
882
- A fully configured agent and live session were published. Setup is composition-only; `agent/session-start` is the first startup-driving extension point. Synchronous listener failure vetoes publication, while returned-promise rejection is reported. Detach requested during dispatch waits until every creation listener has observed the stable entry.
945
+ An entered agent is ready for per-agent initialization after factory setup. Listeners run in order and are awaited before creation resolves. AgentLoop holds queued input until all listeners finish. A throw or rejection fails creation and skips later listeners. Disposal retains the scope and session until dispatch settles; listeners must not await agent.whenIdle() or their own owner's disposal.
883
946
 
884
947
  ```ts cordis-catalog
885
948
  /**
886
- * A fully configured agent and live session were published. Setup is
887
- * composition-only; `agent/session-start` is the first startup-driving extension point.
888
- * Synchronous listener failure vetoes publication, while returned-promise
889
- * rejection is reported. Detach requested during dispatch waits until every
890
- * creation listener has observed the stable entry.
949
+ * An entered agent is ready for per-agent initialization after factory setup.
950
+ * Listeners run in order and are awaited before creation resolves. AgentLoop
951
+ * holds queued input until all listeners finish. A throw or rejection fails
952
+ * creation and skips later listeners. Disposal retains the scope and session
953
+ * until dispatch settles; listeners must not await agent.whenIdle() or their
954
+ * own owner's disposal.
891
955
  * @param payload.agent - the newly registered agent with its live session and completed setup.
956
+ * @param payload.source - fresh creation, resume, clear, or compaction source.
957
+ * @param payload.signal - factory initialization cancellation signal, when provided.
892
958
  * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
893
- * @mode emit
959
+ * @mode serial
894
960
  */
895
- 'agent/created'(this: Scoped<Agent>, payload: { agent: Agent }): void
961
+ 'agent/created'(this: Scoped<Agent>, payload: { agent: Agent; source: SessionStartSource; signal?: AbortSignal }): undefined | Promise<undefined>
896
962
  ```
897
963
 
898
964
  Types: [Scoped](scope.zh.md)
@@ -1040,14 +1106,18 @@ Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/s
1040
1106
 
1041
1107
  #### `agent/request` — waterfall
1042
1108
 
1043
- Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. Model-visible content must use logged channels; this waterfall cannot mutate messages.
1109
+ Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. On step admission, this runs after assembly and `step/start`, before the system prompt and accepted user batch are committed. Cancellation here or during subsequent `prepareCall()` resolution commits neither. The prepared call capability governs prompt admission. Model-visible content must use logged channels; this waterfall cannot mutate messages.
1044
1110
 
1045
1111
  ```ts cordis-catalog
1046
1112
  /**
1047
1113
  * Replace the frozen call configuration. `await next()` yields the config
1048
1114
  * the machine would use (agent options on the first request, the logged
1049
- * header afterwards); return a replacement to switch. Model-visible
1050
- * content must use logged channels; this waterfall cannot mutate messages.
1115
+ * header afterwards); return a replacement to switch. On step admission,
1116
+ * this runs after assembly and `step/start`, before the system prompt and
1117
+ * accepted user batch are committed. Cancellation here or during subsequent
1118
+ * `prepareCall()` resolution commits neither. The prepared call capability
1119
+ * governs prompt admission. Model-visible content must use logged channels;
1120
+ * this waterfall cannot mutate messages.
1051
1121
  * @param payload.agent - the agent making the model call.
1052
1122
  * @param payload.turn - the open turn number.
1053
1123
  * @param payload.step - the step whose request this is.
@@ -1091,30 +1161,6 @@ Types: [LlmFailure](llm-streaming.zh.md) · [ResolvedRetryPolicy](llm-streaming.
1091
1161
 
1092
1162
  Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
1093
1163
 
1094
- <a id="agentsession-start--emit"></a>
1095
-
1096
- #### `agent/session-start` — emit
1097
-
1098
- The session lifecycle began, once before the first turn. Use `agent.inject()` to seed model-facing context. This is a notification, not a veto; disposal requested by a lifecycle owner is rechecked before the driver starts.
1099
-
1100
- ```ts cordis-catalog
1101
- /**
1102
- * The session lifecycle began, once before the first turn. Use
1103
- * `agent.inject()` to seed model-facing context. This is a notification, not
1104
- * a veto; disposal requested by a lifecycle owner is rechecked before the
1105
- * driver starts.
1106
- * @param payload.agent - the agent whose session lifecycle began.
1107
- * @param payload.source - why the session started (fresh startup, resume, …).
1108
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
1109
- * @mode emit
1110
- */
1111
- 'agent/session-start'(this: Scoped<Agent>, payload: { agent: Agent; source: SessionStartSource }): void
1112
- ```
1113
-
1114
- Types: [Scoped](scope.zh.md)
1115
-
1116
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
1117
-
1118
1164
  <a id="agentstatus--emit"></a>
1119
1165
 
1120
1166
  #### `agent/status` — emit
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write docs/subsystems/deliverables.md
5
+ deliverables.md: 3347481f3e69d9a3921bb8784335b62bc9d869c2
6
+ deliverables.zh.md: d3d10565d58664d749cb0c9dbacf1fa2ab741066
@@ -0,0 +1,178 @@
1
+ # Deliverables
2
+
3
+ English | [中文](deliverables.zh.md)
4
+
5
+ What a turn hands to the user, owned by the [deliverables package group](../../packages/deliverables/README.md): the files the model declared through the `present` tool, recorded in a log-only Session event, and the files the turn changed, summarized from git working-tree snapshots taken at turn start and turn end plus whole-file captures around each file-tool edit for the paths git does not cover, announced by a log-only event and served by a Host service while the Session lives together with each listed file's turn-start and turn-end comparison. Only clients read them; the Web [deliverables plugin](../../packages/client/ui-deliverables/README.md) renders both at the end of the turn. Tool behavior, snapshot mechanics, and configuration are on the package READMEs for [`tool-present`](../../packages/deliverables/tool-present/README.md) and [`workspace-changes`](../../packages/deliverables/workspace-changes/README.md).
6
+
7
+ Sources: [`packages/deliverables/tool-present/src/types.ts`](../../packages/deliverables/tool-present/src/types.ts), [`packages/deliverables/workspace-changes/src/types.ts`](../../packages/deliverables/workspace-changes/src/types.ts)
8
+
9
+ ## `PresentedFile` — one declared delivery
10
+
11
+ ```ts type-equiv
12
+ /** A declared filesystem file whose current contents remain at its source path. */
13
+ interface PresentedFile {
14
+ /** Original absolute path or path relative to the Session working directory. */
15
+ path: string
16
+ /** Optional description supplied by the model. */
17
+ description?: string
18
+ }
19
+ ```
20
+
21
+ ## `WorkspaceChangedFile` — one changed file
22
+
23
+ ```ts type-equiv
24
+ /** One file changed during a turn, with line counts from git or from the whole-file captures around its file-tool edits. */
25
+ interface WorkspaceChangedFile {
26
+ /** Path relative to the Session working directory, or an absolute Host path outside it. */
27
+ path: string
28
+ /**
29
+ * Sort key and label: the relative path inside the working directory, a
30
+ * `../` path for repository files above it, a `~` path under the home
31
+ * directory, otherwise the absolute path. Always slash-separated.
32
+ */
33
+ display: string
34
+ /** Lines added; zero for a binary or oversized file. */
35
+ added: number
36
+ /** Lines deleted; zero for a binary or oversized file. */
37
+ deleted: number
38
+ /** Present when git reported the file as binary, or when a captured side holds a NUL byte. */
39
+ binary?: true
40
+ /** Present when a captured side exceeded the plugin's `maxFileBytes`; the file is listed without counts or comparison. */
41
+ oversized?: true
42
+ }
43
+ ```
44
+
45
+ ## `WorkspaceChangesSummary` — one turn's change summary
46
+
47
+ ```ts type-equiv
48
+ /** Files changed during one top-level turn, kept on the Host until its Session is disposed. */
49
+ interface WorkspaceChangesSummary {
50
+ /** The turn whose file changes this summary describes. */
51
+ turn: number
52
+ /** The Session working directory `path` values are relative to. */
53
+ cwd: string
54
+ /** Changed files in `display` order, capped at the plugin's `maxFiles`. */
55
+ files: WorkspaceChangedFile[]
56
+ /** Complete changed-file count, including files omitted by the cap. */
57
+ total: number
58
+ /** Lines added over every changed file, including files omitted by the cap. */
59
+ added: number
60
+ /** Lines deleted over every changed file, including files omitted by the cap. */
61
+ deleted: number
62
+ /** Git tree ids of the turn-start and turn-end snapshots; absent when no snapshot was taken. */
63
+ snapshot?: { before: string; after: string }
64
+ }
65
+ ```
66
+
67
+ ## `WorkspaceDiffHunk` — one unified-diff hunk
68
+
69
+ ```ts type-equiv
70
+ /** One unified-diff hunk with three context lines; every line keeps its `+`, `-`, or space prefix. */
71
+ interface WorkspaceDiffHunk {
72
+ /** First line of the hunk in the turn-start content, 1-based; a side without lines starts at 1 with zero lines. */
73
+ oldStart: number
74
+ /** Lines of the hunk taken from the turn-start content. */
75
+ oldLines: number
76
+ /** First line of the hunk in the turn-end content, 1-based; a side without lines starts at 1 with zero lines. */
77
+ newStart: number
78
+ /** Lines of the hunk taken from the turn-end content. */
79
+ newLines: number
80
+ /** Hunk body in order, each line prefixed with `+`, `-`, or a space. */
81
+ lines: string[]
82
+ }
83
+ ```
84
+
85
+ ## `WorkspaceFileDiff` — one file's comparison
86
+
87
+ ```ts type-equiv
88
+ /** The comparison of one listed file's turn-start and turn-end contents, computed when asked for. */
89
+ type WorkspaceFileDiff =
90
+ | {
91
+ kind: 'text'
92
+ /** The listed file's `path`. */
93
+ path: string
94
+ /** The listed file's `display`. */
95
+ display: string
96
+ /** Whether the file existed at turn start. */
97
+ before: boolean
98
+ /** Whether the file existed at turn end. */
99
+ after: boolean
100
+ /** Hunks in file order; empty when both sides hold the same lines. */
101
+ hunks: WorkspaceDiffHunk[]
102
+ /** True when the line comparison exceeded the plugin's `diffTimeoutMs` and every line is shown as replaced. */
103
+ coarse: boolean
104
+ }
105
+ /** A side git reported as binary or that holds a NUL byte; no lines are served. */
106
+ | { kind: 'binary'; path: string; display: string }
107
+ /** A side larger than the plugin's `maxFileBytes`; no lines are served. */
108
+ | { kind: 'oversized'; path: string; display: string }
109
+ ```
110
+
111
+ ## `WorkspaceChanges` — the Host service serving summaries and comparisons
112
+
113
+ ```ts type-equiv
114
+ /** Serves the summaries and file comparisons the recorder keeps for live Sessions. */
115
+ interface WorkspaceChanges {
116
+ /**
117
+ * The summary announced by one `workspace/changes` event.
118
+ * @param sessionId - the Session that appended the event.
119
+ * @param seq - the event's sequence number.
120
+ * @returns the summary, or undefined once its Session was disposed or when this Host never recorded it.
121
+ */
122
+ summary(sessionId: SessionId, seq: number): WorkspaceChangesSummary | undefined
123
+ /**
124
+ * Compare one listed file's contents at turn start and turn end.
125
+ * @param sessionId - the Session that appended the event.
126
+ * @param seq - the event's sequence number.
127
+ * @param index - the file's index in the summary's `files`.
128
+ * @param signal - cancels the reads.
129
+ * @returns the comparison, or undefined once its Session was disposed, when this Host never recorded it, or when no file has that index.
130
+ * @throws when a snapshot read fails for a live Session.
131
+ */
132
+ diff(sessionId: SessionId, seq: number, index: number, signal: AbortSignal): Promise<WorkspaceFileDiff | undefined>
133
+ }
134
+ ```
135
+
136
+ ## Durable events and the served summary
137
+
138
+ `tool-present` declaration-merges `deliverables/presented: { turn; callId; files: PresentedFile[] }` into `SessionEventMap`, appended once per successful final `present` result. `workspace-changes` merges `workspace/changes: { turn }`, appended when a top-level turn stops; the summary that event announced is not in the log but is returned by `workspaceChanges.summary(sessionId, seq)` for the event's sequence until the Session is disposed, so a conversation reopened after a Host restart has no changed-files card for its earlier turns. `workspaceChanges.diff(sessionId, seq, index, signal)` compares one listed file on the same terms. A later event for the same turn replaces the earlier one, so a client keeps only the latest. The generated [persistence catalog](../persistence-catalog.md#deliverablespresented--log-only) records both declaration sites. Neither event reaches the model.
139
+
140
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
141
+
142
+ <a id="cordis-surface"></a>
143
+
144
+ ## Cordis API
145
+
146
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
147
+
148
+ <a id="ctxworkspacechanges--workspacechanges"></a>
149
+
150
+ ### `ctx.workspaceChanges` — `WorkspaceChanges`
151
+
152
+ Serves the summaries and file comparisons the recorder keeps for live Sessions.
153
+
154
+ ```ts cordis-catalog
155
+ /**
156
+ * The summary announced by one `workspace/changes` event.
157
+ * @param sessionId - the Session that appended the event.
158
+ * @param seq - the event's sequence number.
159
+ * @returns the summary, or undefined once its Session was disposed or when this Host never recorded it.
160
+ */
161
+ summary(sessionId: SessionId, seq: number): WorkspaceChangesSummary | undefined
162
+
163
+ /**
164
+ * Compare one listed file's contents at turn start and turn end.
165
+ * @param sessionId - the Session that appended the event.
166
+ * @param seq - the event's sequence number.
167
+ * @param index - the file's index in the summary's `files`.
168
+ * @param signal - cancels the reads.
169
+ * @returns the comparison, or undefined once its Session was disposed, when this Host never recorded it, or when no file has that index.
170
+ * @throws when a snapshot read fails for a live Session.
171
+ */
172
+ diff(sessionId: SessionId, seq: number, index: number, signal: AbortSignal): Promise<WorkspaceFileDiff | undefined>
173
+ ```
174
+
175
+ Types: [SessionId](core.md)
176
+
177
+ Source: [`packages/deliverables/workspace-changes/src/types.ts`](../../packages/deliverables/workspace-changes/src/types.ts)
178
+ <!-- END GENERATED cordis-surface -->