dsh-plugin-guide 0.3.15 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/package.json +1 -1
  2. package/references/official-docs/AGENTS.md +74 -49
  3. package/references/official-docs/README.i18n.yaml +2 -2
  4. package/references/official-docs/README.zh.md +12 -0
  5. package/references/official-docs/SNAPSHOT.md +4 -4
  6. package/references/official-docs/THIRD_PARTY_NOTICES.md +86 -30
  7. package/references/official-docs/docs/AGENTS.md +7 -6
  8. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
  9. package/references/official-docs/docs/agent-lifecycle.md +12 -5
  10. package/references/official-docs/docs/agent-lifecycle.zh.md +12 -5
  11. package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
  12. package/references/official-docs/docs/api-gateway.md +2 -2
  13. package/references/official-docs/docs/api-gateway.zh.md +2 -2
  14. package/references/official-docs/docs/architecture.i18n.yaml +2 -2
  15. package/references/official-docs/docs/architecture.md +26 -12
  16. package/references/official-docs/docs/architecture.zh.md +28 -14
  17. package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
  18. package/references/official-docs/docs/capability-seams.md +111 -31
  19. package/references/official-docs/docs/capability-seams.zh.md +111 -31
  20. package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
  21. package/references/official-docs/docs/config-catalog.md +674 -202
  22. package/references/official-docs/docs/config-catalog.zh.md +691 -219
  23. package/references/official-docs/docs/cookbook/adding-a-session-format-version.i18n.yaml +6 -0
  24. package/references/official-docs/docs/cookbook/adding-a-session-format-version.md +111 -0
  25. package/references/official-docs/docs/cookbook/adding-a-session-format-version.zh.md +111 -0
  26. package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +1 -1
  27. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
  28. package/references/official-docs/docs/cookbook/adding-a-tool.md +2 -2
  29. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +4 -4
  30. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
  31. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +1 -1
  32. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +1 -1
  33. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +1 -1
  34. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
  35. package/references/official-docs/docs/cookbook/extension-cookbook.md +3 -3
  36. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +5 -5
  37. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +2 -2
  38. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +1 -1
  39. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  40. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.i18n.yaml +6 -0
  41. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.md +108 -0
  42. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.zh.md +108 -0
  43. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +2 -2
  44. package/references/official-docs/docs/cordis-api/fiber.md +3 -3
  45. package/references/official-docs/docs/cordis-api/fiber.zh.md +3 -3
  46. package/references/official-docs/docs/cordis-api/inherited.md +0 -3
  47. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +2 -2
  48. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +2 -2
  49. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +2 -2
  50. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +2 -2
  51. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +14 -15
  52. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +15 -16
  53. package/references/official-docs/docs/dependency-catalog.json +7312 -0
  54. package/references/official-docs/docs/development.i18n.yaml +2 -2
  55. package/references/official-docs/docs/development.md +13 -3
  56. package/references/official-docs/docs/development.zh.md +16 -6
  57. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
  58. package/references/official-docs/docs/event-producer-consumer.md +50 -39
  59. package/references/official-docs/docs/event-producer-consumer.zh.md +55 -44
  60. package/references/official-docs/docs/glossary.i18n.yaml +2 -2
  61. package/references/official-docs/docs/glossary.md +1 -1
  62. package/references/official-docs/docs/glossary.zh.md +1 -1
  63. package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
  64. package/references/official-docs/docs/i18n/README.md +8 -3
  65. package/references/official-docs/docs/i18n/README.zh.md +8 -3
  66. package/references/official-docs/docs/i18n/style-samples.md +1 -1
  67. package/references/official-docs/docs/i18n/translation-prompt.md +5 -5
  68. package/references/official-docs/docs/i18n/translation-rules.zh.md +2 -2
  69. package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
  70. package/references/official-docs/docs/module-graph.md +303 -120
  71. package/references/official-docs/docs/module-graph.zh.md +303 -120
  72. package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
  73. package/references/official-docs/docs/persistence-catalog.md +5699 -64
  74. package/references/official-docs/docs/persistence-catalog.zh.md +5708 -73
  75. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.i18n.yaml +6 -0
  76. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.md +280 -0
  77. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.schema.json +13557 -0
  78. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.zh.md +280 -0
  79. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.i18n.yaml +6 -0
  80. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
  81. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.schema.json +910 -0
  82. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
  83. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.i18n.yaml +6 -0
  84. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.md +96 -0
  85. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.schema.json +8478 -0
  86. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
  87. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.i18n.yaml +6 -0
  88. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
  89. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.schema.json +72 -0
  90. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
  91. package/references/official-docs/docs/persistence-changes/README.i18n.yaml +6 -0
  92. package/references/official-docs/docs/persistence-changes/README.md +74 -0
  93. package/references/official-docs/docs/persistence-changes/README.zh.md +74 -0
  94. package/references/official-docs/docs/persistence-changes/historical-formats/README.i18n.yaml +6 -0
  95. package/references/official-docs/docs/persistence-changes/historical-formats/README.md +74 -0
  96. package/references/official-docs/docs/persistence-changes/historical-formats/README.zh.md +74 -0
  97. package/references/official-docs/docs/persistence-changes/historical-formats/v0.i18n.yaml +6 -0
  98. package/references/official-docs/docs/persistence-changes/historical-formats/v0.md +5105 -0
  99. package/references/official-docs/docs/persistence-changes/historical-formats/v0.schema.json +49308 -0
  100. package/references/official-docs/docs/persistence-changes/historical-formats/v0.zh.md +5105 -0
  101. package/references/official-docs/docs/persistence-changes/historical-formats/v1.i18n.yaml +6 -0
  102. package/references/official-docs/docs/persistence-changes/historical-formats/v1.md +5107 -0
  103. package/references/official-docs/docs/persistence-changes/historical-formats/v1.schema.json +49411 -0
  104. package/references/official-docs/docs/persistence-changes/historical-formats/v1.zh.md +5107 -0
  105. package/references/official-docs/docs/persistence-changes/historical-formats/v2.i18n.yaml +6 -0
  106. package/references/official-docs/docs/persistence-changes/historical-formats/v2.md +5362 -0
  107. package/references/official-docs/docs/persistence-changes/historical-formats/v2.schema.json +56466 -0
  108. package/references/official-docs/docs/persistence-changes/historical-formats/v2.zh.md +5362 -0
  109. package/references/official-docs/docs/persistence-changes/releases/README.i18n.yaml +6 -0
  110. package/references/official-docs/docs/persistence-changes/releases/README.md +103 -0
  111. package/references/official-docs/docs/persistence-changes/releases/README.zh.md +103 -0
  112. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.i18n.yaml +6 -0
  113. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
  114. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.schema.json +39868 -0
  115. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
  116. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.i18n.yaml +6 -0
  117. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
  118. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.schema.json +43342 -0
  119. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
  120. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.i18n.yaml +6 -0
  121. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
  122. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.schema.json +19452 -0
  123. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
  124. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.i18n.yaml +6 -0
  125. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
  126. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.schema.json +5 -0
  127. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
  128. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.i18n.yaml +6 -0
  129. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
  130. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.schema.json +5 -0
  131. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
  132. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.i18n.yaml +6 -0
  133. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
  134. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.schema.json +5 -0
  135. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
  136. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.i18n.yaml +6 -0
  137. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
  138. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.schema.json +5 -0
  139. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
  140. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.i18n.yaml +6 -0
  141. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
  142. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.schema.json +5 -0
  143. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
  144. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.i18n.yaml +6 -0
  145. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
  146. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.schema.json +5 -0
  147. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
  148. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.i18n.yaml +6 -0
  149. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
  150. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.schema.json +5 -0
  151. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
  152. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.i18n.yaml +6 -0
  153. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
  154. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.schema.json +5320 -0
  155. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
  156. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.i18n.yaml +6 -0
  157. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
  158. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.schema.json +21258 -0
  159. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
  160. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.i18n.yaml +6 -0
  161. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
  162. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.schema.json +417 -0
  163. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
  164. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.i18n.yaml +6 -0
  165. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
  166. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.schema.json +29672 -0
  167. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
  168. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.i18n.yaml +6 -0
  169. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
  170. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.schema.json +48429 -0
  171. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
  172. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.i18n.yaml +6 -0
  173. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
  174. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.schema.json +49347 -0
  175. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
  176. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.i18n.yaml +6 -0
  177. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
  178. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.schema.json +5 -0
  179. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
  180. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.i18n.yaml +6 -0
  181. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
  182. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.schema.json +17642 -0
  183. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
  184. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.i18n.yaml +6 -0
  185. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
  186. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.schema.json +5 -0
  187. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
  188. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.i18n.yaml +6 -0
  189. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
  190. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.schema.json +5 -0
  191. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
  192. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.i18n.yaml +6 -0
  193. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
  194. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.schema.json +38678 -0
  195. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
  196. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.i18n.yaml +6 -0
  197. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
  198. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.schema.json +783 -0
  199. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
  200. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.i18n.yaml +6 -0
  201. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
  202. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.schema.json +24597 -0
  203. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
  204. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.i18n.yaml +6 -0
  205. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
  206. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.schema.json +2132 -0
  207. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
  208. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.i18n.yaml +6 -0
  209. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
  210. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.schema.json +5 -0
  211. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
  212. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.i18n.yaml +6 -0
  213. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
  214. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.schema.json +5 -0
  215. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
  216. package/references/official-docs/docs/persistence-changes/releases/manifest.json +162 -0
  217. package/references/official-docs/docs/persistence-schema.json +61480 -0
  218. package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
  219. package/references/official-docs/docs/postmortem/README.md +1 -1
  220. package/references/official-docs/docs/postmortem/README.zh.md +1 -1
  221. package/references/official-docs/docs/rescope.i18n.yaml +2 -2
  222. package/references/official-docs/docs/rescope.md +2 -2
  223. package/references/official-docs/docs/rescope.zh.md +2 -2
  224. package/references/official-docs/docs/session-format-status.i18n.yaml +6 -0
  225. package/references/official-docs/docs/session-format-status.md +49 -0
  226. package/references/official-docs/docs/session-format-status.zh.md +49 -0
  227. package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
  228. package/references/official-docs/docs/subsystems/README.md +12 -3
  229. package/references/official-docs/docs/subsystems/README.zh.md +23 -14
  230. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +2 -2
  231. package/references/official-docs/docs/subsystems/agent-team.md +1 -1
  232. package/references/official-docs/docs/subsystems/agent-team.zh.md +2 -2
  233. package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
  234. package/references/official-docs/docs/subsystems/approval.md +1 -1
  235. package/references/official-docs/docs/subsystems/approval.zh.md +1 -1
  236. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
  237. package/references/official-docs/docs/subsystems/attachment.md +17 -7
  238. package/references/official-docs/docs/subsystems/attachment.zh.md +17 -7
  239. package/references/official-docs/docs/subsystems/{code-runtime.i18n.yaml → boot.i18n.yaml} +3 -3
  240. package/references/official-docs/docs/subsystems/boot.md +223 -0
  241. package/references/official-docs/docs/subsystems/boot.zh.md +223 -0
  242. package/references/official-docs/docs/subsystems/browser-use.i18n.yaml +6 -0
  243. package/references/official-docs/docs/subsystems/browser-use.md +67 -0
  244. package/references/official-docs/docs/subsystems/browser-use.zh.md +67 -0
  245. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
  246. package/references/official-docs/docs/subsystems/client-modules.md +20 -10
  247. package/references/official-docs/docs/subsystems/client-modules.zh.md +21 -11
  248. package/references/official-docs/docs/subsystems/client-resources.i18n.yaml +6 -0
  249. package/references/official-docs/docs/subsystems/client-resources.md +92 -0
  250. package/references/official-docs/docs/subsystems/client-resources.zh.md +92 -0
  251. package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
  252. package/references/official-docs/docs/subsystems/commands.md +4 -0
  253. package/references/official-docs/docs/subsystems/commands.zh.md +5 -1
  254. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
  255. package/references/official-docs/docs/subsystems/compaction.md +48 -2
  256. package/references/official-docs/docs/subsystems/compaction.zh.md +50 -4
  257. package/references/official-docs/docs/subsystems/computer-use.i18n.yaml +6 -0
  258. package/references/official-docs/docs/subsystems/computer-use.md +56 -0
  259. package/references/official-docs/docs/subsystems/computer-use.zh.md +56 -0
  260. package/references/official-docs/docs/subsystems/conversation.zh.md +1 -1
  261. package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
  262. package/references/official-docs/docs/subsystems/core.md +106 -60
  263. package/references/official-docs/docs/subsystems/core.zh.md +109 -63
  264. package/references/official-docs/docs/subsystems/deliverables.i18n.yaml +6 -0
  265. package/references/official-docs/docs/subsystems/deliverables.md +178 -0
  266. package/references/official-docs/docs/subsystems/deliverables.zh.md +178 -0
  267. package/references/official-docs/docs/subsystems/extensions.zh.md +1 -1
  268. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
  269. package/references/official-docs/docs/subsystems/feedback.md +165 -31
  270. package/references/official-docs/docs/subsystems/feedback.zh.md +165 -31
  271. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
  272. package/references/official-docs/docs/subsystems/filesystem.md +15 -0
  273. package/references/official-docs/docs/subsystems/filesystem.zh.md +16 -1
  274. package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
  275. package/references/official-docs/docs/subsystems/goal.md +37 -1
  276. package/references/official-docs/docs/subsystems/goal.zh.md +38 -2
  277. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
  278. package/references/official-docs/docs/subsystems/invariants.md +1 -1
  279. package/references/official-docs/docs/subsystems/invariants.zh.md +3 -3
  280. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +1 -1
  281. package/references/official-docs/docs/subsystems/jobs.md +1 -1
  282. package/references/official-docs/docs/subsystems/jobs.zh.md +1 -1
  283. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
  284. package/references/official-docs/docs/subsystems/llm-streaming.md +35 -15
  285. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +37 -17
  286. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
  287. package/references/official-docs/docs/subsystems/lsp.md +1 -1
  288. package/references/official-docs/docs/subsystems/lsp.zh.md +1 -1
  289. package/references/official-docs/docs/subsystems/mcp.i18n.yaml +6 -0
  290. package/references/official-docs/docs/subsystems/mcp.md +139 -0
  291. package/references/official-docs/docs/subsystems/mcp.zh.md +139 -0
  292. package/references/official-docs/docs/subsystems/office-to-pdf.i18n.yaml +6 -0
  293. package/references/official-docs/docs/subsystems/office-to-pdf.md +87 -0
  294. package/references/official-docs/docs/subsystems/office-to-pdf.zh.md +87 -0
  295. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
  296. package/references/official-docs/docs/subsystems/permission-presets.md +62 -27
  297. package/references/official-docs/docs/subsystems/permission-presets.zh.md +62 -27
  298. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
  299. package/references/official-docs/docs/subsystems/persistence.md +36 -15
  300. package/references/official-docs/docs/subsystems/persistence.zh.md +36 -15
  301. package/references/official-docs/docs/subsystems/plan.zh.md +2 -2
  302. package/references/official-docs/docs/subsystems/ptc-runtime.i18n.yaml +6 -0
  303. package/references/official-docs/docs/subsystems/ptc-runtime.md +232 -0
  304. package/references/official-docs/docs/subsystems/ptc-runtime.zh.md +232 -0
  305. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
  306. package/references/official-docs/docs/subsystems/sandbox.md +5 -4
  307. package/references/official-docs/docs/subsystems/sandbox.zh.md +7 -6
  308. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
  309. package/references/official-docs/docs/subsystems/schedule.md +2 -2
  310. package/references/official-docs/docs/subsystems/schedule.zh.md +3 -3
  311. package/references/official-docs/docs/subsystems/scope.i18n.yaml +2 -2
  312. package/references/official-docs/docs/subsystems/scope.md +1 -1
  313. package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
  314. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
  315. package/references/official-docs/docs/subsystems/session-projection.md +1 -1
  316. package/references/official-docs/docs/subsystems/session-projection.zh.md +2 -2
  317. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
  318. package/references/official-docs/docs/subsystems/session-reference.md +11 -6
  319. package/references/official-docs/docs/subsystems/session-reference.zh.md +11 -6
  320. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
  321. package/references/official-docs/docs/subsystems/session-telemetry.md +22 -6
  322. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +23 -7
  323. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
  324. package/references/official-docs/docs/subsystems/session-title.md +5 -5
  325. package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
  326. package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
  327. package/references/official-docs/docs/subsystems/session.md +149 -61
  328. package/references/official-docs/docs/subsystems/session.zh.md +150 -62
  329. package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
  330. package/references/official-docs/docs/subsystems/shell.md +19 -15
  331. package/references/official-docs/docs/subsystems/shell.zh.md +20 -16
  332. package/references/official-docs/docs/subsystems/sidebar-right.i18n.yaml +6 -0
  333. package/references/official-docs/docs/subsystems/sidebar-right.md +153 -0
  334. package/references/official-docs/docs/subsystems/sidebar-right.zh.md +153 -0
  335. package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
  336. package/references/official-docs/docs/subsystems/skills.md +4 -6
  337. package/references/official-docs/docs/subsystems/skills.zh.md +4 -6
  338. package/references/official-docs/docs/subsystems/slots.i18n.yaml +2 -2
  339. package/references/official-docs/docs/subsystems/slots.md +52 -38
  340. package/references/official-docs/docs/subsystems/slots.zh.md +53 -39
  341. package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
  342. package/references/official-docs/docs/subsystems/spill.md +13 -6
  343. package/references/official-docs/docs/subsystems/spill.zh.md +13 -6
  344. package/references/official-docs/docs/subsystems/ssh.i18n.yaml +6 -0
  345. package/references/official-docs/docs/subsystems/ssh.md +135 -0
  346. package/references/official-docs/docs/subsystems/ssh.zh.md +135 -0
  347. package/references/official-docs/docs/subsystems/storage.zh.md +2 -2
  348. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
  349. package/references/official-docs/docs/subsystems/subagent.md +33 -16
  350. package/references/official-docs/docs/subsystems/subagent.zh.md +32 -15
  351. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
  352. package/references/official-docs/docs/subsystems/subprocess.md +41 -44
  353. package/references/official-docs/docs/subsystems/subprocess.zh.md +41 -44
  354. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
  355. package/references/official-docs/docs/subsystems/system-prompt.md +6 -2
  356. package/references/official-docs/docs/subsystems/system-prompt.zh.md +7 -3
  357. package/references/official-docs/docs/subsystems/todo.zh.md +1 -1
  358. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
  359. package/references/official-docs/docs/subsystems/token-meter.md +2 -1
  360. package/references/official-docs/docs/subsystems/token-meter.zh.md +2 -1
  361. package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
  362. package/references/official-docs/docs/subsystems/tools.md +28 -12
  363. package/references/official-docs/docs/subsystems/tools.zh.md +28 -12
  364. package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
  365. package/references/official-docs/docs/subsystems/typert.md +6 -5
  366. package/references/official-docs/docs/subsystems/typert.zh.md +6 -5
  367. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
  368. package/references/official-docs/docs/subsystems/user-questions.md +2 -0
  369. package/references/official-docs/docs/subsystems/user-questions.zh.md +2 -0
  370. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +2 -2
  371. package/references/official-docs/docs/subsystems/web-client.md +5 -5
  372. package/references/official-docs/docs/subsystems/web-client.zh.md +6 -6
  373. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
  374. package/references/official-docs/docs/subsystems/web-server.md +64 -0
  375. package/references/official-docs/docs/subsystems/web-server.zh.md +65 -1
  376. package/references/official-docs/docs/subsystems/webhook.i18n.yaml +1 -1
  377. package/references/official-docs/docs/subsystems/webhook.md +2 -2
  378. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
  379. package/references/official-docs/docs/subsystems/workflow.md +8 -8
  380. package/references/official-docs/docs/subsystems/workflow.zh.md +10 -10
  381. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
  382. package/references/official-docs/docs/subsystems/workspace.md +199 -1
  383. package/references/official-docs/docs/subsystems/workspace.zh.md +199 -1
  384. package/references/official-docs/docs/testing.i18n.yaml +2 -2
  385. package/references/official-docs/docs/testing.md +5 -4
  386. package/references/official-docs/docs/testing.zh.md +5 -4
  387. package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
  388. package/references/official-docs/docs/tool-catalog.md +452 -187
  389. package/references/official-docs/docs/tool-catalog.zh.md +454 -189
  390. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
  391. package/references/official-docs/docs/tool-execution-pipeline.md +2 -2
  392. package/references/official-docs/docs/tool-execution-pipeline.zh.md +2 -2
  393. package/references/official-docs/docs/user/develop/basic/index.zh.md +1 -1
  394. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
  395. package/references/official-docs/docs/user/develop/basic/publish.md +2 -2
  396. package/references/official-docs/docs/user/develop/basic/publish.zh.md +5 -5
  397. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +2 -2
  398. package/references/official-docs/docs/user/develop/framework/index.md +1 -1
  399. package/references/official-docs/docs/user/develop/framework/index.zh.md +1 -1
  400. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +2 -2
  401. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +8 -8
  402. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +8 -8
  403. package/references/official-docs/docs/user/guide/index.zh.md +2 -2
  404. package/references/official-docs/docs/user/guide/mcp-memory.zh.md +1 -1
  405. package/references/official-docs/docs/user/guide/network-proxy.i18n.yaml +2 -2
  406. package/references/official-docs/docs/user/guide/network-proxy.md +1 -1
  407. package/references/official-docs/docs/user/guide/network-proxy.zh.md +1 -1
  408. package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
  409. package/references/official-docs/docs/user/guide/providers.md +12 -8
  410. package/references/official-docs/docs/user/guide/providers.zh.md +14 -10
  411. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
  412. package/references/official-docs/docs/user/guide/python-sdk.md +59 -23
  413. package/references/official-docs/docs/user/guide/python-sdk.zh.md +60 -24
  414. package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
  415. package/references/official-docs/docs/web-styling.md +2 -1
  416. package/references/official-docs/docs/web-styling.zh.md +3 -2
  417. package/references/official-docs/packages/AGENTS.md +1 -1
  418. package/references/official-docs/packages/README.md +12 -7
  419. package/references/official-docs/vendor/README.md +15 -11
  420. package/references/official-docs/website-docs.ts +4 -2
  421. package/scripts/sync-official-docs.ps1 +5 -5
  422. package/references/official-docs/docs/subsystems/code-runtime.md +0 -195
  423. package/references/official-docs/docs/subsystems/code-runtime.zh.md +0 -195
@@ -49,7 +49,7 @@ A `Message` is one identified, immutable role/source/content value. Model-produc
49
49
 
50
50
  ```ts type-equiv
51
51
  /** Provider/model identity and adapter-private replay data for an assistant message. */
52
- interface AssistantProvenance {
52
+ interface AssistantProviderMetadata {
53
53
  /** Provider route that produced the message. */
54
54
  provider: string
55
55
  /** Provider model id that produced the message. */
@@ -97,7 +97,7 @@ Producer identity and presentation form are independent. `kind` answers *who pro
97
97
  ```ts type-equiv
98
98
  /**
99
99
  * The kind of information in producer-supplied context, declared by the
100
- * producer beside its provenance.
100
+ * producer in the same `MessageSource`.
101
101
  *
102
102
  * `MessageSource.kind` answers *who produced this*; `form` answers *what kind
103
103
  * of thing it is*, and the two axes are deliberately independent — several
@@ -225,7 +225,7 @@ type StreamChunk =
225
225
 
226
226
  `snapshot()` returns a detached immutable stream. `expandAssistantStream()` strictly checks record keys, member counts, indexes, timestamps, tool-call identity, and lossless JSON before recreating the exact timed chunk sequence. The Session log embeds this stream in `assistant/message` for a surface result or `assistant/attempt` for an attempt with no surface message.
227
227
 
228
- Process-local `agent/assistant-stream` frames carry live presentation. Durable replay, telemetry, token accounting, and historical UI assembly expand the embedded settlement instead of treating live frames as persisted facts.
228
+ Process-local `agent/assistant-stream` frames carry live presentation. Durable replay and restore validation still expand the embedded settlement; telemetry, token accounting, and Host folds read the compact records directly. Record-level readers (`assistantStreamFirstTokenTime`, `assistantStreamHasVisibleContent`, `assistantStreamHasVisibleText`, `lastAssistantStreamChunk`, `assistantStreamChunks`, `joinAssistantStreamText`, `assembleAssistantStream`, and the per-run `runFirstTokenTime` and `runFirstVisibleTime`) answer consumer questions in one pass over the records with early exit, so a large history costs O(records) per settlement instead of O(members) expansion ([fold decision](../../.agents/notes/implemented/architecture/2026-09-06-embedded-stream-record-readers.md)). `expandAssistantStream()` remains the validating path for records read at a durable boundary and for consumers that need every member.
229
229
 
230
230
  ## `LlmFailure`
231
231
 
@@ -244,12 +244,19 @@ interface LlmFailure {
244
244
  readonly providerRetryAfterMs?: number
245
245
  /** Opaque provider-issued request identifier for diagnostics. */
246
246
  readonly requestId?: ProviderRequestId
247
+ /**
248
+ * With code `IMAGE_OFFLOAD_REQUIRED`: how many more of the oldest retained
249
+ * image occurrences the route needs offloaded before the same request fits
250
+ * its exact byte accounting. `dsh-compaction-image-offload` records the
251
+ * selected occurrences in an `image/offload` event and retries the step.
252
+ */
253
+ readonly offloadImages?: number
247
254
  }
248
255
  ```
249
256
 
250
257
  ## Request-image pricing
251
258
 
252
- An adapter whose provider charges visual tokens for request images declares per-route pricing by overriding `LlmAdapter.imageRequestPricing`, and `ctx.llm.imageRequestPricing(provider, model)` resolves it synchronously for consumers. The token meter resolves the routed model's pricing on every measurement so compaction pressure, retention, and range selection price image history as the routed request actually sends it; the DeepSeek adapter reproduces its own request projection (per-model pixel budget, oldest-first offload) and prices retained images with the published v4 vision accounting, while provider usage remains the authoritative anchor for completed requests.
259
+ An adapter whose provider charges visual tokens for request images declares per-route pricing by overriding `LlmAdapter.imageRequestPricing`, and `ctx.llm.imageRequestPricing(provider, model)` resolves it synchronously for consumers. The token meter resolves the routed model's pricing on every measurement so compaction pressure, retention, and range selection price image history as the routed request actually sends it; the DeepSeek adapter prices each retained occurrence at its per-model request target with the published vision accounting and each occurrence selected by a logged image-offload decision as its placeholder text, while provider usage remains the authoritative anchor for completed requests.
253
260
 
254
261
  ```ts type-equiv
255
262
  /**
@@ -278,10 +285,11 @@ interface LlmImageRequestPrice {
278
285
  interface LlmImageRequestPricing {
279
286
  /**
280
287
  * Price every image occurrence of one request projection.
281
- * @param images - durable image references in request order, one entry per occurrence.
288
+ * @param images - surface image blocks in request order, one entry per occurrence; an `offloaded` block
289
+ * is priced as its placeholder text.
282
290
  * @returns one price per occurrence, aligned by index with `images`.
283
291
  */
284
- priceImages(images: readonly ImageAttachmentRef[]): readonly LlmImageRequestPrice[]
292
+ priceImages(images: readonly ImageBlock[]): readonly LlmImageRequestPrice[]
285
293
  }
286
294
  ```
287
295
 
@@ -295,7 +303,7 @@ Every adapter MUST obey these, and every consumer may rely on them:
295
303
  - **One adapter call is one provider attempt.** Adapters disable library retries. Agent-level recovery opens another durable numbered turn; direct `ctx.llm.stream()` callers remain single-attempt.
296
304
  - **Provider stalls are bounded at the transport.** Both shipping remote adapters expose positive finite `streamIdleTimeoutMs` with a five-minute default. The watchdog arms only while iterator `next()` is outstanding, uses one stable signal for the whole request, maps its own expiry to `TIMEOUT`, and keeps an earlier caller abort as `ABORTED`.
297
305
  - **Context overflow has one canonical code.** Both DeepSeek adapters classify explicit provider detail through `isContextWindowExceededError()` and surface `CONTEXT_WINDOW_EXCEEDED`, whether the failure arrives as a thrown HTTP `LlmError` or an in-band finish error. Consumers route on the code, never provider text.
298
- - **An empty completion is a retryable error, not a silent success.** Both adapters map a terminal `stop` finish that carried no content blocks to `finish {kind:'error'}` with the canonical `EMPTY_RESPONSE` code, and `dsh-llm-retry` retries it by default; see [empty model responses are retryable](../../.agents/notes/implemented/bug-fix/2026-07-24-empty-model-response-is-retryable.md).
306
+ - **An empty completion is a retryable error, not a silent success.** Both adapters map a terminal `stop` finish that carried no content blocks to `finish {kind:'error'}` with the canonical `EMPTY_RESPONSE` code, and `dsh-llm-retry` retries it by default.
299
307
  - **Every provider HTTP request carries the app-attribution header.** Adapters send `attributionHeaders()` (below) - the `User-Agent` baseline - and prove it with a wire-level test.
300
308
  - **Replay state is adapter-owned; its split is shared.** A successful `finish` may carry a `ReplayEnvelope`: opaque response-level metadata plus optional per-block entries aligned with the emitted block sequence. The alignment is the harness's vocabulary — when assembly drops a block it drops the entry at the same position, so stored metadata always describes stored content. The loop stores the pruned envelope with the assembled assistant message. On a later request, `LlmRuntime` passes the state only when the historical provider and target provider are currently registered to the exact same adapter instance. That adapter validates the state and owns any cross-model or cross-provider conversion; other adapters receive the provider-neutral content plus provider/model fields without the private state. Durable content stays authoritative: a stored state the reading adapter cannot use degrades that one message to provider-neutral conversion with a diagnostic instead of failing the request.
301
309
 
@@ -492,6 +500,8 @@ interface LlmConfigurableProvider {
492
500
  * from outside.
493
501
  */
494
502
  declared?: boolean
503
+ /** Configuration diagnostic for repair; unaffected models may remain serviceable. */
504
+ error?: string
495
505
  }
496
506
  ```
497
507
 
@@ -511,7 +521,7 @@ interface LlmModelInfo {
511
521
  }
512
522
  ```
513
523
 
514
- Correctness-sensitive metadata is resolved separately from the advisory catalog and is owned by the adapter serving the exact route. Context capacity, adapter call defaults, and reasoning choices share one exact-model result so consumers do not repeat authoritative model resolution.
524
+ Correctness-sensitive metadata is resolved separately from the advisory catalog and is owned by the adapter serving the exact route. Context capacity, adapter call defaults, reasoning choices, and the system prompt update mode share one exact-model result so consumers do not repeat authoritative model resolution. `SystemPromptUpdate` has the single value `'in-history'`: the model reads the latest `system` message at any position of `messages` as the complete effective system prompt, so the agent loop can append a changed prompt after the cached history instead of rewriting message 0 ([decision rule](../../packages/core/agent-loop/README.md#understand-the-implementation)); an absent mode means only a leading system message is read, and `normalizeModelInfo` rejects any other value with `INVALID_MODEL_INFO`.
515
525
 
516
526
  ```ts type-equiv
517
527
  /** Provider-owned context capacity for one exact provider/model route. */
@@ -562,6 +572,8 @@ interface LlmResolvedModelInfo extends LlmModelInfo {
562
572
  defaultMaxTokens?: number
563
573
  /** Adapter-owned selectable reasoning levels when exposed. */
564
574
  reasoning?: LlmModelReasoningInfo
575
+ /** Declared mid-conversation system prompt handling; absent means only a leading system message is read. */
576
+ systemPromptUpdate?: SystemPromptUpdate
565
577
  }
566
578
  ```
567
579
 
@@ -574,12 +586,16 @@ interface GenerateOptions {
574
586
  /** Adapter-owned reasoning effort selected for this exact model. */
575
587
  reasoningEffort?: ReasoningEffortId
576
588
  /**
577
- * Ordered conversation messages, exactly as the provider sees them (after
578
- * the `system` slot). A loop-built request assembles them as
579
- * the derived history (dsh-agent-loop); a hand-built one-shot passes any list.
589
+ * Ordered conversation messages, exactly as the provider sees them. A
590
+ * loop-built request passes the derived history (dsh-agent-loop), whose
591
+ * leading system-role message carries the system prompt; a hand-built
592
+ * one-shot passes any list.
580
593
  */
581
594
  messages: Message[]
582
- /** System prompt text (adapters map to the provider's system slot). */
595
+ /**
596
+ * System prompt text for one-shot callers; adapters map it to the provider's
597
+ * system slot ahead of `messages`. Loop-built requests leave it undefined.
598
+ */
583
599
  system?: string
584
600
  /** Tool schemas (adapters map to the provider's `tools` field). */
585
601
  tools?: ToolSchema[]
@@ -688,16 +704,18 @@ interface LlmDiscoveredModel {
688
704
  contextWindow?: number
689
705
  /** Maximum output tokens, when disclosed. */
690
706
  maxTokens?: number
707
+ /** Accepted input types when disclosed by the catalog or endpoint; absent means unknown. */
708
+ inputModalities?: readonly ModelModality[]
691
709
  }
692
710
  ```
693
711
 
694
712
  ### The request envelope: `LlmCallConfig` and the logged header
695
713
 
696
- The loop builds each request from logged state. `EpochHeader` records call config, marks the fields supplied by adapter defaults, and records the rendered prompt and authoritative returned tool order (configured by `toolOrder`, or lexicographic when unset) through full `request/header` snapshots. Together with derived history, this makes the request reconstructable from the session log. See [session.md](session.md#the-request-header-event-requestheader) and the [reconstructability Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.md).
714
+ The loop builds each request from logged state. `EpochHeader` records call config, marks the fields supplied by adapter defaults, and records the authoritative returned tool order (configured by `toolOrder`, or lexicographic when unset) through full `request/header` snapshots. The rendered prompt is derived history — the `system/message` at surface node 0, plus any later system node an `in-history` route appended — so the header and the derived history together make the request reconstructable from the session log. See [session.md](session.md#the-request-header-event-requestheader) and the [reconstructability Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.md).
697
715
 
698
- `agent/request` receives a frozen call-config seed and may return a replacement to switch provider, model, reasoning effort, or sampling. Before the waterfall, the loop removes values marked as adapter defaults so exact-model preparation materializes the selected route's current values; unmarked explicit settings remain in the proposal. After the waterfall, preparation rejects unsupported explicit effort ids without clamping and logs the effective config plus the fields supplied by adapter defaults under the turn signal. The prepared call keeps one adapter registration through dispatch. Requests reaching `llm/stream` are deep-frozen, so mutation throws, and carry a process-local loop identity so observers do not confuse separately logged frozen auxiliary calls with conversation requests.
716
+ `agent/request` receives a frozen call-config seed and may return a replacement to switch provider, model, reasoning effort, or sampling. Before the waterfall, the loop removes values marked as adapter defaults so exact-model preparation materializes the selected route's current values; unmarked explicit settings remain in the proposal. After the waterfall, preparation rejects unsupported explicit effort ids without clamping and logs the effective config plus the fields supplied by adapter defaults under the turn signal. On step admission, this waterfall and preparation run after assembly and `step/start` but before the system prompt and accepted user batch are committed; cancellation during either commits neither. The prepared capability governs prompt reconciliation, and the call keeps one adapter registration through dispatch. Requests reaching `llm/stream` are deep-frozen, so mutation throws, and carry a process-local loop identity so observers do not confuse separately logged frozen auxiliary calls with conversation requests.
699
717
 
700
- On the wire, a loop-built request reads the `system` slot (the rendered prompt assembly) followed by the derived history. The logged request snapshot ends with the newest `user/message` on a turn's first step and the previous step's tool results on later steps. The dev invariant recomputes exactly this equation against every loop-built request.
718
+ On the wire, a loop-built request is the derived history alone: the rendered prompt travels as the leading `system`-role message (surface node 0, a `system/message` event) and, when the prepared call declares `systemPromptUpdate: 'in-history'`, a non-empty changed prompt may follow the cached history as a later `system`-role message that the model reads as the effective prompt; the request's `system` field is unset — `GenerateOptions.system` serves direct one-shot callers such as title providers. An empty rendering leaves no system messages in derived history, even when earlier requests retained several prompt versions. The logged request ends with the newest `user/message` on a turn's first step and the previous step's tool results on later steps. The dev invariant recomputes exactly this equation against every loop-built request and rejects a loop request carrying a `system` field.
701
719
 
702
720
  FIXME(call-config-shape): revisit which remaining fields are genuinely epoch-level for cache purposes (`model` and the model-owned reasoning effort are explicit; the sampling scalars sit here out of caution).
703
721
 
@@ -750,6 +768,8 @@ interface PreparedLlmCall {
750
768
  readonly context?: LlmModelContext
751
769
  /** Exact model modalities captured with the adapter dispatch generation. */
752
770
  readonly inputModalities?: readonly ModelModality[]
771
+ /** Exact model system prompt update mode captured with the adapter dispatch generation. */
772
+ readonly systemPromptUpdate?: SystemPromptUpdate
753
773
  /** Config fields materialized by the captured adapter rather than proposed by the caller. */
754
774
  readonly adapterDefaults: LlmCallConfigAdapterDefaults
755
775
  /**
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](llm-streaming.md) | 中文
4
4
 
5
- [`packages/llm`](../../packages/llm/README-zh.md) 提供对话与流式输出类型:每个请求和持久历史共用的 `Message`/`ContentBlock` 变体、完整组装的模型请求、原始 `StreamChunk` 协议、每个适配器必须实现的适配器约定(adapter contract),以及共享的 assembler。[核心包](core.zh.md)在每个轮次持有并记录这些值;本页声明它们。
5
+ [`packages/llm`](../../packages/llm/README.zh.md) 提供对话与流式输出类型:每个请求和持久历史共用的 `Message`/`ContentBlock` 变体、完整组装的模型请求、原始 `StreamChunk` 协议、每个适配器必须实现的适配器约定(adapter contract),以及共享的 assembler。[核心包](core.zh.md)在每个轮次持有并记录这些值;本页声明它们。
6
6
 
7
7
  源码:[`packages/llm/llm/src/types.ts`](../../packages/llm/llm/src/types.ts)
8
8
 
@@ -49,7 +49,7 @@ interface ImageAttachmentAccess {
49
49
 
50
50
  ```ts type-equiv
51
51
  /** Provider/model identity and adapter-private replay data for an assistant message. */
52
- interface AssistantProvenance {
52
+ interface AssistantProviderMetadata {
53
53
  /** Provider route that produced the message. */
54
54
  provider: string
55
55
  /** Provider model id that produced the message. */
@@ -97,7 +97,7 @@ interface MessageSourceMap {
97
97
  ```ts type-equiv
98
98
  /**
99
99
  * The kind of information in producer-supplied context, declared by the
100
- * producer beside its provenance.
100
+ * producer in the same `MessageSource`.
101
101
  *
102
102
  * `MessageSource.kind` answers *who produced this*; `form` answers *what kind
103
103
  * of thing it is*, and the two axes are deliberately independent — several
@@ -225,7 +225,7 @@ type StreamChunk =
225
225
 
226
226
  `snapshot()` 返回分离且不可变的 stream。`expandAssistantStream()` 会严格检查 record key、成员数、index、时间戳、tool-call identity 与无损 JSON,再重建精确的带时间 chunk 序列。Session 日志会把该 stream 嵌入作为 surface result 的 `assistant/message`,或嵌入没有 surface message 的 `assistant/attempt`。
227
227
 
228
- 进程本地 `agent/assistant-stream` frame 承载实时呈现。持久回放、遥测、token 记账与历史 UI 组装会展开嵌入式 settlement,而不会把 live frame 当作持久事实。
228
+ 进程本地 `agent/assistant-stream` frame 承载实时呈现。持久回放与恢复校验仍会展开内嵌 settlement;遥测、token 记账与 Host 折叠直接读取紧凑记录。记录级读取器(`assistantStreamFirstTokenTime`、`assistantStreamHasVisibleContent`、`assistantStreamHasVisibleText`、`lastAssistantStreamChunk`、`assistantStreamChunks`、`joinAssistantStreamText`、`assembleAssistantStream` 以及按 run `runFirstTokenTime` 与 `runFirstVisibleTime`)以提前退出在一次扫描内回答消费方问题,因此大历史每次结算的代价为 O(records) 而非 O(members) 展开([折叠决策](../../.agents/notes/implemented/architecture/2026-09-06-embedded-stream-record-readers.zh.md))。`expandAssistantStream()` 仍是持久边界读取记录与需要每个成员的消费方的校验路径。
229
229
 
230
230
  <a id="llmfailure"></a>
231
231
 
@@ -246,12 +246,19 @@ interface LlmFailure {
246
246
  readonly providerRetryAfterMs?: number
247
247
  /** Opaque provider-issued request identifier for diagnostics. */
248
248
  readonly requestId?: ProviderRequestId
249
+ /**
250
+ * With code `IMAGE_OFFLOAD_REQUIRED`: how many more of the oldest retained
251
+ * image occurrences the route needs offloaded before the same request fits
252
+ * its exact byte accounting. `dsh-compaction-image-offload` records the
253
+ * selected occurrences in an `image/offload` event and retries the step.
254
+ */
255
+ readonly offloadImages?: number
249
256
  }
250
257
  ```
251
258
 
252
259
  ## 请求图片定价
253
260
 
254
- 提供方对请求图片收取视觉 token 的适配器通过覆写 `LlmAdapter.imageRequestPricing` 声明按路由的定价,消费方经 `ctx.llm.imageRequestPricing(provider, model)` 同步解析。token 计量服务在每次计量时解析路由模型的定价,使 compaction 的压力、保留与选段都按路由请求实际发送的形式为图片历史计价;DeepSeek 适配器复现自身的请求投影(按模型的像素预算、最旧优先 offload),并用官方公布的 v4 视觉计量为保留图片定价,已完成请求仍以 provider usage 为权威锚点。
261
+ 提供方对请求图片收取视觉 token 的适配器通过覆写 `LlmAdapter.imageRequestPricing` 声明按路由的定价,消费方经 `ctx.llm.imageRequestPricing(provider, model)` 同步解析。token 计量服务在每次计量时解析路由模型的定价,使 compaction 的压力、保留与选段都按路由请求实际发送的形式为图片历史计价;DeepSeek 适配器按模型的请求目标用官方公布的视觉计量为每个保留的出现位置定价,并把日志中的图片省略决策选中的出现位置按其占位文本定价,已完成请求仍以 provider usage 为权威锚点。
255
262
 
256
263
  ```ts type-equiv
257
264
  /**
@@ -280,10 +287,11 @@ interface LlmImageRequestPrice {
280
287
  interface LlmImageRequestPricing {
281
288
  /**
282
289
  * Price every image occurrence of one request projection.
283
- * @param images - durable image references in request order, one entry per occurrence.
290
+ * @param images - surface image blocks in request order, one entry per occurrence; an `offloaded` block
291
+ * is priced as its placeholder text.
284
292
  * @returns one price per occurrence, aligned by index with `images`.
285
293
  */
286
- priceImages(images: readonly ImageAttachmentRef[]): readonly LlmImageRequestPrice[]
294
+ priceImages(images: readonly ImageBlock[]): readonly LlmImageRequestPrice[]
287
295
  }
288
296
  ```
289
297
 
@@ -297,7 +305,7 @@ interface LlmImageRequestPricing {
297
305
  - **一次适配器调用就是一次提供方尝试。** 适配器禁用库重试。agent 层恢复会打开另一个持久、带编号的轮次;直接调用 `ctx.llm.stream()` 的调用方仍然只尝试一次。
298
306
  - **提供方停顿在传输层受到时限约束。** 两个已交付的远程适配器都暴露正数且有限的 `streamIdleTimeoutMs`,默认五分钟。watchdog 只在 iterator `next()` 尚未完成时启动,整个请求使用同一个稳定 signal,把自身到期映射为 `TIMEOUT`,并把更早发生的调用方中止保留为 `ABORTED`。
299
307
  - **上下文溢出只有一个规范 code。** 两个 DeepSeek 适配器都通过 `isContextWindowExceededError()` 对提供方的显式细节分类并暴露 `CONTEXT_WINDOW_EXCEEDED`,无论失败以抛出的 HTTP `LlmError` 还是带内 finish error 到达。消费方按 code 路由,绝不依赖提供方文本。
300
- - **空 completion 是可重试错误,而不是静默的成功结果。** 两个适配器都把没有携带任何内容块的终止性 `stop` 结束映射为携带规范 `EMPTY_RESPONSE` code 的 `finish {kind:'error'}`,`dsh-llm-retry` 默认会重试它;详见[空模型响应可重试](../../.agents/notes/implemented/bug-fix/2026-07-24-empty-model-response-is-retryable.zh.md)。
308
+ - **空 completion 是可重试错误,而不是静默的成功结果。** 两个适配器都把没有携带任何内容块的终止性 `stop` 结束映射为携带规范 `EMPTY_RESPONSE` code 的 `finish {kind:'error'}`,`dsh-llm-retry` 默认会重试它。
301
309
  - **每个提供方 HTTP 请求都携带应用归属头。** 适配器发送 `attributionHeaders()`(见下文)作为 `User-Agent` 基线,并通过协议级测试加以证明。
302
310
  - **回放状态归适配器所有;其切分是共享词汇。** 成功的 `finish` 可以携带一个 `ReplayEnvelope`:不透明的响应级元数据,加上与发射块序列对齐的可选逐块条目。对齐关系是 harness 的词汇——组装丢弃某个块时,同一位置的条目一并丢弃,因此存储的元数据始终描述存储的内容。循环把裁剪后的数据与组装后的 assistant 消息一起存储。后续请求中,仅当历史提供方与目标提供方当前注册到完全相同的适配器实例时,`LlmRuntime` 才会传递该状态。该适配器负责校验状态并拥有所有跨模型或跨提供方转换;其他适配器只会收到提供方无关的内容以及提供方/模型字段,不会收到私有状态。持久化内容保持权威:读取适配器无法使用的已存状态只会把这一条消息降级为提供方无关转换并带出诊断,而不是让请求失败。
303
311
 
@@ -498,6 +506,8 @@ interface LlmConfigurableProvider {
498
506
  * from outside.
499
507
  */
500
508
  declared?: boolean
509
+ /** Configuration diagnostic for repair; unaffected models may remain serviceable. */
510
+ error?: string
501
511
  }
502
512
  ```
503
513
 
@@ -517,7 +527,7 @@ interface LlmModelInfo {
517
527
  }
518
528
  ```
519
529
 
520
- 对正确性敏感的元数据与参考目录分开解析,并归服务该确切路由的适配器所有。上下文容量、适配器调用默认值和推理选项共用同一个确切模型结果,消费方因而无需重复执行权威模型解析。
530
+ 对正确性敏感的元数据与参考目录分开解析,并归服务该确切路由的适配器所有。上下文容量、适配器调用默认值、推理选项和系统提示词更新模式共用同一个确切模型结果,消费方因而无需重复执行权威模型解析。`SystemPromptUpdate` 只有一个值 `'in-history'`:模型把 `messages` 中任意位置最新的 `system` 消息读作完整的有效系统提示词,因此 agent loop 可以把变化后的提示词追加到已缓存历史之后,而不是改写第 0 条消息([决策规则](../../packages/core/agent-loop/README.zh.md#understand-the-implementation));模式缺失表示只读取开头的 system 消息,`normalizeModelInfo` 以 `INVALID_MODEL_INFO` 拒绝任何其他值。
521
531
 
522
532
  ```ts type-equiv
523
533
  /** Provider-owned context capacity for one exact provider/model route. */
@@ -568,6 +578,8 @@ interface LlmResolvedModelInfo extends LlmModelInfo {
568
578
  defaultMaxTokens?: number
569
579
  /** Adapter-owned selectable reasoning levels when exposed. */
570
580
  reasoning?: LlmModelReasoningInfo
581
+ /** Declared mid-conversation system prompt handling; absent means only a leading system message is read. */
582
+ systemPromptUpdate?: SystemPromptUpdate
571
583
  }
572
584
  ```
573
585
 
@@ -580,12 +592,16 @@ interface GenerateOptions {
580
592
  /** Adapter-owned reasoning effort selected for this exact model. */
581
593
  reasoningEffort?: ReasoningEffortId
582
594
  /**
583
- * Ordered conversation messages, exactly as the provider sees them (after
584
- * the `system` slot). A loop-built request assembles them as
585
- * the derived history (dsh-agent-loop); a hand-built one-shot passes any list.
595
+ * Ordered conversation messages, exactly as the provider sees them. A
596
+ * loop-built request passes the derived history (dsh-agent-loop), whose
597
+ * leading system-role message carries the system prompt; a hand-built
598
+ * one-shot passes any list.
586
599
  */
587
600
  messages: Message[]
588
- /** System prompt text (adapters map to the provider's system slot). */
601
+ /**
602
+ * System prompt text for one-shot callers; adapters map it to the provider's
603
+ * system slot ahead of `messages`. Loop-built requests leave it undefined.
604
+ */
589
605
  system?: string
590
606
  /** Tool schemas (adapters map to the provider's `tools` field). */
591
607
  tools?: ToolSchema[]
@@ -694,16 +710,18 @@ interface LlmDiscoveredModel {
694
710
  contextWindow?: number
695
711
  /** Maximum output tokens, when disclosed. */
696
712
  maxTokens?: number
713
+ /** Accepted input types when disclosed by the catalog or endpoint; absent means unknown. */
714
+ inputModalities?: readonly ModelModality[]
697
715
  }
698
716
  ```
699
717
 
700
718
  ### 请求信封:`LlmCallConfig` 与记录的 header
701
719
 
702
- 循环从已记录状态构建每个请求。`EpochHeader` 记录调用配置,标记由适配器默认值提供的字段,并通过完整的 `request/header` 快照记录渲染后的提示词以及权威返回工具顺序(由 `toolOrder` 配置;未配置时按字典序)。结合派生历史,请求便可由会话日志重建。见 [session.md](session.zh.md#the-request-header-event-requestheader) 与[可重建性 Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.zh.md)。
720
+ 循环从已记录状态构建每个请求。`EpochHeader` 记录调用配置,标记由适配器默认值提供的字段,并通过完整的 `request/header` 快照记录权威返回工具顺序(由 `toolOrder` 配置;未配置时按字典序)。渲染后的提示词是派生历史——surface 第 0 号节点上的 `system/message`,加上 `in-history` 路由追加的任何后续系统节点——因此请求头与派生历史共同使请求可由会话日志重建。见 [session.md](session.zh.md#the-request-header-event-requestheader) 与[可重建性 Agent Note](../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.zh.md)。
703
721
 
704
- `agent/request` 接收冻结的调用配置种子,并可返回替代值以切换提供方、模型、推理强度或采样参数。waterfall(瀑布式事件)开始前,循环会移除标记为适配器默认值的值,使确切模型准备过程填入所选路由的当前值;未带标记的显式设置仍保留在提议中。waterfall 结束后,准备过程会在轮次信号控制下拒绝显式指定但不受支持的推理强度 ID(不自动调整),并记录生效配置以及由适配器默认值提供的字段。准备完成的调用直至分派完成始终持有同一项适配器注册。到达 `llm/stream` 的请求会被深度冻结,因此变更会抛异常;请求还携带进程本地循环标识,使观察者不会把单独记录的冻结辅助调用误认成对话请求。
722
+ `agent/request` 接收冻结的调用配置种子,并可返回替代值以切换提供方、模型、推理强度或采样参数。waterfall(瀑布式事件)开始前,循环会移除标记为适配器默认值的值,使确切模型准备过程填入所选路由的当前值;未带标记的显式设置仍保留在提议中。waterfall 结束后,准备过程会在轮次信号控制下拒绝显式指定但不受支持的推理强度 ID(不自动调整),并记录生效配置以及由适配器默认值提供的字段。步骤准入时,该 waterfall 与准备过程在组装和 `step/start` 之后、系统提示词与已接纳用户批次提交之前运行;在任一阶段取消都不会提交这两者。已准备调用的能力决定提示词协调,调用直至分派完成始终持有同一项适配器注册。到达 `llm/stream` 的请求会被深度冻结,因此变更会抛异常;请求还携带进程本地循环标识,使观察者不会把单独记录的冻结辅助调用误认成对话请求。
705
723
 
706
- 在协议中,循环构建的请求先读取 `system` slot(渲染后的提示词组装),再读取派生历史。已记录的请求快照会以最新的 `user/message`(轮次首步)或上一步的工具结果(后续步骤)结尾。开发不变式针对每个循环构建的请求精确重算此等式。
724
+ 在协议中,循环构建的请求只有派生历史:渲染后的提示词作为开头的 `system` 角色消息(surface 第 0 号节点,即一个 `system/message` 事件)传输,并且当已准备调用声明 `systemPromptUpdate: 'in-history'` 时,变化后的非空提示词可以作为后续的 `system` 角色消息跟在已缓存历史之后,由模型读作有效提示词;请求的 `system` 字段不设置——`GenerateOptions.system` 服务于标题提供方等直接单次调用方。空渲染文本使派生历史不包含任何系统消息,即使先前请求保留了多个提示词版本。已记录的请求会以最新的 `user/message`(轮次首步)或上一步的工具结果(后续步骤)结尾。开发不变式针对每个循环构建的请求精确重算此等式,并拒绝携带 `system` 字段的循环请求。
707
725
 
708
726
  FIXME(call-config-shape):重新审视其余哪些字段出于缓存目的确实属于 epoch 层级(`model` 和模型持有的推理强度已明确属于;采样标量目前出于谨慎保留在此)。
709
727
 
@@ -739,7 +757,7 @@ interface LlmCallConfigAdapterDefaults {
739
757
 
740
758
  `ctx.deepseekLlmApiExtensions` 是用于向 `deepseek-official` 请求添加顶层字段的提供方特定注册表。贡献插件通过 `register(field, provider)` 认领一个字段;适配器在序列化基础正文后调用 `prepare(request)`,并在 HTTP 前合并返回字段。已准备的 `accept()` 事务会在 2xx 后运行,因此贡献方可以提交交付状态,而不会把传输失败或提供方拒绝当作接受。准备、冲突与接受失败会使用 `REQUEST_EXTENSION`,并使模型请求失败。
741
759
 
742
- [协议参考](../deepseek-llm-api-wire-extensions.zh.md)定义确切的请求标头、扩展事务、字段版本和接收方义务。随附组合会将 [`dsh_session_log`](../../packages/session/session-log-deepseek/README-zh.md) 注册为无损增量权威日志后缀,并将 [`dsh_plugin_packages`](../../packages/llm/plugin-package-inventory-deepseek/README-zh.md) 注册为完整存活 Loader 包集合。这些字段仍位于模型消息之外,也不会进入 pi-ai 适配器路径。
760
+ [协议参考](../deepseek-llm-api-wire-extensions.zh.md)定义确切的请求标头、扩展事务、字段版本和接收方义务。随附组合会将 [`dsh_session_log`](../../packages/session/session-log-deepseek/README.zh.md) 注册为无损增量权威日志后缀,并将 [`dsh_plugin_packages`](../../packages/llm/plugin-package-inventory-deepseek/README.zh.md) 注册为完整存活 Loader 包集合。这些字段仍位于模型消息之外,也不会进入 pi-ai 适配器路径。
743
761
 
744
762
  ## 服务与提供方约定
745
763
 
@@ -756,6 +774,8 @@ interface PreparedLlmCall {
756
774
  readonly context?: LlmModelContext
757
775
  /** Exact model modalities captured with the adapter dispatch generation. */
758
776
  readonly inputModalities?: readonly ModelModality[]
777
+ /** Exact model system prompt update mode captured with the adapter dispatch generation. */
778
+ readonly systemPromptUpdate?: SystemPromptUpdate
759
779
  /** Config fields materialized by the captured adapter rather than proposed by the caller. */
760
780
  readonly adapterDefaults: LlmCallConfigAdapterDefaults
761
781
  /**
@@ -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/lsp.md
5
- lsp.md: 8f0b12cdbc4d81a9317b8f360fb7b76a03fbeb2b
6
- lsp.zh.md: e88218f549b5f12ac1f6681085380347818a478d
5
+ lsp.md: 5a8adb24c1768ac2a977b99f1ffb732610ccd911
6
+ lsp.zh.md: e041217866b3469f6ad06fac9ad20289a6524eb3
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [中文](lsp.zh.md)
4
4
 
5
- The LSP seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-07-15-lsp-capability-seam.md) exposing semantic code navigation on one `ctx.lsp` service, split across packages: Service Definition ([dsh-lsp](../../packages/lsp/lsp), `ctx.lsp` + the provider registry), a generic Service Provider ([dsh-lsp-stdio](../../packages/lsp/lsp-stdio), a configured stdio language-server host), and Consumer ([dsh-tool-lsp](../../packages/lsp/tool-lsp), the `lsp` tool schema). LSP is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](core.md). A provider swap does not change how the model asks for navigation.
5
+ The LSP seam — a [capability seam](../glossary.md#capability-seam) exposing semantic code navigation on one `ctx.lsp` service, split across packages: Service Definition ([dsh-lsp](../../packages/lsp/lsp), `ctx.lsp` + the provider registry), a generic Service Provider ([dsh-lsp-stdio](../../packages/lsp/lsp-stdio), a configured stdio language-server host), and Consumer ([dsh-tool-lsp](../../packages/lsp/tool-lsp), the `lsp` tool schema). LSP is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](core.md). A provider swap does not change how the model asks for navigation.
6
6
 
7
7
  Source: [`packages/lsp/lsp/src/types.ts`](../../packages/lsp/lsp/src/types.ts)
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](lsp.md) | 中文
4
4
 
5
- LSP seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-07-15-lsp-capability-seam.zh.md):它在单一 `ctx.lsp` 服务上公开语义代码导航,并拆分到多个包:Service Definition([dsh-lsp](../../packages/lsp/lsp),`ctx.lsp` + 提供方注册表)、通用 Service Provider([dsh-lsp-stdio](../../packages/lsp/lsp-stdio),经过配置的 stdio 语言服务器宿主)和 Consumer([dsh-tool-lsp](../../packages/lsp/tool-lsp),即 `lsp` 工具 schema)。LSP 是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.zh.md) 中。更换提供方不会改变模型请求导航的方式。
5
+ LSP seam 是一个[能力 seam](../glossary.zh.md#capability-seam):它在单一 `ctx.lsp` 服务上公开语义代码导航,并拆分到多个包:Service Definition([dsh-lsp](../../packages/lsp/lsp),`ctx.lsp` + 提供方注册表)、通用 Service Provider([dsh-lsp-stdio](../../packages/lsp/lsp-stdio),经过配置的 stdio 语言服务器宿主)和 Consumer([dsh-tool-lsp](../../packages/lsp/tool-lsp),即 `lsp` 工具 schema)。LSP 是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.zh.md) 中。更换提供方不会改变模型请求导航的方式。
6
6
 
7
7
  源文件:[`packages/lsp/lsp/src/types.ts`](../../packages/lsp/lsp/src/types.ts)
8
8
 
@@ -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/mcp.md
5
+ mcp.md: 809fea9bafb3db077bbd34959b6b2df8c6ca13fc
6
+ mcp.zh.md: b1e5fcb0e93631bc63a96faa5c0c3b8a9462b67c
@@ -0,0 +1,139 @@
1
+ # MCP
2
+
3
+ English | [中文](mcp.zh.md)
4
+
5
+ ## Summary
6
+
7
+ Model Context Protocol (MCP) connects the model to tools supplied by external servers. Each configured server contributes ordinary harness tools with cancellation, permission checks, recorded results, and supported image output. Shared tools discover and read resources when a server is configured in the caller's scope, while server instructions join the logged system prompt. The official SDK negotiates modern or supported legacy protocol revisions. This reference covers the MCP package group's responsibilities, scope, and composition choices; the [client README](../../packages/mcp/mcp-client/README.md) owns server configuration.
8
+
9
+ ## Table of Contents
10
+
11
+ - [Configuration](#configuration)
12
+ - [Responsibilities and scope](#responsibilities-and-scope)
13
+ - [Protocol and results](#protocol-and-results)
14
+ - [Resources and instructions](#resources-and-instructions)
15
+ - [Resource provider types](#resource-provider-types)
16
+ - [Limits](#limits)
17
+ - [Further reading](#further-reading)
18
+
19
+ -----
20
+
21
+ <a id="configuration"></a>
22
+ ## Configuration
23
+
24
+ MCP servers are opt-in. Configure one `@deepseek-ai/dsh-mcp-client` entry per server in the intended Cordis scope. Every shipped profile supplies the [tool registry](tools.md) and mounts the shared resource service once; users configure only client entries. Callers with no visible configured server receive no MCP prompt text or tools in native or PTC mode.
25
+
26
+ | Choice | Configuration owner |
27
+ |---|---|
28
+ | Server identity, local process or HTTP endpoint, credentials, and process environment | [Client configuration](../../packages/mcp/mcp-client/README.md#use-this-package) |
29
+ | Tool and resource request timeout, startup failure policy, and reconnection | [Client configuration](../../packages/mcp/mcp-client/README.md#use-this-package) |
30
+ | Resource discovery and reading | The [MCP resource service](../../packages/mcp/mcp-resources/README.md#use-this-package) is included in shipped profiles; it has no configuration fields |
31
+ | Server instruction size limit | Client `maxInstructionBytes`; the composition supplies [system-prompt assembly](system-prompt.md) |
32
+ | Permission decisions and supported image output | [Tool execution](tools.md) and [attachments](attachment.md) |
33
+
34
+ Protocol negotiation follows the SDK's supported revisions; there is no product setting that forces a protocol revision. The [configuration catalog](../config-catalog.md#deepseek-aidsh-mcp-client) lists accepted client fields and defaults.
35
+
36
+ -----
37
+
38
+ <a id="responsibilities-and-scope"></a>
39
+ ## Responsibilities and scope
40
+
41
+ The client is a per-server connection plugin and a consumer of the harness tool registry. It does not publish a shared `ctx.mcp` service. The external server implements MCP operations; the SDK owns protocol exchange; the client adapts discovered tools to harness execution.
42
+
43
+ `mcp-resources` owns the shared resource tools and selects providers in the caller's scope. Each MCP client supplies resource operations through its own connection. The first provider in a scope enables the local shared tools, and removing the last removes them; inherited providers remain visible. The service owns these tool registrations independently of any one client. Connection failures do not remove shared resource tools while a visible client entry remains active.
44
+
45
+ Configured `serverName` identifies a server in its registration scope. Two entries in that scope cannot reserve the same name; separate Agent scopes can reuse it. Public tool names include the configured server name, so equally named tools from different servers remain distinct. Registration effects own names and discovered tools; plugin disposal closes the connection and removes its contributions.
46
+
47
+ The [native Cua Driver provider](../../packages/experimental/computer-use-cua-driver-native/README.md) shares the client's exported result adapter without opening an MCP connection. Desktop provider selection belongs to the [computer-use subsystem](computer-use.md).
48
+
49
+ -----
50
+
51
+ <a id="protocol-and-results"></a>
52
+ ## Protocol and results
53
+
54
+ Both stdio and Streamable HTTP use the official SDK's negotiation, discovery, protocol validation, and cancellation. Tool-list changes trigger discovery through legacy notifications or a modern subscription. A failed refresh retains the previous tool generation; connection recovery follows the [client lifecycle](../../packages/mcp/mcp-client/README.md#use-this-package).
55
+
56
+ The result adapter retains canonical MCP JSON for programmatic callers and prepares ordinary tool content. Supported images use the attachment system; unsupported rich content produces explicit text diagnostics. The tool registry remains authoritative for policy failures and replaced results. The [tool contracts](tools.md) own recording and final presentation; the [client result reference](../../packages/mcp/mcp-client/README.md#use-this-package) owns MCP-specific projection details.
57
+
58
+ -----
59
+
60
+ <a id="resources-and-instructions"></a>
61
+ ## Resources and instructions
62
+
63
+ Resource calls require an explicit configured server name. When system-prompt assembly is available, the resource service lists caller-visible names from the same registry used for dispatch, including servers with no tools or instructions. The shared registry resolves that name in the calling Agent's scope before dispatch; unavailable servers fail without a network request. Discovery and reads are on demand, including for servers that expose resources without tools. The [resource package](../../packages/mcp/mcp-resources/README.md) owns pagination and content rendering; its generated tool schemas live in the [tool catalog](../tool-catalog.md#deepseek-aidsh-mcp-resources).
64
+
65
+ Resource providers remain connection-owned. Scope disposal removes registrations; the MCP client controls cancellation and recovery. Canonical results retain complete JSON for programmatic callers, while the text projection replaces binary blobs with descriptions. Returned text enters ordinary tool history; content is not fetched merely because a server connects.
66
+
67
+ When system-prompt assembly is composed, the client publishes nonblank server instructions as a scoped, server-attributed section. Instructions remain literal text and pass the configured size limit before publication. A replacement connection publishes instructions only after discovery succeeds; absent instructions add no section. The [system-prompt subsystem](system-prompt.md) owns assembly and recording.
68
+
69
+ -----
70
+
71
+ <a id="resource-provider-types"></a>
72
+ ## Resource provider types
73
+
74
+ The connection provider receives one operation and the original tool execution, including its caller and cancellation signal.
75
+
76
+ ```ts type-equiv
77
+ /** One supported resource operation, with server-owned cursors and URIs. */
78
+ type McpResourceRequest =
79
+ | { method: 'resources/list' | 'resources/templates/list'; cursor?: string }
80
+ | { method: 'resources/read'; uri: string }
81
+ ```
82
+
83
+ ```ts type-equiv
84
+ /** One configured server's resource access, owned by its MCP connection plugin. */
85
+ interface McpResourceProvider {
86
+ /**
87
+ * Run an operation against one live connection generation.
88
+ * @param request - MCP resource method and parameters.
89
+ * @param exec - caller identity and cancellation for this invocation.
90
+ * @returns the protocol result as lossless JSON.
91
+ */
92
+ request(request: McpResourceRequest, exec: ToolExecution): Promise<JsonValue>
93
+ }
94
+ ```
95
+
96
+ -----
97
+
98
+ <a id="limits"></a>
99
+ ## Limits
100
+
101
+ MCP prompt templates, human-input elicitation, task-based execution, and resource subscriptions are unsupported. Resource tools require a caller-visible configured server; binary resources remain programmatic data with text descriptions for the model. Servers without a tools capability connect with an empty tool set. Connection and discovery timeouts follow the SDK; the client has no separate settings for them.
102
+
103
+ -----
104
+
105
+ <a id="further-reading"></a>
106
+ ## Further reading
107
+
108
+ - [MCP package group](../../packages/mcp/README.md) — package entry points.
109
+ - [MCP resources](../../packages/mcp/mcp-resources/README.md) — shared tools and resource-provider semantics.
110
+ - [Resource visibility decision](../../.agents/notes/implemented/feature/2026-09-13-mcp-resources-in-profiles.md) — shared profile mounting and visibility from configured servers.
111
+ - [Third-party memory servers](../user/guide/mcp-memory.md) — product configuration guide.
112
+ - [Protocol negotiation decision](../../.agents/notes/implemented/feature/2026-09-12-mcp-sdk-protocol-negotiation.md) — SDK ownership and compatibility decisions.
113
+
114
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
115
+
116
+ <a id="cordis-surface"></a>
117
+
118
+ ## Cordis API
119
+
120
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
121
+
122
+ <a id="ctxmcpresources--mcpresourceruntime"></a>
123
+
124
+ ### `ctx.mcpResources` — `McpResourceRuntime`
125
+
126
+ Scoped resource access plus three tools shared by configured MCP servers.
127
+
128
+ ```ts cordis-catalog
129
+ /**
130
+ * Register one server and expose resource tools while that scope has providers.
131
+ * @param server - configured server name, unique in this scope.
132
+ * @param provider - connection-owned resource operations.
133
+ * @returns the effect disposer for this exact registration.
134
+ */
135
+ register(server: string, provider: McpResourceProvider): () => void
136
+ ```
137
+
138
+ Source: [`packages/mcp/mcp-resources/src/index.ts`](../../packages/mcp/mcp-resources/src/index.ts)
139
+ <!-- END GENERATED cordis-surface -->