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/settings.md
5
+ settings.md: bb6163eb11412ebe90e7c72d76c0a7b77e040172
6
+ settings.zh.md: b8168cba14003de61851841041e69e35c7583afa
@@ -0,0 +1,310 @@
1
+ # User Settings
2
+
3
+ English | [中文](settings.zh.md)
4
+
5
+ The user-settings seam of [dsh-settings](../../packages/settings/settings) holds one user-owned document of per-namespace sections and resolves each registered namespace as schema defaults, then the registrant's composition `base`, then the user section. Providers such as [dsh-settings-file](../../packages/settings/settings-file) store the raw document and push external edits; consumer plugins register a schema and read or observe the resolved value. Composition config stays in `cordis.yml` — a namespace carries only the user-editable subset.
6
+
7
+ Source: [`packages/settings/settings/src/index.ts`](../../packages/settings/settings/src/index.ts)
8
+
9
+ ## Identity
10
+
11
+ A namespace names one plugin-owned section of the user document. The brand prevents callers from mixing settings namespaces with other ids passed between packages or processes; construction validates lowercase kebab-case syntax.
12
+
13
+ ```ts type-equiv
14
+ /** Nominal id of one registered settings namespace. */
15
+ type SettingsNamespace = Branded<'SettingsNamespace'>
16
+ ```
17
+
18
+ ## Registration
19
+
20
+ Registration binds a schemastery schema to a namespace on the calling plugin's fiber — disposing that fiber removes the namespace and its observers. The options carry the composition layer, the owner's effect timing, and an optional check for what the schema cannot express.
21
+
22
+ ```ts type-equiv
23
+ /** Registration options beyond the namespace schema. */
24
+ interface SettingsRegisterOptions<T> {
25
+ /** Composition-layer values resolved below the user layer (entry-config subset). */
26
+ base?: Partial<T>
27
+ /** Owner's effect timing, surfaced to configuration UIs; defaults to `live`. */
28
+ applies?: SettingsApplies
29
+ /**
30
+ * Reject a resolved section the owner could not act on, for constraints its
31
+ * schema cannot express — a cross-field requirement, or one field's validity
32
+ * depending on another's. Throwing here refuses the *write* that produced the
33
+ * value, so a caller learns at `update`/`replace`/`mutate` instead of storing
34
+ * something that would silently disable the owner.
35
+ *
36
+ * Kept separate from the schema because the schema is also what a
37
+ * configuration surface renders and what an absent section resolves through;
38
+ * folding a cross-field check into it would change both.
39
+ *
40
+ * Once the owner is registered, a stored section that fails this keeps the
41
+ * namespace's last good value and warns, exactly as a schema failure does,
42
+ * so an externally edited document cannot strand a running owner. At
43
+ * registration there is no last good value yet, so a stored section that
44
+ * already fails rejects the registration itself — again exactly as a schema
45
+ * failure does.
46
+ * @param value - the resolved section, schema-valid by construction.
47
+ */
48
+ validate?: (value: T) => void
49
+ }
50
+ ```
51
+
52
+ `validate` runs after the schema admits a value, so it sees defaults and the composition base exactly as the owner will. `dsh-llm-pi-ai` uses it to refuse a provider profile it could not serve at the write that produced it, rather than storing one that would disable every route in its namespace.
53
+
54
+ `applies` is a UI hint, not a mechanism: a `restart` owner simply never watches, so its value is read once at construction and configuration surfaces can badge the pending change.
55
+
56
+ ```ts type-equiv
57
+ /** When a namespace's changes take effect for its owner. */
58
+ type SettingsApplies = 'live' | 'restart'
59
+ ```
60
+
61
+ ## Owner scope
62
+
63
+ The scope is the owner-facing handle. `update` merges a sparse patch over the user section only (never into `base`); `replace` sets the section wholesale, which is the removal/reset path — keys absent from the replacement re-inherit `base` and schema defaults. Writes to one namespace are serialized in call order, and resolved values are deep-frozen snapshots.
64
+
65
+ ```ts type-equiv
66
+ /** Owner-facing handle for one registered namespace. */
67
+ interface SettingsScope<T> {
68
+ /** Current resolved value: schema defaults, then `base`, then the user layer. */
69
+ get(): T
70
+ /**
71
+ * Observe committed changes to this namespace's resolved value. Invocations
72
+ * of one callback run asynchronously, one at a time, in commit order; a
73
+ * rejection is contained and logged like a sync throw. After the disposer
74
+ * returns, no further invocation starts — one already queued is skipped;
75
+ * one already started still settles, and service disposal waits for it.
76
+ * @param callback - invoked after each commit with the next and previous values.
77
+ * @returns the disposer removing this observer.
78
+ */
79
+ watch(callback: (next: T, prev: T) => void | Promise<void>): () => void
80
+ /**
81
+ * Merge a partial patch into this namespace's user layer and persist it.
82
+ * @param patch - plain-object patch over the user section; JSON-compatible data
83
+ * only (non-JSON values reject with their path before anything persists).
84
+ */
85
+ update(patch: object): Promise<void>
86
+ /**
87
+ * Replace this namespace's user section wholesale; absent keys re-inherit
88
+ * the composition `base` and schema defaults (`replace({})` resets all).
89
+ * @param section - the complete next user section; JSON-compatible data only,
90
+ * as for {@link update}.
91
+ */
92
+ replace(section: object): Promise<void>
93
+ }
94
+ ```
95
+
96
+ ## Descriptors
97
+
98
+ `describe()` serializes every registered namespace for configuration surfaces: the schemastery `toJSON()` envelope drives schema-rendered forms, the resolved value fills them, and the detached `base`/`user` layers let a form mark user-overridden fields by presence. `describe({ redactSecrets: true })` — mandatory on every wire surface — strips `role('secret')` fields from all three layers and enumerates their `{path, set}` slots so a page can render write-only inputs without ever receiving a secret.
99
+
100
+ ```ts type-equiv
101
+ /** One registered namespace as surfaced to configuration UIs. */
102
+ interface SettingsDescriptor {
103
+ /** The registered namespace. */
104
+ ns: SettingsNamespace
105
+ /** Serialized schemastery schema (`schema.toJSON()`). */
106
+ schema: unknown
107
+ /** Current resolved value. */
108
+ value: unknown
109
+ /**
110
+ * Monotonic revision of the raw user section this descriptor was read at.
111
+ * Send it back as `expectedRevision` on a write to refuse a stale one.
112
+ */
113
+ revision: number
114
+ /** Registrant's composition `base` layer (detached), when one was declared. */
115
+ base?: unknown
116
+ /**
117
+ * Raw user section from the stored document (detached), when one exists and
118
+ * is well-formed; a field's presence here is what marks it user-overridden.
119
+ */
120
+ user?: unknown
121
+ /** Owner's declared effect timing. */
122
+ applies: SettingsApplies
123
+ /** Schema-declared secret positions; present only under `redactSecrets`. */
124
+ secrets?: RedactedSecret[]
125
+ }
126
+ ```
127
+
128
+ A caller that holds only the redacted descriptor cannot safely rebuild a section, so removals travel as path ops instead. Each descriptor also carries a `revision` over the raw section; a write may send it back as `expectedRevision`, and one that no longer matches is refused rather than applied over the writer that landed first.
129
+ ```ts type-equiv
130
+ /**
131
+ * One path-addressed edit to a namespace's user section. Path mutation exists
132
+ * for a caller holding an INCOMPLETE view of the section — a configuration UI
133
+ * reads the redacted descriptor, which by construction never received the
134
+ * `role('secret')` fields. Such a caller can name the field it means without
135
+ * restating the section: a wholesale `replace` rebuilt from a redacted
136
+ * document silently deletes every secret the wire never returned.
137
+ */
138
+ type SettingsPathOp =
139
+ | { op: 'set'; path: readonly string[]; value: unknown }
140
+ | { op: 'unset'; path: readonly string[] }
141
+ ```
142
+
143
+ ```ts type-equiv
144
+ /** Options for {@link SettingsProvider.describe}. */
145
+ interface SettingsDescribeOptions {
146
+ /**
147
+ * Strip `role('secret')` fields from `value`/`base`/`user` and enumerate
148
+ * them in each descriptor's `secrets`. Every wire surface MUST pass this;
149
+ * the verbatim default exists for same-process configuration UIs only.
150
+ */
151
+ redactSecrets?: boolean
152
+ }
153
+ ```
154
+
155
+ ## Change commits
156
+
157
+ Every committed change — an in-process write or an externally observed provider edit — emits `settings/updated (ns, next, prev, source)` after the new value is authoritative, and never when the resolved value is deep-equal. The source tag separates the two entry paths.
158
+
159
+ ```ts type-equiv
160
+ /** Origin of one committed settings change. */
161
+ type SettingsUpdateSource = 'update' | 'provider'
162
+ ```
163
+
164
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
165
+
166
+ <a id="cordis-surface"></a>
167
+
168
+ ## Cordis API
169
+
170
+ 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).
171
+
172
+ <a id="ctxsettings--settingsprovider-abstract-seam"></a>
173
+
174
+ ### `ctx.settings` — `SettingsProvider` (abstract seam)
175
+
176
+ Abstract settings service. Providers implement raw-document storage (`load`/`persist`) and push external changes through Settings.publish; the base class owns namespace registration, resolution, validation, change detection, and the `settings/updated` commit event.
177
+
178
+ ```ts cordis-catalog
179
+ /**
180
+ * Prepare the provider's user-editable document for a native editor. File
181
+ * providers may materialize an absent document before returning its path;
182
+ * non-file providers return undefined.
183
+ * @returns the absolute local document path, or undefined for non-file storage.
184
+ */
185
+ prepareDocument(): Promise<string | undefined>
186
+
187
+ /**
188
+ * Register a namespace schema and receive its owner scope. The registration
189
+ * is an effect on the calling plugin's fiber: disposing that fiber removes
190
+ * the namespace and its observers. An invalid stored section fails the
191
+ * registration itself — the earliest point where the schema can judge it.
192
+ * @param ns - unique namespace; duplicate registration fails loud.
193
+ * @param schema - schemastery schema resolving this namespace's value.
194
+ * @param options - composition `base` layer and effect timing.
195
+ * @returns the owner scope for reads, observation, and updates.
196
+ */
197
+ register<T>(ns: SettingsNamespace, schema: z<T>, options?: SettingsRegisterOptions<T>): SettingsScope<T>
198
+
199
+ /**
200
+ * Describe every registered namespace for configuration surfaces, including
201
+ * the composition `base` and raw user layers so a form can mark which fields
202
+ * the user overrode (presence in `user`) and what a reset returns to.
203
+ * @param options - redaction switch; wire surfaces must redact.
204
+ * @returns one descriptor per registered namespace, in registration order.
205
+ */
206
+ describe(options?: SettingsDescribeOptions): SettingsDescriptor[]
207
+
208
+ /**
209
+ * Read one registered namespace's resolved value.
210
+ * @param ns - the namespace to read.
211
+ * @returns the resolved value, or `undefined` while unregistered.
212
+ */
213
+ get(ns: SettingsNamespace): unknown
214
+
215
+ /**
216
+ * Merge a patch into one registered namespace's user layer, validate the
217
+ * resolved candidate, persist through the provider, then commit and emit.
218
+ * A validation failure rejects before anything is persisted. Writes to one
219
+ * namespace are serialized: concurrent updates apply in call order, each
220
+ * merging over the previous write's committed section.
221
+ * @param ns - the registered namespace to update.
222
+ * @param patch - plain-object patch over the user section.
223
+ * @param expectedRevision - the descriptor `revision` the caller read; a
224
+ * namespace that moved past it rejects with {@link SettingsConflictError}.
225
+ */
226
+ async update(ns: SettingsNamespace, patch: object, expectedRevision?: number): Promise<void>
227
+
228
+ /**
229
+ * Replace one registered namespace's user section wholesale, validate,
230
+ * persist, then commit and emit. Keys absent from `section` fall back to the
231
+ * composition `base` and schema defaults — this is the removal/reset path a
232
+ * merge-only patch cannot express (`replace({})` re-inherits everything).
233
+ * @param ns - the registered namespace to replace.
234
+ * @param section - the complete next user section.
235
+ * @param expectedRevision - the descriptor `revision` the caller read; a
236
+ * namespace that moved past it rejects with {@link SettingsConflictError}.
237
+ */
238
+ async replace(ns: SettingsNamespace, section: object, expectedRevision?: number): Promise<void>
239
+
240
+ /**
241
+ * Apply path-addressed edits to one registered namespace's user section,
242
+ * validate, persist, then commit and emit. The ops are applied to the
243
+ * section as it stands when the write reaches the front of the queue, so a
244
+ * caller never has to restate fields it did not touch — and, crucially,
245
+ * cannot delete fields it never saw. This is the write path for any caller
246
+ * holding a redacted view; `replace` remains the wholesale reset.
247
+ * @param ns - the registered namespace to edit.
248
+ * @param ops - ordered path edits; later ops observe earlier ones.
249
+ * @param expectedRevision - the descriptor `revision` the caller read; a
250
+ * namespace that moved past it rejects with {@link SettingsConflictError}.
251
+ */
252
+ async mutate(ns: SettingsNamespace, ops: readonly SettingsPathOp[], expectedRevision?: number): Promise<void>
253
+ ```
254
+
255
+ Source: [`packages/settings/settings/src/index.ts:350`](../../packages/settings/settings/src/index.ts)
256
+
257
+ <a id="settings-events"></a>
258
+
259
+ ### `settings/*` events
260
+
261
+ <a id="settingsdocument-updated--emit"></a>
262
+
263
+ #### `settings/document-updated` — emit
264
+
265
+ One registered namespace's RAW user section changed, whether or not the resolved value did. `settings/updated` is the consumer-facing event and stays deep-equal-gated; this one exists for configuration surfaces, which must learn that a field went from inherited to overridden (same resolved value, different meaning) and that their held revision is stale. Listener containment matches `settings/updated`.
266
+
267
+ ```ts cordis-catalog
268
+ /**
269
+ * One registered namespace's RAW user section changed, whether or not the
270
+ * resolved value did. `settings/updated` is the consumer-facing event and
271
+ * stays deep-equal-gated; this one exists for configuration surfaces,
272
+ * which must learn that a field went from inherited to overridden (same
273
+ * resolved value, different meaning) and that their held revision is
274
+ * stale. Listener containment matches `settings/updated`.
275
+ * @param ns - the namespace whose stored section changed.
276
+ * @param revision - the namespace's new revision.
277
+ * @mode emit
278
+ */
279
+ 'settings/document-updated'(ns: SettingsNamespace, revision: number): void
280
+ ```
281
+
282
+ Source: [`packages/settings/settings/src/types.ts:48`](../../packages/settings/settings/src/types.ts)
283
+
284
+ <a id="settingsupdated--emit"></a>
285
+
286
+ #### `settings/updated` — emit
287
+
288
+ Committed change to one registered namespace's resolved value. Emitted after the provider persisted (for `update`) or published (`provider`) the change; never emitted when the resolved value is deep-equal. Listener failures are contained and logged — a sync throw and an async rejection alike — except `INVARIANT`-coded failures, which rethrow after every listener ran; that rethrow reaches the emitter only from synchronous listeners, so invariant checks on this event must not be async functions.
289
+
290
+ ```ts cordis-catalog
291
+ /**
292
+ * Committed change to one registered namespace's resolved value. Emitted
293
+ * after the provider persisted (for `update`) or published (`provider`)
294
+ * the change; never emitted when the resolved value is deep-equal.
295
+ * Listener failures are contained and logged — a sync throw and an async
296
+ * rejection alike — except `INVARIANT`-coded failures, which rethrow
297
+ * after every listener ran; that rethrow reaches the emitter only from
298
+ * synchronous listeners, so invariant checks on this event must not be
299
+ * async functions.
300
+ * @param ns - the namespace whose resolved value changed.
301
+ * @param next - the new resolved value.
302
+ * @param prev - the previous resolved value.
303
+ * @param source - whether the change entered through `update()` or the provider.
304
+ * @mode emit
305
+ */
306
+ 'settings/updated'(ns: SettingsNamespace, next: unknown, prev: unknown, source: SettingsUpdateSource): void
307
+ ```
308
+
309
+ Source: [`packages/settings/settings/src/types.ts:35`](../../packages/settings/settings/src/types.ts)
310
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,310 @@
1
+ # 用户设置
2
+
3
+ [English](settings.md) | 中文
4
+
5
+ [dsh-settings](../../packages/settings/settings) 的用户设置 seam 持有一份按 namespace 分节的用户文档,并把每个已注册 namespace 解析为:schema 默认值,然后注册方的组合 `base`,最后用户分节。[dsh-settings-file](../../packages/settings/settings-file) 这类提供方存储原始文档并推送外部编辑;消费方插件注册 schema 后读取或观察解析值。组合配置仍留在 `cordis.yml`——namespace 只承载用户可编辑子集。
6
+
7
+ 来源:[`packages/settings/settings/src/index.ts`](../../packages/settings/settings/src/index.ts)
8
+
9
+ ## 标识
10
+
11
+ namespace 命名用户文档中一个归插件所有的分节。brand 防止调用方将设置 namespace 与在包或进程之间传递的其他 id 混用;构造时校验小写 kebab-case 语法。
12
+
13
+ ```ts type-equiv
14
+ /** Nominal id of one registered settings namespace. */
15
+ type SettingsNamespace = Branded<'SettingsNamespace'>
16
+ ```
17
+
18
+ ## 注册
19
+
20
+ 注册把 schemastery schema 绑定到调用方插件 fiber 上的 namespace——dispose(资源释放)该 fiber 即移除 namespace 及其观察者。options 携带组合层、owner 的生效时机,以及一个可选的、用于校验 schema 表达不了的约束的钩子。
21
+
22
+ ```ts type-equiv
23
+ /** Registration options beyond the namespace schema. */
24
+ interface SettingsRegisterOptions<T> {
25
+ /** Composition-layer values resolved below the user layer (entry-config subset). */
26
+ base?: Partial<T>
27
+ /** Owner's effect timing, surfaced to configuration UIs; defaults to `live`. */
28
+ applies?: SettingsApplies
29
+ /**
30
+ * Reject a resolved section the owner could not act on, for constraints its
31
+ * schema cannot express — a cross-field requirement, or one field's validity
32
+ * depending on another's. Throwing here refuses the *write* that produced the
33
+ * value, so a caller learns at `update`/`replace`/`mutate` instead of storing
34
+ * something that would silently disable the owner.
35
+ *
36
+ * Kept separate from the schema because the schema is also what a
37
+ * configuration surface renders and what an absent section resolves through;
38
+ * folding a cross-field check into it would change both.
39
+ *
40
+ * Once the owner is registered, a stored section that fails this keeps the
41
+ * namespace's last good value and warns, exactly as a schema failure does,
42
+ * so an externally edited document cannot strand a running owner. At
43
+ * registration there is no last good value yet, so a stored section that
44
+ * already fails rejects the registration itself — again exactly as a schema
45
+ * failure does.
46
+ * @param value - the resolved section, schema-valid by construction.
47
+ */
48
+ validate?: (value: T) => void
49
+ }
50
+ ```
51
+
52
+ `validate` 在 schema 接纳该值之后运行,因此它看到的默认值和组合 base 与 owner 实际看到的完全一致。`dsh-llm-pi-ai` 用它在写入处拒绝自己无法服务的提供方 profile,而不是先存下来、再让该 namespace 下每条路由失效。
53
+
54
+ `applies` 是 UI 提示而非机制:`restart` 的 owner 只是从不 watch,其值在构造期读取一次,配置界面可为待生效变更加标。
55
+
56
+ ```ts type-equiv
57
+ /** When a namespace's changes take effect for its owner. */
58
+ type SettingsApplies = 'live' | 'restart'
59
+ ```
60
+
61
+ ## Owner scope
62
+
63
+ scope 是面向 owner 的句柄。`update` 把稀疏 patch 只合并进用户分节(绝不进 `base`);`replace` 整体替换分节,是删除/重置路径——替换中缺席的键重新继承 `base` 与 schema 默认值。同一 namespace 的写入按调用顺序串行,解析值是深冻结快照。
64
+
65
+ ```ts type-equiv
66
+ /** Owner-facing handle for one registered namespace. */
67
+ interface SettingsScope<T> {
68
+ /** Current resolved value: schema defaults, then `base`, then the user layer. */
69
+ get(): T
70
+ /**
71
+ * Observe committed changes to this namespace's resolved value. Invocations
72
+ * of one callback run asynchronously, one at a time, in commit order; a
73
+ * rejection is contained and logged like a sync throw. After the disposer
74
+ * returns, no further invocation starts — one already queued is skipped;
75
+ * one already started still settles, and service disposal waits for it.
76
+ * @param callback - invoked after each commit with the next and previous values.
77
+ * @returns the disposer removing this observer.
78
+ */
79
+ watch(callback: (next: T, prev: T) => void | Promise<void>): () => void
80
+ /**
81
+ * Merge a partial patch into this namespace's user layer and persist it.
82
+ * @param patch - plain-object patch over the user section; JSON-compatible data
83
+ * only (non-JSON values reject with their path before anything persists).
84
+ */
85
+ update(patch: object): Promise<void>
86
+ /**
87
+ * Replace this namespace's user section wholesale; absent keys re-inherit
88
+ * the composition `base` and schema defaults (`replace({})` resets all).
89
+ * @param section - the complete next user section; JSON-compatible data only,
90
+ * as for {@link update}.
91
+ */
92
+ replace(section: object): Promise<void>
93
+ }
94
+ ```
95
+
96
+ ## 描述符
97
+
98
+ `describe()` 为配置界面序列化每个已注册 namespace:schemastery 的 `toJSON()` 封装结构驱动 schema 渲染的表单,解析值填充表单,分离出的 `base`/`user` 层让表单按字段是否出现在 user 层标注「用户已覆盖」。`describe({ redactSecrets: true })`——每个对外传输接口都必须传入——从三层剥离 `role('secret')` 字段并枚举其 `{path, set}` slot,页面因此能渲染只写输入框而永远收不到机密值。
99
+
100
+ ```ts type-equiv
101
+ /** One registered namespace as surfaced to configuration UIs. */
102
+ interface SettingsDescriptor {
103
+ /** The registered namespace. */
104
+ ns: SettingsNamespace
105
+ /** Serialized schemastery schema (`schema.toJSON()`). */
106
+ schema: unknown
107
+ /** Current resolved value. */
108
+ value: unknown
109
+ /**
110
+ * Monotonic revision of the raw user section this descriptor was read at.
111
+ * Send it back as `expectedRevision` on a write to refuse a stale one.
112
+ */
113
+ revision: number
114
+ /** Registrant's composition `base` layer (detached), when one was declared. */
115
+ base?: unknown
116
+ /**
117
+ * Raw user section from the stored document (detached), when one exists and
118
+ * is well-formed; a field's presence here is what marks it user-overridden.
119
+ */
120
+ user?: unknown
121
+ /** Owner's declared effect timing. */
122
+ applies: SettingsApplies
123
+ /** Schema-declared secret positions; present only under `redactSecrets`. */
124
+ secrets?: RedactedSecret[]
125
+ }
126
+ ```
127
+
128
+ 只持有脱敏 descriptor 的调用方无法安全地重建分节,因此删除改以路径 op 传递。每个 descriptor 还携带针对原始分节的 `revision`;写入可以把它作为 `expectedRevision` 送回,不再匹配的写入会被拒绝,而不会覆盖先落地的写入。
129
+ ```ts type-equiv
130
+ /**
131
+ * One path-addressed edit to a namespace's user section. Path mutation exists
132
+ * for a caller holding an INCOMPLETE view of the section — a configuration UI
133
+ * reads the redacted descriptor, which by construction never received the
134
+ * `role('secret')` fields. Such a caller can name the field it means without
135
+ * restating the section: a wholesale `replace` rebuilt from a redacted
136
+ * document silently deletes every secret the wire never returned.
137
+ */
138
+ type SettingsPathOp =
139
+ | { op: 'set'; path: readonly string[]; value: unknown }
140
+ | { op: 'unset'; path: readonly string[] }
141
+ ```
142
+
143
+ ```ts type-equiv
144
+ /** Options for {@link SettingsProvider.describe}. */
145
+ interface SettingsDescribeOptions {
146
+ /**
147
+ * Strip `role('secret')` fields from `value`/`base`/`user` and enumerate
148
+ * them in each descriptor's `secrets`. Every wire surface MUST pass this;
149
+ * the verbatim default exists for same-process configuration UIs only.
150
+ */
151
+ redactSecrets?: boolean
152
+ }
153
+ ```
154
+
155
+ ## 变更提交
156
+
157
+ 每次提交的变更——进程内写入或提供方观察到的外部编辑——在新值成为权威值之后发出 `settings/updated (ns, next, prev, source)`,解析值深相等时绝不发出。source 标记区分两条入口路径。
158
+
159
+ ```ts type-equiv
160
+ /** Origin of one committed settings change. */
161
+ type SettingsUpdateSource = 'update' | 'provider'
162
+ ```
163
+
164
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
165
+
166
+ <a id="cordis-surface"></a>
167
+
168
+ ## Cordis API
169
+
170
+ 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).
171
+
172
+ <a id="ctxsettings--settingsprovider-abstract-seam"></a>
173
+
174
+ ### `ctx.settings` — `SettingsProvider` (abstract seam)
175
+
176
+ Abstract settings service. Providers implement raw-document storage (`load`/`persist`) and push external changes through Settings.publish; the base class owns namespace registration, resolution, validation, change detection, and the `settings/updated` commit event.
177
+
178
+ ```ts cordis-catalog
179
+ /**
180
+ * Prepare the provider's user-editable document for a native editor. File
181
+ * providers may materialize an absent document before returning its path;
182
+ * non-file providers return undefined.
183
+ * @returns the absolute local document path, or undefined for non-file storage.
184
+ */
185
+ prepareDocument(): Promise<string | undefined>
186
+
187
+ /**
188
+ * Register a namespace schema and receive its owner scope. The registration
189
+ * is an effect on the calling plugin's fiber: disposing that fiber removes
190
+ * the namespace and its observers. An invalid stored section fails the
191
+ * registration itself — the earliest point where the schema can judge it.
192
+ * @param ns - unique namespace; duplicate registration fails loud.
193
+ * @param schema - schemastery schema resolving this namespace's value.
194
+ * @param options - composition `base` layer and effect timing.
195
+ * @returns the owner scope for reads, observation, and updates.
196
+ */
197
+ register<T>(ns: SettingsNamespace, schema: z<T>, options?: SettingsRegisterOptions<T>): SettingsScope<T>
198
+
199
+ /**
200
+ * Describe every registered namespace for configuration surfaces, including
201
+ * the composition `base` and raw user layers so a form can mark which fields
202
+ * the user overrode (presence in `user`) and what a reset returns to.
203
+ * @param options - redaction switch; wire surfaces must redact.
204
+ * @returns one descriptor per registered namespace, in registration order.
205
+ */
206
+ describe(options?: SettingsDescribeOptions): SettingsDescriptor[]
207
+
208
+ /**
209
+ * Read one registered namespace's resolved value.
210
+ * @param ns - the namespace to read.
211
+ * @returns the resolved value, or `undefined` while unregistered.
212
+ */
213
+ get(ns: SettingsNamespace): unknown
214
+
215
+ /**
216
+ * Merge a patch into one registered namespace's user layer, validate the
217
+ * resolved candidate, persist through the provider, then commit and emit.
218
+ * A validation failure rejects before anything is persisted. Writes to one
219
+ * namespace are serialized: concurrent updates apply in call order, each
220
+ * merging over the previous write's committed section.
221
+ * @param ns - the registered namespace to update.
222
+ * @param patch - plain-object patch over the user section.
223
+ * @param expectedRevision - the descriptor `revision` the caller read; a
224
+ * namespace that moved past it rejects with {@link SettingsConflictError}.
225
+ */
226
+ async update(ns: SettingsNamespace, patch: object, expectedRevision?: number): Promise<void>
227
+
228
+ /**
229
+ * Replace one registered namespace's user section wholesale, validate,
230
+ * persist, then commit and emit. Keys absent from `section` fall back to the
231
+ * composition `base` and schema defaults — this is the removal/reset path a
232
+ * merge-only patch cannot express (`replace({})` re-inherits everything).
233
+ * @param ns - the registered namespace to replace.
234
+ * @param section - the complete next user section.
235
+ * @param expectedRevision - the descriptor `revision` the caller read; a
236
+ * namespace that moved past it rejects with {@link SettingsConflictError}.
237
+ */
238
+ async replace(ns: SettingsNamespace, section: object, expectedRevision?: number): Promise<void>
239
+
240
+ /**
241
+ * Apply path-addressed edits to one registered namespace's user section,
242
+ * validate, persist, then commit and emit. The ops are applied to the
243
+ * section as it stands when the write reaches the front of the queue, so a
244
+ * caller never has to restate fields it did not touch — and, crucially,
245
+ * cannot delete fields it never saw. This is the write path for any caller
246
+ * holding a redacted view; `replace` remains the wholesale reset.
247
+ * @param ns - the registered namespace to edit.
248
+ * @param ops - ordered path edits; later ops observe earlier ones.
249
+ * @param expectedRevision - the descriptor `revision` the caller read; a
250
+ * namespace that moved past it rejects with {@link SettingsConflictError}.
251
+ */
252
+ async mutate(ns: SettingsNamespace, ops: readonly SettingsPathOp[], expectedRevision?: number): Promise<void>
253
+ ```
254
+
255
+ Source: [`packages/settings/settings/src/index.ts:350`](../../packages/settings/settings/src/index.ts)
256
+
257
+ <a id="settings-events"></a>
258
+
259
+ ### `settings/*` events
260
+
261
+ <a id="settingsdocument-updated--emit"></a>
262
+
263
+ #### `settings/document-updated` — emit
264
+
265
+ One registered namespace's RAW user section changed, whether or not the resolved value did. `settings/updated` is the consumer-facing event and stays deep-equal-gated; this one exists for configuration surfaces, which must learn that a field went from inherited to overridden (same resolved value, different meaning) and that their held revision is stale. Listener containment matches `settings/updated`.
266
+
267
+ ```ts cordis-catalog
268
+ /**
269
+ * One registered namespace's RAW user section changed, whether or not the
270
+ * resolved value did. `settings/updated` is the consumer-facing event and
271
+ * stays deep-equal-gated; this one exists for configuration surfaces,
272
+ * which must learn that a field went from inherited to overridden (same
273
+ * resolved value, different meaning) and that their held revision is
274
+ * stale. Listener containment matches `settings/updated`.
275
+ * @param ns - the namespace whose stored section changed.
276
+ * @param revision - the namespace's new revision.
277
+ * @mode emit
278
+ */
279
+ 'settings/document-updated'(ns: SettingsNamespace, revision: number): void
280
+ ```
281
+
282
+ Source: [`packages/settings/settings/src/types.ts:48`](../../packages/settings/settings/src/types.ts)
283
+
284
+ <a id="settingsupdated--emit"></a>
285
+
286
+ #### `settings/updated` — emit
287
+
288
+ Committed change to one registered namespace's resolved value. Emitted after the provider persisted (for `update`) or published (`provider`) the change; never emitted when the resolved value is deep-equal. Listener failures are contained and logged — a sync throw and an async rejection alike — except `INVARIANT`-coded failures, which rethrow after every listener ran; that rethrow reaches the emitter only from synchronous listeners, so invariant checks on this event must not be async functions.
289
+
290
+ ```ts cordis-catalog
291
+ /**
292
+ * Committed change to one registered namespace's resolved value. Emitted
293
+ * after the provider persisted (for `update`) or published (`provider`)
294
+ * the change; never emitted when the resolved value is deep-equal.
295
+ * Listener failures are contained and logged — a sync throw and an async
296
+ * rejection alike — except `INVARIANT`-coded failures, which rethrow
297
+ * after every listener ran; that rethrow reaches the emitter only from
298
+ * synchronous listeners, so invariant checks on this event must not be
299
+ * async functions.
300
+ * @param ns - the namespace whose resolved value changed.
301
+ * @param next - the new resolved value.
302
+ * @param prev - the previous resolved value.
303
+ * @param source - whether the change entered through `update()` or the provider.
304
+ * @mode emit
305
+ */
306
+ 'settings/updated'(ns: SettingsNamespace, next: unknown, prev: unknown, source: SettingsUpdateSource): void
307
+ ```
308
+
309
+ Source: [`packages/settings/settings/src/types.ts:35`](../../packages/settings/settings/src/types.ts)
310
+ <!-- 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/shell.md
5
+ shell.md: b9f8e3aebb69348ea241be93d6fd5559068c4029
6
+ shell.zh.md: 1ea086819f3badc92376d39cb13e584da772572b