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,154 @@
1
+ <!-- 英文源文件由 scripts/gen-cordis-catalog.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
2
+ 更新时先运行 `pnpm run gen-cordis-catalog` 更新英文,再更新本文件并运行 `pnpm run verify-translation-pairing --write docs/cordis-api/registry.md` 重新记录配对。 -->
3
+
4
+ # 注册表
5
+
6
+ [English](registry.md) | 中文
7
+
8
+ 插件加载与依赖注入。
9
+
10
+ ### ctx.inject(deps, callback)
11
+
12
+ ```ts cordis-catalog
13
+ /**
14
+ * Run a callback once the requested services are available.
15
+ *
16
+ * Shorthand for `ctx.plugin({ inject, apply: callback })`: the callback
17
+ * is unloaded and re-run whenever a required service changes.
18
+ *
19
+ * @param deps — required services, as an array or a name → config map.
20
+ * @param callback — plugin body called with `(ctx, config)`.
21
+ * @returns the fiber; awaiting it settles once loading finished.
22
+ */
23
+ inject(deps: Inject, callback: Plugin.Function<void>): Fiber & PromiseLike<Fiber>
24
+ ```
25
+
26
+ 请求的服务可用后,运行回调。
27
+
28
+ 这是 `ctx.plugin({ inject, apply: callback })` 的简写形式:每当某个必需服务发生变化时,系统都会卸载并重新运行该回调。
29
+
30
+ - `deps`:必需服务,形式可以是数组,也可以是从名称到配置的映射。
31
+ - `callback`:以 `(ctx, config)` 调用的插件主体。
32
+
33
+ **返回** fiber;对其执行 await 会在加载完成后结束等待。
34
+
35
+ [源码](../../vendor/cordis/src/registry.ts#L176)
36
+
37
+ ### ctx.plugin(plugin, ...args)
38
+
39
+ ```ts cordis-catalog
40
+ /**
41
+ * Load a plugin in the current context.
42
+ *
43
+ * @param plugin — a function, class, or `{ apply }` object plugin.
44
+ * @param args — the plugin config, validated against its `Config` schema.
45
+ * @returns the fiber; awaiting it settles once loading finished
46
+ * (rejecting on config or startup errors).
47
+ */
48
+ plugin<P extends Plugin>(plugin: P, ...args: Spread<GetPluginConfig<P>>): Fiber & PromiseLike<Fiber>
49
+ ```
50
+
51
+ 在当前上下文中加载插件。
52
+
53
+ - `plugin`:函数、类或 `{ apply }` 对象形式的插件。
54
+ - `args`:插件配置,会根据其 `Config` schema 进行校验。
55
+
56
+ **返回** fiber;对其执行 await 会在加载完成后结束等待(如果发生配置错误或启动错误,则会被拒绝)。
57
+
58
+ [源码](../../vendor/cordis/src/registry.ts#L185)
59
+
60
+ ## Plugin
61
+
62
+ 支持的插件入口点形式。
63
+
64
+ ```ts cordis-catalog
65
+ /** Supported plugin entrypoint shapes. */
66
+ type Plugin<T = any> =
67
+ | Plugin.Function<T>
68
+ | Plugin.Constructor<T>
69
+ | Plugin.Object<T>
70
+
71
+ /** Types associated with plugin entrypoints and runtime records. */
72
+ namespace Plugin {
73
+ /** Shared metadata understood by the plugin registry and related tooling. */
74
+ export interface Base<T = any> {
75
+ /** Display name used for fiber diagnostics and logger names. */
76
+ name?: string
77
+ /** Standard-schema validator applied to config before the plugin starts. */
78
+ Config?: StandardSchemaV1<any, T>
79
+ /** Services the plugin requires; it only loads while all are available. */
80
+ inject?: Inject
81
+ /** Service name(s) the plugin provides (read by `Service` and by loaders). */
82
+ provide?: string | string[]
83
+ /** Service names whose intercept config the plugin declares it consumes. */
84
+ intercept?: Dict<boolean>
85
+ }
86
+
87
+ export interface Transform<S, T> {
88
+ /** Marks the transform object as a schema/config transform. */
89
+ schema?: true
90
+ /** Convert user-facing config to runtime config. */
91
+ Config: (config: S) => T
92
+ }
93
+
94
+ /** Function plugin called with `(ctx, config)`. */
95
+ export interface Function<T = any> extends Base<T> {
96
+ (ctx: Context, config: T): any
97
+ }
98
+
99
+ /** Class plugin constructed with `(ctx, config)`. */
100
+ export interface Constructor<T = any> extends Base<T> {
101
+ new (ctx: Context, config: T): any
102
+ }
103
+
104
+ /** Object plugin with an `apply(ctx, config)` method. */
105
+ export interface Object<T = any> extends Base<T> {
106
+ apply(ctx: Context, config: T): any
107
+ }
108
+
109
+ /** Mutable registry record shared by all fibers of one plugin callback. */
110
+ export interface Runtime {
111
+ /** Display name copied from the first registered plugin shape. */
112
+ name?: string
113
+ /** Every live fiber of this plugin (one per `ctx.plugin()` call). */
114
+ fibers: DisposableList<Fiber>
115
+ /** The executable entrypoint all fibers share (registry identity key). */
116
+ callback: globalThis.Function
117
+ /** Standard-schema validator applied to each fiber's config. */
118
+ Config?: StandardSchemaV1
119
+ }
120
+ }
121
+ ```
122
+
123
+ [源码](../../vendor/cordis/src/registry.ts#L92)
124
+
125
+ ## Inject
126
+
127
+ 插件和 `@Inject` 装饰器接受的服务依赖声明。
128
+
129
+ 数组形式请求不带拦截配置的服务。对象形式将每个服务名称映射到插件上下文中可选的拦截配置。
130
+
131
+ ```ts cordis-catalog
132
+ /**
133
+ * Service dependency declaration accepted by plugins and the `@Inject`
134
+ * decorator.
135
+ *
136
+ * Array form requests services without intercept config. Object form maps each
137
+ * service name to optional intercept config for the plugin context.
138
+ */
139
+ type Inject<M = Dict> = (keyof M)[] | { [K in keyof M]?: M[K] }
140
+
141
+ /** Utilities for normalizing plugin dependency declarations. */
142
+ namespace Inject {
143
+ /**
144
+ * Convert array/object/class-inherited inject metadata into a plain map.
145
+ *
146
+ * @param inject — the declaration to normalize; `null`/`undefined` add nothing.
147
+ * @param result — the map to fill (service name → intercept config or `null`).
148
+ * @returns `result`.
149
+ */
150
+ export function resolve(inject: Inject | null | undefined, result: Dict = Object.create(null))
151
+ }
152
+ ```
153
+
154
+ [源码](../../vendor/cordis/src/registry.ts#L19)
@@ -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/cordis-api/service.md
5
+ service.md: d4b0f06da16decf31e0d348a88e0360b46ee9d35
6
+ service.zh.md: ec0b443a0eae2787e0a3db919583d8092414c52d
@@ -0,0 +1,102 @@
1
+ <!-- Generated by scripts/gen-cordis-catalog.ts — do not edit by hand.
2
+ Run `pnpm run gen-cordis-catalog` to regenerate. -->
3
+
4
+ # Service
5
+
6
+ The base class for context services. A subclass loaded as a plugin registers itself as `ctx.<name>`.
7
+
8
+ Base class for services that expose a named API on `ctx`.
9
+
10
+ Subclasses call `super(ctx, name)` from their constructor. The service is registered immediately and is automatically removed with the owning fiber.
11
+
12
+ [Source](../../vendor/cordis/src/service.ts#L11)
13
+
14
+ ### service.name
15
+
16
+ ```ts cordis-catalog
17
+ /** The service name this instance is registered under. */
18
+ public name!: string
19
+ ```
20
+
21
+ The service name this instance is registered under.
22
+
23
+ [Source](../../vendor/cordis/src/service.ts#L30)
24
+
25
+ ## Static members
26
+
27
+ ### Service.init
28
+
29
+ ```ts cordis-catalog
30
+ /** Symbol key of an instance method run after construction (class plugins). */
31
+ static readonly init: unique symbol
32
+ ```
33
+
34
+ Symbol key of an instance method run after construction (class plugins).
35
+
36
+ [Source](../../vendor/cordis/src/service.ts#L13)
37
+
38
+ ### Service.check
39
+
40
+ ```ts cordis-catalog
41
+ /** Symbol key of the availability predicate passed to `ctx.provide()`. */
42
+ static readonly check: unique symbol
43
+ ```
44
+
45
+ Symbol key of the availability predicate passed to `ctx.provide()`.
46
+
47
+ [Source](../../vendor/cordis/src/service.ts#L15)
48
+
49
+ ### Service.config
50
+
51
+ ```ts cordis-catalog
52
+ /** Symbol key of the phantom intercept-config type parameter. */
53
+ static readonly config: unique symbol
54
+ ```
55
+
56
+ Symbol key of the phantom intercept-config type parameter.
57
+
58
+ [Source](../../vendor/cordis/src/service.ts#L17)
59
+
60
+ ### Service.invoke
61
+
62
+ ```ts cordis-catalog
63
+ /** Symbol key of the call body making a service callable (e.g. `ctx.logger()`). */
64
+ static readonly invoke: unique symbol
65
+ ```
66
+
67
+ Symbol key of the call body making a service callable (e.g. `ctx.logger()`).
68
+
69
+ [Source](../../vendor/cordis/src/service.ts#L19)
70
+
71
+ ### Service.extend
72
+
73
+ ```ts cordis-catalog
74
+ /** Symbol key of the helper deriving an extended service instance. */
75
+ static readonly extend: unique symbol
76
+ ```
77
+
78
+ Symbol key of the helper deriving an extended service instance.
79
+
80
+ [Source](../../vendor/cordis/src/service.ts#L21)
81
+
82
+ ### Service.tracker
83
+
84
+ ```ts cordis-catalog
85
+ /** Symbol key of the tracker metadata used for context tracing. */
86
+ static readonly tracker: unique symbol
87
+ ```
88
+
89
+ Symbol key of the tracker metadata used for context tracing.
90
+
91
+ [Source](../../vendor/cordis/src/service.ts#L23)
92
+
93
+ ### Service.resolveConfig
94
+
95
+ ```ts cordis-catalog
96
+ /** Symbol key of the intercept-config resolution helper below. */
97
+ static readonly resolveConfig: unique symbol
98
+ ```
99
+
100
+ Symbol key of the intercept-config resolution helper below.
101
+
102
+ [Source](../../vendor/cordis/src/service.ts#L25)
@@ -0,0 +1,104 @@
1
+ <!-- 英文源文件由 scripts/gen-cordis-catalog.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
2
+ 更新时先运行 `pnpm run gen-cordis-catalog` 更新英文,再更新本文件并运行 `pnpm run verify-translation-pairing --write docs/cordis-api/service.md` 重新记录配对。 -->
3
+
4
+ # Service
5
+
6
+ [English](service.md) | 中文
7
+
8
+ 上下文服务的基类。以插件形式加载的子类会将自身注册为 `ctx.<name>`。
9
+
10
+ 用于在 `ctx` 上公开具名 API 的服务基类。
11
+
12
+ 子类在构造函数中调用 `super(ctx, name)`。服务会立即注册,并随所属 fiber 自动移除。
13
+
14
+ [源码](../../vendor/cordis/src/service.ts#L11)
15
+
16
+ ### service.name
17
+
18
+ ```ts cordis-catalog
19
+ /** The service name this instance is registered under. */
20
+ public name!: string
21
+ ```
22
+
23
+ 此实例注册时使用的服务名称。
24
+
25
+ [源码](../../vendor/cordis/src/service.ts#L30)
26
+
27
+ ## 静态成员
28
+
29
+ ### Service.init
30
+
31
+ ```ts cordis-catalog
32
+ /** Symbol key of an instance method run after construction (class plugins). */
33
+ static readonly init: unique symbol
34
+ ```
35
+
36
+ 构造完成后运行的实例方法所使用的符号键(类插件)。
37
+
38
+ [源码](../../vendor/cordis/src/service.ts#L13)
39
+
40
+ ### Service.check
41
+
42
+ ```ts cordis-catalog
43
+ /** Symbol key of the availability predicate passed to `ctx.provide()`. */
44
+ static readonly check: unique symbol
45
+ ```
46
+
47
+ 传给 `ctx.provide()` 的可用性谓词所使用的符号键。
48
+
49
+ [源码](../../vendor/cordis/src/service.ts#L15)
50
+
51
+ ### Service.config
52
+
53
+ ```ts cordis-catalog
54
+ /** Symbol key of the phantom intercept-config type parameter. */
55
+ static readonly config: unique symbol
56
+ ```
57
+
58
+ 虚设拦截配置类型参数所使用的符号键。
59
+
60
+ [源码](../../vendor/cordis/src/service.ts#L17)
61
+
62
+ ### Service.invoke
63
+
64
+ ```ts cordis-catalog
65
+ /** Symbol key of the call body making a service callable (e.g. `ctx.logger()`). */
66
+ static readonly invoke: unique symbol
67
+ ```
68
+
69
+ 使服务可被调用的调用体所使用的符号键(例如 `ctx.logger()`)。
70
+
71
+ [源码](../../vendor/cordis/src/service.ts#L19)
72
+
73
+ ### Service.extend
74
+
75
+ ```ts cordis-catalog
76
+ /** Symbol key of the helper deriving an extended service instance. */
77
+ static readonly extend: unique symbol
78
+ ```
79
+
80
+ 用于派生扩展服务实例的辅助方法所使用的符号键。
81
+
82
+ [源码](../../vendor/cordis/src/service.ts#L21)
83
+
84
+ ### Service.tracker
85
+
86
+ ```ts cordis-catalog
87
+ /** Symbol key of the tracker metadata used for context tracing. */
88
+ static readonly tracker: unique symbol
89
+ ```
90
+
91
+ 上下文追踪所用跟踪器元数据的符号键。
92
+
93
+ [源码](../../vendor/cordis/src/service.ts#L23)
94
+
95
+ ### Service.resolveConfig
96
+
97
+ ```ts cordis-catalog
98
+ /** Symbol key of the intercept-config resolution helper below. */
99
+ static readonly resolveConfig: unique symbol
100
+ ```
101
+
102
+ 下述拦截配置解析辅助方法所使用的符号键。
103
+
104
+ [源码](../../vendor/cordis/src/service.ts#L25)
@@ -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/cordis-primer.md
5
+ cordis-primer.md: 2a3afe180623d89b006dfa3e73aba5567c15bbe9
6
+ cordis-primer.zh.md: d4d60f60717ffdc01499fdffadba2808557b285f
@@ -0,0 +1,44 @@
1
+ # Cordis Primer
2
+
3
+ English | [中文](cordis-primer.zh.md)
4
+
5
+ Cordis is the vendored plugin framework underneath DeepSeek Harness. This primer teaches the Cordis ideas a harness plugin author needs before reading the generated service/event reference on the [subsystem pages](subsystems/core.md); the [Cordis tutorial](cordis-tutorial/index.md) walks the same ideas hands-on. The vendored source and sync procedure live in [vendor/README.md](../vendor/README.md).
6
+
7
+ ## Cordis In Five Ideas
8
+
9
+ - **A plugin is a object that implements Service.** It can be a function with optional `inject` and `apply(ctx)` fields, or a `Service` subclass whose lifecycle Cordis mounts into the current context.
10
+ - **A context is a repository of services.** A service claims a stable `ctx.<key>` such as `ctx.tools`, `ctx.llm`, or `ctx.sessions` from a context; other plugins find services via key instead of importing a concrete implementation.
11
+ - **Declare service dependency via `inject`.** A plugin that names required services waits until those services exist, so load order is expressed through service requirements rather than manual boot sequencing.
12
+ - **Typed Events for communication.** Services declare event names through TypeScript declaration merging, then dispatch them as `emit`, `waterfall`, `parallel`, or `serial` depending on whether listeners observe, wrap, fan out, or run in order.
13
+ - **Registrations are reversible effects.** Prompt sections, tool schemas, adapters, providers, and listeners are installed through `ctx.effect()` or `ctx.on()` so reload and teardown unwind them predictably.
14
+
15
+ ## Dispatch Modes
16
+
17
+ Every event can have one of the following dispatch mode and can only be dispatched by these methods accordingly.
18
+
19
+ | Mode | Awaited? | Dispatch Order | Has Return Value? |
20
+ |---|---|---|---|
21
+ | `emit` | No | listeners observe in registration order | No |
22
+ | `waterfall` | No | listeners observe in registration order | Yes |
23
+ | `parallel` | Yes | all listeners observe the event in parallel | No |
24
+ | `serial` | Yes | listeners observe in registration order | Yes |
25
+
26
+ The dispatch mode is part of the event's public contract. New harness events document it with an `@mode` tag so the generated catalog can check declarations against dispatch sites.
27
+
28
+ ## Cordis Waterfall Semantics
29
+
30
+ `ctx.waterfall` is around-middleware. A listener receives `(...args, next)`. Call `next()` to delegate the possibly wrapped result to the next service; return without `next()` to short-circuit. Values propagate through `next()`'s return value.
31
+
32
+ Cooperative listeners usually mutate a shared request or decision object and then delegate. A listener can also choose to replace the result entirely and downstream listeners will only see the result after replacement. Use `prepend: true` only when the listener must run before ordinary registrations.
33
+
34
+ For single-decision events, short-circuiting is the design. A policy listener can return without `next()` when it owns the decision, while a listener that only annotates or observes must delegate.
35
+
36
+ ## Loader Configuration
37
+
38
+ `@deepseek-ai/cordis-plugin-include` parses `!!js` into expression nodes. Loader interpolates an entry's `config` (after declared injections activate, against that plugin context — `ctx.serviceName`) and its `disabled` field (at every mount decision, against the loader context); Include preserves nested row expressions until target activation. Other entry metadata stays literal. Use overlays when the environment selects plugins.
39
+
40
+ ## Practical Rules
41
+
42
+ Encapsulate behavior into plugins: a tool pipeline event belongs to `ctx.tools`, model streaming belongs to `ctx.llm`, and live agent coordination belongs to `ctx.agents`. Prefer events for interception and policy; prefer service methods for direct capability calls.
43
+
44
+ Every registration should have a disposer, either by returning one from `ctx.effect()` or using a Cordis helper that does it for you. If teardown order matters, keep the related work in one effect so disposal unwinds in the intended sequence.
@@ -0,0 +1,50 @@
1
+ # Cordis 入门
2
+
3
+ [English](cordis-primer.md) | 中文
4
+
5
+ Cordis 是 DeepSeek Harness 底层以 vendor 方式引入的插件框架。本文介绍 harness 插件作者在阅读[子系统页面](subsystems/core.md)上生成的服务/事件参考之前需要了解的 Cordis 核心概念;[Cordis 教程](cordis-tutorial/index.md)则通过实践逐一讲解这些概念。vendor 源码与同步流程见 [vendor/README.md](../vendor/README.md)。
6
+
7
+ ## 五个核心概念
8
+
9
+ - **插件是实现 Service 的对象。** 它可以是一个带有可选 `inject` 和 `apply(ctx)` 字段的函数,也可以是一个 `Service` 子类,其生命周期由 Cordis 挂载到当前上下文中。
10
+ - **上下文是服务的容器。** 一个服务占据一个稳定的 `ctx.<key>`(如 `ctx.tools`、`ctx.llm`、`ctx.sessions`);其他插件通过 key 查找服务,而非导入具体实现。
11
+ - **通过 `inject` 声明服务依赖。** 插件声明所需的服务后,会等待这些服务就绪才启动;加载顺序通过服务依赖表达,而非手动编排启动序列。
12
+ - **类型化事件用于通信。** 服务通过 TypeScript 声明合并注册事件名,然后以 `emit`、`waterfall`(瀑布式事件)、`parallel` 或 `serial` 方式分发,分别对应监听者观察、包装、并行扇出或按序执行。
13
+ - **注册是可逆的副作用。** 提示词片段、工具 schema、适配器、提供方和监听器通过 `ctx.effect()` 或 `ctx.on()` 安装,reload 和 teardown 时会按预期撤销。
14
+
15
+ <a id="dispatch-modes"></a>
16
+
17
+ ## 分发模式
18
+
19
+ 每个事件具有以下分发模式之一,且只能通过对应方法分发。
20
+
21
+ | 模式 | 是否 await? | 分发顺序 | 是否有返回值? |
22
+ |---|---|---|---|
23
+ | `emit` | 否 | 监听器按注册顺序观察 | 否 |
24
+ | `waterfall` | 否 | 监听器按注册顺序观察 | 是 |
25
+ | `parallel` | 是 | 所有监听器并行观察事件 | 否 |
26
+ | `serial` | 是 | 监听器按注册顺序观察 | 是 |
27
+
28
+ 分发模式是事件公开约定的一部分。新的 harness 事件通过 `@mode` 标签记录模式,以便生成的目录可以将声明与分发调用点做交叉校验。
29
+
30
+ <a id="cordis-waterfall-semantics"></a>
31
+
32
+ ## Cordis Waterfall 语义
33
+
34
+ `ctx.waterfall` 是环绕中间件。监听器接收 `(...args, next)`。调用 `next()` 会执行下游监听器;下游返回值通过 `next()` 返回当前包装层,可由该层包装后继续向外返回。不调用 `next()` 直接返回则短路。
35
+
36
+ 协作式监听器通常修改一个共享的请求或决策对象,然后委托。监听器也可以选择完全替换结果,下游监听器将只看到替换后的结果。仅当监听器必须在普通注册之前运行时才使用 `prepend: true`。
37
+
38
+ 对于单决策事件,短路是设计意图。策略监听器在拥有决策权时可以不调用 `next()` 直接返回,而仅做标注或观察的监听器则必须委托。
39
+
40
+ <a id="loader-configuration"></a>
41
+
42
+ ## Loader 配置
43
+
44
+ `@deepseek-ai/cordis-plugin-include` 将 `!!js` 解析为表达式节点。Loader 在声明的注入激活后,基于该插件上下文(`ctx.serviceName`)插值条目的 `config`,并在每次挂载决策时基于 loader 上下文插值其 `disabled` 字段;Include 会保留嵌套行表达式,直到目标行激活。其余条目元数据保持字面值。由环境选择插件时,请使用 overlay。
45
+
46
+ ## 实践规则
47
+
48
+ 将行为封装为插件:工具流水线事件属于 `ctx.tools`,模型流式输出属于 `ctx.llm`,实时 agent(智能体)协调属于 `ctx.agents`。拦截和策略优先使用事件;直接能力调用优先使用服务方法。
49
+
50
+ 每个注册都应有对应的 disposer(资源释放函数):要么从 `ctx.effect()` 返回一个,要么使用 Cordis 提供的辅助方法自动处理。如果 teardown 顺序有要求,请将相关工作放在同一个 effect 中,以确保资源按预期顺序释放。
@@ -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/cordis-tutorial/01-first-plugin.md
5
+ 01-first-plugin.md: 79df2f42df1f34a7ef32cc81607e1b926a1854ae
6
+ 01-first-plugin.zh.md: 87cd7a96843d69d68fb95662e59bbfb9ebfc2a37
@@ -0,0 +1,95 @@
1
+ # 1. Your first plugin
2
+
3
+ English | [中文](01-first-plugin.zh.md)
4
+
5
+ In the loader configuration used here, a Cordis plugin module named-exports an `apply` function. When Cordis loads it, it calls `apply` with a **context** — the `ctx` object through which the plugin registers everything it contributes.
6
+
7
+ ## Write the plugin
8
+
9
+ In your `tmp/cordis-tutorial` directory (see [setup](index.md#setup)), create `hello.ts`:
10
+
11
+ ```ts
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+
14
+ export const name = 'hello'
15
+
16
+ export function apply(ctx: Context) {
17
+ console.log('hello from my first plugin')
18
+ }
19
+ ```
20
+
21
+ The `name` export is optional display metadata; it labels the plugin in diagnostics.
22
+
23
+ ## Compose the app
24
+
25
+ This tutorial's launcher assembles the application from configuration. Create `cordis.yml`:
26
+
27
+ ```yaml
28
+ - name: './hello.ts'
29
+ ```
30
+
31
+ The file is a list of plugin entries. `name` is a module specifier — a relative path or an npm package name — and the loader mounts every entry. Entries start concurrently, so list position guarantees nothing about which plugin loads first; ordering comes from service dependencies (`inject`, [chapter 3](03-services.md)), not from position in the file.
32
+
33
+ ## Run it
34
+
35
+ ```sh
36
+ node --import tsx ../../vendor/cordis/bin.js
37
+ ```
38
+
39
+ Expected output:
40
+
41
+ ```
42
+ hello from my first plugin
43
+ ```
44
+
45
+ The process exits on its own once nothing is left running. What happened:
46
+
47
+ 1. The launcher created a root `Context` and mounted the **Loader** plugin.
48
+ 2. The Loader read `cordis.yml`, resolved `./hello.ts`, and mounted it as a child plugin.
49
+ 3. Cordis called your `apply(ctx)`.
50
+
51
+ There is no framework bootstrap code in your file: a plugin describes what it contributes, and `cordis.yml` composes the application. The [`dsh` base](../../packages/bundle/base/cordis.patch.yml), for example, is a longer plugin composition that deployment overlays patch.
52
+
53
+ ## The two other plugin shapes
54
+
55
+ A function is the most common form, but Cordis accepts three:
56
+
57
+ ```ts
58
+ import { Service, type Context } from '@deepseek-ai/cordis'
59
+
60
+ // 1. Function plugin (what you just wrote).
61
+ export function apply(ctx: Context) {}
62
+
63
+ // 2. Object plugin: an object with an `apply` method.
64
+ export const objectPlugin = {
65
+ name: 'object-plugin',
66
+ apply(ctx: Context) {},
67
+ }
68
+
69
+ // 3. Class plugin: a Service subclass (covered in chapter 3).
70
+ export class MyService extends Service {
71
+ constructor(ctx: Context) {
72
+ super(ctx, 'myTutorialService')
73
+ }
74
+ }
75
+ ```
76
+
77
+ Use the function form until you need to expose a service; [chapter 3](03-services.md) covers when the class form earns its place.
78
+
79
+ ## Try breaking it
80
+
81
+ Make `apply` throw:
82
+
83
+ ```ts ignore-check
84
+ export function apply(ctx: Context) {
85
+ throw new Error('apply exploded')
86
+ }
87
+ ```
88
+
89
+ Run again: the process dies with your error. A plugin that fails to load is a loud failure, not a skipped entry.
90
+
91
+ One caveat worth knowing early: a config entry whose module cannot be **resolved** — a typo'd path or package name — is reported through the Cordis logger service instead of crashing the process, and at boot that report can be lost before a console exporter is watching. If a freshly added entry seems to do nothing, check the spelling first.
92
+
93
+ Next: [Lifecycle and effects](02-lifecycle-and-effects.md) — what happens when a plugin unloads.
94
+
95
+ [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)
@@ -0,0 +1,95 @@
1
+ # 1. 编写第一个插件
2
+
3
+ [English](01-first-plugin.md) | 中文
4
+
5
+ 在本教程使用的 loader 配置中,Cordis 插件模块通过命名导出提供 `apply` 函数。Cordis 加载模块时,会用一个 **上下文** 调用 `apply`;该上下文就是 `ctx` 对象,插件通过它注册自己贡献的所有内容。
6
+
7
+ ## 编写插件
8
+
9
+ 在 `tmp/cordis-tutorial` 目录中(参见[环境设置](index.md#setup))创建 `hello.ts`:
10
+
11
+ ```ts
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+
14
+ export const name = 'hello'
15
+
16
+ export function apply(ctx: Context) {
17
+ console.log('hello from my first plugin')
18
+ }
19
+ ```
20
+
21
+ `name` 导出项是可选的显示元数据;它用于在诊断信息中标识插件。
22
+
23
+ ## 组合应用
24
+
25
+ 本教程的启动器通过配置组装应用。创建 `cordis.yml`:
26
+
27
+ ```yaml
28
+ - name: './hello.ts'
29
+ ```
30
+
31
+ 该文件是一组 Cordis 配置项的列表。`name` 是模块指定符,可以是相对路径或 NPM 包名;loader 会挂载每个配置项。各项会并发启动,因此它们在列表中的位置不保证插件的加载先后;顺序由服务依赖(`inject`,参见[第 3 章](03-services.md))决定,而非文件中的位置。
32
+
33
+ ## 运行
34
+
35
+ ```sh
36
+ node --import tsx ../../vendor/cordis/bin.js
37
+ ```
38
+
39
+ 预期输出:
40
+
41
+ ```
42
+ hello from my first plugin
43
+ ```
44
+
45
+ 当没有任何内容继续运行时,进程会自行退出。具体过程如下:
46
+
47
+ 1. 启动器创建根 `Context`,并挂载 **Loader** 插件。
48
+ 2. Loader 读取 `cordis.yml`,解析 `./hello.ts`,然后将其作为子插件挂载。
49
+ 3. Cordis 调用你的 `apply(ctx)`。
50
+
51
+ 你的文件中没有框架启动代码:插件描述自己的贡献,`cordis.yml` 则组合应用。例如,[`dsh` base](../../packages/bundle/base/cordis.patch.yml) 就是一份更长的插件组合,由部署 overlay 对它进行修补。
52
+
53
+ ## 其他两种插件形态
54
+
55
+ 函数是最常见的形式,但 Cordis 接受三种形式:
56
+
57
+ ```ts
58
+ import { Service, type Context } from '@deepseek-ai/cordis'
59
+
60
+ // 1. Function plugin (what you just wrote).
61
+ export function apply(ctx: Context) {}
62
+
63
+ // 2. Object plugin: an object with an `apply` method.
64
+ export const objectPlugin = {
65
+ name: 'object-plugin',
66
+ apply(ctx: Context) {},
67
+ }
68
+
69
+ // 3. Class plugin: a Service subclass (covered in chapter 3).
70
+ export class MyService extends Service {
71
+ constructor(ctx: Context) {
72
+ super(ctx, 'myTutorialService')
73
+ }
74
+ }
75
+ ```
76
+
77
+ 在你需要公开服务之前,请一直使用函数形态;[第 3 章](03-services.md)介绍了何时应当使用类形态。
78
+
79
+ ## 尝试制造错误
80
+
81
+ 让 `apply` 抛出异常:
82
+
83
+ ```ts ignore-check
84
+ export function apply(ctx: Context) {
85
+ throw new Error('apply exploded')
86
+ }
87
+ ```
88
+
89
+ 再次运行:进程会因该错误而终止。插件加载失败会明确报错,不会仅跳过该配置项。
90
+
91
+ 还需要尽早了解一个例外:如果某个配置项的模块无法被 **解析**,例如路径或包名拼写错误,Cordis 会通过 logger 服务报告错误,而不会使进程崩溃。在启动阶段,这条报告可能在 console 导出器开始观察之前丢失。如果新增配置项似乎没有任何效果,请先检查拼写。
92
+
93
+ 下一章:[生命周期与 effect](02-lifecycle-and-effects.md):插件卸载时会发生什么。
94
+
95
+ [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)
@@ -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/cordis-tutorial/02-lifecycle-and-effects.md
5
+ 02-lifecycle-and-effects.md: 8e75708eb0cba1aceb7fa3dae5ae334995eb113f
6
+ 02-lifecycle-and-effects.zh.md: bc4489e702ab58b5d1efd8a72fc693ee48af2624