@qqbrowser/qbot-dsh 0.1.0 → 0.1.2
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/cordis.patch.yml +50 -0
- package/lib/args-w1okyL78.js +9 -0
- package/lib/bin.js +1 -2
- package/lib/client.js +1 -0
- package/lib/content-review-CqDoh3wY.js +1 -0
- package/lib/content-review.js +1 -0
- package/lib/dump-config-CIL0Goqj.js +1 -0
- package/lib/gateway-port-CSFbDyoZ.js +1 -0
- package/lib/index.js +1 -0
- package/lib/llm-gateway-openai.js +17 -0
- package/lib/native-protocol-DdrIh89-.js +2 -0
- package/lib/{plugin-DNAeLZbb.js → plugin-viWCLnSr.js} +1 -1
- package/lib/profile-boot-CxJUSdnu.js +1 -0
- package/lib/profile-boot-DCgBQ4qO.js +8 -0
- package/lib/qb-auth-C2ofR1zn.js +4 -0
- package/lib/qb-auth.js +1 -0
- package/lib/web-search-dsh.js +1 -0
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +7 -2
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +3 -0
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +3 -0
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +1 -1
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +7 -2
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +3 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +3 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +1 -1
- package/node_modules/@deepseek-ai/cordis-plugin-hmr/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-instructions/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-presets/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +12 -12
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +6 -37
- package/node_modules/@deepseek-ai/dsh-base/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-brand/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-runtime/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-schema-form/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-web/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-web-react/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-cmdline/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-code-runtime/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-code-runtime-worker-thread/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-commands/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-credentials-local/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-headless/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-headless/lib/startup.js +3 -3
- package/node_modules/@deepseek-ai/dsh-headless/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-apiproxy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-host-webserver/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-invariants/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-persona/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/runner.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-scope/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-settings/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-settings-file/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-shell/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-shell-env/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-skill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-spill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subprocess/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/index.js +5 -29
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent-report/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-tools/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-web/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +0 -1
- package/node_modules/@deepseek-ai/dsh-web-app/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-web-app/lib/startup.js +4 -5
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-workflow-worker-thread/lib/worker.cjs +9 -8
- package/node_modules/@deepseek-ai/dsh-workflow-worker-thread/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@koromix/koffi-darwin-arm64/darwin_arm64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-arm64/package.json +1 -1
- package/node_modules/@koromix/koffi-darwin-x64/darwin_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-x64/package.json +1 -1
- package/node_modules/@koromix/koffi-win32-x64/package.json +1 -1
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
- package/node_modules/@smithy/core/dist-cjs/index.js +3 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +126 -39
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +14 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +3 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +3 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +10 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +10 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +16 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +4 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +4 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +4 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +7 -0
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +29 -13
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +12 -4
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +9 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +7 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +44 -15
- package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +22 -4
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +5 -0
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +6 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +7 -0
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +5 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/transport/hasOwn.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/transport/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +3 -0
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +19 -7
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -1
- package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +4 -1
- package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +4 -1
- package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +10 -3
- package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +4 -1
- package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +4 -1
- package/node_modules/@smithy/signature-v4/package.json +1 -1
- package/node_modules/koffi/package.json +1 -1
- package/node_modules/koffi/src/koffi/index.cjs +1 -1
- package/node_modules/koffi/src/koffi/index.js +1 -1
- package/node_modules/koffi/src/koffi/indirect.cjs +1 -1
- package/node_modules/koffi/src/koffi/indirect.js +1 -1
- package/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/negotiator/node_modules/content-type/package.json +1 -0
- package/node_modules/negotiator/package.json +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/_idna.mjs +1 -1
- package/node_modules/typebox/build/format/_puny.mjs +1 -1
- package/node_modules/typebox/build/format/uuid.mjs +1 -1
- package/node_modules/typebox/build/guard/emit.mjs +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +1 -1
- package/node_modules/typebox/build/guard/string.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_guard.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/boolean.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/types/_guard.mjs +1 -0
- package/node_modules/typebox/build/schema/types/index.mjs +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ar_001.mjs +1 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +1 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +1 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +1 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +1 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +1 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +1 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +1 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +1 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +1 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +1 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +1 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +1 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +1 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +1 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +1 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +1 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +1 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +1 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +1 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +1 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +1 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +1 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +1 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +1 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +1 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +1 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +1 -1
- package/node_modules/typebox/build/system/memory/clone.mjs +1 -1
- package/node_modules/typebox/build/system/settings/settings.mjs +1 -1
- package/node_modules/typebox/build/type/action/_optional.mjs +1 -0
- package/node_modules/typebox/build/type/action/_readonly.mjs +1 -0
- package/node_modules/typebox/build/type/action/awaited.mjs +1 -0
- package/node_modules/typebox/build/type/action/conditional.mjs +1 -1
- package/node_modules/typebox/build/type/action/index.mjs +1 -1
- package/node_modules/typebox/build/type/action/mapped.mjs +1 -1
- package/node_modules/typebox/build/type/action/module.mjs +1 -1
- package/node_modules/typebox/build/type/action/options.mjs +1 -0
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +1 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +1 -1
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +1 -1
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +1 -1
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +1 -1
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +1 -0
- package/node_modules/typebox/build/type/engine/enum/index.mjs +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +1 -1
- package/node_modules/typebox/build/type/engine/index.mjs +1 -1
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +1 -1
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +1 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +1 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +1 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +1 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +1 -1
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +1 -1
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +1 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/options/instantiate.mjs +1 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +1 -1
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +1 -1
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +1 -1
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +1 -1
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +1 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +1 -1
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +1 -0
- package/node_modules/typebox/build/type/extends/enum.mjs +1 -1
- package/node_modules/typebox/build/type/extends/extends_left.mjs +1 -1
- package/node_modules/typebox/build/type/extends/extends_right.mjs +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/iterator.mjs +1 -0
- package/node_modules/typebox/build/type/extends/object.mjs +1 -1
- package/node_modules/typebox/build/type/extends/parameters.mjs +1 -1
- package/node_modules/typebox/build/type/extends/promise.mjs +1 -0
- package/node_modules/typebox/build/type/extends/template_literal.mjs +1 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +1 -1
- package/node_modules/typebox/build/type/extends/union.mjs +1 -1
- package/node_modules/typebox/build/type/script/mapping.mjs +1 -1
- package/node_modules/typebox/build/type/script/parser.mjs +6 -6
- package/node_modules/typebox/build/type/script/script.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +1 -1
- package/node_modules/typebox/build/type/types/_immutable.mjs +1 -1
- package/node_modules/typebox/build/type/types/_optional.mjs +1 -1
- package/node_modules/typebox/build/type/types/_readonly.mjs +1 -1
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -1
- package/node_modules/typebox/build/type/types/async_iterator.mjs +1 -0
- package/node_modules/typebox/build/type/types/base.mjs +1 -0
- package/node_modules/typebox/build/type/types/call.mjs +1 -1
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/enum.mjs +1 -1
- package/node_modules/typebox/build/type/types/index.mjs +1 -1
- package/node_modules/typebox/build/type/types/iterator.mjs +1 -0
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/promise.mjs +1 -0
- package/node_modules/typebox/build/type/types/record.mjs +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/build/value/clean/clean.mjs +1 -1
- package/node_modules/typebox/build/value/clean/from_base.mjs +1 -0
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +1 -1
- package/node_modules/typebox/build/value/clean/from_type.mjs +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -1
- package/node_modules/typebox/build/value/clone/clone.mjs +1 -1
- package/node_modules/typebox/build/value/codec/decode.mjs +1 -1
- package/node_modules/typebox/build/value/codec/encode.mjs +1 -1
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -1
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/codec/from_record.mjs +1 -1
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -1
- package/node_modules/typebox/build/value/codec/from_union.mjs +1 -1
- package/node_modules/typebox/build/value/convert/from_base.mjs +1 -0
- package/node_modules/typebox/build/value/convert/from_enum.mjs +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +1 -1
- package/node_modules/typebox/build/value/convert/from_type.mjs +1 -1
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +1 -0
- package/node_modules/typebox/build/value/create/from_base.mjs +1 -0
- package/node_modules/typebox/build/value/create/from_enum.mjs +1 -1
- package/node_modules/typebox/build/value/create/from_iterator.mjs +1 -0
- package/node_modules/typebox/build/value/create/from_promise.mjs +1 -0
- package/node_modules/typebox/build/value/create/from_type.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_base.mjs +1 -0
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +1 -1
- package/node_modules/typebox/build/value/index.mjs +1 -1
- package/node_modules/typebox/build/value/mutate/error.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/from_array.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/from_object.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/from_value.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/index.mjs +1 -0
- package/node_modules/typebox/build/value/mutate/mutate.mjs +1 -0
- package/node_modules/typebox/build/value/repair/from_base.mjs +1 -0
- package/node_modules/typebox/build/value/repair/from_enum.mjs +1 -1
- package/node_modules/typebox/build/value/repair/from_type.mjs +1 -1
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +1 -1
- package/node_modules/typebox/build/value/value.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/package.json +1 -1
- package/lib/args-DcHS9iff.js +0 -9
- package/lib/dump-config-xQTUTTDD.js +0 -1
- package/lib/profile-boot-BkordgJK.js +0 -1
- package/lib/profile-boot-DDo03lXi.js +0 -8
- package/node_modules/@deepseek-ai/dsh-content-review/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-content-review/lib/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-content-review/lib/invariant.js +0 -1
- package/node_modules/@deepseek-ai/dsh-content-review/package.json +0 -1
- package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/lib/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/lib/invariant.js +0 -1
- package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/package.json +0 -1
- package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/lib/index.js +0 -17
- package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/lib/invariant.js +0 -1
- package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/package.json +0 -1
- package/node_modules/@deepseek-ai/dsh-qb-auth/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-qb-auth/lib/index.js +0 -4
- package/node_modules/@deepseek-ai/dsh-qb-auth/lib/invariant.js +0 -1
- package/node_modules/@deepseek-ai/dsh-qb-auth/package.json +0 -1
- package/node_modules/@deepseek-ai/dsh-web-search-dsh/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-web-search-dsh/lib/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-web-search-dsh/lib/invariant.js +0 -1
- package/node_modules/@deepseek-ai/dsh-web-search-dsh/package.json +0 -1
- package/node_modules/@napi-rs/xattr/LICENSE +0 -21
- package/node_modules/@napi-rs/xattr/index.js +0 -567
- package/node_modules/@napi-rs/xattr/package.json +0 -1
- package/node_modules/@napi-rs/xattr-darwin-arm64/package.json +0 -1
- package/node_modules/@napi-rs/xattr-darwin-arm64/xattr.darwin-arm64.node +0 -0
- package/node_modules/@napi-rs/xattr-darwin-x64/package.json +0 -1
- package/node_modules/@napi-rs/xattr-darwin-x64/xattr.darwin-x64.node +0 -0
- package/node_modules/@parcel/watcher/LICENSE +0 -21
- package/node_modules/@parcel/watcher/index.js +0 -44
- package/node_modules/@parcel/watcher/index.js.flow +0 -45
- package/node_modules/@parcel/watcher/package.json +0 -1
- package/node_modules/@parcel/watcher/scripts/build-from-source.js +0 -16
- package/node_modules/@parcel/watcher/wrapper.js +0 -88
- package/node_modules/@parcel/watcher-darwin-arm64/LICENSE +0 -21
- package/node_modules/@parcel/watcher-darwin-arm64/package.json +0 -1
- package/node_modules/@parcel/watcher-darwin-arm64/watcher.node +0 -0
- package/node_modules/@parcel/watcher-darwin-x64/LICENSE +0 -21
- package/node_modules/@parcel/watcher-darwin-x64/package.json +0 -1
- package/node_modules/@parcel/watcher-darwin-x64/watcher.node +0 -0
- package/node_modules/@parcel/watcher-win32-x64/LICENSE +0 -21
- package/node_modules/@parcel/watcher-win32-x64/package.json +0 -1
- package/node_modules/@parcel/watcher-win32-x64/watcher.node +0 -0
- package/node_modules/is-extglob/LICENSE +0 -21
- package/node_modules/is-extglob/index.js +0 -20
- package/node_modules/is-extglob/package.json +0 -1
- package/node_modules/is-glob/LICENSE +0 -21
- package/node_modules/is-glob/index.js +0 -150
- package/node_modules/is-glob/package.json +0 -1
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +0 -1
- package/node_modules/typebox/build/type/action/_add_optional.mjs +0 -1
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +0 -1
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +0 -1
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +0 -1
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +0 -1
- package/node_modules/typebox/build/type/action/with.mjs +0 -1
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +0 -1
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +0 -1
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +0 -1
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +0 -1
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +0 -1
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +0 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +0 -1
- package/node_modules/typebox/build/type/engine/priority/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +0 -1
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +0 -1
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +0 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +0 -1
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +0 -1
- package/node_modules/typebox/build/type/engine/with/instantiate.mjs +0 -1
- package/node_modules/typebox/build/type/extends/dependent.mjs +0 -1
- package/node_modules/typebox/build/type/extends/record.mjs +0 -1
- package/node_modules/typebox/build/type/types/dependent.mjs +0 -1
- /package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/lib/{types-D2_FQYSK.js → types-DE3U0cmQ.js} +0 -0
- /package/node_modules/typebox/build/type/engine/{with → awaited}/index.mjs +0 -0
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
- id: agent-default-model
|
|
2
|
+
config:
|
|
3
|
+
provider: qb-gateway
|
|
4
|
+
model: Auto
|
|
5
|
+
- id: llm-pi-ai
|
|
6
|
+
config:
|
|
7
|
+
providers:
|
|
8
|
+
qb-gateway:
|
|
9
|
+
displayName: QQ浏览器提供的模型
|
|
10
|
+
apiKeyEnv: DSH_QB_GATEWAY_KEY
|
|
11
|
+
api: openai-completions
|
|
12
|
+
baseURL: !!js "`http://127.0.0.1:${process.env.DSH_QB_GATEWAY_PORT}/v1`"
|
|
13
|
+
defaultContextWindow: 131072
|
|
14
|
+
defaultMaxTokens: 32768
|
|
15
|
+
models:
|
|
16
|
+
- id: Auto
|
|
17
|
+
name: Auto (免费)
|
|
18
|
+
- id: web
|
|
19
|
+
config:
|
|
20
|
+
searchProvider: dsh
|
|
21
|
+
- id: web-search-deepseek
|
|
22
|
+
disabled: true
|
|
23
|
+
- id: web-runtime
|
|
24
|
+
config:
|
|
25
|
+
printUrl: false
|
|
26
|
+
surfaceContext: true
|
|
27
|
+
trustedHosts: !!js ctx.webStartup.trustedHosts
|
|
28
|
+
- insert:
|
|
29
|
+
- id: qb-auth
|
|
30
|
+
name: '@qqbrowser/qbot-dsh/qb-auth'
|
|
31
|
+
- id: content-review
|
|
32
|
+
name: '@qqbrowser/qbot-dsh/content-review'
|
|
33
|
+
- id: llm-gateway-openai
|
|
34
|
+
name: '@qqbrowser/qbot-dsh/llm-gateway-openai'
|
|
35
|
+
config:
|
|
36
|
+
host: '127.0.0.1'
|
|
37
|
+
port: !!js Number(process.env.DSH_QB_GATEWAY_PORT)
|
|
38
|
+
upstream:
|
|
39
|
+
baseURL: https://qbqaproxy.imtt.qq.com/openapi
|
|
40
|
+
timeoutMs: 120000
|
|
41
|
+
auth:
|
|
42
|
+
kind: qb-encode-token
|
|
43
|
+
review:
|
|
44
|
+
input: true
|
|
45
|
+
output: true
|
|
46
|
+
thresholdChars: 100
|
|
47
|
+
- id: web-search-dsh
|
|
48
|
+
name: '@qqbrowser/qbot-dsh/web-search-dsh'
|
|
49
|
+
- id: qbot-web-product
|
|
50
|
+
name: '@qqbrowser/qbot-dsh'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var m=Object.defineProperty;var s=(r,i)=>m(r,"name",{value:i,configurable:!0});import{r as g}from"./native-protocol-DdrIh89-.js";import{Command as v,CommanderError as b}from"commander";const c=s((r,i=[])=>[...i,r],"collect"),w=`
|
|
2
|
+
Examples:
|
|
3
|
+
qbot-dsh --profile web boot the web profile (same as: qbot-dsh web)
|
|
4
|
+
qbot-dsh --profile headless "run the tests" answer one task, print the result, and exit
|
|
5
|
+
qbot-dsh --profile tui --patch ./extra.yml boot a custom profile with one extra overlay
|
|
6
|
+
qbot-dsh --profile tui --resume <session> arguments after the launcher flags reach the app
|
|
7
|
+
qbot-dsh --profile web --help the web app's own flags and help
|
|
8
|
+
qbot-dsh plugin --profile tui add <package> install a plugin into the tui profile
|
|
9
|
+
`;function h(r,i,o,n,a){const e=o.patch??[];if(e.includes("")&&r.error("error: --patch needs a path"),o.dumpConfig!==!0&&o.dumpDefaultConfig!==!0)return a===void 0?{mode:"profile",profile:i,patches:e,args:n}:{mode:"profile",profile:i,patches:e,args:n,nativeProtocol:a};o.dumpConfig===!0&&o.dumpDefaultConfig===!0&&r.error("error: --dump-config and --dump-default-config are mutually exclusive"),a!==void 0&&r.error("error: --native-protocol cannot combine with a config dump"),n.length>0&&r.error(`error: config dumps take no app arguments, got ${n.map(f=>JSON.stringify(f)).join(" ")}`);const l=o.dumpDefaultConfig===!0;return l&&e.length>0&&r.error("error: --dump-default-config prints the bundle layers and takes no --patch"),{mode:"dump-config",profile:i,defaultOnly:l,patches:e}}s(h,"resolveBoot");function y(r){const i=[];let o;for(let n=0;n<r.length;n+=1){const a=r[n];let e;if(a==="--native-protocol"){const l=r[n+1];l!==void 0&&!l.startsWith("-")?(e=l,n+=1):e=!0}else if(a.startsWith("--native-protocol="))e=a.slice(18);else{i.push(a);continue}if(o!==void 0)throw new Error("--native-protocol may be specified only once");o=g(e)}return o===void 0?{argv:i}:{argv:i,nativeProtocol:o}}s(y,"extractNativeProtocolArgv");function x(r,i){let o,n=[],a;const e=new v;e.name("qbot-dsh").version(i,"-V, --version","output the version number").description("qbot-dsh: boot a DeepSeek Harness profile — an ordered stack of plugin-bundle patch layers under your own overrides.").addHelpText("after",w).exitOverride().helpOption(!1).allowUnknownOption().passThroughOptions().enablePositionalOptions().argument("[args...]","arguments for the booted profile's app (see: qbot-dsh --profile <name> --help)").option("--profile <name>","the profile under $DSH_HOME/profiles to boot").option("--patch <path>","extra patch-list overlay applied after the profile layer (repeatable)",c).option("--native-protocol [protocol]","reserve stdout for a native host protocol (jsonl-v1)").option("--dump-config","print the composed profile tree and exit").option("--dump-default-config","print the profile tree without its user layer or --patch overlays and exit").action((t,p)=>{p.profile===void 0&&(t.some(u=>u==="-h"||u==="--help")&&e.help(),e.error("error: --profile <name> is required"));const d=p.profile;d===""&&e.error("error: --profile needs a name"),o=h(e,d,p,t,a)});const l=s(t=>{const p=e.opts();(p.profile!==void 0||p.patch!==void 0||p.dumpConfig!==void 0||p.dumpDefaultConfig!==void 0)&&e.error(`error: ${t} takes none of parent --profile, --patch, --native-protocol, --dump-config, or --dump-default-config`)},"rejectParentOptions"),f=e.command("web").description("boot the web profile (alias of --profile web); the web app's own flags follow");f.helpOption(!1).allowUnknownOption().passThroughOptions().enablePositionalOptions().argument("[args...]","arguments for the web app (see: qbot-dsh web --help)").option("--patch <path>","extra patch-list overlay applied after the profile layer (repeatable)",c).option("--native-protocol [protocol]","reserve stdout for a native host protocol (jsonl-v1)").option("--dump-config","print the composed web-profile tree (with the user layer and any --patch) and exit").option("--dump-default-config","print the web profile's bundle layers (no user layer) and exit").action((t,p)=>{l("web"),o=h(f,"web",p,t,a)}),e.command("plugin").description("manage a profile's plugins by forwarding the remaining arguments to pnpm in the profile directory").requiredOption("--profile <name>","the profile whose plugins to manage (initialized on first use)").allowUnknownOption().argument("[args...]","pnpm arguments, forwarded verbatim (add <pkg>, remove <pkg>, why <pkg>, ...)").action((t,p)=>{l("plugin"),a!==void 0&&e.error("error: plugin takes no --native-protocol"),p.profile===""&&e.error("error: --profile needs a name"),t.length===0&&e.error("error: plugin needs pnpm arguments to forward (e.g. add <package>)"),o={mode:"plugin",profile:p.profile,args:t}});try{try{({argv:n,nativeProtocol:a}=y(r))}catch(t){e.error(`error: ${t.message}`)}e.parse(n,{from:"user"})}catch(t){return process.exit(t instanceof b?t.exitCode:1)}if(o===void 0)throw new Error("qbot-dsh: no invocation resolved");return o}s(x,"parseDshArgs");export{x as parseDshArgs};
|
package/lib/bin.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`)}};function A(t){return v(t)?new S:void 0}s(A,"createNativeProtocolWriter");function R(t,e=process.platform,o=process.arch){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error("qbot-dsh: package manifest is not an object");const r=t,i=typeof r.version=="string"?r.version:"0.0.0";if(r.dshRelease===void 0)return i;if(r.dshRelease===null||typeof r.dshRelease!="object"||Array.isArray(r.dshRelease))throw new Error("qbot-dsh: package manifest has invalid dshRelease metadata");const n=r.dshRelease.targets;if(!Array.isArray(n)||n.length===0||n.some(w=>typeof w!="string"))throw new Error("qbot-dsh: package manifest has invalid dshRelease.targets metadata");const c=`${e}-${o}`;if(!n.includes(c))throw new Error(`qbot-dsh: unsupported target ${c}; this package supports ${n.join(", ")}`);return i}s(R,"releaseVersionForTarget");function _(){return R(JSON.parse(E(l(new URL("../package.json",import.meta.url)),"utf8")))}s(_,"readVersion");const u=process.argv.slice(2),h=A(u),{parseDshArgs:W}=await import("./args-DcHS9iff.js"),a=W(u,_());switch(a.mode){case"profile":{if(import.meta.url.endsWith("/src/bin.ts")){const[o,r,i]=await Promise.all([import("node:fs"),import("node:path"),import("@deepseek-ai/dsh-home-paths")]),n=r.join(i.resolveDshHome(),"profiles");o.mkdirSync(n,{recursive:!0});try{o.symlinkSync(l(new URL("../../../node_modules/.pnpm/node_modules/",import.meta.url)),r.join(n,"node_modules"),"junction")}catch(c){if(c.code!=="EEXIST")throw c}}const{runProfile:t}=await import("./profile-boot-BkordgJK.js"),{loadLayeredEnv:e}=await import("@deepseek-ai/dsh-app-boot");try{await t({environment:e("qbot-dsh"),profile:a.profile,patchFiles:a.patches,args:a.args,...h===void 0?{}:{nativeProtocol:h}})}catch(o){throw h?.emitError(L(o)),o}break}case"plugin":{const{runPlugin:t}=await import("./plugin-DNAeLZbb.js");process.exit(t(a.profile,a.args));break}case"dump-config":{const{runDumpConfig:t}=await import("./dump-config-xQTUTTDD.js");t(a.profile,a.defaultOnly,a.patches);break}default:throw new Error(`qbot-dsh: unhandled invocation mode ${JSON.stringify(a)}`)}export{};
|
|
2
|
+
var d=Object.defineProperty;var n=(r,a)=>d(r,"name",{value:a,configurable:!0});import{n as l,t as h}from"./native-protocol-DdrIh89-.js";import{readFileSync as f}from"node:fs";import{homedir as m}from"node:os";import{join as w}from"node:path";import{fileURLToPath as u}from"node:url";function g(r,a=process.platform,i=process.arch){if(r===null||typeof r!="object"||Array.isArray(r))throw new Error("qbot-dsh: package manifest is not an object");const o=r,s=typeof o.version=="string"?o.version:"0.0.0";if(o.dshRelease===void 0)return s;if(o.dshRelease===null||typeof o.dshRelease!="object"||Array.isArray(o.dshRelease))throw new Error("qbot-dsh: package manifest has invalid dshRelease metadata");const e=o.dshRelease.targets;if(!Array.isArray(e)||e.length===0||e.some(p=>typeof p!="string"))throw new Error("qbot-dsh: package manifest has invalid dshRelease.targets metadata");const c=`${a}-${i}`;if(!e.includes(c))throw new Error(`qbot-dsh: unsupported target ${c}; this package supports ${e.join(", ")}`);return s}n(g,"releaseVersionForTarget"),process.env.DSH_HOME??=w(m(),".qbot-dsh");function v(){return g(JSON.parse(f(u(new URL("../package.json",import.meta.url)),"utf8")))}n(v,"readVersion");const y=process.argv.slice(2),{parseDshArgs:b}=await import("./args-w1okyL78.js"),t=b(y,v());switch(t.mode){case"profile":{const r=t.nativeProtocol===void 0?void 0:new h,{runProfile:a}=await import("./profile-boot-CxJUSdnu.js"),{loadLayeredEnv:i}=await import("@deepseek-ai/dsh-app-boot"),{ensureGatewayPort:o}=await import("./gateway-port-CSFbDyoZ.js");try{await o();const{ctx:s}=await a({environment:i("qbot-dsh"),profile:t.profile,patchFiles:t.patches,args:t.args}),e=s.get("webServer");r!==void 0?e===void 0?r.emitReady():r.emitReady({host:"127.0.0.1",port:e.port,pid:process.pid}):e!==void 0&&console.log(`qbot-dsh web: http://${e.host}:${String(e.port)}`)}catch(s){throw r?.emitError(l(s)),s}break}case"plugin":{const{runPlugin:r}=await import("./plugin-viWCLnSr.js");process.exit(r(t.profile,t.args));break}case"dump-config":{const{runDumpConfig:r}=await import("./dump-config-CIL0Goqj.js"),{ensureGatewayPort:a}=await import("./gateway-port-CSFbDyoZ.js");await a(),r(t.profile,t.defaultOnly,t.patches);break}default:throw new Error(`qbot-dsh: unhandled invocation mode ${JSON.stringify(t)}`)}export{};
|
package/lib/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var F=Object.defineProperty;var n=(u,h)=>F(u,"name",{value:h,configurable:!0});window.__ModuleLoader__.load({id:"@qqbrowser/qbot-dsh",factory:n(u=>{var h={exports:{}},k=h.exports;Object.defineProperty(k,Symbol.toStringTag,{value:"Module"});let S=u("@deepseek-ai/dsh-client-runtime/client"),l=u("react/jsx-runtime"),v=u("@deepseek-ai/dsh-client-ui-primitives");function q(){return globalThis.crypto.randomUUID()}n(q,"eventId");var I=class{static{n(this,"PostMessageAnalytics")}target;targetOrigin;constructor(e,t="*"){this.target=e,this.targetOrigin=t}emit(e){const{name:t,occurredAt:s,...i}=e;this.target.postMessage({channel:"dsh-web-analytics",version:1,eventId:q(),event:t,timestamp:s,data:i},this.targetOrigin)}};function g(e,t){try{e.emit(t)}catch{}}n(g,"emitAnalytics");var x=class{static{n(this,"QbotAnalyticsTracker")}sink;turns=new Map;lastSeq=new Map;constructor(e){this.sink=e}handle(e,t){const s=String(e),i=this.lastSeq.get(s);if(!(i!==void 0&&t.seq<=i))switch(this.lastSeq.set(s,t.seq),t.type){case"turn/start":this.turns.set(s,{turn:t.data.turn,firstTokenReported:!1});return;case"step/start":{const r=this.stateFor(s,t.data.turn);r.step=t.data.step;return}case"user/message":if(t.data.source.kind!=="user")return;this.questionSent(s,t,this.turns.get(s));return;case"assistant/chunk":if(!(0,S.isTokenDelta)(t.data.chunk))return;this.firstToken(s,t,this.turns.get(s));return;case"assistant/message":{const r=this.stateFor(s,t.data.turn);r.assistantMessageId=String(t.data.message.id),r.step=t.data.step;return}case"turn/end":this.answerCompleted(s,t,this.turns.get(s)),this.turns.delete(s);return;default:return}}clear(e){const t=String(e);this.turns.delete(t),this.lastSeq.delete(t)}stateFor(e,t){const s=this.turns.get(e);if(s!==void 0)return t!==void 0&&(s.turn=t),s;const i={turn:t??0,firstTokenReported:!1};return this.turns.set(e,i),i}questionSent(e,t,s){const i=String(t.data.id),r=s??this.stateFor(e,void 0);r.userMessageId===void 0&&(r.userMessageId=i),r.questionAt===void 0&&(r.questionAt=t.time),g(this.sink,{name:"send",occurredAt:t.time,sessionId:e,userMessageId:i,eventSeq:t.seq,...r.turn>0?{turn:r.turn}:{},...r.step===void 0?{}:{step:r.step}})}firstToken(e,t,s){const i=s??this.stateFor(e,t.data.turn);i.turn=t.data.turn,i.step=t.data.step,!i.firstTokenReported&&(i.firstTokenReported=!0,g(this.sink,{name:"ai_first_token",occurredAt:t.time,sessionId:e,eventSeq:t.seq,turn:t.data.turn,step:t.data.step,...i.userMessageId===void 0?{}:{userMessageId:i.userMessageId},...i.questionAt===void 0?{}:{latencyMs:Math.max(0,t.time-i.questionAt)}}))}answerCompleted(e,t,s){g(this.sink,{name:"ai_reply_complete",occurredAt:t.time,sessionId:e,eventSeq:t.seq,turn:t.data.turn,status:t.data.reason.kind,...s?.userMessageId===void 0?{}:{userMessageId:s.userMessageId},...s?.assistantMessageId===void 0?{}:{assistantMessageId:s.assistantMessageId},...s?.questionAt===void 0?{}:{durationMs:Math.max(0,t.time-s.questionAt)}})}};const y="qbot.analytics",M={kind:"qbot-analytics-event",target:y,match:n(e=>e.type==="turn/start"||e.type==="step/start"||e.type==="user/message"&&e.data.source.kind==="user"||e.type==="assistant/chunk"&&(0,S.isTokenDelta)(e.data.chunk)||e.type==="assistant/message"||e.type==="turn/end"?{id:String(e.seq),role:"start"}:null,"match"),start:n((e,t)=>t.event,"start"),update:n(e=>e.state,"update"),buildViewNode:n(e=>{const t=e.start;return t===void 0?null:{key:e.key,kind:"qbot-analytics-event",id:e.id,target:y,data:{event:t.event,location:t.location}}},"buildViewNode")},A={target:y,create:n(()=>{let e=0;return{empty:{revision:e,live:[]},replace:n(()=>({revision:++e,live:[]}),"replace"),apply:n(({upserts:t})=>({revision:++e,live:t}),"apply")}},"create")};function E(e,t){const s=e.workspaces,i=Reflect.get(s,"startSession"),r=n(p=>{const f=s.list.getSnapshot(),o=e.sessions.list.getSnapshot().current,a=o===void 0?void 0:f.items.find(m=>m.sessionIds.includes(o))?.workspaceId,c=p??a??f.recentWorkspaceId;g(t,{name:"new_session",occurredAt:Date.now(),...o===void 0?{}:{currentSessionId:String(o)},...c===void 0?{}:{workspaceId:String(c)}}),i.call(s,p)},"decorated");return s.startSession=r,()=>{s.startSession===r&&(s.startSession=i)}}n(E,"installNewSessionAnalytics");function j(e,t){const s=new x(t),i=new Map,r=n(o=>{if(i.has(o))return;const a=e.sessions.binding(o)?.session;if(a===void 0)return;const c={session:a,revision:void 0,dispose:n(()=>{},"dispose")},m=n(()=>{const w=a.getSnapshot().views.get(y);if(!(w===void 0||w.revision===c.revision)){c.revision=w.revision;for(const L of w.live)s.handle(o,L.data.event)}},"consume");c.dispose=a.subscribe(m),i.set(o,c),m()},"watch"),p=n(()=>{const o=new Set(e.sessions.list.getSnapshot().ids);for(const a of o)r(a);for(const[a,c]of i)o.has(a)||(c.dispose(),i.delete(a),s.clear(a))},"reconcile"),f=e.sessions.list.subscribe(p);return p(),()=>{f();for(const o of i.values())o.dispose();i.clear()}}n(j,"installSessionAnalytics");const T={"policy.nav":"政策说明","policy.title":"政策说明","policy.intro":"请阅读下述条款,使用本服务表示您已同意相关约定。","policy.harness":"DeepSeek Harness","policy.security":"DeepSeek安全使用政策","policy.data":"DeepSeek数据使用说明","policy.browser":"QQ浏览器服务规则"},D={"policy.nav":"Policy","policy.title":"Policy","policy.intro":"Please read the following terms. Using this service means you agree to them.","policy.harness":"DeepSeek Harness","policy.security":"DeepSeek Security Policy","policy.data":"DeepSeek Data Usage Notice","policy.browser":"QQ Browser Service Rules"},N=[{id:"harness",label:"policy.harness",href:"https://harness.io"},{id:"security",label:"policy.security",href:"https://harness.io/security"},{id:"data",label:"policy.data",href:"https://harness.io/data"},{id:"browser",label:"policy.browser",href:"https://harness.io/browser"}],Z=".EZ91Ia_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:19px;display:flex}.EZ91Ia_title{margin:0;font-size:18px;font-weight:500;line-height:19px}.EZ91Ia_intro{color:var(--dsw-alias-label-tertiary);margin:0;font-size:16px;line-height:19px}.EZ91Ia_links{border:1px solid var(--dsw-alias-border-l2);border-radius:16px;padding:0 19px;overflow:hidden}.EZ91Ia_link{box-sizing:border-box;border:0;border-bottom:1px solid var(--dsw-alias-border-l1);min-height:64px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;justify-content:space-between;align-items:center;gap:16px;font-size:16px;line-height:20px;text-decoration:none;display:flex}.EZ91Ia_link:last-child{border-bottom:0}.EZ91Ia_icon{flex:none}",_="@qqbrowser/qbot-dsh/PolicySection.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(_)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@qqbrowser/qbot-dsh",e.dataset.pluginCss=_,e.textContent=Z,document.head.appendChild(e)}var d={section:"EZ91Ia_section",title:"EZ91Ia_title",link:"EZ91Ia_link",icon:"EZ91Ia_icon",links:"EZ91Ia_links",intro:"EZ91Ia_intro"};function P({link:e,t}){return(0,l.jsxs)("a",{className:d.link,href:e.href,rel:"noopener noreferrer",target:"_blank",children:[(0,l.jsx)("span",{children:t(e.label)}),(0,l.jsx)(v.IconRightUpOutline16,{className:d.icon,size:11,"aria-hidden":"true"})]})}n(P,"PolicyLinkRow");function R({t:e}){return(0,l.jsxs)("section",{className:d.section,children:[(0,l.jsx)("h2",{className:d.title,children:e("policy.title")}),(0,l.jsx)("p",{className:d.intro,children:e("policy.intro")}),(0,l.jsx)("div",{className:d.links,children:N.map(t=>(0,l.jsx)(P,{link:t,t:e},t.id))})]})}n(R,"PolicySection");const b="qbot.product",C=["slots","sessions","workspaces","conversationEvents","conversationViews","locale"];function O(){const e=window.opener;return window.parent!==window?window.parent:e??window}n(O,"analyticsTarget");function z(e){const t=new I(O());e.effect(()=>e.locale.register(b,{zh:T,en:D}),"qbot-product: dictionaries");const s=e.locale.bind(b);e.slots.inject("settings.section",()=>e.slots.register({name:"settings.section",id:"policy",order:30,label:n(()=>s("policy.nav"),"label"),locale:b},R)),e.conversationViews.register(A),e.conversationEvents.register(M),e.effect(()=>j(e,t),"qbot-product: session analytics"),e.effect(()=>E(e,t),"qbot-product: new-session analytics")}return n(z,"apply"),k.apply=z,k.inject=C,h.exports},"factory")});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var n=(s,t)=>d(s,"name",{value:t,configurable:!0});import{Service as w}from"@deepseek-ai/cordis";const a={UNSPECIFIED:0,INPUT:1,OUTPUT:2,THINKING:3},o={PASS:10001,DELETE:30001,DELETE_AND_END:50001,PASS_AND_END:50002},c=n(s=>s===o.PASS,"isPhaseActionPass"),r=n((s,t)=>{const e=s[t];return typeof e=="number"&&Number.isFinite(e)?e:0},"readNumber"),h=n(s=>{const t=typeof s=="object"&&s!==null?s:{},e=t.session_id,i=t.fallback_msg;return{sessionId:typeof e=="string"?e:"",pass:t.pass===!0,fallbackMsg:typeof i=="string"?i:"",isShow:r(t,"is_show"),phaseAction:r(t,"phase_action")}},"parseReviewReply"),E=n((s,t,e)=>{if(t===a.INPUT&&!s.pass)return{fallbackMsg:`${s.phaseAction}${s.fallbackMsg}`,isShow:s.isShow,phaseAction:s.phaseAction};if(t===a.OUTPUT&&!c(s.phaseAction)){let i=s.fallbackMsg;return s.phaseAction===o.DELETE_AND_END?i=`${o.DELETE_AND_END}${i}`:s.phaseAction===o.PASS_AND_END&&(i=`${o.PASS_AND_END}${e}`),{fallbackMsg:i,isShow:s.isShow,phaseAction:s.phaseAction}}},"evaluateReview");var A=class extends Error{static{n(this,"ContentReviewFailedError")}code="CONTENT_REVIEW_FAILED";fallbackMsg;isShow;phaseAction;constructor(s){super("content review denied the submitted text"),this.name="ContentReviewFailedError",this.fallbackMsg=s.fallbackMsg,this.isShow=s.isShow,this.phaseAction=s.phaseAction}};const _="trpc_mtt_content_review_ContentReview",N="GetReviewResult";var u=class extends w{static{n(this,"ContentReview")}static inject=["qbAuth"];constructor(s){super(s,"contentReview")}async review(s){const t=await this.ctx.qbAuth.identity(),e=h(await this.ctx.qbAuth.rpc({servantName:_,funcName:N,body:{user_base_info:{guid:t.guid,qimei36:t.qimei36,qua2:t.qua2},session_id:s.sessionId??t.qimei36,text:s.text,audit_content_type:s.type}})),i=E(e,s.type,s.text);if(i!==void 0)throw new A(i);return{sessionId:e.sessionId}}};export{A as a,c,a as i,h as l,u as n,o,N as r,E as s,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,c as s,i as t,l as i,n as e,o,r as n,s as E,t as R}from"./content-review-CqDoh3wY.js";export{t as AuditContentType,R as CONTENT_REVIEW_SERVANT,e as ContentReview,e as default,a as ContentReviewFailedError,n as GET_REVIEW_RESULT,o as PhaseAction,E as evaluateReview,s as isPhaseActionPass,i as parseReviewReply};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var r=(s,t)=>m(s,"name",{value:t,configurable:!0});import{a as n,i as f,r as P}from"./profile-boot-DCgBQ4qO.js";import{existsSync as d}from"node:fs";import{join as u,resolve as b}from"node:path";import{loadOptionalPatches as E,loadOverlayPatches as O,renderConfigDump as g}from"@deepseek-ai/dsh-app-boot";const c="qbot-dsh";function v(s,t,i){const o=n(s,!t),e=o.layers.map(a=>({label:a.packageName,patches:a.patches}));if(!t){d(o.patchPath)&&e.push({label:o.patchPath,patches:o.patches});const a=f(),p=E(c,a);p!==void 0&&e.push({label:a,patches:p});for(const l of i){const h=b(l);e.push({label:h,patches:O(c,h)})}}process.stdout.write(g(c,u(o.dir,P),e))}r(v,"runDumpConfig");export{v as runDumpConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});import{createServer as d}from"node:net";const s="DSH_QB_GATEWAY_PORT";function u(e){const r=Number(e);if(!Number.isInteger(r)||r<1||r>65535)throw new Error(`qbot-dsh: ${s} must be an integer between 1 and 65535, found ${JSON.stringify(e)}`);return r}t(u,"parsePinnedPort");function p(){return new Promise((e,r)=>{const n=d();n.once("error",r),n.listen(0,"127.0.0.1",()=>{const o=n.address();if(o===null||typeof o=="string"){n.close(()=>{r(new Error("qbot-dsh: gateway port probe returned no address"))});return}const{port:a}=o;n.close(i=>{i!==void 0?r(i):e(a)})})})}t(p,"allocatePort");async function f(e=process.env){const r=e[s];if(r!==void 0&&r!=="")return u(r);const n=await p();return e[s]=String(n),n}t(f,"ensureGatewayPort");export{f as ensureGatewayPort};
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var p=(n,o)=>t(n,"name",{value:o,configurable:!0});function a(){}p(a,"apply");export{a as apply};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var oe=Object.defineProperty;var o=(e,t)=>oe(e,"name",{value:t,configurable:!0});import{d as se,m as ie,t as ce}from"./qb-auth-C2ofR1zn.js";import{a as le,i as M}from"./content-review-CqDoh3wY.js";import{Service as q}from"@deepseek-ai/cordis";import c from"@deepseek-ai/schemastery";import{StringDecoder as ue}from"node:string_decoder";import{randomBytes as F}from"node:crypto";import{createServer as de,request as he}from"node:http";import{credentialRef as K}from"@deepseek-ai/dsh-credentials";import{request as fe}from"node:https";const G="DSH_QB_GATEWAY_KEY";var P=class extends Error{static{o(this,"GatewayConfigError")}code="GATEWAY_CONFIG_INVALID";constructor(e,t){super(e,t),this.name="GatewayConfigError"}};const ye=o(e=>{let t;try{t=new URL(e)}catch(n){throw new P(`llm-gateway: upstream.baseURL is not a URL: ${e}`,{cause:n})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new P(`llm-gateway: upstream.baseURL must be http or https, found ${t.protocol}`);const r=t.protocol==="https:"?443:80;return{protocol:t.protocol,hostname:t.hostname,port:t.port===""?r:Number(t.port),basePath:t.pathname.replace(/\/+$/,""),hostHeader:t.host}},"resolveUpstream"),V=o(e=>{const t=e.auth.kind==="credential"?(()=>{if(e.auth.ref==="")throw new P('llm-gateway: auth.kind "credential" requires auth.ref');return{kind:"credential",ref:e.auth.ref}})():{kind:"qb-encode-token"};if(e.keyRef==="")throw new P("llm-gateway: keyRef must name a credential reference");return{host:e.host,port:e.port,upstream:ye(e.upstream.baseURL),timeoutMs:e.upstream.timeoutMs,auth:t,review:{...e.review},keyRef:e.keyRef,generateKey:e.generateKey,maxRequestBytes:e.maxRequestBytes,modelMap:{...e.modelMap}}},"resolveSpec"),Y=new Set(["host","connection","keep-alive","transfer-encoding","upgrade","te","trailer","proxy-authorization","proxy-authenticate","proxy-connection"]),pe=o(e=>{let t;try{t=decodeURIComponent(e)}catch{return!0}return t.split("/").some(r=>r===".."||r===".")},"hasDotSegment"),me=o((e,t)=>{const r=e.indexOf("?"),n=r===-1?e:e.slice(0,r),a=r===-1?"":e.slice(r);if(!n.startsWith("/"))return{ok:!1,reason:"malformed"};if(pe(n))return{ok:!1,reason:"traversal"};if(!n.startsWith("/v1/"))return{ok:!1,reason:"not-v1"};const s=`${t}${n.slice(3)}`;return s.startsWith(t)?{ok:!0,path:`${s===""?"/":s}${a}`}:{ok:!1,reason:"traversal"}},"mapUpstreamPath"),ge=o((e,t,r)=>{const n={};for(const[a,s]of Object.entries(e))s!==void 0&&(Y.has(a.toLowerCase())||(n[a]=s));n.host=t.hostHeader;for(const[a,s]of Object.entries(r))n[a]=s;return n},"buildForwardHeaders"),we=o(e=>(e.target.protocol==="https:"?fe:he)({protocol:e.target.protocol,hostname:e.target.hostname,port:e.target.port,path:e.path,method:e.method,headers:e.headers,timeout:e.timeoutMs}),"openUpstreamRequest"),p={INVALID_REQUEST:"invalid_request_error",AUTH:"authentication_error",SERVER:"server_error",CONTENT_FILTER:"content_filter",INSUFFICIENT_QUOTA:"insufficient_quota",UPSTREAM:"upstream_error"},d={NOT_FOUND:"not_found",MISSING_API_KEY:"missing_api_key",INVALID_API_KEY:"invalid_api_key",BAD_REQUEST:"bad_request",AUTH_EXPIRED:"auth_expired",TOKEN_FETCH_ERROR:"token_fetch_error",PROXY_ERROR:"proxy_error",GATEWAY_TIMEOUT:"gateway_timeout",CONTENT_REVIEW_FAILED_INPUT:"content_review_failed_input",CONTENT_REVIEW_FAILED_OUTPUT:"content_review_failed_output",CONTENT_REVIEW_FAILED_OUTPUT_PARTIAL:"content_review_failed_output_partial",TOKEN_EXHAUSTED:"token_exhausted",UPSTREAM_UNAVAILABLE:"upstream_unavailable"},Ee="Auto",B="当前使用人数较多,请稍后再试",H="抱歉,暂时无法回答该问题",_e="输入内容包含违规信息,请修改后重试。",j=o(()=>`chatcmpl-${F(12).toString("hex")}`,"completionId"),W=o(()=>Math.floor(Date.now()/1e3),"createdAt"),I=o((e,t,r,n,a,s)=>{const l=JSON.stringify({error:{message:r,type:n,code:a,...s??{}}});e.writeHead(t,{"Content-Type":"application/json","Content-Length":Buffer.byteLength(l)}),e.end(l)},"sendOpenAIError"),ve=o((e,t,r)=>{const n=JSON.stringify({id:j(),object:"chat.completion",created:W(),model:r,choices:[{index:0,message:{role:"assistant",content:t},finish_reason:"stop"}],usage:{prompt_tokens:0,completion_tokens:0,total_tokens:0}});e.writeHead(200,{"Content-Type":"application/json","Content-Length":Buffer.byteLength(n)}),e.end(n)},"sendOpenAIResponse"),Ae=o((e,t,r)=>{if(!e.writable)return;const n=j(),a=W();e.write(`data: ${JSON.stringify({id:n,object:"chat.completion.chunk",created:a,model:r,choices:[{index:0,delta:{role:"assistant",content:t},finish_reason:null}]})}
|
|
2
|
+
|
|
3
|
+
`),e.write(`data: ${JSON.stringify({id:n,object:"chat.completion.chunk",created:a,model:r,choices:[{index:0,delta:{},finish_reason:"stop"}]})}
|
|
4
|
+
|
|
5
|
+
`),e.write(`data: [DONE]
|
|
6
|
+
|
|
7
|
+
`),e.end()},"writeSSEMessageAndEnd"),L=o((e,t,r,n,a)=>{e.writable&&(e.write(`data: ${JSON.stringify({error:{message:t,type:r,code:n,...a??{}}})}
|
|
8
|
+
|
|
9
|
+
`),e.write(`data: [DONE]
|
|
10
|
+
|
|
11
|
+
`),e.end())},"writeSSEErrorAndEnd"),C=o((e,t)=>{if(!t.isStream||!e.headersSent){if(e.headersSent){e.end();return}I(e,t.httpStatus,t.message,t.type,t.code,t.extra);return}L(e,t.message,t.type,t.code,t.extra)},"respondOpenAIError"),S=o((e,t)=>{if(!(typeof e!="object"||e===null))return e[t]},"child$1"),Q=o((e,t)=>{const r=S(e,t);return Array.isArray(r)?r:[]},"childArray"),J=o(e=>{const t=Q(e,"choices")[0],r=S(t,"delta");if(r==null)return{content:"",hasToolCalls:!1};const n=S(r,"content"),a=S(r,"function_call");return{content:typeof n=="string"?n:"",hasToolCalls:Q(r,"tool_calls").length>0||a!=null}},"extractDelta"),z=o(e=>S(e,"type")==="upstream_error"||S(S(e,"error"),"type")==="upstream_error","isUpstreamError"),X=o(e=>{const t=S(e,"reqid");if(typeof t=="string")return t;const r=S(S(e,"error"),"reqid");return typeof r=="string"?r:""},"readUpstreamReqid");var Te=class{static{o(this,"SseLineReader")}decoder=new ue("utf8");buffer="";read(e){this.buffer+=this.decoder.write(e).replace(/\r\n?/g,`
|
|
12
|
+
`);const t=this.buffer.split(`
|
|
13
|
+
`);return this.buffer=t.pop()??"",t}get remainder(){return this.buffer}};const Z=o(e=>{const t=e.trim();return t===""?{kind:"blank"}:t==="data: [DONE]"?{kind:"done"}:t.startsWith("data: ")?{kind:"data",payload:t.slice(6)}:{kind:"other"}},"classifySseLine"),ee=o(e=>{try{return JSON.parse(e)}catch{return}},"parseSsePayload"),Re=o(e=>{const{res:t,upstream:r,logger:n,requestId:a}=e,s=new Te;let l=[],_=0,h="",m="",E=!1,g=!1,A=!1,y=!1,v=!1,k=Promise.resolve();const N=o(()=>!y&&t.writable,"canContinue"),O=o(u=>{t.write(`data: ${u}
|
|
14
|
+
|
|
15
|
+
`)},"writePayload"),b=o(()=>{if(l.length!==0){for(const u of l)O(u);A=!0,l=[],_=0}},"flush"),$=o(()=>{l=[],_=0},"discard"),T=o(u=>{y=!0,$();const i=A?d.CONTENT_REVIEW_FAILED_OUTPUT_PARTIAL:d.CONTENT_REVIEW_FAILED_OUTPUT;n.debug(`llm-gateway[${a}]: output review denied the turn (partial=${String(A)})`),L(t,u.fallbackMsg,p.CONTENT_FILTER,i,u.extra),r.destroy()},"denyOutput"),x=o(async()=>{const u=h;h="";const i=e.reviewOutput;if(i===void 0||u===""){b();return}r.pause();try{const f=await i(u);if(y)return;if(f!==void 0){T(f);return}b()}catch(f){n.warn(`llm-gateway[${a}]: output review unavailable, releasing buffered output (${f instanceof Error?f.name:"unknown error"})`),b()}finally{!y&&!r.destroyed&&r.resume()}},"reviewAccumulated"),R=o(()=>{v=!0,k=x().finally(()=>{v=!1}),k.catch(u=>{n.warn(`llm-gateway[${a}]: stream gate review failed unexpectedly: ${u instanceof Error?u.message:String(u)}`)})},"runReview");r.on("data",u=>{if(N()){for(const i of s.read(u)){const f=Z(i);if(f.kind==="done"){g=!0;continue}if(f.kind!=="data")continue;const U=ee(f.payload);if(z(U)){y=!0,$(),n.warn(`llm-gateway[${a}]: upstream reported a dependency failure (reqid=${X(U)})`),L(t,B,p.UPSTREAM,d.UPSTREAM_UNAVAILABLE),r.destroy();return}if(l.push(f.payload),_+=Buffer.byteLength(f.payload),U!==void 0){const D=J(U);h+=D.content,m+=D.content,D.hasToolCalls&&(E=!0)}}if(_>e.maxPendingBytes){y=!0,$(),n.warn(`llm-gateway[${a}]: buffered output exceeded maxPendingBytes (${String(e.maxPendingBytes)}); ending the turn`),L(t,B,p.UPSTREAM,d.UPSTREAM_UNAVAILABLE),r.destroy();return}if(h.length>=e.thresholdChars&&!v){R();return}e.reviewOutput===void 0&&b()}}),r.on("end",()=>{(async()=>{if(v&&await k,!N())return;const u=s.remainder;if(u.trim()!==""){const i=Z(u);if(i.kind==="data"){const f=ee(i.payload);if(f!==void 0){const U=J(f);h+=U.content,m+=U.content,U.hasToolCalls&&(E=!0)}l.push(i.payload)}else i.kind==="done"&&(g=!0)}if(h!==""&&await x(),!!N()){if(b(),m===""&&!E){n.debug(`llm-gateway[${a}]: upstream produced no output; sending the standard notice`),Ae(t,H,e.model);return}g&&t.write(`data: [DONE]
|
|
16
|
+
|
|
17
|
+
`),t.end()}})()})},"runStreamGate"),w=o((e,t)=>{if(!(typeof e!="object"||e===null))return e[t]},"child"),Se=o(e=>{const t=e.authorization;if(typeof t!="string")return;const r=/^Bearer\s+(.+)$/i.exec(t);return r===null?void 0:r[1]},"extractBearerToken"),ke=o((e,t)=>new Promise((r,n)=>{const a=[];let s=0;e.on("data",l=>{if(s+=l.length,s>t){n(new Error(`request body exceeds ${String(t)} bytes`)),e.destroy();return}a.push(l)}),e.once("end",()=>{r(Buffer.concat(a))}),e.once("error",n)}),"readRequestBody"),Ie=o(e=>{const t=[];for(const r of e){if(w(r,"role")!=="user")continue;const n=w(r,"content");if(typeof n=="string"){n.length>0&&t.push(n);continue}if(Array.isArray(n))for(const a of n){const s=w(a,"text");w(a,"type")==="text"&&typeof s=="string"&&s.length>0&&t.push(s)}}return t},"collectUserTexts"),be=o(e=>{let t=-1;for(let r=e.length-1;r>=0;r-=1)if(w(e[r],"role")==="user"){t=r;break}return t<0?!1:e.slice(t+1).some(r=>w(r,"role")==="tool")},"hasToolMessageAfterLastUser"),xe=o(e=>{const t=w(e,"choices");if(!Array.isArray(t))return{texts:[],hasToolCalls:!1};const r=[];let n=!1;for(const a of t){const s=w(a,"message"),l=w(s,"content");typeof l=="string"&&l.length>0&&r.push(l);const _=w(s,"tool_calls"),h=w(s,"function_call");(Array.isArray(_)&&_.length>0||h!=null)&&(n=!0)}return{texts:r,hasToolCalls:n}},"collectReplyTexts"),te=o(e=>{const t={};for(const[r,n]of Object.entries(e))n!==void 0&&(Y.has(r.toLowerCase())||(t[r]=n));return t},"relayResponseHeaders"),Ue=o(()=>Math.random().toString(36).slice(2,10),"newRequestId"),Ne=o(async(e,t,r)=>{const{spec:n,logger:a}=r,s=Ue(),l=e.url??"/",_=e.method??"GET",h=me(l,n.upstream.basePath);if(!h.ok){a.debug(`llm-gateway[${s}]: refusing ${_} target (${h.reason})`);const i=h.reason==="not-v1"?404:400,f=h.reason==="not-v1"?d.NOT_FOUND:d.BAD_REQUEST;I(t,i,h.reason==="not-v1"?"Not Found":"Bad Request",p.INVALID_REQUEST,f);return}const m=Se(e.headers);if(m===void 0){I(t,401,"You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth.",p.INVALID_REQUEST,d.MISSING_API_KEY);return}const E=await r.expectedKey();if(E===void 0||E===""||m!==E){I(t,401,"Incorrect API key provided. You can check your API key in the proxy configuration.",p.INVALID_REQUEST,d.INVALID_API_KEY);return}let g;try{g=await ke(e,n.maxRequestBytes)}catch(i){a.warn(`llm-gateway[${s}]: cannot read the request body: ${i instanceof Error?i.message:"unknown error"}`),t.headersSent||I(t,400,"Failed to read request body",p.INVALID_REQUEST,d.BAD_REQUEST);return}const A=l.includes("/chat/completions");let y,v=!1;if(A&&g.length>0)try{y=JSON.parse(g.toString("utf-8")),v=w(y,"stream")===!0}catch{}const k=w(y,"model"),N=typeof k=="string"&&k!==""?k:Ee;let O=g;const b=typeof k=="string"?n.modelMap[k]:void 0;b!==void 0&&typeof y=="object"&&y!==null&&(O=Buffer.from(JSON.stringify({...y,model:b}),"utf-8"));const $=w(y,"messages");if(r.reviewInput!==void 0&&A&&Array.isArray($)){const i=await Oe($,r,s);if(i!==void 0){C(t,{isStream:v,httpStatus:400,message:i.fallbackMsg===""?_e:i.fallbackMsg,type:p.CONTENT_FILTER,code:d.CONTENT_REVIEW_FAILED_INPUT,extra:i.extra});return}}let T;try{T=await r.upstreamAuth()}catch(i){C(t,$e(i,v)),a.warn(`llm-gateway[${s}]: cannot obtain upstream credentials: ${i instanceof Error?i.name:"unknown error"}`);return}const x={authorization:T.authorization,bus:ce};T.guid!==""&&(x.guid=T.guid),T.qimei36!==""&&(x.qimei36=T.qimei36),T.qua2!==""&&(x.qua2=T.qua2),O!==g&&(x["content-length"]=String(O.length));const R=we({target:n.upstream,method:_,path:h.path,headers:ge(e.headers,n.upstream,x),timeoutMs:n.timeoutMs}),u=r.track(R);R.on("response",i=>{const f=i.statusCode??502;if((i.headers["content-type"]??"").includes("text/event-stream")||v){t.writeHead(f,te(i.headers)),Re({res:t,upstream:i,model:N,thresholdChars:n.review.thresholdChars,maxPendingBytes:n.review.maxPendingBytes,reviewOutput:r.reviewOutput,logger:a,requestId:s});return}Pe({upstream:i,res:t,status:f,deps:r,requestId:s,modelLabel:N,isChatCompletions:A})}),R.on("timeout",()=>{a.warn(`llm-gateway[${s}]: upstream timed out after ${String(n.timeoutMs)}ms`),R.destroy(),C(t,{isStream:v,httpStatus:504,message:"Gateway Timeout",type:p.SERVER,code:d.GATEWAY_TIMEOUT})}),R.on("error",i=>{a.warn(`llm-gateway[${s}]: upstream request failed: ${i.message}`),C(t,{isStream:v,httpStatus:502,message:`Bad Gateway: ${i.message}`,type:p.SERVER,code:d.PROXY_ERROR})}),R.once("close",u),t.once("close",()=>{t.writableEnded||R.destroy()}),R.end(O)},"handleRequest"),Oe=o(async(e,t,r)=>{if(be(e)){t.logger.debug(`llm-gateway[${r}]: tool continuation; input already reviewed this turn`);return}const n=Ie(e).at(-1);if(n===void 0)return;const a=t.reviewInput;if(a!==void 0)try{return await a(n)}catch(s){t.logger.warn(`llm-gateway[${r}]: input review unavailable, forwarding anyway (${s instanceof Error?s.name:"unknown error"})`);return}},"reviewLastUserMessage"),$e=o((e,t)=>e instanceof ie?{isStream:t,httpStatus:429,message:e.message,type:p.INSUFFICIENT_QUOTA,code:d.TOKEN_EXHAUSTED}:e instanceof se?{isStream:t,httpStatus:401,message:`Auth token expired: ${e.message}`,type:p.AUTH,code:d.AUTH_EXPIRED}:{isStream:t,httpStatus:500,message:e instanceof Error?e.message:"unknown error",type:p.SERVER,code:d.TOKEN_FETCH_ERROR},"classifyAuthFailure"),Pe=o(e=>{const{upstream:t,res:r,status:n,deps:a,requestId:s,modelLabel:l,isChatCompletions:_}=e,h=[];t.on("data",m=>{h.push(m)}),t.once("error",m=>{if(a.logger.warn(`llm-gateway[${s}]: reading the upstream reply failed: ${m.message}`),!r.headersSent){I(r,502,`Bad Gateway: ${m.message}`,p.SERVER,d.PROXY_ERROR);return}r.end()}),t.once("end",()=>{(async()=>{const m=Buffer.concat(h);let E;if(_)try{E=JSON.parse(m.toString("utf-8"))}catch{}if(z(E)){if(a.logger.warn(`llm-gateway[${s}]: upstream reported a dependency failure (reqid=${X(E)})`),!r.headersSent){I(r,503,B,p.UPSTREAM,d.UPSTREAM_UNAVAILABLE);return}r.end();return}if(E!==void 0){const g=xe(E);if(g.texts.length===0&&!g.hasToolCalls){if(a.logger.debug(`llm-gateway[${s}]: upstream produced no output; sending the standard notice`),!r.headersSent){ve(r,H,l);return}r.end();return}const A=a.reviewOutput;if(A!==void 0&&g.texts.length>0){const y=await Le(A,g.texts.join(""),a,s);if(y!==void 0){if(!r.headersSent){I(r,400,y.fallbackMsg,p.CONTENT_FILTER,d.CONTENT_REVIEW_FAILED_OUTPUT,y.extra);return}r.end();return}}}if(r.headersSent){r.end();return}r.writeHead(n,te(t.headers)),r.end(m)})()})},"relayBufferedResponse"),Le=o(async(e,t,r,n)=>{try{return await e(t)}catch(a){r.logger.warn(`llm-gateway[${n}]: output review unavailable, relaying the reply (${a instanceof Error?a.name:"unknown error"})`);return}},"reviewOutputText");var re=class extends Error{static{o(this,"GatewayListenError")}code="GATEWAY_LISTEN_FAILED";constructor(e){super(`llm-gateway: failed to listen: ${e.message}`,{cause:e}),this.name="GatewayListenError"}},ne=class extends Error{static{o(this,"GatewayKeyError")}code="GATEWAY_KEY_UNWRITABLE";constructor(e,t){super(`llm-gateway: cannot store the gateway key in "${e}": a read-only source${t===void 0?"":` (${t})`} already supplies it. Point keyRef at an unused reference, or set generateKey to false to authenticate against the value that source provides.`),this.name="GatewayKeyError"}};const Ce=o(e=>{if(e instanceof le)return{fallbackMsg:e.fallbackMsg,extra:{phase_action:e.phaseAction,is_show:e.isShow}}},"toReviewDenial");var ae=class extends q{static{o(this,"LlmGateway")}static inject=["credentials","qbAuth","contentReview"];static Config=c.object({host:c.union([c.const("127.0.0.1"),c.const("0.0.0.0")]).default("127.0.0.1"),port:c.natural().max(65535).default(0),upstream:c.object({baseURL:c.string().required(),timeoutMs:c.natural().min(1e3).max(6e5).default(12e4)}),auth:c.object({kind:c.union([c.const("qb-encode-token"),c.const("credential")]).default("qb-encode-token"),ref:c.string().role("credential-ref").default("")}),review:c.object({input:c.boolean().default(!0),output:c.boolean().default(!0),thresholdChars:c.natural().min(1).default(100),maxPendingBytes:c.natural().min(1024).default(4194304)}),keyRef:c.string().role("credential-ref").default(G),maxRequestBytes:c.natural().min(1024).default(33554432),generateKey:c.boolean().default(!0),modelMap:c.dict(c.string()).default({})});spec;keyRef;inFlight=new Set;server;listenedPort;localKey;keyStored=!1;constructor(e,t){super(e,"llmGateway"),this.spec=V(t),this.keyRef=K(this.spec.keyRef)}get port(){return this.listenedPort}get host(){return this.spec.host}get baseURL(){return`http://${this.spec.host}:${String(this.listenedPort)}/v1`}inspect(){return{inFlight:this.inFlight.size,keyStored:this.keyStored}}async[q.init](){await this.establishKey();const e=this.buildDeps();this.server=de((t,r)=>{Ne(t,r,e).catch(n=>{if(this.ctx.logger.warn(`llm-gateway: request handling failed: ${n instanceof Error?n.message:String(n)}`),r.headersSent){r.destroy();return}I(r,500,"Internal gateway error",p.SERVER,d.PROXY_ERROR)})}),await new Promise((t,r)=>{const n=o(a=>{r(new re(a))},"rejectListen");this.server.once("error",n),this.server.listen(this.spec.port,this.spec.host,()=>{this.server.off("error",n),this.server.on("error",a=>{this.ctx.logger.error(a)}),this.listenedPort=this.server.address().port,t()})}),this.ctx.effect(()=>async()=>{for(const r of this.inFlight)r.destroy();this.inFlight.clear();const t=new Promise(r=>{this.server.close(()=>{r()})});this.server.closeAllConnections(),await t,await this.retractKey()},"llmGateway.listen")}async establishKey(){if(!this.spec.generateKey)return;const e=await this.ctx.credentials.describe(this.keyRef);if(!e.writable)throw new ne(this.spec.keyRef,e.source);const t=F(32).toString("base64url");await this.ctx.credentials.set(this.keyRef,t),this.localKey=t,this.keyStored=!0}async retractKey(){if(this.keyStored){this.keyStored=!1,this.localKey=void 0;try{await this.ctx.credentials.unset(this.keyRef)}catch(e){this.ctx.logger.warn(`llm-gateway: could not remove the gateway key from "${this.spec.keyRef}": ${e instanceof Error?e.message:String(e)}`)}}}buildDeps(){return{spec:this.spec,logger:{debug:o(e=>{this.ctx.logger.debug(e)},"debug"),warn:o(e=>{this.ctx.logger.warn(e)},"warn")},expectedKey:o(async()=>{const e=this.localKey;return e!==void 0?e:(await this.ctx.credentials.resolve(this.keyRef))?.value},"expectedKey"),upstreamAuth:o(async()=>this.resolveUpstreamAuth(),"upstreamAuth"),reviewInput:this.spec.review.input?e=>this.review(e,M.INPUT):void 0,reviewOutput:this.spec.review.output?e=>this.review(e,M.OUTPUT):void 0,track:o(e=>(this.inFlight.add(e),()=>{this.inFlight.delete(e)}),"track")}}async resolveUpstreamAuth(){const e=this.spec.auth;switch(e.kind){case"qb-encode-token":{const t=await this.ctx.qbAuth.llmToken(),r=await this.ctx.qbAuth.identity();return{authorization:`Bearer ${t}`,guid:r.guid,qimei36:r.qimei36,qua2:r.qua2}}case"credential":{const t=await this.ctx.credentials.resolve(K(e.ref));if(t===void 0)throw new Error(`llm-gateway: credential "${e.ref}" is not configured`);return{authorization:`Bearer ${t.value}`,guid:"",qimei36:"",qua2:""}}default:throw new Error(`llm-gateway: unhandled auth strategy ${JSON.stringify(e)}`)}}async review(e,t){try{await this.ctx.contentReview.review({text:e,type:t});return}catch(r){const n=Ce(r);if(n!==void 0)return n;throw r}}};export{G as DEFAULT_KEY_REF,d as ErrorCode,p as ErrorType,P as GatewayConfigError,ne as GatewayKeyError,re as GatewayListenError,ae as LlmGateway,ae as default,V as resolveSpec};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var a=Object.defineProperty;var o=(t,e)=>a(t,"name",{value:e,configurable:!0});import{writeSync as h}from"node:fs";const d="jsonl-v1",p=1;function f(t){if(t===!0||t===d)return d;throw new Error(`--native-protocol must be ${d}, got ${JSON.stringify(t)}`)}o(f,"parseNativeProtocolFlag");const u={WEB_LISTEN_FAILED:"Failed to start local web server",WEB_STARTUP_FAILED:"Failed to start DSH web service"},n={stdout:process.stdout,stderr:process.stderr,writeLine:o((t,e)=>{const s=Buffer.from(e,"utf8");let r=0;for(;r<s.byteLength;){const i=h(t,s,r,s.byteLength-r);if(i===0)throw new Error("native protocol stdout write made no progress");r+=i}},"writeLine"),onExit:o(t=>{process.on("exit",t)},"onExit"),offExit:o(t=>{process.off("exit",t)},"offExit")};function E(t){const e=[t],s=new Set;for(;e.length>0;){const r=e.pop();if(typeof r!="object"||r===null||s.has(r))continue;s.add(r);const i=r;if(i.syscall==="listen")return"WEB_LISTEN_FAILED";if(e.push(i.cause),Array.isArray(i.errors)){const c=i.errors;e.push(...c)}}return"WEB_STARTUP_FAILED"}o(E,"classifyNativeStartupError");var w=class{static{o(this,"NativeProtocolWriter")}name=d;state="pending";stdout=n.stdout;stderr=n.stderr;originalWrite=this.stdout.write;redirectWrite;exitListener;constructor(){this.redirectWrite=((...t)=>!!Reflect.apply(this.stderr.write,this.stderr,t)),this.stdout.write=this.redirectWrite,this.exitListener=t=>{t!==0&&this.emitError("WEB_STARTUP_FAILED")},n.onExit(this.exitListener)}emitReady(t){if(this.state!=="pending")return!1;if(t===void 0)return this.write({protocolVersion:p,event:"ready",pid:process.pid}),this.state="ready",!0;if(!Number.isInteger(t.port)||t.port<1||t.port>65535)throw new Error("native protocol ready port must be an integer from 1 through 65535");if(!Number.isInteger(t.pid)||t.pid<1)throw new Error("native protocol ready pid must be a positive integer");return this.write({protocolVersion:p,event:"ready",url:`http://${t.host}:${String(t.port)}`,host:t.host,port:t.port,pid:t.pid}),this.state="ready",!0}emitError(t){return this.state!=="pending"?!1:(this.write({protocolVersion:p,event:"error",code:t,message:u[t]}),this.state="error",!0)}dispose(){this.stdout.write===this.redirectWrite&&(this.stdout.write=this.originalWrite),n.offExit(this.exitListener)}write(t){n.writeLine(this.stdout.fd,`${JSON.stringify(t)}
|
|
2
|
+
`)}};export{E as n,f as r,w as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var w=Object.defineProperty;var c=(n,t)=>w(n,"name",{value:t,configurable:!0});import{t as g}from"./profile-boot-
|
|
1
|
+
var w=Object.defineProperty;var c=(n,t)=>w(n,"name",{value:t,configurable:!0});import{t as g}from"./profile-boot-DCgBQ4qO.js";import{existsSync as $}from"node:fs";import{join as u,resolve as b}from"node:path";import{DEFAULT_PROFILE_BUNDLES as y,PROFILE_TEMPLATES as P,initProfile as k,readProfileManifest as d,resolveBundleDir as v,resolveProfileDir as x,writeProfileManifest as E}from"@deepseek-ai/dsh-app-boot";import{spawnSync as S}from"node:child_process";const i="qbot-dsh";function h(n,t){let e;try{e=v(i,n,g,t)}catch{return!1}return d(i,e).dsh?.bundle?.patch!==void 0}c(h,"exportsPatch");function N(n,t){const e=d(i,t),p=new Set(Object.keys(n.dependencies??{})),o=Object.keys(e.dependencies??{}),s=e.dsh?.profile?.bundles??[];let a=!1;for(const r of o){const l=h(r,t);l&&!s.includes(r)?(s.push(r),a=!0):!l&&!p.has(r)&&process.stderr.write(`${i}: warning: ${r} declares no dsh.bundle — installed as a plain dependency, not a profile layer (a later update that gains one activates it automatically)
|
|
2
2
|
`)}const f=new Set(o);for(const r of[...s]){const l=p.has(r)||f.has(r),m=f.has(r)&&h(r,t);l&&!m&&(s.splice(s.indexOf(r),1),a=!0)}a&&(e.dsh={...e.dsh,profile:{...e.dsh?.profile,bundles:s}},E(t,e))}c(N,"reconcilePlugins");function L(n,t){const e=/^(?<prefix>(?:file|link):)?(?<path>\.{1,2}(?:[/\\].*)?)$/.exec(n);return e?.groups?.path===void 0?n:`${e.groups.prefix??""}${b(t,e.groups.path)}`}c(L,"anchorPathSpec");function O(n,t){const e=x(n);$(u(e,"package.json"))||(k(e,P[n]??y),process.stderr.write(`${i}: initialized profile ${n} at ${e}
|
|
3
3
|
`));const p=d(i,e),o=S("pnpm",t.map(a=>L(a,process.cwd())),{cwd:e,stdio:"inherit",shell:process.platform==="win32"});if(o.error!==void 0){if(o.error.code==="ENOENT")return process.stderr.write(`${i}: pnpm not found on PATH — install pnpm to manage profile plugins
|
|
4
4
|
`),127;throw o.error}const s=o.status??1;return s===0?N(p,e):(process.stderr.write(`${i}: pnpm failed in profile directory ${e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r}from"./profile-boot-DCgBQ4qO.js";export{r as runProfile};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var I=Object.defineProperty;var o=(e,t)=>I(e,"name",{value:t,configurable:!0});import{writeFileSync as M}from"node:fs";import{join as v,resolve as D}from"node:path";import{fileURLToPath as w}from"node:url";import{Socket as H}from"node:net";import{PROFILE_PATCH_FILENAME as F,boot as k,composeEntries as A,healProfilesModuleFallback as C,installFailLoud as q,loadOptionalPatches as b,loadOverlayPatches as U,loadProfile as $,readProfileManifest as G,watchUserPatches as O,writeProfileManifest as x}from"@deepseek-ai/dsh-app-boot";import{resolveDshHome as j}from"@deepseek-ai/dsh-home-paths";import{DSH_LAUNCH_ENVIRONMENT_KEY as Y}from"@deepseek-ai/dsh-launch-environment";import{provideCmdline as B}from"@deepseek-ai/dsh-cmdline";const V=5e3;function W(e,t=r=>{process.exit(r)},s=r=>{process.exitCode=r},i=V){let r,a,c=!1,d=!1;const l=o(()=>{a!==void 0&&clearTimeout(a)},"clearExitTimeout"),n=o(f=>{d||(d=!0,l(),t(f))},"forceExitOnce"),p=o(f=>{c||d||(c=!0,l(),s(f))},"completeOnce"),h=o((f,N)=>(r!==void 0||(a=setTimeout(()=>{n(f)},i),r=Promise.resolve().then(e).then(()=>{N?n(f):p(f)},()=>{n(f)})),r),"start");return{shutdown(f){return h(f,!1)},interrupt(f){if(r!==void 0){n(f);return}h(f,!0)}}}o(W,"createProcessShutdown");const m="DSH_HOST_LIFELINE_FD",J=2147483647,K=new Set(["EPIPE","ECONNRESET","ERR_STREAM_PREMATURE_CLOSE"]),P={armed:!1,dispose:o(()=>{},"dispose")};function X(e){if(e===void 0||e==="")return{kind:"absent"};if(!/^\d+$/.test(e))return{kind:"invalid",value:e};const t=Number(e);return t>J?{kind:"invalid",value:e}:{kind:"descriptor",fd:t}}o(X,"resolveLifelineFd");function z(e){const t=new H({fd:e,readable:!0,writable:!1});return t.unref(),t.resume(),{onEnd:o(s=>{t.on("end",s)},"onEnd"),onError:o(s=>{t.on("error",s)},"onError"),close:o(()=>{t.destroy()},"close")}}o(z,"openDescriptorChannel");function Q(e){const t=e.env??process.env,s=e.warn??(l=>{process.stderr.write(l)}),i=e.open??z,r=X(t[m]);if(r.kind==="absent")return P;if(r.kind==="invalid")return s(`qbot-dsh: ${m}=${JSON.stringify(r.value)} is not a file descriptor number; host-lifeline shutdown is off
|
|
2
|
+
`),P;let a;try{a=i(r.fd)}catch(l){return s(`qbot-dsh: cannot observe ${m}=${String(r.fd)} (${T(l)}); host-lifeline shutdown is off
|
|
3
|
+
`),P}let c=!1;const d=o(()=>c?!1:(c=!0,a.close(),!0),"release");return a.onEnd(()=>{d()&&e.onHostGone()}),a.onError(l=>{const n=l.code??"";if(d()){if(K.has(n)){e.onHostGone();return}s(`qbot-dsh: ${m}=${String(r.fd)} failed (${T(l)}); host-lifeline shutdown is off and DSH keeps running
|
|
4
|
+
`)}}),{armed:!0,dispose:o(()=>{d()},"dispose")}}o(Q,"installHostLifeline");function T(e){return e?.code??(e instanceof Error?e.message:String(e))}o(T,"describe");const Z=w(new URL("../config/agent-presets/",import.meta.url)),u="qbot-dsh",y="@qqbrowser/qbot-dsh";function E(){return v(j(),F)}o(E,"homePatchPath");const S=w(new URL("../package.json",import.meta.url)),R="session-telemetry-otel",ee=`# qbot-dsh profile root — an empty entry list. The tree is composed as patches:
|
|
5
|
+
# each bundle in package.json's dsh.profile.bundles, then cordis.patch.yml, then any
|
|
6
|
+
# --patch overlays. Edit cordis.patch.yml, not this file.
|
|
7
|
+
[]
|
|
8
|
+
`,_="cordis.yml";function L(e,t){if(!((e??"")===""||!t))return{id:R,disabled:!0}}o(L,"resolveTelemetryPatch");function g(e,t=!0){C(S);const s=$(u,e,S,void 0,{userLayer:t}),i=G(u,s.dir),r=i.dsh?.profile?.bundles??[];return r.includes("@deepseek-ai/dsh-base")&&!r.includes("@qqbrowser/qbot-dsh")?(i.dsh={...i.dsh,profile:{...i.dsh?.profile,bundles:[...r,y]}},x(s.dir,i),g(e,t)):(M(v(s.dir,_),ee),s)}o(g,"prepareProfile");function te(e){return[...e.bundlePatches,...e.profile.patches,...e.homePatches,...e.overlays]}o(te,"allPatches");function re(e,t){const s=g(e),i=b(u,E())??[],r=t.flatMap(n=>U(u,D(n))),a=s.layers.flatMap(n=>n.patches),c=new Map;for(const n of A([a,s.patches,i,r]))typeof n.id=="string"&&c.set(n.id,n);const d=[...r];c.has("agent-presets")&&d.push({id:"agent-presets",config:{...c.get("agent-presets")?.config??{},roots:[{path:Z,trust:"system"}]}});const l=L(process.env.DSH_TELEMETRY_DISABLED,c.has(R));return l!==void 0&&d.push(l),{profile:s,bundlePatches:a,homePatches:i,overlays:d,rows:c}}o(re,"composeProfile");function oe(e,t,s){if(!t.aborted&&!(e.fiber.state!==2||e.get("loader")===void 0))throw s}o(oe,"suppressShutdownError");async function ne(e){const t=re(e.profile,e.patchFiles),s={},i={},r=W(async()=>{i.lifeline?.dispose(),await s.current?.fiber.dispose()}),a=new AbortController,c=o(p=>{a.abort(),r.interrupt(p)},"interrupt");process.on("SIGTERM",()=>{c(0)}),process.on("SIGINT",()=>{c(130)}),i.lifeline=Q({onHostGone:o(()=>{c(0)},"onHostGone")}),q(u,process,async()=>{await s.current?.fiber.dispose()});const d=v(t.profile.dir,_),l=o(()=>structuredClone([...t.bundlePatches,...b(u,t.profile.patchPath)??[],...b(u,E())??[],...t.overlays]),"composeLive"),n=await k(u,d,structuredClone(te(t)),p=>{s.current=p,p.provide(Y,e.environment),B(p,{args:e.args,exit:o(h=>{r.shutdown(h)},"exit")})});if(s.current=n,!a.signal.aborted&&n.fiber.state===2&&n.get("loader")!==void 0)try{n.get("hmr")===void 0&&(n.get("timer")===void 0&&await n.loader.create({name:"@deepseek-ai/cordis-plugin-timer"}),await n.loader.create({name:"@deepseek-ai/cordis-plugin-hmr",config:{root:[]}})),await O(n,{binName:u,filename:t.profile.patchPath,compose:l}),await O(n,{binName:u,filename:E(),compose:l})}catch(p){oe(n,a.signal,p)}return{ctx:n,shutdown:r}}o(ne,"runProfile");export{g as a,E as i,y as n,L as o,_ as r,ne as s,S as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var S=Object.defineProperty;var s=(e,t)=>S(e,"name",{value:t,configurable:!0});import{existsSync as R,readFileSync as D}from"node:fs";import{homedir as O}from"node:os";import{join as w}from"node:path";import{Service as b}from"@deepseek-ai/cordis";import a from"@deepseek-ai/schemastery";import{Scene as N,authSend as B}from"@tencent/qb-auth-send-h5";import{createConnection as $}from"node:net";import{StringDecoder as L}from"node:string_decoder";const h={SOCIAL_TOKEN_EXPIRED:"-28",QB_TOKEN_EXPIRED:"-34"},F=1101;var p=class extends Error{static{s(this,"QbAuthExpiredError")}code="QB_AUTH_EXPIRED";authCode;constructor(e,t,i){super(t,i),this.name="QbAuthExpiredError",this.authCode=e}},y=class extends Error{static{s(this,"QbTokenExhaustedError")}code="QB_TOKEN_EXHAUSTED";constructor(e){super(e),this.name="QbTokenExhaustedError"}},r=class extends Error{static{s(this,"QbPipeError")}code="QB_PIPE_FAILED";constructor(e,t){super(e,t),this.name="QbPipeError"}},v=class extends Error{static{s(this,"QbRpcError")}code="QB_RPC_FAILED";constructor(e,t){super(e,t),this.name="QbRpcError"}};const q=s(e=>{if(typeof e=="string")return e;if(typeof e=="number")return String(e)},"readCodeField"),j=s(e=>{if(typeof e!="object"||e===null)return"";const t=e,i=t.err;if(typeof i=="object"&&i!==null){const n=q(i.code);if(n!==void 0)return n}return q(t.code)??""},"readRejectCode"),X=s(e=>e===h.SOCIAL_TOKEN_EXPIRED||e===h.QB_TOKEN_EXPIRED,"isAuthErrorCode"),E=s(e=>{const t=j(e);if(X(t))return t;let i;if(typeof e=="string")i=e;else if(typeof e=="object"&&e!==null)try{i=JSON.stringify(e)}catch{return null}else return null;for(const n of Object.values(h))if(i.includes(`"code":"${n}"`)||i.includes(`"code": "${n}"`))return n;return null},"extractAuthErrorCode"),P=s(e=>e===void 0||e===0?4:e===3?2:e===2||e===5?4:e,"convertAccountType"),I=s(e=>{switch(e.platform){case"darwin":return w(e.homedir,"Library","Application Support","QQBrowser3","ipc_token");case"win32":if(e.localAppData===void 0||e.localAppData==="")throw new r("qb-auth: %LOCALAPPDATA% is unset, cannot locate the QQBrowser IPC token file");return w(e.localAppData,"Tencent","QQBrowser","User Data","ipc_token");case"linux":return w(e.homedir,".config","qqbrowser","ipc_token");default:throw new r(`qb-auth: unsupported platform for QQBrowser IPC: ${e.platform}`)}},"resolveTokenFilePath"),k=s(e=>{const t=e.trim().split(/\r?\n/);if(t.length<3)throw new r(`qb-auth: malformed IPC token file: expected 3 lines (pid / token / pipe path), found ${t.length}`);const[i,n,o]=t;if(i===void 0||n===void 0||o===void 0)throw new r("qb-auth: malformed IPC token file: missing one of pid / token / pipe path");const c=Number.parseInt(i,10),d=n.trim(),l=o.trim();if(!Number.isInteger(c))throw new r("qb-auth: malformed IPC token file: first line is not a process id");if(d==="")throw new r("qb-auth: malformed IPC token file: empty auth token");if(l==="")throw new r("qb-auth: malformed IPC token file: empty pipe path");return{pid:c,token:d,pipePath:l}},"parseDiscovery");var _=class{static{s(this,"QbPipeClient")}options;socket;nextId=0;pending=new Map;decoder=new L("utf8");buffer="";accountInfoCache;closed=!1;constructor(e){this.options=e}isConnected(){return this.socket!==void 0&&!this.socket.destroyed}async connect(){if(this.closed)throw new r("qb-auth: pipe client is closed");const e=this.discover(),t=await this.openSocket(e.pipePath);this.socket=t,t.on("data",n=>{this.consume(n)});const i=await this.call("auth",{token:e.token});if(i.error!==void 0)throw this.close(),new r(`qb-auth: IPC handshake refused: ${i.error}`);if(i.result?.authenticated!==!0)throw this.close(),new r("qb-auth: IPC handshake refused: the browser did not authenticate this client")}close(){this.closed=!0;const e=this.socket;this.socket=void 0,this.failPending(new r("qb-auth: pipe connection closed")),e!==void 0&&e.destroy()}async getAccountInfo(){const e=this.accountInfoCache;if(e!==void 0)return e;const t=await this.call("getAccountInfo");return t.result!==void 0&&(t.result.account_type=P(t.result.account_type)),this.accountInfoCache=t,t}clearAccountInfoCache(){this.accountInfoCache=void 0}async refreshToken(e){const t=await this.call("refreshToken",{tokenType:e});return this.clearAccountInfoCache(),t}async getBrowserParam(){return this.call("getBrowserParam")}discover(){const e=this.options.tokenFilePath??I({platform:process.platform,homedir:O(),localAppData:process.env.LOCALAPPDATA});if(!R(e))throw new r(`qb-auth: QQBrowser is not running or its IPC service is off (no token file at ${e})`);return k(D(e,"utf-8"))}openSocket(e){return new Promise((t,i)=>{const n=$({path:e}),o=s(c=>{n.destroy(),i(new r(`qb-auth: cannot connect to QQBrowser IPC: ${c.message}`,{cause:c}))},"onConnectError");n.once("error",o),n.once("connect",()=>{n.off("error",o),n.on("error",c=>{this.failPending(new r(`qb-auth: IPC connection error: ${c.message}`,{cause:c})),n.destroy()}),n.once("close",()=>{this.failPending(new r("qb-auth: pipe connection closed"))}),t(n)})})}consume(e){this.buffer+=this.decoder.write(e);let t=this.buffer.indexOf(`
|
|
2
|
+
`);for(;t!==-1;){const i=this.buffer.slice(0,t);this.buffer=this.buffer.slice(t+1),this.dispatch(i),t=this.buffer.indexOf(`
|
|
3
|
+
`)}}dispatch(e){if(e.trim()==="")return;let t;try{t=JSON.parse(e)}catch{return}const i=this.pending.get(t.id);i!==void 0&&(this.pending.delete(t.id),clearTimeout(i.timer),i.settle(t))}call(e,t){return new Promise((i,n)=>{const o=this.socket;if(o===void 0||o.destroyed){n(new r("qb-auth: not connected to QQBrowser IPC"));return}this.nextId+=1;const c=this.nextId,d=setTimeout(()=>{this.pending.delete(c),n(new r(`qb-auth: IPC request timed out: ${e}`))},this.options.requestTimeoutMs);this.pending.set(c,{settle:i,fail:n,timer:d});const l=t===void 0?{id:c,method:e}:{id:c,method:e,params:t};o.write(`${JSON.stringify(l)}
|
|
4
|
+
`)})}failPending(e){const t=[...this.pending.values()];this.pending.clear();for(const i of t)clearTimeout(i.timer),i.fail(e)}};const A="trpc_mtt_llm_access_proxy_LlmAccessProxy",C="ds_harness",Q="非常抱歉,您已将QQ浏览器提供的免费token额度用完了,敬请期待后续免费活动!若急需使用,可立即前往【设置-模型】自定义。感谢您的理解,我们正全力优化体验!",m=s(e=>typeof e=="object"&&e!==null?e:{},"asRecord"),T=s(e=>typeof e=="string"?JSON.parse(e):e,"parseAuthSendReply"),f=s((...e)=>{for(const t of e)if(t!==void 0&&t!=="")return t;return""},"firstNonEmpty"),u=s((e,t)=>{const i=e[t];return typeof i=="string"?i:""},"readString");var K=class extends b{static{s(this,"QbAuth")}config;static Config=a.object({usePipe:a.boolean().default(!0),loginInfo:a.object({guid:a.string(),openid:a.string(),access_token:a.string().role("secret"),qbaccess_token:a.string().role("secret"),qbid:a.string(),appid:a.string(),account_type:a.string()}),identity:a.object({guid:a.string().default(""),qimei36:a.string().default(""),qua2:a.string().default("")}),tokenFilePath:a.string().default(""),maxRetry:a.natural().max(8).default(1),requestTimeoutMs:a.natural().min(100).max(12e4).default(5e3)});pipe;loginInfo;deviceInfo;accountResolved=!1;resolving;disposed=!1;constructor(e,t){super(e,"qbAuth"),this.config=t}async[b.init](){return this.ctx.effect(()=>()=>{this.disposed=!0,this.pipe?.close(),this.pipe=void 0},"qbAuth.pipe"),Promise.resolve()}async identity(){await this.ensureAccount();const e=m(this.deviceInfo);return{guid:f(u(e,"guid"),this.loginInfo?.guid,this.config.identity.guid),qimei36:f(u(e,"qimei36"),this.config.identity.qimei36),qua2:f(u(e,"qua2"),u(e,"qua"),this.config.identity.qua2)}}async rpc(e){const t=await this.callWithAuth(async(i,n)=>{const o={...i===void 0?{}:{loginInfo:i},...n===void 0?{}:{overRideInfo:n}};return B({servantName:e.servantName,funcName:e.funcName,scene:N.external,isAuth:!1},e.body,o)});return T(t)}async llmToken(){const e=await this.identity(),t=m(await this.rpc({servantName:A,funcName:"EncodeToken",body:{base:{qimei36:e.qimei36,qua2:e.qua2},authcall:{bus:C}}})),i=m(t.rsp),n=typeof i.ret=="number"?i.ret:void 0,o=t.token;if(typeof o!="string"||o===""){if(n===1101)throw new y(Q);const c=t.extend;throw new v((typeof c=="object"&&c!==null?Object.values(c).filter(d=>typeof d=="string"&&d!=="").join("; "):"")||`qb-auth: EncodeToken returned no ticket (ret=${String(n)}, reason=${u(i,"reason")})`)}return o}async callWithAuth(e){await this.ensureAccount();const t=this.buildOverRideInfo();for(let i=0;;i+=1)try{return await e(this.loginInfo,t)}catch(n){const o=E(n);if(o===null)throw n;if(i>=this.config.maxRetry)throw new p(o,`qb-auth: ${g(o)} expired and could not be refreshed (code=${o})`,{cause:n});if(!this.config.usePipe)throw new p(o,`qb-auth: ${g(o)} expired but IPC refresh is disabled (code=${o})`,{cause:n});this.ctx.logger.debug(`qb-auth: refreshing ${g(o)} after upstream expiry`);try{await this.refreshViaPipe(o)}catch(c){throw new p(o,`qb-auth: ${g(o)} expired and the refresh failed (code=${o})`,{cause:c})}}}inspect(){return{pipeConnected:this.pipe?.isConnected()??!1,accountResolved:this.accountResolved,hasLoginInfo:this.loginInfo!==void 0}}buildOverRideInfo(){const e=m(this.deviceInfo),t=f(u(e,"qua2"),u(e,"qua"),this.config.identity.qua2),i=f(u(e,"qimei36"),this.config.identity.qimei36);if(!(t===""&&i===""))return{"q-qua2":t,"q-qimei36":i}}async ensureAccount(){if(!this.config.usePipe){this.loginInfo=this.config.loginInfo;return}if(this.accountResolved)return;const e=this.resolving;if(e!==void 0)return e;const t=this.loadFromPipe();this.resolving=t;try{await t,this.accountResolved=!0}finally{this.resolving=void 0}}async loadFromPipe(){const e=await this.ensurePipe(),[t,i]=await Promise.all([e.getAccountInfo(),e.getBrowserParam()]);if(t.error!==void 0||t.result===void 0)throw new r(`qb-auth: cannot read the QQBrowser account: ${t.error??"empty reply"}`);this.loginInfo=x(t.result),i.result===void 0?this.ctx.logger.debug("qb-auth: QQBrowser returned no device parameters; continuing without them"):this.deviceInfo=i.result}isDisposed(){return this.disposed}async ensurePipe(){if(this.isDisposed())throw new r("qb-auth: service disposed");const e=this.pipe;if(e!==void 0&&e.isConnected())return e;const t=new _({tokenFilePath:this.config.tokenFilePath===""?void 0:this.config.tokenFilePath,requestTimeoutMs:this.config.requestTimeoutMs});if(await t.connect(),this.isDisposed())throw t.close(),new r("qb-auth: service disposed");return this.pipe=t,t}async refreshViaPipe(e){const t=await this.ensurePipe(),i=e===h.QB_TOKEN_EXPIRED?"qbtoken":"token",n=await t.refreshToken(i);if(n.error!==void 0)throw new r(`qb-auth: ticket refresh failed: ${n.error}`);const o=await t.getAccountInfo();if(o.error!==void 0||o.result===void 0)throw new r(`qb-auth: cannot re-read the account after refresh: ${o.error??"empty reply"}`);this.loginInfo=x(o.result)}};const g=s(e=>e===h.QB_TOKEN_EXPIRED?"the QQBrowser ticket":"the social ticket","ticketName"),x=s(e=>({guid:e.guid,openid:e.openid,access_token:e.access_token,qbaccess_token:e.qbaccess_token,qbid:e.qbid,appid:e.appid,account_type:String(e.account_type)}),"toLoginInfo");export{T as a,k as c,p as d,r as f,E as g,F as h,Q as i,I as l,y as m,A as n,_ as o,v as p,K as r,P as s,C as t,h as u};
|
package/lib/qb-auth.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,c as s,d as E,f as e,g as o,h as t,i as p,l as A,m as T,n as S,o as _,p as R,r,s as i,t as u,u as c}from"./qb-auth-C2ofR1zn.js";export{c as AUTH_ERROR_CODES,u as BUS_IDENTIFIER,S as LLM_ACCESS_PROXY_SERVANT,r as QbAuth,r as default,E as QbAuthExpiredError,_ as QbPipeClient,e as QbPipeError,R as QbRpcError,T as QbTokenExhaustedError,p as TOKEN_EXHAUSTED_MESSAGE,t as TOKEN_EXHAUSTED_RET,i as convertAccountType,o as extractAuthErrorCode,a as parseAuthSendReply,s as parseDiscovery,A as resolveTokenFilePath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var I=Object.defineProperty;var n=(e,t)=>I(e,"name",{value:t,configurable:!0});import l from"@deepseek-ai/schemastery";import{WebError as u}from"@deepseek-ai/dsh-web";import*as g from"@deepseek-ai/dsh-web-search-deepseek";import{DEEPSEEK_PROVIDER_ID as m}from"@deepseek-ai/dsh-web-search-deepseek";const q="dsh",S="qbqaproxy.imtt.qq.com",_="deepseek-harness",b="dsh_search",w="mtt_dsh_search_proxy",y="GetToken",D=6e4,B=[1002,1005],M="/cgi-bin/search/proxy",N="deepseek-harness/0.0.1";var k=class extends u{static{n(this,"DshSearchTokenRejected")}};function f(e){return typeof e=="string"&&e.trim().length>0}n(f,"isNonBlank");function C(e){return Number.isInteger(e)&&e>0}n(C,"isPositiveInteger");function V(e){return URL.canParse(`https://${e}`)}n(V,"isValidHost");function E(e){return e instanceof DOMException&&e.name==="AbortError"}n(E,"isAbortError");function W(e){if(!(e instanceof Error))return String(e);const t=e.cause;return t instanceof Error&&t.message!==e.message?`${e.message} (${t.message})`:e.message}n(W,"describeFetchError");function O(e){if(f(e.link))return{url:e.link,...f(e.title)?{title:e.title}:{},...f(e.snippet)?{snippet:e.snippet}:{},...f(e.date)?{publishedAt:e.date}:{}}}n(O,"mapDshSearchItem");function v(e){return{sources:(e.result_list??[]).map(O).filter(t=>t!==void 0),truncated:!1}}n(v,"mapDshSearchResponse");var T=class{static{n(this,"DshSearchProvider")}options;id="dsh";cachedToken;issuing;constructor(e){this.options=e}available(){return V(this.options.host)&&(this.options.num===void 0||C(this.options.num))}async search(e,t){const s=await this.acquireToken(!1);try{return await this.searchOnce(e,s,t)}catch(r){if(!(r instanceof k))throw r;const i=await this.acquireToken(!0);return this.searchOnce(e,i,t)}}acquireToken(e){const t=this.options.tokenRefreshMarginMs??6e4,s=this.cachedToken;if(!e&&s!==void 0&&Date.now()<s.expiretime*1e3-t)return Promise.resolve(s.token);if(!e&&this.issuing!==void 0)return this.issuing;const r=this.options.fetchToken().then(i=>(this.cachedToken=i,i.token));return this.issuing=r,r.catch(()=>{}).finally(()=>{this.issuing===r&&(this.issuing=void 0)}),r}async searchOnce(e,t,s){const r=this.options.num??e.maxResults,i=JSON.stringify({query:e.query,...r!==void 0?{num:r}:{}}),o=`https://${this.options.host}${M}`;let c;try{c=await fetch(o,{method:"POST",redirect:"error",headers:{"content-type":"application/json",authorization:`Bearer ${t}`,"user-agent":N,accept:"application/json"},body:i,...s!==void 0?{signal:s}:{}})}catch(a){throw E(a)?new u("DshSearch search aborted","WEB_ABORTED",{cause:a}):new u(`DshSearch search request to ${o} failed: ${W(a)}`,"WEB_PROVIDER_ERROR",{cause:a})}if(!c.ok){const a=c.status;let d=`DshSearch API error (HTTP ${a})`;try{const p=await c.json();f(p.msg)&&(d=`DshSearch API error (HTTP ${a}): ${p.msg}`)}catch(p){if(E(p))throw new u("DshSearch search aborted","WEB_ABORTED",{cause:p})}throw new u(d,"WEB_PROVIDER_ERROR")}let h;try{h=await c.json()}catch(a){throw E(a)?new u("DshSearch search aborted","WEB_ABORTED",{cause:a}):new u(`DshSearch returned an unprocessable response body: ${String(a)}`,"WEB_PROVIDER_ERROR",{cause:a})}if(typeof h.code!="number")throw new u("DshSearch returned an unexpected response body (missing code)","WEB_PROVIDER_ERROR");if(B.includes(h.code))throw new k(`DshSearch token rejected (code ${h.code}): ${h.msg??"no message"}`,"WEB_PROVIDER_ERROR");if(h.code!==0)throw new u(`DshSearch search failed (code ${h.code}): ${h.msg??"no message"}`,"WEB_PROVIDER_ERROR");return v(h)}};const j=n(e=>e instanceof u||e instanceof Error&&e.name==="WebError"&&typeof e.code=="string","isProviderError");var A=class{static{n(this,"DshRoutingProvider")}id;dsh;fallback;preferDsh;warn;constructor(e,t,s,r,i){this.id=e,this.dsh=t,this.fallback=s,this.preferDsh=r,this.warn=i}available(){return this.dsh.available()||this.fallback.available()}async search(e,t){const s=this.preferDsh()?[this.dsh,this.fallback]:[this.fallback,this.dsh];let r;for(const i of s)if(i.available())try{return await i.search(e,t)}catch(o){if(!j(o)||o.code==="WEB_ABORTED")throw o;this.warn(`web-search-dsh: provider "${i.id}" failed (${o.code}); failing over`),r=o}throw r!==void 0?r:new u("web-search-dsh: no usable search provider (both sides are unavailable)","WEB_PROVIDER_UNAVAILABLE")}};const F="web-search-dsh",U=["web","qbAuth"],$="qb-gateway",P="Auto",x=l.object({host:l.string().default(S),callfrom:l.string().default(_),bus:l.string().default(b),num:l.number().step(1).min(1),tokenRefreshMarginMs:l.natural().min(0).default(D),routeSelection:l.object({provider:l.string().default($),model:l.string().default(P)}),deepseek:g.Config.default({})}),R=n(e=>typeof e=="object"&&e!==null?e:{},"asRecord"),H=n((e,t)=>{const s=e[t];return typeof s=="string"?s:""},"readString"),L=n(e=>{if(e instanceof Error)return e.message;if(typeof e=="string")return e;const t=R(e),s=H(t,"message");if(s!=="")return s;try{const r=JSON.stringify(e);if(r!==void 0)return r}catch{}return String(e)},"describeCause"),K=n(e=>{const t=e.token,s=typeof t=="string"&&t!==""?{...e,token:`<redacted, ${String(t.length)} chars>`}:e;try{return JSON.stringify(s)}catch{return"<unprintable reply>"}},"redactReply"),G=n(e=>{const t=e.token,s=typeof t!="string"?`type ${typeof t}`:t===""?"empty":`${String(t.length)} chars`,r=e.expiretime;return`token=${s}, expiretime=${typeof r=="number"?String(r):typeof r=="string"?`"${r}" (string)`:`type ${typeof r}`}`},"tokenFieldSummary");async function J(e,t){let s;try{const d=await e.qbAuth.identity();s=await e.qbAuth.rpc({servantName:w,funcName:y,body:{base:{qimei36:d.qimei36,qua2:d.qua2},authcall:{callfrom:t.callfrom??"deepseek-harness",bus:t.bus??"dsh_search"}}})}catch(d){throw new u(`DshSearch token issuance failed: ${L(d)}`,"WEB_PROVIDER_ERROR",{cause:d})}const r=R(s),i=R(r.rsp),o=typeof i.ret=="number"?i.ret:void 0;if(o!==0)throw new u(`DshSearch token issuance rejected (ret=${String(o)}, reason=${H(i,"reason")||"none"})`,"WEB_PROVIDER_ERROR");const c=r.token,h=r.expiretime,a=typeof h=="string"&&h.trim()!==""?Number(h):h;if(typeof c!="string"||c===""||typeof a!="number"||!Number.isFinite(a)||a<=0){const d=K(r);throw e.logger.debug(`web-search-dsh: GetToken returned an unusable reply: ${d}`),new u(`DshSearch token issuance returned no usable token or expiry (ret=${String(o)}, ${G(r)}); reply: ${d}`,"WEB_PROVIDER_ERROR")}return{token:c,expiretime:a}}n(J,"issueSearchToken");function z(e){const t=e.get("agents")?.currentInitiator()?.session.requestHeader()?.config;return t!==void 0?{provider:t.provider,model:t.model}:e.get("agentDefaultModel")?.currentSelection()}n(z,"currentModelSelection");async function Q(e,t){const s=new Map,r=new Map;await e.extend({web:{registerSearchProvider:n(o=>(s.set(o.id,o),()=>{s.delete(o.id)}),"registerSearchProvider"),registerFetchProvider:n(o=>(r.set(o.id,o),()=>{r.delete(o.id)}),"registerFetchProvider")}}).plugin(g,t);const i=s.get(m);if(i===void 0)throw new Error(`web-search-dsh: the upstream deepseek plugin did not register "${m}" (registered: ${[...s.keys()].join(", ")||"none"})`);return i}n(Q,"mountDeepseekSide");async function X(e,t){const s=new T({host:t.host??"qbqaproxy.imtt.qq.com",...t.num!==void 0?{num:t.num}:{},tokenRefreshMarginMs:t.tokenRefreshMarginMs??6e4,fetchToken:n(()=>J(e,t),"fetchToken")}),r=await Q(e,t.deepseek??{}),i=t.routeSelection?.provider??"qb-gateway",o=t.routeSelection?.model??"Auto";e.web.registerSearchProvider(new A("dsh",s,r,()=>{const c=z(e);return c!==void 0&&c.provider===i&&c.model===o},c=>{e.logger.warn(c)}))}n(X,"apply");export{x as Config,q as DSH_PROVIDER_ID,b as DSH_SEARCH_DEFAULT_BUS,_ as DSH_SEARCH_DEFAULT_CALLFROM,S as DSH_SEARCH_DEFAULT_HOST,P as DSH_SEARCH_DEFAULT_ROUTE_MODEL,$ as DSH_SEARCH_DEFAULT_ROUTE_PROVIDER,y as DSH_SEARCH_TOKEN_FUNC,D as DSH_SEARCH_TOKEN_MARGIN_MS,w as DSH_SEARCH_TOKEN_SERVANT,A as DshRoutingProvider,T as DshSearchProvider,X as apply,U as inject,O as mapDshSearchItem,v as mapDshSearchResponse,F as name};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
const { hasOwn } = require("@smithy/core/serde");
|
|
2
|
+
const { streamCollector } = require("@smithy/core/serde");
|
|
3
|
+
exports.streamCollector = streamCollector;
|
|
1
4
|
const { buildQueryString, HttpResponse } = require("@smithy/core/protocols");
|
|
2
5
|
const node_https = require("node:https");
|
|
3
6
|
const { Readable } = require("node:stream");
|
|
4
7
|
const http2 = require("node:http2");
|
|
5
|
-
const { streamCollector } = require("@smithy/core/serde");
|
|
6
|
-
exports.streamCollector = streamCollector;
|
|
7
8
|
|
|
8
9
|
function buildAbortError(abortSignal) {
|
|
9
10
|
const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal
|
|
@@ -30,6 +31,8 @@ const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
|
|
|
30
31
|
const getTransformedHeaders = (headers) => {
|
|
31
32
|
const transformedHeaders = {};
|
|
32
33
|
for (const name in headers) {
|
|
34
|
+
if (!hasOwn(headers, name))
|
|
35
|
+
continue;
|
|
33
36
|
const headerValues = headers[name];
|
|
34
37
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
35
38
|
}
|
|
@@ -231,6 +234,8 @@ class NodeHttpHandler {
|
|
|
231
234
|
}
|
|
232
235
|
if (sockets && requests) {
|
|
233
236
|
for (const origin in sockets) {
|
|
237
|
+
if (!hasOwn(sockets, origin))
|
|
238
|
+
continue;
|
|
234
239
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
235
240
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
236
241
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/serde";
|
|
1
2
|
const getTransformedHeaders = (headers) => {
|
|
2
3
|
const transformedHeaders = {};
|
|
3
4
|
for (const name in headers) {
|
|
5
|
+
if (!hasOwn(headers, name))
|
|
6
|
+
continue;
|
|
4
7
|
const headerValues = headers[name];
|
|
5
8
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
6
9
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/serde";
|
|
1
2
|
import { HttpResponse, buildQueryString } from "@smithy/core/protocols";
|
|
2
3
|
import { buildAbortError } from "./build-abort-error";
|
|
3
4
|
import { NODEJS_TIMEOUT_ERROR_CODES } from "./constants";
|
|
@@ -35,6 +36,8 @@ export class NodeHttpHandler {
|
|
|
35
36
|
}
|
|
36
37
|
if (sockets && requests) {
|
|
37
38
|
for (const origin in sockets) {
|
|
39
|
+
if (!hasOwn(sockets, origin))
|
|
40
|
+
continue;
|
|
38
41
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
39
42
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
40
43
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@smithy/node-http-handler","version":"4.11.
|
|
1
|
+
{"name":"@smithy/node-http-handler","version":"4.11.3","license":"Apache-2.0","sideEffects":false,"main":"./dist-cjs/index.js","module":"./dist-es/index.js","dependencies":{"@smithy/core":"^3.33.3","@smithy/types":"^4.17.2","tslib":"^2.6.2"},"engines":{"node":">=18.0.0"}}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
const { hasOwn } = require("@smithy/core/serde");
|
|
2
|
+
const { streamCollector } = require("@smithy/core/serde");
|
|
3
|
+
exports.streamCollector = streamCollector;
|
|
1
4
|
const { buildQueryString, HttpResponse } = require("@smithy/core/protocols");
|
|
2
5
|
const node_https = require("node:https");
|
|
3
6
|
const { Readable } = require("node:stream");
|
|
4
7
|
const http2 = require("node:http2");
|
|
5
|
-
const { streamCollector } = require("@smithy/core/serde");
|
|
6
|
-
exports.streamCollector = streamCollector;
|
|
7
8
|
|
|
8
9
|
function buildAbortError(abortSignal) {
|
|
9
10
|
const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal
|
|
@@ -30,6 +31,8 @@ const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
|
|
|
30
31
|
const getTransformedHeaders = (headers) => {
|
|
31
32
|
const transformedHeaders = {};
|
|
32
33
|
for (const name in headers) {
|
|
34
|
+
if (!hasOwn(headers, name))
|
|
35
|
+
continue;
|
|
33
36
|
const headerValues = headers[name];
|
|
34
37
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
35
38
|
}
|
|
@@ -231,6 +234,8 @@ class NodeHttpHandler {
|
|
|
231
234
|
}
|
|
232
235
|
if (sockets && requests) {
|
|
233
236
|
for (const origin in sockets) {
|
|
237
|
+
if (!hasOwn(sockets, origin))
|
|
238
|
+
continue;
|
|
234
239
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
235
240
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
236
241
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/serde";
|
|
1
2
|
const getTransformedHeaders = (headers) => {
|
|
2
3
|
const transformedHeaders = {};
|
|
3
4
|
for (const name in headers) {
|
|
5
|
+
if (!hasOwn(headers, name))
|
|
6
|
+
continue;
|
|
4
7
|
const headerValues = headers[name];
|
|
5
8
|
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
|
|
6
9
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/serde";
|
|
1
2
|
import { HttpResponse, buildQueryString } from "@smithy/core/protocols";
|
|
2
3
|
import { buildAbortError } from "./build-abort-error";
|
|
3
4
|
import { NODEJS_TIMEOUT_ERROR_CODES } from "./constants";
|
|
@@ -35,6 +36,8 @@ export class NodeHttpHandler {
|
|
|
35
36
|
}
|
|
36
37
|
if (sockets && requests) {
|
|
37
38
|
for (const origin in sockets) {
|
|
39
|
+
if (!hasOwn(sockets, origin))
|
|
40
|
+
continue;
|
|
38
41
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
39
42
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
40
43
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@smithy/node-http-handler","version":"4.11.
|
|
1
|
+
{"name":"@smithy/node-http-handler","version":"4.11.3","license":"Apache-2.0","sideEffects":false,"main":"./dist-cjs/index.js","module":"./dist-es/index.js","dependencies":{"@smithy/core":"^3.33.3","@smithy/types":"^4.17.2","tslib":"^2.6.2"},"engines":{"node":">=18.0.0"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@deepseek-ai/cordis-plugin-hmr","version":"1.0.16","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","@deepseek-ai/cordis":{"services":{"required":["timer"]},"description":{"en":"Hot Module Replacement","zh":"模块热替换"}},"peerDependencies":{"@deepseek-ai/cordis
|
|
1
|
+
{"name":"@deepseek-ai/cordis-plugin-hmr","version":"1.0.16","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","@deepseek-ai/cordis":{"services":{"required":["timer"]},"description":{"en":"Hot Module Replacement","zh":"模块热替换"}},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/cordis-plugin-timer":"^1.1.3"},"dependencies":{"@babel/code-frame":"^7.29.0","chokidar":"^4.0.3","picomatch":"^4.0.3","@deepseek-ai/cosmokit":"^1.8.2","@deepseek-ai/schemastery":"^3.18.1"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@deepseek-ai/dsh-agent","version":"0.1.0","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"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/dsh-
|
|
1
|
+
{"name":"@deepseek-ai/dsh-agent","version":"0.1.0-rc.7","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"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.0-rc.7","@deepseek-ai/dsh-system-prompt":"^0.1.0-rc.7","@deepseek-ai/dsh-scope":"^0.1.0-rc.7","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.7","@deepseek-ai/dsh-llm":"^0.1.0-rc.7","@deepseek-ai/dsh-session":"^0.1.0-rc.7"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@deepseek-ai/dsh-agent-default-model","version":"0.1.0","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":{"@deepseek-ai/dsh-
|
|
1
|
+
{"name":"@deepseek-ai/dsh-agent-default-model","version":"0.1.0-rc.7","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":{"@deepseek-ai/dsh-invariants":"^0.1.0-rc.7","@deepseek-ai/dsh-agent":"^0.1.0-rc.7","@deepseek-ai/dsh-settings":"^0.1.0-rc.7","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-llm":"^0.1.0-rc.7"}}
|