dsh-plugin-guide 0.1.0

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 (374) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE.md +26 -0
  3. package/README.es.md +139 -0
  4. package/README.hi.md +138 -0
  5. package/README.md +165 -0
  6. package/README.pt.md +139 -0
  7. package/README.zh-CN.md +164 -0
  8. package/SKILL.md +69 -0
  9. package/cordis.patch.yml +4 -0
  10. package/guide/links.md +92 -0
  11. package/guide/plugin-dev-guide.md +429 -0
  12. package/guide/quick-reference.es.md +176 -0
  13. package/guide/quick-reference.hi.md +176 -0
  14. package/guide/quick-reference.md +176 -0
  15. package/guide/quick-reference.pt.md +176 -0
  16. package/guide/quick-reference.zh-CN.md +175 -0
  17. package/index.js +58 -0
  18. package/package.json +83 -0
  19. package/references/community-ecosystem.md +201 -0
  20. package/references/community-repo-deep-dive.md +695 -0
  21. package/references/cordis-paper-and-community.md +326 -0
  22. package/references/harness-repo.md +654 -0
  23. package/references/official-docs/AGENTS.md +149 -0
  24. package/references/official-docs/BENCHMARK.md +3 -0
  25. package/references/official-docs/CLAUDE.md +1 -0
  26. package/references/official-docs/CONTRIBUTING.i18n.yaml +6 -0
  27. package/references/official-docs/CONTRIBUTING.md +23 -0
  28. package/references/official-docs/CONTRIBUTING.zh.md +23 -0
  29. package/references/official-docs/LICENSE +21 -0
  30. package/references/official-docs/README.i18n.yaml +6 -0
  31. package/references/official-docs/README.md +35 -0
  32. package/references/official-docs/README.zh.md +74 -0
  33. package/references/official-docs/SNAPSHOT.md +16 -0
  34. package/references/official-docs/THIRD_PARTY_NOTICES.md +192 -0
  35. package/references/official-docs/docs/AGENTS.md +75 -0
  36. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +6 -0
  37. package/references/official-docs/docs/agent-lifecycle.md +82 -0
  38. package/references/official-docs/docs/agent-lifecycle.zh.md +84 -0
  39. package/references/official-docs/docs/api-gateway.i18n.yaml +6 -0
  40. package/references/official-docs/docs/api-gateway.md +164 -0
  41. package/references/official-docs/docs/api-gateway.zh.md +164 -0
  42. package/references/official-docs/docs/architecture.i18n.yaml +6 -0
  43. package/references/official-docs/docs/architecture.md +129 -0
  44. package/references/official-docs/docs/architecture.zh.md +133 -0
  45. package/references/official-docs/docs/capability-seams.i18n.yaml +6 -0
  46. package/references/official-docs/docs/capability-seams.md +471 -0
  47. package/references/official-docs/docs/capability-seams.zh.md +473 -0
  48. package/references/official-docs/docs/config-catalog.i18n.yaml +6 -0
  49. package/references/official-docs/docs/config-catalog.md +3151 -0
  50. package/references/official-docs/docs/config-catalog.zh.md +3152 -0
  51. package/references/official-docs/docs/cookbook/adding-a-conversation-node.i18n.yaml +6 -0
  52. package/references/official-docs/docs/cookbook/adding-a-conversation-node.md +233 -0
  53. package/references/official-docs/docs/cookbook/adding-a-conversation-node.zh.md +233 -0
  54. package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +6 -0
  55. package/references/official-docs/docs/cookbook/adding-a-package.md +118 -0
  56. package/references/official-docs/docs/cookbook/adding-a-package.zh.md +118 -0
  57. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +6 -0
  58. package/references/official-docs/docs/cookbook/adding-a-tool.md +94 -0
  59. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +96 -0
  60. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +6 -0
  61. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +59 -0
  62. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +59 -0
  63. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +6 -0
  64. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +43 -0
  65. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
  66. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +6 -0
  67. package/references/official-docs/docs/cookbook/extension-cookbook.md +129 -0
  68. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +131 -0
  69. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +6 -0
  70. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.md +64 -0
  71. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  72. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +6 -0
  73. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  74. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  75. package/references/official-docs/docs/cordis-api/context.i18n.yaml +6 -0
  76. package/references/official-docs/docs/cordis-api/context.md +364 -0
  77. package/references/official-docs/docs/cordis-api/context.zh.md +366 -0
  78. package/references/official-docs/docs/cordis-api/events.i18n.yaml +6 -0
  79. package/references/official-docs/docs/cordis-api/events.md +207 -0
  80. package/references/official-docs/docs/cordis-api/events.zh.md +209 -0
  81. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +6 -0
  82. package/references/official-docs/docs/cordis-api/fiber.md +375 -0
  83. package/references/official-docs/docs/cordis-api/fiber.zh.md +377 -0
  84. package/references/official-docs/docs/cordis-api/inherited.md +39 -0
  85. package/references/official-docs/docs/cordis-api/registry.i18n.yaml +6 -0
  86. package/references/official-docs/docs/cordis-api/registry.md +152 -0
  87. package/references/official-docs/docs/cordis-api/registry.zh.md +154 -0
  88. package/references/official-docs/docs/cordis-api/service.i18n.yaml +6 -0
  89. package/references/official-docs/docs/cordis-api/service.md +102 -0
  90. package/references/official-docs/docs/cordis-api/service.zh.md +104 -0
  91. package/references/official-docs/docs/cordis-primer.i18n.yaml +6 -0
  92. package/references/official-docs/docs/cordis-primer.md +44 -0
  93. package/references/official-docs/docs/cordis-primer.zh.md +50 -0
  94. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +6 -0
  95. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.md +95 -0
  96. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
  97. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +6 -0
  98. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  99. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  100. package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +6 -0
  101. package/references/official-docs/docs/cordis-tutorial/03-services.md +98 -0
  102. package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +98 -0
  103. package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +6 -0
  104. package/references/official-docs/docs/cordis-tutorial/04-events.md +144 -0
  105. package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +144 -0
  106. package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +6 -0
  107. package/references/official-docs/docs/cordis-tutorial/05-config.md +84 -0
  108. package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +84 -0
  109. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +6 -0
  110. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
  111. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  112. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +6 -0
  113. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +107 -0
  114. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +107 -0
  115. package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +6 -0
  116. package/references/official-docs/docs/cordis-tutorial/index.md +60 -0
  117. package/references/official-docs/docs/cordis-tutorial/index.zh.md +62 -0
  118. package/references/official-docs/docs/defensive-patterns.i18n.yaml +6 -0
  119. package/references/official-docs/docs/defensive-patterns.md +33 -0
  120. package/references/official-docs/docs/defensive-patterns.zh.md +33 -0
  121. package/references/official-docs/docs/development.i18n.yaml +6 -0
  122. package/references/official-docs/docs/development.md +171 -0
  123. package/references/official-docs/docs/development.zh.md +171 -0
  124. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +6 -0
  125. package/references/official-docs/docs/event-producer-consumer.md +76 -0
  126. package/references/official-docs/docs/event-producer-consumer.zh.md +78 -0
  127. package/references/official-docs/docs/glossary.i18n.yaml +6 -0
  128. package/references/official-docs/docs/glossary.md +45 -0
  129. package/references/official-docs/docs/glossary.zh.md +45 -0
  130. package/references/official-docs/docs/graph-atlas.i18n.yaml +6 -0
  131. package/references/official-docs/docs/graph-atlas.md +24 -0
  132. package/references/official-docs/docs/graph-atlas.zh.md +26 -0
  133. package/references/official-docs/docs/i18n/README.i18n.yaml +6 -0
  134. package/references/official-docs/docs/i18n/README.md +60 -0
  135. package/references/official-docs/docs/i18n/README.zh.md +60 -0
  136. package/references/official-docs/docs/i18n/style-samples.md +87 -0
  137. package/references/official-docs/docs/i18n/terminology.md +214 -0
  138. package/references/official-docs/docs/i18n/translation-prompt.md +263 -0
  139. package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +6 -0
  140. package/references/official-docs/docs/i18n/translation-rules.md +69 -0
  141. package/references/official-docs/docs/i18n/translation-rules.zh.md +69 -0
  142. package/references/official-docs/docs/module-graph.i18n.yaml +6 -0
  143. package/references/official-docs/docs/module-graph.md +1638 -0
  144. package/references/official-docs/docs/module-graph.zh.md +1640 -0
  145. package/references/official-docs/docs/persistence-catalog.i18n.yaml +6 -0
  146. package/references/official-docs/docs/persistence-catalog.md +944 -0
  147. package/references/official-docs/docs/persistence-catalog.zh.md +946 -0
  148. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +6 -0
  149. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  150. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  151. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +6 -0
  152. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  153. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  154. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +6 -0
  155. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  156. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  157. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +6 -0
  158. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  159. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  160. package/references/official-docs/docs/postmortem/README.i18n.yaml +6 -0
  161. package/references/official-docs/docs/postmortem/README.md +18 -0
  162. package/references/official-docs/docs/postmortem/README.zh.md +18 -0
  163. package/references/official-docs/docs/rescope.i18n.yaml +6 -0
  164. package/references/official-docs/docs/rescope.md +53 -0
  165. package/references/official-docs/docs/rescope.zh.md +53 -0
  166. package/references/official-docs/docs/subsystems/README.i18n.yaml +6 -0
  167. package/references/official-docs/docs/subsystems/README.md +55 -0
  168. package/references/official-docs/docs/subsystems/README.zh.md +55 -0
  169. package/references/official-docs/docs/subsystems/approval.i18n.yaml +6 -0
  170. package/references/official-docs/docs/subsystems/approval.md +170 -0
  171. package/references/official-docs/docs/subsystems/approval.zh.md +170 -0
  172. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +6 -0
  173. package/references/official-docs/docs/subsystems/attachment.md +115 -0
  174. package/references/official-docs/docs/subsystems/attachment.zh.md +115 -0
  175. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +6 -0
  176. package/references/official-docs/docs/subsystems/client-modules.md +118 -0
  177. package/references/official-docs/docs/subsystems/client-modules.zh.md +118 -0
  178. package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +6 -0
  179. package/references/official-docs/docs/subsystems/code-runtime.md +191 -0
  180. package/references/official-docs/docs/subsystems/code-runtime.zh.md +191 -0
  181. package/references/official-docs/docs/subsystems/commands.i18n.yaml +6 -0
  182. package/references/official-docs/docs/subsystems/commands.md +187 -0
  183. package/references/official-docs/docs/subsystems/commands.zh.md +187 -0
  184. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +6 -0
  185. package/references/official-docs/docs/subsystems/compaction.md +238 -0
  186. package/references/official-docs/docs/subsystems/compaction.zh.md +238 -0
  187. package/references/official-docs/docs/subsystems/core.i18n.yaml +6 -0
  188. package/references/official-docs/docs/subsystems/core.md +1070 -0
  189. package/references/official-docs/docs/subsystems/core.zh.md +1078 -0
  190. package/references/official-docs/docs/subsystems/credentials.i18n.yaml +6 -0
  191. package/references/official-docs/docs/subsystems/credentials.md +133 -0
  192. package/references/official-docs/docs/subsystems/credentials.zh.md +133 -0
  193. package/references/official-docs/docs/subsystems/extensions.i18n.yaml +6 -0
  194. package/references/official-docs/docs/subsystems/extensions.md +364 -0
  195. package/references/official-docs/docs/subsystems/extensions.zh.md +364 -0
  196. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +6 -0
  197. package/references/official-docs/docs/subsystems/feedback.md +266 -0
  198. package/references/official-docs/docs/subsystems/feedback.zh.md +266 -0
  199. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +6 -0
  200. package/references/official-docs/docs/subsystems/filesystem.md +495 -0
  201. package/references/official-docs/docs/subsystems/filesystem.zh.md +495 -0
  202. package/references/official-docs/docs/subsystems/goal.i18n.yaml +6 -0
  203. package/references/official-docs/docs/subsystems/goal.md +277 -0
  204. package/references/official-docs/docs/subsystems/goal.zh.md +277 -0
  205. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +6 -0
  206. package/references/official-docs/docs/subsystems/invariants.md +88 -0
  207. package/references/official-docs/docs/subsystems/invariants.zh.md +88 -0
  208. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +6 -0
  209. package/references/official-docs/docs/subsystems/jobs.md +290 -0
  210. package/references/official-docs/docs/subsystems/jobs.zh.md +290 -0
  211. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +6 -0
  212. package/references/official-docs/docs/subsystems/llm-streaming.md +888 -0
  213. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +894 -0
  214. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +6 -0
  215. package/references/official-docs/docs/subsystems/lsp.md +202 -0
  216. package/references/official-docs/docs/subsystems/lsp.zh.md +202 -0
  217. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +6 -0
  218. package/references/official-docs/docs/subsystems/permission-presets.md +131 -0
  219. package/references/official-docs/docs/subsystems/permission-presets.zh.md +131 -0
  220. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +6 -0
  221. package/references/official-docs/docs/subsystems/persistence.md +385 -0
  222. package/references/official-docs/docs/subsystems/persistence.zh.md +385 -0
  223. package/references/official-docs/docs/subsystems/plan.i18n.yaml +6 -0
  224. package/references/official-docs/docs/subsystems/plan.md +87 -0
  225. package/references/official-docs/docs/subsystems/plan.zh.md +87 -0
  226. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +6 -0
  227. package/references/official-docs/docs/subsystems/sandbox.md +218 -0
  228. package/references/official-docs/docs/subsystems/sandbox.zh.md +218 -0
  229. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +6 -0
  230. package/references/official-docs/docs/subsystems/schedule.md +186 -0
  231. package/references/official-docs/docs/subsystems/schedule.zh.md +186 -0
  232. package/references/official-docs/docs/subsystems/scope.i18n.yaml +6 -0
  233. package/references/official-docs/docs/subsystems/scope.md +59 -0
  234. package/references/official-docs/docs/subsystems/scope.zh.md +59 -0
  235. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +6 -0
  236. package/references/official-docs/docs/subsystems/session-projection.md +262 -0
  237. package/references/official-docs/docs/subsystems/session-projection.zh.md +262 -0
  238. package/references/official-docs/docs/subsystems/session-query.i18n.yaml +6 -0
  239. package/references/official-docs/docs/subsystems/session-query.md +495 -0
  240. package/references/official-docs/docs/subsystems/session-query.zh.md +495 -0
  241. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +6 -0
  242. package/references/official-docs/docs/subsystems/session-reference.md +108 -0
  243. package/references/official-docs/docs/subsystems/session-reference.zh.md +108 -0
  244. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +6 -0
  245. package/references/official-docs/docs/subsystems/session-telemetry.md +194 -0
  246. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +194 -0
  247. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +6 -0
  248. package/references/official-docs/docs/subsystems/session-title.md +204 -0
  249. package/references/official-docs/docs/subsystems/session-title.zh.md +204 -0
  250. package/references/official-docs/docs/subsystems/session.i18n.yaml +6 -0
  251. package/references/official-docs/docs/subsystems/session.md +849 -0
  252. package/references/official-docs/docs/subsystems/session.zh.md +851 -0
  253. package/references/official-docs/docs/subsystems/settings.i18n.yaml +6 -0
  254. package/references/official-docs/docs/subsystems/settings.md +310 -0
  255. package/references/official-docs/docs/subsystems/settings.zh.md +310 -0
  256. package/references/official-docs/docs/subsystems/shell.i18n.yaml +6 -0
  257. package/references/official-docs/docs/subsystems/shell.md +303 -0
  258. package/references/official-docs/docs/subsystems/shell.zh.md +303 -0
  259. package/references/official-docs/docs/subsystems/skills.i18n.yaml +6 -0
  260. package/references/official-docs/docs/subsystems/skills.md +331 -0
  261. package/references/official-docs/docs/subsystems/skills.zh.md +331 -0
  262. package/references/official-docs/docs/subsystems/spill.i18n.yaml +6 -0
  263. package/references/official-docs/docs/subsystems/spill.md +117 -0
  264. package/references/official-docs/docs/subsystems/spill.zh.md +117 -0
  265. package/references/official-docs/docs/subsystems/storage.i18n.yaml +6 -0
  266. package/references/official-docs/docs/subsystems/storage.md +229 -0
  267. package/references/official-docs/docs/subsystems/storage.zh.md +229 -0
  268. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +6 -0
  269. package/references/official-docs/docs/subsystems/subagent.md +734 -0
  270. package/references/official-docs/docs/subsystems/subagent.zh.md +736 -0
  271. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +6 -0
  272. package/references/official-docs/docs/subsystems/subprocess.md +324 -0
  273. package/references/official-docs/docs/subsystems/subprocess.zh.md +324 -0
  274. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +6 -0
  275. package/references/official-docs/docs/subsystems/system-prompt.md +207 -0
  276. package/references/official-docs/docs/subsystems/system-prompt.zh.md +207 -0
  277. package/references/official-docs/docs/subsystems/terminal.i18n.yaml +6 -0
  278. package/references/official-docs/docs/subsystems/terminal.md +184 -0
  279. package/references/official-docs/docs/subsystems/terminal.zh.md +184 -0
  280. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +6 -0
  281. package/references/official-docs/docs/subsystems/token-meter.md +90 -0
  282. package/references/official-docs/docs/subsystems/token-meter.zh.md +90 -0
  283. package/references/official-docs/docs/subsystems/tools.i18n.yaml +6 -0
  284. package/references/official-docs/docs/subsystems/tools.md +720 -0
  285. package/references/official-docs/docs/subsystems/tools.zh.md +720 -0
  286. package/references/official-docs/docs/subsystems/typert.i18n.yaml +6 -0
  287. package/references/official-docs/docs/subsystems/typert.md +336 -0
  288. package/references/official-docs/docs/subsystems/typert.zh.md +336 -0
  289. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +6 -0
  290. package/references/official-docs/docs/subsystems/user-questions.md +178 -0
  291. package/references/official-docs/docs/subsystems/user-questions.zh.md +178 -0
  292. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +6 -0
  293. package/references/official-docs/docs/subsystems/web-server.md +108 -0
  294. package/references/official-docs/docs/subsystems/web-server.zh.md +108 -0
  295. package/references/official-docs/docs/subsystems/web.i18n.yaml +6 -0
  296. package/references/official-docs/docs/subsystems/web.md +199 -0
  297. package/references/official-docs/docs/subsystems/web.zh.md +199 -0
  298. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +6 -0
  299. package/references/official-docs/docs/subsystems/workflow.md +278 -0
  300. package/references/official-docs/docs/subsystems/workflow.zh.md +278 -0
  301. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +6 -0
  302. package/references/official-docs/docs/subsystems/workspace.md +228 -0
  303. package/references/official-docs/docs/subsystems/workspace.zh.md +228 -0
  304. package/references/official-docs/docs/testing.i18n.yaml +6 -0
  305. package/references/official-docs/docs/testing.md +49 -0
  306. package/references/official-docs/docs/testing.zh.md +49 -0
  307. package/references/official-docs/docs/tool-catalog.i18n.yaml +6 -0
  308. package/references/official-docs/docs/tool-catalog.md +1873 -0
  309. package/references/official-docs/docs/tool-catalog.zh.md +1878 -0
  310. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +6 -0
  311. package/references/official-docs/docs/tool-execution-pipeline.md +62 -0
  312. package/references/official-docs/docs/tool-execution-pipeline.zh.md +64 -0
  313. package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +6 -0
  314. package/references/official-docs/docs/user/develop/basic/config.md +106 -0
  315. package/references/official-docs/docs/user/develop/basic/config.zh.md +106 -0
  316. package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +6 -0
  317. package/references/official-docs/docs/user/develop/basic/index.md +144 -0
  318. package/references/official-docs/docs/user/develop/basic/index.zh.md +144 -0
  319. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +6 -0
  320. package/references/official-docs/docs/user/develop/basic/publish.md +183 -0
  321. package/references/official-docs/docs/user/develop/basic/publish.zh.md +183 -0
  322. package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +6 -0
  323. package/references/official-docs/docs/user/develop/basic/tool.md +52 -0
  324. package/references/official-docs/docs/user/develop/basic/tool.zh.md +52 -0
  325. package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +6 -0
  326. package/references/official-docs/docs/user/develop/framework/events.md +143 -0
  327. package/references/official-docs/docs/user/develop/framework/events.zh.md +143 -0
  328. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +6 -0
  329. package/references/official-docs/docs/user/develop/framework/index.md +137 -0
  330. package/references/official-docs/docs/user/develop/framework/index.zh.md +137 -0
  331. package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +6 -0
  332. package/references/official-docs/docs/user/develop/framework/service.md +148 -0
  333. package/references/official-docs/docs/user/develop/framework/service.zh.md +150 -0
  334. package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +6 -0
  335. package/references/official-docs/docs/user/develop/practice/index.md +155 -0
  336. package/references/official-docs/docs/user/develop/practice/index.zh.md +155 -0
  337. package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +6 -0
  338. package/references/official-docs/docs/user/develop/practice/llm-adapter.md +188 -0
  339. package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +188 -0
  340. package/references/official-docs/docs/user/guide/index.i18n.yaml +6 -0
  341. package/references/official-docs/docs/user/guide/index.md +30 -0
  342. package/references/official-docs/docs/user/guide/index.zh.md +30 -0
  343. package/references/official-docs/docs/user/guide/providers-custom-form.png +0 -0
  344. package/references/official-docs/docs/user/guide/providers-custom-form.zh.png +0 -0
  345. package/references/official-docs/docs/user/guide/providers-models-page.png +0 -0
  346. package/references/official-docs/docs/user/guide/providers-models-page.zh.png +0 -0
  347. package/references/official-docs/docs/user/guide/providers.i18n.yaml +6 -0
  348. package/references/official-docs/docs/user/guide/providers.md +98 -0
  349. package/references/official-docs/docs/user/guide/providers.zh.md +98 -0
  350. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +6 -0
  351. package/references/official-docs/docs/user/guide/python-sdk.md +104 -0
  352. package/references/official-docs/docs/user/guide/python-sdk.zh.md +104 -0
  353. package/references/official-docs/docs/user/index.i18n.yaml +6 -0
  354. package/references/official-docs/docs/user/index.md +11 -0
  355. package/references/official-docs/docs/user/index.zh.md +11 -0
  356. package/references/official-docs/docs/web-styling.i18n.yaml +6 -0
  357. package/references/official-docs/docs/web-styling.md +25 -0
  358. package/references/official-docs/docs/web-styling.zh.md +25 -0
  359. package/references/official-docs/examples/AGENTS.md +20 -0
  360. package/references/official-docs/packages/AGENTS.md +27 -0
  361. package/references/official-docs/packages/README.md +69 -0
  362. package/references/official-docs/vendor/README.md +60 -0
  363. package/references/official-docs/website-docs.ts +524 -0
  364. package/references/sources.md +137 -0
  365. package/references/upstream-cordis.md +594 -0
  366. package/references/website-pages.md +668 -0
  367. package/scripts/archive-discussions.ps1 +154 -0
  368. package/scripts/download-community-articles.ps1 +188 -0
  369. package/scripts/download-community-repos.ps1 +232 -0
  370. package/scripts/download-sources.ps1 +195 -0
  371. package/scripts/gen-topic-snapshot.ps1 +91 -0
  372. package/scripts/install-skill.ps1 +63 -0
  373. package/scripts/sync-official-docs.ps1 +130 -0
  374. package/scripts/verify-kit.ps1 +191 -0
@@ -0,0 +1,170 @@
1
+ # 用户审批
2
+
3
+ [English](approval.md) | 中文
4
+
5
+ [dsh-user-approval](../../packages/interaction/user-approval) 的用户审批 seam 回答一个问题:这个具体操作是否可以继续?它拥有共享的请求/结果词汇、`ctx.approval` 分发服务、`approval/request` 应答者 waterfall(瀑布式事件)、仅记录日志的审计事件对,以及按会话的 `ask`/`never` 策略。UI 通道可以提供人类应答者;[ACP(Agent Client Protocol)自动化桥接层](../../packages/acp/acp)为其拥有的 agent(智能体)提供一次性机器决策。调用方如 [dsh-tools](../../packages/core/tools) 和 [dsh-tool-bash](../../packages/shell/tool-bash) 消费闭合的结果,除非结果为 `allowed-once`,否则一律拒绝。
6
+
7
+ 源码:[`packages/interaction/user-approval/src/index.ts`](../../packages/interaction/user-approval/src/index.ts)
8
+
9
+ ## 标识与结果
10
+
11
+ 每个请求都会获得一个全新的 `ApprovalRequestId`。该品牌类型将 `approval/asked` 与 `approval/decided` 审计事件配对,同时不会让审批 id 与工具调用 id 或 agent/会话 id 互换。
12
+
13
+ ```ts type-equiv
14
+ /**
15
+ * Pairs one `approval/asked` audit event with its `approval/decided`.
16
+ * Service-issued (one fresh id per {@link ApprovalService.request} call).
17
+ */
18
+ type ApprovalRequestId = Branded<'ApprovalRequestId'>
19
+ ```
20
+
21
+ `ApprovalOutcome` 是闭合的,且失败时拒绝。`allowed-once` 仅授权所询问的那一个操作;调用方对 `rejected`、`cancelled` 和 `unavailable` 均执行拒绝。缺失、不负责该请求、抛异常或不合规的应答者会产生 `unavailable`,而非放行。
22
+
23
+ ```ts type-equiv
24
+ /**
25
+ * Closed approval outcomes: a one-shot grant, explicit rejection, withdrawn
26
+ * request, or unavailable answerer. Callers fail closed on `unavailable`.
27
+ */
28
+ type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable'
29
+ ```
30
+
31
+ ## 按会话策略
32
+
33
+ `ApprovalPolicy` 决定在交互式应答者运行之前发生什么。`ask` 委托给组合的应答者链,链的无应答默认值为 `unavailable`;`never` 确定性地返回 `rejected`,不分发任何应答者。生效值为会话日志中最后一条 `approval/policy` 事件,回退到服务配置。`setApprovalPolicy(session, policy)` 是唯一的写入路径,因此回放能重建覆盖值。
34
+
35
+ ```ts type-equiv
36
+ /**
37
+ * A session's approval policy — what happens to an {@link ApprovalService}
38
+ * ask BEFORE any interactive answerer sees it:
39
+ *
40
+ * - `'ask'` (the default) — delegate to the composed answerers; with none
41
+ * composed the chain falls through to the fail-closed `'unavailable'`.
42
+ * - `'never'` — never prompt anyone: every ask resolves `'rejected'`
43
+ * deterministically. The strict headless stance (CI, unattended runs) and
44
+ * the policy whose outcome is knowable without asking.
45
+ */
46
+ type ApprovalPolicy = 'ask' | 'never'
47
+ ```
48
+
49
+ 两种策略都会将各自完整的当前含义贡献给缓存安全的运行时上下文快照。带来源的 `user/message` 是持久化且模型可见的输入;审批状态变化时,会在保留的历史后追加一份新的完整快照,而不改写请求头中的系统提示词。
50
+
51
+ ## 审批请求
52
+
53
+ `ApprovalRequest` 以足够精确的方式标识 agent 和工具操作,以便路由和审计该问题。它有意省略工具参数:应答者通过 `callId` 将提示附加到已流式输出的工具调用上,而非渲染另一份可能漂移的副本。
54
+
55
+ ```ts type-equiv
56
+ /**
57
+ * Readonly same-process permission question. `callId` links to an already
58
+ * presented tool call, so arguments are not duplicated here.
59
+ */
60
+ interface ApprovalRequest {
61
+ /**
62
+ * The agent on whose behalf the question is asked. Routes the question (a
63
+ * UI answerer only answers for agents it owns) and receives the audit
64
+ * events on its session log.
65
+ */
66
+ readonly agent: Agent
67
+ /** The tool the question is about (presentation and audit). */
68
+ readonly toolName: string
69
+ /**
70
+ * The exact tool call being decided, when the asker has one — lets a UI
71
+ * attach the prompt to the tool call it already streamed.
72
+ */
73
+ readonly callId?: CallId
74
+ /** The asker's human-readable explanation of WHY it is asking. */
75
+ readonly reason?: string
76
+ /**
77
+ * Aborting withdraws the question: the request settles `'cancelled'`
78
+ * immediately and a late answer from a still-pending answerer is discarded.
79
+ */
80
+ readonly signal?: AbortSignal
81
+ }
82
+ ```
83
+
84
+ ## 分发与审计
85
+
86
+ `ctx.approval.request(req)` 要求发起请求的会话处于一个尚未结束的轮次内。它追加 `approval/asked`,获取一个结果,追加对应的 `approval/decided`,然后以该结果完成。`never` 策略在服务内部、waterfall 分发之前强制执行,因此即使后来以 `prepend` 注册的应答者也无法绕过它。应答者在负责处理该请求时返回结果,否则调用 `next()` 委托;第一个应答占据唯一的决策槽位。
87
+
88
+ 审计事件仅写入日志,不进入模型 transcript(文本记录)。模型可见的行为是调用方派生的工具结果与当前运行时上下文快照。服务 dispose(资源释放)时会移除其上下文贡献;应答者监听器独立地通过 effect 绑定到其所属插件。
89
+
90
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
91
+
92
+ <a id="cordis-surface"></a>
93
+
94
+ ## Cordis API
95
+
96
+ 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).
97
+
98
+ <a id="ctxapproval--approvalservice"></a>
99
+
100
+ ### `ctx.approval` — `ApprovalService`
101
+
102
+ Approval service that applies session policy before answerers and logs every ask/outcome pair to the requesting session. It exposes deterministic policy changes to the model through the runtime-context snapshot and switch notices.
103
+
104
+ ```ts cordis-catalog
105
+ /**
106
+ * Switch one live agent's policy and queue the transition for its next model
107
+ * step. Session initialization uses {@link setApprovalPolicy} directly
108
+ * because there is no previously visible policy to change.
109
+ * @param agent - the live agent whose policy is changing.
110
+ * @param policy - the new effective policy.
111
+ */
112
+ setPolicy(agent: Agent, policy: ApprovalPolicy): void
113
+
114
+ /**
115
+ * Ask the composed answerers to decide one readonly same-process request.
116
+ * The service borrows the request, agent, session, and live signal directly.
117
+ * The request requires an open turn because the audit pair must be enclosed
118
+ * by the durable log's commit/replay boundary; an idle ask rejects before
119
+ * appending anything. The answerer phase always produces an outcome: an
120
+ * aborted signal yields `'cancelled'`, a missing or throwing answerer yields
121
+ * `'unavailable'` (fail closed), and a rogue non-vocabulary return value is
122
+ * normalized to `'unavailable'`. A failure that prevents either audit append
123
+ * from committing still rejects because returning an unlogged decision would
124
+ * violate the pair. Session contains post-commit observer failures, so an
125
+ * authoritative append cannot reject the request or suppress its matching
126
+ * audit event.
127
+ * @param req - the pending decision (agent, tool identity, reason, signal).
128
+ * @returns the closed outcome; `'allowed-once'` is the only grant.
129
+ * @throws when no turn is open or either audit event fails before the session
130
+ * append commit point.
131
+ */
132
+ async request(req: ApprovalRequest): Promise<ApprovalOutcome>
133
+
134
+ /**
135
+ * Read the session override without applying the configured default.
136
+ * @param session - session whose log supplies the override.
137
+ * @returns the last logged policy, or `undefined` without one.
138
+ */
139
+ overrideOf(session: Session): ApprovalPolicy | undefined
140
+ ```
141
+
142
+ Types: [Agent](core.md) · [Session](session.md)
143
+
144
+ Source: [`packages/interaction/user-approval/src/index.ts:192`](../../packages/interaction/user-approval/src/index.ts)
145
+
146
+ <a id="approval-events"></a>
147
+
148
+ ### `approval/*` events
149
+
150
+ <a id="approvalrequest--waterfall"></a>
151
+
152
+ #### `approval/request` — waterfall
153
+
154
+ Ask composed answerers for one decision. Return an outcome to claim the request or call `next()`; failure yields the fail-closed default. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
155
+
156
+ ```ts cordis-catalog
157
+ /**
158
+ * Ask composed answerers for one decision. Return an outcome to claim the
159
+ * request or call `next()`; failure yields the fail-closed default.
160
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
161
+ * @param req - the pending decision (agent, tool identity, reason, signal).
162
+ * @mode waterfall
163
+ */
164
+ 'approval/request'(this: Scoped<ApprovalService>, req: ApprovalRequest, next: () => Promise<ApprovalOutcome>): Promise<ApprovalOutcome>
165
+ ```
166
+
167
+ Types: [Scoped](scope.md)
168
+
169
+ Source: [`packages/interaction/user-approval/src/index.ts:30`](../../packages/interaction/user-approval/src/index.ts)
170
+ <!-- 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/attachment.md
5
+ attachment.md: ff7f14ceae8d4f8055d5cfd4367373729dc5ecbc
6
+ attachment.zh.md: 63769e621b8e088cda9bd49fbf23d08db8058669
@@ -0,0 +1,115 @@
1
+ # Durable Image Attachments
2
+
3
+ English | [中文](attachment.zh.md)
4
+
5
+ The attachment seam separates binary image ownership from the session log. A producer gives validated encoded bytes to [`ctx.attachments`](#ctxattachments--attachmentstore-abstract-seam); the service publishes an immutable content-addressed reference only after the object is durable. Session events and model-visible `ImageBlock`s contain that reference and metadata, never a browser object URL, host temporary path, provider URL, or base64 payload.
6
+
7
+ Unsent browser drafts may stay in memory and native clients may stage them in operating-system temporary storage. Once the host accepts a user message, its images move below `<DSH_HOME>/attachments/v1` before the user event is appended. Structured model image output follows the same persist-before-event rule.
8
+
9
+ Source: [`packages/attachment/attachment/src/types.ts`](../../packages/attachment/attachment/src/types.ts)
10
+
11
+ ## Identity and verified metadata
12
+
13
+ `AttachmentId` is a branded opaque string. The local backend currently emits `sha256:<digest>`, but consumers must neither parse that representation nor derive a filesystem path from it.
14
+
15
+ ```ts type-equiv
16
+ /** Raster image formats accepted by the version-one attachment path. */
17
+ type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif'
18
+ ```
19
+
20
+ ```ts type-equiv
21
+ /** Durable, serializable metadata for one immutable image object. */
22
+ interface ImageAttachmentRef {
23
+ /** Opaque storage identifier; never a filesystem path or bearer URL. */
24
+ attachmentId: AttachmentId
25
+ /** Media type verified from the stored bytes. */
26
+ mediaType: ImageMediaType
27
+ /** Exact encoded byte length. */
28
+ bytes: number
29
+ /** Intrinsic encoded width in pixels. */
30
+ width: number
31
+ /** Intrinsic encoded height in pixels. */
32
+ height: number
33
+ /** Optional display name stripped of local path information. */
34
+ name?: string
35
+ }
36
+ ```
37
+
38
+ ```ts type-equiv
39
+ /** Deployment-resolved limits used by upload admission and request buffering. */
40
+ interface ImageAttachmentLimits {
41
+ maxImageBytes: number
42
+ maxImagesPerMessage: number
43
+ maxMessageImageBytes: number
44
+ maxImagePixels: number
45
+ mediaTypes: readonly ImageMediaType[]
46
+ }
47
+ ```
48
+
49
+ The reference records intrinsic dimensions and encoded length so clients can lay out history without decoding first, while every authoritative read still re-checks digest, media signature, dimensions, and metadata against the object.
50
+
51
+ ## Commit and verified-read payloads
52
+
53
+ ```ts type-equiv
54
+ /** Request to validate and durably commit one image. */
55
+ interface SaveImageAttachment {
56
+ data: Uint8Array
57
+ /** Caller-declared media type, checked against fully decoded bytes. */
58
+ mediaType: ImageMediaType
59
+ /** Optional browser/provider display name; it is never interpreted as a path. */
60
+ name?: string
61
+ }
62
+ ```
63
+
64
+ ```ts type-equiv
65
+ /** Stored image bytes returned after reference and digest verification. */
66
+ interface StoredImageAttachment {
67
+ ref: ImageAttachmentRef
68
+ data: Uint8Array
69
+ }
70
+ ```
71
+
72
+ `saveImage()` validates bytes and atomically commits one object before returning its reference. `validateImage()` runs the same admission checks without persisting anything; batch callers validate every member through it before saving any member, so validation rejection leaves no partial objects behind. `readImage()` accepts a reference from an authorized session path and returns bytes only after integrity verification. The service is deliberately retention-neutral: resumed and forked sessions may share objects, so reference-aware garbage collection is deferred rather than tied to any one session's deletion.
73
+
74
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
75
+
76
+ <a id="cordis-surface"></a>
77
+
78
+ ## Cordis API
79
+
80
+ 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).
81
+
82
+ <a id="ctxattachments--attachmentstore-abstract-seam"></a>
83
+
84
+ ### `ctx.attachments` — `AttachmentStore` (abstract seam)
85
+
86
+ Immutable binary attachment service. Implementations validate bytes before publishing a reference.
87
+
88
+ ```ts cordis-catalog
89
+ /**
90
+ * Validate one image without persisting it.
91
+ * Batch callers validate every member before saving any member.
92
+ * @param input - encoded bytes, declared media type, and optional display name.
93
+ * @returns completion after the encoded raster has been fully decoded.
94
+ */
95
+ abstract validateImage(input: SaveImageAttachment): Promise<void>
96
+
97
+ /**
98
+ * Validate and durably commit one image before its owning session event is appended.
99
+ * @param input - encoded bytes, declared media type, and optional display name.
100
+ * @returns a durable content-addressed reference.
101
+ */
102
+ abstract saveImage(input: SaveImageAttachment): Promise<ImageAttachmentRef>
103
+
104
+ /**
105
+ * Read one image and verify that bytes still match the recorded reference.
106
+ * @param ref - durable reference from the session log.
107
+ * @param signal - optional cancellation for backend read and verification work.
108
+ * @returns the verified bytes and canonical reference.
109
+ * @throws the signal reason when aborted, or a storage error when verification fails.
110
+ */
111
+ abstract readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise<StoredImageAttachment>
112
+ ```
113
+
114
+ Source: [`packages/attachment/attachment/src/index.ts:29`](../../packages/attachment/attachment/src/index.ts)
115
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,115 @@
1
+ # 持久图片附件
2
+
3
+ [English](attachment.md) | 中文
4
+
5
+ 附件 seam 将二进制图片的所有权与会话日志分离。生产方把经过校验的编码字节交给 [`ctx.attachments`](#ctxattachments--attachmentstore-abstract-seam);只有对象完成持久化后,该服务才会发布不可变的内容寻址引用。会话事件和模型可见的 `ImageBlock` 包含该引用及其元数据,绝不包含浏览器对象 URL、宿主临时路径、提供方 URL 或 base64 数据。
6
+
7
+ 未发送的浏览器草稿可以保留在内存中,原生客户端也可以将其暂存于操作系统临时存储。宿主接受用户消息后,会先把消息中的图片移到 `<DSH_HOME>/attachments/v1` 下,再追加用户事件。结构化模型图片输出遵循同样的先持久化、后追加事件规则。
8
+
9
+ 来源:[`packages/attachment/attachment/src/types.ts`](../../packages/attachment/attachment/src/types.ts)
10
+
11
+ ## 标识与经过校验的元数据
12
+
13
+ `AttachmentId` 是带类型标记的不透明字符串。本地后端目前生成 `sha256:<digest>`,但消费方既不能解析这种表示,也不能据此派生文件系统路径。
14
+
15
+ ```ts type-equiv
16
+ /** Raster image formats accepted by the version-one attachment path. */
17
+ type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif'
18
+ ```
19
+
20
+ ```ts type-equiv
21
+ /** Durable, serializable metadata for one immutable image object. */
22
+ interface ImageAttachmentRef {
23
+ /** Opaque storage identifier; never a filesystem path or bearer URL. */
24
+ attachmentId: AttachmentId
25
+ /** Media type verified from the stored bytes. */
26
+ mediaType: ImageMediaType
27
+ /** Exact encoded byte length. */
28
+ bytes: number
29
+ /** Intrinsic encoded width in pixels. */
30
+ width: number
31
+ /** Intrinsic encoded height in pixels. */
32
+ height: number
33
+ /** Optional display name stripped of local path information. */
34
+ name?: string
35
+ }
36
+ ```
37
+
38
+ ```ts type-equiv
39
+ /** Deployment-resolved limits used by upload admission and request buffering. */
40
+ interface ImageAttachmentLimits {
41
+ maxImageBytes: number
42
+ maxImagesPerMessage: number
43
+ maxMessageImageBytes: number
44
+ maxImagePixels: number
45
+ mediaTypes: readonly ImageMediaType[]
46
+ }
47
+ ```
48
+
49
+ 引用记录固有尺寸和编码长度,使客户端无需先解码即可排布历史记录;每次权威读取仍会根据对象重新校验摘要、媒体签名、尺寸和元数据。
50
+
51
+ ## 提交与经校验读取的数据
52
+
53
+ ```ts type-equiv
54
+ /** Request to validate and durably commit one image. */
55
+ interface SaveImageAttachment {
56
+ data: Uint8Array
57
+ /** Caller-declared media type, checked against fully decoded bytes. */
58
+ mediaType: ImageMediaType
59
+ /** Optional browser/provider display name; it is never interpreted as a path. */
60
+ name?: string
61
+ }
62
+ ```
63
+
64
+ ```ts type-equiv
65
+ /** Stored image bytes returned after reference and digest verification. */
66
+ interface StoredImageAttachment {
67
+ ref: ImageAttachmentRef
68
+ data: Uint8Array
69
+ }
70
+ ```
71
+
72
+ `saveImage()` 校验字节并以原子方式提交一个对象,之后才返回其引用。`validateImage()` 执行相同的准入检查,但不持久化任何内容;批量调用方会在保存任何成员前通过它校验所有成员,因此校验拒绝不会留下部分对象。`readImage()` 接受来自已授权会话路径的引用,只在完整性校验通过后返回字节。该服务刻意不规定保留策略:恢复和 fork 后的会话可能共享对象,因此基于引用的垃圾回收会延期实现,而不是与任何一个会话的删除绑定。
73
+
74
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
75
+
76
+ <a id="cordis-surface"></a>
77
+
78
+ ## Cordis API
79
+
80
+ 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).
81
+
82
+ <a id="ctxattachments--attachmentstore-abstract-seam"></a>
83
+
84
+ ### `ctx.attachments` — `AttachmentStore` (abstract seam)
85
+
86
+ Immutable binary attachment service. Implementations validate bytes before publishing a reference.
87
+
88
+ ```ts cordis-catalog
89
+ /**
90
+ * Validate one image without persisting it.
91
+ * Batch callers validate every member before saving any member.
92
+ * @param input - encoded bytes, declared media type, and optional display name.
93
+ * @returns completion after the encoded raster has been fully decoded.
94
+ */
95
+ abstract validateImage(input: SaveImageAttachment): Promise<void>
96
+
97
+ /**
98
+ * Validate and durably commit one image before its owning session event is appended.
99
+ * @param input - encoded bytes, declared media type, and optional display name.
100
+ * @returns a durable content-addressed reference.
101
+ */
102
+ abstract saveImage(input: SaveImageAttachment): Promise<ImageAttachmentRef>
103
+
104
+ /**
105
+ * Read one image and verify that bytes still match the recorded reference.
106
+ * @param ref - durable reference from the session log.
107
+ * @param signal - optional cancellation for backend read and verification work.
108
+ * @returns the verified bytes and canonical reference.
109
+ * @throws the signal reason when aborted, or a storage error when verification fails.
110
+ */
111
+ abstract readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise<StoredImageAttachment>
112
+ ```
113
+
114
+ Source: [`packages/attachment/attachment/src/index.ts:29`](../../packages/attachment/attachment/src/index.ts)
115
+ <!-- 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/client-modules.md
5
+ client-modules.md: c2002b847cd15560ca4493ce6e8623667c395360
6
+ client-modules.zh.md: 88be252a7fdff6bca7e2d8eb4e37b9e1a75dda98
@@ -0,0 +1,118 @@
1
+ # Client Modules
2
+
3
+ English | [中文](client-modules.zh.md)
4
+
5
+ The web plugin table: the Node half of the client module system in [dsh-client-modules](../../packages/client/modules), provided as `ctx.clientModules` (`ClientModuleRegistry`). It scans the host Loader's entries for packages declaring `dsh.client`, composes the `window.__DSH_BOOT__` entry graph, serves each bundle at `/plugins/<id>/client.js`, and taps the index render to inject the boot manifest — the four faces of one service. It is an optional capability of the web GUI stack, not part of the agent-loop spine, and it is a consumer of [dsh-host-webserver](../../packages/host/webserver): the carrier described in [web-server.md](web-server.md) supplies the prefix route and index tap this service registers. The same package's browser half (`ctx.modules`, the lazy-CJS module table that fetches and materializes these bundles) is kernel machinery documented in the [package README](../../packages/client/modules/README.md), not here.
6
+
7
+ Source: [`packages/client/modules/src/client/manifest.ts`](../../packages/client/modules/src/client/manifest.ts)
8
+
9
+ ## The wire
10
+
11
+ The graph is the wire single source between the Node and browser halves: the host composes `WebBootEntry` rows from scanned packages, injects the graph as the first script in `<head>` (`window.__DSH_BOOT__`, with `<` escaped so plugin-controlled strings cannot break out of the script element), and the shell parses it before booting anything. A page without a valid manifest cannot boot — the browser-side parser throws loud on a missing or malformed graph.
12
+
13
+ ```ts type-equiv
14
+ /**
15
+ * One composed client entry pushed by the host (a graph row). Wire
16
+ * single source: the host node half (package root) produces this same shape.
17
+ * `immediately` marks stage-one prefetch; `inject` is informational graph
18
+ * metadata (the authoritative edges live in each package's `dsh.client`
19
+ * declaration and reach fibers through entry creation).
20
+ */
21
+ interface WebBootEntry {
22
+ /** Entry name == package name. */
23
+ id: string
24
+ /** Bundle endpoint, '/plugins/<id>/client.js?rev=<rev>'. */
25
+ url: string
26
+ /** Bundle content hash (cache-busting consistency anchor). */
27
+ rev: string
28
+ /** Package-name dependency edges, informational (preflight display / HMR diffing). */
29
+ inject?: string[]
30
+ /** Stage-one prefetch mark: load the script for factory registration during module-face boot. */
31
+ immediately?: boolean
32
+ }
33
+ ```
34
+
35
+ ```ts type-equiv
36
+ /** The composed client entry graph the host injects as `window.__DSH_BOOT__`. */
37
+ interface WebBootGraph {
38
+ /** Consistency anchor over the whole graph (content + bundle hashes). */
39
+ rev: string
40
+ /** Composed entries; order carries no semantics (activation order is fiber inject waiting). */
41
+ entries: WebBootEntry[]
42
+ }
43
+ ```
44
+
45
+ Each row's `rev` is the bundle's content hash and rides the URL as a cache-busting query; the graph `rev` hashes the composed rows, so any row change changes it. `immediately` marks the stage-one prefetch tier (fetch and execute during module-face boot, registration only); a lazy row is fetched on first import.
46
+
47
+ ## The scan
48
+
49
+ A package joins the table by declaring `dsh.client` (`platform: 'web'`, optional `inject` edges, optional `immediately`) in its package.json and exporting its built bundle at `exports["./client"]`. Package resolution anchors at the config tree's `ctx.baseUrl` — the cordis.yml directory, whose package declares every composed plugin as a dependency — and construction throws when that anchor is unset.
50
+
51
+ Scanning is incremental per package; there is no full-rescan code path. Every cordis `internal/plugin` emission (fiber construction or disposal) marks the fiber's entry name dirty, and a microtask flush reconciles each dirty name against the live loader entries. The activation pass seeds the same dirty set with all current entries and flushes synchronously, so first scan and steady state share one implementation — with opposite failure postures. At activation, a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud `AggregateError` listing every broken package: the fiber FAILS and the boot's fail-loud sweep reports it. In steady state, a broken package logs a warning and must not poison the others.
52
+
53
+ Package metadata — including the negative "not a client package" verdict — is cached per name and never expires: plugin-set changes take effect on restart. A fiber restart reuses its row and rev untouched; bundle content changes reach the graph only through `rebuilt()`.
54
+
55
+ ## The bundle route and index tap
56
+
57
+ `GET`/`HEAD /plugins/<id>/client.js` serves the registered bundle from disk with `no-cache` (the rev query, not HTTP caching, anchors consistency); other methods are 405. An unknown id — or a registered row whose bundle is unreadable because it has not been built yet — answers a loud 404 rather than letting the carrier's SPA fallback ship HTML as JavaScript. The index tap injects the current graph on every index render, so a reload always boots against the live composition.
58
+
59
+ ## The service
60
+
61
+ `ClientModuleRegistry` (`ctx.clientModules`, defined in [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts)) exposes reads and the rebuild face; signatures are in the generated [service catalog](#ctxclientmodules--clientmoduleregistry). `graph()` returns the current composed graph (a stable object between changes) and `clientPath(id)` the bundle's absolute path. `rebuilt(id)` is the only entry point through which bundle content reaches the graph: it re-hashes the file, and only a real rev change recomposes the graph and notifies. `onRebuilt` fires per changed bundle with the new rev; `onGraphChanged` fires after any flush that recomposed the graph (row added or removed, or a rebuilt rev change) and is pull-model — listeners re-read `graph()`. Both notification paths contain listener exceptions so one throwing subscriber cannot skip later subscribers or kill whatever triggered the flush.
62
+
63
+ In development, [dsh-client-hmr](../../packages/client/hmr/README.md) is the registry's watch driver: its node half stat-polls every graph row's bundle from a synchronously captured baseline, calls `rebuilt(id)` on change, resyncs its watch set through `onGraphChanged`, and broadcasts rev changes to the browser half over SSE. Production graphs omit the HMR row entirely; the module host itself never watches files.
64
+
65
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
66
+
67
+ <a id="cordis-surface"></a>
68
+
69
+ ## Cordis API
70
+
71
+ 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).
72
+
73
+ <a id="ctxclientmodules--clientmoduleregistry"></a>
74
+
75
+ ### `ctx.clientModules` — `ClientModuleRegistry`
76
+
77
+ The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index tap. Construction runs the activation scan synchronously — a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud throw (FAILED fiber; the boot activation audit reports it).
78
+
79
+ ```ts cordis-catalog
80
+ /**
81
+ * Current composed entry graph (stable object between changes).
82
+ * @returns the graph served as `window.__DSH_BOOT__`.
83
+ */
84
+ graph(): WebBootGraph
85
+
86
+ /**
87
+ * Absolute path of an entry's client bundle.
88
+ * @param id - entry id (package name).
89
+ * @returns the path, or undefined for an unknown id.
90
+ */
91
+ clientPath(id: string): string | undefined
92
+
93
+ /**
94
+ * Re-hash one bundle (the HMR watch's registration hook — the only entry
95
+ * point through which bundle content changes reach the graph).
96
+ * @param id - entry id (package name).
97
+ * @returns the new rev, or undefined for an unknown id.
98
+ */
99
+ rebuilt(id: string): string | undefined
100
+
101
+ /**
102
+ * Subscribe to bundle rebuilds; fires only when the re-hash changed the rev.
103
+ * @param listener - receives the entry id and its new bundle rev.
104
+ * @returns the unsubscriber.
105
+ */
106
+ onRebuilt(listener: (id: string, rev: string) => void): () => void
107
+
108
+ /**
109
+ * Fires after any flush that recomposed the graph (row added/removed, or a
110
+ * rebuilt rev change). Pull model: listeners re-read {@link graph}.
111
+ * @param listener - notified with no payload.
112
+ * @returns the unsubscriber.
113
+ */
114
+ onGraphChanged(listener: () => void): () => void
115
+ ```
116
+
117
+ Source: [`packages/client/modules/src/index.ts:184`](../../packages/client/modules/src/index.ts)
118
+ <!-- END GENERATED cordis-surface -->