@songtonyli/dsh-cli 0.1.88 → 0.1.90
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.
- package/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/cordis/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-group/package.json +3 -3
- package/node_modules/@deepseek-ai/cordis-plugin-include/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-timer/package.json +3 -3
- package/node_modules/@deepseek-ai/cosmokit/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh/package.json +127 -125
- package/node_modules/@deepseek-ai/dsh-acp/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-acp-app/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-action-cards/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-agent/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +8 -6
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-agent-preset/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +7 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-api-account-controller/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-api-authorization-controller/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/index.js +10 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/index.js +7 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-api-job-controller/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-api-remote-access/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remote-access/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-remote-access/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-remote-access/lib/typert.host.js +5 -1
- package/node_modules/@deepseek-ai/dsh-api-remote-access/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +1541 -184
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/client/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +45 -44
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +6 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +6 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +56 -27
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +1426 -454
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +715 -57
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +560 -40
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/session.js +70 -35
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/transport.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +5 -102
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/assistant-stream.js +80 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/controller.js +294 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history/listener.js +297 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history.js +52 -341
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +98 -67
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/controller.js +289 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/state/listener.js +112 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/web/controller.js +139 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +77 -75
- package/node_modules/@deepseek-ai/dsh-api-settings-controller/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-app-boot/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-app-boot/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +143 -7
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-attachment/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-attachment/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-attachment/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-attachment/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/lib/types/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-attachment-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-authorization/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-base/package.json +100 -100
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-brand/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-chunked-list/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-client-file-upload/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-resources/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-action-cards/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +7 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +7 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +245 -76
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +290 -290
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +34 -34
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-creation-recommendations/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +19 -59
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-entry-customization/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-file-drag/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.md +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.zh.md +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +3 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +28 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +118 -69
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +15 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +164 -106
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-recommendations/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-secret-mask/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-session/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +4 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/lib/client.js +176 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/lib/client.js +42 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +10 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +5 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +29 -29
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +158 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/index.js +239 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/typert.host.js +75 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/typert.remote-client.js +64 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +43 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +8 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +36 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-commands/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-compaction-image-offload/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-computer-use/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-config-editor/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +98 -40
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +14 -6
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-creation-recommendations/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cua/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-cua/README.md +16 -7
- package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +16 -7
- package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +18 -38
- package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +342 -146
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.host.js +19 -20
- package/node_modules/@deepseek-ai/dsh-cua/lib/typert.remote-client.js +13 -14
- package/node_modules/@deepseek-ai/dsh-cua/package.json +53 -50
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.md +9 -9
- package/node_modules/@deepseek-ai/dsh-cua-bundle/README.zh.md +9 -9
- package/node_modules/@deepseek-ai/dsh-cua-bundle/package.json +12 -8
- package/node_modules/@deepseek-ai/dsh-deepseek-account/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-deliverable-file-references/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-deque/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/DETAIL.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/docs/DETAIL.zh.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/typert.host.js +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/typert.remote-client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +45 -45
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +135 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +135 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +8745 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +3131 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +2222 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +1284 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/package.json +117 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/README.i18n.yaml +43 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/README.md +121 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/README.zh.md +121 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/lib/client.js +6272 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-stats/package.json +71 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/docs/DETAIL.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/docs/DETAIL.zh.md +0 -17
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.md +100 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/README.zh.md +100 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/lib/index.js +495 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge/package.json +45 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.md +77 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/README.zh.md +77 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/cordis.patch.yml +17 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/icon.svg +11 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-bundle/package.json +53 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.zh.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/lib/index.js +813 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +47 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/README.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/README.zh.md +105 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/lib/index.js +844 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-forge-session/package.json +88 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/README.i18n.yaml +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/cordis.patch.yml +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/docs/DETAIL.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/docs/DETAIL.zh.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/package.json +7 -6
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.i18n.yaml +52 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.md +177 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/README.zh.md +177 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/cordis.patch.yml +17 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/icon.svg +12 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/client.js +7130 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/index.js +7781 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/owner-gateway/cli.js +370 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/retry-backoff-ccJYtzOj.js +121 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/typert.host.js +767 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/typert.remote-client.js +551 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/viewer-declarations-krUNq6VU.js +287 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/viewer-declarations.js +26 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/de.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/es.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/fr.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/ja.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/pt.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/ru.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +160 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/README.md +93 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/README.zh.md +93 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/lib/index.js +738 -0
- package/node_modules/@deepseek-ai/dsh-experimental-liveshare-protocol/package.json +37 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/DETAIL.md +1 -18
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/DETAIL.zh.md +1 -18
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/preview.svg +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/docs/preview.zh.svg +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/docs/DETAIL.md +0 -10
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/docs/DETAIL.zh.md +0 -10
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/docs/DETAIL.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/docs/DETAIL.zh.md +0 -16
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/docs/DETAIL.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/docs/DETAIL.zh.md +0 -15
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/de.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/en.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/es.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/fr.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/ja.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/pt.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/ru.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/locale/zh.json +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-experimental-translator/package.json +29 -29
- package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/index.js +213 -54
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/package.json +24 -25
- package/node_modules/@deepseek-ai/dsh-file-reference/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-file-reference-local/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-fs/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-goal/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-harness-dev-context/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-headless/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-hmr/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.md +2 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.zh.md +2 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/lib/index.js +5 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/index.js +10 -1
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/typert.host.js +1 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/typert.remote-client.js +1 -0
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/lib/types/index.js +13 -1
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-host-product-telemetry-otel/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-http-proxy/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-lazy-require/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +40 -3
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-llm/package.json +11 -10
- package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +264 -93
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +45 -45
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/index.js +8 -15
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/index.js +12 -17
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js +3 -2
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-resources/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-message-quotes/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-official-bundles/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-official-bundles/lib/index.js +6 -2
- package/node_modules/@deepseek-ai/dsh-official-bundles/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-otel/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.md +1 -0
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.zh.md +1 -0
- package/node_modules/@deepseek-ai/dsh-package-manifest/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-persona/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-personalized-recommendations/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-plugin-detail/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +8 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +8 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +166 -34
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +60 -37
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +37 -35
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/diagnostic.js +72 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +137 -31
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +26 -4
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/tools.js +1 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +43 -39
- package/node_modules/@deepseek-ai/dsh-plugin-market/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-plugin-market-index/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-plugin-recommendations/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.md +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.zh.md +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/lib/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +29 -29
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +50 -22
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +49 -21
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/configuration.js +24 -0
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +413 -597
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/persistent-process.js +5853 -125
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/process.js +5865 -91
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +31 -24
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/runner.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/types-DFdfvhLN.js +1411 -0
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +37 -37
- package/node_modules/@deepseek-ai/dsh-scope/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-sdk-app/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-session-format/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-catalog/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +6 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +5 -2
- package/node_modules/@deepseek-ai/dsh-session-projection/README.md +15 -0
- package/node_modules/@deepseek-ai/dsh-session-projection/README.zh.md +15 -0
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/index.js +4 -2
- package/node_modules/@deepseek-ai/dsh-session-projection/lib/types/index.js +3 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +41 -41
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-turn-outline/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-settings/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-shell/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-skill/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-skill/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.zh.md +3 -2
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/lib/index.js +14 -3
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-skill-office/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-spill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +35 -35
- package/node_modules/@deepseek-ai/dsh-storage/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-storage/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-storage/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-storage/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/lib/index.js +10 -12
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-storage-json/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-storage-json/README.md +9 -7
- package/node_modules/@deepseek-ai/dsh-storage-json/README.zh.md +9 -7
- package/node_modules/@deepseek-ai/dsh-storage-json/lib/index.js +50 -49
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +51 -51
- package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +6 -1
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +37 -37
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +789 -26
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-executor-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/index.js +9 -3
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/errors.js +2 -1
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ptc.js +7 -2
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/lib/types/ts-types.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-executor-ptc/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +8 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +36 -36
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.i18n.yaml +9 -6
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.md +19 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.zh.md +19 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/lib/index.js +21 -8
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-goal/lib/index.js +5 -10
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-present/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +35 -35
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-tool-session-query/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.i18n.yaml +23 -14
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.md +27 -8
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.zh.md +27 -8
- package/node_modules/@deepseek-ai/dsh-tool-skill/lib/index.js +27 -20
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.i18n.yaml +12 -12
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +7 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +7 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +145 -211
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +25 -27
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-tool-terminal/package.json +32 -32
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-tools/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +24 -8
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +85 -85
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-user-questions/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-user-questions/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-user-questions/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +7 -3
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-util-code-language/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-crypto/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-time/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-values/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-web/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +0 -3
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +150 -151
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.i18n.yaml +8 -8
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.md +6 -3
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.zh.md +6 -3
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/lib/index.js +32 -21
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{index-UeToUMuD.js → index--TtJvO-i.js} +84 -84
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{index-91FlLSYh.css → index-Jtzf36XE.css} +1 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{graphql-BIiNFDN_.js → graphql-C-Uijqkk.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{http-DIhnzaXE.js → http-CLu1VCSi.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{php-B4EoFdzs.js → php-CjQPq1Mz.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{rst-BHSXxbFM.js → rst-BuDKiyD7.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{ruby-DYyEMX7k.js → ruby-ZtjE4NPI.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{svelte-CwMGesqy.js → svelte-Tt81icjn.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/{vue-DgeFhH50.js → vue-B5SDFeDA.js} +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{vendor-D3p0kQ7Q.js → vendor-7utBqO4o.js} +25 -25
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +3 -3
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +21 -20
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-web-search-exa/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-win32-process/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/lib/index.js +5 -1
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-working-directory/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +23 -23
- package/node_modules/@deepseek-ai/schemastery/package.json +2 -2
- package/node_modules/acorn/CHANGELOG.md +1012 -0
- package/node_modules/acorn/LICENSE +21 -0
- package/node_modules/acorn/README.md +309 -0
- package/node_modules/acorn/bin/acorn +4 -0
- package/node_modules/acorn/dist/acorn.js +6370 -0
- package/node_modules/acorn/dist/acorn.mjs +6341 -0
- package/node_modules/acorn/dist/bin.js +90 -0
- package/node_modules/acorn/package.json +47 -0
- package/node_modules/acorn-walk/CHANGELOG.md +209 -0
- package/node_modules/{@deepseek-ai/dsh-experimental-worktree → acorn-walk}/LICENSE +5 -5
- package/node_modules/acorn-walk/README.md +124 -0
- package/node_modules/acorn-walk/dist/walk.js +485 -0
- package/node_modules/acorn-walk/dist/walk.mjs +467 -0
- package/node_modules/acorn-walk/package.json +47 -0
- package/node_modules/shell-quote/.github/FUNDING.yml +12 -0
- package/node_modules/shell-quote/LICENSE +24 -0
- package/node_modules/shell-quote/README.md +246 -0
- package/node_modules/shell-quote/index.js +4 -0
- package/node_modules/shell-quote/package.json +66 -0
- package/node_modules/shell-quote/parse.js +382 -0
- package/node_modules/shell-quote/quote.js +85 -0
- package/node_modules/shell-quote/tsconfig.json +10 -0
- package/package.json +346 -326
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.i18n.yaml +0 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.md +0 -91
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.zh.md +0 -91
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/lib/client.js +0 -93
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/lib/index.js +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/de.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/en.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/es.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/fr.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/ja.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/pt.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/ru.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/locale/zh.json +0 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/package.json +0 -59
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/directory.d.ts +0 -7
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/index.d.ts +0 -54
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/process.d.ts +0 -29
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/lib/types/types.d.ts +0 -20
|
@@ -1,14 +1,110 @@
|
|
|
1
1
|
import { stripTypeScriptTypes } from "node:module";
|
|
2
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
import { dirname, isAbsolute, resolve } from "node:path";
|
|
4
2
|
import { DUNDER_MEMBER, PORTABLE_RESERVED_WORDS, PtcRuntime, RESERVED_BINDING_GLOBALS, RESERVED_ERROR_MEMBERS } from "@deepseek-ai/dsh-ptc-runtime";
|
|
3
|
+
import { dirname, isAbsolute, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
import { assertNever, snapshotJsonValue } from "@deepseek-ai/dsh-util-values";
|
|
6
|
+
import z from "@deepseek-ai/schemastery";
|
|
5
7
|
import { MAX_TIMER_DELAY_MS, clampTimeout } from "@deepseek-ai/dsh-timeout";
|
|
8
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
9
|
import { SandboxUnavailableError, classifyRunnerFailure, isRunnerSpawnFailure } from "@deepseek-ai/dsh-sandbox";
|
|
7
|
-
import { assertNever, snapshotJsonValue } from "@deepseek-ai/dsh-util-values";
|
|
8
10
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
9
11
|
import { createBirpc } from "birpc";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
//#region lib/types/launch.js
|
|
13
|
+
/** Select source or built bootstrap assets in the mounted execution world. */
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the local carrier default or validate an explicit execution-world invocation.
|
|
16
|
+
* @param config - explicit remote or local worker configuration; omitted selects this carrier.
|
|
17
|
+
* @returns the worker invocation without guessing from the execution world's paths.
|
|
18
|
+
*/
|
|
19
|
+
function resolveLaunch(config) {
|
|
20
|
+
const launch = config ?? {
|
|
21
|
+
kind: "pkg" in process ? "embedded" : "node-script",
|
|
22
|
+
executable: process.execPath
|
|
23
|
+
};
|
|
24
|
+
if (launch.executable.length === 0) throw new Error("ptc-runtime-node: launch.executable must be non-empty");
|
|
25
|
+
if (launch.kind === "node-script" && launch.bootstrapPath !== void 0 && !isAbsolute(launch.bootstrapPath)) throw new Error("ptc-runtime-node: launch.bootstrapPath must be absolute");
|
|
26
|
+
return launch;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Select explicit arguments without inheriting host loader or inspector flags.
|
|
30
|
+
* @param fs - Filesystem mapping host bootstrap assets into the process world.
|
|
31
|
+
* @param config - resolved worker invocation.
|
|
32
|
+
* @param maxMessageBytes - Validated frame and queued-write limit.
|
|
33
|
+
* @param persistent - Whether the selected mode requires retained-process launch support.
|
|
34
|
+
* @returns Arguments following the resolved Node executable.
|
|
35
|
+
*/
|
|
36
|
+
function bootstrapArgs(fs, config, maxMessageBytes, persistent = false) {
|
|
37
|
+
switch (config.kind) {
|
|
38
|
+
case "embedded":
|
|
39
|
+
if (persistent) throw new Error("Persistent PTC requires a node-script launch");
|
|
40
|
+
return [String(maxMessageBytes)];
|
|
41
|
+
case "node-script": return scriptBootstrapArgs(fs, config.bootstrapPath, maxMessageBytes);
|
|
42
|
+
/* v8 ignore next -- Callers supply the resolved, closed LaunchConfig union. */
|
|
43
|
+
default: return assertNever(config);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function scriptBootstrapArgs(fs, bootstrapPath, maxMessageBytes) {
|
|
47
|
+
if (bootstrapPath !== void 0) return [bootstrapPath, String(maxMessageBytes)];
|
|
48
|
+
const mapped = (path) => {
|
|
49
|
+
const result = fs.processPathFromHostPath(path);
|
|
50
|
+
if (result === void 0) throw new Error(`PTC runtime bootstrap is unavailable in the subprocess execution world: ${path}`);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
/* v8 ignore next 3 -- built-lib.e2e.ts executes the bundled provider and sibling process.js under plain Node. */
|
|
54
|
+
if (!new URL(import.meta.url).pathname.endsWith(".ts")) return [mapped(fileURLToPath(new URL("./process.js", import.meta.url))), String(maxMessageBytes)];
|
|
55
|
+
const entry = mapped(fileURLToPath(new URL("./process.ts", import.meta.url)));
|
|
56
|
+
const helper = mapped(resolve(dirname(fileURLToPath(import.meta.resolve("@deepseek-ai/dsh-subprocess/package.json"))), "src/control.ts"));
|
|
57
|
+
return [
|
|
58
|
+
"--input-type=module",
|
|
59
|
+
"--eval",
|
|
60
|
+
`const {openInheritedControlChannel}=await import(${JSON.stringify(pathToFileURL(helper).href)});const {runNodeMain}=await import(${JSON.stringify(pathToFileURL(entry).href)});await runNodeMain(openInheritedControlChannel(),${maxMessageBytes},process);`
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region lib/types/config.js
|
|
65
|
+
/** Execution mode and resource limits for the Node PTC provider. */
|
|
66
|
+
/** Loader defaults for the Node PTC provider. */
|
|
67
|
+
const NodeConfig = z.object({
|
|
68
|
+
executionMode: z.union([
|
|
69
|
+
z.const("per-call"),
|
|
70
|
+
z.const("persistent-in-memory"),
|
|
71
|
+
z.const("vm-script")
|
|
72
|
+
]).default("per-call"),
|
|
73
|
+
scriptPersistence: z.boolean().default(false),
|
|
74
|
+
timeoutMs: z.number().default(12e4),
|
|
75
|
+
maxTimeoutMs: z.number().default(6e5),
|
|
76
|
+
maxOutputBytes: z.number().default(67108864),
|
|
77
|
+
maxOldGenerationSizeMb: z.number().default(512),
|
|
78
|
+
maxMessageBytes: z.number().default(134217728),
|
|
79
|
+
maxPendingCalls: z.number().default(128),
|
|
80
|
+
graceMs: z.number().default(3e3),
|
|
81
|
+
launch: z.union([z.object({
|
|
82
|
+
kind: z.const("node-script").required(),
|
|
83
|
+
executable: z.string().required(),
|
|
84
|
+
bootstrapPath: z.string()
|
|
85
|
+
}), z.object({
|
|
86
|
+
kind: z.const("embedded").required(),
|
|
87
|
+
executable: z.string().required()
|
|
88
|
+
})])
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Validate resolved Node limits and paths.
|
|
92
|
+
* @param config - Loader-defaulted fields with the selected executable.
|
|
93
|
+
*/
|
|
94
|
+
function validateConfig(config) {
|
|
95
|
+
if (config.scriptPersistence && config.executionMode !== "vm-script") throw new Error("ptc-runtime-node: scriptPersistence requires executionMode: vm-script");
|
|
96
|
+
for (const [key, value] of Object.entries(config)) if (typeof value === "number" && (!Number.isFinite(value) || value <= 0)) throw new Error(`ptc-runtime-node: ${key} must be positive and finite`);
|
|
97
|
+
for (const key of [
|
|
98
|
+
"timeoutMs",
|
|
99
|
+
"maxTimeoutMs",
|
|
100
|
+
"graceMs"
|
|
101
|
+
]) if (config[key] > MAX_TIMER_DELAY_MS) throw new Error(`ptc-runtime-node: ${key} exceeds the supported timer range`);
|
|
102
|
+
if (!Number.isSafeInteger(config.maxOutputBytes) || config.maxOutputBytes < 4) throw new Error("ptc-runtime-node: maxOutputBytes must be an integer of at least 4");
|
|
103
|
+
if (!Number.isSafeInteger(config.maxMessageBytes)) throw new Error("ptc-runtime-node: maxMessageBytes must be an integer");
|
|
104
|
+
if (!Number.isSafeInteger(config.maxPendingCalls)) throw new Error("ptc-runtime-node: maxPendingCalls must be an integer");
|
|
105
|
+
if (!Number.isSafeInteger(config.maxOldGenerationSizeMb)) throw new Error("ptc-runtime-node: maxOldGenerationSizeMb must be an integer");
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
12
108
|
//#region lib/types/json-wire.js
|
|
13
109
|
/**
|
|
14
110
|
* Lossless-JSON snapshots shared by the host and the source bootstrap closure.
|
|
@@ -321,14 +417,14 @@ async function invokeBinding(binding, args) {
|
|
|
321
417
|
/** birpc over newline-delimited JSON on the bounded private process channel. */
|
|
322
418
|
const stringify = JSON.stringify;
|
|
323
419
|
const parse = JSON.parse;
|
|
324
|
-
const messageOf$
|
|
420
|
+
const messageOf$1 = (error) => error instanceof Error ? error.message : String(error);
|
|
325
421
|
/**
|
|
326
422
|
* Connect typed methods over one control endpoint; execution owns all deadlines.
|
|
327
423
|
* @param stream - Owned control endpoint; `$close()` destroys it and rejects outstanding remote calls.
|
|
328
424
|
* @param maxMessageBytes - Maximum incoming JSON line and queued outgoing bytes.
|
|
329
425
|
* @param functions - Only these own methods may be called by the peer.
|
|
330
426
|
* @param eventNames - Remote methods sent as notifications without a response.
|
|
331
|
-
* @param failure - Receives the first I/O or malformed-message failure after
|
|
427
|
+
* @param failure - Receives the first I/O error, peer closure or malformed-message failure after the endpoint closes.
|
|
332
428
|
* @returns Typed remote calls and birpc lifetime controls.
|
|
333
429
|
*/
|
|
334
430
|
function createProcessRpc(stream, maxMessageBytes, functions, eventNames, failure) {
|
|
@@ -350,7 +446,7 @@ function createProcessRpc(stream, maxMessageBytes, functions, eventNames, failur
|
|
|
350
446
|
},
|
|
351
447
|
serialize: (message) => `${stringify(message.e === void 0 ? message : {
|
|
352
448
|
...message,
|
|
353
|
-
e: { message: messageOf$
|
|
449
|
+
e: { message: messageOf$1(message.e) }
|
|
354
450
|
})}\n`,
|
|
355
451
|
post: (line) => {
|
|
356
452
|
if (rpc.$closed) return;
|
|
@@ -391,179 +487,18 @@ function createProcessRpc(stream, maxMessageBytes, functions, eventNames, failur
|
|
|
391
487
|
}
|
|
392
488
|
});
|
|
393
489
|
stream.on("end", () => {
|
|
394
|
-
if (size === 0) fail(/* @__PURE__ */ new Error("control channel ended before the program settled"), "
|
|
490
|
+
if (size === 0) fail(/* @__PURE__ */ new Error("control channel ended before the program settled"), "closed");
|
|
395
491
|
else fail(/* @__PURE__ */ new Error("incomplete RPC message"), "protocol");
|
|
396
492
|
});
|
|
397
493
|
stream.on("error", (error) => {
|
|
398
494
|
fail(error, "io");
|
|
399
495
|
});
|
|
400
496
|
stream.on("close", () => {
|
|
401
|
-
fail(/* @__PURE__ */ new Error("control channel closed"), "
|
|
497
|
+
fail(/* @__PURE__ */ new Error("control channel closed"), "closed");
|
|
402
498
|
});
|
|
403
499
|
return rpc;
|
|
404
500
|
}
|
|
405
501
|
//#endregion
|
|
406
|
-
//#region lib/types/launch.js
|
|
407
|
-
/** Select source or built bootstrap assets in the mounted execution world. */
|
|
408
|
-
/**
|
|
409
|
-
* Resolve the local carrier default or validate an explicit execution-world invocation.
|
|
410
|
-
* @param config - explicit remote or local worker configuration; omitted selects this carrier.
|
|
411
|
-
* @returns the worker invocation without guessing from the execution world's paths.
|
|
412
|
-
*/
|
|
413
|
-
function resolveLaunch(config) {
|
|
414
|
-
const launch = config ?? {
|
|
415
|
-
kind: "pkg" in process ? "embedded" : "node-script",
|
|
416
|
-
executable: process.execPath
|
|
417
|
-
};
|
|
418
|
-
if (launch.executable.length === 0) throw new Error("ptc-runtime-node: launch.executable must be non-empty");
|
|
419
|
-
if (launch.kind === "node-script" && launch.bootstrapPath !== void 0 && !isAbsolute(launch.bootstrapPath)) throw new Error("ptc-runtime-node: launch.bootstrapPath must be absolute");
|
|
420
|
-
return launch;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Select explicit arguments without inheriting host loader or inspector flags.
|
|
424
|
-
* @param fs - Filesystem mapping host bootstrap assets into the process world.
|
|
425
|
-
* @param config - resolved worker invocation.
|
|
426
|
-
* @param maxMessageBytes - Validated message and queued-write limit.
|
|
427
|
-
* @param persistent - Select the in-memory REPL bootstrap instead of the one-shot evaluator.
|
|
428
|
-
* @returns Arguments following the resolved Node executable.
|
|
429
|
-
*/
|
|
430
|
-
function bootstrapArgs(fs, config, maxMessageBytes, persistent = false) {
|
|
431
|
-
switch (config.kind) {
|
|
432
|
-
case "embedded":
|
|
433
|
-
if (persistent) throw new Error("Persistent PTC requires a node-script launch");
|
|
434
|
-
return [String(maxMessageBytes)];
|
|
435
|
-
case "node-script": return scriptBootstrapArgs(fs, config.bootstrapPath, maxMessageBytes, persistent);
|
|
436
|
-
/* v8 ignore next -- Callers supply the resolved, closed LaunchConfig union. */
|
|
437
|
-
default: return assertNever(config);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
function scriptBootstrapArgs(fs, bootstrapPath, maxMessageBytes, persistent) {
|
|
441
|
-
const moduleName = persistent ? "persistent-process" : "process";
|
|
442
|
-
if (bootstrapPath !== void 0) return [bootstrapPath, String(maxMessageBytes)];
|
|
443
|
-
const mapped = (path) => {
|
|
444
|
-
const result = fs.processPathFromHostPath(path);
|
|
445
|
-
if (result === void 0) throw new Error(`PTC runtime bootstrap is unavailable in the subprocess execution world: ${path}`);
|
|
446
|
-
return result;
|
|
447
|
-
};
|
|
448
|
-
/* v8 ignore next 3 -- built-lib.e2e.ts executes the bundled provider and sibling process.js under plain Node. */
|
|
449
|
-
if (!new URL(import.meta.url).pathname.endsWith(".ts")) return [mapped(fileURLToPath(new URL(`./${moduleName}.js`, import.meta.url))), String(maxMessageBytes)];
|
|
450
|
-
const entry = mapped(fileURLToPath(new URL(`./${moduleName}.ts`, import.meta.url)));
|
|
451
|
-
const helper = mapped(resolve(dirname(fileURLToPath(import.meta.resolve("@deepseek-ai/dsh-subprocess/package.json"))), "src/control.ts"));
|
|
452
|
-
const main = persistent ? "runPersistentMain" : "runNodeMain";
|
|
453
|
-
return [
|
|
454
|
-
"--input-type=module",
|
|
455
|
-
"--eval",
|
|
456
|
-
`const {openInheritedControlChannel}=await import(${JSON.stringify(pathToFileURL(helper).href)});const {${main}}=await import(${JSON.stringify(pathToFileURL(entry).href)});await ${main}(openInheritedControlChannel(),${maxMessageBytes},process);`
|
|
457
|
-
];
|
|
458
|
-
}
|
|
459
|
-
//#endregion
|
|
460
|
-
//#region lib/types/config.js
|
|
461
|
-
/** Execution mode and resource limits for the Node PTC provider. */
|
|
462
|
-
/** Loader defaults for the Node PTC provider. */
|
|
463
|
-
const NodeConfig = z.object({
|
|
464
|
-
executionMode: z.union([z.const("per-call"), z.const("persistent-in-memory")]).default("per-call"),
|
|
465
|
-
timeoutMs: z.number().default(12e4),
|
|
466
|
-
maxTimeoutMs: z.number().default(6e5),
|
|
467
|
-
maxOutputBytes: z.number().default(67108864),
|
|
468
|
-
maxOldGenerationSizeMb: z.number().default(512),
|
|
469
|
-
maxMessageBytes: z.number().default(134217728),
|
|
470
|
-
maxPendingCalls: z.number().default(128),
|
|
471
|
-
graceMs: z.number().default(3e3),
|
|
472
|
-
launch: z.union([z.object({
|
|
473
|
-
kind: z.const("node-script").required(),
|
|
474
|
-
executable: z.string().required(),
|
|
475
|
-
bootstrapPath: z.string()
|
|
476
|
-
}), z.object({
|
|
477
|
-
kind: z.const("embedded").required(),
|
|
478
|
-
executable: z.string().required()
|
|
479
|
-
})])
|
|
480
|
-
});
|
|
481
|
-
/**
|
|
482
|
-
* Validate resolved Node limits and paths.
|
|
483
|
-
* @param config - Loader-defaulted fields with the selected executable.
|
|
484
|
-
*/
|
|
485
|
-
function validateConfig(config) {
|
|
486
|
-
for (const [key, value] of Object.entries(config)) if (typeof value === "number" && (!Number.isFinite(value) || value <= 0)) throw new Error(`ptc-runtime-node: ${key} must be positive and finite`);
|
|
487
|
-
for (const key of [
|
|
488
|
-
"timeoutMs",
|
|
489
|
-
"maxTimeoutMs",
|
|
490
|
-
"graceMs"
|
|
491
|
-
]) if (config[key] > MAX_TIMER_DELAY_MS) throw new Error(`ptc-runtime-node: ${key} exceeds the supported timer range`);
|
|
492
|
-
if (!Number.isSafeInteger(config.maxOutputBytes) || config.maxOutputBytes < 4) throw new Error("ptc-runtime-node: maxOutputBytes must be an integer of at least 4");
|
|
493
|
-
if (!Number.isSafeInteger(config.maxMessageBytes)) throw new Error("ptc-runtime-node: maxMessageBytes must be an integer");
|
|
494
|
-
if (!Number.isSafeInteger(config.maxPendingCalls)) throw new Error("ptc-runtime-node: maxPendingCalls must be an integer");
|
|
495
|
-
if (!Number.isSafeInteger(config.maxOldGenerationSizeMb)) throw new Error("ptc-runtime-node: maxOldGenerationSizeMb must be an integer");
|
|
496
|
-
}
|
|
497
|
-
//#endregion
|
|
498
|
-
//#region lib/types/policy-processes.js
|
|
499
|
-
/** Owns asynchronous process cleanup without delaying permission setters. */
|
|
500
|
-
var PolicyProcesses = class {
|
|
501
|
-
ctx;
|
|
502
|
-
processes = /* @__PURE__ */ new Set();
|
|
503
|
-
/**
|
|
504
|
-
* Begin cleanup on policy changes, even when no subsequent program runs.
|
|
505
|
-
* @param ctx - Node provider lifecycle and Session services.
|
|
506
|
-
*/
|
|
507
|
-
constructor(ctx) {
|
|
508
|
-
this.ctx = ctx;
|
|
509
|
-
ctx.on("session/event", (session, event) => {
|
|
510
|
-
if (event.type !== "sandbox/mode") return;
|
|
511
|
-
for (const process of this.processes) {
|
|
512
|
-
if (process.sessionId !== session.id || process.mode === event.data.mode) continue;
|
|
513
|
-
process.invalidated = true;
|
|
514
|
-
this.release(process).catch((error) => {
|
|
515
|
-
ctx.logger.warn(error);
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
}, { global: true });
|
|
519
|
-
ctx.effect(() => async () => {
|
|
520
|
-
await this.settle([...this.processes]);
|
|
521
|
-
}, "Node PTC policy cleanup");
|
|
522
|
-
}
|
|
523
|
-
/**
|
|
524
|
-
* Track an admitted call or retained process until its owner confirms cleanup.
|
|
525
|
-
* @param policy - Resolved process policy, including an optional Session identity.
|
|
526
|
-
* @param release - Idempotent cancellation and awaited cleanup.
|
|
527
|
-
* @returns Removal after successful process cleanup.
|
|
528
|
-
*/
|
|
529
|
-
register(policy, release) {
|
|
530
|
-
if (policy.sessionId === void 0) return () => {};
|
|
531
|
-
const session = this.ctx.get("sessions")?.get(policy.sessionId);
|
|
532
|
-
const process = {
|
|
533
|
-
sessionId: policy.sessionId,
|
|
534
|
-
mode: session === void 0 ? policy.mode : this.ctx.sandboxPolicy.resolve({ session }).mode,
|
|
535
|
-
release,
|
|
536
|
-
invalidated: false
|
|
537
|
-
};
|
|
538
|
-
this.processes.add(process);
|
|
539
|
-
return () => {
|
|
540
|
-
this.processes.delete(process);
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Wait for invalidated processes before admitting another program.
|
|
545
|
-
* @param sessionId - Session carried by the resolved policy.
|
|
546
|
-
* @returns Completion after prior cleanup; a failure rejects and remains retryable.
|
|
547
|
-
*/
|
|
548
|
-
async wait(sessionId) {
|
|
549
|
-
await this.settle([...this.processes].filter((process) => process.sessionId === sessionId && process.invalidated));
|
|
550
|
-
}
|
|
551
|
-
release(process) {
|
|
552
|
-
if (process.cleanup !== void 0) return process.cleanup;
|
|
553
|
-
process.cleanup = process.release().then(() => {
|
|
554
|
-
this.processes.delete(process);
|
|
555
|
-
}, (error) => {
|
|
556
|
-
delete process.cleanup;
|
|
557
|
-
throw error;
|
|
558
|
-
});
|
|
559
|
-
return process.cleanup;
|
|
560
|
-
}
|
|
561
|
-
async settle(processes) {
|
|
562
|
-
const failed = (await Promise.allSettled(processes.map((process) => this.release(process)))).find((result) => result.status === "rejected");
|
|
563
|
-
if (failed?.status === "rejected") throw failed.reason;
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
//#endregion
|
|
567
502
|
//#region lib/types/environment.js
|
|
568
503
|
/** Startup variables required by native executables before model evaluation. */
|
|
569
504
|
/** Native executable search, Windows system paths, and sandbox temporary paths retained in the OS environment. */
|
|
@@ -905,29 +840,16 @@ function readProgramResult(result) {
|
|
|
905
840
|
} } : { value };
|
|
906
841
|
}
|
|
907
842
|
//#endregion
|
|
908
|
-
//#region lib/types/
|
|
909
|
-
/** Node
|
|
910
|
-
const messageOf
|
|
911
|
-
function persistentOutput(maxBytes) {
|
|
912
|
-
return new OutputLedger(maxBytes, `retained variables were cleared; outer output exceeded ${maxBytes} bytes`);
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Compare requested extra grants without resolving paths in another execution world.
|
|
916
|
-
* @param left - one policy's additional roots.
|
|
917
|
-
* @param right - the other policy's additional roots.
|
|
918
|
-
* @returns whether both contain the same paths, ignoring order and duplicates.
|
|
919
|
-
*/
|
|
920
|
-
function sameAdditionalRoots(left, right) {
|
|
921
|
-
const effective = (roots) => [...new Set(roots ?? [])].sort();
|
|
922
|
-
const a = effective(left);
|
|
923
|
-
const b = effective(right);
|
|
924
|
-
return a.length === b.length && a.every((root, index) => root === b[index]);
|
|
925
|
-
}
|
|
843
|
+
//#region lib/types/worker.js
|
|
844
|
+
/** Managed Node process shared by temporary and owner-retained evaluations. */
|
|
845
|
+
const messageOf = (error) => error instanceof Error ? error.message : String(error);
|
|
926
846
|
/** One managed process; all mutable program state belongs to this process alone. */
|
|
927
|
-
var
|
|
847
|
+
var ProgramWorker = class {
|
|
928
848
|
ctx;
|
|
929
849
|
config;
|
|
930
850
|
policy;
|
|
851
|
+
mode;
|
|
852
|
+
retainsState;
|
|
931
853
|
unregister;
|
|
932
854
|
confined;
|
|
933
855
|
handle;
|
|
@@ -938,32 +860,55 @@ var Kernel = class {
|
|
|
938
860
|
cleanupPending = false;
|
|
939
861
|
ready = false;
|
|
940
862
|
stderr = "";
|
|
863
|
+
controlFailure;
|
|
941
864
|
stopped;
|
|
942
865
|
starting;
|
|
943
866
|
exitOutcome;
|
|
944
867
|
controller = new AbortController();
|
|
945
868
|
closed = false;
|
|
946
|
-
|
|
869
|
+
/** Whether termination succeeded and this process no longer needs cleanup retries. */
|
|
870
|
+
get cleanupComplete() {
|
|
871
|
+
return this.closed && !this.cleanupPending;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Own one process under a fixed file policy.
|
|
875
|
+
* @param ctx - Provider execution services.
|
|
876
|
+
* @param config - Validated resource limits and launch selection.
|
|
877
|
+
* @param policy - Authority retained for the lifetime of this process.
|
|
878
|
+
* @param processes - Session policy invalidation and cleanup coordination.
|
|
879
|
+
* @param mode - Evaluator syntax and TypeScript erasure.
|
|
880
|
+
* @param retainsState - Whether this process belongs to an owner and survives completed evaluations.
|
|
881
|
+
*/
|
|
882
|
+
constructor(ctx, config, policy, processes, mode, retainsState) {
|
|
947
883
|
this.ctx = ctx;
|
|
948
884
|
this.config = config;
|
|
949
885
|
this.policy = policy;
|
|
886
|
+
this.mode = mode;
|
|
887
|
+
this.retainsState = retainsState;
|
|
950
888
|
this.unregister = processes.register(policy, () => this.dispose());
|
|
951
889
|
}
|
|
890
|
+
/** Reject reuse until the previous evaluation and required cleanup settle. */
|
|
952
891
|
assertIdle() {
|
|
953
892
|
if (this.running) throw new Error("persistent PTC does not accept concurrent runs for one state owner");
|
|
954
893
|
if (this.cleanupPending) throw new Error("persistent PTC environment cleanup is incomplete; release the owner before running another program");
|
|
955
894
|
}
|
|
956
|
-
|
|
895
|
+
/**
|
|
896
|
+
* Evaluate a program, retaining this process only for an enabled state owner.
|
|
897
|
+
* @param spec - Resolved program inputs and cancellation.
|
|
898
|
+
* @param bindings - Current host binding implementations.
|
|
899
|
+
* @returns Output after any required process cleanup.
|
|
900
|
+
*/
|
|
901
|
+
async run(spec, bindings) {
|
|
957
902
|
this.running = true;
|
|
958
903
|
const sandbox = {
|
|
959
904
|
mode: this.policy.mode,
|
|
960
905
|
denied: false
|
|
961
906
|
};
|
|
962
907
|
try {
|
|
963
|
-
const result = await this.evaluate(spec, bindings
|
|
908
|
+
const result = await this.evaluate(spec, bindings);
|
|
964
909
|
if (this.confined !== void 0) {
|
|
965
910
|
sandbox.enforcement = this.confined.enforcement;
|
|
966
|
-
sandbox.denied
|
|
911
|
+
sandbox.denied ||= result.error?.kind !== "sandbox-unavailable" && this.confined.denialSignatures.some((signature) => result.error?.message.toLowerCase().includes(signature.toLowerCase()));
|
|
967
912
|
}
|
|
968
913
|
return {
|
|
969
914
|
...result,
|
|
@@ -973,45 +918,58 @@ var Kernel = class {
|
|
|
973
918
|
this.running = false;
|
|
974
919
|
}
|
|
975
920
|
}
|
|
976
|
-
|
|
921
|
+
output() {
|
|
922
|
+
return new OutputLedger(this.config.maxOutputBytes, this.retainsState ? `retained variables were cleared; outer output exceeded ${this.config.maxOutputBytes} bytes` : void 0);
|
|
923
|
+
}
|
|
924
|
+
message(message) {
|
|
925
|
+
return this.retainsState ? `${message}; retained variables were cleared` : message;
|
|
926
|
+
}
|
|
927
|
+
abortMessage(signal) {
|
|
928
|
+
return this.retainsState ? "execution canceled; retained variables were cleared" : messageOf(signal?.reason);
|
|
929
|
+
}
|
|
930
|
+
async evaluate(spec, bindings) {
|
|
977
931
|
if (this.exitOutcome !== void 0) {
|
|
978
|
-
const output =
|
|
932
|
+
const output = this.output();
|
|
979
933
|
const failure = spec.signal?.aborted ? {
|
|
980
934
|
kind: "abort",
|
|
981
|
-
message:
|
|
935
|
+
message: this.abortMessage(spec.signal)
|
|
982
936
|
} : {
|
|
983
937
|
kind: "worker-exit",
|
|
984
|
-
message:
|
|
938
|
+
message: this.message(this.exitMessage(this.exitOutcome))
|
|
985
939
|
};
|
|
986
940
|
try {
|
|
987
941
|
await this.stop();
|
|
988
942
|
} catch (error) {
|
|
989
943
|
return output.failure([], {
|
|
990
944
|
kind: "worker-exit",
|
|
991
|
-
message: `managed process cleanup failed: ${messageOf
|
|
945
|
+
message: `managed process cleanup failed: ${messageOf(error)}`
|
|
992
946
|
});
|
|
993
947
|
}
|
|
994
948
|
return output.failure([], failure);
|
|
995
949
|
}
|
|
996
950
|
this.stderr = "";
|
|
997
|
-
const output =
|
|
951
|
+
const output = this.output();
|
|
998
952
|
const logs = [];
|
|
953
|
+
let overflowed = false;
|
|
999
954
|
const result = Promise.withResolvers();
|
|
1000
955
|
const timer = spec.timeoutMs === null ? void 0 : setTimeout(() => {
|
|
1001
956
|
evaluation.finish({
|
|
1002
957
|
kind: "timeout",
|
|
1003
|
-
message: `execution deadline reached (${spec.timeoutMs}ms)
|
|
958
|
+
message: this.message(`execution deadline reached (${spec.timeoutMs}ms)`)
|
|
1004
959
|
}, void 0, true);
|
|
1005
960
|
}, spec.timeoutMs);
|
|
1006
961
|
const onAbort = () => {
|
|
1007
962
|
evaluation.finish({
|
|
1008
963
|
kind: "abort",
|
|
1009
|
-
message:
|
|
964
|
+
message: this.abortMessage(spec.signal)
|
|
1010
965
|
}, void 0, true);
|
|
1011
966
|
};
|
|
1012
967
|
const evaluation = {
|
|
968
|
+
settled: false,
|
|
1013
969
|
data: {
|
|
1014
|
-
code,
|
|
970
|
+
code: "",
|
|
971
|
+
programFormat: this.mode.format,
|
|
972
|
+
retainsState: this.retainsState,
|
|
1015
973
|
maxOutputBytes: this.config.maxOutputBytes,
|
|
1016
974
|
namespaces: [...bindings.values()].map((binding) => ({
|
|
1017
975
|
global: binding.global,
|
|
@@ -1025,7 +983,9 @@ var Kernel = class {
|
|
|
1025
983
|
pending: 0,
|
|
1026
984
|
pendingBytes: 0,
|
|
1027
985
|
admit: (text) => {
|
|
986
|
+
if (overflowed) return;
|
|
1028
987
|
if (!output.admit(text, logs)) {
|
|
988
|
+
overflowed = true;
|
|
1029
989
|
logs.push(text);
|
|
1030
990
|
evaluation.finish({
|
|
1031
991
|
kind: "output-limit",
|
|
@@ -1034,20 +994,23 @@ var Kernel = class {
|
|
|
1034
994
|
}
|
|
1035
995
|
},
|
|
1036
996
|
finish: (error, value, discard = false) => {
|
|
1037
|
-
if (
|
|
997
|
+
if (evaluation.settled) return;
|
|
998
|
+
evaluation.settled = true;
|
|
1038
999
|
clearTimeout(timer);
|
|
1039
1000
|
spec.signal?.removeEventListener("abort", onAbort);
|
|
1040
|
-
|
|
1041
|
-
const outcome =
|
|
1042
|
-
(discard || outcome.error?.kind === "output-limit" ||
|
|
1043
|
-
|
|
1001
|
+
const complete = () => overflowed || error?.kind === "output-limit" ? output.limit(logs) : error ? output.failure(logs, error) : output.success(logs, value);
|
|
1002
|
+
const outcome = complete();
|
|
1003
|
+
(discard || outcome.error?.kind === "output-limit" || !this.retainsState ? this.stop() : Promise.resolve(true)).then((drained) => {
|
|
1004
|
+
this.active = void 0;
|
|
1005
|
+
result.resolve(drained ? complete() : output.failure(logs, {
|
|
1044
1006
|
kind: "worker-exit",
|
|
1045
1007
|
message: "managed process exited but its output did not drain cleanly"
|
|
1046
1008
|
}));
|
|
1047
1009
|
}, (failure) => {
|
|
1010
|
+
this.active = void 0;
|
|
1048
1011
|
result.resolve(output.failure(logs, {
|
|
1049
1012
|
kind: "worker-exit",
|
|
1050
|
-
message: `managed process cleanup failed: ${messageOf
|
|
1013
|
+
message: `managed process cleanup failed: ${messageOf(failure)}`
|
|
1051
1014
|
}));
|
|
1052
1015
|
});
|
|
1053
1016
|
}
|
|
@@ -1055,19 +1018,31 @@ var Kernel = class {
|
|
|
1055
1018
|
this.active = evaluation;
|
|
1056
1019
|
spec.signal?.addEventListener("abort", onAbort, { once: true });
|
|
1057
1020
|
if (spec.signal?.aborted) onAbort();
|
|
1058
|
-
else if (this.ready) this.dispatch(evaluation);
|
|
1059
1021
|
else {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1022
|
+
try {
|
|
1023
|
+
evaluation.data.code = this.mode.stripTypes(spec.program);
|
|
1024
|
+
} catch (error) {
|
|
1025
|
+
evaluation.finish({
|
|
1026
|
+
kind: "exception",
|
|
1027
|
+
message: messageOf(error)
|
|
1028
|
+
});
|
|
1029
|
+
return await result.promise;
|
|
1030
|
+
}
|
|
1031
|
+
if (this.ready) this.dispatch(evaluation);
|
|
1032
|
+
else {
|
|
1033
|
+
this.starting = this.start(spec.cwd);
|
|
1034
|
+
this.starting.catch((error) => {
|
|
1035
|
+
this.fail(error instanceof SandboxUnavailableError || this.confined !== void 0 && isRunnerSpawnFailure(error, this.confined.argv[0], spec.cwd) ? "sandbox-unavailable" : "worker-exit", messageOf(error));
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1064
1038
|
}
|
|
1065
1039
|
return await result.promise;
|
|
1066
1040
|
}
|
|
1041
|
+
/** Cancel active work and await managed process termination and output drainage. */
|
|
1067
1042
|
async dispose() {
|
|
1068
1043
|
this.active?.finish({
|
|
1069
1044
|
kind: "abort",
|
|
1070
|
-
message: "PTC environment disposed
|
|
1045
|
+
message: this.message("PTC environment disposed")
|
|
1071
1046
|
}, void 0, true);
|
|
1072
1047
|
await this.stop();
|
|
1073
1048
|
}
|
|
@@ -1078,13 +1053,13 @@ var Kernel = class {
|
|
|
1078
1053
|
this.controller.abort();
|
|
1079
1054
|
this.channel?.$close();
|
|
1080
1055
|
this.stopped = (async () => {
|
|
1081
|
-
await this.starting?.catch(() => {});
|
|
1056
|
+
await this.starting?.catch((_error) => {});
|
|
1082
1057
|
const handle = this.handle;
|
|
1083
1058
|
return handle === void 0 || await terminateProcess(handle, this.config.graceMs);
|
|
1084
1059
|
})().then((drained) => {
|
|
1085
1060
|
this.unregister?.();
|
|
1086
1061
|
this.cleanupPending = false;
|
|
1087
|
-
if (!drained) this.ctx.logger.warn("
|
|
1062
|
+
if (!drained) this.ctx.logger.warn("Node process exited but its output did not drain cleanly");
|
|
1088
1063
|
return drained;
|
|
1089
1064
|
}, (error) => {
|
|
1090
1065
|
this.stopped = void 0;
|
|
@@ -1095,35 +1070,41 @@ var Kernel = class {
|
|
|
1095
1070
|
fail(kind, message) {
|
|
1096
1071
|
if (this.active) this.active.finish({
|
|
1097
1072
|
kind,
|
|
1098
|
-
message:
|
|
1073
|
+
message: this.message(message)
|
|
1099
1074
|
}, void 0, true);
|
|
1100
1075
|
else {
|
|
1101
1076
|
if (!this.closed) this.ctx.logger.warn(message);
|
|
1102
1077
|
this.stop().catch((error) => {
|
|
1103
|
-
this.ctx.logger.warn(messageOf
|
|
1078
|
+
this.ctx.logger.warn(messageOf(error));
|
|
1104
1079
|
});
|
|
1105
1080
|
}
|
|
1106
1081
|
}
|
|
1107
1082
|
dispatch(evaluation) {
|
|
1108
1083
|
this.channel?.run(evaluation.spec.cwd, evaluation.data).then((raw) => {
|
|
1084
|
+
if (evaluation.settled) return;
|
|
1109
1085
|
const { error, value } = readProgramResult(raw);
|
|
1110
1086
|
setImmediate(() => {
|
|
1111
1087
|
evaluation.finish(error, value);
|
|
1112
1088
|
});
|
|
1113
1089
|
}).catch((error) => {
|
|
1114
|
-
if (this.active === evaluation && !this.channel?.$closed) this.fail("protocol", messageOf
|
|
1090
|
+
if (this.active === evaluation && !this.channel?.$closed) this.fail("protocol", messageOf(error));
|
|
1115
1091
|
});
|
|
1116
1092
|
}
|
|
1093
|
+
withControlFailure(message) {
|
|
1094
|
+
return this.controlFailure === void 0 ? message : `${message}; control channel failed: ${this.controlFailure}`;
|
|
1095
|
+
}
|
|
1117
1096
|
exitMessage(outcome) {
|
|
1118
|
-
return `Node process exited (${String(outcome.exitCode)}, signal ${String(outcome.signal)})${this.stderr ? `: ${this.stderr}` : ""}
|
|
1097
|
+
return this.withControlFailure(`Node process exited (${String(outcome.exitCode)}, signal ${String(outcome.signal)})${this.stderr ? `: ${this.stderr}` : ""}`);
|
|
1119
1098
|
}
|
|
1120
1099
|
async start(cwd) {
|
|
1121
1100
|
const executable = await this.ctx.subprocess.resolveExecutable(this.config.launch.executable, void 0, this.controller.signal);
|
|
1122
1101
|
if (this.closed) return;
|
|
1102
|
+
const packaged = this.config.launch.kind === "embedded";
|
|
1103
|
+
const heapFlag = `--max-old-space-size=${this.config.maxOldGenerationSizeMb}`;
|
|
1123
1104
|
const argv = [
|
|
1124
1105
|
executable,
|
|
1125
|
-
|
|
1126
|
-
...bootstrapArgs(this.ctx.fs, this.config.launch, this.config.maxMessageBytes,
|
|
1106
|
+
...packaged ? [] : [heapFlag],
|
|
1107
|
+
...bootstrapArgs(this.ctx.fs, this.config.launch, this.config.maxMessageBytes, this.retainsState)
|
|
1127
1108
|
];
|
|
1128
1109
|
const policy = this.policy;
|
|
1129
1110
|
this.confined = policy.mode === "danger-full-access" ? void 0 : await this.ctx.sandbox.confine(argv, {
|
|
@@ -1132,6 +1113,10 @@ var Kernel = class {
|
|
|
1132
1113
|
}, this.controller.signal);
|
|
1133
1114
|
if (this.closed) return;
|
|
1134
1115
|
const env = Object.fromEntries(Object.keys(process.env).filter((key) => !STARTUP_ENVIRONMENT_NAMES.has(key.toUpperCase()) && key.toUpperCase() !== "ELECTRON_RUN_AS_NODE").map((key) => [key, void 0]));
|
|
1116
|
+
if (packaged) {
|
|
1117
|
+
env.DSH_PTC_RUNTIME_NODE = "1";
|
|
1118
|
+
env.NODE_OPTIONS = heapFlag;
|
|
1119
|
+
}
|
|
1135
1120
|
const handle = this.ctx.subprocess.spawn({
|
|
1136
1121
|
argv: this.confined?.argv ?? argv,
|
|
1137
1122
|
cwd,
|
|
@@ -1145,7 +1130,7 @@ var Kernel = class {
|
|
|
1145
1130
|
graceMs: this.config.graceMs
|
|
1146
1131
|
});
|
|
1147
1132
|
this.handle = handle;
|
|
1148
|
-
if (!handle.control || !handle.stdout || !handle.stderr) throw new Error("subprocess provider did not supply
|
|
1133
|
+
if (!handle.control || !handle.stdout || !handle.stderr) throw new Error("subprocess provider did not supply the requested control and output pipes");
|
|
1149
1134
|
for (const stream of [handle.stdout, handle.stderr]) {
|
|
1150
1135
|
stream.setEncoding("utf8");
|
|
1151
1136
|
stream.on("data", (text) => {
|
|
@@ -1163,18 +1148,18 @@ var Kernel = class {
|
|
|
1163
1148
|
this.channel = createProcessRpc(handle.control, this.config.maxMessageBytes, {
|
|
1164
1149
|
ready: () => {
|
|
1165
1150
|
if (this.ready || !this.active) {
|
|
1166
|
-
this.fail("protocol", "
|
|
1151
|
+
this.fail("protocol", "duplicate program readiness");
|
|
1167
1152
|
return;
|
|
1168
1153
|
}
|
|
1169
1154
|
this.ready = true;
|
|
1170
1155
|
this.dispatch(this.active);
|
|
1171
1156
|
},
|
|
1172
1157
|
log: (text) => {
|
|
1173
|
-
if (this.active === void 0 || typeof text !== "string") this.fail("protocol", "invalid
|
|
1158
|
+
if (!this.ready || this.active === void 0 || typeof text !== "string") this.fail("protocol", "invalid program log");
|
|
1174
1159
|
else this.active.admit(text);
|
|
1175
1160
|
},
|
|
1176
1161
|
outputLimit: () => {
|
|
1177
|
-
if (this.active === void 0) this.fail("protocol", "idle
|
|
1162
|
+
if (!this.ready || this.active === void 0) this.fail("protocol", "idle PTC output limit");
|
|
1178
1163
|
else this.active.finish({
|
|
1179
1164
|
kind: "output-limit",
|
|
1180
1165
|
message: "output limit exceeded"
|
|
@@ -1182,18 +1167,19 @@ var Kernel = class {
|
|
|
1182
1167
|
},
|
|
1183
1168
|
invoke: async (global, name, wire) => {
|
|
1184
1169
|
const evaluation = this.active;
|
|
1185
|
-
if (evaluation === void 0) return refuse("
|
|
1170
|
+
if (!this.ready || evaluation === void 0 || evaluation.settled) return refuse("binding call arrived without an active PTC evaluation");
|
|
1171
|
+
const functions = evaluation.bindings.get(global)?.functions;
|
|
1172
|
+
const fn = functions !== void 0 && Object.hasOwn(functions, name) ? functions[name] : void 0;
|
|
1173
|
+
if (!this.mode.retainsState && typeof fn !== "function") return refuse("program requested an undeclared binding");
|
|
1186
1174
|
const args = decodePtcJsonWire(wire);
|
|
1187
1175
|
if (args === void 0) return refuse("binding arguments must be lossless JSON");
|
|
1188
1176
|
const bytes = Buffer.byteLength(JSON.stringify(wire));
|
|
1189
1177
|
if (evaluation.pending >= this.config.maxPendingCalls || evaluation.pendingBytes + bytes > this.config.maxMessageBytes) return refuse("pending binding calls exceed configured limits");
|
|
1190
|
-
const functions = evaluation.bindings.get(global)?.functions;
|
|
1191
|
-
const fn = functions !== void 0 && Object.hasOwn(functions, name) ? functions[name] : void 0;
|
|
1192
1178
|
evaluation.pending += 1;
|
|
1193
1179
|
evaluation.pendingBytes += bytes;
|
|
1194
1180
|
try {
|
|
1195
1181
|
const value = await evaluation.invoke(fn, args);
|
|
1196
|
-
if (this.active !== evaluation) throw new Error("PTC evaluation ended before the binding completed");
|
|
1182
|
+
if (this.active !== evaluation || evaluation.settled) throw new Error("PTC evaluation ended before the binding completed");
|
|
1197
1183
|
return value;
|
|
1198
1184
|
} finally {
|
|
1199
1185
|
evaluation.pending -= 1;
|
|
@@ -1202,9 +1188,12 @@ var Kernel = class {
|
|
|
1202
1188
|
}
|
|
1203
1189
|
}, [], (error, kind) => {
|
|
1204
1190
|
if (kind === "protocol") this.fail("protocol", error.message);
|
|
1205
|
-
else
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1191
|
+
else {
|
|
1192
|
+
if (kind === "io") this.controlFailure = error.message;
|
|
1193
|
+
setImmediate(() => {
|
|
1194
|
+
if (!this.closed && this.exitOutcome === void 0) handle.terminate();
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1208
1197
|
});
|
|
1209
1198
|
handle.done.then(async (outcome) => {
|
|
1210
1199
|
this.exitOutcome = outcome;
|
|
@@ -1213,105 +1202,95 @@ var Kernel = class {
|
|
|
1213
1202
|
if (!this.closed) this.fail(this.confined !== void 0 && classifyRunnerFailure(outcome.exitCode, this.stderr, this.confined.runnerFailureRules) !== void 0 ? "sandbox-unavailable" : "worker-exit", this.exitMessage(outcome));
|
|
1214
1203
|
});
|
|
1215
1204
|
}, (error) => {
|
|
1216
|
-
this.fail("worker-exit", messageOf
|
|
1205
|
+
this.fail(this.confined !== void 0 && isRunnerSpawnFailure(error, this.confined.argv[0], cwd) ? "sandbox-unavailable" : "worker-exit", this.withControlFailure(messageOf(error)));
|
|
1217
1206
|
});
|
|
1218
1207
|
}
|
|
1219
1208
|
};
|
|
1220
|
-
|
|
1221
|
-
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region lib/types/execution.js
|
|
1211
|
+
/** Select program syntax and own temporary or retained Node processes. */
|
|
1212
|
+
/**
|
|
1213
|
+
* Select program semantics and create their shared process owner.
|
|
1214
|
+
* @param ctx - Provider lifecycle and execution services.
|
|
1215
|
+
* @param config - Validated configuration with loader defaults.
|
|
1216
|
+
* @param processes - Policy invalidation and process cleanup coordination.
|
|
1217
|
+
* @returns Mode selection and temporary or retained execution through one process implementation.
|
|
1218
|
+
*/
|
|
1219
|
+
function createExecution(ctx, config, processes) {
|
|
1220
|
+
return new NodeExecution(ctx, config, processes, resolveMode(config));
|
|
1221
|
+
}
|
|
1222
|
+
/** Temporary processes and optional object-owned reuse share one process implementation. */
|
|
1223
|
+
var NodeExecution = class {
|
|
1222
1224
|
ctx;
|
|
1223
1225
|
config;
|
|
1224
1226
|
processes;
|
|
1225
|
-
|
|
1226
|
-
* Model-facing rules for retained variables, authority, output, and recovery.
|
|
1227
|
-
* @returns Usage guidance appended to the run_code schema.
|
|
1228
|
-
*/
|
|
1229
|
-
get executionInstructions() {
|
|
1230
|
-
return "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.";
|
|
1231
|
-
}
|
|
1227
|
+
mode;
|
|
1232
1228
|
owners = /* @__PURE__ */ new WeakMap();
|
|
1233
|
-
|
|
1234
|
-
disposed = false;
|
|
1229
|
+
workers = /* @__PURE__ */ new Set();
|
|
1235
1230
|
/**
|
|
1236
|
-
* Own
|
|
1231
|
+
* Own process instances and optional owner lookup for one provider.
|
|
1237
1232
|
* @param ctx - Provider lifecycle and execution services.
|
|
1238
1233
|
* @param config - Validated limits and selected executable.
|
|
1239
1234
|
* @param processes - Provider-owned policy invalidation and cleanup.
|
|
1235
|
+
* @param mode - Program syntax and TypeScript erasure.
|
|
1240
1236
|
*/
|
|
1241
|
-
constructor(ctx, config, processes) {
|
|
1237
|
+
constructor(ctx, config, processes, mode) {
|
|
1242
1238
|
this.ctx = ctx;
|
|
1243
1239
|
this.config = config;
|
|
1244
1240
|
this.processes = processes;
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1241
|
+
this.mode = mode;
|
|
1242
|
+
if (mode.retainsState && this.config.launch.kind === "embedded") throw new Error("Persistent PTC requires a node-script launch");
|
|
1243
|
+
}
|
|
1244
|
+
/** Stop every owned process, retaining failed cleanup for a later retry. */
|
|
1245
|
+
async dispose() {
|
|
1246
|
+
const failed = (await Promise.allSettled([...this.workers].map(async (worker) => {
|
|
1247
|
+
await worker.dispose();
|
|
1248
|
+
this.workers.delete(worker);
|
|
1249
|
+
}))).find((result) => result.status === "rejected");
|
|
1250
|
+
if (failed?.status === "rejected") throw failed.reason;
|
|
1253
1251
|
}
|
|
1254
1252
|
/**
|
|
1255
|
-
* Resolve the file policy, directory and deadline
|
|
1253
|
+
* Resolve the common file policy, directory and deadline defaults.
|
|
1256
1254
|
* @param request - Program, bindings, owner, directory and elapsed budget.
|
|
1257
1255
|
* @returns Resolved inputs with the selected file policy.
|
|
1258
1256
|
*/
|
|
1259
1257
|
resolve(request) {
|
|
1260
|
-
if (this.disposed) throw new Error("persistent PTC: resolve after disposal");
|
|
1261
1258
|
const sandboxPolicy = request.sandboxPolicy ?? this.ctx.sandboxPolicy.resolve();
|
|
1262
1259
|
const cwd = request.cwd ?? sandboxPolicy.workspaceRoot;
|
|
1263
|
-
if (!isAbsolute(cwd)) throw new Error("persistent PTC: cwd must be absolute
|
|
1260
|
+
if (!isAbsolute(cwd)) throw new Error(`${this.mode.retainsState ? "persistent PTC" : "ptc-runtime-node"}: cwd must be absolute`);
|
|
1264
1261
|
return {
|
|
1265
1262
|
...request,
|
|
1266
1263
|
sandboxPolicy,
|
|
1267
1264
|
cwd,
|
|
1268
|
-
timeoutMs: request.timeoutMs === null ? null : clampTimeout(request.timeoutMs, this.config.timeoutMs, this.config.maxTimeoutMs, "persistent PTC timeoutMs")
|
|
1265
|
+
timeoutMs: request.timeoutMs === null ? null : clampTimeout(request.timeoutMs, this.config.timeoutMs, this.config.maxTimeoutMs, this.mode.retainsState ? "persistent PTC timeoutMs" : "ptc-runtime-node: timeoutMs")
|
|
1269
1266
|
};
|
|
1270
1267
|
}
|
|
1271
1268
|
/**
|
|
1272
|
-
* Evaluate
|
|
1269
|
+
* Evaluate in a temporary process or reuse an enabled state owner's process.
|
|
1273
1270
|
* @param spec - Resolved request; concurrent calls for one owner are rejected.
|
|
1274
|
-
* @returns
|
|
1271
|
+
* @returns Captured logs, JSON completion, or a structured execution failure.
|
|
1275
1272
|
*/
|
|
1276
1273
|
async run(spec) {
|
|
1277
|
-
if (
|
|
1278
|
-
if (
|
|
1274
|
+
if (spec.sandboxPolicy === void 0) throw new Error("ptc-runtime-node: run requires a resolved sandbox policy");
|
|
1275
|
+
if (!isAbsolute(spec.cwd) || spec.timeoutMs !== null && (!Number.isFinite(spec.timeoutMs) || spec.timeoutMs <= 0 || spec.timeoutMs > this.config.maxTimeoutMs)) throw new Error("ptc-runtime-node: run requires resolved cwd and timeout");
|
|
1279
1276
|
const bindings = validateBindings(spec);
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
const output = persistentOutput(this.config.maxOutputBytes);
|
|
1288
|
-
const outcome = output.failure([], {
|
|
1289
|
-
kind: "exception",
|
|
1290
|
-
message: messageOf$1(error)
|
|
1291
|
-
});
|
|
1292
|
-
if (outcome.error?.kind === "output-limit" && spec.stateOwner !== void 0) try {
|
|
1293
|
-
await this.release(spec.stateOwner);
|
|
1294
|
-
} catch (failure) {
|
|
1295
|
-
return output.failure([], {
|
|
1296
|
-
kind: "worker-exit",
|
|
1297
|
-
message: `managed process cleanup failed: ${messageOf$1(failure)}`
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
return outcome;
|
|
1301
|
-
}
|
|
1302
|
-
if (!kernel || kernel.closed) {
|
|
1303
|
-
if (kernel) this.kernels.delete(kernel);
|
|
1304
|
-
kernel = new Kernel(this.ctx, this.config, {
|
|
1277
|
+
const owner = this.mode.retainsState ? spec.stateOwner : void 0;
|
|
1278
|
+
let worker = owner === void 0 ? void 0 : this.owners.get(owner);
|
|
1279
|
+
worker?.assertIdle();
|
|
1280
|
+
if (worker && !worker.closed && (worker.policy.mode !== spec.sandboxPolicy.mode || worker.policy.workspaceRoot !== spec.sandboxPolicy.workspaceRoot || worker.policy.sessionId !== spec.sandboxPolicy.sessionId || !sameAdditionalRoots(worker.policy.additionalWritableRoots, spec.sandboxPolicy.additionalWritableRoots))) throw new Error("persistent PTC: release the retained environment before changing its sandbox policy");
|
|
1281
|
+
if (!worker || worker.closed) {
|
|
1282
|
+
if (worker) this.workers.delete(worker);
|
|
1283
|
+
worker = new ProgramWorker(this.ctx, this.config, {
|
|
1305
1284
|
...spec.sandboxPolicy,
|
|
1306
1285
|
...spec.sandboxPolicy.additionalWritableRoots === void 0 ? {} : { additionalWritableRoots: [...spec.sandboxPolicy.additionalWritableRoots] }
|
|
1307
|
-
}, this.processes);
|
|
1308
|
-
this.
|
|
1309
|
-
if (
|
|
1286
|
+
}, this.processes, this.mode, owner !== void 0);
|
|
1287
|
+
this.workers.add(worker);
|
|
1288
|
+
if (owner !== void 0) this.owners.set(owner, worker);
|
|
1310
1289
|
}
|
|
1311
1290
|
try {
|
|
1312
|
-
return await
|
|
1291
|
+
return await worker.run(spec, bindings);
|
|
1313
1292
|
} finally {
|
|
1314
|
-
if (
|
|
1293
|
+
if (owner === void 0 && worker.cleanupComplete) this.workers.delete(worker);
|
|
1315
1294
|
}
|
|
1316
1295
|
}
|
|
1317
1296
|
/**
|
|
@@ -1320,21 +1299,130 @@ var InMemoryExecution = class {
|
|
|
1320
1299
|
* @returns Completion after the owned process and output streams stop.
|
|
1321
1300
|
*/
|
|
1322
1301
|
async release(owner) {
|
|
1323
|
-
const
|
|
1324
|
-
if (!
|
|
1325
|
-
await
|
|
1326
|
-
if (this.owners.get(owner) ===
|
|
1327
|
-
this.
|
|
1302
|
+
const worker = this.owners.get(owner);
|
|
1303
|
+
if (!worker) return;
|
|
1304
|
+
await worker.dispose();
|
|
1305
|
+
if (this.owners.get(owner) === worker) this.owners.delete(owner);
|
|
1306
|
+
this.workers.delete(worker);
|
|
1328
1307
|
}
|
|
1329
1308
|
};
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1309
|
+
/**
|
|
1310
|
+
* Compare requested extra grants without resolving paths in another execution world.
|
|
1311
|
+
* @param left - one policy's additional roots.
|
|
1312
|
+
* @param right - the other policy's additional roots.
|
|
1313
|
+
* @returns whether both contain the same paths, ignoring order and duplicates.
|
|
1314
|
+
*/
|
|
1315
|
+
function sameAdditionalRoots(left, right) {
|
|
1316
|
+
const effective = (roots) => [...new Set(roots ?? [])].sort();
|
|
1317
|
+
const a = effective(left);
|
|
1318
|
+
const b = effective(right);
|
|
1319
|
+
return a.length === b.length && a.every((root, index) => root === b[index]);
|
|
1320
|
+
}
|
|
1333
1321
|
const STRIP_PREFIX = "async function __dsh_program__() {\n";
|
|
1334
1322
|
const STRIP_SUFFIX = "\n}";
|
|
1335
|
-
function
|
|
1336
|
-
|
|
1323
|
+
function resolveMode(config) {
|
|
1324
|
+
switch (config.executionMode) {
|
|
1325
|
+
case "per-call": return {
|
|
1326
|
+
format: "function-body",
|
|
1327
|
+
retainsState: false,
|
|
1328
|
+
executionInstructions: "The program is the body of an async TypeScript function; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level await and return are supported. Emit output with console.log(...) or return a lossless JSON value. Only printed values and the returned value become program output. Each call runs in a fresh Node process. Node APIs are available through await import(...). Relative paths use the supplied working directory; process.env starts empty. Direct filesystem access follows this execution's sandbox policy.",
|
|
1329
|
+
stripTypes(program) {
|
|
1330
|
+
const stripped = stripTypeScriptTypes(STRIP_PREFIX + program + STRIP_SUFFIX);
|
|
1331
|
+
return stripped.slice(35, stripped.length - 2);
|
|
1332
|
+
}
|
|
1333
|
+
};
|
|
1334
|
+
case "persistent-in-memory": return {
|
|
1335
|
+
format: "repl",
|
|
1336
|
+
retainsState: true,
|
|
1337
|
+
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.",
|
|
1338
|
+
stripTypes: stripTypeScriptTypes
|
|
1339
|
+
};
|
|
1340
|
+
case "vm-script": {
|
|
1341
|
+
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.";
|
|
1342
|
+
const asynchronousFailure = "Await asynchronous work: an uncaught callback exception or unhandled rejection terminates the process" + (config.scriptPersistence ? " and clears its variables." : ".");
|
|
1343
|
+
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." : "";
|
|
1344
|
+
return {
|
|
1345
|
+
format: "script",
|
|
1346
|
+
retainsState: config.scriptPersistence,
|
|
1347
|
+
executionInstructions: "The program contains TypeScript script 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. The final expression is awaited if it is a Promise. Only printed values and that final expression become program output. " + lifetime + " Use await import(...) for modules. Relative paths use the supplied working directory. Direct filesystem access follows this execution's sandbox policy; process.env starts empty. " + asynchronousFailure + " Values from bindings and imports can belong to another realm; use Array.isArray for arrays and the supplied binding error classes for failures, because instanceof Array or Error may be false." + recovery,
|
|
1348
|
+
stripTypes: stripTypeScriptTypes
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
/* v8 ignore next -- Loader validates the closed execution-mode union before selection. */
|
|
1352
|
+
default: return assertNever(config.executionMode);
|
|
1353
|
+
}
|
|
1337
1354
|
}
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region lib/types/policy-processes.js
|
|
1357
|
+
/** Owns asynchronous process cleanup without delaying permission setters. */
|
|
1358
|
+
var PolicyProcesses = class {
|
|
1359
|
+
ctx;
|
|
1360
|
+
processes = /* @__PURE__ */ new Set();
|
|
1361
|
+
/**
|
|
1362
|
+
* Begin cleanup on policy changes, even when no subsequent program runs.
|
|
1363
|
+
* @param ctx - Node provider lifecycle and Session services.
|
|
1364
|
+
*/
|
|
1365
|
+
constructor(ctx) {
|
|
1366
|
+
this.ctx = ctx;
|
|
1367
|
+
ctx.on("session/event", (session, event) => {
|
|
1368
|
+
if (event.type !== "sandbox/mode") return;
|
|
1369
|
+
for (const process of this.processes) {
|
|
1370
|
+
if (process.sessionId !== session.id || process.mode === event.data.mode) continue;
|
|
1371
|
+
process.invalidated = true;
|
|
1372
|
+
this.release(process).catch((error) => {
|
|
1373
|
+
ctx.logger.warn(error);
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
}, { global: true });
|
|
1377
|
+
ctx.effect(() => async () => {
|
|
1378
|
+
await this.settle([...this.processes]);
|
|
1379
|
+
}, "Node PTC policy cleanup");
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* Track an admitted call or retained process until its owner confirms cleanup.
|
|
1383
|
+
* @param policy - Resolved process policy, including an optional Session identity.
|
|
1384
|
+
* @param release - Idempotent cancellation and awaited cleanup.
|
|
1385
|
+
* @returns Removal after successful process cleanup.
|
|
1386
|
+
*/
|
|
1387
|
+
register(policy, release) {
|
|
1388
|
+
if (policy.sessionId === void 0) return () => {};
|
|
1389
|
+
const session = this.ctx.get("sessions")?.get(policy.sessionId);
|
|
1390
|
+
const process = {
|
|
1391
|
+
sessionId: policy.sessionId,
|
|
1392
|
+
mode: session === void 0 ? policy.mode : this.ctx.sandboxPolicy.resolve({ session }).mode,
|
|
1393
|
+
release,
|
|
1394
|
+
invalidated: false
|
|
1395
|
+
};
|
|
1396
|
+
this.processes.add(process);
|
|
1397
|
+
return () => {
|
|
1398
|
+
this.processes.delete(process);
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Wait for invalidated processes before admitting another program.
|
|
1403
|
+
* @param sessionId - Session carried by the resolved policy.
|
|
1404
|
+
* @returns Completion after prior cleanup; a failure rejects and remains retryable.
|
|
1405
|
+
*/
|
|
1406
|
+
async wait(sessionId) {
|
|
1407
|
+
await this.settle([...this.processes].filter((process) => process.sessionId === sessionId && process.invalidated));
|
|
1408
|
+
}
|
|
1409
|
+
release(process) {
|
|
1410
|
+
if (process.cleanup !== void 0) return process.cleanup;
|
|
1411
|
+
process.cleanup = process.release().then(() => {
|
|
1412
|
+
this.processes.delete(process);
|
|
1413
|
+
}, (error) => {
|
|
1414
|
+
delete process.cleanup;
|
|
1415
|
+
throw error;
|
|
1416
|
+
});
|
|
1417
|
+
return process.cleanup;
|
|
1418
|
+
}
|
|
1419
|
+
async settle(processes) {
|
|
1420
|
+
const failed = (await Promise.allSettled(processes.map((process) => this.release(process)))).find((result) => result.status === "rejected");
|
|
1421
|
+
if (failed?.status === "rejected") throw failed.reason;
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
//#endregion
|
|
1425
|
+
//#region lib/types/index.js
|
|
1338
1426
|
/** Node execution under file policy, with optional owner-scoped retained memory. */
|
|
1339
1427
|
var NodePtcRuntime = class extends PtcRuntime {
|
|
1340
1428
|
static inject = [
|
|
@@ -1346,14 +1434,16 @@ var NodePtcRuntime = class extends PtcRuntime {
|
|
|
1346
1434
|
static Config = NodeConfig;
|
|
1347
1435
|
language = "typescript";
|
|
1348
1436
|
isolation = "process";
|
|
1349
|
-
|
|
1437
|
+
execution;
|
|
1350
1438
|
processes;
|
|
1351
1439
|
get programFormat() {
|
|
1352
|
-
return this.
|
|
1440
|
+
return this.execution.mode.format;
|
|
1441
|
+
}
|
|
1442
|
+
get retainsState() {
|
|
1443
|
+
return this.execution.mode.retainsState;
|
|
1353
1444
|
}
|
|
1354
1445
|
get executionInstructions() {
|
|
1355
|
-
|
|
1356
|
-
return "The program is the body of an async TypeScript function; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level await and return are supported. Emit output with console.log(...) or return a lossless JSON value. Only printed values and the returned value become program output. Each call runs in a fresh Node process. Node APIs are available through await import(...). Relative paths use the supplied working directory; process.env starts empty. Direct filesystem access follows this execution's sandbox policy.";
|
|
1446
|
+
return this.execution.mode.executionInstructions;
|
|
1357
1447
|
}
|
|
1358
1448
|
config;
|
|
1359
1449
|
live = /* @__PURE__ */ new Set();
|
|
@@ -1366,19 +1456,20 @@ var NodePtcRuntime = class extends PtcRuntime {
|
|
|
1366
1456
|
};
|
|
1367
1457
|
validateConfig(this.config);
|
|
1368
1458
|
this.processes = new PolicyProcesses(ctx);
|
|
1369
|
-
|
|
1459
|
+
this.execution = createExecution(ctx, this.config, this.processes);
|
|
1370
1460
|
ctx.effect(() => async () => {
|
|
1371
1461
|
this.disposed = true;
|
|
1372
1462
|
const active = [...this.live];
|
|
1373
1463
|
for (const run of active) run.controller.abort("runtime disposed");
|
|
1374
|
-
await Promise.
|
|
1464
|
+
const failed = (await Promise.allSettled([this.execution.dispose(), ...active.map((run) => run.finished)])).find((result) => result.status === "rejected");
|
|
1465
|
+
if (failed?.status === "rejected") throw failed.reason;
|
|
1375
1466
|
}, "Node ptc-runtime cleanup");
|
|
1376
1467
|
}
|
|
1377
1468
|
get sandboxMode() {
|
|
1378
1469
|
return this.ctx.sandboxPolicy.defaultMode;
|
|
1379
1470
|
}
|
|
1380
1471
|
release(owner) {
|
|
1381
|
-
return this.
|
|
1472
|
+
return this.execution.release(owner);
|
|
1382
1473
|
}
|
|
1383
1474
|
get timeout() {
|
|
1384
1475
|
return {
|
|
@@ -1392,17 +1483,11 @@ var NodePtcRuntime = class extends PtcRuntime {
|
|
|
1392
1483
|
* @returns Complete execution inputs with a capped numeric budget or an explicit null deadline.
|
|
1393
1484
|
*/
|
|
1394
1485
|
resolve(request) {
|
|
1395
|
-
if (this.
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
return {
|
|
1401
|
-
...request,
|
|
1402
|
-
cwd,
|
|
1403
|
-
timeoutMs: request.timeoutMs === null ? null : clampTimeout(request.timeoutMs, this.config.timeoutMs, this.config.maxTimeoutMs, "ptc-runtime-node: timeoutMs"),
|
|
1404
|
-
sandboxPolicy
|
|
1405
|
-
};
|
|
1486
|
+
if (this.disposed) {
|
|
1487
|
+
const source = this.retainsState ? "persistent PTC" : "ptc-runtime-node";
|
|
1488
|
+
throw new Error(`${source}: resolve after disposal`);
|
|
1489
|
+
}
|
|
1490
|
+
return this.execution.resolve(request);
|
|
1406
1491
|
}
|
|
1407
1492
|
/**
|
|
1408
1493
|
* Run a resolved program under the configured execution mode.
|
|
@@ -1425,287 +1510,18 @@ var NodePtcRuntime = class extends PtcRuntime {
|
|
|
1425
1510
|
this.live.add(live);
|
|
1426
1511
|
try {
|
|
1427
1512
|
await this.processes.wait(spec.sandboxPolicy?.sessionId);
|
|
1428
|
-
if (this.
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
}
|
|
1435
|
-
if (spec.sandboxPolicy === void 0) throw new Error("ptc-runtime-node: run requires a resolved sandbox policy");
|
|
1436
|
-
if (!isAbsolute(spec.cwd) || spec.timeoutMs !== null && (!Number.isFinite(spec.timeoutMs) || spec.timeoutMs <= 0 || spec.timeoutMs > this.config.maxTimeoutMs)) throw new Error("ptc-runtime-node: run requires resolved cwd and timeout");
|
|
1437
|
-
const bindings = validateBindings(spec);
|
|
1438
|
-
return await this.execute(spec, spec.sandboxPolicy, bindings, controller);
|
|
1513
|
+
if (this.disposed) throw new Error(`${this.retainsState ? "persistent PTC" : "ptc-runtime-node"}: run after disposal`);
|
|
1514
|
+
const signal = spec.signal === void 0 ? controller.signal : AbortSignal.any([spec.signal, controller.signal]);
|
|
1515
|
+
return await this.execution.run({
|
|
1516
|
+
...spec,
|
|
1517
|
+
signal
|
|
1518
|
+
});
|
|
1439
1519
|
} finally {
|
|
1440
1520
|
unregister?.();
|
|
1441
1521
|
this.live.delete(live);
|
|
1442
1522
|
completion.resolve();
|
|
1443
1523
|
}
|
|
1444
1524
|
}
|
|
1445
|
-
async execute(spec, policy, bindings, controller) {
|
|
1446
|
-
const callBinding = AsyncLocalStorage.bind(invokeBinding);
|
|
1447
|
-
const output = new OutputLedger(this.config.maxOutputBytes);
|
|
1448
|
-
const logs = [];
|
|
1449
|
-
const sandbox = {
|
|
1450
|
-
mode: policy.mode,
|
|
1451
|
-
denied: false
|
|
1452
|
-
};
|
|
1453
|
-
const result = Promise.withResolvers();
|
|
1454
|
-
const signal = spec.signal === void 0 ? controller.signal : AbortSignal.any([spec.signal, controller.signal]);
|
|
1455
|
-
let handle;
|
|
1456
|
-
let channel;
|
|
1457
|
-
let confined;
|
|
1458
|
-
let settled = false;
|
|
1459
|
-
let timedOut = false;
|
|
1460
|
-
let outputOverflow = false;
|
|
1461
|
-
let overflowResult;
|
|
1462
|
-
let stderr = "";
|
|
1463
|
-
let parsing = true;
|
|
1464
|
-
const wallTimer = spec.timeoutMs === null ? void 0 : setTimeout(() => {
|
|
1465
|
-
timedOut = true;
|
|
1466
|
-
controller.abort("execution deadline reached");
|
|
1467
|
-
}, spec.timeoutMs);
|
|
1468
|
-
let stopping;
|
|
1469
|
-
const stop = () => {
|
|
1470
|
-
if (stopping !== void 0) return stopping;
|
|
1471
|
-
stopping = (handle === void 0 ? Promise.resolve(true) : terminateProcess(handle, this.config.graceMs)).then((drained) => {
|
|
1472
|
-
unregister();
|
|
1473
|
-
return drained;
|
|
1474
|
-
}, (error) => {
|
|
1475
|
-
stopping = void 0;
|
|
1476
|
-
throw error;
|
|
1477
|
-
});
|
|
1478
|
-
return stopping;
|
|
1479
|
-
};
|
|
1480
|
-
const finish = (failure, value) => {
|
|
1481
|
-
if (settled) return;
|
|
1482
|
-
settled = true;
|
|
1483
|
-
clearTimeout(wallTimer);
|
|
1484
|
-
signal.removeEventListener("abort", onAbort);
|
|
1485
|
-
channel?.$close();
|
|
1486
|
-
(async () => {
|
|
1487
|
-
try {
|
|
1488
|
-
if (!await stop() && failure === void 0) failure = {
|
|
1489
|
-
kind: "worker-exit",
|
|
1490
|
-
message: "Node process output did not close cleanly"
|
|
1491
|
-
};
|
|
1492
|
-
} catch (error) {
|
|
1493
|
-
failure = {
|
|
1494
|
-
kind: "worker-exit",
|
|
1495
|
-
message: `managed process cleanup failed: ${messageOf(error)}`
|
|
1496
|
-
};
|
|
1497
|
-
}
|
|
1498
|
-
const outcome = outputOverflow ? overflowResult ?? output.limit(logs) : failure === void 0 ? output.success(logs, value) : output.failure(logs, failure);
|
|
1499
|
-
result.resolve({
|
|
1500
|
-
...outcome,
|
|
1501
|
-
sandbox: { ...sandbox }
|
|
1502
|
-
});
|
|
1503
|
-
})();
|
|
1504
|
-
};
|
|
1505
|
-
const onAbort = () => {
|
|
1506
|
-
finish(timedOut ? {
|
|
1507
|
-
kind: "timeout",
|
|
1508
|
-
message: `execution deadline reached (${spec.timeoutMs}ms)`
|
|
1509
|
-
} : {
|
|
1510
|
-
kind: "abort",
|
|
1511
|
-
message: messageOf(signal.reason)
|
|
1512
|
-
});
|
|
1513
|
-
};
|
|
1514
|
-
const unregister = this.processes.register(policy, async () => {
|
|
1515
|
-
controller.abort(/* @__PURE__ */ new Error("sandbox mode changed"));
|
|
1516
|
-
await stop();
|
|
1517
|
-
});
|
|
1518
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
1519
|
-
if (signal.aborted) onAbort();
|
|
1520
|
-
try {
|
|
1521
|
-
if (settled) return await result.promise;
|
|
1522
|
-
const stripped = stripTypeScriptTypes(STRIP_PREFIX + spec.program + STRIP_SUFFIX);
|
|
1523
|
-
parsing = false;
|
|
1524
|
-
const data = {
|
|
1525
|
-
code: stripped.slice(35, stripped.length - 2),
|
|
1526
|
-
namespaces: [...bindings.values()].map((binding) => ({
|
|
1527
|
-
global: binding.global,
|
|
1528
|
-
names: Object.keys(binding.functions),
|
|
1529
|
-
...binding.errorClass ? { errorClass: binding.errorClass } : {}
|
|
1530
|
-
})),
|
|
1531
|
-
maxOutputBytes: this.config.maxOutputBytes
|
|
1532
|
-
};
|
|
1533
|
-
const executable = await this.ctx.subprocess.resolveExecutable(this.config.launch.executable, void 0, signal);
|
|
1534
|
-
if (settled) return await result.promise;
|
|
1535
|
-
const packaged = this.config.launch.kind === "embedded";
|
|
1536
|
-
const heapFlag = `--max-old-space-size=${this.config.maxOldGenerationSizeMb}`;
|
|
1537
|
-
const argv = [
|
|
1538
|
-
executable,
|
|
1539
|
-
...packaged ? [] : [heapFlag],
|
|
1540
|
-
...bootstrapArgs(this.ctx.fs, this.config.launch, this.config.maxMessageBytes)
|
|
1541
|
-
];
|
|
1542
|
-
confined = policy.mode === "danger-full-access" ? void 0 : await this.ctx.sandbox.confine(argv, {
|
|
1543
|
-
...policy,
|
|
1544
|
-
mode: policy.mode
|
|
1545
|
-
}, signal);
|
|
1546
|
-
if (settled) return await result.promise;
|
|
1547
|
-
if (confined !== void 0) sandbox.enforcement = confined.enforcement;
|
|
1548
|
-
const env = Object.fromEntries(Object.keys(process.env).filter((key) => !STARTUP_ENVIRONMENT_NAMES.has(key.toUpperCase()) && key.toUpperCase() !== "ELECTRON_RUN_AS_NODE").map((key) => [key, void 0]));
|
|
1549
|
-
if (packaged) {
|
|
1550
|
-
env.DSH_PTC_RUNTIME_NODE = "1";
|
|
1551
|
-
env.NODE_OPTIONS = heapFlag;
|
|
1552
|
-
}
|
|
1553
|
-
handle = this.ctx.subprocess.spawn({
|
|
1554
|
-
argv: confined?.argv ?? argv,
|
|
1555
|
-
cwd: spec.cwd,
|
|
1556
|
-
env,
|
|
1557
|
-
stdio: {
|
|
1558
|
-
stdin: "ignore",
|
|
1559
|
-
stdout: "pipe",
|
|
1560
|
-
stderr: "pipe",
|
|
1561
|
-
control: "pipe"
|
|
1562
|
-
},
|
|
1563
|
-
graceMs: this.config.graceMs,
|
|
1564
|
-
signal
|
|
1565
|
-
});
|
|
1566
|
-
const launched = handle;
|
|
1567
|
-
if (launched.control === void 0 || launched.stdout === void 0 || launched.stderr === void 0) throw new Error("subprocess provider did not supply the requested control and output pipes");
|
|
1568
|
-
const admit = (text) => {
|
|
1569
|
-
if (outputOverflow) return;
|
|
1570
|
-
if (!output.admit(text, logs)) {
|
|
1571
|
-
outputOverflow = true;
|
|
1572
|
-
overflowResult = output.limit([...logs, text]);
|
|
1573
|
-
finish({
|
|
1574
|
-
kind: "output-limit",
|
|
1575
|
-
message: `outer output exceeded ${this.config.maxOutputBytes} bytes`
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
const stdoutDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
1580
|
-
const stderrDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
1581
|
-
handle.stdout?.on("data", (chunk) => {
|
|
1582
|
-
const text = stdoutDecoder.decode(chunk, { stream: true });
|
|
1583
|
-
if (text.length > 0) admit(text);
|
|
1584
|
-
});
|
|
1585
|
-
handle.stdout?.on("end", () => {
|
|
1586
|
-
const text = stdoutDecoder.decode();
|
|
1587
|
-
if (text.length > 0) admit(text);
|
|
1588
|
-
});
|
|
1589
|
-
handle.stdout?.on("error", (error) => {
|
|
1590
|
-
finish({
|
|
1591
|
-
kind: "worker-exit",
|
|
1592
|
-
message: messageOf(error)
|
|
1593
|
-
});
|
|
1594
|
-
});
|
|
1595
|
-
handle.stderr?.on("data", (chunk) => {
|
|
1596
|
-
const text = stderrDecoder.decode(chunk, { stream: true });
|
|
1597
|
-
stderr = (stderr + text).slice(-this.config.maxOutputBytes);
|
|
1598
|
-
if (text.length > 0) admit(text);
|
|
1599
|
-
});
|
|
1600
|
-
handle.stderr?.on("end", () => {
|
|
1601
|
-
const text = stderrDecoder.decode();
|
|
1602
|
-
if (text.length > 0) admit(text);
|
|
1603
|
-
});
|
|
1604
|
-
handle.stderr?.on("error", (error) => {
|
|
1605
|
-
finish({
|
|
1606
|
-
kind: "worker-exit",
|
|
1607
|
-
message: messageOf(error)
|
|
1608
|
-
});
|
|
1609
|
-
});
|
|
1610
|
-
let ready = false;
|
|
1611
|
-
let pending = 0;
|
|
1612
|
-
let pendingBytes = 0;
|
|
1613
|
-
const protocolFailure = (message) => {
|
|
1614
|
-
finish({
|
|
1615
|
-
kind: "protocol",
|
|
1616
|
-
message
|
|
1617
|
-
});
|
|
1618
|
-
};
|
|
1619
|
-
const processFinished = (outcome) => {
|
|
1620
|
-
if (settled) return;
|
|
1621
|
-
finish(confined !== void 0 && classifyRunnerFailure(outcome.exitCode, stderr, confined.runnerFailureRules) !== void 0 ? {
|
|
1622
|
-
kind: "sandbox-unavailable",
|
|
1623
|
-
message: stderr
|
|
1624
|
-
} : {
|
|
1625
|
-
kind: "worker-exit",
|
|
1626
|
-
message: `Node process exited before completing (${String(outcome.exitCode)})${stderr ? `: ${stderr}` : ""}`
|
|
1627
|
-
});
|
|
1628
|
-
};
|
|
1629
|
-
const refuse = (message) => {
|
|
1630
|
-
protocolFailure(message);
|
|
1631
|
-
throw new Error(message);
|
|
1632
|
-
};
|
|
1633
|
-
const transport = createProcessRpc(launched.control, this.config.maxMessageBytes, {
|
|
1634
|
-
ready: () => {
|
|
1635
|
-
if (ready) {
|
|
1636
|
-
protocolFailure("duplicate program readiness");
|
|
1637
|
-
return;
|
|
1638
|
-
}
|
|
1639
|
-
ready = true;
|
|
1640
|
-
transport.run(spec.cwd, data).then((raw) => {
|
|
1641
|
-
if (settled) return;
|
|
1642
|
-
const { error, value } = readProgramResult(raw);
|
|
1643
|
-
if (error !== void 0) {
|
|
1644
|
-
if (confined !== void 0) sandbox.denied = confined.denialSignatures.some((signature) => error.message.toLowerCase().includes(signature.toLowerCase()));
|
|
1645
|
-
if (error.kind === "output-limit") outputOverflow = true;
|
|
1646
|
-
}
|
|
1647
|
-
finish(error, value);
|
|
1648
|
-
}).catch((error) => {
|
|
1649
|
-
protocolFailure(messageOf(error));
|
|
1650
|
-
});
|
|
1651
|
-
},
|
|
1652
|
-
log: (text) => {
|
|
1653
|
-
if (typeof text === "string") admit(text);
|
|
1654
|
-
else protocolFailure("invalid program log");
|
|
1655
|
-
},
|
|
1656
|
-
outputLimit: () => {
|
|
1657
|
-
outputOverflow = true;
|
|
1658
|
-
finish();
|
|
1659
|
-
},
|
|
1660
|
-
invoke: async (global, name, wire) => {
|
|
1661
|
-
const functions = bindings.get(global)?.functions;
|
|
1662
|
-
const fn = functions !== void 0 && Object.hasOwn(functions, name) ? functions[name] : void 0;
|
|
1663
|
-
if (typeof fn !== "function") return refuse("program requested an undeclared binding");
|
|
1664
|
-
const args = decodePtcJsonWire(wire);
|
|
1665
|
-
if (args === void 0) return refuse("binding arguments must be lossless JSON");
|
|
1666
|
-
const bytes = Buffer.byteLength(JSON.stringify(wire));
|
|
1667
|
-
if (pending >= this.config.maxPendingCalls || pendingBytes + bytes > this.config.maxMessageBytes) return refuse("pending binding calls exceed configured limits");
|
|
1668
|
-
pending += 1;
|
|
1669
|
-
pendingBytes += bytes;
|
|
1670
|
-
try {
|
|
1671
|
-
return await callBinding(fn, args);
|
|
1672
|
-
} finally {
|
|
1673
|
-
pending -= 1;
|
|
1674
|
-
pendingBytes -= bytes;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}, [], (error, kind) => {
|
|
1678
|
-
if (kind === "protocol") protocolFailure(messageOf(error));
|
|
1679
|
-
else if (ready) finish({
|
|
1680
|
-
kind: "worker-exit",
|
|
1681
|
-
message: messageOf(error)
|
|
1682
|
-
});
|
|
1683
|
-
else launched.done.then(processFinished, (failure) => {
|
|
1684
|
-
finish({
|
|
1685
|
-
kind: "worker-exit",
|
|
1686
|
-
message: messageOf(failure)
|
|
1687
|
-
});
|
|
1688
|
-
});
|
|
1689
|
-
});
|
|
1690
|
-
channel = transport;
|
|
1691
|
-
launched.done.then((outcome) => {
|
|
1692
|
-
setImmediate(() => {
|
|
1693
|
-
processFinished(outcome);
|
|
1694
|
-
});
|
|
1695
|
-
}, (error) => {
|
|
1696
|
-
finish({
|
|
1697
|
-
kind: confined !== void 0 && isRunnerSpawnFailure(error, confined.argv[0], spec.cwd) ? "sandbox-unavailable" : "worker-exit",
|
|
1698
|
-
message: messageOf(error)
|
|
1699
|
-
});
|
|
1700
|
-
});
|
|
1701
|
-
} catch (error) {
|
|
1702
|
-
finish({
|
|
1703
|
-
kind: error instanceof SandboxUnavailableError ? "sandbox-unavailable" : parsing ? "exception" : "worker-exit",
|
|
1704
|
-
message: messageOf(error)
|
|
1705
|
-
});
|
|
1706
|
-
}
|
|
1707
|
-
return await result.promise;
|
|
1708
|
-
}
|
|
1709
1525
|
};
|
|
1710
1526
|
//#endregion
|
|
1711
1527
|
export { NodePtcRuntime, NodePtcRuntime as default };
|