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
@@ -1,224 +0,0 @@
1
- # Session References
2
-
3
- English | [中文](session-reference.zh.md)
4
-
5
- Host-backed file discovery plus structured cross-session reference requests and prepared message contexts. The [file-reference contract](../../packages/context/file-reference) owns path-only completion records and grammar; the [session-reference contract](../../packages/context/session-reference) defines canonical URIs, current-surface projection, tag-safe JSON and byte retention, stable errors, and the untrusted model prompt. Host adapters use these types instead of passing their UI mention syntax into the agent core.
6
-
7
- Sources: [`packages/context/file-reference/src/types.ts`](../../packages/context/file-reference/src/types.ts) · [`packages/context/session-reference/src/types.ts`](../../packages/context/session-reference/src/types.ts)
8
-
9
- ## File candidates
10
-
11
- `FileReferenceCandidate` is the path-only discovery result. The addressed agent supplies the working-directory scope; providers decide ranking and namespace access without reading file contents.
12
-
13
- ```ts type-equiv
14
- /** One path-only completion candidate inside the target session cwd. */
15
- interface FileReferenceCandidate {
16
- /** User-facing path accepted by normal prompts and filesystem tools. */
17
- path: string
18
- /** Directories keep completion open; files finish the mention. */
19
- kind: 'file' | 'directory'
20
- }
21
- ```
22
-
23
- ## Inputs and candidates
24
-
25
- `SessionReferenceInput` is the host-independent selection. The id is authoritative; the label is display metadata carried into the snapshot.
26
-
27
- ```ts type-equiv
28
- /** One source session selected by a host. */
29
- interface SessionReferenceInput {
30
- /** Opaque source session identity. */
31
- sessionId: SessionId
32
- /** Optional user-facing mention label. */
33
- label?: string
34
- }
35
- ```
36
-
37
- `SessionReferenceCandidate` is host-facing discovery output. Its `label` uses the latest Session title when present, while its optional display text prefers a subagent's durable creation label; filtering searches both alongside Session id and cwd, never transcript text. The Remote candidate's canonical mention uses the display text when present.
38
-
39
- ```ts type-equiv
40
- /** One host-facing candidate from exact session metadata. */
41
- interface SessionReferenceCandidate {
42
- /** Opaque source session identity. */
43
- sessionId: SessionId
44
- /** Latest log-backed title, falling back to the opaque session id. */
45
- label: string
46
- /** Display and canonical-mention text, preferring a subagent's durable creation label over {@link label}. */
47
- displayTitle?: string
48
- /** Source session working directory, when recorded. */
49
- cwd?: string
50
- /**
51
- * True when {@link SessionReferenceCandidate.cwd} is recorded and equals the
52
- * requesting agent's. Hosts that only surface a distinguishing location
53
- * read this instead of comparing paths they never received.
54
- */
55
- sameWorkspace: boolean
56
- /** Source session creation time in Unix epoch milliseconds. */
57
- createdAt: number
58
- }
59
- ```
60
-
61
- The `sessionReferenceResolver/candidates` Remote method serves the same discovery to browser consumers and attaches each candidate's canonical prompt mention.
62
-
63
- ```ts type-equiv
64
- /** One discovery candidate carrying its canonical prompt mention. */
65
- interface SessionReferenceMentionCandidate extends SessionReferenceCandidate {
66
- /** Canonical `@[label](dsh-session:…)` mention serialized into the prompt draft. */
67
- mention: string
68
- }
69
- ```
70
-
71
- ## Prepared messages
72
-
73
- Preparation preserves readable current-message content and returns at most one aggregated context. Its durable source records keep `capturedThroughSeq` as a coordinate in the referenced Session's original generation; they never reinterpret it as a seq in the containing Session. `capturedFormatVersion` records that generation, with absence meaning released format v0.
74
-
75
- ```ts type-equiv
76
- /** Durable source session, cited event seqs, and snapshot facts for prepared cross-session context. */
77
- interface SessionReferenceSource {
78
- kind: 'session-reference'
79
- /** Material lifted out of another session's log (`recall` context form). */
80
- form: 'recall'
81
- version: 1
82
- references: {
83
- sessionId: string
84
- label: string
85
- /** Source Session format generation; absence identifies version 0. */
86
- capturedFormatVersion?: number
87
- capturedThroughSeq: OptionalSessionSeq
88
- compacted: boolean
89
- originalMessages: number
90
- retainedMessages: number
91
- omittedMessages: number
92
- omittedBytes: number
93
- truncated: boolean
94
- inputIndex: number
95
- }[]
96
- }
97
- ```
98
-
99
- ```ts type-equiv
100
- /** Direct message content and optional referenced-session context. */
101
- interface PreparedReferencedMessage {
102
- /** Readable message content after host mention tokens are removed. */
103
- content: ContentBlock[]
104
- /** Aggregated untrusted snapshot, absent when the message has no references. */
105
- additionalContext?: UserMessage
106
- }
107
- ```
108
-
109
- ## Errors
110
-
111
- `SessionReferenceError.code` separates invalid configuration or input, self-reference, count limits, source-read failure, budget failure, and cancellation. Host protocols map these codes to their own error envelopes without inspecting prompt bytes.
112
-
113
- ```ts type-equiv
114
- /** Stable failure codes exposed to host adapters. */
115
- type SessionReferenceErrorCode =
116
- | 'SESSION_REFERENCE_INVALID_CONFIG'
117
- | 'SESSION_REFERENCE_INVALID_REFERENCE'
118
- | 'SESSION_REFERENCE_SELF_REFERENCE'
119
- | 'SESSION_REFERENCE_TOO_MANY'
120
- | 'SESSION_REFERENCE_READ_FAILED'
121
- | 'SESSION_REFERENCE_BUDGET_EXCEEDED'
122
- | 'SESSION_REFERENCE_CANCELLED'
123
- ```
124
-
125
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
126
-
127
- <a id="cordis-surface"></a>
128
-
129
- ## Cordis API
130
-
131
- 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).
132
-
133
- <a id="ctxfilereferences--filereferenceservice-abstract-seam"></a>
134
-
135
- ### `ctx.fileReferences` — `FileReferenceService` (abstract seam)
136
-
137
- Host capability for cancellable file-reference discovery.
138
-
139
- ```ts cordis-catalog
140
- /**
141
- * List file and directory candidates for one agent's working directory.
142
- * @param agent - target agent whose session cwd bounds discovery.
143
- * @param query - path text following `@` or `@"`.
144
- * @param signal - caller cancellation.
145
- * @returns deterministic path-only candidates.
146
- */
147
- abstract list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
148
- ```
149
-
150
- Types: [Agent](core.md)
151
-
152
- Source: [`packages/context/file-reference/src/index.ts`](../../packages/context/file-reference/src/index.ts)
153
-
154
- <a id="ctxsessionfilereferences--sessionfilereferences"></a>
155
-
156
- ### `ctx.sessionFileReferences` — `SessionFileReferences`
157
-
158
- Host Remote adapter over the composed file-reference provider.
159
-
160
- ```ts cordis-catalog
161
- /**
162
- * List file and directory candidates for one Agent's working directory.
163
- * @param agent - target Agent resolved from the Session identity on the wire.
164
- * @param query - path text following `@` or `@"`.
165
- * @param signal - caller cancellation.
166
- * @returns deterministic path-only candidates from the composed provider.
167
- */
168
- @Remote list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
169
- ```
170
-
171
- Types: [Agent](core.md)
172
-
173
- Source: [`packages/api/session-controller/src/file-references.ts`](../../packages/api/session-controller/src/file-references.ts)
174
-
175
- <a id="ctxsessionreferenceresolver--sessionreferenceresolver"></a>
176
-
177
- ### `ctx.sessionReferenceResolver` — `SessionReferenceResolver`
178
-
179
- Exact-read consumer that prepares immutable cross-session message context.
180
-
181
- ```ts cordis-catalog
182
- /**
183
- * List reference candidates, ranked by working-directory affinity.
184
- *
185
- * Discovery runs at keystroke rate, so titles and subagent labels only ever
186
- * come from projection reads; sessions without either fall back to their id.
187
- * @param agent - target agent; self is excluded and its cwd drives ranking.
188
- * @param query - optional case-insensitive session-id/cwd/title/display-title substring.
189
- * @param limit - optional positive result cap.
190
- * @param signal - optional cancellation boundary for host autocomplete teardown.
191
- * @returns candidates with canonical mention labels and presentation titles.
192
- */
193
- async listCandidates( agent: Agent, query: string = '', limit: number = this.config.candidateLimit, signal?: AbortSignal, ): Promise<SessionReferenceCandidate[]>
194
-
195
- /**
196
- * Remote face of {@link listCandidates}: the configured candidate limit
197
- * applies, and every candidate carries the canonical mention a host inserts
198
- * into the prompt draft.
199
- * @param agent - target agent; self is excluded and its cwd drives ranking.
200
- * @param query - optional case-insensitive session-id/cwd/title substring.
201
- * @param signal - caller cancellation.
202
- * @returns mention-carrying candidates in rank order.
203
- */
204
- @Remote('candidates') async remoteExportCandidates( agent: Agent, query: string, signal: AbortSignal, ): Promise<SessionReferenceMentionCandidate[]>
205
-
206
- /**
207
- * Snapshot all references for one accepted direct message and return one aggregated durable context.
208
- * Automatic budgets use the last assembled route, or agent options before any assembly.
209
- * Missing model capacity or adapter uses 64 KiB; other metadata lookup failures and cancellation reject preparation.
210
- * Truncated previews include omission facts and a full-snapshot spill locator, or an explicit unavailable notice.
211
- * Cancellation prevents context publication, including when storage completes after cancellation.
212
- * @param agent - target agent; references to it are rejected.
213
- * @param content - already host-normalized readable message content.
214
- * @param references - structured source sessions in mention order.
215
- * @param signal - optional cancellation boundary for the active turn.
216
- * @returns detached content and optional referenced-session context.
217
- */
218
- async prepare( agent: Agent, content: ContentBlock[], references: SessionReferenceInput[], signal?: AbortSignal, ): Promise<PreparedReferencedMessage>
219
- ```
220
-
221
- Types: [Agent](core.md) · [ContentBlock](llm-streaming.md)
222
-
223
- Source: [`packages/context/session-reference/src/index.ts`](../../packages/context/session-reference/src/index.ts)
224
- <!-- END GENERATED cordis-surface -->
@@ -1,224 +0,0 @@
1
- # 会话引用
2
-
3
- [English](session-reference.md) | 中文
4
-
5
- 由 Host 支撑的文件发现,以及结构化的跨会话引用请求与准备后的消息上下文。[文件引用约定](../../packages/context/file-reference)负责仅含路径的补全记录与语法;[会话引用约定](../../packages/context/session-reference)定义规范 URI、当前表层投影、标签安全的 JSON 与字节保留、稳定错误和不可信的模型提示词。宿主适配器使用这些类型,而不会把各自 UI 的提及语法传入 agent(智能体)核心。
6
-
7
- 来源:[`packages/context/file-reference/src/types.ts`](../../packages/context/file-reference/src/types.ts) · [`packages/context/session-reference/src/types.ts`](../../packages/context/session-reference/src/types.ts)
8
-
9
- ## 文件候选项
10
-
11
- `FileReferenceCandidate` 是仅含路径的发现结果。被寻址的 agent 提供工作目录范围;提供方负责排序和命名空间访问,但不会读取文件内容。
12
-
13
- ```ts type-equiv
14
- /** One path-only completion candidate inside the target session cwd. */
15
- interface FileReferenceCandidate {
16
- /** User-facing path accepted by normal prompts and filesystem tools. */
17
- path: string
18
- /** Directories keep completion open; files finish the mention. */
19
- kind: 'file' | 'directory'
20
- }
21
- ```
22
-
23
- ## 输入与候选项
24
-
25
- `SessionReferenceInput` 是与宿主无关的选择。id 具有权威性;label 是随快照携带的显示元数据。
26
-
27
- ```ts type-equiv
28
- /** One source session selected by a host. */
29
- interface SessionReferenceInput {
30
- /** Opaque source session identity. */
31
- sessionId: SessionId
32
- /** Optional user-facing mention label. */
33
- label?: string
34
- }
35
- ```
36
-
37
- `SessionReferenceCandidate` 是面向宿主的发现输出。存在最新 Session 标题时,它的 `label` 使用该标题;可选显示文本则优先使用 subagent 的持久创建 label。筛选会同时搜索两者、Session id 与 cwd,绝不搜索 transcript(文本记录)。Remote 候选在 `displayTitle` 存在时用它标记规范 mention。
38
-
39
- ```ts type-equiv
40
- /** One host-facing candidate from exact session metadata. */
41
- interface SessionReferenceCandidate {
42
- /** Opaque source session identity. */
43
- sessionId: SessionId
44
- /** Latest log-backed title, falling back to the opaque session id. */
45
- label: string
46
- /** Display and canonical-mention text, preferring a subagent's durable creation label over {@link label}. */
47
- displayTitle?: string
48
- /** Source session working directory, when recorded. */
49
- cwd?: string
50
- /**
51
- * True when {@link SessionReferenceCandidate.cwd} is recorded and equals the
52
- * requesting agent's. Hosts that only surface a distinguishing location
53
- * read this instead of comparing paths they never received.
54
- */
55
- sameWorkspace: boolean
56
- /** Source session creation time in Unix epoch milliseconds. */
57
- createdAt: number
58
- }
59
- ```
60
-
61
- `sessionReferenceResolver/candidates` Remote 方法向浏览器消费方提供同一发现能力,并为每个候选附上规范提示词 mention。
62
-
63
- ```ts type-equiv
64
- /** One discovery candidate carrying its canonical prompt mention. */
65
- interface SessionReferenceMentionCandidate extends SessionReferenceCandidate {
66
- /** Canonical `@[label](dsh-session:…)` mention serialized into the prompt draft. */
67
- mention: string
68
- }
69
- ```
70
-
71
- ## 准备后的消息
72
-
73
- 准备过程保留可读的当前消息内容,并最多返回一个聚合上下文。其持久 source 记录会把 `capturedThroughSeq` 保留为被引用 Session 原始 generation 中的坐标,绝不会把它重新解释为所在 Session 的 seq。`capturedFormatVersion` 记录该 generation;缺失表示已发布格式 v0。
74
-
75
- ```ts type-equiv
76
- /** Durable source session, cited event seqs, and snapshot facts for prepared cross-session context. */
77
- interface SessionReferenceSource {
78
- kind: 'session-reference'
79
- /** Material lifted out of another session's log (`recall` context form). */
80
- form: 'recall'
81
- version: 1
82
- references: {
83
- sessionId: string
84
- label: string
85
- /** Source Session format generation; absence identifies version 0. */
86
- capturedFormatVersion?: number
87
- capturedThroughSeq: OptionalSessionSeq
88
- compacted: boolean
89
- originalMessages: number
90
- retainedMessages: number
91
- omittedMessages: number
92
- omittedBytes: number
93
- truncated: boolean
94
- inputIndex: number
95
- }[]
96
- }
97
- ```
98
-
99
- ```ts type-equiv
100
- /** Direct message content and optional referenced-session context. */
101
- interface PreparedReferencedMessage {
102
- /** Readable message content after host mention tokens are removed. */
103
- content: ContentBlock[]
104
- /** Aggregated untrusted snapshot, absent when the message has no references. */
105
- additionalContext?: UserMessage
106
- }
107
- ```
108
-
109
- ## 错误
110
-
111
- `SessionReferenceError.code` 区分无效配置或输入、自引用、数量限制、源读取失败、预算失败和取消。宿主协议会把这些 code 映射到各自的错误封装,无需检查提示词字节。
112
-
113
- ```ts type-equiv
114
- /** Stable failure codes exposed to host adapters. */
115
- type SessionReferenceErrorCode =
116
- | 'SESSION_REFERENCE_INVALID_CONFIG'
117
- | 'SESSION_REFERENCE_INVALID_REFERENCE'
118
- | 'SESSION_REFERENCE_SELF_REFERENCE'
119
- | 'SESSION_REFERENCE_TOO_MANY'
120
- | 'SESSION_REFERENCE_READ_FAILED'
121
- | 'SESSION_REFERENCE_BUDGET_EXCEEDED'
122
- | 'SESSION_REFERENCE_CANCELLED'
123
- ```
124
-
125
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
126
-
127
- <a id="cordis-surface"></a>
128
-
129
- ## Cordis API
130
-
131
- 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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
132
-
133
- <a id="ctxfilereferences--filereferenceservice-abstract-seam"></a>
134
-
135
- ### `ctx.fileReferences` — `FileReferenceService` (abstract seam)
136
-
137
- Host capability for cancellable file-reference discovery.
138
-
139
- ```ts cordis-catalog
140
- /**
141
- * List file and directory candidates for one agent's working directory.
142
- * @param agent - target agent whose session cwd bounds discovery.
143
- * @param query - path text following `@` or `@"`.
144
- * @param signal - caller cancellation.
145
- * @returns deterministic path-only candidates.
146
- */
147
- abstract list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
148
- ```
149
-
150
- Types: [Agent](core.zh.md)
151
-
152
- Source: [`packages/context/file-reference/src/index.ts`](../../packages/context/file-reference/src/index.ts)
153
-
154
- <a id="ctxsessionfilereferences--sessionfilereferences"></a>
155
-
156
- ### `ctx.sessionFileReferences` — `SessionFileReferences`
157
-
158
- Host Remote adapter over the composed file-reference provider.
159
-
160
- ```ts cordis-catalog
161
- /**
162
- * List file and directory candidates for one Agent's working directory.
163
- * @param agent - target Agent resolved from the Session identity on the wire.
164
- * @param query - path text following `@` or `@"`.
165
- * @param signal - caller cancellation.
166
- * @returns deterministic path-only candidates from the composed provider.
167
- */
168
- @Remote list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
169
- ```
170
-
171
- Types: [Agent](core.zh.md)
172
-
173
- Source: [`packages/api/session-controller/src/file-references.ts`](../../packages/api/session-controller/src/file-references.ts)
174
-
175
- <a id="ctxsessionreferenceresolver--sessionreferenceresolver"></a>
176
-
177
- ### `ctx.sessionReferenceResolver` — `SessionReferenceResolver`
178
-
179
- Exact-read consumer that prepares immutable cross-session message context.
180
-
181
- ```ts cordis-catalog
182
- /**
183
- * List reference candidates, ranked by working-directory affinity.
184
- *
185
- * Discovery runs at keystroke rate, so titles and subagent labels only ever
186
- * come from projection reads; sessions without either fall back to their id.
187
- * @param agent - target agent; self is excluded and its cwd drives ranking.
188
- * @param query - optional case-insensitive session-id/cwd/title/display-title substring.
189
- * @param limit - optional positive result cap.
190
- * @param signal - optional cancellation boundary for host autocomplete teardown.
191
- * @returns candidates with canonical mention labels and presentation titles.
192
- */
193
- async listCandidates( agent: Agent, query: string = '', limit: number = this.config.candidateLimit, signal?: AbortSignal, ): Promise<SessionReferenceCandidate[]>
194
-
195
- /**
196
- * Remote face of {@link listCandidates}: the configured candidate limit
197
- * applies, and every candidate carries the canonical mention a host inserts
198
- * into the prompt draft.
199
- * @param agent - target agent; self is excluded and its cwd drives ranking.
200
- * @param query - optional case-insensitive session-id/cwd/title substring.
201
- * @param signal - caller cancellation.
202
- * @returns mention-carrying candidates in rank order.
203
- */
204
- @Remote('candidates') async remoteExportCandidates( agent: Agent, query: string, signal: AbortSignal, ): Promise<SessionReferenceMentionCandidate[]>
205
-
206
- /**
207
- * Snapshot all references for one accepted direct message and return one aggregated durable context.
208
- * Automatic budgets use the last assembled route, or agent options before any assembly.
209
- * Missing model capacity or adapter uses 64 KiB; other metadata lookup failures and cancellation reject preparation.
210
- * Truncated previews include omission facts and a full-snapshot spill locator, or an explicit unavailable notice.
211
- * Cancellation prevents context publication, including when storage completes after cancellation.
212
- * @param agent - target agent; references to it are rejected.
213
- * @param content - already host-normalized readable message content.
214
- * @param references - structured source sessions in mention order.
215
- * @param signal - optional cancellation boundary for the active turn.
216
- * @returns detached content and optional referenced-session context.
217
- */
218
- async prepare( agent: Agent, content: ContentBlock[], references: SessionReferenceInput[], signal?: AbortSignal, ): Promise<PreparedReferencedMessage>
219
- ```
220
-
221
- Types: [Agent](core.zh.md) · [ContentBlock](llm-streaming.zh.md)
222
-
223
- Source: [`packages/context/session-reference/src/index.ts`](../../packages/context/session-reference/src/index.ts)
224
- <!-- END GENERATED cordis-surface -->
@@ -1,212 +0,0 @@
1
- # SessionTelemetryBackend
2
-
3
- English | [中文](session-telemetry.zh.md)
4
-
5
- The [capture service](../../packages/session/session-telemetry/README.md) owns canonical-event capture, redaction, and handoff cursors. The [feedback backend](../../packages/session/session-telemetry-otel/README.md) authorizes Session prefixes and owns their independent queue, per-request scheduling, and 4,000,000-byte ceiling. No reporting data reaches model requests.
6
-
7
- Source: [`packages/session/session-telemetry/src/index.ts`](../../packages/session/session-telemetry/src/index.ts)
8
-
9
- ## The logical record
10
-
11
- ```ts type-equiv
12
- /**
13
- * Severity of a telemetry record, pre-mapped at capture so a receiver can
14
- * alert with zero configuration: `error` for events whose own outcome flag
15
- * says so (the tool message's `isError`, `turn/end` error reasons) and for
16
- * `agent-error` operational records. Captured events otherwise default to
17
- * `info`; `warn` remains available to `session-telemetry/record` policies and
18
- * backends.
19
- */
20
- type SessionTelemetrySeverity = 'info' | 'warn' | 'error'
21
- ```
22
-
23
- ```ts type-equiv
24
- /**
25
- * One logical record handed to a backend — the capture contract's whole outbound
26
- * vocabulary. Ledger records mirror session-log events one-to-one;
27
- * operational records (`channel: 'ops'`) carry the two signals with no log
28
- * home (`agent-error`, `shutdown`) and deliberately omit `event.seq`-style
29
- * identity so they can never be mistaken for ledger rows.
30
- */
31
- interface SessionTelemetryRecord {
32
- /** Canonical envelope without data; body carries the separately redacted payload. Absent for operational records. */
33
- sourceEvent?: { sessionId: SessionId; envelope: Omit<SessionEvent, 'data'> }
34
- /** Ledger (session-log mirror) or ops (operational signal) channel; backends keep the two under separate instrumentation scopes. */
35
- channel: 'ledger' | 'ops'
36
- /** Unix epoch milliseconds — the source event's append time for ledger records, the emission time for ops records. */
37
- time: number
38
- /** Pre-mapped alerting severity; see {@link SessionTelemetrySeverity}. */
39
- severity: SessionTelemetrySeverity
40
- /**
41
- * Identity attributes, deliberately minimal: ledger records carry
42
- * `session.id`, `session.format_version`, `event.type`, `event.seq`, plus optional
43
- * `session.cwd` / `session.parent_id`; a seeded Session also carries
44
- * `session.seed_length` from its exact inherited event count;
45
- * ops records carry `telemetry.op`, `session.id`, and (for `agent-error`)
46
- * `agent.id`, `turn`, `step`, `error.name`. Anything recoverable from the
47
- * body is intentionally NOT duplicated here.
48
- */
49
- attributes: Record<string, string | number>
50
- /**
51
- * The complete payload: a deep copy of the session event's `data` for
52
- * ledger records (JSON-serializable by `Session.append`'s own
53
- * validation), or the op payload for ops records. Never mutated after
54
- * handoff.
55
- */
56
- body: unknown
57
- }
58
- ```
59
-
60
- Every canonical [session event](session.md), including each `assistant/message` or `assistant/attempt` with its complete compact stream and every plugin-merged type the seam never heard of, passes through whole as one ordered ledger record. Process-local `agent/assistant-stream` frames do not enter this durable feed. A new fork starts at its child-owned suffix, including the inherited marker and fork closers; restored Sessions start after their stored prefix, including restored forks. The backend can select `includeHistory` to include the complete prefix; re-adopting the same object resumes after its handoff cursor. Delivery is best-effort: the cursor marks handed-off, not delivered, and records can be lost (crash, reload window) or duplicated (new-object replay, SDK retries), so receivers dedupe ledger records on `(session.id, session.format_version, event.seq)`; ops records deliberately omit that identity — they are signals to alert on, not entries to sum, and tolerate duplicates instead.
61
-
62
- ## The sharing disclosure
63
-
64
- Every backend exposes its deployment-selected mode through the required abstract `sharing` member on `ctx.sessionTelemetry` ([Service Definition README](../../packages/session/session-telemetry/README.md#the-sharing-disclosure)). This is neither a per-Session admission decision nor a delivery receipt. The `/feedback` acknowledgement does not consult it.
65
-
66
- ```ts type-equiv
67
- /**
68
- * Deployment-selected session-sharing mode, not confirmation of SDK delivery.
69
- */
70
- type SessionTelemetrySharingStatus = 'full' | 'feedback-only' | 'disabled'
71
- ```
72
-
73
- ## Capture policy
74
-
75
- ```ts type-equiv
76
- /** Whether capture follows live events or reads the canonical log only when requested. */
77
- type SessionTelemetryCapture = 'live' | 'on-demand'
78
- ```
79
-
80
- ```ts type-equiv
81
- /** Backend-selected capture mode and history policy. */
82
- interface SessionTelemetryCaptureOptions {
83
- /** Follow live events, or wait for explicit capture; defaults to live. */
84
- capture?: SessionTelemetryCapture
85
- /** Include inherited fork history and stored history from earlier lifecycles; defaults to false. */
86
- includeHistory?: boolean
87
- }
88
- ```
89
-
90
- `includeHistory` permits stored and inherited records but does not itself authorize capture. The [OTel backend](../../packages/session/session-telemetry-otel/README.md) uses on-demand capture and requires new own explicit feedback; it releases only the complete prefix through that feedback, for every provider.
91
-
92
- ## The backend contract
93
-
94
- ```ts type-equiv
95
- /**
96
- * The minimum backend contract the coordinator requires. {@link SessionTelemetryBackend} is
97
- * its service-registered form; tests compose the coordinator with a bare
98
- * implementation of this interface.
99
- */
100
- interface SessionTelemetrySink {
101
- /**
102
- * Hand one record to the backend's pipeline. MUST be a non-blocking
103
- * enqueue — the coordinator calls this synchronously from the
104
- * `session/event` hot path or an explicit canonical-log capture, so anything
105
- * slower than a queue push would tax the agent loop or feedback handling.
106
- * Errors thrown here are contained by the coordinator and logged; they
107
- * never reach the loop.
108
- * @param record - the logical record to report; owned by the backend after the call.
109
- */
110
- emit(record: SessionTelemetryRecord): void
111
- /**
112
- * Optional hint that a turn ended. A backend may forward it to its SDK's
113
- * flush so records are exported after each turn. Called
114
- * fire-and-forget; implementations must not block and must not throw
115
- * meaningfully (the coordinator contains exceptions). Most backends should
116
- * leave this unimplemented and let their SDK's own batching cadence govern
117
- * export timing: a backend that does implement it owns the interaction
118
- * between its concurrent flushes and {@link shutdown}'s drain (the OTel
119
- * backend leaves it unimplemented for exactly that hazard — see the
120
- * revival Agent Note).
121
- */
122
- flush?(): void
123
- /**
124
- * Forward the fiber's disposal to the SDK: flush whatever is queued and
125
- * reach quiescence, per the SDK's own shutdown contract. Everything
126
- * emitted before this call must still be delivered — including records
127
- * enqueued while a {@link flush} hint is in flight, so a backend whose SDK
128
- * guards against concurrent flushes orders behind the outstanding one (the
129
- * coordinator emits its dispose-time `shutdown` markers immediately before
130
- * calling this). Awaited by the coordinator's dispose; a rejection is
131
- * logged as a warning and never fails application teardown.
132
- * The coordinator captures dispose-time shutdown markers immediately before
133
- * this call for live capture; on-demand capture creates no ops records.
134
- * @returns resolves when the backend's pipeline has quiesced.
135
- */
136
- shutdown(): Promise<void>
137
- }
138
- ```
139
-
140
- `SessionTelemetryBackend` (`ctx.sessionTelemetry`, [signatures](#ctxsessiontelemetry--sessiontelemetrybackend-abstract-seam)) is the contract's loadable form — one implementation per context, duplicate load throws — and a backend composes the seam's `SessionTelemetryCoordinator` in its constructor to install the capture side.
141
-
142
- ## The redact waterfall: `session-telemetry/record`
143
-
144
- Every record passes the `session-telemetry/record` [waterfall](../cordis-primer.md#cordis-waterfall-semantics) between the canonical-event copy and `emit()` ([event entry](#session-telemetryrecord--waterfall)). The seam ships NO rules of its own: with no listener mounted, records reach the backend exactly as captured, so exported data is precisely as clean as the rules a deployment mounts. Listeners stack by transforming `next()`'s return value; returning without `next()` replaces everything beneath; a throwing listener withholds that one record fail-closed inside the coordinator's containment. Redaction applies to the exported copy only — the canonical session log is never rewritten.
145
-
146
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
147
-
148
- <a id="cordis-surface"></a>
149
-
150
- ## Cordis API
151
-
152
- 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).
153
-
154
- <a id="ctxsessiontelemetry--sessiontelemetrybackend-abstract-seam"></a>
155
-
156
- ### `ctx.sessionTelemetry` — `SessionTelemetryBackend` (abstract seam)
157
-
158
- Loadable form of the backend contract: one implementation per context — the cordis `Service` registration under the `telemetry` key throws on a duplicate, cordis' standard behavior. A backend composes a SessionTelemetryCoordinator in its constructor to install the capture side.
159
-
160
- ```ts cordis-catalog
161
- /**
162
- * See {@link SessionTelemetrySink.emit} — that declaration is the contract's one home.
163
- * @param record - the logical record to report; owned by the backend after the call.
164
- */
165
- abstract emit(record: SessionTelemetryRecord): void
166
-
167
- /** See {@link SessionTelemetrySink.flush}. */
168
- flush?(): void
169
-
170
- /**
171
- * See {@link SessionTelemetrySink.shutdown}.
172
- * @returns resolves when the backend's pipeline has quiesced.
173
- */
174
- abstract shutdown(): Promise<void>
175
- ```
176
-
177
- Source: [`packages/session/session-telemetry/src/index.ts`](../../packages/session/session-telemetry/src/index.ts)
178
-
179
- <a id="session-telemetry-events"></a>
180
-
181
- ### `session-telemetry/*` events
182
-
183
- <a id="session-telemetryrecord--waterfall"></a>
184
-
185
- #### `session-telemetry/record` — waterfall
186
-
187
- Transform one outbound record before it reaches the backend. This waterfall is the Service Definition's redaction extension point. It ships NO rules of its own: the innermost `next()` passes the record through unchanged, and with no listener mounted records reach the backend as captured, so exported data is exactly as clean as the rules a deployment mounts. Listeners stack by transforming `next()`'s return value; returning without `next()` replaces everything beneath. Dispatched synchronously on the capture hot path inside the coordinator's containment: a throwing listener withholds that one record (fail-closed) and never reaches the agent loop. Live capture dispatches at append time; on-demand capture dispatches while reading the canonical log. Redaction applies to the exported copy only; the canonical session log is never rewritten.
188
-
189
- ```ts cordis-catalog
190
- /**
191
- * Transform one outbound record before it reaches the backend. This
192
- * waterfall is the Service Definition's redaction extension point. It ships NO rules
193
- * of its own: the
194
- * innermost `next()` passes the record through unchanged, and with no
195
- * listener mounted records reach the backend as captured, so exported
196
- * data is exactly as clean as the rules a deployment mounts. Listeners
197
- * stack by transforming `next()`'s return value; returning without
198
- * `next()` replaces everything beneath. Dispatched synchronously on the
199
- * capture hot path inside the coordinator's containment: a throwing
200
- * listener withholds that one record (fail-closed) and never reaches the
201
- * agent loop. Live capture dispatches at append time; on-demand capture
202
- * dispatches while reading the canonical log. Redaction applies to the
203
- * exported copy only; the canonical session log is never rewritten.
204
- * @param record - the candidate record, already the coordinator's own deep
205
- * copy; listeners return a (possibly new) record and must not mutate it.
206
- * @mode waterfall
207
- */
208
- 'session-telemetry/record'(record: SessionTelemetryRecord, next: () => SessionTelemetryRecord): SessionTelemetryRecord
209
- ```
210
-
211
- Source: [`packages/session/session-telemetry/src/index.ts`](../../packages/session/session-telemetry/src/index.ts)
212
- <!-- END GENERATED cordis-surface -->