dsh-plugin-dev-kb 1.3.0 → 1.4.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 (364) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.en.md +4 -4
  3. package/README.md +5 -5
  4. package/kb/INDEX.md +18 -18
  5. package/kb/README.md +6 -4
  6. package/kb/extra/AGENTS.md +11 -10
  7. package/kb/extra/cookbook/adding-a-remote-api.md +2 -2
  8. package/kb/extra/cookbook/adding-a-remote-api.zh.md +2 -2
  9. package/kb/extra/cookbook/adding-a-session-format-version.md +48 -6
  10. package/kb/extra/cookbook/adding-a-session-format-version.zh.md +48 -6
  11. package/kb/extra/cookbook/reviewing-persistence-type-changes.md +120 -0
  12. package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +120 -0
  13. package/kb/extra/deepseek-llm-api-wire-extensions.md +18 -19
  14. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +17 -18
  15. package/kb/extra/development.md +27 -10
  16. package/kb/extra/development.zh.md +27 -10
  17. package/kb/extra/event-producer-consumer.md +89 -68
  18. package/kb/extra/event-producer-consumer.zh.md +90 -69
  19. package/kb/extra/glossary.md +1 -1
  20. package/kb/extra/glossary.zh.md +1 -1
  21. package/kb/extra/i18n/README.md +15 -7
  22. package/kb/extra/i18n/README.zh.md +15 -7
  23. package/kb/extra/i18n/terminology.md +4 -4
  24. package/kb/extra/i18n/translation-prompt.md +2 -2
  25. package/kb/extra/module-graph.md +574 -326
  26. package/kb/extra/module-graph.zh.md +574 -326
  27. package/kb/extra/persistence-changes/2026-09-11-initial.md +280 -0
  28. package/kb/extra/persistence-changes/2026-09-11-initial.zh.md +280 -0
  29. package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
  30. package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
  31. package/kb/extra/persistence-changes/2026-09-14-image-offload.md +96 -0
  32. package/kb/extra/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
  33. package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
  34. package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
  35. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +120 -0
  36. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +120 -0
  37. package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.md +48 -0
  38. package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.zh.md +48 -0
  39. package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.md +48 -0
  40. package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.zh.md +48 -0
  41. package/kb/extra/persistence-changes/2026-09-21-user-question-reply.md +60 -0
  42. package/kb/extra/persistence-changes/2026-09-21-user-question-reply.zh.md +60 -0
  43. package/kb/extra/persistence-changes/README.md +88 -0
  44. package/kb/extra/persistence-changes/README.zh.md +88 -0
  45. package/kb/extra/persistence-changes/historical-formats/README.md +75 -0
  46. package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -0
  47. package/kb/extra/persistence-changes/historical-formats/v0.md +5105 -0
  48. package/kb/extra/persistence-changes/historical-formats/v0.zh.md +5105 -0
  49. package/kb/extra/persistence-changes/historical-formats/v1.md +5107 -0
  50. package/kb/extra/persistence-changes/historical-formats/v1.zh.md +5107 -0
  51. package/kb/extra/persistence-changes/historical-formats/v2.md +5362 -0
  52. package/kb/extra/persistence-changes/historical-formats/v2.zh.md +5362 -0
  53. package/kb/extra/persistence-changes/historical-formats/v3.md +5634 -0
  54. package/kb/extra/persistence-changes/historical-formats/v3.zh.md +5634 -0
  55. package/kb/extra/persistence-changes/releases/README.md +103 -0
  56. package/kb/extra/persistence-changes/releases/README.zh.md +103 -0
  57. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
  58. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
  59. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
  60. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
  61. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
  62. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
  63. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
  64. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
  65. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
  66. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
  67. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
  68. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
  69. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
  70. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
  71. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
  72. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
  73. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
  74. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
  75. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
  76. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
  77. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
  78. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
  79. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
  80. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
  81. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
  82. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
  83. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
  84. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
  85. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
  86. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
  87. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
  88. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
  89. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
  90. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
  91. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
  92. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
  93. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
  94. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
  95. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
  96. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
  97. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
  98. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
  99. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
  100. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
  101. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
  102. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
  103. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
  104. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
  105. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
  106. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
  107. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
  108. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
  109. package/kb/extra/rescope.md +1 -1
  110. package/kb/extra/rescope.zh.md +1 -1
  111. package/kb/extra/session-format-status.md +22 -6
  112. package/kb/extra/session-format-status.zh.md +22 -6
  113. package/kb/extra/subsystems/agent-team.md +52 -28
  114. package/kb/extra/subsystems/agent-team.zh.md +52 -28
  115. package/kb/extra/subsystems/attachment.md +19 -9
  116. package/kb/extra/subsystems/attachment.zh.md +19 -9
  117. package/kb/extra/subsystems/boot.md +323 -0
  118. package/kb/extra/subsystems/boot.zh.md +323 -0
  119. package/kb/extra/subsystems/browser-use.md +67 -0
  120. package/kb/extra/subsystems/browser-use.zh.md +67 -0
  121. package/kb/extra/subsystems/claude-code-mods.md +146 -0
  122. package/kb/extra/subsystems/claude-code-mods.zh.md +146 -0
  123. package/kb/extra/subsystems/computer-use.md +56 -0
  124. package/kb/extra/subsystems/computer-use.zh.md +56 -0
  125. package/kb/extra/subsystems/deliverables.md +178 -0
  126. package/kb/extra/subsystems/deliverables.zh.md +178 -0
  127. package/kb/extra/subsystems/extensions.md +6 -4
  128. package/kb/extra/subsystems/extensions.zh.md +6 -4
  129. package/kb/extra/subsystems/feedback.md +4 -4
  130. package/kb/extra/subsystems/feedback.zh.md +4 -4
  131. package/kb/extra/subsystems/mcp.md +139 -0
  132. package/kb/extra/subsystems/mcp.zh.md +139 -0
  133. package/kb/extra/subsystems/office-to-pdf.md +87 -0
  134. package/kb/extra/subsystems/office-to-pdf.zh.md +87 -0
  135. package/kb/extra/subsystems/otel.md +44 -0
  136. package/kb/extra/subsystems/otel.zh.md +44 -0
  137. package/kb/extra/subsystems/product-telemetry.md +79 -0
  138. package/kb/extra/subsystems/product-telemetry.zh.md +79 -0
  139. package/kb/extra/subsystems/ssh.md +135 -0
  140. package/kb/extra/subsystems/ssh.zh.md +135 -0
  141. package/kb/extra/subsystems/todo.md +3 -3
  142. package/kb/extra/subsystems/todo.zh.md +3 -3
  143. package/kb/extra/subsystems/voice-input.md +164 -0
  144. package/kb/extra/subsystems/voice-input.zh.md +164 -0
  145. package/kb/extra/subsystems/webhook.md +3 -3
  146. package/kb/extra/subsystems/webhook.zh.md +1 -1
  147. package/kb/extra/testing.md +3 -3
  148. package/kb/extra/testing.zh.md +3 -3
  149. package/kb/extra/ui-radius.md +115 -0
  150. package/kb/extra/ui-radius.zh.md +115 -0
  151. package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.md +22 -0
  152. package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.zh.md +22 -0
  153. package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.md +25 -0
  154. package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.zh.md +25 -0
  155. package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.md +18 -0
  156. package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.zh.md +18 -0
  157. package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.md +23 -0
  158. package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.zh.md +23 -0
  159. package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +22 -0
  160. package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md +22 -0
  161. package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.md +27 -0
  162. package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.zh.md +27 -0
  163. package/kb/extra/web-styling.md +12 -3
  164. package/kb/extra/web-styling.zh.md +12 -3
  165. package/kb/meta/search-index.json +976 -256
  166. package/kb/meta/site-pages.txt +188 -188
  167. package/kb/meta/source.json +6 -6
  168. package/kb/meta/topics.md +10 -6
  169. package/kb/site/develop/basic/config.md +1 -0
  170. package/kb/site/develop/basic/index.md +1 -0
  171. package/kb/site/develop/basic/publish.md +9 -2
  172. package/kb/site/develop/basic/tool.md +1 -0
  173. package/kb/site/develop/cordis-tutorial/01-first-plugin.md +1 -0
  174. package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
  175. package/kb/site/develop/cordis-tutorial/03-services.md +1 -0
  176. package/kb/site/develop/cordis-tutorial/04-events.md +1 -0
  177. package/kb/site/develop/cordis-tutorial/05-config.md +28 -0
  178. package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
  179. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +1 -0
  180. package/kb/site/develop/cordis-tutorial/index.md +1 -0
  181. package/kb/site/develop/framework/events.md +1 -0
  182. package/kb/site/develop/framework/index.md +2 -1
  183. package/kb/site/develop/framework/service.md +1 -0
  184. package/kb/site/develop/practice/dynamic-cordis.md +9 -8
  185. package/kb/site/develop/practice/index.md +1 -0
  186. package/kb/site/develop/practice/llm-adapter.md +2 -1
  187. package/kb/site/en/develop/basic/config.md +1 -0
  188. package/kb/site/en/develop/basic/index.md +1 -0
  189. package/kb/site/en/develop/basic/publish.md +9 -2
  190. package/kb/site/en/develop/basic/tool.md +1 -0
  191. package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +1 -0
  192. package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
  193. package/kb/site/en/develop/cordis-tutorial/03-services.md +1 -0
  194. package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -0
  195. package/kb/site/en/develop/cordis-tutorial/05-config.md +28 -0
  196. package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
  197. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +1 -0
  198. package/kb/site/en/develop/cordis-tutorial/index.md +1 -0
  199. package/kb/site/en/develop/framework/events.md +1 -0
  200. package/kb/site/en/develop/framework/index.md +2 -1
  201. package/kb/site/en/develop/framework/service.md +1 -0
  202. package/kb/site/en/develop/practice/dynamic-cordis.md +9 -8
  203. package/kb/site/en/develop/practice/index.md +1 -0
  204. package/kb/site/en/develop/practice/llm-adapter.md +2 -1
  205. package/kb/site/en/guide/github-review.md +1 -0
  206. package/kb/site/en/guide/mcp-memory.md +1 -0
  207. package/kb/site/en/guide/network-proxy.md +2 -1
  208. package/kb/site/en/guide/providers-custom-form.png +0 -0
  209. package/kb/site/en/guide/providers-models-page.png +0 -0
  210. package/kb/site/en/guide/providers.md +97 -82
  211. package/kb/site/en/guide/public-deployments.md +36 -0
  212. package/kb/site/en/guide/python-sdk.md +42 -21
  213. package/kb/site/en/guide/quickstart.md +2 -0
  214. package/kb/site/en/guide/schedule.md +70 -11
  215. package/kb/site/en/reference/agent-lifecycle.md +1 -0
  216. package/kb/site/en/reference/api-gateway.md +13 -11
  217. package/kb/site/en/reference/capability-seams.md +177 -59
  218. package/kb/site/en/reference/config-catalog.md +1758 -821
  219. package/kb/site/en/reference/cookbook/adding-a-package.md +57 -3
  220. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +35 -64
  221. package/kb/site/en/reference/cookbook/adding-a-tool.md +4 -3
  222. package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +1 -0
  223. package/kb/site/en/reference/cookbook/extension-cookbook.md +6 -5
  224. package/kb/site/en/reference/cordis-api/context.md +1 -0
  225. package/kb/site/en/reference/cordis-api/events.md +1 -0
  226. package/kb/site/en/reference/cordis-api/fiber.md +4 -3
  227. package/kb/site/en/reference/cordis-api/inherited.md +16 -16
  228. package/kb/site/en/reference/cordis-api/registry.md +1 -0
  229. package/kb/site/en/reference/cordis-api/service.md +1 -0
  230. package/kb/site/en/reference/cordis-primer.md +1 -0
  231. package/kb/site/en/reference/index.md +18 -11
  232. package/kb/site/en/reference/persistence-catalog.md +7687 -54
  233. package/kb/site/en/reference/subsystems/approval.md +2 -1
  234. package/kb/site/en/reference/subsystems/client-modules.md +23 -15
  235. package/kb/site/en/reference/subsystems/client-resources.md +3 -1
  236. package/kb/site/en/reference/subsystems/commands.md +6 -1
  237. package/kb/site/en/reference/subsystems/compaction.md +50 -3
  238. package/kb/site/en/reference/subsystems/conversation.md +36 -6
  239. package/kb/site/en/reference/subsystems/core.md +97 -257
  240. package/kb/site/en/reference/subsystems/credentials.md +169 -5
  241. package/kb/site/en/reference/subsystems/filesystem.md +11 -0
  242. package/kb/site/en/reference/subsystems/goal.md +2 -1
  243. package/kb/site/en/reference/subsystems/index.md +16 -5
  244. package/kb/site/en/reference/subsystems/jobs.md +337 -127
  245. package/kb/site/en/reference/subsystems/llm-streaming.md +76 -36
  246. package/kb/site/en/reference/subsystems/lsp.md +1 -0
  247. package/kb/site/en/reference/subsystems/permission-presets.md +66 -29
  248. package/kb/site/en/reference/subsystems/persistence.md +4 -3
  249. package/kb/site/en/reference/subsystems/plan.md +2 -1
  250. package/kb/site/en/reference/subsystems/ptc-runtime.md +236 -0
  251. package/kb/site/en/reference/subsystems/sandbox.md +7 -5
  252. package/kb/site/en/reference/subsystems/schedule.md +392 -33
  253. package/kb/site/en/reference/subsystems/scope.md +2 -1
  254. package/kb/site/en/reference/subsystems/session-projection.md +22 -19
  255. package/kb/site/en/reference/subsystems/session-query.md +1 -0
  256. package/kb/site/en/reference/subsystems/session-reference.md +8 -6
  257. package/kb/site/en/reference/subsystems/session-telemetry.md +7 -4
  258. package/kb/site/en/reference/subsystems/session-title.md +6 -5
  259. package/kb/site/en/reference/subsystems/session.md +199 -81
  260. package/kb/site/en/reference/subsystems/settings.md +43 -292
  261. package/kb/site/en/reference/subsystems/shell.md +37 -28
  262. package/kb/site/en/reference/subsystems/sidebar-right.md +23 -12
  263. package/kb/site/en/reference/subsystems/skills.md +5 -6
  264. package/kb/site/en/reference/subsystems/slots.md +34 -13
  265. package/kb/site/en/reference/subsystems/spill.md +4 -3
  266. package/kb/site/en/reference/subsystems/storage.md +2 -2
  267. package/kb/site/en/reference/subsystems/subagent.md +50 -64
  268. package/kb/site/en/reference/subsystems/subprocess.md +17 -18
  269. package/kb/site/en/reference/subsystems/system-prompt.md +4 -1
  270. package/kb/site/en/reference/subsystems/terminal.md +1 -0
  271. package/kb/site/en/reference/subsystems/token-meter.md +1 -0
  272. package/kb/site/en/reference/subsystems/tools.md +40 -12
  273. package/kb/site/en/reference/subsystems/typert.md +153 -10
  274. package/kb/site/en/reference/subsystems/user-questions.md +131 -1
  275. package/kb/site/en/reference/subsystems/web-client.md +15 -9
  276. package/kb/site/en/reference/subsystems/web-server.md +74 -1
  277. package/kb/site/en/reference/subsystems/web.md +1 -0
  278. package/kb/site/en/reference/subsystems/workflow.md +10 -9
  279. package/kb/site/en/reference/subsystems/workspace.md +294 -34
  280. package/kb/site/en/reference/tool-catalog.md +782 -331
  281. package/kb/site/en/reference/tool-execution-pipeline.md +7 -3
  282. package/kb/site/guide/github-review.md +1 -0
  283. package/kb/site/guide/mcp-memory.md +1 -0
  284. package/kb/site/guide/network-proxy.md +2 -1
  285. package/kb/site/guide/providers-custom-form.zh.png +0 -0
  286. package/kb/site/guide/providers-models-page.zh.png +0 -0
  287. package/kb/site/guide/providers.md +109 -94
  288. package/kb/site/guide/public-deployments.md +36 -0
  289. package/kb/site/guide/python-sdk.md +42 -21
  290. package/kb/site/guide/quickstart.md +2 -0
  291. package/kb/site/guide/schedule.md +70 -11
  292. package/kb/site/reference/agent-lifecycle.md +1 -0
  293. package/kb/site/reference/api-gateway.md +13 -11
  294. package/kb/site/reference/capability-seams.md +177 -59
  295. package/kb/site/reference/config-catalog.md +1760 -822
  296. package/kb/site/reference/cookbook/adding-a-package.md +55 -3
  297. package/kb/site/reference/cookbook/adding-a-settings-card.md +35 -64
  298. package/kb/site/reference/cookbook/adding-a-tool.md +4 -3
  299. package/kb/site/reference/cookbook/adding-an-llm-adapter.md +1 -0
  300. package/kb/site/reference/cookbook/extension-cookbook.md +6 -5
  301. package/kb/site/reference/cordis-api/context.md +1 -0
  302. package/kb/site/reference/cordis-api/events.md +1 -0
  303. package/kb/site/reference/cordis-api/fiber.md +4 -3
  304. package/kb/site/reference/cordis-api/inherited.md +16 -16
  305. package/kb/site/reference/cordis-api/registry.md +1 -0
  306. package/kb/site/reference/cordis-api/service.md +1 -0
  307. package/kb/site/reference/cordis-primer.md +1 -0
  308. package/kb/site/reference/index.md +18 -11
  309. package/kb/site/reference/persistence-catalog.md +7693 -60
  310. package/kb/site/reference/subsystems/approval.md +2 -1
  311. package/kb/site/reference/subsystems/client-modules.md +23 -15
  312. package/kb/site/reference/subsystems/client-resources.md +3 -1
  313. package/kb/site/reference/subsystems/commands.md +6 -1
  314. package/kb/site/reference/subsystems/compaction.md +50 -3
  315. package/kb/site/reference/subsystems/conversation.md +35 -5
  316. package/kb/site/reference/subsystems/core.md +97 -257
  317. package/kb/site/reference/subsystems/credentials.md +169 -5
  318. package/kb/site/reference/subsystems/filesystem.md +11 -0
  319. package/kb/site/reference/subsystems/goal.md +2 -1
  320. package/kb/site/reference/subsystems/index.md +16 -5
  321. package/kb/site/reference/subsystems/jobs.md +336 -126
  322. package/kb/site/reference/subsystems/llm-streaming.md +76 -36
  323. package/kb/site/reference/subsystems/lsp.md +1 -0
  324. package/kb/site/reference/subsystems/permission-presets.md +66 -29
  325. package/kb/site/reference/subsystems/persistence.md +4 -3
  326. package/kb/site/reference/subsystems/plan.md +2 -1
  327. package/kb/site/reference/subsystems/ptc-runtime.md +236 -0
  328. package/kb/site/reference/subsystems/sandbox.md +7 -5
  329. package/kb/site/reference/subsystems/schedule.md +392 -33
  330. package/kb/site/reference/subsystems/scope.md +2 -1
  331. package/kb/site/reference/subsystems/session-projection.md +22 -19
  332. package/kb/site/reference/subsystems/session-query.md +1 -0
  333. package/kb/site/reference/subsystems/session-reference.md +8 -6
  334. package/kb/site/reference/subsystems/session-telemetry.md +7 -4
  335. package/kb/site/reference/subsystems/session-title.md +6 -5
  336. package/kb/site/reference/subsystems/session.md +199 -81
  337. package/kb/site/reference/subsystems/settings.md +43 -292
  338. package/kb/site/reference/subsystems/shell.md +37 -28
  339. package/kb/site/reference/subsystems/sidebar-right.md +23 -12
  340. package/kb/site/reference/subsystems/skills.md +5 -6
  341. package/kb/site/reference/subsystems/slots.md +34 -13
  342. package/kb/site/reference/subsystems/spill.md +3 -2
  343. package/kb/site/reference/subsystems/storage.md +2 -2
  344. package/kb/site/reference/subsystems/subagent.md +49 -63
  345. package/kb/site/reference/subsystems/subprocess.md +17 -18
  346. package/kb/site/reference/subsystems/system-prompt.md +4 -1
  347. package/kb/site/reference/subsystems/terminal.md +1 -0
  348. package/kb/site/reference/subsystems/token-meter.md +1 -0
  349. package/kb/site/reference/subsystems/tools.md +40 -12
  350. package/kb/site/reference/subsystems/typert.md +153 -10
  351. package/kb/site/reference/subsystems/user-questions.md +132 -2
  352. package/kb/site/reference/subsystems/web-client.md +15 -9
  353. package/kb/site/reference/subsystems/web-server.md +74 -1
  354. package/kb/site/reference/subsystems/web.md +1 -0
  355. package/kb/site/reference/subsystems/workflow.md +10 -9
  356. package/kb/site/reference/subsystems/workspace.md +294 -34
  357. package/kb/site/reference/tool-catalog.md +784 -333
  358. package/kb/site/reference/tool-execution-pipeline.md +7 -3
  359. package/package.json +2 -2
  360. package/skills/dsh-plugin-dev-kb.md +5 -4
  361. package/kb/site/en/reference/subsystems/code-runtime.md +0 -198
  362. package/kb/site/en/reference/subsystems/invariants.md +0 -91
  363. package/kb/site/reference/subsystems/code-runtime.md +0 -198
  364. package/kb/site/reference/subsystems/invariants.md +0 -91
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  editSource: "docs/tool-execution-pipeline.zh.md"
3
+ rawMarkdownPath: "reference/tool-execution-pipeline.md"
3
4
  ---
4
5
 
5
6
  <!-- 英文源文件由 scripts/gen-doc-graphs.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
@@ -7,7 +8,7 @@ editSource: "docs/tool-execution-pipeline.zh.md"
7
8
 
8
9
  # 工具执行流水线
9
10
 
10
- 此图展示策略、钩子、沙箱、文件系统守卫、结果重写、最终结果观察和 UI 渲染在不改变循环的情况下何时运行。`tools/pre-execute` waterfall(瀑布式事件)首先运行,随后是单调守卫,然后运行 `tools/execute` 和 `tools/post-execute` waterfall;这三个 waterfall 可以改写一次调用。由定义自身控制的 `finalizeContent` 和 `tools/result` 在此之后运行。
11
+ 此图展示策略、钩子、沙箱、文件系统守卫、结果重写、最终结果观察和 UI 渲染在不改变循环的情况下何时运行。`tools/pre-execute` waterfall(瀑布式事件)首先运行,随后是单调守卫,然后运行 `tools/execute` 和 `tools/post-execute` waterfall;这三个 waterfall 可以改写一次调用。由定义自身控制的 `projectContent` 在执行后策略之前安装已准备内容;`finalizeContent` 和 `tools/result` 在此之后运行。
11
12
 
12
13
  ```mermaid
13
14
  flowchart TD
@@ -22,6 +23,7 @@ flowchart TD
22
23
  toolBody["Registered tool execute() body"]
23
24
  fsGate["<code>fs/write-intent</code> or <code>fs/edit-intent</code><br/>tool-fs mutations only"]
24
25
  owned["Tool-owned session events<br/><code>todo/write</code>, <code>fs/observed</code>, <code>hook/invoked</code>, <code>hook/result</code>, <code>tool/ptc-dispatch</code>"]
26
+ project["ToolDefinition.projectContent<br/>execution-prepared text and images"]
25
27
  post["<code>tools/post-execute</code> waterfall<br/>accept, block, replace, add context"]
26
28
  normalized["Registry outer normalization<br/>pipeline/result snapshot throws become isError"]
27
29
  finalize["ToolDefinition.finalizeContent<br/>last content-only invariant"]
@@ -43,13 +45,15 @@ flowchart TD
43
45
  approval -->|allowed-once| guards
44
46
  approval -->|rejected, cancelled, unavailable| denied
45
47
  approval -.->|throw| normalized
46
- denied --> post
48
+ denied --> project
47
49
  pre -.->|throw| normalized
48
50
  toolBody --> fsGate
49
51
  fsGate --> toolBody
50
52
  toolBody --> owned
51
53
  toolBody --> around
52
- around --> post
54
+ around --> project
55
+ project --> post
56
+ project -.->|throw| normalized
53
57
  around -.->|wrapper throws| normalized
54
58
  post -.->|throw| normalized
55
59
  post --> finalize
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-plugin-dev-kb",
3
- "description": "dsh 插件开发知识库:DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 188 页)+ 62 篇仓库补充开发参考 + 主题导航与 253 文件全量搜索索引;以 dsh-plugin-dev-kb 技能让 agent 在插件开发任务中自动加载定位文档。纯数据插件,零运行时依赖。",
4
- "version": "1.3.0",
3
+ "description": "dsh 插件开发知识库:DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 188 页)+ 182 篇仓库补充开发参考 + 主题导航与 373 文件全量搜索索引;以 dsh-plugin-dev-kb 技能让 agent 在插件开发任务中自动加载定位文档。纯数据插件,零运行时依赖。",
4
+ "version": "1.4.0",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -17,17 +17,18 @@ whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cord
17
17
  ```
18
18
  kb/
19
19
  ├── site/ 线上站点完整镜像(中英双语 188 页,优先读这里)
20
- │ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy
20
+ │ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy / public-deployments
21
21
  │ ├── develop/ basic(第一个插件/tool/config/publish)、framework(生命周期/服务/事件)、
22
22
  │ │ practice(能力分层/LLM适配器/动态装配)、cordis-tutorial(7章)
23
23
  │ ├── reference/ index(架构)、cordis-primer、capability-seams、agent-lifecycle、
24
24
  │ │ config-catalog、tool-catalog、api-gateway、cordis-api/(6)、cookbook/(5)、subsystems/(46)
25
25
  │ └── en/ 英文站镜像(结构与中文站一致)
26
- ├── extra/ 仓库内未发布到站点的补充文档(62 篇):glossary、defensive-patterns、
27
- │ module-graph、testing、postmortem/(4)、i18n/、cookbook 与 subsystems 扩展
26
+ ├── extra/ 仓库内未发布到站点的补充文档(182 篇):glossary、defensive-patterns、
27
+ │ module-graph、testing、postmortem/、i18n/、cookbook 与 subsystems 扩展、
28
+ │ upgrade-guide/(各版本升级指南)、persistence-changes/(持久化格式变更)
28
29
  ├── meta/
29
30
  │ ├── topics.md ★ 主题导航:任务场景 → 要读的文件(先用这个)
30
- │ ├── search-index.json 全量检索索引(253 文件:path/url/title/字符数)
31
+ │ ├── search-index.json 全量检索索引(373 文件:path/url/title/字符数)
31
32
  │ ├── source.json 来源信息(commit/时间/统计)
32
33
  │ └── site-pages.txt 线上站点页面清单
33
34
  ├── INDEX.md 全部 站点 URL ↔ 本地文件 对照
@@ -1,198 +0,0 @@
1
- ---
2
- editSource: "docs/subsystems/code-runtime.md"
3
- outline: [2,3]
4
- ---
5
-
6
- # Code Runtime
7
-
8
- The code-execution seam — a [capability seam](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-06-13-capability-seams.md) whose Service Definition ([dsh-code-runtime](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/code-runtime/code-runtime), `ctx.codeRuntime`) runs one model-written program against host-provided async bindings and reports what it printed and returned. Code execution is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](./core.md). Backends differ by execution substrate and source language, both readonly descriptors on the service; the worker-thread Service Provider and tool-registry Consumer are specified by the [PTC mode foundation](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-06-15-ptc.md) and [typed-return contract](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-20-ptc-typed-tool-returns.md).
9
-
10
- Source: [`packages/code-runtime/code-runtime/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/types.ts)
11
-
12
- ## The run: request in, result out
13
-
14
- A `CodeRunRequest` carries **everything the runtime acts on** — per the "explicit > implicit at package boundaries" rule, defaulting (time budgets, output caps) is the implementation's validated config, never a hidden `??` inside `run()`:
15
-
16
- ```ts type-equiv
17
- /**
18
- * One run: the program source plus everything the runtime acts on. Per the
19
- * explicit-over-implicit convention, defaulting (time budgets, output caps)
20
- * is the implementation's validated config — a request carries no optional
21
- * tuning knobs for a hidden `??` to fill in.
22
- */
23
- interface CodeRunRequest {
24
- /**
25
- * The program source, in the runtime's {@link ../index.ts | language}. It
26
- * runs as the body of an async function: top-level `await` and `return`
27
- * are available, and the completion value becomes
28
- * {@link CodeRunResult.value}.
29
- */
30
- program: string
31
- /** Host functions exposed to the program, one global object per namespace. */
32
- bindings: CodeBindingNamespace[]
33
- /**
34
- * Abort the run: the runtime stops the program (hard, even mid-loop) and
35
- * resolves with a {@link CodeRunFailure} of kind `'abort'`. In-flight
36
- * binding calls are the CALLER's to settle — the runtime only stops asking.
37
- */
38
- signal?: AbortSignal
39
- }
40
- ```
41
-
42
- The result reports an error as a **field**, never a rejection of `run()` — reporting a failed program is the caller's job, not an exception path (matching `ShellExecutor.run`'s resolve-on-failure contract):
43
-
44
- ```ts type-equiv
45
- /**
46
- * The outcome of one run. An error is a FIELD on a resolved result, never a
47
- * rejection of `run()` — reporting a failed program is the caller's job, not
48
- * an exception path.
49
- */
50
- interface CodeRunResult {
51
- /**
52
- * The program's completion value (its top-level `return`), when it ran to
53
- * completion and the value crossed the runtime's lossless-JSON boundary.
54
- * Invalid or over-limit completions fail the run instead of substituting a
55
- * rendered string; a failed or value-less run leaves this absent.
56
- */
57
- value?: CodeJsonValue
58
- /**
59
- * Captured text. Each source channel preserves emission order; interleaving
60
- * across independent channels is backend-dependent. Bounded only as part of
61
- * the outer result.
62
- */
63
- logs: string[]
64
- /** Present iff the run failed; see {@link CodeRunFailure} for the taxonomy. */
65
- error?: CodeRunFailure
66
- }
67
- ```
68
-
69
- ## Bindings: host functions as program globals
70
-
71
- Each `CodeBindingNamespace` becomes one global object of async callables inside the program (the PTC mode consumer passes one: `tools`). Arguments and resolutions must be lossless JSON and cross without a seam-level byte cap; the runtime may bridge them through structured clone. A namespace may declare a program-visible error class without making the runtime know the consumer's names: the runtime injects the real constructor and turns rejected calls into its instances. A runtime also treats binding names as hostile input (`__proto__` is an ordinary own property, never a prototype collision):
72
-
73
- ```ts type-equiv
74
- /**
75
- * Program-visible typed rejection for one binding namespace. The runtime
76
- * injects a real error constructor under `name`; rejected member calls become
77
- * its instances and expose the exact member name through
78
- * `memberNameProperty`. Both strings are runtime data rather than knowledge
79
- * of a particular consumer such as PTC mode.
80
- */
81
- interface CodeBindingErrorClass {
82
- /** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
83
- name: string
84
- /**
85
- * Non-empty own property for the member name. The portable exclusion set is
86
- * `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__x__`, non-empty
87
- * middle), enforced identically by every backend; any other name —
88
- * identifiers or not — is accepted everywhere.
89
- */
90
- memberNameProperty: string
91
- }
92
- ```
93
-
94
- ```ts type-equiv
95
- /**
96
- * A named group of {@link CodeBindingFunction}s the runtime exposes to the
97
- * program as one global object (e.g. `tools`). Function names are arbitrary
98
- * strings — a runtime must treat names like `__proto__` or `constructor` as
99
- * ordinary own properties (null-prototype construction), never as prototype
100
- * collisions.
101
- */
102
- interface CodeBindingNamespace {
103
- /**
104
- * The global identifier the program sees. Must match the LANGUAGE-PORTABLE
105
- * identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
106
- * words, so the same namespace list works against every backend regardless
107
- * of `language` — a JS-only spelling like `$tools` is rejected by design,
108
- * not just by the Python backend. Names that satisfy the identifier rule but
109
- * name a backend-owned slot (`RESERVED_BINDING_GLOBALS`, e.g. `console`,
110
- * `__dsh_main__`) are also refused everywhere; see its declaration for the
111
- * exact set and why each entry is reserved.
112
- */
113
- global: string
114
- /** The callable members, keyed by the exact name the program calls. */
115
- functions: Record<string, CodeBindingFunction>
116
- /** Optional program-visible typed rejection contract for this namespace. */
117
- errorClass?: CodeBindingErrorClass
118
- }
119
- ```
120
-
121
- ```ts type-equiv
122
- /** A lossless JSON value transferable through the dependency-light Service Definition. */
123
- type CodeJsonValue = null | boolean | number | string | CodeJsonValue[] | { [key: string]: CodeJsonValue }
124
- ```
125
-
126
- ```ts type-equiv
127
- /**
128
- * One host-side function exposed to the program as an async callable. The
129
- * runtime bridges calls to it (possibly across a serialization boundary), so
130
- * `args` and the resolution value MUST be lossless JSON. A runtime rejects a
131
- * lossy or non-cloneable value with a descriptive error rather than corrupting
132
- * the run. No seam-level byte cap applies to a binding resolution. A rejection
133
- * of this function surfaces inside the program as a rejection of the
134
- * corresponding call.
135
- */
136
- type CodeBindingFunction = (args: unknown) => Promise<CodeJsonValue>
137
- ```
138
-
139
- ## Captured output and the failure taxonomy
140
-
141
- Logs are plain strings. Each source channel preserves emission order, while interleaving across independent channels is backend-dependent because channel metadata is not part of the seam. The runtime captures the program's console and stream output, and consumers render only the text. Implementations cap the serialized outer log-array plus completion-value or failure-message payload; fixed result-envelope syntax and consumer presentation whitespace are not part of that variable-payload ledger. Overflow is an explicit failure rather than in-band value substitution.
142
-
143
- Failure kinds are **orthogonal outcomes reported independently** (per [defensive-patterns](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/defensive-patterns.md)): a budget expiry is not an exception, an abort is not a timeout, and a substrate death (e.g. OOM) is neither:
144
-
145
- ```ts type-equiv
146
- /**
147
- * Why a run failed. The kinds are orthogonal outcomes reported independently
148
- * (per docs/defensive-patterns.md): a budget expiry is not an exception, an
149
- * abort is not a timeout, and a substrate death is neither.
150
- *
151
- * - `'exception'` — the program threw or failed to parse/transform.
152
- * - `'timeout'` — an implementation-owned budget expired; the message says which.
153
- * - `'abort'` — {@link CodeRunRequest.signal} fired.
154
- * - `'worker-exit'` — the execution substrate died without settling (e.g. OOM).
155
- * - `'invalid-output'` — the completion value was not lossless JSON.
156
- * - `'output-limit'` — the serialized outer logs/value/diagnostic exceeded the configured cap.
157
- */
158
- interface CodeRunFailure {
159
- /** The failure class (see the interface doc for each kind's meaning). */
160
- kind: 'exception' | 'timeout' | 'abort' | 'worker-exit' | 'invalid-output' | 'output-limit'
161
- /** Human-readable detail, suitable for feeding back to a model to self-correct. */
162
- message: string
163
- }
164
- ```
165
-
166
- ## The service
167
-
168
- `CodeRuntime` (`ctx.codeRuntime`, abstract — defined in [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts)) is `run(request)` plus two readonly descriptors: `language` (what the program must be written in — `'typescript'` and `'python'` are the well-known values, those `dsh-tools` presents, the TypeScript backend released and the Python backend experimental and private (not published); a consumer generating language-specific presentation switches on it and fails loud on one it cannot present) and `isolation` (the execution substrate — `'worker-thread'`, `'process'`, `'container'`; a diagnostic label, **not a security claim**). Implementations must keep runs isolated from each other (no cross-run state) and dispose to quiescence: in-flight runs are terminated and awaited before teardown completes.
169
-
170
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
171
-
172
- <a id="cordis-surface"></a>
173
-
174
- ## Cordis API
175
-
176
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
177
-
178
- <a id="ctxcoderuntime--coderuntime-abstract-seam"></a>
179
-
180
- ### `ctx.codeRuntime` — `CodeRuntime` (abstract seam)
181
-
182
- Registers one `ctx.codeRuntime` implementation. Program, budget, abort, and substrate failures resolve in CodeRunResult; only Service Definition contract misuse rejects. Implementations bridge structured-cloneable bindings, materialize each declared namespace rejection class, treat programs as hostile peers, isolate runs from one another, and terminate and await in-flight runs during disposal.
183
-
184
- ```ts cordis-catalog
185
- /**
186
- * Execute one program against the request's bindings and capture what it
187
- * emitted. See the class doc for the resolution contract (error is a result
188
- * field; rejection means Service Definition contract misuse only).
189
- * @param request - the program, its bindings, and the abort signal; the
190
- * request carries everything the runtime acts on, with no hidden defaults.
191
- * @returns the run's outcome: completion value (when transferable), the
192
- * ordered log capture, and the failure (if any).
193
- */
194
- abstract run(request: CodeRunRequest): Promise<CodeRunResult>
195
- ```
196
-
197
- Source: [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts)
198
- <!-- END GENERATED cordis-surface -->
@@ -1,91 +0,0 @@
1
- ---
2
- editSource: "docs/subsystems/invariants.md"
3
- outline: [2,3]
4
- ---
5
-
6
- # Runtime Invariants
7
-
8
- [dsh-invariants](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/runtime-diagnostics/invariants) is the configurable registry service (`ctx.invariants`) for package-owned runtime invariant checks. It is one support-group package, not a three-package capability seam, and not part of the agent-loop spine: the registry owns selection, name reservation, child-fiber lifecycle, and package-attributed failure, while every workspace package publishes a `./invariant` companion plugin that registers checks under its exact npm package name. What a check may assert — authoritative event streams or mutable data, never service or method presence — is the runtime-invariants convention in [AGENTS.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/AGENTS.md#conventions).
9
-
10
- Source: [`packages/runtime-diagnostics/invariants/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/src/index.ts)
11
-
12
- ## Selection
13
-
14
- ```ts type-equiv
15
- /** Runtime invariant selection configured on the service plugin. */
16
- interface Config {
17
- /** Global switch; defaults to `true`. */
18
- readonly enabled?: boolean
19
- /** Case-sensitive JavaScript regex sources that admit package names; empty admits all. */
20
- readonly package_allowlist?: string[]
21
- /** Case-sensitive JavaScript regex sources that exclude package names after allowlist matching. */
22
- readonly package_blocklist?: string[]
23
- }
24
- ```
25
-
26
- A package is selected when the service is enabled, the allowlist is empty or at least one pattern matches its full npm name, and no blocklist pattern matches — a blocklist match overrides an allowlist match. Entries compile with `new RegExp(source)`: matching is unanchored unless the source supplies `^` and `$`, and `/pattern/flags` syntax is not parsed. Validation fails loud at service startup: a blank, whitespace-padded, duplicate, or invalid entry throws instead of being skipped. A valid pattern may match no currently loaded package, so later loading and HMR stay deterministic; filters are fixed for the service lifetime ([README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/README.md)).
27
-
28
- ## The installer
29
-
30
- ```ts type-equiv
31
- /**
32
- * Throw a package-attributed invariant failure.
33
- * @param message - violated package contract without the standard prefix.
34
- * @returns never because reporting a violation throws.
35
- */
36
- type InvariantFailure = (message: string) => never
37
- ```
38
-
39
- ```ts type-equiv
40
- /** Install one package's checks into the registration's child context. */
41
- interface InvariantInstaller {
42
- /**
43
- * Install the package contribution.
44
- * @param ctx - child context owned by this invariant registration.
45
- * @param fail - reporter bound to the registering package name.
46
- * @returns nothing, or a promise settling after asynchronous checks finish.
47
- */
48
- (ctx: Context, fail: InvariantFailure): void | Promise<void>
49
- /** Services the child installer fiber may access. */
50
- readonly inject?: Inject
51
- }
52
- ```
53
-
54
- An enabled installer runs in a dedicated child Cordis fiber; `installer.inject` declares the services that fiber may access, and synchronous or asynchronous installer completion is joined before the registration succeeds. `fail(message)` throws `InvariantError` — `extends Error` with stable `code: 'INVARIANT'`, the owning `packageName`, and a message prefixed `invariant violated by "<package>": …` — so a violation is attributable without the registry importing any product package.
55
-
56
- ## The service
57
-
58
- `ctx.invariants.register(packageName, installer)` reserves one active registration for the full npm package name and returns its effect-scoped disposer. The reservation holds even when filters keep the installer inactive, so two plugins can never silently claim the same package name; a duplicate, blank, or whitespace-containing name throws. An installer failure disposes the child fiber and releases the reservation atomically. The service owns every registration fiber while the returned disposer also belongs to the companion fiber: unloading either side removes listeners, trace state, and the reservation, so a companion can reload and register the same name again without retained state.
59
-
60
- ## The companion contract
61
-
62
- Every workspace package owns a `./invariant` companion ([package contract](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/AGENTS.md)); publication and registration are exhaustive, but assertions are deliberately not synthetic. A companion installs a check only when its package owns an observable event or mutable-data relationship; otherwise it exports an empty installer whose leading comment starts `No runtime invariant:` and explains, package-specifically, why nothing is checkable. `pnpm run verify-package-invariants` mechanically rejects generated markers, unexplained empty installers, non-empty installers that omit or ignore the reporter, incorrect registration names, and incomplete export, publication, dependency, or bundle wiring ([mechanical-rule Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.md)). The catalog of executable companions and the standard composition live in the [package README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/README.md).
63
-
64
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
65
-
66
- <a id="cordis-surface"></a>
67
-
68
- ## Cordis API
69
-
70
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
71
-
72
- <a id="ctxinvariants--invariantregistry"></a>
73
-
74
- ### `ctx.invariants` — `InvariantRegistry`
75
-
76
- Package-owned invariant registry with global and regex-based selection.
77
-
78
- ```ts cordis-catalog
79
- /**
80
- * Register one package's invariant installer. The package name is reserved
81
- * even when filtering disables its checks. Enabled installers run in a child
82
- * fiber; failure disposes that fiber and releases the reservation.
83
- * @param packageName - full npm package name that owns the contribution.
84
- * @param installer - listener or startup-check installer for the child context.
85
- * @returns an effect-scoped disposer for the registration.
86
- */
87
- register(packageName: string, installer: InvariantInstaller): () => void
88
- ```
89
-
90
- Source: [`packages/runtime-diagnostics/invariants/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/src/index.ts)
91
- <!-- END GENERATED cordis-surface -->
@@ -1,198 +0,0 @@
1
- ---
2
- editSource: "docs/subsystems/code-runtime.zh.md"
3
- outline: [2,3]
4
- ---
5
-
6
- # 代码运行时
7
-
8
- 代码执行 seam 是一个[能力 seam](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-06-13-capability-seams.zh.md):其 Service Definition([dsh-code-runtime](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/code-runtime/code-runtime),`ctx.codeRuntime`)使用宿主提供的异步绑定运行一段模型编写的程序,并报告其打印内容与返回值。代码执行是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](./core.md) 中。各后端的执行基底与源语言不同,这两项均为服务上的只读描述符;worker-thread Service Provider 与工具注册表 Consumer 的约定见 [PTC mode 基础设计](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-06-15-ptc.zh.md) 和[类型化返回约定](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-20-ptc-typed-tool-returns.zh.md)。
9
-
10
- 源码:[`packages/code-runtime/code-runtime/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/types.ts)
11
-
12
- ## 运行:请求进,结果出
13
-
14
- `CodeRunRequest` 携带**运行时要处理的一切内容**。按照「包边界处显式优于隐式」的规则,默认值(时间预算、输出上限)来自实现的已校验配置,绝不是 `run()` 内部隐藏的 `??`:
15
-
16
- ```ts type-equiv
17
- /**
18
- * One run: the program source plus everything the runtime acts on. Per the
19
- * explicit-over-implicit convention, defaulting (time budgets, output caps)
20
- * is the implementation's validated config — a request carries no optional
21
- * tuning knobs for a hidden `??` to fill in.
22
- */
23
- interface CodeRunRequest {
24
- /**
25
- * The program source, in the runtime's {@link ../index.ts | language}. It
26
- * runs as the body of an async function: top-level `await` and `return`
27
- * are available, and the completion value becomes
28
- * {@link CodeRunResult.value}.
29
- */
30
- program: string
31
- /** Host functions exposed to the program, one global object per namespace. */
32
- bindings: CodeBindingNamespace[]
33
- /**
34
- * Abort the run: the runtime stops the program (hard, even mid-loop) and
35
- * resolves with a {@link CodeRunFailure} of kind `'abort'`. In-flight
36
- * binding calls are the CALLER's to settle — the runtime only stops asking.
37
- */
38
- signal?: AbortSignal
39
- }
40
- ```
41
-
42
- 结果将错误报告为一个**字段**,而不是让 `run()` 返回被拒绝的 Promise。报告程序失败是调用方的职责,不走异常路径(与 `ShellExecutor.run` 失败时仍正常完成的约定一致):
43
-
44
- ```ts type-equiv
45
- /**
46
- * The outcome of one run. An error is a FIELD on a resolved result, never a
47
- * rejection of `run()` — reporting a failed program is the caller's job, not
48
- * an exception path.
49
- */
50
- interface CodeRunResult {
51
- /**
52
- * The program's completion value (its top-level `return`), when it ran to
53
- * completion and the value crossed the runtime's lossless-JSON boundary.
54
- * Invalid or over-limit completions fail the run instead of substituting a
55
- * rendered string; a failed or value-less run leaves this absent.
56
- */
57
- value?: CodeJsonValue
58
- /**
59
- * Captured text. Each source channel preserves emission order; interleaving
60
- * across independent channels is backend-dependent. Bounded only as part of
61
- * the outer result.
62
- */
63
- logs: string[]
64
- /** Present iff the run failed; see {@link CodeRunFailure} for the taxonomy. */
65
- error?: CodeRunFailure
66
- }
67
- ```
68
-
69
- ## 绑定:宿主函数作为程序全局变量
70
-
71
- 每个 `CodeBindingNamespace` 在程序内成为一个由异步可调用函数组成的全局对象(PTC mode Consumer 传入一个:`tools`)。参数与返回值必须是无损 JSON,且跨越边界时不受 seam 层字节上限约束;运行时可以通过结构化克隆桥接它们。命名空间可以声明程序可见的错误类,而无需让运行时知道 Consumer 的名称:运行时会注入真实构造函数,并将被拒绝的调用转为该类的实例。运行时也将绑定名视为不可信输入(`__proto__` 是普通自有属性,绝不会发生原型碰撞):
72
-
73
- ```ts type-equiv
74
- /**
75
- * Program-visible typed rejection for one binding namespace. The runtime
76
- * injects a real error constructor under `name`; rejected member calls become
77
- * its instances and expose the exact member name through
78
- * `memberNameProperty`. Both strings are runtime data rather than knowledge
79
- * of a particular consumer such as PTC mode.
80
- */
81
- interface CodeBindingErrorClass {
82
- /** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
83
- name: string
84
- /**
85
- * Non-empty own property for the member name. The portable exclusion set is
86
- * `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__x__`, non-empty
87
- * middle), enforced identically by every backend; any other name —
88
- * identifiers or not — is accepted everywhere.
89
- */
90
- memberNameProperty: string
91
- }
92
- ```
93
-
94
- ```ts type-equiv
95
- /**
96
- * A named group of {@link CodeBindingFunction}s the runtime exposes to the
97
- * program as one global object (e.g. `tools`). Function names are arbitrary
98
- * strings — a runtime must treat names like `__proto__` or `constructor` as
99
- * ordinary own properties (null-prototype construction), never as prototype
100
- * collisions.
101
- */
102
- interface CodeBindingNamespace {
103
- /**
104
- * The global identifier the program sees. Must match the LANGUAGE-PORTABLE
105
- * identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
106
- * words, so the same namespace list works against every backend regardless
107
- * of `language` — a JS-only spelling like `$tools` is rejected by design,
108
- * not just by the Python backend. Names that satisfy the identifier rule but
109
- * name a backend-owned slot (`RESERVED_BINDING_GLOBALS`, e.g. `console`,
110
- * `__dsh_main__`) are also refused everywhere; see its declaration for the
111
- * exact set and why each entry is reserved.
112
- */
113
- global: string
114
- /** The callable members, keyed by the exact name the program calls. */
115
- functions: Record<string, CodeBindingFunction>
116
- /** Optional program-visible typed rejection contract for this namespace. */
117
- errorClass?: CodeBindingErrorClass
118
- }
119
- ```
120
-
121
- ```ts type-equiv
122
- /** A lossless JSON value transferable through the dependency-light Service Definition. */
123
- type CodeJsonValue = null | boolean | number | string | CodeJsonValue[] | { [key: string]: CodeJsonValue }
124
- ```
125
-
126
- ```ts type-equiv
127
- /**
128
- * One host-side function exposed to the program as an async callable. The
129
- * runtime bridges calls to it (possibly across a serialization boundary), so
130
- * `args` and the resolution value MUST be lossless JSON. A runtime rejects a
131
- * lossy or non-cloneable value with a descriptive error rather than corrupting
132
- * the run. No seam-level byte cap applies to a binding resolution. A rejection
133
- * of this function surfaces inside the program as a rejection of the
134
- * corresponding call.
135
- */
136
- type CodeBindingFunction = (args: unknown) => Promise<CodeJsonValue>
137
- ```
138
-
139
- ## 捕获的输出与失败分类体系
140
-
141
- 日志是纯字符串。每个来源通道保留自身的发出顺序;由于通道元数据不属于 seam,相互独立的通道如何交错由后端决定。运行时捕获程序的 console 与流输出,Consumer 只渲染文本。实现会对序列化后的外层日志数组,以及完成值或失败消息的组合载荷设置上限;固定的结果封装语法与 Consumer 展示空白不计入这份可变载荷计量。超限会显式失败,而不会在值中插入替代内容。
142
-
143
- 失败类型是**正交的结果,独立报告**(见 [defensive-patterns](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/defensive-patterns.zh.md)):预算耗尽不是异常,中止不是超时,基底崩溃(如 OOM)也不是二者中的任何一个:
144
-
145
- ```ts type-equiv
146
- /**
147
- * Why a run failed. The kinds are orthogonal outcomes reported independently
148
- * (per docs/defensive-patterns.md): a budget expiry is not an exception, an
149
- * abort is not a timeout, and a substrate death is neither.
150
- *
151
- * - `'exception'` — the program threw or failed to parse/transform.
152
- * - `'timeout'` — an implementation-owned budget expired; the message says which.
153
- * - `'abort'` — {@link CodeRunRequest.signal} fired.
154
- * - `'worker-exit'` — the execution substrate died without settling (e.g. OOM).
155
- * - `'invalid-output'` — the completion value was not lossless JSON.
156
- * - `'output-limit'` — the serialized outer logs/value/diagnostic exceeded the configured cap.
157
- */
158
- interface CodeRunFailure {
159
- /** The failure class (see the interface doc for each kind's meaning). */
160
- kind: 'exception' | 'timeout' | 'abort' | 'worker-exit' | 'invalid-output' | 'output-limit'
161
- /** Human-readable detail, suitable for feeding back to a model to self-correct. */
162
- message: string
163
- }
164
- ```
165
-
166
- ## 服务
167
-
168
- `CodeRuntime`(`ctx.codeRuntime`,抽象服务,定义于 [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts))由 `run(request)` 加两个只读描述符组成:`language`(程序必须使用的语言,已知值为 `'typescript'` 与 `'python'`,即 `dsh-tools` 能呈现的那些,TypeScript 后端已发布、Python 后端为实验性且私有(未发布);生成语言相关展示的 Consumer 据此切换,遇到无法展示的语言时应显式报错)和 `isolation`(执行基底,`'worker-thread'`、`'process'`、`'container'`;仅为诊断标签,**不构成安全承诺**)。实现必须保证各次运行彼此隔离(无跨运行状态),并在 dispose(资源释放)时等待系统完全停稳:teardown 要等到所有进行中的运行均已终止并结算后才完成。
169
-
170
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
171
-
172
- <a id="cordis-surface"></a>
173
-
174
- ## Cordis API
175
-
176
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
177
-
178
- <a id="ctxcoderuntime--coderuntime-abstract-seam"></a>
179
-
180
- ### `ctx.codeRuntime` — `CodeRuntime` (abstract seam)
181
-
182
- Registers one `ctx.codeRuntime` implementation. Program, budget, abort, and substrate failures resolve in CodeRunResult; only Service Definition contract misuse rejects. Implementations bridge structured-cloneable bindings, materialize each declared namespace rejection class, treat programs as hostile peers, isolate runs from one another, and terminate and await in-flight runs during disposal.
183
-
184
- ```ts cordis-catalog
185
- /**
186
- * Execute one program against the request's bindings and capture what it
187
- * emitted. See the class doc for the resolution contract (error is a result
188
- * field; rejection means Service Definition contract misuse only).
189
- * @param request - the program, its bindings, and the abort signal; the
190
- * request carries everything the runtime acts on, with no hidden defaults.
191
- * @returns the run's outcome: completion value (when transferable), the
192
- * ordered log capture, and the failure (if any).
193
- */
194
- abstract run(request: CodeRunRequest): Promise<CodeRunResult>
195
- ```
196
-
197
- Source: [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts)
198
- <!-- END GENERATED cordis-surface -->