dsh-plugin-dev-kb 1.5.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.en.md +31 -9
  3. package/README.md +42 -14
  4. package/kb/INDEX.md +3 -3
  5. package/kb/README.md +9 -4
  6. package/kb/extra/AGENTS.md +1 -1
  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 +2 -2
  16. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +2 -2
  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 +1 -0
  22. package/kb/extra/defensive-patterns/package-surface.zh.md +1 -0
  23. package/kb/extra/defensive-patterns/remote-and-api.md +5 -3
  24. package/kb/extra/defensive-patterns/remote-and-api.zh.md +5 -3
  25. package/kb/extra/development.md +16 -9
  26. package/kb/extra/development.zh.md +16 -9
  27. package/kb/extra/event-producer-consumer.md +64 -51
  28. package/kb/extra/event-producer-consumer.zh.md +64 -51
  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 +204 -92
  32. package/kb/extra/module-graph.zh.md +204 -92
  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/README.md +2 -0
  50. package/kb/extra/persistence-changes/README.zh.md +2 -0
  51. package/kb/extra/persistence-changes/historical-formats/README.md +1 -1
  52. package/kb/extra/persistence-changes/historical-formats/README.zh.md +1 -1
  53. package/kb/extra/rescope.md +7 -5
  54. package/kb/extra/rescope.zh.md +7 -5
  55. package/kb/extra/subsystems/agent-team.md +38 -75
  56. package/kb/extra/subsystems/agent-team.zh.md +38 -75
  57. package/kb/extra/subsystems/attachment.md +36 -13
  58. package/kb/extra/subsystems/attachment.zh.md +36 -13
  59. package/kb/extra/subsystems/boot.md +179 -5
  60. package/kb/extra/subsystems/boot.zh.md +179 -5
  61. package/kb/extra/subsystems/computer-use.md +78 -0
  62. package/kb/extra/subsystems/computer-use.zh.md +78 -0
  63. package/kb/extra/subsystems/deliverables.md +2 -0
  64. package/kb/extra/subsystems/deliverables.zh.md +2 -0
  65. package/kb/extra/subsystems/forge.md +1226 -0
  66. package/kb/extra/subsystems/forge.zh.md +1226 -0
  67. package/kb/extra/subsystems/liveshare.md +158 -0
  68. package/kb/extra/subsystems/liveshare.zh.md +158 -0
  69. package/kb/extra/subsystems/mcp.md +96 -1
  70. package/kb/extra/subsystems/mcp.zh.md +96 -1
  71. package/kb/extra/subsystems/worktrees.md +54 -3
  72. package/kb/extra/subsystems/worktrees.zh.md +54 -3
  73. package/kb/extra/testing.md +1 -1
  74. package/kb/extra/testing.zh.md +1 -1
  75. package/kb/extra/ui-design-review-cases.md +445 -0
  76. package/kb/extra/ui-design-review-cases.zh.md +445 -0
  77. package/kb/extra/ui-radius.md +3 -1
  78. package/kb/extra/ui-radius.zh.md +3 -1
  79. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +1 -1
  80. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +1 -1
  81. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.md +24 -0
  82. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.zh.md +24 -0
  83. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.md +25 -0
  84. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.zh.md +25 -0
  85. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.md +30 -0
  86. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.zh.md +30 -0
  87. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.md +28 -0
  88. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.zh.md +28 -0
  89. package/kb/extra/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.md +24 -0
  90. package/kb/extra/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.zh.md +24 -0
  91. package/kb/extra/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.md +23 -0
  92. package/kb/extra/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.zh.md +23 -0
  93. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.md +20 -0
  94. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.zh.md +20 -0
  95. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.md +31 -0
  96. package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.zh.md +31 -0
  97. package/kb/extra/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.md +34 -0
  98. package/kb/extra/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.zh.md +34 -0
  99. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.md +20 -0
  100. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.zh.md +20 -0
  101. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.md +18 -0
  102. package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.zh.md +18 -0
  103. package/kb/extra/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.md +18 -0
  104. package/kb/extra/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.zh.md +18 -0
  105. package/kb/extra/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.md +25 -0
  106. package/kb/extra/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.zh.md +25 -0
  107. package/kb/extra/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.md +23 -0
  108. package/kb/extra/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.zh.md +23 -0
  109. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.md +22 -0
  110. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.zh.md +22 -0
  111. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.md +18 -0
  112. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.zh.md +18 -0
  113. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.md +17 -0
  114. package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.zh.md +17 -0
  115. package/kb/extra/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.md +19 -0
  116. package/kb/extra/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.zh.md +19 -0
  117. package/kb/extra/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.md +27 -0
  118. package/kb/extra/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.zh.md +27 -0
  119. package/kb/extra/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.md +18 -0
  120. package/kb/extra/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.zh.md +18 -0
  121. package/kb/extra/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.md +22 -0
  122. package/kb/extra/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.zh.md +22 -0
  123. package/kb/extra/upgrade-guide/v0.2.1-rc.2/node-24/guide.md +17 -0
  124. package/kb/extra/upgrade-guide/v0.2.1-rc.2/node-24/guide.zh.md +17 -0
  125. package/kb/extra/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.md +18 -0
  126. package/kb/extra/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.zh.md +18 -0
  127. package/kb/extra/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.md +18 -0
  128. package/kb/extra/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.zh.md +18 -0
  129. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.md +18 -0
  130. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.zh.md +18 -0
  131. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.md +53 -0
  132. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.zh.md +53 -0
  133. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.md +30 -0
  134. package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.zh.md +30 -0
  135. package/kb/extra/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.md +20 -0
  136. package/kb/extra/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.zh.md +20 -0
  137. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.md +18 -0
  138. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.zh.md +18 -0
  139. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.md +18 -0
  140. package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.zh.md +18 -0
  141. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.md +24 -0
  142. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.zh.md +24 -0
  143. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.md +25 -0
  144. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.zh.md +25 -0
  145. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.md +22 -0
  146. package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.zh.md +22 -0
  147. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.md +18 -0
  148. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.zh.md +18 -0
  149. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.md +19 -0
  150. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.zh.md +19 -0
  151. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.md +26 -0
  152. package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.zh.md +26 -0
  153. package/kb/extra/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.md +35 -0
  154. package/kb/extra/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.zh.md +35 -0
  155. package/kb/extra/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.md +21 -0
  156. package/kb/extra/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.zh.md +21 -0
  157. package/kb/extra/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.md +17 -0
  158. package/kb/extra/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.zh.md +17 -0
  159. package/kb/extra/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.md +23 -0
  160. package/kb/extra/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.zh.md +23 -0
  161. package/kb/extra/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.md +21 -0
  162. package/kb/extra/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.zh.md +21 -0
  163. package/kb/extra/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.md +20 -0
  164. package/kb/extra/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.zh.md +20 -0
  165. package/kb/extra/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.md +20 -0
  166. package/kb/extra/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.zh.md +20 -0
  167. package/kb/extra/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.md +19 -0
  168. package/kb/extra/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.zh.md +19 -0
  169. package/kb/extra/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.md +23 -0
  170. package/kb/extra/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.zh.md +23 -0
  171. package/kb/extra/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.md +20 -0
  172. package/kb/extra/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.zh.md +20 -0
  173. package/kb/extra/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.md +21 -0
  174. package/kb/extra/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.zh.md +21 -0
  175. package/kb/extra/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.md +21 -0
  176. package/kb/extra/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.zh.md +21 -0
  177. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.md +18 -0
  178. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.zh.md +18 -0
  179. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-projection/guide.md +20 -0
  180. package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-projection/guide.zh.md +20 -0
  181. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.md +19 -0
  182. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.zh.md +19 -0
  183. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.md +18 -0
  184. package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.zh.md +18 -0
  185. package/kb/extra/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.md +22 -0
  186. package/kb/extra/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.zh.md +22 -0
  187. package/kb/extra/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.md +20 -0
  188. package/kb/extra/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.zh.md +20 -0
  189. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.md +19 -0
  190. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.zh.md +19 -0
  191. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.md +24 -0
  192. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.zh.md +24 -0
  193. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.md +21 -0
  194. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.zh.md +21 -0
  195. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.md +19 -0
  196. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.zh.md +19 -0
  197. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.md +18 -0
  198. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.zh.md +18 -0
  199. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.md +21 -0
  200. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.zh.md +21 -0
  201. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.md +29 -0
  202. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.zh.md +29 -0
  203. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.md +29 -0
  204. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.zh.md +29 -0
  205. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.md +29 -0
  206. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.zh.md +29 -0
  207. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.md +18 -0
  208. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.zh.md +18 -0
  209. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.md +32 -0
  210. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.zh.md +32 -0
  211. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.md +30 -0
  212. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.zh.md +30 -0
  213. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.md +19 -0
  214. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.zh.md +19 -0
  215. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.md +21 -0
  216. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.zh.md +21 -0
  217. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.md +37 -0
  218. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.zh.md +37 -0
  219. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.md +22 -0
  220. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.zh.md +22 -0
  221. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.md +24 -0
  222. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.zh.md +24 -0
  223. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.md +20 -0
  224. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.zh.md +20 -0
  225. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.md +20 -0
  226. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.zh.md +20 -0
  227. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.md +17 -0
  228. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.zh.md +17 -0
  229. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.md +19 -0
  230. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.zh.md +19 -0
  231. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.md +18 -0
  232. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.zh.md +18 -0
  233. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.md +29 -0
  234. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.zh.md +29 -0
  235. package/kb/extra/web-styling.md +19 -1
  236. package/kb/extra/web-styling.zh.md +19 -1
  237. package/kb/meta/search-index.json +1272 -1098
  238. package/kb/meta/source.json +8 -4
  239. package/kb/site/develop/cordis-tutorial/04-events.md +1 -1
  240. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +5 -4
  241. package/kb/site/develop/framework/events.md +1 -1
  242. package/kb/site/develop/practice/dynamic-cordis.md +1 -1
  243. package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -1
  244. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +5 -4
  245. package/kb/site/en/develop/framework/events.md +1 -1
  246. package/kb/site/en/develop/practice/dynamic-cordis.md +1 -1
  247. package/kb/site/en/guide/network-proxy.md +1 -1
  248. package/kb/site/en/guide/plugin-market.md +10 -10
  249. package/kb/site/en/guide/providers.md +5 -1
  250. package/kb/site/en/guide/python-sdk.md +17 -2
  251. package/kb/site/en/guide/schedule.md +45 -26
  252. package/kb/site/en/reference/agent-lifecycle.md +3 -1
  253. package/kb/site/en/reference/api-gateway.md +4 -4
  254. package/kb/site/en/reference/capability-seams.md +65 -17
  255. package/kb/site/en/reference/config-catalog.md +560 -238
  256. package/kb/site/en/reference/cookbook/adding-a-package.md +4 -2
  257. package/kb/site/en/reference/cookbook/extension-cookbook.md +1 -1
  258. package/kb/site/en/reference/cordis-api/context.md +1 -1
  259. package/kb/site/en/reference/cordis-api/events.md +9 -9
  260. package/kb/site/en/reference/cordis-api/fiber.md +85 -32
  261. package/kb/site/en/reference/cordis-api/inherited.md +10 -9
  262. package/kb/site/en/reference/experimental-persistence-catalog.md +3 -0
  263. package/kb/site/en/reference/index.md +14 -8
  264. package/kb/site/en/reference/persistence-catalog.md +532 -246
  265. package/kb/site/en/reference/subsystems/client-modules.md +19 -11
  266. package/kb/site/en/reference/subsystems/compaction.md +1 -1
  267. package/kb/site/en/reference/subsystems/conversation.md +2 -0
  268. package/kb/site/en/reference/subsystems/core.md +119 -65
  269. package/kb/site/en/reference/subsystems/filesystem.md +202 -28
  270. package/kb/site/en/reference/subsystems/index.md +3 -1
  271. package/kb/site/en/reference/subsystems/llm-streaming.md +92 -4
  272. package/kb/site/en/reference/subsystems/persistence.md +17 -7
  273. package/kb/site/en/reference/subsystems/plan.md +4 -4
  274. package/kb/site/en/reference/subsystems/ptc-runtime.md +12 -5
  275. package/kb/site/en/reference/subsystems/sandbox.md +11 -4
  276. package/kb/site/en/reference/subsystems/schedule.md +194 -430
  277. package/kb/site/en/reference/subsystems/session-projection.md +186 -44
  278. package/kb/site/en/reference/subsystems/session-reference.md +4 -3
  279. package/kb/site/en/reference/subsystems/session.md +119 -31
  280. package/kb/site/en/reference/subsystems/sidebar-right.md +12 -11
  281. package/kb/site/en/reference/subsystems/skills.md +4 -4
  282. package/kb/site/en/reference/subsystems/slots.md +30 -3
  283. package/kb/site/en/reference/subsystems/storage.md +26 -9
  284. package/kb/site/en/reference/subsystems/subagent.md +119 -102
  285. package/kb/site/en/reference/subsystems/system-prompt.md +13 -11
  286. package/kb/site/en/reference/subsystems/token-meter.md +45 -0
  287. package/kb/site/en/reference/subsystems/tools.md +222 -82
  288. package/kb/site/en/reference/subsystems/typert.md +21 -11
  289. package/kb/site/en/reference/subsystems/user-questions.md +22 -6
  290. package/kb/site/en/reference/subsystems/web-client.md +1 -1
  291. package/kb/site/en/reference/subsystems/web-server.md +68 -23
  292. package/kb/site/en/reference/subsystems/web.md +79 -21
  293. package/kb/site/en/reference/tool-catalog.md +270 -395
  294. package/kb/site/en/reference/tool-execution-pipeline.md +5 -4
  295. package/kb/site/guide/network-proxy.md +1 -1
  296. package/kb/site/guide/plugin-market.md +10 -10
  297. package/kb/site/guide/providers.md +5 -1
  298. package/kb/site/guide/python-sdk.md +17 -2
  299. package/kb/site/guide/schedule.md +45 -26
  300. package/kb/site/reference/agent-lifecycle.md +3 -1
  301. package/kb/site/reference/api-gateway.md +4 -4
  302. package/kb/site/reference/capability-seams.md +65 -17
  303. package/kb/site/reference/config-catalog.md +560 -238
  304. package/kb/site/reference/cookbook/adding-a-package.md +4 -2
  305. package/kb/site/reference/cookbook/extension-cookbook.md +1 -1
  306. package/kb/site/reference/cordis-api/context.md +1 -1
  307. package/kb/site/reference/cordis-api/events.md +9 -9
  308. package/kb/site/reference/cordis-api/fiber.md +87 -32
  309. package/kb/site/reference/cordis-api/inherited.md +10 -9
  310. package/kb/site/reference/experimental-persistence-catalog.md +3 -0
  311. package/kb/site/reference/index.md +14 -8
  312. package/kb/site/reference/persistence-catalog.md +532 -246
  313. package/kb/site/reference/subsystems/client-modules.md +19 -11
  314. package/kb/site/reference/subsystems/compaction.md +1 -1
  315. package/kb/site/reference/subsystems/conversation.md +4 -0
  316. package/kb/site/reference/subsystems/core.md +119 -65
  317. package/kb/site/reference/subsystems/filesystem.md +202 -28
  318. package/kb/site/reference/subsystems/index.md +3 -1
  319. package/kb/site/reference/subsystems/llm-streaming.md +92 -4
  320. package/kb/site/reference/subsystems/persistence.md +17 -7
  321. package/kb/site/reference/subsystems/plan.md +4 -4
  322. package/kb/site/reference/subsystems/ptc-runtime.md +12 -5
  323. package/kb/site/reference/subsystems/sandbox.md +11 -4
  324. package/kb/site/reference/subsystems/schedule.md +197 -433
  325. package/kb/site/reference/subsystems/session-projection.md +186 -44
  326. package/kb/site/reference/subsystems/session-reference.md +4 -3
  327. package/kb/site/reference/subsystems/session.md +119 -31
  328. package/kb/site/reference/subsystems/sidebar-right.md +12 -11
  329. package/kb/site/reference/subsystems/skills.md +4 -4
  330. package/kb/site/reference/subsystems/slots.md +30 -3
  331. package/kb/site/reference/subsystems/storage.md +26 -9
  332. package/kb/site/reference/subsystems/subagent.md +119 -102
  333. package/kb/site/reference/subsystems/system-prompt.md +13 -11
  334. package/kb/site/reference/subsystems/token-meter.md +45 -0
  335. package/kb/site/reference/subsystems/tools.md +222 -82
  336. package/kb/site/reference/subsystems/typert.md +21 -11
  337. package/kb/site/reference/subsystems/user-questions.md +22 -6
  338. package/kb/site/reference/subsystems/web-client.md +1 -1
  339. package/kb/site/reference/subsystems/web-server.md +68 -23
  340. package/kb/site/reference/subsystems/web.md +79 -21
  341. package/kb/site/reference/tool-catalog.md +273 -399
  342. package/kb/site/reference/tool-execution-pipeline.md +4 -3
  343. package/lib/index.js +268 -11
  344. package/lib/kb-search.js +261 -0
  345. package/lib/kb-version.js +118 -0
  346. package/package.json +5 -3
  347. package/scripts/refresh-kb.mjs +153 -0
  348. package/scripts/selfcheck.mjs +28 -0
  349. package/scripts/smoke.mjs +77 -0
  350. package/skills/dsh-plugin-dev-kb.md +8 -7
  351. package/skills/dsh-plugin-starter.md +65 -0
  352. package/skills/dsh-upgrade-assistant.md +62 -0
  353. package/kb/extra/agent-lifecycle.md +0 -91
  354. package/kb/extra/agent-lifecycle.zh.md +0 -93
  355. package/kb/extra/api-gateway.md +0 -172
  356. package/kb/extra/api-gateway.zh.md +0 -178
  357. package/kb/extra/architecture.md +0 -165
  358. package/kb/extra/architecture.zh.md +0 -169
  359. package/kb/extra/capability-seams.md +0 -714
  360. package/kb/extra/capability-seams.zh.md +0 -716
  361. package/kb/extra/config-catalog.md +0 -4801
  362. package/kb/extra/config-catalog.zh.md +0 -4803
  363. package/kb/extra/cookbook/adding-a-package.md +0 -170
  364. package/kb/extra/cookbook/adding-a-package.zh.md +0 -170
  365. package/kb/extra/cookbook/adding-a-settings-card.md +0 -72
  366. package/kb/extra/cookbook/adding-a-settings-card.zh.md +0 -72
  367. package/kb/extra/cookbook/adding-a-tool.md +0 -101
  368. package/kb/extra/cookbook/adding-a-tool.zh.md +0 -103
  369. package/kb/extra/cookbook/adding-an-llm-adapter.md +0 -43
  370. package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +0 -43
  371. package/kb/extra/cookbook/extension-cookbook.md +0 -132
  372. package/kb/extra/cookbook/extension-cookbook.zh.md +0 -136
  373. package/kb/extra/cordis-api/context.md +0 -364
  374. package/kb/extra/cordis-api/context.zh.md +0 -366
  375. package/kb/extra/cordis-api/events.md +0 -207
  376. package/kb/extra/cordis-api/events.zh.md +0 -209
  377. package/kb/extra/cordis-api/fiber.md +0 -375
  378. package/kb/extra/cordis-api/fiber.zh.md +0 -377
  379. package/kb/extra/cordis-api/inherited.md +0 -38
  380. package/kb/extra/cordis-api/registry.md +0 -152
  381. package/kb/extra/cordis-api/registry.zh.md +0 -154
  382. package/kb/extra/cordis-api/service.md +0 -102
  383. package/kb/extra/cordis-api/service.zh.md +0 -104
  384. package/kb/extra/cordis-tutorial/01-first-plugin.md +0 -95
  385. package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +0 -95
  386. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +0 -98
  387. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +0 -98
  388. package/kb/extra/cordis-tutorial/03-services.md +0 -98
  389. package/kb/extra/cordis-tutorial/03-services.zh.md +0 -98
  390. package/kb/extra/cordis-tutorial/04-events.md +0 -144
  391. package/kb/extra/cordis-tutorial/04-events.zh.md +0 -144
  392. package/kb/extra/cordis-tutorial/05-config.md +0 -111
  393. package/kb/extra/cordis-tutorial/05-config.zh.md +0 -111
  394. package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +0 -113
  395. package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +0 -113
  396. package/kb/extra/cordis-tutorial/07-into-the-harness.md +0 -108
  397. package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +0 -108
  398. package/kb/extra/cordis-tutorial/index.md +0 -60
  399. package/kb/extra/cordis-tutorial/index.zh.md +0 -62
  400. package/kb/extra/experimental-persistence-catalog.md +0 -17
  401. package/kb/extra/experimental-persistence-catalog.zh.md +0 -17
  402. package/kb/extra/persistence-catalog.md +0 -9140
  403. package/kb/extra/persistence-catalog.zh.md +0 -9142
  404. package/kb/extra/subsystems/README.md +0 -76
  405. package/kb/extra/subsystems/README.zh.md +0 -76
  406. package/kb/extra/subsystems/approval.md +0 -170
  407. package/kb/extra/subsystems/approval.zh.md +0 -170
  408. package/kb/extra/subsystems/client-modules.md +0 -198
  409. package/kb/extra/subsystems/client-modules.zh.md +0 -198
  410. package/kb/extra/subsystems/client-resources.md +0 -92
  411. package/kb/extra/subsystems/client-resources.zh.md +0 -92
  412. package/kb/extra/subsystems/commands.md +0 -223
  413. package/kb/extra/subsystems/commands.zh.md +0 -223
  414. package/kb/extra/subsystems/compaction.md +0 -284
  415. package/kb/extra/subsystems/compaction.zh.md +0 -284
  416. package/kb/extra/subsystems/conversation.md +0 -301
  417. package/kb/extra/subsystems/conversation.zh.md +0 -303
  418. package/kb/extra/subsystems/core.md +0 -1113
  419. package/kb/extra/subsystems/core.zh.md +0 -1125
  420. package/kb/extra/subsystems/credentials.md +0 -493
  421. package/kb/extra/subsystems/credentials.zh.md +0 -493
  422. package/kb/extra/subsystems/filesystem.md +0 -530
  423. package/kb/extra/subsystems/filesystem.zh.md +0 -530
  424. package/kb/extra/subsystems/goal.md +0 -313
  425. package/kb/extra/subsystems/goal.zh.md +0 -313
  426. package/kb/extra/subsystems/jobs.md +0 -554
  427. package/kb/extra/subsystems/jobs.zh.md +0 -554
  428. package/kb/extra/subsystems/llm-streaming.md +0 -1196
  429. package/kb/extra/subsystems/llm-streaming.zh.md +0 -1202
  430. package/kb/extra/subsystems/lsp.md +0 -202
  431. package/kb/extra/subsystems/lsp.zh.md +0 -202
  432. package/kb/extra/subsystems/permission-presets.md +0 -167
  433. package/kb/extra/subsystems/permission-presets.zh.md +0 -167
  434. package/kb/extra/subsystems/persistence.md +0 -418
  435. package/kb/extra/subsystems/persistence.zh.md +0 -418
  436. package/kb/extra/subsystems/plan.md +0 -87
  437. package/kb/extra/subsystems/plan.zh.md +0 -87
  438. package/kb/extra/subsystems/ptc-runtime.md +0 -250
  439. package/kb/extra/subsystems/ptc-runtime.zh.md +0 -250
  440. package/kb/extra/subsystems/sandbox.md +0 -221
  441. package/kb/extra/subsystems/sandbox.zh.md +0 -221
  442. package/kb/extra/subsystems/schedule.md +0 -550
  443. package/kb/extra/subsystems/schedule.zh.md +0 -550
  444. package/kb/extra/subsystems/scope.md +0 -59
  445. package/kb/extra/subsystems/scope.zh.md +0 -61
  446. package/kb/extra/subsystems/session-projection.md +0 -356
  447. package/kb/extra/subsystems/session-projection.zh.md +0 -356
  448. package/kb/extra/subsystems/session-query.md +0 -511
  449. package/kb/extra/subsystems/session-query.zh.md +0 -511
  450. package/kb/extra/subsystems/session-reference.md +0 -224
  451. package/kb/extra/subsystems/session-reference.zh.md +0 -224
  452. package/kb/extra/subsystems/session-telemetry.md +0 -212
  453. package/kb/extra/subsystems/session-telemetry.zh.md +0 -212
  454. package/kb/extra/subsystems/session-title.md +0 -213
  455. package/kb/extra/subsystems/session-title.zh.md +0 -213
  456. package/kb/extra/subsystems/session.md +0 -1339
  457. package/kb/extra/subsystems/session.zh.md +0 -1343
  458. package/kb/extra/subsystems/settings.md +0 -155
  459. package/kb/extra/subsystems/settings.zh.md +0 -155
  460. package/kb/extra/subsystems/shell.md +0 -314
  461. package/kb/extra/subsystems/shell.zh.md +0 -314
  462. package/kb/extra/subsystems/sidebar-right.md +0 -160
  463. package/kb/extra/subsystems/sidebar-right.zh.md +0 -160
  464. package/kb/extra/subsystems/skills.md +0 -352
  465. package/kb/extra/subsystems/skills.zh.md +0 -352
  466. package/kb/extra/subsystems/slots.md +0 -200
  467. package/kb/extra/subsystems/slots.zh.md +0 -204
  468. package/kb/extra/subsystems/spill.md +0 -124
  469. package/kb/extra/subsystems/spill.zh.md +0 -124
  470. package/kb/extra/subsystems/storage.md +0 -259
  471. package/kb/extra/subsystems/storage.zh.md +0 -259
  472. package/kb/extra/subsystems/subagent.md +0 -686
  473. package/kb/extra/subsystems/subagent.zh.md +0 -688
  474. package/kb/extra/subsystems/subprocess.md +0 -321
  475. package/kb/extra/subsystems/subprocess.zh.md +0 -321
  476. package/kb/extra/subsystems/system-prompt.md +0 -254
  477. package/kb/extra/subsystems/system-prompt.zh.md +0 -254
  478. package/kb/extra/subsystems/terminal.md +0 -184
  479. package/kb/extra/subsystems/terminal.zh.md +0 -184
  480. package/kb/extra/subsystems/token-meter.md +0 -106
  481. package/kb/extra/subsystems/token-meter.zh.md +0 -106
  482. package/kb/extra/subsystems/tools.md +0 -747
  483. package/kb/extra/subsystems/tools.zh.md +0 -747
  484. package/kb/extra/subsystems/typert.md +0 -690
  485. package/kb/extra/subsystems/typert.zh.md +0 -690
  486. package/kb/extra/subsystems/user-questions.md +0 -307
  487. package/kb/extra/subsystems/user-questions.zh.md +0 -307
  488. package/kb/extra/subsystems/web-client.md +0 -100
  489. package/kb/extra/subsystems/web-client.zh.md +0 -100
  490. package/kb/extra/subsystems/web-server.md +0 -302
  491. package/kb/extra/subsystems/web-server.zh.md +0 -302
  492. package/kb/extra/subsystems/web.md +0 -206
  493. package/kb/extra/subsystems/web.zh.md +0 -206
  494. package/kb/extra/subsystems/workflow.md +0 -278
  495. package/kb/extra/subsystems/workflow.zh.md +0 -278
  496. package/kb/extra/subsystems/workspace.md +0 -647
  497. package/kb/extra/subsystems/workspace.zh.md +0 -647
  498. package/kb/extra/tool-catalog.md +0 -2824
  499. package/kb/extra/tool-catalog.zh.md +0 -2832
  500. package/kb/extra/tool-execution-pipeline.md +0 -65
  501. package/kb/extra/tool-execution-pipeline.zh.md +0 -67
@@ -34,7 +34,7 @@ interface ToolDefinition extends ToolSchema {
34
34
  /**
35
35
  * Run one accepted call and return only its canonical lossless-JSON value.
36
36
  * Async work must observe or forward `exec.signal` and settle only after its
37
- * owned work reaches quiescence. The registry preserves caller cancellation
37
+ * owned work reaches quiescence. The executor preserves caller cancellation
38
38
  * through around-dispatch signal replacement and does not abandon this
39
39
  * promise, but it cannot hard-kill same-process code.
40
40
  * @param args - losslessly snapshotted, frozen model arguments.
@@ -53,12 +53,12 @@ interface ToolDefinition extends ToolSchema {
53
53
  */
54
54
  projectContent?(exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): ContentBlock[] | undefined
55
55
  /**
56
- * Synchronous last-mile transform for model-facing content. The registry
56
+ * Synchronous last-mile transform for model-facing content. The executor
57
57
  * snapshots this callback when execution starts and invokes it exactly once
58
58
  * for every normalized outcome, including pipeline failures that bypass
59
59
  * `tools/post-execute`, immediately before lossless materialization.
60
60
  * Returning `undefined` preserves the content; every other result field
61
- * remains registry-owned. The callback must be total and must not throw.
61
+ * remains executor-owned. The callback must be total and must not throw.
62
62
  * @param exec - immutable execution identity and arguments.
63
63
  * @param result - complete normalized outcome before materialization.
64
64
  * @returns replacement content, or `undefined` to preserve it.
@@ -181,9 +181,140 @@ interface ToolRestriction {
181
181
  }
182
182
  ```
183
183
 
184
+ ## 条件准入 — 步骤拥有的准入集合
185
+
186
+ 注册可以携带 `when` 条件。AgentLoop 为每个拟议步骤以捕获的模型选择调用一次 `ctx.tools.resolve()`;返回的集合决定该步骤的工具声明、执行器分区以及批次中的每次调用,包括 PTC 程序的子调用。`ctx.tools.executable()` 在执行时应用集合,没有集合时排除条件注册。同名替换或新的限制会阻止尚未开始的调用使用已准入的注册,步骤的批次结束后循环释放集合。
187
+
188
+ ```ts type-equiv
189
+ /** Inputs for a tool's step-time activation condition. */
190
+ interface ToolActivationContext {
191
+ /** Agent preparing the step. */
192
+ readonly agent: Agent
193
+ /** Provider, model, and optional reasoning effort captured for the step. */
194
+ readonly modelSelection: Readonly<ModelSelection>
195
+ /** Cancellation of step preparation; asynchronous conditions must observe it. */
196
+ readonly signal: AbortSignal
197
+ }
198
+ ```
199
+
200
+ ```ts type-equiv
201
+ /** Lifecycle-owned conditions for a registered tool. */
202
+ interface ToolRegistrationOptions {
203
+ /**
204
+ * Decide whether the step's requests may call the tool. Omission enables
205
+ * it. False excludes it from both declarations and dispatch; rejection fails
206
+ * step preparation. Conditions must not mutate registrations or start tool work.
207
+ * @param context - preparing agent, captured model selection, and cancellation signal.
208
+ * @returns whether the tool participates in this step.
209
+ */
210
+ readonly when?: (context: ToolActivationContext) => boolean | Promise<boolean>
211
+ }
212
+ ```
213
+
214
+ ```ts type-equiv
215
+ /** One step's admitted registrations, also used by nested PTC calls. */
216
+ interface ResolvedToolSet {
217
+ /** Close admission after the step's tool batch settles. */
218
+ dispose(): void
219
+ /**
220
+ * Read admitted registrations that remain visible in their original scope.
221
+ * @param scope - exact requesting agent; another scope is never admitted.
222
+ * @returns original definitions excluding removed or restricted registrations.
223
+ */
224
+ view(scope: ScopeKey | undefined): ReadonlyMap<string, ToolDefinition>
225
+ }
226
+ ```
227
+
228
+ ## 执行器与原始调用批次
229
+
230
+ `ctx.tools.execute()` 把完整的原始模型调用批次委托给最近作用域的执行器。服务在每个批次开始时选择当前提供者;提示词组装仅返回模型输入。`agent` 在独立服务调用中不存在;`log` 在模型步骤之外的程序调用(例如初始化钩子)中不存在。有 Agent 而没有 `log` 时,调用仍受该 Agent 的工具作用域约束,但不记录根调用/结果事件。工具自身的事件仍可使用 Agent 的 Session。
231
+
232
+ ```ts type-equiv
233
+ /** Model-call schemas produced by an executor. */
234
+ type ToolModelInput = Pick<ToolProviderResult, 'schemas' | 'knownNames'>
235
+ ```
236
+
237
+ ```ts type-equiv
238
+ /** Raw model calls, with optional Agent ownership and model-step logging. */
239
+ interface ToolBatchInput {
240
+ readonly calls: readonly ToolCallBlock[]
241
+ readonly signal: AbortSignal
242
+ /**
243
+ * Positive integer overriding the executor's concurrency limit for this batch.
244
+ * Applies to concurrency-safe root calls; program subcall limits remain separate.
245
+ * Undefined uses the executor's configured limit.
246
+ */
247
+ readonly maxParallelToolCalls?: number
248
+ /**
249
+ * Owning Agent supplies scoped tools and execution context, including outside a turn.
250
+ * Undefined for standalone calls outside an Agent, such as a service invocation.
251
+ */
252
+ readonly agent?: Agent
253
+ /**
254
+ * Step admission for every call in the batch, including program subcalls.
255
+ * Undefined admits only unconditional registrations.
256
+ */
257
+ readonly toolSet?: ResolvedToolSet
258
+ /**
259
+ * Committed model step receiving root call/result events; requires `agent`.
260
+ * Undefined when `agent` is absent or for calls outside a model response, such
261
+ * as session initialization hooks. Without `log`, root call/result events are
262
+ * omitted while `agent`, when provided, still supplies scope and execution context.
263
+ */
264
+ readonly log?: {
265
+ readonly turn: number
266
+ readonly step: number
267
+ }
268
+ }
269
+ ```
270
+
271
+ ```ts type-equiv
272
+ /** One settled result correlated with its original model call. */
273
+ interface ToolCallResult {
274
+ readonly callId: ToolCallId
275
+ readonly result: ToolExecutionResult
276
+ }
277
+ ```
278
+
279
+ ```ts type-equiv
280
+ /** Model-ordered outcomes and context accepted for the next step. */
281
+ interface ToolBatchResult {
282
+ readonly results: readonly ToolCallResult[]
283
+ readonly additionalContexts: readonly UserMessage[]
284
+ readonly concluded: boolean
285
+ }
286
+ ```
287
+
288
+ ```ts type-equiv
289
+ /** A plugin owns argument parsing, dispatch, scheduling, cancellation, and logging. */
290
+ interface ToolExecutor {
291
+ /** Guidance registered and disposed with this executor; absent means no executor-owned sections. */
292
+ readonly sections?: readonly ToolPromptSection[]
293
+ /**
294
+ * Describe the model's callable tools.
295
+ * @param tools - currently visible capability definitions, after scoped restrictions.
296
+ * @returns schemas and names used to validate tool ordering.
297
+ */
298
+ describe(tools: readonly ToolDefinition[]): ToolModelInput
299
+ /**
300
+ * Execute a complete batch. With log, commit root call/result events to the
301
+ * Agent's Session; without log, omit those events. Tool-owned events may still
302
+ * use the owning Agent's Session. Return
303
+ * one outcome per input call in input order, including skipped calls on abort.
304
+ * Never settle while started work is still running. Internal failures reject
305
+ * with ToolBatchExecutionError after draining, preserving committed outcomes
306
+ * and context; callers must stop dependent work and repair missing log results.
307
+ * An explicit maxParallelToolCalls takes precedence over executor configuration.
308
+ * @param input - original calls, cancellation, optional concurrency override, Agent and logging step.
309
+ * @returns settled results, deferred context, and whether a success concludes the turn.
310
+ */
311
+ execute(input: ToolBatchInput): Promise<ToolBatchResult>
312
+ }
313
+ ```
314
+
184
315
  ## 执行:可扩展的 waterfall(瀑布式事件)加单调策略
185
316
 
186
- `ctx.tools.execute()` 接受由调用方拥有且包含必需 readonly `signal` 的 `ToolExecutionInput`,将其解析后的 JSON 参数一次性物化为流水线拥有的 `ToolExecution`,然后让调用依次经过 `tools/pre-execute`(可重排的 allow/deny/ask waterfall)→ 已注册的单调 guard → `tools/execute`(环绕分派包装层)→ `projectContent` → `tools/post-execute`(检查/替换结果)→ 可选且由定义拥有的 `finalizeContent` → `tools/result`(不可变的权威结果)。只有 `tools/execute` 视图可以替换必需的 signal。最终产出为 `ToolExecutionResult`。
317
+ 内置执行器把解析后的 `ToolExecutionInput` 交给共享 `ToolExecutionPipeline`。流水线负责参数快照、执行身份、策略瀑布、工具分发和最终结果通知,每次返回一个 `ToolExecutionResult`。自定义执行器可以独立实现这些行为;公开的 `ToolExecutor` 只要求工具描述和批次执行方法。
187
318
 
188
319
  ```ts type-equiv
189
320
  /** Opaque call identity that permits correlation without exposing mutable execution state. */
@@ -192,8 +323,8 @@ type ToolExecutionToken = symbol & { readonly [toolExecutionTokenBrand]: true }
192
323
 
193
324
  ```ts type-equiv
194
325
  /**
195
- * Caller-supplied description of one tool call. {@link ToolRuntime.execute}
196
- * adds the registry-owned token to form a pipeline {@link ToolExecution};
326
+ * Parsed input to the shared invocation pipeline. The pipeline
327
+ * adds its own token to form a {@link ToolExecution};
197
328
  * callers do not choose that token.
198
329
  */
199
330
  interface ToolExecutionInput {
@@ -210,14 +341,16 @@ interface ToolExecutionInput {
210
341
  readonly arguments: unknown
211
342
  /** The agent on whose behalf the call runs (set by the agent loop). */
212
343
  readonly agent?: Agent
344
+ /** Step admission shared by Native and PTC dispatch. Conditional tools require it. */
345
+ readonly toolSet?: ResolvedToolSet
213
346
  /**
214
347
  * Opaque token of the enclosing transport execution, when one exists. PTC
215
348
  * mode sets this on SDK sub-dispatches so commit-style observers can wait for
216
349
  * the outer `run_code` outcome without receiving its live mutable execution.
217
350
  * The token also marks the call as a transport sub-dispatch rather than a
218
- * model-direct call: under `mode: 'ptc'`, only calls WITH a parent may
351
+ * model-direct call: with the PTC executor selected, only calls with a parent may
219
352
  * execute a native tool name — a model-direct call (no parent) is denied as
220
- * `UNKNOWN_TOOL` before the policy pipeline. See {@link ToolRuntime.execute}.
353
+ * `UNKNOWN_TOOL` before the policy pipeline.
221
354
  */
222
355
  readonly parent?: ToolExecutionToken
223
356
  /** Required caller-owned cancellation for this invocation. */
@@ -229,7 +362,7 @@ interface ToolExecutionInput {
229
362
 
230
363
  ```ts type-equiv
231
364
  /**
232
- * Runtime context handed to a tool implementation after the registry has
365
+ * Runtime context handed to a tool implementation after the executor has
233
366
  * accepted a {@link ToolExecution}. {@link deferContext} attaches context to
234
367
  * this execution's own result — a composite tool ferries nested-dispatch
235
368
  * context back to the outer result, and a leaf tool may mint a fresh
@@ -298,16 +431,16 @@ interface PtcDispatchLog {
298
431
 
299
432
  ```ts type-equiv
300
433
  /**
301
- * One pending tool call inside the registry pipeline. Parsed arguments cross
434
+ * One pending tool call inside the executor pipeline. Parsed arguments cross
302
435
  * one lossless-JSON materialization boundary before policy and are deep-frozen;
303
- * call identity, the caller signal, and the registry-assigned {@link token} are
304
- * readonly. The registry freezes the complete object before `tools/result`
436
+ * call identity, the caller signal, and the executor-assigned {@link token} are
437
+ * readonly. The executor freezes the complete object before `tools/result`
305
438
  * observers run.
306
439
  */
307
440
  interface ToolExecution extends ToolExecutionInput {
308
441
  /** Root model-requested call, resolved for every root and nested execution. */
309
442
  readonly rootCallId: ToolCallId
310
- /** Registry-assigned identity shared with nested calls only as their opaque `parent` token. */
443
+ /** Executor-assigned identity shared with nested calls only as their opaque `parent` token. */
311
444
  readonly token: ToolExecutionToken
312
445
  }
313
446
  ```
@@ -316,7 +449,7 @@ interface ToolExecution extends ToolExecutionInput {
316
449
  /**
317
450
  * Around-dispatch view of a {@link ToolExecution}. A `tools/execute` wrapper
318
451
  * may replace the signal for its delegated lifetime, but it cannot remove it.
319
- * The registry fuses every replacement with the captured caller signal.
452
+ * The executor fuses every replacement with the captured caller signal.
320
453
  */
321
454
  interface ToolDispatchExecution extends Omit<ToolExecution, 'signal'> {
322
455
  /** Cancellation signal visible to the next wrapper or tool body. */
@@ -505,33 +638,21 @@ type ObjectJsonSchema = JsonSchemaNode & { type: 'object' }
505
638
 
506
639
  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).
507
640
 
508
- <a id="ctxtools--toolruntime"></a>
641
+ <a id="ctxtools--toolsservice"></a>
509
642
 
510
- ### `ctx.tools` — `ToolRuntime`
643
+ ### `ctx.tools` — `ToolsService`
511
644
 
512
- Tool registry and execution pipeline. Scoped registrations shadow globals; one visibility resolver feeds presentation, lookup, and dispatch.
645
+ Concrete tool registry and scoped executor dispatcher.
513
646
 
514
647
  ```ts cordis-catalog
515
- /**
516
- * Present the calling scope's tools in `mode` instead of the deployment
517
- * default. Nearest scope on the chain wins, so a preset's standing
518
- * declaration covers every agent joined under it.
519
- *
520
- * Scoped only, and one declaration per scope: this is how an agent preset
521
- * composes PTC mode agents beside native ones in the same process, and a
522
- * process-global override would be the `mode` config field instead.
523
- * @param mode - the presentation the covered agents' models see.
524
- * @returns the exact disposer that restores the deployment default.
525
- */
526
- presentAs(mode: ToolPresentationMode): () => void
527
-
528
648
  /**
529
649
  * Register globally or in the calling agent scope. Scoped tools shadow
530
650
  * globals; duplicates within one layer and the reserved `run_code` name fail.
531
651
  * @param definition - tool schema, execution, and optional finalization/presentation callbacks.
652
+ * @param options - optional step-time activation condition.
532
653
  * @returns the exact disposer that unregisters the tool.
533
654
  */
534
- register(definition: ToolDefinition): () => void
655
+ register(definition: ToolDefinition, options: ToolRegistrationOptions = {}): () => void
535
656
 
536
657
  /**
537
658
  * Restrict global tools for the calling agent scope. Empty filters, unknown
@@ -542,18 +663,6 @@ register(definition: ToolDefinition): () => void
542
663
  */
543
664
  restrict(filter: ToolRestriction): () => void
544
665
 
545
- /**
546
- * Register a monotonic guard after the extensible `tools/pre-execute`
547
- * waterfall. A plain-context guard applies globally; one registered through
548
- * `agent.ctx` applies only to that agent. Any matching guard may deny by
549
- * returning a reason, while no guard can force-allow a call another guard
550
- * denied. The exact effect disposer is returned for ordered ownership and
551
- * HMR cleanup.
552
- * @param guard - synchronous check; a returned string denies the execution.
553
- * @returns the exact disposer that unregisters the guard.
554
- */
555
- guard(guard: ToolGuard): () => void
556
-
557
666
  /**
558
667
  * Look up a tool as one scope sees it (scoped
559
668
  * shadows global; a restricted-away global reads as absent). Presenters pass
@@ -561,42 +670,76 @@ guard(guard: ToolGuard): () => void
561
670
  * actually executed.
562
671
  * @param name - the tool name as registered.
563
672
  * @param scope - the viewing scope (the agent); omitted = the global view.
673
+ * @param toolSet - step admission; omit only to inspect registered definitions.
564
674
  * @returns the definition the scope resolves, or undefined when none is visible.
565
675
  */
566
- get(name: string, scope?: ScopeKey): ToolDefinition | undefined
676
+ get(name: string, scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolDefinition | undefined
677
+
678
+ /**
679
+ * Resolve the definition a call may execute. With a step's admitted set, the
680
+ * set decides; without one, conditional registrations are unavailable.
681
+ * @param name - the tool name as registered.
682
+ * @param scope - the calling agent; omitted = the global view.
683
+ * @param toolSet - step admission, or omitted for a call outside a model step.
684
+ * @returns the executable definition, or undefined when the call must fail as `UNKNOWN_TOOL`.
685
+ */
686
+ executable(name: string, scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolDefinition | undefined
687
+
688
+ /**
689
+ * Resolve conditions once for this step without changing shared registrations.
690
+ * Cancellation or a rejected condition publishes no partial selection. Removed
691
+ * registrations cannot be restored by a late condition result.
692
+ * @param context - preparing agent, captured model selection, and cancellation.
693
+ * @returns the complete selection; the caller disposes it after its tool batch settles.
694
+ */
695
+ async resolve(context: ToolActivationContext): Promise<ResolvedToolSet>
696
+
697
+ /**
698
+ * Read the visible capability definitions for descriptions and program bindings.
699
+ * @param scope - viewing Agent or preset; omitted selects the global view.
700
+ * @param toolSet - step admission; omit only to inspect registered definitions.
701
+ * @returns definitions after scoped shadowing and restrictions, limited to the step's admission when given.
702
+ */
703
+ definitions(scope?: ScopeKey, toolSet?: ResolvedToolSet): readonly ToolDefinition[]
567
704
 
568
705
  /**
569
706
  * Project visible definitions onto the allowlisted model-facing schema fields,
570
707
  * excluding execution and presentation callbacks.
571
708
  * @param scope - the viewing scope (the agent); omitted = the global view.
709
+ * @param toolSet - step admission, or omitted for registered-definition inspection.
572
710
  * @returns one deep-cloned schema per visible tool.
573
711
  */
574
- schemas(scope?: ScopeKey): ToolSchema[]
712
+ schemas(scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolSchema[]
713
+
714
+ /**
715
+ * Provide the executor for the calling scope; an unscoped contribution is the deployment default.
716
+ * Rendering any executor-owned section requires the viewing scope's selection to remain available.
717
+ * @param executor - initialized provider owned by the contributing plugin.
718
+ * @returns the effect disposer. Unloading leaves the selection unavailable until it is replaced.
719
+ */
720
+ setExecutor(executor: ToolExecutor): () => void
575
721
 
576
722
  /**
577
- * Classify a pending call through the caller's visible tool definition. Only
578
- * an exact `true` is parallel; unknown, hidden, undeclared, invalid, or
579
- * throwing classifiers are exclusive.
580
- * @param exec - call name, parsed arguments, and optional agent scope.
581
- * @returns the fail-closed scheduling mode.
723
+ * Delegate a raw call batch to its Agent's provider or the deployment default.
724
+ * Select at dispatch; accepted batches settle through that provider even if it unloads.
725
+ * @param input - original calls, optional owning Agent, and optional logging step.
726
+ * @returns the selected executor's settled batch; unavailable selections reject.
582
727
  */
583
- executionMode(exec: ToolExecutionInput): ToolExecutionMode
728
+ async execute(input: ToolBatchInput): Promise<ToolBatchResult>
584
729
 
585
730
  /**
586
- * Execute through pre-policy, guards, around-dispatch, post-policy,
587
- * definition-owned content finalization, and final notification. Tool and
588
- * listener failures resolve as materialized error results; an invisible tool
589
- * reports `UNKNOWN_TOOL`. The returned outcome is the same lossless, frozen
590
- * snapshot final observers receive. Cancellation
591
- * arriving after entry and before final result materialization skips a
592
- * not-yet-started body with `ABORTED_BEFORE_DISPATCH` or replaces a
593
- * successful started outcome with `ABORTED`; already-started work is still
594
- * drained and may retain a tool-owned structured error.
595
- * @param exec - the typed same-process call input. The registry assigns its
596
- * correlation token before policy begins.
597
- * @returns the materialized final result.
731
+ * Register a monotonic denial in the calling scope.
732
+ * @param guard - evaluated after extensible pre-execute policy by the shared pipeline.
733
+ * @returns the effect disposer that removes this guard.
598
734
  */
599
- async execute(exec: ToolExecutionInput): Promise<ToolExecutionResult>
735
+ guard(guard: ToolGuard): () => void
736
+
737
+ /**
738
+ * Check global and inherited guards after pre-execute policy and approval resolve.
739
+ * @param exec - invocation whose guards are checked before dispatch.
740
+ * @returns the first denial reason, or undefined when no guard denies.
741
+ */
742
+ checkGuards(exec: ToolExecution): string | undefined
600
743
  ```
601
744
 
602
745
  Types: [ScopeKey](./scope.md)
@@ -611,22 +754,19 @@ Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deep
611
754
 
612
755
  #### `tools/change` — emit
613
756
 
614
- A tool was registered or unregistered, or a scoped restriction changed (the available tool set changed — possibly for one scope only). An UNFILTERED registry-subject notification, deliberately not scope-filtered dispatch: a global change concerns every agent's next assembly, so a scoped listener subscribing here sees every change, not just its own scope's.
757
+ A tool was registered or unregistered, or a scoped restriction changed. Unfiltered registry notification: scoped listeners receive changes from every scope because a global contribution can affect every agent's next assembly.
615
758
 
616
759
  ```ts cordis-catalog
617
760
  /**
618
- * A tool was registered or unregistered, or a scoped restriction changed
619
- * (the available tool set changed — possibly for one scope only). An
620
- * UNFILTERED registry-subject notification, deliberately not scope-filtered
621
- * dispatch: a global change concerns every agent's next assembly, so a
622
- * scoped listener subscribing here sees every change, not just its own
623
- * scope's.
761
+ * A tool was registered or unregistered, or a scoped restriction changed.
762
+ * Unfiltered registry notification: scoped listeners receive changes from every
763
+ * scope because a global contribution can affect every agent's next assembly.
624
764
  * @mode emit
625
765
  */
626
766
  'tools/change'(): void
627
767
  ```
628
768
 
629
- Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/index.ts)
769
+ Source: [`packages/core/tools/src/events.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/events.ts)
630
770
 
631
771
  <a id="toolsexecute--waterfall"></a>
632
772
 
@@ -645,12 +785,12 @@ Around-dispatch waterfall for timeout, retry, or metrics. `next()` returns a nor
645
785
  * @param exec - the allowed call about to dispatch (name, parsed arguments, caller agent, signal).
646
786
  * @mode waterfall
647
787
  */
648
- 'tools/execute'(this: Scoped<ToolRuntime>, exec: ToolDispatchExecution, next: () => Promise<ToolExecutionResult>): Promise<ToolExecutionResult>
788
+ 'tools/execute'(this: Scoped<ToolsService>, exec: ToolDispatchExecution, next: () => Promise<ToolExecutionResult>): Promise<ToolExecutionResult>
649
789
  ```
650
790
 
651
791
  Types: [Scoped](./scope.md)
652
792
 
653
- Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/index.ts)
793
+ Source: [`packages/core/tools/src/events.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/events.ts)
654
794
 
655
795
  <a id="toolspost-execute--waterfall"></a>
656
796
 
@@ -670,12 +810,12 @@ Accept, replace, enrich, or block a normalized dispatch result. `next()` accepts
670
810
  * @param result - the dispatch outcome a listener may accept, replace, or block.
671
811
  * @mode waterfall
672
812
  */
673
- 'tools/post-execute'(this: Scoped<ToolRuntime>, exec: ToolExecution, result: Readonly<ToolExecutionResult>, next: () => Promise<PostToolDecision>): Promise<PostToolDecision>
813
+ 'tools/post-execute'(this: Scoped<ToolsService>, exec: ToolExecution, result: Readonly<ToolExecutionResult>, next: () => Promise<PostToolDecision>): Promise<PostToolDecision>
674
814
  ```
675
815
 
676
816
  Types: [Scoped](./scope.md)
677
817
 
678
- Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/index.ts)
818
+ Source: [`packages/core/tools/src/events.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/events.ts)
679
819
 
680
820
  <a id="toolspre-execute--waterfall"></a>
681
821
 
@@ -694,12 +834,12 @@ Allow, deny, cancel, or ask before dispatch. `next()` delegates to allow; `cance
694
834
  * @param exec - the pending call (name, parsed arguments, caller agent).
695
835
  * @mode waterfall
696
836
  */
697
- 'tools/pre-execute'(this: Scoped<ToolRuntime>, exec: ToolExecution, next: () => Promise<PreToolDecision>): Promise<PreToolDecision>
837
+ 'tools/pre-execute'(this: Scoped<ToolsService>, exec: ToolExecution, next: () => Promise<PreToolDecision>): Promise<PreToolDecision>
698
838
  ```
699
839
 
700
840
  Types: [Scoped](./scope.md)
701
841
 
702
- Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/index.ts)
842
+ Source: [`packages/core/tools/src/events.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/events.ts)
703
843
 
704
844
  <a id="toolsptc-dispatch-log--waterfall"></a>
705
845
 
@@ -721,12 +861,12 @@ Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` su
721
861
  * @param dispatch - the parent execution, sub-call identity, and the settled content to log.
722
862
  * @mode waterfall
723
863
  */
724
- 'tools/ptc-dispatch-log'(this: Scoped<ToolRuntime>, dispatch: PtcDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>
864
+ 'tools/ptc-dispatch-log'(this: Scoped<ToolsService>, dispatch: PtcDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>
725
865
  ```
726
866
 
727
867
  Types: [ContentBlock](./llm-streaming.md) · [Scoped](./scope.md)
728
868
 
729
- Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/index.ts)
869
+ Source: [`packages/core/tool-executor-ptc/src/runtime-types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tool-executor-ptc/src/runtime-types.ts)
730
870
 
731
871
  <a id="toolsresult--emit"></a>
732
872
 
@@ -742,10 +882,10 @@ Observe the frozen, lossless-JSON final outcome. Listener failures are contained
742
882
  * @param result - a deep-frozen snapshot of the final returned result.
743
883
  * @mode emit
744
884
  */
745
- 'tools/result'(this: Scoped<ToolRuntime>, exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): undefined
885
+ 'tools/result'(this: Scoped<ToolsService>, exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): undefined
746
886
  ```
747
887
 
748
888
  Types: [Scoped](./scope.md)
749
889
 
750
- Source: [`packages/core/tools/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/index.ts)
890
+ Source: [`packages/core/tools/src/events.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/src/events.ts)
751
891
  <!-- END GENERATED cordis-surface -->
@@ -290,7 +290,7 @@ interface RemoteInvocation {
290
290
 
291
291
  ## Remote 访问资源
292
292
 
293
- 每个 Remote 方法都受 [`dsh-api-remote-access`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/remote-access/README.zh.md) 的访问控制:只有当该 principal 种类的 policy 在调用访问的每个资源上都绑定了列出该端点 action 的 role 时,非 owner 调用才被放行。拥有某个身份类型的包把其资源种类声明合并进 `TypertResourceMap`;内置的无身份资源 `global` 从不是其中的种类。Gateway 从 `@Remote({ resources })` 或 `@RemoteScope(key, { resources })` 的 `resources` 读取函数读取某个种类的身份,其次是把该种类声明为 `resource` 的 lookup 参数或作用域 Context,再次是在 `typert.resources` 中登记的默认字段;不指向任何资源的调用访问 `global`。决策由 [Peer 身份属性 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-10-12-peer-principal-and-remote-access.zh.md) 负责。
293
+ 每个 Remote 方法都受 [`dsh-api-remote-access`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/remote-access/README.zh.md) 的访问控制:只有当该 principal 种类的 policy 在调用访问的每个资源上都绑定了列出该端点 action 的 role 时,非 owner 调用才被放行。拥有某个身份类型的包把其资源种类声明合并进 `TypertResourceMap`;内置的无身份资源 `global` 从不是其中的种类。Gateway 从 `@Remote({ resources })` 或 `@RemoteScope(key, { resources })` 的 `resources` 读取函数读取某个种类的身份,其次是把该种类声明为 `resource` 的 lookup 参数或作用域 Context,再次是在 `typert.resources` 中登记的默认字段或 resolver;不指向任何资源的调用访问 `global`。决策由 [Peer 身份属性 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-10-12-peer-principal-and-remote-access.zh.md) 负责。
294
294
 
295
295
  ```ts type-equiv
296
296
  /**
@@ -338,11 +338,14 @@ interface RemoteScopeOptions<WireArgs extends readonly unknown[] = never> {
338
338
  * throw, an empty list, or an identity other than a non-empty string
339
339
  * refuses the call. For a kind without a reader, the Gateway reads the
340
340
  * identity of a scoped Context whose Host adapter declares that `resource`
341
- * and of lookup parameters declaring it, else the field registered in
342
- * `typert.resources`: a top-level argument or, failing that, the first
343
- * object argument. A call that carries no identity touches `global`. The
344
- * readers and these defaults together must name every resource the method
345
- * accesses: access control never checks a resource they omit.
341
+ * and of lookup parameters declaring it, else the registered default of
342
+ * `typert.resources`: a `resolve` function receiving the validated named
343
+ * wire values and their ordered parameters, or a `field` naming a top-level
344
+ * argument or, failing that, a field of the first object argument. A
345
+ * throwing resolver, an array result, or a field holding an array refuses
346
+ * the call. A call that carries no identity touches `global`. The readers
347
+ * and these defaults together must name every resource the method accesses:
348
+ * access control never checks a resource they omit.
346
349
  */
347
350
  readonly resources?: TypertResourceReaders<WireArgs>
348
351
  }
@@ -362,7 +365,7 @@ interface RemoteMethodOptions<WireArgs extends readonly unknown[] = never> exten
362
365
 
363
366
  ## Typert 注册表
364
367
 
365
- `ctx.typert` 分开保存当前环境的 descriptor、显式选择的 Remote contribution、lookup 提供方、作用域上下文提供方与资源种类的默认字段。lookup 提供方拥有稳定 wire 声明和默认 resolver;Host 组合可以为同一个 key 配置 effect-scoped 同步或异步 resolver,配置卸载后恢复默认策略。各项注册都是由 Cordis 持有的 effect,并返回可等待的 disposer。
368
+ `ctx.typert` 分开保存当前环境的 descriptor、显式选择的 Remote contribution、lookup 提供方、作用域上下文提供方与资源种类的默认字段或 resolver。lookup 提供方拥有稳定 wire 声明和默认 resolver;Host 组合可以为同一个 key 配置 effect-scoped 同步或异步 resolver,配置卸载后恢复默认策略。各项注册都是由 Cordis 持有的 effect,并返回可等待的 disposer。
366
369
 
367
370
  ```ts type-equiv
368
371
  /** Minimal Typert runtime consumed through dependency inversion. */
@@ -445,6 +448,8 @@ interface TypertGateway {
445
448
  * @returns whether an owner stream is open and has not been cancelled.
446
449
  */
447
450
  hasLiveClient(): boolean
451
+ /** @returns detached metadata for all unsettled forwarded events in arrival order. */
452
+ getPendingRemoteEvents(): readonly PendingRemoteEventInfo[]
448
453
  /**
449
454
  * Register the application-selected forwarded-event source.
450
455
  * @param source - stream factory installed by the Remote assembly.
@@ -565,10 +570,9 @@ decide(request: RemoteAccessRequest<Principal>): RemoteAccessDecision
565
570
  allows(resource: RemoteAccessResource): boolean
566
571
 
567
572
  /**
568
- * The baseline a page opens with before its snapshot stream connects. A
569
- * business package rendering a non-owner page assigns this value to
570
- * {@link REMOTE_ACCESS_SNAPSHOT_KEY} after every index injection row,
571
- * replacing the owner baseline the webServer index carries.
573
+ * The baseline a page opens with before its snapshot stream connects; every
574
+ * index the webServer renders carries it under
575
+ * {@link REMOTE_ACCESS_SNAPSHOT_KEY} for the Peer the page speaks for.
572
576
  * @param principal - the page's caller identity.
573
577
  * @returns the owner baseline for the owner; otherwise the principal's current grants.
574
578
  */
@@ -666,6 +670,12 @@ Resolve strict generated definitions or conservative SRC markers against current
666
670
  */
667
671
  hasLiveClient(): boolean
668
672
 
673
+ /**
674
+ * Inspect unsettled forwarded events without changing their lifetime.
675
+ * @returns detached event names and Agent identities.
676
+ */
677
+ getPendingRemoteEvents(): readonly PendingRemoteEventInfo[]
678
+
669
679
  /**
670
680
  * Register the sole application-selected forwarded-event source.
671
681
  * @param source - stream factory installed by the Remote assembly.
@@ -26,7 +26,7 @@ interface AskUserQuestionOption {
26
26
 
27
27
  ## 呈现意图
28
28
 
29
- `AskUserQuestionIntent` 可选地声明一种已知的决策类型。它以 `kind` 作为标记,以便后续加入更多意图;不认识某个标记的 UI 会渲染通用选项列表。意图只改变呈现——遵循它的 UI 回答的选项标签与通用 UI 相同,因此调用方读到的答案字段一致。`approve` 指明表示同意的选项,而不依赖选项顺序。`ask()` 拒绝两种类型无法表达的断言:`approve` 未命名该问题自己的任何选项,以及没有 `detail` 的问题声明了意图。
29
+ `AskUserQuestionIntent` 改变呈现方式,保留选项标签和调用方的决策规则。`plan-review` 指定批准选项,并要求提供计划正文。`approval` 要求只有一个阻塞式问题,带有说明以及互不相同的拒绝、允许和可选的始终允许标签,完整对应已提供的选项,不支持多选或计时等待。CUA 前端通过现有 composer 呈现自己的固定审批;普通问答和计划审阅继续使用原有呈现。
30
30
 
31
31
  ```ts type-equiv
32
32
  /**
@@ -47,6 +47,23 @@ type AskUserQuestionIntent = {
47
47
  approve: string
48
48
  /** Logged tool invocation whose arguments contain the reviewed plan. */
49
49
  callId?: ToolCallId
50
+ } | {
51
+ /** A blocking permission decision with fixed actions and no free-text answer. */
52
+ kind: 'approval'
53
+ /** Option label granting the scope described by the caller. */
54
+ approve: string
55
+ /** Option label refusing the requested access. */
56
+ reject: string
57
+ /** Optional persistent grant offered only when the caller supports it. */
58
+ always?: string
59
+ /** Metadata for human recognition; the caller admits icon sources, which the UI may load as URLs. Never an authorization identity. */
60
+ subject?: { name: string; icon?: string }
61
+ /** Localized question and limited-grant label; fixed cards own reject/always wording. Option labels remain answer values. */
62
+ display?: {
63
+ question: { en: string; [locale: string]: string }
64
+ detail?: { en: string; [locale: string]: string }
65
+ approve?: { en: string; [locale: string]: string }
66
+ }
50
67
  }
51
68
  ```
52
69
 
@@ -265,17 +282,16 @@ async askTimed( request: AskUserQuestionRequest & { agent: Agent }, callId: Tool
265
282
  * Ask the scoped answerer waterfall and wait for the user's answer.
266
283
  *
267
284
  * When a caller supplies an agent, human interaction is valid only for the
268
- * exact live runtime root. Runtime ownership, not durable session lineage,
269
- * decides this boundary: an owned child has no human answerer and would
270
- * block forever, while a lineage-bearing session resumed as a new runtime
271
- * root may ask normally.
285
+ * exact live instance of an ordinary Session. Explicit subagent origin
286
+ * rejects delegated callers; historical ordinary forks may retain parent
287
+ * metadata and still ask normally.
272
288
  *
273
289
  * @param request Questions, owner agent, and abort signal.
274
290
  * @returns The answer chosen or typed by the human.
275
291
  * @throws {UserQuestionError} code `ASK_ABORTED` when the supplied signal
276
292
  * is already or becomes aborted, `CALLER_NOT_LIVE` when a supplied agent
277
293
  * is not the registry's exact live instance, or `DELEGATED_CALLER` when
278
- * that live agent is owned by another agent.
294
+ * that live agent has subagent origin.
279
295
  */
280
296
  async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
281
297
  ```
@@ -27,7 +27,7 @@ Web Client 是由独立加载插件组装而成的浏览器侧 Cordis 应用。
27
27
 
28
28
  Host 把组合后的 `WebBootGraph` 写入 `window.__DSH_BOOT__`,并在 parser-preloaded script 执行前安装浏览器 module-loader facade。模块系统是一张 lazy CommonJS 表:加载 bundle 只注册 factory;materialize entry 时才以同步 `require` 运行 factory,并解析 platform module 和已声明的动态依赖。
29
29
 
30
- Web boot kernel 创建模块系统、预取 `immediately` entry、挂载 vendored Cordis Loader,再创建图中的每个 entry。Cordis service injection 决定激活顺序;module graph 顺序只决定同步 import 能否被 materialize。完整 roster 到达 settled 状态后,`ui-renderer` hydrate 不依赖框架的 boot DOM,并调用唯一一次 context 级 `renderSlot('root')`。[Client Modules](./client-modules.md)负责 graph、bundle route、cache revision 与 loader 细节。
30
+ Web boot kernel 创建模块系统、预取 `immediately` entry、挂载 vendored Cordis Loader,再创建图中的每个 entry。Cordis service injection 决定激活顺序;module graph 顺序只决定同步 import 能否被 materialize。完整 roster 到达 settled 状态且启动审计通过后(浏览器必需名单中的 entry 未激活会拒绝启动;其他未激活 entry 输出一条控制台警告),`ui-renderer` hydrate 不依赖框架的 boot DOM,并调用唯一一次 context 级 `renderSlot('root')`。[Client Modules](./client-modules.md)负责 graph、bundle route、cache revision 与 loader 细节。
31
31
 
32
32
  ## Remote 通信
33
33