dsh-plugin-dev-kb 1.6.0 → 1.8.1

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 (622) hide show
  1. package/CHANGELOG.md +186 -141
  2. package/README.en.md +172 -155
  3. package/README.md +183 -163
  4. package/kb/INDEX.md +236 -234
  5. package/kb/README.md +88 -83
  6. package/kb/extra/AGENTS.md +77 -77
  7. package/kb/extra/cli-help.md +15 -7
  8. package/kb/extra/cli-help.zh.md +15 -7
  9. package/kb/extra/cookbook/adding-a-plugin-preview.md +18 -25
  10. package/kb/extra/cookbook/adding-a-plugin-preview.zh.md +18 -25
  11. package/kb/extra/cookbook/reviewing-persistence-type-changes.md +1 -1
  12. package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +1 -1
  13. package/kb/extra/cookbook/reviewing-ui-design.md +166 -0
  14. package/kb/extra/cookbook/reviewing-ui-design.zh.md +166 -0
  15. package/kb/extra/deepseek-llm-api-wire-extensions.md +162 -162
  16. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +162 -162
  17. package/kb/extra/defensive-patterns/conversation-and-session.md +2 -2
  18. package/kb/extra/defensive-patterns/conversation-and-session.zh.md +2 -2
  19. package/kb/extra/defensive-patterns/general.md +2 -0
  20. package/kb/extra/defensive-patterns/general.zh.md +2 -0
  21. package/kb/extra/defensive-patterns/package-surface.md +233 -231
  22. package/kb/extra/defensive-patterns/package-surface.zh.md +233 -231
  23. package/kb/extra/defensive-patterns/remote-and-api.md +117 -115
  24. package/kb/extra/defensive-patterns/remote-and-api.zh.md +117 -115
  25. package/kb/extra/development.md +221 -214
  26. package/kb/extra/development.zh.md +228 -221
  27. package/kb/extra/event-producer-consumer.md +133 -110
  28. package/kb/extra/event-producer-consumer.zh.md +135 -112
  29. package/kb/extra/i18n/README.md +2 -0
  30. package/kb/extra/i18n/README.zh.md +2 -0
  31. package/kb/extra/module-graph.md +1961 -1776
  32. package/kb/extra/module-graph.zh.md +1963 -1778
  33. package/kb/extra/persistence-changes/2026-10-13-liveshare-share-viewer-principal.md +60 -0
  34. package/kb/extra/persistence-changes/2026-10-13-liveshare-share-viewer-principal.zh.md +60 -0
  35. package/kb/extra/persistence-changes/2026-10-19-session-team-mode.md +48 -0
  36. package/kb/extra/persistence-changes/2026-10-19-session-team-mode.zh.md +48 -0
  37. package/kb/extra/persistence-changes/2026-10-22-action-card-status.md +60 -0
  38. package/kb/extra/persistence-changes/2026-10-22-action-card-status.zh.md +60 -0
  39. package/kb/extra/persistence-changes/2026-10-25-skill-catalog-incomplete.md +60 -0
  40. package/kb/extra/persistence-changes/2026-10-25-skill-catalog-incomplete.zh.md +60 -0
  41. package/kb/extra/persistence-changes/2026-10-27-retry-control-input.md +60 -0
  42. package/kb/extra/persistence-changes/2026-10-27-retry-control-input.zh.md +60 -0
  43. package/kb/extra/persistence-changes/2026-10-27-subagent-settlement-attribution.md +60 -0
  44. package/kb/extra/persistence-changes/2026-10-27-subagent-settlement-attribution.zh.md +60 -0
  45. package/kb/extra/persistence-changes/2026-11-02-subagent-catalog-names.md +48 -0
  46. package/kb/extra/persistence-changes/2026-11-02-subagent-catalog-names.zh.md +48 -0
  47. package/kb/extra/persistence-changes/2026-11-02-team-task-owner-names.md +48 -0
  48. package/kb/extra/persistence-changes/2026-11-02-team-task-owner-names.zh.md +48 -0
  49. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.md +60 -0
  50. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.zh.md +60 -0
  51. package/kb/extra/persistence-changes/README.md +92 -90
  52. package/kb/extra/persistence-changes/README.zh.md +92 -90
  53. package/kb/extra/persistence-changes/historical-formats/README.md +75 -75
  54. package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -75
  55. package/kb/extra/persistence-changes/releases/README.md +103 -103
  56. package/kb/extra/persistence-changes/releases/README.zh.md +103 -103
  57. package/kb/extra/rescope.md +55 -53
  58. package/kb/extra/rescope.zh.md +55 -53
  59. package/kb/extra/subsystems/agent-team.md +38 -75
  60. package/kb/extra/subsystems/agent-team.zh.md +38 -75
  61. package/kb/extra/subsystems/attachment.md +36 -13
  62. package/kb/extra/subsystems/attachment.zh.md +36 -13
  63. package/kb/extra/subsystems/boot.md +631 -447
  64. package/kb/extra/subsystems/boot.zh.md +631 -447
  65. package/kb/extra/subsystems/computer-use.md +179 -59
  66. package/kb/extra/subsystems/computer-use.zh.md +179 -59
  67. package/kb/extra/subsystems/deliverables.md +2 -0
  68. package/kb/extra/subsystems/deliverables.zh.md +2 -0
  69. package/kb/extra/subsystems/extensions.md +387 -384
  70. package/kb/extra/subsystems/extensions.zh.md +387 -384
  71. package/kb/extra/subsystems/feedback.md +418 -400
  72. package/kb/extra/subsystems/feedback.zh.md +418 -400
  73. package/kb/extra/subsystems/forge.md +2169 -0
  74. package/kb/extra/subsystems/forge.zh.md +2171 -0
  75. package/kb/extra/subsystems/liveshare.md +167 -0
  76. package/kb/extra/subsystems/liveshare.zh.md +167 -0
  77. package/kb/extra/subsystems/mcp.md +237 -139
  78. package/kb/extra/subsystems/mcp.zh.md +237 -139
  79. package/kb/extra/subsystems/office-kit.md +122 -0
  80. package/kb/extra/subsystems/office-kit.zh.md +122 -0
  81. package/kb/extra/subsystems/working-directory.md +95 -64
  82. package/kb/extra/subsystems/working-directory.zh.md +95 -64
  83. package/kb/extra/subsystems/worktrees.md +187 -76
  84. package/kb/extra/subsystems/worktrees.zh.md +187 -76
  85. package/kb/extra/testing.md +1 -1
  86. package/kb/extra/testing.zh.md +1 -1
  87. package/kb/extra/ui-design-review-cases.md +445 -0
  88. package/kb/extra/ui-design-review-cases.zh.md +445 -0
  89. package/kb/extra/ui-radius.md +3 -1
  90. package/kb/extra/ui-radius.zh.md +3 -1
  91. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -21
  92. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -21
  93. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +1 -1
  94. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +1 -1
  95. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.md +24 -0
  96. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.zh.md +24 -0
  97. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.md +25 -0
  98. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.zh.md +25 -0
  99. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.md +30 -0
  100. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.zh.md +30 -0
  101. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.md +28 -0
  102. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.zh.md +28 -0
  103. package/kb/extra/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.md +24 -0
  104. package/kb/extra/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.zh.md +24 -0
  105. package/kb/extra/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.md +23 -0
  106. package/kb/extra/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.zh.md +23 -0
  107. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.md +20 -0
  108. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.zh.md +20 -0
  109. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.md +31 -0
  110. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.zh.md +31 -0
  111. package/kb/extra/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.md +34 -0
  112. package/kb/extra/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.zh.md +34 -0
  113. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.md +20 -0
  114. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.zh.md +20 -0
  115. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.md +18 -0
  116. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.zh.md +18 -0
  117. package/kb/extra/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.md +18 -0
  118. package/kb/extra/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.zh.md +18 -0
  119. package/kb/extra/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.md +25 -0
  120. package/kb/extra/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.zh.md +25 -0
  121. package/kb/extra/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.md +23 -0
  122. package/kb/extra/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.zh.md +23 -0
  123. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.md +22 -0
  124. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.zh.md +22 -0
  125. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.md +18 -0
  126. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.zh.md +18 -0
  127. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.md +17 -0
  128. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.zh.md +17 -0
  129. package/kb/extra/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.md +19 -0
  130. package/kb/extra/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.zh.md +19 -0
  131. package/kb/extra/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.md +27 -0
  132. package/kb/extra/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.zh.md +27 -0
  133. package/kb/extra/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.md +18 -0
  134. package/kb/extra/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.zh.md +18 -0
  135. package/kb/extra/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.md +22 -0
  136. package/kb/extra/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.zh.md +22 -0
  137. package/kb/extra/upgrade-guide/v0.2.1-rc.2/node-24/guide.md +17 -0
  138. package/kb/extra/upgrade-guide/v0.2.1-rc.2/node-24/guide.zh.md +17 -0
  139. package/kb/extra/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.md +18 -0
  140. package/kb/extra/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.zh.md +18 -0
  141. package/kb/extra/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.md +18 -0
  142. package/kb/extra/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.zh.md +18 -0
  143. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.md +18 -0
  144. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.zh.md +18 -0
  145. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.md +53 -0
  146. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.zh.md +53 -0
  147. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.md +30 -0
  148. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.zh.md +30 -0
  149. package/kb/extra/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.md +20 -0
  150. package/kb/extra/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.zh.md +20 -0
  151. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.md +18 -0
  152. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.zh.md +18 -0
  153. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.md +18 -0
  154. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.zh.md +18 -0
  155. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.md +24 -0
  156. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.zh.md +24 -0
  157. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.md +25 -0
  158. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.zh.md +25 -0
  159. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.md +22 -0
  160. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.zh.md +22 -0
  161. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.md +18 -0
  162. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.zh.md +18 -0
  163. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.md +19 -0
  164. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.zh.md +19 -0
  165. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.md +26 -0
  166. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.zh.md +26 -0
  167. package/kb/extra/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.md +35 -0
  168. package/kb/extra/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.zh.md +35 -0
  169. package/kb/extra/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.md +21 -0
  170. package/kb/extra/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.zh.md +21 -0
  171. package/kb/extra/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.md +17 -0
  172. package/kb/extra/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.zh.md +17 -0
  173. package/kb/extra/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.md +23 -0
  174. package/kb/extra/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.zh.md +23 -0
  175. package/kb/extra/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.md +21 -0
  176. package/kb/extra/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.zh.md +21 -0
  177. package/kb/extra/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.md +20 -0
  178. package/kb/extra/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.zh.md +20 -0
  179. package/kb/extra/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.md +20 -0
  180. package/kb/extra/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.zh.md +20 -0
  181. package/kb/extra/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.md +19 -0
  182. package/kb/extra/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.zh.md +19 -0
  183. package/kb/extra/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.md +23 -0
  184. package/kb/extra/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.zh.md +23 -0
  185. package/kb/extra/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.md +20 -0
  186. package/kb/extra/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.zh.md +20 -0
  187. package/kb/extra/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.md +21 -0
  188. package/kb/extra/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.zh.md +21 -0
  189. package/kb/extra/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.md +21 -0
  190. package/kb/extra/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.zh.md +21 -0
  191. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.md +18 -0
  192. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.zh.md +18 -0
  193. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-projection/guide.md +20 -0
  194. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-projection/guide.zh.md +20 -0
  195. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.md +19 -0
  196. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.zh.md +19 -0
  197. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.md +18 -0
  198. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.zh.md +18 -0
  199. package/kb/extra/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.md +22 -0
  200. package/kb/extra/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.zh.md +22 -0
  201. package/kb/extra/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.md +20 -0
  202. package/kb/extra/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.zh.md +20 -0
  203. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.md +18 -0
  204. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.zh.md +18 -0
  205. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.md +19 -0
  206. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.zh.md +19 -0
  207. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.md +24 -0
  208. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.zh.md +24 -0
  209. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.md +21 -0
  210. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.zh.md +21 -0
  211. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.md +19 -0
  212. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.zh.md +19 -0
  213. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.md +18 -0
  214. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.zh.md +18 -0
  215. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.md +21 -0
  216. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.zh.md +21 -0
  217. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.md +29 -0
  218. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.zh.md +29 -0
  219. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.md +29 -0
  220. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.zh.md +29 -0
  221. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.md +18 -0
  222. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.zh.md +18 -0
  223. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.md +29 -0
  224. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.zh.md +29 -0
  225. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.md +18 -0
  226. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.zh.md +18 -0
  227. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.md +32 -0
  228. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.zh.md +32 -0
  229. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.md +30 -0
  230. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.zh.md +30 -0
  231. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.md +19 -0
  232. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.zh.md +19 -0
  233. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.md +21 -0
  234. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.zh.md +21 -0
  235. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.md +37 -0
  236. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.zh.md +37 -0
  237. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.md +22 -0
  238. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.zh.md +22 -0
  239. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.md +24 -0
  240. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.zh.md +24 -0
  241. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.md +20 -0
  242. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.zh.md +20 -0
  243. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.md +20 -0
  244. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.zh.md +20 -0
  245. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.md +17 -0
  246. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.zh.md +17 -0
  247. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.md +19 -0
  248. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.zh.md +19 -0
  249. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.md +18 -0
  250. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.zh.md +18 -0
  251. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.md +34 -0
  252. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.zh.md +34 -0
  253. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.md +49 -0
  254. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.zh.md +49 -0
  255. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.md +36 -0
  256. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.zh.md +36 -0
  257. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.md +29 -0
  258. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.zh.md +29 -0
  259. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.md +26 -0
  260. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.zh.md +26 -0
  261. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.md +22 -0
  262. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.zh.md +22 -0
  263. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +21 -0
  264. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +21 -0
  265. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.md +23 -0
  266. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.zh.md +23 -0
  267. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.md +20 -0
  268. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.zh.md +20 -0
  269. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.md +18 -0
  270. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.zh.md +18 -0
  271. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.md +23 -0
  272. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.zh.md +23 -0
  273. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.md +35 -0
  274. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.zh.md +35 -0
  275. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.md +26 -0
  276. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.zh.md +26 -0
  277. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.md +26 -0
  278. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.zh.md +26 -0
  279. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.md +19 -0
  280. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.zh.md +19 -0
  281. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.md +26 -0
  282. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.zh.md +26 -0
  283. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.md +22 -0
  284. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.zh.md +22 -0
  285. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.md +25 -0
  286. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.zh.md +25 -0
  287. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.md +48 -0
  288. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.zh.md +48 -0
  289. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.md +45 -0
  290. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.zh.md +45 -0
  291. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.md +19 -0
  292. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.zh.md +19 -0
  293. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.md +17 -0
  294. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.zh.md +17 -0
  295. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.md +27 -0
  296. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.zh.md +27 -0
  297. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.md +20 -0
  298. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.zh.md +20 -0
  299. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.md +19 -0
  300. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.zh.md +19 -0
  301. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.md +18 -0
  302. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.zh.md +18 -0
  303. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.md +41 -0
  304. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.zh.md +41 -0
  305. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +21 -0
  306. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +21 -0
  307. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.md +29 -0
  308. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.zh.md +29 -0
  309. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.md +25 -0
  310. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.zh.md +25 -0
  311. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.md +31 -0
  312. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.zh.md +31 -0
  313. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md +24 -0
  314. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md +24 -0
  315. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.md +24 -0
  316. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.zh.md +24 -0
  317. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.md +19 -0
  318. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.zh.md +19 -0
  319. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.md +15 -0
  320. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.zh.md +15 -0
  321. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.md +28 -0
  322. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.zh.md +28 -0
  323. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.md +36 -0
  324. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.zh.md +36 -0
  325. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.md +22 -0
  326. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.zh.md +22 -0
  327. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.md +31 -0
  328. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.zh.md +31 -0
  329. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.md +18 -0
  330. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.zh.md +18 -0
  331. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.md +30 -0
  332. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.zh.md +30 -0
  333. package/kb/extra/web-styling.md +57 -39
  334. package/kb/extra/web-styling.zh.md +57 -39
  335. package/kb/meta/search-index.json +4508 -3806
  336. package/kb/meta/source.json +18 -14
  337. package/kb/site/develop/cordis-tutorial/04-events.md +1 -1
  338. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +5 -4
  339. package/kb/site/develop/framework/events.md +1 -1
  340. package/kb/site/develop/practice/dynamic-cordis.md +1 -1
  341. package/kb/site/develop/practice/llm-adapter.md +192 -192
  342. package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -1
  343. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +5 -4
  344. package/kb/site/en/develop/framework/events.md +1 -1
  345. package/kb/site/en/develop/practice/dynamic-cordis.md +1 -1
  346. package/kb/site/en/develop/practice/llm-adapter.md +192 -192
  347. package/kb/site/en/guide/desktop-uninstall-cleanup.md +63 -0
  348. package/kb/site/en/guide/network-proxy.md +1 -1
  349. package/kb/site/en/guide/plugin-market.md +153 -151
  350. package/kb/site/en/guide/providers.md +234 -230
  351. package/kb/site/en/guide/python-sdk.md +17 -2
  352. package/kb/site/en/guide/quickstart.md +35 -34
  353. package/kb/site/en/guide/schedule.md +45 -26
  354. package/kb/site/en/reference/agent-lifecycle.md +3 -1
  355. package/kb/site/en/reference/api-gateway.md +4 -4
  356. package/kb/site/en/reference/capability-seams.md +789 -719
  357. package/kb/site/en/reference/config-catalog.md +5432 -4806
  358. package/kb/site/en/reference/cookbook/adding-a-package.md +175 -173
  359. package/kb/site/en/reference/cookbook/adding-a-tool.md +105 -104
  360. package/kb/site/en/reference/cookbook/extension-cookbook.md +178 -135
  361. package/kb/site/en/reference/cordis-api/context.md +373 -369
  362. package/kb/site/en/reference/cordis-api/events.md +9 -9
  363. package/kb/site/en/reference/cordis-api/fiber.md +457 -380
  364. package/kb/site/en/reference/cordis-api/inherited.md +44 -43
  365. package/kb/site/en/reference/cordis-api/service.md +118 -107
  366. package/kb/site/en/reference/experimental-persistence-catalog.md +36 -20
  367. package/kb/site/en/reference/index.md +174 -168
  368. package/kb/site/en/reference/persistence-catalog.md +9453 -9146
  369. package/kb/site/en/reference/subsystems/client-modules.md +19 -11
  370. package/kb/site/en/reference/subsystems/compaction.md +288 -288
  371. package/kb/site/en/reference/subsystems/conversation.md +2 -0
  372. package/kb/site/en/reference/subsystems/core.md +1172 -1117
  373. package/kb/site/en/reference/subsystems/credentials.md +526 -497
  374. package/kb/site/en/reference/subsystems/filesystem.md +708 -534
  375. package/kb/site/en/reference/subsystems/index.md +82 -80
  376. package/kb/site/en/reference/subsystems/llm-streaming.md +1290 -1200
  377. package/kb/site/en/reference/subsystems/lsp.md +230 -206
  378. package/kb/site/en/reference/subsystems/persistence.md +451 -422
  379. package/kb/site/en/reference/subsystems/plan.md +91 -91
  380. package/kb/site/en/reference/subsystems/ptc-runtime.md +295 -254
  381. package/kb/site/en/reference/subsystems/sandbox.md +250 -225
  382. package/kb/site/en/reference/subsystems/schedule.md +194 -430
  383. package/kb/site/en/reference/subsystems/session-projection.md +186 -44
  384. package/kb/site/en/reference/subsystems/session-query.md +525 -515
  385. package/kb/site/en/reference/subsystems/session-reference.md +231 -228
  386. package/kb/site/en/reference/subsystems/session.md +1478 -1343
  387. package/kb/site/en/reference/subsystems/sidebar-right.md +165 -164
  388. package/kb/site/en/reference/subsystems/skills.md +356 -356
  389. package/kb/site/en/reference/subsystems/slots.md +235 -204
  390. package/kb/site/en/reference/subsystems/storage.md +26 -9
  391. package/kb/site/en/reference/subsystems/subagent.md +119 -102
  392. package/kb/site/en/reference/subsystems/system-prompt.md +13 -11
  393. package/kb/site/en/reference/subsystems/terminal.md +188 -188
  394. package/kb/site/en/reference/subsystems/token-meter.md +45 -0
  395. package/kb/site/en/reference/subsystems/tools.md +902 -751
  396. package/kb/site/en/reference/subsystems/typert.md +21 -11
  397. package/kb/site/en/reference/subsystems/user-questions.md +330 -311
  398. package/kb/site/en/reference/subsystems/web-client.md +161 -104
  399. package/kb/site/en/reference/subsystems/web-server.md +434 -306
  400. package/kb/site/en/reference/subsystems/web.md +268 -210
  401. package/kb/site/en/reference/subsystems/workflow.md +287 -282
  402. package/kb/site/en/reference/subsystems/workspace.md +743 -651
  403. package/kb/site/en/reference/tool-catalog.md +2867 -2829
  404. package/kb/site/en/reference/tool-execution-pipeline.md +5 -4
  405. package/kb/site/guide/desktop-uninstall-cleanup.md +63 -0
  406. package/kb/site/guide/network-proxy.md +1 -1
  407. package/kb/site/guide/plugin-market.md +153 -151
  408. package/kb/site/guide/providers.md +234 -230
  409. package/kb/site/guide/python-sdk.md +17 -2
  410. package/kb/site/guide/quickstart.md +35 -34
  411. package/kb/site/guide/schedule.md +45 -26
  412. package/kb/site/reference/agent-lifecycle.md +3 -1
  413. package/kb/site/reference/api-gateway.md +4 -4
  414. package/kb/site/reference/capability-seams.md +789 -719
  415. package/kb/site/reference/config-catalog.md +5432 -4806
  416. package/kb/site/reference/cookbook/adding-a-package.md +175 -173
  417. package/kb/site/reference/cookbook/adding-a-tool.md +107 -106
  418. package/kb/site/reference/cookbook/extension-cookbook.md +182 -139
  419. package/kb/site/reference/cordis-api/context.md +373 -369
  420. package/kb/site/reference/cordis-api/events.md +9 -9
  421. package/kb/site/reference/cordis-api/fiber.md +459 -380
  422. package/kb/site/reference/cordis-api/inherited.md +44 -43
  423. package/kb/site/reference/cordis-api/service.md +118 -107
  424. package/kb/site/reference/experimental-persistence-catalog.md +36 -20
  425. package/kb/site/reference/index.md +178 -172
  426. package/kb/site/reference/persistence-catalog.md +9453 -9146
  427. package/kb/site/reference/subsystems/client-modules.md +19 -11
  428. package/kb/site/reference/subsystems/compaction.md +288 -288
  429. package/kb/site/reference/subsystems/conversation.md +4 -0
  430. package/kb/site/reference/subsystems/core.md +1184 -1129
  431. package/kb/site/reference/subsystems/credentials.md +526 -497
  432. package/kb/site/reference/subsystems/filesystem.md +708 -534
  433. package/kb/site/reference/subsystems/index.md +82 -80
  434. package/kb/site/reference/subsystems/llm-streaming.md +1296 -1206
  435. package/kb/site/reference/subsystems/lsp.md +230 -206
  436. package/kb/site/reference/subsystems/persistence.md +451 -422
  437. package/kb/site/reference/subsystems/plan.md +91 -91
  438. package/kb/site/reference/subsystems/ptc-runtime.md +295 -254
  439. package/kb/site/reference/subsystems/sandbox.md +250 -225
  440. package/kb/site/reference/subsystems/schedule.md +197 -433
  441. package/kb/site/reference/subsystems/session-projection.md +186 -44
  442. package/kb/site/reference/subsystems/session-query.md +525 -515
  443. package/kb/site/reference/subsystems/session-reference.md +231 -228
  444. package/kb/site/reference/subsystems/session.md +1482 -1347
  445. package/kb/site/reference/subsystems/sidebar-right.md +165 -164
  446. package/kb/site/reference/subsystems/skills.md +356 -356
  447. package/kb/site/reference/subsystems/slots.md +239 -208
  448. package/kb/site/reference/subsystems/storage.md +26 -9
  449. package/kb/site/reference/subsystems/subagent.md +119 -102
  450. package/kb/site/reference/subsystems/system-prompt.md +13 -11
  451. package/kb/site/reference/subsystems/terminal.md +188 -188
  452. package/kb/site/reference/subsystems/token-meter.md +45 -0
  453. package/kb/site/reference/subsystems/tools.md +902 -751
  454. package/kb/site/reference/subsystems/typert.md +21 -11
  455. package/kb/site/reference/subsystems/user-questions.md +330 -311
  456. package/kb/site/reference/subsystems/web-client.md +161 -104
  457. package/kb/site/reference/subsystems/web-server.md +434 -306
  458. package/kb/site/reference/subsystems/web.md +268 -210
  459. package/kb/site/reference/subsystems/workflow.md +287 -282
  460. package/kb/site/reference/subsystems/workspace.md +743 -651
  461. package/kb/site/reference/tool-catalog.md +2872 -2835
  462. package/kb/site/reference/tool-execution-pipeline.md +4 -3
  463. package/lib/index.js +359 -244
  464. package/lib/kb-version.js +118 -0
  465. package/package.json +68 -66
  466. package/scripts/refresh-kb.mjs +153 -0
  467. package/scripts/selfcheck.mjs +18 -0
  468. package/scripts/smoke.mjs +77 -0
  469. package/skills/dsh-plugin-dev-kb.md +71 -69
  470. package/skills/dsh-plugin-starter.md +65 -0
  471. package/skills/dsh-upgrade-assistant.md +62 -0
  472. package/kb/extra/agent-lifecycle.md +0 -91
  473. package/kb/extra/agent-lifecycle.zh.md +0 -93
  474. package/kb/extra/api-gateway.md +0 -172
  475. package/kb/extra/api-gateway.zh.md +0 -178
  476. package/kb/extra/architecture.md +0 -165
  477. package/kb/extra/architecture.zh.md +0 -169
  478. package/kb/extra/capability-seams.md +0 -714
  479. package/kb/extra/capability-seams.zh.md +0 -716
  480. package/kb/extra/config-catalog.md +0 -4801
  481. package/kb/extra/config-catalog.zh.md +0 -4803
  482. package/kb/extra/cookbook/adding-a-package.md +0 -170
  483. package/kb/extra/cookbook/adding-a-package.zh.md +0 -170
  484. package/kb/extra/cookbook/adding-a-settings-card.md +0 -72
  485. package/kb/extra/cookbook/adding-a-settings-card.zh.md +0 -72
  486. package/kb/extra/cookbook/adding-a-tool.md +0 -101
  487. package/kb/extra/cookbook/adding-a-tool.zh.md +0 -103
  488. package/kb/extra/cookbook/adding-an-llm-adapter.md +0 -43
  489. package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +0 -43
  490. package/kb/extra/cookbook/extension-cookbook.md +0 -132
  491. package/kb/extra/cookbook/extension-cookbook.zh.md +0 -136
  492. package/kb/extra/cordis-api/context.md +0 -364
  493. package/kb/extra/cordis-api/context.zh.md +0 -366
  494. package/kb/extra/cordis-api/events.md +0 -207
  495. package/kb/extra/cordis-api/events.zh.md +0 -209
  496. package/kb/extra/cordis-api/fiber.md +0 -375
  497. package/kb/extra/cordis-api/fiber.zh.md +0 -377
  498. package/kb/extra/cordis-api/inherited.md +0 -38
  499. package/kb/extra/cordis-api/registry.md +0 -152
  500. package/kb/extra/cordis-api/registry.zh.md +0 -154
  501. package/kb/extra/cordis-api/service.md +0 -102
  502. package/kb/extra/cordis-api/service.zh.md +0 -104
  503. package/kb/extra/cordis-tutorial/01-first-plugin.md +0 -95
  504. package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +0 -95
  505. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +0 -98
  506. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +0 -98
  507. package/kb/extra/cordis-tutorial/03-services.md +0 -98
  508. package/kb/extra/cordis-tutorial/03-services.zh.md +0 -98
  509. package/kb/extra/cordis-tutorial/04-events.md +0 -144
  510. package/kb/extra/cordis-tutorial/04-events.zh.md +0 -144
  511. package/kb/extra/cordis-tutorial/05-config.md +0 -111
  512. package/kb/extra/cordis-tutorial/05-config.zh.md +0 -111
  513. package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +0 -113
  514. package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +0 -113
  515. package/kb/extra/cordis-tutorial/07-into-the-harness.md +0 -108
  516. package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +0 -108
  517. package/kb/extra/cordis-tutorial/index.md +0 -60
  518. package/kb/extra/cordis-tutorial/index.zh.md +0 -62
  519. package/kb/extra/experimental-persistence-catalog.md +0 -17
  520. package/kb/extra/experimental-persistence-catalog.zh.md +0 -17
  521. package/kb/extra/persistence-catalog.md +0 -9140
  522. package/kb/extra/persistence-catalog.zh.md +0 -9142
  523. package/kb/extra/subsystems/README.md +0 -76
  524. package/kb/extra/subsystems/README.zh.md +0 -76
  525. package/kb/extra/subsystems/approval.md +0 -170
  526. package/kb/extra/subsystems/approval.zh.md +0 -170
  527. package/kb/extra/subsystems/client-modules.md +0 -198
  528. package/kb/extra/subsystems/client-modules.zh.md +0 -198
  529. package/kb/extra/subsystems/client-resources.md +0 -92
  530. package/kb/extra/subsystems/client-resources.zh.md +0 -92
  531. package/kb/extra/subsystems/commands.md +0 -223
  532. package/kb/extra/subsystems/commands.zh.md +0 -223
  533. package/kb/extra/subsystems/compaction.md +0 -284
  534. package/kb/extra/subsystems/compaction.zh.md +0 -284
  535. package/kb/extra/subsystems/conversation.md +0 -301
  536. package/kb/extra/subsystems/conversation.zh.md +0 -303
  537. package/kb/extra/subsystems/core.md +0 -1113
  538. package/kb/extra/subsystems/core.zh.md +0 -1125
  539. package/kb/extra/subsystems/credentials.md +0 -493
  540. package/kb/extra/subsystems/credentials.zh.md +0 -493
  541. package/kb/extra/subsystems/filesystem.md +0 -530
  542. package/kb/extra/subsystems/filesystem.zh.md +0 -530
  543. package/kb/extra/subsystems/goal.md +0 -313
  544. package/kb/extra/subsystems/goal.zh.md +0 -313
  545. package/kb/extra/subsystems/jobs.md +0 -554
  546. package/kb/extra/subsystems/jobs.zh.md +0 -554
  547. package/kb/extra/subsystems/llm-streaming.md +0 -1196
  548. package/kb/extra/subsystems/llm-streaming.zh.md +0 -1202
  549. package/kb/extra/subsystems/lsp.md +0 -202
  550. package/kb/extra/subsystems/lsp.zh.md +0 -202
  551. package/kb/extra/subsystems/office-to-pdf.md +0 -87
  552. package/kb/extra/subsystems/office-to-pdf.zh.md +0 -87
  553. package/kb/extra/subsystems/permission-presets.md +0 -167
  554. package/kb/extra/subsystems/permission-presets.zh.md +0 -167
  555. package/kb/extra/subsystems/persistence.md +0 -418
  556. package/kb/extra/subsystems/persistence.zh.md +0 -418
  557. package/kb/extra/subsystems/plan.md +0 -87
  558. package/kb/extra/subsystems/plan.zh.md +0 -87
  559. package/kb/extra/subsystems/ptc-runtime.md +0 -250
  560. package/kb/extra/subsystems/ptc-runtime.zh.md +0 -250
  561. package/kb/extra/subsystems/sandbox.md +0 -221
  562. package/kb/extra/subsystems/sandbox.zh.md +0 -221
  563. package/kb/extra/subsystems/schedule.md +0 -550
  564. package/kb/extra/subsystems/schedule.zh.md +0 -550
  565. package/kb/extra/subsystems/scope.md +0 -59
  566. package/kb/extra/subsystems/scope.zh.md +0 -61
  567. package/kb/extra/subsystems/session-projection.md +0 -356
  568. package/kb/extra/subsystems/session-projection.zh.md +0 -356
  569. package/kb/extra/subsystems/session-query.md +0 -511
  570. package/kb/extra/subsystems/session-query.zh.md +0 -511
  571. package/kb/extra/subsystems/session-reference.md +0 -224
  572. package/kb/extra/subsystems/session-reference.zh.md +0 -224
  573. package/kb/extra/subsystems/session-telemetry.md +0 -212
  574. package/kb/extra/subsystems/session-telemetry.zh.md +0 -212
  575. package/kb/extra/subsystems/session-title.md +0 -213
  576. package/kb/extra/subsystems/session-title.zh.md +0 -213
  577. package/kb/extra/subsystems/session.md +0 -1339
  578. package/kb/extra/subsystems/session.zh.md +0 -1343
  579. package/kb/extra/subsystems/settings.md +0 -155
  580. package/kb/extra/subsystems/settings.zh.md +0 -155
  581. package/kb/extra/subsystems/shell.md +0 -314
  582. package/kb/extra/subsystems/shell.zh.md +0 -314
  583. package/kb/extra/subsystems/sidebar-right.md +0 -160
  584. package/kb/extra/subsystems/sidebar-right.zh.md +0 -160
  585. package/kb/extra/subsystems/skills.md +0 -352
  586. package/kb/extra/subsystems/skills.zh.md +0 -352
  587. package/kb/extra/subsystems/slots.md +0 -200
  588. package/kb/extra/subsystems/slots.zh.md +0 -204
  589. package/kb/extra/subsystems/spill.md +0 -124
  590. package/kb/extra/subsystems/spill.zh.md +0 -124
  591. package/kb/extra/subsystems/storage.md +0 -259
  592. package/kb/extra/subsystems/storage.zh.md +0 -259
  593. package/kb/extra/subsystems/subagent.md +0 -686
  594. package/kb/extra/subsystems/subagent.zh.md +0 -688
  595. package/kb/extra/subsystems/subprocess.md +0 -321
  596. package/kb/extra/subsystems/subprocess.zh.md +0 -321
  597. package/kb/extra/subsystems/system-prompt.md +0 -254
  598. package/kb/extra/subsystems/system-prompt.zh.md +0 -254
  599. package/kb/extra/subsystems/terminal.md +0 -184
  600. package/kb/extra/subsystems/terminal.zh.md +0 -184
  601. package/kb/extra/subsystems/token-meter.md +0 -106
  602. package/kb/extra/subsystems/token-meter.zh.md +0 -106
  603. package/kb/extra/subsystems/tools.md +0 -747
  604. package/kb/extra/subsystems/tools.zh.md +0 -747
  605. package/kb/extra/subsystems/typert.md +0 -690
  606. package/kb/extra/subsystems/typert.zh.md +0 -690
  607. package/kb/extra/subsystems/user-questions.md +0 -307
  608. package/kb/extra/subsystems/user-questions.zh.md +0 -307
  609. package/kb/extra/subsystems/web-client.md +0 -100
  610. package/kb/extra/subsystems/web-client.zh.md +0 -100
  611. package/kb/extra/subsystems/web-server.md +0 -302
  612. package/kb/extra/subsystems/web-server.zh.md +0 -302
  613. package/kb/extra/subsystems/web.md +0 -206
  614. package/kb/extra/subsystems/web.zh.md +0 -206
  615. package/kb/extra/subsystems/workflow.md +0 -278
  616. package/kb/extra/subsystems/workflow.zh.md +0 -278
  617. package/kb/extra/subsystems/workspace.md +0 -647
  618. package/kb/extra/subsystems/workspace.zh.md +0 -647
  619. package/kb/extra/tool-catalog.md +0 -2824
  620. package/kb/extra/tool-catalog.zh.md +0 -2832
  621. package/kb/extra/tool-execution-pipeline.md +0 -65
  622. package/kb/extra/tool-execution-pipeline.zh.md +0 -67
@@ -1,1113 +0,0 @@
1
- # Core
2
-
3
- English | [中文](core.zh.md)
4
-
5
- The **core** subsystem is [`packages/core`](../../packages/core/README.md) — the packages every composition boots: the event-sourced session log, system-prompt assembly, the tool registry, the agent types, and the concrete loop that drives them. This page explains what the `agent`/`agent-loop` pair declares — how an agent is created and owned, and the `Agent` handle's delivery, cancellation, and interception contracts — plus the two type patterns every subsystem follows. The group's dedicated pages and the rest of the folder are indexed in the [subsystems README](README.md).
6
-
7
- ## The spine, package by package
8
-
9
- A turn flows through the six packages in one loop: the driver in [`agent-loop`](../../packages/core/agent-loop) claims a queued prompt, opens a turn on the [session log](session.md) (`ctx.sessions`), assembles the request prefix through [system-prompt](system-prompt.md) (`ctx.systemPrompt`) and derives history from the log, streams the model response through the [LLM seam](llm-streaming.md), dispatches tool calls through the [tool registry](tools.md) (`ctx.tools`), and appends every model-visible fact back onto the log before the next step derives from it. The conversation vocabulary the loop moves — `Message`, `ContentBlock`, `StreamChunk`, the model request — is declared by [`packages/llm`](../../packages/llm/README.md) and documented on [llm-streaming.md](llm-streaming.md).
10
-
11
- | Package | Owns | Page |
12
- |---|---|---|
13
- | `session/` | The append-only `SessionEvent` log and in-memory store — the single source of truth (`ctx.sessions`) | [session.md](session.md) |
14
- | `system-prompt/` | Prompt-section and tool-schema assembly (`ctx.systemPrompt`) | [system-prompt.md](system-prompt.md) |
15
- | `tools/` | The scoped tool registry and guarded execution pipeline (`ctx.tools`) | [tools.md](tools.md) |
16
- | `agent/` | The `Agent` interface, live registry, initiator scope, and `agent/*` event vocabulary (`ctx.agents`) | this page |
17
- | `agent-loop/` | The concrete driver implementing the public `Agent` contract (`ctx.agentLoop`) | this page |
18
- | `scope/` | The scoped-registration primitive the registries and loop build per-agent scoping on | [scope.md](scope.md) |
19
-
20
- `scope/` is the one non-service package: a dependency-free library (`createScope`/`scopeOf`/`scopeTarget`) that sits below `session/` and `system-prompt/` in the module graph precisely so they can consume it without a cycle. `agent-loop` is the one concrete implementation of the public `Agent` contract and lives here because it is the harness's default product loop; it runs each driver inside `ctx.agents.withInitiator()`. Extension plugins depend on `agent` — including when they need the initiating Agent — and never on `agent-loop` directly, so the loop stays swappable. [`dsh-base`](../../packages/bundle/base/README.md) is the default product composition, while [`dsh-sdk-minimal`](../../packages/bundle/sdk-minimal/README.md) declares a smaller standalone tree.
21
-
22
- ## Creation and ownership
23
-
24
- Consumers create agents through `ctx.agents` — `create()` builds a fresh session and agent under one caller-supplied `SessionId`, `resume()` loads a persisted session first — or declaratively through the loop's config entries. Programmatic creation returns the owner's handle:
25
-
26
- Source: [`packages/core/agent/src/index.ts`](../../packages/core/agent/src/index.ts)
27
-
28
- ```ts type-equiv
29
- /**
30
- * An owned agent plus its disposer, returned by {@link AgentRegistry.create} /
31
- * {@link AgentRegistry.resume}. The disposer is a CAPABILITY: among consumers,
32
- * only the holder can tear this agent down. The registered factory provider is
33
- * also a structural owner because the scoped agent depends on that provider's
34
- * service API; provider unload stops and drains every live handle it made.
35
- * `dispose()` stops the loop, awaits its exit, unregisters the agent, removes
36
- * its session from the store, and finally unwinds its scoped world.
37
- *
38
- * `ctx.agents.get(id)` still returns a bare {@link Agent} — the handle is
39
- * exposed only to the consumer owner that created it; the structural provider
40
- * reaches the same teardown internally. Config-created agents (the loop's own
41
- * startup) are owned by the loop fiber and never need a handle.
42
- */
43
- interface AgentHandle {
44
- agent: Agent
45
- dispose(): Promise<void>
46
- }
47
- ```
48
-
49
- `CreateAgentOptions` carries the shared identity and everything a fresh agent needs before publication: an optional live `parentAgent`, session metadata (`meta` — validated `cwd`, fork lineage, the `isSeeded` marker, origin classification, delegation depth, and `agentPreset`), the exact fork cut in sibling field `inheritedEventCount`, an optional `seed` replay prefix, per-agent `AgentOptions`, a creation-only cancellation `signal`, and `setup`. `ResumeAgentOptions` is the persisted-identity counterpart: `resumeSessionId`, `parentAgent`, `agentOptions`, `signal`, and `setup`. The `setup` callback (`AgentSetup`) receives `(agentCtx, agent)` while both ids are still unpublished: the context owns scoped registrations, while the explicit Agent supplies the exact child Session without a reverse property on the Context. Everything registered through `agentCtx` exists before `agent/created` and the first prompt assembly. Setup may return a synchronous commit invoked immediately before publication; a setup rejection, commit throw, or owner disposal rolls the transaction back without publishing either id.
50
-
51
- `AgentFactory` is the creation interface behind the registry: the loop registers its factory via `ctx.agents.setFactory()`, so consumers use `ctx.agents` without depending on the concrete loop package. A runtime child creator sets `options.parentAgent`; the registry passes the options and caller Context to the factory without deriving one from the other. The exact `create`/`resume` signatures and rollback contracts are in the [generated section](#ctxagents--agentregistry) below.
52
-
53
- ## The agent handle
54
-
55
- `Agent` is the surface every plugin (UI, hooks, orchestrators) programs against; `ctx.agents.get(id)` returns it, and the [initiator scope](#initiating-agent) carries it. The concrete implementation is package-internal to dsh-agent-loop; nothing outside the loop depends on it. The unified `send` method exposes target and wakeup routing directly; `followup`, `steer`, and `inject` are fixed-preset aliases.
56
-
57
- Source: [`packages/core/agent/src/types.ts`](../../packages/core/agent/src/types.ts)
58
-
59
- ```ts type-equiv
60
- /** Public live-agent handle; the runtime face augments its live capabilities. */
61
- interface Agent {
62
- /** Session-backed Agent identity. */
63
- readonly id: SessionId
64
- /** The provider route and model this agent's requests use. */
65
- readonly options: AgentOptions
66
- /** The live session this agent drives; its log is the durable source of truth. */
67
- readonly session: Session
68
- /** Agent-owned access to durable pending work. */
69
- readonly inbox: Inbox
70
- /** The current lifecycle state, mirrored on every `agent/status` transition. */
71
- readonly status: AgentStatus
72
- /** Agent-scoped context; its contributions are agent-local, unwind on disposal, and reject registration afterward. */
73
- readonly ctx: Context
74
-
75
- /**
76
- * Clear queued and steering work — unless `keepInbox` — and abort the active
77
- * turn or between-turn task. The first cause wins for that activity. With no
78
- * active activity, cancellation is a no-op and does not arm later work.
79
- * @param cause - the stable caller intent carried by the active operation signal.
80
- * @param options - cancellation options; `keepInbox` preserves pending work.
81
- */
82
- cancel(cause: AgentCancelCause, options?: CancelOptions): void
83
-
84
- /**
85
- * Resolve after the current whole-agent activity reaches quiescence. This
86
- * follows replacement work started before the observed driver retires,
87
- * but does not identify the settlement of any particular message.
88
- * @returns fulfillment after no active driver or maintenance task remains.
89
- */
90
- whenIdle(): Promise<void>
91
-
92
- /**
93
- * Run one non-turn maintenance task from the true idle phase. The task starts
94
- * synchronously after claiming that phase; later waking input remains in the
95
- * inbox until the task settles, while public status stays `idle`.
96
- * `whenIdle()` follows both the task and any waking work released behind it.
97
- * @param task - operation whose fulfillment or rejection is preserved, with a signal aborted by {@link cancel}.
98
- * @throws synchronously when turn-driving or another maintenance task already owns the agent.
99
- * @returns the task promise.
100
- */
101
- runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>
102
-
103
- /**
104
- * Route identified input to an inbox boundary and optionally wake the driver.
105
- * Waking input submitted after active cancellation is queued for the next
106
- * turn and runs when the aborted activity converges to idle; a `disposed`
107
- * cancel leaves it parked. A wake submitted while already idle always opens
108
- * its turn boundary, even when its message is cleared before the driver
109
- * claims ([driver wake convergence](../../agent-loop/src/agent.ts)).
110
- * @param message - identified content and the source that supplied it.
111
- * @param target - the preferred next-turn or next-step inbox boundary.
112
- * @param wakeup - whether delivery may wake the driver.
113
- */
114
- send(message: UserMessage, target: InboxTarget, wakeup: boolean): void
115
-
116
- /**
117
- * Queue an ordinary follow-up turn and wake the driver. The item becomes the
118
- * sole ordinary message of its own turn.
119
- * @param message - identified prompt content and the source that supplied it.
120
- */
121
- followup(message: UserMessage): void
122
-
123
- /**
124
- * Submit steering for the nearest step. An idle driver starts a turn;
125
- * a running driver consumes it at its next step boundary.
126
- * A rejected step leaves steering parked in the inbox until the next
127
- * wake; cancellation or disposal may discard pending steering.
128
- * @param message - identified steering content and the source that supplied it.
129
- */
130
- steer(message: UserMessage): void
131
-
132
- /**
133
- * Queue model-facing context for the next pre-step without waking the
134
- * driver. A running driver claims it at the nearest later step boundary;
135
- * idle drivers leave it pending until follow-up or steering
136
- * wakes them. It may miss a request whose pre-step already claimed its
137
- * batch. Cancellation or disposal may discard pending context.
138
- * @param message - identified injected context and the source that supplied it.
139
- */
140
- inject(message: UserMessage): void
141
- }
142
- ```
143
-
144
- ```ts type-equiv
145
- /**
146
- * An agent's lifecycle state, emitted on every transition as `agent/status`:
147
- * `idle` means no driver is active; `running` begins when waking input starts
148
- * cancellable pre-step processing and lasts while the driver drains,
149
- * closes, or checkpoints turns. Disposal removes the agent from its registry;
150
- * it is not a third observable status.
151
- */
152
- type AgentStatus = 'idle' | 'running'
153
- ```
154
-
155
- ```ts type-equiv
156
- /** One process-local live assistant streaming publication. */
157
- type AssistantStreamFrame =
158
- | {
159
- readonly type: 'start'
160
- readonly attemptId: LlmAttemptId
161
- /** Monotone within one attached Agent lifecycle; replacement restarts at 1. */
162
- readonly revision: number
163
- readonly turn: number
164
- readonly step: number
165
- }
166
- | {
167
- readonly type: 'chunk'
168
- readonly attemptId: LlmAttemptId
169
- readonly revision: number
170
- /** Dense zero-based position within the attempt. */
171
- readonly index: number
172
- /** Safe-integer timestamp reused by the durable embedded stream. */
173
- readonly time: number
174
- readonly chunk: StreamChunk
175
- }
176
- | {
177
- readonly type: 'end'
178
- readonly attemptId: LlmAttemptId
179
- readonly revision: number
180
- /** Number of chunk frames emitted by this attempt. */
181
- readonly index: number
182
- /** Durable settlement committed before this notification, or live abandonment without one. */
183
- readonly outcome:
184
- | {
185
- readonly kind: 'committed'
186
- readonly eventType: 'assistant/message' | 'assistant/attempt'
187
- readonly seq: SessionSeq
188
- }
189
- | { readonly kind: 'abandoned' }
190
- }
191
- ```
192
-
193
- `running` describes the driver-wide drain interval and may span consecutive queued turns; it does not prove a turn is still open. Disposal removes the agent from the registry and emits `agent/disposed`; it is not a terminal status value. `followup()` returns no handle: its `MessageId` identifies durable inbox insertion, claim, and discard facts, not a later assistant output or turn ending. `whenIdle()` observes the whole agent, so callers may call a receipt-to-idle interval a run only when they explicitly own that interval ([decision](../../.agents/notes/implemented/architecture/2026-07-30-followup-enqueue-and-owned-runs.md)).
194
-
195
- ```ts type-equiv
196
- /** Merge-extensible agent creation options. Persona belongs to system-prompt sections. */
197
- interface AgentOptions {
198
- /** Provider route (must have a registered adapter at call time). */
199
- provider?: string
200
- /** Model id interpreted by the selected provider adapter. */
201
- model?: string
202
- /** Adapter-owned reasoning effort for the selected provider/model route. */
203
- reasoningEffort?: ReasoningEffortId
204
- /** Maximum output tokens for each conversation-model request. */
205
- maxTokens?: number
206
- }
207
- ```
208
-
209
- Dispatch requires `provider` and `model` after `agent/request`. An explicit `reasoningEffort` seeds the first request on that route; exact-model resolution validates it, while omission allows the adapter default to materialize. When present, `maxTokens` must be a positive safe integer and caps every conversation-model request; omission allows the exact-model adapter default to materialize before the request header, or otherwise leaves provider behavior unchanged. An agent-scoped `deployment:persona-prefix` prompt section may shadow the global default persona.
210
-
211
- The inbox is the delivery vocabulary — two ordered pending-message lists the agent owns as a durable projection:
212
-
213
- ```ts type-equiv
214
- /** Agent-owned access to pending work; concrete storage belongs to the driver. */
215
- interface Inbox {
216
- /** Prompts awaiting individual turns. */
217
- readonly nextTurn: readonly UserMessage[]
218
- /** Input awaiting the next step boundary. */
219
- readonly nextStep: readonly UserMessage[]
220
-
221
- /** Durably cancel all pending input, clearing next-step before next-turn. */
222
- clear(): void
223
-
224
- /**
225
- * Append one message to a pending list.
226
- * @param target - pending list to extend.
227
- * @param message - message to append.
228
- */
229
- append(target: InboxTarget, message: UserMessage): void
230
-
231
- /**
232
- * Prepend one message to a pending list.
233
- * @param target - pending list to extend.
234
- * @param message - message to prepend.
235
- */
236
- prepend(target: InboxTarget, message: UserMessage): void
237
-
238
- /**
239
- * Replace one pending message in place.
240
- * @param messageId - identity of the pending message to replace.
241
- * @param newMessage - replacement message.
242
- * @returns whether the message was still pending.
243
- */
244
- replace(messageId: MessageId, newMessage: UserMessage): boolean
245
-
246
- /**
247
- * Remove one pending message.
248
- * @param messageId - identity of the pending message to remove.
249
- * @returns whether the message was still pending.
250
- */
251
- remove(messageId: MessageId): boolean
252
-
253
- /**
254
- * Apply standard splice semantics and durably record the normalized result.
255
- * @param target - pending list to mutate.
256
- * @param start - splice position.
257
- * @param deleteCount - maximum number of messages to remove.
258
- * @param inserted - messages to insert at the resolved position.
259
- * @returns messages removed by the splice.
260
- */
261
- splice(
262
- target: InboxTarget,
263
- start: number,
264
- deleteCount: number,
265
- inserted: UserMessage[],
266
- ): UserMessage[]
267
- }
268
- ```
269
-
270
- ```ts type-equiv
271
- /** One of the two ordered pending-message lists owned by an agent. */
272
- type InboxTarget = 'next-turn' | 'next-step'
273
- ```
274
-
275
- Every pending occurrence is its `UserMessage`; `MessageId` is the sole identity. The structural `Inbox` methods record normalized durable `agent/inbox/spliced` mutations and reject duplicate pending ids. `replace(messageId, newMessage)` and `remove(messageId)` locate the pending message across both lists; replacement may change identity and emits the old message as discarded followed by the new message as inserted. Ordinary removals and `clear()` are cancellations. At a step boundary, dsh-agent-loop's package-internal `ReactLoopInbox` removes the proposed batch — all `next-step` input plus, at a turn boundary, one `next-turn` message — through pure deletion splices without discarded notifications, then emits per-message claimed notifications. Loop-only pending detection and claiming are not part of `Agent.inbox`. The `AgentLoop` service registers the standard `inbox` projection before publishing its factory; its cell is the sole live state, and the same fold serves cold consumers even when no Agent exists. The fold rejects unsafe or out-of-range splice coordinates and duplicate identities across both lists, identifying malformed durable history by event seq. Consumers following one message use the exact `agent/inbox/inserted`, `claimed`, and `discarded` notifications.
276
-
277
- Cancellation:
278
-
279
- ```ts type-equiv
280
- /** Options for {@link Agent.cancel}. */
281
- interface CancelOptions {
282
- /**
283
- * Preserve queued and steering inbox items instead of discarding them. The
284
- * active turn is still aborted, but un-started and pending work survives for a
285
- * later turn and no canceled inbox splice is logged.
286
- */
287
- keepInbox?: boolean | undefined
288
- }
289
- ```
290
-
291
- ```ts type-equiv
292
- /** Why an active agent driver was cancelled. */
293
- type AgentCancelCause =
294
- | { readonly kind: 'user' }
295
- | { readonly kind: 'parent' }
296
- | { readonly kind: 'hook'; readonly reason: string }
297
- | { readonly kind: 'disposed' }
298
- ```
299
-
300
- The cause is a TypeScript-enforced same-process input. An active cancellation holder exposes that same object as the runtime-only `AbortSignal.reason`; a signal grants cooperating listeners no classification authority. Durable `turn/end` records the outcome as `{ kind: 'aborted', reason: TurnEndCancelCause }`, so the cancel cause lands in the terminal result.
301
-
302
- The [event taxonomy](../architecture.md#events) owns the `agent/*` lifecycle, checkpoint, and waterfall contracts. Turn and step boundaries are durable session events rather than agent emits.
303
-
304
- ## Initiating Agent
305
-
306
- The process-local initiator carried by `ctx.agents` is the exact `Agent` above, not a separate frame or copied identity. Ambient presence is neither liveness proof nor authorization; the [initiator-scope decision](../../.agents/notes/implemented/architecture/2026-07-15-agent-initiator-scope.md) defines its lifetime and scope rules.
307
-
308
- ## Interception decisions
309
-
310
- Pre-step decisions use the same identified `UserMessage` type as durable user-role input. The entered batch is authoritative and preserves every message's `id` and `source`. Hook bridges map their native decision fields onto this typed result.
311
-
312
- Source: [`packages/core/agent/src/types.ts`](../../packages/core/agent/src/types.ts)
313
-
314
- `agent/pre-step` receives one payload carrying the exclusive claimed batch (`messages`), the proposed step's coordinates (`turn`, `step`), and the current turn's cancellation `signal`. The initial proposal runs inside an open turn before any step; a tool continuation may submit an empty claimed batch between steps:
315
-
316
- It returns a `PreStepDecision`. Reject opens no step. Enter supplies the complete message batch appended after `step/start`; claimed messages omitted by the final decision remain removed, while input inserted after the claim stays pending:
317
-
318
- ```ts type-equiv
319
- /** Whether and with which messages the loop enters a proposed step. */
320
- type PreStepDecision =
321
- | { kind: 'reject' }
322
- | {
323
- kind: 'enter'
324
- messages: UserMessage[]
325
- /** Start a distinct model-message series before this step's admitted messages. */
326
- startsRequestSeries?: true
327
- }
328
- ```
329
-
330
- `agent/request-error` runs after a failed model step closes and before its turn closes. Listeners can repair durable state or await policy work while the failed turn's signal is still live. A handling listener returns `{ kind: 'retry' }` without calling `next()`; the default `undefined` leaves the failure terminal.
331
-
332
- ```ts type-equiv
333
- /** Action returned by a listener that owns model-request recovery. */
334
- type RequestErrorAction = { kind: 'retry' } | undefined
335
- ```
336
-
337
- `agent/pre-step` is the only waterfall listener chain before request derivation. `agent/turn-stopping` runs when a turn has no tool or steering continuation, before one final steering drain.
338
-
339
- `agent/created` carries a `SessionStartSource` (why the session lifecycle began; a bridge keys its SessionStart matcher on it):
340
-
341
- ```ts type-equiv
342
- /** Why a session lifecycle began; seeded creates are `startup`, while persisted loads are `resume`. */
343
- type SessionStartSource = 'startup' | 'resume' | 'clear' | 'compact'
344
- ```
345
-
346
- ## Sessions
347
-
348
- A `Session` is an **append-only log** of typed `SessionEvent`s — the single source of truth. The LLM message history is *derived* from the log (`deriveMessages()`), not stored separately. Every entry carries a monotonic `seq`, a `time`, and a `type`-discriminated `data` payload; surface variants may also list cited earlier events in `sourceEventSeqs` and carry a `surfaceOp`.
349
-
350
- The `SessionEvent` envelope's exact conditional fields, the thirteen core event variants (`turn/start`, `turn/end`, `step/start`, `step/end`, `user/message`, `system/message`, `assistant/message`, `assistant/attempt`, `tool/call`, `tool/result`, `request/header`, `request/context`, `session/end-seed`), the `deriveMessages()` projection rules, the `TurnEndReason` reasons, and the execution-enclosure and standalone-event rules are on **[session.md](session.md)**. How the log is made durable — the `SessionPersistence` interface, JSONL provider, `session/flush` checkpoint, crash recovery, and `SessionHeader` — is on **[persistence.md](persistence.md)**.
351
-
352
- ## `ToolDefinition`
353
-
354
- The one pipeline-authoring type that is core: what every registered tool *is* — a model-facing `ToolSchema` plus an `execute` function and optional final-content and UI callbacks. A tool author rarely constructs it by hand (the `defineTool` DSL builds it with typed arguments), but it is the contract the registry holds and the loop dispatches through.
355
-
356
- Its full fields, the `defineTool`/`ValueSchemaSpec`/`ParameterSchemaSpec` typed schema DSL, the `ToolExecution`/`ToolExecutionResult` waterfall types, and the tool-presentation UI types are on **[tools.md](tools.md)**.
357
-
358
- ## Repo-wide type patterns
359
-
360
- Two patterns recur across every subsystem and are documented once, here.
361
-
362
- <a id="the-map--derived-union-pattern"></a>
363
-
364
- ### The `…Map → derived-union` pattern
365
-
366
- Almost every extensible sum type in the harness follows one pattern: an interface keyed by a discriminant tag (the `…Map`), from which the union is derived with `keyof`. Plugins add variants by **declaration merging** — no edit to the owning package.
367
-
368
- ```ts ignore-check
369
- // The pattern, schematically:
370
- interface ThingMap {
371
- 'a': { kind: 'a'; /* … */ }
372
- 'b': { kind: 'b'; /* … */ }
373
- }
374
- type ThingKind = keyof ThingMap // 'a' | 'b'
375
- type Thing = ThingMap[keyof ThingMap] // the discriminated union
376
-
377
- // A plugin extends it without touching the source package:
378
- declare module '@deepseek-ai/dsh-llm' {
379
- interface ThingMap {
380
- 'c': { kind: 'c'; /* … */ }
381
- }
382
- }
383
- ```
384
-
385
- Five canonical maps use this pattern; a plugin author extends these:
386
-
387
- | Map | Package | Derives | Catalog |
388
- |---|---|---|---|
389
- | `ContentBlockMap` | dsh-llm | `ContentBlock` | [llm-streaming.md](llm-streaming.md#content-blocks-and-messages) |
390
- | `MessageSourceMap` | dsh-llm | `MessageSource` | [llm-streaming.md](llm-streaming.md#content-blocks-and-messages) |
391
- | `FinishReasonMap` | dsh-llm | `FinishReason` | [llm-streaming.md](llm-streaming.md#the-model-request-and-result) |
392
- | `TurnEndReasonMap` | dsh-session | `TurnEndReason` | [session.md](session.md) |
393
- | `SessionEventMap` | dsh-session | `SessionEvent` | [session.md](session.md) |
394
-
395
- Two large discriminated unions are the ones consumers `switch` over most: **`StreamChunk`** (the streaming protocol) and **`SessionEvent`** (the log entry). Per the repo convention, `switch` on the tag — don't chain `if`s — so each arm narrows and a typo'd tag fails to compile.
396
-
397
- ### Branded IDs
398
-
399
- IDs passed between packages are **branded** — structurally strings, but non-interchangeable at the type level (a `SessionId` cannot be passed where a `ToolCallId` is expected). Construction uses the shared `brandString<T>()` helper or an owner-defined validating factory; comparison, logging, and JSON behave as ordinary strings.
400
-
401
- The `Branded<B>` primitive and stateless constructor live in [dsh-brand](../../packages/util/brand), which has no harness capability dependency. `brandString<T>()` applies a compile-time-only string brand.
402
-
403
- Source: [`packages/util/brand/src/index.ts`](../../packages/util/brand/src/index.ts)
404
-
405
- ```ts type-equiv
406
- /** A string carrying a compile-time-only brand `B`. */
407
- type Branded<B extends string> = string & { readonly [BRAND]: B }
408
- ```
409
-
410
- The two core IDs are `ToolCallId` (correlates a tool call with its result; dsh-llm) and `SessionId` (the shared live agent and durable session identity; dsh-session). Capability packages brand their own ids too, such as `JobId` in [jobs.md](jobs.md).
411
-
412
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
413
-
414
- <a id="cordis-surface"></a>
415
-
416
- ## Cordis API
417
-
418
- 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).
419
-
420
- <a id="ctxagentdefaultmodel--agentdefaultmodelconfig"></a>
421
-
422
- ### `ctx.agentDefaultModel` — `AgentDefaultModelConfig`
423
-
424
- Owns the default model selection independently of any Host or transport. Each operation reads the owning Config references.
425
-
426
- ```ts cordis-catalog
427
- /**
428
- * Read the current default model selection.
429
- * @returns a detached provider, model, and optional reasoning selection.
430
- */
431
- currentSelection(): ModelSelection
432
-
433
- /**
434
- * Save the complete default model selection. A deployment without a configuration
435
- * editor keeps its composition entry. Saves commit in submission order; a failed
436
- * save rejects its caller without blocking later saves.
437
- * @param next - resolved selection accepted by an entry point.
438
- * @returns fulfillment after the optional profile write settles.
439
- */
440
- async saveSelection(next: ModelSelection): Promise<void>
441
- ```
442
-
443
- Source: [`packages/core/agent-default-model/src/index.ts`](../../packages/core/agent-default-model/src/index.ts)
444
-
445
- <a id="ctxagentloop--agentloop"></a>
446
-
447
- ### `ctx.agentLoop` — `AgentLoop`
448
-
449
- Concrete agent factory and driver service.
450
-
451
- ```ts cordis-catalog
452
- /**
453
- * Create an agent and session under one caller-supplied identity, owned by
454
- * the accessing fiber. Constructor-driven config calls mint a fresh combined
455
- * id before entering this boundary. When a persistence backend is mounted,
456
- * the session's durable identity and any seed are stored before publication.
457
- * @param id - shared agent/session identity.
458
- * @param options - concrete loop options.
459
- * @param meta - optional fresh-session workspace metadata.
460
- * @returns the published running agent.
461
- */
462
- async create(id: SessionId, options: AgentOptions = {}, meta: Pick<SessionHeader, 'cwd'> = {}): Promise<Agent>
463
-
464
- /**
465
- * Create an owned agent on a caller-supplied session id.
466
- * @param ownerCtx - caller context that structurally owns the lifecycle.
467
- * @param options - identities, optional live parent, session seed/metadata, loop options, setup, and cancellation.
468
- * @returns the published handle.
469
- */
470
- async createAgent(ownerCtx: Context, options: CreateAgentOptions): Promise<AgentHandle>
471
-
472
- /**
473
- * Resume an owned agent from the configured persistence service.
474
- * @param ownerCtx - caller context that owns load, setup, and the live lifecycle.
475
- * @param options - persisted identity, optional live parent, loop options, setup, and cancellation.
476
- * @returns the published handle.
477
- */
478
- async resume(ownerCtx: Context, options: ResumeAgentOptions): Promise<AgentHandle>
479
- ```
480
-
481
- Types: [SessionHeader](persistence.md)
482
-
483
- Source: [`packages/core/agent-loop/src/index.ts`](../../packages/core/agent-loop/src/index.ts)
484
-
485
- <a id="ctxagentpresets--agentpresetregistry"></a>
486
-
487
- ### `ctx.agentPresets` — `AgentPresetRegistry`
488
-
489
- Registry of YAML-declared presets and the revisions live Agents retain.
490
-
491
- ```ts cordis-catalog
492
- /** Register and eagerly load a definition; activation failure remains visible in the roster.
493
- * @param definition Parsed configuration supplied by the declaring plugin.
494
- * @returns Definition disposer after activation or its diagnostic settles; the declaring plugin owns it.
495
- */
496
- async register(definition: PresetDefinition): Promise<() => Promise<void>>
497
-
498
- /** Inspect retained revisions, or the exact revision an Agent joined.
499
- * @param ctx - optional Agent context; omission includes all retained revisions.
500
- * @returns detached module references and isolation diagnostics; no match returns an empty list.
501
- */
502
- inspectCompositions(ctx?: Context): AgentPresetInspection[]
503
-
504
- /** Read every declared preset, including activation failures.
505
- * @returns Display metadata and loading diagnostics.
506
- */
507
- async list(): Promise<AgentPreset[]>
508
-
509
- /** Read the selection roster.
510
- * @returns Current presets, each marked when it is the default.
511
- */
512
- @Remote('list') async remoteExportList(): Promise<AgentPresetRoster>
513
-
514
- /** Resolve an identity without starting an Agent.
515
- * @param id Explicit preset or the current default.
516
- * @returns Current metadata, including failure when activation failed.
517
- */
518
- async resolve(id?: string): Promise<AgentPreset>
519
-
520
- /** Read one declaration's child plugin list as YAML, for viewing only.
521
- * @param agentPreset Preset identity.
522
- * @returns The declared composition beside its published metadata.
523
- */
524
- @Remote('read') readDocument(agentPreset: string): Promise<AgentPresetDocument>
525
-
526
- /** Bind an unpublished Agent to the current preset revision.
527
- * @param ctx Agent context from its setup callback.
528
- * @param id Requested preset, or the default.
529
- * @returns Bound preset identity.
530
- */
531
- async mount(ctx: Context, id?: string): Promise<AgentPreset>
532
-
533
- /** Join a child to the exact revision retained by its parent.
534
- * @param ctx Child Agent context.
535
- * @param parent Parent Agent context.
536
- * @returns Inherited preset id, or undefined in a preset-free composition.
537
- */
538
- composeFrom(ctx: Context, parent: Context): string | undefined
539
-
540
- /** Read the preset a live Agent uses.
541
- * @param ctx Agent context.
542
- * @returns Its preset id, if bound.
543
- */
544
- composedPreset(ctx: Context): string | undefined
545
-
546
- /** Read a service supplied inside an Agent's isolated preset group.
547
- * @param agent Agent whose composition is queried.
548
- * @param name Cordis service name.
549
- * @returns The service, or undefined.
550
- */
551
- serviceFor<K extends string & keyof Context>(agent: { ctx: Context }, name: K): Context[K] | undefined
552
-
553
- /** Rebind a blank Agent; the caller owns the blank-session check.
554
- * @param ctx Agent context.
555
- * @param id Requested preset.
556
- * @returns The bound identity.
557
- */
558
- async recompose(ctx: Context, id: string): Promise<AgentPreset>
559
-
560
- /** Select a preset before a session starts its first turn. A Session whose
561
- * log records the preset and whose Agent runs its current revision keeps its
562
- * composition; nothing is logged or announced.
563
- * @param agent Target Agent.
564
- * @param agentPreset Requested identity.
565
- * @returns Committed preset identity.
566
- */
567
- @Remote('select') async select(agent: Agent, agentPreset: string): Promise<string>
568
-
569
- /** Read current registrations for cold transcript presentation.
570
- * @param id Preset identity or the default.
571
- * @returns A revision lease; dispose it after the scoped read completes.
572
- */
573
- async acquireScope(id?: string): Promise<{ key: ScopeKey } & AsyncDisposable>
574
-
575
- /** Read plugin rows without creating an Agent.
576
- * @returns Current declaration metadata and activation states.
577
- */
578
- compositionInventory(): Promise<AgentPresetComposition[]>
579
- ```
580
-
581
- Types: [ScopeKey](scope.md)
582
-
583
- Source: [`packages/preset/agent-preset-registry/src/index.ts`](../../packages/preset/agent-preset-registry/src/index.ts)
584
-
585
- <a id="ctxagents--agentregistry"></a>
586
-
587
- ### `ctx.agents` — `AgentRegistry`
588
-
589
- Agent service (`ctx.agents`): tracks live agents and carries the initiating Agent through one process-local asynchronous driver chain. Agent *creation* is provided by whichever plugin implements the AgentFactory (`@deepseek-ai/dsh-agent-loop`), registered via setFactory.
590
-
591
- Initiator methods provide same-process causal attribution only. Ambient presence is neither liveness proof nor authorization; subjects and owners remain explicit, as does identity at worker, process, persistence, and wire boundaries. Returned Promise boundaries drain during teardown, except a nested lineage that starts an owning-fiber unload is excluded from its own drain.
592
-
593
- ```ts cordis-catalog
594
- /**
595
- * Read the Agent that initiated the inherited asynchronous driver chain.
596
- * Use this optional form for logging, tracing, metrics, or host attribution
597
- * that also supports agentless calls. When a parent creates a child, setup
598
- * reports the causal parent while the setup callback's Agent parameter
599
- * identifies the child.
600
- * @returns the inherited Agent, or `undefined` outside an initiator boundary
601
- * and inside an explicit clearing boundary.
602
- * @throws when this service instance has been disposed.
603
- */
604
- currentInitiator(): Agent | undefined
605
-
606
- /**
607
- * Read the initiating Agent and fail when no initiator boundary is active.
608
- * Use this for private helpers contractually below a driver, or for a
609
- * deployment-owned outbound request whose contract forbids agentless calls.
610
- * Generic or direct-call paths use optional lookup or explicit request fields.
611
- * @returns the inherited Agent.
612
- * @throws when no initiator is active or this service instance has been disposed.
613
- */
614
- requireInitiator(): Agent
615
-
616
- /**
617
- * Run an operation with one exact Agent as its process-local initiator. The
618
- * exact synchronous value or Promise returned by the operation is preserved.
619
- * Custom drivers and test harnesses wrap their complete returned foreground
620
- * lifetime.
621
- * A queue or wire receiver may establish this boundary only after validating
622
- * explicit identity and resolving the exact live Agent; this method does neither.
623
- * Detached work remains owned by the subsystem that starts it.
624
- * @param agent - initiating Agent to inherit; presence is neither liveness proof nor authorization.
625
- * @param operation - synchronous or asynchronous operation to invoke.
626
- * @returns the exact value returned by `operation`.
627
- * @throws when the initiator scope is closing/disposed, or when `operation` throws.
628
- */
629
- withInitiator<T>(agent: Agent, operation: () => T): T
630
-
631
- /**
632
- * Run an operation inside a boundary that hides any inherited initiating
633
- * Agent. The exact synchronous value or Promise is preserved.
634
- * Use this while creating lazy shared timers, queue pumps, pool maintenance,
635
- * watchers, or exporters so they do not inherit the first Agent that happens
636
- * to initialize them. It clears only initiator attribution, not explicit
637
- * fields, and does not own or drain detached resources.
638
- * @param operation - synchronous or asynchronous operation to invoke without an initiator.
639
- * @returns the exact value returned by `operation`.
640
- * @throws when the initiator scope is closing/disposed, or when `operation` throws.
641
- */
642
- withoutInitiator<T>(operation: () => T): T
643
-
644
- /**
645
- * Register the agent-creation factory (the loop calls this on construction,
646
- * effect-scoped). A traced Cordis service is canonicalized to its concrete
647
- * target; each create/resume call is then traced through that caller's
648
- * context so ownership follows the caller without stacking proxy layers.
649
- * Throws if a factory is already registered. Returns the disposer; on
650
- * dispose the factory slot is cleared.
651
- * @param factory - the loop-owned factory {@link create}/{@link resume} delegate to.
652
- * @returns the disposer that clears the factory slot. The exact
653
- * Cordis effect disposer (single-shot): composite (generator) effects may
654
- * yield it directly — exact identity nests the teardown in order.
655
- */
656
- setFactory(factory: AgentFactory): () => void
657
-
658
- /**
659
- * Create and publish a new agent through the registered factory.
660
- * Distinct from {@link register} (which records an already-constructed
661
- * agent): this constructs the agent and its session. Rejects if no factory is
662
- * registered or creation/setup fails. The resolved {@link AgentHandle} lets
663
- * the owner tear down exactly this agent.
664
- * @param options - shared identity, optional live parent, session seed/metadata, and agent options.
665
- * @returns the handle after setup, rollback-covered publication, and loop start complete.
666
- */
667
- async create(options: CreateAgentOptions): Promise<AgentHandle>
668
-
669
- /**
670
- * Load a persisted session and resume an agent on it through the registered
671
- * factory. Rejects if no factory is registered; the factory rejects if
672
- * session persistence is not configured or persistence/setup fails.
673
- * @param options - persisted identity, optional live parent, configuration, and setup.
674
- * @returns the handle after setup, rollback-covered publication, and loop start complete.
675
- */
676
- async resume(options: ResumeAgentOptions): Promise<AgentHandle>
677
-
678
- /**
679
- * Register a live agent with source `startup`. Rejects if the id is already registered or a
680
- * serial `agent/created` listener fails. Emits `agent/disposed`
681
- * when the calling fiber is disposed — both with the agent's scope carrier
682
- * (`scopeTarget(agent, agent)`): the subject is the agent in hand, so the
683
- * emits are scope-filtered regardless of which context invoked `register`
684
- * (calling through `agent.ctx` scopes EFFECTS; dispatch scoping always
685
- * requires passing the carrier). The entry is a runtime root; factory-backed
686
- * creation uses `options.parentAgent` for child ownership. Await the registration before using the agent.
687
- * @param agent - the already-constructed agent to record in the store.
688
- * @returns the awaitable Cordis effect disposer (single-shot; a repeat call
689
- * returns undefined without awaiting an in-flight teardown). Exact
690
- * identity is load-bearing: a composite (generator) effect that owns a
691
- * teardown ORDER — the agent factory's lifecycle chain — must yield THIS
692
- * function so Cordis nests the unregistration at that yield position;
693
- * yielding a wrapper would leave it disposing as a concurrent sibling on
694
- * owner unload, unregistering the agent (and emitting `agent/disposed`)
695
- * while its final turn is still draining.
696
- */
697
- register(agent: Agent): ReturnType<Context['effect']>
698
-
699
- /**
700
- * Insert an already-constructed agent without announcing it. This is the
701
- * advanced ordered-lifecycle primitive used by the async agent factory: it
702
- * first completes setup while the agent is unpublished, then assigns the
703
- * returned detach closure into its pre-installed composite teardown before
704
- * calling {@link announce}. Ordinary callers use {@link register}.
705
- * @param agent - the prepared, unpublished agent.
706
- * @param owner - explicitly supplied live runtime owner, or
707
- * undefined for a top-level runtime root. This is runtime ownership, not
708
- * the resumed session's durable parent lineage.
709
- * @returns an idempotent closure that removes this exact entry and emits
710
- * `agent/disposed` with listener failures contained. When called from a
711
- * `agent/created` listener, removal and disposal wait until the serial
712
- * creation dispatch settles.
713
- */
714
- enter(agent: Agent, owner: Agent | undefined): () => void
715
-
716
- /**
717
- * Announce an agent previously inserted with {@link enter}.
718
- * @param agent - the live inserted agent to announce.
719
- * @param source - fresh creation, resume, clear, or compaction source.
720
- * @param signal - optional factory initialization cancellation signal passed to listeners.
721
- * @returns completion of the serial creation listeners; a listener failure rejects.
722
- * @throws if `agent` is not the exact live registry entry for its id, or its
723
- * creation announcement already began (including a reentrant call from a
724
- * creation listener).
725
- */
726
- async announce(agent: Agent, source: SessionStartSource, signal?: AbortSignal): Promise<void>
727
-
728
- /**
729
- * Look up a live agent.
730
- * @param id - the shared agent/session id to look up.
731
- * @returns the agent, or undefined when no live agent has that id.
732
- */
733
- get(id: SessionId): Agent | undefined
734
-
735
- /**
736
- * Test whether a live agent was created through one exact parent agent's
737
- * scoped context. Runtime ownership is independent of durable session
738
- * lineage and remains unambiguous when unrelated providers reuse an id.
739
- * @param id - the candidate child agent's shared agent/session id.
740
- * @param owner - the expected runtime creator agent.
741
- * @returns true only while the exact child entry is live under that owner.
742
- */
743
- isOwnedBy(id: SessionId, owner: Agent): boolean
744
-
745
- /**
746
- * All live agents, in registration order.
747
- * @returns a fresh array; mutating it does not affect the registry.
748
- */
749
- list(): Agent[]
750
-
751
- /**
752
- * All live top-level agents in registration order. A top-level agent was
753
- * created without an owning agent context; durable session lineage does not
754
- * affect this runtime relation, so a resumed fork may still be a root.
755
- * @returns a fresh array; mutating it does not affect the registry.
756
- */
757
- roots(): Agent[]
758
- ```
759
-
760
- Source: [`packages/core/agent/src/index.ts`](../../packages/core/agent/src/index.ts)
761
-
762
- <a id="agent-events"></a>
763
-
764
- ### `agent/*` events
765
-
766
- <a id="agentassistant-stream--emit"></a>
767
-
768
- #### `agent/assistant-stream` — emit
769
-
770
- Process-local assistant-stream publication. Chunk frames are transient; the loop appends one final v2 `assistant/message` or `assistant/attempt` with the same stream before a committed end frame.
771
-
772
- ```ts cordis-catalog
773
- /**
774
- * Process-local assistant-stream publication. Chunk frames are transient;
775
- * the loop appends one final v2 `assistant/message` or `assistant/attempt`
776
- * with the same stream before a committed end frame.
777
- * @param payload.agent - the agent whose attempt produced the frame.
778
- * @param payload.frame - one ordered start, chunk, or end publication.
779
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
780
- * @mode emit
781
- */
782
- 'agent/assistant-stream'(this: Scoped<Agent>, payload: { agent: Agent; frame: AssistantStreamFrame }): void
783
- ```
784
-
785
- Types: [Scoped](scope.md)
786
-
787
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
788
-
789
- <a id="agentcreated--serial"></a>
790
-
791
- #### `agent/created` — serial
792
-
793
- An entered agent is ready for per-agent initialization after factory setup. Listeners run in order and are awaited before creation resolves. AgentLoop holds queued input until all listeners finish. A throw or rejection fails creation and skips later listeners. Disposal retains the scope and session until dispatch settles; listeners must not await agent.whenIdle() or their own owner's disposal.
794
-
795
- ```ts cordis-catalog
796
- /**
797
- * An entered agent is ready for per-agent initialization after factory setup.
798
- * Listeners run in order and are awaited before creation resolves. AgentLoop
799
- * holds queued input until all listeners finish. A throw or rejection fails
800
- * creation and skips later listeners. Disposal retains the scope and session
801
- * until dispatch settles; listeners must not await agent.whenIdle() or their
802
- * own owner's disposal.
803
- * @param payload.agent - the newly registered agent with its live session and completed setup.
804
- * @param payload.source - fresh creation, resume, clear, or compaction source.
805
- * @param payload.signal - factory initialization cancellation signal, when provided.
806
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
807
- * @mode serial
808
- */
809
- 'agent/created'(this: Scoped<Agent>, payload: { agent: Agent; source: SessionStartSource; signal?: AbortSignal }): undefined | Promise<undefined>
810
- ```
811
-
812
- Types: [Scoped](scope.md)
813
-
814
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
815
-
816
- <a id="agentdisposed--emit"></a>
817
-
818
- #### `agent/disposed` — emit
819
-
820
- An agent left the registry; AgentLoop emits this after driver quiescence and scoped-registration unwind, but before session detachment. Custom registry users own their driver-ordering contract.
821
-
822
- ```ts cordis-catalog
823
- /**
824
- * An agent left the registry; AgentLoop emits this after driver quiescence
825
- * and scoped-registration unwind, but before session detachment. Custom
826
- * registry users own their driver-ordering contract.
827
- * @param payload.agent - the exact agent removed from the registry.
828
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
829
- * @mode emit
830
- */
831
- 'agent/disposed'(this: Scoped<Agent>, payload: { agent: Agent }): void
832
- ```
833
-
834
- Types: [Scoped](scope.md)
835
-
836
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
837
-
838
- <a id="agenterror--emit"></a>
839
-
840
- #### `agent/error` — emit
841
-
842
- A step or turn errored. The machine reports a failure here even when the error has no in-turn position for a durable record.
843
-
844
- ```ts cordis-catalog
845
- /**
846
- * A step or turn errored. The machine reports a failure here even when
847
- * the error has no in-turn position for a durable record.
848
- * @param payload.agent - the agent whose turn errored.
849
- * @param payload.turn - the turn in which the failure surfaced.
850
- * @param payload.step - the step at which the failure surfaced.
851
- * @param payload.error - the failure, verbatim.
852
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
853
- * @mode emit
854
- */
855
- 'agent/error'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; step: number; error: unknown }): void
856
- ```
857
-
858
- Types: [Scoped](scope.md)
859
-
860
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
861
-
862
- <a id="agentinboxclaimed--emit"></a>
863
-
864
- #### `agent/inbox/claimed` — emit
865
-
866
- One message left the inbox inside its open turn. If the proposed step is rejected, the claimed message ends here: it is neither discarded nor re-emitted as a user/message, and the turn closes without a step.
867
-
868
- ```ts cordis-catalog
869
- /**
870
- * One message left the inbox inside its open turn. If the proposed step
871
- * is rejected, the claimed message ends here: it is neither discarded nor
872
- * re-emitted as a user/message, and the turn closes without a step.
873
- * @param payload.agent - the agent whose inbox changed.
874
- * @param payload.message - the claimed message.
875
- * @param payload.turn - the owning turn.
876
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
877
- * @mode emit
878
- */
879
- 'agent/inbox/claimed'(this: Scoped<Agent>, payload: { agent: Agent; message: UserMessage; turn: number }): void
880
- ```
881
-
882
- Types: [Scoped](scope.md) · [UserMessage](session.md)
883
-
884
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
885
-
886
- <a id="agentinboxdiscarded--emit"></a>
887
-
888
- #### `agent/inbox/discarded` — emit
889
-
890
- One message was discarded from the live inbox.
891
-
892
- ```ts cordis-catalog
893
- /**
894
- * One message was discarded from the live inbox.
895
- * @param payload.agent - the agent whose inbox changed.
896
- * @param payload.message - the discarded message.
897
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
898
- * @mode emit
899
- */
900
- 'agent/inbox/discarded'(this: Scoped<Agent>, payload: { agent: Agent; message: UserMessage }): void
901
- ```
902
-
903
- Types: [Scoped](scope.md) · [UserMessage](session.md)
904
-
905
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
906
-
907
- <a id="agentinboxinserted--emit"></a>
908
-
909
- #### `agent/inbox/inserted` — emit
910
-
911
- One message entered the live inbox.
912
-
913
- ```ts cordis-catalog
914
- /**
915
- * One message entered the live inbox.
916
- * @param payload.agent - the agent whose inbox changed.
917
- * @param payload.message - the inserted message.
918
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
919
- * @mode emit
920
- */
921
- 'agent/inbox/inserted'(this: Scoped<Agent>, payload: { agent: Agent; message: UserMessage }): void
922
- ```
923
-
924
- Types: [Scoped](scope.md) · [UserMessage](session.md)
925
-
926
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
927
-
928
- <a id="agentpre-step--waterfall"></a>
929
-
930
- #### `agent/pre-step` — waterfall
931
-
932
- Reject a proposed step or replace the messages that enter it. Calling `next()` preserves the current messages.
933
-
934
- ```ts cordis-catalog
935
- /**
936
- * Reject a proposed step or replace the messages that enter it. Calling
937
- * `next()` preserves the current messages.
938
- * @param payload.agent - the agent proposing the step.
939
- * @param payload.messages - messages removed from the inbox for this step.
940
- * @param payload.turn - the turn that will own the step.
941
- * @param payload.step - the step proposed by the loop.
942
- * @param payload.signal - the current turn's cancellation signal.
943
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
944
- * @mode waterfall
945
- */
946
- 'agent/pre-step'(this: Scoped<Agent>, payload: { agent: Agent; messages: UserMessage[]; turn: number; step: number; signal: AbortSignal }, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>
947
- ```
948
-
949
- Types: [Scoped](scope.md) · [UserMessage](session.md)
950
-
951
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
952
-
953
- <a id="agentrequest--waterfall"></a>
954
-
955
- #### `agent/request` — waterfall
956
-
957
- Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. On step admission, this runs after assembly and `step/start`, before the system prompt and accepted user batch are committed. Cancellation here or during subsequent `prepareCall()` resolution commits neither. The prepared call capability governs prompt admission. Model-visible content must use logged channels; this waterfall cannot mutate messages.
958
-
959
- ```ts cordis-catalog
960
- /**
961
- * Replace the frozen call configuration. `await next()` yields the config
962
- * the machine would use (agent options on the first request, the logged
963
- * header afterwards); return a replacement to switch. On step admission,
964
- * this runs after assembly and `step/start`, before the system prompt and
965
- * accepted user batch are committed. Cancellation here or during subsequent
966
- * `prepareCall()` resolution commits neither. The prepared call capability
967
- * governs prompt admission. Model-visible content must use logged channels;
968
- * this waterfall cannot mutate messages.
969
- * @param payload.agent - the agent making the model call.
970
- * @param payload.turn - the open turn number.
971
- * @param payload.step - the step whose request this is.
972
- * @param payload.signal - the current turn's explicit abort signal.
973
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
974
- * @mode waterfall
975
- */
976
- 'agent/request'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; step: number; signal: AbortSignal }, next: () => Promise<LlmCallConfig>): Promise<LlmCallConfig>
977
- ```
978
-
979
- Types: [LlmCallConfig](llm-streaming.md) · [Scoped](scope.md)
980
-
981
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
982
-
983
- <a id="agentrequest-error--waterfall"></a>
984
-
985
- #### `agent/request-error` — waterfall
986
-
987
- Handle one failed model-request attempt before the loop retries or closes its step. A listener returns `{ kind: 'retry' }` without calling `next()` when it owns recovery, or calls `next()` to delegate. The default `undefined` leaves the failure terminal.
988
-
989
- ```ts cordis-catalog
990
- /**
991
- * Handle one failed model-request attempt before the loop retries or closes
992
- * its step. A listener returns `{ kind: 'retry' }` without calling `next()`
993
- * when it owns recovery, or calls `next()` to delegate. The default
994
- * `undefined` leaves the failure terminal.
995
- * @param payload.agent - the agent whose request failed.
996
- * @param payload.turn - the turn containing the failed request.
997
- * @param payload.step - the step containing the failed request attempt.
998
- * @param payload.provider - the provider selected for the failed request.
999
- * @param payload.failure - serializable facts normalized at the final adapter boundary.
1000
- * @param payload.retryPolicy - the policy of the adapter registration that served the failed request.
1001
- * @param payload.signal - the turn abort signal.
1002
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
1003
- * @mode waterfall
1004
- */
1005
- 'agent/request-error'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; step: number; provider: string; failure: LlmFailure; retryPolicy: ResolvedRetryPolicy | undefined; signal: AbortSignal }, next: () => Promise<RequestErrorAction>): Promise<RequestErrorAction>
1006
- ```
1007
-
1008
- Types: [LlmFailure](llm-streaming.md) · [ResolvedRetryPolicy](llm-streaming.md) · [Scoped](scope.md)
1009
-
1010
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
1011
-
1012
- <a id="agentstatus--emit"></a>
1013
-
1014
- #### `agent/status` — emit
1015
-
1016
- Agent status changed (`idle` ⇄ `running`). A waking delivery enters `running` synchronously after reserving cancellation; `idle` means no driver remains scheduled or active.
1017
-
1018
- ```ts cordis-catalog
1019
- /**
1020
- * Agent status changed (`idle` ⇄ `running`). A waking delivery enters
1021
- * `running` synchronously after reserving cancellation; `idle` means no
1022
- * driver remains scheduled or active.
1023
- * @param payload.agent - the agent whose status flipped.
1024
- * @param payload.status - the status just entered (the transition's destination).
1025
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
1026
- * @mode emit
1027
- */
1028
- 'agent/status'(this: Scoped<Agent>, payload: { agent: Agent; status: AgentStatus }): void
1029
- ```
1030
-
1031
- Types: [Scoped](scope.md)
1032
-
1033
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
1034
-
1035
- <a id="agentturn-stopping--serial"></a>
1036
-
1037
- #### `agent/turn-stopping` — serial
1038
-
1039
- The turn is about to close: the model owes no response (no live tool calls, no fresh steering). Awaited before the boundary commits — a listener that objects steers (`agent.steer(...)`) and the machine re-reads its inbox: fresh steering runs another step, none closes the turn. Data decides, so listener order cannot change the outcome. The inverse control (stop a tool loop early) is data too: a tool result carrying `concludesTurn` ends the turn at its step. The conclusion never short-circuits already-submitted next-step work: same-step `additionalContexts` or racing steering still runs, and the turn closes only when that inbox drains.
1040
-
1041
- ```ts cordis-catalog
1042
- /**
1043
- * The turn is about to close: the model owes no response (no live tool
1044
- * calls, no fresh steering). Awaited before the boundary commits — a
1045
- * listener that objects steers (`agent.steer(...)`) and the machine
1046
- * re-reads its inbox: fresh steering runs another step, none closes the
1047
- * turn. Data decides, so listener order cannot change the outcome. The
1048
- * inverse control (stop a tool loop early) is data too: a tool result
1049
- * carrying `concludesTurn` ends the turn at its step. The conclusion
1050
- * never short-circuits already-submitted next-step work: same-step
1051
- * `additionalContexts` or racing steering still runs, and the turn
1052
- * closes only when that inbox drains.
1053
- * @param payload.agent - the agent whose turn is at its stop boundary.
1054
- * @param payload.turn - the turn about to close.
1055
- * @param payload.signal - the current turn's explicit abort signal.
1056
- * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
1057
- * @mode serial
1058
- */
1059
- 'agent/turn-stopping'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; signal: AbortSignal }): Promise<void> | void
1060
- ```
1061
-
1062
- Types: [Scoped](scope.md)
1063
-
1064
- Source: [`packages/core/agent/src/runtime-types.ts`](../../packages/core/agent/src/runtime-types.ts)
1065
-
1066
- <a id="agent-loop-events"></a>
1067
-
1068
- ### `agent-loop/*` events
1069
-
1070
- <a id="agent-loopconfig-start-failed--emit"></a>
1071
-
1072
- #### `agent-loop/config-start-failed` — emit
1073
-
1074
- A declarative agent entry failed before it could publish a live agent. Consumers that buffer work for the configured identity use this transient signal to reject that work instead of waiting forever. Normal factory teardown suppresses failures from the cancelled startup attempt.
1075
-
1076
- ```ts cordis-catalog
1077
- /**
1078
- * A declarative agent entry failed before it could publish a live agent.
1079
- * Consumers that buffer work for the configured identity use this
1080
- * transient signal to reject that work instead of waiting forever. Normal
1081
- * factory teardown suppresses failures from the cancelled startup attempt.
1082
- * @param payload.sessionId - exact shared agent/session identity that failed startup.
1083
- * @param payload.error - persistence, setup, or publication failure.
1084
- * @mode emit
1085
- */
1086
- 'agent-loop/config-start-failed'(payload: { sessionId: SessionId; error: unknown }): void
1087
- ```
1088
-
1089
- Source: [`packages/core/agent-loop/src/index.ts`](../../packages/core/agent-loop/src/index.ts)
1090
-
1091
- <a id="agent-preset-events"></a>
1092
-
1093
- ### `agent-preset/*` events
1094
-
1095
- <a id="agent-presetselected--emit"></a>
1096
-
1097
- #### `agent-preset/selected` — emit
1098
-
1099
- One session committed a different agent preset to its durable log. Consumers invalidate only state derived from that session's composition.
1100
-
1101
- ```ts cordis-catalog
1102
- /**
1103
- * One session committed a different agent preset to its durable log.
1104
- * Consumers invalidate only state derived from that session's composition.
1105
- * @mode emit
1106
- * @param sessionId - the session whose composition changed.
1107
- * @param agentPreset - the preset recorded by the committed selection.
1108
- */
1109
- 'agent-preset/selected'(sessionId: SessionId, agentPreset: string): void
1110
- ```
1111
-
1112
- Source: [`packages/preset/agent-preset-registry/src/types.ts`](../../packages/preset/agent-preset-registry/src/types.ts)
1113
- <!-- END GENERATED cordis-surface -->