dsh-plugin-guide 0.3.15 → 0.3.17

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 (446) hide show
  1. package/README-es.md +43 -40
  2. package/README-hi.md +43 -40
  3. package/README-pt.md +43 -40
  4. package/README-zh.md +43 -40
  5. package/README.md +19 -15
  6. package/dist/dsh-plugin-dev.js +230 -6
  7. package/guide/plugin-dev-guide.md +1 -1
  8. package/guide/release-engineering.md +7 -5
  9. package/guide/release-engineering.zh-CN.md +7 -5
  10. package/guide/unfixed-issues.md +4 -2
  11. package/package.json +5 -4
  12. package/references/official-docs/AGENTS.md +74 -49
  13. package/references/official-docs/README.i18n.yaml +2 -2
  14. package/references/official-docs/README.zh.md +12 -0
  15. package/references/official-docs/SNAPSHOT.md +4 -4
  16. package/references/official-docs/THIRD_PARTY_NOTICES.md +86 -30
  17. package/references/official-docs/docs/AGENTS.md +7 -6
  18. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
  19. package/references/official-docs/docs/agent-lifecycle.md +12 -5
  20. package/references/official-docs/docs/agent-lifecycle.zh.md +12 -5
  21. package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
  22. package/references/official-docs/docs/api-gateway.md +2 -2
  23. package/references/official-docs/docs/api-gateway.zh.md +2 -2
  24. package/references/official-docs/docs/architecture.i18n.yaml +2 -2
  25. package/references/official-docs/docs/architecture.md +26 -12
  26. package/references/official-docs/docs/architecture.zh.md +28 -14
  27. package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
  28. package/references/official-docs/docs/capability-seams.md +111 -31
  29. package/references/official-docs/docs/capability-seams.zh.md +111 -31
  30. package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
  31. package/references/official-docs/docs/config-catalog.md +674 -202
  32. package/references/official-docs/docs/config-catalog.zh.md +691 -219
  33. package/references/official-docs/docs/cookbook/adding-a-session-format-version.i18n.yaml +6 -0
  34. package/references/official-docs/docs/cookbook/adding-a-session-format-version.md +111 -0
  35. package/references/official-docs/docs/cookbook/adding-a-session-format-version.zh.md +111 -0
  36. package/references/official-docs/docs/cookbook/adding-a-settings-card.md +8 -8
  37. package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +9 -9
  38. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
  39. package/references/official-docs/docs/cookbook/adding-a-tool.md +2 -2
  40. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +4 -4
  41. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
  42. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +1 -1
  43. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +1 -1
  44. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +1 -1
  45. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
  46. package/references/official-docs/docs/cookbook/extension-cookbook.md +3 -3
  47. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +5 -5
  48. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +2 -2
  49. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +1 -1
  50. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  51. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.i18n.yaml +6 -0
  52. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.md +108 -0
  53. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.zh.md +108 -0
  54. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +2 -2
  55. package/references/official-docs/docs/cordis-api/fiber.md +3 -3
  56. package/references/official-docs/docs/cordis-api/fiber.zh.md +3 -3
  57. package/references/official-docs/docs/cordis-api/inherited.md +0 -3
  58. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +2 -2
  59. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +2 -2
  60. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +2 -2
  61. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +2 -2
  62. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +14 -15
  63. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +15 -16
  64. package/references/official-docs/docs/dependency-catalog.json +7312 -0
  65. package/references/official-docs/docs/development.i18n.yaml +2 -2
  66. package/references/official-docs/docs/development.md +13 -3
  67. package/references/official-docs/docs/development.zh.md +16 -6
  68. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
  69. package/references/official-docs/docs/event-producer-consumer.md +50 -39
  70. package/references/official-docs/docs/event-producer-consumer.zh.md +55 -44
  71. package/references/official-docs/docs/glossary.i18n.yaml +2 -2
  72. package/references/official-docs/docs/glossary.md +1 -1
  73. package/references/official-docs/docs/glossary.zh.md +1 -1
  74. package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
  75. package/references/official-docs/docs/i18n/README.md +8 -3
  76. package/references/official-docs/docs/i18n/README.zh.md +8 -3
  77. package/references/official-docs/docs/i18n/style-samples.md +1 -1
  78. package/references/official-docs/docs/i18n/translation-prompt.md +5 -5
  79. package/references/official-docs/docs/i18n/translation-rules.zh.md +2 -2
  80. package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
  81. package/references/official-docs/docs/module-graph.md +303 -120
  82. package/references/official-docs/docs/module-graph.zh.md +303 -120
  83. package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
  84. package/references/official-docs/docs/persistence-catalog.md +5699 -64
  85. package/references/official-docs/docs/persistence-catalog.zh.md +5708 -73
  86. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.i18n.yaml +6 -0
  87. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.md +280 -0
  88. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.schema.json +13557 -0
  89. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.zh.md +280 -0
  90. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.i18n.yaml +6 -0
  91. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
  92. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.schema.json +910 -0
  93. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
  94. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.i18n.yaml +6 -0
  95. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.md +96 -0
  96. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.schema.json +8478 -0
  97. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
  98. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.i18n.yaml +6 -0
  99. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
  100. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.schema.json +72 -0
  101. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
  102. package/references/official-docs/docs/persistence-changes/README.i18n.yaml +6 -0
  103. package/references/official-docs/docs/persistence-changes/README.md +74 -0
  104. package/references/official-docs/docs/persistence-changes/README.zh.md +74 -0
  105. package/references/official-docs/docs/persistence-changes/historical-formats/README.i18n.yaml +6 -0
  106. package/references/official-docs/docs/persistence-changes/historical-formats/README.md +74 -0
  107. package/references/official-docs/docs/persistence-changes/historical-formats/README.zh.md +74 -0
  108. package/references/official-docs/docs/persistence-changes/historical-formats/v0.i18n.yaml +6 -0
  109. package/references/official-docs/docs/persistence-changes/historical-formats/v0.md +5105 -0
  110. package/references/official-docs/docs/persistence-changes/historical-formats/v0.schema.json +49308 -0
  111. package/references/official-docs/docs/persistence-changes/historical-formats/v0.zh.md +5105 -0
  112. package/references/official-docs/docs/persistence-changes/historical-formats/v1.i18n.yaml +6 -0
  113. package/references/official-docs/docs/persistence-changes/historical-formats/v1.md +5107 -0
  114. package/references/official-docs/docs/persistence-changes/historical-formats/v1.schema.json +49411 -0
  115. package/references/official-docs/docs/persistence-changes/historical-formats/v1.zh.md +5107 -0
  116. package/references/official-docs/docs/persistence-changes/historical-formats/v2.i18n.yaml +6 -0
  117. package/references/official-docs/docs/persistence-changes/historical-formats/v2.md +5362 -0
  118. package/references/official-docs/docs/persistence-changes/historical-formats/v2.schema.json +56466 -0
  119. package/references/official-docs/docs/persistence-changes/historical-formats/v2.zh.md +5362 -0
  120. package/references/official-docs/docs/persistence-changes/releases/README.i18n.yaml +6 -0
  121. package/references/official-docs/docs/persistence-changes/releases/README.md +103 -0
  122. package/references/official-docs/docs/persistence-changes/releases/README.zh.md +103 -0
  123. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.i18n.yaml +6 -0
  124. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
  125. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.schema.json +39868 -0
  126. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
  127. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.i18n.yaml +6 -0
  128. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
  129. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.schema.json +43342 -0
  130. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
  131. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.i18n.yaml +6 -0
  132. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
  133. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.schema.json +19452 -0
  134. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
  135. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.i18n.yaml +6 -0
  136. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
  137. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.schema.json +5 -0
  138. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
  139. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.i18n.yaml +6 -0
  140. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
  141. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.schema.json +5 -0
  142. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
  143. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.i18n.yaml +6 -0
  144. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
  145. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.schema.json +5 -0
  146. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
  147. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.i18n.yaml +6 -0
  148. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
  149. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.schema.json +5 -0
  150. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
  151. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.i18n.yaml +6 -0
  152. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
  153. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.schema.json +5 -0
  154. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
  155. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.i18n.yaml +6 -0
  156. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
  157. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.schema.json +5 -0
  158. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
  159. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.i18n.yaml +6 -0
  160. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
  161. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.schema.json +5 -0
  162. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
  163. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.i18n.yaml +6 -0
  164. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
  165. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.schema.json +5320 -0
  166. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
  167. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.i18n.yaml +6 -0
  168. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
  169. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.schema.json +21258 -0
  170. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
  171. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.i18n.yaml +6 -0
  172. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
  173. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.schema.json +417 -0
  174. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
  175. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.i18n.yaml +6 -0
  176. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
  177. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.schema.json +29672 -0
  178. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
  179. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.i18n.yaml +6 -0
  180. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
  181. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.schema.json +48429 -0
  182. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
  183. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.i18n.yaml +6 -0
  184. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
  185. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.schema.json +49347 -0
  186. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
  187. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.i18n.yaml +6 -0
  188. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
  189. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.schema.json +5 -0
  190. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
  191. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.i18n.yaml +6 -0
  192. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
  193. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.schema.json +17642 -0
  194. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
  195. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.i18n.yaml +6 -0
  196. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
  197. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.schema.json +5 -0
  198. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
  199. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.i18n.yaml +6 -0
  200. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
  201. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.schema.json +5 -0
  202. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
  203. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.i18n.yaml +6 -0
  204. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
  205. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.schema.json +38678 -0
  206. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
  207. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.i18n.yaml +6 -0
  208. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
  209. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.schema.json +783 -0
  210. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
  211. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.i18n.yaml +6 -0
  212. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
  213. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.schema.json +24597 -0
  214. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
  215. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.i18n.yaml +6 -0
  216. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
  217. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.schema.json +2132 -0
  218. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
  219. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.i18n.yaml +6 -0
  220. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
  221. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.schema.json +5 -0
  222. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
  223. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.i18n.yaml +6 -0
  224. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
  225. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.schema.json +5 -0
  226. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
  227. package/references/official-docs/docs/persistence-changes/releases/manifest.json +162 -0
  228. package/references/official-docs/docs/persistence-schema.json +61480 -0
  229. package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
  230. package/references/official-docs/docs/postmortem/README.md +1 -1
  231. package/references/official-docs/docs/postmortem/README.zh.md +1 -1
  232. package/references/official-docs/docs/rescope.i18n.yaml +2 -2
  233. package/references/official-docs/docs/rescope.md +2 -2
  234. package/references/official-docs/docs/rescope.zh.md +2 -2
  235. package/references/official-docs/docs/session-format-status.i18n.yaml +6 -0
  236. package/references/official-docs/docs/session-format-status.md +49 -0
  237. package/references/official-docs/docs/session-format-status.zh.md +49 -0
  238. package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
  239. package/references/official-docs/docs/subsystems/README.md +12 -3
  240. package/references/official-docs/docs/subsystems/README.zh.md +23 -14
  241. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +2 -2
  242. package/references/official-docs/docs/subsystems/agent-team.md +1 -1
  243. package/references/official-docs/docs/subsystems/agent-team.zh.md +2 -2
  244. package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
  245. package/references/official-docs/docs/subsystems/approval.md +1 -1
  246. package/references/official-docs/docs/subsystems/approval.zh.md +1 -1
  247. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
  248. package/references/official-docs/docs/subsystems/attachment.md +17 -7
  249. package/references/official-docs/docs/subsystems/attachment.zh.md +17 -7
  250. package/references/official-docs/docs/subsystems/{code-runtime.i18n.yaml → boot.i18n.yaml} +3 -3
  251. package/references/official-docs/docs/subsystems/boot.md +223 -0
  252. package/references/official-docs/docs/subsystems/boot.zh.md +223 -0
  253. package/references/official-docs/docs/subsystems/browser-use.i18n.yaml +6 -0
  254. package/references/official-docs/docs/subsystems/browser-use.md +67 -0
  255. package/references/official-docs/docs/subsystems/browser-use.zh.md +67 -0
  256. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
  257. package/references/official-docs/docs/subsystems/client-modules.md +20 -10
  258. package/references/official-docs/docs/subsystems/client-modules.zh.md +21 -11
  259. package/references/official-docs/docs/subsystems/client-resources.i18n.yaml +6 -0
  260. package/references/official-docs/docs/subsystems/client-resources.md +92 -0
  261. package/references/official-docs/docs/subsystems/client-resources.zh.md +92 -0
  262. package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
  263. package/references/official-docs/docs/subsystems/commands.md +4 -0
  264. package/references/official-docs/docs/subsystems/commands.zh.md +5 -1
  265. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
  266. package/references/official-docs/docs/subsystems/compaction.md +48 -2
  267. package/references/official-docs/docs/subsystems/compaction.zh.md +50 -4
  268. package/references/official-docs/docs/subsystems/computer-use.i18n.yaml +6 -0
  269. package/references/official-docs/docs/subsystems/computer-use.md +56 -0
  270. package/references/official-docs/docs/subsystems/computer-use.zh.md +56 -0
  271. package/references/official-docs/docs/subsystems/conversation.zh.md +1 -1
  272. package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
  273. package/references/official-docs/docs/subsystems/core.md +106 -60
  274. package/references/official-docs/docs/subsystems/core.zh.md +109 -63
  275. package/references/official-docs/docs/subsystems/deliverables.i18n.yaml +6 -0
  276. package/references/official-docs/docs/subsystems/deliverables.md +178 -0
  277. package/references/official-docs/docs/subsystems/deliverables.zh.md +178 -0
  278. package/references/official-docs/docs/subsystems/extensions.zh.md +1 -1
  279. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
  280. package/references/official-docs/docs/subsystems/feedback.md +165 -31
  281. package/references/official-docs/docs/subsystems/feedback.zh.md +165 -31
  282. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
  283. package/references/official-docs/docs/subsystems/filesystem.md +15 -0
  284. package/references/official-docs/docs/subsystems/filesystem.zh.md +16 -1
  285. package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
  286. package/references/official-docs/docs/subsystems/goal.md +37 -1
  287. package/references/official-docs/docs/subsystems/goal.zh.md +38 -2
  288. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
  289. package/references/official-docs/docs/subsystems/invariants.md +1 -1
  290. package/references/official-docs/docs/subsystems/invariants.zh.md +3 -3
  291. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +1 -1
  292. package/references/official-docs/docs/subsystems/jobs.md +1 -1
  293. package/references/official-docs/docs/subsystems/jobs.zh.md +1 -1
  294. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
  295. package/references/official-docs/docs/subsystems/llm-streaming.md +35 -15
  296. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +37 -17
  297. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
  298. package/references/official-docs/docs/subsystems/lsp.md +1 -1
  299. package/references/official-docs/docs/subsystems/lsp.zh.md +1 -1
  300. package/references/official-docs/docs/subsystems/mcp.i18n.yaml +6 -0
  301. package/references/official-docs/docs/subsystems/mcp.md +139 -0
  302. package/references/official-docs/docs/subsystems/mcp.zh.md +139 -0
  303. package/references/official-docs/docs/subsystems/office-to-pdf.i18n.yaml +6 -0
  304. package/references/official-docs/docs/subsystems/office-to-pdf.md +87 -0
  305. package/references/official-docs/docs/subsystems/office-to-pdf.zh.md +87 -0
  306. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
  307. package/references/official-docs/docs/subsystems/permission-presets.md +62 -27
  308. package/references/official-docs/docs/subsystems/permission-presets.zh.md +62 -27
  309. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
  310. package/references/official-docs/docs/subsystems/persistence.md +36 -15
  311. package/references/official-docs/docs/subsystems/persistence.zh.md +36 -15
  312. package/references/official-docs/docs/subsystems/plan.zh.md +2 -2
  313. package/references/official-docs/docs/subsystems/ptc-runtime.i18n.yaml +6 -0
  314. package/references/official-docs/docs/subsystems/ptc-runtime.md +232 -0
  315. package/references/official-docs/docs/subsystems/ptc-runtime.zh.md +232 -0
  316. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
  317. package/references/official-docs/docs/subsystems/sandbox.md +5 -4
  318. package/references/official-docs/docs/subsystems/sandbox.zh.md +7 -6
  319. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
  320. package/references/official-docs/docs/subsystems/schedule.md +2 -2
  321. package/references/official-docs/docs/subsystems/schedule.zh.md +3 -3
  322. package/references/official-docs/docs/subsystems/scope.i18n.yaml +2 -2
  323. package/references/official-docs/docs/subsystems/scope.md +1 -1
  324. package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
  325. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
  326. package/references/official-docs/docs/subsystems/session-projection.md +1 -1
  327. package/references/official-docs/docs/subsystems/session-projection.zh.md +2 -2
  328. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
  329. package/references/official-docs/docs/subsystems/session-reference.md +11 -6
  330. package/references/official-docs/docs/subsystems/session-reference.zh.md +11 -6
  331. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
  332. package/references/official-docs/docs/subsystems/session-telemetry.md +22 -6
  333. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +23 -7
  334. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
  335. package/references/official-docs/docs/subsystems/session-title.md +5 -5
  336. package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
  337. package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
  338. package/references/official-docs/docs/subsystems/session.md +149 -61
  339. package/references/official-docs/docs/subsystems/session.zh.md +150 -62
  340. package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
  341. package/references/official-docs/docs/subsystems/shell.md +19 -15
  342. package/references/official-docs/docs/subsystems/shell.zh.md +20 -16
  343. package/references/official-docs/docs/subsystems/sidebar-right.i18n.yaml +6 -0
  344. package/references/official-docs/docs/subsystems/sidebar-right.md +153 -0
  345. package/references/official-docs/docs/subsystems/sidebar-right.zh.md +153 -0
  346. package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
  347. package/references/official-docs/docs/subsystems/skills.md +4 -6
  348. package/references/official-docs/docs/subsystems/skills.zh.md +4 -6
  349. package/references/official-docs/docs/subsystems/slots.i18n.yaml +2 -2
  350. package/references/official-docs/docs/subsystems/slots.md +52 -38
  351. package/references/official-docs/docs/subsystems/slots.zh.md +53 -39
  352. package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
  353. package/references/official-docs/docs/subsystems/spill.md +13 -6
  354. package/references/official-docs/docs/subsystems/spill.zh.md +13 -6
  355. package/references/official-docs/docs/subsystems/ssh.i18n.yaml +6 -0
  356. package/references/official-docs/docs/subsystems/ssh.md +135 -0
  357. package/references/official-docs/docs/subsystems/ssh.zh.md +135 -0
  358. package/references/official-docs/docs/subsystems/storage.zh.md +2 -2
  359. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
  360. package/references/official-docs/docs/subsystems/subagent.md +33 -16
  361. package/references/official-docs/docs/subsystems/subagent.zh.md +32 -15
  362. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
  363. package/references/official-docs/docs/subsystems/subprocess.md +41 -44
  364. package/references/official-docs/docs/subsystems/subprocess.zh.md +41 -44
  365. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
  366. package/references/official-docs/docs/subsystems/system-prompt.md +6 -2
  367. package/references/official-docs/docs/subsystems/system-prompt.zh.md +7 -3
  368. package/references/official-docs/docs/subsystems/todo.zh.md +1 -1
  369. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
  370. package/references/official-docs/docs/subsystems/token-meter.md +2 -1
  371. package/references/official-docs/docs/subsystems/token-meter.zh.md +2 -1
  372. package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
  373. package/references/official-docs/docs/subsystems/tools.md +28 -12
  374. package/references/official-docs/docs/subsystems/tools.zh.md +28 -12
  375. package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
  376. package/references/official-docs/docs/subsystems/typert.md +6 -5
  377. package/references/official-docs/docs/subsystems/typert.zh.md +6 -5
  378. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
  379. package/references/official-docs/docs/subsystems/user-questions.md +2 -0
  380. package/references/official-docs/docs/subsystems/user-questions.zh.md +2 -0
  381. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +2 -2
  382. package/references/official-docs/docs/subsystems/web-client.md +5 -5
  383. package/references/official-docs/docs/subsystems/web-client.zh.md +6 -6
  384. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
  385. package/references/official-docs/docs/subsystems/web-server.md +64 -0
  386. package/references/official-docs/docs/subsystems/web-server.zh.md +65 -1
  387. package/references/official-docs/docs/subsystems/webhook.i18n.yaml +1 -1
  388. package/references/official-docs/docs/subsystems/webhook.md +2 -2
  389. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
  390. package/references/official-docs/docs/subsystems/workflow.md +8 -8
  391. package/references/official-docs/docs/subsystems/workflow.zh.md +10 -10
  392. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
  393. package/references/official-docs/docs/subsystems/workspace.md +199 -1
  394. package/references/official-docs/docs/subsystems/workspace.zh.md +199 -1
  395. package/references/official-docs/docs/testing.i18n.yaml +2 -2
  396. package/references/official-docs/docs/testing.md +5 -4
  397. package/references/official-docs/docs/testing.zh.md +5 -4
  398. package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
  399. package/references/official-docs/docs/tool-catalog.md +452 -187
  400. package/references/official-docs/docs/tool-catalog.zh.md +454 -189
  401. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
  402. package/references/official-docs/docs/tool-execution-pipeline.md +2 -2
  403. package/references/official-docs/docs/tool-execution-pipeline.zh.md +2 -2
  404. package/references/official-docs/docs/user/develop/basic/index.zh.md +1 -1
  405. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
  406. package/references/official-docs/docs/user/develop/basic/publish.md +2 -2
  407. package/references/official-docs/docs/user/develop/basic/publish.zh.md +5 -5
  408. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +2 -2
  409. package/references/official-docs/docs/user/develop/framework/index.md +1 -1
  410. package/references/official-docs/docs/user/develop/framework/index.zh.md +1 -1
  411. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +2 -2
  412. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +8 -8
  413. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +8 -8
  414. package/references/official-docs/docs/user/guide/index.zh.md +2 -2
  415. package/references/official-docs/docs/user/guide/mcp-memory.zh.md +1 -1
  416. package/references/official-docs/docs/user/guide/network-proxy.i18n.yaml +2 -2
  417. package/references/official-docs/docs/user/guide/network-proxy.md +1 -1
  418. package/references/official-docs/docs/user/guide/network-proxy.zh.md +1 -1
  419. package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
  420. package/references/official-docs/docs/user/guide/providers.md +12 -8
  421. package/references/official-docs/docs/user/guide/providers.zh.md +14 -10
  422. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
  423. package/references/official-docs/docs/user/guide/python-sdk.md +59 -23
  424. package/references/official-docs/docs/user/guide/python-sdk.zh.md +60 -24
  425. package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
  426. package/references/official-docs/docs/web-styling.md +2 -1
  427. package/references/official-docs/docs/web-styling.zh.md +3 -2
  428. package/references/official-docs/packages/AGENTS.md +1 -1
  429. package/references/official-docs/packages/README.md +12 -7
  430. package/references/official-docs/vendor/README.md +15 -11
  431. package/references/official-docs/website-docs.ts +4 -2
  432. package/scripts/sync-official-docs.ps1 +5 -5
  433. package/templates/js/README-es.md +1 -1
  434. package/templates/js/README-hi.md +1 -1
  435. package/templates/js/README-pt.md +1 -1
  436. package/templates/js/README-zh.md +1 -1
  437. package/templates/js/README.md +1 -1
  438. package/templates/js/package.json +2 -2
  439. package/templates/ts/README-es.md +1 -1
  440. package/templates/ts/README-hi.md +1 -1
  441. package/templates/ts/README-pt.md +1 -1
  442. package/templates/ts/README-zh.md +1 -1
  443. package/templates/ts/README.md +1 -1
  444. package/templates/ts/package.json +2 -2
  445. package/references/official-docs/docs/subsystems/code-runtime.md +0 -195
  446. package/references/official-docs/docs/subsystems/code-runtime.zh.md +0 -195
@@ -2,13 +2,13 @@
2
2
 
3
3
  [English](permission-presets.md) | 中文
4
4
 
5
- [dsh-permission-presets](../../packages/interaction/permission-presets) 的权限预设层(`ctx.permissionPresets`,`PermissionPresetService`)把两个相互独立的强制执行 knob,即[沙箱模式](sandbox.zh.md)(`sandbox/mode`)与[审批策略](approval.zh.md)(`approval/policy`),捆绑成具名预设,供客户端作为单个权限(Permissions)选择器提供。它是一项可选能力,不属于 agent loop(智能体循环)主干,也不拥有任何强制执行:执行、提示词叙述与回放仍然读取各自 knob的折叠结果,预设切换只记录意图,并通过每个 knob各自的规范 setter 写入。[包 README](../../packages/interaction/permission-presets/README-zh.md) 负责组合状态与限制;[沙箱切换设计](../../.agents/notes/implemented/feature/2026-07-06-sandbox.zh.md)负责决策依据。
5
+ [dsh-permission-presets](../../packages/interaction/permission-presets) 的权限预设层(`ctx.permissionPresets`,`PermissionPresetService`)把两个相互独立的强制执行 knob,即[沙箱模式](sandbox.zh.md)(`sandbox/mode`)与[审批策略](approval.zh.md)(`approval/policy`),捆绑成具名预设,供客户端作为单个 Permissions 选择器提供。配置表拥有未来会话默认值,而固定的 `registerAuto(admit)` 钩子让 [Auto review](../../packages/experimental/auto-review/README.zh.md) integration 在一个 effect 生命周期内发布仅限当前会话的选项。该层是可选能力,且不拥有执行策略:提示词叙述与回放仍读取各自 knob 的折叠结果,额外强制执行由 Auto review 拥有。[包 README](../../packages/interaction/permission-presets/README.zh.md)负责组合状态与限制;[沙箱切换设计](../../.agents/notes/implemented/feature/2026-07-06-sandbox.zh.md)负责原始旋钮依据。
6
6
 
7
7
  源码:[`packages/interaction/permission-presets/src/index.ts`](../../packages/interaction/permission-presets/src/index.ts)
8
8
 
9
9
  ## 预设表
10
10
 
11
- 预设是一个表键,映射到一个沙箱/审批组合,外加可选的客户端展示信息;默认预设表自带 `workspace-write`(`workspace-write` + `ask`)和 `danger-full-access`(`danger-full-access` + `never`)。
11
+ 预设把一个稳定 key 映射到一组沙箱/审批组合,外加可选的客户端展示信息。默认配置表自带 `workspace-write`(`workspace-write` + `ask`)和 `danger-full-access`(`danger-full-access` + `never`);`custom` 与 `auto` 是保留名称,不能配置。
12
12
 
13
13
  ```ts type-equiv
14
14
  /** One preset's sandbox/approval bundle and optional client presentation. */
@@ -30,7 +30,8 @@ interface Config {
30
30
  /**
31
31
  * The preset table: name → knob bundle. Defaults to `workspace-write`
32
32
  * (workspace-write + ask) and `danger-full-access` (danger-full-access +
33
- * never). The name `custom` is reserved for the derived not-a-preset state.
33
+ * never). The names `custom` and `auto` are reserved for derived state and
34
+ * the Auto review integration respectively.
34
35
  */
35
36
  presets?: Record<string, PresetSpec>
36
37
  /**
@@ -41,18 +42,24 @@ interface Config {
41
42
  }
42
43
  ```
43
44
 
44
- 该服务要求一个施加隔离的 `ctx.shell` 执行器和 `ctx.approval`,配置错误在插件加载时即失败:名为 `custom` 的表项会抛出异常(该名称保留给派生的「非预设」状态);在不施加隔离的 bash 执行器(没有 `sandboxMode` 能力事实)之上组合同样抛出异常,因为预设捆绑了一个沙箱模式。
45
+ 该服务要求一个施加隔离的 `ctx.shell` 执行器和 `ctx.approval`,配置错误在插件加载时即失败:名为 `custom` `auto` 的配置条目会抛出异常;在不施加隔离的 bash 执行器(没有 `sandboxMode` 能力事实)之上组合同样抛出异常,因为预设捆绑了一个沙箱模式。
46
+
47
+ ## 固定的当前会话 Auto 注册
48
+
49
+ Auto integration 会在自身 effect 生命周期内调用 `registerAuto(admit)`。本服务固定 `auto` 身份以及 `danger-full-access` 加 `never` 的组合;shipped 客户端的 locale 字典拥有 Auto 的 label 与 description,而配置预设的展示信息仍归 Host 所有。调用方不能通过通用 contribution API 发布其他预设。Auto 排列在配置预设之后,绝不会进入 `permission.defaultPreset` 设置 schema,并在 effect dispose 时消失。同步 `admit` 回调会在 Auto 选择修改 Session 前,以及存储的 Auto Session 发布前运行,因此 integration 缺失或正在关闭时不会改写持久身份。
50
+
51
+ 注册或移除 Auto 会发出无 payload 的 `permission-presets/catalog-changed` 通知。进程级消费方先订阅,再调用 `catalog()`;每次收到通知后重新读取完整的可选目录。`permissions` Session 投影只包含 `currentValue`,因此目录变化不会追加 Session 事件、发布 Session 投影帧或改变 Session 序列。
45
52
 
46
53
  ## 当前预设与派生的 `custom`
47
54
 
48
- `current(session)` 从可选注册的 `permissions` 投影派生实际生效的预设。该单元折叠会话的沙箱模式、审批策略和已记录选择;状态内部的缺失值回退到执行器配置的模式与审批服务配置,最后回退到 `ask`。注册表或投影 key 缺失时会显式失败。服务优先取仍然匹配的选择,其次取声明顺序中第一个匹配的表项,否则返回 `CUSTOM_PRESET`(`'custom'`)。`custom` 只是派生值:客户端可以把它显示为当前值,但它绝不是切换目标,也绝不出现在事件 payload 中。
55
+ `current(session)` 从必需的 `permissions` 投影派生实际生效的预设。该单元折叠会话的沙箱模式、审批策略和已记录选择;状态内部的缺失值回退到执行器配置的模式与审批服务配置,最后回退到 `ask`。投影 key 缺失时会显式失败。服务优先取仍然匹配的选择,其次取第一个匹配的配置条目,否则返回 `CUSTOM_PRESET`(`'custom'`)。`custom` 只是派生值:客户端可以把它显示为当前值,但它绝不是切换目标,也绝不出现在事件 payload 中。
49
56
 
50
- `names` 按预设表声明顺序列出可切换的预设;`optionOf(name)` 为某个表键(label 回退为该键)或 `custom` 构建客户端渲染的选项,传入其他任何名称都会抛出异常。
57
+ `names` 先按声明顺序列出配置预设,再在 Auto integration 存活时列出 Auto。`catalog()` 把这些可选条目作为一份进程级快照返回。`optionOf(name)` 为可用条目(label 回退为该 key)或派生的 `custom` 展示构建选项,传入其他任何名称都会抛出异常。客户端把目录与 Session 投影合并;`custom` 可以标记当前值,但绝不会成为目录条目。
51
58
 
52
59
  ```ts type-equiv
53
- /** The select-option shape a presentation layer advertises for one preset (or for the derived `custom` state). */
60
+ /** Presentation for an available preset or the derived `custom` current value. */
54
61
  interface PresetOption {
55
- /** Stable option value: the table key, or `custom`. */
62
+ /** Stable option value: a configured preset key, live `auto`, or derived `custom`. */
56
63
  value: string
57
64
  /** The display label. */
58
65
  name: string
@@ -63,9 +70,9 @@ interface PresetOption {
63
70
 
64
71
  ## 切换与 `permission/preset` 事件
65
72
 
66
- `set(session, name)` 解析预设(未知名称抛出异常),在 `name` 尚不是生效预设时追加一条仅记日志的 `permission/preset` 事件,然后通过各旋钮自己的 setter([dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) 的 `setSandboxMode` 与 [dsh-user-approval](../../packages/interaction/user-approval) 的 `setApprovalPolicy`)写入,且仅当该 knob的生效值发生变化时才写。同一轮次内,选择事件先于旋钮事件出现;重新选择当前生效的预设则什么都不追加。
73
+ `set(session, name)` 解析预设(未知名称抛出异常),在适用时运行 Auto 准入,在 `name` 尚不是生效预设时追加一条仅记日志的 `permission/preset` 事件,然后通过各旋钮自己的 setter([dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) 的 `setSandboxMode` 与 [dsh-user-approval](../../packages/interaction/user-approval) 的 `setApprovalPolicy`)写入,且仅当该 knob 的生效值发生变化时才写。同一轮次内,选择事件先于旋钮事件出现;重新选择当前生效的预设则什么都不追加。
67
74
 
68
- `permission/preset` 是持久、仅记日志的用户意图:它不进入模型 transcript(文本记录),模型可见的后果由 knob 事件经各自消费方承担;它存在是为了在两个预设共享同一个旋钮组合时,让 `current()` 仍能保住用户选择的究竟是哪一个预设。`permissions` 投影把该选择与两个 knob 事件一同折叠,并保留用于区分空恢复 seed 与新会话的 `session/end-seed` 边界;回放不需要任何追赶状态或原始日志重扫。完整事件声明见[持久化日志事件目录](../persistence-catalog.zh.md);方法签名见生成的[服务目录](#ctxpermissionpresets--permissionpresetservice)。
75
+ `permission/preset` 是持久、仅记日志的用户意图:它不进入模型 transcript(文本记录),模型可见的后果由 knob 事件经各自消费方承担;它存在是为了在两个预设共享同一个旋钮组合时,让 `current()` 仍能保住用户选择的究竟是哪一个预设。`permissions` 投影把该选择与两个 knob 事件一同折叠,并保留用于区分空恢复 seed 与新会话的 `session/end-seed` 边界;回放不需要任何追赶状态或原始日志重扫。恢复的 `auto` 选择在 agent 发布前必须存在 live Auto 注册。完整事件声明见[持久化日志事件目录](../persistence-catalog.zh.md);方法签名见生成的[服务目录](#ctxpermissionpresets--permissionpresetservice)。
69
76
 
70
77
  <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
71
78
 
@@ -79,40 +86,47 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
79
86
 
80
87
  ### `ctx.permissionPresets` — `PermissionPresetService`
81
88
 
82
- Owns the deployment's permission presets and their write path. Requires a confining `ctx.shell` executor and `ctx.approval`; unmatched knob values are reported as CUSTOM_PRESET, not an error.
89
+ Owns the deployment's configured permission presets, the fixed Auto integration hook, and their write path. Requires a confining `ctx.shell` executor and `ctx.approval`; unmatched knob values are reported as CUSTOM_PRESET, not an error.
83
90
 
84
91
  ```ts cordis-catalog
92
+ /**
93
+ * Read the complete process-level catalog exposed to current-session UI.
94
+ * @returns every currently selectable preset in contribution order.
95
+ */
96
+ @Remote('catalog') catalog(): PermissionCatalog
97
+
98
+ /**
99
+ * Publish the fixed current-session Auto preset for the calling
100
+ * integration's effect lifetime.
101
+ * @param admit - synchronous gate run before live Auto selection or restore.
102
+ * @returns the async effect disposer that removes Auto.
103
+ */
104
+ registerAuto(admit: () => void): () => Promise<void>
105
+
85
106
  /**
86
107
  * Resolve the preset matching the effective knob values. A still-matching
87
- * last selection wins shared-bundle ties; otherwise the first table match
88
- * wins, or {@link CUSTOM_PRESET} when no entry matches.
108
+ * last selection wins shared-bundle ties; otherwise the first configured
109
+ * match wins. Returns
110
+ * {@link CUSTOM_PRESET} when no available preset matches.
89
111
  * @param session - the session whose knob state is read.
90
112
  * @returns the effective preset name, or `custom` when nothing matches.
91
113
  */
92
114
  current(session: Session): string
93
115
 
94
116
  /**
95
- * Build the whole select value for one folded knob state: every table
96
- * option in declaration order, `custom` appended exactly while derived.
97
- * @param state - the folded knob overrides.
98
- * @returns the `permissions` projection payload.
99
- */
100
- selectFor(state: KnobState): PermissionSelect
101
-
102
- /**
103
- * Resolve a preset's knob bundle.
117
+ * Resolve an available preset's knob bundle.
104
118
  * @param name - the preset name to resolve.
105
119
  * @returns the configured bundle.
106
- * @throws when `name` is not in the table.
120
+ * @throws when `name` is neither configured nor the currently live Auto preset.
107
121
  */
108
122
  resolve(name: string): PresetSpec
109
123
 
110
124
  /**
111
- * Build the client option for a table entry or {@link CUSTOM_PRESET}. A
112
- * missing label falls back to the table key.
113
- * @param name - a table key, or `custom`.
125
+ * Build the client option for an available preset or {@link CUSTOM_PRESET}.
126
+ * A missing label falls back to the preset key.
127
+ * @param name - a configured preset key, live `auto`, or `custom`.
114
128
  * @returns the option a client renders.
115
- * @throws when `name` is neither a table key nor `custom`.
129
+ * @throws when `name` is neither a configured preset, live `auto`, nor `custom`.
116
130
  */
117
131
  optionOf(name: string): PresetOption
118
132
 
@@ -128,4 +142,25 @@ set(session: Session, name: string): void
128
142
  Types: [Session](session.zh.md)
129
143
 
130
144
  Source: [`packages/interaction/permission-presets/src/index.ts`](../../packages/interaction/permission-presets/src/index.ts)
145
+
146
+ <a id="permission-presets-events"></a>
147
+
148
+ ### `permission-presets/*` events
149
+
150
+ <a id="permission-presetscatalog-changed--emit"></a>
151
+
152
+ #### `permission-presets/catalog-changed` — emit
153
+
154
+ The selectable process catalog changed. Payload-free by design: consumers subscribe first, then re-read the complete catalog.
155
+
156
+ ```ts cordis-catalog
157
+ /**
158
+ * The selectable process catalog changed. Payload-free by design:
159
+ * consumers subscribe first, then re-read the complete catalog.
160
+ * @mode emit
161
+ */
162
+ 'permission-presets/catalog-changed'(): void
163
+ ```
164
+
165
+ Source: [`packages/interaction/permission-presets/src/types.ts`](../../packages/interaction/permission-presets/src/types.ts)
131
166
  <!-- END GENERATED cordis-surface -->
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write docs/subsystems/persistence.md
5
- persistence.md: 7cce80f43591610c1e0667d480971dbd8f3cd4f7
6
- persistence.zh.md: 73169ec2f3a58f06a7355922b0e0f7e4e82944c7
5
+ persistence.md: 7e18e9bbfec8c7aa81525da33ad3cffa4681ea73
6
+ persistence.zh.md: 8250fb93b20dc33c2df705fd2c7092bc8dea155c
@@ -8,7 +8,20 @@ The seam is a [capability seam](../../.agents/notes/implemented/architecture/202
8
8
 
9
9
  ## `SessionHandle` — one open channel onto a stored session
10
10
 
11
- Every log read and write flows through a handle, never through id-addressed service methods: the handle is the single door the cross-process write lease guards. One handle type serves both accesses — a mutation on a `read` handle is a runtime `SessionReadOnlyError` rather than a typed split — and in-process single-writer ownership makes a second `open(id, 'write')` reject with `SessionAlreadyOwnedError` while an owner is active.
11
+ Every log read and write flows through a handle, never through id-addressed service methods: the handle is the single door the cross-process write lease guards. A read returns a caller-owned outer slice and the producer-established aliasing state of its event values. One handle type serves both accesses — a mutation on a `read` handle is a runtime `SessionReadOnlyError` rather than a typed split — and in-process single-writer ownership makes a second `open(id, 'write')` reject with `SessionAlreadyOwnedError` while an owner is active.
12
+
13
+ ```ts type-equiv
14
+ /** One persistence event slice returned by {@link SessionHandle.read}. */
15
+ interface SessionHandleReadResult {
16
+ /**
17
+ * Whether event values are exclusively owned or shared only after deep
18
+ * freezing. Slicing preserves the producer's state even when no events remain.
19
+ */
20
+ readonly eventState: SessionSeedEventState
21
+ /** Event values in a caller-owned outer array. */
22
+ readonly events: readonly SessionEvent[]
23
+ }
24
+ ```
12
25
 
13
26
  ```ts type-equiv
14
27
  /**
@@ -47,9 +60,9 @@ interface SessionHandle extends AsyncDisposable {
47
60
  * @param length - maximum number of events to return; defaults to the rest
48
61
  * of the log. An offset at or past the end returns an empty list.
49
62
  * @param options - optional cancellation.
50
- * @returns the events with `seq >= offset`, at most `length` of them.
63
+ * @returns the caller-owned outer slice plus the ownership state of its event values.
51
64
  */
52
- read(offset?: number, length?: number, options?: SessionHandleReadOptions): Promise<readonly SessionEvent[]>
65
+ read(offset?: number, length?: number, options?: SessionHandleReadOptions): Promise<SessionHandleReadResult>
53
66
 
54
67
  /**
55
68
  * Append a contiguous batch continuing the current logical end. The first
@@ -90,7 +103,7 @@ A created session is observable in this process from the moment `create` resolve
90
103
 
91
104
  ## The flush checkpoint
92
105
 
93
- `session/event` is a *synchronous* notification; the mounted backend routes it by session id into the active write handle's bounded write-behind window without blocking the producer (the backend installs these listeners once, because persistence already enforces one active write handle per id). The first pending event starts a fixed internal batching window, and later events join without resetting its deadline. Expiry starts one durable `append` through the session's write handle; events admitted during that write receive their own deadline and form a follow-up batch. `session/flush` cancels the wait and drains through quiescence, so the loop still uses it as the ordering and error-observation checkpoint before claiming the next ordinary turn. A rejected background write retains its events in order, pauses the automatic path, and is reported through the logger; the next explicit flush retries and rejects loudly to its caller. `session/disposed` performs the same final drain and closes the handle, and `close()` itself drains the routed buffer through the still-open storage, so backend teardown's close sweep loses nothing. The window bounds only intentional batching wait, not event-loop scheduling or backend durability latency ([decision](../../.agents/notes/implemented/architecture/2026-08-08-bounded-session-persistence-write-batching.md)).
106
+ `session/event` is a *synchronous* notification; the mounted backend routes it by session id into the active write handle's bounded write-behind window without blocking the producer (the backend installs these listeners once, because persistence already enforces one active write handle per id). The first pending event starts a fixed internal batching window, and later events join without resetting its deadline. Expiry starts one durable `append` through the session's write handle; events admitted during that write receive their own deadline and form a follow-up batch. `session/flush` cancels the wait and drains through quiescence, so the loop still uses it as the ordering and error-observation checkpoint before claiming the next ordinary turn. A rejected background write retains its events in order, pauses the automatic path, and is reported through the logger; the next explicit flush retries and rejects loudly to its caller. `session/disposed` performs the same final drain and closes the handle, and `close()` itself drains the routed buffer through the still-open storage, so backend teardown's close sweep loses nothing. The window bounds only intentional batching wait, not event-loop scheduling or backend durability latency.
94
107
 
95
108
  ## Crash recovery preserves an interrupted turn
96
109
 
@@ -98,7 +111,7 @@ A log crashed mid-turn ends with an open `turn/start` and no `turn/end`. Persist
98
111
 
99
112
  Repair therefore writes only under write ownership: a live session's write handle is held by its lifecycle owner, so a concurrent `open(id, 'write')` rejects with `SessionAlreadyOwnedError` instead of racing repair against a live turn. Read-only observers (session-query) balance an interrupted cold log with the same closers in memory only, writing nothing back.
100
113
 
101
- Read-only observation is `open(id, 'read')`: the handle serves validated contiguous prefix slices, never a torn tail, and repeated reads on one handle never observe an older state than a prior read. There is no persistence-side prepared-Session cache: session-query owns its cold-read cache, keying one balanced cold Session per id on the `stat().revision` change token and re-reading only when the token changes. The [handle-based persistence Agent Note](../../.agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.md) owns this lifecycle; the [Session preparation decision](../../.agents/notes/implemented/architecture/2026-08-05-session-preparation.md) records the publication-boundary `SessionPreparation` that remains.
114
+ Read-only observation is `open(id, 'read')`: the handle serves validated contiguous prefix slices, never a torn tail, and repeated reads on one handle never observe an older state than a prior read. There is no persistence-side prepared-Session cache: session-query owns its cold-read cache, keying one balanced cold Session per id on the `stat().revision` change token and re-reading only when the token changes. The [handle-based persistence Agent Note](../../.agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.md) owns this lifecycle; the archived [Session preparation record](../../.agents/notes/archived/architecture/2026-08-05-session-preparation.md) documents the original publication-boundary `SessionPreparation` decision.
102
115
 
103
116
  ## `SessionLocation` — refusal-diagnostics artifact target
104
117
 
@@ -173,7 +186,7 @@ interface SessionHeader {
173
186
 
174
187
  ## Format refusal — logs a build cannot faithfully read
175
188
 
176
- A backend refuses a log it cannot faithfully interpret with `SessionFormatUnsupportedError`, distinct from `SessionPersistenceCorruptionError` because nothing is damaged. `stat` and `list` classify the highest canonical generation and translate a supported historical header without reading or mutating its body. `open` runs the build-static adjacent migration chain under per-id serialization before returning a handle, leaves every source path, byte, and inode unchanged, and exclusively publishes only the final current generation. A future highest generation refuses even when an older readable generation remains. Current v2 restoration retains installed extensions and unknown events carrying `ignorable: true`; historical v0/v1 migration refuses an unknown type even when marked ignorable. The message appends the selected raw log path when the backend keeps one artifact per session. The JSONL backend migrates released v0 or v1 to current v2 and refuses a future version before interpreting its version-specific fields or event rows. An out-of-tree backend must enforce equivalent current-only handle values and direction-aware refusals at its physical-format entry. The [released-format migration decision](../../.agents/notes/implemented/architecture/2026-08-31-released-session-format-migrations.md) owns the chain and immutable-publication rules.
189
+ A backend refuses a log it cannot faithfully interpret with `SessionFormatUnsupportedError`, distinct from `SessionPersistenceCorruptionError` because nothing is damaged. `stat` and `list` classify the highest canonical generation and translate a supported historical header without reading or mutating its body. Historical `open` calls share one per-session migration preparation before returning current logical values and leave every source path, byte, and inode unchanged. The JSONL provider returns a read handle from that in-memory result without publishing; a write open holds its single-writer claim and file lease while it reuses the preparation, exclusively publishes the final current generation, and only then returns the writable handle. A future highest generation refuses even when an older readable generation remains. Current-format restoration retains installed extensions and unknown events carrying `ignorable: true`; historical v0/v1/v2 migration refuses an unknown type even when marked ignorable. The message appends the selected raw log path when the backend keeps one artifact per session. An out-of-tree backend must enforce equivalent current-only handle values and direction-aware refusals at its physical-format entry. The [released-format migration decision](../../.agents/notes/implemented/architecture/2026-08-31-released-session-format-migrations.md) owns the chain and immutable-publication rules.
177
190
 
178
191
  ## `CreateSessionOptions` — seeding and metadata
179
192
 
@@ -189,7 +202,7 @@ interface CreateSessionOptions {
189
202
  /** Initial replay or fork history supplied at construction. */
190
203
  readonly seed?: readonly SessionEvent[]
191
204
  /**
192
- * Exact fork-inherited prefix length when `meta.isSeeded` is true. In v2 the
205
+ * Exact fork-inherited prefix length when `meta.isSeeded` is true. The
193
206
  * constructor seed is exactly this inherited prefix; the constructor
194
207
  * appends the child-owned tagged marker at the cut.
195
208
  */
@@ -214,29 +227,37 @@ Replay/fork is therefore `ctx.agents.create({ sessionId, seed, meta })` — a fo
214
227
 
215
228
  ## Preparation and restoration ownership
216
229
 
217
- `SessionStore.prepare()` accepts ordinary creation options or fresh persistence graphs transferred through `RestoredSessionOptions`. The restoration branch validates and freezes the transferred header and events in place, so callers must retain no mutable aliases. `SessionPreparation` then owns the exact unpublished Session until publication or rollback; disposal is synchronous and idempotent. agent-loop's resume builds these graphs by reading the stored log through the session's write handle and appending any needed `interruptedTurnClosers` before preparation.
230
+ `SessionStore.prepare()` accepts ordinary creation options or an adoptable seed through `RestoredSessionOptions`. Its `eventState` says whether event values are independently owned or shared only after deep freezing; the producer establishes that state, and slicing does not infer a different state from result length. Restoration validates and adopts those values without another copy or freeze pass. `SessionPreparation` then owns the exact unpublished Session until publication or rollback; disposal is synchronous and idempotent. agent-loop's resume reads this result through the session's write handle and appends independently owned `interruptedTurnClosers` before preparation.
231
+
232
+ ```ts type-equiv
233
+ /**
234
+ * Aliasing state of an adoptable Session seed. `shared-frozen` permits deeply
235
+ * frozen aliases plus independently owned unfrozen values in the same seed.
236
+ */
237
+ type SessionSeedEventState = 'detached' | 'shared-frozen'
238
+ ```
218
239
 
219
240
  ```ts type-equiv
220
241
  /**
221
- * Fresh storage values transferred to {@link SessionStore.prepare} without a
222
- * second serialization copy. Callers retain no mutable aliases.
242
+ * Adoptable storage values transferred to {@link SessionStore.prepare}
243
+ * without another copy or freeze pass.
223
244
  */
224
245
  interface RestoredSessionOptions {
225
- /** Fresh detached storage events to validate and freeze in place. */
246
+ /** Events that are independently owned or already deeply frozen. */
226
247
  readonly seed: SessionEvent[]
227
- /** Fresh detached storage metadata to validate and freeze in place. */
248
+ /** Independently owned storage metadata to validate and freeze in place. */
228
249
  readonly meta: SessionHeader
229
250
  /** Exact number of fork-inherited leading events decoded from storage. */
230
251
  readonly inheritedEventCount: SessionLogOffset
231
- /** Select the persistence ownership-transfer path. */
232
- readonly seedSource: 'persistence'
252
+ /** Aliasing state carried from the operation that produced the seed. */
253
+ readonly eventState: SessionSeedEventState
233
254
  }
234
255
  ```
235
256
 
236
257
  ```ts type-equiv
237
258
  /** Inputs accepted while constructing an unpublished Session. */
238
259
  type PrepareSessionOptions =
239
- | (CreateSessionOptions & { readonly seedSource?: undefined })
260
+ | (CreateSessionOptions & { readonly eventState?: undefined })
240
261
  | RestoredSessionOptions
241
262
  ```
242
263
 
@@ -8,7 +8,20 @@
8
8
 
9
9
  ## `SessionHandle`——通向已存储会话的一条打开通道
10
10
 
11
- 每一次日志读写都经由句柄流动,绝不经由按 id 寻址的服务方法:句柄是跨进程写租约把守的那扇唯一的门。一种句柄类型同时服务两种访问——在 `read` 句柄上执行修改是运行时的 `SessionReadOnlyError`,而非类型层面的拆分——而进程内单写者所有权使得在已有活跃持有者时第二次 `open(id, 'write')` 以 `SessionAlreadyOwnedError` 拒绝。
11
+ 每一次日志读写都经由句柄流动,绝不经由按 id 寻址的服务方法:句柄是跨进程写租约把守的唯一入口。读取会返回调用方独占的外层 slice,以及由生产者建立的 event value 别名状态。一种句柄类型同时服务两种访问——在 `read` 句柄上执行修改是运行时的 `SessionReadOnlyError`,而非类型层面的拆分——而进程内单写者所有权使得在已有活跃持有者时第二次 `open(id, 'write')` 以 `SessionAlreadyOwnedError` 拒绝。
12
+
13
+ ```ts type-equiv
14
+ /** One persistence event slice returned by {@link SessionHandle.read}. */
15
+ interface SessionHandleReadResult {
16
+ /**
17
+ * Whether event values are exclusively owned or shared only after deep
18
+ * freezing. Slicing preserves the producer's state even when no events remain.
19
+ */
20
+ readonly eventState: SessionSeedEventState
21
+ /** Event values in a caller-owned outer array. */
22
+ readonly events: readonly SessionEvent[]
23
+ }
24
+ ```
12
25
 
13
26
  ```ts type-equiv
14
27
  /**
@@ -47,9 +60,9 @@ interface SessionHandle extends AsyncDisposable {
47
60
  * @param length - maximum number of events to return; defaults to the rest
48
61
  * of the log. An offset at or past the end returns an empty list.
49
62
  * @param options - optional cancellation.
50
- * @returns the events with `seq >= offset`, at most `length` of them.
63
+ * @returns the caller-owned outer slice plus the ownership state of its event values.
51
64
  */
52
- read(offset?: number, length?: number, options?: SessionHandleReadOptions): Promise<readonly SessionEvent[]>
65
+ read(offset?: number, length?: number, options?: SessionHandleReadOptions): Promise<SessionHandleReadResult>
53
66
 
54
67
  /**
55
68
  * Append a contiguous batch continuing the current logical end. The first
@@ -90,7 +103,7 @@ interface SessionHandle extends AsyncDisposable {
90
103
 
91
104
  ## flush 检查点
92
105
 
93
- `session/event` 是一个*同步*通知;挂载的后端按会话 id 把它路由进活跃写句柄的有界 write-behind 窗口,而不阻塞生产方(后端一次性安装这些监听器,因为持久化已保证每个 id 只有一个活跃写句柄)。第一个待处理事件会开启固定的内部批处理窗口,后续事件会加入但不会重置其截止时间。窗口到期后会通过该会话的写句柄启动一次持久化 `append`;该次写入期间接纳的事件会获得自己的截止时间,并形成后续批次。`session/flush` 会取消等待并排空至完全停稳,因此循环仍将其用作在领取下一个普通轮次之前的顺序与错误观察检查点。后台写入被拒绝时会按序保留对应事件、暂停自动路径,并通过 logger 报告;下一次显式 flush 会重试,并向其调用方响亮地拒绝。`session/disposed` 会执行同样的最终排空并关闭句柄,而 `close()` 本身会经由仍然打开的存储排空已路由的缓冲,因此后端 teardown 的关闭清扫不丢任何数据。该窗口只限制有意的批处理等待,不限制事件循环调度或后端完成持久化的延迟([决策](../../.agents/notes/implemented/architecture/2026-08-08-bounded-session-persistence-write-batching.zh.md))。
106
+ `session/event` 是一个*同步*通知;挂载的后端按会话 id 把它路由进活跃写句柄的有界 write-behind 窗口,而不阻塞生产方(后端一次性安装这些监听器,因为持久化已保证每个 id 只有一个活跃写句柄)。第一个待处理事件会开启固定的内部批处理窗口,后续事件会加入但不会重置其截止时间。窗口到期后会通过该会话的写句柄启动一次持久化 `append`;该次写入期间接纳的事件会获得自己的截止时间,并形成后续批次。`session/flush` 会取消等待并排空至完全停稳,因此循环仍将其用作在领取下一个普通轮次之前的顺序与错误观察检查点。后台写入被拒绝时会按序保留对应事件、暂停自动路径,并通过 logger 报告;下一次显式 flush 会重试,并向其调用方响亮地拒绝。`session/disposed` 会执行同样的最终排空并关闭句柄,而 `close()` 本身会经由仍然打开的存储排空已路由的缓冲,因此后端 teardown 的关闭清扫不丢任何数据。该窗口只限制有意的批处理等待,不限制事件循环调度或后端完成持久化的延迟。
94
107
 
95
108
  ## 崩溃恢复保留被中断的轮次
96
109
 
@@ -98,7 +111,7 @@ interface SessionHandle extends AsyncDisposable {
98
111
 
99
112
  因此修复只在写所有权之下写入:活跃会话的写句柄由其生命周期所有者持有,故并发的 `open(id, 'write')` 会以 `SessionAlreadyOwnedError` 拒绝,而不是让修复与活跃轮次竞速。只读观察方(session-query)仅在内存中用同样的闭合事件配平被中断的冷日志,不回写任何内容。
100
113
 
101
- 只读观察即 `open(id, 'read')`:句柄提供经过验证的连续前缀切片,绝不返回撕裂尾部,且同一句柄上的重复读取绝不会观察到比先前读取更旧的状态。持久化侧不存在已准备 Session 缓存:session-query 拥有自己的冷读缓存,按 `stat().revision` 变更令牌为每个 id 缓存一个已配平的冷 Session,仅在令牌变化时重新读取。该生命周期由[基于句柄的持久化 Agent Note](../../.agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.zh.md)定义;[Session 准备阶段决策](../../.agents/notes/implemented/architecture/2026-08-05-session-preparation.zh.md)记录仍然保留的发布边界 `SessionPreparation`。
114
+ 只读观察即 `open(id, 'read')`:句柄提供经过验证的连续前缀切片,绝不返回撕裂尾部,且同一句柄上的重复读取绝不会观察到比先前读取更旧的状态。持久化侧不存在已准备 Session 缓存:session-query 拥有自己的冷读缓存,按 `stat().revision` 变更令牌为每个 id 缓存一个已配平的冷 Session,仅在令牌变化时重新读取。该生命周期由[基于句柄的持久化 Agent Note](../../.agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.zh.md)定义;已归档的 [Session 准备阶段记录](../../.agents/notes/archived/architecture/2026-08-05-session-preparation.md)记载了发布边界 `SessionPreparation` 最初的决策。
102
115
 
103
116
  ## `SessionLocation`——拒绝诊断的产物目标
104
117
 
@@ -173,7 +186,7 @@ interface SessionHeader {
173
186
 
174
187
  ## 格式拒绝:本构建无法可靠读取的日志
175
188
 
176
- 后端用 `SessionFormatUnsupportedError` 拒绝无法可靠解读的日志,它与 `SessionPersistenceCorruptionError` 区分,因为数据没有损坏。`stat` 与 `list` 会对最高规范 generation 分类,并在不读取或改变正文的前提下转换受支持的历史 header。`open` 会在按 id 串行化的区段内运行构建时静态确定的相邻迁移链,再返回句柄;每个源路径、字节与 inode 都保持不变,并且只排他发布最终的当前 generation。即使仍有较旧的可读 generation,最高的未来 generation 仍会导致拒绝。当前 v2 恢复会保留已安装扩展和带 `ignorable: true` 的未知事件;历史 v0/v1 迁移则会拒绝未知类型,即使它带有 ignorable 标记。后端为每个会话保留独立文件时,消息附上选定的原始日志路径。JSONL 后端把已发布 v0 或 v1 迁移到当前 v2,并在解读其版本专属字段或事件行前拒绝未来版本。仓库外后端必须在自己的物理格式入口提供等价的仅当前句柄值与方向感知拒绝。[已发布格式迁移决策](../../.agents/notes/implemented/architecture/2026-08-31-released-session-format-migrations.zh.md)负责迁移链与不可变发布规则。
189
+ 后端用 `SessionFormatUnsupportedError` 拒绝无法可靠解读的日志,它与 `SessionPersistenceCorruptionError` 区分,因为数据没有损坏。`stat` 与 `list` 会对最高规范 generation 分类,并在不读取或改变正文的前提下转换受支持的历史 header。历史 `open` 会共享每个 Session 唯一的一次 migration preparation,再返回当前逻辑值,并保持每个源路径、字节与 inode 不变。JSONL provider 直接从该内存结果返回读句柄而不发布;写 open 则在持有单写者 claim 与文件 lease 时复用 preparation、排他发布最终 current generation,随后才返回可写句柄。即使仍有较旧的可读 generation,最高的未来 generation 仍会导致拒绝。当前格式恢复会保留已安装扩展和带 `ignorable: true` 的未知事件;历史 v0/v1/v2 迁移则会拒绝未知类型,即使它带有 ignorable 标记。后端为每个会话保留独立文件时,消息附上选定的原始日志路径。仓库外后端必须在自己的物理格式入口提供等价的仅当前句柄值与方向感知拒绝。[已发布格式迁移决策](../../.agents/notes/implemented/architecture/2026-08-31-released-session-format-migrations.zh.md)负责迁移链与不可变发布规则。
177
190
 
178
191
  ## `CreateSessionOptions`:seed 与元数据
179
192
 
@@ -189,7 +202,7 @@ interface CreateSessionOptions {
189
202
  /** Initial replay or fork history supplied at construction. */
190
203
  readonly seed?: readonly SessionEvent[]
191
204
  /**
192
- * Exact fork-inherited prefix length when `meta.isSeeded` is true. In v2 the
205
+ * Exact fork-inherited prefix length when `meta.isSeeded` is true. The
193
206
  * constructor seed is exactly this inherited prefix; the constructor
194
207
  * appends the child-owned tagged marker at the cut.
195
208
  */
@@ -214,29 +227,37 @@ interface CreateSessionOptions {
214
227
 
215
228
  ## 准备与恢复所有权
216
229
 
217
- `SessionStore.prepare()` 接收普通创建选项,或通过 `RestoredSessionOptions` 转移所有权的全新的持久化对象图。恢复分支会就地验证并冻结转移来的 header 与事件,因此调用方不得保留可变别名。`SessionPreparation` 随后持有该精确的未发布 Session,直至发布或回滚;dispose 是同步且幂等的。agent-loop 的 resume 通过该会话的写句柄读取已存储的日志,并在准备之前追加所需的 `interruptedTurnClosers`,以此构建这些对象图。
230
+ `SessionStore.prepare()` 接收普通创建选项,或通过 `RestoredSessionOptions` 接收可直接接管的 seed。它的 `eventState` 表明 event value 是独占对象,还是只有深度冻结后的共享对象;生产者负责建立该状态,slice 不会根据结果长度推断其他状态。恢复流程会校验并直接接管这些值,不再复制或冻结。`SessionPreparation` 随后持有该精确的未发布 Session,直至发布或回滚;dispose 是同步且幂等的。agent-loop 的 resume 通过该会话的写句柄读取这份结果,并在准备之前追加独占的 `interruptedTurnClosers`。
231
+
232
+ ```ts type-equiv
233
+ /**
234
+ * Aliasing state of an adoptable Session seed. `shared-frozen` permits deeply
235
+ * frozen aliases plus independently owned unfrozen values in the same seed.
236
+ */
237
+ type SessionSeedEventState = 'detached' | 'shared-frozen'
238
+ ```
218
239
 
219
240
  ```ts type-equiv
220
241
  /**
221
- * Fresh storage values transferred to {@link SessionStore.prepare} without a
222
- * second serialization copy. Callers retain no mutable aliases.
242
+ * Adoptable storage values transferred to {@link SessionStore.prepare}
243
+ * without another copy or freeze pass.
223
244
  */
224
245
  interface RestoredSessionOptions {
225
- /** Fresh detached storage events to validate and freeze in place. */
246
+ /** Events that are independently owned or already deeply frozen. */
226
247
  readonly seed: SessionEvent[]
227
- /** Fresh detached storage metadata to validate and freeze in place. */
248
+ /** Independently owned storage metadata to validate and freeze in place. */
228
249
  readonly meta: SessionHeader
229
250
  /** Exact number of fork-inherited leading events decoded from storage. */
230
251
  readonly inheritedEventCount: SessionLogOffset
231
- /** Select the persistence ownership-transfer path. */
232
- readonly seedSource: 'persistence'
252
+ /** Aliasing state carried from the operation that produced the seed. */
253
+ readonly eventState: SessionSeedEventState
233
254
  }
234
255
  ```
235
256
 
236
257
  ```ts type-equiv
237
258
  /** Inputs accepted while constructing an unpublished Session. */
238
259
  type PrepareSessionOptions =
239
- | (CreateSessionOptions & { readonly seedSource?: undefined })
260
+ | (CreateSessionOptions & { readonly eventState?: undefined })
240
261
  | RestoredSessionOptions
241
262
  ```
242
263
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](plan.md) | 中文
4
4
 
5
- 计划模式是 [dsh-plan-mode](../../packages/plan/plan-mode) 拥有的、记录到日志的逐 agent(智能体)协作状态(`ctx.planMode`,`PlanModeController`):激活期间,每个模型请求都会包含一段部署持有的指引。计划模式是**软性指引**。[沙箱模式](sandbox.zh.md)与[审批策略](approval.zh.md)分别强制限制;两者都不读写计划状态,因此部署需要分别配置它们。该包是可选项,agent loop(智能体循环)不依赖它。它贡献 `plan:policy` 提示词段落,并注册 `exit_plan_mode` 工具和 `/plan` 命令。[设计说明](../../.agents/notes/implemented/simplification/2026-07-22-plan-specific-collaboration-state.zh.md)负责决策依据;[包 README](../../packages/plan/plan-mode/README-zh.md)负责模型体验与限制细节。
5
+ 计划模式是 [dsh-plan-mode](../../packages/plan/plan-mode) 拥有的、记录到日志的逐 agent(智能体)协作状态(`ctx.planMode`,`PlanModeController`):激活期间,每个模型请求都会包含一段部署持有的指引。计划模式是**软性指引**。[沙箱模式](sandbox.zh.md)与[审批策略](approval.zh.md)分别强制限制;两者都不读写计划状态,因此部署需要分别配置它们。该包是可选项,agent loop(智能体循环)不依赖它。它贡献 `plan:policy` 提示词段落,并注册 `exit_plan_mode` 工具和 `/plan` 命令。[设计说明](../../.agents/notes/implemented/simplification/2026-07-22-plan-specific-collaboration-state.zh.md)负责决策依据;[包 README](../../packages/plan/plan-mode/README.zh.md)负责模型体验与限制细节。
6
6
 
7
7
  源码:[`packages/plan/plan-mode/src/index.ts`](../../packages/plan/plan-mode/src/index.ts)
8
8
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  由于每个会话事件都位于轮次之内,用户选择会保持待生效状态,直到下一个被接受的轮内 pre-step 在派生请求之前追加该选择,无论该 pre-step 位于哪个轮次。选择不会强制续行,因此在某轮最后一个被接受的 pre-step 之后作出的选择会在之后的轮次追加。`set(agent, active)` 记录待生效选择(目标值与已记录或已在等待的状态相同时不做任何事),`get(agent)` 返回 `{ active: boolean; pending?: boolean }`:用于组装当前步骤的已记录状态,以及等待追加的已选状态。
16
16
 
17
- agent 运行时,唯一的追加点是前置(prepend)注册的 `agent/pre-step` 监听器。它会观察每个候选请求步骤,包括第 1 轮第 1 步和请求恢复重试;它先调用下游监听器,只在下游接受该步骤后追加。提示词准入发生在轮次开启之前,无法追加 `plan/mode`,因此在提示词处作出的选择由它开启的轮次内第一个被接受的 pre-step 追加。追加失败不能阻塞轮次,且该选择会继续等待之后被接受的轮内 pre-step。追加用户选择时还会记录一条插件来源的 `user/message` 通知,但仅当最后记录的请求头描述的是另一种状态时才记录,因此模型恰好在上下文变化时收到通知,且绝不重复。在某轮最后一个被接受的 pre-step 之后作出的选择只存在于进程内;如果进程在另一个被接受的轮内 pre-step 之前退出,该选择会丢失([README 限制](../../packages/plan/plan-mode/README-zh.md#known-limitations-and-deferred-work))。
17
+ agent 运行时,唯一的追加点是前置(prepend)注册的 `agent/pre-step` 监听器。它会观察每个候选请求步骤,包括第 1 轮第 1 步和请求恢复重试;它先调用下游监听器,只在下游接受该步骤后追加。提示词准入发生在轮次开启之前,无法追加 `plan/mode`,因此在提示词处作出的选择由它开启的轮次内第一个被接受的 pre-step 追加。追加失败不能阻塞轮次,且该选择会继续等待之后被接受的轮内 pre-step。追加用户选择时还会记录一条插件来源的 `user/message` 通知,但仅当最后记录的请求头描述的是另一种状态时才记录,因此模型恰好在上下文变化时收到通知,且绝不重复。在某轮最后一个被接受的 pre-step 之后作出的选择只存在于进程内;如果进程在另一个被接受的轮内 pre-step 之前退出,该选择会丢失([README 限制](../../packages/plan/plan-mode/README.zh.md#known-limitations-and-deferred-work))。
18
18
 
19
19
  ## 配置
20
20
 
@@ -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/ptc-runtime.md
5
+ ptc-runtime.md: efab5bcefa0aaec50c29c73f981f6a6b717cd087
6
+ ptc-runtime.zh.md: f35c5bd84d79ddaccc40653707d792f5672e73d9