@qqbrowser/qbot-dsh 0.0.5 → 0.0.6
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/config/agent-presets/minimal/agent.cordis.yml +1 -1
- package/lib/bin.js +2 -2
- package/lib/{dump-config-k4Eekk03.js → dump-config-DRyeYoJB.js} +1 -1
- package/lib/{plugin-BVDd3xNU.js → plugin-peKc7sV-.js} +1 -1
- package/lib/profile-boot-BAgU8KvC.js +5 -0
- package/lib/profile-boot-KD3x0Z2S.js +1 -0
- package/node_modules/@deepseek-ai/cordis-plugin-hmr/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-agent/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-agent-default-model/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-agent-instructions/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-agent-loop/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-agent-presets/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-agent-tool-presentation/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-anonymous-user-id/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-api-gateway/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-api-remotes/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-app-boot/lib/index.js +12 -12
- package/node_modules/@qqbrowser/qbot-dsh-app-boot/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-atomic-write/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-attachment/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-attachment-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-base/cordis.patch.yml +4 -4
- package/node_modules/@qqbrowser/qbot-dsh-base/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-bash-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-bash-sandbox/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-brand/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-connection/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-hmr/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-locale/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-locale/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-modules/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-modules/lib/index.js +3 -3
- package/node_modules/@qqbrowser/qbot-dsh-client-modules/lib/invariant.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-modules/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-runtime/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-runtime/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-schema-form/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-agent-preset/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-agent-preset/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-attachment/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-commands/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-commands/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-conversation/lib/client.js +8 -8
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-conversation/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-cordis/lib/client.js +3 -3
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-cordis/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-deliverables/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-deliverables/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-directory-picker-browse/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-directory-picker-browse/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-directory-picker-native/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-goal/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-goal/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-input-trigger/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-input-trigger/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-jobs/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-jobs/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-layout/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-layout/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-message-feedback/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-message-feedback/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-model-selection/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-model-selection/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-permission-presets/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-permission-presets/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-plan/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-plan/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-primitives/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-general/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-general/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-models/lib/client.js +3 -3
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-models/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-plugin-inventory/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-plugins/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-settings-plugins/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-sidebar/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-skill/lib/client.js +3 -3
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-skill/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-slots/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-subagent/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-subagent/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-theme/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-theme/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-tool/lib/client.js +4 -4
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-tool/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-trajectory/lib/client.js +14 -14
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-trajectory/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-user-questions/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-user-questions/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-workflow-run/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-workflow-run/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-workspace/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-ui-workspace/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-web/lib/index.js +2 -2
- package/node_modules/@qqbrowser/qbot-dsh-client-web/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-client-web-react/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-cmdline/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-code-runtime/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-code-runtime-worker-thread/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-command-compact/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-command-feedback/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-command-goal/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-commands/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-compaction/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-compaction-basic/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-compaction-tool-result-pruner/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-cordis-client-runner/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-cordis-host-runner/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-credentials/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-credentials-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-fs/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-fs-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-fs-observation-policy/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-fs-sandbox/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-goal/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-goal-round-driver/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-headless/cordis.patch.yml +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-headless/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-home-paths/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-home-paths/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-apiproxy/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-directory-picker/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-directory-picker-auto/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-directory-picker-browse/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-directory-picker-native/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-directory-picker-native/lib/worker.cjs +2 -2
- package/node_modules/@qqbrowser/qbot-dsh-host-directory-picker-native/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-frontend-static/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-plugin-inventory/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-host-webserver/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-invariants/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-jobs/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-jobs-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-launch-environment/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-launch-environment/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-llm/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-llm-deepseek/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-llm-pi-ai/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-llm-retry/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-mcp-client/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-message-feedback/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-native-command/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-output-retention/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-permission-presets/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-persona/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-plan-mode/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-pwsh-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-pwsh-sandbox/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-repeat-tool-reminder/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-sandbox/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-sandbox-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-sandbox-policy/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-sandbox-windows-acl/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-schedule/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-scope/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-checkpoint-policy/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-log-export/lib/client.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-log-export/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-persistence/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-persistence-jsonl/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-persistence-jsonl/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-projection/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-projection-cache/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-query/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-query-sqlite/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-reference/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-stats/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-telemetry/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-telemetry-otel/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-title/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-title-first-prompt-llm/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-session-title-llm/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-settings/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-settings-file/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-shell/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-shell/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-shell-env/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-shell-env/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-skill/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-skill-badge/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-skill-filesystem/lib/index.js +2 -2
- package/node_modules/@qqbrowser/qbot-dsh-skill-filesystem/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-spill/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-spill-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-spill-policy/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-storage/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-storage-domain/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-storage-json/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subagent/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subagent-fork-in-process/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subagent-in-process-driver/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subagent-spawn-in-process/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subprocess/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subprocess/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-subprocess-local/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-system-prompt/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-terminal/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-terminal-bash/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-terminal-bash/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-time-context/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-timeout/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tmux-context/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-token-meter/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-ask-user/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-bash/lib/index.js +2 -2
- package/node_modules/@qqbrowser/qbot-dsh-tool-bash/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-bash-persistent/lib/index.js +8 -8
- package/node_modules/@qqbrowser/qbot-dsh-tool-bash-persistent/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-call-timeout-policy/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-cordis/lib/index.js +7 -5
- package/node_modules/@qqbrowser/qbot-dsh-tool-cordis/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-fs/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-fs-search/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-goal/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-jobs/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-pwsh/lib/index.js +2 -2
- package/node_modules/@qqbrowser/qbot-dsh-tool-pwsh/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-ralph/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-skill/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-str-replace-editor/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-subagent/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-subagent-control/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-subagent-report/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-todo/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-web/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tool-workflow/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-tools/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-typert-loader/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-typert-protocol/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-typert-registry/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-user-approval/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-user-questions/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web-app/cordis.patch.yml +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web-app/lib/index.js +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web-app/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web-frontend/dist/assets/{index-9qKLIol0.js → index-eqGZnPzD.js} +24 -24
- package/node_modules/@qqbrowser/qbot-dsh-web-frontend/dist/index.html +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web-frontend/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-web-search-deepseek/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-workflow/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-workflow-worker-thread/package.json +1 -1
- package/node_modules/@qqbrowser/qbot-dsh-workspace/package.json +1 -1
- package/package.json +1 -1
- package/lib/args-DEvDJqPu.js +0 -9
- package/lib/args-LilI9aDQ.js +0 -9
- package/lib/dump-config-B2DyR4dg.js +0 -1
- package/lib/dump-config-BITsCIFc.js +0 -1
- package/lib/dump-config-C3uXMpb-.js +0 -1
- package/lib/dump-config-CAkgocAS.js +0 -1
- package/lib/plugin-CuZ9TQG6.js +0 -6
- package/lib/plugin-DMh4mi7q.js +0 -6
- package/lib/plugin-DtRgTK19.js +0 -6
- package/lib/plugin-GoEpG7Lt.js +0 -6
- package/lib/profile-boot-9oPlPpAm.js +0 -5
- package/lib/profile-boot-B1cY1jRh.js +0 -5
- package/lib/profile-boot-B4JIT6XQ.js +0 -1
- package/lib/profile-boot-B4SoKsRj.js +0 -5
- package/lib/profile-boot-Bk4jvF5L.js +0 -1
- package/lib/profile-boot-CC3d8SUg.js +0 -5
- package/lib/profile-boot-CWiF3YiI.js +0 -1
- package/lib/profile-boot-DF9Fqljf.js +0 -1
- package/lib/profile-boot-DWtNaORu.js +0 -5
- package/lib/profile-boot-o7vgfnwK.js +0 -1
- package/node_modules/@qqbrowser/qbot-dsh-sandbox-windows-acl/lib/types-CNjZgO4h.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var H=Object.defineProperty;var s=(t,r)=>H(t,"name",{value:r,configurable:!0});import{access as N,lstat as O,readFile as x,readdir as U,stat as D}from"node:fs/promises";import{unwatchFile as C,watchFile as K}from"node:fs";import{dirname as E,isAbsolute as z,join as d,relative as T,resolve as f,sep as y}from"node:path";import{homedir as B}from"node:os";import q from"chokidar";import l from"@deepseek-ai/schemastery";import{parse as Q}from"yaml";import{canonicalizeWatchPath as Y,resolveDshHome as G}from"@qqbrowser/qbot-dsh-home-paths";import{BUNDLED_SKILL_RANK as J,isSkillName as X}from"@qqbrowser/qbot-dsh-skill";const V=100,Z=200,tt=300,et=400,rt=500,I=200,M=100,W=128,it="skill-filesystem",nt=["skills"],ot=l.object({providerName:l.string().min(1).default("filesystem"),includeDefaultRoots:l.boolean().default(!0),dshHome:l.string(),agentsHome:l.string(),customSkillDirs:l.array(l.string()).default([]),watch:l.boolean().default(!0),watchUsePolling:l.boolean().default(!1),watchStabilityThresholdMs:l.number().default(I),watchPollIntervalMs:l.number().default(M),watchMaxProjects:l.number().default(W),watchFollowSymlinks:l.boolean().default(!0),bundledSkillDir:l.string()});function st(t,r={}){let e;t.skills.registerProvider(i=>(e=new A(t,i,r),e)),t.effect(function*(){yield async()=>{await e.dispose()}},"skill-filesystem watcher"),t.on("fs/observed",(i,n,o)=>{ut(o)!==void 0&&e.observeHostMutation(i.displayPath)})}s(st,"apply");var A=class{static{s(this,"FileSystemSkillProvider")}ctx;name;includeDefaultRoots;dshHome;agentsHome;customSkillDirs;watchManager;bundledSkillDir;disposal;constructor(t,r,e={}){this.ctx=t,this.name=e.providerName??"filesystem",this.includeDefaultRoots=e.includeDefaultRoots??!0,this.dshHome=G(e.dshHome),this.agentsHome=f(e.agentsHome??process.env.QBOT_DSH_AGENTS_HOME??d(B(),".agents")),this.customSkillDirs=(e.customSkillDirs??[]).map(n=>f(n)),this.watchManager=new at(t,r.invalidate,ct(e)),r.signal.addEventListener("abort",()=>{this.dispose()},{once:!0});const i=e.bundledSkillDir??(this.includeDefaultRoots?process.env.QBOT_DSH_BUNDLED_SKILL_DIR:void 0);this.bundledSkillDir=i===void 0?void 0:f(i)}async list(t){const r=await this.roots(t.cwd);let e=!0;try{await this.watchManager.observeRoots(r)}catch(n){if(this.disposal!==void 0)throw n;e=!1}const i=[];for(const n of r)for(const o of await dt(n,this.ctx,this.name))i.push(o);return e?i:{candidates:i,complete:e}}async get(t,r){const e=t.locator,i=await j(e.path,this.ctx,r.signal,t.source==="bundled");if(i!==void 0)return{name:i.name,description:i.description,...i.whenToUse!==void 0?{whenToUse:i.whenToUse}:{},invocation:i.invocation,source:t.source,provider:this.name,resourceBase:{kind:"directory",path:e.directory},path:e.path,...i.metadata!==void 0?{metadata:i.metadata}:{},content:i.content}}observeHostMutation(t){this.watchManager.observeHostMutation(t)}dispose(){return this.disposal??=this.watchManager.dispose(),this.disposal}async roots(t){const r=[];if(this.includeDefaultRoots&&t!==void 0){const e=await Dt(f(t),S(this.ctx));r.push({path:d(e,".qbot-dsh/skills"),source:"project-dsh",rank:V,projectRoot:e},{path:d(e,".agents/skills"),source:"project-agents",rank:Z,projectRoot:e})}return r.push(...this.customSkillDirs.map(e=>({path:e,source:"custom",rank:tt}))),this.includeDefaultRoots&&r.push({path:d(this.dshHome,"skills"),source:"user-dsh",rank:et,skipSystem:!0},{path:d(this.agentsHome,"skills"),source:"user-agents",rank:rt}),this.bundledSkillDir!==void 0&&r.push({path:this.bundledSkillDir,source:"bundled",rank:J,trustedHost:!0}),r}},at=class{static{s(this,"SkillWatchManager")}ctx;invalidate;config;roots=new Map;projects=new Map;lifecycle=new AbortController;closing=!1;invalidationQueued=!1;constructor(t,r,e){this.ctx=t,this.invalidate=r,this.config=e}async observeRoots(t){if(this.closing)return;const r=new Map,e=[];for(const n of t){if(n.projectRoot===void 0){e.push(this.retainRoot(n,`shared:${n.path}`));continue}const o=r.get(n.projectRoot)??[];o.push(n),r.set(n.projectRoot,o)}for(const[n,o]of r){const a=`project:${n}`;this.projects.delete(n);const c=new Set(o.map(u=>u.path));this.projects.set(n,c);for(const u of o)e.push(this.retainRoot(u,a))}let i=!1;for(;this.projects.size>this.config.maxProjects;){const n=this.projects.entries().next();if(n.done)break;const[o,a]=n.value;this.projects.delete(o);const c=`project:${o}`;for(const u of a)e.push(this.releaseRoot(u,c));i=!0}await Promise.all(e),i&&this.invalidate()}observeHostMutation(t){if(this.closing)return;const r=f(t);[...this.roots.values()].some(e=>ht(e.root,r))&&this.invalidate()}async dispose(){this.closing=!0,this.lifecycle.abort(new Error("skill-filesystem watcher disposed"));const t=[...this.roots.values()];this.roots.clear(),this.projects.clear(),await Promise.all(t.map(async r=>{await g(r.opening);const e=r.watcher;r.watcher=void 0,e!==void 0&&await this.closeWatcher(e)}))}async retainRoot(t,r){let e=this.roots.get(t.path);e===void 0&&(e={root:t,owners:new Set,watcher:void 0,opening:void 0,unhealthy:!0},this.roots.set(t.path,e)),e.owners.add(r),this.config.enabled&&await this.ensureWatcher(e)}async releaseRoot(t,r){const e=this.roots.get(t);if(e===void 0||(e.owners.delete(r),e.owners.size>0))return;this.roots.delete(t),await g(e.opening);const i=e.watcher;e.watcher=void 0,i!==void 0&&await this.closeWatcher(i)}ensureWatcher(t){if(this.closing||!this.config.enabled)return Promise.resolve();if(t.opening!==void 0)return t.opening;const r=this.ensureCurrentWatcher(t);return t.opening=r,r.then(()=>{t.opening=void 0},()=>{t.opening=void 0}),r}async ensureCurrentWatcher(t){const r=t.watcher;if(r!==void 0&&!t.unhealthy){const e=await v(t.root.path,this.config.followSymlinks);if(!t.unhealthy&&k(r.mode,e))return}await this.replaceWatcher(t)}async replaceWatcher(t){const r=t.watcher;if(t.watcher=void 0,r!==void 0&&await this.closeWatcher(r),!(this.closing||t.owners.size===0))try{const e=await this.openStableWatcher(t);if(e===void 0)return;if(this.closing||t.owners.size===0){await this.closeWatcher(e);return}t.watcher=e,t.unhealthy=!1}catch(e){throw this.closing||(t.unhealthy=!0,this.ctx.logger.warn(`skill-filesystem: failed to watch ${t.root.path}: ${p(e)}`)),e}}async openStableWatcher(t){for(;!this.closing&&t.owners.size>0;){const r=await v(t.root.path,this.config.followSymlinks),e=r.kind==="ancestor"?this.openAncestorWatcher(t,r):await this.openRootWatcher(t,r);if(k(r,await v(t.root.path,this.config.followSymlinks)))return e;await this.closeWatcher(e)}}openAncestorWatcher(t,r){const e=s((i,n)=>{this.handleAncestorWatchEvent(t,r)},"listener");return K(r.nextPath,{persistent:!1,interval:this.config.pollIntervalMs},e),{mode:r,close(){C(r.nextPath,e)}}}async handleAncestorWatchEvent(t,r){let e;try{e=await v(t.root.path,this.config.followSymlinks)}catch(i){!this.closing&&t.owners.size>0&&this.handleWatcherError(t,i);return}this.closing||t.owners.size===0||k(r,e)||(this.queueInvalidation(),t.unhealthy=!0,this.scheduleRewatch(t))}async openRootWatcher(t,r){const e=q.watch(r.anchor,{persistent:!0,ignoreInitial:!0,depth:1,followSymlinks:this.config.followSymlinks,atomic:!0,awaitWriteFinish:{stabilityThreshold:this.config.stabilityThresholdMs,pollInterval:this.config.pollIntervalMs},usePolling:this.config.usePolling,interval:this.config.pollIntervalMs}),i={mode:r,close:s(()=>e.close(),"close")};let n=!1;const o=Promise.withResolvers(),a=this.lifecycle.signal;a.aborted&&(await this.closeWatcher(i),a.throwIfAborted());const c=s(()=>{o.reject(a.reason)},"onAbort");a.addEventListener("abort",c,{once:!0});const u=s(h=>{if(!n){o.reject(h);return}this.handleWatcherError(t,h)},"onError");e.on("error",u),e.once("ready",()=>{n=!0,o.resolve(void 0)});for(const h of["add","addDir","change","unlink","unlinkDir"])e.on(h,$=>{this.handleWatchEvent(t,r,h,$)});try{await o.promise}catch(h){throw await this.closeWatcher(i),h}finally{a.removeEventListener("abort",c)}return i}handleWatchEvent(t,r,e,i){const n=f(i);this.closing||!lt({...t.root,path:r.anchor},e,n)||(this.queueInvalidation(),n===r.anchor&&e==="unlinkDir"&&(t.unhealthy=!0,this.scheduleRewatch(t)))}handleWatcherError(t,r){this.closing||(this.ctx.logger.warn(`skill-filesystem: watcher for ${t.root.path} failed: ${p(r)}`),t.unhealthy=!0,this.queueInvalidation(),this.scheduleRewatch(t))}scheduleRewatch(t){const r=t.opening??Promise.resolve();(async()=>{await g(r);try{await this.ensureWatcher(t)}catch{return}this.queueInvalidation()})()}queueInvalidation(){this.closing||this.invalidationQueued||(this.invalidationQueued=!0,queueMicrotask(()=>{this.invalidationQueued=!1,!this.closing&&this.invalidate()}))}async closeWatcher(t){try{await t.close()}catch(r){this.ctx.logger.warn(`skill-filesystem: failed to close watcher: ${p(r)}`)}}};async function g(t){if(t!==void 0)try{await t}catch{}}s(g,"settleWatcherOpening");function ct(t){const r=t.watchStabilityThresholdMs??I,e=t.watchPollIntervalMs??M,i=t.watchMaxProjects??W;return b("watchStabilityThresholdMs",r),b("watchPollIntervalMs",e),b("watchMaxProjects",i),{enabled:t.watch??!0,usePolling:t.watchUsePolling??!1,stabilityThresholdMs:r,pollIntervalMs:e,maxProjects:i,followSymlinks:t.watchFollowSymlinks??!0}}s(ct,"resolveWatchConfig");async function v(t,r){let e=t;for(;;){try{if((await D(e)).isDirectory()){const n=e===t&&!r&&(await O(e)).isSymbolicLink()?f(e):await Y(e);if(e===t)return{kind:"root",anchor:n};const o=T(e,t).split(y)[0];return o===void 0||o.length===0?{kind:"root",anchor:n}:{kind:"ancestor",anchor:n,nextPath:d(n,o)}}}catch(n){if(!_(n))throw n}const i=E(e);if(i===e)return{kind:"ancestor",anchor:e,nextPath:t};e=i}}s(v,"resolveRootWatchMode");function k(t,r){return t.kind===r.kind&&t.anchor===r.anchor&&(t.kind==="root"||r.kind==="ancestor"&&t.nextPath===r.nextPath)}s(k,"sameWatchMode");function lt(t,r,e){const i=P(t.path,e);return i===void 0?!1:i.length===0?r==="addDir"||r==="unlinkDir":t.skipSystem===!0&&i[0]===".system"?!1:i.length===1?r==="addDir"||r==="unlinkDir"?!0:i[0]?.endsWith(".md")===!0:i.length===2&&i[1]==="SKILL.md"&&r!=="addDir"&&r!=="unlinkDir"}s(lt,"isRelevantWatchEvent");function ht(t,r){const e=P(t.path,r);return e===void 0||e.length===0||e.length>2||t.skipSystem===!0&&e[0]===".system"?!1:e.length===1?e[0]?.endsWith(".md")===!0:e[1]==="SKILL.md"}s(ht,"isPotentialSkillPath");function P(t,r){const e=T(t,r);if(e.length===0)return[];if(!(e===".."||e.startsWith(`..${y}`)||z(e)))return e.split(y)}s(P,"containedSegments");function ut(t){if(t===void 0||!("name"in t))return;const r=t.name;return r==="edit"||r==="write"?r:void 0}s(ut,"mutationToolName");function b(t,r){if(!Number.isInteger(r)||r<1)throw new TypeError(`skill-filesystem: ${t} must be a positive integer`)}s(b,"assertPositiveInteger");function _(t){return m(t,"ENOENT")||m(t,"ENOTDIR")}s(_,"isAbsentPathError");function w(t){return _(t)||m(t,"FS_NOT_FOUND")||m(t,"FS_NOT_DIRECTORY")}s(w,"isAbsentSkillPathError");function m(t,r){return typeof t=="object"&&t!==null&&"code"in t&&t.code===r}s(m,"hasErrorCode");async function dt(t,r,e){const i=[],n=await ft(t,r);for(const o of n.sort((a,c)=>a.name.localeCompare(c.name))){if(t.skipSystem&&o.name===".system")continue;const a=o.type==="directory"?{path:d(o.path,"SKILL.md"),directory:o.path}:o.type==="file"&&o.name.endsWith(".md")?{path:o.path,directory:t.path}:void 0;if(a===void 0)continue;const c=await j(a.path,r,void 0,t.trustedHost===!0);c!==void 0&&i.push({name:c.name,description:c.description,...c.whenToUse!==void 0?{whenToUse:c.whenToUse}:{},invocation:c.invocation,provider:e,source:t.source,rank:t.rank,locator:a,resourceBase:{kind:"directory",path:a.directory},path:a.path,...c.metadata!==void 0?{metadata:c.metadata}:{}})}return i}s(dt,"discoverRoot");async function ft(t,r){const e=S(r);return e!==void 0&&t.trustedHost!==!0?await pt(t,e):await vt(t,r)}s(ft,"listSkillRootEntries");async function pt(t,r){try{return(await wt(r,t.path)).map(mt)}catch(e){if(w(e))return[];throw e}}s(pt,"listSkillRootEntriesFromFileSystem");async function wt(t,r){const e=await t.resolve(r);return await t.listDir(e)}s(wt,"fsListDir");function mt(t){return{name:t.name,type:t.type,path:t.target.displayPath}}s(mt,"entryFromFs");async function vt(t,r){let e;try{e=await U(t.path,{withFileTypes:!0,encoding:"utf8"})}catch(n){if(w(n))return[];throw n}const i=[];for(const n of e){const o=d(t.path,n.name),a=await bt(o,n,r);i.push({name:n.name,type:a??"other",path:o})}return i}s(vt,"listSkillRootEntriesFromNode");async function j(t,r,e,i=!1){const n=await yt(r,t,e,i);if(e?.throwIfAborted(),n===void 0)return;let o;try{o=St(n)}catch(h){r.logger.warn(`skill file ${t} ignored: invalid YAML frontmatter: ${p(h)}`);return}if(!o){r.logger.warn(`skill file ${t} ignored: missing YAML frontmatter`);return}const a=L(o.data,"name"),c=L(o.data,"description");if(a===void 0||c===void 0){r.logger.warn(`skill file ${t} ignored: frontmatter requires name and description`);return}if(!X(a)){r.logger.warn(`skill file ${t} ignored: invalid skill name "${a}"`);return}let u;try{u=Wt(o.data)}catch(h){r.logger.warn(`skill file ${t} ignored: invalid invocation frontmatter: ${p(h)}`);return}return{name:a,description:c,...Mt(o.data,"whenToUse"),invocation:u,...At(o.data),content:o.body.trim()}}s(j,"parseSkillFile");function S(t){return t.get("fs")}s(S,"optionalFileSystem");async function yt(t,r,e,i=!1){e?.throwIfAborted();const n=S(t);if(n!==void 0&&!i)return await gt(t,n,r,e);try{return await x(r,{encoding:"utf8",signal:e})}catch(o){if(e?.throwIfAborted(),w(o))return;throw o}}s(yt,"readSkillText");async function gt(t,r,e,i){i?.throwIfAborted();let n;try{n=await r.resolve(e)}catch(a){if(w(a))return;throw a}i?.throwIfAborted();let o;try{o=await r.stat(n,i)}catch(a){if(i?.throwIfAborted(),w(a))return;throw a}if(!(o===void 0||o.type!=="file"))try{return await r.readText(n,i)}catch(a){if(i?.throwIfAborted(),w(a))return;if(!m(a,"FS_NOT_TEXT"))throw a;t.logger.warn(`skill file ${e} ignored: ${kt(n,a)}`);return}}s(gt,"readSkillTextFromFileSystem");function kt(t,r){return`failed to read text file at ${t.displayPath}: ${p(r)}`}s(kt,"fsReadErrorMessage");async function bt(t,r,e){if(r.isDirectory())return"directory";if(r.isFile())return"file";if(r.isSymbolicLink())try{const i=await D(t);return i.isDirectory()?"directory":i.isFile()?"file":void 0}catch(i){e.logger.warn(`skill entry ${t} ignored: failed to follow symbolic link: ${p(i)}`);return}}s(bt,"nodeEntryKind");function St(t){const r=t.indexOf(`
|
|
1
|
+
var H=Object.defineProperty;var s=(t,r)=>H(t,"name",{value:r,configurable:!0});import{access as N,lstat as O,readFile as x,readdir as U,stat as D}from"node:fs/promises";import{unwatchFile as C,watchFile as K}from"node:fs";import{dirname as E,isAbsolute as z,join as d,relative as I,resolve as f,sep as y}from"node:path";import{homedir as q}from"node:os";import B from"chokidar";import l from"@deepseek-ai/schemastery";import{parse as Q}from"yaml";import{canonicalizeWatchPath as Y,resolveDshHome as G}from"@qqbrowser/qbot-dsh-home-paths";import{BUNDLED_SKILL_RANK as J,isSkillName as X}from"@qqbrowser/qbot-dsh-skill";const V=100,Z=200,tt=300,et=400,rt=500,T=200,M=100,W=128,it="skill-filesystem",nt=["skills"],ot=l.object({providerName:l.string().min(1).default("filesystem"),includeDefaultRoots:l.boolean().default(!0),dshHome:l.string(),agentsHome:l.string(),customSkillDirs:l.array(l.string()).default([]),watch:l.boolean().default(!0),watchUsePolling:l.boolean().default(!1),watchStabilityThresholdMs:l.number().default(T),watchPollIntervalMs:l.number().default(M),watchMaxProjects:l.number().default(W),watchFollowSymlinks:l.boolean().default(!0),bundledSkillDir:l.string()});function st(t,r={}){let e;t.skills.registerProvider(i=>(e=new A(t,i,r),e)),t.effect(function*(){yield async()=>{await e.dispose()}},"skill-filesystem watcher"),t.on("fs/observed",(i,n,o)=>{ut(o)!==void 0&&e.observeHostMutation(i.displayPath)})}s(st,"apply");var A=class{static{s(this,"FileSystemSkillProvider")}ctx;name;includeDefaultRoots;dshHome;agentsHome;customSkillDirs;watchManager;bundledSkillDir;disposal;constructor(t,r,e={}){this.ctx=t,this.name=e.providerName??"filesystem",this.includeDefaultRoots=e.includeDefaultRoots??!0,this.dshHome=G(e.dshHome),this.agentsHome=f(e.agentsHome??process.env.DSH_AGENTS_HOME??d(q(),".agents")),this.customSkillDirs=(e.customSkillDirs??[]).map(n=>f(n)),this.watchManager=new at(t,r.invalidate,ct(e)),r.signal.addEventListener("abort",()=>{this.dispose()},{once:!0});const i=e.bundledSkillDir??(this.includeDefaultRoots?process.env.DSH_BUNDLED_SKILL_DIR:void 0);this.bundledSkillDir=i===void 0?void 0:f(i)}async list(t){const r=await this.roots(t.cwd);let e=!0;try{await this.watchManager.observeRoots(r)}catch(n){if(this.disposal!==void 0)throw n;e=!1}const i=[];for(const n of r)for(const o of await dt(n,this.ctx,this.name))i.push(o);return e?i:{candidates:i,complete:e}}async get(t,r){const e=t.locator,i=await _(e.path,this.ctx,r.signal,t.source==="bundled");if(i!==void 0)return{name:i.name,description:i.description,...i.whenToUse!==void 0?{whenToUse:i.whenToUse}:{},invocation:i.invocation,source:t.source,provider:this.name,resourceBase:{kind:"directory",path:e.directory},path:e.path,...i.metadata!==void 0?{metadata:i.metadata}:{},content:i.content}}observeHostMutation(t){this.watchManager.observeHostMutation(t)}dispose(){return this.disposal??=this.watchManager.dispose(),this.disposal}async roots(t){const r=[];if(this.includeDefaultRoots&&t!==void 0){const e=await Dt(f(t),S(this.ctx));r.push({path:d(e,".qbot-dsh/skills"),source:"project-dsh",rank:V,projectRoot:e},{path:d(e,".agents/skills"),source:"project-agents",rank:Z,projectRoot:e})}return r.push(...this.customSkillDirs.map(e=>({path:e,source:"custom",rank:tt}))),this.includeDefaultRoots&&r.push({path:d(this.dshHome,"skills"),source:"user-dsh",rank:et,skipSystem:!0},{path:d(this.agentsHome,"skills"),source:"user-agents",rank:rt}),this.bundledSkillDir!==void 0&&r.push({path:this.bundledSkillDir,source:"bundled",rank:J,trustedHost:!0}),r}},at=class{static{s(this,"SkillWatchManager")}ctx;invalidate;config;roots=new Map;projects=new Map;lifecycle=new AbortController;closing=!1;invalidationQueued=!1;constructor(t,r,e){this.ctx=t,this.invalidate=r,this.config=e}async observeRoots(t){if(this.closing)return;const r=new Map,e=[];for(const n of t){if(n.projectRoot===void 0){e.push(this.retainRoot(n,`shared:${n.path}`));continue}const o=r.get(n.projectRoot)??[];o.push(n),r.set(n.projectRoot,o)}for(const[n,o]of r){const a=`project:${n}`;this.projects.delete(n);const c=new Set(o.map(u=>u.path));this.projects.set(n,c);for(const u of o)e.push(this.retainRoot(u,a))}let i=!1;for(;this.projects.size>this.config.maxProjects;){const n=this.projects.entries().next();if(n.done)break;const[o,a]=n.value;this.projects.delete(o);const c=`project:${o}`;for(const u of a)e.push(this.releaseRoot(u,c));i=!0}await Promise.all(e),i&&this.invalidate()}observeHostMutation(t){if(this.closing)return;const r=f(t);[...this.roots.values()].some(e=>ht(e.root,r))&&this.invalidate()}async dispose(){this.closing=!0,this.lifecycle.abort(new Error("skill-filesystem watcher disposed"));const t=[...this.roots.values()];this.roots.clear(),this.projects.clear(),await Promise.all(t.map(async r=>{await g(r.opening);const e=r.watcher;r.watcher=void 0,e!==void 0&&await this.closeWatcher(e)}))}async retainRoot(t,r){let e=this.roots.get(t.path);e===void 0&&(e={root:t,owners:new Set,watcher:void 0,opening:void 0,unhealthy:!0},this.roots.set(t.path,e)),e.owners.add(r),this.config.enabled&&await this.ensureWatcher(e)}async releaseRoot(t,r){const e=this.roots.get(t);if(e===void 0||(e.owners.delete(r),e.owners.size>0))return;this.roots.delete(t),await g(e.opening);const i=e.watcher;e.watcher=void 0,i!==void 0&&await this.closeWatcher(i)}ensureWatcher(t){if(this.closing||!this.config.enabled)return Promise.resolve();if(t.opening!==void 0)return t.opening;const r=this.ensureCurrentWatcher(t);return t.opening=r,r.then(()=>{t.opening=void 0},()=>{t.opening=void 0}),r}async ensureCurrentWatcher(t){const r=t.watcher;if(r!==void 0&&!t.unhealthy){const e=await v(t.root.path,this.config.followSymlinks);if(!t.unhealthy&&k(r.mode,e))return}await this.replaceWatcher(t)}async replaceWatcher(t){const r=t.watcher;if(t.watcher=void 0,r!==void 0&&await this.closeWatcher(r),!(this.closing||t.owners.size===0))try{const e=await this.openStableWatcher(t);if(e===void 0)return;if(this.closing||t.owners.size===0){await this.closeWatcher(e);return}t.watcher=e,t.unhealthy=!1}catch(e){throw this.closing||(t.unhealthy=!0,this.ctx.logger.warn(`skill-filesystem: failed to watch ${t.root.path}: ${p(e)}`)),e}}async openStableWatcher(t){for(;!this.closing&&t.owners.size>0;){const r=await v(t.root.path,this.config.followSymlinks),e=r.kind==="ancestor"?this.openAncestorWatcher(t,r):await this.openRootWatcher(t,r);if(k(r,await v(t.root.path,this.config.followSymlinks)))return e;await this.closeWatcher(e)}}openAncestorWatcher(t,r){const e=s((i,n)=>{this.handleAncestorWatchEvent(t,r)},"listener");return K(r.nextPath,{persistent:!1,interval:this.config.pollIntervalMs},e),{mode:r,close(){C(r.nextPath,e)}}}async handleAncestorWatchEvent(t,r){let e;try{e=await v(t.root.path,this.config.followSymlinks)}catch(i){!this.closing&&t.owners.size>0&&this.handleWatcherError(t,i);return}this.closing||t.owners.size===0||k(r,e)||(this.queueInvalidation(),t.unhealthy=!0,this.scheduleRewatch(t))}async openRootWatcher(t,r){const e=B.watch(r.anchor,{persistent:!0,ignoreInitial:!0,depth:1,followSymlinks:this.config.followSymlinks,atomic:!0,awaitWriteFinish:{stabilityThreshold:this.config.stabilityThresholdMs,pollInterval:this.config.pollIntervalMs},usePolling:this.config.usePolling,interval:this.config.pollIntervalMs}),i={mode:r,close:s(()=>e.close(),"close")};let n=!1;const o=Promise.withResolvers(),a=this.lifecycle.signal;a.aborted&&(await this.closeWatcher(i),a.throwIfAborted());const c=s(()=>{o.reject(a.reason)},"onAbort");a.addEventListener("abort",c,{once:!0});const u=s(h=>{if(!n){o.reject(h);return}this.handleWatcherError(t,h)},"onError");e.on("error",u),e.once("ready",()=>{n=!0,o.resolve(void 0)});for(const h of["add","addDir","change","unlink","unlinkDir"])e.on(h,$=>{this.handleWatchEvent(t,r,h,$)});try{await o.promise}catch(h){throw await this.closeWatcher(i),h}finally{a.removeEventListener("abort",c)}return i}handleWatchEvent(t,r,e,i){const n=f(i);this.closing||!lt({...t.root,path:r.anchor},e,n)||(this.queueInvalidation(),n===r.anchor&&e==="unlinkDir"&&(t.unhealthy=!0,this.scheduleRewatch(t)))}handleWatcherError(t,r){this.closing||(this.ctx.logger.warn(`skill-filesystem: watcher for ${t.root.path} failed: ${p(r)}`),t.unhealthy=!0,this.queueInvalidation(),this.scheduleRewatch(t))}scheduleRewatch(t){const r=t.opening??Promise.resolve();(async()=>{await g(r);try{await this.ensureWatcher(t)}catch{return}this.queueInvalidation()})()}queueInvalidation(){this.closing||this.invalidationQueued||(this.invalidationQueued=!0,queueMicrotask(()=>{this.invalidationQueued=!1,!this.closing&&this.invalidate()}))}async closeWatcher(t){try{await t.close()}catch(r){this.ctx.logger.warn(`skill-filesystem: failed to close watcher: ${p(r)}`)}}};async function g(t){if(t!==void 0)try{await t}catch{}}s(g,"settleWatcherOpening");function ct(t){const r=t.watchStabilityThresholdMs??T,e=t.watchPollIntervalMs??M,i=t.watchMaxProjects??W;return b("watchStabilityThresholdMs",r),b("watchPollIntervalMs",e),b("watchMaxProjects",i),{enabled:t.watch??!0,usePolling:t.watchUsePolling??!1,stabilityThresholdMs:r,pollIntervalMs:e,maxProjects:i,followSymlinks:t.watchFollowSymlinks??!0}}s(ct,"resolveWatchConfig");async function v(t,r){let e=t;for(;;){try{if((await D(e)).isDirectory()){const n=e===t&&!r&&(await O(e)).isSymbolicLink()?f(e):await Y(e);if(e===t)return{kind:"root",anchor:n};const o=I(e,t).split(y)[0];return o===void 0||o.length===0?{kind:"root",anchor:n}:{kind:"ancestor",anchor:n,nextPath:d(n,o)}}}catch(n){if(!j(n))throw n}const i=E(e);if(i===e)return{kind:"ancestor",anchor:e,nextPath:t};e=i}}s(v,"resolveRootWatchMode");function k(t,r){return t.kind===r.kind&&t.anchor===r.anchor&&(t.kind==="root"||r.kind==="ancestor"&&t.nextPath===r.nextPath)}s(k,"sameWatchMode");function lt(t,r,e){const i=P(t.path,e);return i===void 0?!1:i.length===0?r==="addDir"||r==="unlinkDir":t.skipSystem===!0&&i[0]===".system"?!1:i.length===1?r==="addDir"||r==="unlinkDir"?!0:i[0]?.endsWith(".md")===!0:i.length===2&&i[1]==="SKILL.md"&&r!=="addDir"&&r!=="unlinkDir"}s(lt,"isRelevantWatchEvent");function ht(t,r){const e=P(t.path,r);return e===void 0||e.length===0||e.length>2||t.skipSystem===!0&&e[0]===".system"?!1:e.length===1?e[0]?.endsWith(".md")===!0:e[1]==="SKILL.md"}s(ht,"isPotentialSkillPath");function P(t,r){const e=I(t,r);if(e.length===0)return[];if(!(e===".."||e.startsWith(`..${y}`)||z(e)))return e.split(y)}s(P,"containedSegments");function ut(t){if(t===void 0||!("name"in t))return;const r=t.name;return r==="edit"||r==="write"?r:void 0}s(ut,"mutationToolName");function b(t,r){if(!Number.isInteger(r)||r<1)throw new TypeError(`skill-filesystem: ${t} must be a positive integer`)}s(b,"assertPositiveInteger");function j(t){return m(t,"ENOENT")||m(t,"ENOTDIR")}s(j,"isAbsentPathError");function w(t){return j(t)||m(t,"FS_NOT_FOUND")||m(t,"FS_NOT_DIRECTORY")}s(w,"isAbsentSkillPathError");function m(t,r){return typeof t=="object"&&t!==null&&"code"in t&&t.code===r}s(m,"hasErrorCode");async function dt(t,r,e){const i=[],n=await ft(t,r);for(const o of n.sort((a,c)=>a.name.localeCompare(c.name))){if(t.skipSystem&&o.name===".system")continue;const a=o.type==="directory"?{path:d(o.path,"SKILL.md"),directory:o.path}:o.type==="file"&&o.name.endsWith(".md")?{path:o.path,directory:t.path}:void 0;if(a===void 0)continue;const c=await _(a.path,r,void 0,t.trustedHost===!0);c!==void 0&&i.push({name:c.name,description:c.description,...c.whenToUse!==void 0?{whenToUse:c.whenToUse}:{},invocation:c.invocation,provider:e,source:t.source,rank:t.rank,locator:a,resourceBase:{kind:"directory",path:a.directory},path:a.path,...c.metadata!==void 0?{metadata:c.metadata}:{}})}return i}s(dt,"discoverRoot");async function ft(t,r){const e=S(r);return e!==void 0&&t.trustedHost!==!0?await pt(t,e):await vt(t,r)}s(ft,"listSkillRootEntries");async function pt(t,r){try{return(await wt(r,t.path)).map(mt)}catch(e){if(w(e))return[];throw e}}s(pt,"listSkillRootEntriesFromFileSystem");async function wt(t,r){const e=await t.resolve(r);return await t.listDir(e)}s(wt,"fsListDir");function mt(t){return{name:t.name,type:t.type,path:t.target.displayPath}}s(mt,"entryFromFs");async function vt(t,r){let e;try{e=await U(t.path,{withFileTypes:!0,encoding:"utf8"})}catch(n){if(w(n))return[];throw n}const i=[];for(const n of e){const o=d(t.path,n.name),a=await bt(o,n,r);i.push({name:n.name,type:a??"other",path:o})}return i}s(vt,"listSkillRootEntriesFromNode");async function _(t,r,e,i=!1){const n=await yt(r,t,e,i);if(e?.throwIfAborted(),n===void 0)return;let o;try{o=St(n)}catch(h){r.logger.warn(`skill file ${t} ignored: invalid YAML frontmatter: ${p(h)}`);return}if(!o){r.logger.warn(`skill file ${t} ignored: missing YAML frontmatter`);return}const a=L(o.data,"name"),c=L(o.data,"description");if(a===void 0||c===void 0){r.logger.warn(`skill file ${t} ignored: frontmatter requires name and description`);return}if(!X(a)){r.logger.warn(`skill file ${t} ignored: invalid skill name "${a}"`);return}let u;try{u=Wt(o.data)}catch(h){r.logger.warn(`skill file ${t} ignored: invalid invocation frontmatter: ${p(h)}`);return}return{name:a,description:c,...Mt(o.data,"whenToUse"),invocation:u,...At(o.data),content:o.body.trim()}}s(_,"parseSkillFile");function S(t){return t.get("fs")}s(S,"optionalFileSystem");async function yt(t,r,e,i=!1){e?.throwIfAborted();const n=S(t);if(n!==void 0&&!i)return await gt(t,n,r,e);try{return await x(r,{encoding:"utf8",signal:e})}catch(o){if(e?.throwIfAborted(),w(o))return;throw o}}s(yt,"readSkillText");async function gt(t,r,e,i){i?.throwIfAborted();let n;try{n=await r.resolve(e)}catch(a){if(w(a))return;throw a}i?.throwIfAborted();let o;try{o=await r.stat(n,i)}catch(a){if(i?.throwIfAborted(),w(a))return;throw a}if(!(o===void 0||o.type!=="file"))try{return await r.readText(n,i)}catch(a){if(i?.throwIfAborted(),w(a))return;if(!m(a,"FS_NOT_TEXT"))throw a;t.logger.warn(`skill file ${e} ignored: ${kt(n,a)}`);return}}s(gt,"readSkillTextFromFileSystem");function kt(t,r){return`failed to read text file at ${t.displayPath}: ${p(r)}`}s(kt,"fsReadErrorMessage");async function bt(t,r,e){if(r.isDirectory())return"directory";if(r.isFile())return"file";if(r.isSymbolicLink())try{const i=await D(t);return i.isDirectory()?"directory":i.isFile()?"file":void 0}catch(i){e.logger.warn(`skill entry ${t} ignored: failed to follow symbolic link: ${p(i)}`);return}}s(bt,"nodeEntryKind");function St(t){const r=t.indexOf(`
|
|
2
2
|
`);if(r<0||t.slice(0,r).replace(/\r$/,"")!=="---")return;const e=r+1,i=Rt(t,e);if(i===void 0)return;const n=Q(t.slice(e,i.start));if(!(typeof n!="object"||n===null||Array.isArray(n)))return{data:n,body:t.slice(i.bodyStart)}}s(St,"parseFrontmatter");function Rt(t,r){let e=r;for(;e<=t.length;){const i=t.indexOf(`
|
|
3
|
-
`,e),n=i<0?t.length:i;if(t.slice(e,n).replace(/\r$/,"")==="---")return{start:e,bodyStart:i<0?t.length:i+1};if(i<0)return;e=i+1}}s(Rt,"findClosingFrontmatter");async function Dt(t,r){let e=t;for(;;){if(await Et(d(e,".git"),r))return e;const i=E(e);if(i===e)return t;e=i}}s(Dt,"findProjectRoot");async function Et(t,r){return r!==void 0?await
|
|
3
|
+
`,e),n=i<0?t.length:i;if(t.slice(e,n).replace(/\r$/,"")==="---")return{start:e,bodyStart:i<0?t.length:i+1};if(i<0)return;e=i+1}}s(Rt,"findClosingFrontmatter");async function Dt(t,r){let e=t;for(;;){if(await Et(d(e,".git"),r))return e;const i=E(e);if(i===e)return t;e=i}}s(Dt,"findProjectRoot");async function Et(t,r){return r!==void 0?await It(t,r):await Tt(t)}s(Et,"pathExists");async function It(t,r){let e;try{e=await r.resolve(t)}catch{return!1}try{return await r.stat(e)!==void 0}catch{return!1}}s(It,"pathExistsInFileSystem");async function Tt(t){try{return await N(t),!0}catch{return!1}}s(Tt,"pathExistsInNode");function L(t,r){const e=t[r];return typeof e=="string"&&e.length>0?e:void 0}s(L,"stringField");function Mt(t,r){const e=t[r];return typeof e=="string"&&e.length>0?{[r]:e}:{}}s(Mt,"optionalString");function Wt(t){R(t,"disableModelInvocation","disable-model-invocation"),R(t,"modelInvocable","disable-model-invocation"),R(t,"userInvocable","user-invocable");const r=F(t,"disable-model-invocation"),e=F(t,"user-invocable");return{modelInvocable:r!==!0,userInvocable:e!==!1}}s(Wt,"parseInvocationPolicy");function R(t,r,e){if(Object.hasOwn(t,r))throw new Error(`frontmatter field "${r}" is unsupported; use "${e}"`)}s(R,"rejectLegacyInvocationKey");function F(t,r){if(!Object.hasOwn(t,r))return;const e=t[r];if(typeof e=="boolean")return e;if(e===1||e==="1")return!0;if(e===0||e==="0")return!1;if(typeof e=="string")switch(e.toLowerCase()){case"true":case"yes":case"on":return!0;case"false":case"no":case"off":return!1}throw new TypeError(`frontmatter field "${r}" must be a boolean`)}s(F,"frontmatterBoolean");function At(t){const r=t.metadata;return typeof r=="object"&&r!==null&&!Array.isArray(r)?{metadata:r}:{}}s(At,"optionalMetadata");function p(t){return String(t)}s(p,"errorMessage");export{ot as Config,A as FileSystemSkillProvider,st as apply,nt as inject,it as name};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-skill-filesystem","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-skill-filesystem","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-fs":"^0.0.6","@qqbrowser/qbot-dsh-home-paths":"^0.0.6","@qqbrowser/qbot-dsh-skill":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-invariants":"^0.0.6"},"dependencies":{"chokidar":"^5.0.0","yaml":"^2.4.2","@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-spill","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-spill","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-brand":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-llm":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-spill-local","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-spill-local","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-spill":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-invariants":"^0.0.6"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-spill-policy","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-spill-policy","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-output-retention":"^0.0.6","@qqbrowser/qbot-dsh-spill":"^0.0.6","@qqbrowser/qbot-dsh-tools":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-llm":"^0.0.6"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-storage","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-storage","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-storage-domain","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-storage-domain","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-storage":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"},"dependencies":{"zod":"^4.4.3","@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-storage-json","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-storage-json","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-storage":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-subagent","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-subagent","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client.d.ts","default":"./lib/types/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"zod":"^4.4.3"},"peerDependencies":{"@qqbrowser/qbot-dsh-brand":"^0.0.6","@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-sandbox":"^0.0.6","@qqbrowser/qbot-dsh-llm":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-sandbox-policy":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-session-projection":"^0.0.6","@qqbrowser/qbot-dsh-session-persistence":"^0.0.6","@qqbrowser/qbot-dsh-session-projection-cache":"^0.0.6","@qqbrowser/qbot-dsh-scope":"^0.0.6","@qqbrowser/qbot-dsh-jobs":"^0.0.6","@qqbrowser/qbot-dsh-tools":"^0.0.6","@qqbrowser/qbot-dsh-agent-presets":"^0.0.6","@qqbrowser/qbot-dsh-user-approval":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"},"peerDependenciesMeta":{"@qqbrowser/qbot-dsh-agent-presets":{"optional":true},"@qqbrowser/qbot-dsh-sandbox":{"optional":true},"@qqbrowser/qbot-dsh-sandbox-policy":{"optional":true},"@qqbrowser/qbot-dsh-session-persistence":{"optional":true},"@qqbrowser/qbot-dsh-session-projection":{"optional":true},"@qqbrowser/qbot-dsh-session-projection-cache":{"optional":true},"@qqbrowser/qbot-dsh-jobs":{"optional":true},"@qqbrowser/qbot-dsh-user-approval":{"optional":true}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-subagent-fork-in-process","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-subagent-fork-in-process","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-subagent":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-subagent-in-process-driver":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-subagent-in-process-driver","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-subagent-in-process-driver","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-llm":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-subagent":"^0.0.6","@qqbrowser/qbot-dsh-system-prompt":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-tools":"^0.0.6"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-subagent-spawn-in-process","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-subagent-spawn-in-process","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-subagent":"^0.0.6","@qqbrowser/qbot-dsh-subagent-in-process-driver":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E=Object.defineProperty;var t=(e,s)=>E(e,"name",{value:s,configurable:!0});import{Service as u}from"@deepseek-ai/cordis";const S="DSH_",n=/KEY|PASSWORD|SECRET|TOKEN/i;function p(){const e={};for(const[s,r]of Object.entries(process.env)){const o=s.toUpperCase();r!==void 0&&!n.test(s)&&o!=="QBOT_DSH_HOME"&&!o.startsWith("DSH_")&&(e[s]=r)}return e}t(p,"scrubbedParentEnv");var c=class extends u{static{t(this,"SubprocessRuntime")}constructor(e){super(e,"subprocess")}};export{S as DSH_ENV_PREFIX,n as SENSITIVE_ENV_PATTERN,c as SubprocessRuntime,c as default,p as scrubbedParentEnv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-subprocess","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-subprocess","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-subprocess-local","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-subprocess-local","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-timeout":"^0.0.6","@qqbrowser/qbot-dsh-subprocess":"^0.0.6"},"dependencies":{"node-pty":"^1.1.0"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-system-prompt","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-system-prompt","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-scope":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-llm":"^0.0.6"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-terminal","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-terminal","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-brand":"^0.0.6"}}
|
|
@@ -7,4 +7,4 @@ var T=Object.defineProperty;var o=(t,e)=>T(t,"name",{value:e,configurable:!0});i
|
|
|
7
7
|
`),this.dropped=!0)}const e=m(this.value,this.maxBytes);this.value=e.text,this.dropped||=e.truncated}consume(){const t=this.value,e=this.dropped;return this.value="",this.dropped=!1,{delta:t,truncated:e}}snapshot(){return{text:this.value,truncated:this.dropped}}},O=class{static{o(this,"LocalSendOperation")}startedAt;onCancel;output;promise;finished=!1;cancellationRequested=!1;initialForegroundLeftWait;initialForegroundPgid;constructor(t,e,i){this.startedAt=e,this.onCancel=i,this.output=new v(t),this.promise=Promise.withResolvers(),this.initialForegroundLeftWait=!0}get done(){return this.promise.promise}get settled(){return this.finished}get cancelRequested(){return this.cancellationRequested}append(t){this.finished||this.output.append(t)}settle(t,e,i){if(this.finished)return;this.finished=!0;const s=this.output.snapshot();this.promise.resolve({viewport:s.text,waitReason:t,sessionStatus:e,truncated:s.truncated||i})}fail(t){this.finished||(this.finished=!0,this.promise.reject(t))}readOutput(){return this.output.consume()}setInitialForeground(t){this.initialForegroundPgid=t?.processGroupId,this.initialForegroundLeftWait=t?.inputWaiting!==!0}acceptsStdinWait(t,e){return t!==this.initialForegroundPgid?e:(e||(this.initialForegroundLeftWait=!0),e&&this.initialForegroundLeftWait)}cancel(){return this.finished?!1:(this.cancellationRequested=!0,this.onCancel(),!0)}},B=class{static{o(this,"LocalPtySession")}terminal;config;motd="";pid;decoder=new TextDecoder;sanitizer;scrollback;outputEnded=Promise.withResolvers();completion;statusValue={kind:"running"};active;activeTimer;activeDeadlineTimer;activeAbort;interrupting;activeWrite;pollingReady;polling=!1;promptSeen=!1;promptTextSeen=!1;promptTail="";shellPgid;initializing=!1;lastOutputAt=Date.now();closing=!1;closePromise;transportFailure;constructor(t,e){this.terminal=t,this.config=e,this.pid=t.pid,this.sanitizer=new R(e.maxReadBytes),this.scrollback=new v(e.scrollbackMaxBytes,e.scrollbackLines),t.output.on("data",this.onTerminalData),t.output.once("end",this.onTerminalEnd),t.output.once("error",this.onTerminalError),this.completion=t.done.then(i=>this.onExit(i),i=>{this.onTransportFailure(i)})}async initialize(t){this.initializing=!0;try{const e=await this.startSend({text:"",submit:!1,...t!==void 0?{signal:t}:{}}).done;if(e.waitReason==="session_exit")throw new Error("PTY shell exited during startup");if(e.waitReason==="timeout")throw new Error("PTY shell did not reach readiness before startup timeout");this.motd=e.viewport}catch(e){throw t?.throwIfAborted(),e}finally{this.initializing=!1}}startSend(t){if(this.closing)throw new Error("PTY session is closing");if(this.statusValue.kind==="exited")throw new Error("PTY session has exited");if(this.active!==void 0)throw new P(`PTY session already has an active send${this.activeWrite!==void 0?" or draining provider write":this.interrupting!==void 0?" or draining foreground interrupt":""}`,"SEND_ACTIVE");if(t.signal?.aborted===!0)throw new Error("PTY send aborted before write");const e=new O(this.config.maxReadBytes,Date.now(),()=>{this.interrupt(e)});if(this.active=e,this.resetReadinessEvidence(),t.signal!==void 0){const i=o(()=>{e.cancel()},"onAbort");t.signal.addEventListener("abort",i,{once:!0}),this.activeAbort=()=>t.signal?.removeEventListener("abort",i)}return this.activeDeadlineTimer=setTimeout(()=>{this.active===e&&this.settleActive("timeout",this.activeWrite!==void 0||this.interrupting===e)},this.config.timeoutMs),this.beginSend(e,t),e}async beginSend(t,e){let i;try{i=await this.terminal.inspectForeground()}catch(s){this.active===t&&!this.closing&&this.interrupting!==t&&this.failActive(s);return}try{if(this.active!==t||this.closing||this.interrupting===t)return;t.setInitialForeground(i);const s=`${e.text}${e.submit?"\r":""}`;if(s.length>0&&!t.cancelRequested){this.resetReadinessEvidence();const n=this.terminal.write(s);this.activeWrite=n.then(()=>!0,()=>!1);try{await n}finally{this.activeWrite=void 0}}if(t.cancelRequested)return;if(this.active===t&&t.settled){this.clearActive();return}this.active===t&&!this.closing&&(this.pollingReady=t,this.schedulePoll(t))}catch(s){this.active===t&&!this.closing&&(t.settled?this.clearActive():this.failActive(s))}}resetReadinessEvidence(){this.lastOutputAt=Date.now(),this.promptSeen=!1,this.promptTextSeen=!1,this.promptTail=""}read(t){const e=this.scrollback.snapshot(),i=e.text.split(`
|
|
8
8
|
`),s=e.text.length===0?0:i.length,n=t.offset??0,r=t.count??500;if(!Number.isSafeInteger(n)||n<0)throw new Error("PTY read offset must be a non-negative safe integer");if(!Number.isSafeInteger(r)||r<=0)throw new Error("PTY read count must be a positive safe integer");if(n>=s)return{text:"",totalLines:s,lineBegin:n,lineEnd:n,truncated:e.truncated};const h=s-n,a=Math.max(0,h-r),d=m(i.slice(a,h).join(`
|
|
9
9
|
`),this.config.maxReadBytes),c=d.text.length===0?0:d.text.split(`
|
|
10
|
-
`).length;return{text:d.text,totalLines:s,lineBegin:n,lineEnd:n+c,truncated:e.truncated||d.truncated}}async signal(t){if(this.closing)throw new Error("PTY session is closing");return{delivered:!0,targetPgid:await this.terminal.signalForeground(t)}}status(){return this.statusValue}close(t){if(this.closing=!0,this.closePromise!==void 0)return this.closePromise;const e=this.closeOnce(t).catch(i=>{throw this.closePromise=void 0,this.failActive(i),i});return this.closePromise=e,e}onTerminalData=o(t=>{const e=typeof t=="string"?p.from(t,"utf8"):t;this.onData(this.decoder.decode(e,{stream:!0}))},"onTerminalData");onTerminalEnd=o(()=>{this.onData(this.decoder.decode()),this.appendOutput(this.sanitizer.flush()),this.outputEnded.resolve()},"onTerminalEnd");onTerminalError=o(t=>{this.onTransportFailure(t),this.outputEnded.resolve()},"onTerminalError");onData(t){const e=this.sanitizer.push(t);if(this.appendOutput(e.text),e.prompt&&(this.promptSeen=!0,this.promptTail="",this.lastOutputAt=Date.now()),this.promptSeen&&e.promptTail!==void 0){const i=Math.max(0,6-this.promptTail.length);this.promptTail+=e.promptTail.slice(0,i),e.promptTail.length>i&&(this.promptTail=`${g}\0`),this.promptTextSeen=this.promptTail===g}}async onExit(t){await this.outputEnded.promise,this.transportFailure===void 0&&(this.statusValue={kind:"exited",exitCode:t.exitCode,signal:t.signal},this.settleActive("session_exit"))}onTransportFailure(t){const e=t instanceof Error?t:new Error(String(t));this.transportFailure??=e,this.statusValue={kind:"exited",exitCode:null,signal:null},this.failActive(e),this.terminal.terminate().catch(()=>{})}appendOutput(t){t.length!==0&&(this.lastOutputAt=Date.now(),this.scrollback.append(t),this.active?.append(t))}schedulePoll(t,e=this.config.pollIntervalMs){this.active!==t||this.interrupting===t||this.polling||(this.activeTimer!==void 0&&clearTimeout(this.activeTimer),this.activeTimer=setTimeout(()=>{this.activeTimer=void 0,this.pollReadiness(t)},e))}async pollReadiness(t){if(!(this.active!==t||this.polling)){this.polling=!0;try{if(this.statusValue.kind==="exited"){this.settleActive("session_exit");return}const e=await this.terminal.inspectForeground();if(this.active!==t||this.closing||this.interrupting===t)return;const i=Date.now()-this.lastOutputAt;if(this.promptSeen&&e!==void 0&&this.shellPgid===void 0&&(this.shellPgid=e.processGroupId),this.promptSeen&&this.promptTextSeen&&i>=this.config.pollIntervalMs&&e?.processGroupId===this.shellPgid){this.settleActive("stdin_read");return}const s=Date.now()-t.startedAt,n=!this.initializing||this.scrollback.snapshot().text.length>0,r=n&&e!==void 0&&t.acceptsStdinWait(e.processGroupId,e.inputWaiting);if(s>=this.config.exactProbeAfterMs&&r){this.settleActive("stdin_read");return}const h=this.promptSeen?this.config.handoffGraceMs:0;n&&i>=this.config.idleSilenceMs+h&&this.settleActive("inferred_idle")}catch(e){this.active===t&&!this.closing&&this.interrupting!==t&&this.failActive(e)}finally{this.polling=!1;const e=this.active;e!==void 0&&this.pollingReady===e&&this.schedulePoll(e)}}}settleActive(t,e=!1){const i=this.active;if(i===void 0)return;const s=this.scrollback.snapshot().truncated;e?(this.stopPolling(),this.activeAbort?.(),this.activeAbort=void 0):this.clearActive(),i.settle(t,this.statusValue,s)}stopPolling(){this.stopReadinessPolling(),this.activeDeadlineTimer!==void 0&&clearTimeout(this.activeDeadlineTimer),this.activeDeadlineTimer=void 0}stopReadinessPolling(){this.activeTimer!==void 0&&clearTimeout(this.activeTimer),this.activeTimer=void 0,this.pollingReady=void 0}clearActive(){const t=this.active;this.stopPolling(),this.activeAbort?.(),this.activeAbort=void 0,this.interrupting===t&&(this.interrupting=void 0),this.pollingReady=void 0,this.active=void 0}failActive(t){const e=this.active;e!==void 0&&(this.clearActive(),e.fail(t))}interrupt(t){this.active===t&&(this.interrupting=t,this.stopReadinessPolling(),this.interruptOnce(t))}async interruptOnce(t){try{const e=this.activeWrite;if(e!==void 0&&!await e)return;await this.terminal.signalForeground("SIGINT")}catch(e){this.active===t&&!this.closing&&this.onTransportFailure(e);return}finally{this.interrupting===t&&(this.interrupting=void 0)}this.active===t&&t.settled?this.clearActive():this.active===t&&!this.closing&&(this.pollingReady=t,this.schedulePoll(t,0))}async closeOnce(t){this.stopPolling();try{await this.terminal.terminate()}catch(e){throw new Error(`PTY cleanup failed (${t})`,{cause:e})}if(this.settleActive("session_exit"),await this.completion,this.terminal.output.off("data",this.onTerminalData),this.terminal.output.off("end",this.onTerminalEnd),this.terminal.output.off("error",this.onTerminalError),this.transportFailure!==void 0)throw this.transportFailure}};const D="terminal-bash",I=["terminals","sandboxPolicy","subprocess"],b=new WeakMap;function L(t,e){const i=b.get(e);if(i!==void 0){i.pty=t.terminals,i.sandboxPolicy=t.sandboxPolicy;return}const s={pty:t.terminals,sandboxPolicy:t.sandboxPolicy};b.set(e,s),e.ctx.on("internal/dispatch",(n,r,h)=>{if(r!=="session/event")return;const[a,d]=h;if(a!==e.session||d.type!=="sandbox/mode")return;const c=E(a.events)??s.sandboxPolicy.defaultMode;if(!(d.data.mode===c||!s.pty.hasOwnerActivity(e)))throw new Error(`cannot change sandbox mode from "${c}" to "${d.data.mode}" while persistent terminal sessions are open or being created; wait for creation to settle and close them first`)},{global:!0})}o(L,"ensureSandboxModeFence");function F(t){return{TERM:"dumb",PAGER:"cat",GIT_PAGER:"cat",PS1:g,PROMPT_COMMAND:'printf "\\033]133;D;%s\\007" "$?"',BASH_SILENCE_DEPRECATION_WARNING:"1",
|
|
10
|
+
`).length;return{text:d.text,totalLines:s,lineBegin:n,lineEnd:n+c,truncated:e.truncated||d.truncated}}async signal(t){if(this.closing)throw new Error("PTY session is closing");return{delivered:!0,targetPgid:await this.terminal.signalForeground(t)}}status(){return this.statusValue}close(t){if(this.closing=!0,this.closePromise!==void 0)return this.closePromise;const e=this.closeOnce(t).catch(i=>{throw this.closePromise=void 0,this.failActive(i),i});return this.closePromise=e,e}onTerminalData=o(t=>{const e=typeof t=="string"?p.from(t,"utf8"):t;this.onData(this.decoder.decode(e,{stream:!0}))},"onTerminalData");onTerminalEnd=o(()=>{this.onData(this.decoder.decode()),this.appendOutput(this.sanitizer.flush()),this.outputEnded.resolve()},"onTerminalEnd");onTerminalError=o(t=>{this.onTransportFailure(t),this.outputEnded.resolve()},"onTerminalError");onData(t){const e=this.sanitizer.push(t);if(this.appendOutput(e.text),e.prompt&&(this.promptSeen=!0,this.promptTail="",this.lastOutputAt=Date.now()),this.promptSeen&&e.promptTail!==void 0){const i=Math.max(0,6-this.promptTail.length);this.promptTail+=e.promptTail.slice(0,i),e.promptTail.length>i&&(this.promptTail=`${g}\0`),this.promptTextSeen=this.promptTail===g}}async onExit(t){await this.outputEnded.promise,this.transportFailure===void 0&&(this.statusValue={kind:"exited",exitCode:t.exitCode,signal:t.signal},this.settleActive("session_exit"))}onTransportFailure(t){const e=t instanceof Error?t:new Error(String(t));this.transportFailure??=e,this.statusValue={kind:"exited",exitCode:null,signal:null},this.failActive(e),this.terminal.terminate().catch(()=>{})}appendOutput(t){t.length!==0&&(this.lastOutputAt=Date.now(),this.scrollback.append(t),this.active?.append(t))}schedulePoll(t,e=this.config.pollIntervalMs){this.active!==t||this.interrupting===t||this.polling||(this.activeTimer!==void 0&&clearTimeout(this.activeTimer),this.activeTimer=setTimeout(()=>{this.activeTimer=void 0,this.pollReadiness(t)},e))}async pollReadiness(t){if(!(this.active!==t||this.polling)){this.polling=!0;try{if(this.statusValue.kind==="exited"){this.settleActive("session_exit");return}const e=await this.terminal.inspectForeground();if(this.active!==t||this.closing||this.interrupting===t)return;const i=Date.now()-this.lastOutputAt;if(this.promptSeen&&e!==void 0&&this.shellPgid===void 0&&(this.shellPgid=e.processGroupId),this.promptSeen&&this.promptTextSeen&&i>=this.config.pollIntervalMs&&e?.processGroupId===this.shellPgid){this.settleActive("stdin_read");return}const s=Date.now()-t.startedAt,n=!this.initializing||this.scrollback.snapshot().text.length>0,r=n&&e!==void 0&&t.acceptsStdinWait(e.processGroupId,e.inputWaiting);if(s>=this.config.exactProbeAfterMs&&r){this.settleActive("stdin_read");return}const h=this.promptSeen?this.config.handoffGraceMs:0;n&&i>=this.config.idleSilenceMs+h&&this.settleActive("inferred_idle")}catch(e){this.active===t&&!this.closing&&this.interrupting!==t&&this.failActive(e)}finally{this.polling=!1;const e=this.active;e!==void 0&&this.pollingReady===e&&this.schedulePoll(e)}}}settleActive(t,e=!1){const i=this.active;if(i===void 0)return;const s=this.scrollback.snapshot().truncated;e?(this.stopPolling(),this.activeAbort?.(),this.activeAbort=void 0):this.clearActive(),i.settle(t,this.statusValue,s)}stopPolling(){this.stopReadinessPolling(),this.activeDeadlineTimer!==void 0&&clearTimeout(this.activeDeadlineTimer),this.activeDeadlineTimer=void 0}stopReadinessPolling(){this.activeTimer!==void 0&&clearTimeout(this.activeTimer),this.activeTimer=void 0,this.pollingReady=void 0}clearActive(){const t=this.active;this.stopPolling(),this.activeAbort?.(),this.activeAbort=void 0,this.interrupting===t&&(this.interrupting=void 0),this.pollingReady=void 0,this.active=void 0}failActive(t){const e=this.active;e!==void 0&&(this.clearActive(),e.fail(t))}interrupt(t){this.active===t&&(this.interrupting=t,this.stopReadinessPolling(),this.interruptOnce(t))}async interruptOnce(t){try{const e=this.activeWrite;if(e!==void 0&&!await e)return;await this.terminal.signalForeground("SIGINT")}catch(e){this.active===t&&!this.closing&&this.onTransportFailure(e);return}finally{this.interrupting===t&&(this.interrupting=void 0)}this.active===t&&t.settled?this.clearActive():this.active===t&&!this.closing&&(this.pollingReady=t,this.schedulePoll(t,0))}async closeOnce(t){this.stopPolling();try{await this.terminal.terminate()}catch(e){throw new Error(`PTY cleanup failed (${t})`,{cause:e})}if(this.settleActive("session_exit"),await this.completion,this.terminal.output.off("data",this.onTerminalData),this.terminal.output.off("end",this.onTerminalEnd),this.terminal.output.off("error",this.onTerminalError),this.transportFailure!==void 0)throw this.transportFailure}};const D="terminal-bash",I=["terminals","sandboxPolicy","subprocess"],b=new WeakMap;function L(t,e){const i=b.get(e);if(i!==void 0){i.pty=t.terminals,i.sandboxPolicy=t.sandboxPolicy;return}const s={pty:t.terminals,sandboxPolicy:t.sandboxPolicy};b.set(e,s),e.ctx.on("internal/dispatch",(n,r,h)=>{if(r!=="session/event")return;const[a,d]=h;if(a!==e.session||d.type!=="sandbox/mode")return;const c=E(a.events)??s.sandboxPolicy.defaultMode;if(!(d.data.mode===c||!s.pty.hasOwnerActivity(e)))throw new Error(`cannot change sandbox mode from "${c}" to "${d.data.mode}" while persistent terminal sessions are open or being created; wait for creation to settle and close them first`)},{global:!0})}o(L,"ensureSandboxModeFence");function F(t){return{TERM:"dumb",PAGER:"cat",GIT_PAGER:"cat",PS1:g,PROMPT_COMMAND:'printf "\\033]133;D;%s\\007" "$?"',BASH_SILENCE_DEPRECATION_WARNING:"1",DSH_SHELL:"1",DSH_SESSION_ID:t.owner.id,DSH_PTY_SESSION_ID:t.sessionId}}o(F,"childEnvironment");function k(t,e,i){const s=[e.shellPath,...e.shellArgs];if(i.mode==="danger-full-access")return s;const n=t.get("sandbox");if(n===void 0)throw new Error(`terminal-bash: sandbox mode "${i.mode}" requires a ctx.sandbox provider in the execution world`);return n.confine(s,{...i,mode:i.mode}).argv}o(k,"spawnArgv");async function W(t,e){if(e===void 0){await t.initialize(e);return}const i=Promise.withResolvers(),s=o(()=>{i.reject(e.reason)},"onAbort");e.addEventListener("abort",s,{once:!0});try{e.throwIfAborted(),await Promise.race([t.initialize(e),i.promise])}finally{e.removeEventListener("abort",s)}}o(W,"initializeSession");var w=class{static{o(this,"BashTerminalBackend")}ctx;config;spawnTerminal;createSession;type;constructor(t,e,i=n=>t.subprocess.spawnTerminal(n),s=(n,r)=>new B(n,r)){this.ctx=t,this.config=e,this.spawnTerminal=i,this.createSession=s,this.type=e.backendType}async spawn(t){t.signal?.throwIfAborted(),L(this.ctx,t.owner);const e=this.ctx.sandboxPolicy.resolve({session:t.owner.session}),i=k(this.ctx,this.config,e);if(i[0]===void 0)throw new Error("terminal-bash: sandbox returned empty argv");const s=await this.spawnTerminal({argv:i,cwd:t.cwd??e.workspaceRoot,env:F(t),rows:this.config.rows,cols:this.config.cols,graceMs:this.config.disposeGraceMs,signal:t.signal}),n=this.createSession(s,this.config);try{return await W(n,t.signal),n}catch(r){try{await n.close("PTY startup failed")}catch(h){throw new y(r,h)}throw r}}};function C(t,e){S(e),t.terminals.registerBackend(new w(t,e))}o(C,"apply");export{w as BashTerminalBackend,A as Config,C as apply,I as inject,D as name};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-terminal-bash","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-terminal-bash","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-terminal":"^0.0.6","@qqbrowser/qbot-dsh-sandbox-policy":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-subprocess":"^0.0.6","@qqbrowser/qbot-dsh-sandbox":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-agent":"^0.0.6"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-time-context","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-time-context","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"@deepseek-ai/schemastery":"^3.18.1"},"peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-agent":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-timeout","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-timeout","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-tmux-context","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-tmux-context","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"@deepseek-ai/schemastery":"^3.18.1"},"peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-shell":"^0.0.6"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-token-meter","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-token-meter","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client.d.ts","default":"./lib/types/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-compaction":"^0.0.6","@qqbrowser/qbot-dsh-session":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-session-projection":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-llm":"^0.0.6"},"dependencies":{"zod":"^4.4.3","@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-tool-ask-user","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-tool-ask-user","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-user-questions":"^0.0.6","@deepseek-ai/cordis":"^4.0.1","@qqbrowser/qbot-dsh-tools":"^0.0.6"}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var E=Object.defineProperty;var r=(e,o)=>E(e,"name",{value:o,configurable:!0});import g from"@deepseek-ai/schemastery";import{isAbsolute as P,resolve as M}from"node:path";import{TOOL_ABORTED as y,defineTool as O}from"@qqbrowser/qbot-dsh-tools";import{HarnessError as v}from"@qqbrowser/qbot-dsh-llm";import{ESCALATION_TARGETS as $,approveEscalation as C,canonicalPath as R,escalationHintMarker as w,sandboxDenialMarker as x,validateEscalationArgs as I}from"@qqbrowser/qbot-dsh-sandbox";import{
|
|
1
|
+
var E=Object.defineProperty;var r=(e,o)=>E(e,"name",{value:o,configurable:!0});import g from"@deepseek-ai/schemastery";import{isAbsolute as P,resolve as M}from"node:path";import{TOOL_ABORTED as y,defineTool as O}from"@qqbrowser/qbot-dsh-tools";import{HarnessError as v}from"@qqbrowser/qbot-dsh-llm";import{ESCALATION_TARGETS as $,approveEscalation as C,canonicalPath as R,escalationHintMarker as w,sandboxDenialMarker as x,validateEscalationArgs as I}from"@qqbrowser/qbot-dsh-sandbox";import{DSH_ENV_PREFIX as T,parseExitStatus as A}from"@qqbrowser/qbot-dsh-shell";function B(e){return e.status==="killed"?{status:"killed",detail:e.signal!==null?`signal: ${e.signal}`:"killed before exit"}:{status:"completed",detail:`exit code: ${e.exitCode??0}`}}r(B,"processOutcome");function k(e){return e.truncated?`${e.text}
|
|
2
2
|
[output truncated; full output: ${e.spillPath??"(unavailable)"}]`:e.text}r(k,"streamText");function N(e,o=[]){const i=k(e.stdout),n=k(e.stderr);let t=i;n.length>0&&(t.length>0&&!t.endsWith(`
|
|
3
3
|
`)&&(t+=`
|
|
4
4
|
`),t+=`[stderr]
|
|
@@ -10,4 +10,4 @@ ${n}`),t.length===0&&(t="(no output)");const a=[];return e.sandbox?.denied&&(a.p
|
|
|
10
10
|
`:""}${n.join(`
|
|
11
11
|
`)}`}r(S,"renderProcessRead");const D="tool-bash",F=["tools","shell","systemPrompt","shellEnv"],L=g.object({enableRunInBackground:g.boolean().default(!0)});function U(e){if(e.command.trim().length===0)throw new Error("invalid command: expected a non-empty string");if(e.description.trim().length===0)throw new Error("invalid description: expected a non-empty string");if(e.timeoutMs!==void 0&&(!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0))throw new Error(`invalid timeoutMs: expected a positive number, got ${JSON.stringify(e.timeoutMs)}`);I(e.sandbox_permissions,e.justification)}r(U,"validateBashArgs");function H(e,o){const i=e?"Set `run_in_background: true` for long-running commands: the call returns a job id immediately; read its output with `job_output` and stop it with `job_kill`.":"Background execution is not available; long-running commands must finish within the timeout.",n=`Execute a bash command (\`bash -c\`) and return its stdout/stderr. Each call runs in a fresh shell: no state (cwd, variables, functions) persists between calls — pass \`workdir\` instead of using \`cd\`. Non-zero exits are reported as \`[exit code: N]\`. Current harness environment facts are exposed through managed \`$${T}*\` variables; inspect them when needed. Commands may run under a file sandbox; a blocked file operation is reported as \`[sandbox: file access denied under <mode> mode]\` — a policy denial, not a bug in the command; do not retry another way. Long output is truncated to its tail; the full output is saved to a file whose path is reported when available. `+i;return o.length===0?n:n+" Attempting a command the sandbox may deny is safe and expected: run it and read the marker rather than assuming the denial. When a command is denied and a wider mode would let it succeed, escalate immediately in the same turn — the one sanctioned exception to a denial: retry the exact same command once with `sandbox_permissions` (the narrowest wider mode that suffices) plus a one-sentence `justification`. Do not detour through chat to ask permission first — the approval prompt raised by that retry is how the user consents. If the session states approval prompts are disabled, there is no exception: a denial is final — do not set `sandbox_permissions`. Never escalate speculatively: ground the request in a real denial — normally the one this command just hit; escalating up front is fine only when this session already denied the same access. A rejected escalation is final for that command — stop and explain, never work around it — but it does not forbid attempting or escalating other commands later."}r(H,"bashDescription");function W(e){return e.run_in_background===!0?{card:"generic",title:e.command,kind:"execute",rawInput:e.command,content:[{type:"text",text:e.description}]}:{card:"terminal",title:e.command,description:e.description,...e.workdir!==void 0?{cwd:e.workdir}:{}}}r(W,"presentBashCall");function z(e,o){const i=o.content.length===1?o.content[0]:void 0;if(i===void 0||i.type!=="text")return;const n=i.text;if(typeof e=="object"&&e!==null&&e.run_in_background===!0||o.isError)return{card:"generic",content:[{type:"text",text:`\`\`\`console
|
|
12
12
|
${n.replace(/\n+$/,"")}
|
|
13
|
-
\`\`\``}]};const{body:t,...a}=A(n);return{card:"terminal",output:t,...a}}r(z,"presentBashResult");function G(e,o,i){const n=o.agent?.session.header.cwd,t=i??(n===void 0?void 0:R(n));return e===void 0?t:t!==void 0&&!P(e)?M(t,e):e}r(G,"resolveWorkdir");function J(e){const o=r(i=>({text:i.text,truncated:i.truncated,...i.spillPath!==void 0?{spillPath:i.spillPath}:{}}),"output");return{exitCode:e.exitCode,signal:e.signal,timedOut:e.timedOut,aborted:e.aborted,timeoutMs:e.timeoutMs,stdout:o(e.stdout),stderr:o(e.stderr),...e.sandbox!==void 0?{sandbox:{mode:e.sandbox.mode,denied:e.sandbox.denied,...e.sandbox.enforcement!==void 0?{enforcement:e.sandbox.enforcement}:{},...e.sandbox.runnerFailed!==void 0?{runnerFailed:e.sandbox.runnerFailed}:{}}}:{}}}r(J,"canonicalBashResult");const K={kind:{type:"string",required:!0,const:"background"},jobId:{type:"string",required:!0}};function
|
|
13
|
+
\`\`\``}]};const{body:t,...a}=A(n);return{card:"terminal",output:t,...a}}r(z,"presentBashResult");function G(e,o,i){const n=o.agent?.session.header.cwd,t=i??(n===void 0?void 0:R(n));return e===void 0?t:t!==void 0&&!P(e)?M(t,e):e}r(G,"resolveWorkdir");function J(e){const o=r(i=>({text:i.text,truncated:i.truncated,...i.spillPath!==void 0?{spillPath:i.spillPath}:{}}),"output");return{exitCode:e.exitCode,signal:e.signal,timedOut:e.timedOut,aborted:e.aborted,timeoutMs:e.timeoutMs,stdout:o(e.stdout),stderr:o(e.stderr),...e.sandbox!==void 0?{sandbox:{mode:e.sandbox.mode,denied:e.sandbox.denied,...e.sandbox.enforcement!==void 0?{enforcement:e.sandbox.enforcement}:{},...e.sandbox.runnerFailed!==void 0?{runnerFailed:e.sandbox.runnerFailed}:{}}}:{}}}r(J,"canonicalBashResult");const K={kind:{type:"string",required:!0,const:"background"},jobId:{type:"string",required:!0}};function V(e,o={}){const i=o.enableRunInBackground??!0,n=e.shell.sandboxMode,t=n===void 0?[]:$,a=n===void 0?void 0:e.get("sandboxPolicy");if(n!==void 0&&a===void 0)throw new Error("tool-bash: the mounted bash executor confines but ctx.sandboxPolicy is missing");const j=r(s=>a?.resolve(s.agent===void 0?{}:{session:s.agent.session}),"resolveSandboxPolicy"),_=r((s,d,l,p)=>{if(t.length===0)throw new Error("sandbox_permissions is not available in this composition (no sandboxing executor to escalate)");const m=p.mode;return C({requestedMode:s,justification:d,effectiveMode:m,subject:"command"},{approver:e.get("approval"),agent:l.agent,callId:l.callId,toolName:"bash",signal:l.signal})},"approveBashEscalation");e.systemPrompt.section({name:"tool:bash",order:105,text:"Check the [exit code: N] marker on every bash result; investigate failures before moving on."}),e.tools.register(O({name:"bash",description:H(i,t),parameters:{command:{type:"string",required:!0,description:"The bash command to execute."},description:{type:"string",required:!0,description:'Clear, concise description of what this command does in active voice, 5-10 words (shown in the UI). Examples: "ls" → "List files in current directory"; "git status" → "Show working tree status"; "npm install" → "Install package dependencies".'},timeoutMs:{type:"number",description:"Timeout in milliseconds. The executor applies its configured default and cap, and kills the command on expiry."},workdir:{type:"string",description:"Working directory for this command. Defaults to the session workspace; a relative path is resolved against it."},...i?{run_in_background:{type:"boolean",description:"Run in the background and return a job id immediately (collect with job_output, stop with job_kill). No timeout applies."}}:{},...t.length>0?{sandbox_permissions:{type:"string",enum:[...t],description:"The wider sandbox mode this command needs. Only valid as a one-shot retry of a command the sandbox just denied; requires justification and user approval."},justification:{type:"string",description:"Required with sandbox_permissions: one sentence for the user explaining why this exact command needs the wider access."}}:{}},output:{schema:{oneOf:[{type:"object",additionalProperties:!1,properties:K},{type:"object",additionalProperties:!1,properties:{kind:{type:"string",required:!0,const:"foreground"},exitCode:{required:!0,oneOf:[{type:"integer"},{type:"null"}]},signal:{required:!0,oneOf:[{type:"string"},{type:"null"}]},timedOut:{type:"boolean",required:!0},aborted:{type:"boolean",required:!0},timeoutMs:{type:"number",required:!0},stdout:{type:"object",additionalProperties:!1,required:!0,properties:{text:{type:"string",required:!0},truncated:{type:"boolean",required:!0},spillPath:{type:"string"}}},stderr:{type:"object",additionalProperties:!1,required:!0,properties:{text:{type:"string",required:!0},truncated:{type:"boolean",required:!0},spillPath:{type:"string"}}},sandbox:{type:"object",additionalProperties:!1,properties:{mode:{type:"string",required:!0},denied:{type:"boolean",required:!0},enforcement:{type:"string"},runnerFailed:{type:"boolean"}}}}}]},render:r((s,d)=>[{type:"text",text:d.kind==="background"?`started background job ${d.jobId}`:N(d,t)}],"render")},async execute(s,d){U(s);const l=j(d),p=s.sandbox_permissions!==void 0&&s.justification!==void 0?await _(s.sandbox_permissions,s.justification,d,l):void 0,m=p===void 0?l:{...l,mode:p},h=G(s.workdir,d,l?.workspaceRoot),q=e.shellEnv.collect(d),b={command:s.command,...h!==void 0?{workdir:h}:{},...s.timeoutMs!==void 0?{timeoutMs:s.timeoutMs}:{},dshEnv:q,...m!==void 0?{sandboxPolicy:m}:{}};if(s.run_in_background===!0){if(!i)throw new Error("run_in_background is disabled for this deployment (enableRunInBackground: false)");const c=e.get("jobs");if(c===void 0)throw new Error("background jobs unavailable: load @qqbrowser/qbot-dsh-jobs and @qqbrowser/qbot-dsh-tool-jobs");if(d.signal.aborted){const u=new v("tool call aborted",y);throw u.name="AbortError",u}return{kind:"background",jobId:c.start({kind:"bash",label:s.command,...d.agent?{owner:d.agent}:{},run:r(()=>{const u=e.shell.start(e.shell.resolve(b));return{cancel:r(()=>{u.kill()},"cancel"),done:u.done.then(()=>B(u)),readOutput:r(()=>S(u.readOutput(),u.sandbox,t),"readOutput")}},"run")})}}const f=await e.shell.run(e.shell.resolve({...b,signal:d.signal}));if(f.aborted){const c=new v("tool call aborted",y);throw c.name="AbortError",c}return{kind:"foreground",...J(f)}},presentCall:W,presentResult:z}))}r(V,"apply");export{L as Config,V as apply,F as inject,D as name};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-tool-bash","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-tool-bash","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-shell-env":"^0.0.6","@qqbrowser/qbot-dsh-shell":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-llm":"^0.0.6","@qqbrowser/qbot-dsh-sandbox":"^0.0.6","@qqbrowser/qbot-dsh-sandbox-policy":"^0.0.6","@qqbrowser/qbot-dsh-system-prompt":"^0.0.6","@qqbrowser/qbot-dsh-user-approval":"^0.0.6","@qqbrowser/qbot-dsh-tools":"^0.0.6","@qqbrowser/qbot-dsh-jobs":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var N=Object.defineProperty;var l=(e,t)=>N(e,"name",{value:t,configurable:!0});import{randomUUID as D}from"node:crypto";import
|
|
2
|
-
`,P="The persistent bash shell was reset; the next bash call starts from the workspace with a fresh current directory and environment.",g="
|
|
3
|
-
`,"\\n")}'`}l(
|
|
4
|
-
`)?t.slice(0,-1):t}l(v,"stripPrompt");function
|
|
1
|
+
var N=Object.defineProperty;var l=(e,t)=>N(e,"name",{value:t,configurable:!0});import{randomUUID as D}from"node:crypto";import w from"@deepseek-ai/schemastery";import{deadline as L,timeoutOf as j}from"@qqbrowser/qbot-dsh-timeout";import{defineTool as H}from"@qqbrowser/qbot-dsh-tools";var B=l(function(e,t,s){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,i;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],s&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=l(function(){try{i.call(this)}catch(n){return Promise.reject(n)}},"dispose")),e.stack.push({value:t,dispose:r,async:s})}else s&&e.stack.push({async:!0});return t},"__addDisposableResource"),W=(function(e){return function(t){function s(o){t.error=t.hasError?new e(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}l(s,"fail");var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,function(a){return s(a),n()})}else i|=1}catch(a){s(a)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return l(n,"next"),n()}})(typeof SuppressedError=="function"?SuppressedError:function(e,t,s){var r=new Error(s);return r.name="SuppressedError",r.error=e,r.suppressed=t,r});const M="<response clipped><NOTE>To save on context only part of this file has been shown to you. You should retry this tool after you have searched inside the file with `grep -n` in order to find the line numbers of what you are looking for.</NOTE>",U=`<response clipped><NOTE>The beginning of this command output was dropped by the terminal scrollback limit. The following text is the earliest retained output.</NOTE>
|
|
2
|
+
`,P="The persistent bash shell was reset; the next bash call starts from the workspace with a fresh current directory and environment.",g="__DSH_PERSISTENT_BASH_PROMPT__ ",k="PERSISTENT_BASH_TIMEOUT",O=1e3,q=25,A="Run commands in a persistent bash shell. State, including the current directory and exported environment variables, persists across calls for this agent.";function z(e,t,s=!1){return e.length<=t&&!s?e:e.length<=t?e+M:e.slice(0,t)+M}l(z,"maybeTruncate");function G(){const e=D();return{start:`__DSH_PERSISTENT_BASH_START_${e}__`,end:`__DSH_PERSISTENT_BASH_END_${e}:`}}l(G,"markers");function _(e){return`$'${e.replaceAll("\\","\\\\").replaceAll("'","\\'").replaceAll("\r","\\r").replaceAll(`
|
|
3
|
+
`,"\\n")}'`}l(_,"quoteForBash");function F(e,t){return`printf '%s\\n' ${_(t.start)}; eval -- ${_(e)}; __dsh_persistent_bash_status=$?; printf '%s%s\\n' ${_(t.end)} "$__dsh_persistent_bash_status"`}l(F,"wrapCommand");function v(e){let t=e.replace(/\r?\n$/,"");for(;t.endsWith(g);)t=t.slice(0,-31);return t.endsWith(`
|
|
4
|
+
`)?t.slice(0,-1):t}l(v,"stripPrompt");function Y(e,t){const s=e.text,r=s.lastIndexOf(t.end),i=/^(\d+)\r?\n/.exec(s.slice(r+t.end.length))?.[1];if(i===void 0)return;const n=s.lastIndexOf(t.start,r),o=n<0?0:n+t.start.length;return{text:v(s.slice(o,r).replace(/^\r?\n/,"")),incomplete:n<0,exitCode:Number(i)}}l(Y,"commandOutput");function K(e){return e.viewport.endsWith(g)||e.viewport.endsWith(`${g}\r
|
|
5
5
|
`)||e.viewport.endsWith(`${g}
|
|
6
|
-
`)}l(
|
|
6
|
+
`)}l(K,"promptCompleted");function I(e,t,s,r=!1){const i=e.text.lastIndexOf(t.start);if(i>=0)return{text:v(e.text.slice(i+t.start.length).replace(/^\r?\n/,"")),incomplete:!1};const n=s.lastIndexOf(t.start),o=n<0?s:s.slice(n+t.start.length).replace(/^\r?\n/,""),a=o.lastIndexOf(t.end);return{text:v((a<0?o:o.slice(0,a)).replaceAll(g,"")),incomplete:r||n<0}}l(I,"partialOutput");async function V(){await new Promise(e=>setTimeout(e,q))}l(V,"pause");function X(e,t){if(!(e.text.length===0||e.lineEnd<=t))return e.lineEnd}l(X,"nextScrollbackOffset");function T(e,t,s,r=e.terminals.read(t,s,{offset:0,count:O})){const i=r.text.length===0?[]:[r.text];let n=r.lineEnd,o=r.truncated;for(;!(n>=r.totalLines);){const a=e.terminals.read(t,s,{offset:n,count:O});o||=a.truncated,a.text.length>0&&i.unshift(a.text);const d=X(a,n);if(d===void 0||d>=a.totalLines)break;n=d}return{text:i.join(`
|
|
7
7
|
`),truncated:o}}l(T,"retainedScrollback");function x(e,t){const s=z(e.text,t,e.incomplete);return $(e.incomplete&&e.text.length>0?U+s:s,e.exitCode!==void 0&&e.exitCode!==0?`[exit code: ${e.exitCode}]`:void 0)}l(x,"renderCaptured");function $(e,t){return t===void 0?e:e.length===0?t:`${e}
|
|
8
|
-
${t}`}l($,"appendStatusMarker");function
|
|
9
|
-
`)}if(a.signal.aborted&&(await t.reset(s,"persistent bash command aborted"),a.signal.throwIfAborted()),b.text.includes(S.end)){const y=
|
|
10
|
-
`)}if(
|
|
8
|
+
${t}`}l($,"appendStatusMarker");function J(e,t,s){return $(e,s!==null?`[shell killed by signal: ${s}]`:t!==null?`[shell exited: code ${t}]`:"[shell exited]")}l(J,"renderShellExitStatus");function Q(e,t){const s=new WeakMap,r=new Map,i=new Set,n=new WeakSet,o=new AbortController,a=l(async(c,p,u)=>{e.terminals.list(c).some(f=>f.sessionId===p)&&await e.terminals.kill(c,p,u)},"close");e.effect(()=>async()=>{o.abort(new Error("tool-bash-persistent disposed during shell creation")),await Promise.allSettled([...i]);const c=[...r].map(async([p,u])=>{await a(p,u,"tool-bash-persistent disposed")});await Promise.all(c),r.clear()},"tool-bash-persistent shell cleanup");const d=l(async(c,p)=>{s.delete(c);const u=r.get(c);r.delete(c),u!==void 0&&await a(c,u,p)},"reset");return{get:l((c,p)=>{const u=s.get(c);if(u!==void 0)return u;const f=AbortSignal.any([p,o.signal]),m=(async()=>{try{const h=c.session.header.cwd,E=await e.terminals.spawn(c,{type:t.backendType,...h===void 0?{}:{cwd:h}},f);r.set(c,E.sessionId),n.has(c)||(n.add(c),c.ctx.effect(()=>()=>{s.delete(c),r.delete(c)},"tool-bash-persistent owner cache cleanup"));const b=await e.terminals.startSend(c,E.sessionId,{text:`stty -echo; PS1=${_(g)}`,submit:!0,signal:f}).done;if(b.sessionStatus.kind==="exited"||b.waitReason==="timeout")throw new Error("persistent bash shell did not accept initialization");return E.sessionId}catch(h){throw await d(c,"persistent bash initialization failed"),h}})().finally(()=>{i.delete(m)});return i.add(m),s.set(c,m),m},"get"),reset:d}}l(Q,"persistentShells");async function Z(e,t,s,r,i,n){const o={stack:[],error:void 0,hasError:!1};try{const a=B(o,L(n,i.timeoutMs,k),!1),d=await t.get(s,a.signal),S=G(),c=F(r,S);let p=!0,u="",f=!1;for(;;){let m,h;try{m=e.terminals.startSend(s,d,{text:p?c:"",submit:p,signal:a.signal}),p=!1,h=await m.done}catch(y){throw await t.reset(s,"persistent bash send failed"),y}const E=m.readOutput();u=E.delta.length>0?u+E.delta:h.viewport,f||=E.truncated||h.truncated;const b=e.terminals.read(s,d,{offset:0,count:O}),C=j(a.signal,k);if(C!==void 0){const y=x(I(T(e,s,d,b),S,u,f),i.maxOutputChars);return await t.reset(s,"persistent bash command timed out"),[`Your command timed out after ${Math.round(C.timeoutMs/1e3)} seconds or experienced an OOM error. Below is partial output:`,y,P].join(`
|
|
9
|
+
`)}if(a.signal.aborted&&(await t.reset(s,"persistent bash command aborted"),a.signal.throwIfAborted()),b.text.includes(S.end)){const y=Y(T(e,s,d,b),S);if(y!==void 0)return x(y,i.maxOutputChars)}if(h.sessionStatus.kind==="exited"){const y=T(e,s,d,b);return await t.reset(s,"persistent bash shell exited"),[J(x(I(y,S,u,f),i.maxOutputChars),h.sessionStatus.exitCode,h.sessionStatus.signal),P].filter(R=>R.length>0).join(`
|
|
10
|
+
`)}if(K(h))return x(I(T(e,s,d,b),S,u,f),i.maxOutputChars);await V()}}catch(a){o.error=a,o.hasError=!0}finally{W(o)}}l(Z,"executeCommand");function tt(e,t){const s=Q(e,t),r=new WeakMap,i=l(async(n,o)=>{const a=(r.get(n)??Promise.resolve()).then(o,o),d=a.then(()=>{},()=>{});r.set(n,d);try{return await a}finally{r.get(n)===d&&r.delete(n)}},"serialized");e.tools.register(H({name:"bash",description:t.description,parameters:{command:{type:"string",required:!0,description:"The bash command to run. Relative path is preferred in the command."}},output:{schema:{type:"string"},render:l((n,o)=>[{type:"text",text:o}],"render")},async execute(n,o){if(n.command.trim().length===0)throw new Error("command must be a non-empty string");const a=o.agent;if(a===void 0)throw new Error("bash requires an owning agent session");return i(a,async()=>(o.signal.throwIfAborted(),Z(e,s,a,n.command,t,o.signal)))},presentCall:l(n=>({card:"terminal",title:n.command}),"presentCall")}))}l(tt,"registerPersistentBash");const et="tool-bash-persistent",st=["tools","terminals"],rt=w.object({backendType:w.string().default("shell"),timeoutMs:w.number().default(3e5),maxOutputChars:w.number().default(16e3),description:w.string().default(A)});function nt(e,t){const s={backendType:t.backendType??"shell",timeoutMs:t.timeoutMs??3e5,maxOutputChars:t.maxOutputChars??16e3,description:t.description??A};if(s.backendType.trim().length===0)throw new Error("tool-bash-persistent: backendType must be non-empty");if(!Number.isSafeInteger(s.timeoutMs)||s.timeoutMs<=0)throw new Error("tool-bash-persistent: timeoutMs must be a positive safe integer");if(!Number.isSafeInteger(s.maxOutputChars)||s.maxOutputChars<=0)throw new Error("tool-bash-persistent: maxOutputChars must be a positive safe integer");if(s.description.trim().length===0)throw new Error("tool-bash-persistent: description must be non-empty");tt(e,s)}l(nt,"apply");export{rt as Config,nt as apply,st as inject,et as name};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-tool-bash-persistent","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-tool-bash-persistent","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-agent":"^0.0.6","@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-terminal":"^0.0.6","@qqbrowser/qbot-dsh-timeout":"^0.0.6","@qqbrowser/qbot-dsh-tools":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"},"dependencies":{"@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@qqbrowser/qbot-dsh-tool-call-timeout-policy","version":"0.0.
|
|
1
|
+
{"name":"@qqbrowser/qbot-dsh-tool-call-timeout-policy","version":"0.0.6","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@qqbrowser/qbot-dsh-invariants":"^0.0.6","@qqbrowser/qbot-dsh-llm":"^0.0.6","@qqbrowser/qbot-dsh-timeout":"^0.0.6","@qqbrowser/qbot-dsh-tools":"^0.0.6","@deepseek-ai/cordis":"^4.0.1"}}
|