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,277 @@
1
+ # Same-session goals
2
+
3
+ English | [中文](goal.zh.md)
4
+
5
+ Types shared by the event-sourced goal service and its policy consumers. The [goal-domain Agent Note](../../.agents/notes/implemented/feature/2026-07-19-persisted-same-session-goal-domain.md) owns the persistence and activation decisions; this page records the exact fields and variants from [`packages/goal/goal/src/types.ts`](../../packages/goal/goal/src/types.ts).
6
+
7
+ ## Identity and lifecycle
8
+
9
+ `GoalId` is a [branded id](core.md#branded-ids). A caller mutates one exact revision through `GoalRef`; every accepted durable mutation increments the revision.
10
+
11
+ ```ts type-equiv
12
+ /** Compare-and-set identity for one exact goal revision. */
13
+ interface GoalRef {
14
+ /** Stable goal identity. */
15
+ readonly id: GoalId
16
+ /** Positive revision; every durable mutation increments it. */
17
+ readonly revision: number
18
+ }
19
+ ```
20
+
21
+ The durable phase answers what happened to the objective. Process-local activation separately answers whether a continuation consumer may start another round.
22
+
23
+ ```ts type-equiv
24
+ /** Durable continuation phase. Activation is process-local and separate. */
25
+ type GoalPhase =
26
+ | 'active'
27
+ | 'paused'
28
+ | 'blocked'
29
+ | 'complete'
30
+ ```
31
+
32
+ Blocking is the single durable stopped-by-a-problem state. Its policy-owned reason carries a stable lower-kebab-case code for routing and a free-form explanation for humans and models.
33
+
34
+ ```ts type-equiv
35
+ /** Machine-routable and human-readable explanation for a blocked goal. */
36
+ interface GoalBlockReason {
37
+ /** Stable lower-kebab-case classification chosen by the blocking policy. */
38
+ readonly code: string
39
+ /** Non-empty explanation shown to humans and models. */
40
+ readonly message: string
41
+ }
42
+ ```
43
+
44
+ ```ts type-equiv
45
+ /** Full durable state written by every non-clear goal mutation. */
46
+ interface GoalSnapshot extends GoalRef {
47
+ /** Human-requested completion objective. */
48
+ readonly objective: string
49
+ /** Durable lifecycle phase. */
50
+ readonly phase: GoalPhase
51
+ /** Present exactly while `phase` is `blocked`. */
52
+ readonly blockedReason?: GoalBlockReason
53
+ /** Total admitted goal-round cap. */
54
+ readonly maxGoalRounds: number
55
+ }
56
+ ```
57
+
58
+ ```ts type-equiv
59
+ /** Current goal projection, including values derived from the session log. */
60
+ interface GoalView extends GoalSnapshot {
61
+ /** Highest admitted round number for this goal. */
62
+ readonly roundsStarted: number
63
+ /** Epoch milliseconds of the create mutation. */
64
+ readonly createdAt: number
65
+ /** Epoch milliseconds of the latest mutation. */
66
+ readonly updatedAt: number
67
+ /** Process-local continuation eligibility; never persisted. */
68
+ readonly activation: GoalActivation
69
+ }
70
+ ```
71
+
72
+ ## Durable changes
73
+
74
+ Every mutation is a durable `goal/change` session event whose payload is either a complete post-mutation snapshot or a clear tombstone. The strict fold and persisted projection derive lifecycle state only from these events; inbox mutations do not affect goal state.
75
+
76
+ ```ts type-equiv
77
+ /** Full-snapshot goal mutation committed by a durable `goal/change` event. */
78
+ interface GoalSnapshotChangeMeta {
79
+ readonly kind: 'goal/change'
80
+ readonly version: 1
81
+ readonly operation: Exclude<GoalOperation, 'clear'>
82
+ readonly goal: GoalSnapshot
83
+ readonly roundsStarted: number
84
+ readonly createdAt: number
85
+ readonly updatedAt: number
86
+ }
87
+ ```
88
+
89
+ ```ts type-equiv
90
+ /** Tombstone retained when the current goal is cleared. */
91
+ interface GoalClearChangeMeta {
92
+ readonly kind: 'goal/change'
93
+ readonly version: 1
94
+ readonly operation: 'clear'
95
+ readonly cleared: GoalRef
96
+ readonly clearedAt: number
97
+ }
98
+ ```
99
+
100
+ A continuation consumer attributes each admitted user-message turn with a positive, sequential round number and the current revision; only these admitted `user/message` events advance `roundsStarted`. Replay rejects non-positive rounds, gaps, stale revisions, stopped phases, and cap overflow.
101
+
102
+ ```ts type-equiv
103
+ /** Message attribution for admitted continuation rounds. */
104
+ interface GoalMessageSource {
105
+ readonly kind: 'goal'
106
+ readonly goalId: GoalId
107
+ readonly revision: number
108
+ /** Positive admitted continuation round. */
109
+ readonly round: number
110
+ }
111
+ ```
112
+
113
+ ## Requests and notifications
114
+
115
+ Creation separates caller omission from the deployment choice, which `create()` resolves internally. An edit is a partial replacement whose runtime validator requires at least one field. Every mutation notification carries the accepted operation and exact revision; clear omits `goal`.
116
+
117
+ ```ts type-equiv
118
+ /** Input whose omitted round cap is resolved by the service configuration. */
119
+ interface CreateGoalRequest {
120
+ readonly objective: string
121
+ readonly maxGoalRounds?: number
122
+ }
123
+ ```
124
+
125
+ ```ts type-equiv
126
+ /** Fields changed by an edit; at least one must be present. */
127
+ interface EditGoalRequest {
128
+ readonly objective?: string
129
+ readonly maxGoalRounds?: number
130
+ }
131
+ ```
132
+
133
+ ```ts type-equiv
134
+ /** Live notification after one durable goal mutation commits. */
135
+ interface GoalChanged {
136
+ readonly operation: GoalOperation
137
+ readonly ref: GoalRef
138
+ /** Absent for a clear tombstone. */
139
+ readonly goal?: GoalView
140
+ }
141
+ ```
142
+
143
+ ## Service behavior
144
+
145
+ [`GoalService`](../../packages/goal/goal/src/index.ts) resolves creation defaults, folds strict replay from durable `goal/change` events, enforces exact-live-agent identity and compare-and-set mutations, and emits contained `goal/changed` notifications. The package [README](../../packages/goal/goal/README.md) defines the callable API and model-visible contract.
146
+
147
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
148
+
149
+ <a id="cordis-surface"></a>
150
+
151
+ ## Cordis API
152
+
153
+ 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).
154
+
155
+ <a id="ctxgoals--goalservice"></a>
156
+
157
+ ### `ctx.goals` — `GoalService`
158
+
159
+ Goal service (`ctx.goals`) backed exclusively by the owning session log.
160
+
161
+ ```ts cordis-catalog
162
+ /**
163
+ * Read the current goal for one exact live agent.
164
+ * @param agent - owning live agent.
165
+ * @returns a fresh view or `undefined` when no goal is current.
166
+ * @throws {@link GoalError} when the agent is not the registry's live instance.
167
+ */
168
+ get(agent: Agent): GoalView | undefined
169
+
170
+ /**
171
+ * Remove process-local continuation authority without changing durable goal
172
+ * phase or revision. Lifecycle owners use this before unloading a driver;
173
+ * a later human-authorized {@link resume} records the new activation edge.
174
+ * @param agent - owning live agent.
175
+ * @returns a fresh disarmed view, or `undefined` when no goal is current.
176
+ */
177
+ disarm(agent: Agent): GoalView | undefined
178
+
179
+ /**
180
+ * Create and arm a goal. A completed goal may be replaced; every other
181
+ * current phase must be cleared or resumed instead.
182
+ * @param agent - owning live agent.
183
+ * @param request - objective and optional round cap.
184
+ * @returns the created live view.
185
+ */
186
+ create(agent: Agent, request: CreateGoalRequest): GoalView
187
+
188
+ /**
189
+ * Edit objective and/or round cap without changing phase.
190
+ * @param agent - owning live agent.
191
+ * @param ref - expected current revision.
192
+ * @param request - at least one replacement field.
193
+ * @returns the edited view.
194
+ */
195
+ @Remote('edit') edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
196
+
197
+ /**
198
+ * Pause an active goal and disarm automatic continuation.
199
+ * @param agent - owning live agent.
200
+ * @param ref - expected current revision.
201
+ * @returns the paused view.
202
+ */
203
+ @Remote('pause') pause(agent: Agent, ref: GoalRef): GoalView
204
+
205
+ /**
206
+ * Resume and arm a stopped goal, or rearm an active goal after a
207
+ * session-start edge, while its round budget still has capacity.
208
+ * @param agent - owning live agent.
209
+ * @param ref - expected current revision.
210
+ * @returns the active view.
211
+ */
212
+ @Remote('resume') resume(agent: Agent, ref: GoalRef): GoalView
213
+
214
+ /**
215
+ * Mark a current non-complete goal complete and disarm it.
216
+ * @param agent - owning live agent.
217
+ * @param ref - expected current revision.
218
+ * @returns the completed view.
219
+ */
220
+ @Remote('complete') complete(agent: Agent, ref: GoalRef): GoalView
221
+
222
+ /**
223
+ * Mark an active goal blocked and disarm it.
224
+ * @param agent - owning live agent.
225
+ * @param ref - expected current revision.
226
+ * @param reason - policy-owned stable code and human-readable explanation.
227
+ * @returns the blocked view with its durable reason.
228
+ */
229
+ block(agent: Agent, ref: GoalRef, reason: GoalBlockReason): GoalView
230
+
231
+ /**
232
+ * Clear the current goal while retaining a durable tombstone and history.
233
+ * @param agent - owning live agent.
234
+ * @param ref - expected current revision.
235
+ * @returns the tombstone ref whose revision is one past the cleared snapshot.
236
+ */
237
+ @Remote('clear') clear(agent: Agent, ref: GoalRef): GoalRef
238
+
239
+ /**
240
+ * Create one Goal through the remote boundary.
241
+ * @param agent - exact live Agent resolved from the wire identity.
242
+ * @param request - objective and optional round cap.
243
+ * @returns the created Goal identity.
244
+ */
245
+ @Remote('create') remoteExportCreate(agent: Agent, request: CreateGoalRequest): CreateGoalResult
246
+ ```
247
+
248
+ Types: [Agent](core.md)
249
+
250
+ Source: [`packages/goal/goal/src/index.ts:183`](../../packages/goal/goal/src/index.ts)
251
+
252
+ <a id="goal-events"></a>
253
+
254
+ ### `goal/*` events
255
+
256
+ <a id="goalchanged--emit"></a>
257
+
258
+ #### `goal/changed` — emit
259
+
260
+ Goal mutation accepted by one live agent. The matching `goal/change` session event has already committed. Listener failures are contained. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
261
+
262
+ ```ts cordis-catalog
263
+ /**
264
+ * Goal mutation accepted by one live agent. The matching `goal/change`
265
+ * session event has already committed. Listener failures are contained.
266
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
267
+ * @param payload.agent - agent whose session owns the goal.
268
+ * @param payload.change - fresh current projection or clear tombstone.
269
+ * @mode emit
270
+ */
271
+ 'goal/changed'(this: import('@deepseek-ai/dsh-scope').Scoped<Agent>, payload: { agent: Agent; change: GoalChanged }): void
272
+ ```
273
+
274
+ Types: [Agent](core.md) · [Scoped](scope.md)
275
+
276
+ Source: [`packages/goal/goal/src/domain.ts:114`](../../packages/goal/goal/src/domain.ts)
277
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,277 @@
1
+ # 同会话目标
2
+
3
+ [English](goal.md) | 中文
4
+
5
+ 事件溯源目标服务及其策略消费方共享的类型。[目标领域 Agent Note](../../.agents/notes/implemented/feature/2026-07-19-persisted-same-session-goal-domain.md) 负责记录持久化与激活决策;本页记录 [`packages/goal/goal/src/types.ts`](../../packages/goal/goal/src/types.ts) 中的确切字段和变体。
6
+
7
+ ## 标识与生命周期
8
+
9
+ `GoalId` 是[品牌化 id](core.md#branded-ids)。调用方通过 `GoalRef` 修改一个确切修订版本;每次获准的持久变更都会递增修订号。
10
+
11
+ ```ts type-equiv
12
+ /** Compare-and-set identity for one exact goal revision. */
13
+ interface GoalRef {
14
+ /** Stable goal identity. */
15
+ readonly id: GoalId
16
+ /** Positive revision; every durable mutation increments it. */
17
+ readonly revision: number
18
+ }
19
+ ```
20
+
21
+ 持久阶段回答目标发生了什么。进程本地激活状态则另行回答续跑消费方能否开始另一个 Round。
22
+
23
+ ```ts type-equiv
24
+ /** Durable continuation phase. Activation is process-local and separate. */
25
+ type GoalPhase =
26
+ | 'active'
27
+ | 'paused'
28
+ | 'blocked'
29
+ | 'complete'
30
+ ```
31
+
32
+ 阻塞是唯一表示「因问题而停止」的持久状态。由策略负责的阻塞原因会携带一个用于路由、稳定且采用 lower-kebab-case 的代码,以及一段供人和模型阅读的自由文本说明。
33
+
34
+ ```ts type-equiv
35
+ /** Machine-routable and human-readable explanation for a blocked goal. */
36
+ interface GoalBlockReason {
37
+ /** Stable lower-kebab-case classification chosen by the blocking policy. */
38
+ readonly code: string
39
+ /** Non-empty explanation shown to humans and models. */
40
+ readonly message: string
41
+ }
42
+ ```
43
+
44
+ ```ts type-equiv
45
+ /** Full durable state written by every non-clear goal mutation. */
46
+ interface GoalSnapshot extends GoalRef {
47
+ /** Human-requested completion objective. */
48
+ readonly objective: string
49
+ /** Durable lifecycle phase. */
50
+ readonly phase: GoalPhase
51
+ /** Present exactly while `phase` is `blocked`. */
52
+ readonly blockedReason?: GoalBlockReason
53
+ /** Total admitted goal-round cap. */
54
+ readonly maxGoalRounds: number
55
+ }
56
+ ```
57
+
58
+ ```ts type-equiv
59
+ /** Current goal projection, including values derived from the session log. */
60
+ interface GoalView extends GoalSnapshot {
61
+ /** Highest admitted round number for this goal. */
62
+ readonly roundsStarted: number
63
+ /** Epoch milliseconds of the create mutation. */
64
+ readonly createdAt: number
65
+ /** Epoch milliseconds of the latest mutation. */
66
+ readonly updatedAt: number
67
+ /** Process-local continuation eligibility; never persisted. */
68
+ readonly activation: GoalActivation
69
+ }
70
+ ```
71
+
72
+ ## 持久变更
73
+
74
+ 每次变更都是持久的 `goal/change` 会话事件,其载荷要么是变更后的完整快照,要么是清除墓碑。严格折叠与持久投影只从这些事件派生生命周期状态;inbox 变更不会影响 goal 状态。
75
+
76
+ ```ts type-equiv
77
+ /** Full-snapshot goal mutation committed by a durable `goal/change` event. */
78
+ interface GoalSnapshotChangeMeta {
79
+ readonly kind: 'goal/change'
80
+ readonly version: 1
81
+ readonly operation: Exclude<GoalOperation, 'clear'>
82
+ readonly goal: GoalSnapshot
83
+ readonly roundsStarted: number
84
+ readonly createdAt: number
85
+ readonly updatedAt: number
86
+ }
87
+ ```
88
+
89
+ ```ts type-equiv
90
+ /** Tombstone retained when the current goal is cleared. */
91
+ interface GoalClearChangeMeta {
92
+ readonly kind: 'goal/change'
93
+ readonly version: 1
94
+ readonly operation: 'clear'
95
+ readonly cleared: GoalRef
96
+ readonly clearedAt: number
97
+ }
98
+ ```
99
+
100
+ 续跑消费方会为每个获准的用户消息轮次标注正数且连续的 Round 编号和当前修订号;只有这些获准的 `user/message` 事件会推进 `roundsStarted`。回放会拒绝非正数 Round、编号缺口、陈旧修订号、已停止阶段和超出上限。
101
+
102
+ ```ts type-equiv
103
+ /** Message attribution for admitted continuation rounds. */
104
+ interface GoalMessageSource {
105
+ readonly kind: 'goal'
106
+ readonly goalId: GoalId
107
+ readonly revision: number
108
+ /** Positive admitted continuation round. */
109
+ readonly round: number
110
+ }
111
+ ```
112
+
113
+ ## 请求与通知
114
+
115
+ 创建操作会区分调用方省略字段与采用部署配置值这两种情况,`create()` 会在内部解析后者。编辑是局部替换,其运行时校验器要求至少提供一个字段。每条变更通知都会携带获准的操作和确切修订号;清除操作不带 `goal`。
116
+
117
+ ```ts type-equiv
118
+ /** Input whose omitted round cap is resolved by the service configuration. */
119
+ interface CreateGoalRequest {
120
+ readonly objective: string
121
+ readonly maxGoalRounds?: number
122
+ }
123
+ ```
124
+
125
+ ```ts type-equiv
126
+ /** Fields changed by an edit; at least one must be present. */
127
+ interface EditGoalRequest {
128
+ readonly objective?: string
129
+ readonly maxGoalRounds?: number
130
+ }
131
+ ```
132
+
133
+ ```ts type-equiv
134
+ /** Live notification after one durable goal mutation commits. */
135
+ interface GoalChanged {
136
+ readonly operation: GoalOperation
137
+ readonly ref: GoalRef
138
+ /** Absent for a clear tombstone. */
139
+ readonly goal?: GoalView
140
+ }
141
+ ```
142
+
143
+ ## 服务行为
144
+
145
+ [`GoalService`](../../packages/goal/goal/src/index.ts) 解析创建默认值、从持久 `goal/change` 事件执行严格回放折叠、校验传入的 agent(智能体)是注册表中的确切活跃实例、以比较并设置方式执行变更,并发出 `goal/changed` 通知;监听器故障会被隔离。包 [README](../../packages/goal/goal/README.md) 定义可调用 API 和面向模型的约定。
146
+
147
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
148
+
149
+ <a id="cordis-surface"></a>
150
+
151
+ ## Cordis API
152
+
153
+ 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).
154
+
155
+ <a id="ctxgoals--goalservice"></a>
156
+
157
+ ### `ctx.goals` — `GoalService`
158
+
159
+ Goal service (`ctx.goals`) backed exclusively by the owning session log.
160
+
161
+ ```ts cordis-catalog
162
+ /**
163
+ * Read the current goal for one exact live agent.
164
+ * @param agent - owning live agent.
165
+ * @returns a fresh view or `undefined` when no goal is current.
166
+ * @throws {@link GoalError} when the agent is not the registry's live instance.
167
+ */
168
+ get(agent: Agent): GoalView | undefined
169
+
170
+ /**
171
+ * Remove process-local continuation authority without changing durable goal
172
+ * phase or revision. Lifecycle owners use this before unloading a driver;
173
+ * a later human-authorized {@link resume} records the new activation edge.
174
+ * @param agent - owning live agent.
175
+ * @returns a fresh disarmed view, or `undefined` when no goal is current.
176
+ */
177
+ disarm(agent: Agent): GoalView | undefined
178
+
179
+ /**
180
+ * Create and arm a goal. A completed goal may be replaced; every other
181
+ * current phase must be cleared or resumed instead.
182
+ * @param agent - owning live agent.
183
+ * @param request - objective and optional round cap.
184
+ * @returns the created live view.
185
+ */
186
+ create(agent: Agent, request: CreateGoalRequest): GoalView
187
+
188
+ /**
189
+ * Edit objective and/or round cap without changing phase.
190
+ * @param agent - owning live agent.
191
+ * @param ref - expected current revision.
192
+ * @param request - at least one replacement field.
193
+ * @returns the edited view.
194
+ */
195
+ @Remote('edit') edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
196
+
197
+ /**
198
+ * Pause an active goal and disarm automatic continuation.
199
+ * @param agent - owning live agent.
200
+ * @param ref - expected current revision.
201
+ * @returns the paused view.
202
+ */
203
+ @Remote('pause') pause(agent: Agent, ref: GoalRef): GoalView
204
+
205
+ /**
206
+ * Resume and arm a stopped goal, or rearm an active goal after a
207
+ * session-start edge, while its round budget still has capacity.
208
+ * @param agent - owning live agent.
209
+ * @param ref - expected current revision.
210
+ * @returns the active view.
211
+ */
212
+ @Remote('resume') resume(agent: Agent, ref: GoalRef): GoalView
213
+
214
+ /**
215
+ * Mark a current non-complete goal complete and disarm it.
216
+ * @param agent - owning live agent.
217
+ * @param ref - expected current revision.
218
+ * @returns the completed view.
219
+ */
220
+ @Remote('complete') complete(agent: Agent, ref: GoalRef): GoalView
221
+
222
+ /**
223
+ * Mark an active goal blocked and disarm it.
224
+ * @param agent - owning live agent.
225
+ * @param ref - expected current revision.
226
+ * @param reason - policy-owned stable code and human-readable explanation.
227
+ * @returns the blocked view with its durable reason.
228
+ */
229
+ block(agent: Agent, ref: GoalRef, reason: GoalBlockReason): GoalView
230
+
231
+ /**
232
+ * Clear the current goal while retaining a durable tombstone and history.
233
+ * @param agent - owning live agent.
234
+ * @param ref - expected current revision.
235
+ * @returns the tombstone ref whose revision is one past the cleared snapshot.
236
+ */
237
+ @Remote('clear') clear(agent: Agent, ref: GoalRef): GoalRef
238
+
239
+ /**
240
+ * Create one Goal through the remote boundary.
241
+ * @param agent - exact live Agent resolved from the wire identity.
242
+ * @param request - objective and optional round cap.
243
+ * @returns the created Goal identity.
244
+ */
245
+ @Remote('create') remoteExportCreate(agent: Agent, request: CreateGoalRequest): CreateGoalResult
246
+ ```
247
+
248
+ Types: [Agent](core.md)
249
+
250
+ Source: [`packages/goal/goal/src/index.ts:183`](../../packages/goal/goal/src/index.ts)
251
+
252
+ <a id="goal-events"></a>
253
+
254
+ ### `goal/*` events
255
+
256
+ <a id="goalchanged--emit"></a>
257
+
258
+ #### `goal/changed` — emit
259
+
260
+ Goal mutation accepted by one live agent. The matching `goal/change` session event has already committed. Listener failures are contained. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
261
+
262
+ ```ts cordis-catalog
263
+ /**
264
+ * Goal mutation accepted by one live agent. The matching `goal/change`
265
+ * session event has already committed. Listener failures are contained.
266
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
267
+ * @param payload.agent - agent whose session owns the goal.
268
+ * @param payload.change - fresh current projection or clear tombstone.
269
+ * @mode emit
270
+ */
271
+ 'goal/changed'(this: import('@deepseek-ai/dsh-scope').Scoped<Agent>, payload: { agent: Agent; change: GoalChanged }): void
272
+ ```
273
+
274
+ Types: [Agent](core.md) · [Scoped](scope.md)
275
+
276
+ Source: [`packages/goal/goal/src/domain.ts:114`](../../packages/goal/goal/src/domain.ts)
277
+ <!-- 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/invariants.md
5
+ invariants.md: 36565059ffb205b44145ad3051705200dd514e12
6
+ invariants.zh.md: 7307101620e1dc11bea6ea3bcc9355521d968cb9
@@ -0,0 +1,88 @@
1
+ # Runtime Invariants
2
+
3
+ English | [中文](invariants.zh.md)
4
+
5
+ [dsh-invariants](../../packages/runtime-diagnostics/invariants) is the configurable registry service (`ctx.invariants`) for package-owned runtime invariant checks. It is one support-group package, not a three-package capability seam, and not part of the agent-loop spine: the registry owns selection, name reservation, child-fiber lifecycle, and package-attributed failure, while every workspace package publishes a `./invariant` companion plugin that registers checks under its exact npm package name. What a check may assert — authoritative event streams or mutable data, never service or method presence — is the runtime-invariants convention in [AGENTS.md](../../AGENTS.md#conventions); the registry design is owned by the [invariant-service Agent Note](../../.agents/notes/implemented/architecture/2026-07-19-package-owned-invariant-service.md).
6
+
7
+ Source: [`packages/runtime-diagnostics/invariants/src/index.ts`](../../packages/runtime-diagnostics/invariants/src/index.ts)
8
+
9
+ ## Selection
10
+
11
+ ```ts type-equiv
12
+ /** Runtime invariant selection configured on the service plugin. */
13
+ interface Config {
14
+ /** Global switch; defaults to `true`. */
15
+ readonly enabled?: boolean
16
+ /** Case-sensitive JavaScript regex sources that admit package names; empty admits all. */
17
+ readonly package_allowlist?: string[]
18
+ /** Case-sensitive JavaScript regex sources that exclude package names after allowlist matching. */
19
+ readonly package_blocklist?: string[]
20
+ }
21
+ ```
22
+
23
+ A package is selected when the service is enabled, the allowlist is empty or at least one pattern matches its full npm name, and no blocklist pattern matches — a blocklist match overrides an allowlist match. Entries compile with `new RegExp(source)`: matching is unanchored unless the source supplies `^` and `$`, and `/pattern/flags` syntax is not parsed. Validation fails loud at service startup: a blank, whitespace-padded, duplicate, or invalid entry throws instead of being skipped. A valid pattern may match no currently loaded package, so later loading and HMR stay deterministic; filters are fixed for the service lifetime ([README](../../packages/runtime-diagnostics/invariants/README.md)).
24
+
25
+ ## The installer
26
+
27
+ ```ts type-equiv
28
+ /**
29
+ * Throw a package-attributed invariant failure.
30
+ * @param message - violated package contract without the standard prefix.
31
+ * @returns never because reporting a violation throws.
32
+ */
33
+ type InvariantFailure = (message: string) => never
34
+ ```
35
+
36
+ ```ts type-equiv
37
+ /** Install one package's checks into the registration's child context. */
38
+ interface InvariantInstaller {
39
+ /**
40
+ * Install the package contribution.
41
+ * @param ctx - child context owned by this invariant registration.
42
+ * @param fail - reporter bound to the registering package name.
43
+ * @returns nothing, or a promise settling after asynchronous checks finish.
44
+ */
45
+ (ctx: Context, fail: InvariantFailure): void | Promise<void>
46
+ /** Services the child installer fiber may access. */
47
+ readonly inject?: Inject
48
+ }
49
+ ```
50
+
51
+ An enabled installer runs in a dedicated child Cordis fiber; `installer.inject` declares the services that fiber may access, and synchronous or asynchronous installer completion is joined before the registration succeeds. `fail(message)` throws `InvariantError` — `extends Error` with stable `code: 'INVARIANT'`, the owning `packageName`, and a message prefixed `invariant violated by "<package>": …` — so a violation is attributable without the registry importing any product package.
52
+
53
+ ## The service
54
+
55
+ `ctx.invariants.register(packageName, installer)` reserves one active registration for the full npm package name and returns its effect-scoped disposer. The reservation holds even when filters keep the installer inactive, so two plugins can never silently claim the same package name; a duplicate, blank, or whitespace-containing name throws. An installer failure disposes the child fiber and releases the reservation atomically. The service owns every registration fiber while the returned disposer also belongs to the companion fiber: unloading either side removes listeners, trace state, and the reservation, so a companion can reload and register the same name again without retained state.
56
+
57
+ ## The companion contract
58
+
59
+ Every workspace package owns a `./invariant` companion ([package contract](../../packages/AGENTS.md)); publication and registration are exhaustive, but assertions are deliberately not synthetic. A companion installs a check only when its package owns an observable event or mutable-data relationship; otherwise it exports an empty installer whose leading comment starts `No runtime invariant:` and explains, package-specifically, why nothing is checkable. `pnpm run verify-package-invariants` mechanically rejects generated markers, unexplained empty installers, non-empty installers that omit or ignore the reporter, incorrect registration names, and incomplete export, publication, dependency, or bundle wiring ([mechanical-rule Agent Note](../../.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.md)). The catalog of executable companions and the standard composition live in the [package README](../../packages/runtime-diagnostics/invariants/README.md).
60
+
61
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
62
+
63
+ <a id="cordis-surface"></a>
64
+
65
+ ## Cordis API
66
+
67
+ 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).
68
+
69
+ <a id="ctxinvariants--invariantregistry"></a>
70
+
71
+ ### `ctx.invariants` — `InvariantRegistry`
72
+
73
+ Package-owned invariant registry with global and regex-based selection.
74
+
75
+ ```ts cordis-catalog
76
+ /**
77
+ * Register one package's invariant installer. The package name is reserved
78
+ * even when filtering disables its checks. Enabled installers run in a child
79
+ * fiber; failure disposes that fiber and releases the reservation.
80
+ * @param packageName - full npm package name that owns the contribution.
81
+ * @param installer - listener or startup-check installer for the child context.
82
+ * @returns an effect-scoped disposer for the registration.
83
+ */
84
+ register(packageName: string, installer: InvariantInstaller): () => void
85
+ ```
86
+
87
+ Source: [`packages/runtime-diagnostics/invariants/src/index.ts:94`](../../packages/runtime-diagnostics/invariants/src/index.ts)
88
+ <!-- END GENERATED cordis-surface -->