@songtonyli/dsh-cli 0.1.94 → 0.1.95

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 (565) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@deepseek-ai/cordis/package.json +4 -4
  4. package/node_modules/@deepseek-ai/cordis-plugin-group/package.json +3 -3
  5. package/node_modules/@deepseek-ai/cordis-plugin-include/package.json +4 -4
  6. package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +4 -4
  7. package/node_modules/@deepseek-ai/cordis-plugin-timer/package.json +3 -3
  8. package/node_modules/@deepseek-ai/cosmokit/package.json +1 -1
  9. package/node_modules/@deepseek-ai/dsh/package.json +126 -126
  10. package/node_modules/@deepseek-ai/dsh-acp/package.json +26 -26
  11. package/node_modules/@deepseek-ai/dsh-acp-app/package.json +6 -6
  12. package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +7 -3
  13. package/node_modules/@deepseek-ai/dsh-action-cards/package.json +19 -19
  14. package/node_modules/@deepseek-ai/dsh-agent/package.json +21 -21
  15. package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +10 -10
  16. package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +28 -28
  17. package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +27 -27
  18. package/node_modules/@deepseek-ai/dsh-agent-preset/package.json +13 -13
  19. package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +2 -2
  20. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +7 -3
  21. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +39 -39
  22. package/node_modules/@deepseek-ai/dsh-agent-team/README.i18n.yaml +12 -12
  23. package/node_modules/@deepseek-ai/dsh-agent-team/README.md +6 -6
  24. package/node_modules/@deepseek-ai/dsh-agent-team/README.zh.md +6 -6
  25. package/node_modules/@deepseek-ai/dsh-agent-team/lib/index.js +25 -11
  26. package/node_modules/@deepseek-ai/dsh-agent-team/lib/typert.host.js +8 -4
  27. package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/projection.js +6 -1
  28. package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/task-board.js +12 -8
  29. package/node_modules/@deepseek-ai/dsh-agent-team/lib/types/task-view.js +2 -1
  30. package/node_modules/@deepseek-ai/dsh-agent-team/package.json +25 -25
  31. package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +13 -13
  32. package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +7 -7
  33. package/node_modules/@deepseek-ai/dsh-api-account-controller/package.json +9 -9
  34. package/node_modules/@deepseek-ai/dsh-api-authorization-controller/package.json +13 -13
  35. package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +14 -14
  36. package/node_modules/@deepseek-ai/dsh-api-job-controller/package.json +12 -12
  37. package/node_modules/@deepseek-ai/dsh-api-remote-access/package.json +9 -9
  38. package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +67 -47
  39. package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +48 -48
  40. package/node_modules/@deepseek-ai/dsh-api-session-controller/README.i18n.yaml +6 -6
  41. package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +6 -1
  42. package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +6 -1
  43. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +19 -5
  44. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +52 -18
  45. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +69 -41
  46. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +51 -31
  47. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/service.js +20 -5
  48. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +58 -18
  49. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/continuation.js +48 -0
  50. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +5 -2
  51. package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +79 -77
  52. package/node_modules/@deepseek-ai/dsh-api-settings-controller/package.json +16 -16
  53. package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +7 -3
  54. package/node_modules/@deepseek-ai/dsh-api-terminal-controller/package.json +22 -22
  55. package/node_modules/@deepseek-ai/dsh-api-workspace-controller/package.json +21 -21
  56. package/node_modules/@deepseek-ai/dsh-api-workspace-files/package.json +15 -15
  57. package/node_modules/@deepseek-ai/dsh-app-boot/package.json +19 -19
  58. package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +3 -3
  59. package/node_modules/@deepseek-ai/dsh-attachment/package.json +5 -5
  60. package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +9 -9
  61. package/node_modules/@deepseek-ai/dsh-authorization/package.json +7 -7
  62. package/node_modules/@deepseek-ai/dsh-base/README.i18n.yaml +2 -2
  63. package/node_modules/@deepseek-ai/dsh-base/README.md +1 -1
  64. package/node_modules/@deepseek-ai/dsh-base/README.zh.md +1 -1
  65. package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +3 -0
  66. package/node_modules/@deepseek-ai/dsh-base/package.json +103 -102
  67. package/node_modules/@deepseek-ai/dsh-bash-local/package.json +11 -11
  68. package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +14 -14
  69. package/node_modules/@deepseek-ai/dsh-brand/package.json +3 -3
  70. package/node_modules/@deepseek-ai/dsh-chunked-list/package.json +3 -3
  71. package/node_modules/@deepseek-ai/dsh-client-connection/package.json +13 -13
  72. package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +7 -3
  73. package/node_modules/@deepseek-ai/dsh-client-file-upload/package.json +12 -12
  74. package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +7 -7
  75. package/node_modules/@deepseek-ai/dsh-client-locale/package.json +10 -10
  76. package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +1 -1
  77. package/node_modules/@deepseek-ai/dsh-client-modules/package.json +6 -6
  78. package/node_modules/@deepseek-ai/dsh-client-product-analytics/package.json +16 -16
  79. package/node_modules/@deepseek-ai/dsh-client-resources/package.json +5 -5
  80. package/node_modules/@deepseek-ai/dsh-client-shortcuts/package.json +9 -9
  81. package/node_modules/@deepseek-ai/dsh-client-ui-action-cards/package.json +15 -15
  82. package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +17 -17
  83. package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/README.i18n.yaml +2 -2
  84. package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/README.md +1 -1
  85. package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/README.zh.md +1 -1
  86. package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/lib/client.js +1 -1
  87. package/node_modules/@deepseek-ai/dsh-client-ui-agent-team/package.json +17 -17
  88. package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.i18n.yaml +2 -2
  89. package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.md +2 -0
  90. package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.zh.md +2 -0
  91. package/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js +125 -5
  92. package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +14 -13
  93. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +12 -12
  94. package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.i18n.yaml +19 -16
  95. package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.md +16 -7
  96. package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.zh.md +16 -7
  97. package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/assets/breach-atlas-43c5305a3d4d.webp +0 -0
  98. package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/lib/client.js +395 -3
  99. package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +13 -9
  100. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +6 -6
  101. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +4 -2
  102. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +4 -2
  103. package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +60 -37
  104. package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +40 -40
  105. package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +14 -14
  106. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.i18n.yaml +2 -2
  107. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.md +2 -0
  108. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.zh.md +2 -0
  109. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/client.js +164 -40
  110. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/package.json +10 -10
  111. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +18 -9
  112. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +24 -4
  113. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +24 -4
  114. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +205 -56
  115. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/index.js +1 -1
  116. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +37 -36
  117. package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +13 -13
  118. package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/package.json +10 -10
  119. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +28 -28
  120. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +7 -7
  121. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +6 -6
  122. package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/package.json +11 -11
  123. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/package.json +10 -10
  124. package/node_modules/@deepseek-ai/dsh-client-ui-file-drag/package.json +7 -7
  125. package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
  126. package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +14 -14
  127. package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +11 -11
  128. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.i18n.yaml +2 -2
  129. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.md +1 -1
  130. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.zh.md +1 -1
  131. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +4 -19
  132. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +10 -10
  133. package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +9 -9
  134. package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +15 -15
  135. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.i18n.yaml +4 -4
  136. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +2 -2
  137. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +2 -2
  138. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +4 -18
  139. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +16 -16
  140. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +14 -14
  141. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +12 -10
  142. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +12 -10
  143. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +65 -58
  144. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/locale/zh.json +1 -1
  145. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +26 -26
  146. package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +14 -14
  147. package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +19 -19
  148. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +2 -2
  149. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +1 -1
  150. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +1 -1
  151. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +6 -17
  152. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/package.json +18 -18
  153. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/package.json +12 -12
  154. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-recommendations/package.json +13 -13
  155. package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +16 -16
  156. package/node_modules/@deepseek-ai/dsh-client-ui-renderer/lib/client.js +175 -20
  157. package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +3 -3
  158. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.i18n.yaml +2 -2
  159. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.md +1 -1
  160. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.zh.md +1 -1
  161. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +27 -65
  162. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +21 -21
  163. package/node_modules/@deepseek-ai/dsh-client-ui-secret-mask/package.json +6 -6
  164. package/node_modules/@deepseek-ai/dsh-client-ui-session/package.json +9 -9
  165. package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +7 -7
  166. package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  167. package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/package.json +17 -17
  168. package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/package.json +8 -8
  169. package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  170. package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +17 -17
  171. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +11 -11
  172. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +11 -11
  173. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +7 -7
  174. package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/package.json +8 -8
  175. package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/package.json +8 -8
  176. package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/package.json +6 -6
  177. package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/package.json +8 -8
  178. package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +9 -9
  179. package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/package.json +9 -9
  180. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  181. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +11 -11
  182. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/package.json +10 -10
  183. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.i18n.yaml +4 -4
  184. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +2 -2
  185. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +2 -2
  186. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +6 -15
  187. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.pdf.js +11 -3
  188. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +21 -21
  189. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +14 -14
  190. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +15 -15
  191. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json +14 -14
  192. package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +16 -16
  193. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.i18n.yaml +6 -6
  194. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.md +4 -4
  195. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.zh.md +4 -4
  196. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +12 -12
  197. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +18 -18
  198. package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +12 -12
  199. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +6 -6
  200. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +6 -6
  201. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +6 -6
  202. package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +285 -14
  203. package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +32 -31
  204. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +20 -20
  205. package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +22 -22
  206. package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +13 -13
  207. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +4 -4
  208. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +2 -2
  209. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +2 -2
  210. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +35 -73
  211. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +26 -26
  212. package/node_modules/@deepseek-ai/dsh-cmdline/package.json +6 -6
  213. package/node_modules/@deepseek-ai/dsh-command-compact/package.json +12 -12
  214. package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +15 -15
  215. package/node_modules/@deepseek-ai/dsh-command-goal/package.json +14 -14
  216. package/node_modules/@deepseek-ai/dsh-commands/README.i18n.yaml +4 -4
  217. package/node_modules/@deepseek-ai/dsh-commands/README.md +2 -2
  218. package/node_modules/@deepseek-ai/dsh-commands/README.zh.md +2 -2
  219. package/node_modules/@deepseek-ai/dsh-commands/lib/index.js +37 -2
  220. package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +28 -5
  221. package/node_modules/@deepseek-ai/dsh-commands/lib/typert.remote-client.js +2 -2
  222. package/node_modules/@deepseek-ai/dsh-commands/lib/types/index.js +36 -2
  223. package/node_modules/@deepseek-ai/dsh-commands/package.json +18 -18
  224. package/node_modules/@deepseek-ai/dsh-compaction/package.json +11 -11
  225. package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +27 -27
  226. package/node_modules/@deepseek-ai/dsh-compaction-image-offload/package.json +18 -18
  227. package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +17 -17
  228. package/node_modules/@deepseek-ai/dsh-computer-use/package.json +5 -5
  229. package/node_modules/@deepseek-ai/dsh-config-editor/package.json +12 -12
  230. package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +83 -39
  231. package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +10 -10
  232. package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +14 -6
  233. package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +23 -23
  234. package/node_modules/@deepseek-ai/dsh-creation-recommendations/package.json +21 -21
  235. package/node_modules/@deepseek-ai/dsh-credentials/package.json +4 -4
  236. package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +12 -12
  237. package/node_modules/@deepseek-ai/dsh-cua/README.i18n.yaml +2 -2
  238. package/node_modules/@deepseek-ai/dsh-cua/README.md +2 -0
  239. package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +2 -0
  240. package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +30 -1
  241. package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +16 -16
  242. package/node_modules/@deepseek-ai/dsh-cua/package.json +53 -53
  243. package/node_modules/@deepseek-ai/dsh-cua-bundle/package.json +7 -7
  244. package/node_modules/@deepseek-ai/dsh-deepseek-account/package.json +11 -11
  245. package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/package.json +12 -12
  246. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/package.json +3 -3
  247. package/node_modules/@deepseek-ai/dsh-deliverable-file-references/package.json +5 -5
  248. package/node_modules/@deepseek-ai/dsh-deque/package.json +3 -3
  249. package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/package.json +8 -8
  250. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +45 -45
  251. package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/package.json +4 -4
  252. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/package.json +20 -20
  253. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.i18n.yaml +8 -8
  254. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +9 -7
  255. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +9 -7
  256. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +779 -137
  257. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +142 -10
  258. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +131 -29
  259. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +103 -24
  260. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/package.json +42 -42
  261. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/package.json +19 -19
  262. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/package.json +15 -15
  263. package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/package.json +6 -6
  264. package/node_modules/@deepseek-ai/dsh-experimental-forge/package.json +6 -6
  265. package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/package.json +9 -9
  266. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +10 -10
  267. package/node_modules/@deepseek-ai/dsh-experimental-forge-session/package.json +33 -33
  268. package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.i18n.yaml +2 -2
  269. package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.md +1 -1
  270. package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.zh.md +1 -1
  271. package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/client.js +150 -136
  272. package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/index.js +200 -186
  273. package/node_modules/@deepseek-ai/dsh-experimental-inspector/package.json +17 -17
  274. package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/package.json +7 -7
  275. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.i18n.yaml +6 -6
  276. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.md +6 -4
  277. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.zh.md +6 -4
  278. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +72 -72
  279. package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/package.json +4 -4
  280. package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/package.json +5 -5
  281. package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/package.json +5 -5
  282. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/README.i18n.yaml +2 -2
  283. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/README.md +1 -1
  284. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/README.zh.md +1 -1
  285. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/lib/client.js +6 -16
  286. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/package.json +12 -12
  287. package/node_modules/@deepseek-ai/dsh-experimental-session-search/package.json +5 -5
  288. package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/package.json +4 -4
  289. package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/package.json +11 -11
  290. package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/package.json +10 -10
  291. package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/package.json +6 -6
  292. package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/package.json +23 -23
  293. package/node_modules/@deepseek-ai/dsh-experimental-translator/package.json +29 -29
  294. package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/package.json +8 -8
  295. package/node_modules/@deepseek-ai/dsh-experimental-worktree/package.json +23 -23
  296. package/node_modules/@deepseek-ai/dsh-file-reference/package.json +5 -5
  297. package/node_modules/@deepseek-ai/dsh-file-reference-local/package.json +17 -17
  298. package/node_modules/@deepseek-ai/dsh-fs/package.json +10 -10
  299. package/node_modules/@deepseek-ai/dsh-fs-local/package.json +8 -8
  300. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +6 -6
  301. package/node_modules/@deepseek-ai/dsh-fs-patch/package.json +3 -3
  302. package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +12 -12
  303. package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +7 -3
  304. package/node_modules/@deepseek-ai/dsh-goal/package.json +23 -23
  305. package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +17 -17
  306. package/node_modules/@deepseek-ai/dsh-harness-dev-context/package.json +13 -13
  307. package/node_modules/@deepseek-ai/dsh-headless/package.json +30 -30
  308. package/node_modules/@deepseek-ai/dsh-hmr/package.json +15 -15
  309. package/node_modules/@deepseek-ai/dsh-home-paths/package.json +3 -3
  310. package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +3 -3
  311. package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +20 -20
  312. package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +5 -5
  313. package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +5 -5
  314. package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +10 -10
  315. package/node_modules/@deepseek-ai/dsh-host-open-in-app/package.json +9 -9
  316. package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +13 -13
  317. package/node_modules/@deepseek-ai/dsh-host-product-telemetry-otel/package.json +8 -8
  318. package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +5 -5
  319. package/node_modules/@deepseek-ai/dsh-http-proxy/package.json +3 -3
  320. package/node_modules/@deepseek-ai/dsh-jobs/package.json +11 -11
  321. package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +16 -16
  322. package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +3 -3
  323. package/node_modules/@deepseek-ai/dsh-lazy-require/package.json +3 -3
  324. package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +5 -1
  325. package/node_modules/@deepseek-ai/dsh-llm/package.json +11 -11
  326. package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +25 -25
  327. package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +45 -45
  328. package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/package.json +17 -17
  329. package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +14 -14
  330. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +28 -28
  331. package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +25 -25
  332. package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +26 -26
  333. package/node_modules/@deepseek-ai/dsh-mcp-manager/package.json +22 -22
  334. package/node_modules/@deepseek-ai/dsh-mcp-resources/package.json +16 -16
  335. package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +19 -19
  336. package/node_modules/@deepseek-ai/dsh-message-quotes/package.json +9 -9
  337. package/node_modules/@deepseek-ai/dsh-native-command/package.json +4 -4
  338. package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +15 -15
  339. package/node_modules/@deepseek-ai/dsh-office-to-pdf/package.json +11 -11
  340. package/node_modules/@deepseek-ai/dsh-official-bundles/package.json +4 -4
  341. package/node_modules/@deepseek-ai/dsh-otel/package.json +5 -5
  342. package/node_modules/@deepseek-ai/dsh-output-retention/package.json +3 -3
  343. package/node_modules/@deepseek-ai/dsh-package-manifest/package.json +3 -3
  344. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +7 -3
  345. package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +23 -23
  346. package/node_modules/@deepseek-ai/dsh-persona/package.json +7 -7
  347. package/node_modules/@deepseek-ai/dsh-personalized-recommendations/package.json +23 -23
  348. package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +24 -24
  349. package/node_modules/@deepseek-ai/dsh-plugin-detail/package.json +3 -3
  350. package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +38 -38
  351. package/node_modules/@deepseek-ai/dsh-plugin-market/package.json +31 -31
  352. package/node_modules/@deepseek-ai/dsh-plugin-market-index/package.json +4 -4
  353. package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/package.json +19 -19
  354. package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +7 -3
  355. package/node_modules/@deepseek-ai/dsh-plugin-recommendations/package.json +17 -17
  356. package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +5 -5
  357. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +14 -14
  358. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +12 -6
  359. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +12 -6
  360. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +93 -38
  361. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/persistent-process.js +112 -93
  362. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/process.js +112 -93
  363. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +23 -23
  364. package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +11 -11
  365. package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +14 -14
  366. package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +12 -12
  367. package/node_modules/@deepseek-ai/dsh-sandbox/package.json +8 -8
  368. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/package.json +25 -25
  369. package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +12 -12
  370. package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +14 -14
  371. package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +14 -14
  372. package/node_modules/@deepseek-ai/dsh-schedule/package.json +40 -40
  373. package/node_modules/@deepseek-ai/dsh-scope/package.json +3 -3
  374. package/node_modules/@deepseek-ai/dsh-sdk-app/package.json +19 -19
  375. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +48 -48
  376. package/node_modules/@deepseek-ai/dsh-sdk-minimal/cordis.patch.yml +3 -0
  377. package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +40 -39
  378. package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +13 -13
  379. package/node_modules/@deepseek-ai/dsh-session/README.i18n.yaml +2 -2
  380. package/node_modules/@deepseek-ai/dsh-session/README.md +1 -1
  381. package/node_modules/@deepseek-ai/dsh-session/README.zh.md +1 -1
  382. package/node_modules/@deepseek-ai/dsh-session/package.json +10 -10
  383. package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +19 -19
  384. package/node_modules/@deepseek-ai/dsh-session-continuation/README.i18n.yaml +37 -0
  385. package/node_modules/@deepseek-ai/dsh-session-continuation/README.md +84 -0
  386. package/node_modules/@deepseek-ai/dsh-session-continuation/README.zh.md +84 -0
  387. package/node_modules/@deepseek-ai/dsh-session-continuation/lib/index.js +109 -0
  388. package/node_modules/@deepseek-ai/dsh-session-continuation/lib/types/index.js +51 -0
  389. package/node_modules/@deepseek-ai/dsh-session-continuation/lib/types/projection.js +48 -0
  390. package/node_modules/@deepseek-ai/dsh-session-continuation/lib/types/types.js +2 -0
  391. package/node_modules/@deepseek-ai/dsh-session-continuation/package.json +55 -0
  392. package/node_modules/@deepseek-ai/dsh-session-format/package.json +4 -4
  393. package/node_modules/@deepseek-ai/dsh-session-format-catalog/package.json +11 -11
  394. package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/package.json +7 -7
  395. package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/package.json +8 -8
  396. package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/package.json +6 -6
  397. package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.i18n.yaml +2 -2
  398. package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.md +1 -1
  399. package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.zh.md +1 -1
  400. package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/lib/index.js +19 -1
  401. package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/package.json +5 -5
  402. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/package.json +18 -18
  403. package/node_modules/@deepseek-ai/dsh-session-log-export/README.i18n.yaml +10 -10
  404. package/node_modules/@deepseek-ai/dsh-session-log-export/README.md +6 -6
  405. package/node_modules/@deepseek-ai/dsh-session-log-export/README.zh.md +6 -6
  406. package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +100 -120
  407. package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +26 -26
  408. package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +11 -11
  409. package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +19 -1
  410. package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
  411. package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +2 -2
  412. package/node_modules/@deepseek-ai/dsh-session-projection/README.md +1 -1
  413. package/node_modules/@deepseek-ai/dsh-session-projection/README.zh.md +1 -1
  414. package/node_modules/@deepseek-ai/dsh-session-projection/package.json +6 -6
  415. package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +13 -13
  416. package/node_modules/@deepseek-ai/dsh-session-query/package.json +20 -20
  417. package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +13 -13
  418. package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +7 -3
  419. package/node_modules/@deepseek-ai/dsh-session-reference/package.json +41 -41
  420. package/node_modules/@deepseek-ai/dsh-session-stats/package.json +11 -11
  421. package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +7 -7
  422. package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +25 -25
  423. package/node_modules/@deepseek-ai/dsh-session-title/package.json +17 -17
  424. package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/package.json +15 -15
  425. package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +20 -20
  426. package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +13 -13
  427. package/node_modules/@deepseek-ai/dsh-session-turn-outline/package.json +11 -11
  428. package/node_modules/@deepseek-ai/dsh-settings/package.json +17 -17
  429. package/node_modules/@deepseek-ai/dsh-shell/package.json +7 -7
  430. package/node_modules/@deepseek-ai/dsh-shell-env/package.json +14 -14
  431. package/node_modules/@deepseek-ai/dsh-skill/package.json +9 -9
  432. package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +5 -5
  433. package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +10 -10
  434. package/node_modules/@deepseek-ai/dsh-skill-office/package.json +10 -10
  435. package/node_modules/@deepseek-ai/dsh-spill/package.json +9 -9
  436. package/node_modules/@deepseek-ai/dsh-spill-local/package.json +11 -11
  437. package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +35 -35
  438. package/node_modules/@deepseek-ai/dsh-storage/package.json +3 -3
  439. package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +6 -6
  440. package/node_modules/@deepseek-ai/dsh-storage-json/package.json +6 -6
  441. package/node_modules/@deepseek-ai/dsh-subagent/README.i18n.yaml +15 -12
  442. package/node_modules/@deepseek-ai/dsh-subagent/README.md +14 -6
  443. package/node_modules/@deepseek-ai/dsh-subagent/README.zh.md +14 -6
  444. package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +276 -42
  445. package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +31 -9
  446. package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.remote-client.js +2 -2
  447. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/catalog.js +31 -8
  448. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/continuation-messages.js +10 -8
  449. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/index.js +44 -2
  450. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/list-children.js +35 -6
  451. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/manager.js +78 -12
  452. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/names.js +96 -0
  453. package/node_modules/@deepseek-ai/dsh-subagent/package.json +51 -51
  454. package/node_modules/@deepseek-ai/dsh-subagent-acp/README.i18n.yaml +2 -2
  455. package/node_modules/@deepseek-ai/dsh-subagent-acp/README.md +1 -1
  456. package/node_modules/@deepseek-ai/dsh-subagent-acp/README.zh.md +1 -1
  457. package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +24 -24
  458. package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.i18n.yaml +6 -6
  459. package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.md +3 -3
  460. package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.zh.md +3 -3
  461. package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +15 -15
  462. package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.i18n.yaml +4 -4
  463. package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.md +2 -2
  464. package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.zh.md +2 -2
  465. package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +19 -19
  466. package/node_modules/@deepseek-ai/dsh-subprocess/package.json +6 -6
  467. package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +9 -9
  468. package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +8 -8
  469. package/node_modules/@deepseek-ai/dsh-terminal/package.json +8 -8
  470. package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +22 -22
  471. package/node_modules/@deepseek-ai/dsh-time-context/package.json +23 -23
  472. package/node_modules/@deepseek-ai/dsh-timeout/package.json +3 -3
  473. package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +14 -14
  474. package/node_modules/@deepseek-ai/dsh-token-meter/package.json +17 -17
  475. package/node_modules/@deepseek-ai/dsh-tool-agent-team/README.i18n.yaml +8 -8
  476. package/node_modules/@deepseek-ai/dsh-tool-agent-team/README.md +6 -6
  477. package/node_modules/@deepseek-ai/dsh-tool-agent-team/README.zh.md +6 -6
  478. package/node_modules/@deepseek-ai/dsh-tool-agent-team/lib/index.js +26 -17
  479. package/node_modules/@deepseek-ai/dsh-tool-agent-team/package.json +27 -27
  480. package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +13 -13
  481. package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +37 -37
  482. package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +27 -27
  483. package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +10 -10
  484. package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +73 -8
  485. package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +17 -17
  486. package/node_modules/@deepseek-ai/dsh-tool-executor-native/package.json +5 -5
  487. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.i18n.yaml +19 -16
  488. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.md +22 -9
  489. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.zh.md +22 -9
  490. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/index.js +185 -74
  491. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/config.js +2 -1
  492. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/errors.js +25 -0
  493. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/index.js +36 -6
  494. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ptc-calls.js +57 -7
  495. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ptc.js +29 -14
  496. package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/package.json +28 -28
  497. package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +4 -4
  498. package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +2 -2
  499. package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +2 -2
  500. package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +2 -2
  501. package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +39 -39
  502. package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +31 -31
  503. package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +20 -20
  504. package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +19 -19
  505. package/node_modules/@deepseek-ai/dsh-tool-present/package.json +21 -21
  506. package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +35 -35
  507. package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/package.json +28 -28
  508. package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +24 -24
  509. package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +19 -19
  510. package/node_modules/@deepseek-ai/dsh-tool-session-query/package.json +27 -27
  511. package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +18 -18
  512. package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +23 -23
  513. package/node_modules/@deepseek-ai/dsh-tool-subagent/README.i18n.yaml +12 -12
  514. package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +6 -6
  515. package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +6 -6
  516. package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +11 -6
  517. package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +25 -25
  518. package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.i18n.yaml +39 -36
  519. package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.md +29 -17
  520. package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.zh.md +29 -17
  521. package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/index.js +74 -122
  522. package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +24 -25
  523. package/node_modules/@deepseek-ai/dsh-tool-terminal/package.json +32 -32
  524. package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +19 -19
  525. package/node_modules/@deepseek-ai/dsh-tool-web/package.json +25 -25
  526. package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +24 -24
  527. package/node_modules/@deepseek-ai/dsh-tool-working-directory/package.json +13 -13
  528. package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/package.json +12 -12
  529. package/node_modules/@deepseek-ai/dsh-tools/package.json +20 -20
  530. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +8 -8
  531. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +5 -3
  532. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +5 -3
  533. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +454 -84
  534. package/node_modules/@deepseek-ai/dsh-tui-app/package.json +87 -85
  535. package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +10 -10
  536. package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +4 -4
  537. package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +4 -4
  538. package/node_modules/@deepseek-ai/dsh-user-approval/package.json +18 -18
  539. package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +7 -3
  540. package/node_modules/@deepseek-ai/dsh-user-questions/package.json +18 -18
  541. package/node_modules/@deepseek-ai/dsh-util-code-language/package.json +3 -3
  542. package/node_modules/@deepseek-ai/dsh-util-crypto/package.json +3 -3
  543. package/node_modules/@deepseek-ai/dsh-util-time/package.json +3 -3
  544. package/node_modules/@deepseek-ai/dsh-util-values/package.json +3 -3
  545. package/node_modules/@deepseek-ai/dsh-util-workspace-path/package.json +3 -3
  546. package/node_modules/@deepseek-ai/dsh-web/package.json +8 -8
  547. package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +4 -4
  548. package/node_modules/@deepseek-ai/dsh-web-app/package.json +155 -155
  549. package/node_modules/@deepseek-ai/dsh-web-deepseek-api/package.json +30 -30
  550. package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +9 -9
  551. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-CZZasi1N.css +1 -0
  552. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-CnyQSzND.js +199 -0
  553. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +2 -2
  554. package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +21 -21
  555. package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +20 -20
  556. package/node_modules/@deepseek-ai/dsh-win32-process/package.json +4 -4
  557. package/node_modules/@deepseek-ai/dsh-workflow/package.json +11 -11
  558. package/node_modules/@deepseek-ai/dsh-workflow-ptc/package.json +39 -39
  559. package/node_modules/@deepseek-ai/dsh-working-directory/package.json +21 -21
  560. package/node_modules/@deepseek-ai/dsh-workspace/package.json +14 -14
  561. package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +26 -26
  562. package/node_modules/@deepseek-ai/schemastery/package.json +2 -2
  563. package/package.json +335 -333
  564. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-B2q7cWGa.js +0 -199
  565. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-uWlUD22X.css +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-plugin-recommendations",
3
3
  "description": "Official plugin suggestions with explicit user activation and persistent conversation decisions",
4
- "version": "0.2.2-alpha.3",
4
+ "version": "0.2.2-rc.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,27 +37,27 @@
37
37
  },
38
38
  "license": "MIT",
39
39
  "peerDependencies": {
40
- "@deepseek-ai/cordis": "4.0.6-alpha.2",
41
- "@deepseek-ai/dsh-typert-protocol": "0.2.2-alpha.3",
42
- "@deepseek-ai/dsh-llm": "0.2.2-alpha.3",
43
- "@deepseek-ai/dsh-skill": "0.2.2-alpha.3"
40
+ "@deepseek-ai/cordis": "4.1.0",
41
+ "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
42
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
43
+ "@deepseek-ai/dsh-skill": "0.2.2-rc.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@deepseek-ai/cordis": "4.0.6-alpha.2",
47
- "@deepseek-ai/dsh-typert-protocol": "0.2.2-alpha.3",
48
- "@deepseek-ai/dsh-llm": "0.2.2-alpha.3",
49
- "@deepseek-ai/dsh-agent": "0.2.2-alpha.3",
50
- "@deepseek-ai/dsh-session": "0.2.2-alpha.3",
51
- "@deepseek-ai/dsh-plugin-manager": "0.2.2-alpha.3",
52
- "@deepseek-ai/dsh-package-manifest": "0.2.2-alpha.3",
53
- "@deepseek-ai/dsh-api-remote-access": "0.2.2-alpha.3",
54
- "@deepseek-ai/dsh-skill": "0.2.2-alpha.3"
46
+ "@deepseek-ai/cordis": "4.1.0",
47
+ "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
48
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
49
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.1",
50
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1",
51
+ "@deepseek-ai/dsh-plugin-manager": "0.2.2-rc.1",
52
+ "@deepseek-ai/dsh-package-manifest": "0.2.2-rc.1",
53
+ "@deepseek-ai/dsh-api-remote-access": "0.2.2-rc.1",
54
+ "@deepseek-ai/dsh-skill": "0.2.2-rc.1"
55
55
  },
56
56
  "dependencies": {
57
57
  "zod": "4.4.3",
58
- "@deepseek-ai/dsh-client-ui-plugin-recommendations": "0.2.2-alpha.3",
59
- "@deepseek-ai/dsh-action-cards": "0.2.2-alpha.3",
60
- "@deepseek-ai/dsh-client-ui-action-cards": "0.2.2-alpha.3"
58
+ "@deepseek-ai/dsh-client-ui-plugin-recommendations": "0.2.2-rc.1",
59
+ "@deepseek-ai/dsh-action-cards": "0.2.2-rc.1",
60
+ "@deepseek-ai/dsh-client-ui-action-cards": "0.2.2-rc.1"
61
61
  },
62
62
  "files": [
63
63
  "icon.svg",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-ptc-runtime",
3
3
  "description": "Abstract PTC execution seam (ctx.ptcRuntime) for the DeepSeek Harness",
4
- "version": "0.2.2-alpha.3",
4
+ "version": "0.2.2-rc.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,11 +27,11 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
- "@deepseek-ai/cordis": "4.0.6-alpha.2",
31
- "@deepseek-ai/dsh-sandbox": "0.2.2-alpha.3"
30
+ "@deepseek-ai/cordis": "4.1.0",
31
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@deepseek-ai/cordis": "4.0.6-alpha.2",
35
- "@deepseek-ai/dsh-sandbox": "0.2.2-alpha.3"
34
+ "@deepseek-ai/cordis": "4.1.0",
35
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.1"
36
36
  }
37
37
  }
@@ -9,8 +9,8 @@
9
9
  en: 7e1a8657a212c70b
10
10
  zh: afb7a8c6a3afd718
11
11
  /deepseek-ai-dsh-ptc-runtime-node/summary:
12
- en: 79d30a488dfb61a9
13
- zh: 6b375f440656da9c
12
+ en: fd81f3e969a3d8cc
13
+ zh: a8211ce7c308dfd2
14
14
  /deepseek-ai-dsh-ptc-runtime-node/table-of-contents:
15
15
  en: d152484eb41ac6b4
16
16
  zh: 725b47765ee8f30b
@@ -18,17 +18,17 @@
18
18
  en: 9c742ab3175c4f80
19
19
  zh: 5fa7d1ce9c3920d2
20
20
  /deepseek-ai-dsh-ptc-runtime-node/use-this-package/configuration:
21
- en: 34b5a336733ea39f
22
- zh: 7604b03999b61517
21
+ en: 8d42f921a1fa8e5c
22
+ zh: 27b79ec4ec52b3fd
23
23
  /deepseek-ai-dsh-ptc-runtime-node/use-this-package/execution-and-results:
24
24
  en: 2a9fa3292bf07355
25
25
  zh: db0b5684820915eb
26
26
  /deepseek-ai-dsh-ptc-runtime-node/use-this-package/in-memory-modes:
27
- en: 647286ffa607df3b
28
- zh: ddf6d548e914cf4c
27
+ en: 0204fbdcb55c9c0d
28
+ zh: 8e6b6f3974993ca0
29
29
  /deepseek-ai-dsh-ptc-runtime-node/use-this-package/deadlines-and-cancellation:
30
- en: 3e7ab293fac35688
31
- zh: 617ed4930bbef6c7
30
+ en: d383ec7aeab8afec
31
+ zh: 7c9c49e205fbbcd8
32
32
  /deepseek-ai-dsh-ptc-runtime-node/use-this-package/failures:
33
33
  en: 34a221d0f26b8e47
34
34
  zh: 2fd20ac9c9953c7f
@@ -36,8 +36,8 @@
36
36
  en: 50e6cd38e298da31
37
37
  zh: c8b252b3acf59147
38
38
  /deepseek-ai-dsh-ptc-runtime-node/understand-the-implementation/launch-and-control:
39
- en: 5b3c72f09ab82585
40
- zh: 82bf54f0cf160250
39
+ en: f27d477e3ccb10de
40
+ zh: 0f14a4899bae6c39
41
41
  /deepseek-ai-dsh-ptc-runtime-node/understand-the-implementation/source-and-built-bootstraps:
42
42
  en: 93c117a1e404ddca
43
43
  zh: 6902de0d96efb03b
@@ -45,8 +45,8 @@
45
45
  en: e2458b4653a620bb
46
46
  zh: 4ae26bd1e6a69430
47
47
  /deepseek-ai-dsh-ptc-runtime-node/understand-the-implementation/source-map:
48
- en: af96c044b4fbda62
49
- zh: 481180e36cc7e951
48
+ en: 2821d695aec82044
49
+ zh: 59e365efb152b047
50
50
  /deepseek-ai-dsh-ptc-runtime-node/further-exploration:
51
51
  en: ac2e2ae13d3f1394
52
52
  zh: 5d08b9c658fcf83a
@@ -57,8 +57,8 @@
57
57
  en: 40294c1c31b74824
58
58
  zh: d91e7b78c0619c7e
59
59
  /deepseek-ai-dsh-ptc-runtime-node/known-limitations-and-deferred-work:
60
- en: c3fba2e38749fd24
61
- zh: 18a77758669688b3
60
+ en: 7f688098214c7c72
61
+ zh: de06cbba4da172c5
62
62
  /deepseek-ai-dsh-ptc-runtime-node/known-limitations-and-deferred-work/dev-note:
63
63
  en: 6373aba4e08f7205
64
64
  zh: 2a8c33d1f2839df4
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- Execute model-written TypeScript with host-provided async functions. The default `per-call` mode runs async function bodies in fresh Node processes; `vm-script` supports top-level await and optionally retains a context per Agent with `scriptPersistence`. Opt-in `persistent-in-memory` retains a REPL per Agent. All modes apply the selected file sandbox policy and return captured logs, lossless JSON, or structured failures. Elapsed deadlines, output bounds and a V8 heap limit constrain execution. Cancellation and one-shot completion clean up the managed process range; unavailable confinement fails execution.
12
+ Execute model-written TypeScript with host-provided async functions. The default `per-call` mode runs async function bodies in fresh Node processes; `vm-script` supports top-level await and optionally retains a context per Agent with `scriptPersistence`. Opt-in `persistent-in-memory` retains a REPL per Agent. All modes apply the selected file sandbox policy and return captured logs, lossless JSON, or structured failures. Elapsed deadlines, output bounds and a V8 heap limit constrain execution. Unacknowledged stops and one-shot completion clean up the managed process range; unavailable confinement fails execution.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -41,6 +41,7 @@ Configure the provider row after its required services are available:
41
41
  maxOldGenerationSizeMb: 512
42
42
  maxMessageBytes: 134217728
43
43
  maxPendingCalls: 128
44
+ stopGraceMs: 3000
44
45
  graceMs: 3000
45
46
  ```
46
47
 
@@ -54,6 +55,7 @@ Configure the provider row after its required services are available:
54
55
  | `maxOldGenerationSizeMb` | `512` | V8 old-generation heap limit in MiB |
55
56
  | `maxMessageBytes` | `134,217,728` | Limit for a control message, outstanding binding-argument bytes and queued control writes |
56
57
  | `maxPendingCalls` | `128` | Maximum simultaneous host binding calls |
58
+ | `stopGraceMs` | `3,000` | Time to wait for cooperative stop acknowledgment before terminating the process |
57
59
  | `graceMs` | `3,000` | Managed termination and output-drain grace |
58
60
  | `launch` | Local carrier | Explicit `{ kind: "node-script", executable, bootstrapPath? }` or `{ kind: "embedded", executable }` in the subprocess world |
59
61
 
@@ -93,7 +95,7 @@ Save the patch and pass its path to `dsh headless --patch <path>` in a compositi
93
95
 
94
96
  In REPL mode, each live Agent keeps its own process and top-level variables, functions, and imported modules across `run_code` calls and turns. Use `await import(...)`, `console.log(...)`, and a final JSON expression; top-level `return` is not supported. Assignments to undeclared names create retained globals under Node REPL’s non-strict evaluation. `_` and `_error` are ordinary retained globals, without interactive REPL result setters. Node REPL declaration rules apply, including errors on redeclaring existing `let`, `const`, or `class` names; assign to a mutable binding or choose a new name. A leading `{ ... }` is a statement block and can contain top-level await and temporary declarations; parenthesize an object expression to return it. Retained functions and saved tool methods call the current evaluation's bindings. All tool calls must be awaited; callbacks from a completed evaluation cannot invoke tools in a later evaluation.
95
97
 
96
- Memory is best-effort and never saved to disk. Restart, Agent disposal, provider unload, cancellation, timeout, protocol failure, output overflow, or process exit clears it. Missing variables raise normal reference errors; reacquire handles and recreate declarations. Exceptions in the active evaluation settle once and preserve earlier mutations. In REPL mode, exceptions from callbacks belonging to a completed evaluation are not reported in a later result. In Script mode, uncaught callback exceptions can terminate the retained process; await asynchronous work before completing an evaluation. The Session still records programs, tool dispatches and visible results; restoring a Session or forking an Agent starts with empty memory. Each evaluation resets the process working directory to its resolved cwd; program calls to `process.chdir()` do not persist across evaluations. Direct Node access follows the resolved file policy. A retained owner cannot change mode, workspace root, additional writable roots, or Session identity until its environment is released.
98
+ Memory is best-effort and never saved to disk. Restart, Agent disposal, provider unload, protocol failure, output overflow, or process exit clears it. Missing variables raise normal reference errors; reacquire handles and recreate declarations. Exceptions in the active evaluation settle once and preserve earlier mutations. In REPL mode, exceptions from callbacks belonging to a completed evaluation are not reported in a later result. In Script mode, uncaught callback exceptions can terminate the retained process; await asynchronous work before completing an evaluation. The Session still records programs, tool dispatches and visible results; restoring a Session or forking an Agent starts with empty memory. Each evaluation resets the process working directory to its resolved cwd; program calls to `process.chdir()` do not persist across evaluations. Direct Node access follows the resolved file policy. A retained owner cannot change mode, workspace root, additional writable roots, or Session identity until its environment is released.
97
99
 
98
100
  Service consumers pass an object as `stateOwner` to reuse its environment and await `release(owner)` when finished. Requests without an owner run in temporary processes. Their failures leave other owners' retained variables intact and do not report clearing them. Permission setters record the new mode synchronously. The runtime immediately invalidates affected processes and begins cancellation when the Session mode changes, including idle environments. The next program waits for their cleanup before starting; cleanup failure blocks that program and remains retryable. Permission-setting success does not mean old processes have finished stopping. A one-time approved escalation uses a separate environment and awaits its cleanup before returning; it cannot read the standing environment's variables or retain new declarations. Concurrent runs for one owner reject until execution and required cleanup complete; distinct owners may run concurrently. An idle environment has no expiration timer and keeps its process until release or failure. Raw stdout/stderr have no evaluation identity: bytes received during an evaluation share its output budget, even when written by an earlier child process; idle stdout is discarded and idle stderr retains only the bounded diagnostic tail. Await child-process completion before ending an evaluation. Process-exit diagnostics include the exit code and retained stderr tail; idle failures are written to the host logger. If process observation fails during cleanup, releasing the owner retries termination; new runs remain blocked until cleanup succeeds. Pipes that fail to drain after confirmed process exit produce a diagnostic but do not prevent releasing the environment.
99
101
 
@@ -103,7 +105,7 @@ For calls carrying a Session policy, a mode change cancels admission even while
103
105
 
104
106
  The PTC consumer exposes per-call timeout and approved sandbox choices as described in [dsh-tool-executor-ptc](../../core/tool-executor-ptc/README.md). The runtime's readonly `timeout` descriptor reports its effective default and maximum to that consumer. The provider owns execution syntax, output syntax and state-retention guidance in `executionInstructions`. The tool consumer appends those mode-specific rules to its model-visible schema without inferring persistence from `programFormat`.
105
107
 
106
- Omitting `timeoutMs` uses the configured elapsed default; numeric requests are validated and capped. Service callers can explicitly pass `timeoutMs: null` to omit the elapsed timer, as the workflow adapter does; `run_code` continues to accept only positive numeric overrides. An enabled deadline covers runtime setup and execution, including time awaiting nested tools or approval. It is not a CPU meter. Timeout or cancellation stops a synchronous loop through the host's managed process owner; successful per-call completion also cleans that managed range. The timer stops when an outcome is selected, before cleanup, so the returned call can take longer than its execution deadline while cleanup settles.
108
+ Omitting `timeoutMs` uses the configured elapsed default; numeric requests are validated and capped. Service callers can explicitly pass `timeoutMs: null` to omit the elapsed timer, as the workflow adapter does; `run_code` continues to accept only positive numeric overrides. An enabled deadline covers runtime setup and execution, including time awaiting nested tools or approval. It is not a CPU meter. Timeout results retain captured output and report `execution timed out before code started` until the program is submitted to the ready process, or `execution timed out during execution` afterward. Timeout or cancellation during retained execution requests cooperative revocation. Captured output produced after the stop request is discarded, including output from `catch` and `finally` handlers. Acknowledgment preserves the VM and variables, including earlier mutations. If the execution thread cannot acknowledge within `stopGraceMs`, or the acknowledgment fails, the host terminates the managed process range and waits for cleanup. The result remains `timeout` or `abort` and reports whether variables were preserved or cleared; timeout messages also report the elapsed budget. After confirmed termination, the next call creates an empty environment. Cleanup failure returns `worker-exit` and blocks reuse until host release succeeds. Startup timeouts, temporary execution stops and successful per-call completion terminate the managed process range immediately. The timer stops when an outcome is selected, before cleanup, so the returned call can take longer than its execution deadline while cleanup settles.
107
109
 
108
110
  ### Failures
109
111
 
@@ -125,7 +127,11 @@ The host owns policy, deadlines, binding lookup and process cleanup. The child o
125
127
 
126
128
  The host strips erasable types and, when starting a process, resolves the executable and bootstrap in the configured execution world, awaits argv confinement through `ctx.sandbox`, then spawns through `ctx.subprocess`. Cancellation is checked again after confinement, so a provider returning after cancellation cannot start the program. After adopting the inherited control channel, the child retains only executable-search, Windows system, and temporary paths in its OS environment and replaces the program-visible `process.env` with an empty dictionary. Named `node:process` exports are refreshed so imports also receive the empty environment. Windows ACL setup receives the parent's distinct `TEMP` and `TMP` values for shared grant locks, then replaces both with its private directory before starting the program. These native paths keep nested process creation and native temporary-file APIs functional. The host preserves `ELECTRON_RUN_AS_NODE` only for child startup so the Desktop executable runs the Node bootstrap; the bootstrap removes the selector before evaluating model code. The heap limit uses Node argv or a provider-created `NODE_OPTIONS` value for packaged executables; ambient loader and inspector flags are discarded.
127
129
 
128
- The host calls the child’s `run()` method through birpc; injected bindings call the host’s `invoke()` method, and captured output uses notifications. birpc owns request correlation, remote results, and rejection delivery. Newline-delimited JSON travels over the inherited control pipe separately from stdout/stderr. The RPC adapter bounds each line and the native write queue and rejects pending calls when the pipe closes; birpc answers calls to methods an endpoint does not own with an error, and runs no method after the pipe closes. The host validates binding names and lossless JSON before dispatch; one pipe delivers each evaluation's messages before its result, so messages carry no evaluation identity. Execution deadlines remain host-owned, including calls that await approval.
130
+ Control traffic uses newline-delimited JSON on an inherited pipe separate from stdout/stderr. The RPC adapter bounds each message and queued native writes, rejects pending transport calls on closure, and runs no further methods after closure. Unsupported methods receive error replies. The host validates binding names and lossless JSON before dispatch.
131
+
132
+ The host calls the child's `run()` method over birpc on the ordered control pipe. Only one evaluation runs at a time; its asynchronous context prevents ended callbacks from starting new bindings or emitting captured output. RPC requests associate completions and binding replies with their callers. On timeout or cancellation, the host rejects new binding calls and late results, sends a one-way `revoke()` notification, and waits for the original `run()` response within `stopGraceMs`. Revocation rejects unfinished tool calls normally, allowing user `catch` and `finally` handlers to run. A validated response confirms settlement without changing the selected timeout or cancellation outcome. A missing, rejected or malformed response triggers termination. Callers must await settlement or fallback termination and cleanup before starting another evaluation. A blocked event loop cannot process revocation, so synchronous loops require process termination and lose retained state.
133
+
134
+ Timers, arbitrary user-created Promises, I/O callbacks, Workers and child processes have no per-evaluation cancellation guarantee. Stop acknowledgment waits for the current evaluation to settle; it does not establish cleanup of those resources. Unmanaged asynchronous work may mutate retained globals after acknowledgment; captured output and completion from ended evaluations are ignored. Await required work before returning and use host reset when resources cannot be trusted.
129
135
 
130
136
  Per-call completion leaves unfinished binding waits pending and stops binding calls and captured output notifications. The child keeps the control pipe open until the host receives its result and closes the pipe. Output capture meters serialized logs plus the completion or diagnostic; fixed result-envelope fields and sandbox metadata are outside that ledger.
131
137
 
@@ -160,7 +166,7 @@ AsyncFunction and Node REPL share synchronous `registerHooks` and a symbol-keyed
160
166
  | [`src/config.ts`](src/config.ts) | Execution mode, validated limits and defaults |
161
167
  | [`src/configuration.ts`](src/configuration.ts) | Retained-execution settings for profile editors |
162
168
  | [`src/execution.ts`](src/execution.ts) | Mode selection, request resolution and temporary or retained process ownership |
163
- | [`src/worker.ts`](src/worker.ts) | Shared process launch, evaluation deadlines, binding dispatch and cleanup |
169
+ | [`src/worker.ts`](src/worker.ts) | Shared process launch, evaluation deadlines and binding dispatch; `interruptEvaluation()` requests cooperative interruption, `terminate()` ends the process |
164
170
  | [`src/persistent-process.ts`](src/persistent-process.ts) | Installed REPL-default entry delegating to the common child loop |
165
171
  | [`src/evaluators/index.ts`](src/evaluators/index.ts) | Shared selection entry for the three evaluators |
166
172
  | [`src/imports/vm-modules.ts`](src/imports/vm-modules.ts) | Script import decisions, recursive ESM linking and native delegation |
@@ -219,7 +225,7 @@ These limits qualify the execution guarantees and retained output.
219
225
  - **In-memory environments retain one process per live owner** — idle owners keep their process and heap until explicit release, owner disposal or failure. Fan-out can retain many processes; idle expiration remains deferred.
220
226
  - **Output caps reject rather than retain every byte** — spill can preserve only the bounded result delivered by this provider.
221
227
  - **Bindings are bounded at transport admission** — control limits do not bound the memory a host binding allocates while producing its result.
222
- - **The control protocol has no version handshake** — a preinstalled `launch.bootstrapPath` or SSH helper must come from the client's release; another release's bootstrap fails at its first control message.
228
+ - **Preinstalled bootstraps require a compatible protocol revision** — readiness rejects a missing or mismatched revision before dispatching code. Upgrade `launch.bootstrapPath` with the host; the runtime does not install remote bootstrap updates.
223
229
  - **The console shim has five methods** — `log`, `info`, `warn`, `error` and `debug`.
224
230
 
225
231
  <a id="dev-note"></a>
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- 执行模型编写的 TypeScript,并提供宿主异步函数。默认的 `per-call` 模式在全新 Node 进程中运行异步函数体;`vm-script` 支持顶层 await,并可通过 `scriptPersistence` 为每个 Agent 保留 context。显式启用的 `persistent-in-memory` 为每个 Agent 保留 REPL。所有模式都应用所选文件沙箱策略,返回捕获日志、无损 JSON 或结构化失败。执行时限、输出上限和 V8 堆上限约束运行。取消与单次执行完成后清理受管进程范围;约束不可用时执行失败。
12
+ 执行模型编写的 TypeScript,并提供宿主异步函数。默认的 `per-call` 模式在全新 Node 进程中运行异步函数体;`vm-script` 支持顶层 await,并可通过 `scriptPersistence` 为每个 Agent 保留 context。显式启用的 `persistent-in-memory` 为每个 Agent 保留 REPL。所有模式都应用所选文件沙箱策略,返回捕获日志、无损 JSON 或结构化失败。执行时限、输出上限和 V8 堆上限约束运行。未确认的停止请求与单次执行完成后清理受管进程范围;约束不可用时执行失败。
13
13
 
14
14
  ## 目录
15
15
 
@@ -41,6 +41,7 @@ kind: "package-reference"
41
41
  maxOldGenerationSizeMb: 512
42
42
  maxMessageBytes: 134217728
43
43
  maxPendingCalls: 128
44
+ stopGraceMs: 3000
44
45
  graceMs: 3000
45
46
  ```
46
47
 
@@ -54,6 +55,7 @@ kind: "package-reference"
54
55
  | `maxOldGenerationSizeMb` | `512` | V8 老生代堆上限,单位 MiB |
55
56
  | `maxMessageBytes` | `134,217,728` | 控制消息、未完成绑定参数字节和排队控制写入的上限 |
56
57
  | `maxPendingCalls` | `128` | 同时进行的 Host 绑定调用数量上限 |
58
+ | `stopGraceMs` | `3,000` | 终止进程前等待协作式停止确认的时间 |
57
59
  | `graceMs` | `3,000` | 受管终止与输出排空宽限时间 |
58
60
  | `launch` | 本地载体 | 子进程环境中显式的 `{ kind: "node-script", executable, bootstrapPath? }` 或 `{ kind: "embedded", executable }` |
59
61
 
@@ -93,7 +95,7 @@ profile 编辑器可从 `@deepseek-ai/dsh-ptc-runtime-node/configuration` 导入
93
95
 
94
96
  在 REPL 模式下,每个存活 Agent 保留独立进程,跨 `run_code` 调用和轮次保留顶层变量、函数及导入模块。使用 `await import(...)`、`console.log(...)` 和末尾 JSON 表达式;不支持顶层 `return`。Node REPL 使用非严格模式,给未声明的名称赋值会创建保留的全局变量。`_` 和 `_error` 是普通的保留全局变量,不使用交互式 REPL 的结果设置器。声明遵循 Node REPL 规则,包括重复声明已有 `let`、`const` 或 `class` 名称时报错;应给可变绑定赋值或选择新名称。开头的 `{ ... }` 按语句块执行,可以包含顶层 await 和临时声明;需要返回对象表达式时,用圆括号包裹。保留的函数和工具方法引用调用当前执行的绑定。必须等待所有工具调用;已完成执行的回调不能在后续执行中调用工具。
95
97
 
96
- 内存按尽力保留处理,不保存到磁盘。重启、Agent 销毁、提供方卸载、取消、超时、协议失败、输出超限或进程退出都会清除内存。缺失变量产生普通引用错误,模型需要重新获取句柄和创建声明。当前执行中的异常只结算一次,并保留此前发生的修改。在 REPL 模式下,已完成执行的回调抛出的异常不会在后续结果中报告。在 Script 模式下,未捕获的回调异常可能终止保留进程;结束执行前应等待异步工作完成。Session 仍记录程序、工具分派和可见结果;恢复 Session 或派生 Agent 时从空内存开始。每次执行都会将进程工作目录重置为本次解析的 cwd;程序中的 `process.chdir()` 不跨执行保留。直接 Node 访问遵循已解析的文件策略。保留状态的所有者必须先释放环境,才能更改权限模式、工作区根目录、额外可写根目录或 Session 身份。
98
+ 内存按尽力保留处理,不保存到磁盘。重启、Agent 销毁、提供方卸载、协议失败、输出超限或进程退出都会清除内存。缺失变量产生普通引用错误,模型需要重新获取句柄和创建声明。当前执行中的异常只结算一次,并保留此前发生的修改。在 REPL 模式下,已完成执行的回调抛出的异常不会在后续结果中报告。在 Script 模式下,未捕获的回调异常可能终止保留进程;结束执行前应等待异步工作完成。Session 仍记录程序、工具分派和可见结果;恢复 Session 或派生 Agent 时从空内存开始。每次执行都会将进程工作目录重置为本次解析的 cwd;程序中的 `process.chdir()` 不跨执行保留。直接 Node 访问遵循已解析的文件策略。保留状态的所有者必须先释放环境,才能更改权限模式、工作区根目录、额外可写根目录或 Session 身份。
97
99
 
98
100
  服务消费者通过 `stateOwner` 对象复用环境,并在结束时等待 `release(owner)`。没有所有者的请求在临时进程中执行。此类执行失败不影响其他所有者保留的变量,也不报告清空了这些变量。权限设置同步记录新模式。Session 模式变化时,运行时立即禁止复用受影响的进程并开始取消,包括空闲环境。下一次程序执行前等待这些进程清理;清理失败会阻止本次程序启动,并允许重试。权限设置成功时,旧进程可能仍在停止过程中。单次获准的提权使用独立环境,返回前等待清理;该次执行无法访问原环境的变量,也不会保留新声明。执行及必要清理完成之前,同一所有者的并发调用会被拒绝;不同所有者可以并发。空闲环境没有过期计时器,进程保留到释放或失败为止。原始 stdout/stderr 不携带执行标识:执行期间收到的字节计入本次输出预算,包括较早启动的子进程此时写出的内容;空闲期间丢弃 stdout,只保留限额内的 stderr 诊断尾部。结束本次执行前,应等待子进程完成。进程退出诊断包含退出码和保留的 stderr 尾部;空闲期间的失败写入宿主日志。清理期间无法观测进程范围时,释放所有者会重试终止;清理成功前拒绝新执行。确认进程退出后仍未排空的管道会产生诊断,但不阻止释放环境。
99
101
 
@@ -103,7 +105,7 @@ profile 编辑器可从 `@deepseek-ai/dsh-ptc-runtime-node/configuration` 导入
103
105
 
104
106
  PTC 消费方按 [dsh-tool-executor-ptc](../../core/tool-executor-ptc/README.zh.md) 的说明公开逐次超时与经审批的沙箱选择。运行时只读 `timeout` 描述符向该消费方报告有效默认值与上限。提供方通过 `executionInstructions` 负责求值语法、输出方式和状态保留指引。工具消费者将对应模式的规则附加到面向模型的 schema,不根据 `programFormat` 推断是否保留状态。
105
107
 
106
- 省略 `timeoutMs` 使用配置的经过时间默认值;数值请求经过验证并封顶。服务调用方可以显式传入 `timeoutMs: null` 来省略经过时间定时器,工作流适配器即如此;`run_code` 仍只接受正数覆盖值。启用的截止覆盖运行时准备和执行,包括等待嵌套工具或审批的时间。它不是 CPU 计量器。超时或取消通过 Host 的受管进程所有者停止同步循环;逐次执行成功完成也会清理该受管范围。选择结果后、清理前停止计时器,因此调用可能要在执行截止之后等待清理结算才返回。
108
+ 省略 `timeoutMs` 使用配置的经过时间默认值;数值请求经过验证并封顶。服务调用方可以显式传入 `timeoutMs: null` 来省略经过时间定时器,工作流适配器即如此;`run_code` 仍只接受正数覆盖值。启用的截止覆盖运行时准备和执行,包括等待嵌套工具或审批的时间。它不是 CPU 计量器。超时结果保留已捕获的输出;在程序提交给就绪进程之前报告 `execution timed out before code started`,提交后报告 `execution timed out during execution`。保留环境中的执行超时或取消会请求协作式撤销。发出停止请求后产生的捕获输出会被丢弃,包括 `catch` 和 `finally` 处理器的捕获输出。收到确认后保留 VM 和变量,包括此前发生的修改。如果执行线程未在 `stopGraceMs` 内确认,或确认失败,宿主终止受管进程范围并等待清理。结果仍为 `timeout` 或 `abort`,并说明变量被保留还是清空;超时消息还会报告经过时间预算。确认终止后,下一次调用创建空环境。清理失败返回 `worker-exit`,并阻止复用,直到宿主释放成功。启动前超时、临时执行停止以及逐次执行成功完成均立即终止受管进程范围。选择结果后、清理前停止计时器,因此调用可能要在执行截止之后等待清理结算才返回。
107
109
 
108
110
  ### 失败
109
111
 
@@ -125,7 +127,11 @@ Host 负责策略、截止时间、绑定查找和进程清理。子进程负责
125
127
 
126
128
  Host 擦除可擦除类型;需要启动进程时,在配置的执行世界中解析可执行文件与 bootstrap,通过 `ctx.sandbox` 等待 argv 限制准备完成,再通过 `ctx.subprocess` 启动。限制准备完成后会再次检查取消状态,因此提供方在取消后返回也无法启动程序。接管继承的控制通道后,子进程在 OS 环境中只保留可执行文件搜索路径、Windows 系统路径和临时路径,并将程序可见的 `process.env` 替换为空字典。`node:process` 的具名导出同步更新,因此导入也会获得空环境。Windows ACL 初始化接收父进程各自的 `TEMP` 和 `TMP` 值以使用共享授权锁,然后在启动程序前将二者替换为私有目录。这些原生路径使嵌套进程创建和原生临时文件 API 仍可正常工作。Host 仅在子进程启动时保留 `ELECTRON_RUN_AS_NODE`,使桌面端可执行文件运行 Node bootstrap;bootstrap 在求值模型代码前删除该选择变量。堆上限通过 Node argv 或为打包可执行文件由提供方构造的 `NODE_OPTIONS` 值传递;环境中的加载器和调试器标志会被丢弃。
127
129
 
128
- Host 通过 birpc 调用子进程的 `run()` 方法;注入的绑定调用 Host 的 `invoke()` 方法,捕获的输出通过通知传递。birpc 负责请求关联、远程结果和异常传递。逐行 JSON 通过继承的控制管道传输,与 stdout/stderr 分离。RPC 适配层限制每行消息和原生写入队列的大小,并在管道关闭时拒绝待完成调用;对端点自身没有的方法,birpc 以错误回复,管道关闭后不再执行任何方法。Host 在分派前校验绑定名与无损 JSON;同一管道保证每次求值的消息先于其结果到达,因此消息不携带求值身份。执行截止时间仍由 Host 管理,包含等待审批的调用。
130
+ 控制通信使用继承管道上的逐行 JSON,与 stdout/stderr 分离。RPC 适配层限制每条消息和原生写入队列的大小,在通道关闭时拒绝待完成的传输调用,关闭后不再执行方法。不支持的方法会收到错误回复。Host 在分派前校验绑定名称和无损 JSON。
131
+
132
+ Host 通过有序控制管道上的 birpc 调用子进程的 `run()`。同一时间只运行一次执行,其异步上下文阻止已结束执行的回调发起新绑定或发送捕获输出。RPC 请求将执行完成结果和绑定回复关联到各自的调用方。超时或取消时,Host 拒绝新绑定调用及迟到结果,发送单向 `revoke()` 通知,并在 `stopGraceMs` 内等待原 `run()` 响应。撤销会让未完成的工具调用正常抛错,允许用户的 `catch` 和 `finally` 运行。有效响应确认本次执行已结束,不改变已选定的超时或取消结果。未收到响应、请求被拒绝或响应格式无效时,终止进程。调用方必须等待执行结束,或兜底终止及清理完成后,才能开始下一次执行。阻塞的事件循环无法处理撤销,因此同步死循环需要终止进程并丢失保留状态。
133
+
134
+ 定时器、任意用户创建的 Promise、I/O 回调、Worker 和子进程不承诺按执行取消。停止确认仅等待当前执行结束,不表示这些资源已清理。未受管异步工作在确认停止后仍可能修改保留的全局变量;已结束执行的捕获输出和完成通知会被忽略。返回前应等待必要工作完成,资源不可信时使用宿主重置。
129
135
 
130
136
  单次执行完成后,尚未完成的绑定等待保持挂起,并停止绑定调用和捕获输出的通知。子进程保持控制管道打开,直到 Host 收到结果并关闭管道。输出捕获计量序列化日志加完成值或诊断;固定结果信封字段与沙箱元数据不计入该账本。
131
137
 
@@ -160,7 +166,7 @@ AsyncFunction 和 Node REPL 共用同步 `registerHooks` 和以 symbol 为键的
160
166
  | [`src/config.ts`](src/config.ts) | 执行模式、限制校验与默认值 |
161
167
  | [`src/configuration.ts`](src/configuration.ts) | 供 profile 编辑器使用的持久执行设置 |
162
168
  | [`src/execution.ts`](src/execution.ts) | 模式选择、请求解析及临时或保留进程的所有权 |
163
- | [`src/worker.ts`](src/worker.ts) | 共用的进程启动、执行截止、绑定分派与清理 |
169
+ | [`src/worker.ts`](src/worker.ts) | 共用的进程启动、执行截止与绑定分派;`interruptEvaluation()` 请求协作中断,`terminate()` 终止进程 |
164
170
  | [`src/persistent-process.ts`](src/persistent-process.ts) | 默认使用 REPL 的已安装入口,委托共用子进程循环 |
165
171
  | [`src/evaluators/index.ts`](src/evaluators/index.ts) | 三种求值器的统一选择入口 |
166
172
  | [`src/imports/vm-modules.ts`](src/imports/vm-modules.ts) | Script 导入决策、递归 ESM 链接与原生加载委托 |
@@ -219,7 +225,7 @@ AsyncFunction 和 Node REPL 共用同步 `registerHooks` 和以 symbol 为键的
219
225
  - **内存保留环境为每个存活所有者保留一个进程**——空闲所有者保留进程及堆内存,直到显式释放、所有者销毁或执行失败。并行创建多个所有者会保留多个进程;空闲过期机制留待后续处理。
220
226
  - **输出上限拒绝超量内容,而不保留每个字节**——溢出只能保存本提供方交付的有界结果。
221
227
  - **绑定在传输接纳时受限**——控制限制不约束 Host 绑定生成结果期间分配的内存。
222
- - **控制协议没有版本握手**——预装的 `launch.bootstrapPath` 或 SSH helper 必须来自与客户端相同的版本;其他版本的 bootstrap 会在第一条控制消息时失败。
228
+ - **预装 bootstrap 需要兼容的协议版本**——就绪握手会在派发代码前拒绝缺失或不匹配的版本。请将 `launch.bootstrapPath` 与宿主一同升级;运行时不会安装远端 bootstrap 更新。
223
229
  - **console shim 有五个方法**——`log`、`info`、`warn`、`error` 与 `debug`。
224
230
 
225
231
  <a id="dev-note"></a>
@@ -77,6 +77,7 @@ const NodeConfig = z.object({
77
77
  maxOldGenerationSizeMb: z.number().default(512),
78
78
  maxMessageBytes: z.number().default(134217728),
79
79
  maxPendingCalls: z.number().default(128),
80
+ stopGraceMs: z.number().default(3e3),
80
81
  graceMs: z.number().default(3e3),
81
82
  launch: z.union([z.object({
82
83
  kind: z.const("node-script").required(),
@@ -97,7 +98,8 @@ function validateConfig(config) {
97
98
  for (const key of [
98
99
  "timeoutMs",
99
100
  "maxTimeoutMs",
100
- "graceMs"
101
+ "graceMs",
102
+ "stopGraceMs"
101
103
  ]) if (config[key] > MAX_TIMER_DELAY_MS) throw new Error(`ptc-runtime-node: ${key} exceeds the supported timer range`);
102
104
  if (!Number.isSafeInteger(config.maxOutputBytes) || config.maxOutputBytes < 4) throw new Error("ptc-runtime-node: maxOutputBytes must be an integer of at least 4");
103
105
  if (!Number.isSafeInteger(config.maxMessageBytes)) throw new Error("ptc-runtime-node: maxMessageBytes must be an integer");
@@ -860,7 +862,7 @@ var ProgramWorker = class {
860
862
  ready = false;
861
863
  stderr = "";
862
864
  controlFailure;
863
- stopped;
865
+ termination;
864
866
  starting;
865
867
  exitOutcome;
866
868
  controller = new AbortController();
@@ -923,21 +925,18 @@ var ProgramWorker = class {
923
925
  message(message) {
924
926
  return this.retainsState ? `${message}; retained variables were cleared` : message;
925
927
  }
926
- abortMessage(signal) {
927
- return this.retainsState ? "execution canceled; retained variables were cleared" : messageOf(signal?.reason);
928
- }
929
928
  async evaluate(spec, bindings) {
930
929
  if (this.exitOutcome !== void 0) {
931
930
  const output = this.output();
932
931
  const failure = spec.signal?.aborted ? {
933
932
  kind: "abort",
934
- message: this.abortMessage(spec.signal)
933
+ message: this.message("execution canceled")
935
934
  } : {
936
935
  kind: "worker-exit",
937
936
  message: this.message(this.exitMessage(this.exitOutcome))
938
937
  };
939
938
  try {
940
- await this.stop();
939
+ await this.terminate();
941
940
  } catch (error) {
942
941
  return output.failure([], {
943
942
  kind: "worker-exit",
@@ -952,19 +951,21 @@ var ProgramWorker = class {
952
951
  let overflowed = false;
953
952
  const result = Promise.withResolvers();
954
953
  const timer = spec.timeoutMs === null ? void 0 : setTimeout(() => {
954
+ const message = `execution timed out ${evaluation.completion !== void 0 ? "during execution" : "before code started"} (${spec.timeoutMs}ms)`;
955
955
  evaluation.finish({
956
956
  kind: "timeout",
957
- message: this.message(`execution deadline reached (${spec.timeoutMs}ms)`)
958
- }, void 0, true);
957
+ message
958
+ }, void 0, evaluation.completion === void 0);
959
959
  }, spec.timeoutMs);
960
960
  const onAbort = () => {
961
961
  evaluation.finish({
962
962
  kind: "abort",
963
- message: this.abortMessage(spec.signal)
964
- }, void 0, true);
963
+ message: this.retainsState ? "execution canceled" : messageOf(spec.signal?.reason)
964
+ }, void 0, evaluation.completion === void 0);
965
965
  };
966
966
  const evaluation = {
967
967
  settled: false,
968
+ completion: void 0,
968
969
  data: {
969
970
  code: "",
970
971
  programFormat: this.mode.format,
@@ -999,12 +1000,26 @@ var ProgramWorker = class {
999
1000
  spec.signal?.removeEventListener("abort", onAbort);
1000
1001
  const complete = () => overflowed || error?.kind === "output-limit" ? output.limit(logs) : error ? output.failure(logs, error) : output.success(logs, value);
1001
1002
  const outcome = complete();
1002
- (discard || outcome.error?.kind === "output-limit" || !this.retainsState ? this.stop() : Promise.resolve(true)).then((drained) => {
1003
- this.active = void 0;
1004
- result.resolve(drained ? complete() : output.failure(logs, {
1003
+ const cleanup = async () => {
1004
+ const interrupted = error?.kind === "timeout" || error?.kind === "abort";
1005
+ let preserved = this.retainsState && !discard && outcome.error?.kind !== "output-limit";
1006
+ if (preserved && interrupted) preserved = await this.interruptEvaluation(evaluation);
1007
+ let drained = true;
1008
+ if (!preserved) drained = await this.terminate();
1009
+ if (interrupted && this.retainsState && error) error = {
1010
+ ...error,
1011
+ message: `${error.message}; retained variables were ${preserved ? "preserved" : "cleared"}`
1012
+ };
1013
+ const completed = complete();
1014
+ if (completed.error?.kind === "output-limit" && preserved) drained = await this.terminate();
1015
+ return drained ? completed : output.failure(logs, {
1005
1016
  kind: "worker-exit",
1006
1017
  message: "managed process exited but its output did not drain cleanly"
1007
- }));
1018
+ });
1019
+ };
1020
+ cleanup().then((completed) => {
1021
+ this.active = void 0;
1022
+ result.resolve(completed);
1008
1023
  }, (failure) => {
1009
1024
  this.active = void 0;
1010
1025
  result.resolve(output.failure(logs, {
@@ -1037,21 +1052,45 @@ var ProgramWorker = class {
1037
1052
  }
1038
1053
  return await result.promise;
1039
1054
  }
1055
+ /** True confirms evaluation settlement with the process still available for reuse. */
1056
+ async interruptEvaluation(evaluation) {
1057
+ const completion = evaluation.completion;
1058
+ if (!this.channel || this.channel.$closed || this.closed || !completion) return false;
1059
+ const deadline = Promise.withResolvers();
1060
+ const timer = setTimeout(() => {
1061
+ deadline.reject(/* @__PURE__ */ new Error(`execution did not settle within ${this.config.stopGraceMs}ms`));
1062
+ }, this.config.stopGraceMs);
1063
+ const abort = () => {
1064
+ deadline.reject(/* @__PURE__ */ new Error("environment disposed during interruption"));
1065
+ };
1066
+ this.controller.signal.addEventListener("abort", abort, { once: true });
1067
+ try {
1068
+ await Promise.race([this.channel.revoke().then(() => completion), deadline.promise]);
1069
+ this.controller.signal.throwIfAborted();
1070
+ return true;
1071
+ } catch (_error) {
1072
+ return false;
1073
+ } finally {
1074
+ clearTimeout(timer);
1075
+ this.controller.signal.removeEventListener("abort", abort);
1076
+ }
1077
+ }
1040
1078
  /** Cancel active work and await managed process termination and output drainage. */
1041
1079
  async dispose() {
1042
1080
  this.active?.finish({
1043
1081
  kind: "abort",
1044
- message: this.message("PTC environment disposed")
1082
+ message: "PTC environment disposed"
1045
1083
  }, void 0, true);
1046
- await this.stop();
1084
+ await this.terminate();
1047
1085
  }
1048
- stop() {
1049
- if (this.stopped) return this.stopped;
1086
+ /** Terminate the process; resolve to whether its output pipes drained cleanly. */
1087
+ terminate() {
1088
+ if (this.termination) return this.termination;
1050
1089
  this.closed = true;
1051
1090
  this.cleanupPending = true;
1052
1091
  this.controller.abort();
1053
1092
  this.channel?.$close();
1054
- this.stopped = (async () => {
1093
+ this.termination = (async () => {
1055
1094
  await this.starting?.catch((_error) => {});
1056
1095
  const handle = this.handle;
1057
1096
  return handle === void 0 || await terminateProcess(handle, this.config.graceMs);
@@ -1061,10 +1100,10 @@ var ProgramWorker = class {
1061
1100
  if (!drained) this.ctx.logger.warn("Node process exited but its output did not drain cleanly");
1062
1101
  return drained;
1063
1102
  }, (error) => {
1064
- this.stopped = void 0;
1103
+ this.termination = void 0;
1065
1104
  throw error;
1066
1105
  });
1067
- return this.stopped;
1106
+ return this.termination;
1068
1107
  }
1069
1108
  fail(kind, message) {
1070
1109
  if (this.active) this.active.finish({
@@ -1073,20 +1112,21 @@ var ProgramWorker = class {
1073
1112
  }, void 0, true);
1074
1113
  else {
1075
1114
  if (!this.closed) this.ctx.logger.warn(message);
1076
- this.stop().catch((error) => {
1115
+ this.terminate().catch((error) => {
1077
1116
  this.ctx.logger.warn(messageOf(error));
1078
1117
  });
1079
1118
  }
1080
1119
  }
1081
1120
  dispatch(evaluation) {
1082
- this.channel?.run(evaluation.spec.cwd, evaluation.data).then((raw) => {
1121
+ const completion = this.channel?.run(evaluation.spec.cwd, evaluation.data).then(readProgramResult);
1122
+ evaluation.completion = completion;
1123
+ completion?.then(({ error, value }) => {
1083
1124
  if (evaluation.settled) return;
1084
- const { error, value } = readProgramResult(raw);
1085
1125
  setImmediate(() => {
1086
1126
  evaluation.finish(error, value);
1087
1127
  });
1088
1128
  }).catch((error) => {
1089
- if (this.active === evaluation && !this.channel?.$closed) this.fail("protocol", messageOf(error));
1129
+ if (this.active === evaluation && !evaluation.settled && !this.channel?.$closed) this.fail("protocol", messageOf(error));
1090
1130
  });
1091
1131
  }
1092
1132
  withControlFailure(message) {
@@ -1145,7 +1185,11 @@ var ProgramWorker = class {
1145
1185
  throw new Error(message);
1146
1186
  };
1147
1187
  this.channel = createProcessRpc(handle.control, this.config.maxMessageBytes, {
1148
- ready: () => {
1188
+ ready: (version) => {
1189
+ if (version !== 2) {
1190
+ this.fail("protocol", "bootstrap protocol mismatch; upgrade launch.bootstrapPath with the host");
1191
+ return;
1192
+ }
1149
1193
  if (this.ready || !this.active) {
1150
1194
  this.fail("protocol", "duplicate program readiness");
1151
1195
  return;
@@ -1154,19 +1198,26 @@ var ProgramWorker = class {
1154
1198
  this.dispatch(this.active);
1155
1199
  },
1156
1200
  log: (text) => {
1157
- if (!this.ready || this.active === void 0 || typeof text !== "string") this.fail("protocol", "invalid program log");
1158
- else this.active.admit(text);
1201
+ if (!this.ready || !this.active || typeof text !== "string") {
1202
+ this.fail("protocol", "invalid program log");
1203
+ return;
1204
+ }
1205
+ if (!this.active.settled) this.active.admit(text);
1159
1206
  },
1160
1207
  outputLimit: () => {
1161
- if (!this.ready || this.active === void 0) this.fail("protocol", "idle PTC output limit");
1162
- else this.active.finish({
1208
+ if (!this.ready || !this.active) {
1209
+ this.fail("protocol", "idle PTC output limit");
1210
+ return;
1211
+ }
1212
+ this.active.finish({
1163
1213
  kind: "output-limit",
1164
1214
  message: "output limit exceeded"
1165
1215
  }, void 0, true);
1166
1216
  },
1167
1217
  invoke: async (global, name, wire) => {
1168
1218
  const evaluation = this.active;
1169
- if (!this.ready || evaluation === void 0 || evaluation.settled) return refuse("binding call arrived without an active PTC evaluation");
1219
+ if (!this.ready || !evaluation) return refuse("binding call arrived without an active PTC evaluation");
1220
+ if (evaluation.settled) throw new Error("PTC evaluation ended before the binding completed");
1170
1221
  const functions = evaluation.bindings.get(global)?.functions;
1171
1222
  const fn = functions !== void 0 && Object.hasOwn(functions, name) ? functions[name] : void 0;
1172
1223
  if (!this.mode.retainsState && typeof fn !== "function") return refuse("program requested an undeclared binding");
@@ -1176,16 +1227,20 @@ var ProgramWorker = class {
1176
1227
  if (evaluation.pending >= this.config.maxPendingCalls || evaluation.pendingBytes + bytes > this.config.maxMessageBytes) return refuse("pending binding calls exceed configured limits");
1177
1228
  evaluation.pending += 1;
1178
1229
  evaluation.pendingBytes += bytes;
1230
+ let value;
1179
1231
  try {
1180
- const value = await evaluation.invoke(fn, args);
1181
- if (this.active !== evaluation || evaluation.settled) throw new Error("PTC evaluation ended before the binding completed");
1182
- return value;
1232
+ value = await evaluation.invoke(fn, args);
1233
+ } catch (error) {
1234
+ if (evaluation.settled) throw new Error("PTC evaluation ended before the binding completed");
1235
+ throw error;
1183
1236
  } finally {
1184
1237
  evaluation.pending -= 1;
1185
1238
  evaluation.pendingBytes -= bytes;
1186
1239
  }
1240
+ if (evaluation.settled) throw new Error("PTC evaluation ended before the binding completed");
1241
+ return value;
1187
1242
  }
1188
- }, [], (error, kind) => {
1243
+ }, ["revoke"], (error, kind) => {
1189
1244
  if (kind === "protocol") this.fail("protocol", error.message);
1190
1245
  else {
1191
1246
  if (kind === "io") this.controlFailure = error.message;
@@ -1333,13 +1388,13 @@ function resolveMode(config) {
1333
1388
  case "persistent-in-memory": return {
1334
1389
  format: "repl",
1335
1390
  retainsState: true,
1336
- executionInstructions: "The program contains TypeScript REPL statements; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level declarations and await are supported; top-level return is not supported. Emit output with console.log(...) or a final lossless JSON expression. Only printed values and that final expression become program output. Variables, functions, and imported modules remain in memory for this Agent across calls. Use await import(...) for modules. Direct filesystem access follows this execution's sandbox policy; process.env starts empty. Changing the session sandbox mode clears retained variables. An approved sandbox escalation runs in a separate temporary environment: it cannot access retained variables, and its declarations are discarded afterward. Restart, Agent disposal, cancellation, timeout, output overflow, or process failure clears the environment. If a variable is undefined, recreate it and reacquire its resources. State is not restored from the conversation, and failed evaluations can leave earlier mutations in memory. Redeclaring an existing let, const, or class name fails; assign to a mutable binding or use a new name. Await all tool calls; background callbacks cannot call tools after their evaluation ends. Await child-process completion before ending an evaluation; raw subprocess output belongs to whichever evaluation is active when it arrives.",
1391
+ executionInstructions: "The program contains TypeScript REPL statements; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level declarations and await are supported; top-level return is not supported. Emit output with console.log(...) or a final lossless JSON expression. Only printed values and that final expression become program output. Variables, functions, and imported modules remain in memory for this Agent across calls. Use await import(...) for modules. Direct filesystem access follows this execution's sandbox policy; process.env starts empty. Timeout and cancellation results say whether retained variables were preserved or cleared. Restart, sandbox changes, output overflow, or process failure clears them. Recreate missing variables and resources; conversation history does not restore state. Earlier mutations and tool effects are not rolled back. Approved sandbox escalations use a fresh environment and discard its variables afterward. Do not redeclare existing let, const, or class names; reuse mutable bindings or choose new names. Await tools and cleanup before returning; unfinished tools reject. After completion, timeout, or cancellation, new tool calls are rejected and captured output is discarded; background work may still change state. Await child-process completion before returning; raw output belongs to the active evaluation.",
1337
1392
  stripTypes: stripTypeScriptTypes
1338
1393
  };
1339
1394
  case "vm-script": {
1340
1395
  const lifetime = config.scriptPersistence ? "Variables, functions, and imported modules remain in memory for this Agent across calls." : "Each call runs in a fresh Node process.";
1341
1396
  const asynchronousFailure = "Await asynchronous work: an uncaught callback exception or unhandled rejection terminates the process" + (config.scriptPersistence ? " and clears its variables." : ".");
1342
- const recovery = config.scriptPersistence ? " Changing the session sandbox mode clears retained variables. An approved sandbox escalation runs in a separate temporary environment: it cannot access retained variables, and its declarations are discarded afterward. Restart, Agent disposal, cancellation, timeout, output overflow, or process failure clears the environment. If a variable is undefined, recreate it and reacquire its resources. State is not restored from the conversation, and failed evaluations can leave earlier mutations in memory. Redeclaring an existing let, const, or class name fails; assign to a mutable binding or use a new name. Await all tool calls; background callbacks cannot call tools after their evaluation ends. Await child-process completion before ending an evaluation; raw subprocess output belongs to whichever evaluation is active when it arrives. If a native top-level let, const, or class initializer throws, its name may remain permanently uninitialized; use a new name or restart the environment." : "";
1397
+ const recovery = config.scriptPersistence ? " Timeout and cancellation results say whether retained variables were preserved or cleared. Restart, sandbox changes, output overflow, or process failure clears them. Recreate missing variables and resources; conversation history does not restore state. Earlier mutations and tool effects are not rolled back. Approved sandbox escalations use a fresh environment and discard its variables afterward. Do not redeclare existing let, const, or class names; reuse mutable bindings or choose new names. Await tools and cleanup before returning; unfinished tools reject. After completion, timeout, or cancellation, new tool calls are rejected and captured output is discarded; background work may still change state. Await child-process completion before returning; raw output belongs to the active evaluation. If a native top-level let, const, or class initializer throws, its name may remain permanently uninitialized; use a new name or restart the environment." : "";
1343
1398
  return {
1344
1399
  format: "script",
1345
1400
  retainsState: config.scriptPersistence,