@evanbobo/dsh-agentdoor 0.0.0-stage → 0.2.2-rc.1
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/LICENSE +21 -0
- package/README.en.md +268 -0
- package/README.md +243 -2
- package/THIRD_PARTY_NOTICES +96 -0
- package/assets/provider-icons/antigravity.svg +39 -0
- package/assets/provider-icons/claude-code.png +0 -0
- package/assets/provider-icons/codebuddy.svg +37 -0
- package/assets/provider-icons/codex.png +0 -0
- package/assets/provider-icons/command-code.svg +5 -0
- package/assets/provider-icons/cursor-cli.svg +1 -0
- package/assets/provider-icons/deepseek-harness.svg +9 -0
- package/assets/provider-icons/doubao.png +0 -0
- package/assets/provider-icons/gemini.png +0 -0
- package/assets/provider-icons/grok.png +0 -0
- package/assets/provider-icons/kimi.png +0 -0
- package/assets/provider-icons/kiro-cli.svg +11 -0
- package/assets/provider-icons/minimax-code.svg +4 -0
- package/assets/provider-icons/opencode.png +0 -0
- package/assets/provider-icons/pi.svg +7 -0
- package/assets/provider-icons/qoder-cn.svg +5 -0
- package/assets/provider-icons/qoder.svg +5 -0
- package/assets/provider-icons/r4.svg +4 -0
- package/assets/provider-icons/workbuddy.svg +29 -0
- package/assets/provider-icons/zcode.svg +14 -0
- package/bin/agent-door-credential.mjs +92 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +97 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts.map +1 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.js +169 -0
- package/data/build/dist/bootstrap/dsh-connection-adapter.js.map +1 -0
- package/data/build/dist/bootstrap/index.d.ts +38 -0
- package/data/build/dist/bootstrap/index.d.ts.map +1 -0
- package/data/build/dist/bootstrap/index.js +44 -0
- package/data/build/dist/bootstrap/index.js.map +1 -0
- package/data/build/dist/client/account-bar.d.ts +14 -0
- package/data/build/dist/client/account-bar.d.ts.map +1 -0
- package/data/build/dist/client/account-bar.js +541 -0
- package/data/build/dist/client/account-bar.js.map +1 -0
- package/data/build/dist/client/adapter-catalog-watch.d.ts +16 -0
- package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -0
- package/data/build/dist/client/adapter-catalog-watch.js +91 -0
- package/data/build/dist/client/adapter-catalog-watch.js.map +1 -0
- package/data/build/dist/client/bundle.js +67698 -0
- package/data/build/dist/client/bundle.js.map +1 -0
- package/data/build/dist/client/cli-catalog.d.ts +29 -0
- package/data/build/dist/client/cli-catalog.d.ts.map +1 -0
- package/data/build/dist/client/cli-catalog.js +148 -0
- package/data/build/dist/client/cli-catalog.js.map +1 -0
- package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
- package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-dialog.js +215 -0
- package/data/build/dist/client/cli-management-dialog.js.map +1 -0
- package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
- package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-terminal.js +30 -0
- package/data/build/dist/client/cli-management-terminal.js.map +1 -0
- package/data/build/dist/client/cli-session-config-cache.d.ts +17 -0
- package/data/build/dist/client/cli-session-config-cache.d.ts.map +1 -0
- package/data/build/dist/client/cli-session-config-cache.js +62 -0
- package/data/build/dist/client/cli-session-config-cache.js.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.js +45 -0
- package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
- package/data/build/dist/client/cli-slots.d.ts +64 -0
- package/data/build/dist/client/cli-slots.d.ts.map +1 -0
- package/data/build/dist/client/cli-slots.js +985 -0
- package/data/build/dist/client/cli-slots.js.map +1 -0
- package/data/build/dist/client/client.command-token.js +32 -0
- package/data/build/dist/client/client.command-token.js.map +1 -0
- package/data/build/dist/client/client.delegate-command.js +1314 -0
- package/data/build/dist/client/client.delegate-command.js.map +1 -0
- package/data/build/dist/client/client.editor-engine.js +32557 -0
- package/data/build/dist/client/client.editor-engine.js.map +1 -0
- package/data/build/dist/client/client.primitives-adapter.js +3740 -0
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -0
- package/data/build/dist/client/client.rolldown-runtime.js +58 -0
- package/data/build/dist/client/client.xterm-engine.js +13061 -0
- package/data/build/dist/client/client.xterm-engine.js.map +1 -0
- package/data/build/dist/client/command-token.d.ts +13 -0
- package/data/build/dist/client/command-token.d.ts.map +1 -0
- package/data/build/dist/client/command-token.js +14 -0
- package/data/build/dist/client/command-token.js.map +1 -0
- package/data/build/dist/client/context-breakdown-dom.d.ts +53 -0
- package/data/build/dist/client/context-breakdown-dom.d.ts.map +1 -0
- package/data/build/dist/client/context-breakdown-dom.js +171 -0
- package/data/build/dist/client/context-breakdown-dom.js.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts +11 -0
- package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -0
- package/data/build/dist/client/conversation-translation-settings.js +60 -0
- package/data/build/dist/client/conversation-translation-settings.js.map +1 -0
- package/data/build/dist/client/credential-reference.d.ts +14 -0
- package/data/build/dist/client/credential-reference.d.ts.map +1 -0
- package/data/build/dist/client/credential-reference.js +268 -0
- package/data/build/dist/client/credential-reference.js.map +1 -0
- package/data/build/dist/client/credential-ui-dom.d.ts +18 -0
- package/data/build/dist/client/credential-ui-dom.d.ts.map +1 -0
- package/data/build/dist/client/credential-ui-dom.js +191 -0
- package/data/build/dist/client/credential-ui-dom.js.map +1 -0
- package/data/build/dist/client/credentials-settings-section.d.ts +10 -0
- package/data/build/dist/client/credentials-settings-section.d.ts.map +1 -0
- package/data/build/dist/client/credentials-settings-section.js +204 -0
- package/data/build/dist/client/credentials-settings-section.js.map +1 -0
- package/data/build/dist/client/debug/ui.d.ts +13 -0
- package/data/build/dist/client/debug/ui.d.ts.map +1 -0
- package/data/build/dist/client/debug/ui.js +499 -0
- package/data/build/dist/client/debug/ui.js.map +1 -0
- package/data/build/dist/client/delegate-command.d.ts +17 -0
- package/data/build/dist/client/delegate-command.d.ts.map +1 -0
- package/data/build/dist/client/delegate-command.js +616 -0
- package/data/build/dist/client/delegate-command.js.map +1 -0
- package/data/build/dist/client/delegate-plan.d.ts +40 -0
- package/data/build/dist/client/delegate-plan.d.ts.map +1 -0
- package/data/build/dist/client/delegate-plan.js +63 -0
- package/data/build/dist/client/delegate-plan.js.map +1 -0
- package/data/build/dist/client/delegate-ui-dom.d.ts +86 -0
- package/data/build/dist/client/delegate-ui-dom.d.ts.map +1 -0
- package/data/build/dist/client/delegate-ui-dom.js +647 -0
- package/data/build/dist/client/delegate-ui-dom.js.map +1 -0
- package/data/build/dist/client/dsh-h5-bootstrap.d.ts +66 -0
- package/data/build/dist/client/dsh-h5-bootstrap.d.ts.map +1 -0
- package/data/build/dist/client/dsh-h5-bootstrap.js +372 -0
- package/data/build/dist/client/dsh-h5-bootstrap.js.map +1 -0
- package/data/build/dist/client/dsh-runtime-version.d.ts +4 -0
- package/data/build/dist/client/dsh-runtime-version.d.ts.map +1 -0
- package/data/build/dist/client/dsh-runtime-version.js +11 -0
- package/data/build/dist/client/dsh-runtime-version.js.map +1 -0
- package/data/build/dist/client/editor-engine.d.ts +4 -0
- package/data/build/dist/client/editor-engine.d.ts.map +1 -0
- package/data/build/dist/client/editor-engine.js +53 -0
- package/data/build/dist/client/editor-engine.js.map +1 -0
- package/data/build/dist/client/engine-loader.d.ts +5 -0
- package/data/build/dist/client/engine-loader.d.ts.map +1 -0
- package/data/build/dist/client/engine-loader.js +35 -0
- package/data/build/dist/client/engine-loader.js.map +1 -0
- package/data/build/dist/client/external-tool-stream.d.ts +24 -0
- package/data/build/dist/client/external-tool-stream.d.ts.map +1 -0
- package/data/build/dist/client/external-tool-stream.js +123 -0
- package/data/build/dist/client/external-tool-stream.js.map +1 -0
- package/data/build/dist/client/features/cli-adapters.d.ts +14 -0
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -0
- package/data/build/dist/client/features/cli-adapters.js +456 -0
- package/data/build/dist/client/features/cli-adapters.js.map +1 -0
- package/data/build/dist/client/features/credentials.d.ts +3 -0
- package/data/build/dist/client/features/credentials.d.ts.map +1 -0
- package/data/build/dist/client/features/credentials.js +96 -0
- package/data/build/dist/client/features/credentials.js.map +1 -0
- package/data/build/dist/client/features/debug.d.ts +4 -0
- package/data/build/dist/client/features/debug.d.ts.map +1 -0
- package/data/build/dist/client/features/debug.js +26 -0
- package/data/build/dist/client/features/debug.js.map +1 -0
- package/data/build/dist/client/features/file-management-panel.d.ts +5 -0
- package/data/build/dist/client/features/file-management-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/file-management-panel.js +41 -0
- package/data/build/dist/client/features/file-management-panel.js.map +1 -0
- package/data/build/dist/client/features/file-management.d.ts +4 -0
- package/data/build/dist/client/features/file-management.d.ts.map +1 -0
- package/data/build/dist/client/features/file-management.js +92 -0
- package/data/build/dist/client/features/file-management.js.map +1 -0
- package/data/build/dist/client/features/index.d.ts +41 -0
- package/data/build/dist/client/features/index.d.ts.map +1 -0
- package/data/build/dist/client/features/index.js +63 -0
- package/data/build/dist/client/features/index.js.map +1 -0
- package/data/build/dist/client/features/lan-access-panel.d.ts +5 -0
- package/data/build/dist/client/features/lan-access-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/lan-access-panel.js +225 -0
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -0
- package/data/build/dist/client/features/lan-access-status.d.ts +40 -0
- package/data/build/dist/client/features/lan-access-status.d.ts.map +1 -0
- package/data/build/dist/client/features/lan-access-status.js +118 -0
- package/data/build/dist/client/features/lan-access-status.js.map +1 -0
- package/data/build/dist/client/features/lan-access.d.ts +12 -0
- package/data/build/dist/client/features/lan-access.d.ts.map +1 -0
- package/data/build/dist/client/features/lan-access.js +62 -0
- package/data/build/dist/client/features/lan-access.js.map +1 -0
- package/data/build/dist/client/features/login-protection-panel.d.ts +5 -0
- package/data/build/dist/client/features/login-protection-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/login-protection-panel.js +96 -0
- package/data/build/dist/client/features/login-protection-panel.js.map +1 -0
- package/data/build/dist/client/features/login-protection-session.d.ts +8 -0
- package/data/build/dist/client/features/login-protection-session.d.ts.map +1 -0
- package/data/build/dist/client/features/login-protection-session.js +43 -0
- package/data/build/dist/client/features/login-protection-session.js.map +1 -0
- package/data/build/dist/client/features/login-protection.d.ts +4 -0
- package/data/build/dist/client/features/login-protection.d.ts.map +1 -0
- package/data/build/dist/client/features/login-protection.js +23 -0
- package/data/build/dist/client/features/login-protection.js.map +1 -0
- package/data/build/dist/client/features/mobile-access-panel.d.ts +12 -0
- package/data/build/dist/client/features/mobile-access-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/mobile-access-panel.js +256 -0
- package/data/build/dist/client/features/mobile-access-panel.js.map +1 -0
- package/data/build/dist/client/features/mobile-access.d.ts +10 -0
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -0
- package/data/build/dist/client/features/mobile-access.js +66 -0
- package/data/build/dist/client/features/mobile-access.js.map +1 -0
- package/data/build/dist/client/features/plugin-update.d.ts +3 -0
- package/data/build/dist/client/features/plugin-update.d.ts.map +1 -0
- package/data/build/dist/client/features/plugin-update.js +14 -0
- package/data/build/dist/client/features/plugin-update.js.map +1 -0
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts +9 -0
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/reverse-proxy-panel.js +269 -0
- package/data/build/dist/client/features/reverse-proxy-panel.js.map +1 -0
- package/data/build/dist/client/features/reverse-proxy.d.ts +11 -0
- package/data/build/dist/client/features/reverse-proxy.d.ts.map +1 -0
- package/data/build/dist/client/features/reverse-proxy.js +183 -0
- package/data/build/dist/client/features/reverse-proxy.js.map +1 -0
- package/data/build/dist/client/features/session-translation.d.ts +3 -0
- package/data/build/dist/client/features/session-translation.d.ts.map +1 -0
- package/data/build/dist/client/features/session-translation.js +124 -0
- package/data/build/dist/client/features/session-translation.js.map +1 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts +9 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js +28 -0
- package/data/build/dist/client/features/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/features/subscription-usage-panel.d.ts +15 -0
- package/data/build/dist/client/features/subscription-usage-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/subscription-usage-panel.js +118 -0
- package/data/build/dist/client/features/subscription-usage-panel.js.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts +5 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.js +169 -0
- package/data/build/dist/client/features/terminal-enhancement-panel.js.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement.d.ts +4 -0
- package/data/build/dist/client/features/terminal-enhancement.d.ts.map +1 -0
- package/data/build/dist/client/features/terminal-enhancement.js +30 -0
- package/data/build/dist/client/features/terminal-enhancement.js.map +1 -0
- package/data/build/dist/client/features/types.d.ts +99 -0
- package/data/build/dist/client/features/types.d.ts.map +1 -0
- package/data/build/dist/client/features/types.js +2 -0
- package/data/build/dist/client/features/types.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts +5 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +121 -0
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts +4 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js +278 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -0
- package/data/build/dist/client/file-management-context-menu.d.ts +10 -0
- package/data/build/dist/client/file-management-context-menu.d.ts.map +1 -0
- package/data/build/dist/client/file-management-context-menu.js +178 -0
- package/data/build/dist/client/file-management-context-menu.js.map +1 -0
- package/data/build/dist/client/file-management-dom.d.ts +40 -0
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -0
- package/data/build/dist/client/file-management-dom.js +660 -0
- package/data/build/dist/client/file-management-dom.js.map +1 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts +27 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.d.ts.map +1 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js +101 -0
- package/data/build/dist/client/file-viewer-copy-path-menu.js.map +1 -0
- package/data/build/dist/client/font-scale.d.ts +37 -0
- package/data/build/dist/client/font-scale.d.ts.map +1 -0
- package/data/build/dist/client/font-scale.js +56 -0
- package/data/build/dist/client/font-scale.js.map +1 -0
- package/data/build/dist/client/git-history-graph.d.ts +81 -0
- package/data/build/dist/client/git-history-graph.d.ts.map +1 -0
- package/data/build/dist/client/git-history-graph.js +195 -0
- package/data/build/dist/client/git-history-graph.js.map +1 -0
- package/data/build/dist/client/git-management-settings.d.ts +4 -0
- package/data/build/dist/client/git-management-settings.d.ts.map +1 -0
- package/data/build/dist/client/git-management-settings.js +73 -0
- package/data/build/dist/client/git-management-settings.js.map +1 -0
- package/data/build/dist/client/git-management.d.ts +24 -0
- package/data/build/dist/client/git-management.d.ts.map +1 -0
- package/data/build/dist/client/git-management.js +1209 -0
- package/data/build/dist/client/git-management.js.map +1 -0
- package/data/build/dist/client/git-panel-styles.d.ts +32 -0
- package/data/build/dist/client/git-panel-styles.d.ts.map +1 -0
- package/data/build/dist/client/git-panel-styles.js +110 -0
- package/data/build/dist/client/git-panel-styles.js.map +1 -0
- package/data/build/dist/client/git-workspace-events.d.ts +7 -0
- package/data/build/dist/client/git-workspace-events.d.ts.map +1 -0
- package/data/build/dist/client/git-workspace-events.js +32 -0
- package/data/build/dist/client/git-workspace-events.js.map +1 -0
- package/data/build/dist/client/git-worktree-selection.d.ts +89 -0
- package/data/build/dist/client/git-worktree-selection.d.ts.map +1 -0
- package/data/build/dist/client/git-worktree-selection.js +121 -0
- package/data/build/dist/client/git-worktree-selection.js.map +1 -0
- package/data/build/dist/client/h5-bootstrap-entry.d.ts +2 -0
- package/data/build/dist/client/h5-bootstrap-entry.d.ts.map +1 -0
- package/data/build/dist/client/h5-bootstrap-entry.js +17 -0
- package/data/build/dist/client/h5-bootstrap-entry.js.map +1 -0
- package/data/build/dist/client/html-workspace-files.d.ts +4 -0
- package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/client/html-workspace-files.js +114 -0
- package/data/build/dist/client/html-workspace-files.js.map +1 -0
- package/data/build/dist/client/index.d.ts +39 -0
- package/data/build/dist/client/index.d.ts.map +1 -0
- package/data/build/dist/client/index.js +249 -0
- package/data/build/dist/client/index.js.map +1 -0
- package/data/build/dist/client/lan-access.d.ts +28 -0
- package/data/build/dist/client/lan-access.d.ts.map +1 -0
- package/data/build/dist/client/lan-access.js +68 -0
- package/data/build/dist/client/lan-access.js.map +1 -0
- package/data/build/dist/client/locale.d.ts +27 -0
- package/data/build/dist/client/locale.d.ts.map +1 -0
- package/data/build/dist/client/locale.js +845 -0
- package/data/build/dist/client/locale.js.map +1 -0
- package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
- package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
- package/data/build/dist/client/locales/cliManagement.js +155 -0
- package/data/build/dist/client/locales/cliManagement.js.map +1 -0
- package/data/build/dist/client/locales/credentials.d.ts +3 -0
- package/data/build/dist/client/locales/credentials.d.ts.map +1 -0
- package/data/build/dist/client/locales/credentials.js +93 -0
- package/data/build/dist/client/locales/credentials.js.map +1 -0
- package/data/build/dist/client/locales/debug.d.ts +9 -0
- package/data/build/dist/client/locales/debug.d.ts.map +1 -0
- package/data/build/dist/client/locales/debug.js +163 -0
- package/data/build/dist/client/locales/debug.js.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts +9 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.js +153 -0
- package/data/build/dist/client/locales/fileWorkspace.js.map +1 -0
- package/data/build/dist/client/locales/git.d.ts +9 -0
- package/data/build/dist/client/locales/git.d.ts.map +1 -0
- package/data/build/dist/client/locales/git.js +263 -0
- package/data/build/dist/client/locales/git.js.map +1 -0
- package/data/build/dist/client/locales/nativeApproval.d.ts +3 -0
- package/data/build/dist/client/locales/nativeApproval.d.ts.map +1 -0
- package/data/build/dist/client/locales/nativeApproval.js +51 -0
- package/data/build/dist/client/locales/nativeApproval.js.map +1 -0
- package/data/build/dist/client/locales/panels.d.ts +9 -0
- package/data/build/dist/client/locales/panels.d.ts.map +1 -0
- package/data/build/dist/client/locales/panels.js +251 -0
- package/data/build/dist/client/locales/panels.js.map +1 -0
- package/data/build/dist/client/locales/pluginUpdate.d.ts +3 -0
- package/data/build/dist/client/locales/pluginUpdate.d.ts.map +1 -0
- package/data/build/dist/client/locales/pluginUpdate.js +131 -0
- package/data/build/dist/client/locales/pluginUpdate.js.map +1 -0
- package/data/build/dist/client/locales/subagentCollapsed.d.ts +53 -0
- package/data/build/dist/client/locales/subagentCollapsed.d.ts.map +1 -0
- package/data/build/dist/client/locales/subagentCollapsed.js +95 -0
- package/data/build/dist/client/locales/subagentCollapsed.js.map +1 -0
- package/data/build/dist/client/locales/terminalAuth.d.ts +9 -0
- package/data/build/dist/client/locales/terminalAuth.d.ts.map +1 -0
- package/data/build/dist/client/locales/terminalAuth.js +153 -0
- package/data/build/dist/client/locales/terminalAuth.js.map +1 -0
- package/data/build/dist/client/locales/usage.d.ts +9 -0
- package/data/build/dist/client/locales/usage.d.ts.map +1 -0
- package/data/build/dist/client/locales/usage.js +311 -0
- package/data/build/dist/client/locales/usage.js.map +1 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.d.ts +29 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.js +93 -0
- package/data/build/dist/client/mobile-rightbar-tabs-dom.js.map +1 -0
- package/data/build/dist/client/mobile-rightbar-visibility.d.ts +32 -0
- package/data/build/dist/client/mobile-rightbar-visibility.d.ts.map +1 -0
- package/data/build/dist/client/mobile-rightbar-visibility.js +188 -0
- package/data/build/dist/client/mobile-rightbar-visibility.js.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts +43 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.js +227 -0
- package/data/build/dist/client/mobile-session-interaction.js.map +1 -0
- package/data/build/dist/client/mobile-settings-modal-dom.d.ts +49 -0
- package/data/build/dist/client/mobile-settings-modal-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-settings-modal-dom.js +152 -0
- package/data/build/dist/client/mobile-settings-modal-dom.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts +149 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts.map +1 -0
- package/data/build/dist/client/mobile-sidebar-gestures.js +623 -0
- package/data/build/dist/client/mobile-sidebar-gestures.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-logo.d.ts +18 -0
- package/data/build/dist/client/mobile-sidebar-logo.d.ts.map +1 -0
- package/data/build/dist/client/mobile-sidebar-logo.js +15 -0
- package/data/build/dist/client/mobile-sidebar-logo.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts +114 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.js +452 -0
- package/data/build/dist/client/mobile-sidebar-rail-dom.js.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts +14 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.js +164 -0
- package/data/build/dist/client/mobile-team-panel-dom.js.map +1 -0
- package/data/build/dist/client/mobile-vibration.d.ts +16 -0
- package/data/build/dist/client/mobile-vibration.d.ts.map +1 -0
- package/data/build/dist/client/mobile-vibration.js +20 -0
- package/data/build/dist/client/mobile-vibration.js.map +1 -0
- package/data/build/dist/client/model-catalog-cache.d.ts +28 -0
- package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -0
- package/data/build/dist/client/model-catalog-cache.js +158 -0
- package/data/build/dist/client/model-catalog-cache.js.map +1 -0
- package/data/build/dist/client/model-priority-pool.d.ts +23 -0
- package/data/build/dist/client/model-priority-pool.d.ts.map +1 -0
- package/data/build/dist/client/model-priority-pool.js +245 -0
- package/data/build/dist/client/model-priority-pool.js.map +1 -0
- package/data/build/dist/client/native-approval-selector.d.ts +22 -0
- package/data/build/dist/client/native-approval-selector.d.ts.map +1 -0
- package/data/build/dist/client/native-approval-selector.js +39 -0
- package/data/build/dist/client/native-approval-selector.js.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts +6 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.js +62 -0
- package/data/build/dist/client/native-model-translation-menu.js.map +1 -0
- package/data/build/dist/client/native-translation-default.d.ts +6 -0
- package/data/build/dist/client/native-translation-default.d.ts.map +1 -0
- package/data/build/dist/client/native-translation-default.js +30 -0
- package/data/build/dist/client/native-translation-default.js.map +1 -0
- package/data/build/dist/client/native-workspace-store.d.ts +29 -0
- package/data/build/dist/client/native-workspace-store.d.ts.map +1 -0
- package/data/build/dist/client/native-workspace-store.js +75 -0
- package/data/build/dist/client/native-workspace-store.js.map +1 -0
- package/data/build/dist/client/popup-dismiss.d.ts +48 -0
- package/data/build/dist/client/popup-dismiss.d.ts.map +1 -0
- package/data/build/dist/client/popup-dismiss.js +93 -0
- package/data/build/dist/client/popup-dismiss.js.map +1 -0
- package/data/build/dist/client/provider-icon-assets.d.ts +2 -0
- package/data/build/dist/client/provider-icon-assets.d.ts.map +1 -0
- package/data/build/dist/client/provider-icon-assets.js +7 -0
- package/data/build/dist/client/provider-icon-assets.js.map +1 -0
- package/data/build/dist/client/provider-icon-bridge.d.ts +6 -0
- package/data/build/dist/client/provider-icon-bridge.d.ts.map +1 -0
- package/data/build/dist/client/provider-icon-bridge.js +65 -0
- package/data/build/dist/client/provider-icon-bridge.js.map +1 -0
- package/data/build/dist/client/provider-icons.d.ts +43 -0
- package/data/build/dist/client/provider-icons.d.ts.map +1 -0
- package/data/build/dist/client/provider-icons.js +185 -0
- package/data/build/dist/client/provider-icons.js.map +1 -0
- package/data/build/dist/client/pwa-install-prompt.d.ts +76 -0
- package/data/build/dist/client/pwa-install-prompt.d.ts.map +1 -0
- package/data/build/dist/client/pwa-install-prompt.js +179 -0
- package/data/build/dist/client/pwa-install-prompt.js.map +1 -0
- package/data/build/dist/client/pwa-notifications.d.ts +105 -0
- package/data/build/dist/client/pwa-notifications.d.ts.map +1 -0
- package/data/build/dist/client/pwa-notifications.js +192 -0
- package/data/build/dist/client/pwa-notifications.js.map +1 -0
- package/data/build/dist/client/quick-phrase-layout.d.ts +60 -0
- package/data/build/dist/client/quick-phrase-layout.d.ts.map +1 -0
- package/data/build/dist/client/quick-phrase-layout.js +115 -0
- package/data/build/dist/client/quick-phrase-layout.js.map +1 -0
- package/data/build/dist/client/quick-phrase-slot.d.ts +7 -0
- package/data/build/dist/client/quick-phrase-slot.d.ts.map +1 -0
- package/data/build/dist/client/quick-phrase-slot.js +405 -0
- package/data/build/dist/client/quick-phrase-slot.js.map +1 -0
- package/data/build/dist/client/remote-web-context.d.ts +59 -0
- package/data/build/dist/client/remote-web-context.d.ts.map +1 -0
- package/data/build/dist/client/remote-web-context.js +1037 -0
- package/data/build/dist/client/remote-web-context.js.map +1 -0
- package/data/build/dist/client/rpc-call.d.ts +4 -0
- package/data/build/dist/client/rpc-call.d.ts.map +1 -0
- package/data/build/dist/client/rpc-call.js +23 -0
- package/data/build/dist/client/rpc-call.js.map +1 -0
- package/data/build/dist/client/serial-polling.d.ts +16 -0
- package/data/build/dist/client/serial-polling.d.ts.map +1 -0
- package/data/build/dist/client/serial-polling.js +50 -0
- package/data/build/dist/client/serial-polling.js.map +1 -0
- package/data/build/dist/client/service-tier.d.ts +65 -0
- package/data/build/dist/client/service-tier.d.ts.map +1 -0
- package/data/build/dist/client/service-tier.js +93 -0
- package/data/build/dist/client/service-tier.js.map +1 -0
- package/data/build/dist/client/session-adapter-cache.d.ts +20 -0
- package/data/build/dist/client/session-adapter-cache.d.ts.map +1 -0
- package/data/build/dist/client/session-adapter-cache.js +105 -0
- package/data/build/dist/client/session-adapter-cache.js.map +1 -0
- package/data/build/dist/client/session-changed-files-view.d.ts +37 -0
- package/data/build/dist/client/session-changed-files-view.d.ts.map +1 -0
- package/data/build/dist/client/session-changed-files-view.js +528 -0
- package/data/build/dist/client/session-changed-files-view.js.map +1 -0
- package/data/build/dist/client/session-file-links.d.ts +11 -0
- package/data/build/dist/client/session-file-links.d.ts.map +1 -0
- package/data/build/dist/client/session-file-links.js +52 -0
- package/data/build/dist/client/session-file-links.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +73 -0
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-chat.js +889 -0
- package/data/build/dist/client/session-translation-chat.js.map +1 -0
- package/data/build/dist/client/session-translation-interactions.d.ts +40 -0
- package/data/build/dist/client/session-translation-interactions.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-interactions.js +222 -0
- package/data/build/dist/client/session-translation-interactions.js.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts +8 -0
- package/data/build/dist/client/session-translation-pending-dom.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-pending-dom.js +58 -0
- package/data/build/dist/client/session-translation-pending-dom.js.map +1 -0
- package/data/build/dist/client/session-translation-retry.d.ts +16 -0
- package/data/build/dist/client/session-translation-retry.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-retry.js +67 -0
- package/data/build/dist/client/session-translation-retry.js.map +1 -0
- package/data/build/dist/client/session-translation-rules.d.ts +13 -0
- package/data/build/dist/client/session-translation-rules.d.ts.map +1 -0
- package/data/build/dist/client/session-translation-rules.js +58 -0
- package/data/build/dist/client/session-translation-rules.js.map +1 -0
- package/data/build/dist/client/settings-anchor.d.ts +73 -0
- package/data/build/dist/client/settings-anchor.d.ts.map +1 -0
- package/data/build/dist/client/settings-anchor.js +70 -0
- package/data/build/dist/client/settings-anchor.js.map +1 -0
- package/data/build/dist/client/settings-bridge.d.ts +62 -0
- package/data/build/dist/client/settings-bridge.d.ts.map +1 -0
- package/data/build/dist/client/settings-bridge.js +247 -0
- package/data/build/dist/client/settings-bridge.js.map +1 -0
- package/data/build/dist/client/settings-controls.d.ts +29 -0
- package/data/build/dist/client/settings-controls.d.ts.map +1 -0
- package/data/build/dist/client/settings-controls.js +80 -0
- package/data/build/dist/client/settings-controls.js.map +1 -0
- package/data/build/dist/client/settings-promo-styles.d.ts +33 -0
- package/data/build/dist/client/settings-promo-styles.d.ts.map +1 -0
- package/data/build/dist/client/settings-promo-styles.js +71 -0
- package/data/build/dist/client/settings-promo-styles.js.map +1 -0
- package/data/build/dist/client/settings-promo.d.ts +16 -0
- package/data/build/dist/client/settings-promo.d.ts.map +1 -0
- package/data/build/dist/client/settings-promo.js +68 -0
- package/data/build/dist/client/settings-promo.js.map +1 -0
- package/data/build/dist/client/settings-section.d.ts +31 -0
- package/data/build/dist/client/settings-section.d.ts.map +1 -0
- package/data/build/dist/client/settings-section.js +140 -0
- package/data/build/dist/client/settings-section.js.map +1 -0
- package/data/build/dist/client/settings-update.d.ts +8 -0
- package/data/build/dist/client/settings-update.d.ts.map +1 -0
- package/data/build/dist/client/settings-update.js +57 -0
- package/data/build/dist/client/settings-update.js.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts +11 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.js +6 -0
- package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
- package/data/build/dist/client/skill-command.d.ts +10 -0
- package/data/build/dist/client/skill-command.d.ts.map +1 -0
- package/data/build/dist/client/skill-command.js +282 -0
- package/data/build/dist/client/skill-command.js.map +1 -0
- package/data/build/dist/client/skill-reference-dom.d.ts +38 -0
- package/data/build/dist/client/skill-reference-dom.d.ts.map +1 -0
- package/data/build/dist/client/skill-reference-dom.js +187 -0
- package/data/build/dist/client/skill-reference-dom.js.map +1 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts +103 -0
- package/data/build/dist/client/subagent-collapsed-lineage.d.ts.map +1 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js +664 -0
- package/data/build/dist/client/subagent-collapsed-lineage.js.map +1 -0
- package/data/build/dist/client/subscription-slot.d.ts +49 -0
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -0
- package/data/build/dist/client/subscription-slot.js +936 -0
- package/data/build/dist/client/subscription-slot.js.map +1 -0
- package/data/build/dist/client/terminal/index.d.ts +4 -0
- package/data/build/dist/client/terminal/index.d.ts.map +1 -0
- package/data/build/dist/client/terminal/index.js +3 -0
- package/data/build/dist/client/terminal/index.js.map +1 -0
- package/data/build/dist/client/terminal/log-preview.d.ts +14 -0
- package/data/build/dist/client/terminal/log-preview.d.ts.map +1 -0
- package/data/build/dist/client/terminal/log-preview.js +23 -0
- package/data/build/dist/client/terminal/log-preview.js.map +1 -0
- package/data/build/dist/client/terminal/model.d.ts +287 -0
- package/data/build/dist/client/terminal/model.d.ts.map +1 -0
- package/data/build/dist/client/terminal/model.js +1166 -0
- package/data/build/dist/client/terminal/model.js.map +1 -0
- package/data/build/dist/client/terminal/recovery.d.ts +69 -0
- package/data/build/dist/client/terminal/recovery.d.ts.map +1 -0
- package/data/build/dist/client/terminal/recovery.js +167 -0
- package/data/build/dist/client/terminal/recovery.js.map +1 -0
- package/data/build/dist/client/terminal/selection-actions.d.ts +63 -0
- package/data/build/dist/client/terminal/selection-actions.d.ts.map +1 -0
- package/data/build/dist/client/terminal/selection-actions.js +132 -0
- package/data/build/dist/client/terminal/selection-actions.js.map +1 -0
- package/data/build/dist/client/terminal/share-menu.d.ts +17 -0
- package/data/build/dist/client/terminal/share-menu.d.ts.map +1 -0
- package/data/build/dist/client/terminal/share-menu.js +131 -0
- package/data/build/dist/client/terminal/share-menu.js.map +1 -0
- package/data/build/dist/client/terminal/sharing.d.ts +42 -0
- package/data/build/dist/client/terminal/sharing.d.ts.map +1 -0
- package/data/build/dist/client/terminal/sharing.js +144 -0
- package/data/build/dist/client/terminal/sharing.js.map +1 -0
- package/data/build/dist/client/terminal/snapshot.d.ts +32 -0
- package/data/build/dist/client/terminal/snapshot.d.ts.map +1 -0
- package/data/build/dist/client/terminal/snapshot.js +108 -0
- package/data/build/dist/client/terminal/snapshot.js.map +1 -0
- package/data/build/dist/client/terminal/styles.d.ts +53 -0
- package/data/build/dist/client/terminal/styles.d.ts.map +1 -0
- package/data/build/dist/client/terminal/styles.js +134 -0
- package/data/build/dist/client/terminal/styles.js.map +1 -0
- package/data/build/dist/client/terminal/surface-cache.d.ts +10 -0
- package/data/build/dist/client/terminal/surface-cache.d.ts.map +1 -0
- package/data/build/dist/client/terminal/surface-cache.js +19 -0
- package/data/build/dist/client/terminal/surface-cache.js.map +1 -0
- package/data/build/dist/client/terminal/ui.d.ts +20 -0
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -0
- package/data/build/dist/client/terminal/ui.js +618 -0
- package/data/build/dist/client/terminal/ui.js.map +1 -0
- package/data/build/dist/client/terminal/xterm-engine.d.ts +4 -0
- package/data/build/dist/client/terminal/xterm-engine.d.ts.map +1 -0
- package/data/build/dist/client/terminal/xterm-engine.js +5 -0
- package/data/build/dist/client/terminal/xterm-engine.js.map +1 -0
- package/data/build/dist/client/terminal/xterm-view.d.ts +23 -0
- package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -0
- package/data/build/dist/client/terminal/xterm-view.js +790 -0
- package/data/build/dist/client/terminal/xterm-view.js.map +1 -0
- package/data/build/dist/client/theme.d.ts +75 -0
- package/data/build/dist/client/theme.d.ts.map +1 -0
- package/data/build/dist/client/theme.js +247 -0
- package/data/build/dist/client/theme.js.map +1 -0
- package/data/build/dist/client/touch-input-focus.d.ts +30 -0
- package/data/build/dist/client/touch-input-focus.d.ts.map +1 -0
- package/data/build/dist/client/touch-input-focus.js +209 -0
- package/data/build/dist/client/touch-input-focus.js.map +1 -0
- package/data/build/dist/client/update-panel-styles.d.ts +29 -0
- package/data/build/dist/client/update-panel-styles.d.ts.map +1 -0
- package/data/build/dist/client/update-panel-styles.js +69 -0
- package/data/build/dist/client/update-panel-styles.js.map +1 -0
- package/data/build/dist/client/update-panel.d.ts +7 -0
- package/data/build/dist/client/update-panel.d.ts.map +1 -0
- package/data/build/dist/client/update-panel.js +52 -0
- package/data/build/dist/client/update-panel.js.map +1 -0
- package/data/build/dist/client/update-store.d.ts +43 -0
- package/data/build/dist/client/update-store.d.ts.map +1 -0
- package/data/build/dist/client/update-store.js +207 -0
- package/data/build/dist/client/update-store.js.map +1 -0
- package/data/build/dist/client/workspace-activity-dom.d.ts +8 -0
- package/data/build/dist/client/workspace-activity-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-activity-dom.js +140 -0
- package/data/build/dist/client/workspace-activity-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +58 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-archive-dom.js +749 -0
- package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-fiber.d.ts +3 -0
- package/data/build/dist/client/workspace-session-fiber.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-fiber.js +33 -0
- package/data/build/dist/client/workspace-session-fiber.js.map +1 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts +29 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-logo-dom.js +130 -0
- package/data/build/dist/client/workspace-session-logo-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.d.ts +28 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.js +282 -0
- package/data/build/dist/client/workspace-session-rightbar-dom.js.map +1 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts +39 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -0
- package/data/build/dist/client/workspace-session-visibility-dom.js +712 -0
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.js +18 -0
- package/data/build/dist/dsh-capabilities/client/agent-permission-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js +71 -0
- package/data/build/dist/dsh-capabilities/client/composer-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts +64 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js +162 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.d.ts +22 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.js +33 -0
- package/data/build/dist/dsh-capabilities/client/context-menu-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.js +6 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts +27 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js +109 -0
- package/data/build/dist/dsh-capabilities/client/global-panel-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts +33 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js +99 -0
- package/data/build/dist/dsh-capabilities/client/interaction-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts +12 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js +181 -0
- package/data/build/dist/dsh-capabilities/client/interaction-text-dom.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.d.ts +9 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +49 -0
- package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.js +6 -0
- package/data/build/dist/dsh-capabilities/client/plugin-reload-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +76 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +180 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts +20 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js +65 -0
- package/data/build/dist/dsh-capabilities/client/question-history-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +9 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +79 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.d.ts +14 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.js +39 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.js +5 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts +32 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js +90 -0
- package/data/build/dist/dsh-capabilities/client/slot-presentation-mirror.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.d.ts +33 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.js +186 -0
- package/data/build/dist/dsh-capabilities/client/terminal-sharing-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.d.ts +5 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts +81 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js +237 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.d.ts +12 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.js +10 -0
- package/data/build/dist/dsh-capabilities/host/attachment-store-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.d.ts +40 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.js +71 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js +24 -0
- package/data/build/dist/dsh-capabilities/host/connection-peer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.js +13 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.d.ts +27 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.js +101 -0
- package/data/build/dist/dsh-capabilities/host/llm-text-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.d.ts +23 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.js +79 -0
- package/data/build/dist/dsh-capabilities/host/plugin-update-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js +37 -0
- package/data/build/dist/dsh-capabilities/host/session-activation-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.d.ts +16 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.js +94 -0
- package/data/build/dist/dsh-capabilities/host/session-compaction-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts +24 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js +106 -0
- package/data/build/dist/dsh-capabilities/host/session-model-selection-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +27 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts +29 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js +65 -0
- package/data/build/dist/dsh-capabilities/host/session-prompt-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts +11 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js +229 -0
- package/data/build/dist/dsh-capabilities/host/session-title-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.js +47 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts +28 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js +123 -0
- package/data/build/dist/dsh-capabilities/host/sidebar-session-compat.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/index.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/index.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/index.js +6 -0
- package/data/build/dist/dsh-capabilities/index.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.js +91 -0
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -0
- package/data/build/dist/dsh-capabilities/registry.d.ts +22 -0
- package/data/build/dist/dsh-capabilities/registry.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/registry.js +200 -0
- package/data/build/dist/dsh-capabilities/registry.js.map +1 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts +17 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/routes.js +307 -0
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -0
- package/data/build/dist/dsh-capabilities/settings-store.d.ts +43 -0
- package/data/build/dist/dsh-capabilities/settings-store.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/settings-store.js +39 -0
- package/data/build/dist/dsh-capabilities/settings-store.js.map +1 -0
- package/data/build/dist/dsh-capabilities/types.d.ts +50 -0
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/types.js +23 -0
- package/data/build/dist/dsh-capabilities/types.js.map +1 -0
- package/data/build/dist/features/index.d.ts +3 -0
- package/data/build/dist/features/index.d.ts.map +1 -0
- package/data/build/dist/features/index.js +2 -0
- package/data/build/dist/features/index.js.map +1 -0
- package/data/build/dist/features/registry.d.ts +87 -0
- package/data/build/dist/features/registry.d.ts.map +1 -0
- package/data/build/dist/features/registry.js +525 -0
- package/data/build/dist/features/registry.js.map +1 -0
- package/data/build/dist/host/auth-session.d.ts +49 -0
- package/data/build/dist/host/auth-session.d.ts.map +1 -0
- package/data/build/dist/host/auth-session.js +208 -0
- package/data/build/dist/host/auth-session.js.map +1 -0
- package/data/build/dist/host/browser-text.d.ts +30 -0
- package/data/build/dist/host/browser-text.d.ts.map +1 -0
- package/data/build/dist/host/browser-text.js +119 -0
- package/data/build/dist/host/browser-text.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +156 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +705 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.d.ts +31 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.js +144 -0
- package/data/build/dist/host/cli-adapters/acp-elicitation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts +96 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.js +608 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.d.ts +90 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.js +7 -0
- package/data/build/dist/host/cli-adapters/antigravity-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.d.ts +122 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.js +545 -0
- package/data/build/dist/host/cli-adapters/antigravity-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.js +75 -0
- package/data/build/dist/host/cli-adapters/antigravity-updater.js.map +1 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts +26 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.js +189 -0
- package/data/build/dist/host/cli-adapters/attachment-utils.js.map +1 -0
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/binary-detection.js +75 -0
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +88 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js +815 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.js +109 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.d.ts +90 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.js +7 -0
- package/data/build/dist/host/cli-adapters/claude-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/claude-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-performance.js +66 -0
- package/data/build/dist/host/cli-adapters/claude-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/claude-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-process.js +59 -0
- package/data/build/dist/host/cli-adapters/claude-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts +148 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js +1958 -0
- package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.d.ts +53 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.js +778 -0
- package/data/build/dist/host/cli-adapters/codebuddy-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +155 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-driver.js +2226 -0
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.js +271 -0
- package/data/build/dist/host/cli-adapters/codex-file-citations.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +179 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +135 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.js +2098 -0
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts +174 -0
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-history.js +789 -0
- package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.js +132 -0
- package/data/build/dist/host/cli-adapters/command-code-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.d.ts +21 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.js +91 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.d.ts +67 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.js +169 -0
- package/data/build/dist/host/cli-adapters/custom-upstream-classifier.js.map +1 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts +49 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js +112 -0
- package/data/build/dist/host/cli-adapters/delegate-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.d.ts +19 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.js +49 -0
- package/data/build/dist/host/cli-adapters/delegation-authorization.js.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.d.ts +36 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js +126 -0
- package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js.map +1 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js +157 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts +48 -0
- package/data/build/dist/host/cli-adapters/doubao-app.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-app.js +281 -0
- package/data/build/dist/host/cli-adapters/doubao-app.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.js +142 -0
- package/data/build/dist/host/cli-adapters/doubao-artifact-store.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.js +34 -0
- package/data/build/dist/host/cli-adapters/doubao-artifacts.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.d.ts +49 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.js +177 -0
- package/data/build/dist/host/cli-adapters/doubao-cdp.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts +33 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.js +294 -0
- package/data/build/dist/host/cli-adapters/doubao-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-events.d.ts +21 -0
- package/data/build/dist/host/cli-adapters/doubao-events.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-events.js +126 -0
- package/data/build/dist/host/cli-adapters/doubao-events.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.js +176 -0
- package/data/build/dist/host/cli-adapters/doubao-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.js +139 -0
- package/data/build/dist/host/cli-adapters/doubao-tools.js.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts +82 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.js +2 -0
- package/data/build/dist/host/cli-adapters/driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/dsh-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js +153 -0
- package/data/build/dist/host/cli-adapters/dsh-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +73 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +514 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.js +34 -0
- package/data/build/dist/host/cli-adapters/dsh-model-catalog.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts +52 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +528 -0
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts +27 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js +100 -0
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js.map +1 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts +28 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/feature.js +2418 -0
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.js +507 -0
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +48 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-driver.js +1118 -0
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js +48 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.d.ts +22 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.js +99 -0
- package/data/build/dist/host/cli-adapters/http-sse-client.js.map +1 -0
- package/data/build/dist/host/cli-adapters/interaction-events.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/interaction-events.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/interaction-events.js +80 -0
- package/data/build/dist/host/cli-adapters/interaction-events.js.map +1 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +93 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +375 -0
- package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js +416 -0
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.d.ts +12 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.js +18 -0
- package/data/build/dist/host/cli-adapters/kiro-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts +28 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +142 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts +24 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.js +167 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.js.map +1 -0
- package/data/build/dist/host/cli-adapters/log-files.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/log-files.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/log-files.js +32 -0
- package/data/build/dist/host/cli-adapters/log-files.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
- package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts +37 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.js +144 -0
- package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.js +62 -0
- package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management.js +177 -0
- package/data/build/dist/host/cli-adapters/management.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.d.ts +23 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.js +120 -0
- package/data/build/dist/host/cli-adapters/mcode-catalog.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.d.ts +60 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.js +621 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +113 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js +526 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +159 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +566 -0
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.d.ts +4 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.js +4 -0
- package/data/build/dist/host/cli-adapters/native-subagent-holder.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.d.ts +41 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.js +140 -0
- package/data/build/dist/host/cli-adapters/native-team-proxy.js.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +175 -0
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts +75 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.js +869 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.d.ts +29 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.js +361 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +112 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.js +1270 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts +30 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +828 -0
- package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-driver.js +616 -0
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.d.ts +90 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.js +7 -0
- package/data/build/dist/host/cli-adapters/pi-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance.d.ts +15 -0
- package/data/build/dist/host/cli-adapters/pi-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/pi-performance.js +94 -0
- package/data/build/dist/host/cli-adapters/pi-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +53 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/process-utils.js +242 -0
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-registry.d.ts +33 -0
- package/data/build/dist/host/cli-adapters/provider-registry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-registry.js +83 -0
- package/data/build/dist/host/cli-adapters/provider-registry.js.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +189 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.js +1616 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts +86 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.js +707 -0
- package/data/build/dist/host/cli-adapters/qoder-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.d.ts +36 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.js +207 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts +13 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js +111 -0
- package/data/build/dist/host/cli-adapters/r4-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.js +79 -0
- package/data/build/dist/host/cli-adapters/reasoning-content.js.map +1 -0
- package/data/build/dist/host/cli-adapters/registry-holder.d.ts +4 -0
- package/data/build/dist/host/cli-adapters/registry-holder.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/registry-holder.js +9 -0
- package/data/build/dist/host/cli-adapters/registry-holder.js.map +1 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts +194 -0
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/registry.js +1412 -0
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +120 -0
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +80 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js +108 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/session-probe.d.ts +20 -0
- package/data/build/dist/host/cli-adapters/session-probe.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-probe.js +139 -0
- package/data/build/dist/host/cli-adapters/session-probe.js.map +1 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts +98 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-store.js +364 -0
- package/data/build/dist/host/cli-adapters/session-store.js.map +1 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.d.ts +25 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.js +161 -0
- package/data/build/dist/host/cli-adapters/skill-filesystem.js.map +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +73 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +365 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +39 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +135 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js +38 -0
- package/data/build/dist/host/cli-adapters/subagent-tool-descriptions.js.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.js +185 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -0
- package/data/build/dist/host/cli-adapters/team-input.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/team-input.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/team-input.js +67 -0
- package/data/build/dist/host/cli-adapters/team-input.js.map +1 -0
- package/data/build/dist/host/cli-adapters/tool-observation.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/tool-observation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/tool-observation.js +45 -0
- package/data/build/dist/host/cli-adapters/tool-observation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.js +263 -0
- package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.d.ts +12 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.js +53 -0
- package/data/build/dist/host/cli-adapters/windows-command-environment.js.map +1 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.js +212 -0
- package/data/build/dist/host/cli-adapters/workbuddy-credential-bootstrap.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.d.ts +10 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.js +84 -0
- package/data/build/dist/host/cli-adapters/zcode-credentials.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts +74 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js +1033 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.js +97 -0
- package/data/build/dist/host/cli-adapters/zcode-interactions.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.d.ts +29 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.js +147 -0
- package/data/build/dist/host/cli-adapters/zcode-provider-config.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts +23 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.js +187 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.js +124 -0
- package/data/build/dist/host/cli-adapters/zcode-telemetry.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js +149 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +46 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.js +98 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts +56 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-server.js +201 -0
- package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts +52 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.js +335 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -0
- package/data/build/dist/host/cli-bridge/dispatch.d.ts +19 -0
- package/data/build/dist/host/cli-bridge/dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/dispatch.js +199 -0
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts +34 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.js +147 -0
- package/data/build/dist/host/cli-bridge/fetch-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts +119 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.js +491 -0
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts +8 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +344 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.js +9 -0
- package/data/build/dist/host/cli-bridge/pi-extension-entry.js.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension.d.ts +52 -0
- package/data/build/dist/host/cli-bridge/pi-extension.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/pi-extension.js +315 -0
- package/data/build/dist/host/cli-bridge/pi-extension.js.map +1 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.d.ts +28 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.js +177 -0
- package/data/build/dist/host/cli-bridge/search-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts +11 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js +23 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts +36 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js +243 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.js +18 -0
- package/data/build/dist/host/cli-bridge/team-tool.js.map +1 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.d.ts +33 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.js +174 -0
- package/data/build/dist/host/cli-bridge/web-diagnostics.js.map +1 -0
- package/data/build/dist/host/control-api-client.d.ts +84 -0
- package/data/build/dist/host/control-api-client.d.ts.map +1 -0
- package/data/build/dist/host/control-api-client.js +131 -0
- package/data/build/dist/host/control-api-client.js.map +1 -0
- package/data/build/dist/host/credential-store.d.ts +54 -0
- package/data/build/dist/host/credential-store.d.ts.map +1 -0
- package/data/build/dist/host/credential-store.js +124 -0
- package/data/build/dist/host/credential-store.js.map +1 -0
- package/data/build/dist/host/credentials/broker.d.ts +73 -0
- package/data/build/dist/host/credentials/broker.d.ts.map +1 -0
- package/data/build/dist/host/credentials/broker.js +495 -0
- package/data/build/dist/host/credentials/broker.js.map +1 -0
- package/data/build/dist/host/credentials/index.d.ts +4 -0
- package/data/build/dist/host/credentials/index.d.ts.map +1 -0
- package/data/build/dist/host/credentials/index.js +4 -0
- package/data/build/dist/host/credentials/index.js.map +1 -0
- package/data/build/dist/host/credentials/service.d.ts +43 -0
- package/data/build/dist/host/credentials/service.d.ts.map +1 -0
- package/data/build/dist/host/credentials/service.js +432 -0
- package/data/build/dist/host/credentials/service.js.map +1 -0
- package/data/build/dist/host/credentials/store.d.ts +33 -0
- package/data/build/dist/host/credentials/store.d.ts.map +1 -0
- package/data/build/dist/host/credentials/store.js +238 -0
- package/data/build/dist/host/credentials/store.js.map +1 -0
- package/data/build/dist/host/credentials/tool.d.ts +3 -0
- package/data/build/dist/host/credentials/tool.d.ts.map +1 -0
- package/data/build/dist/host/credentials/tool.js +54 -0
- package/data/build/dist/host/credentials/tool.js.map +1 -0
- package/data/build/dist/host/debug.d.ts +79 -0
- package/data/build/dist/host/debug.d.ts.map +1 -0
- package/data/build/dist/host/debug.js +296 -0
- package/data/build/dist/host/debug.js.map +1 -0
- package/data/build/dist/host/dsh-device-runtime.d.ts +45 -0
- package/data/build/dist/host/dsh-device-runtime.d.ts.map +1 -0
- package/data/build/dist/host/dsh-device-runtime.js +155 -0
- package/data/build/dist/host/dsh-device-runtime.js.map +1 -0
- package/data/build/dist/host/dsh-gateway-feature.d.ts +5 -0
- package/data/build/dist/host/dsh-gateway-feature.d.ts.map +1 -0
- package/data/build/dist/host/dsh-gateway-feature.js +78 -0
- package/data/build/dist/host/dsh-gateway-feature.js.map +1 -0
- package/data/build/dist/host/dsh-runtime-version.d.ts +13 -0
- package/data/build/dist/host/dsh-runtime-version.d.ts.map +1 -0
- package/data/build/dist/host/dsh-runtime-version.js +143 -0
- package/data/build/dist/host/dsh-runtime-version.js.map +1 -0
- package/data/build/dist/host/features/auth.d.ts +11 -0
- package/data/build/dist/host/features/auth.d.ts.map +1 -0
- package/data/build/dist/host/features/auth.js +284 -0
- package/data/build/dist/host/features/auth.js.map +1 -0
- package/data/build/dist/host/features/credentials.d.ts +4 -0
- package/data/build/dist/host/features/credentials.d.ts.map +1 -0
- package/data/build/dist/host/features/credentials.js +90 -0
- package/data/build/dist/host/features/credentials.js.map +1 -0
- package/data/build/dist/host/features/debug.d.ts +5 -0
- package/data/build/dist/host/features/debug.d.ts.map +1 -0
- package/data/build/dist/host/features/debug.js +90 -0
- package/data/build/dist/host/features/debug.js.map +1 -0
- package/data/build/dist/host/features/file-management.d.ts +5 -0
- package/data/build/dist/host/features/file-management.d.ts.map +1 -0
- package/data/build/dist/host/features/file-management.js +282 -0
- package/data/build/dist/host/features/file-management.js.map +1 -0
- package/data/build/dist/host/features/git-commit-message.d.ts +5 -0
- package/data/build/dist/host/features/git-commit-message.d.ts.map +1 -0
- package/data/build/dist/host/features/git-commit-message.js +66 -0
- package/data/build/dist/host/features/git-commit-message.js.map +1 -0
- package/data/build/dist/host/features/git-management.d.ts +13 -0
- package/data/build/dist/host/features/git-management.d.ts.map +1 -0
- package/data/build/dist/host/features/git-management.js +576 -0
- package/data/build/dist/host/features/git-management.js.map +1 -0
- package/data/build/dist/host/features/host-status.d.ts +45 -0
- package/data/build/dist/host/features/host-status.d.ts.map +1 -0
- package/data/build/dist/host/features/host-status.js +122 -0
- package/data/build/dist/host/features/host-status.js.map +1 -0
- package/data/build/dist/host/features/index.d.ts +24 -0
- package/data/build/dist/host/features/index.d.ts.map +1 -0
- package/data/build/dist/host/features/index.js +46 -0
- package/data/build/dist/host/features/index.js.map +1 -0
- package/data/build/dist/host/features/interaction-translation.d.ts +10 -0
- package/data/build/dist/host/features/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/interaction-translation.js +222 -0
- package/data/build/dist/host/features/interaction-translation.js.map +1 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts +8 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts.map +1 -0
- package/data/build/dist/host/features/lan-access-dsh.js +129 -0
- package/data/build/dist/host/features/lan-access-dsh.js.map +1 -0
- package/data/build/dist/host/features/plugin-update.d.ts +6 -0
- package/data/build/dist/host/features/plugin-update.d.ts.map +1 -0
- package/data/build/dist/host/features/plugin-update.js +51 -0
- package/data/build/dist/host/features/plugin-update.js.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts +10 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.js +236 -0
- package/data/build/dist/host/features/session-prompt-translation.js.map +1 -0
- package/data/build/dist/host/features/session-title-optimization.d.ts +5 -0
- package/data/build/dist/host/features/session-title-optimization.d.ts.map +1 -0
- package/data/build/dist/host/features/session-title-optimization.js +32 -0
- package/data/build/dist/host/features/session-title-optimization.js.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts +26 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-protection.js +213 -0
- package/data/build/dist/host/features/session-translation-protection.js.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts +21 -0
- package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-recovery.js +123 -0
- package/data/build/dist/host/features/session-translation-recovery.js.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts +23 -0
- package/data/build/dist/host/features/session-translation-runtime.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-runtime.js +62 -0
- package/data/build/dist/host/features/session-translation-runtime.js.map +1 -0
- package/data/build/dist/host/features/session-translation-service.d.ts +66 -0
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation-service.js +664 -0
- package/data/build/dist/host/features/session-translation-service.js.map +1 -0
- package/data/build/dist/host/features/session-translation.d.ts +5 -0
- package/data/build/dist/host/features/session-translation.d.ts.map +1 -0
- package/data/build/dist/host/features/session-translation.js +45 -0
- package/data/build/dist/host/features/session-translation.js.map +1 -0
- package/data/build/dist/host/features/terminal-process.d.ts +5 -0
- package/data/build/dist/host/features/terminal-process.d.ts.map +1 -0
- package/data/build/dist/host/features/terminal-process.js +110 -0
- package/data/build/dist/host/features/terminal-process.js.map +1 -0
- package/data/build/dist/host/features/terminal-status.d.ts +20 -0
- package/data/build/dist/host/features/terminal-status.d.ts.map +1 -0
- package/data/build/dist/host/features/terminal-status.js +58 -0
- package/data/build/dist/host/features/terminal-status.js.map +1 -0
- package/data/build/dist/host/features/types.d.ts +65 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -0
- package/data/build/dist/host/features/types.js +2 -0
- package/data/build/dist/host/features/types.js.map +1 -0
- package/data/build/dist/host/host-config.d.ts +17 -0
- package/data/build/dist/host/host-config.d.ts.map +1 -0
- package/data/build/dist/host/host-config.js +13 -0
- package/data/build/dist/host/host-config.js.map +1 -0
- package/data/build/dist/host/host-event-bridge.d.ts +11 -0
- package/data/build/dist/host/host-event-bridge.d.ts.map +1 -0
- package/data/build/dist/host/host-event-bridge.js +16 -0
- package/data/build/dist/host/host-event-bridge.js.map +1 -0
- package/data/build/dist/host/html-workspace-files.d.ts +3 -0
- package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/host/html-workspace-files.js +135 -0
- package/data/build/dist/host/html-workspace-files.js.map +1 -0
- package/data/build/dist/host/image-artifact-store.d.ts +21 -0
- package/data/build/dist/host/image-artifact-store.d.ts.map +1 -0
- package/data/build/dist/host/image-artifact-store.js +136 -0
- package/data/build/dist/host/image-artifact-store.js.map +1 -0
- package/data/build/dist/host/index-injection.d.ts +35 -0
- package/data/build/dist/host/index-injection.d.ts.map +1 -0
- package/data/build/dist/host/index-injection.js +78 -0
- package/data/build/dist/host/index-injection.js.map +1 -0
- package/data/build/dist/host/index.d.ts +64 -0
- package/data/build/dist/host/index.d.ts.map +1 -0
- package/data/build/dist/host/index.js +446 -0
- package/data/build/dist/host/index.js.map +1 -0
- package/data/build/dist/host/lan-access-dsh.d.ts +192 -0
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -0
- package/data/build/dist/host/lan-access-dsh.js +1322 -0
- package/data/build/dist/host/lan-access-dsh.js.map +1 -0
- package/data/build/dist/host/login-attempt-guard.d.ts +55 -0
- package/data/build/dist/host/login-attempt-guard.d.ts.map +1 -0
- package/data/build/dist/host/login-attempt-guard.js +201 -0
- package/data/build/dist/host/login-attempt-guard.js.map +1 -0
- package/data/build/dist/host/modules/pwa/index.d.ts +7 -0
- package/data/build/dist/host/modules/pwa/index.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/index.js +7 -0
- package/data/build/dist/host/modules/pwa/index.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts +50 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.js +182 -0
- package/data/build/dist/host/modules/pwa/pwa-assets.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.d.ts +10 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.js +40 -0
- package/data/build/dist/host/modules/pwa/pwa-client-script.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.d.ts +10 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.js +185 -0
- package/data/build/dist/host/modules/pwa/pwa-icons.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-push.d.ts +74 -0
- package/data/build/dist/host/modules/pwa/pwa-push.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-push.js +288 -0
- package/data/build/dist/host/modules/pwa/pwa-push.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts +17 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js +83 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.d.ts +12 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.d.ts.map +1 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.js +47 -0
- package/data/build/dist/host/modules/pwa/pwa-viewport.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +215 -0
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -0
- package/data/build/dist/host/native-session-bridge.js +993 -0
- package/data/build/dist/host/native-session-bridge.js.map +1 -0
- package/data/build/dist/host/provider-icon-assets.d.ts +5 -0
- package/data/build/dist/host/provider-icon-assets.d.ts.map +1 -0
- package/data/build/dist/host/provider-icon-assets.js +61 -0
- package/data/build/dist/host/provider-icon-assets.js.map +1 -0
- package/data/build/dist/host/relay-tunnel-runtime.d.ts +130 -0
- package/data/build/dist/host/relay-tunnel-runtime.d.ts.map +1 -0
- package/data/build/dist/host/relay-tunnel-runtime.js +422 -0
- package/data/build/dist/host/relay-tunnel-runtime.js.map +1 -0
- package/data/build/dist/host/remote-web-runtime.d.ts +78 -0
- package/data/build/dist/host/remote-web-runtime.d.ts.map +1 -0
- package/data/build/dist/host/remote-web-runtime.js +607 -0
- package/data/build/dist/host/remote-web-runtime.js.map +1 -0
- package/data/build/dist/host/rpc-table.d.ts +32 -0
- package/data/build/dist/host/rpc-table.d.ts.map +1 -0
- package/data/build/dist/host/rpc-table.js +47 -0
- package/data/build/dist/host/rpc-table.js.map +1 -0
- package/data/build/dist/host/rpc.d.ts +43 -0
- package/data/build/dist/host/rpc.d.ts.map +1 -0
- package/data/build/dist/host/rpc.js +422 -0
- package/data/build/dist/host/rpc.js.map +1 -0
- package/data/build/dist/host/session-changes.d.ts +13 -0
- package/data/build/dist/host/session-changes.d.ts.map +1 -0
- package/data/build/dist/host/session-changes.js +374 -0
- package/data/build/dist/host/session-changes.js.map +1 -0
- package/data/build/dist/host/session-handle-eviction.d.ts +33 -0
- package/data/build/dist/host/session-handle-eviction.d.ts.map +1 -0
- package/data/build/dist/host/session-handle-eviction.js +429 -0
- package/data/build/dist/host/session-handle-eviction.js.map +1 -0
- package/data/build/dist/host/session-migration-repair.d.ts +23 -0
- package/data/build/dist/host/session-migration-repair.d.ts.map +1 -0
- package/data/build/dist/host/session-migration-repair.js +576 -0
- package/data/build/dist/host/session-migration-repair.js.map +1 -0
- package/data/build/dist/host/settings.d.ts +39 -0
- package/data/build/dist/host/settings.d.ts.map +1 -0
- package/data/build/dist/host/settings.js +352 -0
- package/data/build/dist/host/settings.js.map +1 -0
- package/data/build/dist/host/stage0-dev-hmr.d.ts +6 -0
- package/data/build/dist/host/stage0-dev-hmr.d.ts.map +1 -0
- package/data/build/dist/host/stage0-dev-hmr.js +20 -0
- package/data/build/dist/host/stage0-dev-hmr.js.map +1 -0
- package/data/build/dist/host/tar-archive.d.ts +8 -0
- package/data/build/dist/host/tar-archive.d.ts.map +1 -0
- package/data/build/dist/host/tar-archive.js +17 -0
- package/data/build/dist/host/tar-archive.js.map +1 -0
- package/data/build/dist/host/terminal/attachment-registry.d.ts +17 -0
- package/data/build/dist/host/terminal/attachment-registry.d.ts.map +1 -0
- package/data/build/dist/host/terminal/attachment-registry.js +49 -0
- package/data/build/dist/host/terminal/attachment-registry.js.map +1 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.d.ts +39 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.d.ts.map +1 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.js +160 -0
- package/data/build/dist/host/terminal/backends/conpty-backend.js.map +1 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts +36 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts.map +1 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js +192 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js.map +1 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +80 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts.map +1 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.js +467 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.js.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.d.ts +27 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.d.ts.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.js +154 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-client.js.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.d.ts +10 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.d.ts.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.js +147 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-process.js.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.d.ts +92 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.d.ts.map +1 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.js +134 -0
- package/data/build/dist/host/terminal/broker/conpty-broker-protocol.js.map +1 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts +42 -0
- package/data/build/dist/host/terminal/controller-factory.d.ts.map +1 -0
- package/data/build/dist/host/terminal/controller-factory.js +104 -0
- package/data/build/dist/host/terminal/controller-factory.js.map +1 -0
- package/data/build/dist/host/terminal/index.d.ts +17 -0
- package/data/build/dist/host/terminal/index.d.ts.map +1 -0
- package/data/build/dist/host/terminal/index.js +17 -0
- package/data/build/dist/host/terminal/index.js.map +1 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts +109 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts.map +1 -0
- package/data/build/dist/host/terminal/runtime-adapter.js +26 -0
- package/data/build/dist/host/terminal/runtime-adapter.js.map +1 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts +45 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts.map +1 -0
- package/data/build/dist/host/terminal/runtime-manager.js +270 -0
- package/data/build/dist/host/terminal/runtime-manager.js.map +1 -0
- package/data/build/dist/host/terminal/shell-detection.d.ts +23 -0
- package/data/build/dist/host/terminal/shell-detection.d.ts.map +1 -0
- package/data/build/dist/host/terminal/shell-detection.js +105 -0
- package/data/build/dist/host/terminal/shell-detection.js.map +1 -0
- package/data/build/dist/host/terminal/startup.d.ts +38 -0
- package/data/build/dist/host/terminal/startup.d.ts.map +1 -0
- package/data/build/dist/host/terminal/startup.js +102 -0
- package/data/build/dist/host/terminal/startup.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts +93 -0
- package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-controller.js +467 -0
- package/data/build/dist/host/terminal/terminal-controller.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-service.d.ts +52 -0
- package/data/build/dist/host/terminal/terminal-process-service.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-service.js +308 -0
- package/data/build/dist/host/terminal/terminal-process-service.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-store.d.ts +45 -0
- package/data/build/dist/host/terminal/terminal-process-store.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-process-store.js +183 -0
- package/data/build/dist/host/terminal/terminal-process-store.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-service.d.ts +150 -0
- package/data/build/dist/host/terminal/terminal-service.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-service.js +1171 -0
- package/data/build/dist/host/terminal/terminal-service.js.map +1 -0
- package/data/build/dist/host/terminal/terminal-store.d.ts +49 -0
- package/data/build/dist/host/terminal/terminal-store.d.ts.map +1 -0
- package/data/build/dist/host/terminal/terminal-store.js +242 -0
- package/data/build/dist/host/terminal/terminal-store.js.map +1 -0
- package/data/build/dist/host/update/application-result.d.ts +3 -0
- package/data/build/dist/host/update/application-result.d.ts.map +1 -0
- package/data/build/dist/host/update/application-result.js +13 -0
- package/data/build/dist/host/update/application-result.js.map +1 -0
- package/data/build/dist/host/update/http.d.ts +7 -0
- package/data/build/dist/host/update/http.d.ts.map +1 -0
- package/data/build/dist/host/update/http.js +55 -0
- package/data/build/dist/host/update/http.js.map +1 -0
- package/data/build/dist/host/update/metadata.d.ts +14 -0
- package/data/build/dist/host/update/metadata.d.ts.map +1 -0
- package/data/build/dist/host/update/metadata.js +75 -0
- package/data/build/dist/host/update/metadata.js.map +1 -0
- package/data/build/dist/host/update/release-notes.d.ts +6 -0
- package/data/build/dist/host/update/release-notes.d.ts.map +1 -0
- package/data/build/dist/host/update/release-notes.js +52 -0
- package/data/build/dist/host/update/release-notes.js.map +1 -0
- package/data/build/dist/host/update/service.d.ts +25 -0
- package/data/build/dist/host/update/service.d.ts.map +1 -0
- package/data/build/dist/host/update/service.js +209 -0
- package/data/build/dist/host/update/service.js.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.js +15 -0
- package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
- package/data/build/dist/host/workspace-root.d.ts +13 -0
- package/data/build/dist/host/workspace-root.d.ts.map +1 -0
- package/data/build/dist/host/workspace-root.js +98 -0
- package/data/build/dist/host/workspace-root.js.map +1 -0
- package/data/build/dist/index.d.ts +40 -0
- package/data/build/dist/index.d.ts.map +1 -0
- package/data/build/dist/index.js +31 -0
- package/data/build/dist/index.js.map +1 -0
- package/data/build/dist/shared/attachment-prompts.d.ts +11 -0
- package/data/build/dist/shared/attachment-prompts.d.ts.map +1 -0
- package/data/build/dist/shared/attachment-prompts.js +17 -0
- package/data/build/dist/shared/attachment-prompts.js.map +1 -0
- package/data/build/dist/shared/attachments.d.ts +18 -0
- package/data/build/dist/shared/attachments.d.ts.map +1 -0
- package/data/build/dist/shared/attachments.js +22 -0
- package/data/build/dist/shared/attachments.js.map +1 -0
- package/data/build/dist/shared/cli-provider-route.d.ts +7 -0
- package/data/build/dist/shared/cli-provider-route.d.ts.map +1 -0
- package/data/build/dist/shared/cli-provider-route.js +13 -0
- package/data/build/dist/shared/cli-provider-route.js.map +1 -0
- package/data/build/dist/shared/codex-performance.d.ts +3 -0
- package/data/build/dist/shared/codex-performance.d.ts.map +1 -0
- package/data/build/dist/shared/codex-performance.js +2 -0
- package/data/build/dist/shared/codex-performance.js.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts +14 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.js +51 -0
- package/data/build/dist/shared/contracts/agent-team.js.map +1 -0
- package/data/build/dist/shared/contracts/auth.d.ts +122 -0
- package/data/build/dist/shared/contracts/auth.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/auth.js +8 -0
- package/data/build/dist/shared/contracts/auth.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +484 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.js +2 -0
- package/data/build/dist/shared/contracts/cli-adapter.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts +29 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.js +2 -0
- package/data/build/dist/shared/contracts/cli-management.js.map +1 -0
- package/data/build/dist/shared/contracts/command-code.d.ts +5 -0
- package/data/build/dist/shared/contracts/command-code.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/command-code.js +2 -0
- package/data/build/dist/shared/contracts/command-code.js.map +1 -0
- package/data/build/dist/shared/contracts/config.d.ts +363 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/config.js +302 -0
- package/data/build/dist/shared/contracts/config.js.map +1 -0
- package/data/build/dist/shared/contracts/credentials.d.ts +73 -0
- package/data/build/dist/shared/contracts/credentials.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/credentials.js +38 -0
- package/data/build/dist/shared/contracts/credentials.js.map +1 -0
- package/data/build/dist/shared/contracts/debug-config.d.ts +28 -0
- package/data/build/dist/shared/contracts/debug-config.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/debug-config.js +78 -0
- package/data/build/dist/shared/contracts/debug-config.js.map +1 -0
- package/data/build/dist/shared/contracts/debug.d.ts +75 -0
- package/data/build/dist/shared/contracts/debug.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/debug.js +121 -0
- package/data/build/dist/shared/contracts/debug.js.map +1 -0
- package/data/build/dist/shared/contracts/dsh-device.d.ts +86 -0
- package/data/build/dist/shared/contracts/dsh-device.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/dsh-device.js +2 -0
- package/data/build/dist/shared/contracts/dsh-device.js.map +1 -0
- package/data/build/dist/shared/contracts/errors.d.ts +30 -0
- package/data/build/dist/shared/contracts/errors.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/errors.js +38 -0
- package/data/build/dist/shared/contracts/errors.js.map +1 -0
- package/data/build/dist/shared/contracts/feature.d.ts +93 -0
- package/data/build/dist/shared/contracts/feature.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/feature.js +2 -0
- package/data/build/dist/shared/contracts/feature.js.map +1 -0
- package/data/build/dist/shared/contracts/file-management.d.ts +6 -0
- package/data/build/dist/shared/contracts/file-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/file-management.js +3 -0
- package/data/build/dist/shared/contracts/file-management.js.map +1 -0
- package/data/build/dist/shared/contracts/git.d.ts +129 -0
- package/data/build/dist/shared/contracts/git.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/git.js +29 -0
- package/data/build/dist/shared/contracts/git.js.map +1 -0
- package/data/build/dist/shared/contracts/host-status.d.ts +32 -0
- package/data/build/dist/shared/contracts/host-status.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/host-status.js +2 -0
- package/data/build/dist/shared/contracts/host-status.js.map +1 -0
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts +32 -0
- package/data/build/dist/shared/contracts/interaction-presentation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js +2 -0
- package/data/build/dist/shared/contracts/interaction-presentation.js.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts +55 -0
- package/data/build/dist/shared/contracts/interaction-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/interaction-translation.js +48 -0
- package/data/build/dist/shared/contracts/interaction-translation.js.map +1 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.d.ts +53 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.js +2 -0
- package/data/build/dist/shared/contracts/lan-access-dsh.js.map +1 -0
- package/data/build/dist/shared/contracts/llm-chat.d.ts +18 -0
- package/data/build/dist/shared/contracts/llm-chat.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/llm-chat.js +2 -0
- package/data/build/dist/shared/contracts/llm-chat.js.map +1 -0
- package/data/build/dist/shared/contracts/plugin-update.d.ts +93 -0
- package/data/build/dist/shared/contracts/plugin-update.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/plugin-update.js +128 -0
- package/data/build/dist/shared/contracts/plugin-update.js.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts +135 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.js +195 -0
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -0
- package/data/build/dist/shared/contracts/signaling.d.ts +67 -0
- package/data/build/dist/shared/contracts/signaling.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/signaling.js +2 -0
- package/data/build/dist/shared/contracts/signaling.js.map +1 -0
- package/data/build/dist/shared/contracts/subscription.d.ts +206 -0
- package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/subscription.js +15 -0
- package/data/build/dist/shared/contracts/subscription.js.map +1 -0
- package/data/build/dist/shared/contracts/terminal-process.d.ts +65 -0
- package/data/build/dist/shared/contracts/terminal-process.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal-process.js +2 -0
- package/data/build/dist/shared/contracts/terminal-process.js.map +1 -0
- package/data/build/dist/shared/contracts/terminal-share.d.ts +27 -0
- package/data/build/dist/shared/contracts/terminal-share.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal-share.js +2 -0
- package/data/build/dist/shared/contracts/terminal-share.js.map +1 -0
- package/data/build/dist/shared/contracts/terminal.d.ts +141 -0
- package/data/build/dist/shared/contracts/terminal.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/terminal.js +2 -0
- package/data/build/dist/shared/contracts/terminal.js.map +1 -0
- package/data/build/dist/shared/contracts/transport.d.ts +45 -0
- package/data/build/dist/shared/contracts/transport.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/transport.js +3 -0
- package/data/build/dist/shared/contracts/transport.js.map +1 -0
- package/data/build/dist/shared/contracts/version.d.ts +25 -0
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/version.js +89 -0
- package/data/build/dist/shared/contracts/version.js.map +1 -0
- package/data/build/dist/shared/credential-carrier.d.ts +19 -0
- package/data/build/dist/shared/credential-carrier.d.ts.map +1 -0
- package/data/build/dist/shared/credential-carrier.js +90 -0
- package/data/build/dist/shared/credential-carrier.js.map +1 -0
- package/data/build/dist/shared/debug.d.ts +22 -0
- package/data/build/dist/shared/debug.d.ts.map +1 -0
- package/data/build/dist/shared/debug.js +89 -0
- package/data/build/dist/shared/debug.js.map +1 -0
- package/data/build/dist/shared/delegation-carrier.d.ts +24 -0
- package/data/build/dist/shared/delegation-carrier.d.ts.map +1 -0
- package/data/build/dist/shared/delegation-carrier.js +111 -0
- package/data/build/dist/shared/delegation-carrier.js.map +1 -0
- package/data/build/dist/shared/index.d.ts +29 -0
- package/data/build/dist/shared/index.d.ts.map +1 -0
- package/data/build/dist/shared/index.js +13 -0
- package/data/build/dist/shared/index.js.map +1 -0
- package/data/build/dist/shared/native-approval-modes.d.ts +7 -0
- package/data/build/dist/shared/native-approval-modes.d.ts.map +1 -0
- package/data/build/dist/shared/native-approval-modes.js +38 -0
- package/data/build/dist/shared/native-approval-modes.js.map +1 -0
- package/data/build/dist/shared/provider-icon-resources.d.ts +4 -0
- package/data/build/dist/shared/provider-icon-resources.d.ts.map +1 -0
- package/data/build/dist/shared/provider-icon-resources.js +25 -0
- package/data/build/dist/shared/provider-icon-resources.js.map +1 -0
- package/data/build/dist/shared/request-performance.d.ts +20 -0
- package/data/build/dist/shared/request-performance.d.ts.map +1 -0
- package/data/build/dist/shared/request-performance.js +6 -0
- package/data/build/dist/shared/request-performance.js.map +1 -0
- package/data/build/dist/shared/runtime-environment.d.ts +5 -0
- package/data/build/dist/shared/runtime-environment.d.ts.map +1 -0
- package/data/build/dist/shared/runtime-environment.js +7 -0
- package/data/build/dist/shared/runtime-environment.js.map +1 -0
- package/data/build/dist/shared/session-file-location.d.ts +11 -0
- package/data/build/dist/shared/session-file-location.d.ts.map +1 -0
- package/data/build/dist/shared/session-file-location.js +20 -0
- package/data/build/dist/shared/session-file-location.js.map +1 -0
- package/data/build/dist/shared/session-reference.d.ts +9 -0
- package/data/build/dist/shared/session-reference.d.ts.map +1 -0
- package/data/build/dist/shared/session-reference.js +27 -0
- package/data/build/dist/shared/session-reference.js.map +1 -0
- package/data/build/dist/shared/session-title.d.ts +12 -0
- package/data/build/dist/shared/session-title.d.ts.map +1 -0
- package/data/build/dist/shared/session-title.js +71 -0
- package/data/build/dist/shared/session-title.js.map +1 -0
- package/data/build/dist/shared/terminal-input.d.ts +8 -0
- package/data/build/dist/shared/terminal-input.d.ts.map +1 -0
- package/data/build/dist/shared/terminal-input.js +10 -0
- package/data/build/dist/shared/terminal-input.js.map +1 -0
- package/data/build/dist/shared/translation-effect.d.ts +8 -0
- package/data/build/dist/shared/translation-effect.d.ts.map +1 -0
- package/data/build/dist/shared/translation-effect.js +24 -0
- package/data/build/dist/shared/translation-effect.js.map +1 -0
- package/data/build/dist/shared/translation-indicator.d.ts +26 -0
- package/data/build/dist/shared/translation-indicator.d.ts.map +1 -0
- package/data/build/dist/shared/translation-indicator.js +29 -0
- package/data/build/dist/shared/translation-indicator.js.map +1 -0
- package/data/build/dist/transport/carrier.d.ts +48 -0
- package/data/build/dist/transport/carrier.d.ts.map +1 -0
- package/data/build/dist/transport/carrier.js +319 -0
- package/data/build/dist/transport/carrier.js.map +1 -0
- package/data/build/dist/transport/debug.d.ts +39 -0
- package/data/build/dist/transport/debug.d.ts.map +1 -0
- package/data/build/dist/transport/debug.js +97 -0
- package/data/build/dist/transport/debug.js.map +1 -0
- package/data/build/dist/transport/dsh-envelope.d.ts +41 -0
- package/data/build/dist/transport/dsh-envelope.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-envelope.js +107 -0
- package/data/build/dist/transport/dsh-envelope.js.map +1 -0
- package/data/build/dist/transport/dsh-gateway.d.ts +64 -0
- package/data/build/dist/transport/dsh-gateway.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-gateway.js +254 -0
- package/data/build/dist/transport/dsh-gateway.js.map +1 -0
- package/data/build/dist/transport/dsh-session.d.ts +72 -0
- package/data/build/dist/transport/dsh-session.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-session.js +291 -0
- package/data/build/dist/transport/dsh-session.js.map +1 -0
- package/data/build/dist/transport/dsh-transport.d.ts +59 -0
- package/data/build/dist/transport/dsh-transport.d.ts.map +1 -0
- package/data/build/dist/transport/dsh-transport.js +136 -0
- package/data/build/dist/transport/dsh-transport.js.map +1 -0
- package/data/build/dist/transport/frame.d.ts +132 -0
- package/data/build/dist/transport/frame.d.ts.map +1 -0
- package/data/build/dist/transport/frame.js +168 -0
- package/data/build/dist/transport/frame.js.map +1 -0
- package/data/build/dist/transport/index.d.ts +11 -0
- package/data/build/dist/transport/index.d.ts.map +1 -0
- package/data/build/dist/transport/index.js +11 -0
- package/data/build/dist/transport/index.js.map +1 -0
- package/data/build/dist/transport/multiplexer.d.ts +63 -0
- package/data/build/dist/transport/multiplexer.d.ts.map +1 -0
- package/data/build/dist/transport/multiplexer.js +323 -0
- package/data/build/dist/transport/multiplexer.js.map +1 -0
- package/data/build/dist/transport/webrtc-client.d.ts +75 -0
- package/data/build/dist/transport/webrtc-client.d.ts.map +1 -0
- package/data/build/dist/transport/webrtc-client.js +382 -0
- package/data/build/dist/transport/webrtc-client.js.map +1 -0
- package/data/build/dist/transport/webrtc-host.d.ts +60 -0
- package/data/build/dist/transport/webrtc-host.d.ts.map +1 -0
- package/data/build/dist/transport/webrtc-host.js +259 -0
- package/data/build/dist/transport/webrtc-host.js.map +1 -0
- package/data/build/dist/typert.host.d.ts +25 -0
- package/data/build/dist/typert.host.d.ts.map +1 -0
- package/data/build/dist/typert.host.js +155 -0
- package/data/build/dist/typert.host.js.map +1 -0
- package/data/build/dist/typert.remote-client.d.ts +11 -0
- package/data/build/dist/typert.remote-client.d.ts.map +1 -0
- package/data/build/dist/typert.remote-client.js +7 -0
- package/data/build/dist/typert.remote-client.js.map +1 -0
- package/dsh.bundle.patch +23 -0
- package/package.json +227 -4
- package/profile/README.md +43 -0
- package/profile/cordis.patch.yml +2 -0
- package/profile/package.json +25 -0
- package/profile/scripts/check-dsh-install.mjs +126 -0
- package/profile/version.json +5 -0
- package/scripts/check-dsh-install.mjs +128 -0
- package/version.json +6 -0
|
@@ -0,0 +1,1616 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
import { identifyModelProvider, MODEL_PROVIDER_DEFINITIONS, normalizeProviderBaseUrl, thirdPartyProvider } from './provider-registry.js';
|
|
7
|
+
import { OfficialProviderSubscriptionService } from './official-provider-subscription.js';
|
|
8
|
+
import { ZcodeSubscriptionService } from './zcode-subscription.js';
|
|
9
|
+
import { JsonRpcProcess, JsonRpcRequestError } from './json-rpc-process.js';
|
|
10
|
+
import { detectBinary } from './rpc-driver-utils.js';
|
|
11
|
+
import { QoderSubscriptionService } from './qoder-subscription.js';
|
|
12
|
+
import { NewApiSubscriptionService, isOfficialAgentBaseUrl } from './new-api-subscription.js';
|
|
13
|
+
import { CodeBuddySubscriptionService } from './codebuddy-subscription.js';
|
|
14
|
+
import { AntigravitySubscriptionService } from './antigravity-subscription.js';
|
|
15
|
+
import { CustomUpstreamClassifier, mergeCustomUpstreamCandidates } from './custom-upstream-classifier.js';
|
|
16
|
+
import { readDshDefaultProvider, readDshProviderSource } from './dsh-config.js';
|
|
17
|
+
import { readZcodeProviderConfigsAsync, readPreferredZcodeProviderConfig } from './zcode-provider-config.js';
|
|
18
|
+
import { R4SubscriptionService, isR4Source } from './r4-subscription.js';
|
|
19
|
+
/** 统一读取 Codex、Claude Code、OpenCode 订阅摘要。所有原始凭据都留在 Host。 */
|
|
20
|
+
export class ProviderSubscriptionService {
|
|
21
|
+
commandCode;
|
|
22
|
+
codex;
|
|
23
|
+
claudeCode;
|
|
24
|
+
opencode;
|
|
25
|
+
sub2api;
|
|
26
|
+
newApi;
|
|
27
|
+
customUpstreamClassifier;
|
|
28
|
+
deepseek;
|
|
29
|
+
official;
|
|
30
|
+
r4;
|
|
31
|
+
kimi;
|
|
32
|
+
grok;
|
|
33
|
+
zcode;
|
|
34
|
+
qoder;
|
|
35
|
+
qoderCn;
|
|
36
|
+
codebuddy;
|
|
37
|
+
antigravity;
|
|
38
|
+
zcodeProviderOptions;
|
|
39
|
+
constructor(options = {}) {
|
|
40
|
+
// 全局超时只作为缺省值;单项服务显式给出的 timeoutMs 优先。
|
|
41
|
+
const shared = options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs };
|
|
42
|
+
this.commandCode = options.commandCode;
|
|
43
|
+
this.codex = new CodexSubscriptionService({ ...shared, ...options.codex });
|
|
44
|
+
this.claudeCode = new ClaudeCodeSubscriptionService({ ...shared, ...options.claudeCode });
|
|
45
|
+
this.opencode = new OpenCodeSubscriptionService(options.opencode);
|
|
46
|
+
this.sub2api = new Sub2ApiUsageService({ ...shared, ...options.sub2api });
|
|
47
|
+
this.newApi = new NewApiSubscriptionService({ ...shared, ...options.newApi });
|
|
48
|
+
this.customUpstreamClassifier = new CustomUpstreamClassifier(options.customUpstream);
|
|
49
|
+
this.deepseek = new DeepseekSubscriptionService({ ...shared, ...options.deepseek });
|
|
50
|
+
this.official = new OfficialProviderSubscriptionService({ ...shared, ...options.official });
|
|
51
|
+
this.r4 = new R4SubscriptionService({ ...shared, ...options.r4 });
|
|
52
|
+
this.kimi = new KimiSubscriptionService({ ...shared, ...options.kimi });
|
|
53
|
+
this.grok = new GrokSubscriptionService({ ...shared, ...options.grok });
|
|
54
|
+
this.zcode = new ZcodeSubscriptionService({ ...shared, ...options.zcode });
|
|
55
|
+
this.zcodeProviderOptions = options.zcode ?? {};
|
|
56
|
+
this.qoder = new QoderSubscriptionService({ ...shared, variant: 'qoder', ...options.qoder });
|
|
57
|
+
this.qoderCn = new QoderSubscriptionService({ ...shared, variant: 'qoder-cn', ...options.qoderCn });
|
|
58
|
+
this.codebuddy = new CodeBuddySubscriptionService({ ...shared, ...options.codebuddy });
|
|
59
|
+
this.antigravity = new AntigravitySubscriptionService({ ...shared, ...options.antigravity });
|
|
60
|
+
}
|
|
61
|
+
read(adapterId, providerId, modelId) {
|
|
62
|
+
if (adapterId === 'codebuddy-cn')
|
|
63
|
+
adapterId = 'codebuddy';
|
|
64
|
+
if (adapterId === 'dsh')
|
|
65
|
+
return this.readDsh(providerId);
|
|
66
|
+
if (adapterId === 'qoder')
|
|
67
|
+
return this.qoder.read();
|
|
68
|
+
if (adapterId === 'qoder-cn')
|
|
69
|
+
return this.qoderCn.read();
|
|
70
|
+
// Antigravity 没有自定义上游入口,始终读官方账户余量;模型决定 Gemini 与
|
|
71
|
+
// Claude/GPT 两个独立配额组里读哪一组。
|
|
72
|
+
if (adapterId === 'antigravity')
|
|
73
|
+
return this.antigravity.read({ modelId });
|
|
74
|
+
if (adapterId === 'zcode')
|
|
75
|
+
return this.readZcode(providerId, modelId);
|
|
76
|
+
// Grok Build 的 OAuth 登录代表官方 SuperGrok 订阅,即使本机同时保留了
|
|
77
|
+
// GROK_BASE_URL/XAI_BASE_URL 之类的自定义上游配置,也必须先展示官方订阅窗口。
|
|
78
|
+
// 否则自定义上游只要能返回余额,就会在官方读取器执行前截获结果。
|
|
79
|
+
if (adapterId === 'grok')
|
|
80
|
+
return this.readGrokFirst(providerId);
|
|
81
|
+
if (adapterId === 'codex' || adapterId === 'claude-code' || adapterId === 'opencode' || adapterId === 'command-code' || adapterId === 'codebuddy' || adapterId === 'workbuddy') {
|
|
82
|
+
return this.readSub2ApiFirst(adapterId, providerId);
|
|
83
|
+
}
|
|
84
|
+
switch (adapterId) {
|
|
85
|
+
case 'kimi': return this.kimi.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'kimi-coding' }), ''));
|
|
86
|
+
default: return Promise.resolve(null);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** 消耗一次官方订阅重置;仅官方 Codex 订阅支持,第三方上游必须显式拒绝。 */
|
|
90
|
+
async reset(adapterId, providerId) {
|
|
91
|
+
if (adapterId !== 'codex')
|
|
92
|
+
throw new Error('当前 Agent 不支持重置订阅');
|
|
93
|
+
if (this.sub2api.hasThirdPartySource(adapterId, providerId) || this.newApi.hasSource(adapterId, providerId)) {
|
|
94
|
+
throw new Error('Codex 正在使用第三方上游,无法重置官方订阅');
|
|
95
|
+
}
|
|
96
|
+
return this.codex.reset();
|
|
97
|
+
}
|
|
98
|
+
async readDsh(providerId) {
|
|
99
|
+
const currentProviderId = providerId ?? resolveDshDefaultProvider();
|
|
100
|
+
const configuredSource = resolveDshProviderSource(currentProviderId);
|
|
101
|
+
if (configuredSource !== null && isR4Source(configuredSource))
|
|
102
|
+
return this.r4.read(configuredSource);
|
|
103
|
+
const matchedProvider = identifyModelProvider({ name: currentProviderId, baseUrl: configuredSource?.baseUrl });
|
|
104
|
+
if (matchedProvider?.reader === 'openrouter-balance' || matchedProvider?.reader === 'minimax-usage' || matchedProvider?.reader === 'zai-usage' || matchedProvider?.reader === 'github-copilot-usage') {
|
|
105
|
+
return this.official.read(currentProviderId, configuredSource);
|
|
106
|
+
}
|
|
107
|
+
if (matchedProvider?.reader === 'deepseek-balance' && isOfficialDeepseekSource(currentProviderId, configuredSource))
|
|
108
|
+
return this.deepseek.read(configuredSource ?? undefined);
|
|
109
|
+
const customUpstream = !isOfficialDeepseekSource(currentProviderId, configuredSource)
|
|
110
|
+
? await this.readCustomUpstream('dsh', currentProviderId)
|
|
111
|
+
: null;
|
|
112
|
+
if (customUpstream !== null)
|
|
113
|
+
return customUpstream.usage;
|
|
114
|
+
if (matchedProvider?.reader === 'sub2api')
|
|
115
|
+
return null;
|
|
116
|
+
// 已识别的官方提供商但没有可用读取器时,不尝试把官方 API 当成 Sub2API。
|
|
117
|
+
if (matchedProvider !== undefined && configuredSource !== null)
|
|
118
|
+
return null;
|
|
119
|
+
if (isThirdPartyDeepseekProvider(currentProviderId))
|
|
120
|
+
return null;
|
|
121
|
+
// 没有第三方来源时才允许读取官方 DeepSeek 余额。
|
|
122
|
+
const official = await this.deepseek.read();
|
|
123
|
+
return official === null || matchedProvider === undefined ? official : withProvider(official, matchedProvider, configuredSource?.baseUrl);
|
|
124
|
+
}
|
|
125
|
+
async readSub2ApiFirst(adapterId, providerId) {
|
|
126
|
+
// 统一分类后只调用一个读取器;已分类来源临时失败时不切换协议。
|
|
127
|
+
const customUpstream = await this.readCustomUpstream(adapterId, providerId);
|
|
128
|
+
if (customUpstream !== null)
|
|
129
|
+
return customUpstream.usage;
|
|
130
|
+
if (adapterId === 'codex')
|
|
131
|
+
return this.codex.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'openai-codex' }), ''));
|
|
132
|
+
if (adapterId === 'claude-code')
|
|
133
|
+
return this.claudeCode.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'anthropic' }), ''));
|
|
134
|
+
if (adapterId === 'grok')
|
|
135
|
+
return this.grok.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'xai' }), ''));
|
|
136
|
+
if (adapterId === 'command-code')
|
|
137
|
+
return this.commandCode?.read() ?? null;
|
|
138
|
+
if (adapterId === 'codebuddy' || adapterId === 'workbuddy')
|
|
139
|
+
return this.codebuddy.read(adapterId);
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
async readGrokFirst(providerId) {
|
|
143
|
+
// R4 按来源域名识别,不能先被本机 Grok OAuth 读取器短路;其它自定义来源仍保持
|
|
144
|
+
// 官方 Grok 订阅优先,避免自定义余额覆盖 SuperGrok 订阅。
|
|
145
|
+
const r4Source = this.resolveR4Source('grok', providerId);
|
|
146
|
+
if (r4Source !== undefined)
|
|
147
|
+
return this.r4.read(r4Source);
|
|
148
|
+
const official = await this.grok.read();
|
|
149
|
+
if (official !== null)
|
|
150
|
+
return withProvider(official, identifyModelProvider({ name: 'xai' }), '');
|
|
151
|
+
return (await this.readCustomUpstream('grok', providerId))?.usage ?? null;
|
|
152
|
+
}
|
|
153
|
+
resolveR4Source(adapterId, providerId, discoveredSources) {
|
|
154
|
+
return this.resolveCustomUpstreamCandidates(adapterId, providerId, discoveredSources)
|
|
155
|
+
.find((candidate) => isR4Source(candidate.source))?.source;
|
|
156
|
+
}
|
|
157
|
+
/** 余额属于当前模型的原生 Provider,不能用其它账号或 Start Plan 冒充。 */
|
|
158
|
+
async readZcode(providerId, modelId) {
|
|
159
|
+
const slash = modelId?.indexOf('/') ?? -1;
|
|
160
|
+
let selectedId = slash > 0 ? modelId.slice(0, slash)
|
|
161
|
+
: providerId !== 'zcode' ? providerId : undefined;
|
|
162
|
+
const explicitlyConfigured = this.newApi.hasConfiguredSource('zcode', selectedId)
|
|
163
|
+
|| this.sub2api.hasConfiguredSource('zcode', selectedId);
|
|
164
|
+
if (explicitlyConfigured)
|
|
165
|
+
return (await this.readCustomUpstream('zcode', selectedId))?.usage ?? null;
|
|
166
|
+
if (selectedId === undefined)
|
|
167
|
+
selectedId = (await readPreferredZcodeProviderConfig(this.zcodeProviderOptions))?.providerId;
|
|
168
|
+
if (selectedId === undefined)
|
|
169
|
+
return this.zcode.read();
|
|
170
|
+
const provider = (await readZcodeProviderConfigsAsync(selectedId, this.zcodeProviderOptions))[0];
|
|
171
|
+
if (provider === undefined)
|
|
172
|
+
return null;
|
|
173
|
+
if (provider.accessMode === 'start-plan' || provider.accessMode === 'off-peak')
|
|
174
|
+
return this.zcode.read();
|
|
175
|
+
const source = provider.source;
|
|
176
|
+
if (source === null)
|
|
177
|
+
return null;
|
|
178
|
+
if (isR4Source(source))
|
|
179
|
+
return this.r4.read(source);
|
|
180
|
+
const origin = normalizeProviderBaseUrl(source.baseUrl);
|
|
181
|
+
const matched = identifyModelProvider({ name: selectedId, baseUrl: source.baseUrl })
|
|
182
|
+
?? MODEL_PROVIDER_DEFINITIONS.find((definition) => definition.officialHosts.some((host) => origin === `https://${host}`));
|
|
183
|
+
if (matched?.reader === 'deepseek-balance')
|
|
184
|
+
return this.deepseek.read(source);
|
|
185
|
+
if (matched?.reader === 'openrouter-balance' || matched?.reader === 'minimax-usage' || matched?.reader === 'zai-usage' || matched?.reader === 'github-copilot-usage') {
|
|
186
|
+
return this.official.read(matched.id, source);
|
|
187
|
+
}
|
|
188
|
+
if (isOfficialAgentBaseUrl('zcode', source.baseUrl) || matched !== undefined && matched.reader !== 'sub2api')
|
|
189
|
+
return null;
|
|
190
|
+
return (await this.readCustomUpstream('zcode', selectedId, [source]))?.usage ?? null;
|
|
191
|
+
}
|
|
192
|
+
async readCustomUpstream(adapterId, providerId, discoveredSources) {
|
|
193
|
+
const candidates = this.resolveCustomUpstreamCandidates(adapterId, providerId, discoveredSources);
|
|
194
|
+
if (candidates.length === 0)
|
|
195
|
+
return null;
|
|
196
|
+
const r4Source = candidates.find((candidate) => isR4Source(candidate.source))?.source;
|
|
197
|
+
if (r4Source !== undefined)
|
|
198
|
+
return { usage: await this.r4.read(r4Source) };
|
|
199
|
+
return this.customUpstreamClassifier.read(adapterId, providerId, candidates, {
|
|
200
|
+
newApi: (source) => this.newApi.readWithKind(adapterId, providerId, source),
|
|
201
|
+
sub2api: (source) => this.sub2api.readWithKind(adapterId, providerId, source),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
resolveCustomUpstreamCandidates(adapterId, providerId, discoveredSources) {
|
|
205
|
+
const newApiConfigured = this.newApi.hasConfiguredSource(adapterId, providerId);
|
|
206
|
+
const sub2apiConfigured = this.sub2api.hasConfiguredSource(adapterId, providerId);
|
|
207
|
+
// 只要一侧有显式来源,就不把另一侧从本机环境自动发现的无关来源混进来。
|
|
208
|
+
// 两侧都没有显式来源时,才同时使用各自的 Agent 配置自动发现结果。
|
|
209
|
+
const newApiSources = discoveredSources ?? (sub2apiConfigured && !newApiConfigured ? [] : this.newApi.resolveSources(adapterId, providerId));
|
|
210
|
+
const sub2apiSources = (discoveredSources ?? (newApiConfigured && !sub2apiConfigured ? [] : this.sub2api.resolveSources(adapterId, providerId)))
|
|
211
|
+
.filter((source) => !isOfficialAgentBaseUrl(adapterId, source.baseUrl));
|
|
212
|
+
// 同一自定义来源的协议不能由配置项名称预先决定:一个 Agent 的配置文件
|
|
213
|
+
// 可能实际接入 New-API,也可能接入 Sub2API。统一分类器需要对每个候选
|
|
214
|
+
// 同时做两侧协议探测,再缓存最终分类,才能覆盖所有支持自定义 Provider
|
|
215
|
+
// 的适配器(尤其是 Command Code、ZCode、CodeBuddy 和 WorkBuddy)。
|
|
216
|
+
return mergeCustomUpstreamCandidates(newApiSources, sub2apiSources).map((candidate) => ({
|
|
217
|
+
...candidate,
|
|
218
|
+
newApi: true,
|
|
219
|
+
sub2api: true,
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** 读取官方 DeepSeek API 的余额;凭据只在 Host 内使用。 */
|
|
224
|
+
export class DeepseekSubscriptionService {
|
|
225
|
+
request;
|
|
226
|
+
timeoutMs;
|
|
227
|
+
configuredSources;
|
|
228
|
+
constructor(options = {}) {
|
|
229
|
+
this.request = options.fetch ?? fetch;
|
|
230
|
+
this.timeoutMs = options.timeoutMs ?? 8_000;
|
|
231
|
+
this.configuredSources = options.sources;
|
|
232
|
+
}
|
|
233
|
+
async read(source) {
|
|
234
|
+
const sources = source === undefined ? (this.configuredSources ?? resolveDeepseekSources()) : [source];
|
|
235
|
+
for (const candidate of sources) {
|
|
236
|
+
if (!isOfficialDeepseekUrl(candidate.baseUrl))
|
|
237
|
+
continue;
|
|
238
|
+
const result = await this.readSource(candidate);
|
|
239
|
+
if (result !== null)
|
|
240
|
+
return result;
|
|
241
|
+
}
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
async readSource(source) {
|
|
245
|
+
const baseUrl = deepseekApiRoot(source.baseUrl);
|
|
246
|
+
if (baseUrl === '' || source.apiKey.trim() === '')
|
|
247
|
+
return null;
|
|
248
|
+
const controller = new AbortController();
|
|
249
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
250
|
+
try {
|
|
251
|
+
const response = await this.request(`${baseUrl}/user/balance`, {
|
|
252
|
+
headers: {
|
|
253
|
+
Authorization: source.apiKey.trim().startsWith('Bearer ') ? source.apiKey.trim() : `Bearer ${source.apiKey.trim()}`,
|
|
254
|
+
Accept: 'application/json',
|
|
255
|
+
},
|
|
256
|
+
signal: controller.signal,
|
|
257
|
+
});
|
|
258
|
+
if (!response.ok)
|
|
259
|
+
return null;
|
|
260
|
+
const usage = normalizeDeepseekUsage(await response.json(), baseUrl);
|
|
261
|
+
if (usage === null)
|
|
262
|
+
return null;
|
|
263
|
+
return {
|
|
264
|
+
authenticated: true,
|
|
265
|
+
planType: null,
|
|
266
|
+
primary: null,
|
|
267
|
+
secondary: null,
|
|
268
|
+
monthly: null,
|
|
269
|
+
rateLimitReachedType: null,
|
|
270
|
+
resetCredits: null,
|
|
271
|
+
capturedAt: new Date().toISOString(),
|
|
272
|
+
provider: providerSummary(identifyModelProvider({ name: 'deepseek', baseUrl }), baseUrl, await readLogoDataUrl(identifyModelProvider({ name: 'deepseek', baseUrl })?.logoUrl ?? '', this.request, this.timeoutMs)),
|
|
273
|
+
deepseek: usage,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
finally {
|
|
280
|
+
clearTimeout(timer);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/** 通过 Provider 的上游 base URL 检测 Sub2API;只返回脱敏后的统计摘要。 */
|
|
285
|
+
export class Sub2ApiUsageService {
|
|
286
|
+
request;
|
|
287
|
+
timeoutMs;
|
|
288
|
+
configuredSources;
|
|
289
|
+
constructor(options = {}) {
|
|
290
|
+
this.request = options.fetch ?? fetch;
|
|
291
|
+
this.timeoutMs = options.timeoutMs ?? 8_000;
|
|
292
|
+
this.configuredSources = options.sources;
|
|
293
|
+
}
|
|
294
|
+
hasSource(adapterId, providerId) {
|
|
295
|
+
const configured = this.configuredSource(adapterId, providerId);
|
|
296
|
+
if (configured !== undefined)
|
|
297
|
+
return Array.isArray(configured) ? configured.length > 0 : true;
|
|
298
|
+
return resolveSub2ApiSources(adapterId, providerId).length > 0;
|
|
299
|
+
}
|
|
300
|
+
/** 判断当前来源是否由调用方显式注入;用于隔离本机自动发现的其它来源。 */
|
|
301
|
+
hasConfiguredSource(adapterId, providerId) {
|
|
302
|
+
if (this.configuredSources === undefined)
|
|
303
|
+
return false;
|
|
304
|
+
return (providerId !== undefined && this.configuredSources[providerId] !== undefined)
|
|
305
|
+
|| this.configuredSources[adapterId] !== undefined;
|
|
306
|
+
}
|
|
307
|
+
resolveSources(adapterId, providerId) {
|
|
308
|
+
const configured = this.configuredSource(adapterId, providerId);
|
|
309
|
+
const single = configured;
|
|
310
|
+
return configured === undefined
|
|
311
|
+
? resolveSub2ApiSources(adapterId, providerId)
|
|
312
|
+
: Array.isArray(configured) ? [...configured] : single === undefined ? [] : [single];
|
|
313
|
+
}
|
|
314
|
+
/** 只判断是否存在第三方上游;官方 Codex/Claude 源必须允许回退原生订阅读取器。 */
|
|
315
|
+
hasThirdPartySource(adapterId, providerId) {
|
|
316
|
+
const configured = this.configuredSource(adapterId, providerId);
|
|
317
|
+
const sources = configured === undefined
|
|
318
|
+
? resolveSub2ApiSources(adapterId, providerId)
|
|
319
|
+
: Array.isArray(configured) ? configured : [configured];
|
|
320
|
+
return sources.some((source) => !isOfficialAgentSource(adapterId, source));
|
|
321
|
+
}
|
|
322
|
+
async read(adapterId, providerId, source) {
|
|
323
|
+
const result = await this.readWithKind(adapterId, providerId, source);
|
|
324
|
+
return result?.usage ?? null;
|
|
325
|
+
}
|
|
326
|
+
async readWithKind(adapterId, providerId, source) {
|
|
327
|
+
const sources = source === undefined ? this.resolveSources(adapterId, providerId) : [source];
|
|
328
|
+
for (const source of sources) {
|
|
329
|
+
const result = await this.readSourceWithKind(source, providerId);
|
|
330
|
+
if (result !== null)
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
async readSourceWithKind(source, providerId) {
|
|
336
|
+
// 请求地址与分类缓存使用同一套 URL 清洗规则,避免 query/hash 中的凭据
|
|
337
|
+
// 被带到上游,也避免同一来源因尾部 /v1 或查询参数产生不同请求路径。
|
|
338
|
+
const baseUrl = sanitizeUpstreamUrl(source.baseUrl);
|
|
339
|
+
if (baseUrl === '')
|
|
340
|
+
return null;
|
|
341
|
+
const usagePath = /\/v1$/u.test(baseUrl) ? '/usage' : '/v1/usage';
|
|
342
|
+
const billingPath = /\/v1$/u.test(baseUrl) ? '/sub2api/billing' : '/v1/sub2api/billing';
|
|
343
|
+
const controller = new AbortController();
|
|
344
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
345
|
+
try {
|
|
346
|
+
const headers = {
|
|
347
|
+
Authorization: source.apiKey.trim().startsWith('Bearer ') ? source.apiKey.trim() : `Bearer ${source.apiKey.trim()}`,
|
|
348
|
+
Accept: 'application/json',
|
|
349
|
+
};
|
|
350
|
+
// /v1/usage 是统计主接口。统计服务不可用或响应字段不完整时,仍继续
|
|
351
|
+
// 读取 /v1/sub2api/billing,用其明确的 object 标记锁定 Sub2API 类型。
|
|
352
|
+
let usageRaw = null;
|
|
353
|
+
let usageStatus = 0;
|
|
354
|
+
try {
|
|
355
|
+
const response = await this.request(`${baseUrl}${usagePath}`, { headers, signal: controller.signal });
|
|
356
|
+
usageStatus = response.status;
|
|
357
|
+
if (response.ok)
|
|
358
|
+
usageRaw = await response.json();
|
|
359
|
+
}
|
|
360
|
+
catch {
|
|
361
|
+
// 主接口失败不代表来源类型未知,下面仍尝试 billing 探针。
|
|
362
|
+
}
|
|
363
|
+
const usage = normalizeSub2ApiUsage(usageRaw, baseUrl);
|
|
364
|
+
if (usage !== null) {
|
|
365
|
+
const logoUrl = buildLogoUrl(baseUrl);
|
|
366
|
+
const logoDataUrl = logoUrl === '' ? '' : await readLogoDataUrl(logoUrl, this.request, this.timeoutMs);
|
|
367
|
+
const providerDefinition = identifyModelProvider({ name: providerId, baseUrl }) ?? thirdPartyProvider({ name: providerId, baseUrl });
|
|
368
|
+
const providerLogoDataUrl = logoDataUrl || await readLogoDataUrl(providerDefinition.logoUrl, this.request, this.timeoutMs);
|
|
369
|
+
return {
|
|
370
|
+
usage: { authenticated: true, planType: usage.planName, primary: null, secondary: null, monthly: null, rateLimitReachedType: null, resetCredits: null, capturedAt: new Date().toISOString(), provider: providerSummary(providerDefinition, baseUrl, providerLogoDataUrl, 'sub2api'), sub2api: { ...usage, logoUrl, logoDataUrl } },
|
|
371
|
+
kind: 'sub2api',
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
if (isSub2ApiUsageSignature(usageRaw))
|
|
375
|
+
return { usage: null, kind: 'sub2api' };
|
|
376
|
+
// 无效凭据时 billing 只会重复返回鉴权错误,避免额外请求;404/5xx
|
|
377
|
+
// 等临时失败则继续探测,因为 billing 是产品级强特征。
|
|
378
|
+
if (usageStatus === 401 || usageStatus === 403)
|
|
379
|
+
return null;
|
|
380
|
+
try {
|
|
381
|
+
const response = await this.request(`${baseUrl}${billingPath}`, { headers, signal: controller.signal });
|
|
382
|
+
if (!response.ok)
|
|
383
|
+
return null;
|
|
384
|
+
const billing = await response.json();
|
|
385
|
+
return isSub2ApiUsageSignature(billing) ? { usage: null, kind: 'sub2api' } : null;
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
finally {
|
|
395
|
+
clearTimeout(timer);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
configuredSource(adapterId, providerId) {
|
|
399
|
+
if (this.configuredSources === undefined)
|
|
400
|
+
return undefined;
|
|
401
|
+
return (providerId !== undefined && this.configuredSources[providerId] !== undefined)
|
|
402
|
+
? this.configuredSources[providerId]
|
|
403
|
+
: this.configuredSources[adapterId];
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/** 判断 Sub2API 用量端点的协议结构;统计明细为空时仍保留协议分类。 */
|
|
407
|
+
export function isSub2ApiUsageSignature(value) {
|
|
408
|
+
const root = recordValue(value);
|
|
409
|
+
if (root === null)
|
|
410
|
+
return false;
|
|
411
|
+
const payload = recordValue(root.data) ?? root;
|
|
412
|
+
if (textValue(payload.object) === 'sub2api.key_billing')
|
|
413
|
+
return true;
|
|
414
|
+
const hasMode = textValue(payload.mode) !== null && typeof payload.isValid === 'boolean';
|
|
415
|
+
const usage = recordValue(payload.usage);
|
|
416
|
+
const hasUsagePoints = usage !== null && (recordValue(usage.today) !== null || recordValue(usage.total) !== null);
|
|
417
|
+
return hasMode || hasUsagePoints || Array.isArray(payload.daily_usage) || Array.isArray(payload.model_stats);
|
|
418
|
+
}
|
|
419
|
+
export class CodexSubscriptionService {
|
|
420
|
+
binaries;
|
|
421
|
+
runSpawnSync;
|
|
422
|
+
runSpawn;
|
|
423
|
+
timeoutMs;
|
|
424
|
+
homeDirectory;
|
|
425
|
+
command = null;
|
|
426
|
+
constructor(options = {}) {
|
|
427
|
+
this.binaries = options.binaries ?? ['codex'];
|
|
428
|
+
this.runSpawnSync = options.spawnSync ?? spawnSync;
|
|
429
|
+
this.runSpawn = options.spawn ?? spawn;
|
|
430
|
+
this.timeoutMs = options.timeoutMs ?? 8_000;
|
|
431
|
+
this.homeDirectory = options.homeDirectory ?? (process.env.CODEX_HOME ?? join(homedir(), '.codex'));
|
|
432
|
+
}
|
|
433
|
+
async read() {
|
|
434
|
+
if (hasThirdPartyCodexConfig(this.homeDirectory))
|
|
435
|
+
return null;
|
|
436
|
+
try {
|
|
437
|
+
this.command ??= (await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync })).command;
|
|
438
|
+
if (this.command === null)
|
|
439
|
+
return null;
|
|
440
|
+
const rpc = new JsonRpcProcess({ command: this.command, args: ['app-server'], spawn: this.runSpawn });
|
|
441
|
+
const controller = new AbortController();
|
|
442
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
443
|
+
try {
|
|
444
|
+
await rpc.request('initialize', { clientInfo: { name: 'dsh-agentdoor', version: '0.1.1' }, capabilities: {} }, { signal: controller.signal });
|
|
445
|
+
rpc.notify('initialized', {});
|
|
446
|
+
const result = await rpc.request('account/rateLimits/read', {}, { signal: controller.signal });
|
|
447
|
+
return normalizeCodexSnapshot(result);
|
|
448
|
+
}
|
|
449
|
+
finally {
|
|
450
|
+
clearTimeout(timer);
|
|
451
|
+
rpc.dispose();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
catch {
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
/** 消耗一次 Codex 官方重置券;凭据始终留在 Codex 侧,Host 只中转协议结果。 */
|
|
459
|
+
async reset() {
|
|
460
|
+
if (hasThirdPartyCodexConfig(this.homeDirectory))
|
|
461
|
+
throw new Error('Codex 使用第三方配置,无法重置官方订阅');
|
|
462
|
+
this.command ??= (await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync })).command;
|
|
463
|
+
if (this.command === null)
|
|
464
|
+
throw new Error('未找到 Codex CLI,无法重置订阅');
|
|
465
|
+
const rpc = new JsonRpcProcess({ command: this.command, args: ['app-server'], spawn: this.runSpawn });
|
|
466
|
+
const controller = new AbortController();
|
|
467
|
+
// 消费接口连上游耗时可能超过普通查询;超时过短会在重置已生效时误报失败。
|
|
468
|
+
const timer = setTimeout(() => controller.abort(), Math.max(this.timeoutMs, 20_000));
|
|
469
|
+
try {
|
|
470
|
+
await rpc.request('initialize', { clientInfo: { name: 'dsh-agentdoor', version: '0.1.1' }, capabilities: {} }, { signal: controller.signal });
|
|
471
|
+
rpc.notify('initialized', {});
|
|
472
|
+
const result = await rpc.request('account/rateLimitResetCredit/consume', { idempotencyKey: randomUUID() }, { signal: controller.signal });
|
|
473
|
+
return { outcome: normalizeCodexResetOutcome(result) };
|
|
474
|
+
}
|
|
475
|
+
catch (error) {
|
|
476
|
+
if (error instanceof JsonRpcRequestError && error.code === -32601) {
|
|
477
|
+
throw new Error('当前 Codex CLI 版本不支持重置订阅,请升级 Codex 后重试');
|
|
478
|
+
}
|
|
479
|
+
throw error;
|
|
480
|
+
}
|
|
481
|
+
finally {
|
|
482
|
+
clearTimeout(timer);
|
|
483
|
+
rpc.dispose();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
export class ClaudeCodeSubscriptionService {
|
|
488
|
+
homeDirectory;
|
|
489
|
+
request;
|
|
490
|
+
timeoutMs;
|
|
491
|
+
constructor(options = {}) {
|
|
492
|
+
this.homeDirectory = options.homeDirectory ?? join(homedir(), '.claude');
|
|
493
|
+
this.request = options.fetch ?? fetch;
|
|
494
|
+
this.timeoutMs = options.timeoutMs ?? 8_000;
|
|
495
|
+
}
|
|
496
|
+
async read() {
|
|
497
|
+
const auth = readJson(join(this.homeDirectory, '.credentials.json'));
|
|
498
|
+
const oauth = recordValue(auth)?.claudeAiOauth;
|
|
499
|
+
const token = textValue(recordValue(oauth)?.accessToken);
|
|
500
|
+
if (token === null)
|
|
501
|
+
return null;
|
|
502
|
+
if (hasThirdPartyClaudeConfig(this.homeDirectory))
|
|
503
|
+
return null;
|
|
504
|
+
const controller = new AbortController();
|
|
505
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
506
|
+
try {
|
|
507
|
+
const response = await this.request('https://api.anthropic.com/api/oauth/usage', {
|
|
508
|
+
headers: {
|
|
509
|
+
Authorization: `Bearer ${token}`,
|
|
510
|
+
Accept: 'application/json',
|
|
511
|
+
'anthropic-beta': 'oauth-2025-04-20',
|
|
512
|
+
},
|
|
513
|
+
signal: controller.signal,
|
|
514
|
+
});
|
|
515
|
+
if (!response.ok)
|
|
516
|
+
return null;
|
|
517
|
+
const snapshot = normalizeClaudeSnapshot(await response.json(), textValue(recordValue(oauth)?.subscriptionType));
|
|
518
|
+
return hasSubscriptionWindow(snapshot) ? snapshot : null;
|
|
519
|
+
}
|
|
520
|
+
catch {
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
finally {
|
|
524
|
+
clearTimeout(timer);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
export class OpenCodeSubscriptionService {
|
|
529
|
+
homeDirectory;
|
|
530
|
+
constructor(options = {}) {
|
|
531
|
+
this.homeDirectory = options.homeDirectory ?? defaultOpenCodeDataDirectory();
|
|
532
|
+
}
|
|
533
|
+
async read() {
|
|
534
|
+
const candidates = [
|
|
535
|
+
join(this.homeDirectory, 'auth.json'),
|
|
536
|
+
join(homedir(), '.config', 'opencode', 'auth.json'),
|
|
537
|
+
join(homedir(), 'Library', 'Application Support', 'opencode', 'auth.json'),
|
|
538
|
+
...(process.platform === 'win32' && process.env.APPDATA
|
|
539
|
+
? [join(process.env.APPDATA, 'opencode', 'auth.json')]
|
|
540
|
+
: []),
|
|
541
|
+
];
|
|
542
|
+
const auth = candidates.map(readJson).find((value) => value !== null);
|
|
543
|
+
if (auth === null || auth === undefined || Object.keys(auth).length === 0)
|
|
544
|
+
return null;
|
|
545
|
+
// OpenCode 支持多个第三方 Provider,目前没有稳定的统一额度协议;只报告认证状态。
|
|
546
|
+
const snapshot = normalizeOpenCodeSnapshot(auth);
|
|
547
|
+
if (snapshot !== null)
|
|
548
|
+
return snapshot;
|
|
549
|
+
const provider = Object.keys(auth).find((key) => key.trim() !== '') ?? null;
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
/** 读取 Kimi Code 官方套餐额度;本地 OAuth 凭据只在 Host 内使用,不做刷新只读访问令牌。 */
|
|
554
|
+
export class KimiSubscriptionService {
|
|
555
|
+
request;
|
|
556
|
+
timeoutMs;
|
|
557
|
+
credentialPaths;
|
|
558
|
+
constructor(options = {}) {
|
|
559
|
+
this.request = options.fetch ?? fetch;
|
|
560
|
+
this.timeoutMs = options.timeoutMs ?? 8_000;
|
|
561
|
+
this.credentialPaths = options.credentials ?? defaultKimiCredentialPaths();
|
|
562
|
+
}
|
|
563
|
+
async read() {
|
|
564
|
+
const token = this.readAccessToken();
|
|
565
|
+
if (token === null)
|
|
566
|
+
return null;
|
|
567
|
+
for (const baseUrl of kimiCodeBaseUrls(token.region)) {
|
|
568
|
+
const usage = await this.readUsage(baseUrl, token.value);
|
|
569
|
+
if (usage !== null)
|
|
570
|
+
return usage;
|
|
571
|
+
}
|
|
572
|
+
return null;
|
|
573
|
+
}
|
|
574
|
+
readAccessToken() {
|
|
575
|
+
for (const path of this.credentialPaths) {
|
|
576
|
+
const credentials = readJson(path);
|
|
577
|
+
const token = textValue(credentials?.access_token);
|
|
578
|
+
if (token === null)
|
|
579
|
+
continue;
|
|
580
|
+
const expiresAt = numberValue(credentials?.expires_at);
|
|
581
|
+
// 访问令牌有效期很短;已过期或临期的令牌直接跳过,由 CLI 自己负责刷新。
|
|
582
|
+
if (expiresAt !== null && expiresAt * 1000 <= Date.now() + 30_000)
|
|
583
|
+
continue;
|
|
584
|
+
return { value: token, region: kimiTokenRegion(token) };
|
|
585
|
+
}
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
async readUsage(baseUrl, token) {
|
|
589
|
+
const controller = new AbortController();
|
|
590
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
591
|
+
try {
|
|
592
|
+
const response = await this.request(`${baseUrl}/usages`, {
|
|
593
|
+
headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' },
|
|
594
|
+
signal: controller.signal,
|
|
595
|
+
});
|
|
596
|
+
if (!response.ok)
|
|
597
|
+
return null;
|
|
598
|
+
return normalizeKimiUsage(await response.json());
|
|
599
|
+
}
|
|
600
|
+
catch {
|
|
601
|
+
return null;
|
|
602
|
+
}
|
|
603
|
+
finally {
|
|
604
|
+
clearTimeout(timer);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
const GROK_BILLING_ENDPOINT = 'https://grok.com/grok_api_v2.GrokBuildBilling/GetGrokCreditsConfig';
|
|
609
|
+
const GROK_SETTINGS_ENDPOINT = 'https://cli-chat-proxy.grok.com/v1/settings';
|
|
610
|
+
const GROK_OIDC_SCOPE_PREFIX = 'https://auth.x.ai::';
|
|
611
|
+
const GROK_LEGACY_SESSION_SCOPE = 'https://accounts.x.ai/sign-in';
|
|
612
|
+
const GROK_DEFAULT_PLAN = 'SuperGrok';
|
|
613
|
+
/** 读取 Grok(xAI)官方 SuperGrok 订阅额度;只读 Grok CLI 的 OAuth 凭据(~/.grok/auth.json),不做刷新,过期令牌也照常尝试以容忍时钟偏差。 */
|
|
614
|
+
export class GrokSubscriptionService {
|
|
615
|
+
request;
|
|
616
|
+
timeoutMs;
|
|
617
|
+
credentialPaths;
|
|
618
|
+
constructor(options = {}) {
|
|
619
|
+
this.request = options.fetch ?? fetch;
|
|
620
|
+
this.timeoutMs = options.timeoutMs ?? 15_000;
|
|
621
|
+
this.credentialPaths = options.credentials ?? defaultGrokCredentialPaths();
|
|
622
|
+
}
|
|
623
|
+
async read() {
|
|
624
|
+
const credentials = this.readCredentials();
|
|
625
|
+
if (credentials === null)
|
|
626
|
+
return null;
|
|
627
|
+
const controller = new AbortController();
|
|
628
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
629
|
+
try {
|
|
630
|
+
// 空 gRPC-web 帧(1 字节 flags + 4 字节大端长度 0)即可取回账单快照。
|
|
631
|
+
const response = await this.request(GROK_BILLING_ENDPOINT, {
|
|
632
|
+
method: 'POST',
|
|
633
|
+
headers: {
|
|
634
|
+
Authorization: `Bearer ${credentials.token}`,
|
|
635
|
+
Origin: 'https://grok.com',
|
|
636
|
+
Referer: 'https://grok.com/?_s=usage',
|
|
637
|
+
Accept: '*/*',
|
|
638
|
+
'Content-Type': 'application/grpc-web+proto',
|
|
639
|
+
'x-grpc-web': '1',
|
|
640
|
+
'x-user-agent': 'connect-es/2.1.1',
|
|
641
|
+
},
|
|
642
|
+
body: new Uint8Array(5),
|
|
643
|
+
signal: controller.signal,
|
|
644
|
+
});
|
|
645
|
+
// 鉴权失败与其他 HTTP 错误都不展示陈旧数据;令牌过期时由 Grok CLI 重新登录后恢复。
|
|
646
|
+
if (!response.ok)
|
|
647
|
+
return null;
|
|
648
|
+
const headerStatus = numberValue(response.headers.get('grpc-status') ?? undefined);
|
|
649
|
+
if (headerStatus !== null && headerStatus !== 0)
|
|
650
|
+
return null;
|
|
651
|
+
const raw = new Uint8Array(await response.arrayBuffer());
|
|
652
|
+
const trailerStatus = numberValue(grpcWebTrailerFields(raw)['grpc-status']);
|
|
653
|
+
if (trailerStatus !== null && trailerStatus !== 0)
|
|
654
|
+
return null;
|
|
655
|
+
const nowSecs = Math.floor(Date.now() / 1000);
|
|
656
|
+
const snapshot = parseGrokBillingPayload(raw, nowSecs);
|
|
657
|
+
if (snapshot === null)
|
|
658
|
+
return null;
|
|
659
|
+
const usedPercent = clamp(snapshot.usedPercent);
|
|
660
|
+
const planType = await this.readPlanType(credentials.token, credentials.isOidc);
|
|
661
|
+
return {
|
|
662
|
+
authenticated: true,
|
|
663
|
+
planType,
|
|
664
|
+
primary: { usedPercent, remainingPercent: 100 - usedPercent, windowDurationMins: grokWindowDurationMins(snapshot.resetsAt, nowSecs), resetsAt: snapshot.resetsAt },
|
|
665
|
+
secondary: null,
|
|
666
|
+
monthly: null,
|
|
667
|
+
rateLimitReachedType: null,
|
|
668
|
+
resetCredits: null,
|
|
669
|
+
capturedAt: new Date().toISOString(),
|
|
670
|
+
...(credentials.accountName === null ? {} : { accountName: credentials.accountName }),
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
catch {
|
|
674
|
+
return null;
|
|
675
|
+
}
|
|
676
|
+
finally {
|
|
677
|
+
clearTimeout(timer);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
readCredentials() {
|
|
681
|
+
for (const path of this.credentialPaths) {
|
|
682
|
+
const auth = readJson(path);
|
|
683
|
+
if (auth === null)
|
|
684
|
+
continue;
|
|
685
|
+
const credentials = selectGrokAuthCredentials(auth);
|
|
686
|
+
if (credentials !== null)
|
|
687
|
+
return credentials;
|
|
688
|
+
}
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
async readPlanType(token, isOidc) {
|
|
692
|
+
const controller = new AbortController();
|
|
693
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
694
|
+
try {
|
|
695
|
+
const response = await this.request(GROK_SETTINGS_ENDPOINT, {
|
|
696
|
+
headers: {
|
|
697
|
+
Authorization: `Bearer ${token}`,
|
|
698
|
+
Accept: 'application/json',
|
|
699
|
+
'x-xai-token-auth': 'xai-grok-cli',
|
|
700
|
+
},
|
|
701
|
+
signal: controller.signal,
|
|
702
|
+
});
|
|
703
|
+
if (!response.ok)
|
|
704
|
+
return isOidc ? GROK_DEFAULT_PLAN : null;
|
|
705
|
+
const payload = recordValue(await response.json());
|
|
706
|
+
return textValue(payload?.subscription_tier_display) ?? (isOidc ? GROK_DEFAULT_PLAN : null);
|
|
707
|
+
}
|
|
708
|
+
catch {
|
|
709
|
+
return isOidc ? GROK_DEFAULT_PLAN : null;
|
|
710
|
+
}
|
|
711
|
+
finally {
|
|
712
|
+
clearTimeout(timer);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
function defaultGrokCredentialPaths() {
|
|
717
|
+
return [join(process.env.GROK_HOME ?? join(homedir(), '.grok'), 'auth.json')];
|
|
718
|
+
}
|
|
719
|
+
/** auth.json 以 OIDC scope URL 为键;优先 SuperGrok 的 auth.x.ai 条目,回退 legacy 登录条目,残缺条目不遮蔽健康条目。 */
|
|
720
|
+
function selectGrokAuthCredentials(auth) {
|
|
721
|
+
let oidc = null;
|
|
722
|
+
let legacy = null;
|
|
723
|
+
for (const [scope, value] of Object.entries(auth)) {
|
|
724
|
+
const record = recordValue(value);
|
|
725
|
+
const token = textValue(record?.key);
|
|
726
|
+
if (token === null)
|
|
727
|
+
continue;
|
|
728
|
+
const credentials = {
|
|
729
|
+
token,
|
|
730
|
+
accountName: grokAccountName(record),
|
|
731
|
+
isOidc: scope.startsWith(GROK_OIDC_SCOPE_PREFIX),
|
|
732
|
+
};
|
|
733
|
+
if (scope.startsWith(GROK_OIDC_SCOPE_PREFIX))
|
|
734
|
+
oidc = credentials;
|
|
735
|
+
else if (scope === GROK_LEGACY_SESSION_SCOPE || scope.includes('/sign-in'))
|
|
736
|
+
legacy = credentials;
|
|
737
|
+
}
|
|
738
|
+
return oidc ?? legacy;
|
|
739
|
+
}
|
|
740
|
+
function grokAccountName(auth) {
|
|
741
|
+
if (auth === null)
|
|
742
|
+
return null;
|
|
743
|
+
const firstName = textValue(auth.first_name ?? auth.firstName);
|
|
744
|
+
const lastName = textValue(auth.last_name ?? auth.lastName);
|
|
745
|
+
const fullName = [firstName, lastName].filter((value) => value !== null).join(' ');
|
|
746
|
+
return fullName || textValue(auth.name) || textValue(auth.email);
|
|
747
|
+
}
|
|
748
|
+
/** 按重置时间距今的天数推断窗口长度(4–12 天按周窗口、20–45 天按月窗口),无法推断时留空由客户端使用兜底标签。 */
|
|
749
|
+
function grokWindowDurationMins(resetsAt, nowSecs) {
|
|
750
|
+
if (resetsAt === null)
|
|
751
|
+
return null;
|
|
752
|
+
const days = Math.round((resetsAt - nowSecs) / 86_400);
|
|
753
|
+
if (days >= 4 && days <= 12)
|
|
754
|
+
return 7 * 24 * 60;
|
|
755
|
+
if (days >= 20 && days <= 45)
|
|
756
|
+
return 30 * 24 * 60;
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* 账单端点没有公开 .proto,按字段路径启发式提取(移植自 cc-switch / CodexBar):
|
|
761
|
+
* 百分比取路径末段为 1、值域 [0,100] 的最浅 fixed32 字段;重置时间取落在合理 Unix 秒区间且
|
|
762
|
+
* 晚于当前时刻的 varint(优先路径 [1,5,1]);proto3 会省略 0 值字段,存在重置时间与周期标记时按 0% 处理。
|
|
763
|
+
*/
|
|
764
|
+
function parseGrokBillingPayload(data, nowSecs) {
|
|
765
|
+
let payloads = grpcWebDataFrames(data);
|
|
766
|
+
if (payloads.length === 0 && looksLikeProtobufPayload(data))
|
|
767
|
+
payloads = [data];
|
|
768
|
+
if (payloads.length === 0)
|
|
769
|
+
return null;
|
|
770
|
+
const scan = { fixed32: [], varint: [] };
|
|
771
|
+
for (const payload of payloads)
|
|
772
|
+
scanGrokProtobuf(payload, 0, [], 0, scan);
|
|
773
|
+
const percent = scan.fixed32
|
|
774
|
+
.filter((field) => field.path.at(-1) === 1 && Number.isFinite(field.value) && field.value >= 0 && field.value <= 100)
|
|
775
|
+
.sort((left, right) => (left.path.length - right.path.length) || (left.order - right.order))[0]?.value;
|
|
776
|
+
const resetCandidates = scan.varint.filter((field) => field.value >= 1_700_000_000 && field.value <= 2_100_000_000 && field.value > nowSecs);
|
|
777
|
+
const preferred = resetCandidates.filter((field) => field.path.length === 3 && field.path[0] === 1 && field.path[1] === 5 && field.path[2] === 1);
|
|
778
|
+
const resetPool = preferred.length > 0 ? preferred : resetCandidates;
|
|
779
|
+
const reset = resetPool.length > 0 ? Math.min(...resetPool.map((field) => field.value)) : null;
|
|
780
|
+
const hasUsagePeriod = scan.varint.some((field) => (field.path.length >= 2 && field.path[0] === 1 && field.path[1] === 6)
|
|
781
|
+
|| (field.path.length === 3 && field.path[0] === 1 && field.path[1] === 8 && field.path[2] === 1 && (field.value === 1 || field.value === 2)));
|
|
782
|
+
const usedPercent = percent ?? (scan.fixed32.length === 0 && reset !== null && hasUsagePeriod ? 0 : undefined);
|
|
783
|
+
if (usedPercent === undefined)
|
|
784
|
+
return null;
|
|
785
|
+
return { usedPercent, resetsAt: reset };
|
|
786
|
+
}
|
|
787
|
+
/** 拆出 gRPC-web data 帧(flags 高位 0x80 的 trailer 帧跳过);任一帧长度非法时返回空,调用方再按裸 protobuf 兜底。 */
|
|
788
|
+
function grpcWebDataFrames(data) {
|
|
789
|
+
const frames = [];
|
|
790
|
+
let index = 0;
|
|
791
|
+
while (index < data.length) {
|
|
792
|
+
if (index + 5 > data.length)
|
|
793
|
+
return [];
|
|
794
|
+
const flags = data[index];
|
|
795
|
+
const length = data[index + 1] * 16_777_216 + data[index + 2] * 65_536 + data[index + 3] * 256 + data[index + 4];
|
|
796
|
+
const start = index + 5;
|
|
797
|
+
const end = start + length;
|
|
798
|
+
if (end > data.length)
|
|
799
|
+
return [];
|
|
800
|
+
if ((flags & 0x80) === 0)
|
|
801
|
+
frames.push(data.subarray(start, end));
|
|
802
|
+
index = end;
|
|
803
|
+
}
|
|
804
|
+
return frames;
|
|
805
|
+
}
|
|
806
|
+
/** 响应体没有帧头时,看首字节是否像合法 protobuf tag(某些成功请求直接返回裸 protobuf)。 */
|
|
807
|
+
function looksLikeProtobufPayload(data) {
|
|
808
|
+
const first = data[0];
|
|
809
|
+
if (first === undefined)
|
|
810
|
+
return false;
|
|
811
|
+
const wireType = first & 0x07;
|
|
812
|
+
return first >> 3 > 0 && (wireType === 0 || wireType === 1 || wireType === 2 || wireType === 5);
|
|
813
|
+
}
|
|
814
|
+
/** 从 trailer 帧(flags & 0x80)解析 grpc-status / grpc-message 等字段。 */
|
|
815
|
+
function grpcWebTrailerFields(data) {
|
|
816
|
+
const fields = {};
|
|
817
|
+
let index = 0;
|
|
818
|
+
while (index + 5 <= data.length) {
|
|
819
|
+
const flags = data[index];
|
|
820
|
+
const length = data[index + 1] * 16_777_216 + data[index + 2] * 65_536 + data[index + 3] * 256 + data[index + 4];
|
|
821
|
+
const start = index + 5;
|
|
822
|
+
const end = start + length;
|
|
823
|
+
if (end > data.length)
|
|
824
|
+
break;
|
|
825
|
+
if ((flags & 0x80) !== 0) {
|
|
826
|
+
for (const line of new TextDecoder().decode(data.subarray(start, end)).split(/\r?\n/u)) {
|
|
827
|
+
const separator = line.indexOf(':');
|
|
828
|
+
if (separator <= 0)
|
|
829
|
+
continue;
|
|
830
|
+
fields[line.slice(0, separator).trim().toLowerCase()] = grokPercentDecode(line.slice(separator + 1).trim());
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
index = end;
|
|
834
|
+
}
|
|
835
|
+
return fields;
|
|
836
|
+
}
|
|
837
|
+
/** gRPC message 使用 percent-encoding;解码失败的序列原样保留。 */
|
|
838
|
+
function grokPercentDecode(input) {
|
|
839
|
+
const bytes = new TextEncoder().encode(input);
|
|
840
|
+
const out = [];
|
|
841
|
+
let index = 0;
|
|
842
|
+
while (index < bytes.length) {
|
|
843
|
+
if (bytes[index] === 0x25 && index + 2 < bytes.length) {
|
|
844
|
+
const hex = String.fromCharCode(bytes[index + 1], bytes[index + 2]);
|
|
845
|
+
if (/^[0-9a-fA-F]{2}$/u.test(hex)) {
|
|
846
|
+
out.push(parseInt(hex, 16));
|
|
847
|
+
index += 3;
|
|
848
|
+
continue;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
out.push(bytes[index]);
|
|
852
|
+
index += 1;
|
|
853
|
+
}
|
|
854
|
+
return new TextDecoder().decode(new Uint8Array(out));
|
|
855
|
+
}
|
|
856
|
+
function readGrokVarint(bytes, state) {
|
|
857
|
+
let value = 0;
|
|
858
|
+
let shift = 0;
|
|
859
|
+
while (state.index < bytes.length && shift < 64) {
|
|
860
|
+
const byte = bytes[state.index];
|
|
861
|
+
state.index += 1;
|
|
862
|
+
value += (byte & 0x7f) * 2 ** shift;
|
|
863
|
+
if ((byte & 0x80) === 0)
|
|
864
|
+
return value;
|
|
865
|
+
shift += 7;
|
|
866
|
+
}
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
/** 递归扫描 protobuf 消息,收集 varint 与 fixed32 字段;length-delimited 一律按嵌套消息试扫(深度 ≤4),无法解析时从字段起点 +1 重新同步。 */
|
|
870
|
+
function scanGrokProtobuf(bytes, depth, path, order, scan) {
|
|
871
|
+
let index = 0;
|
|
872
|
+
let nextOrder = order;
|
|
873
|
+
while (index < bytes.length) {
|
|
874
|
+
const fieldStart = index;
|
|
875
|
+
const keyState = { index };
|
|
876
|
+
const key = readGrokVarint(bytes, keyState);
|
|
877
|
+
index = keyState.index;
|
|
878
|
+
if (key === null || key === 0) {
|
|
879
|
+
index = fieldStart + 1;
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
const fieldPath = [...path, Math.floor(key / 8)];
|
|
883
|
+
const wireType = key & 0x07;
|
|
884
|
+
if (wireType === 0) {
|
|
885
|
+
const valueState = { index };
|
|
886
|
+
const value = readGrokVarint(bytes, valueState);
|
|
887
|
+
if (value === null) {
|
|
888
|
+
index = fieldStart + 1;
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
index = valueState.index;
|
|
892
|
+
scan.varint.push({ path: fieldPath, value });
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (wireType === 1) {
|
|
896
|
+
if (index + 8 > bytes.length)
|
|
897
|
+
return nextOrder;
|
|
898
|
+
index += 8;
|
|
899
|
+
continue;
|
|
900
|
+
}
|
|
901
|
+
if (wireType === 2) {
|
|
902
|
+
const lengthState = { index };
|
|
903
|
+
const length = readGrokVarint(bytes, lengthState);
|
|
904
|
+
index = lengthState.index;
|
|
905
|
+
if (length === null || length > bytes.length - index) {
|
|
906
|
+
index = fieldStart + 1;
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
const end = index + length;
|
|
910
|
+
if (depth < 4)
|
|
911
|
+
nextOrder = scanGrokProtobuf(bytes.subarray(index, end), depth + 1, fieldPath, nextOrder, scan);
|
|
912
|
+
index = end;
|
|
913
|
+
continue;
|
|
914
|
+
}
|
|
915
|
+
if (wireType === 5) {
|
|
916
|
+
if (index + 4 > bytes.length)
|
|
917
|
+
return nextOrder;
|
|
918
|
+
scan.fixed32.push({ path: fieldPath, value: new DataView(bytes.buffer, bytes.byteOffset + index, 4).getFloat32(0, true), order: nextOrder });
|
|
919
|
+
nextOrder += 1;
|
|
920
|
+
index += 4;
|
|
921
|
+
continue;
|
|
922
|
+
}
|
|
923
|
+
index = fieldStart + 1;
|
|
924
|
+
}
|
|
925
|
+
return nextOrder;
|
|
926
|
+
}
|
|
927
|
+
function normalizeCodexSnapshot(value) {
|
|
928
|
+
const root = recordValue(value);
|
|
929
|
+
const source = recordValue(root?.rateLimits ?? root?.rate_limits) ?? root;
|
|
930
|
+
if (source === null)
|
|
931
|
+
return null;
|
|
932
|
+
const primary = normalizeRateWindow(source.primary);
|
|
933
|
+
const secondary = normalizeRateWindow(source.secondary);
|
|
934
|
+
if (primary === null && secondary === null)
|
|
935
|
+
return null;
|
|
936
|
+
return {
|
|
937
|
+
authenticated: true,
|
|
938
|
+
planType: textValue(source.planType ?? source.plan_type),
|
|
939
|
+
primary,
|
|
940
|
+
secondary,
|
|
941
|
+
monthly: null,
|
|
942
|
+
rateLimitReachedType: textValue(source.rateLimitReachedType ?? source.rate_limit_reached_type),
|
|
943
|
+
resetCredits: normalizeCodexResetCredits(root?.rateLimitResetCredits ?? root?.rate_limit_reset_credits),
|
|
944
|
+
credits: normalizeCodexCredits(source.credits),
|
|
945
|
+
capturedAt: new Date().toISOString(),
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
/** Codex 重置券摘要;availableCount 权威,明细行可能被上游截断。 */
|
|
949
|
+
function normalizeCodexResetCredits(value) {
|
|
950
|
+
const source = recordValue(value);
|
|
951
|
+
if (source === null)
|
|
952
|
+
return null;
|
|
953
|
+
const rawCount = source.availableCount ?? source.available_count;
|
|
954
|
+
const availableCount = rawCount === null || rawCount === undefined ? null : numberValue(rawCount);
|
|
955
|
+
if (availableCount === null)
|
|
956
|
+
return null;
|
|
957
|
+
const rows = Array.isArray(source.credits) ? source.credits : [];
|
|
958
|
+
return {
|
|
959
|
+
availableCount: Math.max(0, Math.trunc(availableCount)),
|
|
960
|
+
credits: rows
|
|
961
|
+
.map((item) => recordValue(item))
|
|
962
|
+
.filter((row) => row !== null && (typeof row.status !== 'string' || row.status === 'available'))
|
|
963
|
+
.map((row) => {
|
|
964
|
+
const rawExpiry = row.expiresAt ?? row.expires_at;
|
|
965
|
+
return {
|
|
966
|
+
id: textValue(row.id),
|
|
967
|
+
expiresAt: rawExpiry === null || rawExpiry === undefined ? null : timestampValue(rawExpiry),
|
|
968
|
+
title: textValue(row.title),
|
|
969
|
+
description: textValue(row.description),
|
|
970
|
+
};
|
|
971
|
+
}),
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
/** Codex 点数余额:余额保持字符串以保留上游十进制精度;字段全缺时视为未提供。 */
|
|
975
|
+
function normalizeCodexCredits(value) {
|
|
976
|
+
const source = recordValue(value);
|
|
977
|
+
if (source === null)
|
|
978
|
+
return null;
|
|
979
|
+
const hasCredits = booleanValue(source.hasCredits ?? source.has_credits);
|
|
980
|
+
const unlimited = booleanValue(source.unlimited);
|
|
981
|
+
const balance = creditBalanceValue(source.balance);
|
|
982
|
+
if (hasCredits === null && unlimited === null && balance === null)
|
|
983
|
+
return null;
|
|
984
|
+
return { hasCredits: hasCredits ?? balance !== null, unlimited: unlimited ?? false, balance };
|
|
985
|
+
}
|
|
986
|
+
const CODEX_RESET_OUTCOMES = ['reset', 'alreadyRedeemed', 'nothingToReset', 'noCredit'];
|
|
987
|
+
function normalizeCodexResetOutcome(value) {
|
|
988
|
+
const outcome = textValue(recordValue(value)?.outcome);
|
|
989
|
+
const matched = CODEX_RESET_OUTCOMES.find((candidate) => candidate === outcome);
|
|
990
|
+
if (matched === undefined)
|
|
991
|
+
throw new Error('Codex 返回了无法识别的重置结果');
|
|
992
|
+
return matched;
|
|
993
|
+
}
|
|
994
|
+
function normalizeClaudeSnapshot(value, planType) {
|
|
995
|
+
const root = recordValue(value) ?? {};
|
|
996
|
+
const source = recordValue(root.data) ?? root;
|
|
997
|
+
return {
|
|
998
|
+
authenticated: true,
|
|
999
|
+
planType,
|
|
1000
|
+
primary: normalizeUsageWindow(source.five_hour ?? source.fiveHour),
|
|
1001
|
+
secondary: normalizeUsageWindow(source.seven_day ?? source.sevenDay),
|
|
1002
|
+
monthly: normalizeUsageWindow(source.seven_day_opus ?? source.sevenDayOpus),
|
|
1003
|
+
rateLimitReachedType: null,
|
|
1004
|
+
resetCredits: null,
|
|
1005
|
+
capturedAt: new Date().toISOString(),
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
function normalizeRateWindow(value) {
|
|
1009
|
+
const source = recordValue(value);
|
|
1010
|
+
if (source === null)
|
|
1011
|
+
return null;
|
|
1012
|
+
const usedPercent = numberValue(source.usedPercent ?? source.used_percent);
|
|
1013
|
+
if (usedPercent === null)
|
|
1014
|
+
return null;
|
|
1015
|
+
return {
|
|
1016
|
+
usedPercent: clamp(usedPercent),
|
|
1017
|
+
remainingPercent: 100 - clamp(usedPercent),
|
|
1018
|
+
windowDurationMins: integerValue(source.windowDurationMins ?? source.window_duration_mins),
|
|
1019
|
+
resetsAt: timestampValue(source.resetsAt ?? source.resets_at),
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
function normalizeUsageWindow(value) {
|
|
1023
|
+
const source = recordValue(value);
|
|
1024
|
+
if (source === null)
|
|
1025
|
+
return null;
|
|
1026
|
+
const utilization = numberValue(source.utilization ?? source.usedPercent ?? source.used_percent);
|
|
1027
|
+
if (utilization === null)
|
|
1028
|
+
return null;
|
|
1029
|
+
const usedPercent = clamp(utilization);
|
|
1030
|
+
return { usedPercent, remainingPercent: 100 - usedPercent, windowDurationMins: null, resetsAt: timestampValue(source.resets_at ?? source.resetsAt) };
|
|
1031
|
+
}
|
|
1032
|
+
function normalizeOpenCodeSnapshot(value) {
|
|
1033
|
+
const source = recordValue(value.rateLimits ?? value.rate_limits ?? value.usage ?? value.subscription);
|
|
1034
|
+
if (source === null)
|
|
1035
|
+
return null;
|
|
1036
|
+
const primary = normalizeUsageWindow(source.five_hour ?? source.fiveHour ?? source.primary);
|
|
1037
|
+
const secondary = normalizeUsageWindow(source.seven_day ?? source.sevenDay ?? source.secondary);
|
|
1038
|
+
const monthly = normalizeUsageWindow(source.monthly);
|
|
1039
|
+
if (primary === null && secondary === null && monthly === null)
|
|
1040
|
+
return null;
|
|
1041
|
+
return { authenticated: true, planType: textValue(source.planType ?? source.plan), primary, secondary, monthly, rateLimitReachedType: null, resetCredits: null, capturedAt: new Date().toISOString() };
|
|
1042
|
+
}
|
|
1043
|
+
function hasSubscriptionWindow(value) {
|
|
1044
|
+
return value !== null && (value.primary !== null || value.secondary !== null || value.monthly !== null);
|
|
1045
|
+
}
|
|
1046
|
+
function defaultKimiCredentialPaths() {
|
|
1047
|
+
return [
|
|
1048
|
+
join(process.env.KIMI_CODE_HOME ?? join(homedir(), '.kimi-code'), 'credentials', 'kimi-code.json'),
|
|
1049
|
+
join(process.env.KIMI_HOME ?? join(homedir(), '.kimi'), 'credentials', 'kimi-code.json'),
|
|
1050
|
+
];
|
|
1051
|
+
}
|
|
1052
|
+
/** 只解析 JWT payload 中的 region 字段用于选择就近接入点;签名校验由服务端负责。 */
|
|
1053
|
+
function kimiTokenRegion(token) {
|
|
1054
|
+
const parts = token.split('.');
|
|
1055
|
+
const payloadPart = parts[1];
|
|
1056
|
+
if (payloadPart === undefined)
|
|
1057
|
+
return null;
|
|
1058
|
+
try {
|
|
1059
|
+
const payload = recordValue(JSON.parse(Buffer.from(payloadPart.replace(/-/gu, '+').replace(/_/gu, '/'), 'base64').toString('utf8')));
|
|
1060
|
+
return textValue(payload?.region);
|
|
1061
|
+
}
|
|
1062
|
+
catch {
|
|
1063
|
+
return null;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
function kimiCodeBaseUrls(region) {
|
|
1067
|
+
const override = textValue(process.env.KIMI_CODE_BASE_URL);
|
|
1068
|
+
if (override !== null)
|
|
1069
|
+
return [override.replace(/\/+$/u, '')];
|
|
1070
|
+
const mainland = 'https://api.kimi.com/coding/v1';
|
|
1071
|
+
const global = 'https://api.kimi.ai/coding/v1';
|
|
1072
|
+
return region === 'cn' ? [mainland, global] : [global, mainland];
|
|
1073
|
+
}
|
|
1074
|
+
function normalizeKimiUsage(value) {
|
|
1075
|
+
const usages = recordValue(recordValue(value)?.usages);
|
|
1076
|
+
if (usages === null)
|
|
1077
|
+
return null;
|
|
1078
|
+
const primary = normalizeKimiQuotaWindow(usages.limit_5h ?? usages.limit5h, 5 * 60);
|
|
1079
|
+
const secondary = normalizeKimiQuotaWindow(usages.limit_7d ?? usages.limit7d, 7 * 24 * 60);
|
|
1080
|
+
const monthly = normalizeKimiQuotaWindow(usages.limit_month_code ?? usages.limitMonthCode, null)
|
|
1081
|
+
?? normalizeKimiQuotaWindow(usages.limit_month_total ?? usages.limitMonthTotal, null);
|
|
1082
|
+
if (primary === null && secondary === null && monthly === null)
|
|
1083
|
+
return null;
|
|
1084
|
+
return {
|
|
1085
|
+
authenticated: true,
|
|
1086
|
+
planType: null,
|
|
1087
|
+
primary,
|
|
1088
|
+
secondary,
|
|
1089
|
+
monthly,
|
|
1090
|
+
rateLimitReachedType: null,
|
|
1091
|
+
resetCredits: null,
|
|
1092
|
+
capturedAt: new Date().toISOString(),
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
function normalizeKimiQuotaWindow(value, windowDurationMins) {
|
|
1096
|
+
const source = recordValue(value);
|
|
1097
|
+
if (source === null)
|
|
1098
|
+
return null;
|
|
1099
|
+
const usedRatio = numberValue(source.used_ratio ?? source.usedRatio);
|
|
1100
|
+
if (usedRatio === null)
|
|
1101
|
+
return null;
|
|
1102
|
+
const usedPercent = clamp(usedRatio * 100);
|
|
1103
|
+
return { usedPercent, remainingPercent: 100 - usedPercent, windowDurationMins, resetsAt: timestampValue(source.reset_time ?? source.resetAt) };
|
|
1104
|
+
}
|
|
1105
|
+
function hasThirdPartyCodexConfig(homeDirectory) {
|
|
1106
|
+
const config = readText(join(homeDirectory, 'config.toml'));
|
|
1107
|
+
const configuredBaseUrl = config === null ? null : readCodexBaseUrl(config);
|
|
1108
|
+
const environmentBaseUrl = textValue(process.env.OPENAI_BASE_URL);
|
|
1109
|
+
return [configuredBaseUrl, environmentBaseUrl].some((value) => value !== null && !isOfficialOpenAiUrl(value));
|
|
1110
|
+
}
|
|
1111
|
+
function hasThirdPartyClaudeConfig(homeDirectory) {
|
|
1112
|
+
const baseUrl = textValue(process.env.ANTHROPIC_BASE_URL);
|
|
1113
|
+
if (baseUrl !== null && !isOfficialAnthropicUrl(baseUrl))
|
|
1114
|
+
return true;
|
|
1115
|
+
if (textValue(process.env.ANTHROPIC_API_KEY) !== null || textValue(process.env.ANTHROPIC_AUTH_TOKEN) !== null)
|
|
1116
|
+
return true;
|
|
1117
|
+
const settings = readJson(join(homeDirectory, 'settings.json'));
|
|
1118
|
+
const env = recordValue(settings)?.env;
|
|
1119
|
+
const configuredBaseUrl = textValue(recordValue(env)?.ANTHROPIC_BASE_URL);
|
|
1120
|
+
if (configuredBaseUrl !== null && !isOfficialAnthropicUrl(configuredBaseUrl))
|
|
1121
|
+
return true;
|
|
1122
|
+
return textValue(recordValue(env)?.ANTHROPIC_API_KEY) !== null || textValue(recordValue(env)?.ANTHROPIC_AUTH_TOKEN) !== null;
|
|
1123
|
+
}
|
|
1124
|
+
function isOfficialOpenAiUrl(value) {
|
|
1125
|
+
try {
|
|
1126
|
+
return new URL(value).hostname === 'api.openai.com';
|
|
1127
|
+
}
|
|
1128
|
+
catch {
|
|
1129
|
+
return false;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
function isOfficialAnthropicUrl(value) {
|
|
1133
|
+
try {
|
|
1134
|
+
return new URL(value).hostname === 'api.anthropic.com';
|
|
1135
|
+
}
|
|
1136
|
+
catch {
|
|
1137
|
+
return false;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
function readText(path) {
|
|
1141
|
+
if (!existsSync(path))
|
|
1142
|
+
return null;
|
|
1143
|
+
try {
|
|
1144
|
+
return readFileSync(path, 'utf8');
|
|
1145
|
+
}
|
|
1146
|
+
catch {
|
|
1147
|
+
return null;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
/** 只读取 DSH 凭据文档中的指定引用,不把凭据内容写入任何返回结构。 */
|
|
1151
|
+
function readDshCredential(name) {
|
|
1152
|
+
const dshHome = process.env.DSH_HOME ?? join(homedir(), '.dsh');
|
|
1153
|
+
const paths = [join(dshHome, '.credentials.yaml'), join(dshHome, '.env'), join(process.cwd(), '.env')];
|
|
1154
|
+
const pattern = new RegExp(`^\\s*${name}\\s*:\\s*(?:"([^"]*)"|'([^']*)'|([^#\\s]+))`, 'mu');
|
|
1155
|
+
const envPattern = new RegExp(`^\\s*${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^#\\s]+))`, 'mu');
|
|
1156
|
+
for (const path of paths) {
|
|
1157
|
+
const source = readText(path);
|
|
1158
|
+
if (source === null)
|
|
1159
|
+
continue;
|
|
1160
|
+
const match = path.endsWith('.env') ? envPattern.exec(source) : pattern.exec(source);
|
|
1161
|
+
const value = match?.[1] ?? match?.[2] ?? match?.[3];
|
|
1162
|
+
if (typeof value === 'string' && value.trim() !== '')
|
|
1163
|
+
return value.trim();
|
|
1164
|
+
}
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
function readJson(path) {
|
|
1168
|
+
if (!existsSync(path))
|
|
1169
|
+
return null;
|
|
1170
|
+
try {
|
|
1171
|
+
return recordValue(JSON.parse(readFileSync(path, 'utf8')));
|
|
1172
|
+
}
|
|
1173
|
+
catch {
|
|
1174
|
+
return null;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
function recordValue(value) { return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : null; }
|
|
1178
|
+
function textValue(value) { return typeof value === 'string' && value.trim() ? value.trim() : null; }
|
|
1179
|
+
function numberValue(value) { const result = typeof value === 'number' ? value : Number(value); return Number.isFinite(result) ? result : null; }
|
|
1180
|
+
function integerValue(value) { const result = numberValue(value); return result === null ? null : Math.round(result); }
|
|
1181
|
+
function timestampValue(value) {
|
|
1182
|
+
const numeric = numberValue(value);
|
|
1183
|
+
if (numeric !== null)
|
|
1184
|
+
return numeric > 10_000_000_000 ? Math.round(numeric / 1000) : Math.round(numeric);
|
|
1185
|
+
if (typeof value === 'string') {
|
|
1186
|
+
const parsed = Date.parse(value);
|
|
1187
|
+
return Number.isFinite(parsed) ? Math.round(parsed / 1000) : null;
|
|
1188
|
+
}
|
|
1189
|
+
return null;
|
|
1190
|
+
}
|
|
1191
|
+
function clamp(value) { return Math.max(0, Math.min(100, value)); }
|
|
1192
|
+
function booleanValue(value) { return typeof value === 'boolean' ? value : null; }
|
|
1193
|
+
/** 点数余额保持字符串以保留上游十进制精度;数字也归一为字符串。 */
|
|
1194
|
+
function creditBalanceValue(value) {
|
|
1195
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
1196
|
+
return String(value);
|
|
1197
|
+
return textValue(value);
|
|
1198
|
+
}
|
|
1199
|
+
function normalizeDeepseekUsage(value, baseUrl) {
|
|
1200
|
+
const root = recordValue(value);
|
|
1201
|
+
if (root === null)
|
|
1202
|
+
return null;
|
|
1203
|
+
const rawBalances = root.balance_infos ?? root.balanceInfos ?? root.balances;
|
|
1204
|
+
if (!Array.isArray(rawBalances))
|
|
1205
|
+
return null;
|
|
1206
|
+
const balances = rawBalances.flatMap((value) => {
|
|
1207
|
+
const source = recordValue(value);
|
|
1208
|
+
const currency = textValue(source?.currency);
|
|
1209
|
+
const totalBalance = numberValue(source?.total_balance ?? source?.totalBalance);
|
|
1210
|
+
if (currency === null || totalBalance === null)
|
|
1211
|
+
return [];
|
|
1212
|
+
return [{
|
|
1213
|
+
currency,
|
|
1214
|
+
totalBalance,
|
|
1215
|
+
grantedBalance: numberValue(source?.granted_balance ?? source?.grantedBalance) ?? 0,
|
|
1216
|
+
toppedUpBalance: numberValue(source?.topped_up_balance ?? source?.toppedUpBalance) ?? 0,
|
|
1217
|
+
}];
|
|
1218
|
+
});
|
|
1219
|
+
if (balances.length === 0)
|
|
1220
|
+
return null;
|
|
1221
|
+
return {
|
|
1222
|
+
upstreamUrl: sanitizeUpstreamUrl(baseUrl),
|
|
1223
|
+
isAvailable: typeof root.is_available === 'boolean' ? root.is_available : typeof root.isAvailable === 'boolean' ? root.isAvailable : null,
|
|
1224
|
+
balances,
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
function resolveDeepseekSources() {
|
|
1228
|
+
const sources = [];
|
|
1229
|
+
const add = (source) => {
|
|
1230
|
+
if (source === null || source.baseUrl.trim() === '' || source.apiKey.trim() === '')
|
|
1231
|
+
return;
|
|
1232
|
+
if (!sources.some((item) => item.baseUrl === source.baseUrl && item.apiKey === source.apiKey))
|
|
1233
|
+
sources.push(source);
|
|
1234
|
+
};
|
|
1235
|
+
const dshBaseUrl = textValue(process.env.DSH_BASE_URL);
|
|
1236
|
+
const dshApiKey = textValue(process.env.DSH_API_KEY);
|
|
1237
|
+
add(dshBaseUrl !== null && dshApiKey !== null ? { baseUrl: dshBaseUrl, apiKey: dshApiKey } : null);
|
|
1238
|
+
const deepseekBaseUrl = textValue(process.env.DEEPSEEK_BASE_URL);
|
|
1239
|
+
const deepseekApiKey = textValue(process.env.DEEPSEEK_API_KEY) ?? readDshCredential('DEEPSEEK_API_KEY');
|
|
1240
|
+
add(deepseekApiKey === null ? null : { baseUrl: deepseekBaseUrl ?? 'https://api.deepseek.com', apiKey: deepseekApiKey });
|
|
1241
|
+
add(envSource('DEEPSEEK_BASE_URL', 'DEEPSEEK_API_KEY'));
|
|
1242
|
+
add(findConfigSource(readJson(join(homedir(), '.dsh', 'config.json'))));
|
|
1243
|
+
return sources;
|
|
1244
|
+
}
|
|
1245
|
+
function resolveDshProviderSource(providerId) {
|
|
1246
|
+
const normalized = providerId?.trim();
|
|
1247
|
+
if (normalized === undefined || normalized === '')
|
|
1248
|
+
return null;
|
|
1249
|
+
const envPrefix = normalized.replace(/[^a-z0-9]+/giu, '_').toUpperCase();
|
|
1250
|
+
const envBaseUrl = textValue(process.env[`${envPrefix}_BASE_URL`]);
|
|
1251
|
+
const envApiKey = textValue(process.env[`${envPrefix}_API_KEY`]);
|
|
1252
|
+
if (envBaseUrl !== null && envApiKey !== null)
|
|
1253
|
+
return { baseUrl: envBaseUrl, apiKey: envApiKey };
|
|
1254
|
+
return readDshProviderSource(normalized);
|
|
1255
|
+
}
|
|
1256
|
+
function resolveDshDefaultProvider() {
|
|
1257
|
+
return readDshDefaultProvider();
|
|
1258
|
+
}
|
|
1259
|
+
function isOfficialDeepseekProvider(providerId) {
|
|
1260
|
+
if (providerId === undefined)
|
|
1261
|
+
return false;
|
|
1262
|
+
return /^(?:deepseek(?:-official)?|official-deepseek)$/iu.test(providerId.trim());
|
|
1263
|
+
}
|
|
1264
|
+
/** 官方接口必须同时满足提供商名称和官方 baseURL,避免第三方代理冒充官方。 */
|
|
1265
|
+
function isOfficialDeepseekSource(providerId, source) {
|
|
1266
|
+
if (source === null || !isOfficialDeepseekUrl(source.baseUrl))
|
|
1267
|
+
return false;
|
|
1268
|
+
return providerId === undefined || isOfficialDeepseekProvider(providerId);
|
|
1269
|
+
}
|
|
1270
|
+
function isThirdPartyDeepseekProvider(providerId) {
|
|
1271
|
+
return providerId !== undefined && providerId.trim() !== '' && !isOfficialDeepseekProvider(providerId);
|
|
1272
|
+
}
|
|
1273
|
+
function providerSummary(definition, baseUrl, logoDataUrl, capability) {
|
|
1274
|
+
const resolved = definition ?? thirdPartyProvider({ baseUrl });
|
|
1275
|
+
return {
|
|
1276
|
+
id: resolved.id,
|
|
1277
|
+
displayName: resolved.displayName,
|
|
1278
|
+
baseUrl: sanitizeUpstreamUrl(baseUrl),
|
|
1279
|
+
capability: capability ?? resolved.capability,
|
|
1280
|
+
logoUrl: resolved.logoUrl,
|
|
1281
|
+
...(logoDataUrl === '' ? {} : { logoDataUrl }),
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
function withProvider(usage, definition, baseUrl = '') {
|
|
1285
|
+
return { ...usage, provider: providerSummary(definition, baseUrl, '') };
|
|
1286
|
+
}
|
|
1287
|
+
function resolveSub2ApiSources(adapterId, providerId) {
|
|
1288
|
+
const sources = [];
|
|
1289
|
+
const add = (source) => {
|
|
1290
|
+
if (source === null || source.baseUrl.trim() === '' || source.apiKey.trim() === '')
|
|
1291
|
+
return;
|
|
1292
|
+
if (!sources.some((item) => item.baseUrl === source.baseUrl && item.apiKey === source.apiKey))
|
|
1293
|
+
sources.push(source);
|
|
1294
|
+
};
|
|
1295
|
+
if (adapterId === 'codex') {
|
|
1296
|
+
const home = process.env.CODEX_HOME ?? join(homedir(), '.codex');
|
|
1297
|
+
const config = readText(join(home, 'config.toml')) ?? '';
|
|
1298
|
+
add(readCodexSource(home, config));
|
|
1299
|
+
}
|
|
1300
|
+
if (adapterId === 'claude-code') {
|
|
1301
|
+
const home = process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), '.claude');
|
|
1302
|
+
const settings = readJson(join(home, 'settings.json'));
|
|
1303
|
+
const env = recordValue(settings)?.env;
|
|
1304
|
+
add({
|
|
1305
|
+
baseUrl: textValue(process.env.ANTHROPIC_BASE_URL) ?? textValue(recordValue(env)?.ANTHROPIC_BASE_URL) ?? '',
|
|
1306
|
+
apiKey: textValue(process.env.ANTHROPIC_AUTH_TOKEN) ?? textValue(process.env.ANTHROPIC_API_KEY) ?? textValue(recordValue(env)?.ANTHROPIC_AUTH_TOKEN) ?? textValue(recordValue(env)?.ANTHROPIC_API_KEY) ?? '',
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
if (adapterId === 'opencode') {
|
|
1310
|
+
const configCandidates = [
|
|
1311
|
+
join(homedir(), '.config', 'opencode', 'opencode.json'),
|
|
1312
|
+
...(process.platform === 'win32' && process.env.APPDATA
|
|
1313
|
+
? [join(process.env.APPDATA, 'opencode', 'opencode.json')]
|
|
1314
|
+
: []),
|
|
1315
|
+
];
|
|
1316
|
+
const config = configCandidates.map(readJson).find((value) => value !== null) ?? null;
|
|
1317
|
+
add(findConfigSource(config));
|
|
1318
|
+
}
|
|
1319
|
+
if (adapterId === 'dsh') {
|
|
1320
|
+
const providerSource = resolveDshProviderSource(providerId);
|
|
1321
|
+
add(providerSource);
|
|
1322
|
+
// 已明确拿到当前提供商时只查询它的上游,不能把另一个配置项的余额冒充过来。
|
|
1323
|
+
if (providerId !== undefined && !isOfficialDeepseekProvider(providerId))
|
|
1324
|
+
return sources;
|
|
1325
|
+
for (const source of resolveDeepseekSources()) {
|
|
1326
|
+
if (!isOfficialDeepseekUrl(source.baseUrl))
|
|
1327
|
+
add(source);
|
|
1328
|
+
}
|
|
1329
|
+
add(envSource('OPENAI_BASE_URL', 'OPENAI_API_KEY'));
|
|
1330
|
+
}
|
|
1331
|
+
if (adapterId === 'grok') {
|
|
1332
|
+
add(envSource('GROK_BASE_URL', 'GROK_API_KEY'));
|
|
1333
|
+
add(envSource('XAI_BASE_URL', 'XAI_API_KEY'));
|
|
1334
|
+
add(envSource('XAI_API_BASE_URL', 'XAI_API_KEY'));
|
|
1335
|
+
add(findConfigSource(readJson(join(homedir(), '.grok', 'config.json'))));
|
|
1336
|
+
}
|
|
1337
|
+
return sources;
|
|
1338
|
+
}
|
|
1339
|
+
function readCodexSource(homeDirectory, config) {
|
|
1340
|
+
const baseUrl = readCodexBaseUrl(config) ?? textValue(process.env.OPENAI_BASE_URL);
|
|
1341
|
+
if (baseUrl === null)
|
|
1342
|
+
return null;
|
|
1343
|
+
const provider = tomlScalar(config, 'model_provider');
|
|
1344
|
+
const section = provider === null ? '' : tomlSection(config, `model_providers.${provider}`);
|
|
1345
|
+
const token = tomlScalar(section, 'experimental_bearer_token')
|
|
1346
|
+
?? tomlScalar(section, 'api_key')
|
|
1347
|
+
?? (() => {
|
|
1348
|
+
const environmentName = tomlScalar(section, 'api_key_env');
|
|
1349
|
+
return environmentName === null ? null : textValue(process.env[environmentName]);
|
|
1350
|
+
})()
|
|
1351
|
+
?? textValue(readJsonValue(join(homeDirectory, 'auth.json'), 'OPENAI_API_KEY'))
|
|
1352
|
+
?? textValue(process.env.OPENAI_API_KEY);
|
|
1353
|
+
return token === null ? null : { baseUrl, apiKey: token };
|
|
1354
|
+
}
|
|
1355
|
+
function readCodexBaseUrl(config) {
|
|
1356
|
+
const provider = tomlScalar(config, 'model_provider');
|
|
1357
|
+
const section = provider === null ? '' : tomlSection(config, `model_providers.${provider}`);
|
|
1358
|
+
return tomlScalar(section, 'base_url') ?? tomlScalar(config, 'base_url');
|
|
1359
|
+
}
|
|
1360
|
+
function tomlSection(source, name) {
|
|
1361
|
+
if (source === '')
|
|
1362
|
+
return '';
|
|
1363
|
+
const escaped = name.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
1364
|
+
const start = source.search(new RegExp(`^\\[${escaped}\\]\\s*$`, 'mu'));
|
|
1365
|
+
if (start < 0)
|
|
1366
|
+
return '';
|
|
1367
|
+
const rest = source.slice(start);
|
|
1368
|
+
const next = /^\[[^\n]+\]\s*$/mu.exec(rest.slice(1));
|
|
1369
|
+
return next === null ? rest : rest.slice(0, next.index + 1);
|
|
1370
|
+
}
|
|
1371
|
+
function tomlScalar(source, key) {
|
|
1372
|
+
if (source === '')
|
|
1373
|
+
return null;
|
|
1374
|
+
const escaped = key.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
1375
|
+
const match = new RegExp(`^\\s*${escaped}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^#\\s]+))`, 'mu').exec(source);
|
|
1376
|
+
const value = match?.[1] ?? match?.[2] ?? match?.[3];
|
|
1377
|
+
return textValue(value);
|
|
1378
|
+
}
|
|
1379
|
+
function isOfficialAgentSource(adapterId, source) {
|
|
1380
|
+
if (adapterId === 'codex')
|
|
1381
|
+
return isOfficialOpenAiUrl(source.baseUrl);
|
|
1382
|
+
if (adapterId === 'claude-code')
|
|
1383
|
+
return isOfficialAnthropicUrl(source.baseUrl);
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1386
|
+
function isOfficialDeepseekUrl(value) {
|
|
1387
|
+
try {
|
|
1388
|
+
const hostname = new URL(value).hostname.toLowerCase();
|
|
1389
|
+
return hostname === 'api.deepseek.com' || hostname === 'api.deepseek.com.cn';
|
|
1390
|
+
}
|
|
1391
|
+
catch {
|
|
1392
|
+
return false;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
function deepseekApiRoot(value) {
|
|
1396
|
+
try {
|
|
1397
|
+
const url = new URL(value);
|
|
1398
|
+
url.pathname = url.pathname.replace(/\/+$/u, '').replace(/\/(?:anthropic(?:\/v1)?|v1)$/u, '');
|
|
1399
|
+
url.search = '';
|
|
1400
|
+
url.hash = '';
|
|
1401
|
+
return url.toString().replace(/\/$/u, '');
|
|
1402
|
+
}
|
|
1403
|
+
catch {
|
|
1404
|
+
return '';
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
function defaultOpenCodeDataDirectory() {
|
|
1408
|
+
if (process.platform === 'win32')
|
|
1409
|
+
return join(process.env.APPDATA ?? join(homedir(), 'AppData', 'Roaming'), 'opencode');
|
|
1410
|
+
return join(homedir(), '.local', 'share', 'opencode');
|
|
1411
|
+
}
|
|
1412
|
+
function envSource(baseName, keyName) {
|
|
1413
|
+
const baseUrl = textValue(process.env[baseName]);
|
|
1414
|
+
const apiKey = textValue(process.env[keyName]);
|
|
1415
|
+
return baseUrl === null || apiKey === null ? null : { baseUrl, apiKey };
|
|
1416
|
+
}
|
|
1417
|
+
function findConfigSource(value, depth = 0) {
|
|
1418
|
+
if (depth > 6 || !value || typeof value !== 'object' || Array.isArray(value))
|
|
1419
|
+
return null;
|
|
1420
|
+
const record = value;
|
|
1421
|
+
const baseUrl = textValue(record.baseURL ?? record.baseUrl ?? record.base_url);
|
|
1422
|
+
const apiKey = textValue(record.apiKey ?? record.api_key ?? record.key);
|
|
1423
|
+
if (baseUrl !== null && apiKey !== null)
|
|
1424
|
+
return { baseUrl, apiKey };
|
|
1425
|
+
for (const child of Object.values(record)) {
|
|
1426
|
+
const source = findConfigSource(child, depth + 1);
|
|
1427
|
+
if (source !== null)
|
|
1428
|
+
return source;
|
|
1429
|
+
}
|
|
1430
|
+
return null;
|
|
1431
|
+
}
|
|
1432
|
+
function normalizeSub2ApiUsage(value, baseUrl) {
|
|
1433
|
+
const root = recordValue(value);
|
|
1434
|
+
if (root === null)
|
|
1435
|
+
return null;
|
|
1436
|
+
const usage = recordValue(root.usage) ?? {};
|
|
1437
|
+
const daily = Array.isArray(root.daily_usage) ? root.daily_usage.flatMap((item) => normalizeDailyPoint(item)) : [];
|
|
1438
|
+
const latestDaily = daily.at(-1);
|
|
1439
|
+
const today = normalizePoint(usage.today) ?? latestDaily;
|
|
1440
|
+
const total = normalizePoint(usage.total);
|
|
1441
|
+
const balance = numberValue(root.balance) ?? numberValue(root.remaining);
|
|
1442
|
+
if (balance === null || today === undefined || today === null || total === undefined || total === null)
|
|
1443
|
+
return null;
|
|
1444
|
+
const models = Array.isArray(root.model_stats) ? root.model_stats.flatMap((item) => normalizeModelPoint(item)) : [];
|
|
1445
|
+
return {
|
|
1446
|
+
upstreamType: detectUpstreamType(root, baseUrl),
|
|
1447
|
+
upstreamUrl: sanitizeUpstreamUrl(baseUrl),
|
|
1448
|
+
logoDataUrl: '',
|
|
1449
|
+
logoUrl: '',
|
|
1450
|
+
balance,
|
|
1451
|
+
remaining: numberValue(root.remaining) ?? balance,
|
|
1452
|
+
unit: textValue(root.unit) ?? 'USD',
|
|
1453
|
+
planName: textValue(root.planName ?? root.plan_name),
|
|
1454
|
+
mode: textValue(root.mode),
|
|
1455
|
+
today,
|
|
1456
|
+
total,
|
|
1457
|
+
daily,
|
|
1458
|
+
models,
|
|
1459
|
+
rpm: numberValue(usage.rpm),
|
|
1460
|
+
tpm: numberValue(usage.tpm),
|
|
1461
|
+
averageDurationMs: numberValue(usage.average_duration_ms),
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
function detectUpstreamType(root, baseUrl) {
|
|
1465
|
+
const provider = `${textValue(root.provider) ?? ''} ${textValue(root.source) ?? ''} ${textValue(root.platform) ?? ''}`.toLowerCase();
|
|
1466
|
+
if (provider.includes('one-api') || provider.includes('oneapi'))
|
|
1467
|
+
return 'OneAPI';
|
|
1468
|
+
if (provider.includes('sub2api') || Array.isArray(root.daily_usage) || Array.isArray(root.model_stats))
|
|
1469
|
+
return 'Sub2API';
|
|
1470
|
+
try {
|
|
1471
|
+
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
1472
|
+
if (hostname.includes('oneapi'))
|
|
1473
|
+
return 'OneAPI';
|
|
1474
|
+
if (hostname.includes('sub2api'))
|
|
1475
|
+
return 'Sub2API';
|
|
1476
|
+
}
|
|
1477
|
+
catch {
|
|
1478
|
+
// 非标准地址仍然可以展示统计,只标记为其他上游。
|
|
1479
|
+
}
|
|
1480
|
+
return '其他';
|
|
1481
|
+
}
|
|
1482
|
+
function sanitizeUpstreamUrl(value) {
|
|
1483
|
+
try {
|
|
1484
|
+
const url = new URL(value);
|
|
1485
|
+
url.username = '';
|
|
1486
|
+
url.password = '';
|
|
1487
|
+
url.search = '';
|
|
1488
|
+
url.hash = '';
|
|
1489
|
+
return url.toString().replace(/\/$/u, '');
|
|
1490
|
+
}
|
|
1491
|
+
catch {
|
|
1492
|
+
return '';
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
function buildLogoUrl(baseUrl) {
|
|
1496
|
+
try {
|
|
1497
|
+
return new URL('/logo.svg', baseUrl).toString();
|
|
1498
|
+
}
|
|
1499
|
+
catch {
|
|
1500
|
+
return '';
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
/** 获取小型公开图标并转为 CSP 允许的 data URL;图标失败不影响订阅数据。 */
|
|
1504
|
+
async function readLogoDataUrl(url, request, timeoutMs) {
|
|
1505
|
+
let parsed;
|
|
1506
|
+
try {
|
|
1507
|
+
parsed = new URL(url);
|
|
1508
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
|
|
1509
|
+
return '';
|
|
1510
|
+
}
|
|
1511
|
+
catch {
|
|
1512
|
+
return '';
|
|
1513
|
+
}
|
|
1514
|
+
const controller = new AbortController();
|
|
1515
|
+
const timer = setTimeout(() => controller.abort(), Math.min(timeoutMs, 3_000));
|
|
1516
|
+
try {
|
|
1517
|
+
const response = await request(parsed.toString(), { headers: { Accept: 'image/*' }, signal: controller.signal });
|
|
1518
|
+
if (!response.ok)
|
|
1519
|
+
return '';
|
|
1520
|
+
const contentType = (response.headers.get('content-type') ?? '').split(';', 1)[0]?.trim().toLowerCase() ?? '';
|
|
1521
|
+
if (!isSupportedLogoContentType(contentType))
|
|
1522
|
+
return '';
|
|
1523
|
+
if (response.url !== '' && new URL(response.url).origin !== parsed.origin)
|
|
1524
|
+
return '';
|
|
1525
|
+
const bytes = await readResponseBytes(response, 64 * 1024);
|
|
1526
|
+
if (bytes === null || (contentType === 'image/svg+xml' && !isSafeSvg(bytes)))
|
|
1527
|
+
return '';
|
|
1528
|
+
return `data:${contentType};base64,${Buffer.from(bytes).toString('base64')}`;
|
|
1529
|
+
}
|
|
1530
|
+
catch {
|
|
1531
|
+
return '';
|
|
1532
|
+
}
|
|
1533
|
+
finally {
|
|
1534
|
+
clearTimeout(timer);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
function isSupportedLogoContentType(value) {
|
|
1538
|
+
return value === 'image/svg+xml' || value === 'image/png' || value === 'image/jpeg' || value === 'image/gif' || value === 'image/webp' || value === 'image/avif' || value === 'image/x-icon' || value === 'image/vnd.microsoft.icon';
|
|
1539
|
+
}
|
|
1540
|
+
async function readResponseBytes(response, maxBytes) {
|
|
1541
|
+
const declaredLength = Number(response.headers.get('content-length'));
|
|
1542
|
+
if (Number.isFinite(declaredLength) && declaredLength > maxBytes)
|
|
1543
|
+
return null;
|
|
1544
|
+
if (response.body === null) {
|
|
1545
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
1546
|
+
return bytes.byteLength > maxBytes ? null : bytes;
|
|
1547
|
+
}
|
|
1548
|
+
const reader = response.body.getReader();
|
|
1549
|
+
const chunks = [];
|
|
1550
|
+
let total = 0;
|
|
1551
|
+
try {
|
|
1552
|
+
while (true) {
|
|
1553
|
+
const next = await reader.read();
|
|
1554
|
+
if (next.done)
|
|
1555
|
+
break;
|
|
1556
|
+
total += next.value.byteLength;
|
|
1557
|
+
if (total > maxBytes) {
|
|
1558
|
+
await reader.cancel();
|
|
1559
|
+
return null;
|
|
1560
|
+
}
|
|
1561
|
+
chunks.push(next.value);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
finally {
|
|
1565
|
+
reader.releaseLock();
|
|
1566
|
+
}
|
|
1567
|
+
const bytes = new Uint8Array(total);
|
|
1568
|
+
let offset = 0;
|
|
1569
|
+
for (const chunk of chunks) {
|
|
1570
|
+
bytes.set(chunk, offset);
|
|
1571
|
+
offset += chunk.byteLength;
|
|
1572
|
+
}
|
|
1573
|
+
return bytes;
|
|
1574
|
+
}
|
|
1575
|
+
function isSafeSvg(bytes) {
|
|
1576
|
+
const source = new TextDecoder().decode(bytes).toLowerCase();
|
|
1577
|
+
return !/<\/?script\b|<\/?foreignobject\b|\bon[a-z]+\s*=|(?:href|xlink:href)\s*=\s*["']https?:|url\(\s*https?:/u.test(source);
|
|
1578
|
+
}
|
|
1579
|
+
function normalizePoint(value) {
|
|
1580
|
+
const source = recordValue(value);
|
|
1581
|
+
if (source === null)
|
|
1582
|
+
return null;
|
|
1583
|
+
const inputTokens = nonNegative(source.input_tokens);
|
|
1584
|
+
const outputTokens = nonNegative(source.output_tokens);
|
|
1585
|
+
const cacheCreationTokens = nonNegative(source.cache_creation_tokens ?? source.cache_write_tokens);
|
|
1586
|
+
const cacheReadTokens = nonNegative(source.cache_read_tokens);
|
|
1587
|
+
const totalTokens = nonNegative(source.total_tokens) || inputTokens + outputTokens + cacheCreationTokens + cacheReadTokens;
|
|
1588
|
+
const requests = nonNegative(source.requests);
|
|
1589
|
+
const cost = numberValue(source.cost) ?? numberValue(source.actual_cost) ?? 0;
|
|
1590
|
+
const actualCost = numberValue(source.actual_cost) ?? cost;
|
|
1591
|
+
return { requests, inputTokens, outputTokens, cacheCreationTokens, cacheReadTokens, totalTokens, cost, actualCost, cacheHitRate: calculateCacheHitRate(inputTokens, cacheReadTokens) };
|
|
1592
|
+
}
|
|
1593
|
+
function normalizeDailyPoint(value) {
|
|
1594
|
+
const source = recordValue(value);
|
|
1595
|
+
const point = normalizePoint(source);
|
|
1596
|
+
const date = textValue(source?.date);
|
|
1597
|
+
return point === null || date === null ? [] : [{ date, ...point }];
|
|
1598
|
+
}
|
|
1599
|
+
function normalizeModelPoint(value) {
|
|
1600
|
+
const source = recordValue(value);
|
|
1601
|
+
const point = normalizePoint(source);
|
|
1602
|
+
const model = textValue(source?.model);
|
|
1603
|
+
return point === null || model === null ? [] : [{ model, accountCost: numberValue(source?.account_cost) ?? point.actualCost, ...point }];
|
|
1604
|
+
}
|
|
1605
|
+
function calculateCacheHitRate(inputTokens, cacheReadTokens) {
|
|
1606
|
+
const denominator = inputTokens + cacheReadTokens;
|
|
1607
|
+
return denominator === 0 ? 0 : Number((cacheReadTokens / denominator * 100).toFixed(4));
|
|
1608
|
+
}
|
|
1609
|
+
function nonNegative(value) {
|
|
1610
|
+
const result = numberValue(value);
|
|
1611
|
+
return result === null ? 0 : Math.max(0, result);
|
|
1612
|
+
}
|
|
1613
|
+
function readJsonValue(path, key) {
|
|
1614
|
+
return readJson(path)?.[key];
|
|
1615
|
+
}
|
|
1616
|
+
//# sourceMappingURL=provider-subscription.js.map
|