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,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/lsp.md
5
+ lsp.md: 18ed0e178c73702534a9964557a3dabf7bb9dd11
6
+ lsp.zh.md: 8b154143057f05d74bf28b715a385a2ec65fbbff
@@ -0,0 +1,202 @@
1
+ # LSP navigation
2
+
3
+ English | [中文](lsp.zh.md)
4
+
5
+ The LSP seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-07-15-lsp-capability-seam.md) exposing semantic code navigation on one `ctx.lsp` service, split across packages: Service Definition ([dsh-lsp](../../packages/lsp/lsp), `ctx.lsp` + the provider registry), a generic Service Provider ([dsh-lsp-stdio](../../packages/lsp/lsp-stdio), a configured stdio language-server host), and Consumer ([dsh-tool-lsp](../../packages/lsp/tool-lsp), the `lsp` tool schema). LSP is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](core.md). A provider swap does not change how the model asks for navigation.
6
+
7
+ Source: [`packages/lsp/lsp/src/types.ts`](../../packages/lsp/lsp/src/types.ts)
8
+
9
+ ## Operations and coordinates
10
+
11
+ The seam and model expose exactly four semantic queries; the union is closed, so adding one is a compile-enforced change across the seam, providers, and the tool. Positions and ranges are zero-based UTF-16, matching the protocol; the model-facing tool owns the one-based cursor convention and converts on the way in and out.
12
+
13
+ ```ts type-equiv
14
+ /**
15
+ * The four semantic queries the seam and model expose. A closed union: adding an operation is a
16
+ * compile-enforced change across the seam, providers, and the tool. Symbols and call hierarchy are
17
+ * not operations here; they need different schemas.
18
+ */
19
+ type LspOperation = 'goToDefinition' | 'findReferences' | 'goToImplementation' | 'hover'
20
+ ```
21
+
22
+ ```ts type-equiv
23
+ /** A zero-based UTF-16 cursor coordinate, matching the LSP wire convention. */
24
+ interface LspPosition {
25
+ /** Zero-based line. */
26
+ readonly line: number
27
+ /** Zero-based UTF-16 code-unit offset within the line. */
28
+ readonly character: number
29
+ }
30
+ ```
31
+
32
+ ```ts type-equiv
33
+ /** A zero-based UTF-16 half-open range `[start, end)`. */
34
+ interface LspRange {
35
+ readonly start: LspPosition
36
+ readonly end: LspPosition
37
+ }
38
+ ```
39
+
40
+ ## Request
41
+
42
+ Every field is required: `workspaceRoot` is caller-supplied, `languageId` comes from the provider's registration (not the request), and consumers own timeouts and result limits — so no field needs implementation defaulting and there is no `resolve()` step. The provider receives the caller's request plus the derived `languageId`, which only synchronizes the transient document and never participates in selection.
43
+
44
+ ```ts type-equiv
45
+ /**
46
+ * A caller's normalized query. Every field is required: `workspaceRoot` is caller-supplied,
47
+ * `languageId` comes from the provider registration (not here), and consumers own timeouts and
48
+ * result limits — so no field needs implementation defaulting and there is no `resolve()` step.
49
+ */
50
+ interface LspQueryRequest {
51
+ /** Which semantic query to run. */
52
+ readonly operation: LspOperation
53
+ /** The source file to query (relative to `workspaceRoot` or absolute; the provider canonicalizes). */
54
+ readonly filePath: string
55
+ /** The zero-based UTF-16 cursor position to query at. */
56
+ readonly position: LspPosition
57
+ /** The workspace root the provider resolves against and indexes; required, never defaulted. */
58
+ readonly workspaceRoot: string
59
+ }
60
+ ```
61
+
62
+ ```ts type-equiv
63
+ /**
64
+ * A request as a provider receives it: the caller's {@link LspQueryRequest} plus the `languageId`
65
+ * the seam derived from the provider's extension mapping. The language id only synchronizes the
66
+ * transient document; it does not participate in selection.
67
+ */
68
+ interface LspProviderQuery extends LspQueryRequest {
69
+ /** The LSP language id for `filePath`, from this provider's extension mapping. */
70
+ readonly languageId: string
71
+ }
72
+ ```
73
+
74
+ ## Result
75
+
76
+ A CLOSED discriminated union: navigation operations normalize to `locations`, `hover` to content or `null`. Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled. `findReferences` always includes declarations — the provider enforces this internally, so callers get no flag. The `locations` variant carries `resolvedWorkspaceUri`, the provider's canonical workspace `file:` URI. A caller relativizing location URIs uses that coordinate rather than applying host-platform path rules to the possibly-symlinked request root.
77
+
78
+ ```ts type-equiv
79
+ /** One resolved location: a document URI and the range within it. */
80
+ interface LspLocation {
81
+ /** The target document URI (`file:` or otherwise), verbatim from the server. */
82
+ readonly uri: string
83
+ /** The range within the target document. */
84
+ readonly range: LspRange
85
+ }
86
+ ```
87
+
88
+ ```ts type-equiv
89
+ /** Normalized hover content, or `null` for no hover at the position. */
90
+ interface LspHover {
91
+ /** The normalized hover text (markdown or plaintext, provider-joined). */
92
+ readonly contents: string
93
+ /** The range the hover applies to, when the server supplied one. */
94
+ readonly range?: LspRange
95
+ }
96
+ ```
97
+
98
+ ```ts type-equiv
99
+ /**
100
+ * The closed result union. Navigation operations (`goToDefinition`, `findReferences`,
101
+ * `goToImplementation`) normalize to `locations`; `hover` normalizes to content or `null`.
102
+ * Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled.
103
+ *
104
+ * The `locations` variant carries `resolvedWorkspaceUri`: the provider's canonical `file:` URI for
105
+ * the request's workspace root. A caller that relativizes location URIs MUST use this, not parse the
106
+ * request's possibly symlinked process path with host-platform rules; the execution platform may
107
+ * differ from the caller's.
108
+ */
109
+ type LspQueryResult =
110
+ | { readonly kind: 'locations'; readonly locations: readonly LspLocation[]; readonly resolvedWorkspaceUri: string }
111
+ | { readonly kind: 'hover'; readonly hover: LspHover | null }
112
+ ```
113
+
114
+ ## Provider and service
115
+
116
+ A provider owns a stable branded `id` and an exclusive lowercase leading-dot extension map. `registerProvider` reserves the id and every extension atomically — an invalid or conflicting registration publishes nothing — and its disposer releases all reservations. Selection is per query and order-independent; no match throws `LspError` `LSP_UNAVAILABLE`. The seam exposes no protocol types, process/document controls, or generic JSON-RPC escape hatch.
117
+
118
+ ```ts type-equiv
119
+ /**
120
+ * A language-server backend registered on `ctx.lsp`. Each provider owns a stable {@link
121
+ * LspProviderId} and an extension-to-language-id map (lowercase, leading-dot keys).
122
+ * `findReferences` always includes declarations — the provider enforces this internally; callers
123
+ * get no flag.
124
+ */
125
+ interface LspProvider {
126
+ /** Stable provider identity, reserved atomically with the extension mappings. */
127
+ readonly id: LspProviderId
128
+ /** Lowercase leading-dot extension → LSP language id (e.g. `{ '.ts': 'typescript' }`). */
129
+ readonly extensionToLanguage: Readonly<Record<string, string>>
130
+ /**
131
+ * Run one query. The seam has already selected this provider and derived `languageId`.
132
+ * @param request - the resolved provider query (caller request + derived language id).
133
+ * @param signal - optional cancellation; the provider stops its own work when it aborts.
134
+ * @returns the normalized, closed-union result.
135
+ */
136
+ query(request: LspProviderQuery, signal?: AbortSignal): Promise<LspQueryResult>
137
+ }
138
+ ```
139
+
140
+ ```ts type-equiv
141
+ /**
142
+ * The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query
143
+ * execution; exposes exactly the four operations and no protocol escape hatch.
144
+ */
145
+ interface LspService {
146
+ /**
147
+ * Register a provider, atomically reserving its id and every normalized extension. Any conflict
148
+ * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
149
+ * reservations. Disposed with the calling fiber.
150
+ * @param provider - the backend to register.
151
+ * @returns a synchronous disposer releasing the id and all extension reservations.
152
+ */
153
+ registerProvider(provider: LspProvider): () => void
154
+ /**
155
+ * Select a provider by the file's extension and run one query. Selection is per-query and
156
+ * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
157
+ * @param request - the normalized query.
158
+ * @param signal - optional cancellation forwarded to the selected provider.
159
+ * @returns the normalized, closed-union result.
160
+ */
161
+ query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
162
+ }
163
+ ```
164
+
165
+ `LspProviderId` is the seam's branded id (`Branded<'LspProviderId'>` from [dsh-brand](../../packages/util/brand)); `LspError` extends `HarnessError` with stable codes such as `LSP_INVALID_PROVIDER`, `LSP_CONFLICT`, `LSP_UNAVAILABLE`, `LSP_DISPOSED`, `LSP_UNSUPPORTED_OPERATION`, and `LSP_MALFORMED_RESPONSE`, which callers route on instead of parsing `message`.
166
+
167
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
168
+
169
+ <a id="cordis-surface"></a>
170
+
171
+ ## Cordis API
172
+
173
+ 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).
174
+
175
+ <a id="ctxlsp--lspservice"></a>
176
+
177
+ ### `ctx.lsp` — `LspService`
178
+
179
+ The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query execution; exposes exactly the four operations and no protocol escape hatch.
180
+
181
+ ```ts cordis-catalog
182
+ /**
183
+ * Register a provider, atomically reserving its id and every normalized extension. Any conflict
184
+ * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
185
+ * reservations. Disposed with the calling fiber.
186
+ * @param provider - the backend to register.
187
+ * @returns a synchronous disposer releasing the id and all extension reservations.
188
+ */
189
+ registerProvider(provider: LspProvider): () => void
190
+
191
+ /**
192
+ * Select a provider by the file's extension and run one query. Selection is per-query and
193
+ * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
194
+ * @param request - the normalized query.
195
+ * @param signal - optional cancellation forwarded to the selected provider.
196
+ * @returns the normalized, closed-union result.
197
+ */
198
+ query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
199
+ ```
200
+
201
+ Source: [`packages/lsp/lsp/src/types.ts:113`](../../packages/lsp/lsp/src/types.ts)
202
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,202 @@
1
+ # LSP 导航
2
+
3
+ [English](lsp.md) | 中文
4
+
5
+ LSP seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-07-15-lsp-capability-seam.md):它在单一 `ctx.lsp` 服务上公开语义代码导航,并拆分到多个包:Service Definition([dsh-lsp](../../packages/lsp/lsp),`ctx.lsp` + 提供方注册表)、通用 Service Provider([dsh-lsp-stdio](../../packages/lsp/lsp-stdio),经过配置的 stdio 语言服务器宿主)和 Consumer([dsh-tool-lsp](../../packages/lsp/tool-lsp),即 `lsp` 工具 schema)。LSP 是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.md) 中。更换提供方不会改变模型请求导航的方式。
6
+
7
+ 源文件:[`packages/lsp/lsp/src/types.ts`](../../packages/lsp/lsp/src/types.ts)
8
+
9
+ ## 操作与坐标
10
+
11
+ seam 与模型恰好公开 4 项语义查询;该联合是闭合的,因此新增一项查询会通过编译强制要求同步修改 seam、提供方和工具。位置与范围采用从零开始的 UTF-16 坐标,与协议一致;面向模型的工具采用从 1 开始的光标约定,并在输入和输出时进行转换。
12
+
13
+ ```ts type-equiv
14
+ /**
15
+ * The four semantic queries the seam and model expose. A closed union: adding an operation is a
16
+ * compile-enforced change across the seam, providers, and the tool. Symbols and call hierarchy are
17
+ * not operations here; they need different schemas.
18
+ */
19
+ type LspOperation = 'goToDefinition' | 'findReferences' | 'goToImplementation' | 'hover'
20
+ ```
21
+
22
+ ```ts type-equiv
23
+ /** A zero-based UTF-16 cursor coordinate, matching the LSP wire convention. */
24
+ interface LspPosition {
25
+ /** Zero-based line. */
26
+ readonly line: number
27
+ /** Zero-based UTF-16 code-unit offset within the line. */
28
+ readonly character: number
29
+ }
30
+ ```
31
+
32
+ ```ts type-equiv
33
+ /** A zero-based UTF-16 half-open range `[start, end)`. */
34
+ interface LspRange {
35
+ readonly start: LspPosition
36
+ readonly end: LspPosition
37
+ }
38
+ ```
39
+
40
+ ## 请求
41
+
42
+ 每个字段都是必填项:`workspaceRoot` 由调用方提供,`languageId` 来自提供方注册而非请求,超时与结果上限由消费方决定。因此没有字段需要由实现提供默认值,也不存在 `resolve()` 步骤。提供方收到调用方请求和派生的 `languageId`;后者只用于同步瞬态文档,从不参与选择。
43
+
44
+ ```ts type-equiv
45
+ /**
46
+ * A caller's normalized query. Every field is required: `workspaceRoot` is caller-supplied,
47
+ * `languageId` comes from the provider registration (not here), and consumers own timeouts and
48
+ * result limits — so no field needs implementation defaulting and there is no `resolve()` step.
49
+ */
50
+ interface LspQueryRequest {
51
+ /** Which semantic query to run. */
52
+ readonly operation: LspOperation
53
+ /** The source file to query (relative to `workspaceRoot` or absolute; the provider canonicalizes). */
54
+ readonly filePath: string
55
+ /** The zero-based UTF-16 cursor position to query at. */
56
+ readonly position: LspPosition
57
+ /** The workspace root the provider resolves against and indexes; required, never defaulted. */
58
+ readonly workspaceRoot: string
59
+ }
60
+ ```
61
+
62
+ ```ts type-equiv
63
+ /**
64
+ * A request as a provider receives it: the caller's {@link LspQueryRequest} plus the `languageId`
65
+ * the seam derived from the provider's extension mapping. The language id only synchronizes the
66
+ * transient document; it does not participate in selection.
67
+ */
68
+ interface LspProviderQuery extends LspQueryRequest {
69
+ /** The LSP language id for `filePath`, from this provider's extension mapping. */
70
+ readonly languageId: string
71
+ }
72
+ ```
73
+
74
+ ## 结果
75
+
76
+ 这是一个闭合的可辨识联合:导航操作规范化为 `locations`,`hover` 规范化为内容或 `null`。消费方使用 `switch` 对 `kind` 做穷尽处理,因此新增分支会使编译失败,直到完成处理。`findReferences` 始终包含声明;提供方在内部强制保证这一点,因此调用方没有对应 flag。`locations` 变体携带 `resolvedWorkspaceUri`,即提供方的规范工作区 `file:` URI。调用方相对化位置 URI 时应使用这一坐标,而不是对可能经过符号链接的请求根目录应用宿主平台路径规则。
77
+
78
+ ```ts type-equiv
79
+ /** One resolved location: a document URI and the range within it. */
80
+ interface LspLocation {
81
+ /** The target document URI (`file:` or otherwise), verbatim from the server. */
82
+ readonly uri: string
83
+ /** The range within the target document. */
84
+ readonly range: LspRange
85
+ }
86
+ ```
87
+
88
+ ```ts type-equiv
89
+ /** Normalized hover content, or `null` for no hover at the position. */
90
+ interface LspHover {
91
+ /** The normalized hover text (markdown or plaintext, provider-joined). */
92
+ readonly contents: string
93
+ /** The range the hover applies to, when the server supplied one. */
94
+ readonly range?: LspRange
95
+ }
96
+ ```
97
+
98
+ ```ts type-equiv
99
+ /**
100
+ * The closed result union. Navigation operations (`goToDefinition`, `findReferences`,
101
+ * `goToImplementation`) normalize to `locations`; `hover` normalizes to content or `null`.
102
+ * Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled.
103
+ *
104
+ * The `locations` variant carries `resolvedWorkspaceUri`: the provider's canonical `file:` URI for
105
+ * the request's workspace root. A caller that relativizes location URIs MUST use this, not parse the
106
+ * request's possibly symlinked process path with host-platform rules; the execution platform may
107
+ * differ from the caller's.
108
+ */
109
+ type LspQueryResult =
110
+ | { readonly kind: 'locations'; readonly locations: readonly LspLocation[]; readonly resolvedWorkspaceUri: string }
111
+ | { readonly kind: 'hover'; readonly hover: LspHover | null }
112
+ ```
113
+
114
+ ## 提供方与服务
115
+
116
+ 每个提供方拥有一个稳定的品牌化 `id`,以及一份互斥的、小写且以点开头的扩展名映射。`registerProvider` 会原子预留 id 和每个扩展名:注册无效或冲突时不发布任何内容;其 disposer 会释放所有保留项。每次查询独立选择提供方,且选择与顺序无关;没有匹配项时抛出 `LspError` `LSP_UNAVAILABLE`。该 seam 不公开协议类型、进程或文档控制,也不提供通用 JSON-RPC 逃生口。
117
+
118
+ ```ts type-equiv
119
+ /**
120
+ * A language-server backend registered on `ctx.lsp`. Each provider owns a stable {@link
121
+ * LspProviderId} and an extension-to-language-id map (lowercase, leading-dot keys).
122
+ * `findReferences` always includes declarations — the provider enforces this internally; callers
123
+ * get no flag.
124
+ */
125
+ interface LspProvider {
126
+ /** Stable provider identity, reserved atomically with the extension mappings. */
127
+ readonly id: LspProviderId
128
+ /** Lowercase leading-dot extension → LSP language id (e.g. `{ '.ts': 'typescript' }`). */
129
+ readonly extensionToLanguage: Readonly<Record<string, string>>
130
+ /**
131
+ * Run one query. The seam has already selected this provider and derived `languageId`.
132
+ * @param request - the resolved provider query (caller request + derived language id).
133
+ * @param signal - optional cancellation; the provider stops its own work when it aborts.
134
+ * @returns the normalized, closed-union result.
135
+ */
136
+ query(request: LspProviderQuery, signal?: AbortSignal): Promise<LspQueryResult>
137
+ }
138
+ ```
139
+
140
+ ```ts type-equiv
141
+ /**
142
+ * The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query
143
+ * execution; exposes exactly the four operations and no protocol escape hatch.
144
+ */
145
+ interface LspService {
146
+ /**
147
+ * Register a provider, atomically reserving its id and every normalized extension. Any conflict
148
+ * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
149
+ * reservations. Disposed with the calling fiber.
150
+ * @param provider - the backend to register.
151
+ * @returns a synchronous disposer releasing the id and all extension reservations.
152
+ */
153
+ registerProvider(provider: LspProvider): () => void
154
+ /**
155
+ * Select a provider by the file's extension and run one query. Selection is per-query and
156
+ * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
157
+ * @param request - the normalized query.
158
+ * @param signal - optional cancellation forwarded to the selected provider.
159
+ * @returns the normalized, closed-union result.
160
+ */
161
+ query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
162
+ }
163
+ ```
164
+
165
+ `LspProviderId` 是该 seam 的品牌化 id(来自 [dsh-brand](../../packages/util/brand) 的 `Branded<'LspProviderId'>`);`LspError` 扩展 `HarnessError`,提供 `LSP_INVALID_PROVIDER`、`LSP_CONFLICT`、`LSP_UNAVAILABLE`、`LSP_DISPOSED`、`LSP_UNSUPPORTED_OPERATION` 和 `LSP_MALFORMED_RESPONSE` 等稳定错误码,调用方应按错误码路由,而不是解析 `message`。
166
+
167
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
168
+
169
+ <a id="cordis-surface"></a>
170
+
171
+ ## Cordis API
172
+
173
+ 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).
174
+
175
+ <a id="ctxlsp--lspservice"></a>
176
+
177
+ ### `ctx.lsp` — `LspService`
178
+
179
+ The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query execution; exposes exactly the four operations and no protocol escape hatch.
180
+
181
+ ```ts cordis-catalog
182
+ /**
183
+ * Register a provider, atomically reserving its id and every normalized extension. Any conflict
184
+ * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
185
+ * reservations. Disposed with the calling fiber.
186
+ * @param provider - the backend to register.
187
+ * @returns a synchronous disposer releasing the id and all extension reservations.
188
+ */
189
+ registerProvider(provider: LspProvider): () => void
190
+
191
+ /**
192
+ * Select a provider by the file's extension and run one query. Selection is per-query and
193
+ * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
194
+ * @param request - the normalized query.
195
+ * @param signal - optional cancellation forwarded to the selected provider.
196
+ * @returns the normalized, closed-union result.
197
+ */
198
+ query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
199
+ ```
200
+
201
+ Source: [`packages/lsp/lsp/src/types.ts:113`](../../packages/lsp/lsp/src/types.ts)
202
+ <!-- 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/permission-presets.md
5
+ permission-presets.md: 16ce29a4c3b00fece089ebcdc959e57f419d35c9
6
+ permission-presets.zh.md: d2e5eff6696d5dc6f925032d7eaafb7b19774f4e
@@ -0,0 +1,131 @@
1
+ # Permission Presets
2
+
3
+ English | [中文](permission-presets.zh.md)
4
+
5
+ The permission-preset layer of [dsh-permission-presets](../../packages/interaction/permission-presets) (`ctx.permissionPresets`, `PermissionPresetService`) bundles the two independent enforcement knobs — [sandbox mode](sandbox.md) (`sandbox/mode`) and [approval policy](approval.md) (`approval/policy`) — into named presets a client offers as one Permissions selector. It is one optional capability, not part of the agent-loop spine, and it owns no enforcement: execution, prompt narration, and replay keep reading their knob folds, and a preset switch only records intent and writes through each knob's canonical setter. The [package README](../../packages/interaction/permission-presets/README.md) owns composition status and limitations; the [sandbox switching design](../../.agents/notes/implemented/feature/2026-07-06-sandbox.md) owns the rationale.
6
+
7
+ Source: [`packages/interaction/permission-presets/src/index.ts`](../../packages/interaction/permission-presets/src/index.ts)
8
+
9
+ ## The preset table
10
+
11
+ A preset is a table key mapping to one sandbox/approval bundle plus optional client presentation; the default table ships `workspace-write` (`workspace-write` + `ask`) and `danger-full-access` (`danger-full-access` + `never`).
12
+
13
+ ```ts type-equiv
14
+ /** One preset's sandbox/approval bundle and optional client presentation. */
15
+ interface PresetSpec {
16
+ /** The `sandbox/mode` value the preset writes through. */
17
+ sandbox: SandboxMode
18
+ /** The `approval/policy` value the preset writes through. */
19
+ approval: ApprovalPolicy
20
+ /** The display label a client shows for this preset; the raw table key when omitted. */
21
+ name?: string
22
+ /** One user-facing sentence on what the preset means; omitted when not configured. */
23
+ description?: string
24
+ }
25
+ ```
26
+
27
+ ```ts type-equiv
28
+ /** The {@link PermissionPresetService} config: preset table and composition default. */
29
+ interface Config {
30
+ /**
31
+ * The preset table: name → knob bundle. Defaults to `workspace-write`
32
+ * (workspace-write + ask) and `danger-full-access` (danger-full-access +
33
+ * never). The name `custom` is reserved for the derived not-a-preset state.
34
+ */
35
+ presets?: Record<string, PresetSpec>
36
+ /**
37
+ * Default for new sessions. When omitted, the preset matching the composed
38
+ * sandbox and approval defaults is used.
39
+ */
40
+ defaultPreset?: string
41
+ }
42
+ ```
43
+
44
+ The service requires a confining `ctx.shell` executor and `ctx.approval`, and misconfiguration fails at plugin load: a table entry named `custom` throws (the name is reserved for the derived not-a-preset state), and composing over a bash executor that does not confine (no `sandboxMode` capability fact) throws, because presets bundle a sandbox mode.
45
+
46
+ ## Current preset and the derived `custom`
47
+
48
+ `current(events)` derives the effective preset from the knobs, not from its own event alone: it folds the session's effective sandbox mode (falling back to the executor's configured mode) and effective approval policy (falling back to the approval service config, then `ask`), prefers a still-matching recorded selection, then the first matching table entry in declaration order, and otherwise returns `CUSTOM_PRESET` (`'custom'`). `custom` is derived-only: clients may display it as the current value, but it is never a switch target or an event payload.
49
+
50
+ `names` lists the switchable presets in table declaration order; `optionOf(name)` builds the option a client renders for a table key (label falls back to the key) or for `custom`, and throws for any other name.
51
+
52
+ ```ts type-equiv
53
+ /** The select-option shape a presentation layer advertises for one preset (or for the derived `custom` state). */
54
+ interface PresetOption {
55
+ /** Stable option value: the table key, or `custom`. */
56
+ value: string
57
+ /** The display label. */
58
+ name: string
59
+ /** One user-facing sentence on what the value means; omitted when not configured. */
60
+ description?: string
61
+ }
62
+ ```
63
+
64
+ ## Switching and the `permission/preset` event
65
+
66
+ `set(session, name)` resolves the preset (unknown names throw), appends a log-only `permission/preset` event unless `name` is already the effective preset, then writes each knob through its own setter — `setSandboxMode` from [dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) and `setApprovalPolicy` from [dsh-user-approval](../../packages/interaction/user-approval) — only when that knob's effective value changes. The selection event precedes the knob events in the same turn, and re-selecting the effective preset appends nothing at all.
67
+
68
+ `permission/preset` is durable, log-only user intent: it stays out of the model transcript (the knob events own the model-visible consequences through their consumers), and it exists so `current()` can preserve WHICH preset the user chose when two presets share a bundle; `effectivePermissionPreset(events)` folds the last one, and replay needs no catch-up state. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md); the method signatures are in the generated [service catalog](#ctxpermissionpresets--permissionpresetservice).
69
+
70
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
71
+
72
+ <a id="cordis-surface"></a>
73
+
74
+ ## Cordis API
75
+
76
+ 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).
77
+
78
+ <a id="ctxpermissionpresets--permissionpresetservice"></a>
79
+
80
+ ### `ctx.permissionPresets` — `PermissionPresetService`
81
+
82
+ Owns the deployment's permission presets and their write path. Requires a confining `ctx.shell` executor and `ctx.approval`; unmatched knob values are reported as CUSTOM_PRESET, not an error.
83
+
84
+ ```ts cordis-catalog
85
+ /**
86
+ * Resolve the preset matching the effective knob values. A still-matching
87
+ * last selection wins shared-bundle ties; otherwise the first table match
88
+ * wins, or {@link CUSTOM_PRESET} when no entry matches.
89
+ * @param events - the session's events in log order.
90
+ * @returns the effective preset name, or `custom` when nothing matches.
91
+ */
92
+ current(events: readonly SessionEvent[]): string
93
+
94
+ /**
95
+ * Build the whole select value for one folded knob state: every table
96
+ * option in declaration order, `custom` appended exactly while derived.
97
+ * @param state - the folded knob overrides.
98
+ * @returns the `permissions` projection payload.
99
+ */
100
+ selectFor(state: KnobState): PermissionSelect
101
+
102
+ /**
103
+ * Resolve a preset's knob bundle.
104
+ * @param name - the preset name to resolve.
105
+ * @returns the configured bundle.
106
+ * @throws when `name` is not in the table.
107
+ */
108
+ resolve(name: string): PresetSpec
109
+
110
+ /**
111
+ * Build the client option for a table entry or {@link CUSTOM_PRESET}. A
112
+ * missing label falls back to the table key.
113
+ * @param name - a table key, or `custom`.
114
+ * @returns the option a client renders.
115
+ * @throws when `name` is neither a table key nor `custom`.
116
+ */
117
+ optionOf(name: string): PresetOption
118
+
119
+ /**
120
+ * Record a changed preset, then update each changed knob through its own
121
+ * setter. Selecting the effective preset again appends nothing.
122
+ * @param session - the session the switch belongs to.
123
+ * @param name - the preset to switch to; unknown names throw.
124
+ */
125
+ set(session: Session, name: string): void
126
+ ```
127
+
128
+ Types: [Session](session.md) · [SessionEvent](session.md)
129
+
130
+ Source: [`packages/interaction/permission-presets/src/index.ts:159`](../../packages/interaction/permission-presets/src/index.ts)
131
+ <!-- END GENERATED cordis-surface -->