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,178 @@
1
+ # User Interaction
2
+
3
+ English | [中文](user-questions.zh.md)
4
+
5
+ The user-questions seam of [dsh-user-questions](../../packages/interaction/user-questions). It is the provider-neutral vocabulary a tool or permission plugin uses when it needs the human to answer before the agent can continue. UI surfaces provide the active `UserQuestionProvider`; the host runtime relays requests to its connected client.
6
+
7
+ Source: [`packages/interaction/user-questions/src/index.ts`](../../packages/interaction/user-questions/src/index.ts)
8
+
9
+ ## Question options
10
+
11
+ `AskUserQuestionOption` contains one selectable choice. `label` is the user-facing option text and also the model-facing selected value; `description` is optional UI help text.
12
+
13
+ ```ts type-equiv
14
+ /** One selectable answer offered to the user. */
15
+ interface AskUserQuestionOption {
16
+ /** User-facing label. */
17
+ label: string
18
+ /** Optional extra context rendered by capable UIs. */
19
+ description?: string
20
+ }
21
+ ```
22
+
23
+ ## Presentation intent
24
+
25
+ `AskUserQuestionIntent` optionally declares a known decision kind. It is tagged on `kind` so intents can be added; a UI that does not recognise a tag renders the generic option list. An intent changes presentation only — a UI honouring it answers with the same option labels a generic UI would send, so the caller reads the same answer fields either way. `approve` names the affirmative option instead of relying on option order. `ask()` rejects the two assertions no type can carry: an `approve` naming none of its own question's options, and an intent on a question with no `detail`.
26
+
27
+ ```ts type-equiv
28
+ /**
29
+ * A caller-declared presentation intent: the question IS this kind of
30
+ * decision, so a UI that recognises the tag may present it as such instead of as a
31
+ * generic option list. Tagged so further intents can be added; a UI that does
32
+ * not know a tag renders the generic flow, and the answer encoding is identical
33
+ * either way — an intent changes presentation only, never the protocol.
34
+ */
35
+ type AskUserQuestionIntent = {
36
+ /** A plan submitted for review: `detail` is the plan markdown `ask()` requires, and the decision approves or declines it. */
37
+ kind: 'plan-review'
38
+ /**
39
+ * The option label that approves the plan; every other option declines it.
40
+ * Named rather than positional so no UI infers the verdict from option order.
41
+ * An `approve` naming no option of its own question is rejected at `ask()`.
42
+ */
43
+ approve: string
44
+ }
45
+ ```
46
+
47
+ ## Question item
48
+
49
+ `AskUserQuestionItem` is one question in a request. The caller supplies a stable `id`, which is echoed back with the answer so batched questions remain routable. Optional `detail` carries supporting text that providers render with the question but keep out of selectable option labels.
50
+
51
+ ```ts type-equiv
52
+ /** One question in a user-questions request. */
53
+ interface AskUserQuestionItem {
54
+ /** Stable caller-provided question id, echoed in the answer. */
55
+ id: string
56
+ /** The question to display. */
57
+ question: string
58
+ /** Optional supporting detail rendered with the question but kept out of option labels. */
59
+ detail?: string
60
+ /** Optional short heading/group label. */
61
+ header?: string
62
+ /** Optional choices the UI can render as a menu. */
63
+ options?: AskUserQuestionOption[]
64
+ /** Whether more than one option may be selected. Defaults to single-select. */
65
+ multiSelect?: boolean
66
+ /** Optional presentation intent for capable UIs; absent asks for the generic option list. */
67
+ intent?: AskUserQuestionIntent
68
+ }
69
+ ```
70
+
71
+ ## Ask request
72
+
73
+ `AskUserQuestionRequest` is the cross-package request. `questions` is an array so a UI can present related prompts in one flow while preserving a stable id per answer. When present, `agent` is the exact live caller; the interaction seam admits it only while the live registry identifies that instance as a runtime root.
74
+
75
+ ```ts type-equiv
76
+ /** Request for a human answer. */
77
+ interface AskUserQuestionRequest {
78
+ /** Questions to display. */
79
+ questions: AskUserQuestionItem[]
80
+ /** Exact live calling agent, when the request came from an agent tool call. */
81
+ agent?: Agent
82
+ /** Abort signal for the owning tool/step. */
83
+ signal?: AbortSignal
84
+ }
85
+ ```
86
+
87
+ ## Answer
88
+
89
+ Providers return one answer item per question id. `selected` contains selected option labels, and `custom` carries a free-form "Other" answer when the user typed one. For a single-select question, `custom` overrides the selected choice and `selected` is empty. For a multi-select question, `custom` may supplement the labels in `selected`. A UI may also use an item with empty `selected` and no `custom` to preserve a skipped question in an otherwise completed batch.
90
+
91
+ ```ts type-equiv
92
+ /** Answer to one question. */
93
+ interface AskUserQuestionAnswerItem {
94
+ /** The answered question id. */
95
+ id: string
96
+ /** Selected option labels. May accompany custom text for a multi-select question. */
97
+ selected: string[]
98
+ /** Optional free-text "Other" answer. */
99
+ custom?: string
100
+ }
101
+ ```
102
+
103
+ ```ts type-equiv
104
+ /** The human's answer. */
105
+ interface AskUserQuestionAnswer {
106
+ /** Structured answers keyed by question id. */
107
+ answers: AskUserQuestionAnswerItem[]
108
+ }
109
+ ```
110
+
111
+ ## Provider
112
+
113
+ Only one provider may be active in a context. Provider registration is effect-bound so HMR/disposal removes the active UI.
114
+
115
+ ```ts type-equiv
116
+ /** UI-side provider for user questions. */
117
+ interface UserQuestionProvider {
118
+ ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
119
+ }
120
+ ```
121
+
122
+ ## Errors
123
+
124
+ `UserQuestionError` extends `HarnessError`, so `ctx.tools.execute()` preserves `{ name, code }` for model-facing tool failures such as `EMPTY_QUESTIONS`, `NO_PROVIDER`, `ASK_ABORTED`, or UI-side cancellation.
125
+
126
+ ```ts type-equiv
127
+ /** Stable error taxonomy for user-questions failures. */
128
+ class UserQuestionError extends HarnessError {
129
+ constructor(message: string, code: string, options?: ErrorOptions) {
130
+ super(message, code, options)
131
+ this.name = 'UserQuestionError'
132
+ }
133
+ }
134
+ ```
135
+
136
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
137
+
138
+ <a id="cordis-surface"></a>
139
+
140
+ ## Cordis API
141
+
142
+ 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).
143
+
144
+ <a id="ctxuserquestions--userquestionservice"></a>
145
+
146
+ ### `ctx.userQuestions` — `UserQuestionService`
147
+
148
+ `ctx.userQuestions`: one active UI provider plus an `ask()` API.
149
+
150
+ ```ts cordis-catalog
151
+ /**
152
+ * Register the UI provider. Only one provider may be active in a context.
153
+ *
154
+ * @param provider UI-side implementation that collects answers.
155
+ * @returns Disposer that unregisters this provider.
156
+ */
157
+ registerProvider(provider: UserQuestionProvider): () => void
158
+
159
+ /**
160
+ * Ask the active UI provider and wait for the user's answer.
161
+ *
162
+ * When a caller supplies an agent, human interaction is valid only for the
163
+ * exact live runtime root. Runtime ownership, not durable session lineage,
164
+ * decides this boundary: an owned child has no human answerer and would
165
+ * block forever, while a lineage-bearing session resumed as a new runtime
166
+ * root may ask normally.
167
+ *
168
+ * @param request Questions, owner agent, and abort signal.
169
+ * @returns The answer chosen or typed by the human.
170
+ * @throws {UserQuestionError} code `CALLER_NOT_LIVE` when a supplied
171
+ * agent is not the registry's exact live instance, or `DELEGATED_CALLER`
172
+ * when that live agent is owned by another agent.
173
+ */
174
+ async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
175
+ ```
176
+
177
+ Source: [`packages/interaction/user-questions/src/index.ts:51`](../../packages/interaction/user-questions/src/index.ts)
178
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,178 @@
1
+ # 用户交互
2
+
3
+ [English](user-questions.md) | 中文
4
+
5
+ [dsh-user-questions](../../packages/interaction/user-questions) 的用户交互 seam。它是工具或权限插件需要人类回答后 agent(智能体)才能继续时所使用的、提供方无关的词汇。UI 界面提供活跃的 `UserQuestionProvider`;host 运行时把请求转发给其连接的客户端。
6
+
7
+ 源码:[`packages/interaction/user-questions/src/index.ts`](../../packages/interaction/user-questions/src/index.ts)
8
+
9
+ ## 问题选项
10
+
11
+ `AskUserQuestionOption` 包含一个可供选择的选项。`label` 是面向用户的选项文字,同时也是面向模型的选中值;`description` 是可选的 UI 帮助文本。
12
+
13
+ ```ts type-equiv
14
+ /** One selectable answer offered to the user. */
15
+ interface AskUserQuestionOption {
16
+ /** User-facing label. */
17
+ label: string
18
+ /** Optional extra context rendered by capable UIs. */
19
+ description?: string
20
+ }
21
+ ```
22
+
23
+ ## 呈现意图
24
+
25
+ `AskUserQuestionIntent` 可选地声明一种已知的决策类型。它按 `kind` 打标签,因此可以增加新的意图;不认识某个标签的 UI 渲染通用选项列表。意图只改变呈现方式——遵循它的 UI 回答的仍是通用 UI 会发送的那些选项标签,因此调用方两种情况下读到的回答字段相同。`approve` 指名肯定选项,而不依赖选项顺序。`ask()` 会拒绝两种无法由类型系统表达的情况:`approve` 未指向该问题自身的任何选项,以及为没有 `detail` 的问题指定意图。
26
+
27
+ ```ts type-equiv
28
+ /**
29
+ * A caller-declared presentation intent: the question IS this kind of
30
+ * decision, so a UI that recognises the tag may present it as such instead of as a
31
+ * generic option list. Tagged so further intents can be added; a UI that does
32
+ * not know a tag renders the generic flow, and the answer encoding is identical
33
+ * either way — an intent changes presentation only, never the protocol.
34
+ */
35
+ type AskUserQuestionIntent = {
36
+ /** A plan submitted for review: `detail` is the plan markdown `ask()` requires, and the decision approves or declines it. */
37
+ kind: 'plan-review'
38
+ /**
39
+ * The option label that approves the plan; every other option declines it.
40
+ * Named rather than positional so no UI infers the verdict from option order.
41
+ * An `approve` naming no option of its own question is rejected at `ask()`.
42
+ */
43
+ approve: string
44
+ }
45
+ ```
46
+
47
+ ## 问题条目
48
+
49
+ `AskUserQuestionItem` 是请求中的一个问题。调用方提供稳定的 `id`,它会随答案原样返回,使批量问题仍可路由。可选的 `detail` 携带辅助文本;提供方会将其随问题渲染,但不会放入可选选项标签。
50
+
51
+ ```ts type-equiv
52
+ /** One question in a user-questions request. */
53
+ interface AskUserQuestionItem {
54
+ /** Stable caller-provided question id, echoed in the answer. */
55
+ id: string
56
+ /** The question to display. */
57
+ question: string
58
+ /** Optional supporting detail rendered with the question but kept out of option labels. */
59
+ detail?: string
60
+ /** Optional short heading/group label. */
61
+ header?: string
62
+ /** Optional choices the UI can render as a menu. */
63
+ options?: AskUserQuestionOption[]
64
+ /** Whether more than one option may be selected. Defaults to single-select. */
65
+ multiSelect?: boolean
66
+ /** Optional presentation intent for capable UIs; absent asks for the generic option list. */
67
+ intent?: AskUserQuestionIntent
68
+ }
69
+ ```
70
+
71
+ ## 提问请求
72
+
73
+ `AskUserQuestionRequest` 是跨包请求。`questions` 是数组,这样 UI 可以在一个流程中呈现相关提示,同时保持每个回答有稳定的 id。如提供 `agent`,它必须与存活调用方是同一实例;只有当当前注册表将该实例识别为运行时根时,交互 seam 才会接纳该 agent。
74
+
75
+ ```ts type-equiv
76
+ /** Request for a human answer. */
77
+ interface AskUserQuestionRequest {
78
+ /** Questions to display. */
79
+ questions: AskUserQuestionItem[]
80
+ /** Exact live calling agent, when the request came from an agent tool call. */
81
+ agent?: Agent
82
+ /** Abort signal for the owning tool/step. */
83
+ signal?: AbortSignal
84
+ }
85
+ ```
86
+
87
+ ## 回答
88
+
89
+ 提供方为每个问题 id 返回一个回答项。`selected` 包含选中的选项标签,`custom` 在用户输入自由文本时携带「其他」回答。对于单选题,`custom` 会覆盖选中的选项,且 `selected` 为空。对于多选题,`custom` 可以补充 `selected` 中的标签。UI 也可以使用 `selected` 为空且不含 `custom` 的回答项,在其余问题均已完成的批次中保留被跳过的问题。
90
+
91
+ ```ts type-equiv
92
+ /** Answer to one question. */
93
+ interface AskUserQuestionAnswerItem {
94
+ /** The answered question id. */
95
+ id: string
96
+ /** Selected option labels. May accompany custom text for a multi-select question. */
97
+ selected: string[]
98
+ /** Optional free-text "Other" answer. */
99
+ custom?: string
100
+ }
101
+ ```
102
+
103
+ ```ts type-equiv
104
+ /** The human's answer. */
105
+ interface AskUserQuestionAnswer {
106
+ /** Structured answers keyed by question id. */
107
+ answers: AskUserQuestionAnswerItem[]
108
+ }
109
+ ```
110
+
111
+ ## 提供方
112
+
113
+ 同一上下文中只能有一个活跃的提供方。提供方注册绑定到 effect,因此 HMR(热模块替换)或 dispose(资源释放)会移除当前活跃的 UI。
114
+
115
+ ```ts type-equiv
116
+ /** UI-side provider for user questions. */
117
+ interface UserQuestionProvider {
118
+ ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
119
+ }
120
+ ```
121
+
122
+ ## 错误
123
+
124
+ `UserQuestionError` 继承 `HarnessError`,因此 `ctx.tools.execute()` 会保留 `{ name, code }`,用于面向模型的工具失败,如 `EMPTY_QUESTIONS`、`NO_PROVIDER`、`ASK_ABORTED` 或 UI 侧取消。
125
+
126
+ ```ts type-equiv
127
+ /** Stable error taxonomy for user-questions failures. */
128
+ class UserQuestionError extends HarnessError {
129
+ constructor(message: string, code: string, options?: ErrorOptions) {
130
+ super(message, code, options)
131
+ this.name = 'UserQuestionError'
132
+ }
133
+ }
134
+ ```
135
+
136
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
137
+
138
+ <a id="cordis-surface"></a>
139
+
140
+ ## Cordis API
141
+
142
+ 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).
143
+
144
+ <a id="ctxuserquestions--userquestionservice"></a>
145
+
146
+ ### `ctx.userQuestions` — `UserQuestionService`
147
+
148
+ `ctx.userQuestions`: one active UI provider plus an `ask()` API.
149
+
150
+ ```ts cordis-catalog
151
+ /**
152
+ * Register the UI provider. Only one provider may be active in a context.
153
+ *
154
+ * @param provider UI-side implementation that collects answers.
155
+ * @returns Disposer that unregisters this provider.
156
+ */
157
+ registerProvider(provider: UserQuestionProvider): () => void
158
+
159
+ /**
160
+ * Ask the active UI provider and wait for the user's answer.
161
+ *
162
+ * When a caller supplies an agent, human interaction is valid only for the
163
+ * exact live runtime root. Runtime ownership, not durable session lineage,
164
+ * decides this boundary: an owned child has no human answerer and would
165
+ * block forever, while a lineage-bearing session resumed as a new runtime
166
+ * root may ask normally.
167
+ *
168
+ * @param request Questions, owner agent, and abort signal.
169
+ * @returns The answer chosen or typed by the human.
170
+ * @throws {UserQuestionError} code `CALLER_NOT_LIVE` when a supplied
171
+ * agent is not the registry's exact live instance, or `DELEGATED_CALLER`
172
+ * when that live agent is owned by another agent.
173
+ */
174
+ async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
175
+ ```
176
+
177
+ Source: [`packages/interaction/user-questions/src/index.ts:51`](../../packages/interaction/user-questions/src/index.ts)
178
+ <!-- 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/web-server.md
5
+ web-server.md: 414863d88cdc34163882cdc3dfe8dc7c1471ac77
6
+ web-server.zh.md: d756192ce733a3fe79c9eaf44e5d556c4bac90a8
@@ -0,0 +1,108 @@
1
+ # HTTP Server
2
+
3
+ English | [中文](web-server.zh.md)
4
+
5
+ [dsh-host-webserver](../../packages/host/webserver) is the browser HTTP carrier for the GUI host: a single `node:http` plugin providing `ctx.webServer`, a named-route registry, index.html transform callbacks, and one fallback handler that a plugin may claim. It is not part of the agent loop and not a capability seam; it knows no harness concepts, and another plugin registers every feature route, including the `/api` bridge, plugin bundles, and the HMR event stream ([layering note](../../.agents/notes/implemented/architecture/2026-07-19-gui-layering-and-rpc-protocol.md)). It serves browsers only: Electron loads the built files over `file://` and sends fetch requests through an IPC bridge instead of this server.
6
+
7
+ Source: [`packages/host/webserver/src/index.ts`](../../packages/host/webserver/src/index.ts)
8
+
9
+ ## Routes
10
+
11
+ ```ts type-equiv
12
+ /** Route match kind: 'exact' matches the pathname verbatim; 'prefix' p matches p and p/<anything>. */
13
+ type WebRouteKind = 'exact' | 'prefix'
14
+ ```
15
+
16
+ ```ts type-equiv
17
+ /** One named route registration. */
18
+ interface WebRoute {
19
+ kind: WebRouteKind
20
+ /** Absolute pathname, no trailing slash. */
21
+ path: string
22
+ /** Owns the full response lifecycle (may hold the response open, e.g. SSE). */
23
+ handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>
24
+ }
25
+ ```
26
+
27
+ Match order is fixed: exact table first, then longest matching prefix, then the registered fallback. Registration order carries no request-facing semantics — named routes are composed to be disjoint, and the fallback seat answers anything no named route claims; one owner only, a second registration throws. The shipped Web composition claims the seat with [`dsh-host-frontend-static`](../../packages/host/frontend-static/src/index.ts), the SPA dist server with locked semantics: non-GET/HEAD is 405, traversal outside the dist root is 403, any miss falls back to `index.html` with HTTP 200 (SPA routing), and unknown extensions ship as octet-stream.
28
+
29
+ ## Config
30
+
31
+ ```ts type-equiv
32
+ /** Gateway config: the listen address. */
33
+ interface Config {
34
+ /** Listen host; the two supported values are loopback and all-interfaces. */
35
+ host: '127.0.0.1' | '0.0.0.0'
36
+ /** Listen port; zero requests an OS-assigned port. */
37
+ port: number
38
+ }
39
+ ```
40
+
41
+ `host` accepts only `127.0.0.1` (default posture) and `0.0.0.0` (deliberate network exposure); there is no TLS, auth, or origin policy, so a non-loopback bind exposes the server to that network. The dist location is an assembly fact of the frontend plugin that claims the seat.
42
+
43
+ ## The service
44
+
45
+ `WebServer` (`ctx.webServer`) listens immediately on activation; a listen failure (EADDRINUSE…) rejects initialization, and the boot process reports the failed fiber. `register(route)` adds one named route and returns its disposer; a duplicate `(kind, path)` throws because route patterns are a composition-level contract and a collision is a misconfiguration. `tapIndex(transform)` adds a pure html-to-html transform applied to every index response — `/` and each SPA fallback — in registration order; [dsh-client-modules](../../packages/client/modules) uses it to inject the boot manifest. `port` reads the listening port, including the port assigned by the OS when `config.port` is 0.
46
+
47
+ A request whose handling throws (a malformed %-escape hitting `decodeURIComponent`, a client dropping mid-body) is logged as a warning and answered 400 — or the socket destroyed when headers are already out — never a process exit. Disposal pairs `close()` with `closeAllConnections()` because a handler may hold its response open (SSE) and such connections never end on their own; without the force-close, teardown would hang. The package never prints: the URL line belongs to the shell. Per-package operational detail, including the dev-mode bundle watch pipeline, stays in the [README](../../packages/host/webserver/README.md).
48
+
49
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
50
+
51
+ <a id="cordis-surface"></a>
52
+
53
+ ## Cordis API
54
+
55
+ 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).
56
+
57
+ <a id="ctxwebserver--webserver"></a>
58
+
59
+ ### `ctx.webServer` — `WebServer`
60
+
61
+ The browser HTTP carrier service. Activation listens immediately. Route registration order does not affect requests because configured named routes must be distinct, and the fallback handler answers anything not yet claimed during startup with 404 until its owner registers. A listen failure rejects initialization, and the boot process reports the failed fiber.
62
+
63
+ ```ts cordis-catalog
64
+ /**
65
+ * Register a named route. Duplicate (kind, path) throws — route patterns are
66
+ * a composition-level contract, so a collision is a misconfiguration.
67
+ * @param route - kind, path, and the owning handler.
68
+ * @returns the disposer removing the route.
69
+ */
70
+ register(route: WebRoute): () => void
71
+
72
+ /**
73
+ * Register an exact-path HTTP upgrade route. Duplicate paths throw because
74
+ * one socket can have only one protocol owner.
75
+ * @param route - pathname and handler owning negotiation plus socket use.
76
+ * @returns the disposer removing the route.
77
+ */
78
+ registerUpgrade(route: WebUpgradeRoute): () => void
79
+
80
+ /**
81
+ * Claim the fallback seat: the handler answering every request no named
82
+ * route matches (the SPA dist server in the shipped Web composition). One
83
+ * owner only — a second registration throws, because two fallbacks cannot
84
+ * compose.
85
+ * @param handler - owns the full response lifecycle of unmatched requests.
86
+ * @returns the disposer releasing the seat.
87
+ */
88
+ registerFallback(handler: WebRoute['handler']): () => void
89
+
90
+ /**
91
+ * Register an index.html transform, applied by the fallback owner to every
92
+ * index response ({@link applyIndexTaps}) in registration order.
93
+ * @param transform - pure html-to-html function.
94
+ * @returns the disposer removing the transform.
95
+ */
96
+ tapIndex(transform: (html: string) => string): () => void
97
+
98
+ /**
99
+ * Run an index.html body through the registered taps in registration order
100
+ * — called by the fallback owner on every index response it renders.
101
+ * @param html - the raw index.html body.
102
+ * @returns the transformed body.
103
+ */
104
+ applyIndexTaps(html: string): string
105
+ ```
106
+
107
+ Source: [`packages/host/webserver/src/index.ts:59`](../../packages/host/webserver/src/index.ts)
108
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,108 @@
1
+ # HTTP 服务器
2
+
3
+ [English](web-server.md) | 中文
4
+
5
+ [dsh-host-webserver](../../packages/host/webserver) 是 GUI 宿主的浏览器 HTTP 载体:它是一个提供 `ctx.webServer` 的 `node:http` 插件,包含具名路由注册表、index.html 转换回调,以及一个可由插件认领的回退处理器。它不属于 agent loop(智能体循环),也不是能力 seam;它不了解任何 harness 概念。其他插件负责注册所有功能路由,包括 `/api` 桥接、插件 bundle 和 HMR(热模块替换)事件流([分层说明](../../.agents/notes/implemented/architecture/2026-07-19-gui-layering-and-rpc-protocol.md))。该服务器只服务浏览器:Electron 通过 `file://` 加载已构建文件,并经 IPC 桥接发送 fetch 请求,不使用本服务器。
6
+
7
+ 源码:[`packages/host/webserver/src/index.ts`](../../packages/host/webserver/src/index.ts)
8
+
9
+ ## 路由
10
+
11
+ ```ts type-equiv
12
+ /** Route match kind: 'exact' matches the pathname verbatim; 'prefix' p matches p and p/<anything>. */
13
+ type WebRouteKind = 'exact' | 'prefix'
14
+ ```
15
+
16
+ ```ts type-equiv
17
+ /** One named route registration. */
18
+ interface WebRoute {
19
+ kind: WebRouteKind
20
+ /** Absolute pathname, no trailing slash. */
21
+ path: string
22
+ /** Owns the full response lifecycle (may hold the response open, e.g. SSE). */
23
+ handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>
24
+ }
25
+ ```
26
+
27
+ 匹配顺序固定:先查 exact 表,再取最长匹配前缀,最后落到已注册的回退。注册顺序不携带任何面向请求的语义:具名路由在组合上互不相交,任何未被具名路由认领的请求都由回退席位应答;席位只有一个所有者,第二次注册会抛出异常。发布的 Web 组合用 [`dsh-host-frontend-static`](../../packages/host/frontend-static/src/index.ts) 认领席位,即遵循固定语义的 SPA dist 服务器:非 GET/HEAD 返回 405,越出 dist 根目录的遍历返回 403,任何未命中都以 HTTP 200 回退到 `index.html`(SPA 路由),未知扩展名按 octet-stream 发送。
28
+
29
+ ## 配置
30
+
31
+ ```ts type-equiv
32
+ /** Gateway config: the listen address. */
33
+ interface Config {
34
+ /** Listen host; the two supported values are loopback and all-interfaces. */
35
+ host: '127.0.0.1' | '0.0.0.0'
36
+ /** Listen port; zero requests an OS-assigned port. */
37
+ port: number
38
+ }
39
+ ```
40
+
41
+ `host` 只接受 `127.0.0.1`(默认姿态)和 `0.0.0.0`(刻意的网络暴露);没有 TLS、认证或 origin 策略,因此绑定到非回环地址会把服务器暴露给该网络。dist 位置是认领席位的前端插件的组装事实。
42
+
43
+ ## 服务
44
+
45
+ `WebServer`(`ctx.webServer`)在激活时立即监听;监听失败(EADDRINUSE 等)会使初始化被拒绝,启动进程会报告失败的 fiber。`register(route)` 添加一条具名路由并返回其 disposer;重复的 `(kind, path)` 抛出异常,因为路由模式是组合层约定,冲突即配置错误。`tapIndex(transform)` 添加一个纯 HTML 到 HTML 转换函数,按注册顺序应用于每个 index 响应(`/` 和每次 SPA 回退);[dsh-client-modules](../../packages/client/modules) 用它注入启动 manifest(元数据清单)。`port` 读取监听端口,包括 `config.port` 为 0 时操作系统分配的端口。
46
+
47
+ 处理过程中抛出异常的请求(畸形的 % 转义撞上 `decodeURIComponent`、客户端在请求体中途断开)会记录为警告并应答 400(响应头已发出时则销毁 socket),绝不导致进程退出。dispose(资源释放)把 `close()` 与 `closeAllConnections()` 配对使用,因为处理器可能像 SSE(Server-Sent Events)那样保持响应打开,而这类连接永远不会自行结束;没有强制关闭,拆卸就会挂起。该包从不打印输出:URL 行归 shell 所有。逐包运维细节(含开发模式的 bundle 监视流水线)留在 [README](../../packages/host/webserver/README.md) 中。
48
+
49
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
50
+
51
+ <a id="cordis-surface"></a>
52
+
53
+ ## Cordis API
54
+
55
+ 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).
56
+
57
+ <a id="ctxwebserver--webserver"></a>
58
+
59
+ ### `ctx.webServer` — `WebServer`
60
+
61
+ The browser HTTP carrier service. Activation listens immediately. Route registration order does not affect requests because configured named routes must be distinct, and the fallback handler answers anything not yet claimed during startup with 404 until its owner registers. A listen failure rejects initialization, and the boot process reports the failed fiber.
62
+
63
+ ```ts cordis-catalog
64
+ /**
65
+ * Register a named route. Duplicate (kind, path) throws — route patterns are
66
+ * a composition-level contract, so a collision is a misconfiguration.
67
+ * @param route - kind, path, and the owning handler.
68
+ * @returns the disposer removing the route.
69
+ */
70
+ register(route: WebRoute): () => void
71
+
72
+ /**
73
+ * Register an exact-path HTTP upgrade route. Duplicate paths throw because
74
+ * one socket can have only one protocol owner.
75
+ * @param route - pathname and handler owning negotiation plus socket use.
76
+ * @returns the disposer removing the route.
77
+ */
78
+ registerUpgrade(route: WebUpgradeRoute): () => void
79
+
80
+ /**
81
+ * Claim the fallback seat: the handler answering every request no named
82
+ * route matches (the SPA dist server in the shipped Web composition). One
83
+ * owner only — a second registration throws, because two fallbacks cannot
84
+ * compose.
85
+ * @param handler - owns the full response lifecycle of unmatched requests.
86
+ * @returns the disposer releasing the seat.
87
+ */
88
+ registerFallback(handler: WebRoute['handler']): () => void
89
+
90
+ /**
91
+ * Register an index.html transform, applied by the fallback owner to every
92
+ * index response ({@link applyIndexTaps}) in registration order.
93
+ * @param transform - pure html-to-html function.
94
+ * @returns the disposer removing the transform.
95
+ */
96
+ tapIndex(transform: (html: string) => string): () => void
97
+
98
+ /**
99
+ * Run an index.html body through the registered taps in registration order
100
+ * — called by the fallback owner on every index response it renders.
101
+ * @param html - the raw index.html body.
102
+ * @returns the transformed body.
103
+ */
104
+ applyIndexTaps(html: string): string
105
+ ```
106
+
107
+ Source: [`packages/host/webserver/src/index.ts:59`](../../packages/host/webserver/src/index.ts)
108
+ <!-- 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/web.md
5
+ web.md: 3bcd3ac24927c8c51baeabd770e2bd91c5ad1b77
6
+ web.zh.md: 3348be2b808dc286364f5a795b236cb299acd6a6