dsh-plugin-guide 0.3.21 → 0.3.23

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 (438) hide show
  1. package/README-es.md +15 -12
  2. package/README-hi.md +15 -12
  3. package/README-pt.md +15 -12
  4. package/README-zh.md +15 -12
  5. package/README.md +290 -280
  6. package/SKILL.md +36 -19
  7. package/dist/dsh-plugin-dev.js +113 -9
  8. package/guide/choosing-a-plugin.md +412 -0
  9. package/guide/choosing-a-plugin.zh-CN.md +414 -0
  10. package/guide/links.md +20 -2
  11. package/guide/migration-0.2.md +219 -0
  12. package/guide/plugin-dev-guide.md +99 -24
  13. package/guide/quick-reference.es.md +14 -8
  14. package/guide/quick-reference.hi.md +15 -9
  15. package/guide/quick-reference.md +18 -10
  16. package/guide/quick-reference.pt.md +15 -9
  17. package/guide/quick-reference.zh-CN.md +19 -11
  18. package/guide/release-engineering.md +2 -2
  19. package/guide/release-engineering.zh-CN.md +2 -2
  20. package/guide/unfixed-issues.md +117 -82
  21. package/guide/when-to-retire-a-plugin.md +127 -0
  22. package/guide/when-to-retire-a-plugin.zh-CN.md +127 -0
  23. package/icon.svg +5 -0
  24. package/locale/en.json +6 -0
  25. package/locale/zh.json +6 -0
  26. package/package.json +8 -4
  27. package/references/official-docs/AGENTS.md +8 -5
  28. package/references/official-docs/CONTRIBUTING.i18n.yaml +6 -5
  29. package/references/official-docs/README.i18n.yaml +33 -5
  30. package/references/official-docs/README.zh.md +3 -3
  31. package/references/official-docs/SNAPSHOT.md +3 -3
  32. package/references/official-docs/THIRD_PARTY_NOTICES.md +34 -6
  33. package/references/official-docs/docs/AGENTS.md +4 -4
  34. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +9 -5
  35. package/references/official-docs/docs/api-gateway.i18n.yaml +27 -5
  36. package/references/official-docs/docs/api-gateway.md +10 -9
  37. package/references/official-docs/docs/api-gateway.zh.md +10 -9
  38. package/references/official-docs/docs/architecture.i18n.yaml +36 -5
  39. package/references/official-docs/docs/architecture.md +10 -8
  40. package/references/official-docs/docs/architecture.zh.md +10 -8
  41. package/references/official-docs/docs/capability-seams.i18n.yaml +9 -5
  42. package/references/official-docs/docs/capability-seams.md +76 -32
  43. package/references/official-docs/docs/capability-seams.zh.md +76 -32
  44. package/references/official-docs/docs/config-catalog.i18n.yaml +18 -5
  45. package/references/official-docs/docs/config-catalog.md +1360 -765
  46. package/references/official-docs/docs/config-catalog.zh.md +1363 -767
  47. package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +27 -5
  48. package/references/official-docs/docs/cookbook/adding-a-package.md +56 -3
  49. package/references/official-docs/docs/cookbook/adding-a-package.zh.md +54 -3
  50. package/references/official-docs/docs/cookbook/adding-a-remote-api.i18n.yaml +24 -5
  51. package/references/official-docs/docs/cookbook/adding-a-remote-api.md +2 -2
  52. package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +2 -2
  53. package/references/official-docs/docs/cookbook/adding-a-session-format-version.i18n.yaml +39 -5
  54. package/references/official-docs/docs/cookbook/adding-a-session-format-version.md +46 -6
  55. package/references/official-docs/docs/cookbook/adding-a-session-format-version.zh.md +46 -6
  56. package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +21 -5
  57. package/references/official-docs/docs/cookbook/adding-a-settings-card.md +34 -64
  58. package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +34 -64
  59. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +30 -5
  60. package/references/official-docs/docs/cookbook/adding-a-tool.md +2 -2
  61. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +2 -2
  62. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +18 -5
  63. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +18 -5
  64. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +24 -5
  65. package/references/official-docs/docs/cookbook/extension-cookbook.md +3 -3
  66. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +3 -3
  67. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +21 -5
  68. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +15 -5
  69. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.i18n.yaml +30 -5
  70. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.md +13 -1
  71. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.zh.md +13 -1
  72. package/references/official-docs/docs/cordis-api/context.i18n.yaml +72 -5
  73. package/references/official-docs/docs/cordis-api/events.i18n.yaml +36 -5
  74. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +75 -5
  75. package/references/official-docs/docs/cordis-api/inherited.md +15 -13
  76. package/references/official-docs/docs/cordis-api/registry.i18n.yaml +21 -5
  77. package/references/official-docs/docs/cordis-api/service.i18n.yaml +36 -5
  78. package/references/official-docs/docs/cordis-primer.i18n.yaml +21 -5
  79. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +21 -5
  80. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +15 -5
  81. package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +21 -5
  82. package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +15 -5
  83. package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +18 -5
  84. package/references/official-docs/docs/cordis-tutorial/05-config.md +27 -0
  85. package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +27 -0
  86. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +15 -5
  87. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +18 -5
  88. package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +15 -5
  89. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +33 -5
  90. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +7 -7
  91. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +7 -7
  92. package/references/official-docs/docs/defensive-patterns.i18n.yaml +27 -5
  93. package/references/official-docs/docs/dependency-catalog.json +2 -2
  94. package/references/official-docs/docs/development.i18n.yaml +48 -5
  95. package/references/official-docs/docs/development.md +27 -10
  96. package/references/official-docs/docs/development.zh.md +27 -10
  97. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +12 -5
  98. package/references/official-docs/docs/event-producer-consumer.md +78 -66
  99. package/references/official-docs/docs/event-producer-consumer.zh.md +78 -66
  100. package/references/official-docs/docs/glossary.i18n.yaml +24 -5
  101. package/references/official-docs/docs/graph-atlas.i18n.yaml +9 -5
  102. package/references/official-docs/docs/i18n/README.i18n.yaml +18 -5
  103. package/references/official-docs/docs/i18n/README.md +12 -8
  104. package/references/official-docs/docs/i18n/README.zh.md +12 -8
  105. package/references/official-docs/docs/i18n/terminology.md +4 -4
  106. package/references/official-docs/docs/i18n/translation-prompt.md +2 -2
  107. package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +27 -5
  108. package/references/official-docs/docs/module-graph.i18n.yaml +9 -5
  109. package/references/official-docs/docs/module-graph.md +348 -245
  110. package/references/official-docs/docs/module-graph.zh.md +348 -245
  111. package/references/official-docs/docs/persistence-catalog.i18n.yaml +2064 -5
  112. package/references/official-docs/docs/persistence-catalog.md +5275 -3205
  113. package/references/official-docs/docs/persistence-catalog.zh.md +5275 -3205
  114. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.i18n.yaml +27 -5
  115. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.i18n.yaml +27 -5
  116. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.i18n.yaml +27 -5
  117. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.i18n.yaml +27 -5
  118. package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.i18n.yaml +28 -0
  119. package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.md +120 -0
  120. package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.schema.json +16212 -0
  121. package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.zh.md +120 -0
  122. package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.i18n.yaml +28 -0
  123. package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.md +48 -0
  124. package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.schema.json +302 -0
  125. package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.zh.md +48 -0
  126. package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.i18n.yaml +28 -0
  127. package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.md +48 -0
  128. package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.schema.json +250 -0
  129. package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.zh.md +48 -0
  130. package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.i18n.yaml +28 -0
  131. package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.md +60 -0
  132. package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.schema.json +11405 -0
  133. package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.zh.md +60 -0
  134. package/references/official-docs/docs/persistence-changes/README.i18n.yaml +27 -5
  135. package/references/official-docs/docs/persistence-changes/README.md +17 -3
  136. package/references/official-docs/docs/persistence-changes/README.zh.md +17 -3
  137. package/references/official-docs/docs/persistence-changes/finalized/v4.json +379 -0
  138. package/references/official-docs/docs/persistence-changes/historical-formats/README.i18n.yaml +27 -5
  139. package/references/official-docs/docs/persistence-changes/historical-formats/README.md +3 -2
  140. package/references/official-docs/docs/persistence-changes/historical-formats/README.zh.md +3 -2
  141. package/references/official-docs/docs/persistence-changes/historical-formats/v0.i18n.yaml +1284 -5
  142. package/references/official-docs/docs/persistence-changes/historical-formats/v1.i18n.yaml +1284 -5
  143. package/references/official-docs/docs/persistence-changes/historical-formats/v2.i18n.yaml +1344 -5
  144. package/references/official-docs/docs/persistence-changes/historical-formats/v3.i18n.yaml +1441 -0
  145. package/references/official-docs/docs/persistence-changes/historical-formats/v3.md +5634 -0
  146. package/references/official-docs/docs/persistence-changes/historical-formats/v3.schema.json +61307 -0
  147. package/references/official-docs/docs/persistence-changes/historical-formats/v3.zh.md +5634 -0
  148. package/references/official-docs/docs/persistence-changes/releases/README.i18n.yaml +30 -5
  149. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.i18n.yaml +30 -5
  150. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.i18n.yaml +30 -5
  151. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.i18n.yaml +30 -5
  152. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.i18n.yaml +30 -5
  153. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.i18n.yaml +30 -5
  154. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.i18n.yaml +30 -5
  155. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.i18n.yaml +30 -5
  156. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.i18n.yaml +30 -5
  157. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.i18n.yaml +30 -5
  158. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.i18n.yaml +30 -5
  159. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.i18n.yaml +30 -5
  160. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.i18n.yaml +30 -5
  161. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.i18n.yaml +30 -5
  162. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.i18n.yaml +30 -5
  163. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.i18n.yaml +30 -5
  164. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.i18n.yaml +30 -5
  165. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.i18n.yaml +30 -5
  166. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.i18n.yaml +30 -5
  167. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.i18n.yaml +30 -5
  168. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.i18n.yaml +30 -5
  169. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.i18n.yaml +30 -5
  170. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.i18n.yaml +30 -5
  171. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.i18n.yaml +30 -5
  172. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.i18n.yaml +30 -5
  173. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.schema.json +3 -3
  174. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.i18n.yaml +30 -5
  175. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.i18n.yaml +30 -5
  176. package/references/official-docs/docs/persistence-schema.json +12692 -48753
  177. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +33 -5
  178. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +27 -5
  179. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +27 -5
  180. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +27 -5
  181. package/references/official-docs/docs/postmortem/README.i18n.yaml +6 -5
  182. package/references/official-docs/docs/rescope.i18n.yaml +18 -5
  183. package/references/official-docs/docs/rescope.md +1 -1
  184. package/references/official-docs/docs/rescope.zh.md +1 -1
  185. package/references/official-docs/docs/session-format-status.i18n.yaml +27 -5
  186. package/references/official-docs/docs/session-format-status.md +17 -3
  187. package/references/official-docs/docs/session-format-status.zh.md +17 -3
  188. package/references/official-docs/docs/subsystems/README.i18n.yaml +6 -5
  189. package/references/official-docs/docs/subsystems/README.md +6 -3
  190. package/references/official-docs/docs/subsystems/README.zh.md +6 -3
  191. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +21 -5
  192. package/references/official-docs/docs/subsystems/agent-team.md +52 -28
  193. package/references/official-docs/docs/subsystems/agent-team.zh.md +52 -28
  194. package/references/official-docs/docs/subsystems/approval.i18n.yaml +18 -5
  195. package/references/official-docs/docs/subsystems/approval.md +1 -1
  196. package/references/official-docs/docs/subsystems/approval.zh.md +1 -1
  197. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +12 -5
  198. package/references/official-docs/docs/subsystems/attachment.md +2 -2
  199. package/references/official-docs/docs/subsystems/attachment.zh.md +2 -2
  200. package/references/official-docs/docs/subsystems/boot.i18n.yaml +9 -5
  201. package/references/official-docs/docs/subsystems/boot.md +117 -17
  202. package/references/official-docs/docs/subsystems/boot.zh.md +117 -17
  203. package/references/official-docs/docs/subsystems/browser-use.i18n.yaml +18 -5
  204. package/references/official-docs/docs/subsystems/claude-code-mods.i18n.yaml +28 -0
  205. package/references/official-docs/docs/subsystems/claude-code-mods.md +146 -0
  206. package/references/official-docs/docs/subsystems/claude-code-mods.zh.md +146 -0
  207. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +18 -5
  208. package/references/official-docs/docs/subsystems/client-modules.md +13 -7
  209. package/references/official-docs/docs/subsystems/client-modules.zh.md +13 -7
  210. package/references/official-docs/docs/subsystems/client-resources.i18n.yaml +21 -5
  211. package/references/official-docs/docs/subsystems/commands.i18n.yaml +18 -5
  212. package/references/official-docs/docs/subsystems/commands.md +1 -1
  213. package/references/official-docs/docs/subsystems/commands.zh.md +1 -1
  214. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +21 -5
  215. package/references/official-docs/docs/subsystems/compaction.md +2 -2
  216. package/references/official-docs/docs/subsystems/compaction.zh.md +2 -2
  217. package/references/official-docs/docs/subsystems/computer-use.i18n.yaml +15 -5
  218. package/references/official-docs/docs/subsystems/conversation.i18n.yaml +30 -5
  219. package/references/official-docs/docs/subsystems/conversation.md +35 -6
  220. package/references/official-docs/docs/subsystems/conversation.zh.md +34 -5
  221. package/references/official-docs/docs/subsystems/core.i18n.yaml +36 -5
  222. package/references/official-docs/docs/subsystems/core.md +70 -214
  223. package/references/official-docs/docs/subsystems/core.zh.md +70 -214
  224. package/references/official-docs/docs/subsystems/credentials.i18n.yaml +24 -5
  225. package/references/official-docs/docs/subsystems/credentials.md +168 -5
  226. package/references/official-docs/docs/subsystems/credentials.zh.md +168 -5
  227. package/references/official-docs/docs/subsystems/deliverables.i18n.yaml +27 -5
  228. package/references/official-docs/docs/subsystems/extensions.i18n.yaml +6 -5
  229. package/references/official-docs/docs/subsystems/extensions.md +6 -4
  230. package/references/official-docs/docs/subsystems/extensions.zh.md +6 -4
  231. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +27 -5
  232. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +33 -5
  233. package/references/official-docs/docs/subsystems/filesystem.md +10 -0
  234. package/references/official-docs/docs/subsystems/filesystem.zh.md +10 -0
  235. package/references/official-docs/docs/subsystems/goal.i18n.yaml +18 -5
  236. package/references/official-docs/docs/subsystems/goal.md +1 -1
  237. package/references/official-docs/docs/subsystems/goal.zh.md +1 -1
  238. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +24 -5
  239. package/references/official-docs/docs/subsystems/jobs.md +335 -126
  240. package/references/official-docs/docs/subsystems/jobs.zh.md +335 -126
  241. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +48 -5
  242. package/references/official-docs/docs/subsystems/llm-streaming.md +60 -31
  243. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +60 -31
  244. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +18 -5
  245. package/references/official-docs/docs/subsystems/mcp.i18n.yaml +33 -5
  246. package/references/official-docs/docs/subsystems/mcp.md +2 -2
  247. package/references/official-docs/docs/subsystems/mcp.zh.md +2 -2
  248. package/references/official-docs/docs/subsystems/office-to-pdf.i18n.yaml +18 -5
  249. package/references/official-docs/docs/subsystems/office-to-pdf.md +4 -4
  250. package/references/official-docs/docs/subsystems/office-to-pdf.zh.md +4 -4
  251. package/references/official-docs/docs/subsystems/otel.i18n.yaml +7 -0
  252. package/references/official-docs/docs/subsystems/otel.md +44 -0
  253. package/references/official-docs/docs/subsystems/otel.zh.md +44 -0
  254. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +18 -5
  255. package/references/official-docs/docs/subsystems/permission-presets.md +7 -6
  256. package/references/official-docs/docs/subsystems/permission-presets.zh.md +7 -6
  257. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +36 -5
  258. package/references/official-docs/docs/subsystems/persistence.md +3 -3
  259. package/references/official-docs/docs/subsystems/persistence.zh.md +3 -3
  260. package/references/official-docs/docs/subsystems/plan.i18n.yaml +21 -5
  261. package/references/official-docs/docs/subsystems/plan.md +1 -1
  262. package/references/official-docs/docs/subsystems/plan.zh.md +1 -1
  263. package/references/official-docs/docs/subsystems/product-telemetry.i18n.yaml +10 -0
  264. package/references/official-docs/docs/subsystems/product-telemetry.md +79 -0
  265. package/references/official-docs/docs/subsystems/product-telemetry.zh.md +79 -0
  266. package/references/official-docs/docs/subsystems/ptc-runtime.i18n.yaml +18 -5
  267. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +18 -5
  268. package/references/official-docs/docs/subsystems/sandbox.md +1 -1
  269. package/references/official-docs/docs/subsystems/sandbox.zh.md +1 -1
  270. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +39 -5
  271. package/references/official-docs/docs/subsystems/schedule.md +391 -33
  272. package/references/official-docs/docs/subsystems/schedule.zh.md +391 -33
  273. package/references/official-docs/docs/subsystems/scope.i18n.yaml +15 -5
  274. package/references/official-docs/docs/subsystems/scope.md +1 -1
  275. package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
  276. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +15 -5
  277. package/references/official-docs/docs/subsystems/session-projection.md +20 -18
  278. package/references/official-docs/docs/subsystems/session-projection.zh.md +20 -18
  279. package/references/official-docs/docs/subsystems/session-query.i18n.yaml +27 -5
  280. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +18 -5
  281. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +21 -5
  282. package/references/official-docs/docs/subsystems/session-telemetry.md +6 -4
  283. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +6 -4
  284. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +15 -5
  285. package/references/official-docs/docs/subsystems/session.i18n.yaml +66 -5
  286. package/references/official-docs/docs/subsystems/session.md +113 -62
  287. package/references/official-docs/docs/subsystems/session.zh.md +113 -62
  288. package/references/official-docs/docs/subsystems/settings.i18n.yaml +12 -5
  289. package/references/official-docs/docs/subsystems/settings.md +42 -292
  290. package/references/official-docs/docs/subsystems/settings.zh.md +42 -292
  291. package/references/official-docs/docs/subsystems/shell.i18n.yaml +24 -5
  292. package/references/official-docs/docs/subsystems/shell.md +29 -22
  293. package/references/official-docs/docs/subsystems/shell.zh.md +29 -22
  294. package/references/official-docs/docs/subsystems/sidebar-right.i18n.yaml +36 -5
  295. package/references/official-docs/docs/subsystems/sidebar-right.md +14 -9
  296. package/references/official-docs/docs/subsystems/sidebar-right.zh.md +14 -9
  297. package/references/official-docs/docs/subsystems/skills.i18n.yaml +27 -5
  298. package/references/official-docs/docs/subsystems/skills.md +2 -2
  299. package/references/official-docs/docs/subsystems/skills.zh.md +2 -2
  300. package/references/official-docs/docs/subsystems/slots.i18n.yaml +27 -5
  301. package/references/official-docs/docs/subsystems/slots.md +21 -7
  302. package/references/official-docs/docs/subsystems/slots.zh.md +21 -7
  303. package/references/official-docs/docs/subsystems/spill.i18n.yaml +15 -5
  304. package/references/official-docs/docs/subsystems/spill.md +1 -1
  305. package/references/official-docs/docs/subsystems/spill.zh.md +1 -1
  306. package/references/official-docs/docs/subsystems/ssh.i18n.yaml +21 -5
  307. package/references/official-docs/docs/subsystems/storage.i18n.yaml +24 -5
  308. package/references/official-docs/docs/subsystems/storage.md +1 -2
  309. package/references/official-docs/docs/subsystems/storage.zh.md +1 -2
  310. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +30 -5
  311. package/references/official-docs/docs/subsystems/subagent.md +35 -60
  312. package/references/official-docs/docs/subsystems/subagent.zh.md +35 -60
  313. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +30 -5
  314. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +18 -5
  315. package/references/official-docs/docs/subsystems/terminal.i18n.yaml +18 -5
  316. package/references/official-docs/docs/subsystems/todo.i18n.yaml +12 -5
  317. package/references/official-docs/docs/subsystems/todo.md +3 -3
  318. package/references/official-docs/docs/subsystems/todo.zh.md +3 -3
  319. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +12 -5
  320. package/references/official-docs/docs/subsystems/tools.i18n.yaml +24 -5
  321. package/references/official-docs/docs/subsystems/tools.md +15 -4
  322. package/references/official-docs/docs/subsystems/tools.zh.md +15 -4
  323. package/references/official-docs/docs/subsystems/typert.i18n.yaml +21 -5
  324. package/references/official-docs/docs/subsystems/typert.md +147 -6
  325. package/references/official-docs/docs/subsystems/typert.zh.md +147 -6
  326. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +27 -5
  327. package/references/official-docs/docs/subsystems/user-questions.md +128 -1
  328. package/references/official-docs/docs/subsystems/user-questions.zh.md +129 -2
  329. package/references/official-docs/docs/subsystems/voice-input.i18n.yaml +19 -0
  330. package/references/official-docs/docs/subsystems/voice-input.md +164 -0
  331. package/references/official-docs/docs/subsystems/voice-input.zh.md +164 -0
  332. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +36 -5
  333. package/references/official-docs/docs/subsystems/web-client.md +10 -5
  334. package/references/official-docs/docs/subsystems/web-client.zh.md +10 -5
  335. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +15 -5
  336. package/references/official-docs/docs/subsystems/web-server.md +12 -4
  337. package/references/official-docs/docs/subsystems/web-server.zh.md +12 -4
  338. package/references/official-docs/docs/subsystems/web.i18n.yaml +27 -5
  339. package/references/official-docs/docs/subsystems/webhook.i18n.yaml +18 -5
  340. package/references/official-docs/docs/subsystems/webhook.md +1 -1
  341. package/references/official-docs/docs/subsystems/webhook.zh.md +1 -1
  342. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +27 -5
  343. package/references/official-docs/docs/subsystems/workflow.md +2 -2
  344. package/references/official-docs/docs/subsystems/workflow.zh.md +2 -2
  345. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +27 -5
  346. package/references/official-docs/docs/subsystems/workspace.md +175 -35
  347. package/references/official-docs/docs/subsystems/workspace.zh.md +175 -35
  348. package/references/official-docs/docs/testing.i18n.yaml +33 -5
  349. package/references/official-docs/docs/testing.md +2 -2
  350. package/references/official-docs/docs/testing.zh.md +2 -2
  351. package/references/official-docs/docs/tool-catalog.i18n.yaml +312 -5
  352. package/references/official-docs/docs/tool-catalog.md +321 -92
  353. package/references/official-docs/docs/tool-catalog.zh.md +321 -92
  354. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +9 -5
  355. package/references/official-docs/docs/tool-execution-pipeline.md +6 -3
  356. package/references/official-docs/docs/tool-execution-pipeline.zh.md +6 -3
  357. package/references/official-docs/docs/ui-radius.i18n.yaml +31 -0
  358. package/references/official-docs/docs/ui-radius.md +115 -0
  359. package/references/official-docs/docs/ui-radius.zh.md +115 -0
  360. package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.i18n.yaml +16 -0
  361. package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.md +22 -0
  362. package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.zh.md +22 -0
  363. package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.i18n.yaml +16 -0
  364. package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.md +25 -0
  365. package/references/official-docs/docs/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.zh.md +25 -0
  366. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.i18n.yaml +16 -0
  367. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.md +18 -0
  368. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.zh.md +18 -0
  369. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.i18n.yaml +16 -0
  370. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.md +23 -0
  371. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.zh.md +23 -0
  372. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.i18n.yaml +16 -0
  373. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +22 -0
  374. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md +22 -0
  375. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.i18n.yaml +16 -0
  376. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.md +27 -0
  377. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.zh.md +27 -0
  378. package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +27 -5
  379. package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +36 -5
  380. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +30 -5
  381. package/references/official-docs/docs/user/develop/basic/publish.md +7 -1
  382. package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -1
  383. package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +15 -5
  384. package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +45 -5
  385. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +30 -5
  386. package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +39 -5
  387. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +9 -5
  388. package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +45 -5
  389. package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +33 -5
  390. package/references/official-docs/docs/user/develop/practice/llm-adapter.md +1 -1
  391. package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +1 -1
  392. package/references/official-docs/docs/user/guide/github-review.i18n.yaml +24 -5
  393. package/references/official-docs/docs/user/guide/index.i18n.yaml +18 -5
  394. package/references/official-docs/docs/user/guide/index.md +1 -0
  395. package/references/official-docs/docs/user/guide/index.zh.md +1 -0
  396. package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +36 -5
  397. package/references/official-docs/docs/user/guide/network-proxy.i18n.yaml +24 -5
  398. package/references/official-docs/docs/user/guide/providers-custom-form.png +0 -0
  399. package/references/official-docs/docs/user/guide/providers-custom-form.zh.png +0 -0
  400. package/references/official-docs/docs/user/guide/providers-models-page.png +0 -0
  401. package/references/official-docs/docs/user/guide/providers-models-page.zh.png +0 -0
  402. package/references/official-docs/docs/user/guide/providers.i18n.yaml +36 -5
  403. package/references/official-docs/docs/user/guide/providers.md +88 -78
  404. package/references/official-docs/docs/user/guide/providers.zh.md +102 -92
  405. package/references/official-docs/docs/user/guide/public-deployments.i18n.yaml +19 -0
  406. package/references/official-docs/docs/user/guide/public-deployments.md +33 -0
  407. package/references/official-docs/docs/user/guide/public-deployments.zh.md +33 -0
  408. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +27 -5
  409. package/references/official-docs/docs/user/guide/python-sdk.md +1 -1
  410. package/references/official-docs/docs/user/guide/python-sdk.zh.md +1 -1
  411. package/references/official-docs/docs/user/guide/schedule.i18n.yaml +30 -5
  412. package/references/official-docs/docs/user/guide/schedule.md +69 -11
  413. package/references/official-docs/docs/user/guide/schedule.zh.md +69 -11
  414. package/references/official-docs/docs/user/index.i18n.yaml +9 -5
  415. package/references/official-docs/docs/web-styling.i18n.yaml +18 -5
  416. package/references/official-docs/docs/web-styling.md +12 -3
  417. package/references/official-docs/docs/web-styling.zh.md +12 -3
  418. package/references/official-docs/packages/AGENTS.md +1 -2
  419. package/references/official-docs/packages/README.md +5 -5
  420. package/references/official-docs/vendor/README.md +6 -2
  421. package/references/official-docs/website-docs.ts +10 -3
  422. package/references/official-plugin-dev-skill.md +124 -0
  423. package/references/sources.md +10 -5
  424. package/scripts/archive-discussions.ps1 +9 -1
  425. package/scripts/build-llms-full.mjs +64 -0
  426. package/scripts/check-docs-drift.ps1 +1 -1
  427. package/scripts/sync-official-docs.ps1 +1 -1
  428. package/templates/js/icon.svg +4 -0
  429. package/templates/js/locale/en.json +6 -0
  430. package/templates/js/locale/zh.json +6 -0
  431. package/templates/js/package.json +9 -1
  432. package/templates/ts/icon.svg +4 -0
  433. package/templates/ts/locale/en.json +6 -0
  434. package/templates/ts/locale/zh.json +6 -0
  435. package/templates/ts/package.json +9 -1
  436. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +0 -6
  437. package/references/official-docs/docs/subsystems/invariants.md +0 -88
  438. package/references/official-docs/docs/subsystems/invariants.zh.md +0 -88
@@ -117,10 +117,51 @@ Ownership truth is the record's ordered `sessionIds`, never derived from session
117
117
 
118
118
  ## The registry: `ctx.workspaceRegistry`
119
119
 
120
- `WorkspaceRegistry` ([signatures](#ctxworkspaceregistry--workspaceregistry)) owns registration and resolution. `create(path, title?)` requires a fully qualified path, canonicalizes it, rejects a nonexistent path (the original `ENOENT`) or a non-directory, returns the existing entity unchanged when the canonical path is already owned, and otherwise creates a record with `title ?? defaultWorkspaceTitle(path)` prepended to the durable registry order (different canonical paths may share a display title, and a path with no final segment uses its root spelling). `get(id)` and the ordered `list()` are synchronous cache reads; `resolveByPath(path)` applies the same fully qualified realpath canon without creating. `delete(id)` removes only the registration, order entry, and session account — the directory, user files, live sessions, and persisted logs are never touched, so those sessions become Ungrouped ([decision](../../.agents/notes/implemented/feature/2026-07-27-workspace-registration-deletion.md)); unknown ids return `false`. Create and delete persist a pending-mutation marker before their two writes (record + order) can diverge; startup resolves exactly the marked mutation — by deleting the marked table row, which completes an interrupted delete and rolls back an interrupted create (the registration is re-creatable, so rollback is the safe direction) — and an unmarked order/table mismatch fails loud as corruption.
120
+ `WorkspaceRegistry` ([signatures](#ctxworkspaceregistry--workspaceregistry)) owns registration and resolution. `create(path, title?)` requires a fully qualified path, canonicalizes it, rejects a nonexistent path (the original `ENOENT`) or a non-directory, returns the existing entity unchanged when the canonical path is already owned, and otherwise creates a record with `title ?? defaultWorkspaceTitle(path)` prepended to the durable registry order (different canonical paths may share a display title, and a path with no final segment uses its root spelling). `get(id)` and the ordered `list()` are synchronous cache reads; `resolveByPath(path)` applies the same fully qualified realpath canon without creating. `delete(id)` removes only the registration, order entry, and session account — the directory, user files, live sessions, and persisted logs are never touched, so those sessions become Ungrouped ([reference](../../packages/workspace/workspace/README.md)); unknown ids return `false`. Create and delete persist a pending-mutation marker before their two writes (record + order) can diverge; startup resolves exactly the marked mutation — by deleting the marked table row, which completes an interrupted delete and rolls back an interrupted create (the registration is re-creatable, so rollback is the safe direction) — and an unmarked order/table mismatch fails loud as corruption.
121
121
 
122
122
  Sessions get their cwd at create time from whoever creates them, not from this registry — the API gateway resolves a new session's cwd from the chosen workspace's `path` (falling back to an explicit or default cwd), creates the session so the cwd lands in its immutable [`SessionHeader`](persistence.md#sessionheader--metadata-beside-the-log), then calls `attachSession`, which re-validates that stored header cwd against the workspace path. On the first successful start, the registry bootstraps history from persisted headers alone (`id`, `cwd`, `createdAt` — never event bodies), grouping sessions with a valid canonical cwd into per-directory workspaces, newest first; the initialized marker is written last so an interrupted bootstrap resumes safely. The bootstrap is one-time: cwd-less legacy sessions stay Ungrouped, and sessions created afterwards join a workspace only through `attachSession`.
123
123
 
124
+ ## Default Workspace initialization
125
+
126
+ The controller's `initializeDefault` takes no request: it owns the fixed `default-workspace` directory name, resolves the Documents location, and asks the registry to initialize once. The registry accepts a directory resolver, derives the initial title from the requested directory's final segment rather than the canonical one, and commits the registration with its durable identity. No language reaches the Host — browser consumers label a Workspace still carrying that automatic title through the controller's `workspaceDisplayTitle`, so only the on-screen name follows the reader's language. [First-use behavior and configuration](../../packages/api/workspace-controller/README.md#first-use-workspace) describe reuse and failure handling.
127
+
128
+ ## Session pinning
129
+
130
+ The controller's [transport types](../../packages/api/workspace-controller/src/types.ts) define `WorkspacePinSessionRequest` and `WorkspaceUnpinSessionRequest`, each carrying one `sessionId`. Both operations return `WorkspacePinValue`: the complete `pinnedSessionIds` array of Session ids, most recently pinned first. Pinning requires a known, unarchived Session; unpinning an id that is not pinned succeeds without changing the set. Archiving removes the Session's pin in the same durable write, and unarchiving does not restore it.
131
+
132
+ ## Archive admission
133
+
134
+ Archiving is a registry-global durable set, and the registry refuses to hide running work behind it. The rule is a capability seam over two Host events the package declares and dispatches ([events](#workspace-events)): `workspace/session-activity` (waterfall) asks the composed providers what still runs for a Session, and `workspace/session-stop` (parallel) asks them to stop it. Each provider registers on the root like any listener, so the package knows no agent, job, or schedule vocabulary; the families are keys of a merge-extensible map.
135
+
136
+ ```ts type-equiv
137
+ /**
138
+ * Activity families a `workspace/session-activity` listener may report. This
139
+ * package declares none: each provider merges its own key from a module both
140
+ * its Host and Client faces import, so a consumer that renders the families
141
+ * sees exactly the keys its program compiled and falls through to a generic
142
+ * description for any other. The shipped providers merge `turn` (the Agent
143
+ * registry), `job` (the job registry seam), `subagent` (the Subagent
144
+ * runtime), and `schedule` (the Schedule plugin).
145
+ */
146
+ interface SessionActivityKindMap {}
147
+ ```
148
+
149
+ `SessionActivityKind` is `keyof SessionActivityKindMap`, so a program that compiled no provider sees no key at all. The shipped keys live in client-importable type modules: `turn` in the Agent registry's `types.ts`, `job` in the job registry seam's `view.ts`, `subagent` in the Subagent runtime's `control-types.ts`, `schedule` in the Schedule plugin's `types.ts`; a consumer that renders the families imports those modules for its cases and keeps a generic line for any other key. A provider answers the waterfall by prepending its `SessionActivity` entries to the result of `next()`; the registry's innermost callback returns an empty list, so a composition without providers archives freely.
150
+
151
+ ```ts type-equiv
152
+ /**
153
+ * One reason a session counts as active for archive admission. Families with
154
+ * per-item identity list their items so a caller can name what must stop.
155
+ */
156
+ interface SessionActivity {
157
+ readonly kind: SessionActivityKind
158
+ /** Active items of the family; absent for a family without per-item identity (`turn`). */
159
+ readonly items?: readonly SessionActivityItem[]
160
+ }
161
+ ```
162
+
163
+ `SessionActivityItem` carries the family-specific `id` (a session, job, or schedule id) and an optional display `label`. `archiveSession(sessionId)` asks the waterfall once, after the existence check, and rejects a non-empty answer with `WorkspaceActiveSessionError` (`sessionId`, `activity`) without writing; the controller maps it to the `workspace/session-active` error, whose details carry the same two fields. `archiveSession(sessionId, { stopActivity: true })` — the `ArchiveSessionOptions` field the transport request exposes as `stopActivity` — skips the check, writes the archive, then dispatches `workspace/session-stop`; a rejecting provider is logged and the archive stays, and the stopped work is never awaited to settlement. An already archived id neither asks nor stops. The shipped providers, what they stop, and the `agent/pre-step` gate that keeps an archived Session from running a model step are documented with the [registry package](../../packages/workspace/workspace/README.md#api-behavior); the decision record is the [archive-stops-running-work Agent Note](../../.agents/notes/implemented/feature/2026-09-21-archive-stops-running-session-work.md).
164
+
124
165
  ## Consumers
125
166
 
126
167
  [`dsh-workspace-controller`](../../packages/api/workspace-controller) serves workspace CRUD to GUI clients over `ctx.workspaceRegistry`, and [`dsh-session-controller`](../../packages/api/session-controller) performs the create-session-then-attach flow above. [dsh-agent-instructions](../../packages/context/agent-instructions) is **not** a consumer despite the name: it discovers AGENTS.md-style instruction files under an agent's own cwd and never touches `ctx.workspaceRegistry` — the shared word refers to the user's working directory, not to this registry's entities.
@@ -297,6 +338,16 @@ Host service backing the generated `ctx.remote.workspace` namespace.
297
338
  */
298
339
  @Remote('create') create(request: WorkspaceCreateRequest): Promise<WorkspaceCreateValue>
299
340
 
341
+ /**
342
+ * Initialize or reuse the default Workspace during first-use startup. The
343
+ * directory name is fixed, so the Host never renames or relocates an
344
+ * existing default; its initial title is that same name, which browser
345
+ * consumers label in the reader's language.
346
+ * @param signal - caller lifetime; cancels native directory lookup.
347
+ * @returns the durable Workspace, or undefined when first-use initialization is ineligible; creates no Session or message.
348
+ */
349
+ @Remote('initializeDefault') async initializeDefault(signal: AbortSignal): Promise<WorkspaceValue | undefined>
350
+
300
351
  /**
301
352
  * Rename one Workspace to a unique non-blank title.
302
353
  * @param request - Workspace identity and proposed title.
@@ -339,6 +390,20 @@ Host service backing the generated `ctx.remote.workspace` namespace.
339
390
  */
340
391
  @Remote('unarchiveSession') unarchiveSession(request: WorkspaceUnarchiveSessionRequest): Promise<WorkspaceArchiveValue>
341
392
 
393
+ /**
394
+ * Surface one known unarchived Session ahead of unpinned Sessions.
395
+ * @param request - Session identity to pin.
396
+ * @returns the complete resulting pin set, most recently pinned first.
397
+ */
398
+ @Remote('pinSession') pinSession(request: WorkspacePinSessionRequest): Promise<WorkspacePinValue>
399
+
400
+ /**
401
+ * Remove one Session's pin without changing its saved Session order.
402
+ * @param request - Session identity to unpin.
403
+ * @returns the complete resulting pin set, most recently pinned first.
404
+ */
405
+ @Remote('unpinSession') unpinSession(request: WorkspaceUnpinSessionRequest): Promise<WorkspacePinValue>
406
+
342
407
  /**
343
408
  * Stream a complete Workspace baseline followed by ordered increments.
344
409
  * @param signal - generation cancellation.
@@ -367,34 +432,14 @@ Host Remote file reads and workspace directory observations over the composed fi
367
432
  @Remote async read( workspaceFileScope: WorkspaceFileScope, path: string, range: WorkspaceFileRange, signal: AbortSignal, ): Promise<WorkspaceFileText>
368
433
 
369
434
  /**
370
- * Read one byte window of a regular file readable by the filesystem backend: raw
371
- * bytes, no text decoding and no binary rejection.
372
- * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
373
- * @param path - absolute path or path relative to the workspace root; files outside it are allowed.
374
- * @param range - the byte window; omitted fields take the window defaults.
375
- * @param signal - caller cancellation.
376
- * @returns the window in base64, the file's version and size at the stat before it, and whether it reaches the last byte.
377
- */
378
- @Remote async readBytes( workspaceFileScope: WorkspaceFileScope, path: string, range: WorkspaceByteRange, signal: AbortSignal, ): Promise<WorkspaceFileBytes>
379
-
380
- /**
381
- * Read a complete regular file as bytes, subject to the configured full-file cap.
382
- * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
383
- * @param path - absolute or workspace-relative file path.
384
- * @param signal - caller cancellation.
385
- * @returns one complete base64 window with offset zero and eof true; oversized files fail with too-large.
386
- */
387
- @Remote async readAll(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): Promise<WorkspaceFileBytes>
388
-
389
- /**
390
- * Read a complete file relative to another file's directory, including outside the workspace.
435
+ * Read a complete regular file or one byte range without text decoding.
391
436
  * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
392
- * @param path - base file, absolute or workspace-relative.
393
- * @param relativePath - relative filesystem path, not a URL or absolute path.
437
+ * @param path - target path, absolute or workspace-relative; relative to the base file's directory when provided.
438
+ * @param options - optional base file and range; without a range the complete-file cap applies.
394
439
  * @param signal - caller cancellation.
395
- * @returns the complete related file using the ordinary file-size and access checks.
440
+ * @returns native bytes with the file's version and size at the preceding stat, byte offset, and EOF marker.
396
441
  */
397
- @Remote async readRelated( workspaceFileScope: WorkspaceFileScope, path: string, relativePath: string, signal: AbortSignal, ): Promise<WorkspaceFileBytes>
442
+ @Remote async readBytes( workspaceFileScope: WorkspaceFileScope, path: string, options: WorkspaceByteReadOptions, signal: AbortSignal, ): Promise<WorkspaceFileBytes>
398
443
 
399
444
  /**
400
445
  * Report one regular file's identity, version, and size without its content.
@@ -415,15 +460,15 @@ Host Remote file reads and workspace directory observations over the composed fi
415
460
  @Remote async list(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): Promise<WorkspaceDirectoryListing>
416
461
 
417
462
  /**
418
- * Stream every `fs/observed` observation of a file inside the Session's
419
- * workspace. Only instrumented filesystem operations report here; the OS is
420
- * not watched.
463
+ * Watch one file or a directory's direct entries in the Session's filesystem.
464
+ * Files use the backend's read authority; directories remain workspace-scoped.
421
465
  * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
466
+ * @param path - target path; the Host determines its type and confines directories to the workspace.
422
467
  * @param signal - generation cancellation.
423
- * @returns `ready` once the Host observation queue is active and the workspace
424
- * root is resolved, then queued and live observations in emission order.
468
+ * @returns `ready` once the target watch is active, then current metadata for queued and live invalidations.
469
+ * @throws RemoteError when watching is unavailable or a directory is outside the workspace.
425
470
  */
426
- @Remote({ mode: 'stream' }) changes(workspaceFileScope: WorkspaceFileScope, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>
471
+ @Remote({ mode: 'stream' }) changes(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>
427
472
  ```
428
473
 
429
474
  Source: [`packages/api/workspace-files/src/index.ts`](../../packages/api/workspace-files/src/index.ts)
@@ -448,6 +493,20 @@ Durable workspace registry. Startup waits for `sessionPersistence`, builds one c
448
493
  */
449
494
  async create(path: string, title?: string): Promise<Workspace>
450
495
 
496
+ /**
497
+ * Initialize the default Workspace only while both the registry and Session
498
+ * history are empty. Repeated requests reuse its durable identity; deleting
499
+ * that registration permanently disables automatic creation.
500
+ * @param resolveDirectory - resolve the absolute directory; called only for
501
+ * eligible creation, inside the registry mutation queue. Missing directories
502
+ * are created recursively before registration, and the initial title is the
503
+ * requested directory's own final segment — not the canonical one, so a
504
+ * symlink at that path does not retitle the Workspace after its target.
505
+ * After resolution, caller cancellation does not roll back creation or registration.
506
+ * @returns the initialized Workspace, or undefined when automatic creation is ineligible.
507
+ */
508
+ initializeDefault(resolveDirectory: () => Promise<string>): Promise<Workspace | undefined>
509
+
451
510
  /**
452
511
  * Look up a workspace by id.
453
512
  * @param id - Workspace id.
@@ -485,11 +544,21 @@ insertBefore(id: WorkspaceId, beforeId?: WorkspaceId): Promise<readonly Workspac
485
544
  /**
486
545
  * Archive one session durably. The session must exist (live or in session
487
546
  * persistence); its workspace accounting — or lack of one — is irrelevant.
488
- * An already archived id resolves without writing.
547
+ * Without `stopActivity` the session must also be inactive: the
548
+ * `workspace/session-activity` waterfall is asked once, and any reported
549
+ * activity rejects with {@link WorkspaceActiveSessionError} before anything
550
+ * is written. With `stopActivity` the archive is written without an
551
+ * activity check, and the `workspace/session-stop` providers are then asked
552
+ * to stop the session's work: the durable archive set is what a provider's
553
+ * `agent/pre-step` gate reads, so every wake the stops induce is already
554
+ * blocked. Archiving drops the session's pin in the same durable write
555
+ * (pinning and archival are mutually exclusive). An already archived id
556
+ * resolves without writing, asking, or stopping.
489
557
  * @param sessionId - The session to archive.
490
- * @returns resolution after durability.
558
+ * @param options - Whether running work is stopped instead of refusing.
559
+ * @returns resolution after durability and, with `stopActivity`, after every stop request was issued.
491
560
  */
492
- archiveSession(sessionId: SessionId): Promise<void>
561
+ archiveSession(sessionId: SessionId, options: ArchiveSessionOptions = {}): Promise<void>
493
562
 
494
563
  /**
495
564
  * Unarchive one session durably by dropping it from the registry-global
@@ -503,6 +572,25 @@ archiveSession(sessionId: SessionId): Promise<void>
503
572
  */
504
573
  unarchiveSession(sessionId: SessionId): Promise<void>
505
574
 
575
+ /**
576
+ * Pin one session durably, prepending it to the registry-global pin set.
577
+ * The session must exist (live or in session persistence) and must not be
578
+ * archived. An already pinned id resolves without writing or reordering.
579
+ * @param sessionId - The session to pin.
580
+ * @returns resolution after durability.
581
+ */
582
+ pinSession(sessionId: SessionId): Promise<void>
583
+
584
+ /**
585
+ * Unpin one session durably by dropping it from the registry-global pin
586
+ * set. Unpinning runs no session-existence check because removing an id
587
+ * cannot introduce an unknown one, so an entry whose session is gone still
588
+ * resolves. An id that is not pinned resolves without writing.
589
+ * @param sessionId - The session to unpin.
590
+ * @returns resolution after durability.
591
+ */
592
+ unpinSession(sessionId: SessionId): Promise<void>
593
+
506
594
  /**
507
595
  * Resolve by canonical directory path without creating or mutating a
508
596
  * workspace. A missing path rejects during `realpath`; an existing unowned
@@ -515,5 +603,57 @@ async resolveByPath(path: string): Promise<Workspace | undefined>
515
603
 
516
604
  Types: [SessionId](core.md)
517
605
 
606
+ Source: [`packages/workspace/workspace/src/index.ts`](../../packages/workspace/workspace/src/index.ts)
607
+
608
+ <a id="workspace-events"></a>
609
+
610
+ ### `workspace/*` events
611
+
612
+ <a id="workspacesession-activity--waterfall"></a>
613
+
614
+ #### `workspace/session-activity` — waterfall
615
+
616
+ Ask the composed providers what still runs for a session before it is archived. A listener prepends its own SessionActivity entries to the result of `next()`; the registry's innermost callback returns an empty list, so a composition without providers archives freely. Any non-empty result refuses the archive without a write.
617
+
618
+ ```ts cordis-catalog
619
+ /**
620
+ * Ask the composed providers what still runs for a session before it is
621
+ * archived. A listener prepends its own {@link SessionActivity} entries to
622
+ * the result of `next()`; the registry's innermost callback returns an
623
+ * empty list, so a composition without providers archives freely. Any
624
+ * non-empty result refuses the archive without a write.
625
+ * @param request - the session about to be archived.
626
+ * @param next - delegate to the remaining providers.
627
+ * @mode waterfall
628
+ */
629
+ 'workspace/session-activity'( request: SessionActivityRequest, next: () => Promise<readonly SessionActivity[]>, ): Promise<readonly SessionActivity[]>
630
+ ```
631
+
632
+ Source: [`packages/workspace/workspace/src/index.ts`](../../packages/workspace/workspace/src/index.ts)
633
+
634
+ <a id="workspacesession-stop--parallel"></a>
635
+
636
+ #### `workspace/session-stop` — parallel
637
+
638
+ Stop a session's running work because the caller archived it with `stopActivity`; the archive set is durable when this dispatches. Each provider stops its own families — cancelling a turn, its subagent descendants, owned jobs, or active schedules — through the same cancel paths the user's own stop actions use, so the session log ends every open turn regularly and a later unarchive can continue the conversation. Listeners issue their stop requests without waiting for running work to settle; a listener may await its own durability barrier. A rejection is logged by the registry and does not undo the archive.
639
+
640
+ ```ts cordis-catalog
641
+ /**
642
+ * Stop a session's running work because the caller archived it with
643
+ * `stopActivity`; the archive set is durable when this dispatches. Each
644
+ * provider stops its own families — cancelling a turn, its subagent
645
+ * descendants, owned jobs, or active schedules — through the same cancel
646
+ * paths the user's own stop actions use, so the session log ends every
647
+ * open turn regularly and a later unarchive can continue the
648
+ * conversation. Listeners issue their stop requests without waiting for
649
+ * running work to settle; a listener may await its own durability
650
+ * barrier. A rejection is logged by the registry and does not undo the
651
+ * archive.
652
+ * @param request - the session being archived.
653
+ * @mode parallel
654
+ */
655
+ 'workspace/session-stop'(request: SessionActivityRequest): Promise<void> | void
656
+ ```
657
+
518
658
  Source: [`packages/workspace/workspace/src/index.ts`](../../packages/workspace/workspace/src/index.ts)
519
659
  <!-- END GENERATED cordis-surface -->
@@ -117,10 +117,51 @@ interface Workspace {
117
117
 
118
118
  ## 注册表:`ctx.workspaceRegistry`
119
119
 
120
- `WorkspaceRegistry`([签名](#ctxworkspaceregistry--workspaceregistry))拥有注册与解析。`create(path, title?)` 要求完全限定路径并将其规范化,拒绝不存在的路径(原样传出原始 `ENOENT`)或非目录;当规范路径已被拥有时原样返回既有实体;否则创建一条标题为 `title ?? defaultWorkspaceTitle(path)` 的记录并前插到持久的注册表顺序中(不同规范路径可以共享同一显示标题,没有最终路径段时使用根路径拼写)。`get(id)` 与有序的 `list()` 是同步缓存读取;`resolveByPath(path)` 应用同一套完全限定 realpath 规范但不创建。`delete(id)` 只移除注册记录、顺序条目和会话账本——目录、用户文件、实时会话和已持久化日志一概不动,因此这些会话变为 Ungrouped([决策](../../.agents/notes/implemented/feature/2026-07-27-workspace-registration-deletion.zh.md));未知 id 返回 `false`。create 与 delete 会在其两次写入(记录 + 顺序)可能分叉之前先持久写入一个待定变更标记;启动时恰好解决被标记的那次变更——通过删除被标记的表行:这会补完被中断的 delete,并回滚被中断的 create(注册可以重建,因此回滚是安全方向)——而没有标记的顺序/表不一致则作为损坏大声失败。
120
+ `WorkspaceRegistry`([签名](#ctxworkspaceregistry--workspaceregistry))拥有注册与解析。`create(path, title?)` 要求完全限定路径并将其规范化,拒绝不存在的路径(原样传出原始 `ENOENT`)或非目录;当规范路径已被拥有时原样返回既有实体;否则创建一条标题为 `title ?? defaultWorkspaceTitle(path)` 的记录并前插到持久的注册表顺序中(不同规范路径可以共享同一显示标题,没有最终路径段时使用根路径拼写)。`get(id)` 与有序的 `list()` 是同步缓存读取;`resolveByPath(path)` 应用同一套完全限定 realpath 规范但不创建。`delete(id)` 只移除注册记录、顺序条目和会话账本——目录、用户文件、实时会话和已持久化日志一概不动,因此这些会话变为 Ungrouped([参考](../../packages/workspace/workspace/README.zh.md));未知 id 返回 `false`。create 与 delete 会在其两次写入(记录 + 顺序)可能分叉之前先持久写入一个待定变更标记;启动时恰好解决被标记的那次变更——通过删除被标记的表行:这会补完被中断的 delete,并回滚被中断的 create(注册可以重建,因此回滚是安全方向)——而没有标记的顺序/表不一致则作为损坏大声失败。
121
121
 
122
122
  会话的 cwd 在创建时由创建者赋予,而不是由本注册表赋予——API 网关从所选工作区的 `path` 解析新会话的 cwd(回退到显式或默认 cwd),先创建会话使 cwd 落入其不可变的 [`SessionHeader`](persistence.zh.md#sessionheader--metadata-beside-the-log),再调用 `attachSession`,后者会把已存储的 header cwd 与工作区路径重新校验一遍。首次成功启动时,注册表仅凭已持久化的 header(`id`、`cwd`、`createdAt`——绝不读事件正文)引导历史:把规范 cwd 有效的会话按目录分组为工作区,最新的排在最前;「已初始化」标记最后写入,因此被中断的引导可以安全续跑。引导只发生这一次:没有 cwd 的历史遗留会话保持 Ungrouped,此后创建的会话只能通过 `attachSession` 加入工作区。
123
123
 
124
+ ## 默认工作区初始化
125
+
126
+ 控制器的 `initializeDefault` 不接受请求参数:它拥有固定目录名 `default-workspace`,解析 Documents 位置,并请求注册表执行一次初始化。注册表接收目录解析器,以所请求目录(而非规范路径)的最后一段作为初始标题,并将登记与持久化身份一起提交。语言不会传到 Host——浏览器消费方通过控制器的 `workspaceDisplayTitle` 为仍保留该自动标题的工作区加标签,因此只有屏幕上的名称跟随读者语言。[首次使用行为与配置](../../packages/api/workspace-controller/README.zh.md#first-use-workspace)说明复用和失败处理。
127
+
128
+ ## 会话置顶
129
+
130
+ 控制器的[传输类型](../../packages/api/workspace-controller/src/types.ts)定义了 `WorkspacePinSessionRequest` 和 `WorkspaceUnpinSessionRequest`,两者都携带一个 `sessionId`。两个操作都返回 `WorkspacePinValue`:完整的会话 id 数组 `pinnedSessionIds`,最近置顶的会话排在前面。置顶要求会话已知且未归档;对未置顶的 id 取消置顶会成功,且不改变集合。归档在同一次持久化写入中移除该会话的置顶,取消归档不会恢复置顶。
131
+
132
+ ## 归档准入
133
+
134
+ 归档是一个注册表全局的持久化集合,注册表拒绝把正在运行的工作藏在它后面。这条规则是本包声明并派发的两个宿主事件之上的能力接缝([事件](#workspace-events)):`workspace/session-activity`(waterfall)向已组合的提供方询问某会话还有什么在跑,`workspace/session-stop`(parallel)请它们停止这些工作。每个提供方像任何监听器一样在根上注册,因此本包不认识 agent、job 或 schedule 的词汇;各族是一个可合并扩展的 map 的键。
135
+
136
+ ```ts type-equiv
137
+ /**
138
+ * Activity families a `workspace/session-activity` listener may report. This
139
+ * package declares none: each provider merges its own key from a module both
140
+ * its Host and Client faces import, so a consumer that renders the families
141
+ * sees exactly the keys its program compiled and falls through to a generic
142
+ * description for any other. The shipped providers merge `turn` (the Agent
143
+ * registry), `job` (the job registry seam), `subagent` (the Subagent
144
+ * runtime), and `schedule` (the Schedule plugin).
145
+ */
146
+ interface SessionActivityKindMap {}
147
+ ```
148
+
149
+ `SessionActivityKind` 即 `keyof SessionActivityKindMap`,因此一个没有编译任何提供方的程序看不到任何键。随附的键放在各自 client 可导入的类型模块里:`turn` 在 Agent 注册表的 `types.ts`,`job` 在任务注册表接缝的 `view.ts`,`subagent` 在 Subagent runtime 的 `control-types.ts`,`schedule` 在 Schedule 插件的 `types.ts`;渲染各族的消费方为其分支导入这些模块,并为其他任何键保留一条通用文案。提供方通过把自己的 `SessionActivity` 条目前置到 `next()` 的结果来回答 waterfall;注册表最内层的回调返回空列表,因此没有提供方的组合可自由归档。
150
+
151
+ ```ts type-equiv
152
+ /**
153
+ * One reason a session counts as active for archive admission. Families with
154
+ * per-item identity list their items so a caller can name what must stop.
155
+ */
156
+ interface SessionActivity {
157
+ readonly kind: SessionActivityKind
158
+ /** Active items of the family; absent for a family without per-item identity (`turn`). */
159
+ readonly items?: readonly SessionActivityItem[]
160
+ }
161
+ ```
162
+
163
+ `SessionActivityItem` 携带各族自己的 `id`(会话、任务或提醒 id)和可选的展示 `label`。`archiveSession(sessionId)` 在存在性检查之后只询问 waterfall 一次,对非空答案以 `WorkspaceActiveSessionError`(`sessionId`、`activity`)拒绝且不写入;控制器把它映射为 `workspace/session-active` 错误,其 details 携带同样的两个字段。`archiveSession(sessionId, { stopActivity: true })`——`ArchiveSessionOptions` 的这个字段由传输请求以 `stopActivity` 暴露——跳过检查、先写入归档、再派发 `workspace/session-stop`;提供方抛错只记日志,归档保留,被停止的工作从不等待收敛。已归档的 id 既不询问也不停止。随附的提供方、它们停止什么,以及让已归档会话不跑模型步的 `agent/pre-step` 门禁,记录在[注册表包](../../packages/workspace/workspace/README.zh.md#api-behavior);决策记录见 [archive-stops-running-work Agent Note](../../.agents/notes/implemented/feature/2026-09-21-archive-stops-running-session-work.zh.md)。
164
+
124
165
  ## 消费方
125
166
 
126
167
  [`dsh-workspace-controller`](../../packages/api/workspace-controller) 经 `ctx.workspaceRegistry` 向 GUI 客户端提供工作区 CRUD,[`dsh-session-controller`](../../packages/api/session-controller) 执行上文「先建会话再 attach」的流程。[dsh-agent-instructions](../../packages/context/agent-instructions) 尽管名字如此,却**不是**消费方:它在 agent 自己的 cwd 下发现 AGENTS.md 风格的指令文件,从不触碰 `ctx.workspaceRegistry`——两者共用的这个词指的是用户的工作目录,而非本注册表的实体。
@@ -297,6 +338,16 @@ Host service backing the generated `ctx.remote.workspace` namespace.
297
338
  */
298
339
  @Remote('create') create(request: WorkspaceCreateRequest): Promise<WorkspaceCreateValue>
299
340
 
341
+ /**
342
+ * Initialize or reuse the default Workspace during first-use startup. The
343
+ * directory name is fixed, so the Host never renames or relocates an
344
+ * existing default; its initial title is that same name, which browser
345
+ * consumers label in the reader's language.
346
+ * @param signal - caller lifetime; cancels native directory lookup.
347
+ * @returns the durable Workspace, or undefined when first-use initialization is ineligible; creates no Session or message.
348
+ */
349
+ @Remote('initializeDefault') async initializeDefault(signal: AbortSignal): Promise<WorkspaceValue | undefined>
350
+
300
351
  /**
301
352
  * Rename one Workspace to a unique non-blank title.
302
353
  * @param request - Workspace identity and proposed title.
@@ -339,6 +390,20 @@ Host service backing the generated `ctx.remote.workspace` namespace.
339
390
  */
340
391
  @Remote('unarchiveSession') unarchiveSession(request: WorkspaceUnarchiveSessionRequest): Promise<WorkspaceArchiveValue>
341
392
 
393
+ /**
394
+ * Surface one known unarchived Session ahead of unpinned Sessions.
395
+ * @param request - Session identity to pin.
396
+ * @returns the complete resulting pin set, most recently pinned first.
397
+ */
398
+ @Remote('pinSession') pinSession(request: WorkspacePinSessionRequest): Promise<WorkspacePinValue>
399
+
400
+ /**
401
+ * Remove one Session's pin without changing its saved Session order.
402
+ * @param request - Session identity to unpin.
403
+ * @returns the complete resulting pin set, most recently pinned first.
404
+ */
405
+ @Remote('unpinSession') unpinSession(request: WorkspaceUnpinSessionRequest): Promise<WorkspacePinValue>
406
+
342
407
  /**
343
408
  * Stream a complete Workspace baseline followed by ordered increments.
344
409
  * @param signal - generation cancellation.
@@ -367,34 +432,14 @@ Host Remote file reads and workspace directory observations over the composed fi
367
432
  @Remote async read( workspaceFileScope: WorkspaceFileScope, path: string, range: WorkspaceFileRange, signal: AbortSignal, ): Promise<WorkspaceFileText>
368
433
 
369
434
  /**
370
- * Read one byte window of a regular file readable by the filesystem backend: raw
371
- * bytes, no text decoding and no binary rejection.
372
- * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
373
- * @param path - absolute path or path relative to the workspace root; files outside it are allowed.
374
- * @param range - the byte window; omitted fields take the window defaults.
375
- * @param signal - caller cancellation.
376
- * @returns the window in base64, the file's version and size at the stat before it, and whether it reaches the last byte.
377
- */
378
- @Remote async readBytes( workspaceFileScope: WorkspaceFileScope, path: string, range: WorkspaceByteRange, signal: AbortSignal, ): Promise<WorkspaceFileBytes>
379
-
380
- /**
381
- * Read a complete regular file as bytes, subject to the configured full-file cap.
382
- * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
383
- * @param path - absolute or workspace-relative file path.
384
- * @param signal - caller cancellation.
385
- * @returns one complete base64 window with offset zero and eof true; oversized files fail with too-large.
386
- */
387
- @Remote async readAll(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): Promise<WorkspaceFileBytes>
388
-
389
- /**
390
- * Read a complete file relative to another file's directory, including outside the workspace.
435
+ * Read a complete regular file or one byte range without text decoding.
391
436
  * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
392
- * @param path - base file, absolute or workspace-relative.
393
- * @param relativePath - relative filesystem path, not a URL or absolute path.
437
+ * @param path - target path, absolute or workspace-relative; relative to the base file's directory when provided.
438
+ * @param options - optional base file and range; without a range the complete-file cap applies.
394
439
  * @param signal - caller cancellation.
395
- * @returns the complete related file using the ordinary file-size and access checks.
440
+ * @returns native bytes with the file's version and size at the preceding stat, byte offset, and EOF marker.
396
441
  */
397
- @Remote async readRelated( workspaceFileScope: WorkspaceFileScope, path: string, relativePath: string, signal: AbortSignal, ): Promise<WorkspaceFileBytes>
442
+ @Remote async readBytes( workspaceFileScope: WorkspaceFileScope, path: string, options: WorkspaceByteReadOptions, signal: AbortSignal, ): Promise<WorkspaceFileBytes>
398
443
 
399
444
  /**
400
445
  * Report one regular file's identity, version, and size without its content.
@@ -415,15 +460,15 @@ Host Remote file reads and workspace directory observations over the composed fi
415
460
  @Remote async list(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): Promise<WorkspaceDirectoryListing>
416
461
 
417
462
  /**
418
- * Stream every `fs/observed` observation of a file inside the Session's
419
- * workspace. Only instrumented filesystem operations report here; the OS is
420
- * not watched.
463
+ * Watch one file or a directory's direct entries in the Session's filesystem.
464
+ * Files use the backend's read authority; directories remain workspace-scoped.
421
465
  * @param workspaceFileScope - header-derived workspace root for the Session identity on the wire.
466
+ * @param path - target path; the Host determines its type and confines directories to the workspace.
422
467
  * @param signal - generation cancellation.
423
- * @returns `ready` once the Host observation queue is active and the workspace
424
- * root is resolved, then queued and live observations in emission order.
468
+ * @returns `ready` once the target watch is active, then current metadata for queued and live invalidations.
469
+ * @throws RemoteError when watching is unavailable or a directory is outside the workspace.
425
470
  */
426
- @Remote({ mode: 'stream' }) changes(workspaceFileScope: WorkspaceFileScope, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>
471
+ @Remote({ mode: 'stream' }) changes(workspaceFileScope: WorkspaceFileScope, path: string, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>
427
472
  ```
428
473
 
429
474
  Source: [`packages/api/workspace-files/src/index.ts`](../../packages/api/workspace-files/src/index.ts)
@@ -448,6 +493,20 @@ Durable workspace registry. Startup waits for `sessionPersistence`, builds one c
448
493
  */
449
494
  async create(path: string, title?: string): Promise<Workspace>
450
495
 
496
+ /**
497
+ * Initialize the default Workspace only while both the registry and Session
498
+ * history are empty. Repeated requests reuse its durable identity; deleting
499
+ * that registration permanently disables automatic creation.
500
+ * @param resolveDirectory - resolve the absolute directory; called only for
501
+ * eligible creation, inside the registry mutation queue. Missing directories
502
+ * are created recursively before registration, and the initial title is the
503
+ * requested directory's own final segment — not the canonical one, so a
504
+ * symlink at that path does not retitle the Workspace after its target.
505
+ * After resolution, caller cancellation does not roll back creation or registration.
506
+ * @returns the initialized Workspace, or undefined when automatic creation is ineligible.
507
+ */
508
+ initializeDefault(resolveDirectory: () => Promise<string>): Promise<Workspace | undefined>
509
+
451
510
  /**
452
511
  * Look up a workspace by id.
453
512
  * @param id - Workspace id.
@@ -485,11 +544,21 @@ insertBefore(id: WorkspaceId, beforeId?: WorkspaceId): Promise<readonly Workspac
485
544
  /**
486
545
  * Archive one session durably. The session must exist (live or in session
487
546
  * persistence); its workspace accounting — or lack of one — is irrelevant.
488
- * An already archived id resolves without writing.
547
+ * Without `stopActivity` the session must also be inactive: the
548
+ * `workspace/session-activity` waterfall is asked once, and any reported
549
+ * activity rejects with {@link WorkspaceActiveSessionError} before anything
550
+ * is written. With `stopActivity` the archive is written without an
551
+ * activity check, and the `workspace/session-stop` providers are then asked
552
+ * to stop the session's work: the durable archive set is what a provider's
553
+ * `agent/pre-step` gate reads, so every wake the stops induce is already
554
+ * blocked. Archiving drops the session's pin in the same durable write
555
+ * (pinning and archival are mutually exclusive). An already archived id
556
+ * resolves without writing, asking, or stopping.
489
557
  * @param sessionId - The session to archive.
490
- * @returns resolution after durability.
558
+ * @param options - Whether running work is stopped instead of refusing.
559
+ * @returns resolution after durability and, with `stopActivity`, after every stop request was issued.
491
560
  */
492
- archiveSession(sessionId: SessionId): Promise<void>
561
+ archiveSession(sessionId: SessionId, options: ArchiveSessionOptions = {}): Promise<void>
493
562
 
494
563
  /**
495
564
  * Unarchive one session durably by dropping it from the registry-global
@@ -503,6 +572,25 @@ archiveSession(sessionId: SessionId): Promise<void>
503
572
  */
504
573
  unarchiveSession(sessionId: SessionId): Promise<void>
505
574
 
575
+ /**
576
+ * Pin one session durably, prepending it to the registry-global pin set.
577
+ * The session must exist (live or in session persistence) and must not be
578
+ * archived. An already pinned id resolves without writing or reordering.
579
+ * @param sessionId - The session to pin.
580
+ * @returns resolution after durability.
581
+ */
582
+ pinSession(sessionId: SessionId): Promise<void>
583
+
584
+ /**
585
+ * Unpin one session durably by dropping it from the registry-global pin
586
+ * set. Unpinning runs no session-existence check because removing an id
587
+ * cannot introduce an unknown one, so an entry whose session is gone still
588
+ * resolves. An id that is not pinned resolves without writing.
589
+ * @param sessionId - The session to unpin.
590
+ * @returns resolution after durability.
591
+ */
592
+ unpinSession(sessionId: SessionId): Promise<void>
593
+
506
594
  /**
507
595
  * Resolve by canonical directory path without creating or mutating a
508
596
  * workspace. A missing path rejects during `realpath`; an existing unowned
@@ -515,5 +603,57 @@ async resolveByPath(path: string): Promise<Workspace | undefined>
515
603
 
516
604
  Types: [SessionId](core.zh.md)
517
605
 
606
+ Source: [`packages/workspace/workspace/src/index.ts`](../../packages/workspace/workspace/src/index.ts)
607
+
608
+ <a id="workspace-events"></a>
609
+
610
+ ### `workspace/*` events
611
+
612
+ <a id="workspacesession-activity--waterfall"></a>
613
+
614
+ #### `workspace/session-activity` — waterfall
615
+
616
+ Ask the composed providers what still runs for a session before it is archived. A listener prepends its own SessionActivity entries to the result of `next()`; the registry's innermost callback returns an empty list, so a composition without providers archives freely. Any non-empty result refuses the archive without a write.
617
+
618
+ ```ts cordis-catalog
619
+ /**
620
+ * Ask the composed providers what still runs for a session before it is
621
+ * archived. A listener prepends its own {@link SessionActivity} entries to
622
+ * the result of `next()`; the registry's innermost callback returns an
623
+ * empty list, so a composition without providers archives freely. Any
624
+ * non-empty result refuses the archive without a write.
625
+ * @param request - the session about to be archived.
626
+ * @param next - delegate to the remaining providers.
627
+ * @mode waterfall
628
+ */
629
+ 'workspace/session-activity'( request: SessionActivityRequest, next: () => Promise<readonly SessionActivity[]>, ): Promise<readonly SessionActivity[]>
630
+ ```
631
+
632
+ Source: [`packages/workspace/workspace/src/index.ts`](../../packages/workspace/workspace/src/index.ts)
633
+
634
+ <a id="workspacesession-stop--parallel"></a>
635
+
636
+ #### `workspace/session-stop` — parallel
637
+
638
+ Stop a session's running work because the caller archived it with `stopActivity`; the archive set is durable when this dispatches. Each provider stops its own families — cancelling a turn, its subagent descendants, owned jobs, or active schedules — through the same cancel paths the user's own stop actions use, so the session log ends every open turn regularly and a later unarchive can continue the conversation. Listeners issue their stop requests without waiting for running work to settle; a listener may await its own durability barrier. A rejection is logged by the registry and does not undo the archive.
639
+
640
+ ```ts cordis-catalog
641
+ /**
642
+ * Stop a session's running work because the caller archived it with
643
+ * `stopActivity`; the archive set is durable when this dispatches. Each
644
+ * provider stops its own families — cancelling a turn, its subagent
645
+ * descendants, owned jobs, or active schedules — through the same cancel
646
+ * paths the user's own stop actions use, so the session log ends every
647
+ * open turn regularly and a later unarchive can continue the
648
+ * conversation. Listeners issue their stop requests without waiting for
649
+ * running work to settle; a listener may await its own durability
650
+ * barrier. A rejection is logged by the registry and does not undo the
651
+ * archive.
652
+ * @param request - the session being archived.
653
+ * @mode parallel
654
+ */
655
+ 'workspace/session-stop'(request: SessionActivityRequest): Promise<void> | void
656
+ ```
657
+
518
658
  Source: [`packages/workspace/workspace/src/index.ts`](../../packages/workspace/workspace/src/index.ts)
519
659
  <!-- END GENERATED cordis-surface -->
@@ -1,6 +1,34 @@
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:
1
+ # Bilingual-pair consistency record for testing.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write docs/testing.md
5
- testing.md: 95badfd66ba49151a64dad3f5959a12265449f97
6
- testing.zh.md: a715fb0a6f285a908857a90e848213f42cc040cf
5
+ /testing-policy:
6
+ en: 0d7399a58529b9eb
7
+ zh: 7f445b06430f21a4
8
+ /testing-policy/tiers:
9
+ en: c024da7e8d9cb056
10
+ zh: c4cc1a66d2903656
11
+ /testing-policy/how-specs-execute:
12
+ en: 298c13b105e86eae
13
+ zh: 4f1b0b7742fb7b49
14
+ /testing-policy/the-with-key-policy-inference-is-cheap-here:
15
+ en: d555af53068bf523
16
+ zh: ddc4265e5de5b3be
17
+ /testing-policy/prefer-the-real-implementation-over-a-mock:
18
+ en: 96a5bdcea4960b25
19
+ zh: 98ad9d468e55a5ed
20
+ /testing-policy/verify-the-world-not-the-self-report:
21
+ en: e7cbafc4f96b72c2
22
+ zh: 0c5a0aa2afd9a812
23
+ /testing-policy/test-the-real-entry-path:
24
+ en: 002e4c4a1bcbef50
25
+ zh: c3dd3820c0b2164f
26
+ /testing-policy/test-resolution-source-plane-only:
27
+ en: 8a142fe4cbd196d7
28
+ zh: 0f8c682cd8c654de
29
+ /testing-policy/test-subprocess-launch-modes:
30
+ en: 5ea1c7ff7a9a5728
31
+ zh: bbae70e0cd2d5cbf
32
+ /testing-policy/when-a-snapshot-test-is-required:
33
+ en: 055966993c5392c0
34
+ zh: eb35536ad2c4320b