dsh-plugin-dev-kb 1.6.0 → 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 (500) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.en.md +23 -6
  3. package/README.md +28 -8
  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 +123 -8
  344. package/lib/kb-version.js +118 -0
  345. package/package.json +4 -2
  346. package/scripts/refresh-kb.mjs +153 -0
  347. package/scripts/selfcheck.mjs +18 -0
  348. package/scripts/smoke.mjs +77 -0
  349. package/skills/dsh-plugin-dev-kb.md +7 -6
  350. package/skills/dsh-plugin-starter.md +65 -0
  351. package/skills/dsh-upgrade-assistant.md +62 -0
  352. package/kb/extra/agent-lifecycle.md +0 -91
  353. package/kb/extra/agent-lifecycle.zh.md +0 -93
  354. package/kb/extra/api-gateway.md +0 -172
  355. package/kb/extra/api-gateway.zh.md +0 -178
  356. package/kb/extra/architecture.md +0 -165
  357. package/kb/extra/architecture.zh.md +0 -169
  358. package/kb/extra/capability-seams.md +0 -714
  359. package/kb/extra/capability-seams.zh.md +0 -716
  360. package/kb/extra/config-catalog.md +0 -4801
  361. package/kb/extra/config-catalog.zh.md +0 -4803
  362. package/kb/extra/cookbook/adding-a-package.md +0 -170
  363. package/kb/extra/cookbook/adding-a-package.zh.md +0 -170
  364. package/kb/extra/cookbook/adding-a-settings-card.md +0 -72
  365. package/kb/extra/cookbook/adding-a-settings-card.zh.md +0 -72
  366. package/kb/extra/cookbook/adding-a-tool.md +0 -101
  367. package/kb/extra/cookbook/adding-a-tool.zh.md +0 -103
  368. package/kb/extra/cookbook/adding-an-llm-adapter.md +0 -43
  369. package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +0 -43
  370. package/kb/extra/cookbook/extension-cookbook.md +0 -132
  371. package/kb/extra/cookbook/extension-cookbook.zh.md +0 -136
  372. package/kb/extra/cordis-api/context.md +0 -364
  373. package/kb/extra/cordis-api/context.zh.md +0 -366
  374. package/kb/extra/cordis-api/events.md +0 -207
  375. package/kb/extra/cordis-api/events.zh.md +0 -209
  376. package/kb/extra/cordis-api/fiber.md +0 -375
  377. package/kb/extra/cordis-api/fiber.zh.md +0 -377
  378. package/kb/extra/cordis-api/inherited.md +0 -38
  379. package/kb/extra/cordis-api/registry.md +0 -152
  380. package/kb/extra/cordis-api/registry.zh.md +0 -154
  381. package/kb/extra/cordis-api/service.md +0 -102
  382. package/kb/extra/cordis-api/service.zh.md +0 -104
  383. package/kb/extra/cordis-tutorial/01-first-plugin.md +0 -95
  384. package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +0 -95
  385. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +0 -98
  386. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +0 -98
  387. package/kb/extra/cordis-tutorial/03-services.md +0 -98
  388. package/kb/extra/cordis-tutorial/03-services.zh.md +0 -98
  389. package/kb/extra/cordis-tutorial/04-events.md +0 -144
  390. package/kb/extra/cordis-tutorial/04-events.zh.md +0 -144
  391. package/kb/extra/cordis-tutorial/05-config.md +0 -111
  392. package/kb/extra/cordis-tutorial/05-config.zh.md +0 -111
  393. package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +0 -113
  394. package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +0 -113
  395. package/kb/extra/cordis-tutorial/07-into-the-harness.md +0 -108
  396. package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +0 -108
  397. package/kb/extra/cordis-tutorial/index.md +0 -60
  398. package/kb/extra/cordis-tutorial/index.zh.md +0 -62
  399. package/kb/extra/experimental-persistence-catalog.md +0 -17
  400. package/kb/extra/experimental-persistence-catalog.zh.md +0 -17
  401. package/kb/extra/persistence-catalog.md +0 -9140
  402. package/kb/extra/persistence-catalog.zh.md +0 -9142
  403. package/kb/extra/subsystems/README.md +0 -76
  404. package/kb/extra/subsystems/README.zh.md +0 -76
  405. package/kb/extra/subsystems/approval.md +0 -170
  406. package/kb/extra/subsystems/approval.zh.md +0 -170
  407. package/kb/extra/subsystems/client-modules.md +0 -198
  408. package/kb/extra/subsystems/client-modules.zh.md +0 -198
  409. package/kb/extra/subsystems/client-resources.md +0 -92
  410. package/kb/extra/subsystems/client-resources.zh.md +0 -92
  411. package/kb/extra/subsystems/commands.md +0 -223
  412. package/kb/extra/subsystems/commands.zh.md +0 -223
  413. package/kb/extra/subsystems/compaction.md +0 -284
  414. package/kb/extra/subsystems/compaction.zh.md +0 -284
  415. package/kb/extra/subsystems/conversation.md +0 -301
  416. package/kb/extra/subsystems/conversation.zh.md +0 -303
  417. package/kb/extra/subsystems/core.md +0 -1113
  418. package/kb/extra/subsystems/core.zh.md +0 -1125
  419. package/kb/extra/subsystems/credentials.md +0 -493
  420. package/kb/extra/subsystems/credentials.zh.md +0 -493
  421. package/kb/extra/subsystems/filesystem.md +0 -530
  422. package/kb/extra/subsystems/filesystem.zh.md +0 -530
  423. package/kb/extra/subsystems/goal.md +0 -313
  424. package/kb/extra/subsystems/goal.zh.md +0 -313
  425. package/kb/extra/subsystems/jobs.md +0 -554
  426. package/kb/extra/subsystems/jobs.zh.md +0 -554
  427. package/kb/extra/subsystems/llm-streaming.md +0 -1196
  428. package/kb/extra/subsystems/llm-streaming.zh.md +0 -1202
  429. package/kb/extra/subsystems/lsp.md +0 -202
  430. package/kb/extra/subsystems/lsp.zh.md +0 -202
  431. package/kb/extra/subsystems/permission-presets.md +0 -167
  432. package/kb/extra/subsystems/permission-presets.zh.md +0 -167
  433. package/kb/extra/subsystems/persistence.md +0 -418
  434. package/kb/extra/subsystems/persistence.zh.md +0 -418
  435. package/kb/extra/subsystems/plan.md +0 -87
  436. package/kb/extra/subsystems/plan.zh.md +0 -87
  437. package/kb/extra/subsystems/ptc-runtime.md +0 -250
  438. package/kb/extra/subsystems/ptc-runtime.zh.md +0 -250
  439. package/kb/extra/subsystems/sandbox.md +0 -221
  440. package/kb/extra/subsystems/sandbox.zh.md +0 -221
  441. package/kb/extra/subsystems/schedule.md +0 -550
  442. package/kb/extra/subsystems/schedule.zh.md +0 -550
  443. package/kb/extra/subsystems/scope.md +0 -59
  444. package/kb/extra/subsystems/scope.zh.md +0 -61
  445. package/kb/extra/subsystems/session-projection.md +0 -356
  446. package/kb/extra/subsystems/session-projection.zh.md +0 -356
  447. package/kb/extra/subsystems/session-query.md +0 -511
  448. package/kb/extra/subsystems/session-query.zh.md +0 -511
  449. package/kb/extra/subsystems/session-reference.md +0 -224
  450. package/kb/extra/subsystems/session-reference.zh.md +0 -224
  451. package/kb/extra/subsystems/session-telemetry.md +0 -212
  452. package/kb/extra/subsystems/session-telemetry.zh.md +0 -212
  453. package/kb/extra/subsystems/session-title.md +0 -213
  454. package/kb/extra/subsystems/session-title.zh.md +0 -213
  455. package/kb/extra/subsystems/session.md +0 -1339
  456. package/kb/extra/subsystems/session.zh.md +0 -1343
  457. package/kb/extra/subsystems/settings.md +0 -155
  458. package/kb/extra/subsystems/settings.zh.md +0 -155
  459. package/kb/extra/subsystems/shell.md +0 -314
  460. package/kb/extra/subsystems/shell.zh.md +0 -314
  461. package/kb/extra/subsystems/sidebar-right.md +0 -160
  462. package/kb/extra/subsystems/sidebar-right.zh.md +0 -160
  463. package/kb/extra/subsystems/skills.md +0 -352
  464. package/kb/extra/subsystems/skills.zh.md +0 -352
  465. package/kb/extra/subsystems/slots.md +0 -200
  466. package/kb/extra/subsystems/slots.zh.md +0 -204
  467. package/kb/extra/subsystems/spill.md +0 -124
  468. package/kb/extra/subsystems/spill.zh.md +0 -124
  469. package/kb/extra/subsystems/storage.md +0 -259
  470. package/kb/extra/subsystems/storage.zh.md +0 -259
  471. package/kb/extra/subsystems/subagent.md +0 -686
  472. package/kb/extra/subsystems/subagent.zh.md +0 -688
  473. package/kb/extra/subsystems/subprocess.md +0 -321
  474. package/kb/extra/subsystems/subprocess.zh.md +0 -321
  475. package/kb/extra/subsystems/system-prompt.md +0 -254
  476. package/kb/extra/subsystems/system-prompt.zh.md +0 -254
  477. package/kb/extra/subsystems/terminal.md +0 -184
  478. package/kb/extra/subsystems/terminal.zh.md +0 -184
  479. package/kb/extra/subsystems/token-meter.md +0 -106
  480. package/kb/extra/subsystems/token-meter.zh.md +0 -106
  481. package/kb/extra/subsystems/tools.md +0 -747
  482. package/kb/extra/subsystems/tools.zh.md +0 -747
  483. package/kb/extra/subsystems/typert.md +0 -690
  484. package/kb/extra/subsystems/typert.zh.md +0 -690
  485. package/kb/extra/subsystems/user-questions.md +0 -307
  486. package/kb/extra/subsystems/user-questions.zh.md +0 -307
  487. package/kb/extra/subsystems/web-client.md +0 -100
  488. package/kb/extra/subsystems/web-client.zh.md +0 -100
  489. package/kb/extra/subsystems/web-server.md +0 -302
  490. package/kb/extra/subsystems/web-server.zh.md +0 -302
  491. package/kb/extra/subsystems/web.md +0 -206
  492. package/kb/extra/subsystems/web.zh.md +0 -206
  493. package/kb/extra/subsystems/workflow.md +0 -278
  494. package/kb/extra/subsystems/workflow.zh.md +0 -278
  495. package/kb/extra/subsystems/workspace.md +0 -647
  496. package/kb/extra/subsystems/workspace.zh.md +0 -647
  497. package/kb/extra/tool-catalog.md +0 -2824
  498. package/kb/extra/tool-catalog.zh.md +0 -2832
  499. package/kb/extra/tool-execution-pipeline.md +0 -65
  500. package/kb/extra/tool-execution-pipeline.zh.md +0 -67
@@ -1,100 +0,0 @@
1
- # Web Client architecture
2
-
3
- English | [中文](web-client.zh.md)
4
-
5
- The Web Client is a browser-side Cordis application assembled from independently loaded plugins. Its architecture has four reusable foundations: [Client Modules](client-modules.md) loads the plugin graph, the [API Gateway](../api-gateway.md) provides typed Host communication, [Slots](slots.md) composes React UI, and [Conversation](conversation.md) turns a Session history window into target-owned views. This page connects those systems and defines where Client models and feature packages belong.
6
-
7
- [Keyboard shortcuts](../../packages/client/shortcuts/README.md) owns window-local command registration and physical-key dispatch; [the shortcut reference](../../packages/client/ui-shortcuts/README.md) presents available commands and local input actions. Command owners declare each runtime/platform default and share their existing actions with mouse controls. The shared modal primitive arbitrates top-layer Escape and restores focus.
8
-
9
- ## Layers and ownership
10
-
11
- | Layer | Main owners | Responsibility |
12
- |---|---|---|
13
- | Host application | business services and `packages/api/*-controller` Host entries | Own authoritative state, persistence, mutation ordering, access policy, and stream production. |
14
- | Transport and API assembly | `client/connection`, `api/gateway`, `api/remotes` | Establish a Client generation, expose generated `ctx.remote` methods and streams, forward selected Cordis events, and carry cancellation and results. |
15
- | Client models | `api/session-controller/client`, `api/workspace-controller/client` | Maintain React-free mirrors of Host state, resolve stream/unary races, own object identities and subscriptions, and expose narrow command services. |
16
- | UI adapters | `client/ui-session`, `client/ui-workspace` | Convert model observables into root or Provider-bound Session Slot sources and own view-level navigation and status policy. |
17
- | Conversation data | `client/ui-conversation`, target packages such as `ui-chat` and `ui-trajectory` | Assemble standard events and compact historical Assistant runs into independent target snapshots and own the shared conversation shell and input flow. |
18
- | Composition and rendering | `client/ui-slots`, `client/ui-renderer`, `client/ui-layout`, feature UI packages | Declare extension locations, derive component props, bind observables to React hooks, and mount the final tree. |
19
-
20
- The dependency direction is Host state → Remote transport → Client model → UI adapter → Conversation or presentation → Slots → React. User actions travel back through callbacks that close over an injected Client service or generated Remote namespace. A presentation component never receives Cordis `ctx`, a transport object, or another feature plugin's implementation.
21
-
22
- ## Browser boot
23
-
24
- The Host writes the composed `WebBootGraph` to `window.__DSH_BOOT__` and installs the browser module-loader facade before parser-preloaded scripts execute. The module system is a lazy CommonJS table: loading a bundle registers its factory, while materializing an entry runs the factory with synchronous `require` over platform modules and declared dynamic dependencies.
25
-
26
- The Web boot kernel creates the module system, prefetches `immediately` entries, mounts the vendored Cordis Loader, and creates every graph entry. Cordis service injection determines activation; module graph order determines only whether synchronous imports can be materialized. After the complete roster reaches a settled state, `ui-renderer` hydrates the framework-free boot DOM and calls the sole context-level `renderSlot('root')` operation. [Client Modules](client-modules.md) owns the graph, bundle route, cache revision, and loader details.
27
-
28
- ## Remote communication
29
-
30
- Host business services annotate callable methods with Typert Remote decorators. Host generation emits strict descriptors, runtime codecs, declaration merges, and source maps. The Client-side `api-remotes` assembly selects those generated contributions and mounts concrete methods under `ctx.remote.<namespace>` and Session-scoped `agentCtx.remote.<namespace>`. Feature packages depend on the generated service face, not the Gateway implementation or a Host package's runtime entry.
31
-
32
- The Connection owns request URL resolution, correlation, the `/api` carrier, trust checks, exact Fetch routes, and connection generations. API Gateway owns Remote dispatch, cancellation, logical streams, and selected Host event forwarding. Controller operations belong on generated Remote methods or explicit Remote streams; feature-owned downloads register exact Fetch routes. The [API Gateway reference](../api-gateway.md) defines generation and invocation, while the [Connection README](../../packages/client/connection/README.md) defines the physical carrier and trust policy.
33
-
34
- The internal `$events` logical stream is the Connection generation source. Its opening `ready` frame carries the Host home used for path display and establishes the generation after Host listeners are attached, before any controller begins a baseline read. `ctx.remote.$on()` delivers allowlisted ordinary events to the root Client Context and scoped waterfall events to the resolved Session Context; a waterfall listener returns a result, calls `next()`, or rejects.
35
-
36
- ## Client models
37
-
38
- Each API controller package owns a paired Host and Client face. The Host side owns authoritative mutation and stream production. The Client side owns an identity-stable, React-free model over the same generated wire types and exposes observable snapshots plus commands. UI packages consume these Client services and do not reproduce transport state in component stores.
39
-
40
- ### Sessions
41
-
42
- [`api/session-controller`](../../packages/api/session-controller/README.md) exposes Host commands for list, search, creation, prompt, queue, cancellation, pagination, and follow/control streams. Its Client side is organized as `ClientSessions → SessionManager → Session`:
43
-
44
- - `ClientSessions` provides `ctx.sessions`, owns references, source counts, Session scopes, and stable `SessionBinding` objects, and projects catalog state without selecting a global current Session.
45
- - `SessionManager` owns the list baseline, live list/control updates, lazy Session instances, projection stores, subagent catalogs, and conflict ordering between pulls and later updates.
46
- - Each `Session` owns one contiguous logical-event window represented by `SessionEventLikeEntry` values, paging, follow, prompt/control state, and the observable snapshot consumed by adapters.
47
-
48
- The durable event path opens `follow()`, whose first frame contains the current header, tail page, cursor, and complete projection baseline. History records have an explicit `event` or `chunks` discriminator and an aligned inner `event`; the journal validates each inclusive logical sequence range before the Client retains the records as `SessionEventLikeEntry` values without per-record conversion. Each physical generation atomically replaces the retained window from that snapshot; standard live events then append by sequence. `page()` is reserved for older history and gap repair. The transient control stream starts every generation with a complete baseline and then applies projection updates.
49
-
50
- ### Workspaces
51
-
52
- [`api/workspace-controller`](../../packages/api/workspace-controller/README.md) keeps Workspace mutation policy and the authoritative follow feed on the Host. `ClientWorkspaceModel` owns browser rows, Workspace order, archived and pinned Session id arrays, command echoes, and stream/unary race resolution. Every stream generation starts with a complete baseline followed by `upsert`, `remove`, `order`, `archived`, and `pinned` increments; reconnect replaces the model from the new baseline. `WorkspaceController` exposes that model as `ctx.workspaces`, while `ui-workspace` contributes `useWorkspaces` and navigation callbacks. The sidebar's `ArchivedFilter` controls default-hidden, shown, or archived-only rows in lists and search. Archived rows retain their ordering slots, render grayed, and cannot open until restored through the row or search-result Unarchive action. Restoration calls `workspace.unarchiveSession`, and its complete archive set reaches Clients through the unary response and `archived` increment. Session display order stays browser-local and includes hidden archives; pinning moves a Session within that full order, while unpinning does not restore its earlier position.
53
-
54
- This pairing is not a second source of business truth. Host controllers decide durable state and mutation outcomes; Client models maintain the latest usable local projection, preserve object identity where useful to rendering, and encode how delayed responses and replacement baselines merge.
55
-
56
- ## Conversation and presentation
57
-
58
- Web and desktop share the [Coding Tools preference](../../packages/client/ui-settings/README.md#use-this-package). It controls diagnostic Views, [available preset choices](../../packages/client/ui-agent-preset/README.md), changed-file cards, and the builtin HTML preview policy without changing Session records.
59
-
60
- `ui-session` installs the Session scope adapter and publishes `useSessions`, `useSessionStatus`, `useSessionRetainInfo`, `useSessionAccess`, `useSession`, `sessionId`, `useProjection`, and the Session-scope `useAccess` over the [remote-access](../../packages/api/remote-access/README.md) Client service. `SessionProvider` inherits an outer binding or binds an explicit `SessionReference`, so concurrent subtrees can target different Sessions. Domain adapters add further standard sources without putting React hooks on the model objects.
61
-
62
- `ui-conversation` binds once to each `SessionBinding.eventSource`. Its event registry correlates durable Session events and Client-only `assistant/live-chunk` updates into stable business Contexts, and its view registry materializes target snapshots. Chat Assistant, Trajectory Assistant, and Turn Tail interpret both live chunks and the compact streams embedded in durable settlements, so reconnect and paged history reproduce the same Assistant state without durable token rows. `ui-chat` and `ui-trajectory` register separate Definitions and builders: they may interpret the same event family, but they do not import or share each other's final display model. The shell selects a registered view and passes its snapshot through standard hooks and Slots. [Conversation](conversation.md) defines Context identity, replay, Location data, target builders, and keyed renderers.
63
-
64
- `ui-slots` provides the typed registry and lifecycle ledger; `ui-renderer` is the only package that binds bare observables through `useSyncExternalStore`, owns React contexts, and renders the root tree. Feature components receive framework hooks, owner props, store actions, and explicit injection through their derived props. [Web Client Slots](slots.md) lists those inputs, extension APIs, and the current Slot hierarchy.
65
-
66
- ## Data paths
67
-
68
- | Path | Sequence |
69
- |---|---|
70
- | durable Session display | Host Session log → packed Remote `follow`/`page` history → Client `SessionEventLikeEntry` window → Conversation Contexts → target snapshot (`chat`, `trajectory`, or another registered target) → Slot view → React |
71
- | transient Session control | Host control baseline → Remote snapshot stream → `SessionManager` projection stores → Session and list snapshots → standard hooks → components |
72
- | Background jobs | Host job registry → `job.list` / `job.follow` → [`ClientJobs`](../../packages/api/job-controller/README.md) roster and output views → job list and panels |
73
- | Workspace state | Host Workspace baseline and increments → `ClientWorkspaceModel` → `ctx.workspaces.list` → `useWorkspaces` → sidebar, hero, and navigation entries |
74
- | scoped interaction | Host Cordis waterfall → API Remotes `$events` → `ctx.remote.$on()` on the Session Context → owning UI package → result or `next()` |
75
- | user command | component callback → registration inject face or Slot owner → `ctx.sessions`, `ctx.workspaces`, or generated scoped Remote → Host Controller → authoritative update → stream or event projection back to the Client |
76
-
77
- ## Reconnection
78
-
79
- Physical and logical recovery are separate. Gateway mux restores the physical WebSocket; each `RemoteStream` reopens its own logical source when the Connection publishes a usable generation. A carrier failure is retryable, while a business error, malformed opening item, or protocol violation is terminal for the owning logical stream.
80
-
81
- Recovery follows the data's semantics:
82
-
83
- - A durable Session journal validates logical sequence ranges and replaces its window from every generation's opening snapshot; `page()` supplies older history and repairs any later range gap.
84
- - Session control and Workspace streams retain the last published value while disconnected, then atomically replace it from a fresh opening baseline.
85
- - Ordinary forwarded notifications are not replayed. Stateful domains need a baseline, cursor, or explicit query; scoped waterfalls retain their own request lifetime.
86
-
87
- There is no monolithic Client `Runtime`, `HostFrame`, `events.mux`, `events.host`, or universal `resync()` API. The Connection exposes generation state, Gateway owns logical stream supervision, and each Client model defines replacement or resume semantics appropriate to its data.
88
-
89
- ## Package boundaries
90
-
91
- Feature plugin packages may share declarations through `import type`; they do not runtime-import or re-export another feature plugin's values. Cross-package behavior uses injected Cordis services, and cross-package UI uses Slots. Target-specific Conversation Definitions, projection helpers, and final view data stay with their target package even when Chat and Trajectory intentionally implement parallel logic.
92
-
93
- Shared runtime values need a narrow static owner with no feature lifecycle, such as `client/store`, `ui-primitives`, or a browser-safe utility package. Transport and generated API assembly may import runtime contributions because assembling one protocol is their explicit responsibility. A feature package does not add `dsh.client.external` merely to bypass this rule.
94
-
95
- Use the four detailed references according to the extension being added:
96
-
97
- - [Client Modules](client-modules.md) for package discovery, loading, shared module identities, and boot order.
98
- - [API Gateway](../api-gateway.md) for Host methods, generated Remote contributions, streams, and forwarded events.
99
- - [Web Client Slots](slots.md) for components, hooks, stores, injection, and placement.
100
- - [Conversation](conversation.md) for durable event correlation, target snapshots, and Chat or Trajectory view contributions.
@@ -1,100 +0,0 @@
1
- # Web Client 架构
2
-
3
- [English](web-client.md) | 中文
4
-
5
- Web Client 是由独立加载插件组装而成的浏览器侧 Cordis 应用。它有四个可复用底座:[Client Modules](client-modules.zh.md) 加载插件图,[API Gateway](../api-gateway.zh.md) 提供类型化 Host 通信,[Slots](slots.zh.md) 组合 React UI,[Conversation](conversation.zh.md) 把 Session 历史窗口变成各 target 自有的视图。本文串联这些系统,并规定 Client model 与功能包各自所在的位置。
6
-
7
- [快捷键](../../packages/client/shortcuts/README.zh.md)负责窗口内命令注册和物理键分发;[快捷键速查](../../packages/client/ui-shortcuts/README.zh.md)展示可用命令及局部输入操作。命令 owner 声明各运行端/平台的默认键位,并与鼠标控件共用既有操作。共用模态组件裁决顶层 Esc 并恢复焦点。
8
-
9
- ## 分层与所有权
10
-
11
- | 层 | 主要 owner | 职责 |
12
- |---|---|---|
13
- | Host 应用 | 业务 service 与 `packages/api/*-controller` Host entry | 拥有权威状态、持久化、mutation 顺序、访问策略与 stream 生产。 |
14
- | 传输与 API assembly | `client/connection`、`api/gateway`、`api/remotes` | 建立 Client generation,公开生成的 `ctx.remote` method 与 stream,转发选定的 Cordis event,并承载取消和结果。 |
15
- | Client model | `api/session-controller/client`、`api/workspace-controller/client` | 维护不依赖 React 的 Host 状态镜像,处理 stream/unary 竞态,拥有对象 identity 与订阅,并公开收窄的 command service。 |
16
- | UI adapter | `client/ui-session`、`client/ui-workspace` | 把 model observable 转换为 root 或 Provider 绑定的 Session Slot source,并拥有视图级导航与状态策略。 |
17
- | Conversation 数据 | `client/ui-conversation`、`ui-chat` 与 `ui-trajectory` 等 target package | 把标准 event 与紧凑的 Assistant 历史批次组装成相互独立的 target snapshot,并拥有共享的 Conversation shell 与输入流程。 |
18
- | 组合与渲染 | `client/ui-slots`、`client/ui-renderer`、`client/ui-layout`、各 UI 功能包 | 声明扩展位置、推导组件 props、把 observable 绑定成 React hook,并挂载最终组件树。 |
19
-
20
- 依赖方向是 Host 状态 → Remote 传输 → Client model → UI adapter → Conversation 或 presentation → Slots → React。用户操作通过 callback 反向进入注入的 Client service 或生成的 Remote namespace。Presentation component 绝不接收 Cordis `ctx`、transport object 或其他功能插件的实现。
21
-
22
- ## 浏览器启动
23
-
24
- Host 把组合后的 `WebBootGraph` 写入 `window.__DSH_BOOT__`,并在 parser-preloaded script 执行前安装浏览器 module-loader facade。模块系统是一张 lazy CommonJS 表:加载 bundle 只注册 factory;materialize entry 时才以同步 `require` 运行 factory,并解析 platform module 和已声明的动态依赖。
25
-
26
- 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.zh.md)负责 graph、bundle route、cache revision 与 loader 细节。
27
-
28
- ## Remote 通信
29
-
30
- Host 业务 service 使用 Typert Remote decorator 标记可调用 method。Host generation 产出严格 descriptor、runtime codec、declaration merge 与 source map。Client 侧 `api-remotes` assembly 选择这些生成贡献,并把具体 method 挂到 `ctx.remote.<namespace>` 与 Session scope 的 `agentCtx.remote.<namespace>`。功能包依赖生成的 service face,而不依赖 Gateway 实现或 Host 包的运行时 entry。
31
-
32
- Connection 拥有请求 URL 解析、request correlation、`/api` carrier、trust check、精确 Fetch 路由与 connection generation。API Gateway 拥有 Remote dispatch、取消、logical stream 与选定 Host event 的转发。Controller 操作应进入生成的 Remote method 或显式 Remote stream;功能自有的下载则注册精确 Fetch 路由。[API Gateway 参考](../api-gateway.zh.md)定义 generation 与调用,[Connection README](../../packages/client/connection/README.zh.md)定义物理 carrier 与信任策略。
33
-
34
- 内部 `$events` logical stream 是 Connection generation source。它的 opening `ready` frame 携带用于路径显示的 Host home,并在 Host listener 已挂载、任何 controller 开始 baseline read 之前建立 generation。`ctx.remote.$on()` 把 allowlist 内的普通 event 交付给 root Client Context,并把 scoped waterfall event 交付给已解析的 Session Context;waterfall listener 可以返回结果、调用 `next()` 或拒绝。
35
-
36
- ## Client models
37
-
38
- 每个 API controller 包都拥有配对的 Host face 与 Client face。Host 侧拥有权威 mutation 与 stream 生产;Client 侧基于相同的生成 wire type 维护 identity 稳定、与 React 无关的 model,并公开 observable snapshot 与 command。UI 包消费这些 Client service,不在 component store 中复制 transport state。
39
-
40
- ### Sessions
41
-
42
- [`api/session-controller`](../../packages/api/session-controller/README.zh.md)公开 Session list、search、creation、prompt、queue、cancellation、pagination 及 follow/control stream 等 Host command。其 Client 侧按 `ClientSessions → SessionManager → Session` 组织:
43
-
44
- - `ClientSessions` 提供 `ctx.sessions`,拥有 reference、source count、Session scope 与稳定的 `SessionBinding` object,并投影不含全局 current Session 选择的 catalog state。
45
- - `SessionManager` 拥有 list baseline、实时 list/control update、惰性 Session instance、projection store、subagent catalog,以及 pull 与后到 update 之间的冲突顺序。
46
- - 每个 `Session` 拥有一段由 `SessionEventLikeEntry` value 表示的连续逻辑 event window、pagination、follow、prompt/control state 与供 adapter 消费的 observable snapshot。
47
-
48
- 持久 event 路径打开 `follow()`,其首帧包含当前 header、tail page、cursor 与完整 projection baseline。历史 record 带有显式 `event` 或 `chunks` 判别字段和字段对齐的内部 `event`;journal 先校验每条 record 的逻辑 seq 闭区间,Client 再直接把这些 record 保留为 `SessionEventLikeEntry`,无需逐 record 转换。每个物理 generation 都根据该 snapshot 原子替换保留窗口,随后按 seq append 标准实时 event。`page()` 只用于更早历史与 gap repair。瞬态 control stream 每代以完整 baseline 开始,随后应用 projection update。
49
-
50
- ### Workspaces
51
-
52
- [`api/workspace-controller`](../../packages/api/workspace-controller/README.zh.md)把 Workspace 变更策略与权威 follow feed 留在 Host。`ClientWorkspaceModel` 拥有浏览器行、Workspace 顺序、归档与置顶 Session id 数组、命令回显,以及流与一元调用的竞态合并。每代 stream 先给出完整 baseline,再给出 `upsert`、`remove`、`order`、`archived` 和 `pinned` increment;重连时以新 baseline 替换 model。`WorkspaceController` 把该 model 作为 `ctx.workspaces` 公开,`ui-workspace` 则提供 `useWorkspaces` 与导航回调。侧边栏的 `ArchivedFilter` 控制列表与搜索中的默认隐藏、显示已归档或仅显示已归档。归档行保留排序位置、置灰展示,必须通过行菜单或搜索结果的取消归档操作恢复后才能打开。恢复调用 `workspace.unarchiveSession`,完整归档集合通过一元响应及 `archived` increment 到达 Client。Session 显示顺序保存在浏览器本地,包含隐藏归档项;置顶在该完整顺序内移动 Session,取消置顶不恢复先前位置。
53
-
54
- 这种配对不会产生第二份业务真相。Host controller 决定持久状态与 mutation outcome;Client model 维护最新可用的本地 projection,在有利于渲染时保持 object identity,并明确 delayed response 与 replacement baseline 的合并规则。
55
-
56
- ## Conversation 与 presentation
57
-
58
- Web 和桌面端共享[代码工作工具偏好](../../packages/client/ui-settings/README.zh.md#use-this-package)。它控制诊断 View、[可用的预设选项](../../packages/client/ui-agent-preset/README.zh.md)、改动文件卡片和内置 HTML 预览策略,不改变 Session 记录。
59
-
60
- `ui-session` 安装 Session scope adapter,并在 [remote-access](../../packages/api/remote-access/README.zh.md) Client 服务之上提供 `useSessions`、`useSessionStatus`、`useSessionRetainInfo`、`useSessionAccess`、`useSession`、`sessionId`、`useProjection` 和会话作用域的 `useAccess`。`SessionProvider` 可以继承外围 binding,也可以绑定显式 `SessionReference`,因此并存子树可以指向不同 Session。领域 adapter 可以继续添加标准 source,但不会把 React hook 放进 model object。
61
-
62
- `ui-conversation` 对每个 `SessionBinding.eventSource` 只绑定一次。它的 event registry 把持久 Session event 与 Client-only `assistant/live-chunk` update 关联成稳定的业务 Context,view registry 则 materialize target snapshot。Chat Assistant、Trajectory Assistant 与 Turn Tail 同时解释 live chunk 和持久 settlement 中嵌入的紧凑 stream,因此重连与分页历史无需持久 token 行即可复现相同 Assistant 状态。`ui-chat` 与 `ui-trajectory` 分别注册自己的 Definition 和 builder:它们可以解释同一 event family,但不会导入或共享彼此的最终 display model。Shell 选择一个已注册 view,再通过标准 hook 与 Slot 交付其 snapshot。[Conversation](conversation.zh.md)定义 Context identity、replay、Location data、target builder 与 keyed renderer。
63
-
64
- `ui-slots` 提供类型化 registry 与 lifecycle ledger;`ui-renderer` 是唯一通过 `useSyncExternalStore` 绑定裸 observable、拥有 React context 并渲染 root tree 的包。功能 component 通过推导出的 props 接收 framework hook、owner prop、store action 与显式 injection。[Web Client Slots](slots.zh.md)列出这些输入、扩展 API 与当前 Slot 层级。
65
-
66
- ## 数据通路
67
-
68
- | 路径 | 顺序 |
69
- |---|---|
70
- | 持久 Session 展示 | Host Session log → packed Remote `follow`/`page` 历史 → Client `SessionEventLikeEntry` window → Conversation Context → target snapshot(`chat`、`trajectory` 或其他已注册 target)→ Slot view → React |
71
- | 瞬态 Session control | Host control baseline → Remote snapshot stream → `SessionManager` projection store → Session 与 list snapshot → 标准 hook → component |
72
- | 后台任务 | Host job 注册表 → `job.list` / `job.follow` → [`ClientJobs`](../../packages/api/job-controller/README.zh.md) 名册与输出视图 → 任务列表和面板 |
73
- | Workspace 状态 | Host Workspace baseline 与 increment → `ClientWorkspaceModel` → `ctx.workspaces.list` → `useWorkspaces` → sidebar、hero 与 navigation entry |
74
- | scoped interaction | Host Cordis waterfall → API Remotes `$events` → Session Context 上的 `ctx.remote.$on()` → 所属 UI 包 → result 或 `next()` |
75
- | 用户 command | component callback → 注册项 inject face 或 Slot owner → `ctx.sessions`、`ctx.workspaces` 或生成的 scoped Remote → Host Controller → 权威 update → stream 或 event projection 回到 Client |
76
-
77
- ## 重连
78
-
79
- 物理恢复与逻辑恢复彼此独立。Gateway mux 恢复物理 WebSocket;Connection 发布可用 generation 后,每个 `RemoteStream` 分别重开自己的 logical source。Carrier failure 可以重试;business error、非法 opening item 或 protocol violation 会令所属 logical stream 终止。
80
-
81
- 恢复方式由数据语义决定:
82
-
83
- - 持久 Session journal 校验逻辑 seq range,并根据每个 generation 的 opening snapshot 替换窗口;`page()` 提供更早历史并修复后续 range gap。
84
- - Session control 与 Workspace stream 在断开期间保留最后一次发布的值,再用新的 opening baseline 原子替换。
85
- - 普通 forwarded notification 不会 replay。需要可靠恢复的 stateful domain 必须提供 baseline、cursor 或显式 query;scoped waterfall 保留自身的 request lifetime。
86
-
87
- 架构中没有统一的 Client `Runtime`、`HostFrame`、`events.mux`、`events.host` 或通用 `resync()` API。Connection 公开 generation state,Gateway 管理 logical stream,Client model 则按自身数据定义 replacement 或 resume 语义。
88
-
89
- ## 包边界
90
-
91
- 功能插件包可以通过 `import type` 共享声明;不得运行时导入或转发另一个功能插件的值。跨包行为使用注入的 Cordis service,跨包 UI 使用 Slots。特定 target 的 Conversation Definition、projection helper 与最终 view data 留在所属 target 包中,即使 Chat 和 Trajectory 有意实现平行逻辑。
92
-
93
- 共享运行时值需要一个职责收窄、没有功能生命周期的静态 owner,例如 `client/store`、`ui-primitives` 或浏览器安全的 util 包。Transport 与生成 API assembly 可以导入运行时 contribution,因为组装同一个 protocol 正是它们的显式职责。功能包不能只为绕过此规则而添加 `dsh.client.external`。
94
-
95
- 根据所添加的扩展查阅四篇详细参考:
96
-
97
- - [Client Modules](client-modules.zh.md):package discovery、loading、共享 module identity 与 boot order。
98
- - [API Gateway](../api-gateway.zh.md):Host method、生成的 Remote contribution、stream 与 forwarded event。
99
- - [Web Client Slots](slots.zh.md):component、hook、store、injection 与 placement。
100
- - [Conversation](conversation.zh.md):持久 event correlation、target snapshot,以及 Chat 或 Trajectory view contribution。
@@ -1,302 +0,0 @@
1
- # HTTP Server
2
-
3
- English | [中文](web-server.zh.md)
4
-
5
- [dsh-host-webserver](../../packages/host/webserver) is the browser HTTP carrier for the GUI host: one `node:http` server — `node:https` when `tls` is configured — providing `ctx.webServer`, a named-route registry, optional gzip response compression, index.html transform callbacks, and one fallback handler that a plugin may claim. It is not part of the agent loop and not a capability seam; it knows no harness concepts, and another plugin registers every feature route, including the `/api` bridge, plugin bundles, and the HMR event stream ([layering reference](../../packages/boot/app-boot/README.md)). It serves browsers only: Electron loads the built files over `file://` and sends fetch requests through an IPC bridge instead of this server.
6
-
7
- Source: [`packages/host/webserver/src/index.ts`](../../packages/host/webserver/src/index.ts)
8
-
9
- ## Routes
10
-
11
- ```ts type-equiv
12
- /** Route match kind: 'exact' matches the pathname verbatim; 'prefix' p matches p and p/<anything>. */
13
- type WebRouteKind = 'exact' | 'prefix'
14
- ```
15
-
16
- ```ts type-equiv
17
- /** One named route registration. */
18
- interface WebRoute {
19
- kind: WebRouteKind
20
- /** Absolute pathname, no trailing slash. */
21
- path: string
22
- /** Owns the full response lifecycle (may hold the response open, e.g. SSE). */
23
- handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>
24
- }
25
- ```
26
-
27
- Match order is fixed: exact table first, then longest matching prefix, then the registered fallback. Registration order carries no request-facing semantics — named routes are composed to be disjoint, and the fallback seat answers anything no named route claims; one owner only, a second registration throws. The shipped Web composition claims the seat with [`dsh-host-frontend-static`](../../packages/host/frontend-static/src/index.ts), the SPA dist server with locked semantics: Connection authenticates the dist root and configured index before their HTML is read; non-index assets remain public; non-GET/HEAD is 405, traversal outside the dist root is 403, existing files are served directly, absent or non-file targets are empty 404 responses, and unknown extensions ship as octet-stream.
28
-
29
- <a id="config"></a>
30
-
31
- ## Config
32
-
33
- ```ts type-equiv
34
- /** Web server listen, TLS, and response-compression config. */
35
- interface Config {
36
- /**
37
- * Listen address: a concrete IPv4 or IPv6 literal of one local interface,
38
- * for example the container's own Pod address from `hostname -i`. A loopback
39
- * literal (any address in 127/8, `::1`, or a mapped form of either) keeps the
40
- * server on this machine; any other literal serves the network that address
41
- * belongs to, over plain HTTP unless `tls` is set. The unspecified address —
42
- * IPv4 any, IPv6 any, and the IPv4-mapped forms of IPv4 any — is rejected at
43
- * load: it would expose the port on every interface at once.
44
- */
45
- host: string
46
- /** Listen port; zero requests an OS-assigned port. */
47
- port: number
48
- /**
49
- * Serve HTTPS with this certificate and key instead of plain HTTP. Both files
50
- * are read once, before the listener binds: an unreadable or empty file,
51
- * invalid PEM, or a key that does not match the certificate rejects
52
- * initialization rather than falling back to HTTP. The material is never
53
- * re-read, so replacing a certificate takes a reload. Omitted or null listens
54
- * over plain HTTP.
55
- */
56
- tls?: TlsConfig
57
- /** Response compression for socket-backed HTTP requests. @default 'none' */
58
- compression?: 'none' | 'gzip'
59
- /** Gzip DEFLATE level from 0 through 9. @default 1 */
60
- compressionLevel?: number
61
- /** Minimum known response length eligible for gzip; unknown-length streams are eligible. @default 1024 */
62
- compressionThresholdBytes?: number
63
- }
64
- ```
65
-
66
- ```ts type-equiv
67
- /**
68
- * TLS material for the HTTPS listener: one certificate chain file and the
69
- * private key file it pairs with. Both hold PEM text and both resolve against
70
- * the process working directory.
71
- */
72
- interface TlsConfig {
73
- /** Certificate chain file, leaf certificate first, PEM, no passphrase. */
74
- certFile: string
75
- /** Private key file for the chain's leaf certificate; unencrypted PEM. */
76
- keyFile: string
77
- }
78
- ```
79
-
80
- No composition can bind every interface at once: the unspecified address is rejected at load. The exported `isWildcardHost` and `isLoopbackHost` classify a bind address from its parsed value, and an IPv6 `%zone` is kept for `listen` while classification reads the address alone. The carrier owns no authentication or Origin policy, and it serves plain HTTP unless `tls` supplies a certificate and key. `compression` defaults to `none`; the shipped Web bundle selects gzip level 1 with a 1024-byte threshold. The shipped `dsh web` command selects loopback by default and accepts one concrete `--host` address, warning at startup when a non-loopback bind serves plain HTTP; its Connection plugin supplies Host/Origin checks plus browser-session authentication for every Host API route and stream, and the bind address plus `--trusted-host` govern which browser Host is accepted; `--public-url` changes only the advertised URL. Other compositions own their bind and route-authentication policy. The dist location is an assembly fact of the frontend plugin that claims the seat.
81
-
82
- ## The service
83
-
84
- `WebServer` (`ctx.webServer`) listens immediately on activation; a listen failure (EADDRINUSE…) rejects initialization, and the boot process reports the failed fiber. The `tls` pair is read once before the listener binds, and an unreadable, empty, or mismatched pair rejects initialization the same way instead of falling back to HTTP. `register(route)` adds one named route and returns its disposer; a duplicate `(kind, path)` throws because route patterns are a composition-level contract and a collision is a misconfiguration. Gzip wraps eligible socket-backed responses inside the server, so route handlers retain direct `ServerResponse` ownership and no response-writing API is added to the service. Existing content encodings, `Cache-Control: no-transform`, ranges, SSE, ZIP, and the packaged `.gz` Worker image remain identity responses. `collectIndexInjections()` gathers structured `IndexInjection` rows over one `webserver/index-inject` emit, and `renderIndex(html)` renders them into successful root and configured index responses before applying the raw `tapIndex(transform)` escape-hatch transforms in registration order; [dsh-client-modules](../../packages/client/modules) answers the event with the boot manifest rows. `port` reads the listening port, including the port assigned by the OS when `config.port` is 0, and `protocol` reports the scheme the listener serves (`http:` or `https:`).
85
-
86
- A request whose handling throws (a malformed %-escape hitting `decodeURIComponent`, a client dropping mid-body) is logged as a warning and answered 400 — or the socket destroyed when headers are already out — never a process exit. Disposal pairs `close()` with `closeAllConnections()` because a handler may hold its response open (SSE) and such connections never end on their own; without the force-close, teardown would hang. A TLS socket counts as a connection only after its handshake, so the server tracks raw TLS sockets beside upgraded ones and destroys both at disposal. The package never prints: the URL line belongs to the shell. Per-package operational detail, including the dev-mode bundle watch pipeline, stays in the [README](../../packages/host/webserver/README.md).
87
-
88
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
89
-
90
- <a id="cordis-surface"></a>
91
-
92
- ## Cordis API
93
-
94
- 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).
95
-
96
- <a id="ctxconnection--hostconnectionhandle"></a>
97
-
98
- ### `ctx.connection` — `HostConnectionHandle`
99
-
100
- Host `ctx.connection` members consumed by transport-independent adapters.
101
-
102
- ```ts cordis-catalog
103
- /**
104
- * Compose exact Fetch routes and the shared-channel RPC interceptor.
105
- * @param channel - shared channel mounted by Connection.
106
- * @returns Fetch handler for trusted, authenticated requests.
107
- */
108
- createSharedFetchHandler(channel: '/api'): ConnectionFetchHandler
109
-
110
- /**
111
- * Apply Connection's Host/Origin checks and browser authentication to
112
- * another Web route.
113
- * @param request - request headers from the HTTP or upgrade request.
114
- * @returns rejection status, or undefined when the route may accept the request.
115
- */
116
- requestRejection(request: ConnectionTrustRequest): ConnectionRequestRejection
117
-
118
- /**
119
- * Admit an HTTP request against its signed browser or API credential and live Peer.
120
- * @param request - request headers from the HTTP or upgrade request.
121
- * @returns the credential's Peer, or the rejection status.
122
- */
123
- admit(request: ConnectionTrustRequest): PeerAdmission
124
-
125
- /**
126
- * Create an independent in-process Peer, disposed with the Context that read `ctx.connection`.
127
- * @param options - fixed principal and optional interaction participation (default `answer`).
128
- * @returns a new Peer distinct from every other Peer.
129
- */
130
- createPeer(options: { readonly principal: Principal; readonly interactions?: 'answer' | 'none' }): PeerScope
131
-
132
- /**
133
- * Claim a physical socket for an API Peer; browser sockets share their owner Peer.
134
- * @param request - authenticated upgrade request headers.
135
- * @returns the Peer and idempotent release, or 409 for duplicate API ownership.
136
- * The carrier releases on socket termination or failed upgrade; release removes
137
- * API admission synchronously without cancelling independent HTTP calls.
138
- */
139
- admitConnection(request: ConnectionTrustRequest): ConnectionAdmission
140
-
141
- /**
142
- * Authenticate one frontend index request, owning a token redirect or 401.
143
- * The cookie this mints is `Secure` when the mounted Web carrier serves TLS,
144
- * which only that listener's protocol decides.
145
- * @param request - root or configured-index HTTP request.
146
- * @param response - response owned when the result is false.
147
- * @returns true only when the frontend may serve index.html.
148
- */
149
- authorizeIndex(request: ConnectionIndexRequest, response: ConnectionIndexResponse): boolean
150
-
151
- /**
152
- * Add the fresh process token to an ordinary Web application URL.
153
- * @param baseUrl - clean application URL whose authority and mount are preserved.
154
- * @returns tokenized URL for initial login; a mount proxy strips its prefix before {@link authorizeIndex}.
155
- */
156
- authenticatedUrl(baseUrl: string): string
157
- ```
158
-
159
- Types: [Principal](typert.md)
160
-
161
- Source: [`packages/client/connection/src/rpc.ts`](../../packages/client/connection/src/rpc.ts)
162
-
163
- <a id="ctxwebapp--webapp"></a>
164
-
165
- ### `ctx.webApp` — `WebApp`
166
-
167
- The Web GUI this process serves, provided by the `web-runtime` row.
168
-
169
- ```ts cordis-catalog
170
- /**
171
- * The URL this GUI advertises, also used for `DSH_WEB_URL` and the startup URL line.
172
- * @returns the configured `publicUrl`, otherwise the listener origin.
173
- */
174
- getAdvertisedUrl(): string
175
- ```
176
-
177
- Source: [`packages/bundle/web-app/src/index.ts`](../../packages/bundle/web-app/src/index.ts)
178
-
179
- <a id="ctxwebserver--webserver"></a>
180
-
181
- ### `ctx.webServer` — `WebServer`
182
-
183
- The browser HTTP carrier service. Activation loads any configured TLS material, then listens immediately; a material or listen failure rejects initialization, and the boot process reports the failed fiber. Route registration order does not affect requests because configured named routes must be distinct, and the fallback handler answers anything not yet claimed during startup with 404 until its owner registers.
184
-
185
- ```ts cordis-catalog
186
- /**
187
- * The root URL local clients use to reach the bound listener: the protocol,
188
- * the {@link bindUrlHost} form of the bind address, and the listening port.
189
- * @returns the origin, for example `http://127.0.0.1:3080`.
190
- * @throws before `listen` binds a port, or when the bind address has no URL form.
191
- */
192
- getOrigin(): string
193
-
194
- /**
195
- * Register a named route. Duplicate (kind, path) throws — route patterns are
196
- * a composition-level contract, so a collision is a misconfiguration.
197
- * @param route - kind, path, and the owning handler.
198
- * @returns the disposer removing the route.
199
- */
200
- register(route: WebRoute): () => void
201
-
202
- /**
203
- * Register an exact-path HTTP upgrade route. Duplicate paths throw because
204
- * one socket can have only one protocol owner.
205
- * @param route - pathname and handler owning negotiation plus socket use.
206
- * @returns the disposer removing the route.
207
- */
208
- registerUpgrade(route: WebUpgradeRoute): () => void
209
-
210
- /**
211
- * Claim the fallback seat: the handler answering every request no named
212
- * route matches (the SPA dist server in the shipped Web composition). One
213
- * owner only — a second registration throws, because two fallbacks cannot
214
- * compose.
215
- * @param handler - owns the full response lifecycle of unmatched requests.
216
- * @returns the disposer releasing the seat.
217
- */
218
- registerFallback(handler: WebRoute['handler']): () => void
219
-
220
- /**
221
- * Register a raw-HTML index transform, the escape hatch for markup no
222
- * {@link IndexInjection} row expresses: {@link renderIndex} applies taps in
223
- * registration order after rendering the structured rows.
224
- * @param transform - pure html-to-html function.
225
- * @returns the disposer removing the transform.
226
- */
227
- tapIndex(transform: (html: string) => string): () => void
228
-
229
- /**
230
- * Run an index.html body through the registered taps in registration order
231
- * — called by the fallback owner on every index response it renders.
232
- * @param html - the raw index.html body.
233
- * @returns the transformed body.
234
- */
235
- applyIndexTaps(html: string): string
236
-
237
- /**
238
- * Gather the structured injection table: one `webserver/index-inject` emit,
239
- * every subscriber pushes its current rows. Fresh per call, so subscribers
240
- * read live state (module graph, theme preference) at emit time.
241
- * @returns rows in subscriber activation order.
242
- */
243
- collectIndexInjections(): IndexInjection[]
244
-
245
- /**
246
- * Render one index.html body: the structured injection table first, then
247
- * the raw `tapIndex` transforms over the result.
248
- * @param html - the raw index.html body.
249
- * @returns the transformed body.
250
- */
251
- renderIndex(html: string): string
252
- ```
253
-
254
- Source: [`packages/host/webserver/src/index.ts`](../../packages/host/webserver/src/index.ts)
255
-
256
- <a id="connection-events"></a>
257
-
258
- ### `connection/*` events
259
-
260
- <a id="connectionrequest--waterfall"></a>
261
-
262
- #### `connection/request` — waterfall
263
-
264
- Admit or wrap an authenticated shared API request, including body transfer. Existing requests continue when a listener refuses subsequent requests.
265
-
266
- ```ts cordis-catalog
267
- /**
268
- * Admit or wrap an authenticated shared API request, including body transfer.
269
- * Existing requests continue when a listener refuses subsequent requests.
270
- * @param request - Authenticated incoming HTTP request.
271
- * @param response - Response owned until the delegated bridge settles.
272
- * @param next - Delegate to the next listener or the shared API bridge.
273
- * @mode waterfall
274
- */
275
- 'connection/request'(request: IncomingMessage, response: ServerResponse, next: () => Promise<void>): Promise<void>
276
- ```
277
-
278
- Source: [`packages/client/connection/src/index.ts`](../../packages/client/connection/src/index.ts)
279
-
280
- <a id="webserver-events"></a>
281
-
282
- ### `webserver/*` events
283
-
284
- <a id="webserverindex-inject--emit"></a>
285
-
286
- #### `webserver/index-inject` — emit
287
-
288
- Collect the structured index injection table. Emitted on every index render and every worker boot-payload request; listeners push their current rows, so a row's data is read fresh at emit time.
289
-
290
- ```ts cordis-catalog
291
- /**
292
- * Collect the structured index injection table. Emitted on every index
293
- * render and every worker boot-payload request; listeners push their
294
- * current rows, so a row's data is read fresh at emit time.
295
- * @param table - Mutable row table; listeners append in activation order.
296
- * @mode emit
297
- */
298
- 'webserver/index-inject'(table: IndexInjection[]): void
299
- ```
300
-
301
- Source: [`packages/host/webserver/src/index.ts`](../../packages/host/webserver/src/index.ts)
302
- <!-- END GENERATED cordis-surface -->