dsh-plugin-guide 0.2.0 → 0.3.2

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 (373) hide show
  1. package/README.es.md +36 -18
  2. package/README.hi.md +36 -18
  3. package/README.md +38 -18
  4. package/README.pt.md +36 -18
  5. package/README.zh.md +38 -18
  6. package/SKILL.md +1 -1
  7. package/dist/dsh-plugin-dev.js +5 -5
  8. package/guide/links.md +1 -1
  9. package/guide/plugin-dev-guide.md +1 -1
  10. package/guide/quick-reference.es.md +2 -2
  11. package/guide/quick-reference.hi.md +2 -2
  12. package/guide/quick-reference.md +2 -2
  13. package/guide/quick-reference.pt.md +2 -2
  14. package/guide/quick-reference.zh-CN.md +3 -3
  15. package/package.json +13 -4
  16. package/references/cordis-paper-and-community.md +1 -1
  17. package/references/harness-repo.md +1 -1
  18. package/references/official-docs/AGENTS.md +27 -22
  19. package/references/official-docs/README.i18n.yaml +2 -2
  20. package/references/official-docs/README.md +1 -1
  21. package/references/official-docs/README.zh.md +19 -9
  22. package/references/official-docs/SNAPSHOT.md +5 -5
  23. package/references/official-docs/THIRD_PARTY_NOTICES.md +36 -13
  24. package/references/official-docs/docs/AGENTS.md +4 -4
  25. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
  26. package/references/official-docs/docs/agent-lifecycle.md +1 -1
  27. package/references/official-docs/docs/agent-lifecycle.zh.md +2 -2
  28. package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
  29. package/references/official-docs/docs/api-gateway.md +8 -8
  30. package/references/official-docs/docs/api-gateway.zh.md +8 -8
  31. package/references/official-docs/docs/architecture.i18n.yaml +2 -2
  32. package/references/official-docs/docs/architecture.md +23 -7
  33. package/references/official-docs/docs/architecture.zh.md +36 -20
  34. package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
  35. package/references/official-docs/docs/capability-seams.md +132 -67
  36. package/references/official-docs/docs/capability-seams.zh.md +132 -67
  37. package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
  38. package/references/official-docs/docs/config-catalog.md +659 -373
  39. package/references/official-docs/docs/config-catalog.zh.md +677 -391
  40. package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
  41. package/references/official-docs/docs/cookbook/adding-a-package.md +2 -3
  42. package/references/official-docs/docs/cookbook/adding-a-package.zh.md +8 -7
  43. package/references/official-docs/docs/cookbook/{adding-a-conversation-node.i18n.yaml → adding-a-remote-api.i18n.yaml} +3 -3
  44. package/references/official-docs/docs/cookbook/adding-a-remote-api.md +197 -0
  45. package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +197 -0
  46. package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +6 -0
  47. package/references/official-docs/docs/cookbook/adding-a-settings-card.md +102 -0
  48. package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +102 -0
  49. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
  50. package/references/official-docs/docs/cookbook/adding-a-tool.md +11 -4
  51. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +16 -9
  52. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
  53. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +2 -2
  54. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +4 -4
  55. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +2 -2
  56. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +1 -1
  57. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +3 -3
  58. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
  59. package/references/official-docs/docs/cookbook/extension-cookbook.md +9 -8
  60. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +17 -14
  61. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +1 -1
  62. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +1 -1
  63. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +1 -1
  64. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  65. package/references/official-docs/docs/cordis-api/context.i18n.yaml +1 -1
  66. package/references/official-docs/docs/cordis-api/context.zh.md +1 -1
  67. package/references/official-docs/docs/cordis-api/events.i18n.yaml +1 -1
  68. package/references/official-docs/docs/cordis-api/events.zh.md +1 -1
  69. package/references/official-docs/docs/cordis-api/inherited.md +1 -1
  70. package/references/official-docs/docs/cordis-primer.i18n.yaml +2 -2
  71. package/references/official-docs/docs/cordis-primer.md +2 -1
  72. package/references/official-docs/docs/cordis-primer.zh.md +3 -2
  73. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +1 -1
  74. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +4 -4
  75. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +1 -1
  76. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +4 -4
  77. package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +1 -1
  78. package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +4 -4
  79. package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +1 -1
  80. package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +4 -4
  81. package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +1 -1
  82. package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +2 -2
  83. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +1 -1
  84. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +3 -3
  85. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +2 -2
  86. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +5 -4
  87. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +11 -10
  88. package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +1 -1
  89. package/references/official-docs/docs/cordis-tutorial/index.zh.md +10 -10
  90. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +6 -0
  91. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +159 -0
  92. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +159 -0
  93. package/references/official-docs/docs/defensive-patterns.i18n.yaml +1 -1
  94. package/references/official-docs/docs/defensive-patterns.zh.md +3 -1
  95. package/references/official-docs/docs/development.i18n.yaml +2 -2
  96. package/references/official-docs/docs/development.md +9 -13
  97. package/references/official-docs/docs/development.zh.md +23 -21
  98. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
  99. package/references/official-docs/docs/event-producer-consumer.md +55 -46
  100. package/references/official-docs/docs/event-producer-consumer.zh.md +55 -46
  101. package/references/official-docs/docs/glossary.i18n.yaml +2 -2
  102. package/references/official-docs/docs/glossary.md +1 -1
  103. package/references/official-docs/docs/glossary.zh.md +1 -1
  104. package/references/official-docs/docs/graph-atlas.i18n.yaml +2 -2
  105. package/references/official-docs/docs/graph-atlas.md +0 -2
  106. package/references/official-docs/docs/graph-atlas.zh.md +7 -9
  107. package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
  108. package/references/official-docs/docs/i18n/README.md +7 -7
  109. package/references/official-docs/docs/i18n/README.zh.md +11 -9
  110. package/references/official-docs/docs/i18n/style-samples.md +3 -3
  111. package/references/official-docs/docs/i18n/translation-prompt.md +3 -3
  112. package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +2 -2
  113. package/references/official-docs/docs/i18n/translation-rules.md +2 -2
  114. package/references/official-docs/docs/i18n/translation-rules.zh.md +3 -3
  115. package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
  116. package/references/official-docs/docs/module-graph.md +666 -747
  117. package/references/official-docs/docs/module-graph.zh.md +668 -749
  118. package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
  119. package/references/official-docs/docs/persistence-catalog.md +160 -39
  120. package/references/official-docs/docs/persistence-catalog.zh.md +169 -48
  121. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +2 -2
  122. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +2 -2
  123. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +3 -3
  124. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +2 -2
  125. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +2 -2
  126. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +2 -2
  127. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +2 -2
  128. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +2 -2
  129. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +2 -2
  130. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +2 -2
  131. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +1 -1
  132. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +2 -2
  133. package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
  134. package/references/official-docs/docs/postmortem/README.zh.md +5 -5
  135. package/references/official-docs/docs/rescope.i18n.yaml +2 -2
  136. package/references/official-docs/docs/rescope.md +2 -2
  137. package/references/official-docs/docs/rescope.zh.md +3 -3
  138. package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
  139. package/references/official-docs/docs/subsystems/README.md +8 -2
  140. package/references/official-docs/docs/subsystems/README.zh.md +53 -47
  141. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +6 -0
  142. package/references/official-docs/docs/subsystems/agent-team.md +206 -0
  143. package/references/official-docs/docs/subsystems/agent-team.zh.md +206 -0
  144. package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
  145. package/references/official-docs/docs/subsystems/approval.md +12 -12
  146. package/references/official-docs/docs/subsystems/approval.zh.md +13 -13
  147. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
  148. package/references/official-docs/docs/subsystems/attachment.md +90 -7
  149. package/references/official-docs/docs/subsystems/attachment.zh.md +90 -7
  150. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
  151. package/references/official-docs/docs/subsystems/client-modules.md +69 -19
  152. package/references/official-docs/docs/subsystems/client-modules.zh.md +69 -19
  153. package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +2 -2
  154. package/references/official-docs/docs/subsystems/code-runtime.md +5 -5
  155. package/references/official-docs/docs/subsystems/code-runtime.zh.md +6 -6
  156. package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
  157. package/references/official-docs/docs/subsystems/commands.md +29 -6
  158. package/references/official-docs/docs/subsystems/commands.zh.md +30 -7
  159. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
  160. package/references/official-docs/docs/subsystems/compaction.md +5 -5
  161. package/references/official-docs/docs/subsystems/compaction.zh.md +11 -11
  162. package/references/official-docs/docs/subsystems/conversation.i18n.yaml +6 -0
  163. package/references/official-docs/docs/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +49 -24
  164. package/references/official-docs/docs/{cookbook/adding-a-conversation-node.zh.md → subsystems/conversation.zh.md} +49 -24
  165. package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
  166. package/references/official-docs/docs/subsystems/core.md +110 -33
  167. package/references/official-docs/docs/subsystems/core.zh.md +141 -62
  168. package/references/official-docs/docs/subsystems/credentials.i18n.yaml +2 -2
  169. package/references/official-docs/docs/subsystems/credentials.md +207 -11
  170. package/references/official-docs/docs/subsystems/credentials.zh.md +207 -11
  171. package/references/official-docs/docs/subsystems/extensions.i18n.yaml +2 -2
  172. package/references/official-docs/docs/subsystems/extensions.md +27 -9
  173. package/references/official-docs/docs/subsystems/extensions.zh.md +30 -12
  174. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
  175. package/references/official-docs/docs/subsystems/feedback.md +4 -4
  176. package/references/official-docs/docs/subsystems/feedback.zh.md +4 -4
  177. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
  178. package/references/official-docs/docs/subsystems/filesystem.md +17 -7
  179. package/references/official-docs/docs/subsystems/filesystem.zh.md +19 -9
  180. package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
  181. package/references/official-docs/docs/subsystems/goal.md +4 -4
  182. package/references/official-docs/docs/subsystems/goal.zh.md +8 -8
  183. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
  184. package/references/official-docs/docs/subsystems/invariants.md +2 -2
  185. package/references/official-docs/docs/subsystems/invariants.zh.md +5 -5
  186. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +2 -2
  187. package/references/official-docs/docs/subsystems/jobs.md +3 -3
  188. package/references/official-docs/docs/subsystems/jobs.zh.md +6 -6
  189. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
  190. package/references/official-docs/docs/subsystems/llm-streaming.md +193 -22
  191. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +199 -28
  192. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
  193. package/references/official-docs/docs/subsystems/lsp.md +2 -2
  194. package/references/official-docs/docs/subsystems/lsp.zh.md +3 -3
  195. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
  196. package/references/official-docs/docs/subsystems/permission-presets.md +8 -8
  197. package/references/official-docs/docs/subsystems/permission-presets.zh.md +8 -8
  198. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
  199. package/references/official-docs/docs/subsystems/persistence.md +35 -17
  200. package/references/official-docs/docs/subsystems/persistence.zh.md +38 -20
  201. package/references/official-docs/docs/subsystems/plan.i18n.yaml +2 -2
  202. package/references/official-docs/docs/subsystems/plan.md +4 -4
  203. package/references/official-docs/docs/subsystems/plan.zh.md +10 -10
  204. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
  205. package/references/official-docs/docs/subsystems/sandbox.md +5 -3
  206. package/references/official-docs/docs/subsystems/sandbox.zh.md +8 -6
  207. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
  208. package/references/official-docs/docs/subsystems/schedule.md +9 -3
  209. package/references/official-docs/docs/subsystems/schedule.zh.md +11 -5
  210. package/references/official-docs/docs/subsystems/scope.i18n.yaml +1 -1
  211. package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
  212. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
  213. package/references/official-docs/docs/subsystems/session-projection.md +136 -67
  214. package/references/official-docs/docs/subsystems/session-projection.zh.md +136 -67
  215. package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
  216. package/references/official-docs/docs/subsystems/session-query.md +11 -3
  217. package/references/official-docs/docs/subsystems/session-query.zh.md +12 -4
  218. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
  219. package/references/official-docs/docs/subsystems/session-reference.md +94 -7
  220. package/references/official-docs/docs/subsystems/session-reference.zh.md +95 -8
  221. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
  222. package/references/official-docs/docs/subsystems/session-telemetry.md +5 -6
  223. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +9 -10
  224. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
  225. package/references/official-docs/docs/subsystems/session-title.md +3 -3
  226. package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
  227. package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
  228. package/references/official-docs/docs/subsystems/session.md +273 -39
  229. package/references/official-docs/docs/subsystems/session.zh.md +290 -54
  230. package/references/official-docs/docs/subsystems/settings.i18n.yaml +2 -2
  231. package/references/official-docs/docs/subsystems/settings.md +105 -10
  232. package/references/official-docs/docs/subsystems/settings.zh.md +105 -10
  233. package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
  234. package/references/official-docs/docs/subsystems/shell.md +3 -3
  235. package/references/official-docs/docs/subsystems/shell.zh.md +11 -11
  236. package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
  237. package/references/official-docs/docs/subsystems/skills.md +26 -3
  238. package/references/official-docs/docs/subsystems/skills.zh.md +29 -6
  239. package/references/official-docs/docs/subsystems/slots.i18n.yaml +6 -0
  240. package/references/official-docs/docs/subsystems/slots.md +174 -0
  241. package/references/official-docs/docs/subsystems/slots.zh.md +174 -0
  242. package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
  243. package/references/official-docs/docs/subsystems/spill.md +4 -4
  244. package/references/official-docs/docs/subsystems/spill.zh.md +6 -6
  245. package/references/official-docs/docs/subsystems/storage.i18n.yaml +2 -2
  246. package/references/official-docs/docs/subsystems/storage.md +13 -5
  247. package/references/official-docs/docs/subsystems/storage.zh.md +16 -8
  248. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
  249. package/references/official-docs/docs/subsystems/subagent.md +120 -32
  250. package/references/official-docs/docs/subsystems/subagent.zh.md +131 -41
  251. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
  252. package/references/official-docs/docs/subsystems/subprocess.md +3 -3
  253. package/references/official-docs/docs/subsystems/subprocess.zh.md +5 -5
  254. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
  255. package/references/official-docs/docs/subsystems/system-prompt.md +21 -8
  256. package/references/official-docs/docs/subsystems/system-prompt.zh.md +23 -10
  257. package/references/official-docs/docs/subsystems/terminal.i18n.yaml +2 -2
  258. package/references/official-docs/docs/subsystems/terminal.md +2 -2
  259. package/references/official-docs/docs/subsystems/terminal.zh.md +4 -4
  260. package/references/official-docs/docs/subsystems/todo.i18n.yaml +6 -0
  261. package/references/official-docs/docs/subsystems/todo.md +32 -0
  262. package/references/official-docs/docs/subsystems/todo.zh.md +32 -0
  263. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
  264. package/references/official-docs/docs/subsystems/token-meter.md +27 -12
  265. package/references/official-docs/docs/subsystems/token-meter.zh.md +28 -13
  266. package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
  267. package/references/official-docs/docs/subsystems/tools.md +46 -46
  268. package/references/official-docs/docs/subsystems/tools.zh.md +54 -54
  269. package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
  270. package/references/official-docs/docs/subsystems/typert.md +65 -58
  271. package/references/official-docs/docs/subsystems/typert.zh.md +67 -60
  272. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
  273. package/references/official-docs/docs/subsystems/user-questions.md +35 -35
  274. package/references/official-docs/docs/subsystems/user-questions.zh.md +35 -35
  275. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +6 -0
  276. package/references/official-docs/docs/subsystems/web-client.md +95 -0
  277. package/references/official-docs/docs/subsystems/web-client.zh.md +95 -0
  278. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
  279. package/references/official-docs/docs/subsystems/web-server.md +55 -9
  280. package/references/official-docs/docs/subsystems/web-server.zh.md +56 -10
  281. package/references/official-docs/docs/subsystems/web.i18n.yaml +2 -2
  282. package/references/official-docs/docs/subsystems/web.md +14 -7
  283. package/references/official-docs/docs/subsystems/web.zh.md +16 -9
  284. package/references/official-docs/docs/subsystems/webhook.i18n.yaml +6 -0
  285. package/references/official-docs/docs/subsystems/webhook.md +70 -0
  286. package/references/official-docs/docs/subsystems/webhook.zh.md +70 -0
  287. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
  288. package/references/official-docs/docs/subsystems/workflow.md +8 -8
  289. package/references/official-docs/docs/subsystems/workflow.zh.md +13 -13
  290. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
  291. package/references/official-docs/docs/subsystems/workspace.md +98 -5
  292. package/references/official-docs/docs/subsystems/workspace.zh.md +102 -9
  293. package/references/official-docs/docs/testing.i18n.yaml +2 -2
  294. package/references/official-docs/docs/testing.md +15 -10
  295. package/references/official-docs/docs/testing.zh.md +15 -10
  296. package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
  297. package/references/official-docs/docs/tool-catalog.md +433 -27
  298. package/references/official-docs/docs/tool-catalog.zh.md +438 -29
  299. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
  300. package/references/official-docs/docs/tool-execution-pipeline.md +1 -1
  301. package/references/official-docs/docs/tool-execution-pipeline.zh.md +1 -1
  302. package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +2 -2
  303. package/references/official-docs/docs/user/develop/basic/config.md +1 -1
  304. package/references/official-docs/docs/user/develop/basic/config.zh.md +4 -4
  305. package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +1 -1
  306. package/references/official-docs/docs/user/develop/basic/index.zh.md +5 -5
  307. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
  308. package/references/official-docs/docs/user/develop/basic/publish.md +3 -3
  309. package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -7
  310. package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +2 -2
  311. package/references/official-docs/docs/user/develop/basic/tool.md +3 -3
  312. package/references/official-docs/docs/user/develop/basic/tool.zh.md +4 -4
  313. package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +2 -2
  314. package/references/official-docs/docs/user/develop/framework/events.md +2 -2
  315. package/references/official-docs/docs/user/develop/framework/events.zh.md +3 -3
  316. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +1 -1
  317. package/references/official-docs/docs/user/develop/framework/index.zh.md +3 -3
  318. package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +2 -2
  319. package/references/official-docs/docs/user/develop/framework/service.md +1 -1
  320. package/references/official-docs/docs/user/develop/framework/service.zh.md +3 -3
  321. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +6 -0
  322. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +15 -0
  323. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
  324. package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +2 -2
  325. package/references/official-docs/docs/user/develop/practice/index.md +1 -1
  326. package/references/official-docs/docs/user/develop/practice/index.zh.md +3 -3
  327. package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +2 -2
  328. package/references/official-docs/docs/user/develop/practice/llm-adapter.md +4 -3
  329. package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +4 -3
  330. package/references/official-docs/docs/user/guide/github-review.i18n.yaml +6 -0
  331. package/references/official-docs/docs/user/guide/github-review.md +102 -0
  332. package/references/official-docs/docs/user/guide/github-review.zh.md +102 -0
  333. package/references/official-docs/docs/user/guide/index.i18n.yaml +2 -2
  334. package/references/official-docs/docs/user/guide/index.md +2 -2
  335. package/references/official-docs/docs/user/guide/index.zh.md +8 -8
  336. package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +6 -0
  337. package/references/official-docs/docs/user/guide/mcp-memory.md +101 -0
  338. package/references/official-docs/docs/user/guide/mcp-memory.zh.md +101 -0
  339. package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
  340. package/references/official-docs/docs/user/guide/providers.md +40 -1
  341. package/references/official-docs/docs/user/guide/providers.zh.md +41 -2
  342. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
  343. package/references/official-docs/docs/user/guide/python-sdk.md +80 -34
  344. package/references/official-docs/docs/user/guide/python-sdk.zh.md +87 -41
  345. package/references/official-docs/docs/user/guide/schedule.i18n.yaml +6 -0
  346. package/references/official-docs/docs/user/guide/schedule.md +21 -0
  347. package/references/official-docs/docs/user/guide/schedule.zh.md +21 -0
  348. package/references/official-docs/docs/web-styling.i18n.yaml +1 -1
  349. package/references/official-docs/docs/web-styling.zh.md +2 -2
  350. package/references/official-docs/packages/AGENTS.md +3 -2
  351. package/references/official-docs/packages/README.md +104 -59
  352. package/references/official-docs/vendor/README.md +1 -0
  353. package/references/official-docs/website-docs.ts +52 -11
  354. package/references/sources.md +2 -2
  355. package/references/website-pages.md +3 -3
  356. package/scripts/check-docs-drift.ps1 +55 -0
  357. package/scripts/check-readme-sync.mjs +91 -0
  358. package/scripts/download-sources.ps1 +1 -1
  359. package/scripts/sync-official-docs.ps1 +19 -11
  360. package/scripts/verify-kit.ps1 +0 -4
  361. package/templates/js/README.es.md +1 -1
  362. package/templates/js/README.hi.md +1 -1
  363. package/templates/js/README.md +1 -1
  364. package/templates/js/README.pt.md +1 -1
  365. package/templates/js/README.zh.md +1 -1
  366. package/templates/js/package.json +4 -4
  367. package/templates/ts/README.es.md +1 -1
  368. package/templates/ts/README.hi.md +1 -1
  369. package/templates/ts/README.md +1 -1
  370. package/templates/ts/README.pt.md +1 -1
  371. package/templates/ts/README.zh.md +1 -1
  372. package/templates/ts/package.json +4 -4
  373. package/references/official-docs/examples/AGENTS.md +0 -20
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](system-prompt.md) | 中文
4
4
 
5
- [system-prompt 包](../../packages/core/system-prompt)负责管理提示词贡献者与一次组装调用之间交换的数据。该包的 [README](../../packages/core/system-prompt/README.md) 记录注册、排序、作用域与渲染行为;本页记录各插件实现或传递的确切跨包类型。
5
+ [system-prompt 包](../../packages/core/system-prompt)负责管理提示词贡献者与一次组装调用之间交换的数据。该包的 [README](../../packages/core/system-prompt/README.zh.md) 记录注册、排序、作用域与渲染行为;本页记录各插件实现或传递的确切跨包类型。
6
6
 
7
7
  源码:[`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts)。
8
8
 
@@ -39,7 +39,7 @@ interface ToolProviderResult {
39
39
 
40
40
  ## 提示词段落
41
41
 
42
- `PromptSection` 是一份只读的同进程注册约定。其文本可以是静态的,也可以从当前组装上下文动态解析。协作式组装完成后,一个有效的 `complete` 段会成为唯一的提示词段落。
42
+ `PromptSection` 是一份只读的同进程注册约定。其文本可以是静态的,也可以从当前组装上下文动态解析。各段先按 order 升序排列,再按名称的代码单元顺序排列;仓库贡献方通过 `getSectionOrder()` 解析服务持有的具名分配。Runtime-context 贡献方通过 `getContextOrder()` 解析独立分配。协作式组装完成后,一个有效的 `complete` 段会成为唯一的提示词段落。
43
43
 
44
44
  ```ts type-equiv
45
45
  /** One contributed section of the system prompt (registry input). */
@@ -47,9 +47,8 @@ interface PromptSection {
47
47
  /** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
48
48
  readonly name: string
49
49
  /**
50
- * Sections are concatenated in ascending order. Convention: `-100` is the
51
- * harness identity, `0` the deployment persona, tool guidance uses 100–199;
52
- * other negative orders also render before the persona.
50
+ * Sections are concatenated in ascending order. Equal orders use code-unit
51
+ * name order.
53
52
  */
54
53
  readonly order: number
55
54
  /**
@@ -90,7 +89,7 @@ interface PromptContext {
90
89
 
91
90
  ## Cordis API
92
91
 
93
- 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`) — this section is byte-identical in both language sides of the page. 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).
92
+ 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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
94
93
 
95
94
  <a id="ctxsystemprompt--systemprompt"></a>
96
95
 
@@ -109,6 +108,20 @@ Registry service for the prompt inputs assembled before each model step.
109
108
  */
110
109
  section(section: PromptSection): () => void
111
110
 
111
+ /**
112
+ * Resolve the centrally owned placement of a repository prompt section.
113
+ * @param name - stable section placement name.
114
+ * @returns the section's numeric sort order.
115
+ */
116
+ getSectionOrder(name: PromptSectionOrderName): number
117
+
118
+ /**
119
+ * Resolve the centrally owned placement of a repository runtime context.
120
+ * @param name - stable context placement name.
121
+ * @returns the context's numeric sort order.
122
+ */
123
+ getContextOrder(name: PromptContextOrderName): number
124
+
112
125
  /**
113
126
  * Register ordered dynamic context in the calling context's scope. Scoped
114
127
  * entries shadow global entries with the same name.
@@ -156,7 +169,7 @@ variable(name: string, provider: (context: AssembleContext) => string | undefine
156
169
  async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
157
170
  ```
158
171
 
159
- Source: [`packages/core/system-prompt/src/index.ts:338`](../../packages/core/system-prompt/src/index.ts)
172
+ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts)
160
173
 
161
174
  <a id="system-prompt-events"></a>
162
175
 
@@ -184,9 +197,9 @@ Expert waterfall over the assembled sections, contexts, tools, and variables. Sc
184
197
  'system-prompt/assemble'(this: Scoped<SystemPrompt>, assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly>
185
198
  ```
186
199
 
187
- Types: [Scoped](scope.md)
200
+ Types: [Scoped](scope.zh.md)
188
201
 
189
- Source: [`packages/core/system-prompt/src/index.ts:31`](../../packages/core/system-prompt/src/index.ts)
202
+ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts)
190
203
 
191
204
  <a id="system-promptchange--emit"></a>
192
205
 
@@ -203,5 +216,5 @@ Emitted when any prompt provider changes. This registry notification is unfilter
203
216
  'system-prompt/change'(): void
204
217
  ```
205
218
 
206
- Source: [`packages/core/system-prompt/src/index.ts:37`](../../packages/core/system-prompt/src/index.ts)
219
+ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts)
207
220
  <!-- 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/terminal.md
5
- terminal.md: eedf6157b256e83d3b57e07bf738429773b87574
6
- terminal.zh.md: 3cc2c281e8c2090bb7e92808f932be689fd0b710
5
+ terminal.md: c1c78963e48f51014678e778bbdc5da530f453c6
6
+ terminal.zh.md: e97e5771f5681ce98024394752405dca012b0a5e
@@ -96,7 +96,7 @@ interface TerminalSendResult {
96
96
 
97
97
  ## Cordis API
98
98
 
99
- 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`) — this section is byte-identical in both language sides of the page. 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).
99
+ 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).
100
100
 
101
101
  <a id="ctxterminals--terminalsessionservice"></a>
102
102
 
@@ -180,5 +180,5 @@ list(owner: Agent): TerminalSessionSnapshot[]
180
180
 
181
181
  Types: [Agent](core.md)
182
182
 
183
- Source: [`packages/terminal/terminal/src/index.ts:105`](../../packages/terminal/terminal/src/index.ts)
183
+ Source: [`packages/terminal/terminal/src/index.ts`](../../packages/terminal/terminal/src/index.ts)
184
184
  <!-- END GENERATED cordis-surface -->
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](terminal.md) | 中文
4
4
 
5
- PTY 后端、`ctx.terminals` 与面向模型的消费方共享的类型。[持久 PTY Agent Note](../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.md) 负责记录决策依据;本页记录来自 [`packages/terminal/terminal/src/types.ts`](../../packages/terminal/terminal/src/types.ts) 的跨包词汇。
5
+ PTY 后端、`ctx.terminals` 与面向模型的消费方共享的类型。[持久 PTY Agent Note](../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.zh.md) 负责记录决策依据;本页记录来自 [`packages/terminal/terminal/src/types.ts`](../../packages/terminal/terminal/src/types.ts) 的跨包词汇。
6
6
 
7
7
  ## 标识与就绪
8
8
 
@@ -96,7 +96,7 @@ interface TerminalSendResult {
96
96
 
97
97
  ## Cordis API
98
98
 
99
- 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`) — this section is byte-identical in both language sides of the page. 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).
99
+ 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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
100
100
 
101
101
  <a id="ctxterminals--terminalsessionservice"></a>
102
102
 
@@ -178,7 +178,7 @@ async kill(owner: Agent, id: TerminalSessionId, reason: string = 'model request'
178
178
  list(owner: Agent): TerminalSessionSnapshot[]
179
179
  ```
180
180
 
181
- Types: [Agent](core.md)
181
+ Types: [Agent](core.zh.md)
182
182
 
183
- Source: [`packages/terminal/terminal/src/index.ts:105`](../../packages/terminal/terminal/src/index.ts)
183
+ Source: [`packages/terminal/terminal/src/index.ts`](../../packages/terminal/terminal/src/index.ts)
184
184
  <!-- END GENERATED cordis-surface -->
@@ -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/todo.md
5
+ todo.md: 70eca60ff484572b6c1a62737816504830623726
6
+ todo.zh.md: 74f76f59b6cd132bb1c3722c7fef7f554554b242
@@ -0,0 +1,32 @@
1
+ # Todo
2
+
3
+ English | [中文](todo.zh.md)
4
+
5
+ The durable todo vocabulary owned by [`@deepseek-ai/dsh-tool-todo`](../../packages/todo/tool-todo/README.md). The model-facing tool replaces one agent session's whole list; the package also owns the event declaration, replay projection, and invariant companion. Tool behavior and configuration are on the [package README](../../packages/todo/tool-todo/README.md).
6
+
7
+ Source: [`packages/todo/tool-todo/src/types.ts`](../../packages/todo/tool-todo/src/types.ts)
8
+
9
+ ## `TodoItem` — one list entry
10
+
11
+ ```ts type-equiv
12
+ /**
13
+ * One entry in an agent's todo list — the unit of the `todo/write`
14
+ * whole-list snapshot declared by this package.
15
+ *
16
+ * Deliberately minimal: a human-readable `content` line and a three-state
17
+ * `status`. No id, priority, or `activeForm` — the list is replaced wholesale
18
+ * on every write (last-write-wins), so entries need no stable identity. The
19
+ * three statuses describe the complete portable lifecycle needed by model and
20
+ * UI consumers.
21
+ */
22
+ interface TodoItem {
23
+ /** What this task is — a short imperative line shown in the UI. */
24
+ content: string
25
+ /** Lifecycle state. `in_progress` marks a task being worked now; parallel work may mark several. */
26
+ status: 'pending' | 'in_progress' | 'completed'
27
+ }
28
+ ```
29
+
30
+ ## Durable event and invariant
31
+
32
+ The package declaration-merges `todo/write: { todos: TodoItem[] }` into `SessionEventMap`. The event is log-only and carries the complete replacement list; the generated [persistence catalog](../persistence-catalog.md#todowrite--log-only) records its declaration site. The package's invariant companion validates existing and newly announced sessions in one pass, then tracks committed turn boundaries incrementally so every live `todo/write` is checked before append without rescanning the log.
@@ -0,0 +1,32 @@
1
+ # Todo
2
+
3
+ [English](todo.md) | 中文
4
+
5
+ 本页记录 [`@deepseek-ai/dsh-tool-todo`](../../packages/todo/tool-todo/README.zh.md) 拥有的持久 todo 词汇。面向模型的工具会整体替换一个 agent(智能体)会话的列表;该包还拥有事件声明、回放投影和不变量配套插件。工具行为与配置见[包 README](../../packages/todo/tool-todo/README.zh.md)。
6
+
7
+ 源码:[`packages/todo/tool-todo/src/types.ts`](../../packages/todo/tool-todo/src/types.ts)
8
+
9
+ ## `TodoItem`:一条列表项
10
+
11
+ ```ts type-equiv
12
+ /**
13
+ * One entry in an agent's todo list — the unit of the `todo/write`
14
+ * whole-list snapshot declared by this package.
15
+ *
16
+ * Deliberately minimal: a human-readable `content` line and a three-state
17
+ * `status`. No id, priority, or `activeForm` — the list is replaced wholesale
18
+ * on every write (last-write-wins), so entries need no stable identity. The
19
+ * three statuses describe the complete portable lifecycle needed by model and
20
+ * UI consumers.
21
+ */
22
+ interface TodoItem {
23
+ /** What this task is — a short imperative line shown in the UI. */
24
+ content: string
25
+ /** Lifecycle state. `in_progress` marks a task being worked now; parallel work may mark several. */
26
+ status: 'pending' | 'in_progress' | 'completed'
27
+ }
28
+ ```
29
+
30
+ ## 持久事件与不变量
31
+
32
+ 该包通过声明合并把 `todo/write: { todos: TodoItem[] }` 加入 `SessionEventMap`。此事件仅写入日志,并携带完整替换列表;生成的[持久化目录](../persistence-catalog.zh.md#todowrite--log-only)会记录其声明位置。该包的不变量配套插件会单次遍历校验现有会话和新发布的会话,随后增量追踪已提交的轮次边界,使每个实时 `todo/write` 都能在追加前得到校验,而无需重新扫描日志。
@@ -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/token-meter.md
5
- token-meter.md: a1a096b800d895cabe9e05b751e23f06cea67d67
6
- token-meter.zh.md: 16e13e3d168c3cd67bdf12903045dd9b4056402f
5
+ token-meter.md: 9c4a1e4b95ffd84f65f7a73e208be245378a3301
6
+ token-meter.zh.md: d9e2e7f773041ccb6d1e4c3cc4d81a342db0cc01
@@ -19,14 +19,14 @@ interface TokenMeasurement {
19
19
  readonly surfaceDeltaTokens: number
20
20
  /** Non-negative current request-and-response pressure. */
21
21
  readonly totalTokens: number
22
- /** Total heuristic tokens across the current surface. */
22
+ /** Total route-priced request tokens across the current surface; equals the sum of the node prices. */
23
23
  readonly surfaceTokens: number
24
24
  /** Current surface nodes in positional head-to-tail order. */
25
25
  readonly nodes: readonly TokenSurfaceNode[]
26
26
  }
27
27
  ```
28
28
 
29
- `baseline.kind === 'usage'` means the latest successful provider call has the same canonical request envelope and its total is no lower than that call's full heuristic anchor. `estimated` means no reusable conservative usage anchor exists, so the service priced the complete envelope and surface with its fixed heuristic. A later successful request replaces the earlier anchor; signed `surfaceDeltaTokens` preserves growth and shrinkage relative to a matching anchor. `totalTokens` remains request-and-response pressure, while `surfaceTokens` is the surface-only heuristic total and equals the sum of the node prices.
29
+ Every measurement resolves the effective envelope's routed provider/model to that route's declared request-image pricing through `ctx.llm`, so image occurrences are priced as the visual tokens plus model-visible text the request actually sends; routes and compositions without declared pricing keep the fixed heuristic. `baseline.kind === 'usage'` means the latest successful provider call has the same canonical request envelope and its total is no lower than that call's full route-priced anchor. `estimated` means no reusable conservative usage anchor exists, so the service priced the complete envelope and surface itself. A later successful request replaces the earlier anchor; signed `surfaceDeltaTokens` preserves growth and shrinkage relative to a matching anchor, repricing both sides under the same route. `totalTokens` remains request-and-response pressure, while `surfaceTokens` is the surface-only route-priced total and equals the sum of the node prices.
30
30
 
31
31
  ## `TokenSurfaceNode`
32
32
 
@@ -35,8 +35,19 @@ interface TokenMeasurement {
35
35
  interface TokenSurfaceNode {
36
36
  /** Durable sequence number of the surface event. */
37
37
  readonly seq: number
38
- /** Heuristic tokens for the exact message projected by this node. */
38
+ /**
39
+ * Request-pressure tokens for the exact message projected by this node under
40
+ * the measured route: image occurrences carry the route's declared visual
41
+ * price when the routed adapter declares one, and the fixed heuristic
42
+ * otherwise. Trigger, retention, and range selection all read this price.
43
+ */
39
44
  readonly tokens: number
45
+ /**
46
+ * Fixed-heuristic tokens for the same message, independent of any route.
47
+ * The shadow-price protocol prices replacements with this value so the O(1)
48
+ * projection fold stays in agreement with its own appends.
49
+ */
50
+ readonly heuristicTokens: number
40
51
  }
41
52
  ```
42
53
 
@@ -48,7 +59,7 @@ Surface order is authoritative; replacement nodes can have higher durable seqs t
48
59
 
49
60
  ## Cordis API
50
61
 
51
- 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`) — this section is byte-identical in both language sides of the page. 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).
62
+ 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).
52
63
 
53
64
  <a id="ctxtokenmeter--tokenmeter"></a>
54
65
 
@@ -60,14 +71,18 @@ Replay owner for one service-wide estimator and isolated per-session folds.
60
71
  /**
61
72
  * Measure current request pressure and surface through the durable tail.
62
73
  *
63
- * Provider usage is reused only when the latest successful call's canonical
64
- * request envelope matches `requestHeader` and its total is no lower than
65
- * that call's full heuristic anchor; otherwise the complete envelope and
66
- * surface are heuristically repriced.
74
+ * The effective envelope's routed provider/model selects the request-image
75
+ * pricing every node is priced under: a route whose adapter declares image
76
+ * pricing charges each retained image its visual tokens plus its
77
+ * model-visible text, while other routes keep the fixed heuristic. Provider
78
+ * usage is reused only when the latest successful call's canonical request
79
+ * envelope matches `requestHeader` and its total is no lower than that
80
+ * call's full route-priced anchor; otherwise the complete envelope and
81
+ * surface are repriced.
67
82
  *
68
- * `requestHeader` affects request pressure only; surface fields always
69
- * describe the current session surface. Every call clones those positional
70
- * nodes, so measurement is O(surface).
83
+ * `requestHeader` replaces the latest logged envelope for pressure and node
84
+ * pricing; the node set always describes the current session surface. Every
85
+ * call clones those positional nodes, so measurement is O(surface).
71
86
  *
72
87
  * @param session - session to replay through its current durable tail.
73
88
  * @param requestHeader - optional effective request envelope replacing the latest logged header.
@@ -86,5 +101,5 @@ estimateMessage(message: Message): number
86
101
 
87
102
  Types: [EpochHeader](session.md) · [Message](llm-streaming.md) · [Session](session.md)
88
103
 
89
- Source: [`packages/llm/token-meter/src/index.ts:74`](../../packages/llm/token-meter/src/index.ts)
104
+ Source: [`packages/llm/token-meter/src/index.ts`](../../packages/llm/token-meter/src/index.ts)
90
105
  <!-- END GENERATED cordis-surface -->
@@ -19,14 +19,14 @@ interface TokenMeasurement {
19
19
  readonly surfaceDeltaTokens: number
20
20
  /** Non-negative current request-and-response pressure. */
21
21
  readonly totalTokens: number
22
- /** Total heuristic tokens across the current surface. */
22
+ /** Total route-priced request tokens across the current surface; equals the sum of the node prices. */
23
23
  readonly surfaceTokens: number
24
24
  /** Current surface nodes in positional head-to-tail order. */
25
25
  readonly nodes: readonly TokenSurfaceNode[]
26
26
  }
27
27
  ```
28
28
 
29
- `baseline.kind === 'usage'` 表示最近一次成功的提供方调用具有相同的规范请求 envelope,且该调用的总量不低于其完整启发式锚点。`estimated` 表示不存在可复用的保守 usage 锚点,因此服务使用固定启发式规则对完整信封和表层定价。后续成功请求会替换早先的锚点;有符号的 `surfaceDeltaTokens` 会保留相对于匹配锚点的增长与缩减。`totalTokens` 仍表示请求与响应压力,`surfaceTokens` 则是仅针对表层的启发式总量,等于所有节点价格之和。
29
+ 每次计量都会通过 `ctx.llm` 把生效信封的路由 provider/model 解析为该路由声明的请求图片定价,因此图片出现处按请求实际发送的视觉 token 加模型可见文本计价;未声明定价的路由与组合保持固定启发式规则。`baseline.kind === 'usage'` 表示最近一次成功的提供方调用具有相同的规范请求 envelope,且该调用的总量不低于其完整路由定价锚点。`estimated` 表示不存在可复用的保守 usage 锚点,因此服务自行对完整信封和表层定价。后续成功请求会替换早先的锚点;有符号的 `surfaceDeltaTokens` 会保留相对于匹配锚点的增长与缩减,且两侧按同一路由重新定价。`totalTokens` 仍表示请求与响应压力,`surfaceTokens` 则是表层的路由定价总量,等于所有节点价格之和。
30
30
 
31
31
  ## `TokenSurfaceNode`
32
32
 
@@ -35,8 +35,19 @@ interface TokenMeasurement {
35
35
  interface TokenSurfaceNode {
36
36
  /** Durable sequence number of the surface event. */
37
37
  readonly seq: number
38
- /** Heuristic tokens for the exact message projected by this node. */
38
+ /**
39
+ * Request-pressure tokens for the exact message projected by this node under
40
+ * the measured route: image occurrences carry the route's declared visual
41
+ * price when the routed adapter declares one, and the fixed heuristic
42
+ * otherwise. Trigger, retention, and range selection all read this price.
43
+ */
39
44
  readonly tokens: number
45
+ /**
46
+ * Fixed-heuristic tokens for the same message, independent of any route.
47
+ * The shadow-price protocol prices replacements with this value so the O(1)
48
+ * projection fold stays in agreement with its own appends.
49
+ */
50
+ readonly heuristicTokens: number
40
51
  }
41
52
  ```
42
53
 
@@ -48,7 +59,7 @@ interface TokenSurfaceNode {
48
59
 
49
60
  ## Cordis API
50
61
 
51
- 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`) — this section is byte-identical in both language sides of the page. 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).
62
+ 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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
52
63
 
53
64
  <a id="ctxtokenmeter--tokenmeter"></a>
54
65
 
@@ -60,14 +71,18 @@ Replay owner for one service-wide estimator and isolated per-session folds.
60
71
  /**
61
72
  * Measure current request pressure and surface through the durable tail.
62
73
  *
63
- * Provider usage is reused only when the latest successful call's canonical
64
- * request envelope matches `requestHeader` and its total is no lower than
65
- * that call's full heuristic anchor; otherwise the complete envelope and
66
- * surface are heuristically repriced.
74
+ * The effective envelope's routed provider/model selects the request-image
75
+ * pricing every node is priced under: a route whose adapter declares image
76
+ * pricing charges each retained image its visual tokens plus its
77
+ * model-visible text, while other routes keep the fixed heuristic. Provider
78
+ * usage is reused only when the latest successful call's canonical request
79
+ * envelope matches `requestHeader` and its total is no lower than that
80
+ * call's full route-priced anchor; otherwise the complete envelope and
81
+ * surface are repriced.
67
82
  *
68
- * `requestHeader` affects request pressure only; surface fields always
69
- * describe the current session surface. Every call clones those positional
70
- * nodes, so measurement is O(surface).
83
+ * `requestHeader` replaces the latest logged envelope for pressure and node
84
+ * pricing; the node set always describes the current session surface. Every
85
+ * call clones those positional nodes, so measurement is O(surface).
71
86
  *
72
87
  * @param session - session to replay through its current durable tail.
73
88
  * @param requestHeader - optional effective request envelope replacing the latest logged header.
@@ -84,7 +99,7 @@ measure(session: Session, requestHeader?: EpochHeader): TokenMeasurement
84
99
  estimateMessage(message: Message): number
85
100
  ```
86
101
 
87
- Types: [EpochHeader](session.md) · [Message](llm-streaming.md) · [Session](session.md)
102
+ Types: [EpochHeader](session.zh.md) · [Message](llm-streaming.zh.md) · [Session](session.zh.md)
88
103
 
89
- Source: [`packages/llm/token-meter/src/index.ts:74`](../../packages/llm/token-meter/src/index.ts)
104
+ Source: [`packages/llm/token-meter/src/index.ts`](../../packages/llm/token-meter/src/index.ts)
90
105
  <!-- 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/tools.md
5
- tools.md: eb9c21f31e2929c7caea3ab905d1e9941b97ef6d
6
- tools.zh.md: 033cc0e8ca52dd52bb92df32de309293d2e14bd4
5
+ tools.md: 9939e8ab9fff9fa5bd23fd370e07f6296a608824
6
+ tools.zh.md: 52e812a35d6932a5ed00a86a3d3fe71460b26cd4
@@ -157,7 +157,7 @@ Registration is a trusted same-process contract. The registry borrows the typed
157
157
  ```ts type-equiv
158
158
  /**
159
159
  * Per-scope filter over global tools. Restrictions intersect and do not affect
160
- * scoped registrations or the reserved Code Mode transport.
160
+ * scoped registrations or the reserved PTC mode transport.
161
161
  */
162
162
  interface ToolRestriction {
163
163
  /** Global tool names that stay visible; everything else is removed. */
@@ -183,23 +183,23 @@ type ToolExecutionToken = symbol & { readonly [toolExecutionTokenBrand]: true }
183
183
  * callers do not choose that token.
184
184
  */
185
185
  interface ToolExecutionInput {
186
- readonly callId: CallId
186
+ readonly callId: ToolCallId
187
187
  /**
188
188
  * Root model-requested call owning this execution tree. Callers omit it for
189
189
  * a root execution; nested dispatchers propagate the enclosing value.
190
190
  */
191
- readonly rootCallId?: CallId
191
+ readonly rootCallId?: ToolCallId
192
192
  readonly name: string
193
193
  /** Losslessly JSON-serializable parsed arguments (tools validate their own schema). */
194
194
  readonly arguments: unknown
195
195
  /** The agent on whose behalf the call runs (set by the agent loop). */
196
196
  readonly agent?: Agent
197
197
  /**
198
- * Opaque token of the enclosing transport execution, when one exists. Code
199
- * Mode sets this on SDK sub-dispatches so commit-style observers can wait for
198
+ * Opaque token of the enclosing transport execution, when one exists. PTC
199
+ * mode sets this on SDK sub-dispatches so commit-style observers can wait for
200
200
  * the outer `run_code` outcome without receiving its live mutable execution.
201
201
  * The token also marks the call as a transport sub-dispatch rather than a
202
- * model-direct call: under `mode: 'code'`, only calls WITH a parent may
202
+ * model-direct call: under `mode: 'ptc'`, only calls WITH a parent may
203
203
  * execute a native tool name — a model-direct call (no parent) is denied as
204
204
  * `UNKNOWN_TOOL` before the policy pipeline. See {@link ToolRuntime.execute}.
205
205
  */
@@ -252,25 +252,25 @@ type ToolExecutionMode =
252
252
  | { kind: 'exclusive' }
253
253
  ```
254
254
 
255
- Code Mode's bridge additionally exposes each settled sub-dispatch to the `tools/code-dispatch-log` waterfall, which may change the durable event's copy of the content (the program's value and model-visible result remain untouched):
255
+ PTC mode's bridge additionally exposes each settled sub-dispatch to the `tools/ptc-dispatch-log` waterfall, which may change the durable event's copy of the content (the program's value and model-visible result remain untouched):
256
256
 
257
257
  ```ts type-equiv
258
258
  /**
259
259
  * One settled `run_code` sub-dispatch about to be logged, as seen by the
260
- * `tools/code-dispatch-log` waterfall: the parent execution (session owner,
260
+ * `tools/ptc-dispatch-log` waterfall: the parent execution (session owner,
261
261
  * outer call identity), the sub-call identity, and the outcome whose durable
262
262
  * copy a listener may reshape. `content` is the RENDERED result projection
263
263
  * (what a native `tool/result` would carry) — the program itself received
264
264
  * the structured `value` (or just the error message on failure); only the
265
265
  * `tool/code-dispatch` event's copy changes.
266
266
  */
267
- interface CodeDispatchLog {
267
+ interface PtcDispatchLog {
268
268
  /** The outer `run_code` execution. */
269
269
  readonly exec: ToolExecution
270
270
  /** The calling agent (the scope routing key and the spill owner), when the outer call has one. */
271
271
  readonly agent?: Agent
272
272
  /** Deterministic sub-call id (`<parent>:code:<n>`). */
273
- readonly subCallId: CallId
273
+ readonly subCallId: ToolCallId
274
274
  /** The dispatched sub-tool name. */
275
275
  readonly name: string
276
276
  /** Whether the sub-call settled as an error. */
@@ -290,7 +290,7 @@ interface CodeDispatchLog {
290
290
  */
291
291
  interface ToolExecution extends ToolExecutionInput {
292
292
  /** Root model-requested call, resolved for every root and nested execution. */
293
- readonly rootCallId: CallId
293
+ readonly rootCallId: ToolCallId
294
294
  /** Registry-assigned identity shared with nested calls only as their opaque `parent` token. */
295
295
  readonly token: ToolExecutionToken
296
296
  }
@@ -473,7 +473,7 @@ The full presentation field docs live in [`packages/core/tools/src/presentation.
473
473
 
474
474
  ## Cordis API
475
475
 
476
- 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`) — this section is byte-identical in both language sides of the page. 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).
476
+ 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).
477
477
 
478
478
  <a id="ctxtools--toolruntime"></a>
479
479
 
@@ -488,7 +488,7 @@ Tool registry and execution pipeline. Scoped registrations shadow globals; one v
488
488
  * declaration covers every agent joined under it.
489
489
  *
490
490
  * Scoped only, and one declaration per scope: this is how an agent preset
491
- * composes Code Mode agents beside native ones in the same process, and a
491
+ * composes PTC mode agents beside native ones in the same process, and a
492
492
  * process-global override would be the `mode` config field instead.
493
493
  * @param mode - the presentation the covered agents' models see.
494
494
  * @returns the exact disposer that restores the deployment default.
@@ -571,7 +571,7 @@ async execute(exec: ToolExecutionInput): Promise<ToolExecutionResult>
571
571
 
572
572
  Types: [ScopeKey](scope.md)
573
573
 
574
- Source: [`packages/core/tools/src/index.ts:787`](../../packages/core/tools/src/index.ts)
574
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
575
575
 
576
576
  <a id="tools-events"></a>
577
577
 
@@ -596,34 +596,7 @@ A tool was registered or unregistered, or a scoped restriction changed (the avai
596
596
  'tools/change'(): void
597
597
  ```
598
598
 
599
- Source: [`packages/core/tools/src/index.ts:207`](../../packages/core/tools/src/index.ts)
600
-
601
- <a id="toolscode-dispatch-log--waterfall"></a>
602
-
603
- #### `tools/code-dispatch-log` — waterfall
604
-
605
- Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/code-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy's preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.
606
-
607
- ```ts cordis-catalog
608
- /**
609
- * Allow a listener to replace content in the DURABLE LOG COPY of one
610
- * `run_code` sub-dispatch outcome before the bridge appends its
611
- * `tool/code-dispatch` event. `next()` keeps the
612
- * content unchanged; a listener may return replacement blocks (e.g. the
613
- * spill policy's preview + locator for an oversized text result). Only the
614
- * logged copy is affected — the program already received the complete
615
- * value, and the model sees neither. A throwing listener is contained:
616
- * the bridge falls back to logging the original settled content.
617
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.
618
- * @param dispatch - the parent execution, sub-call identity, and the settled content to log.
619
- * @mode waterfall
620
- */
621
- 'tools/code-dispatch-log'(this: Scoped<ToolRuntime>, dispatch: CodeDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>
622
- ```
623
-
624
- Types: [ContentBlock](llm-streaming.md) · [Scoped](scope.md)
625
-
626
- Source: [`packages/core/tools/src/index.ts:189`](../../packages/core/tools/src/index.ts)
599
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
627
600
 
628
601
  <a id="toolsexecute--waterfall"></a>
629
602
 
@@ -647,7 +620,7 @@ Around-dispatch waterfall for timeout, retry, or metrics. `next()` returns a nor
647
620
 
648
621
  Types: [Scoped](scope.md)
649
622
 
650
- Source: [`packages/core/tools/src/index.ts:163`](../../packages/core/tools/src/index.ts)
623
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
651
624
 
652
625
  <a id="toolspost-execute--waterfall"></a>
653
626
 
@@ -672,7 +645,7 @@ Accept, replace, enrich, or block a normalized dispatch result. `next()` accepts
672
645
 
673
646
  Types: [Scoped](scope.md)
674
647
 
675
- Source: [`packages/core/tools/src/index.ts:175`](../../packages/core/tools/src/index.ts)
648
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
676
649
 
677
650
  <a id="toolspre-execute--waterfall"></a>
678
651
 
@@ -695,7 +668,34 @@ Allow, deny, or ask before dispatch. `next()` delegates to allow; missing approv
695
668
 
696
669
  Types: [Scoped](scope.md)
697
670
 
698
- Source: [`packages/core/tools/src/index.ts:152`](../../packages/core/tools/src/index.ts)
671
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
672
+
673
+ <a id="toolsptc-dispatch-log--waterfall"></a>
674
+
675
+ #### `tools/ptc-dispatch-log` — waterfall
676
+
677
+ Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/code-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy's preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.
678
+
679
+ ```ts cordis-catalog
680
+ /**
681
+ * Allow a listener to replace content in the DURABLE LOG COPY of one
682
+ * `run_code` sub-dispatch outcome before the bridge appends its
683
+ * `tool/code-dispatch` event. `next()` keeps the
684
+ * content unchanged; a listener may return replacement blocks (e.g. the
685
+ * spill policy's preview + locator for an oversized text result). Only the
686
+ * logged copy is affected — the program already received the complete
687
+ * value, and the model sees neither. A throwing listener is contained:
688
+ * the bridge falls back to logging the original settled content.
689
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.
690
+ * @param dispatch - the parent execution, sub-call identity, and the settled content to log.
691
+ * @mode waterfall
692
+ */
693
+ 'tools/ptc-dispatch-log'(this: Scoped<ToolRuntime>, dispatch: PtcDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>
694
+ ```
695
+
696
+ Types: [ContentBlock](llm-streaming.md) · [Scoped](scope.md)
697
+
698
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
699
699
 
700
700
  <a id="toolsresult--emit"></a>
701
701
 
@@ -716,5 +716,5 @@ Observe the frozen, lossless-JSON final outcome. Listener failures are contained
716
716
 
717
717
  Types: [Scoped](scope.md)
718
718
 
719
- Source: [`packages/core/tools/src/index.ts:197`](../../packages/core/tools/src/index.ts)
719
+ Source: [`packages/core/tools/src/index.ts`](../../packages/core/tools/src/index.ts)
720
720
  <!-- END GENERATED cordis-surface -->