@jingyi0605/codingns4dsh 0.2.0-beta.2 → 0.2.0-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -4
- package/README.md +18 -7
- package/assets/provider-icons/antigravity.svg +39 -0
- package/assets/provider-icons/codebuddy.svg +37 -0
- package/assets/provider-icons/cursor-cli.svg +1 -0
- package/assets/provider-icons/kiro-cli.svg +11 -0
- package/assets/provider-icons/minimax-code.svg +4 -0
- package/assets/provider-icons/qoder-cn.svg +5 -0
- package/assets/provider-icons/qoder.svg +5 -0
- package/assets/provider-icons/workbuddy.svg +29 -0
- package/assets/provider-icons/zcode.svg +14 -0
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.d.ts.map +1 -1
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js +78 -1
- package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js.map +1 -1
- package/data/build/dist/client/account-bar.d.ts +2 -1
- package/data/build/dist/client/account-bar.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.js +21 -16
- package/data/build/dist/client/account-bar.js.map +1 -1
- package/data/build/dist/client/bundle.js +8147 -2158
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-catalog.d.ts +1 -1
- package/data/build/dist/client/cli-catalog.d.ts.map +1 -1
- package/data/build/dist/client/cli-catalog.js +11 -5
- package/data/build/dist/client/cli-catalog.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +127 -21
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/debug/ui.d.ts +2 -1
- package/data/build/dist/client/debug/ui.d.ts.map +1 -1
- package/data/build/dist/client/debug/ui.js +41 -34
- package/data/build/dist/client/debug/ui.js.map +1 -1
- 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 +597 -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/external-tool-stream.d.ts.map +1 -1
- package/data/build/dist/client/external-tool-stream.js +44 -36
- package/data/build/dist/client/external-tool-stream.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.d.ts +7 -2
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +153 -95
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/debug.d.ts.map +1 -1
- package/data/build/dist/client/features/debug.js +5 -3
- package/data/build/dist/client/features/debug.js.map +1 -1
- package/data/build/dist/client/features/file-management.d.ts.map +1 -1
- package/data/build/dist/client/features/file-management.js +7 -4
- package/data/build/dist/client/features/file-management.js.map +1 -1
- package/data/build/dist/client/features/lan-access-panel.js +10 -10
- package/data/build/dist/client/features/lan-access-panel.js.map +1 -1
- package/data/build/dist/client/features/lan-access.d.ts.map +1 -1
- package/data/build/dist/client/features/lan-access.js +8 -3
- package/data/build/dist/client/features/lan-access.js.map +1 -1
- package/data/build/dist/client/features/login-protection-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/login-protection-panel.js +9 -7
- package/data/build/dist/client/features/login-protection-panel.js.map +1 -1
- package/data/build/dist/client/features/login-protection.js +2 -2
- package/data/build/dist/client/features/login-protection.js.map +1 -1
- package/data/build/dist/client/features/mobile-access-panel.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access-panel.js +8 -7
- package/data/build/dist/client/features/mobile-access-panel.js.map +1 -1
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access.js +6 -2
- package/data/build/dist/client/features/mobile-access.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts +6 -4
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +459 -27
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/reverse-proxy.js +2 -2
- package/data/build/dist/client/features/reverse-proxy.js.map +1 -1
- package/data/build/dist/client/features/terminal-enhancement.js +2 -2
- package/data/build/dist/client/features/terminal-enhancement.js.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.js +8 -3
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
- package/data/build/dist/client/file-management-dom.d.ts +3 -0
- package/data/build/dist/client/file-management-dom.d.ts.map +1 -1
- package/data/build/dist/client/file-management-dom.js +41 -30
- package/data/build/dist/client/file-management-dom.js.map +1 -1
- package/data/build/dist/client/git-history-graph.d.ts +2 -2
- package/data/build/dist/client/git-history-graph.d.ts.map +1 -1
- package/data/build/dist/client/git-history-graph.js +2 -2
- package/data/build/dist/client/git-history-graph.js.map +1 -1
- package/data/build/dist/client/git-management.d.ts +2 -0
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +103 -75
- package/data/build/dist/client/git-management.js.map +1 -1
- 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/index.d.ts +2 -0
- package/data/build/dist/client/index.d.ts.map +1 -1
- package/data/build/dist/client/index.js +6 -5
- package/data/build/dist/client/index.js.map +1 -1
- package/data/build/dist/client/locale.d.ts +7 -0
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +140 -42
- package/data/build/dist/client/locale.js.map +1 -1
- 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 +139 -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 +223 -0
- package/data/build/dist/client/locales/git.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 +33 -0
- package/data/build/dist/client/locales/panels.js.map +1 -0
- package/data/build/dist/client/locales/peerHost.d.ts +9 -0
- package/data/build/dist/client/locales/peerHost.d.ts.map +1 -0
- package/data/build/dist/client/locales/peerHost.js +153 -0
- package/data/build/dist/client/locales/peerHost.js.map +1 -0
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts +9 -0
- package/data/build/dist/client/locales/peerHostWorkspace.d.ts.map +1 -0
- package/data/build/dist/client/locales/peerHostWorkspace.js +69 -0
- package/data/build/dist/client/locales/peerHostWorkspace.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 +71 -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 +215 -0
- package/data/build/dist/client/locales/usage.js.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts +44 -0
- package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -0
- package/data/build/dist/client/mobile-session-interaction.js +308 -0
- package/data/build/dist/client/mobile-session-interaction.js.map +1 -0
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts +55 -7
- package/data/build/dist/client/mobile-sidebar-gestures.d.ts.map +1 -1
- package/data/build/dist/client/mobile-sidebar-gestures.js +339 -40
- package/data/build/dist/client/mobile-sidebar-gestures.js.map +1 -1
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts +10 -2
- package/data/build/dist/client/mobile-sidebar-rail-dom.d.ts.map +1 -1
- package/data/build/dist/client/mobile-sidebar-rail-dom.js +14 -6
- package/data/build/dist/client/mobile-sidebar-rail-dom.js.map +1 -1
- package/data/build/dist/client/model-catalog-cache.d.ts +5 -0
- package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -0
- package/data/build/dist/client/model-catalog-cache.js +58 -0
- package/data/build/dist/client/model-catalog-cache.js.map +1 -0
- package/data/build/dist/client/peer-host-aggregate-refresh.d.ts +7 -0
- package/data/build/dist/client/peer-host-aggregate-refresh.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-aggregate-refresh.js +13 -1
- package/data/build/dist/client/peer-host-aggregate-refresh.js.map +1 -1
- package/data/build/dist/client/peer-host-connection-button.d.ts +14 -1
- package/data/build/dist/client/peer-host-connection-button.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-connection-button.js +12 -4
- package/data/build/dist/client/peer-host-connection-button.js.map +1 -1
- package/data/build/dist/client/peer-host-management-panel.d.ts +3 -0
- package/data/build/dist/client/peer-host-management-panel.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-management-panel.js +83 -79
- package/data/build/dist/client/peer-host-management-panel.js.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.d.ts +17 -1
- package/data/build/dist/client/peer-host-native-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-projection.js +54 -8
- package/data/build/dist/client/peer-host-native-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.d.ts +6 -2
- package/data/build/dist/client/peer-host-native-store-projection.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-native-store-projection.js +308 -10
- package/data/build/dist/client/peer-host-native-store-projection.js.map +1 -1
- package/data/build/dist/client/peer-host-scoped-client.js +5 -5
- package/data/build/dist/client/peer-host-scoped-client.js.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.d.ts +8 -0
- package/data/build/dist/client/peer-host-workspace-tab.d.ts.map +1 -1
- package/data/build/dist/client/peer-host-workspace-tab.js +48 -28
- package/data/build/dist/client/peer-host-workspace-tab.js.map +1 -1
- package/data/build/dist/client/provider-icon-assets.js +18 -0
- package/data/build/dist/client/provider-icon-assets.js.map +1 -1
- package/data/build/dist/client/provider-icons.d.ts +8 -2
- package/data/build/dist/client/provider-icons.d.ts.map +1 -1
- package/data/build/dist/client/provider-icons.js +28 -7
- package/data/build/dist/client/provider-icons.js.map +1 -1
- package/data/build/dist/client/pwa-install-prompt.d.ts +4 -1
- package/data/build/dist/client/pwa-install-prompt.d.ts.map +1 -1
- package/data/build/dist/client/pwa-install-prompt.js +8 -7
- package/data/build/dist/client/pwa-install-prompt.js.map +1 -1
- package/data/build/dist/client/quick-phrase-layout.d.ts +11 -0
- package/data/build/dist/client/quick-phrase-layout.d.ts.map +1 -1
- package/data/build/dist/client/quick-phrase-layout.js +20 -0
- package/data/build/dist/client/quick-phrase-layout.js.map +1 -1
- package/data/build/dist/client/quick-phrase-slot.d.ts.map +1 -1
- package/data/build/dist/client/quick-phrase-slot.js +20 -8
- package/data/build/dist/client/quick-phrase-slot.js.map +1 -1
- package/data/build/dist/client/remote-web-context.js +10 -6
- package/data/build/dist/client/remote-web-context.js.map +1 -1
- package/data/build/dist/client/service-tier.d.ts +54 -0
- package/data/build/dist/client/service-tier.d.ts.map +1 -0
- package/data/build/dist/client/service-tier.js +78 -0
- package/data/build/dist/client/service-tier.js.map +1 -0
- package/data/build/dist/client/session-changed-files-view.d.ts +8 -1
- package/data/build/dist/client/session-changed-files-view.d.ts.map +1 -1
- package/data/build/dist/client/session-changed-files-view.js +71 -28
- package/data/build/dist/client/session-changed-files-view.js.map +1 -1
- package/data/build/dist/client/settings-anchor.d.ts +9 -3
- package/data/build/dist/client/settings-anchor.d.ts.map +1 -1
- package/data/build/dist/client/settings-anchor.js +8 -2
- package/data/build/dist/client/settings-anchor.js.map +1 -1
- package/data/build/dist/client/settings-promo-styles.d.ts +28 -0
- package/data/build/dist/client/settings-promo-styles.d.ts.map +1 -0
- package/data/build/dist/client/settings-promo-styles.js +58 -0
- package/data/build/dist/client/settings-promo-styles.js.map +1 -0
- package/data/build/dist/client/settings-promo.d.ts +14 -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 +2 -1
- package/data/build/dist/client/settings-section.d.ts.map +1 -1
- package/data/build/dist/client/settings-section.js +10 -7
- package/data/build/dist/client/settings-section.js.map +1 -1
- package/data/build/dist/client/subscription-slot.d.ts +4 -1
- package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
- package/data/build/dist/client/subscription-slot.js +497 -56
- package/data/build/dist/client/subscription-slot.js.map +1 -1
- package/data/build/dist/client/terminal/model.d.ts +94 -4
- package/data/build/dist/client/terminal/model.d.ts.map +1 -1
- package/data/build/dist/client/terminal/model.js +392 -33
- package/data/build/dist/client/terminal/model.js.map +1 -1
- package/data/build/dist/client/terminal/recovery.d.ts +16 -1
- package/data/build/dist/client/terminal/recovery.d.ts.map +1 -1
- package/data/build/dist/client/terminal/recovery.js +101 -39
- package/data/build/dist/client/terminal/recovery.js.map +1 -1
- package/data/build/dist/client/terminal/styles.d.ts +10 -0
- package/data/build/dist/client/terminal/styles.d.ts.map +1 -1
- package/data/build/dist/client/terminal/styles.js +27 -3
- package/data/build/dist/client/terminal/styles.js.map +1 -1
- package/data/build/dist/client/terminal/ui.d.ts +3 -2
- package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
- package/data/build/dist/client/terminal/ui.js +216 -103
- package/data/build/dist/client/terminal/ui.js.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.d.ts +8 -1
- package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -1
- package/data/build/dist/client/terminal/xterm-view.js +394 -34
- package/data/build/dist/client/terminal/xterm-view.js.map +1 -1
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-archive-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-archive-dom.js +131 -45
- package/data/build/dist/client/workspace-session-archive-dom.js.map +1 -1
- package/data/build/dist/client/workspace-session-logo-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-logo-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-logo-dom.js +3 -1
- package/data/build/dist/client/workspace-session-logo-dom.js.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.js +46 -17
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +20 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- 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 +105 -0
- package/data/build/dist/host/browser-text.js.map +1 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +58 -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 +271 -0
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts +30 -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 +210 -0
- package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +28 -2
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +74 -4
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-model-options.js +22 -9
- package/data/build/dist/host/cli-adapters/claude-model-options.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts +139 -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 +1721 -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 +22 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +254 -7
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +43 -3
- package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +681 -74
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-history.d.ts +147 -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 +659 -0
- package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -0
- package/data/build/dist/host/cli-adapters/cursor-driver.d.ts +12 -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 +20 -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 +48 -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 +111 -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 +34 -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 +121 -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 +32 -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 +121 -0
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +5 -4
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts +16 -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 +73 -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.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +459 -26
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js +21 -5
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +24 -7
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +22 -6
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +118 -21
- package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/kimi-driver.js +25 -4
- package/data/build/dist/host/cli-adapters/kimi-driver.js.map +1 -1
- 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 +11 -2
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +26 -6
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
- 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 +56 -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 +544 -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 +35 -5
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.js +213 -8
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +81 -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 +299 -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.js +18 -15
- package/data/build/dist/host/cli-adapters/native-team-proxy.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +57 -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 +126 -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 +959 -0
- package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +22 -10
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/pi-driver.js +24 -7
- package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +41 -4
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/provider-subscription.js +254 -40
- package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
- package/data/build/dist/host/cli-adapters/qoder-driver.d.ts +71 -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 +553 -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 +31 -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 +178 -0
- package/data/build/dist/host/cli-adapters/qoder-subscription.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 +54 -2
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +224 -18
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/session-store.d.ts +10 -1
- package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/session-store.js +60 -6
- package/data/build/dist/host/cli-adapters/session-store.js.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +16 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +150 -26
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +10 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +23 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
- 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 +112 -0
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts +57 -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 +843 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.d.ts +28 -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 +212 -0
- package/data/build/dist/host/cli-adapters/zcode-subscription.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +27 -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 +51 -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 +39 -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 +140 -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 +29 -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 +91 -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 +128 -0
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts +28 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/injections.js +131 -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 +170 -0
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -0
- package/data/build/dist/host/features/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/features/lan-access-dsh.js +6 -2
- package/data/build/dist/host/features/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/features/peer-host.d.ts +21 -1
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +176 -31
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +2 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/index.d.ts +15 -1
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +48 -2
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts +7 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +95 -19
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- 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/peer-host/host-api-proxy-service.d.ts +3 -0
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js +2 -0
- package/data/build/dist/host/modules/peer-host/host-api-proxy-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js +1 -0
- package/data/build/dist/host/modules/peer-host/peer-host-aggregate-service.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +9 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.d.ts +8 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.js +9 -0
- package/data/build/dist/host/modules/peer-host/peer-host-native-transport.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.d.ts +7 -0
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js +31 -3
- package/data/build/dist/host/modules/peer-host/peer-host-remote-summary-source.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts +2 -0
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts.map +1 -1
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js +26 -7
- package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts +6 -4
- package/data/build/dist/host/modules/pwa/pwa-assets.d.ts.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-assets.js +11 -9
- package/data/build/dist/host/modules/pwa/pwa-assets.js.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts +3 -0
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.d.ts.map +1 -1
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js +6 -4
- package/data/build/dist/host/modules/pwa/pwa-session-notifications.js.map +1 -1
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +106 -59
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.js +8 -2
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +14 -4
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts.map +1 -1
- package/data/build/dist/host/terminal/backends/local-pty-backend.js +14 -0
- package/data/build/dist/host/terminal/backends/local-pty-backend.js.map +1 -1
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +40 -1
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts.map +1 -1
- package/data/build/dist/host/terminal/backends/tmux-backend.js +291 -18
- package/data/build/dist/host/terminal/backends/tmux-backend.js.map +1 -1
- package/data/build/dist/host/terminal/runtime-adapter.d.ts +32 -0
- package/data/build/dist/host/terminal/runtime-adapter.d.ts.map +1 -1
- package/data/build/dist/host/terminal/runtime-adapter.js +8 -0
- package/data/build/dist/host/terminal/runtime-adapter.js.map +1 -1
- package/data/build/dist/host/terminal/runtime-manager.d.ts +3 -0
- package/data/build/dist/host/terminal/runtime-manager.d.ts.map +1 -1
- package/data/build/dist/host/terminal/runtime-manager.js +92 -4
- package/data/build/dist/host/terminal/runtime-manager.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-controller.js +58 -6
- package/data/build/dist/host/terminal/terminal-controller.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-process-service.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-process-service.js +12 -2
- package/data/build/dist/host/terminal/terminal-process-service.js.map +1 -1
- package/data/build/dist/host/terminal/terminal-service.d.ts +41 -4
- package/data/build/dist/host/terminal/terminal-service.d.ts.map +1 -1
- package/data/build/dist/host/terminal/terminal-service.js +551 -61
- package/data/build/dist/host/terminal/terminal-service.js.map +1 -1
- package/data/build/dist/index.d.ts +2 -2
- package/data/build/dist/index.d.ts.map +1 -1
- package/data/build/dist/index.js +2 -2
- package/data/build/dist/index.js.map +1 -1
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +69 -2
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.d.ts +63 -10
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js +57 -5
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.d.ts +2 -0
- package/data/build/dist/shared/contracts/peer-host.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/peer-host.js.map +1 -1
- package/data/build/dist/shared/contracts/subscription.d.ts +20 -1
- package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/subscription.js.map +1 -1
- package/data/build/dist/shared/contracts/terminal.d.ts +8 -1
- package/data/build/dist/shared/contracts/terminal.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +1 -1
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.js +1 -1
- package/data/build/dist/shared/contracts/version.js.map +1 -1
- package/data/build/dist/shared/debug.d.ts +8 -0
- package/data/build/dist/shared/debug.d.ts.map +1 -1
- package/data/build/dist/shared/debug.js +43 -7
- package/data/build/dist/shared/debug.js.map +1 -1
- 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 +3 -3
- package/data/build/dist/shared/index.d.ts.map +1 -1
- package/data/build/dist/shared/index.js +2 -2
- package/data/build/dist/shared/index.js.map +1 -1
- 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/transport/debug.d.ts +7 -0
- package/data/build/dist/transport/debug.d.ts.map +1 -1
- package/data/build/dist/transport/debug.js +33 -5
- package/data/build/dist/transport/debug.js.map +1 -1
- package/data/build/dist/transport/index.d.ts +1 -1
- package/data/build/dist/transport/index.d.ts.map +1 -1
- package/data/build/dist/transport/index.js +1 -1
- package/data/build/dist/transport/index.js.map +1 -1
- package/data/build/dist/typert.host.js +1 -1
- package/data/build/dist/typert.host.js.map +1 -1
- package/package.json +3 -1
- package/profile/README.md +2 -2
- package/profile/package.json +2 -2
- package/profile/version.json +1 -1
- package/version.json +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { spawn, spawnSync } from 'node:child_process';
|
|
2
|
-
import type { CliSubscriptionUsage } from '../../shared/contracts/subscription.js';
|
|
2
|
+
import type { CliSubscriptionResetResult, CliSubscriptionUsage } from '../../shared/contracts/subscription.js';
|
|
3
3
|
import { OfficialProviderSubscriptionService, type OfficialProviderSubscriptionOptions } from './official-provider-subscription.js';
|
|
4
|
+
import { ZcodeSubscriptionService, type ZcodeSubscriptionOptions } from './zcode-subscription.js';
|
|
5
|
+
import { QoderSubscriptionService, type QoderSubscriptionOptions } from './qoder-subscription.js';
|
|
6
|
+
import { NewApiSubscriptionService, type NewApiSubscriptionOptions } from './new-api-subscription.js';
|
|
7
|
+
import { CodeBuddySubscriptionService, type CodeBuddySubscriptionOptions } from './codebuddy-subscription.js';
|
|
8
|
+
import { CustomUpstreamClassifier, type CustomUpstreamClassifierOptions } from './custom-upstream-classifier.js';
|
|
4
9
|
type FetchLike = typeof fetch;
|
|
5
10
|
/** 统一读取 Codex、Claude Code、OpenCode 订阅摘要。所有原始凭据都留在 Host。 */
|
|
6
11
|
export declare class ProviderSubscriptionService {
|
|
@@ -9,14 +14,23 @@ export declare class ProviderSubscriptionService {
|
|
|
9
14
|
readonly claudeCode: ClaudeCodeSubscriptionService;
|
|
10
15
|
readonly opencode: OpenCodeSubscriptionService;
|
|
11
16
|
readonly sub2api: Sub2ApiUsageService;
|
|
17
|
+
readonly newApi: NewApiSubscriptionService;
|
|
18
|
+
readonly customUpstreamClassifier: CustomUpstreamClassifier;
|
|
12
19
|
readonly deepseek: DeepseekSubscriptionService;
|
|
13
20
|
readonly official: OfficialProviderSubscriptionService;
|
|
14
21
|
readonly kimi: KimiSubscriptionService;
|
|
15
22
|
readonly grok: GrokSubscriptionService;
|
|
23
|
+
readonly zcode: ZcodeSubscriptionService;
|
|
24
|
+
readonly qoder: QoderSubscriptionService;
|
|
25
|
+
readonly qoderCn: QoderSubscriptionService;
|
|
26
|
+
readonly codebuddy: CodeBuddySubscriptionService;
|
|
16
27
|
constructor(options?: ProviderSubscriptionOptions);
|
|
17
28
|
read(adapterId: string, providerId?: string): Promise<CliSubscriptionUsage | null>;
|
|
29
|
+
/** 消耗一次官方订阅重置;仅官方 Codex 订阅支持,第三方上游必须显式拒绝。 */
|
|
30
|
+
reset(adapterId: string, providerId?: string): Promise<CliSubscriptionResetResult>;
|
|
18
31
|
private readDsh;
|
|
19
32
|
private readSub2ApiFirst;
|
|
33
|
+
private readCustomUpstream;
|
|
20
34
|
}
|
|
21
35
|
export interface ProviderSubscriptionOptions {
|
|
22
36
|
readonly commandCode?: SubscriptionReader;
|
|
@@ -24,10 +38,16 @@ export interface ProviderSubscriptionOptions {
|
|
|
24
38
|
readonly claudeCode?: ClaudeCodeSubscriptionOptions;
|
|
25
39
|
readonly opencode?: OpenCodeSubscriptionOptions;
|
|
26
40
|
readonly sub2api?: Sub2ApiUsageOptions;
|
|
41
|
+
readonly newApi?: NewApiSubscriptionOptions;
|
|
42
|
+
readonly customUpstream?: CustomUpstreamClassifierOptions;
|
|
27
43
|
readonly deepseek?: DeepseekSubscriptionOptions;
|
|
28
44
|
readonly official?: OfficialProviderSubscriptionOptions;
|
|
29
45
|
readonly kimi?: KimiSubscriptionOptions;
|
|
30
46
|
readonly grok?: GrokSubscriptionOptions;
|
|
47
|
+
readonly zcode?: ZcodeSubscriptionOptions;
|
|
48
|
+
readonly qoder?: QoderSubscriptionOptions;
|
|
49
|
+
readonly qoderCn?: QoderSubscriptionOptions;
|
|
50
|
+
readonly codebuddy?: CodeBuddySubscriptionOptions;
|
|
31
51
|
/** 所有读取器共用的网络超时(毫秒);单项服务显式给出时优先。 */
|
|
32
52
|
readonly timeoutMs?: number;
|
|
33
53
|
}
|
|
@@ -55,7 +75,15 @@ export declare class DeepseekSubscriptionService {
|
|
|
55
75
|
export interface Sub2ApiUsageOptions {
|
|
56
76
|
readonly fetch?: FetchLike;
|
|
57
77
|
readonly timeoutMs?: number;
|
|
58
|
-
|
|
78
|
+
/**
|
|
79
|
+
* 按适配器或 Provider 保存自定义来源。这里使用开放键集合,确保新增
|
|
80
|
+
* Command Code、ZCode、CodeBuddy、WorkBuddy 等适配器时不会丢失配置。
|
|
81
|
+
*/
|
|
82
|
+
readonly sources?: Partial<Record<string, Sub2ApiSource | readonly Sub2ApiSource[]>>;
|
|
83
|
+
}
|
|
84
|
+
export interface Sub2ApiReadResult {
|
|
85
|
+
readonly usage: CliSubscriptionUsage | null;
|
|
86
|
+
readonly kind: 'sub2api';
|
|
59
87
|
}
|
|
60
88
|
/** 通过 Provider 的上游 base URL 检测 Sub2API;只返回脱敏后的统计摘要。 */
|
|
61
89
|
export declare class Sub2ApiUsageService {
|
|
@@ -64,11 +92,18 @@ export declare class Sub2ApiUsageService {
|
|
|
64
92
|
private readonly configuredSources;
|
|
65
93
|
constructor(options?: Sub2ApiUsageOptions);
|
|
66
94
|
hasSource(adapterId: string, providerId?: string): boolean;
|
|
95
|
+
/** 判断当前来源是否由调用方显式注入;用于隔离本机自动发现的其它来源。 */
|
|
96
|
+
hasConfiguredSource(adapterId: string, providerId?: string): boolean;
|
|
97
|
+
resolveSources(adapterId: string, providerId?: string): Sub2ApiSource[];
|
|
67
98
|
/** 只判断是否存在第三方上游;官方 Codex/Claude 源必须允许回退原生订阅读取器。 */
|
|
68
99
|
hasThirdPartySource(adapterId: string, providerId?: string): boolean;
|
|
69
|
-
read(adapterId: string, providerId?: string): Promise<CliSubscriptionUsage | null>;
|
|
70
|
-
|
|
100
|
+
read(adapterId: string, providerId?: string, source?: Sub2ApiSource): Promise<CliSubscriptionUsage | null>;
|
|
101
|
+
readWithKind(adapterId: string, providerId?: string, source?: Sub2ApiSource): Promise<Sub2ApiReadResult | null>;
|
|
102
|
+
private readSourceWithKind;
|
|
103
|
+
private configuredSource;
|
|
71
104
|
}
|
|
105
|
+
/** 判断 Sub2API 用量端点的协议结构;统计明细为空时仍保留协议分类。 */
|
|
106
|
+
export declare function isSub2ApiUsageSignature(value: unknown): boolean;
|
|
72
107
|
export interface CodexSubscriptionOptions {
|
|
73
108
|
readonly homeDirectory?: string;
|
|
74
109
|
readonly binaries?: readonly string[];
|
|
@@ -85,6 +120,8 @@ export declare class CodexSubscriptionService implements SubscriptionReader {
|
|
|
85
120
|
private command;
|
|
86
121
|
constructor(options?: CodexSubscriptionOptions);
|
|
87
122
|
read(): Promise<CliSubscriptionUsage | null>;
|
|
123
|
+
/** 消耗一次 Codex 官方重置券;凭据始终留在 Codex 侧,Host 只中转协议结果。 */
|
|
124
|
+
reset(): Promise<CliSubscriptionResetResult>;
|
|
88
125
|
}
|
|
89
126
|
export interface ClaudeCodeSubscriptionOptions {
|
|
90
127
|
readonly homeDirectory?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-subscription.d.ts","sourceRoot":"","sources":["../../../../../src/host/cli-adapters/provider-subscription.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"provider-subscription.d.ts","sourceRoot":"","sources":["../../../../../src/host/cli-adapters/provider-subscription.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,KAAK,EAAgF,0BAA0B,EAAE,oBAAoB,EAAgI,MAAM,wCAAwC,CAAA;AAE1T,OAAO,EAAE,mCAAmC,EAAE,KAAK,mCAAmC,EAAE,MAAM,qCAAqC,CAAA;AACnI,OAAO,EAAE,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAGjG,OAAO,EAAE,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAE,yBAAyB,EAAE,KAAK,yBAAyB,EAA0B,MAAM,2BAA2B,CAAA;AAC7H,OAAO,EAAE,4BAA4B,EAAE,K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B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACzC;AAMD,qGAAqG;AACrG,qBAAa,uBAAwB,YAAW,kBAAkB;IAChE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmB;gBAEvC,OAAO,GAAE,uBAA4B;IAM3C,IAAI,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAiDlD,OAAO,CAAC,eAAe;CASxB"}
|
|
@@ -2,10 +2,16 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { spawn, spawnSync } from 'node:child_process';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
5
6
|
import { identifyModelProvider, normalizeProviderBaseUrl, thirdPartyProvider } from './provider-registry.js';
|
|
6
7
|
import { OfficialProviderSubscriptionService } from './official-provider-subscription.js';
|
|
7
|
-
import {
|
|
8
|
+
import { ZcodeSubscriptionService } from './zcode-subscription.js';
|
|
9
|
+
import { JsonRpcProcess, JsonRpcRequestError } from './json-rpc-process.js';
|
|
8
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 { CustomUpstreamClassifier, mergeCustomUpstreamCandidates } from './custom-upstream-classifier.js';
|
|
9
15
|
/** 统一读取 Codex、Claude Code、OpenCode 订阅摘要。所有原始凭据都留在 Host。 */
|
|
10
16
|
export class ProviderSubscriptionService {
|
|
11
17
|
commandCode;
|
|
@@ -13,10 +19,16 @@ export class ProviderSubscriptionService {
|
|
|
13
19
|
claudeCode;
|
|
14
20
|
opencode;
|
|
15
21
|
sub2api;
|
|
22
|
+
newApi;
|
|
23
|
+
customUpstreamClassifier;
|
|
16
24
|
deepseek;
|
|
17
25
|
official;
|
|
18
26
|
kimi;
|
|
19
27
|
grok;
|
|
28
|
+
zcode;
|
|
29
|
+
qoder;
|
|
30
|
+
qoderCn;
|
|
31
|
+
codebuddy;
|
|
20
32
|
constructor(options = {}) {
|
|
21
33
|
// 全局超时只作为缺省值;单项服务显式给出的 timeoutMs 优先。
|
|
22
34
|
const shared = options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs };
|
|
@@ -25,26 +37,43 @@ export class ProviderSubscriptionService {
|
|
|
25
37
|
this.claudeCode = new ClaudeCodeSubscriptionService({ ...shared, ...options.claudeCode });
|
|
26
38
|
this.opencode = new OpenCodeSubscriptionService(options.opencode);
|
|
27
39
|
this.sub2api = new Sub2ApiUsageService({ ...shared, ...options.sub2api });
|
|
40
|
+
this.newApi = new NewApiSubscriptionService({ ...shared, ...options.newApi });
|
|
41
|
+
this.customUpstreamClassifier = new CustomUpstreamClassifier(options.customUpstream);
|
|
28
42
|
this.deepseek = new DeepseekSubscriptionService({ ...shared, ...options.deepseek });
|
|
29
43
|
this.official = new OfficialProviderSubscriptionService({ ...shared, ...options.official });
|
|
30
44
|
this.kimi = new KimiSubscriptionService({ ...shared, ...options.kimi });
|
|
31
45
|
this.grok = new GrokSubscriptionService({ ...shared, ...options.grok });
|
|
46
|
+
this.zcode = new ZcodeSubscriptionService({ ...shared, ...options.zcode });
|
|
47
|
+
this.qoder = new QoderSubscriptionService({ ...shared, variant: 'qoder', ...options.qoder });
|
|
48
|
+
this.qoderCn = new QoderSubscriptionService({ ...shared, variant: 'qoder-cn', ...options.qoderCn });
|
|
49
|
+
this.codebuddy = new CodeBuddySubscriptionService({ ...shared, ...options.codebuddy });
|
|
32
50
|
}
|
|
33
51
|
read(adapterId, providerId) {
|
|
52
|
+
if (adapterId === 'codebuddy-cn')
|
|
53
|
+
adapterId = 'codebuddy';
|
|
34
54
|
if (adapterId === 'dsh')
|
|
35
55
|
return this.readDsh(providerId);
|
|
36
|
-
if (adapterId === '
|
|
37
|
-
return this.
|
|
56
|
+
if (adapterId === 'qoder')
|
|
57
|
+
return this.qoder.read();
|
|
58
|
+
if (adapterId === 'qoder-cn')
|
|
59
|
+
return this.qoderCn.read();
|
|
60
|
+
if (adapterId === 'codex' || adapterId === 'claude-code' || adapterId === 'grok' || adapterId === 'opencode' || adapterId === 'command-code' || adapterId === 'zcode' || adapterId === 'codebuddy' || adapterId === 'workbuddy') {
|
|
61
|
+
return this.readSub2ApiFirst(adapterId, providerId);
|
|
38
62
|
}
|
|
39
63
|
switch (adapterId) {
|
|
40
|
-
case 'command-code': return this.commandCode?.read() ?? Promise.resolve(null);
|
|
41
|
-
case 'codex': return this.codex.read();
|
|
42
|
-
case 'claude-code': return this.claudeCode.read();
|
|
43
|
-
case 'opencode': return this.opencode.read();
|
|
44
64
|
case 'kimi': return this.kimi.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'kimi-coding' }), ''));
|
|
45
65
|
default: return Promise.resolve(null);
|
|
46
66
|
}
|
|
47
67
|
}
|
|
68
|
+
/** 消耗一次官方订阅重置;仅官方 Codex 订阅支持,第三方上游必须显式拒绝。 */
|
|
69
|
+
async reset(adapterId, providerId) {
|
|
70
|
+
if (adapterId !== 'codex')
|
|
71
|
+
throw new Error('当前 Agent 不支持重置订阅');
|
|
72
|
+
if (this.sub2api.hasThirdPartySource(adapterId, providerId) || this.newApi.hasSource(adapterId, providerId)) {
|
|
73
|
+
throw new Error('Codex 正在使用第三方上游,无法重置官方订阅');
|
|
74
|
+
}
|
|
75
|
+
return this.codex.reset();
|
|
76
|
+
}
|
|
48
77
|
async readDsh(providerId) {
|
|
49
78
|
const currentProviderId = providerId ?? resolveDshDefaultProvider();
|
|
50
79
|
const configuredSource = resolveDshProviderSource(currentProviderId);
|
|
@@ -54,34 +83,65 @@ export class ProviderSubscriptionService {
|
|
|
54
83
|
}
|
|
55
84
|
if (matchedProvider?.reader === 'deepseek-balance' && isOfficialDeepseekSource(currentProviderId, configuredSource))
|
|
56
85
|
return this.deepseek.read(configuredSource ?? undefined);
|
|
86
|
+
const customUpstream = !isOfficialDeepseekSource(currentProviderId, configuredSource)
|
|
87
|
+
? await this.readCustomUpstream('dsh', currentProviderId)
|
|
88
|
+
: null;
|
|
89
|
+
if (customUpstream !== null)
|
|
90
|
+
return customUpstream.usage;
|
|
57
91
|
if (matchedProvider?.reader === 'sub2api')
|
|
58
|
-
return
|
|
92
|
+
return null;
|
|
59
93
|
// 已识别的官方提供商但没有可用读取器时,不尝试把官方 API 当成 Sub2API。
|
|
60
94
|
if (matchedProvider !== undefined && configuredSource !== null)
|
|
61
95
|
return null;
|
|
62
96
|
if (isThirdPartyDeepseekProvider(currentProviderId))
|
|
63
|
-
return
|
|
64
|
-
//
|
|
65
|
-
const hasThirdPartySource = this.sub2api.hasSource('dsh');
|
|
66
|
-
if (hasThirdPartySource)
|
|
67
|
-
return this.sub2api.read('dsh');
|
|
97
|
+
return null;
|
|
98
|
+
// 没有第三方来源时才允许读取官方 DeepSeek 余额。
|
|
68
99
|
const official = await this.deepseek.read();
|
|
69
100
|
return official === null || matchedProvider === undefined ? official : withProvider(official, matchedProvider, configuredSource?.baseUrl);
|
|
70
101
|
}
|
|
71
|
-
async readSub2ApiFirst(adapterId) {
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return this.sub2api.read(adapterId);
|
|
102
|
+
async readSub2ApiFirst(adapterId, providerId) {
|
|
103
|
+
// 统一分类后只调用一个读取器;已分类来源临时失败时不切换协议。
|
|
104
|
+
const customUpstream = await this.readCustomUpstream(adapterId, providerId);
|
|
105
|
+
if (customUpstream !== null)
|
|
106
|
+
return customUpstream.usage;
|
|
77
107
|
if (adapterId === 'codex')
|
|
78
108
|
return this.codex.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'openai-codex' }), ''));
|
|
79
109
|
if (adapterId === 'claude-code')
|
|
80
110
|
return this.claudeCode.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'anthropic' }), ''));
|
|
81
111
|
if (adapterId === 'grok')
|
|
82
112
|
return this.grok.read().then((usage) => usage === null ? null : withProvider(usage, identifyModelProvider({ name: 'xai' }), ''));
|
|
113
|
+
if (adapterId === 'command-code')
|
|
114
|
+
return this.commandCode?.read() ?? null;
|
|
115
|
+
if (adapterId === 'zcode')
|
|
116
|
+
return this.zcode.read();
|
|
117
|
+
if (adapterId === 'codebuddy' || adapterId === 'workbuddy')
|
|
118
|
+
return this.codebuddy.read(adapterId);
|
|
83
119
|
return null;
|
|
84
120
|
}
|
|
121
|
+
async readCustomUpstream(adapterId, providerId) {
|
|
122
|
+
const newApiConfigured = this.newApi.hasConfiguredSource(adapterId, providerId);
|
|
123
|
+
const sub2apiConfigured = this.sub2api.hasConfiguredSource(adapterId, providerId);
|
|
124
|
+
// 只要一侧有显式来源,就不把另一侧从本机环境自动发现的无关来源混进来。
|
|
125
|
+
// 两侧都没有显式来源时,才同时使用各自的 Agent 配置自动发现结果。
|
|
126
|
+
const newApiSources = sub2apiConfigured && !newApiConfigured ? [] : this.newApi.resolveSources(adapterId, providerId);
|
|
127
|
+
const sub2apiSources = newApiConfigured && !sub2apiConfigured ? [] : this.sub2api.resolveSources(adapterId, providerId)
|
|
128
|
+
.filter((source) => !isOfficialAgentBaseUrl(adapterId, source.baseUrl));
|
|
129
|
+
// 同一自定义来源的协议不能由配置项名称预先决定:一个 Agent 的配置文件
|
|
130
|
+
// 可能实际接入 New-API,也可能接入 Sub2API。统一分类器需要对每个候选
|
|
131
|
+
// 同时做两侧协议探测,再缓存最终分类,才能覆盖所有支持自定义 Provider
|
|
132
|
+
// 的适配器(尤其是 Command Code、ZCode、CodeBuddy 和 WorkBuddy)。
|
|
133
|
+
const candidates = mergeCustomUpstreamCandidates(newApiSources, sub2apiSources).map((candidate) => ({
|
|
134
|
+
...candidate,
|
|
135
|
+
newApi: true,
|
|
136
|
+
sub2api: true,
|
|
137
|
+
}));
|
|
138
|
+
if (candidates.length === 0)
|
|
139
|
+
return null;
|
|
140
|
+
return this.customUpstreamClassifier.read(adapterId, providerId, candidates, {
|
|
141
|
+
newApi: (source) => this.newApi.readWithKind(adapterId, providerId, source),
|
|
142
|
+
sub2api: (source) => this.sub2api.readWithKind(adapterId, providerId, source),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
85
145
|
}
|
|
86
146
|
/** 读取官方 DeepSeek API 的余额;凭据只在 Host 内使用。 */
|
|
87
147
|
export class DeepseekSubscriptionService {
|
|
@@ -155,49 +215,101 @@ export class Sub2ApiUsageService {
|
|
|
155
215
|
this.configuredSources = options.sources;
|
|
156
216
|
}
|
|
157
217
|
hasSource(adapterId, providerId) {
|
|
158
|
-
const configured = this.
|
|
218
|
+
const configured = this.configuredSource(adapterId, providerId);
|
|
159
219
|
if (configured !== undefined)
|
|
160
220
|
return Array.isArray(configured) ? configured.length > 0 : true;
|
|
161
221
|
return resolveSub2ApiSources(adapterId, providerId).length > 0;
|
|
162
222
|
}
|
|
223
|
+
/** 判断当前来源是否由调用方显式注入;用于隔离本机自动发现的其它来源。 */
|
|
224
|
+
hasConfiguredSource(adapterId, providerId) {
|
|
225
|
+
if (this.configuredSources === undefined)
|
|
226
|
+
return false;
|
|
227
|
+
return (providerId !== undefined && this.configuredSources[providerId] !== undefined)
|
|
228
|
+
|| this.configuredSources[adapterId] !== undefined;
|
|
229
|
+
}
|
|
230
|
+
resolveSources(adapterId, providerId) {
|
|
231
|
+
const configured = this.configuredSource(adapterId, providerId);
|
|
232
|
+
const single = configured;
|
|
233
|
+
return configured === undefined
|
|
234
|
+
? resolveSub2ApiSources(adapterId, providerId)
|
|
235
|
+
: Array.isArray(configured) ? [...configured] : single === undefined ? [] : [single];
|
|
236
|
+
}
|
|
163
237
|
/** 只判断是否存在第三方上游;官方 Codex/Claude 源必须允许回退原生订阅读取器。 */
|
|
164
238
|
hasThirdPartySource(adapterId, providerId) {
|
|
165
|
-
const configured = this.
|
|
239
|
+
const configured = this.configuredSource(adapterId, providerId);
|
|
166
240
|
const sources = configured === undefined
|
|
167
241
|
? resolveSub2ApiSources(adapterId, providerId)
|
|
168
242
|
: Array.isArray(configured) ? configured : [configured];
|
|
169
243
|
return sources.some((source) => !isOfficialAgentSource(adapterId, source));
|
|
170
244
|
}
|
|
171
|
-
async read(adapterId, providerId) {
|
|
172
|
-
const
|
|
173
|
-
|
|
245
|
+
async read(adapterId, providerId, source) {
|
|
246
|
+
const result = await this.readWithKind(adapterId, providerId, source);
|
|
247
|
+
return result?.usage ?? null;
|
|
248
|
+
}
|
|
249
|
+
async readWithKind(adapterId, providerId, source) {
|
|
250
|
+
const sources = source === undefined ? this.resolveSources(adapterId, providerId) : [source];
|
|
174
251
|
for (const source of sources) {
|
|
175
|
-
const result = await this.
|
|
252
|
+
const result = await this.readSourceWithKind(source, providerId);
|
|
176
253
|
if (result !== null)
|
|
177
254
|
return result;
|
|
178
255
|
}
|
|
179
256
|
return null;
|
|
180
257
|
}
|
|
181
|
-
async
|
|
182
|
-
|
|
258
|
+
async readSourceWithKind(source, providerId) {
|
|
259
|
+
// 请求地址与分类缓存使用同一套 URL 清洗规则,避免 query/hash 中的凭据
|
|
260
|
+
// 被带到上游,也避免同一来源因尾部 /v1 或查询参数产生不同请求路径。
|
|
261
|
+
const baseUrl = sanitizeUpstreamUrl(source.baseUrl);
|
|
262
|
+
if (baseUrl === '')
|
|
263
|
+
return null;
|
|
183
264
|
const usagePath = /\/v1$/u.test(baseUrl) ? '/usage' : '/v1/usage';
|
|
265
|
+
const billingPath = /\/v1$/u.test(baseUrl) ? '/sub2api/billing' : '/v1/sub2api/billing';
|
|
184
266
|
const controller = new AbortController();
|
|
185
267
|
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
186
268
|
try {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
269
|
+
const headers = {
|
|
270
|
+
Authorization: source.apiKey.trim().startsWith('Bearer ') ? source.apiKey.trim() : `Bearer ${source.apiKey.trim()}`,
|
|
271
|
+
Accept: 'application/json',
|
|
272
|
+
};
|
|
273
|
+
// /v1/usage 是统计主接口。统计服务不可用或响应字段不完整时,仍继续
|
|
274
|
+
// 读取 /v1/sub2api/billing,用其明确的 object 标记锁定 Sub2API 类型。
|
|
275
|
+
let usageRaw = null;
|
|
276
|
+
let usageStatus = 0;
|
|
277
|
+
try {
|
|
278
|
+
const response = await this.request(`${baseUrl}${usagePath}`, { headers, signal: controller.signal });
|
|
279
|
+
usageStatus = response.status;
|
|
280
|
+
if (response.ok)
|
|
281
|
+
usageRaw = await response.json();
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
// 主接口失败不代表来源类型未知,下面仍尝试 billing 探针。
|
|
285
|
+
}
|
|
286
|
+
const usage = normalizeSub2ApiUsage(usageRaw, baseUrl);
|
|
287
|
+
if (usage !== null) {
|
|
288
|
+
const logoUrl = buildLogoUrl(baseUrl);
|
|
289
|
+
const logoDataUrl = logoUrl === '' ? '' : await readLogoDataUrl(logoUrl, this.request, this.timeoutMs);
|
|
290
|
+
const providerDefinition = identifyModelProvider({ name: providerId, baseUrl }) ?? thirdPartyProvider({ name: providerId, baseUrl });
|
|
291
|
+
const providerLogoDataUrl = logoDataUrl || await readLogoDataUrl(providerDefinition.logoUrl, this.request, this.timeoutMs);
|
|
292
|
+
return {
|
|
293
|
+
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 } },
|
|
294
|
+
kind: 'sub2api',
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if (isSub2ApiUsageSignature(usageRaw))
|
|
298
|
+
return { usage: null, kind: 'sub2api' };
|
|
299
|
+
// 无效凭据时 billing 只会重复返回鉴权错误,避免额外请求;404/5xx
|
|
300
|
+
// 等临时失败则继续探测,因为 billing 是产品级强特征。
|
|
301
|
+
if (usageStatus === 401 || usageStatus === 403)
|
|
192
302
|
return null;
|
|
193
|
-
|
|
194
|
-
|
|
303
|
+
try {
|
|
304
|
+
const response = await this.request(`${baseUrl}${billingPath}`, { headers, signal: controller.signal });
|
|
305
|
+
if (!response.ok)
|
|
306
|
+
return null;
|
|
307
|
+
const billing = await response.json();
|
|
308
|
+
return isSub2ApiUsageSignature(billing) ? { usage: null, kind: 'sub2api' } : null;
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
195
311
|
return null;
|
|
196
|
-
|
|
197
|
-
const logoDataUrl = logoUrl === '' ? '' : await readLogoDataUrl(logoUrl, this.request, this.timeoutMs);
|
|
198
|
-
const providerDefinition = identifyModelProvider({ name: providerId, baseUrl }) ?? thirdPartyProvider({ name: providerId, baseUrl });
|
|
199
|
-
const providerLogoDataUrl = logoDataUrl || await readLogoDataUrl(providerDefinition.logoUrl, this.request, this.timeoutMs);
|
|
200
|
-
return { 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 } };
|
|
312
|
+
}
|
|
201
313
|
}
|
|
202
314
|
catch {
|
|
203
315
|
return null;
|
|
@@ -206,6 +318,26 @@ export class Sub2ApiUsageService {
|
|
|
206
318
|
clearTimeout(timer);
|
|
207
319
|
}
|
|
208
320
|
}
|
|
321
|
+
configuredSource(adapterId, providerId) {
|
|
322
|
+
if (this.configuredSources === undefined)
|
|
323
|
+
return undefined;
|
|
324
|
+
return (providerId !== undefined && this.configuredSources[providerId] !== undefined)
|
|
325
|
+
? this.configuredSources[providerId]
|
|
326
|
+
: this.configuredSources[adapterId];
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/** 判断 Sub2API 用量端点的协议结构;统计明细为空时仍保留协议分类。 */
|
|
330
|
+
export function isSub2ApiUsageSignature(value) {
|
|
331
|
+
const root = recordValue(value);
|
|
332
|
+
if (root === null)
|
|
333
|
+
return false;
|
|
334
|
+
const payload = recordValue(root.data) ?? root;
|
|
335
|
+
if (textValue(payload.object) === 'sub2api.key_billing')
|
|
336
|
+
return true;
|
|
337
|
+
const hasMode = textValue(payload.mode) !== null && typeof payload.isValid === 'boolean';
|
|
338
|
+
const usage = recordValue(payload.usage);
|
|
339
|
+
const hasUsagePoints = usage !== null && (recordValue(usage.today) !== null || recordValue(usage.total) !== null);
|
|
340
|
+
return hasMode || hasUsagePoints || Array.isArray(payload.daily_usage) || Array.isArray(payload.model_stats);
|
|
209
341
|
}
|
|
210
342
|
export class CodexSubscriptionService {
|
|
211
343
|
binaries;
|
|
@@ -246,6 +378,34 @@ export class CodexSubscriptionService {
|
|
|
246
378
|
return null;
|
|
247
379
|
}
|
|
248
380
|
}
|
|
381
|
+
/** 消耗一次 Codex 官方重置券;凭据始终留在 Codex 侧,Host 只中转协议结果。 */
|
|
382
|
+
async reset() {
|
|
383
|
+
if (hasThirdPartyCodexConfig(this.homeDirectory))
|
|
384
|
+
throw new Error('Codex 使用第三方配置,无法重置官方订阅');
|
|
385
|
+
this.command ??= (await detectBinary({ binaries: this.binaries, spawnSync: this.runSpawnSync })).command;
|
|
386
|
+
if (this.command === null)
|
|
387
|
+
throw new Error('未找到 Codex CLI,无法重置订阅');
|
|
388
|
+
const rpc = new JsonRpcProcess({ command: this.command, args: ['app-server'], spawn: this.runSpawn });
|
|
389
|
+
const controller = new AbortController();
|
|
390
|
+
// 消费接口连上游耗时可能超过普通查询;超时过短会在重置已生效时误报失败。
|
|
391
|
+
const timer = setTimeout(() => controller.abort(), Math.max(this.timeoutMs, 20_000));
|
|
392
|
+
try {
|
|
393
|
+
await rpc.request('initialize', { clientInfo: { name: 'codingns4dsh', version: '0.1.1' }, capabilities: {} }, { signal: controller.signal });
|
|
394
|
+
rpc.notify('initialized', {});
|
|
395
|
+
const result = await rpc.request('account/rateLimitResetCredit/consume', { idempotencyKey: randomUUID() }, { signal: controller.signal });
|
|
396
|
+
return { outcome: normalizeCodexResetOutcome(result) };
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
if (error instanceof JsonRpcRequestError && error.code === -32601) {
|
|
400
|
+
throw new Error('当前 Codex CLI 版本不支持重置订阅,请升级 Codex 后重试');
|
|
401
|
+
}
|
|
402
|
+
throw error;
|
|
403
|
+
}
|
|
404
|
+
finally {
|
|
405
|
+
clearTimeout(timer);
|
|
406
|
+
rpc.dispose();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
249
409
|
}
|
|
250
410
|
export class ClaudeCodeSubscriptionService {
|
|
251
411
|
homeDirectory;
|
|
@@ -661,10 +821,57 @@ function normalizeCodexSnapshot(value) {
|
|
|
661
821
|
secondary,
|
|
662
822
|
monthly: null,
|
|
663
823
|
rateLimitReachedType: textValue(source.rateLimitReachedType ?? source.rate_limit_reached_type),
|
|
664
|
-
resetCredits:
|
|
824
|
+
resetCredits: normalizeCodexResetCredits(root?.rateLimitResetCredits ?? root?.rate_limit_reset_credits),
|
|
825
|
+
credits: normalizeCodexCredits(source.credits),
|
|
665
826
|
capturedAt: new Date().toISOString(),
|
|
666
827
|
};
|
|
667
828
|
}
|
|
829
|
+
/** Codex 重置券摘要;availableCount 权威,明细行可能被上游截断。 */
|
|
830
|
+
function normalizeCodexResetCredits(value) {
|
|
831
|
+
const source = recordValue(value);
|
|
832
|
+
if (source === null)
|
|
833
|
+
return null;
|
|
834
|
+
const rawCount = source.availableCount ?? source.available_count;
|
|
835
|
+
const availableCount = rawCount === null || rawCount === undefined ? null : numberValue(rawCount);
|
|
836
|
+
if (availableCount === null)
|
|
837
|
+
return null;
|
|
838
|
+
const rows = Array.isArray(source.credits) ? source.credits : [];
|
|
839
|
+
return {
|
|
840
|
+
availableCount: Math.max(0, Math.trunc(availableCount)),
|
|
841
|
+
credits: rows
|
|
842
|
+
.map((item) => recordValue(item))
|
|
843
|
+
.filter((row) => row !== null && (typeof row.status !== 'string' || row.status === 'available'))
|
|
844
|
+
.map((row) => {
|
|
845
|
+
const rawExpiry = row.expiresAt ?? row.expires_at;
|
|
846
|
+
return {
|
|
847
|
+
id: textValue(row.id),
|
|
848
|
+
expiresAt: rawExpiry === null || rawExpiry === undefined ? null : timestampValue(rawExpiry),
|
|
849
|
+
title: textValue(row.title),
|
|
850
|
+
description: textValue(row.description),
|
|
851
|
+
};
|
|
852
|
+
}),
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
/** Codex 点数余额:余额保持字符串以保留上游十进制精度;字段全缺时视为未提供。 */
|
|
856
|
+
function normalizeCodexCredits(value) {
|
|
857
|
+
const source = recordValue(value);
|
|
858
|
+
if (source === null)
|
|
859
|
+
return null;
|
|
860
|
+
const hasCredits = booleanValue(source.hasCredits ?? source.has_credits);
|
|
861
|
+
const unlimited = booleanValue(source.unlimited);
|
|
862
|
+
const balance = creditBalanceValue(source.balance);
|
|
863
|
+
if (hasCredits === null && unlimited === null && balance === null)
|
|
864
|
+
return null;
|
|
865
|
+
return { hasCredits: hasCredits ?? balance !== null, unlimited: unlimited ?? false, balance };
|
|
866
|
+
}
|
|
867
|
+
const CODEX_RESET_OUTCOMES = ['reset', 'alreadyRedeemed', 'nothingToReset', 'noCredit'];
|
|
868
|
+
function normalizeCodexResetOutcome(value) {
|
|
869
|
+
const outcome = textValue(recordValue(value)?.outcome);
|
|
870
|
+
const matched = CODEX_RESET_OUTCOMES.find((candidate) => candidate === outcome);
|
|
871
|
+
if (matched === undefined)
|
|
872
|
+
throw new Error('Codex 返回了无法识别的重置结果');
|
|
873
|
+
return matched;
|
|
874
|
+
}
|
|
668
875
|
function normalizeClaudeSnapshot(value, planType) {
|
|
669
876
|
const root = recordValue(value) ?? {};
|
|
670
877
|
const source = recordValue(root.data) ?? root;
|
|
@@ -863,6 +1070,13 @@ function timestampValue(value) {
|
|
|
863
1070
|
return null;
|
|
864
1071
|
}
|
|
865
1072
|
function clamp(value) { return Math.max(0, Math.min(100, value)); }
|
|
1073
|
+
function booleanValue(value) { return typeof value === 'boolean' ? value : null; }
|
|
1074
|
+
/** 点数余额保持字符串以保留上游十进制精度;数字也归一为字符串。 */
|
|
1075
|
+
function creditBalanceValue(value) {
|
|
1076
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
1077
|
+
return String(value);
|
|
1078
|
+
return textValue(value);
|
|
1079
|
+
}
|
|
866
1080
|
function normalizeDeepseekUsage(value, baseUrl) {
|
|
867
1081
|
const root = recordValue(value);
|
|
868
1082
|
if (root === null)
|