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
@@ -6,9 +6,9 @@ outline: [2,3]
6
6
 
7
7
  # Filesystem
8
8
 
9
- The optional filesystem capability has four parts: [dsh-fs](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs) owns `ctx.fs` and atomic text operations with optional guards, [dsh-fs-local](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs-local) implements local disk, [dsh-fs-observation-policy](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs-observation-policy) records observed presence or absence and adds freshness rules through events rather than a service, and [dsh-tool-fs](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/tool-fs) directly executes model-facing read/write/edit calls and renders windows. It is outside the agent-loop spine; alternate backends do not change policy or tool schemas.
9
+ The optional filesystem capability composes these roles: [dsh-fs](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs) owns `ctx.fs` and guarded file mutations, [dsh-fs-local](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs-local) implements local disk, [dsh-fs-observation-policy](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs-observation-policy) records observed presence or absence and adds freshness rules through events rather than a service, and [dsh-tool-fs](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/tool-fs) directly executes model-facing read/write/edit calls and renders windows. It is outside the agent-loop spine; alternate backends do not change policy or tool schemas. The pure [dsh-fs-patch](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs-patch/README.md) library supplies patch parsing and text application.
10
10
 
11
- `dsh-fs-observation-policy` is optional. Without it, the `FileSystem` Service Definition, a provider, and the `dsh-tool-fs` Consumer form the complete, unconstrained filesystem seam: `write` unconditionally creates or overwrites, and `edit` unconditionally replaces literal text. The policy plugin changes these operations by deciding the `fs/*` waterfalls. Removing it does not break the tool because the tool calls `ctx.fs` and dispatches events; it does not call policy methods. A deployment that loads `dsh-tool-fs` is expected to also load `dsh-fs-observation-policy` so the default behavior is read-before-write/edit.
11
+ `dsh-fs-observation-policy` is optional. Without it, the `FileSystem` Service Definition, a provider, and the `dsh-tool-fs` Consumer form the complete, unconstrained filesystem seam: `write` unconditionally creates or overwrites, and `edit` unconditionally replaces literal text. The policy plugin changes these operations by deciding the `fs/*` waterfalls. Removing it does not break the tool because the tool calls `ctx.fs` and dispatches events; it does not call policy methods. The shipped compositions run without it: `dsh-base` lists the `fs-observation-policy` row `disabled: true`, and a deployment that wants read-before-write/edit sets that row to `disabled: false`.
12
12
 
13
13
  Provider source: [`packages/fs/fs/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs/src/types.ts) and [`packages/fs/fs/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs/src/index.ts). Policy source: [`packages/fs/fs-observation-policy/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs-observation-policy/src/types.ts). Read-rendering source: [`packages/fs/tool-fs/src/read-render.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-fs/src/read-render.ts).
14
14
 
@@ -34,7 +34,7 @@ interface FsTarget {
34
34
  }
35
35
  ```
36
36
 
37
- The backend owns file-version tokens — the freshness token a write/edit guards against. The policy plugin stores them for stale checks; consumers do not interpret them. Both ids are branded opaque strings.
37
+ The backend owns file-version tokens — the freshness token a mutation guards against. The policy plugin stores them for stale checks; consumers do not interpret them. Both ids are branded opaque strings.
38
38
 
39
39
  ```ts type-equiv
40
40
  /**
@@ -115,8 +115,114 @@ interface FsDirEntry {
115
115
  }
116
116
  ```
117
117
 
118
+ <a id="patch-syntax-records"></a>
119
+ ## Patch syntax records
120
+
121
+ [dsh-fs-patch](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs-patch/README.md) parses complete patch text into serializable operations whose paths are unresolved strings, and `applyHunks` applies hunks to caller-supplied LF-normalized text, returning complete new text or a structured match failure. The package README owns the pinned parsing and matching rules.
122
+
123
+ ```ts type-equiv
124
+ /** One contiguous update. */
125
+ interface PatchHunk {
126
+ /** One-based input line containing the marker or first implicit hunk line. */
127
+ lineNumber: number
128
+ /** Text following `@@ `, used as a search anchor by the text matcher. */
129
+ context?: string
130
+ /** Context and removed lines, without patch prefixes or line endings. */
131
+ oldLines: string[]
132
+ /** Context and added lines, without patch prefixes or line endings. */
133
+ newLines: string[]
134
+ /** Whether `*** End of File` follows this hunk. */
135
+ isEndOfFile: boolean
136
+ }
137
+
138
+ ```
139
+
140
+ ```ts type-equiv
141
+ /** Ordered file operation; a move is an update with a destination path. */
142
+ type PatchOperation =
143
+ | {
144
+ kind: 'add'
145
+ path: string
146
+ lineNumber: number
147
+ /** Added lines joined with LF, including a final LF for every added line. */
148
+ content: string
149
+ }
150
+ | {
151
+ kind: 'delete'
152
+ path: string
153
+ lineNumber: number
154
+ }
155
+ | {
156
+ kind: 'update'
157
+ path: string
158
+ lineNumber: number
159
+ moveTo?: string
160
+ hunks: PatchHunk[]
161
+ }
162
+ ```
163
+
164
+ ```ts type-equiv
165
+ /** The first hunk whose anchor or old lines could not be located in the original text. */
166
+ interface HunkApplyFailure {
167
+ /** One-based line of the failing hunk in the patch input. */
168
+ hunkLineNumber: number
169
+ /** The failed anchor or old-content search. */
170
+ stage: 'context' | 'oldLines'
171
+ /** Zero-based sequential search cursor; EOF searches override it with the tail candidate. */
172
+ searchStart: number
173
+ /** Original anchor or old lines, including any trailing empty line retried without its sentinel. */
174
+ pattern: string[]
175
+ }
176
+
177
+ ```
178
+
179
+ ```ts type-equiv
180
+ /** Complete new text or a match failure; failures contain no partially updated text. */
181
+ type ApplyHunksResult =
182
+ | { ok: true; after: string }
183
+ | { ok: false; failure: HunkApplyFailure }
184
+ ```
185
+
118
186
  ## Write and edit guards (provider contract)
119
187
 
188
+ The same optional guard rules cover patches, deletion, and moves. Providers perform no observation recording; callers dispatch intents and record completed outcomes.
189
+
190
+ | Operation | Intent | Success observation |
191
+ |---|---|---|
192
+ | `patchText` | `fs/edit-intent` | Target present at the returned version. |
193
+ | `deleteFile` | `fs/delete-intent` | Source absent. |
194
+ | `moveFile` source | `fs/edit-intent` | Source absent only when `sourceDeleted` is true. |
195
+ | `moveFile` destination | `fs/write-intent` | Destination present at `destination.version`. |
196
+
197
+ Patch, delete, and move sources must be regular files; missing or stale sources report `FS_STALE_VERSION`. Patch matching runs on LF-normalized text inside the mutation lock, and a mismatch reports `FS_PATCH_MISMATCH` with the patch hunk line and stage. Moves reject identical target keys with `FS_SAME_TARGET`, use write guards for their destination, and preserve source line endings and mode. Deletion, move-source, and overwritten-destination bases are bounded nullable LF text. A move is two effects: the destination may be published while source removal fails. Cancellation is checked before local destination staging; after that, the provider completes both effects and reports their outcome.
198
+
199
+ Targets already follow symlinks, so a caller that rejects symlink sources inspects the path with `lstat` before `resolve`.
200
+
201
+ ```ts type-equiv
202
+ /** Outcome of a guarded delete; the bounded basis follows FsWriteOutcome.before. */
203
+ interface FsDeleteOutcome {
204
+ /** LF-normalized removed content, or null for an unavailable, binary, or over-limit basis. */
205
+ before: string | null
206
+ }
207
+ ```
208
+
209
+ ```ts type-equiv
210
+ /** Serializable failure after a move has published its destination but retained its source. */
211
+ interface FsMoveSourceFailure {
212
+ /** Filesystem failure code for source removal. */
213
+ code: FsErrorCode
214
+ /** Diagnostic identifying the source and the failed removal. */
215
+ message: string
216
+ }
217
+ ```
218
+
219
+ ```ts type-equiv
220
+ /** Published destination and removal status; sourceBefore is the bounded LF source basis captured under the move lock. */
221
+ type FsMoveOutcome =
222
+ | { sourceBefore: string | null; destination: FsWriteOutcome; sourceDeleted: true }
223
+ | { sourceBefore: string | null; destination: FsWriteOutcome; sourceDeleted: false; sourceFailure: FsMoveSourceFailure }
224
+ ```
225
+
120
226
  Both `writeText` and `editText` take their version guard OPTIONALLY: omit it for an unconditional (bare-provider) mutation, supply it to guard. `writeText`'s guard is an `FsWriteIntent` — `createIfAbsent` creates a missing target and rejects an existing one with `FS_NOT_OBSERVED`, including a target that appears after the provider's initial probe because publication itself must be no-replace; `replaceIfVersion` replaces only when the target exists at the observed version, else `FS_STALE_VERSION`. Omitting `expected` unconditionally creates-or-overwrites. The union itself carries only the two guarded intents; "no guard" is expressed by omission, so write and edit both use the same optional `expected` field.
121
227
 
122
228
  ```ts type-equiv
@@ -184,9 +290,9 @@ interface FsEditOutcome {
184
290
 
185
291
  ## The fs policy events (provider contract vocabulary)
186
292
 
187
- `dsh-fs` owns three events the tool dispatches and the policy plugin listens for, so the emitter (`dsh-tool-fs`) and the listener (`dsh-fs-observation-policy`) share a vocabulary without the emitter depending on the policy plugin. They carry only `dsh-fs` vocabulary plus an opaque `object` actor — no model-facing concepts and no agent/session owner structure.
293
+ `dsh-fs` owns four events for mutation consumers and observation policy. Consumers dispatch intents before operations and record completed effects; they do not depend on the policy plugin. They carry only `dsh-fs` vocabulary plus an opaque `object` actor — no model-facing concepts and no agent/session owner structure.
188
294
 
189
- `fs/write-intent` and `fs/edit-intent` are **single-slot decision waterfalls**: the tool dispatches each with a default thunk returning `undefined` (the bare provider), and a listener fully decides without calling `next()`. The slot is first-wins by registration order — the policy plugin owning it is a deployment convention, not an enforced invariant. `fs/observed` is a fire-and-forget recording event carrying an `FsObservation`: present at a version or confirmed absent. It is dispatched with a plain `ctx.emit`; its listener MUST be synchronous and side-effect-only, because the tool does NOT guard the emit — a throwing listener can replace a read error or surface as the tool's `isError` result after a mutation already succeeded. The generated [cordis surface](#cordis-surface) below shows the exact signatures.
295
+ `fs/write-intent`, `fs/edit-intent`, and `fs/delete-intent` are **single-slot decision waterfalls**: the tool dispatches each with a default thunk returning `undefined` (the bare provider), and a listener fully decides without calling `next()`. The slot is first-wins by registration order — the policy plugin owning it is a deployment convention, not an enforced invariant. `fs/observed` is a fire-and-forget recording event carrying an `FsObservation`: present at a version or confirmed absent. It is dispatched with a plain `ctx.emit`; its listener MUST be synchronous and side-effect-only, because the tool does NOT guard the emit — a throwing listener can replace a read error or surface as the tool's `isError` result after a mutation already succeeded. The generated [cordis surface](#cordis-surface) below shows the exact signatures.
190
296
 
191
297
  ```ts type-equiv
192
298
  /**
@@ -243,35 +349,37 @@ interface FileReadOutcome {
243
349
 
244
350
  ## Observed-file state (policy plugin)
245
351
 
246
- Observed state is a `WeakMap<owner, Map<targetKey, FsObservation>>` held inside the `dsh-fs-observation-policy` plugin. Missing map entry means unseen; `{ kind: 'absent' }` means a `read` or `str_replace_editor` `view`, `str_replace`, or `insert` metadata miss confirmed absence; `{ kind: 'present', version }` means a read, write, or edit observed that version. The write decision maps unseen and absent to `createIfAbsent`, while present maps to `replaceIfVersion`; the edit decision maps unseen to `FS_NOT_OBSERVED`, absent to `FS_NOT_FOUND`, and present to its version guard. The owner is derived from the event actor (normally `exec.agent.session`), treated as opaque and never read. Disposal drops everything (HMR safety), and the policy performs no filesystem I/O.
352
+ Observed state is a `WeakMap<owner, Map<targetKey, FsObservation>>` held inside the `dsh-fs-observation-policy` plugin. Missing map entry means unseen; `{ kind: 'absent' }` means a `read` or `str_replace_editor` `view`, `str_replace`, or `insert` metadata miss confirmed absence; `{ kind: 'present', version }` means a read, write, or edit observed that version. The write decision maps unseen and absent to `createIfAbsent`, while present maps to `replaceIfVersion`; the edit/delete decision maps unseen to `FS_NOT_OBSERVED`, absent to `FS_NOT_FOUND`, and present to its version guard. The owner is derived from the event actor (normally `exec.agent.session`), treated as opaque and never read. Disposal drops everything (HMR safety), and the policy performs no filesystem I/O.
353
+
354
+ ## Patch execution (consumer)
355
+
356
+ The internal [tool-fs patch executor](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-fs/README.md#understand-the-implementation) dispatches intent decisions in preflight without emitting observations, simulates preceding operations, and reacquires guards for each commit. Sandbox containment stays with the provider at commit, as for `write` and `edit`. Provider results determine which effects are recorded; executor details and failure guarantees belong to the package README.
357
+
358
+ | Operation | Preflight intent on first target use | Commit intent | Successful observation |
359
+ |---|---|---|---|
360
+ | add | `fs/write-intent` | `fs/write-intent` | target present(version) |
361
+ | update | `fs/edit-intent` | `fs/edit-intent` | target present(version) |
362
+ | delete | `fs/delete-intent` | `fs/delete-intent` | target absent |
363
+ | move | source `fs/edit-intent`; destination `fs/write-intent` | same two intents, freshly dispatched | destination present(version); source absent only when removed |
364
+
365
+ The `apply_patch` tool returns strict commit values with per-operation diagnostics and full-text change inputs for rendering; persisted metadata holds diff hunks from the provider's bounded bases and a stopped flag. Syntax and preflight refusals set `isError: true`; commit reports retain `isError: false` even when stopped so known partial diffs reach Session presentation, except that a cancelled call receives the tool registry's abort result like every other tool. The [tool README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-fs/README.md#use-this-package) owns formatting and recovery.
247
366
 
248
367
  ## Error taxonomy (provider contract)
249
368
 
250
369
  Filesystem failures use stable `FsErrorCode` strings carried by `FsError` (`HarnessError`). The tool registry preserves `{ name, code }` on error results, so retry, permission, and UI layers can branch without parsing text.
251
370
 
371
+ `FS_PATCH_MISMATCH` means a hunk failed inside the provider commit; its message names the patch line and failed search stage. `FS_SAME_TARGET` means a move source and destination share the resolved identity. Delete intent follows edit intent: unseen is `FS_NOT_OBSERVED`, observed absence is `FS_NOT_FOUND`, and present state supplies a version. Provider-side missing patch/delete/move sources use `FS_STALE_VERSION` even without a guard.
372
+
373
+ ```ts
374
+ import { FS_ERROR_CODES } from '@deepseek-ai/dsh-fs'
375
+ ```
376
+
252
377
  ```ts type-equiv
253
- /**
254
- * Stable, machine-routable codes for filesystem failures. Carried on
255
- * {@link FsError}; the tool registry exposes `{ name, code }` on `isError`
256
- * results so retry/permission/UI layers can branch without parsing messages.
257
- */
258
- type FsErrorCode =
259
- | 'FS_NOT_FOUND'
260
- | 'FS_NOT_DIRECTORY'
261
- | 'FS_NOT_TEXT'
262
- | 'FS_NOT_REGULAR_FILE'
263
- | 'FS_TOO_LARGE'
264
- | 'FS_PERMISSION_DENIED'
265
- | 'FS_SANDBOX_DENIED'
266
- | 'FS_IO_ERROR'
267
- | 'FS_STALE_VERSION'
268
- | 'FS_NOT_OBSERVED'
269
- | 'FS_AMBIGUOUS_EDIT'
270
- | 'FS_EDIT_NOT_FOUND'
271
- | 'FS_ABORTED'
378
+ /** One machine-routable filesystem failure code from FS_ERROR_CODES. */
379
+ type FsErrorCode = typeof FS_ERROR_CODES[number]
272
380
  ```
273
381
 
274
- `FS_NOT_DIRECTORY`, `FS_PERMISSION_DENIED`, and `FS_IO_ERROR` are used by directory listing to distinguish an existing non-directory target, a denied listing, and an unexpected backend I/O failure. `FS_SANDBOX_DENIED` is a POLICY refusal from a sandbox-enforcing backend (`dsh-fs-sandbox`) — the mode fence denied a write/edit — distinct from `FS_PERMISSION_DENIED` (the host kernel refusing). `FS_NOT_OBSERVED` means the policy plugin has no prior-observation record for this owner (or a `createIfAbsent` hit an existing file). `FS_NOT_FOUND` also represents an edit rejected from confirmed absence. `FS_STALE_VERSION` means the backend version no longer matches the observed one (or the provider itself receives an edit for a missing target). Freshness authorization has no partial/full distinction, so there is no `FS_PARTIAL_OBSERVATION`.
382
+ `FS_NOT_DIRECTORY`, `FS_PERMISSION_DENIED`, and `FS_IO_ERROR` are used by directory listing to distinguish an existing non-directory target, a denied listing, and an unexpected backend I/O failure. `FS_SANDBOX_DENIED` is a POLICY refusal from a sandbox-enforcing backend (`dsh-fs-sandbox`) — the mode fence denied a mutation — distinct from `FS_PERMISSION_DENIED` (the host kernel refusing). `FS_NOT_OBSERVED` means the policy plugin has no prior-observation record for this owner (or a `createIfAbsent` hit an existing file). `FS_NOT_FOUND` also represents an edit rejected from confirmed absence. `FS_STALE_VERSION` means the backend version no longer matches the observed one (or the provider itself receives an edit for a missing target). Freshness authorization has no partial/full distinction, so there is no `FS_PARTIAL_OBSERVATION`.
275
383
 
276
384
  ## No timeouts on file IO
277
385
 
@@ -279,7 +387,7 @@ type FsErrorCode =
279
387
 
280
388
  ## The service and the plugin
281
389
 
282
- `FileSystem` (`ctx.fs`, abstract) owns the provider primitives: `resolve`, `processPath`, `processPathFromHostPath`, `fileUrl`, `contains`, `stat`, `lstat`, `readText`, `streamText`, `readBytes`, `listDir`, `writeText`, and `editText`. `dsh-fs-observation-policy` registers **no service** — it is a plugin that adds policy through the `fs/*` event gate: it decides the write/edit intent waterfalls from unseen/absent/present state and records `FsObservation` values. The executor is `dsh-tool-fs`: it reads/writes/edits through `ctx.fs`, dispatches the waterfalls, and emits the recording event. The generated [`ctx.fs` section](#ctxfs--filesystem-abstract-seam) below shows the exact signatures.
390
+ `FileSystem` (`ctx.fs`, abstract) owns the provider primitives: `resolve`, `processPath`, `processPathFromHostPath`, `fileUrl`, `contains`, `stat`, `lstat`, `readText`, `streamText`, `readBytes`, `listDir`, `writeText`, `editText`, `patchText`, `deleteFile`, and `moveFile`. `dsh-fs-observation-policy` registers **no service** — it is a plugin that adds policy through the `fs/*` event gate: it decides the write/edit/delete intent waterfalls from unseen/absent/present state and records `FsObservation` values. The executor is `dsh-tool-fs`: it reads/writes/edits through `ctx.fs`, dispatches the waterfalls, and emits the recording event. The generated [`ctx.fs` section](#ctxfs--filesystem-abstract-seam) below shows the exact signatures.
283
391
 
284
392
  <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
285
393
 
@@ -293,7 +401,7 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
293
401
 
294
402
  ### `ctx.fs` — `FileSystem` (abstract seam)
295
403
 
296
- Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and mutations are atomic. Optional guards add stale protection without changing the unguarded provider contract.
404
+ Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and single-file publication is atomic. Moves can retain their source after publishing the destination. Optional guards add stale protection without changing the unguarded provider contract.
297
405
 
298
406
  ```ts cordis-catalog
299
407
  /**
@@ -462,6 +570,53 @@ abstract writeText( target: FsTarget, content: string, expected?: FsWriteIntent,
462
570
  * @returns the outcome, including the version the edit produced.
463
571
  */
464
572
  abstract editText( target: FsTarget, edit: FsEditRequest, expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsEditOutcome>
573
+
574
+ /**
575
+ * Atomically apply parsed hunks to the LF-normalized text and restore the
576
+ * stored line-ending style. A missing or stale target reports
577
+ * `FS_STALE_VERSION`; an unmatched hunk reports `FS_PATCH_MISMATCH`.
578
+ * @param target - the resolved regular file to patch.
579
+ * @param hunks - ordered hunks from `parsePatch`.
580
+ * @param expected - the version guard; omit for an unconditional patch.
581
+ * @param signal - aborts before atomic publication takes effect.
582
+ * @param sandboxPolicy - the per-call mode and workspace root this patch runs
583
+ * under; a sandboxing backend fences the patch by it, the bare backend
584
+ * ignores it. Omit to leave the backend its own default.
585
+ * @returns the outcome, including the version the patch produced.
586
+ */
587
+ abstract patchText( target: FsTarget, hunks: readonly PatchHunk[], expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsEditOutcome>
588
+
589
+ /**
590
+ * Remove a regular file. A missing or stale target reports `FS_STALE_VERSION`;
591
+ * a directory or other non-file reports `FS_NOT_REGULAR_FILE`. Resolution has
592
+ * already followed symlinks, so the target is the real file.
593
+ * @param target - the resolved file to remove.
594
+ * @param expected - the version guard; omit for an unconditional removal.
595
+ * @param signal - aborts before removal.
596
+ * @param sandboxPolicy - the per-call mode and workspace root this removal
597
+ * runs under; a sandboxing backend fences it, the bare backend ignores it.
598
+ * Omit to leave the backend its own default.
599
+ * @returns the bounded LF-normalized removed text, or null when no basis is available.
600
+ */
601
+ abstract deleteFile( target: FsTarget, expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsDeleteOutcome>
602
+
603
+ /**
604
+ * Publish the source text, optionally patched, at the destination, then remove
605
+ * the source. Both targets stay locked in canonical order. Identical targets
606
+ * report `FS_SAME_TARGET`; the source guard follows `patchText` and the
607
+ * destination guard follows `writeText`. The two effects are separate: a
608
+ * published destination with a retained source is a final outcome reported
609
+ * through `sourceDeleted: false`.
610
+ * @param source - the resolved regular source; its line-ending style and mode carry over.
611
+ * @param destination - the resolved destination within the same provider.
612
+ * @param options - optional hunks and the source/destination guards; an omitted guard is unconditional.
613
+ * @param signal - checked before destination staging; the commit then completes both effects.
614
+ * @param sandboxPolicy - the per-call mode and workspace root both paths run
615
+ * under; a sandboxing backend fences them, the bare backend ignores it.
616
+ * Omit to leave the backend its own default.
617
+ * @returns the bounded LF source basis, the destination outcome, and the source-removal status.
618
+ */
619
+ abstract moveFile( source: FsTarget, destination: FsTarget, options: { hunks?: readonly PatchHunk[] expectedSource?: { version: FsVersion } expectedDestination?: FsWriteIntent }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsMoveOutcome>
465
620
  ```
466
621
 
467
622
  Types: [SandboxExecutionPolicy](./sandbox.md)
@@ -472,6 +627,25 @@ Source: [`packages/fs/fs/src/index.ts`](https://github.com/deepseek-ai/deepseek-
472
627
 
473
628
  ### `fs/*` events
474
629
 
630
+ <a id="fsdelete-intent--waterfall"></a>
631
+
632
+ #### `fs/delete-intent` — waterfall
633
+
634
+ Single-slot decision for FileSystem.deleteFile; the first returned guard wins. Calling next() delegates to an unconditional deletion.
635
+
636
+ ```ts cordis-catalog
637
+ /**
638
+ * Single-slot decision for FileSystem.deleteFile; the first returned guard wins.
639
+ * Calling next() delegates to an unconditional deletion.
640
+ * @param target - the resolved source about to be removed.
641
+ * @param actor - the opaque tool-execution context used to select observed state.
642
+ * @mode waterfall
643
+ */
644
+ 'fs/delete-intent'(target: FsTarget, actor: object | undefined, next: () => { version: FsVersion } | undefined | Promise<{ version: FsVersion } | undefined>): Promise<{ version: FsVersion } | undefined>
645
+ ```
646
+
647
+ Source: [`packages/fs/fs/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs/src/index.ts)
648
+
475
649
  <a id="fsedit-intent--waterfall"></a>
476
650
 
477
651
  #### `fs/edit-intent` — waterfall
@@ -24,6 +24,7 @@ One page per subsystem of the DeepSeek Harness: what it is, the data structures
24
24
  | [session.md](./session.md) | the full `SessionEventMap` variant catalog, `TurnEndReason`, `deriveMessages()`, execution enclosure, and standalone events |
25
25
  | [working-directory.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/working-directory.md) | Session execution directories, durable changes, recovery, and user context |
26
26
  | [worktrees.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/worktrees.md) | Experimental Git branch and checkout creation under existing permissions |
27
+ | [forge.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/forge.md) | Experimental code host change requests: provider contract, shared status polling, and Session bindings |
27
28
  | [persistence.md](./persistence.md) | the durability seam: `SessionPersistence`, the JSONL provider, `session/flush`, crash recovery, `SessionHeader` |
28
29
  | [settings.md](./settings.md) | the user-settings seam: `SettingsNamespace` registration, layered resolution (defaults → composition `base` → user document), owner scopes, hot commits |
29
30
  | [credentials.md](./credentials.md) | the credential seam: `CredentialRef` references (never values) in configuration, per-operation resolution, UI-safe `CredentialInfo`, provider source layers |
@@ -54,7 +55,8 @@ One page per subsystem of the DeepSeek Harness: what it is, the data structures
54
55
  | [subagent.md](./subagent.md) | the subagent seam: the named-provider registry, `SubagentStartRequest`/`Result`/`Run`, the start-time-vs-runtime capability split |
55
56
  | [voice-input.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/voice-input.md) | experimental named recognizers, transient audio and revision-guarded draft insertion |
56
57
  | [translation.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/translation.md) | experimental anonymous text translation and explicit provider requests |
57
- | [agent-team.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) | Agent Teams: implicit Lead identity, named continuable teammates, direct peer inbox delivery, and shared task DAG |
58
+ | [agent-team.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) | Agent Teams: shared task DAG and task ownership for a subagent tree |
59
+ | [liveshare.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/liveshare.md) | the opt-in LiveShare bundle: nested share modes, a fork's ceiling and durability, enforcement installation, and the constraint a shared Session's externally driven turns run under |
58
60
  | [claude-code-mods.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/claude-code-mods.md) | Claude Code mods through the experimental bridge: every event, `$` member, chain rule, drawing feature, and example mod that differs from Claude Code |
59
61
  | [web.md](./web.md) | the web access seam: `WebSearchRequest`/`Result`, `WebFetchRequest`/`Result`, `WebFetchBody`, provider availability, `WebError` |
60
62
  | [spill.md](./spill.md) | the spill storage seam: `SaveTextSpill`, `SpillOwner`/`SpillSource`, `SpillRef`, the branded `SpillLocator` |
@@ -529,6 +529,26 @@ interface LlmNativeAuth {
529
529
  }
530
530
  ```
531
531
 
532
+ A catalog entry may carry a provider-authored `badge` that selectors show beside the model name. It is display data: `resolveModelInfo` omits it, and no model request carries it.
533
+
534
+ ```ts type-equiv
535
+ /**
536
+ * Emphasis of a model badge: `neutral` states a plain fact, `info` highlights
537
+ * the model, `success` marks a benefit, and `warning` asks for attention.
538
+ */
539
+ type LlmModelBadgeTone = 'neutral' | 'info' | 'success' | 'warning'
540
+ ```
541
+
542
+ ```ts type-equiv
543
+ /** Short provider-authored label a selector shows beside one advertised model name. */
544
+ interface LlmModelBadge {
545
+ /** One literal, or translations keyed by lowercase language id with a required English entry. */
546
+ text: LocalizedText
547
+ /** Emphasis of the label. */
548
+ tone: LlmModelBadgeTone
549
+ }
550
+ ```
551
+
532
552
  ```ts type-equiv
533
553
  /** One adapter-discovered model; catalog membership is advisory, not request validation. */
534
554
  interface LlmModelInfo {
@@ -542,6 +562,11 @@ interface LlmModelInfo {
542
562
  description?: string
543
563
  /** Accepted request modalities; absent means unknown, while an explicit omission is negative capability. */
544
564
  inputModalities?: readonly ModelModality[]
565
+ /**
566
+ * Selector label advertised by catalog discovery; exact-route resolution
567
+ * omits it, and no model request or Session event carries it.
568
+ */
569
+ badge?: LlmModelBadge
545
570
  }
546
571
  ```
547
572
 
@@ -621,8 +646,21 @@ type RequestMessage = Message | RequestUserInput
621
646
  ```
622
647
 
623
648
  ```ts type-equiv
624
- /** A single model request, fully assembled. */
625
- interface GenerateOptions {
649
+ /** Auxiliary request purposes declared by their producer packages. */
650
+ interface LlmRequestPurposeMap {}
651
+ ```
652
+
653
+ ```ts type-equiv
654
+ /** Declared auxiliary request purpose; ordinary conversation requests leave it absent. */
655
+ type LlmRequestPurpose = Extract<keyof LlmRequestPurposeMap, string>
656
+ ```
657
+
658
+ ```ts type-equiv
659
+ /**
660
+ * A single model request, fully assembled.
661
+ * @typeParam Purpose - declared purpose keys for callers; forwarding adapters may accept `string`.
662
+ */
663
+ interface GenerateOptions<Purpose extends string = LlmRequestPurpose> {
626
664
  /** Registered provider route selecting the adapter instance. */
627
665
  provider: string
628
666
  model: string
@@ -663,7 +701,7 @@ interface GenerateOptions {
663
701
  * map the purpose to model-hidden transport metadata. Ordinary conversation
664
702
  * requests leave it unset.
665
703
  */
666
- purpose?: 'compaction' | 'session-title'
704
+ purpose?: Purpose
667
705
  }
668
706
  ```
669
707
 
@@ -764,7 +802,7 @@ interface LlmDiscoveredModel {
764
802
 
765
803
  The loop builds each request from logged state. `EpochHeader` records call config, marks the fields supplied by adapter defaults, and records the authoritative returned tool order (configured by `toolOrder`, or lexicographic when unset) through full `request/header` snapshots. The rendered prompt is derived history — the `system/message` at surface node 0, plus any later system node an `in-history` route appended — so the header and the derived history together make the request reconstructable from the session log. See [session.md](./session.md#the-request-header-event-requestheader) and the [reconstructability Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.md).
766
804
 
767
- `agent/request` receives a frozen call-config seed and may return a replacement to switch provider, model, reasoning effort, or sampling. Before the waterfall, the loop removes values marked as adapter defaults so exact-model preparation materializes the selected route's current values; unmarked explicit settings remain in the proposal. After the waterfall, preparation rejects unsupported explicit effort ids without clamping and logs the effective config plus the fields supplied by adapter defaults under the turn signal. On step admission, this waterfall and preparation run after assembly and `step/start` but before the system prompt and accepted user batch are committed; cancellation during either commits neither. The prepared capability governs prompt reconciliation, and the call keeps one adapter registration through dispatch. Requests reaching `llm/stream` are deep-frozen, so mutation throws, and carry a process-local loop identity so observers do not confuse separately logged frozen auxiliary calls with conversation requests.
805
+ The deprecated `agent/request` hook remains available to existing listeners. New code selects models and reasoning effort through [Session model selection](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent/README.md#use-this-package). The hook receives a frozen call-config seed based on the step's captured model selection and may replace controls such as sampling. A replacement must preserve provider, model, and the optional explicit reasoning effort; record a new Session selection before the next step to change them. Before the waterfall, the loop removes values marked as adapter defaults so exact-model preparation materializes the selected route's current values; unmarked explicit settings remain in the proposal. After the waterfall, preparation rejects unsupported explicit effort ids without clamping and logs the effective config plus the fields supplied by adapter defaults under the turn signal. On step admission, this waterfall and preparation run after assembly and `step/start` but before the system prompt and accepted user batch are committed; cancellation during either commits neither. The prepared capability governs prompt reconciliation, and the call keeps one adapter registration through dispatch. Requests reaching `llm/stream` are deep-frozen, so mutation throws, and carry a process-local loop identity so observers do not confuse separately logged frozen auxiliary calls with conversation requests.
768
806
 
769
807
  On the wire, a loop-built request is the derived history alone: the rendered prompt travels as the leading `system`-role message (surface node 0, a `system/message` event) and, when the prepared call declares `systemPromptUpdate: 'in-history'`, a non-empty changed prompt may follow the cached history as a later `system`-role message that the model reads as the effective prompt; the request's `system` field is unset — `GenerateOptions.system` serves direct one-shot callers such as title providers. An empty rendering leaves no system messages in derived history, even when earlier requests retained several prompt versions. The logged request ends with the newest `user/message` on a turn's first step and the previous step's tool results on later steps.
770
808
 
@@ -826,6 +864,10 @@ interface LlmCallConfigAdapterDefaults {
826
864
 
827
865
  The [wire reference](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/deepseek-llm-api-wire-extensions.md) defines the exact request headers, extension transaction, field versions, and receiver obligations. The shipped composition registers [`dsh_session_log`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-log-deepseek/README.md) as a lossless incremental canonical-log suffix and [`dsh_plugin_packages`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/plugin-package-inventory-deepseek/README.md) as the complete active Loader-backed package set. These fields remain outside model messages and are absent from the pi-ai adapter path.
828
866
 
867
+ ## Pi-ai request headers
868
+
869
+ `PiAiRequestHeaderContext` contains the prepared call's provider, model, resolved model `baseURL`, and optional Session id and auxiliary purpose. It is immutable, contains no messages or authentication fields, and accompanies a request-owned `Headers` object in the synchronous `llm-pi-ai/request-headers` waterfall. The [adapter's request-header documentation](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-pi-ai/README.md#request-headers) defines contribution ownership, attribution precedence, and failure behavior. This extension point is specific to pi-ai inference requests.
870
+
829
871
  ## Service and provider contracts
830
872
 
831
873
  `LlmAdapter` is the provider contract: subclass, implement `stream()`, and register one adapter instance with `ctx.llm.registerAdapter(providers, adapter)`. `GenerateOptions.provider` selects the registered adapter; `GenerateOptions.model` is passed to that adapter and need not be registered at lifecycle start. Duplicate provider routes fail atomically. Optional `providerRetryPolicy()` is captured per route with normal defaults, while `providerInfo()` and asynchronous `listModels()` feed `LlmRuntime.listProviders()` / `listModels()` with detached selector metadata. That catalog is advisory rather than a request whitelist: the adapter remains authoritative and may accept unlisted model ids. One asynchronous `resolveModel()` query returns exact model identity plus optional correctness-sensitive context capacity, an adapter-configured `defaultMaxTokens`, and ordered model-owned reasoning ids with an optional deployment default; absent fields mean unavailable metadata or provider-owned behavior, not invalid catalog membership. The resolver receives optional cancellation and must settle promptly after abort. `LlmRuntime.resolveModelInfo()` validates and detaches the aggregate. At the final adapter boundary, `resolveCallConfig()` materializes the output default only when `maxTokens` is absent and validates and materializes reasoning, so direct calls cannot bypass either configured behavior; direct dispatch captures one registration before awaiting that resolution. The agent loop instead uses `prepareCall()` to keep the same registration across model resolution, durable header logging, and dispatch, retain detached context metadata from that exact lookup, and report which config fields the adapter defaulted. Adapter lookup happens at the terminal continuation of the `llm/stream` waterfall, so a listener may short-circuit the call or route a mutable one-shot request before lookup. AgentLoop observes a request attempt once the outer waterfall returns a stream handle; that limited boundary does not prove a lazy terminal adapter was constructed or began provider I/O. The `block-start` / `block-end` `index` correlation and the assembler together mean an adapter only has to emit well-formed chunks — block reassembly is not each adapter's problem. [architecture.md](../index.md#turn-flow) shows where `ctx.llm.stream()` and the `llm/stream` waterfall sit in one turn.
@@ -1174,6 +1216,23 @@ The provider topology changed: an adapter registered or unregistered routes, or
1174
1216
 
1175
1217
  Source: [`packages/llm/llm/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/types.ts)
1176
1218
 
1219
+ <a id="llmmodels-updated--emit"></a>
1220
+
1221
+ #### `llm/models-updated` — emit
1222
+
1223
+ A provider's advertised models or display metadata changed; consumers reload `listModels()`.
1224
+
1225
+ ```ts cordis-catalog
1226
+ /**
1227
+ * A provider's advertised models or display metadata changed; consumers reload `listModels()`.
1228
+ * @mode emit
1229
+ * @param provider - route whose model catalog changed.
1230
+ */
1231
+ 'llm/models-updated'(provider: string): void
1232
+ ```
1233
+
1234
+ Source: [`packages/llm/llm/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/types.ts)
1235
+
1177
1236
  <a id="llmstream--waterfall"></a>
1178
1237
 
1179
1238
  #### `llm/stream` — waterfall
@@ -1197,4 +1256,33 @@ Waterfall around every streaming model call (retry, replay, routing). Bound to t
1197
1256
  ```
1198
1257
 
1199
1258
  Source: [`packages/llm/llm/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/index.ts)
1259
+
1260
+ <a id="llm-pi-ai-events"></a>
1261
+
1262
+ ### `llm-pi-ai/*` events
1263
+
1264
+ <a id="llm-pi-airequest-headers--waterfall"></a>
1265
+
1266
+ #### `llm-pi-ai/request-headers` — waterfall
1267
+
1268
+ Prepare headers for one pi-ai inference call, excluding model discovery. Listeners run synchronously and must call next(); they may edit only the request-owned headers and must not retain them. Throws fail the call with REQUEST_HEADERS before inference I/O. Harness attribution wins afterward. Non-TypeError messages are user-visible and must exclude secrets. TypeError details and non-Error values are replaced with safe guidance.
1269
+
1270
+ ```ts cordis-catalog
1271
+ /**
1272
+ * Prepare headers for one pi-ai inference call, excluding model discovery.
1273
+ * Listeners run synchronously and must call next(); they may edit only the
1274
+ * request-owned headers and must not retain them. Throws fail the call with
1275
+ * REQUEST_HEADERS before inference I/O. Harness attribution wins afterward.
1276
+ * Non-TypeError messages are user-visible and must exclude secrets. TypeError
1277
+ * details and non-Error values are replaced with safe guidance.
1278
+ * @mode waterfall
1279
+ * @param request - immutable routing metadata from the exact prepared call.
1280
+ * @param headers - fresh profile headers, shared only within this dispatch.
1281
+ * @param next - continue header preparation through the remaining listeners.
1282
+ * @returns headers passed to pi-ai after Harness attribution is applied.
1283
+ */
1284
+ 'llm-pi-ai/request-headers'(request: PiAiRequestHeaderContext, headers: Headers, next: () => Headers): Headers
1285
+ ```
1286
+
1287
+ Source: [`packages/llm/llm-pi-ai/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-pi-ai/src/index.ts)
1200
1288
  <!-- END GENERATED cordis-surface -->
@@ -117,16 +117,16 @@ Repair therefore writes only under write ownership: a live session's write handl
117
117
 
118
118
  Read-only observation is `open(id, 'read')`: the handle serves validated contiguous prefix slices, never a torn tail, and repeated reads on one handle never observe an older state than a prior read. There is no persistence-side prepared-Session cache: session-query owns its cold-read cache, keying one balanced cold Session per id on the `stat().revision` change token and re-reading only when the token changes. The [handle-based persistence Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.md) owns this lifecycle; the archived [Session preparation record](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/archived/architecture/2026-08-05-session-preparation.md) documents the original publication-boundary `SessionPreparation` decision.
119
119
 
120
- ## `SessionLocation` — refusal-diagnostics artifact target
120
+ ## `SessionLocation` — per-Session artifact metadata
121
121
 
122
- `SessionLocation` is not a consumer-facing query: log access goes through a session handle's `read`. It survives only as refusal diagnostics, letting a `SessionFormatUnsupportedError` name the raw log a build refused to interpret. JSONL supplies the absolute transcript path inside its project/session directory; a backend without one artifact per session supplies nothing.
122
+ `SessionLocation` is observational metadata for diagnostics and export; log access still goes through a session handle's `read`. Materialized persistence snapshots carry the selected artifact path, and a `SessionFormatUnsupportedError` can name the raw log a build refused to interpret. JSONL supplies the absolute transcript path inside its project/session directory; a backend without one artifact per session supplies nothing.
123
123
 
124
124
  ```ts type-equiv
125
125
  /**
126
- * A backend-resolved, per-session local artifact location. Carried only by
127
- * refusal diagnostics ({@link SessionFormatUnsupportedError}) so a user can
128
- * find the raw log a build refused to interpret; it is not a consumer-facing
129
- * query — log access goes through a session handle's `read`.
126
+ * A backend-resolved, per-Session local artifact path used by observational
127
+ * snapshots and refusal diagnostics. It names a backend target for the Session
128
+ * and does not authorize reads; log access still goes through a session
129
+ * handle's `read`. It is not persisted Session content.
130
130
  */
131
131
  interface SessionLocation {
132
132
  /** Backend-specific artifact kind, for example `jsonl`. */
@@ -160,7 +160,11 @@ interface SessionHeader {
160
160
  readonly createdAt: number
161
161
  /** Absolute working directory the session was created in (if any). */
162
162
  readonly cwd?: string
163
- /** The session this one was forked from (seed lineage), if any. */
163
+ /**
164
+ * Direct creator of a subagent Session. Ordinary forks omit this field;
165
+ * historical ordinary forks may retain their source id here. Presence alone
166
+ * does not classify a Session as a subagent; use `origin` for that distinction.
167
+ */
164
168
  readonly parentSession?: SessionId
165
169
  /**
166
170
  * Whether this Session contains a fork-inherited event prefix. The exact prefix
@@ -323,6 +327,12 @@ interface SessionPersistenceSnapshot {
323
327
  readonly eventCount?: number
324
328
  /** Physical artifact byte size, when the backend can provide it cheaply (JSONL); otherwise absent. */
325
329
  readonly sizeBytes?: number
330
+ /**
331
+ * Backend-resolved location of the selected materialized per-Session
332
+ * artifact, for diagnostics and export. Absent when the backend has no
333
+ * materialized per-Session file, including an unmaterialized pending Session.
334
+ */
335
+ readonly location?: SessionLocation
326
336
  }
327
337
  ```
328
338
 
@@ -12,7 +12,7 @@ Source: [`packages/plan/plan-mode/src/index.ts`](https://github.com/deepseek-ai/
12
12
 
13
13
  ## Logged state and recovery
14
14
 
15
- `plan/mode` (`{ active: boolean }`) is a log-only, whole-value-replace [session event](./session.md): durable and replayable, never in the model transcript. The optionally registered `plan` unit folds committed mode, command settlement, and the mode recorded at the latest request header. `ctx.planMode` reads that state through `stateOf()`; the first dependent access fails if the registry, `plan` key, or `turnBoundary` key is absent. Clients receive only `{ active, pending }`; resume, fork, and compaction recover both from the log. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md).
15
+ `plan/mode` (`{ active: boolean }`) is a log-only, whole-value-replace [session event](./session.md): durable and replayable, never in the model transcript. The `plan` unit folds committed mode, command settlement, and the mode recorded at the latest request header. `ctx.planMode` requires the registry and awaits registration of `plan` and `turnBoundary` during activation, then reads through their retained handles. Clients receive only `{ active, pending }`; resume, fork, and compaction recover both from the log. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md).
16
16
 
17
17
  ## Pending selections and the pre-step append
18
18
 
@@ -34,13 +34,13 @@ A missing, blank, or non-string `section` and any unknown key fail at plugin loa
34
34
 
35
35
  ## The exit tool and the `/plan` command
36
36
 
37
- [`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) stays registered while plan mode is inactive, so entering or leaving plan mode changes only the prompt section, never the request tool catalog; execution outside plan mode fails. In plan mode it requires a complete markdown plan starting with a `#` heading and presents it for review through the [user-questions seam](./user-questions.md). Approval returns `{ approved: true }` and records a silent (non-narrated) pending exit that is appended at the next accepted in-turn pre-step. Plan guidance therefore remains active for the rest of the assistant's current tool batch, and the tool result itself reports the transition. Keep-planning is a failed call carrying the user's feedback, so the model revises and presents again. A dismissed review returns `{ approved: false }` and concludes the turn, so plan mode stays active until the user's next message. A missing interaction channel and a service reload during review also fail the call rather than silently leaving plan mode.
37
+ [`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) is disclosed progressively: it is admitted from the first step whose selected plan state is active and stays admitted for the rest of the Session, so the first plan-mode entry adds it to the request tool declarations and later transitions change only the plan guidance. Native and PTC execution use the same admitted set; a call before the first entry returns `UNKNOWN_TOOL`, and a call while plan mode is not committed fails. In plan mode it requires a complete markdown plan starting with a `#` heading and presents it for review through the [user-questions seam](./user-questions.md). Approval returns `{ approved: true }` and records a silent (non-narrated) pending exit that is appended at the next accepted in-turn pre-step. Plan guidance therefore remains active for the rest of the assistant's current tool batch, and the tool result itself reports the transition. Keep-planning is a failed call carrying the user's feedback, so the model revises and presents again. A dismissed review returns `{ approved: false }` and concludes the turn, so plan mode stays active until the user's next message. A missing interaction channel and a service reload during review also fail the call rather than silently leaving plan mode.
38
38
 
39
39
  When [`ctx.commands`](./commands.md) is composed, the plugin registers `/plan [off|message]`: bare `/plan` selects plan mode, any other non-empty message selects it and then submits the text through `agent.steer()` so it becomes the next step's ordinary logged user message under plan guidance, and the exact argument `off` selects inactive, which also cancels a pending entry before it is appended and becomes visible to a request.
40
40
 
41
41
  ## The service
42
42
 
43
- `ctx.planMode` owns the logged plan state, applies and narrates selected state at step start, and owns the `plan:policy` section, the `/plan` command, and the stable exit tool; `get`/`set` signatures are in the generated [service catalog](#ctxplanmode--planmodecontroller).
43
+ `ctx.planMode` owns the logged plan state, applies and narrates selected state at step start, and owns the `plan:policy` section, the `/plan` command, and the conditional exit tool; `get`/`set` signatures are in the generated [service catalog](#ctxplanmode--planmodecontroller).
44
44
 
45
45
  <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
46
46
 
@@ -54,7 +54,7 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
54
54
 
55
55
  ### `ctx.planMode` — `PlanModeController`
56
56
 
57
- `ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool. Client carriers expose the projection's cropped `{ active, pending }` view.
57
+ `ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the conditional exit tool. Client carriers expose the projection's cropped `{ active, pending }` view. Agent prompt assembly fails while the projection reader is not ready; callers must await plugin activation before running an agent.
58
58
 
59
59
  ```ts cordis-catalog
60
60
  /**
@@ -23,9 +23,11 @@ interface PtcRunRequest {
23
23
  /**
24
24
  * The program source, in the runtime's {@link ../index.ts | language}. It
25
25
  * follows the provider's programFormat: an async function body supports
26
- * top-level `await` and `return`; a REPL supports top-level declarations,
27
- * `await`, and a final expression. The completion value becomes
28
- * {@link PtcRunResult.value}.
26
+ * top-level `await` and `return`; REPL and Script programs support top-level
27
+ * declarations, `await`, and a final expression, but not top-level `return`.
28
+ * The Script provider lowers top-level await; its executionInstructions and
29
+ * documentation define retained-binding semantics. The completion value
30
+ * becomes {@link PtcRunResult.value}.
29
31
  */
30
32
  program: string
31
33
  /**
@@ -88,7 +90,7 @@ interface PtcRunResult {
88
90
  /** Applied file policy and observed denial, when the provider enforces file policy. */
89
91
  sandbox?: PtcRunSandbox
90
92
  /**
91
- * The program's completion value (a return or final REPL expression), when it ran to
93
+ * The program's completion value (a return or final REPL/Script expression), when it ran to
92
94
  * completion and the value crossed the runtime's lossless-JSON boundary.
93
95
  * Invalid or over-limit completions fail the run instead of substituting a
94
96
  * rendered string; a failed or value-less run leaves this absent.
@@ -105,7 +107,12 @@ interface PtcRunResult {
105
107
  }
106
108
  ```
107
109
 
108
- `programFormat` distinguishes async function bodies from REPL statements. `stateOwner` is an in-process object identity for optional retained memory; distinct objects remain isolated. Consumers await `release(owner)` when that owner ends; cleanup failures reject that call. Omitted owners are one-shot, and stateless providers ignore ownership. The [persistent Node provider](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/ptc-runtime/ptc-runtime-node/README.md#persistent-repl) defines reset and recovery behavior; no retained object enters the durable Session format.
110
+ ```ts type-equiv
111
+ /** Source evaluation form, independent of retained program state. */
112
+ type PtcProgramFormat = 'function-body' | 'repl' | 'script'
113
+ ```
114
+
115
+ `programFormat` distinguishes async function bodies, REPL statements, and scripts. REPL and Script programs accept top-level `await`, declarations, and a final expression; top-level `return` is not supported. The Node Script provider lowers top-level await and awaits the completion value; its [declaration limitations](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/ptc-runtime/ptc-runtime-node/README.md#known-limitations-and-deferred-work) apply to transformed programs. `retainsState` reports memory retention independently of source syntax. `stateOwner` is an in-process object identity for optional retained memory; distinct objects remain isolated. Consumers await `release(owner)` when that owner ends; cleanup failures reject that call. Omitted owners are one-shot, and stateless providers ignore ownership. The [persistent Node provider](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/ptc-runtime/ptc-runtime-node/README.md#persistent-repl) defines reset and recovery behavior; no retained object enters the durable Session format.
109
116
 
110
117
  ## Bindings: host functions as program globals
111
118