dsh-plugin-dev-kb 1.1.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 (370) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.en.md +14 -8
  3. package/README.md +15 -9
  4. package/docs/banner.svg +25 -0
  5. package/kb/INDEX.md +23 -19
  6. package/kb/README.md +8 -6
  7. package/kb/extra/AGENTS.md +11 -10
  8. package/kb/extra/cookbook/adding-a-remote-api.md +2 -2
  9. package/kb/extra/cookbook/adding-a-remote-api.zh.md +2 -2
  10. package/kb/extra/cookbook/adding-a-session-format-version.md +151 -0
  11. package/kb/extra/cookbook/adding-a-session-format-version.zh.md +151 -0
  12. package/kb/extra/cookbook/adding-a-vendored-package.md +1 -1
  13. package/kb/extra/cookbook/adding-a-vendored-package.zh.md +1 -1
  14. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +1 -1
  15. package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  16. package/kb/extra/cookbook/reviewing-persistence-type-changes.md +120 -0
  17. package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +120 -0
  18. package/kb/extra/deepseek-llm-api-wire-extensions.md +19 -20
  19. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +18 -19
  20. package/kb/extra/development.md +37 -10
  21. package/kb/extra/development.zh.md +37 -10
  22. package/kb/extra/event-producer-consumer.md +90 -67
  23. package/kb/extra/event-producer-consumer.zh.md +91 -68
  24. package/kb/extra/glossary.md +1 -1
  25. package/kb/extra/glossary.zh.md +1 -1
  26. package/kb/extra/i18n/README.md +16 -7
  27. package/kb/extra/i18n/README.zh.md +17 -8
  28. package/kb/extra/i18n/terminology.md +4 -4
  29. package/kb/extra/i18n/translation-prompt.md +3 -3
  30. package/kb/extra/module-graph.md +621 -335
  31. package/kb/extra/module-graph.zh.md +621 -335
  32. package/kb/extra/persistence-changes/2026-09-11-initial.md +280 -0
  33. package/kb/extra/persistence-changes/2026-09-11-initial.zh.md +280 -0
  34. package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
  35. package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
  36. package/kb/extra/persistence-changes/2026-09-14-image-offload.md +96 -0
  37. package/kb/extra/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
  38. package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
  39. package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
  40. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +120 -0
  41. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +120 -0
  42. package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.md +48 -0
  43. package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.zh.md +48 -0
  44. package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.md +48 -0
  45. package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.zh.md +48 -0
  46. package/kb/extra/persistence-changes/2026-09-21-user-question-reply.md +60 -0
  47. package/kb/extra/persistence-changes/2026-09-21-user-question-reply.zh.md +60 -0
  48. package/kb/extra/persistence-changes/README.md +88 -0
  49. package/kb/extra/persistence-changes/README.zh.md +88 -0
  50. package/kb/extra/persistence-changes/historical-formats/README.md +75 -0
  51. package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -0
  52. package/kb/extra/persistence-changes/historical-formats/v0.md +5105 -0
  53. package/kb/extra/persistence-changes/historical-formats/v0.zh.md +5105 -0
  54. package/kb/extra/persistence-changes/historical-formats/v1.md +5107 -0
  55. package/kb/extra/persistence-changes/historical-formats/v1.zh.md +5107 -0
  56. package/kb/extra/persistence-changes/historical-formats/v2.md +5362 -0
  57. package/kb/extra/persistence-changes/historical-formats/v2.zh.md +5362 -0
  58. package/kb/extra/persistence-changes/historical-formats/v3.md +5634 -0
  59. package/kb/extra/persistence-changes/historical-formats/v3.zh.md +5634 -0
  60. package/kb/extra/persistence-changes/releases/README.md +103 -0
  61. package/kb/extra/persistence-changes/releases/README.zh.md +103 -0
  62. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
  63. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
  64. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
  65. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
  66. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
  67. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
  68. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
  69. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
  70. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
  71. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
  72. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
  73. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
  74. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
  75. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
  76. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
  77. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
  78. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
  79. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
  80. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
  81. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
  82. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
  83. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
  84. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
  85. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
  86. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
  87. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
  88. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
  89. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
  90. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
  91. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
  92. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
  93. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
  94. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
  95. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
  96. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
  97. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
  98. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
  99. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
  100. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
  101. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
  102. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
  103. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
  104. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
  105. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
  106. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
  107. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
  108. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
  109. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
  110. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
  111. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
  112. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
  113. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
  114. package/kb/extra/rescope.md +2 -2
  115. package/kb/extra/rescope.zh.md +2 -2
  116. package/kb/extra/session-format-status.md +63 -0
  117. package/kb/extra/session-format-status.zh.md +63 -0
  118. package/kb/extra/subsystems/agent-team.md +52 -28
  119. package/kb/extra/subsystems/agent-team.zh.md +52 -28
  120. package/kb/extra/subsystems/attachment.md +19 -9
  121. package/kb/extra/subsystems/attachment.zh.md +19 -9
  122. package/kb/extra/subsystems/boot.md +323 -0
  123. package/kb/extra/subsystems/boot.zh.md +323 -0
  124. package/kb/extra/subsystems/browser-use.md +67 -0
  125. package/kb/extra/subsystems/browser-use.zh.md +67 -0
  126. package/kb/extra/subsystems/claude-code-mods.md +146 -0
  127. package/kb/extra/subsystems/claude-code-mods.zh.md +146 -0
  128. package/kb/extra/subsystems/computer-use.md +56 -0
  129. package/kb/extra/subsystems/computer-use.zh.md +56 -0
  130. package/kb/extra/subsystems/deliverables.md +178 -0
  131. package/kb/extra/subsystems/deliverables.zh.md +178 -0
  132. package/kb/extra/subsystems/extensions.md +6 -4
  133. package/kb/extra/subsystems/extensions.zh.md +6 -4
  134. package/kb/extra/subsystems/feedback.md +165 -31
  135. package/kb/extra/subsystems/feedback.zh.md +165 -31
  136. package/kb/extra/subsystems/mcp.md +139 -0
  137. package/kb/extra/subsystems/mcp.zh.md +139 -0
  138. package/kb/extra/subsystems/office-to-pdf.md +87 -0
  139. package/kb/extra/subsystems/office-to-pdf.zh.md +87 -0
  140. package/kb/extra/subsystems/otel.md +44 -0
  141. package/kb/extra/subsystems/otel.zh.md +44 -0
  142. package/kb/extra/subsystems/product-telemetry.md +79 -0
  143. package/kb/extra/subsystems/product-telemetry.zh.md +79 -0
  144. package/kb/extra/subsystems/ssh.md +135 -0
  145. package/kb/extra/subsystems/ssh.zh.md +135 -0
  146. package/kb/extra/subsystems/todo.md +3 -3
  147. package/kb/extra/subsystems/todo.zh.md +3 -3
  148. package/kb/extra/subsystems/voice-input.md +164 -0
  149. package/kb/extra/subsystems/voice-input.zh.md +164 -0
  150. package/kb/extra/subsystems/webhook.md +3 -3
  151. package/kb/extra/subsystems/webhook.zh.md +1 -1
  152. package/kb/extra/testing.md +5 -4
  153. package/kb/extra/testing.zh.md +5 -4
  154. package/kb/extra/ui-radius.md +115 -0
  155. package/kb/extra/ui-radius.zh.md +115 -0
  156. package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.md +22 -0
  157. package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.zh.md +22 -0
  158. package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.md +25 -0
  159. package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.zh.md +25 -0
  160. package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.md +18 -0
  161. package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.zh.md +18 -0
  162. package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.md +23 -0
  163. package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.zh.md +23 -0
  164. package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +22 -0
  165. package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md +22 -0
  166. package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.md +27 -0
  167. package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.zh.md +27 -0
  168. package/kb/extra/web-styling.md +12 -2
  169. package/kb/extra/web-styling.zh.md +12 -2
  170. package/kb/meta/search-index.json +1019 -251
  171. package/kb/meta/site-pages.txt +187 -183
  172. package/kb/meta/source.json +8 -8
  173. package/kb/meta/topics.md +11 -7
  174. package/kb/site/develop/basic/config.md +1 -0
  175. package/kb/site/develop/basic/index.md +1 -0
  176. package/kb/site/develop/basic/publish.md +10 -3
  177. package/kb/site/develop/basic/tool.md +1 -0
  178. package/kb/site/develop/cordis-tutorial/01-first-plugin.md +1 -0
  179. package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
  180. package/kb/site/develop/cordis-tutorial/03-services.md +1 -0
  181. package/kb/site/develop/cordis-tutorial/04-events.md +1 -0
  182. package/kb/site/develop/cordis-tutorial/05-config.md +28 -0
  183. package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
  184. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +1 -0
  185. package/kb/site/develop/cordis-tutorial/index.md +1 -0
  186. package/kb/site/develop/framework/events.md +1 -0
  187. package/kb/site/develop/framework/index.md +2 -1
  188. package/kb/site/develop/framework/service.md +1 -0
  189. package/kb/site/develop/practice/dynamic-cordis.md +9 -8
  190. package/kb/site/develop/practice/index.md +1 -0
  191. package/kb/site/develop/practice/llm-adapter.md +2 -1
  192. package/kb/site/en/develop/basic/config.md +1 -0
  193. package/kb/site/en/develop/basic/index.md +1 -0
  194. package/kb/site/en/develop/basic/publish.md +10 -3
  195. package/kb/site/en/develop/basic/tool.md +1 -0
  196. package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +1 -0
  197. package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
  198. package/kb/site/en/develop/cordis-tutorial/03-services.md +1 -0
  199. package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -0
  200. package/kb/site/en/develop/cordis-tutorial/05-config.md +28 -0
  201. package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
  202. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +1 -0
  203. package/kb/site/en/develop/cordis-tutorial/index.md +1 -0
  204. package/kb/site/en/develop/framework/events.md +1 -0
  205. package/kb/site/en/develop/framework/index.md +2 -1
  206. package/kb/site/en/develop/framework/service.md +1 -0
  207. package/kb/site/en/develop/practice/dynamic-cordis.md +9 -8
  208. package/kb/site/en/develop/practice/index.md +1 -0
  209. package/kb/site/en/develop/practice/llm-adapter.md +2 -1
  210. package/kb/site/en/guide/github-review.md +1 -0
  211. package/kb/site/en/guide/mcp-memory.md +1 -0
  212. package/kb/site/en/guide/network-proxy.md +2 -1
  213. package/kb/site/en/guide/providers-custom-form.png +0 -0
  214. package/kb/site/en/guide/providers-models-page.png +0 -0
  215. package/kb/site/en/guide/providers.md +98 -83
  216. package/kb/site/en/guide/public-deployments.md +36 -0
  217. package/kb/site/en/guide/python-sdk.md +60 -23
  218. package/kb/site/en/guide/quickstart.md +2 -0
  219. package/kb/site/en/guide/schedule.md +70 -11
  220. package/kb/site/en/reference/agent-lifecycle.md +13 -5
  221. package/kb/site/en/reference/api-gateway.md +13 -11
  222. package/kb/site/en/reference/capability-seams.md +187 -62
  223. package/kb/site/en/reference/config-catalog.md +1887 -819
  224. package/kb/site/en/reference/cookbook/adding-a-package.md +57 -3
  225. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +35 -64
  226. package/kb/site/en/reference/cookbook/adding-a-tool.md +5 -4
  227. package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +1 -0
  228. package/kb/site/en/reference/cookbook/extension-cookbook.md +7 -6
  229. package/kb/site/en/reference/cordis-api/context.md +1 -0
  230. package/kb/site/en/reference/cordis-api/events.md +1 -0
  231. package/kb/site/en/reference/cordis-api/fiber.md +4 -3
  232. package/kb/site/en/reference/cordis-api/inherited.md +16 -16
  233. package/kb/site/en/reference/cordis-api/registry.md +1 -0
  234. package/kb/site/en/reference/cordis-api/service.md +1 -0
  235. package/kb/site/en/reference/cordis-primer.md +1 -0
  236. package/kb/site/en/reference/index.md +32 -15
  237. package/kb/site/en/reference/persistence-catalog.md +7787 -81
  238. package/kb/site/en/reference/subsystems/approval.md +3 -2
  239. package/kb/site/en/reference/subsystems/client-modules.md +30 -13
  240. package/kb/site/en/reference/subsystems/client-resources.md +96 -0
  241. package/kb/site/en/reference/subsystems/commands.md +6 -1
  242. package/kb/site/en/reference/subsystems/compaction.md +50 -3
  243. package/kb/site/en/reference/subsystems/conversation.md +36 -6
  244. package/kb/site/en/reference/subsystems/core.md +174 -271
  245. package/kb/site/en/reference/subsystems/credentials.md +169 -5
  246. package/kb/site/en/reference/subsystems/filesystem.md +26 -0
  247. package/kb/site/en/reference/subsystems/goal.md +39 -2
  248. package/kb/site/en/reference/subsystems/index.md +18 -5
  249. package/kb/site/en/reference/subsystems/jobs.md +337 -127
  250. package/kb/site/en/reference/subsystems/llm-streaming.md +93 -43
  251. package/kb/site/en/reference/subsystems/lsp.md +2 -1
  252. package/kb/site/en/reference/subsystems/permission-presets.md +66 -29
  253. package/kb/site/en/reference/subsystems/persistence.md +40 -18
  254. package/kb/site/en/reference/subsystems/plan.md +2 -1
  255. package/kb/site/en/reference/subsystems/ptc-runtime.md +236 -0
  256. package/kb/site/en/reference/subsystems/sandbox.md +7 -5
  257. package/kb/site/en/reference/subsystems/schedule.md +392 -33
  258. package/kb/site/en/reference/subsystems/scope.md +2 -1
  259. package/kb/site/en/reference/subsystems/session-projection.md +22 -19
  260. package/kb/site/en/reference/subsystems/session-query.md +1 -0
  261. package/kb/site/en/reference/subsystems/session-reference.md +12 -6
  262. package/kb/site/en/reference/subsystems/session-telemetry.md +27 -8
  263. package/kb/site/en/reference/subsystems/session-title.md +6 -5
  264. package/kb/site/en/reference/subsystems/session.md +258 -118
  265. package/kb/site/en/reference/subsystems/settings.md +43 -292
  266. package/kb/site/en/reference/subsystems/shell.md +44 -32
  267. package/kb/site/en/reference/subsystems/sidebar-right.md +162 -0
  268. package/kb/site/en/reference/subsystems/skills.md +5 -6
  269. package/kb/site/en/reference/subsystems/slots.md +68 -39
  270. package/kb/site/en/reference/subsystems/spill.md +15 -7
  271. package/kb/site/en/reference/subsystems/storage.md +2 -2
  272. package/kb/site/en/reference/subsystems/subagent.md +65 -72
  273. package/kb/site/en/reference/subsystems/subprocess.md +42 -44
  274. package/kb/site/en/reference/subsystems/system-prompt.md +7 -2
  275. package/kb/site/en/reference/subsystems/terminal.md +1 -0
  276. package/kb/site/en/reference/subsystems/token-meter.md +3 -1
  277. package/kb/site/en/reference/subsystems/tools.md +44 -16
  278. package/kb/site/en/reference/subsystems/typert.md +153 -10
  279. package/kb/site/en/reference/subsystems/user-questions.md +131 -1
  280. package/kb/site/en/reference/subsystems/web-client.md +15 -9
  281. package/kb/site/en/reference/subsystems/web-server.md +74 -1
  282. package/kb/site/en/reference/subsystems/web.md +1 -0
  283. package/kb/site/en/reference/subsystems/workflow.md +10 -9
  284. package/kb/site/en/reference/subsystems/workspace.md +343 -4
  285. package/kb/site/en/reference/tool-catalog.md +806 -311
  286. package/kb/site/en/reference/tool-execution-pipeline.md +9 -5
  287. package/kb/site/guide/github-review.md +1 -0
  288. package/kb/site/guide/mcp-memory.md +1 -0
  289. package/kb/site/guide/network-proxy.md +2 -1
  290. package/kb/site/guide/providers-custom-form.zh.png +0 -0
  291. package/kb/site/guide/providers-models-page.zh.png +0 -0
  292. package/kb/site/guide/providers.md +109 -94
  293. package/kb/site/guide/public-deployments.md +36 -0
  294. package/kb/site/guide/python-sdk.md +60 -23
  295. package/kb/site/guide/quickstart.md +2 -0
  296. package/kb/site/guide/schedule.md +70 -11
  297. package/kb/site/reference/agent-lifecycle.md +13 -5
  298. package/kb/site/reference/api-gateway.md +13 -11
  299. package/kb/site/reference/capability-seams.md +187 -62
  300. package/kb/site/reference/config-catalog.md +1889 -820
  301. package/kb/site/reference/cookbook/adding-a-package.md +55 -3
  302. package/kb/site/reference/cookbook/adding-a-settings-card.md +35 -64
  303. package/kb/site/reference/cookbook/adding-a-tool.md +5 -4
  304. package/kb/site/reference/cookbook/adding-an-llm-adapter.md +1 -0
  305. package/kb/site/reference/cookbook/extension-cookbook.md +7 -6
  306. package/kb/site/reference/cordis-api/context.md +1 -0
  307. package/kb/site/reference/cordis-api/events.md +1 -0
  308. package/kb/site/reference/cordis-api/fiber.md +4 -3
  309. package/kb/site/reference/cordis-api/inherited.md +16 -16
  310. package/kb/site/reference/cordis-api/registry.md +1 -0
  311. package/kb/site/reference/cordis-api/service.md +1 -0
  312. package/kb/site/reference/cordis-primer.md +1 -0
  313. package/kb/site/reference/index.md +32 -15
  314. package/kb/site/reference/persistence-catalog.md +7791 -85
  315. package/kb/site/reference/subsystems/approval.md +3 -2
  316. package/kb/site/reference/subsystems/client-modules.md +30 -13
  317. package/kb/site/reference/subsystems/client-resources.md +96 -0
  318. package/kb/site/reference/subsystems/commands.md +6 -1
  319. package/kb/site/reference/subsystems/compaction.md +50 -3
  320. package/kb/site/reference/subsystems/conversation.md +35 -5
  321. package/kb/site/reference/subsystems/core.md +174 -271
  322. package/kb/site/reference/subsystems/credentials.md +169 -5
  323. package/kb/site/reference/subsystems/filesystem.md +26 -0
  324. package/kb/site/reference/subsystems/goal.md +39 -2
  325. package/kb/site/reference/subsystems/index.md +28 -15
  326. package/kb/site/reference/subsystems/jobs.md +336 -126
  327. package/kb/site/reference/subsystems/llm-streaming.md +93 -43
  328. package/kb/site/reference/subsystems/lsp.md +2 -1
  329. package/kb/site/reference/subsystems/permission-presets.md +66 -29
  330. package/kb/site/reference/subsystems/persistence.md +40 -18
  331. package/kb/site/reference/subsystems/plan.md +2 -1
  332. package/kb/site/reference/subsystems/ptc-runtime.md +236 -0
  333. package/kb/site/reference/subsystems/sandbox.md +7 -5
  334. package/kb/site/reference/subsystems/schedule.md +392 -33
  335. package/kb/site/reference/subsystems/scope.md +2 -1
  336. package/kb/site/reference/subsystems/session-projection.md +22 -19
  337. package/kb/site/reference/subsystems/session-query.md +1 -0
  338. package/kb/site/reference/subsystems/session-reference.md +12 -6
  339. package/kb/site/reference/subsystems/session-telemetry.md +27 -8
  340. package/kb/site/reference/subsystems/session-title.md +6 -5
  341. package/kb/site/reference/subsystems/session.md +258 -118
  342. package/kb/site/reference/subsystems/settings.md +43 -292
  343. package/kb/site/reference/subsystems/shell.md +44 -32
  344. package/kb/site/reference/subsystems/sidebar-right.md +162 -0
  345. package/kb/site/reference/subsystems/skills.md +5 -6
  346. package/kb/site/reference/subsystems/slots.md +68 -39
  347. package/kb/site/reference/subsystems/spill.md +15 -7
  348. package/kb/site/reference/subsystems/storage.md +2 -2
  349. package/kb/site/reference/subsystems/subagent.md +64 -71
  350. package/kb/site/reference/subsystems/subprocess.md +42 -44
  351. package/kb/site/reference/subsystems/system-prompt.md +7 -2
  352. package/kb/site/reference/subsystems/terminal.md +1 -0
  353. package/kb/site/reference/subsystems/token-meter.md +3 -1
  354. package/kb/site/reference/subsystems/tools.md +44 -16
  355. package/kb/site/reference/subsystems/typert.md +153 -10
  356. package/kb/site/reference/subsystems/user-questions.md +132 -2
  357. package/kb/site/reference/subsystems/web-client.md +15 -9
  358. package/kb/site/reference/subsystems/web-server.md +74 -1
  359. package/kb/site/reference/subsystems/web.md +1 -0
  360. package/kb/site/reference/subsystems/workflow.md +10 -9
  361. package/kb/site/reference/subsystems/workspace.md +343 -4
  362. package/kb/site/reference/tool-catalog.md +810 -315
  363. package/kb/site/reference/tool-execution-pipeline.md +9 -5
  364. package/lib/index.js +25 -44
  365. package/package.json +3 -2
  366. package/skills/dsh-plugin-dev-kb.md +6 -5
  367. package/kb/site/en/reference/subsystems/code-runtime.md +0 -198
  368. package/kb/site/en/reference/subsystems/invariants.md +0 -91
  369. package/kb/site/reference/subsystems/code-runtime.md +0 -198
  370. package/kb/site/reference/subsystems/invariants.md +0 -91
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  editSource: "docs/subsystems/tools.md"
3
+ rawMarkdownPath: "en/reference/subsystems/tools.md"
3
4
  outline: [2,3]
4
5
  ---
5
6
 
@@ -11,7 +12,7 @@ Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deep
11
12
 
12
13
  ## `ToolDefinition` — a registered tool
13
14
 
14
- A `ToolSchema` (the model-facing fields) plus a mandatory canonical output declaration, the `execute` function, host-only scheduler metadata, an optional final-content callback, and optional UI presenters. The registry holds these; the loop dispatches calls through them. The registry's `schemas()` builds the model-facing `ToolSchema[]` by an explicit allowlist — `output`/`execute`/`finalizeContent`/`timeoutMs`/`isConcurrencySafe`/`presentCall`/`presentResult` must never leak into a model request.
15
+ A `ToolSchema` (the model-facing fields) plus a mandatory canonical output declaration, the `execute` function, host-only scheduler metadata, an optional final-content callback, and optional UI presenters. The registry holds these; the loop dispatches calls through them. The registry's `schemas()` builds the model-facing `ToolSchema[]` by an explicit allowlist — `output`/`execute`/`projectContent`/`finalizeContent`/`timeoutMs`/`isConcurrencySafe`/`presentCall`/`presentResult` must never leak into a model request.
15
16
 
16
17
  ```ts type-equiv
17
18
  /** Tool-owned canonical output contract used after the body returns a JSON value. */
@@ -41,6 +42,16 @@ interface ToolDefinition extends ToolSchema {
41
42
  * @returns the canonical value declared by `output.schema`.
42
43
  */
43
44
  execute(args: unknown, exec: ToolRunContext): Promise<unknown>
45
+ /**
46
+ * Install execution-prepared content before `tools/post-execute` policies.
47
+ * The callback is captured when the call starts and runs once for a
48
+ * normalized outcome entering post-execute. Policy replacements remain
49
+ * authoritative; pipeline failures that bypass post-execute skip projection.
50
+ * @param exec - immutable execution identity and arguments.
51
+ * @param result - normalized result before post-execute policy.
52
+ * @returns replacement content, or undefined to preserve the renderer output.
53
+ */
54
+ projectContent?(exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): ContentBlock[] | undefined
44
55
  /**
45
56
  * Synchronous last-mile transform for model-facing content. The registry
46
57
  * snapshots this callback when execution starts and invokes it exactly once
@@ -172,7 +183,7 @@ interface ToolRestriction {
172
183
 
173
184
  ## Execution: extensible waterfalls plus monotonic policy
174
185
 
175
- `ctx.tools.execute()` accepts a caller-owned `ToolExecutionInput` with a required readonly `signal`, materializes its parsed JSON arguments once into a pipeline-owned `ToolExecution`, and runs that call through `tools/pre-execute` (the reorderable allow/deny/ask waterfall) → registered monotonic guards → `tools/execute` (around-dispatch wrappers) → `tools/post-execute` (inspect/replace the result) → optional definition-owned `finalizeContent` → `tools/result` (the immutable authoritative outcome). Only the `tools/execute` view may replace the required signal. The outcome is a `ToolExecutionResult`.
186
+ `ctx.tools.execute()` accepts a caller-owned `ToolExecutionInput` with a required readonly `signal`, materializes its parsed JSON arguments once into a pipeline-owned `ToolExecution`, and runs that call through `tools/pre-execute` (the reorderable allow/deny/ask waterfall) → registered monotonic guards → `tools/execute` (around-dispatch wrappers) → `projectContent` → `tools/post-execute` (inspect/replace the result) → optional definition-owned `finalizeContent` → `tools/result` (the immutable authoritative outcome). Only the `tools/execute` view may replace the required signal. The outcome is a `ToolExecutionResult`.
176
187
 
177
188
  ```ts type-equiv
178
189
  /** Opaque call identity that permits correlation without exposing mutable execution state. */
@@ -193,6 +204,8 @@ interface ToolExecutionInput {
193
204
  */
194
205
  readonly rootCallId?: ToolCallId
195
206
  readonly name: string
207
+ /** Binding-time tool schema for a PTC inner call; frozen by its producer and never logged. */
208
+ readonly schema?: ToolSchema
196
209
  /** Losslessly JSON-serializable parsed arguments (tools validate their own schema). */
197
210
  readonly arguments: unknown
198
211
  /** The agent on whose behalf the call runs (set by the agent loop). */
@@ -255,7 +268,7 @@ type ToolExecutionMode =
255
268
  | { kind: 'exclusive' }
256
269
  ```
257
270
 
258
- PTC mode's bridge additionally exposes each settled sub-dispatch to the `tools/ptc-dispatch-log` waterfall, which may change the durable event's copy of the content (the program's value and model-visible result remain untouched):
271
+ PTC bindings freeze their ToolSchema at construction and pass it through the scheduler into `ToolExecution.schema`; it is transient execution metadata. Before policy, each actually started sub-dispatch records only pairing ids, name, and normalized arguments. Neither start nor settle events serialize description, parameters, or schema. The bridge later exposes the settled call to the `tools/ptc-dispatch-log` waterfall, which may change the durable content copy while preserving the program value, model-visible outer result, and structured failure identity:
259
272
 
260
273
  ```ts type-equiv
261
274
  /**
@@ -265,14 +278,14 @@ PTC mode's bridge additionally exposes each settled sub-dispatch to the `tools/p
265
278
  * copy a listener may reshape. `content` is the RENDERED result projection
266
279
  * (what a native `tool/result` would carry) — the program itself received
267
280
  * the structured `value` (or just the error message on failure); only the
268
- * `tool/code-dispatch` event's copy changes.
281
+ * `tool/ptc-dispatch` event's copy changes.
269
282
  */
270
283
  interface PtcDispatchLog {
271
284
  /** The outer `run_code` execution. */
272
285
  readonly exec: ToolExecution
273
286
  /** The calling agent (the scope routing key and the spill owner), when the outer call has one. */
274
287
  readonly agent?: Agent
275
- /** Deterministic sub-call id (`<parent>:code:<n>`). */
288
+ /** Opaque sub-call id; new calls use `<parent>:ptc:<n>`. */
276
289
  readonly subCallId: ToolCallId
277
290
  /** The dispatched sub-tool name. */
278
291
  readonly name: string
@@ -370,7 +383,17 @@ interface ToolExecutionFailure {
370
383
  type ToolExecutionResult = ToolExecutionSuccess | ToolExecutionFailure
371
384
  ```
372
385
 
373
- The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/code-dispatch` stores the sub-call's rendered `content` and `isError` verbatim. Replay reproduces presentation but cannot reconstruct canonical intermediate values.
386
+ ```ts type-equiv
387
+ /** Structured error metadata for a failed tool call (alongside the model-facing text). */
388
+ interface ToolErrorInfo {
389
+ name: string
390
+ code: string
391
+ /** Optional raw user-facing detail; durable projections preserve it but model-facing content does not include it. */
392
+ reason?: string
393
+ }
394
+ ```
395
+
396
+ The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, and optional structured `error`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content.
374
397
 
375
398
  On success the registry snapshots and validates the body value, freezes it, and invokes the pure renderer plus the optional top-level-call metadata projector. It separately materializes the durable presentation fields immediately before `tools/result`; an invalid value, renderer/projector failure, or non-JSON presentation becomes a JSON-safe `isError`. The final live observer therefore sees the exact execution-local value beside fields safe for the later durable append.
376
399
 
@@ -380,15 +403,19 @@ Each interception waterfall returns a typed **Decision** (the idiom shared with
380
403
 
381
404
  ```ts type-equiv
382
405
  /**
383
- * Pre-dispatch decision. `allow` runs the call; `deny` materializes an error;
384
- * `ask` runs only after an approval service returns `allowed-once` and otherwise
385
- * denies. Input rewriting is excluded because arguments are already logged and
406
+ * Pre-dispatch decision. `allow` runs the call; `deny` materializes its
407
+ * model-facing reason and optional structured error identity; `cancel` selects
408
+ * the canonical cancellation result without presenting a policy denial; `ask`
409
+ * runs only after an approval service returns `allowed-once` and otherwise
410
+ * denies; its `reason` is the audited approval reason and its optional
411
+ * `displayReason` is the localized prompt text. Input rewriting is excluded because arguments are already logged and
386
412
  * presented.
387
413
  */
388
414
  type PreToolDecision =
389
415
  | { kind: 'allow' }
390
- | { kind: 'deny'; reason: string }
391
- | { kind: 'ask'; reason?: string }
416
+ | { kind: 'deny'; reason: string; info?: ToolErrorInfo }
417
+ | { kind: 'cancel' }
418
+ | { kind: 'ask'; reason?: string; displayReason?: { readonly en: string; readonly [locale: string]: string } }
392
419
  ```
393
420
 
394
421
  ```ts type-equiv
@@ -402,7 +429,7 @@ type PostToolDecision =
402
429
  | { kind: 'block'; feedback: ContentBlock[]; additionalContexts?: UserMessage[] }
403
430
  ```
404
431
 
405
- Call `next()` for the default or return a decision to short-circuit. Pre-policy may deny or ask; only `allowed-once` proceeds, while a non-grant, missing approval channel or service, or agent-less request becomes a denial. Guards may still impose a final denial. Arguments cannot be rewritten because history, audit, UI, and execution must agree.
432
+ Call `next()` for the default or return a decision to short-circuit. Pre-policy may deny or ask; only `allowed-once` proceeds, while a non-grant, missing approval channel or service, or agent-less request becomes a denial. A deny may attach structured identity and user-facing detail without changing its model-facing reason. Guards may still impose a final denial. Arguments cannot be rewritten because history, audit, UI, and execution must agree.
406
433
 
407
434
  Post-policy may replace either content or value, never both. Content replacement preserves the canonical value and existing metadata; value replacement is revalidated and recomputes content/metadata; a block removes the value and becomes an `isError` containing corrective feedback. Content replacement is presentation policy, not confidentiality policy: a listener that must hide the programmatic value blocks or replaces it. `tools/result` receives the frozen execution and result after normalization; observers cannot transform them, and observer failures are contained. Unknown and throwing tools both become structured errors (`ToolNotFoundError` maps to `UNKNOWN_TOOL`), so the call fails without ending the turn.
408
435
 
@@ -654,11 +681,12 @@ Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deep
654
681
 
655
682
  #### `tools/pre-execute` — waterfall
656
683
 
657
- Allow, deny, or ask before dispatch. `next()` delegates to allow; missing approval support turns `ask` into denial. Async gates must observe `exec.signal`; the registry rechecks cancellation after they settle but never abandons their promise. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's calls.
684
+ Allow, deny, cancel, or ask before dispatch. `next()` delegates to allow; `cancel` selects the canonical pre-dispatch cancellation result, and missing approval support turns `ask` into denial. Async gates must observe `exec.signal`; the registry rechecks cancellation after they settle but never abandons their promise. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's calls.
658
685
 
659
686
  ```ts cordis-catalog
660
687
  /**
661
- * Allow, deny, or ask before dispatch. `next()` delegates to allow; missing
688
+ * Allow, deny, cancel, or ask before dispatch. `next()` delegates to allow;
689
+ * `cancel` selects the canonical pre-dispatch cancellation result, and missing
662
690
  * approval support turns `ask` into denial. Async gates must observe
663
691
  * `exec.signal`; the registry rechecks cancellation after they settle but
664
692
  * never abandons their promise.
@@ -677,13 +705,13 @@ Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deep
677
705
 
678
706
  #### `tools/ptc-dispatch-log` — waterfall
679
707
 
680
- Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/code-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy's preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.
708
+ Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/ptc-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy's preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.
681
709
 
682
710
  ```ts cordis-catalog
683
711
  /**
684
712
  * Allow a listener to replace content in the DURABLE LOG COPY of one
685
713
  * `run_code` sub-dispatch outcome before the bridge appends its
686
- * `tool/code-dispatch` event. `next()` keeps the
714
+ * `tool/ptc-dispatch` event. `next()` keeps the
687
715
  * content unchanged; a listener may return replacement blocks (e.g. the
688
716
  * spill policy's preview + locator for an oversized text result). Only the
689
717
  * logged copy is affected — the program already received the complete
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  editSource: "docs/subsystems/typert.md"
3
+ rawMarkdownPath: "en/reference/subsystems/typert.md"
3
4
  outline: [2,3]
4
5
  ---
5
6
 
@@ -41,7 +42,7 @@ interface TypertLookupDefinition {
41
42
 
42
43
  ## Invocation descriptors
43
44
 
44
- An `InvocationDescriptor` is local reflection, not a wire message. Host and consumer builds generate corresponding descriptors; the request sends only the endpoint and named `args`. Strict codecs carry generated schemas, while SRC codecs enforce JSON-safe values without structural type recovery. Cancellation is an out-of-band carrier signal injected after business parameters and never enters `args`.
45
+ An `InvocationDescriptor` is local reflection, not a wire message. Host and consumer builds generate corresponding descriptors; the request sends only the endpoint and named `args`. Strict codecs carry generated schema factories, while SRC codecs enforce JSON-safe inputs without structural type recovery. Unary result codecs can supply `encode()` for byte-containing subtrees and `decode()` for recursive native-byte validation; Client declarations narrow every `Uint8Array` to `ArrayBuffer` backing. Pure JSON results need neither byte detection nor Client decoding. Cancellation is an out-of-band carrier signal injected after business parameters and never enters `args`.
45
46
 
46
47
  ```ts type-equiv
47
48
  /** Codec attached to one invocation parameter or result. */
@@ -49,7 +50,21 @@ type TypertCodec =
49
50
  | {
50
51
  readonly mode: 'strict'
51
52
  readonly typeSymbol: string
52
- readonly schema: TypertSchema
53
+ /** Materialize and return the process-realm schema on first boundary use. */
54
+ readonly create: () => TypertSchema
55
+ /**
56
+ * Decode a unary result whose fields require type-specific handling.
57
+ * @param value - result reconstructed by the RPC carrier.
58
+ * @returns the validated result, retaining native byte views.
59
+ */
60
+ readonly decode?: (value: unknown) => unknown
61
+ /**
62
+ * Project typed binary fields into RPC result attachments.
63
+ * @param value - native unary result.
64
+ * @param writeBytes - records a byte view at its result-relative path and returns its JSON placeholder.
65
+ * @returns JSON metadata with untouched JSON subtrees retained.
66
+ */
67
+ readonly encode?: (value: unknown, writeBytes: (bytes: Uint8Array, path: readonly (string | number)[]) => null) => unknown
53
68
  }
54
69
  | {
55
70
  readonly mode: 'src-json'
@@ -87,7 +102,7 @@ interface InvocationDescriptor {
87
102
  readonly method: string
88
103
  /** Service member invoked when the exported method name is an alias. */
89
104
  readonly implementation?: string
90
- /** Absent for unary calls; stream calls validate and deliver every yielded item. */
105
+ /** Absent for unary calls; stream calls deliver every yielded item as the Host produced it. */
91
106
  readonly mode?: 'stream'
92
107
  /** Receiver selection mode. */
93
108
  readonly invocation:
@@ -107,6 +122,16 @@ interface InvocationDescriptor {
107
122
  }
108
123
  /** Ordered business parameters. */
109
124
  readonly parameters: readonly InvocationParameterDescriptor[]
125
+ /**
126
+ * Client-to-Host items of the same logical stream, generated from the `In`
127
+ * type argument of the method's `RemoteStream<Out, In>` return type; absent
128
+ * when `In` is `never`. The method reads the items through
129
+ * `RemoteInvocation.uplink()`, so nothing enters the parameter list.
130
+ */
131
+ readonly uplink?: {
132
+ /** Codec validating every uplink item before `uplink()` delivers it. */
133
+ readonly codec: TypertCodec
134
+ }
110
135
  /** Transport cancellation injected after business parameters instead of entering wire args. */
111
136
  readonly cancellation?: {
112
137
  /** Reserved final Host method parameter. */
@@ -119,6 +144,106 @@ interface InvocationDescriptor {
119
144
  }
120
145
  ```
121
146
 
147
+ The Host alias `RemoteStream<Out, In>` names both directions of one stream, and the receiving method reads its call context as `this.ctx.invocation`:
148
+
149
+ ```ts type-equiv
150
+ /**
151
+ * One Remote stream as a Host method returns it: the items it yields to the
152
+ * Client, iterated as a plain `AsyncIterable<Out>`. `In` is the type of the
153
+ * items the Client may send back on the same logical stream, read through
154
+ * `RemoteInvocation.uplink()`; it is carried only as a type-level marker. The
155
+ * default `never` declares a method that reads none, and its descriptor
156
+ * carries no uplink codec. A generated Client stream method returns the same
157
+ * stream as a `RemoteStreamHandle<Out, In>`.
158
+ * @template Out - item type the Host method yields.
159
+ * @template In - item type the Client may send; `never` when the method reads none.
160
+ */
161
+ type RemoteStream<Out, In = never> = AsyncIterable<Out> & { readonly [STREAM_UPLINK]?: In }
162
+ ```
163
+
164
+ ```ts type-equiv
165
+ /**
166
+ * One open Remote stream as the Client holds it: the downlink items as an
167
+ * `AsyncIterable`, plus the uplink and cancellation of the same logical
168
+ * stream. A generated Client stream method returns it, and calling that
169
+ * method opens the stream: a holder that neither iterates nor disposes the
170
+ * handle keeps the Host stream alive. A handle stands for one generation:
171
+ * when the carrier is lost, iteration fails with the carrier error and the
172
+ * handle is finished.
173
+ * @template Out - item type the Host method yields.
174
+ * @template In - item type the Client may send; `never` when the method reads none.
175
+ */
176
+ interface RemoteStreamHandle<Out, In> extends AsyncIterable<Out> {
177
+ /**
178
+ * Send one uplink item. Items sent before the stream has opened are queued
179
+ * and sent once the `open` frame is on the wire. A top-level `undefined`
180
+ * travels as an `item` frame without `value`.
181
+ * @param item - item the Host validates against the method's uplink codec.
182
+ * @throws {Error} when the item is not a lossless JSON value, when `end()`
183
+ * was called, or once the stream has terminated.
184
+ */
185
+ send(item: In): void
186
+ /** Half-close the uplink: the Host's `uplink()` iteration ends. Idempotent; ignored after termination. */
187
+ end(): void
188
+ /**
189
+ * Cancel the logical stream: send `cancel` unless a terminal frame has
190
+ * arrived, and end the downlink iterator quietly. Breaking out of
191
+ * `for await` early does the same.
192
+ */
193
+ dispose(): void
194
+ }
195
+ ```
196
+
197
+ ```ts type-equiv
198
+ /**
199
+ * One Peer's session on this Host. Connection owns it: `ctx` is the Cordis
200
+ * scope that owns connection-lifetime registrations and is disposed with the
201
+ * Peer. Who the Peer is and what it may do are not recorded here.
202
+ */
203
+ interface PeerScope {
204
+ readonly id: PeerId
205
+ readonly ctx: Context
206
+ /**
207
+ * Tear down every registration made through `ctx`.
208
+ * @returns settles once the scope has quiesced; racing calls share one completion.
209
+ */
210
+ dispose(): Promise<void>
211
+ }
212
+ ```
213
+
214
+ ```ts type-equiv
215
+ /**
216
+ * The context of one Remote call, reachable inside the receiving method as
217
+ * `this.ctx.invocation`. The Gateway derives the receiver from a Context that
218
+ * carries it, so no parameter is injected and nothing crosses the wire.
219
+ */
220
+ interface RemoteInvocation {
221
+ readonly request: {
222
+ readonly namespace: string
223
+ readonly method: string
224
+ readonly args: Readonly<Record<string, unknown>>
225
+ }
226
+ /** Cordis service key of the receiving Service. */
227
+ readonly service: string
228
+ /** Peer the call speaks for; an in-process carrier speaks for the operator. */
229
+ readonly peer: PeerScope
230
+ /** Carrier cancellation: Client cancel, socket close, or an uplink failure. */
231
+ readonly signal: AbortSignal
232
+ /**
233
+ * The Client's uplink items for this call. Available once; a second call
234
+ * throws. With an uplink codec on the descriptor every item is decoded to
235
+ * `In`; without one items arrive as `unknown` after a JSON-safety check.
236
+ * Iteration ends when the Client ends its uplink; when the method finishes
237
+ * its downlink the Gateway calls the iterator's `return()` and unread items
238
+ * are dropped. `In` is the caller's assertion: the runtime decodes by the
239
+ * descriptor and does not cross-check it.
240
+ * @template In - item type the caller reads; the descriptor codec decides what arrives.
241
+ * @returns the single-consumer uplink iterable.
242
+ */
243
+ uplink<In = unknown>(): AsyncIterable<In>
244
+ }
245
+ ```
246
+
122
247
  ## Typert registry
123
248
 
124
249
  `ctx.typert` separates current-environment descriptors, explicitly selected Remote contributions, lookup providers, and scoped Context providers. A lookup provider owns the stable wire declaration and default resolver; Host composition can configure an effect-scoped synchronous or asynchronous resolver for the same key, and unloading that configuration restores the default policy. Registrations are Cordis-owned effects and return awaitable disposers.
@@ -153,6 +278,13 @@ interface InvokeRemoteRequest {
153
278
  readonly method: string
154
279
  /** Named wire values; fields must exactly match the descriptor. */
155
280
  readonly args: Readonly<Record<string, unknown>>
281
+ /**
282
+ * Client uplink items of this logical stream, delivered to the method through
283
+ * `invocation.uplink()`; absent means an immediately ended iterable.
284
+ */
285
+ readonly uplink?: AsyncIterable<unknown>
286
+ /** Peer the call speaks for; absent means an in-process carrier, answered as the operator. */
287
+ readonly peer?: PeerScope
156
288
  /** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
157
289
  readonly signal?: AbortSignal
158
290
  }
@@ -174,10 +306,12 @@ type TypertGatewayErrorCode =
174
306
  | 'gateway/lookup-not-found'
175
307
  | 'gateway/lookup-unavailable'
176
308
  | 'gateway/method-unavailable'
309
+ | 'gateway/protocol'
177
310
  | 'gateway/provider-mismatch'
178
311
  | 'gateway/result-invalid'
179
312
  | 'gateway/service-unavailable'
180
313
  | 'gateway/signature-invalid'
314
+ | 'gateway/uplink-overflow'
181
315
  ```
182
316
 
183
317
  ```ts type-equiv
@@ -185,6 +319,11 @@ type TypertGatewayErrorCode =
185
319
  interface TypertGateway {
186
320
  /** Carrier adapter shared by WebSocket and in-process transports. */
187
321
  readonly wireStream: TypertGatewayWireStream
322
+ /**
323
+ * Check for an active Client event stream.
324
+ * @returns whether a stream is open and has not been cancelled.
325
+ */
326
+ hasLiveClient(): boolean
188
327
  /**
189
328
  * Register the application-selected forwarded-event source.
190
329
  * @param source - stream factory installed by the Remote assembly.
@@ -204,7 +343,7 @@ interface TypertGateway {
204
343
  invoke(request: InvokeRemoteRequest): Promise<unknown>
205
344
  /**
206
345
  * Open one live stream Remote method without assuming a physical carrier.
207
- * @param request - decoded endpoint and named wire arguments.
346
+ * @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
208
347
  * @returns a cancellation-aware iterable over the business results.
209
348
  */
210
349
  stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
@@ -264,14 +403,14 @@ register(contribution: TypertContribution): TypertDisposer
264
403
  /**
265
404
  * Look up one schema by `<package>#<name>`.
266
405
  * @param key - global schema key.
267
- * @returns the live schema record, or `undefined` when absent.
406
+ * @returns a record containing the cached schema, or `undefined` when absent.
268
407
  */
269
408
  get(key: string): TypertSchemaRecord | undefined
270
409
 
271
410
  /**
272
411
  * Resolve one required schema.
273
412
  * @param key - global schema key.
274
- * @returns the live schema record.
413
+ * @returns a record containing the cached schema.
275
414
  * @throws when the key is malformed, the package face is absent, or the schema is not contributed.
276
415
  */
277
416
  resolve(key: string): TypertSchemaRecord
@@ -279,7 +418,7 @@ resolve(key: string): TypertSchemaRecord
279
418
  /**
280
419
  * Enumerate live schemas in registration order.
281
420
  * @param filter - optional package and face restriction.
282
- * @returns matching schema records.
421
+ * @returns matching records containing the cached schemas.
283
422
  */
284
423
  list(filter: TypertSchemaFilter = {}): TypertSchemaRecord[]
285
424
 
@@ -307,8 +446,6 @@ listPackages(filter: TypertPackageFilter = {}): TypertPackageRecord[]
307
446
  toJSONSchema(key: string, params?: z.core.ToJSONSchemaParams): z.core.JSONSchema.BaseSchema
308
447
  ```
309
448
 
310
- Types: [TypertContribution](./invariants.md) · [TypertFace](./invariants.md) · [TypertPackageFilter](./invariants.md) · [TypertPackageRecord](./invariants.md) · [TypertSchemaFilter](./invariants.md) · [TypertSchemaRecord](./invariants.md)
311
-
312
449
  Source: [`packages/typert/registry/src/service.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/typert/registry/src/service.ts)
313
450
 
314
451
  <a id="ctxtypertgateway--typertgatewayservice"></a>
@@ -318,6 +455,12 @@ Source: [`packages/typert/registry/src/service.ts`](https://github.com/deepseek-
318
455
  Resolve strict generated definitions or conservative SRC markers against current Cordis Services and Typert providers.
319
456
 
320
457
  ```ts cordis-catalog
458
+ /**
459
+ * Check for an active Client event stream.
460
+ * @returns whether a stream is open and has not been cancelled.
461
+ */
462
+ hasLiveClient(): boolean
463
+
321
464
  /**
322
465
  * Register the sole application-selected forwarded-event source.
323
466
  * @param source - stream factory installed by the Remote assembly.
@@ -336,7 +479,7 @@ async invoke(request: InvokeRemoteRequest): Promise<unknown>
336
479
 
337
480
  /**
338
481
  * Open one live stream Remote method without assuming a physical carrier.
339
- * @param request - decoded endpoint and named wire arguments.
482
+ * @param request - decoded endpoint, named wire arguments, and the Client uplink when the carrier has one.
340
483
  * @returns a cancellation-aware iterable over the business results.
341
484
  */
342
485
  async stream(request: InvokeRemoteRequest): Promise<AsyncIterable<unknown>>
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  editSource: "docs/subsystems/user-questions.md"
3
+ rawMarkdownPath: "en/reference/subsystems/user-questions.md"
3
4
  outline: [2,3]
4
5
  ---
5
6
 
@@ -44,6 +45,8 @@ type AskUserQuestionIntent = {
44
45
  * An `approve` naming no option of its own question is rejected at `ask()`.
45
46
  */
46
47
  approve: string
48
+ /** Logged tool invocation whose arguments contain the reviewed plan. */
49
+ callId?: ToolCallId
47
50
  }
48
51
  ```
49
52
 
@@ -104,9 +107,96 @@ interface AskUserQuestionAnswer {
104
107
  }
105
108
  ```
106
109
 
110
+ Timed answerers receive `wait: { callId, timed: true }`. The call id identifies the card and the foreground wait. The Client calls `attachWait` to claim the wait and obtain its remaining duration; transport forwards the original event without inspecting or rewriting these fields. A `wait` without `timed` identifies an indefinite card-keyed request. An absent `wait` identifies a blocking request without a card key.
111
+
112
+ ```ts type-equiv
113
+ /** Client-safe payload declared for the user-question answerer waterfall. */
114
+ interface AskUserQuestionRequestEvent {
115
+ /** Questions to display. */
116
+ questions: AskUserQuestionItem[]
117
+ /** Agent identity projected to the corresponding Client Context in transit. */
118
+ agent?: Agent
119
+ /** Cancellation lifetime of the pending request. */
120
+ signal?: AbortSignal
121
+ /**
122
+ * Tool call the Client card is keyed by. Timed answerers attach to the
123
+ * business wait stream before starting their local countdown.
124
+ */
125
+ wait?: {
126
+ /** Tool call the Client card is keyed by. */
127
+ callId: ToolCallId
128
+ /** True for a foreground wait that requires a Client claim; absent for indefinite waits. */
129
+ timed?: boolean
130
+ }
131
+ }
132
+ ```
133
+
134
+ ## Timed questions and late replies
135
+
136
+ A timed question waits for a bounded foreground window and then lets the agent continue independent work. If the user answers inside the window, the tool returns the answer batch; otherwise `TimedUserQuestionResult` is `{ pending: true, callId }`. Pending means the question is still answerable; it is not an empty answer, a refusal, a confirmation, or permission.
137
+
138
+ ```ts type-equiv
139
+ /** Timed ask result returned when the foreground answer window closes. */
140
+ type TimedUserQuestionResult = AskUserQuestionAnswer | { pending: true; callId: ToolCallId }
141
+ ```
142
+
143
+ A Client claim is a business Remote stream, not a Gateway delivery. `TimedQuestionWait` holds the original Host deadline and runs its timer only while no claim exists. Its `attachWait` stream yields the current remaining duration, and the Client counts down with its own clock. Focus, editing, and Take time stay local. Stream cancellation releases that claim; after the last claim leaves, the Host resumes the original deadline. An unattended timeout aborts the foreground waterfall's private signal and returns pending without cancelling the Turn. Gateway and `api-remotes` contain no question-specific timing policy.
144
+
145
+ The `userQuestions` Session projection folds existing events into the answerable question set and the settled one; no wait state, focus state, or deadline is logged. Each `request/header` records the exact tool schemas the model saw. Native calls are tracked only when that header declares the timed `ask_user_question` schema with a `timeout` parameter; the blocking legacy tool never declares it. A native `tool/call` opens a question. A `tool/result` marks it `continued` only when it carries the pending payload or is the synthetic `TOOL_OUTCOME_UNKNOWN` result Session resume repair appends; an answer batch moves it into `settled` with that batch, and any failure drops it. A `run_code` PTC sub-call enters the projection when its `tool/ptc-dispatch` result is pending, even though the request header exposes only `run_code`. A late reply moves a continued question into `settled` when its message is admitted as `user/message`, together with the answer batch read out of that message: the timed call's own result recorded the timeout, so a transcript row has nowhere else to read what the user finally chose. A queued reply can be canceled before admission and leaves the question answerable. A reply whose text carries no readable batch settles the call with no answers; one naming a call that is not active changes nothing.
146
+
147
+ ```ts type-equiv
148
+ /** `open` while the tool call may still return the answer; `continued` once the answer can only arrive as a new turn. */
149
+ type UserQuestionState = 'open' | 'continued'
150
+ ```
151
+
152
+ ```ts type-equiv
153
+ /** One unanswered timed `ask_user_question` call reconstructed from the Session log. */
154
+ interface PendingUserQuestion {
155
+ readonly callId: ToolCallId
156
+ readonly questions: readonly AskUserQuestionItem[]
157
+ readonly state: UserQuestionState
158
+ }
159
+ ```
160
+
161
+ ```ts type-equiv
162
+ /**
163
+ * One timed `ask_user_question` call and the answers it settled with: the
164
+ * batch its own result carried when the user answered inside the window,
165
+ * otherwise the batch its late reply carried, because that call's own result
166
+ * recorded the timeout. A transcript row reads what the user finally answered
167
+ * from here, and only a call listed here was a timed one.
168
+ */
169
+ interface SettledUserQuestion {
170
+ /** The settled call. */
171
+ readonly callId: ToolCallId
172
+ /** The recorded batch, one entry per question; empty when the late reply carried none. */
173
+ readonly answers: readonly AskUserQuestionAnswerItem[]
174
+ }
175
+ ```
176
+
177
+ ```ts type-equiv
178
+ /**
179
+ * Both halves of one Session's timed `ask_user_question` state, as every
180
+ * Client reads them. A call made while the blocking legacy tool was in
181
+ * effect appears in neither half.
182
+ */
183
+ interface UserQuestionProjectionView {
184
+ /** Calls that can still take an answer, in ask order. */
185
+ readonly active: readonly PendingUserQuestion[]
186
+ /** Calls an answer settled, in settlement order. */
187
+ readonly settled: readonly SettledUserQuestion[]
188
+ }
189
+ ```
190
+
191
+ An open question accepts answers only through the waterfall. Once it is `continued`, the `answer` Remote method queues a user message for the owning agent and wakes it if idle. The message has source `user-question-reply`, outcome `answered`, and an `answer_to_pending_question` payload. The method returns `false` for an open or unknown call, rejects a second queued reply with `REPLY_QUEUED` even after a Host restart, and rejects incomplete or duplicate answer batches with `BAD_ANSWER`.
192
+
193
+ Closing the Client panel sends nothing. A foreground timeout ends only the tool wait. Continued questions have no deadline; they stay answerable until a reply is admitted.
194
+
195
+ After a Host restart, the Remote layer resumes the root agent when the Session reopens. A late reply then enters a new turn.
196
+
107
197
  ## Errors
108
198
 
109
- `UserQuestionError` extends `HarnessError`, so `ctx.tools.execute()` preserves `{ name, code }` for model-facing tool failures such as `EMPTY_QUESTIONS`, `NO_PROVIDER`, `ASK_ABORTED`, or UI-side cancellation.
199
+ `UserQuestionError` extends `HarnessError`, so `ctx.tools.execute()` preserves `{ name, code }` for model-facing tool failures such as `EMPTY_QUESTIONS`, `BAD_INTENT`, `NO_PROVIDER`, `ASK_ABORTED`, or UI-side cancellation.
110
200
 
111
201
  ```ts type-equiv
112
202
  /** Stable error taxonomy for user-questions failures. */
@@ -133,6 +223,44 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
133
223
  `ctx.userQuestions`: validation plus the scoped answerer waterfall.
134
224
 
135
225
  ```ts cordis-catalog
226
+ /**
227
+ * Answer a continued question. The reply is steered into the agent as a
228
+ * user message whose source names the call; that message is also the
229
+ * record that closes the question in the projection.
230
+ * @param agent - Live root agent for the owning Session.
231
+ * @param callId - Continued question identity.
232
+ * @param answer - Complete structured answer batch, one item per question of the call.
233
+ * @returns Whether the question is still continued; an accepted reply stays
234
+ * queued until the agent admits its user message.
235
+ * @throws {UserQuestionError} `BAD_ANSWER` when the batch does not name each
236
+ * question of the call exactly once, or `REPLY_QUEUED` when a reply is
237
+ * already waiting for admission.
238
+ */
239
+ @Remote answer(agent: Agent, callId: ToolCallId, answer: AskUserQuestionAnswer): boolean
240
+
241
+ /**
242
+ * Let one answer UI hold a live timed wait. Closing the stream releases its claim.
243
+ * @param agent - Live root agent owning the question.
244
+ * @param callId - Foreground tool call to attach to.
245
+ * @param signal - Remote stream cancellation, including Client disconnect.
246
+ * @returns One Host-computed remaining duration, or no frames once the wait ended.
247
+ */
248
+ @Remote({ mode: 'stream' }) async *attachWait(agent: Agent, callId: ToolCallId, signal: AbortSignal): AsyncIterable<{ remainingMs: number }>
249
+
250
+ /**
251
+ * Foreground wait whose first settlement the Client decides: the Client
252
+ * rejects with `ASK_TIMED_OUT` when its countdown ends, and this method maps
253
+ * that code to the pending result.
254
+ * @param request - Questions, live owner agent, and abort signal.
255
+ * @param callId - Tool call identity the Client card is keyed by.
256
+ * @param timeoutMs - Positive foreground wait in milliseconds.
257
+ * @returns The answer when it arrives inside the window, otherwise a pending
258
+ * result, also when no connected Client claimed the request by the deadline.
259
+ * @throws {UserQuestionError} `BAD_TIMEOUT` for a non-integer, non-positive,
260
+ * or oversized wait.
261
+ */
262
+ async askTimed( request: AskUserQuestionRequest & { agent: Agent }, callId: ToolCallId, timeoutMs: number, ): Promise<TimedUserQuestionResult>
263
+
136
264
  /**
137
265
  * Ask the scoped answerer waterfall and wait for the user's answer.
138
266
  *
@@ -152,6 +280,8 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
152
280
  async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
153
281
  ```
154
282
 
283
+ Types: [Agent](./core.md) · [ToolCallId](./core.md)
284
+
155
285
  Source: [`packages/interaction/user-questions/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/user-questions/src/index.ts)
156
286
 
157
287
  <a id="user-questions-events"></a>