better-dsh 0.2.3 → 0.2.4

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 (385) hide show
  1. package/cordis.patch.yml +1 -1
  2. package/docs/50_test-reports/2026-09-06-write/345/267/245/345/205/267sandbox/345/215/207/347/272/247/351/200/217/344/274/240bug/345/244/215/345/217/221/345/217/212/346/214/202/350/265/267-/344/272/213/344/273/266/346/212/245/345/221/212.md +176 -0
  3. package/docs/50_test-reports/2026-09-08-hashline-edit-E_RANGE_UNVERIFIED/350/267/250/350/275/256/344/274/232/350/257/235/351/224/256/345/244/261/346/225/210-/350/257/212/346/226/255/346/212/245/345/221/212.md +226 -0
  4. package/docs/50_test-reports/2026-09-11-control-prompt-into-eval-description/345/256/236/346/265/213/346/212/245/345/221/212.md +222 -0
  5. package/docs/50_test-reports/2026-09-12-fs-scheme-resolution-/345/256/236/346/265/213/346/212/245/345/221/212.md +81 -0
  6. package/docs/50_test-reports/2026-09-12-url-schemes-grammar-matrix/344/270/216catalog-centralize-/345/256/236/346/265/213/346/212/245/345/221/212.md +234 -0
  7. package/docs/50_test-reports/2026-09-12-url-schemes-recallable-context-design/351/252/214/350/257/201/346/212/245/345/221/212.md +160 -0
  8. package/docs/50_test-reports/2026-09-12-url-schemes-recallable-context-/345/256/236/346/265/213/345/211/247/346/234/254.md +44 -0
  9. package/docs/50_test-reports/2026-09-12-url-schemes-recallable-context-/345/256/236/346/265/213/346/212/245/345/221/212.md +89 -0
  10. package/docs/50_test-reports/2026-09-12-url-schemes-/345/205/255scheme/345/206/222/347/203/237/344/270/216/350/276/271/347/225/214/345/256/236/346/265/213/346/212/245/345/221/212.md +198 -0
  11. package/docs/50_test-reports/2026-09-13-hashline-off/344/270/213scheme/345/217/257/350/276/276/346/200/247/345/267/245/345/205/267/351/235/242/344/270/215/345/257/271/347/247/260-/345/256/236/346/265/213/346/212/245/345/221/212.md +246 -0
  12. package/docs/50_test-reports/2026-09-13-preact-ui-shell/345/256/236/346/265/213/346/212/245/345/221/212.md +50 -0
  13. package/docs/50_test-reports/2026-09-14-4999-skill/346/270/205/345/215/225/344/270/216lsp-gate/345/256/236/346/265/213/346/212/245/345/221/212.md +63 -0
  14. package/docs/50_test-reports/upstream-dsh-0.1.3-alpha.2-local-test-report.md +44 -0
  15. package/docs/50_test-reports/upstream-dsh-0.1.3-alpha.2-report.md +110 -0
  16. package/docs/50_test-reports/upstream-dsh-0.1.5-rc.2-local-test-report.md +79 -0
  17. package/docs/50_test-reports/v0.2.3b-hashline-content-locator/345/256/236/346/265/213/346/212/245/345/221/212.md +73 -0
  18. package/docs/50_test-reports/v0.2.3c-mobile-wave/345/256/236/346/265/213/346/212/245/345/221/212.md +47 -0
  19. package/docs/50_test-reports/v0.2.4-ios-focus-zoom-suppression/345/256/236/346/265/213/346/212/245/345/221/212.md +158 -0
  20. package/docs/specs/agent/spec.md +54 -0
  21. package/docs/specs/ast/spec.md +34 -0
  22. package/docs/specs/compaction-recall/spec.md +46 -0
  23. package/docs/specs/ctx/spec.md +107 -0
  24. package/docs/specs/dsh/spec.md +47 -0
  25. package/docs/specs/dvc/spec.md +87 -0
  26. package/docs/specs/escalation-guidance/spec.md +44 -0
  27. package/docs/specs/fs-scheme-resolution/spec.md +37 -0
  28. package/docs/specs/hash-edit/spec.md +41 -0
  29. package/docs/specs/http-read/spec.md +73 -0
  30. package/docs/specs/kernel-provisioning/spec.md +53 -0
  31. package/docs/specs/lsp/spec.md +121 -0
  32. package/docs/specs/mobile-layout/spec.md +108 -0
  33. package/docs/specs/model-failover/spec.md +20 -0
  34. package/docs/specs/preact-ui-shell/spec.md +22 -0
  35. package/docs/specs/repl-dispatch-resilience/spec.md +21 -0
  36. package/docs/specs/skill/spec.md +58 -0
  37. package/docs/specs/tool-surface/spec.md +222 -0
  38. package/docs/specs/url-schema/spec.md +148 -0
  39. package/docs/specs/web-trust-fence/spec.md +43 -0
  40. package/docs/upstream-dsh-0.1.5-rc.2-report.md +156 -0
  41. package/dsh-docs/AGENTS.md +75 -0
  42. package/dsh-docs/agent-lifecycle.md +84 -0
  43. package/dsh-docs/agent-lifecycle.zh.md +86 -0
  44. package/dsh-docs/api-gateway.md +164 -0
  45. package/dsh-docs/api-gateway.zh.md +164 -0
  46. package/dsh-docs/architecture.md +150 -0
  47. package/dsh-docs/architecture.zh.md +154 -0
  48. package/dsh-docs/capability-seams.md +543 -0
  49. package/dsh-docs/capability-seams.zh.md +545 -0
  50. package/dsh-docs/config-catalog.md +3473 -0
  51. package/dsh-docs/config-catalog.zh.md +3474 -0
  52. package/dsh-docs/cookbook/adding-a-package.md +117 -0
  53. package/dsh-docs/cookbook/adding-a-package.zh.md +119 -0
  54. package/dsh-docs/cookbook/adding-a-remote-api.md +197 -0
  55. package/dsh-docs/cookbook/adding-a-remote-api.zh.md +197 -0
  56. package/dsh-docs/cookbook/adding-a-session-format-version.md +109 -0
  57. package/dsh-docs/cookbook/adding-a-session-format-version.zh.md +109 -0
  58. package/dsh-docs/cookbook/adding-a-settings-card.md +102 -0
  59. package/dsh-docs/cookbook/adding-a-settings-card.zh.md +102 -0
  60. package/dsh-docs/cookbook/adding-a-tool.md +101 -0
  61. package/dsh-docs/cookbook/adding-a-tool.zh.md +103 -0
  62. package/dsh-docs/cookbook/adding-a-vendored-package.md +59 -0
  63. package/dsh-docs/cookbook/adding-a-vendored-package.zh.md +59 -0
  64. package/dsh-docs/cookbook/adding-an-llm-adapter.md +43 -0
  65. package/dsh-docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
  66. package/dsh-docs/cookbook/extension-cookbook.md +132 -0
  67. package/dsh-docs/cookbook/extension-cookbook.zh.md +136 -0
  68. package/dsh-docs/cookbook/maintaining-dsh-code-review.md +64 -0
  69. package/dsh-docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  70. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  71. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  72. package/dsh-docs/cordis-api/context.md +364 -0
  73. package/dsh-docs/cordis-api/context.zh.md +366 -0
  74. package/dsh-docs/cordis-api/events.md +207 -0
  75. package/dsh-docs/cordis-api/events.zh.md +209 -0
  76. package/dsh-docs/cordis-api/fiber.md +375 -0
  77. package/dsh-docs/cordis-api/fiber.zh.md +377 -0
  78. package/dsh-docs/cordis-api/inherited.md +39 -0
  79. package/dsh-docs/cordis-api/registry.md +152 -0
  80. package/dsh-docs/cordis-api/registry.zh.md +154 -0
  81. package/dsh-docs/cordis-api/service.md +102 -0
  82. package/dsh-docs/cordis-api/service.zh.md +104 -0
  83. package/dsh-docs/cordis-primer.md +45 -0
  84. package/dsh-docs/cordis-primer.zh.md +51 -0
  85. package/dsh-docs/cordis-tutorial/01-first-plugin.md +95 -0
  86. package/dsh-docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
  87. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  88. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  89. package/dsh-docs/cordis-tutorial/03-services.md +98 -0
  90. package/dsh-docs/cordis-tutorial/03-services.zh.md +98 -0
  91. package/dsh-docs/cordis-tutorial/04-events.md +144 -0
  92. package/dsh-docs/cordis-tutorial/04-events.zh.md +144 -0
  93. package/dsh-docs/cordis-tutorial/05-config.md +84 -0
  94. package/dsh-docs/cordis-tutorial/05-config.zh.md +84 -0
  95. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
  96. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  97. package/dsh-docs/cordis-tutorial/07-into-the-harness.md +108 -0
  98. package/dsh-docs/cordis-tutorial/07-into-the-harness.zh.md +108 -0
  99. package/dsh-docs/cordis-tutorial/index.md +60 -0
  100. package/dsh-docs/cordis-tutorial/index.zh.md +62 -0
  101. package/dsh-docs/deepseek-llm-api-wire-extensions.md +163 -0
  102. package/dsh-docs/deepseek-llm-api-wire-extensions.zh.md +163 -0
  103. package/dsh-docs/defensive-patterns.md +33 -0
  104. package/dsh-docs/defensive-patterns.zh.md +35 -0
  105. package/dsh-docs/development.md +167 -0
  106. package/dsh-docs/development.zh.md +173 -0
  107. package/dsh-docs/event-producer-consumer.md +86 -0
  108. package/dsh-docs/event-producer-consumer.zh.md +88 -0
  109. package/dsh-docs/glossary.md +45 -0
  110. package/dsh-docs/glossary.zh.md +45 -0
  111. package/dsh-docs/graph-atlas.md +22 -0
  112. package/dsh-docs/graph-atlas.zh.md +24 -0
  113. package/dsh-docs/i18n/README.md +60 -0
  114. package/dsh-docs/i18n/README.zh.md +62 -0
  115. package/dsh-docs/i18n/style-samples.md +87 -0
  116. package/dsh-docs/i18n/terminology.md +214 -0
  117. package/dsh-docs/i18n/translation-prompt.md +263 -0
  118. package/dsh-docs/i18n/translation-rules.md +69 -0
  119. package/dsh-docs/i18n/translation-rules.zh.md +69 -0
  120. package/dsh-docs/module-graph.md +1411 -0
  121. package/dsh-docs/module-graph.zh.md +1413 -0
  122. package/dsh-docs/persistence-catalog.md +1075 -0
  123. package/dsh-docs/persistence-catalog.zh.md +1077 -0
  124. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  125. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  126. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  127. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  128. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  129. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  130. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  131. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  132. package/dsh-docs/postmortem/README.md +18 -0
  133. package/dsh-docs/postmortem/README.zh.md +18 -0
  134. package/dsh-docs/rescope.md +53 -0
  135. package/dsh-docs/rescope.zh.md +53 -0
  136. package/dsh-docs/session-format-status.md +47 -0
  137. package/dsh-docs/session-format-status.zh.md +47 -0
  138. package/dsh-docs/subsystems/README.md +61 -0
  139. package/dsh-docs/subsystems/README.zh.md +61 -0
  140. package/dsh-docs/subsystems/agent-team.md +207 -0
  141. package/dsh-docs/subsystems/agent-team.zh.md +207 -0
  142. package/dsh-docs/subsystems/approval.md +170 -0
  143. package/dsh-docs/subsystems/approval.zh.md +170 -0
  144. package/dsh-docs/subsystems/attachment.md +351 -0
  145. package/dsh-docs/subsystems/attachment.zh.md +351 -0
  146. package/dsh-docs/subsystems/client-modules.md +168 -0
  147. package/dsh-docs/subsystems/client-modules.zh.md +168 -0
  148. package/dsh-docs/subsystems/client-resources.md +91 -0
  149. package/dsh-docs/subsystems/client-resources.zh.md +91 -0
  150. package/dsh-docs/subsystems/code-runtime.md +195 -0
  151. package/dsh-docs/subsystems/code-runtime.zh.md +195 -0
  152. package/dsh-docs/subsystems/commands.md +219 -0
  153. package/dsh-docs/subsystems/commands.zh.md +219 -0
  154. package/dsh-docs/subsystems/compaction.md +238 -0
  155. package/dsh-docs/subsystems/compaction.zh.md +238 -0
  156. package/dsh-docs/subsystems/conversation.md +258 -0
  157. package/dsh-docs/subsystems/conversation.zh.md +258 -0
  158. package/dsh-docs/subsystems/core.md +1209 -0
  159. package/dsh-docs/subsystems/core.zh.md +1219 -0
  160. package/dsh-docs/subsystems/credentials.md +329 -0
  161. package/dsh-docs/subsystems/credentials.zh.md +329 -0
  162. package/dsh-docs/subsystems/extensions.md +382 -0
  163. package/dsh-docs/subsystems/extensions.zh.md +382 -0
  164. package/dsh-docs/subsystems/feedback.md +266 -0
  165. package/dsh-docs/subsystems/feedback.zh.md +266 -0
  166. package/dsh-docs/subsystems/filesystem.md +505 -0
  167. package/dsh-docs/subsystems/filesystem.zh.md +505 -0
  168. package/dsh-docs/subsystems/goal.md +277 -0
  169. package/dsh-docs/subsystems/goal.zh.md +277 -0
  170. package/dsh-docs/subsystems/invariants.md +88 -0
  171. package/dsh-docs/subsystems/invariants.zh.md +88 -0
  172. package/dsh-docs/subsystems/jobs.md +290 -0
  173. package/dsh-docs/subsystems/jobs.zh.md +290 -0
  174. package/dsh-docs/subsystems/llm-streaming.md +1080 -0
  175. package/dsh-docs/subsystems/llm-streaming.zh.md +1086 -0
  176. package/dsh-docs/subsystems/lsp.md +202 -0
  177. package/dsh-docs/subsystems/lsp.zh.md +202 -0
  178. package/dsh-docs/subsystems/permission-presets.md +131 -0
  179. package/dsh-docs/subsystems/permission-presets.zh.md +131 -0
  180. package/dsh-docs/subsystems/persistence.md +395 -0
  181. package/dsh-docs/subsystems/persistence.zh.md +395 -0
  182. package/dsh-docs/subsystems/plan.md +87 -0
  183. package/dsh-docs/subsystems/plan.zh.md +87 -0
  184. package/dsh-docs/subsystems/sandbox.md +220 -0
  185. package/dsh-docs/subsystems/sandbox.zh.md +220 -0
  186. package/dsh-docs/subsystems/schedule.md +192 -0
  187. package/dsh-docs/subsystems/schedule.zh.md +192 -0
  188. package/dsh-docs/subsystems/scope.md +59 -0
  189. package/dsh-docs/subsystems/scope.zh.md +59 -0
  190. package/dsh-docs/subsystems/session-projection.md +354 -0
  191. package/dsh-docs/subsystems/session-projection.zh.md +354 -0
  192. package/dsh-docs/subsystems/session-query.md +509 -0
  193. package/dsh-docs/subsystems/session-query.zh.md +509 -0
  194. package/dsh-docs/subsystems/session-reference.md +219 -0
  195. package/dsh-docs/subsystems/session-reference.zh.md +219 -0
  196. package/dsh-docs/subsystems/session-telemetry.md +194 -0
  197. package/dsh-docs/subsystems/session-telemetry.zh.md +194 -0
  198. package/dsh-docs/subsystems/session-title.md +204 -0
  199. package/dsh-docs/subsystems/session-title.zh.md +204 -0
  200. package/dsh-docs/subsystems/session.md +1155 -0
  201. package/dsh-docs/subsystems/session.zh.md +1159 -0
  202. package/dsh-docs/subsystems/settings.md +405 -0
  203. package/dsh-docs/subsystems/settings.zh.md +405 -0
  204. package/dsh-docs/subsystems/shell.md +303 -0
  205. package/dsh-docs/subsystems/shell.zh.md +303 -0
  206. package/dsh-docs/subsystems/sidebar-right.md +148 -0
  207. package/dsh-docs/subsystems/sidebar-right.zh.md +148 -0
  208. package/dsh-docs/subsystems/skills.md +354 -0
  209. package/dsh-docs/subsystems/skills.zh.md +354 -0
  210. package/dsh-docs/subsystems/slots.md +175 -0
  211. package/dsh-docs/subsystems/slots.zh.md +175 -0
  212. package/dsh-docs/subsystems/spill.md +117 -0
  213. package/dsh-docs/subsystems/spill.zh.md +117 -0
  214. package/dsh-docs/subsystems/storage.md +260 -0
  215. package/dsh-docs/subsystems/storage.zh.md +260 -0
  216. package/dsh-docs/subsystems/subagent.md +766 -0
  217. package/dsh-docs/subsystems/subagent.zh.md +770 -0
  218. package/dsh-docs/subsystems/subprocess.md +324 -0
  219. package/dsh-docs/subsystems/subprocess.zh.md +324 -0
  220. package/dsh-docs/subsystems/system-prompt.md +220 -0
  221. package/dsh-docs/subsystems/system-prompt.zh.md +220 -0
  222. package/dsh-docs/subsystems/terminal.md +184 -0
  223. package/dsh-docs/subsystems/terminal.zh.md +184 -0
  224. package/dsh-docs/subsystems/todo.md +32 -0
  225. package/dsh-docs/subsystems/todo.zh.md +32 -0
  226. package/dsh-docs/subsystems/token-meter.md +105 -0
  227. package/dsh-docs/subsystems/token-meter.zh.md +105 -0
  228. package/dsh-docs/subsystems/tools.md +720 -0
  229. package/dsh-docs/subsystems/tools.zh.md +720 -0
  230. package/dsh-docs/subsystems/typert.md +343 -0
  231. package/dsh-docs/subsystems/typert.zh.md +343 -0
  232. package/dsh-docs/subsystems/user-questions.md +178 -0
  233. package/dsh-docs/subsystems/user-questions.zh.md +178 -0
  234. package/dsh-docs/subsystems/web-client.md +95 -0
  235. package/dsh-docs/subsystems/web-client.zh.md +95 -0
  236. package/dsh-docs/subsystems/web-server.md +154 -0
  237. package/dsh-docs/subsystems/web-server.zh.md +154 -0
  238. package/dsh-docs/subsystems/web.md +206 -0
  239. package/dsh-docs/subsystems/web.zh.md +206 -0
  240. package/dsh-docs/subsystems/webhook.md +70 -0
  241. package/dsh-docs/subsystems/webhook.zh.md +70 -0
  242. package/dsh-docs/subsystems/workflow.md +278 -0
  243. package/dsh-docs/subsystems/workflow.zh.md +278 -0
  244. package/dsh-docs/subsystems/workspace.md +321 -0
  245. package/dsh-docs/subsystems/workspace.zh.md +321 -0
  246. package/dsh-docs/testing.md +54 -0
  247. package/dsh-docs/testing.zh.md +54 -0
  248. package/dsh-docs/tool-catalog.md +2225 -0
  249. package/dsh-docs/tool-catalog.zh.md +2233 -0
  250. package/dsh-docs/tool-execution-pipeline.md +62 -0
  251. package/dsh-docs/tool-execution-pipeline.zh.md +64 -0
  252. package/dsh-docs/user/develop/basic/config.md +106 -0
  253. package/dsh-docs/user/develop/basic/config.zh.md +106 -0
  254. package/dsh-docs/user/develop/basic/index.md +144 -0
  255. package/dsh-docs/user/develop/basic/index.zh.md +144 -0
  256. package/dsh-docs/user/develop/basic/publish.md +183 -0
  257. package/dsh-docs/user/develop/basic/publish.zh.md +183 -0
  258. package/dsh-docs/user/develop/basic/tool.md +52 -0
  259. package/dsh-docs/user/develop/basic/tool.zh.md +52 -0
  260. package/dsh-docs/user/develop/framework/events.md +143 -0
  261. package/dsh-docs/user/develop/framework/events.zh.md +143 -0
  262. package/dsh-docs/user/develop/framework/index.md +137 -0
  263. package/dsh-docs/user/develop/framework/index.zh.md +137 -0
  264. package/dsh-docs/user/develop/framework/service.md +148 -0
  265. package/dsh-docs/user/develop/framework/service.zh.md +150 -0
  266. package/dsh-docs/user/develop/practice/dynamic-cordis.md +15 -0
  267. package/dsh-docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
  268. package/dsh-docs/user/develop/practice/index.md +155 -0
  269. package/dsh-docs/user/develop/practice/index.zh.md +155 -0
  270. package/dsh-docs/user/develop/practice/llm-adapter.md +189 -0
  271. package/dsh-docs/user/develop/practice/llm-adapter.zh.md +189 -0
  272. package/dsh-docs/user/guide/github-review.md +102 -0
  273. package/dsh-docs/user/guide/github-review.zh.md +102 -0
  274. package/dsh-docs/user/guide/index.md +30 -0
  275. package/dsh-docs/user/guide/index.zh.md +30 -0
  276. package/dsh-docs/user/guide/mcp-memory.md +101 -0
  277. package/dsh-docs/user/guide/mcp-memory.zh.md +101 -0
  278. package/dsh-docs/user/guide/network-proxy.md +85 -0
  279. package/dsh-docs/user/guide/network-proxy.zh.md +85 -0
  280. package/dsh-docs/user/guide/providers.md +190 -0
  281. package/dsh-docs/user/guide/providers.zh.md +190 -0
  282. package/dsh-docs/user/guide/python-sdk.md +150 -0
  283. package/dsh-docs/user/guide/python-sdk.zh.md +150 -0
  284. package/dsh-docs/user/guide/schedule.md +21 -0
  285. package/dsh-docs/user/guide/schedule.zh.md +21 -0
  286. package/dsh-docs/user/index.md +11 -0
  287. package/dsh-docs/user/index.zh.md +11 -0
  288. package/dsh-docs/web-styling.md +29 -0
  289. package/dsh-docs/web-styling.zh.md +29 -0
  290. package/eval-description.md +33 -0
  291. package/lib/client/index.js +327 -88
  292. package/lib/fs-aware/sandbox-plugin.d.ts +71 -0
  293. package/lib/fs-aware/sandbox-plugin.js +249 -0
  294. package/lib/index.d.ts +22 -22
  295. package/lib/index.js +3095 -3204
  296. package/lib/lsp-server-registry-DkaYmTwt.js +972 -0
  297. package/lib/lsp-server-registry-_hk-Wcia.js +3 -0
  298. package/lib/py-sdk-Chvy92MB.js +178 -0
  299. package/lib/py-sdk.d.ts +19 -2
  300. package/lib/py-sdk.js +2 -2
  301. package/lib/wrap-JFjcWwZf.js +747 -0
  302. package/package.json +9 -3
  303. package/url-schemes-instruction.md +22 -0
  304. package/control-prompt.md +0 -37
  305. package/docs/50_test-reports/v0.1.8d_artifacts/README.md +0 -138
  306. package/docs/50_test-reports/v0.1.8d_artifacts/code-mode-repl-only.observation.md +0 -74
  307. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +0 -3890
  308. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +0 -544
  309. package/docs/50_test-reports/v0.1.8d_artifacts/functions.json +0 -592
  310. package/docs/50_test-reports/v0.1.8d_artifacts/skills-catalog.snapshot.md +0 -30
  311. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.output-schemas.json +0 -1236
  312. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.python.txt +0 -592
  313. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.typescript.txt +0 -516
  314. package/docs/50_test-reports/v0.1.8d_artifacts/wire-vs-transcription.diff.md +0 -54
  315. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.lock +0 -7
  316. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.toml +0 -6
  317. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +0 -8
  318. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/main.rs +0 -4
  319. package/docs/50_test-reports/v0.2.0b_artifacts/hashline-probe.md +0 -5
  320. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.lock +0 -7
  321. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.toml +0 -7
  322. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/build.rs +0 -4
  323. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/src/main.rs +0 -13
  324. package/docs/60_exploration-and-research/cordis-research.md +0 -350
  325. package/docs/60_exploration-and-research/dsh-web-profile-package-map.md +0 -186
  326. package/docs/60_exploration-and-research/dsh-web-ui-slot-system-research.md +0 -310
  327. package/docs/60_exploration-and-research/dsh-webui-strip-boundary-research.md +0 -300
  328. package/docs/60_exploration-and-research/ios-chat-app-bridge-research.md +0 -324
  329. package/docs/60_exploration-and-research/web-frontend-composability-research.md +0 -191
  330. package/docs/REPL-/345/267/245/345/205/267/350/260/203/347/224/250-/346/210/252/346/226/255/350/257/212/346/226/255.md +0 -110
  331. package/docs/adr/0001-bridge-tool-layer-not-service-layer.md +0 -14
  332. package/docs/adr/0002-masking-is-presentation-only.md +0 -15
  333. package/docs/plans/A2A-messaging-channel-test-archive.md +0 -256
  334. package/docs/plans/code-mode-vs-rlm-ipython-comparison.md +0 -137
  335. package/docs/plans/dashr-blueprint-review.md +0 -201
  336. package/docs/plans/dashr-blueprint.md +0 -561
  337. package/docs/plans/dashr-compaction-window-and-archive.md +0 -307
  338. package/docs/plans/dashr-profile-layer-feasibility.md +0 -367
  339. package/docs/plans/dashr-sandbox-escalation-semantics-gap.md +0 -171
  340. package/docs/plans/dashr-security-sandbox-analysis.md +0 -187
  341. package/docs/plans/dashr-surface-invariant-and-omp-imports.md +0 -97
  342. package/docs/plans/ipython-kernel-interactive-interface-test-report.md +0 -152
  343. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft.md +0 -146
  344. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v3.md +0 -50
  345. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v4.md +0 -79
  346. package/docs/plans/kernel-refactoring/Dash-vs-PrimeAgent-systemprompt-toolcatalog-comparison.md +0 -138
  347. package/docs/plans/kernel-refactoring/RLM-system-prompt-injection-gap-report.md +0 -161
  348. package/docs/plans/kernel-refactoring/V0.1.5-development-plan.md +0 -109
  349. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_dsh.md +0 -50
  350. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_prime.md +0 -113
  351. package/docs/plans/recallable-compaction.md +0 -147
  352. package/docs/plans/spike-tag-repro.mjs +0 -102
  353. package/docs/plans/upstream-analysis.md +0 -128
  354. package/docs/v0.1.8-improved-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -142
  355. package/docs/v0.1.8-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -193
  356. package/docs/v0.1.8b-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -96
  357. package/docs/v0.1.8c-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -127
  358. package/docs/v0.1.8d-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -150
  359. package/docs/v0.1.8d_artifacts/README.md +0 -138
  360. package/docs/v0.1.8d_artifacts/code-mode-repl-only.observation.md +0 -74
  361. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +0 -3890
  362. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +0 -544
  363. package/docs/v0.1.8d_artifacts/functions.json +0 -592
  364. package/docs/v0.1.8d_artifacts/skills-catalog.snapshot.md +0 -30
  365. package/docs/v0.1.8d_artifacts/tools-sdk.output-schemas.json +0 -1236
  366. package/docs/v0.1.8d_artifacts/tools-sdk.python.txt +0 -592
  367. package/docs/v0.1.8d_artifacts/tools-sdk.typescript.txt +0 -516
  368. package/docs/v0.1.8d_artifacts/wire-vs-transcription.diff.md +0 -54
  369. package/docs/v0.1.8e-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -224
  370. package/docs/v0.1.9a-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -168
  371. package/docs/v0.2.0b-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -123
  372. package/docs/v0.2.0b_artifacts/f2probe/Cargo.lock +0 -7
  373. package/docs/v0.2.0b_artifacts/f2probe/Cargo.toml +0 -6
  374. package/docs/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +0 -8
  375. package/docs/v0.2.0b_artifacts/f2probe/src/main.rs +0 -4
  376. package/docs/v0.2.0b_artifacts/hashline-probe.md +0 -5
  377. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.lock +0 -7
  378. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.toml +0 -7
  379. package/docs/v0.2.0b_artifacts/slowprobe/build.rs +0 -4
  380. package/docs/v0.2.0b_artifacts/slowprobe/src/main.rs +0 -13
  381. package/docs/v0.2.1-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -110
  382. package/docs/v0.2.1b-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -86
  383. package/docs/v0.2.1c-/345/256/236/346/265/213/346/212/245/345/221/212.md +0 -66
  384. package/lib/py-sdk-BCaOGYz7.d.ts +0 -125
  385. package/lib/py-sdk-CbgYiX8O.js +0 -691
@@ -0,0 +1,84 @@
1
+ # 5. Configuration
2
+
3
+ English | [中文](05-config.zh.md)
4
+
5
+ Each `cordis.yml` entry can carry a `config` block, and the plugin declares a schema that validates it before `apply` runs. Bad config fails the load with a precise error — the plugin never starts half-configured.
6
+
7
+ ## A configurable plugin
8
+
9
+ Create `config-demo.ts` in `tmp/cordis-tutorial`:
10
+
11
+ ```ts
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+ import Schema from '@deepseek-ai/schemastery'
14
+
15
+ export const name = 'config-demo'
16
+
17
+ export interface Config {
18
+ greeting: string
19
+ targets: string[]
20
+ }
21
+
22
+ export const Config: Schema<Config> = Schema.object({
23
+ greeting: Schema.string().default('Hello'),
24
+ targets: Schema.array(String).default(['world']),
25
+ })
26
+
27
+ export function apply(ctx: Context, config: Config) {
28
+ for (const target of config.targets) {
29
+ console.log(`${config.greeting}, ${target}!`)
30
+ }
31
+ }
32
+ ```
33
+
34
+ The exported `Config` is both a TypeScript interface and a runtime schema with the same name — consumers get the type, Cordis gets the validator. This repo uses [Schemastery](https://github.com/shigma/schemastery) for schemas; Cordis itself accepts any [Standard Schema](https://standardschema.dev/) validator, so a plain object exported as `Config` will not work.
35
+
36
+ Configure it:
37
+
38
+ ```yaml
39
+ - name: './config-demo.ts'
40
+ config:
41
+ targets: ['alpha', 'beta']
42
+ ```
43
+
44
+ Run:
45
+
46
+ ```
47
+ Hello, alpha!
48
+ Hello, beta!
49
+ ```
50
+
51
+ `greeting` was omitted, so the schema default filled it in — `apply` always receives complete, validated config.
52
+
53
+ ## Fail loud
54
+
55
+ Now feed it something invalid:
56
+
57
+ ```yaml
58
+ - name: './config-demo.ts'
59
+ config:
60
+ targets: 'not-an-array'
61
+ ```
62
+
63
+ ```
64
+ ValidationError: invalid config:
65
+ - $.targets expected array but got not-an-array (at targets)
66
+ ```
67
+
68
+ The plugin's fiber goes to FAILED, and this tutorial's launcher exits with status 1 after printing the error. A plugin should also reject schema-valid config that names an unavailable resource or provider as soon as it can resolve that reference.
69
+
70
+ ## Computed config values
71
+
72
+ The loader used in this repo supports a `!!js` tag for config values that must be computed at load time:
73
+
74
+ ```yaml
75
+ - name: './config-demo.ts'
76
+ config:
77
+ greeting: !!js process.env.DEMO_GREETING ?? 'Hello'
78
+ ```
79
+
80
+ `!!js` works only inside `config` and in an entry's `disabled` field. `disabled: !!js ...` evaluates against the loader context at every mount decision (this repo's extension), so a row can gate itself on platform or environment; the other metadata (`name`, `id`, `inject`, ...) stays static, where an expression is ordinary truthy data. See [loader configuration](../cordis-primer.md#loader-configuration).
81
+
82
+ Next: [Composition and HMR](06-composition-and-hmr.md) — treating `cordis.yml` as the application.
83
+
84
+ [![](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,84 @@
1
+ # 5. 配置
2
+
3
+ [English](05-config.md) | 中文
4
+
5
+ `cordis.yml` 中的每个 Cordis 配置项都可以携带 `config` 块,插件则声明一个 schema,在运行 `apply` 前验证该块。错误配置会导致加载失败,并给出准确的错误:插件绝不会在配置不完整时启动。
6
+
7
+ ## 可配置插件
8
+
9
+ 创建 `config-demo.ts`,并将其放在 `tmp/cordis-tutorial` 中:
10
+
11
+ ```ts
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+ import Schema from '@deepseek-ai/schemastery'
14
+
15
+ export const name = 'config-demo'
16
+
17
+ export interface Config {
18
+ greeting: string
19
+ targets: string[]
20
+ }
21
+
22
+ export const Config: Schema<Config> = Schema.object({
23
+ greeting: Schema.string().default('Hello'),
24
+ targets: Schema.array(String).default(['world']),
25
+ })
26
+
27
+ export function apply(ctx: Context, config: Config) {
28
+ for (const target of config.targets) {
29
+ console.log(`${config.greeting}, ${target}!`)
30
+ }
31
+ }
32
+ ```
33
+
34
+ 导出的 `Config` 既是 TypeScript 接口,也是同名的运行时 schema:消费方获得类型,Cordis 获得验证器。本仓库使用 [Schemastery](https://github.com/shigma/schemastery) 定义 schema;Cordis 本身接受任意 [Standard Schema](https://standardschema.dev/) 验证器,因此将普通对象导出为 `Config` 无法工作。
35
+
36
+ 对其进行配置:
37
+
38
+ ```yaml
39
+ - name: './config-demo.ts'
40
+ config:
41
+ targets: ['alpha', 'beta']
42
+ ```
43
+
44
+ 运行:
45
+
46
+ ```
47
+ Hello, alpha!
48
+ Hello, beta!
49
+ ```
50
+
51
+ 未提供 `greeting`,因此 schema 默认值会将其补齐:`apply` 始终会收到完整且经过验证的配置。
52
+
53
+ ## 明确报错
54
+
55
+ 现在向它传入无效内容:
56
+
57
+ ```yaml
58
+ - name: './config-demo.ts'
59
+ config:
60
+ targets: 'not-an-array'
61
+ ```
62
+
63
+ ```
64
+ ValidationError: invalid config:
65
+ - $.targets expected array but got not-an-array (at targets)
66
+ ```
67
+
68
+ 插件的 fiber 进入 FAILED 状态,本教程的启动器打印错误后以状态码 1 退出。如果某个插件的配置通过了 schema 验证,但其中指定的资源或提供方不可用,该插件也应当在能解析该引用时立即拒绝。
69
+
70
+ ## 计算得到的配置值
71
+
72
+ 本仓库使用的 loader 支持 `!!js` 标签,用于必须在加载时计算的配置值:
73
+
74
+ ```yaml
75
+ - name: './config-demo.ts'
76
+ config:
77
+ greeting: !!js process.env.DEMO_GREETING ?? 'Hello'
78
+ ```
79
+
80
+ `!!js` 仅在 `config` 与条目 `disabled` 字段内有效。`disabled: !!js ...` 在每次挂载决策时基于 loader 上下文求值(本仓库的扩展),可以按平台或环境门控一行;其余元数据(`name`、`id`、`inject` 等)保持静态,其中的表达式是普通真值数据。详见 [loader 配置](../cordis-primer.zh.md#loader-configuration)。
81
+
82
+ 下一章:[组合与 HMR(热模块替换)](06-composition-and-hmr.zh.md):将 `cordis.yml` 视为应用。
83
+
84
+ [![](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,113 @@
1
+ # 6. Composition and HMR
2
+
3
+ English | [中文](06-composition-and-hmr.zh.md)
4
+
5
+ Every capability built so far is a plugin, and `cordis.yml` selects the application's plugin tree. This chapter changes that composition, hot-reloads a plugin, and diagnoses a plugin that never loads.
6
+
7
+ ## Entries are more than a name
8
+
9
+ A config entry accepts metadata beyond `name` and `config`:
10
+
11
+ ```yaml
12
+ - id: greeter # stable identity for this entry
13
+ name: './greeter.ts'
14
+ - id: consumer
15
+ name: './consumer.ts'
16
+ disabled: true # keep the entry, skip mounting it
17
+ ```
18
+
19
+ `id` gives the entry a stable identity so the loader can tell an edit to an existing entry apart from a removal plus an addition. `disabled: true` unmounts a plugin without deleting its entry — flip it back and the plugin (and everything PENDING on its services) loads again.
20
+
21
+ Groups nest a sub-list of entries that load and unload as one unit, and `isolate` gives a group its own instance of a service name — two groups can each see a differently configured `shell` provider without affecting each other. The [Cordis primer](../cordis-primer.md) and the [service isolation example](../user/develop/framework/service.md#service-isolation) cover the details.
22
+
23
+ ## Hot module replacement
24
+
25
+ Because unloading releases effects ([chapter 2](02-lifecycle-and-effects.md)) and loading follows dependencies ([chapter 3](03-services.md)), HMR can replace a running plugin by unloading and loading it. The `@deepseek-ai/cordis-plugin-hmr` plugin watches your files and does exactly that on save.
26
+
27
+ In `tmp/cordis-tutorial`, write `cordis.yml`:
28
+
29
+ ```yaml
30
+ - id: logger
31
+ name: '@deepseek-ai/cordis-plugin-logger-console'
32
+ - id: timer
33
+ name: '@deepseek-ai/cordis-plugin-timer'
34
+ - id: hmr
35
+ name: '@deepseek-ai/cordis-plugin-hmr'
36
+ config:
37
+ root: ['.']
38
+ - id: hello
39
+ name: './hello.ts'
40
+ ```
41
+
42
+ Two support plugins joined the list: HMR logs through the Cordis logger service, so without a console exporter you would not see its messages, and it `inject`s the `timer` service for debouncing — without `@deepseek-ai/cordis-plugin-timer` it sits in PENDING forever, silently. That silence is the subject of the next section.
43
+
44
+ HMR reads Node's loader internals through the Loader's native helper. Run Cordis under tsx:
45
+
46
+ ```sh
47
+ node --import tsx ../../vendor/cordis/bin.js
48
+ ```
49
+
50
+ Now edit `hello.ts` — change the log message — and save:
51
+
52
+ ```
53
+ hello from my first plugin
54
+ 2026-07-22 15:44:36 [I] hmr watching [ '.' ]
55
+ 2026-07-22 15:44:39 [I] hmr reload plugin at hello.ts
56
+ hello from my EDITED plugin
57
+ ```
58
+
59
+ The old instance unloaded (all its effects unwound), the new code loaded, `apply` ran again. Stop the process with Ctrl-C. Editing `cordis.yml` itself is also picked up: the loader diffs entries by `id` and mounts, unmounts, or reconfigures only what changed. This is why the entries above carry explicit `id`s — an entry without one gets a generated id on every read, so after any config-file edit it counts as removed-plus-added and remounts even if its own lines did not change.
60
+
61
+ ## Diagnosing a plugin that never loads
62
+
63
+ The flip side of dependency-driven loading: a plugin whose `inject` names a service nobody provides waits forever, printing nothing. No error — PENDING is a legitimate state, since the provider may be mounted later.
64
+
65
+ You can see the states directly. Every context can enumerate the plugin registry; create `diagnose.ts`:
66
+
67
+ ```ts
68
+ import { FiberState, type Context } from '@deepseek-ai/cordis'
69
+
70
+ export const name = 'diagnose'
71
+
72
+ export function apply(ctx: Context) {
73
+ setTimeout(() => {
74
+ for (const runtime of ctx.registry.values()) {
75
+ for (const fiber of runtime.fibers) {
76
+ if (fiber.state === FiberState.PENDING) {
77
+ console.log(`${fiber.name} is PENDING — a required service is missing`)
78
+ }
79
+ }
80
+ }
81
+ }, 500)
82
+ }
83
+ ```
84
+
85
+ And a plugin with an unsatisfiable dependency, `needs-timer.ts`:
86
+
87
+ ```ts
88
+ import type { Context } from '@deepseek-ai/cordis'
89
+
90
+ export const name = 'needs-timer'
91
+ export const inject = ['timer']
92
+
93
+ export function apply(ctx: Context) {
94
+ console.log('needs-timer loaded')
95
+ }
96
+ ```
97
+
98
+ ```yaml
99
+ - name: './needs-timer.ts'
100
+ - name: './diagnose.ts'
101
+ ```
102
+
103
+ Run it (plain `node --import tsx ../../vendor/cordis/bin.js`; stop with Ctrl-C):
104
+
105
+ ```
106
+ needs-timer is PENDING — a required service is missing
107
+ ```
108
+
109
+ `inject: ['timer']` has no provider. Add `- name: '@deepseek-ai/cordis-plugin-timer'` to the list and the plugin loads. When a plugin does nothing and reports nothing, inspect its fiber state. Iterating without the PENDING filter also shows the loader's own plugins (Loader, Include) as ACTIVE fibers because plugins mount the config file itself.
110
+
111
+ Next: [Into the harness](07-into-the-harness.md) — the same patterns against real harness services.
112
+
113
+ [![](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,113 @@
1
+ # 6. 组合与 HMR(热模块替换)
2
+
3
+ [English](06-composition-and-hmr.md) | 中文
4
+
5
+ 到目前为止构建的每项能力都是插件,`cordis.yml` 则选择应用的插件树。本章会改变这种组合、热重载一个插件,并诊断始终无法加载的插件。
6
+
7
+ ## Cordis 配置项不只有名称
8
+
9
+ Cordis 配置项除了 `name` 和 `config`,还接受其他元数据:
10
+
11
+ ```yaml
12
+ - id: greeter # stable identity for this entry
13
+ name: './greeter.ts'
14
+ - id: consumer
15
+ name: './consumer.ts'
16
+ disabled: true # keep the entry, skip mounting it
17
+ ```
18
+
19
+ `id` 为 Cordis 配置项提供稳定标识,使 loader 能区分修改现有 Cordis 配置项与先删除再添加。`disabled: true` 会卸载插件而不删除其 Cordis 配置项;改回原值后,插件以及所有因依赖其服务而处于 PENDING 的插件都会再次加载。
20
+
21
+ 组可以嵌套一份 Cordis 配置项子列表,并将其作为一个单元加载和卸载;`isolate` 则为一个组提供某项服务名称的独立实例,因此两个组可以各自看到配置不同的 `shell` 提供方,互不影响。[Cordis 入门](../cordis-primer.zh.md)和[服务隔离示例](../user/develop/framework/service.zh.md#service-isolation)介绍了详细内容。
22
+
23
+ ## 热模块替换
24
+
25
+ 卸载会释放 effect([第 2 章](02-lifecycle-and-effects.zh.md)),加载则遵循依赖关系([第 3 章](03-services.zh.md)),因此 HMR 可以先卸载、再加载,以替换正在运行的插件。`@deepseek-ai/cordis-plugin-hmr` 插件会监视文件,并在保存时执行这一过程。
26
+
27
+ 在 `tmp/cordis-tutorial` 中编写 `cordis.yml`:
28
+
29
+ ```yaml
30
+ - id: logger
31
+ name: '@deepseek-ai/cordis-plugin-logger-console'
32
+ - id: timer
33
+ name: '@deepseek-ai/cordis-plugin-timer'
34
+ - id: hmr
35
+ name: '@deepseek-ai/cordis-plugin-hmr'
36
+ config:
37
+ root: ['.']
38
+ - id: hello
39
+ name: './hello.ts'
40
+ ```
41
+
42
+ 列表中增加了两个辅助插件:HMR 通过 Cordis logger 服务记录日志,因此没有控制台导出器时看不到其消息;它还会 `inject` `timer` 服务来实现去抖,如果没有 `@deepseek-ai/cordis-plugin-timer`,它就会永远停在 PENDING,而且不发出任何提示。下一节就讨论这种静默状态。
43
+
44
+ HMR 通过 Loader 的原生辅助工具读取 Node 的 loader 内部结构。请在 tsx 下运行 Cordis:
45
+
46
+ ```sh
47
+ node --import tsx ../../vendor/cordis/bin.js
48
+ ```
49
+
50
+ 现在编辑 `hello.ts`,修改日志消息并保存:
51
+
52
+ ```
53
+ hello from my first plugin
54
+ 2026-07-22 15:44:36 [I] hmr watching [ '.' ]
55
+ 2026-07-22 15:44:39 [I] hmr reload plugin at hello.ts
56
+ hello from my EDITED plugin
57
+ ```
58
+
59
+ 旧实例先卸载(其所有 effect 都会回卷),新代码随后加载,`apply` 再次运行。按 Ctrl-C 停止进程。编辑 `cordis.yml` 本身也会触发更新:loader 按 `id` 比较 Cordis 配置项,只挂载、卸载或重新配置发生变化的部分。这就是上述 Cordis 配置项显式携带 `id` 的原因:不带该字段的 Cordis 配置项在每次读取时都会获得一个新生成的 id,所以只要配置文件发生任何编辑,即使自身文本未变,它也会被视为先删除再添加并重新挂载。
60
+
61
+ ## 诊断始终无法加载的插件
62
+
63
+ 依赖驱动加载也有另一面:如果插件的 `inject` 指定了无人提供的服务,它就会一直等待,不输出任何内容。这不是错误,因为 PENDING 是合法状态,提供方可能稍后才挂载。
64
+
65
+ 你可以直接查看这些状态。每个上下文都能枚举插件注册表;创建 `diagnose.ts`:
66
+
67
+ ```ts
68
+ import { FiberState, type Context } from '@deepseek-ai/cordis'
69
+
70
+ export const name = 'diagnose'
71
+
72
+ export function apply(ctx: Context) {
73
+ setTimeout(() => {
74
+ for (const runtime of ctx.registry.values()) {
75
+ for (const fiber of runtime.fibers) {
76
+ if (fiber.state === FiberState.PENDING) {
77
+ console.log(`${fiber.name} is PENDING — a required service is missing`)
78
+ }
79
+ }
80
+ }
81
+ }, 500)
82
+ }
83
+ ```
84
+
85
+ 再创建一个依赖无法满足的插件 `needs-timer.ts`:
86
+
87
+ ```ts
88
+ import type { Context } from '@deepseek-ai/cordis'
89
+
90
+ export const name = 'needs-timer'
91
+ export const inject = ['timer']
92
+
93
+ export function apply(ctx: Context) {
94
+ console.log('needs-timer loaded')
95
+ }
96
+ ```
97
+
98
+ ```yaml
99
+ - name: './needs-timer.ts'
100
+ - name: './diagnose.ts'
101
+ ```
102
+
103
+ 运行它(直接执行 `node --import tsx ../../vendor/cordis/bin.js`,按 Ctrl-C 停止):
104
+
105
+ ```
106
+ needs-timer is PENDING — a required service is missing
107
+ ```
108
+
109
+ `inject: ['timer']` 没有提供方。向列表添加 `- name: '@deepseek-ai/cordis-plugin-timer'` 后,插件就会加载。如果插件既不执行任何操作,也不报告任何内容,请检查其 fiber 状态。不加 PENDING 过滤条件进行迭代时,还会看到 loader 自身的插件(Loader、Include)处于 ACTIVE,因为配置文件本身也是通过插件挂载的。
110
+
111
+ 下一章:[进入 harness](07-into-the-harness.zh.md):把相同模式用于真实的 harness 服务。
112
+
113
+ [![](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,108 @@
1
+ # 7. Into the harness
2
+
3
+ English | [中文](07-into-the-harness.zh.md)
4
+
5
+ This chapter registers a model-callable tool with the harness's `tools` service, executes it through the harness tool pipeline, and observes the result event. It remains keyless and does not call a model.
6
+
7
+ ## A tool plugin
8
+
9
+ Create `greet-tool.ts` in `tmp/cordis-tutorial`:
10
+
11
+ ```ts
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+ import { brandString } from '@deepseek-ai/dsh-brand'
14
+ import { defineTool } from '@deepseek-ai/dsh-tools'
15
+ import type { ToolCallId } from '@deepseek-ai/dsh-llm'
16
+
17
+ export const name = 'greet-tool'
18
+ export const inject = ['tools']
19
+
20
+ export function apply(ctx: Context) {
21
+ ctx.tools.register(defineTool({
22
+ name: 'greet',
23
+ description: 'Greet the named person.',
24
+ parameters: {
25
+ name: { type: 'string', required: true, description: 'Who to greet' },
26
+ },
27
+ output: {
28
+ schema: { type: 'string' },
29
+ render: (_args, value) => [{ type: 'text', text: value }],
30
+ },
31
+ async execute(args) {
32
+ return `Hello, ${args.name}!`
33
+ },
34
+ }))
35
+
36
+ // Drive one call through the real execution pipeline, standing in for
37
+ // the model. ToolCallId brands the correlation id a provider would issue.
38
+ void (async () => {
39
+ const result = await ctx.tools.execute({
40
+ callId: brandString<ToolCallId>('demo-1'),
41
+ name: 'greet',
42
+ arguments: { name: 'Cordis' },
43
+ signal: new AbortController().signal,
44
+ })
45
+ console.log('tool replied:', JSON.stringify(result.content))
46
+ })()
47
+ }
48
+ ```
49
+
50
+ Every pattern here is from the earlier chapters: `inject: ['tools']` ([chapter 3](03-services.md)) holds the plugin until the tool registry exists; `ctx.tools.register(...)` attaches the registration disposer to the plugin ([chapter 2](02-lifecycle-and-effects.md)), so unloading unregisters the tool. `defineTool` converts the `parameters` spec to the JSON Schema shown to the model, infers the type of `args`, and validates model-supplied arguments before `execute` runs. The tool returns the canonical value declared by `output.schema`; `output.render` separately produces the Native and durable result content.
51
+
52
+ ## An observer plugin
53
+
54
+ Create `tool-logger.ts` — a separate plugin that watches every tool call in the app through the harness's `tools/result` event:
55
+
56
+ ```ts
57
+ import type { Context } from '@deepseek-ai/cordis'
58
+ import type {} from '@deepseek-ai/dsh-tools'
59
+
60
+ export const name = 'tool-logger'
61
+ export const inject = ['tools']
62
+
63
+ export function apply(ctx: Context) {
64
+ ctx.on('tools/result', (exec, result) => {
65
+ const text = result.content
66
+ .map(block => (block.type === 'text' ? block.text : ''))
67
+ .join('')
68
+ console.log(`[tool-logger] ${exec.name} -> ${text}`)
69
+ })
70
+ }
71
+ ```
72
+
73
+ The `import type {} from '@deepseek-ai/dsh-tools'` line pulls in the package's declaration merges so `'tools/result'` and its payload are typed — the same move as chapter 4's `stats.ts` import, at package scale.
74
+
75
+ ## Compose and run
76
+
77
+ ```yaml
78
+ - name: '@deepseek-ai/dsh-system-prompt'
79
+ - name: '@deepseek-ai/dsh-tools'
80
+ - name: './tool-logger.ts'
81
+ - name: './greet-tool.ts'
82
+ ```
83
+
84
+ `@deepseek-ai/dsh-tools` injects the `systemPrompt` service because tools contribute schemas to the system prompt, so the composition lists its provider too. Without it, the tools plugin remains PENDING as described in [chapter 6](06-composition-and-hmr.md).
85
+
86
+ ```sh
87
+ node --import tsx ../../vendor/cordis/bin.js
88
+ ```
89
+
90
+ ```
91
+ [tool-logger] greet -> Hello, Cordis!
92
+ tool replied: [{"type":"text","text":"Hello, Cordis!"}]
93
+ ```
94
+
95
+ The logger fired first: `tools/result` is emitted as part of result materialization, before `execute`'s promise resolves to the caller. Neither of your plugins knows the other exists — the registry service and the event connect them.
96
+
97
+ ## From here to a full agent
98
+
99
+ A real agent is this composition plus more plugins: an LLM adapter, the agent loop, persistence, and an application entry. Compare the [base profile layer](../../packages/bundle/base/cordis.patch.yml) and [headless layer](../../packages/bundle/headless/cordis.patch.yml) — you can read their entries now. Add your `greet-tool.ts` through a small `--patch` overlay.
100
+
101
+ Where to go next:
102
+
103
+ - [Build a tool](../user/develop/basic/tool.md) — more of `defineTool`, including presentation and richer schemas.
104
+ - [Three-layer capability design](../user/develop/practice/index.md) — how the harness structures replaceable capabilities.
105
+ - The generated `cordis-surface` regions on the [subsystem pages](../subsystems/core.md) — everything you can inject and listen to, each on its owning page.
106
+ - [Architecture](../architecture.md) — the system map these plugins live in.
107
+
108
+ [![](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,108 @@
1
+ # 7. 进入 harness
2
+
3
+ [English](07-into-the-harness.md) | 中文
4
+
5
+ 本章会向 harness 的 `tools` 服务注册一个可由模型调用的工具,通过 harness 工具流水线执行它,并观察结果事件。整个示例无需密钥,也不会调用模型。
6
+
7
+ ## 工具插件
8
+
9
+ 创建 `greet-tool.ts`,将它放在 `tmp/cordis-tutorial` 中:
10
+
11
+ ```ts
12
+ import type { Context } from '@deepseek-ai/cordis'
13
+ import { brandString } from '@deepseek-ai/dsh-brand'
14
+ import { defineTool } from '@deepseek-ai/dsh-tools'
15
+ import type { ToolCallId } from '@deepseek-ai/dsh-llm'
16
+
17
+ export const name = 'greet-tool'
18
+ export const inject = ['tools']
19
+
20
+ export function apply(ctx: Context) {
21
+ ctx.tools.register(defineTool({
22
+ name: 'greet',
23
+ description: 'Greet the named person.',
24
+ parameters: {
25
+ name: { type: 'string', required: true, description: 'Who to greet' },
26
+ },
27
+ output: {
28
+ schema: { type: 'string' },
29
+ render: (_args, value) => [{ type: 'text', text: value }],
30
+ },
31
+ async execute(args) {
32
+ return `Hello, ${args.name}!`
33
+ },
34
+ }))
35
+
36
+ // Drive one call through the real execution pipeline, standing in for
37
+ // the model. ToolCallId brands the correlation id a provider would issue.
38
+ void (async () => {
39
+ const result = await ctx.tools.execute({
40
+ callId: brandString<ToolCallId>('demo-1'),
41
+ name: 'greet',
42
+ arguments: { name: 'Cordis' },
43
+ signal: new AbortController().signal,
44
+ })
45
+ console.log('tool replied:', JSON.stringify(result.content))
46
+ })()
47
+ }
48
+ ```
49
+
50
+ 这里的每个模式都来自前几章:`inject: ['tools']`([第 3 章](03-services.zh.md))会让插件等待工具注册表就绪;`ctx.tools.register(...)` 会把注册 disposer 附着到插件([第 2 章](02-lifecycle-and-effects.zh.md)),因此卸载时会注销工具。`defineTool` 将 `parameters` 规约转换为向模型展示的 JSON Schema,推导 `args` 的类型,并在 `execute` 运行前校验模型提供的参数。工具返回由 `output.schema` 声明的规范值;`output.render` 则作为 Native renderer(原生渲染器),另行生成可持久化的结果内容。
51
+
52
+ ## 观察插件
53
+
54
+ 创建 `tool-logger.ts`。这是一个独立插件,通过 harness 的 `tools/result` 事件观察应用中的每次工具调用:
55
+
56
+ ```ts
57
+ import type { Context } from '@deepseek-ai/cordis'
58
+ import type {} from '@deepseek-ai/dsh-tools'
59
+
60
+ export const name = 'tool-logger'
61
+ export const inject = ['tools']
62
+
63
+ export function apply(ctx: Context) {
64
+ ctx.on('tools/result', (exec, result) => {
65
+ const text = result.content
66
+ .map(block => (block.type === 'text' ? block.text : ''))
67
+ .join('')
68
+ console.log(`[tool-logger] ${exec.name} -> ${text}`)
69
+ })
70
+ }
71
+ ```
72
+
73
+ `import type {} from '@deepseek-ai/dsh-tools'` 行会引入该包的声明合并,使 `'tools/result'` 及其 payload 具有类型。这与第 4 章导入 `stats.ts` 的做法相同,只是扩展到了包级别。
74
+
75
+ ## 组合并运行
76
+
77
+ ```yaml
78
+ - name: '@deepseek-ai/dsh-system-prompt'
79
+ - name: '@deepseek-ai/dsh-tools'
80
+ - name: './tool-logger.ts'
81
+ - name: './greet-tool.ts'
82
+ ```
83
+
84
+ `@deepseek-ai/dsh-tools` 会注入 `systemPrompt` 服务,因为工具需要向系统提示词贡献 schema,所以组合中也要列出该服务的提供方。缺少提供方时,工具插件会像[第 6 章](06-composition-and-hmr.zh.md)所述那样保持 PENDING。
85
+
86
+ ```sh
87
+ node --import tsx ../../vendor/cordis/bin.js
88
+ ```
89
+
90
+ ```
91
+ [tool-logger] greet -> Hello, Cordis!
92
+ tool replied: [{"type":"text","text":"Hello, Cordis!"}]
93
+ ```
94
+
95
+ logger 会先触发:`tools/result` 在结果物化过程中发出,发生在 `execute` 向调用方返回的 promise 兑现之前。两个插件都不知道另一个插件存在,它们由注册表服务和事件连接。
96
+
97
+ ## 从这里走向完整 agent(智能体)
98
+
99
+ 真实 agent 就是这套组合再加上更多插件:LLM(大语言模型)适配器、agent loop(智能体循环)、持久化和应用入口。对照 [base profile 层](../../packages/bundle/base/cordis.patch.yml)与 [headless 层](../../packages/bundle/headless/cordis.patch.yml),你现在已经可以读懂其中各项。通过一个小型 `--patch` overlay 加入 `greet-tool.ts` 即可。
100
+
101
+ 后续可以阅读:
102
+
103
+ - [构建工具](../user/develop/basic/tool.zh.md):深入了解 `defineTool`,包括呈现和更丰富的 schema。
104
+ - [三层能力设计](../user/develop/practice/index.zh.md):harness 如何组织可替换能力。
105
+ - [子系统页面](../subsystems/core.zh.md)上生成的 `cordis-surface` 区块:可以注入和监听的所有内容,各在其所属页面上。
106
+ - [架构](../architecture.zh.md):这些插件所处的系统地图。
107
+
108
+ [![](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,60 @@
1
+ # Cordis tutorial
2
+
3
+ English | [中文](index.zh.md)
4
+
5
+ Cordis is the plugin framework underneath DeepSeek Harness: a small runtime where every capability — tools, LLM adapters, file access, the agent loop itself — is a plugin mounted into a shared context. This tutorial teaches Cordis hands-on: each chapter is a runnable example you build in a scratch directory inside this repository, ending with a plugin wired into real harness services.
6
+
7
+ The audience is agent developers. You do not need deep TypeScript experience; the [TypeScript notes](#typescript-notes) below explain the syntax that may be unfamiliar, and every chapter shows the exact commands and expected output.
8
+
9
+ If you want the condensed concept reference instead of a walkthrough, read the [Cordis primer](../cordis-primer.md). The exhaustive API reference lives in the generated `cordis-surface` regions on the [subsystem pages](../subsystems/core.md) and the [Cordis core API](../cordis-api/context.md) pages.
10
+
11
+ To write plugins for the harness itself — loaded from a `cordis.yml` and driven from the Web UI rather than the launcher below — start from [your first Harness plugin](../user/develop/basic/index.md).
12
+
13
+ ## Setup
14
+
15
+ You need a clone of this repository with dependencies installed; the [development guide](../development.md#setup-tutorial) lists the prerequisites. No API key is needed for this tutorial; every example runs keylessly.
16
+
17
+ ```sh
18
+ git clone https://github.com/deepseek-ai/deepseek-harness.git
19
+ cd deepseek-harness
20
+ pnpm install
21
+ ```
22
+
23
+ Create the scratch directory the chapters work in. `tmp/` is gitignored, so nothing you write there touches version control:
24
+
25
+ ```sh
26
+ mkdir -p tmp/cordis-tutorial
27
+ cd tmp/cordis-tutorial
28
+ ```
29
+
30
+ Every chapter runs the same command from this directory:
31
+
32
+ ```sh
33
+ node --import tsx ../../vendor/cordis/bin.js
34
+ ```
35
+
36
+ That one-file launcher (see [vendor/cordis/bin.js](../../vendor/cordis/bin.js)) creates a root `Context`, mounts the Loader plugin, and tells it to load `./cordis.yml` from the current directory. Everything else — which plugins exist, how they are configured — comes from that YAML file, which you will write in a moment. The `--import tsx` flag lets Node run the TypeScript files the config points at without a build step.
37
+
38
+ ## Chapters
39
+
40
+ 1. [Your first plugin](01-first-plugin.md) — a plugin is a function; the loader mounts it.
41
+ 2. [Lifecycle and effects](02-lifecycle-and-effects.md) — Cordis-managed registrations are undone when their plugin unloads.
42
+ 3. [Services](03-services.md) — expose a capability on `ctx` and depend on it with `inject`.
43
+ 4. [Events](04-events.md) — typed events, broadcast dispatch, and the waterfall short-circuit.
44
+ 5. [Configuration](05-config.md) — validated config from `cordis.yml`, failing loud on bad input.
45
+ 6. [Composition and HMR](06-composition-and-hmr.md) — the config file as a plugin tree, hot reload, and diagnosing a plugin that never loads.
46
+ 7. [Into the harness](07-into-the-harness.md) — register a model-callable tool against real harness services.
47
+
48
+ <a id="typescript-notes"></a>
49
+
50
+ ## TypeScript notes
51
+
52
+ The examples use three TypeScript features beyond ordinary modern JavaScript:
53
+
54
+ - **Type annotations** describe values without changing runtime behavior: `ctx: Context` says that `ctx` has the Cordis context API, `who: string` accepts text, and `string[]` means an array of strings.
55
+ - **`import type { Context } from '@deepseek-ai/cordis'`** imports only type information. It vanishes at runtime, so a plugin file that needs `Context` solely for annotations adds no runtime dependency.
56
+ - **Declaration merging** (`declare module '@deepseek-ai/cordis' { ... }`) adds your entries to interfaces that Cordis already declares — for example the type of a new `ctx.greeter` property or event name. It generates no runtime wiring; the plugin separately provides the service or emits the event. Chapter 3 shows the pattern in full.
57
+
58
+ Chapter 5 also uses an `interface` to describe a configuration object's fields and a generic type such as `Schema<Config>` to say which object fields a schema validates. You can copy those declarations as shown; the surrounding text explains what each one connects.
59
+
60
+ [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)