@alm-allen/dsh-multi-provider 0.0.0-stage → 0.90.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/LICENSE +21 -0
- package/README.md +229 -2
- package/cordis.patch.yml +6 -0
- package/icon.svg +28 -0
- package/lib/client.js +25708 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +93587 -0
- package/lib/types/client/CodexComposerQuota.d.ts +13 -0
- package/lib/types/client/CodexComposerQuota.d.ts.map +1 -0
- package/lib/types/client/CodexSubscriptionSection.d.ts +42 -0
- package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -0
- package/lib/types/client/ProviderHubSection.d.ts +21 -0
- package/lib/types/client/ProviderHubSection.d.ts.map +1 -0
- package/lib/types/client/api.d.ts +66 -0
- package/lib/types/client/api.d.ts.map +1 -0
- package/lib/types/client/claude/ClaudeComposerQuota.d.ts +29 -0
- package/lib/types/client/claude/ClaudeComposerQuota.d.ts.map +1 -0
- package/lib/types/client/claude/ClaudeSection.d.ts +12 -0
- package/lib/types/client/claude/ClaudeSection.d.ts.map +1 -0
- package/lib/types/client/claude/locales.d.ts +489 -0
- package/lib/types/client/claude/locales.d.ts.map +1 -0
- package/lib/types/client/claude/styles.d.ts +15 -0
- package/lib/types/client/claude/styles.d.ts.map +1 -0
- package/lib/types/client/claude/useClaudeSection.d.ts +106 -0
- package/lib/types/client/claude/useClaudeSection.d.ts.map +1 -0
- package/lib/types/client/claude-api/ClaudeApiSection.d.ts +5 -0
- package/lib/types/client/claude-api/ClaudeApiSection.d.ts.map +1 -0
- package/lib/types/client/claude-api/api.d.ts +23 -0
- package/lib/types/client/claude-api/api.d.ts.map +1 -0
- package/lib/types/client/claude-api/locales.d.ts +161 -0
- package/lib/types/client/claude-api/locales.d.ts.map +1 -0
- package/lib/types/client/claude-api/styles.d.ts +4 -0
- package/lib/types/client/claude-api/styles.d.ts.map +1 -0
- package/lib/types/client/claude-api/useClaudeApiSection.d.ts +37 -0
- package/lib/types/client/claude-api/useClaudeApiSection.d.ts.map +1 -0
- package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts +23 -0
- package/lib/types/client/cline-pass/ClinePassComposerQuota.d.ts.map +1 -0
- package/lib/types/client/cline-pass/ClinePassSection.d.ts +17 -0
- package/lib/types/client/cline-pass/ClinePassSection.d.ts.map +1 -0
- package/lib/types/client/cline-pass/api.d.ts +85 -0
- package/lib/types/client/cline-pass/api.d.ts.map +1 -0
- package/lib/types/client/cline-pass/locales.d.ts +911 -0
- package/lib/types/client/cline-pass/locales.d.ts.map +1 -0
- package/lib/types/client/cline-pass/styles.d.ts +7 -0
- package/lib/types/client/cline-pass/styles.d.ts.map +1 -0
- package/lib/types/client/command-code/CommandCodeComposerQuota.d.ts +20 -0
- package/lib/types/client/command-code/CommandCodeComposerQuota.d.ts.map +1 -0
- package/lib/types/client/command-code/CommandCodeSection.d.ts +8 -0
- package/lib/types/client/command-code/CommandCodeSection.d.ts.map +1 -0
- package/lib/types/client/command-code/locales.d.ts +305 -0
- package/lib/types/client/command-code/locales.d.ts.map +1 -0
- package/lib/types/client/common/AccountPoolSection.d.ts +104 -0
- package/lib/types/client/common/AccountPoolSection.d.ts.map +1 -0
- package/lib/types/client/common/ComposerQuotaBadge.d.ts +63 -0
- package/lib/types/client/common/ComposerQuotaBadge.d.ts.map +1 -0
- package/lib/types/client/common/ContextWindowEditor.d.ts +71 -0
- package/lib/types/client/common/ContextWindowEditor.d.ts.map +1 -0
- package/lib/types/client/common/LineProxySection.d.ts +78 -0
- package/lib/types/client/common/LineProxySection.d.ts.map +1 -0
- package/lib/types/client/common/ModelChecklist.d.ts +29 -0
- package/lib/types/client/common/ModelChecklist.d.ts.map +1 -0
- package/lib/types/client/common/account-pool-labels.d.ts +74 -0
- package/lib/types/client/common/account-pool-labels.d.ts.map +1 -0
- package/lib/types/client/common/account-quota.d.ts +60 -0
- package/lib/types/client/common/account-quota.d.ts.map +1 -0
- package/lib/types/client/common/format.d.ts +70 -0
- package/lib/types/client/common/format.d.ts.map +1 -0
- package/lib/types/client/common/host-locale-mirror.d.ts +24 -0
- package/lib/types/client/common/host-locale-mirror.d.ts.map +1 -0
- package/lib/types/client/common/line-api.d.ts +8 -0
- package/lib/types/client/common/line-api.d.ts.map +1 -0
- package/lib/types/client/common/line-locale.d.ts +21 -0
- package/lib/types/client/common/line-locale.d.ts.map +1 -0
- package/lib/types/client/common/model-checklist-styles.d.ts +2 -0
- package/lib/types/client/common/model-checklist-styles.d.ts.map +1 -0
- package/lib/types/client/common/plugin-style.d.ts +23 -0
- package/lib/types/client/common/plugin-style.d.ts.map +1 -0
- package/lib/types/client/common/quota-follow-up.d.ts +30 -0
- package/lib/types/client/common/quota-follow-up.d.ts.map +1 -0
- package/lib/types/client/common/styles.d.ts +11 -0
- package/lib/types/client/common/styles.d.ts.map +1 -0
- package/lib/types/client/common/use-store.d.ts +3 -0
- package/lib/types/client/common/use-store.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/GlmCodingPlanComposerQuota.d.ts +27 -0
- package/lib/types/client/glm-coding-plan/GlmCodingPlanComposerQuota.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts +22 -0
- package/lib/types/client/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/api.d.ts +4 -0
- package/lib/types/client/glm-coding-plan/api.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/locales.d.ts +409 -0
- package/lib/types/client/glm-coding-plan/locales.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/styles.d.ts +16 -0
- package/lib/types/client/glm-coding-plan/styles.d.ts.map +1 -0
- package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts +65 -0
- package/lib/types/client/glm-coding-plan/useGlmCodingPlanSection.d.ts.map +1 -0
- package/lib/types/client/hub/HubOverview.d.ts +16 -0
- package/lib/types/client/hub/HubOverview.d.ts.map +1 -0
- package/lib/types/client/hub/brand-icons.d.ts +64 -0
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -0
- package/lib/types/client/hub/brand-svg.d.ts +51 -0
- package/lib/types/client/hub/brand-svg.d.ts.map +1 -0
- package/lib/types/client/hub/hub-styles.d.ts +2 -0
- package/lib/types/client/hub/hub-styles.d.ts.map +1 -0
- package/lib/types/client/hub/providers.d.ts +55 -0
- package/lib/types/client/hub/providers.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +67 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/kimi-code/KimiCodeComposerQuota.d.ts +21 -0
- package/lib/types/client/kimi-code/KimiCodeComposerQuota.d.ts.map +1 -0
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts +8 -0
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -0
- package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts +16 -0
- package/lib/types/client/kimi-code/KimiModelCapabilities.d.ts.map +1 -0
- package/lib/types/client/kimi-code/KimiQuotaCard.d.ts +31 -0
- package/lib/types/client/kimi-code/KimiQuotaCard.d.ts.map +1 -0
- package/lib/types/client/kimi-code/labels.d.ts +66 -0
- package/lib/types/client/kimi-code/labels.d.ts.map +1 -0
- package/lib/types/client/kimi-code/locales.d.ts +640 -0
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -0
- package/lib/types/client/kimi-code/staff-art.d.ts +19 -0
- package/lib/types/client/kimi-code/staff-art.d.ts.map +1 -0
- package/lib/types/client/kimi-code/styles.d.ts +4 -0
- package/lib/types/client/kimi-code/styles.d.ts.map +1 -0
- package/lib/types/client/locales-ru/account-pool.d.ts +11 -0
- package/lib/types/client/locales-ru/account-pool.d.ts.map +1 -0
- package/lib/types/client/locales-ru/claude-api.d.ts +3 -0
- package/lib/types/client/locales-ru/claude-api.d.ts.map +1 -0
- package/lib/types/client/locales-ru/claude.d.ts +3 -0
- package/lib/types/client/locales-ru/claude.d.ts.map +1 -0
- package/lib/types/client/locales-ru/cline-pass.d.ts +11 -0
- package/lib/types/client/locales-ru/cline-pass.d.ts.map +1 -0
- package/lib/types/client/locales-ru/command-code.d.ts +9 -0
- package/lib/types/client/locales-ru/command-code.d.ts.map +1 -0
- package/lib/types/client/locales-ru/glm-coding-plan.d.ts +10 -0
- package/lib/types/client/locales-ru/glm-coding-plan.d.ts.map +1 -0
- package/lib/types/client/locales-ru/hub.d.ts +3 -0
- package/lib/types/client/locales-ru/hub.d.ts.map +1 -0
- package/lib/types/client/locales-ru/index.d.ts +26 -0
- package/lib/types/client/locales-ru/index.d.ts.map +1 -0
- package/lib/types/client/locales-ru/kimi-code.d.ts +10 -0
- package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -0
- package/lib/types/client/locales-ru/minimax-code.d.ts +9 -0
- package/lib/types/client/locales-ru/minimax-code.d.ts.map +1 -0
- package/lib/types/client/locales-ru/ollama.d.ts +10 -0
- package/lib/types/client/locales-ru/ollama.d.ts.map +1 -0
- package/lib/types/client/locales-ru/opencode-go.d.ts +3 -0
- package/lib/types/client/locales-ru/opencode-go.d.ts.map +1 -0
- package/lib/types/client/locales-ru/opendesign.d.ts +10 -0
- package/lib/types/client/locales-ru/opendesign.d.ts.map +1 -0
- package/lib/types/client/locales-ru/qianwen-token-plan.d.ts +3 -0
- package/lib/types/client/locales-ru/qianwen-token-plan.d.ts.map +1 -0
- package/lib/types/client/locales-ru/qoder.d.ts +11 -0
- package/lib/types/client/locales-ru/qoder.d.ts.map +1 -0
- package/lib/types/client/locales-ru/relayone.d.ts +3 -0
- package/lib/types/client/locales-ru/relayone.d.ts.map +1 -0
- package/lib/types/client/locales-ru/step-code.d.ts +9 -0
- package/lib/types/client/locales-ru/step-code.d.ts.map +1 -0
- package/lib/types/client/locales-ru/workbuddy.d.ts +10 -0
- package/lib/types/client/locales-ru/workbuddy.d.ts.map +1 -0
- package/lib/types/client/locales.d.ts +497 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/minimax-code/MinimaxCodeComposerQuota.d.ts +23 -0
- package/lib/types/client/minimax-code/MinimaxCodeComposerQuota.d.ts.map +1 -0
- package/lib/types/client/minimax-code/MinimaxCodeSection.d.ts +23 -0
- package/lib/types/client/minimax-code/MinimaxCodeSection.d.ts.map +1 -0
- package/lib/types/client/minimax-code/api.d.ts +35 -0
- package/lib/types/client/minimax-code/api.d.ts.map +1 -0
- package/lib/types/client/minimax-code/commands-contract.d.ts +46 -0
- package/lib/types/client/minimax-code/commands-contract.d.ts.map +1 -0
- package/lib/types/client/minimax-code/locales.d.ts +422 -0
- package/lib/types/client/minimax-code/locales.d.ts.map +1 -0
- package/lib/types/client/minimax-code/styles.d.ts +12 -0
- package/lib/types/client/minimax-code/styles.d.ts.map +1 -0
- package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts +164 -0
- package/lib/types/client/minimax-code/useMinimaxCodeSection.d.ts.map +1 -0
- package/lib/types/client/ollama/OllamaSection.d.ts +25 -0
- package/lib/types/client/ollama/OllamaSection.d.ts.map +1 -0
- package/lib/types/client/ollama/api.d.ts +49 -0
- package/lib/types/client/ollama/api.d.ts.map +1 -0
- package/lib/types/client/ollama/locales.d.ts +479 -0
- package/lib/types/client/ollama/locales.d.ts.map +1 -0
- package/lib/types/client/opencode-go/OpenCodeGoQuotaCard.d.ts +20 -0
- package/lib/types/client/opencode-go/OpenCodeGoQuotaCard.d.ts.map +1 -0
- package/lib/types/client/opencode-go/OpenCodeGoSection.d.ts +8 -0
- package/lib/types/client/opencode-go/OpenCodeGoSection.d.ts.map +1 -0
- package/lib/types/client/opencode-go/locales.d.ts +210 -0
- package/lib/types/client/opencode-go/locales.d.ts.map +1 -0
- package/lib/types/client/opencode-go/styles.d.ts +10 -0
- package/lib/types/client/opencode-go/styles.d.ts.map +1 -0
- package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts +26 -0
- package/lib/types/client/opendesign/OpenDesignComposerQuota.d.ts.map +1 -0
- package/lib/types/client/opendesign/OpenDesignSection.d.ts +19 -0
- package/lib/types/client/opendesign/OpenDesignSection.d.ts.map +1 -0
- package/lib/types/client/opendesign/api.d.ts +45 -0
- package/lib/types/client/opendesign/api.d.ts.map +1 -0
- package/lib/types/client/opendesign/locales.d.ts +815 -0
- package/lib/types/client/opendesign/locales.d.ts.map +1 -0
- package/lib/types/client/opendesign/styles.d.ts +16 -0
- package/lib/types/client/opendesign/styles.d.ts.map +1 -0
- package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts +14 -0
- package/lib/types/client/qianwen-token-plan/QianwenComposerQuota.d.ts.map +1 -0
- package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts +4 -0
- package/lib/types/client/qianwen-token-plan/QianwenTokenPlanSection.d.ts.map +1 -0
- package/lib/types/client/qianwen-token-plan/api.d.ts +5 -0
- package/lib/types/client/qianwen-token-plan/api.d.ts.map +1 -0
- package/lib/types/client/qianwen-token-plan/locales.d.ts +158 -0
- package/lib/types/client/qianwen-token-plan/locales.d.ts.map +1 -0
- package/lib/types/client/qianwen-token-plan/styles.d.ts +3 -0
- package/lib/types/client/qianwen-token-plan/styles.d.ts.map +1 -0
- package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts +32 -0
- package/lib/types/client/qianwen-token-plan/useQianwenSection.d.ts.map +1 -0
- package/lib/types/client/qoder/QoderComposerQuota.d.ts +41 -0
- package/lib/types/client/qoder/QoderComposerQuota.d.ts.map +1 -0
- package/lib/types/client/qoder/QoderSection.d.ts +37 -0
- package/lib/types/client/qoder/QoderSection.d.ts.map +1 -0
- package/lib/types/client/qoder/api.d.ts +4 -0
- package/lib/types/client/qoder/api.d.ts.map +1 -0
- package/lib/types/client/qoder/locales.d.ts +322 -0
- package/lib/types/client/qoder/locales.d.ts.map +1 -0
- package/lib/types/client/qoder/styles.d.ts +16 -0
- package/lib/types/client/qoder/styles.d.ts.map +1 -0
- package/lib/types/client/qoder/useQoderSection.d.ts +97 -0
- package/lib/types/client/qoder/useQoderSection.d.ts.map +1 -0
- package/lib/types/client/quota.d.ts +9 -0
- package/lib/types/client/quota.d.ts.map +1 -0
- package/lib/types/client/relayone/RelayOneComposerQuota.d.ts +14 -0
- package/lib/types/client/relayone/RelayOneComposerQuota.d.ts.map +1 -0
- package/lib/types/client/relayone/RelayOneSection.d.ts +4 -0
- package/lib/types/client/relayone/RelayOneSection.d.ts.map +1 -0
- package/lib/types/client/relayone/api.d.ts +5 -0
- package/lib/types/client/relayone/api.d.ts.map +1 -0
- package/lib/types/client/relayone/locales.d.ts +221 -0
- package/lib/types/client/relayone/locales.d.ts.map +1 -0
- package/lib/types/client/relayone/quota-format.d.ts +6 -0
- package/lib/types/client/relayone/quota-format.d.ts.map +1 -0
- package/lib/types/client/relayone/styles.d.ts +3 -0
- package/lib/types/client/relayone/styles.d.ts.map +1 -0
- package/lib/types/client/relayone/useRelayOneSection.d.ts +32 -0
- package/lib/types/client/relayone/useRelayOneSection.d.ts.map +1 -0
- package/lib/types/client/step-code/StepCodeComposerQuota.d.ts +50 -0
- package/lib/types/client/step-code/StepCodeComposerQuota.d.ts.map +1 -0
- package/lib/types/client/step-code/StepCodeSection.d.ts +28 -0
- package/lib/types/client/step-code/StepCodeSection.d.ts.map +1 -0
- package/lib/types/client/step-code/api.d.ts +4 -0
- package/lib/types/client/step-code/api.d.ts.map +1 -0
- package/lib/types/client/step-code/locales.d.ts +657 -0
- package/lib/types/client/step-code/locales.d.ts.map +1 -0
- package/lib/types/client/step-code/styles.d.ts +28 -0
- package/lib/types/client/step-code/styles.d.ts.map +1 -0
- package/lib/types/client/step-code/useStepCodeSection.d.ts +122 -0
- package/lib/types/client/step-code/useStepCodeSection.d.ts.map +1 -0
- package/lib/types/client/store.d.ts +19 -0
- package/lib/types/client/store.d.ts.map +1 -0
- package/lib/types/client/styles.d.ts +26 -0
- package/lib/types/client/styles.d.ts.map +1 -0
- package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts +34 -0
- package/lib/types/client/workbuddy/WorkBuddyComposerQuota.d.ts.map +1 -0
- package/lib/types/client/workbuddy/WorkBuddySection.d.ts +91 -0
- package/lib/types/client/workbuddy/WorkBuddySection.d.ts.map +1 -0
- package/lib/types/client/workbuddy/locales.d.ts +768 -0
- package/lib/types/client/workbuddy/locales.d.ts.map +1 -0
- package/lib/types/client/workbuddy/styles.d.ts +21 -0
- package/lib/types/client/workbuddy/styles.d.ts.map +1 -0
- package/lib/types/client/workbuddy/useWorkBuddySection.d.ts +149 -0
- package/lib/types/client/workbuddy/useWorkBuddySection.d.ts.map +1 -0
- package/lib/types/compat.d.ts +139 -0
- package/lib/types/compat.d.ts.map +1 -0
- package/lib/types/host/adapter.d.ts +43 -0
- package/lib/types/host/adapter.d.ts.map +1 -0
- package/lib/types/host/callback-server.d.ts +22 -0
- package/lib/types/host/callback-server.d.ts.map +1 -0
- package/lib/types/host/claude/account-pool.d.ts +583 -0
- package/lib/types/host/claude/account-pool.d.ts.map +1 -0
- package/lib/types/host/claude/adapter.d.ts +424 -0
- package/lib/types/host/claude/adapter.d.ts.map +1 -0
- package/lib/types/host/claude/adopt.d.ts +292 -0
- package/lib/types/host/claude/adopt.d.ts.map +1 -0
- package/lib/types/host/claude/client.d.ts +579 -0
- package/lib/types/host/claude/client.d.ts.map +1 -0
- package/lib/types/host/claude/mapper.d.ts +802 -0
- package/lib/types/host/claude/mapper.d.ts.map +1 -0
- package/lib/types/host/claude/model-catalog.d.ts +560 -0
- package/lib/types/host/claude/model-catalog.d.ts.map +1 -0
- package/lib/types/host/claude/oauth.d.ts +419 -0
- package/lib/types/host/claude/oauth.d.ts.map +1 -0
- package/lib/types/host/claude/routes.d.ts +131 -0
- package/lib/types/host/claude/routes.d.ts.map +1 -0
- package/lib/types/host/claude/token-store.d.ts +347 -0
- package/lib/types/host/claude/token-store.d.ts.map +1 -0
- package/lib/types/host/claude/types.d.ts +417 -0
- package/lib/types/host/claude/types.d.ts.map +1 -0
- package/lib/types/host/claude-api/adapter.d.ts +70 -0
- package/lib/types/host/claude-api/adapter.d.ts.map +1 -0
- package/lib/types/host/claude-api/capability-memory.d.ts +4 -0
- package/lib/types/host/claude-api/capability-memory.d.ts.map +1 -0
- package/lib/types/host/claude-api/catalog-manager.d.ts +57 -0
- package/lib/types/host/claude-api/catalog-manager.d.ts.map +1 -0
- package/lib/types/host/claude-api/client-version.d.ts +4 -0
- package/lib/types/host/claude-api/client-version.d.ts.map +1 -0
- package/lib/types/host/claude-api/client.d.ts +55 -0
- package/lib/types/host/claude-api/client.d.ts.map +1 -0
- package/lib/types/host/claude-api/compaction-instruction.d.ts +23 -0
- package/lib/types/host/claude-api/compaction-instruction.d.ts.map +1 -0
- package/lib/types/host/claude-api/compaction-store.d.ts +62 -0
- package/lib/types/host/claude-api/compaction-store.d.ts.map +1 -0
- package/lib/types/host/claude-api/compaction.d.ts +47 -0
- package/lib/types/host/claude-api/compaction.d.ts.map +1 -0
- package/lib/types/host/claude-api/mapper.d.ts +61 -0
- package/lib/types/host/claude-api/mapper.d.ts.map +1 -0
- package/lib/types/host/claude-api/model-catalog.d.ts +76 -0
- package/lib/types/host/claude-api/model-catalog.d.ts.map +1 -0
- package/lib/types/host/claude-api/routes.d.ts +22 -0
- package/lib/types/host/claude-api/routes.d.ts.map +1 -0
- package/lib/types/host/claude-api/stream.d.ts +88 -0
- package/lib/types/host/claude-api/stream.d.ts.map +1 -0
- package/lib/types/host/claude-api/token-store.d.ts +60 -0
- package/lib/types/host/claude-api/token-store.d.ts.map +1 -0
- package/lib/types/host/claude-api/types.d.ts +68 -0
- package/lib/types/host/claude-api/types.d.ts.map +1 -0
- package/lib/types/host/cline-pass/account-pool.d.ts +63 -0
- package/lib/types/host/cline-pass/account-pool.d.ts.map +1 -0
- package/lib/types/host/cline-pass/adapter.d.ts +60 -0
- package/lib/types/host/cline-pass/adapter.d.ts.map +1 -0
- package/lib/types/host/cline-pass/catalog.d.ts +49 -0
- package/lib/types/host/cline-pass/catalog.d.ts.map +1 -0
- package/lib/types/host/cline-pass/client.d.ts +109 -0
- package/lib/types/host/cline-pass/client.d.ts.map +1 -0
- package/lib/types/host/cline-pass/engine.d.ts +93 -0
- package/lib/types/host/cline-pass/engine.d.ts.map +1 -0
- package/lib/types/host/cline-pass/line.d.ts +55 -0
- package/lib/types/host/cline-pass/line.d.ts.map +1 -0
- package/lib/types/host/cline-pass/mapper.d.ts +138 -0
- package/lib/types/host/cline-pass/mapper.d.ts.map +1 -0
- package/lib/types/host/cline-pass/oauth.d.ts +134 -0
- package/lib/types/host/cline-pass/oauth.d.ts.map +1 -0
- package/lib/types/host/cline-pass/protocol.d.ts +44 -0
- package/lib/types/host/cline-pass/protocol.d.ts.map +1 -0
- package/lib/types/host/cline-pass/routes.d.ts +92 -0
- package/lib/types/host/cline-pass/routes.d.ts.map +1 -0
- package/lib/types/host/cline-pass/store.d.ts +75 -0
- package/lib/types/host/cline-pass/store.d.ts.map +1 -0
- package/lib/types/host/cline-pass/token-store.d.ts +170 -0
- package/lib/types/host/cline-pass/token-store.d.ts.map +1 -0
- package/lib/types/host/cline-pass/tools.d.ts +21 -0
- package/lib/types/host/cline-pass/tools.d.ts.map +1 -0
- package/lib/types/host/cline-pass/types.d.ts +127 -0
- package/lib/types/host/cline-pass/types.d.ts.map +1 -0
- package/lib/types/host/codex-account-pool.d.ts +223 -0
- package/lib/types/host/codex-account-pool.d.ts.map +1 -0
- package/lib/types/host/codex-adopt.d.ts +255 -0
- package/lib/types/host/codex-adopt.d.ts.map +1 -0
- package/lib/types/host/codex-catalog.d.ts +69 -0
- package/lib/types/host/codex-catalog.d.ts.map +1 -0
- package/lib/types/host/codex-fetch.d.ts +17 -0
- package/lib/types/host/codex-fetch.d.ts.map +1 -0
- package/lib/types/host/codex-file-import.d.ts +35 -0
- package/lib/types/host/codex-file-import.d.ts.map +1 -0
- package/lib/types/host/codex-identity.d.ts +132 -0
- package/lib/types/host/codex-identity.d.ts.map +1 -0
- package/lib/types/host/codex-remote-compaction.d.ts +41 -0
- package/lib/types/host/codex-remote-compaction.d.ts.map +1 -0
- package/lib/types/host/codex-search.d.ts +11 -0
- package/lib/types/host/codex-search.d.ts.map +1 -0
- package/lib/types/host/command-code/account-pool.d.ts +72 -0
- package/lib/types/host/command-code/account-pool.d.ts.map +1 -0
- package/lib/types/host/command-code/adapter.d.ts +89 -0
- package/lib/types/host/command-code/adapter.d.ts.map +1 -0
- package/lib/types/host/command-code/client.d.ts +126 -0
- package/lib/types/host/command-code/client.d.ts.map +1 -0
- package/lib/types/host/command-code/mapper.d.ts +199 -0
- package/lib/types/host/command-code/mapper.d.ts.map +1 -0
- package/lib/types/host/command-code/model-catalog.d.ts +90 -0
- package/lib/types/host/command-code/model-catalog.d.ts.map +1 -0
- package/lib/types/host/command-code/oauth.d.ts +95 -0
- package/lib/types/host/command-code/oauth.d.ts.map +1 -0
- package/lib/types/host/command-code/plans.d.ts +40 -0
- package/lib/types/host/command-code/plans.d.ts.map +1 -0
- package/lib/types/host/command-code/routes.d.ts +44 -0
- package/lib/types/host/command-code/routes.d.ts.map +1 -0
- package/lib/types/host/command-code/token-store.d.ts +100 -0
- package/lib/types/host/command-code/token-store.d.ts.map +1 -0
- package/lib/types/host/command-code/types.d.ts +222 -0
- package/lib/types/host/command-code/types.d.ts.map +1 -0
- package/lib/types/host/common/account-pool.d.ts +584 -0
- package/lib/types/host/common/account-pool.d.ts.map +1 -0
- package/lib/types/host/common/account-quota.d.ts +44 -0
- package/lib/types/host/common/account-quota.d.ts.map +1 -0
- package/lib/types/host/common/brand-compat.d.ts +4 -0
- package/lib/types/host/common/brand-compat.d.ts.map +1 -0
- package/lib/types/host/common/cache-activity.d.ts +16 -0
- package/lib/types/host/common/cache-activity.d.ts.map +1 -0
- package/lib/types/host/common/cache-affinity.d.ts +23 -0
- package/lib/types/host/common/cache-affinity.d.ts.map +1 -0
- package/lib/types/host/common/cache-hint.d.ts +18 -0
- package/lib/types/host/common/cache-hint.d.ts.map +1 -0
- package/lib/types/host/common/capabilities.d.ts +100 -0
- package/lib/types/host/common/capabilities.d.ts.map +1 -0
- package/lib/types/host/common/catalog-snapshot.d.ts +80 -0
- package/lib/types/host/common/catalog-snapshot.d.ts.map +1 -0
- package/lib/types/host/common/claude-capability-memory.d.ts +51 -0
- package/lib/types/host/common/claude-capability-memory.d.ts.map +1 -0
- package/lib/types/host/common/claude-code-cch.d.ts +28 -0
- package/lib/types/host/common/claude-code-cch.d.ts.map +1 -0
- package/lib/types/host/common/claude-code-corrections.d.ts +6 -0
- package/lib/types/host/common/claude-code-corrections.d.ts.map +1 -0
- package/lib/types/host/common/claude-code-first-party.d.ts +68 -0
- package/lib/types/host/common/claude-code-first-party.d.ts.map +1 -0
- package/lib/types/host/common/claude-code-version.d.ts +90 -0
- package/lib/types/host/common/claude-code-version.d.ts.map +1 -0
- package/lib/types/host/common/concurrency-gate.d.ts +46 -0
- package/lib/types/host/common/concurrency-gate.d.ts.map +1 -0
- package/lib/types/host/common/context-budget-fetch.d.ts +7 -0
- package/lib/types/host/common/context-budget-fetch.d.ts.map +1 -0
- package/lib/types/host/common/context-overflow.d.ts +7 -0
- package/lib/types/host/common/context-overflow.d.ts.map +1 -0
- package/lib/types/host/common/context-window-overrides.d.ts +12 -0
- package/lib/types/host/common/context-window-overrides.d.ts.map +1 -0
- package/lib/types/host/common/credential-read-cache.d.ts +82 -0
- package/lib/types/host/common/credential-read-cache.d.ts.map +1 -0
- package/lib/types/host/common/credentials-compat.d.ts +73 -0
- package/lib/types/host/common/credentials-compat.d.ts.map +1 -0
- package/lib/types/host/common/failure-classification.d.ts +21 -0
- package/lib/types/host/common/failure-classification.d.ts.map +1 -0
- package/lib/types/host/common/file-preferences.d.ts +49 -0
- package/lib/types/host/common/file-preferences.d.ts.map +1 -0
- package/lib/types/host/common/gpt-engineering-guidance.d.ts +16 -0
- package/lib/types/host/common/gpt-engineering-guidance.d.ts.map +1 -0
- package/lib/types/host/common/home.d.ts +8 -0
- package/lib/types/host/common/home.d.ts.map +1 -0
- package/lib/types/host/common/hosted-media.d.ts +36 -0
- package/lib/types/host/common/hosted-media.d.ts.map +1 -0
- package/lib/types/host/common/i18n/en.d.ts +9 -0
- package/lib/types/host/common/i18n/en.d.ts.map +1 -0
- package/lib/types/host/common/i18n/index.d.ts +13 -0
- package/lib/types/host/common/i18n/index.d.ts.map +1 -0
- package/lib/types/host/common/i18n/provider-name.d.ts +10 -0
- package/lib/types/host/common/i18n/provider-name.d.ts.map +1 -0
- package/lib/types/host/common/i18n/ru.d.ts +10 -0
- package/lib/types/host/common/i18n/ru.d.ts.map +1 -0
- package/lib/types/host/common/i18n/runtime.d.ts +54 -0
- package/lib/types/host/common/i18n/runtime.d.ts.map +1 -0
- package/lib/types/host/common/i18n/t.d.ts +38 -0
- package/lib/types/host/common/i18n/t.d.ts.map +1 -0
- package/lib/types/host/common/i18n/zh.d.ts +172 -0
- package/lib/types/host/common/i18n/zh.d.ts.map +1 -0
- package/lib/types/host/common/idle-watchdog.d.ts +58 -0
- package/lib/types/host/common/idle-watchdog.d.ts.map +1 -0
- package/lib/types/host/common/legacy-preferences.d.ts +29 -0
- package/lib/types/host/common/legacy-preferences.d.ts.map +1 -0
- package/lib/types/host/common/llm-compat.d.ts +157 -0
- package/lib/types/host/common/llm-compat.d.ts.map +1 -0
- package/lib/types/host/common/model-request-control.d.ts +21 -0
- package/lib/types/host/common/model-request-control.d.ts.map +1 -0
- package/lib/types/host/common/orphan-tool-calls.d.ts +47 -0
- package/lib/types/host/common/orphan-tool-calls.d.ts.map +1 -0
- package/lib/types/host/common/output-reservation.d.ts +11 -0
- package/lib/types/host/common/output-reservation.d.ts.map +1 -0
- package/lib/types/host/common/pool-storage-settings.d.ts +41 -0
- package/lib/types/host/common/pool-storage-settings.d.ts.map +1 -0
- package/lib/types/host/common/pool-storage.d.ts +143 -0
- package/lib/types/host/common/pool-storage.d.ts.map +1 -0
- package/lib/types/host/common/prefix-request-coordinator.d.ts +46 -0
- package/lib/types/host/common/prefix-request-coordinator.d.ts.map +1 -0
- package/lib/types/host/common/prefix-stability.d.ts +24 -0
- package/lib/types/host/common/prefix-stability.d.ts.map +1 -0
- package/lib/types/host/common/prompt-cache-policy.d.ts +47 -0
- package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -0
- package/lib/types/host/common/prompt-estimate.d.ts +22 -0
- package/lib/types/host/common/prompt-estimate.d.ts.map +1 -0
- package/lib/types/host/common/provider-route.d.ts +56 -0
- package/lib/types/host/common/provider-route.d.ts.map +1 -0
- package/lib/types/host/common/quota-refresh.d.ts +35 -0
- package/lib/types/host/common/quota-refresh.d.ts.map +1 -0
- package/lib/types/host/common/reasoning-dialect.d.ts +24 -0
- package/lib/types/host/common/reasoning-dialect.d.ts.map +1 -0
- package/lib/types/host/common/reasoning-efforts.d.ts +2 -0
- package/lib/types/host/common/reasoning-efforts.d.ts.map +1 -0
- package/lib/types/host/common/request-diagnostics.d.ts +79 -0
- package/lib/types/host/common/request-diagnostics.d.ts.map +1 -0
- package/lib/types/host/common/request-images.d.ts +275 -0
- package/lib/types/host/common/request-images.d.ts.map +1 -0
- package/lib/types/host/common/same-origin.d.ts +30 -0
- package/lib/types/host/common/same-origin.d.ts.map +1 -0
- package/lib/types/host/common/session-cache-state.d.ts +29 -0
- package/lib/types/host/common/session-cache-state.d.ts.map +1 -0
- package/lib/types/host/common/session-effort-memory.d.ts +35 -0
- package/lib/types/host/common/session-effort-memory.d.ts.map +1 -0
- package/lib/types/host/common/settings-compat.d.ts +55 -0
- package/lib/types/host/common/settings-compat.d.ts.map +1 -0
- package/lib/types/host/common/sticky-image-budget.d.ts +10 -0
- package/lib/types/host/common/sticky-image-budget.d.ts.map +1 -0
- package/lib/types/host/common/stream-error.d.ts +93 -0
- package/lib/types/host/common/stream-error.d.ts.map +1 -0
- package/lib/types/host/common/tool-schema.d.ts +27 -0
- package/lib/types/host/common/tool-schema.d.ts.map +1 -0
- package/lib/types/host/common/video-request.d.ts +81 -0
- package/lib/types/host/common/video-request.d.ts.map +1 -0
- package/lib/types/host/common/video.d.ts +90 -0
- package/lib/types/host/common/video.d.ts.map +1 -0
- package/lib/types/host/common/webserver-compat.d.ts +7 -0
- package/lib/types/host/common/webserver-compat.d.ts.map +1 -0
- package/lib/types/host/credential-store-secret-service.d.ts +66 -0
- package/lib/types/host/credential-store-secret-service.d.ts.map +1 -0
- package/lib/types/host/fetch-address-policy.d.ts +79 -0
- package/lib/types/host/fetch-address-policy.d.ts.map +1 -0
- package/lib/types/host/fetch-configuration.d.ts +6 -0
- package/lib/types/host/fetch-configuration.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/account-pool.d.ts +152 -0
- package/lib/types/host/glm-coding-plan/account-pool.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/adapter.d.ts +169 -0
- package/lib/types/host/glm-coding-plan/adapter.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/adopt.d.ts +354 -0
- package/lib/types/host/glm-coding-plan/adopt.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/biz-token-cache.d.ts +99 -0
- package/lib/types/host/glm-coding-plan/biz-token-cache.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/client.d.ts +218 -0
- package/lib/types/host/glm-coding-plan/client.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/exchange.d.ts +223 -0
- package/lib/types/host/glm-coding-plan/exchange.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/mapper-anthropic.d.ts +312 -0
- package/lib/types/host/glm-coding-plan/mapper-anthropic.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/mapper-openai.d.ts +213 -0
- package/lib/types/host/glm-coding-plan/mapper-openai.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/model-catalog.d.ts +241 -0
- package/lib/types/host/glm-coding-plan/model-catalog.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/oauth.d.ts +211 -0
- package/lib/types/host/glm-coding-plan/oauth.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/routes.d.ts +93 -0
- package/lib/types/host/glm-coding-plan/routes.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/token-store.d.ts +202 -0
- package/lib/types/host/glm-coding-plan/token-store.d.ts.map +1 -0
- package/lib/types/host/glm-coding-plan/types.d.ts +492 -0
- package/lib/types/host/glm-coding-plan/types.d.ts.map +1 -0
- package/lib/types/host/hub-overview.d.ts +32 -0
- package/lib/types/host/hub-overview.d.ts.map +1 -0
- package/lib/types/host/kimi-code/account-pool.d.ts +124 -0
- package/lib/types/host/kimi-code/account-pool.d.ts.map +1 -0
- package/lib/types/host/kimi-code/adapter.d.ts +451 -0
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -0
- package/lib/types/host/kimi-code/api-key.d.ts +55 -0
- package/lib/types/host/kimi-code/api-key.d.ts.map +1 -0
- package/lib/types/host/kimi-code/cache-affinity.d.ts +112 -0
- package/lib/types/host/kimi-code/cache-affinity.d.ts.map +1 -0
- package/lib/types/host/kimi-code/cache-hint.d.ts +65 -0
- package/lib/types/host/kimi-code/cache-hint.d.ts.map +1 -0
- package/lib/types/host/kimi-code/client.d.ts +306 -0
- package/lib/types/host/kimi-code/client.d.ts.map +1 -0
- package/lib/types/host/kimi-code/mapper.d.ts +913 -0
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -0
- package/lib/types/host/kimi-code/media-files.d.ts +206 -0
- package/lib/types/host/kimi-code/media-files.d.ts.map +1 -0
- package/lib/types/host/kimi-code/modalities.d.ts +23 -0
- package/lib/types/host/kimi-code/modalities.d.ts.map +1 -0
- package/lib/types/host/kimi-code/model-catalog.d.ts +125 -0
- package/lib/types/host/kimi-code/model-catalog.d.ts.map +1 -0
- package/lib/types/host/kimi-code/oauth.d.ts +213 -0
- package/lib/types/host/kimi-code/oauth.d.ts.map +1 -0
- package/lib/types/host/kimi-code/routes.d.ts +52 -0
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -0
- package/lib/types/host/kimi-code/session-cache-state.d.ts +156 -0
- package/lib/types/host/kimi-code/session-cache-state.d.ts.map +1 -0
- package/lib/types/host/kimi-code/token-store.d.ts +182 -0
- package/lib/types/host/kimi-code/token-store.d.ts.map +1 -0
- package/lib/types/host/kimi-code/tool-argument-guard.d.ts +43 -0
- package/lib/types/host/kimi-code/tool-argument-guard.d.ts.map +1 -0
- package/lib/types/host/kimi-code/types.d.ts +458 -0
- package/lib/types/host/kimi-code/types.d.ts.map +1 -0
- package/lib/types/host/kimi-code/warmup-streak.d.ts +66 -0
- package/lib/types/host/kimi-code/warmup-streak.d.ts.map +1 -0
- package/lib/types/host/minimax-code/account-pool.d.ts +309 -0
- package/lib/types/host/minimax-code/account-pool.d.ts.map +1 -0
- package/lib/types/host/minimax-code/adapter.d.ts +207 -0
- package/lib/types/host/minimax-code/adapter.d.ts.map +1 -0
- package/lib/types/host/minimax-code/checkin-gateway.d.ts +145 -0
- package/lib/types/host/minimax-code/checkin-gateway.d.ts.map +1 -0
- package/lib/types/host/minimax-code/checkin.d.ts +207 -0
- package/lib/types/host/minimax-code/checkin.d.ts.map +1 -0
- package/lib/types/host/minimax-code/client.d.ts +242 -0
- package/lib/types/host/minimax-code/client.d.ts.map +1 -0
- package/lib/types/host/minimax-code/files-api.d.ts +117 -0
- package/lib/types/host/minimax-code/files-api.d.ts.map +1 -0
- package/lib/types/host/minimax-code/iso-bmff-duration.d.ts +84 -0
- package/lib/types/host/minimax-code/iso-bmff-duration.d.ts.map +1 -0
- package/lib/types/host/minimax-code/mapper.d.ts +351 -0
- package/lib/types/host/minimax-code/mapper.d.ts.map +1 -0
- package/lib/types/host/minimax-code/matrix-client.d.ts +168 -0
- package/lib/types/host/minimax-code/matrix-client.d.ts.map +1 -0
- package/lib/types/host/minimax-code/modalities.d.ts +20 -0
- package/lib/types/host/minimax-code/modalities.d.ts.map +1 -0
- package/lib/types/host/minimax-code/model-catalog.d.ts +227 -0
- package/lib/types/host/minimax-code/model-catalog.d.ts.map +1 -0
- package/lib/types/host/minimax-code/oauth.d.ts +220 -0
- package/lib/types/host/minimax-code/oauth.d.ts.map +1 -0
- package/lib/types/host/minimax-code/reset-card.d.ts +136 -0
- package/lib/types/host/minimax-code/reset-card.d.ts.map +1 -0
- package/lib/types/host/minimax-code/routes.d.ts +82 -0
- package/lib/types/host/minimax-code/routes.d.ts.map +1 -0
- package/lib/types/host/minimax-code/token-store.d.ts +328 -0
- package/lib/types/host/minimax-code/token-store.d.ts.map +1 -0
- package/lib/types/host/minimax-code/tool-argument-repair.d.ts +72 -0
- package/lib/types/host/minimax-code/tool-argument-repair.d.ts.map +1 -0
- package/lib/types/host/minimax-code/types.d.ts +378 -0
- package/lib/types/host/minimax-code/types.d.ts.map +1 -0
- package/lib/types/host/model-catalog.d.ts +43 -0
- package/lib/types/host/model-catalog.d.ts.map +1 -0
- package/lib/types/host/oauth-service.d.ts +242 -0
- package/lib/types/host/oauth-service.d.ts.map +1 -0
- package/lib/types/host/ollama/account-pool.d.ts +65 -0
- package/lib/types/host/ollama/account-pool.d.ts.map +1 -0
- package/lib/types/host/ollama/adapter.d.ts +90 -0
- package/lib/types/host/ollama/adapter.d.ts.map +1 -0
- package/lib/types/host/ollama/client.d.ts +166 -0
- package/lib/types/host/ollama/client.d.ts.map +1 -0
- package/lib/types/host/ollama/mapper.d.ts +49 -0
- package/lib/types/host/ollama/mapper.d.ts.map +1 -0
- package/lib/types/host/ollama/routes.d.ts +22 -0
- package/lib/types/host/ollama/routes.d.ts.map +1 -0
- package/lib/types/host/ollama/token-store.d.ts +78 -0
- package/lib/types/host/ollama/token-store.d.ts.map +1 -0
- package/lib/types/host/ollama/types.d.ts +247 -0
- package/lib/types/host/ollama/types.d.ts.map +1 -0
- package/lib/types/host/opencode-go/account-pool.d.ts +50 -0
- package/lib/types/host/opencode-go/account-pool.d.ts.map +1 -0
- package/lib/types/host/opencode-go/adapter.d.ts +38 -0
- package/lib/types/host/opencode-go/adapter.d.ts.map +1 -0
- package/lib/types/host/opencode-go/client.d.ts +13 -0
- package/lib/types/host/opencode-go/client.d.ts.map +1 -0
- package/lib/types/host/opencode-go/mapper-gemini.d.ts +13 -0
- package/lib/types/host/opencode-go/mapper-gemini.d.ts.map +1 -0
- package/lib/types/host/opencode-go/mapper-messages.d.ts +8 -0
- package/lib/types/host/opencode-go/mapper-messages.d.ts.map +1 -0
- package/lib/types/host/opencode-go/mapper-responses.d.ts +9 -0
- package/lib/types/host/opencode-go/mapper-responses.d.ts.map +1 -0
- package/lib/types/host/opencode-go/mapper.d.ts +38 -0
- package/lib/types/host/opencode-go/mapper.d.ts.map +1 -0
- package/lib/types/host/opencode-go/model-catalog.d.ts +57 -0
- package/lib/types/host/opencode-go/model-catalog.d.ts.map +1 -0
- package/lib/types/host/opencode-go/native-shared.d.ts +31 -0
- package/lib/types/host/opencode-go/native-shared.d.ts.map +1 -0
- package/lib/types/host/opencode-go/protocol.d.ts +13 -0
- package/lib/types/host/opencode-go/protocol.d.ts.map +1 -0
- package/lib/types/host/opencode-go/routes.d.ts +13 -0
- package/lib/types/host/opencode-go/routes.d.ts.map +1 -0
- package/lib/types/host/opencode-go/token-store.d.ts +29 -0
- package/lib/types/host/opencode-go/token-store.d.ts.map +1 -0
- package/lib/types/host/opencode-go/types.d.ts +20 -0
- package/lib/types/host/opencode-go/types.d.ts.map +1 -0
- package/lib/types/host/opendesign/account-pool.d.ts +54 -0
- package/lib/types/host/opendesign/account-pool.d.ts.map +1 -0
- package/lib/types/host/opendesign/adapter.d.ts +88 -0
- package/lib/types/host/opendesign/adapter.d.ts.map +1 -0
- package/lib/types/host/opendesign/catalog.d.ts +58 -0
- package/lib/types/host/opendesign/catalog.d.ts.map +1 -0
- package/lib/types/host/opendesign/client.d.ts +304 -0
- package/lib/types/host/opendesign/client.d.ts.map +1 -0
- package/lib/types/host/opendesign/line.d.ts +60 -0
- package/lib/types/host/opendesign/line.d.ts.map +1 -0
- package/lib/types/host/opendesign/mapper.d.ts +218 -0
- package/lib/types/host/opendesign/mapper.d.ts.map +1 -0
- package/lib/types/host/opendesign/oauth.d.ts +105 -0
- package/lib/types/host/opendesign/oauth.d.ts.map +1 -0
- package/lib/types/host/opendesign/routes.d.ts +75 -0
- package/lib/types/host/opendesign/routes.d.ts.map +1 -0
- package/lib/types/host/opendesign/token-store.d.ts +241 -0
- package/lib/types/host/opendesign/token-store.d.ts.map +1 -0
- package/lib/types/host/opendesign/types.d.ts +235 -0
- package/lib/types/host/opendesign/types.d.ts.map +1 -0
- package/lib/types/host/platform-token-store.d.ts +3 -0
- package/lib/types/host/platform-token-store.d.ts.map +1 -0
- package/lib/types/host/preferences.d.ts +26 -0
- package/lib/types/host/preferences.d.ts.map +1 -0
- package/lib/types/host/proxy-manager.d.ts +261 -0
- package/lib/types/host/proxy-manager.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/adapter.d.ts +37 -0
- package/lib/types/host/qianwen-token-plan/adapter.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/cache-stats.d.ts +17 -0
- package/lib/types/host/qianwen-token-plan/cache-stats.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/client.d.ts +5 -0
- package/lib/types/host/qianwen-token-plan/client.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/mapper.d.ts +71 -0
- package/lib/types/host/qianwen-token-plan/mapper.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/model-catalog.d.ts +28 -0
- package/lib/types/host/qianwen-token-plan/model-catalog.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/routes.d.ts +12 -0
- package/lib/types/host/qianwen-token-plan/routes.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/token-store.d.ts +56 -0
- package/lib/types/host/qianwen-token-plan/token-store.d.ts.map +1 -0
- package/lib/types/host/qianwen-token-plan/types.d.ts +13 -0
- package/lib/types/host/qianwen-token-plan/types.d.ts.map +1 -0
- package/lib/types/host/qoder/account-pool.d.ts +141 -0
- package/lib/types/host/qoder/account-pool.d.ts.map +1 -0
- package/lib/types/host/qoder/adapter.d.ts +167 -0
- package/lib/types/host/qoder/adapter.d.ts.map +1 -0
- package/lib/types/host/qoder/adopt.d.ts +146 -0
- package/lib/types/host/qoder/adopt.d.ts.map +1 -0
- package/lib/types/host/qoder/client.d.ts +323 -0
- package/lib/types/host/qoder/client.d.ts.map +1 -0
- package/lib/types/host/qoder/cosy.d.ts +173 -0
- package/lib/types/host/qoder/cosy.d.ts.map +1 -0
- package/lib/types/host/qoder/mapper.d.ts +332 -0
- package/lib/types/host/qoder/mapper.d.ts.map +1 -0
- package/lib/types/host/qoder/model-catalog.d.ts +231 -0
- package/lib/types/host/qoder/model-catalog.d.ts.map +1 -0
- package/lib/types/host/qoder/oauth.d.ts +151 -0
- package/lib/types/host/qoder/oauth.d.ts.map +1 -0
- package/lib/types/host/qoder/routes.d.ts +119 -0
- package/lib/types/host/qoder/routes.d.ts.map +1 -0
- package/lib/types/host/qoder/token-store.d.ts +280 -0
- package/lib/types/host/qoder/token-store.d.ts.map +1 -0
- package/lib/types/host/qoder/types.d.ts +262 -0
- package/lib/types/host/qoder/types.d.ts.map +1 -0
- package/lib/types/host/relayone/account-pool.d.ts +129 -0
- package/lib/types/host/relayone/account-pool.d.ts.map +1 -0
- package/lib/types/host/relayone/adapter.d.ts +87 -0
- package/lib/types/host/relayone/adapter.d.ts.map +1 -0
- package/lib/types/host/relayone/catalog-manager.d.ts +45 -0
- package/lib/types/host/relayone/catalog-manager.d.ts.map +1 -0
- package/lib/types/host/relayone/client.d.ts +5 -0
- package/lib/types/host/relayone/client.d.ts.map +1 -0
- package/lib/types/host/relayone/mapper-anthropic.d.ts +49 -0
- package/lib/types/host/relayone/mapper-anthropic.d.ts.map +1 -0
- package/lib/types/host/relayone/mapper-openai.d.ts +36 -0
- package/lib/types/host/relayone/mapper-openai.d.ts.map +1 -0
- package/lib/types/host/relayone/mapper-shared.d.ts +25 -0
- package/lib/types/host/relayone/mapper-shared.d.ts.map +1 -0
- package/lib/types/host/relayone/model-catalog.d.ts +70 -0
- package/lib/types/host/relayone/model-catalog.d.ts.map +1 -0
- package/lib/types/host/relayone/quota.d.ts +29 -0
- package/lib/types/host/relayone/quota.d.ts.map +1 -0
- package/lib/types/host/relayone/routes.d.ts +33 -0
- package/lib/types/host/relayone/routes.d.ts.map +1 -0
- package/lib/types/host/relayone/token-store.d.ts +49 -0
- package/lib/types/host/relayone/token-store.d.ts.map +1 -0
- package/lib/types/host/relayone/types.d.ts +22 -0
- package/lib/types/host/relayone/types.d.ts.map +1 -0
- package/lib/types/host/responses-client.d.ts +125 -0
- package/lib/types/host/responses-client.d.ts.map +1 -0
- package/lib/types/host/responses-mapper.d.ts +133 -0
- package/lib/types/host/responses-mapper.d.ts.map +1 -0
- package/lib/types/host/routes.d.ts +30 -0
- package/lib/types/host/routes.d.ts.map +1 -0
- package/lib/types/host/search-provider-switcher.d.ts +45 -0
- package/lib/types/host/search-provider-switcher.d.ts.map +1 -0
- package/lib/types/host/session-title-guard/index.d.ts +80 -0
- package/lib/types/host/session-title-guard/index.d.ts.map +1 -0
- package/lib/types/host/step-code/account-pool.d.ts +187 -0
- package/lib/types/host/step-code/account-pool.d.ts.map +1 -0
- package/lib/types/host/step-code/adapter.d.ts +156 -0
- package/lib/types/host/step-code/adapter.d.ts.map +1 -0
- package/lib/types/host/step-code/adopt.d.ts +201 -0
- package/lib/types/host/step-code/adopt.d.ts.map +1 -0
- package/lib/types/host/step-code/cache-stats.d.ts +181 -0
- package/lib/types/host/step-code/cache-stats.d.ts.map +1 -0
- package/lib/types/host/step-code/client.d.ts +339 -0
- package/lib/types/host/step-code/client.d.ts.map +1 -0
- package/lib/types/host/step-code/mapper.d.ts +305 -0
- package/lib/types/host/step-code/mapper.d.ts.map +1 -0
- package/lib/types/host/step-code/model-catalog.d.ts +247 -0
- package/lib/types/host/step-code/model-catalog.d.ts.map +1 -0
- package/lib/types/host/step-code/oauth.d.ts +265 -0
- package/lib/types/host/step-code/oauth.d.ts.map +1 -0
- package/lib/types/host/step-code/routes.d.ts +129 -0
- package/lib/types/host/step-code/routes.d.ts.map +1 -0
- package/lib/types/host/step-code/token-store.d.ts +325 -0
- package/lib/types/host/step-code/token-store.d.ts.map +1 -0
- package/lib/types/host/step-code/types.d.ts +492 -0
- package/lib/types/host/step-code/types.d.ts.map +1 -0
- package/lib/types/host/token-store-linux.d.ts +20 -0
- package/lib/types/host/token-store-linux.d.ts.map +1 -0
- package/lib/types/host/token-store-macos.d.ts +39 -0
- package/lib/types/host/token-store-macos.d.ts.map +1 -0
- package/lib/types/host/token-store-windows.d.ts +26 -0
- package/lib/types/host/token-store-windows.d.ts.map +1 -0
- package/lib/types/host/token-store.d.ts +81 -0
- package/lib/types/host/token-store.d.ts.map +1 -0
- package/lib/types/host/usage-service.d.ts +109 -0
- package/lib/types/host/usage-service.d.ts.map +1 -0
- package/lib/types/host/web-provider-reconciler.d.ts +34 -0
- package/lib/types/host/web-provider-reconciler.d.ts.map +1 -0
- package/lib/types/host/wire-auth.d.ts +63 -0
- package/lib/types/host/wire-auth.d.ts.map +1 -0
- package/lib/types/host/workbuddy/account-pool.d.ts +389 -0
- package/lib/types/host/workbuddy/account-pool.d.ts.map +1 -0
- package/lib/types/host/workbuddy/adapter.d.ts +248 -0
- package/lib/types/host/workbuddy/adapter.d.ts.map +1 -0
- package/lib/types/host/workbuddy/atrest.d.ts +98 -0
- package/lib/types/host/workbuddy/atrest.d.ts.map +1 -0
- package/lib/types/host/workbuddy/checkin.d.ts +150 -0
- package/lib/types/host/workbuddy/checkin.d.ts.map +1 -0
- package/lib/types/host/workbuddy/client.d.ts +214 -0
- package/lib/types/host/workbuddy/client.d.ts.map +1 -0
- package/lib/types/host/workbuddy/dsml.d.ts +55 -0
- package/lib/types/host/workbuddy/dsml.d.ts.map +1 -0
- package/lib/types/host/workbuddy/guardrails.d.ts +111 -0
- package/lib/types/host/workbuddy/guardrails.d.ts.map +1 -0
- package/lib/types/host/workbuddy/identity.d.ts +71 -0
- package/lib/types/host/workbuddy/identity.d.ts.map +1 -0
- package/lib/types/host/workbuddy/mapper.d.ts +238 -0
- package/lib/types/host/workbuddy/mapper.d.ts.map +1 -0
- package/lib/types/host/workbuddy/model-catalog.d.ts +239 -0
- package/lib/types/host/workbuddy/model-catalog.d.ts.map +1 -0
- package/lib/types/host/workbuddy/oauth.d.ts +47 -0
- package/lib/types/host/workbuddy/oauth.d.ts.map +1 -0
- package/lib/types/host/workbuddy/outbound-identity.d.ts +139 -0
- package/lib/types/host/workbuddy/outbound-identity.d.ts.map +1 -0
- package/lib/types/host/workbuddy/routes.d.ts +56 -0
- package/lib/types/host/workbuddy/routes.d.ts.map +1 -0
- package/lib/types/host/workbuddy/token-store.d.ts +370 -0
- package/lib/types/host/workbuddy/token-store.d.ts.map +1 -0
- package/lib/types/host/workbuddy/types.d.ts +185 -0
- package/lib/types/host/workbuddy/types.d.ts.map +1 -0
- package/lib/types/index.d.ts +248 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/shared/account-pool-contracts.d.ts +99 -0
- package/lib/types/shared/account-pool-contracts.d.ts.map +1 -0
- package/lib/types/shared/claude-api-contracts.d.ts +98 -0
- package/lib/types/shared/claude-api-contracts.d.ts.map +1 -0
- package/lib/types/shared/claude-contracts.d.ts +370 -0
- package/lib/types/shared/claude-contracts.d.ts.map +1 -0
- package/lib/types/shared/cline-pass-contracts.d.ts +234 -0
- package/lib/types/shared/cline-pass-contracts.d.ts.map +1 -0
- package/lib/types/shared/command-code-contracts.d.ts +163 -0
- package/lib/types/shared/command-code-contracts.d.ts.map +1 -0
- package/lib/types/shared/contracts.d.ts +343 -0
- package/lib/types/shared/contracts.d.ts.map +1 -0
- package/lib/types/shared/glm-coding-plan-contracts.d.ts +315 -0
- package/lib/types/shared/glm-coding-plan-contracts.d.ts.map +1 -0
- package/lib/types/shared/hub-contracts.d.ts +37 -0
- package/lib/types/shared/hub-contracts.d.ts.map +1 -0
- package/lib/types/shared/i18n-contracts.d.ts +35 -0
- package/lib/types/shared/i18n-contracts.d.ts.map +1 -0
- package/lib/types/shared/kimi-code-contracts.d.ts +435 -0
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -0
- package/lib/types/shared/minimax-code-contracts.d.ts +263 -0
- package/lib/types/shared/minimax-code-contracts.d.ts.map +1 -0
- package/lib/types/shared/model-catalog.d.ts +302 -0
- package/lib/types/shared/model-catalog.d.ts.map +1 -0
- package/lib/types/shared/ollama-contracts.d.ts +73 -0
- package/lib/types/shared/ollama-contracts.d.ts.map +1 -0
- package/lib/types/shared/opencode-go-contracts.d.ts +80 -0
- package/lib/types/shared/opencode-go-contracts.d.ts.map +1 -0
- package/lib/types/shared/opendesign-contracts.d.ts +262 -0
- package/lib/types/shared/opendesign-contracts.d.ts.map +1 -0
- package/lib/types/shared/preferences.d.ts +60 -0
- package/lib/types/shared/preferences.d.ts.map +1 -0
- package/lib/types/shared/qianwen-token-plan-contracts.d.ts +94 -0
- package/lib/types/shared/qianwen-token-plan-contracts.d.ts.map +1 -0
- package/lib/types/shared/qoder-contracts.d.ts +342 -0
- package/lib/types/shared/qoder-contracts.d.ts.map +1 -0
- package/lib/types/shared/relayone-contracts.d.ts +95 -0
- package/lib/types/shared/relayone-contracts.d.ts.map +1 -0
- package/lib/types/shared/step-code-contracts.d.ts +443 -0
- package/lib/types/shared/step-code-contracts.d.ts.map +1 -0
- package/lib/types/shared/workbuddy-contracts.d.ts +531 -0
- package/lib/types/shared/workbuddy-contracts.d.ts.map +1 -0
- package/package.json +147 -4
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire half of the MiniMax Code daily check-in.
|
|
3
|
+
*
|
|
4
|
+
* Everything in this file is measured against, or ported from, the official
|
|
5
|
+
* client's own open source (`MiniMax-AI/minimax-code`, MIT):
|
|
6
|
+
* `packages/tui/src/checkin/http-gateway.ts` does the two check-in calls and
|
|
7
|
+
* `packages/tui/src/runtime/public-gateway.ts` builds the request. The wire
|
|
8
|
+
* shape was additionally verified live against the CN deployment with this
|
|
9
|
+
* machine's own credential (see the 0.2.0-rc.1-era probe notes in the
|
|
10
|
+
* changelog): `GET signin/status` and `POST signin/claim` answer exactly the
|
|
11
|
+
* shapes validated below, and a duplicate claim answers
|
|
12
|
+
* `claim_result: 2` (AlreadyClaimed) rather than an error.
|
|
13
|
+
*
|
|
14
|
+
* The `yy` / `x-timestamp` / `x-signature` headers are the same first-party
|
|
15
|
+
* attribution literals this package's `types.ts` product-token note discusses.
|
|
16
|
+
* The official source's own comment calls them wire-protocol constants that
|
|
17
|
+
* are "not credentials or a security boundary" — authorization is the Bearer
|
|
18
|
+
* token. Unlike the quota read (where they are optional and stay off by
|
|
19
|
+
* default), the check-in gateway refuses requests without them, so this
|
|
20
|
+
* feature cannot exist without sending them; that trade is recorded in the
|
|
21
|
+
* changelog and was made explicitly, not by default. The User-Agent stays the
|
|
22
|
+
* plugin's own honest one — it is NOT part of the signed surface.
|
|
23
|
+
*/
|
|
24
|
+
import type { MinimaxCodeRegion } from '../../shared/minimax-code-contracts.ts';
|
|
25
|
+
/** Activity status surface; answers whether today is claimable or claimed. */
|
|
26
|
+
export declare const SIGNIN_STATUS_PATH = "/minimax-cloud/api/v1/signin/status";
|
|
27
|
+
/** Check-in surface; credits are granted by posting here once a day. */
|
|
28
|
+
export declare const SIGNIN_CLAIM_PATH = "/minimax-cloud/api/v1/signin/claim";
|
|
29
|
+
/** Account identity surface; resolves the realUserID the query string needs. */
|
|
30
|
+
export declare const USER_INFO_PATH = "/v1/api/user/info";
|
|
31
|
+
/** Day status values the panel reports. Mirrors the official SigninDayStatus. */
|
|
32
|
+
export declare const SIGNIN_DAY_UPCOMING = 1;
|
|
33
|
+
export declare const SIGNIN_DAY_CLAIMABLE = 2;
|
|
34
|
+
export declare const SIGNIN_DAY_CLAIMED = 3;
|
|
35
|
+
export declare const SIGNIN_DAY_DISABLED = 4;
|
|
36
|
+
/** Claim outcomes the service reports. Mirrors the official SigninClaimResult. */
|
|
37
|
+
export declare const SIGNIN_CLAIM_FRESH = 1;
|
|
38
|
+
export declare const SIGNIN_CLAIM_ALREADY = 2;
|
|
39
|
+
export declare const CHECKIN_TIMEOUT_MS = 30000;
|
|
40
|
+
/** Origin the official client uses for this surface, per region. */
|
|
41
|
+
export declare function checkinGatewayOrigin(region: MinimaxCodeRegion): string;
|
|
42
|
+
export interface SigninDayItem {
|
|
43
|
+
day_no: number;
|
|
44
|
+
points: number;
|
|
45
|
+
bonus_points?: number;
|
|
46
|
+
status: number;
|
|
47
|
+
is_today: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface SigninPanel {
|
|
50
|
+
scene: number;
|
|
51
|
+
days: SigninDayItem[];
|
|
52
|
+
}
|
|
53
|
+
export interface ClaimSigninData {
|
|
54
|
+
claim_id: string;
|
|
55
|
+
claim_result: number;
|
|
56
|
+
day_no: number;
|
|
57
|
+
points: number;
|
|
58
|
+
expire_at_ms: number;
|
|
59
|
+
panel: SigninPanel;
|
|
60
|
+
}
|
|
61
|
+
/** Identity the check-in needs beyond the access token. */
|
|
62
|
+
export interface MinimaxCodeAccountIdentity {
|
|
63
|
+
realUserID: string;
|
|
64
|
+
userName?: string;
|
|
65
|
+
subUserName?: string;
|
|
66
|
+
userEmail?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Non-secret identity of the SIGN-IN a check-in credential came from.
|
|
70
|
+
*
|
|
71
|
+
* Spelled the way `minimaxCodePoolIdentity` (account-pool.ts) and
|
|
72
|
+
* `rotationKey` (token-store.ts) spell it — a native record slot, or the
|
|
73
|
+
* sign-in that produced a plugin-owned credential — because it names the same
|
|
74
|
+
* thing those do: one session, stable across every token rotation. It is
|
|
75
|
+
* repeated here rather than imported so this wire half stays free of the pool's
|
|
76
|
+
* imports.
|
|
77
|
+
*
|
|
78
|
+
* **Read this before trusting it as an account id.** It is a rotation key — a
|
|
79
|
+
* guard rail that tells "the same session, rotated" from "a different session" —
|
|
80
|
+
* and NOT the authoritative identity of the person behind it:
|
|
81
|
+
*
|
|
82
|
+
* - `native:<region>:<recordKey>` names a RECORD SLOT in the desktop app's
|
|
83
|
+
* `auth.json`, not a user. `recordKey` is a digest of the app's auth-home
|
|
84
|
+
* path, and the app keeps one record per slot, so signing a DIFFERENT account
|
|
85
|
+
* in on the desktop replaces that slot's session while the key stays the same.
|
|
86
|
+
* - `signin:<region>:<loginEpoch>` has the same shape of gap: it names the
|
|
87
|
+
* sign-in event, not the account it produced.
|
|
88
|
+
*
|
|
89
|
+
* The authoritative account fact on this line is therefore the `realUserID`
|
|
90
|
+
* resolved from the identity surface, and that is what the check-in state pins
|
|
91
|
+
* and what an attempt is compared against. This key is supporting evidence: it
|
|
92
|
+
* distinguishes a rotation from a swap, which `realUserID` cannot do without
|
|
93
|
+
* a request.
|
|
94
|
+
*
|
|
95
|
+
* Both fields are deliberately non-secret: a record slot name and a sign-in
|
|
96
|
+
* epoch, never a token and never a digest of one. That is what makes this the
|
|
97
|
+
* only account identity allowed to appear in a check-in error message.
|
|
98
|
+
*/
|
|
99
|
+
export declare function checkinAccountIdentity(credentials: {
|
|
100
|
+
region?: string | undefined;
|
|
101
|
+
recordKey?: string | null | undefined;
|
|
102
|
+
loginEpoch?: string | undefined;
|
|
103
|
+
}): string | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Validate one panel response. Ported from the official
|
|
106
|
+
* `validateSigninPanel`: exactly seven days, day numbers 1..7 without
|
|
107
|
+
* repeats, at most one claimable and at most one "today". A panel that fails
|
|
108
|
+
* this is a wire surprise, and treating it as "nothing to do" would silently
|
|
109
|
+
* skip the day, so validation throws.
|
|
110
|
+
*/
|
|
111
|
+
export declare function validateSigninPanel(value: unknown): SigninPanel;
|
|
112
|
+
/** Validate one claim response. Ported from the official `validateClaimSigninData`. */
|
|
113
|
+
export declare function validateClaimSigninData(value: unknown): ClaimSigninData;
|
|
114
|
+
/**
|
|
115
|
+
* The consecutive-claimed count ending today, from one panel.
|
|
116
|
+
*
|
|
117
|
+
* Ported from the official `getCurrentSigninStreak`: when today is claimed it
|
|
118
|
+
* counts; when today is still claimable the streak up to yesterday is what a
|
|
119
|
+
* claim would extend, so that is what the card shows.
|
|
120
|
+
*/
|
|
121
|
+
export declare function currentSigninStreak(days: readonly SigninDayItem[]): number;
|
|
122
|
+
export interface CheckinHttpOptions {
|
|
123
|
+
fetchFn?: typeof fetch;
|
|
124
|
+
/** Clock injection for tests. */
|
|
125
|
+
nowMs?: () => number;
|
|
126
|
+
/** `desktop_version` the request reports; the plugin version in production. */
|
|
127
|
+
appVersion?: string;
|
|
128
|
+
signal?: AbortSignal;
|
|
129
|
+
}
|
|
130
|
+
export declare class MinimaxCodeCheckinHttpError extends Error {
|
|
131
|
+
readonly status: number | null;
|
|
132
|
+
constructor(message: string, status: number | null);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Resolve the account's realUserID (and display fields) through the identity
|
|
136
|
+
* surface. The check-in query string needs realUserID and the OAuth document
|
|
137
|
+
* does not carry it, so it is resolved once per scheduler pass and cached in
|
|
138
|
+
* the check-in state afterwards.
|
|
139
|
+
*/
|
|
140
|
+
export declare function fetchAccountIdentity(accessToken: string, region: MinimaxCodeRegion, options?: CheckinHttpOptions): Promise<MinimaxCodeAccountIdentity>;
|
|
141
|
+
/** Read the seven-day panel; throws on transport, HTTP, or shape failures. */
|
|
142
|
+
export declare function fetchSigninPanel(accessToken: string, realUserID: string, region: MinimaxCodeRegion, options?: CheckinHttpOptions): Promise<SigninPanel>;
|
|
143
|
+
/** Claim today's credit; the response carries the fresh panel. */
|
|
144
|
+
export declare function claimSignin(accessToken: string, realUserID: string, region: MinimaxCodeRegion, options?: CheckinHttpOptions): Promise<ClaimSigninData>;
|
|
145
|
+
//# sourceMappingURL=checkin-gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin-gateway.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/checkin-gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAA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WAAW,CAAC,CAEtB;AAED,kEAAkE;AAClE,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,eAAe,CAAC,CAE1B"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daily check-in scheduler for the MiniMax Code line.
|
|
3
|
+
*
|
|
4
|
+
* The wire half lives in ./checkin-gateway.ts (official-client recipe,
|
|
5
|
+
* verified live); this module is the host-owned daily pass around it.
|
|
6
|
+
*
|
|
7
|
+
* - **Both regions.** The official client's public gateway has an origin per
|
|
8
|
+
* region, so an account signs in against its own region's origin. There is
|
|
9
|
+
* no CN-only carve-out: the CLI ships the same surface
|
|
10
|
+
* worldwide.
|
|
11
|
+
* - **Idempotent.** The panel is read first; an account whose today is already
|
|
12
|
+
* claimed (by anyone) is only recorded. A duplicate claim answers
|
|
13
|
+
* `claim_result: 2` (AlreadyClaimed), which is a success, never a retry.
|
|
14
|
+
* - **Patient with the day.** A today that is neither claimable nor claimed
|
|
15
|
+
* (upcoming/disabled) is parked and re-checked on an hourly cadence rather
|
|
16
|
+
* than abandoned: the activity flips on its own schedule, and the host
|
|
17
|
+
* usually boots before it does.
|
|
18
|
+
* - **Bounded.** A failing account is retried at most {@link CHECKIN_ATTEMPT_CAP}
|
|
19
|
+
* times a day, so a broken account cannot turn the ten-minute tick into a
|
|
20
|
+
* request loop. A manual run ignores the cap and the toggle, like the card's
|
|
21
|
+
* "check in now", and is queued behind an in-flight run.
|
|
22
|
+
*
|
|
23
|
+
* Credentials stay host-side: the only write beyond the state file is the
|
|
24
|
+
* account pool's own refresh write-back, reused here unchanged through
|
|
25
|
+
* `getFreshCredential` / `renewCredential`.
|
|
26
|
+
*/
|
|
27
|
+
import type { MinimaxCodeCheckinSummary } from '../../shared/minimax-code-contracts.ts';
|
|
28
|
+
import type { MinimaxCodeAccountPool } from './account-pool.ts';
|
|
29
|
+
/**
|
|
30
|
+
* Scheduler cadence. The first tick at host startup is the daily run; the
|
|
31
|
+
* interval keeps a long-lived process signing in on later days without a
|
|
32
|
+
* restart. Idle ticks cost no requests — the day state short-circuits them.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CHECKIN_TICK_MS: number;
|
|
35
|
+
/** Daily retry ceiling for one account after a failed attempt. */
|
|
36
|
+
export declare const CHECKIN_ATTEMPT_CAP = 3;
|
|
37
|
+
/**
|
|
38
|
+
* How long a not-yet-claimable today waits before the panel is polled again.
|
|
39
|
+
* The activity opens on its own schedule, and the first answer of the day is
|
|
40
|
+
* frequently "not open yet".
|
|
41
|
+
*/
|
|
42
|
+
export declare const CHECKIN_INACTIVE_RECHECK_MS: number;
|
|
43
|
+
/** State document the scheduler keeps beside the other plugin stores. */
|
|
44
|
+
export declare function checkinStatePath(): string;
|
|
45
|
+
/** Local calendar day an instant belongs to; state entries are keyed by it. */
|
|
46
|
+
export declare function localDateString(nowMs: number): string;
|
|
47
|
+
/**
|
|
48
|
+
* The check-in refused to act because the account changed **halfway through one
|
|
49
|
+
* attempt**.
|
|
50
|
+
*
|
|
51
|
+
* This is deliberately NOT the "the pool row was re-pointed at another account"
|
|
52
|
+
* case: that one is a legitimate state change and the entry re-synchronises to
|
|
53
|
+
* it (see {@link MinimaxCodeCheckinService['identityFor']}). What this class
|
|
54
|
+
* reports is the one case that must never self-heal — a forced 401 renewal that
|
|
55
|
+
* answers with a different account — because the panel was already read for one
|
|
56
|
+
* account and the claim would post as another.
|
|
57
|
+
*
|
|
58
|
+
* Its own class so the caller can tell it apart from a transport failure: it is
|
|
59
|
+
* never retried, and never recorded as "nothing to do today". The message
|
|
60
|
+
* carries only non-secret facts — the account keys each side resolved to — and
|
|
61
|
+
* never a token.
|
|
62
|
+
*/
|
|
63
|
+
export declare class MinimaxCodeCheckinAccountMismatchError extends Error {
|
|
64
|
+
readonly accountId: string;
|
|
65
|
+
readonly expectedIdentity: string | undefined;
|
|
66
|
+
readonly actualIdentity: string | undefined;
|
|
67
|
+
constructor(accountId: string, expectedIdentity: string | undefined, actualIdentity: string | undefined);
|
|
68
|
+
}
|
|
69
|
+
/** The slice of the account pool the scheduler uses. */
|
|
70
|
+
export type MinimaxCodeCheckinPool = Pick<MinimaxCodeAccountPool, 'listAccounts' | 'getFreshCredential' | 'renewCredential'>;
|
|
71
|
+
export interface MinimaxCodeCheckinServiceOptions {
|
|
72
|
+
fetchFn?: typeof fetch;
|
|
73
|
+
/** State document path; tests redirect it, production uses {@link checkinStatePath}. */
|
|
74
|
+
statePath?: string;
|
|
75
|
+
/** Live preference, re-read on every tick so the toggle applies at once. */
|
|
76
|
+
settings: () => {
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Resolves once the preference store has read its stored document, so the
|
|
81
|
+
* startup pass cannot act on a default the stored document is about to
|
|
82
|
+
* overwrite. Optional for callers whose settings are already in memory.
|
|
83
|
+
*/
|
|
84
|
+
ready?: () => Promise<void>;
|
|
85
|
+
/** Clock injection for tests. */
|
|
86
|
+
now?: () => number;
|
|
87
|
+
/** `desktop_version` the wire request reports; the plugin version in production. */
|
|
88
|
+
appVersion?: string;
|
|
89
|
+
logger?: {
|
|
90
|
+
info(message: string): void;
|
|
91
|
+
warn(message: string): void;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The check-in scheduler. One instance per plugin load; the host owns the
|
|
96
|
+
* interval and clears it from the same `ctx.effect` that created it.
|
|
97
|
+
*/
|
|
98
|
+
export declare class MinimaxCodeCheckinService {
|
|
99
|
+
private readonly pool;
|
|
100
|
+
private readonly options;
|
|
101
|
+
private readonly fetchFn;
|
|
102
|
+
private readonly statePath;
|
|
103
|
+
private readonly now;
|
|
104
|
+
private readonly logger;
|
|
105
|
+
private readonly appVersion;
|
|
106
|
+
private state;
|
|
107
|
+
private identities;
|
|
108
|
+
private loaded;
|
|
109
|
+
/** Passes waiting to run, in order; `true` marks a manual pass. */
|
|
110
|
+
private readonly queue;
|
|
111
|
+
/** The drain loop currently working the queue, if any. */
|
|
112
|
+
private draining;
|
|
113
|
+
private lastRunAt;
|
|
114
|
+
/** Memoized preference warmup, so it is awaited once however many passes run. */
|
|
115
|
+
private readyWait;
|
|
116
|
+
constructor(pool: MinimaxCodeCheckinPool, options: MinimaxCodeCheckinServiceOptions);
|
|
117
|
+
/**
|
|
118
|
+
* One scheduler pass. Automatic passes honour the toggle and the retry cap;
|
|
119
|
+
* a manual pass (`manual: true`, the card's "check in now") ignores both
|
|
120
|
+
* but still respects an account already signed in today.
|
|
121
|
+
*
|
|
122
|
+
* A manual pass that lands while a run is already in flight is *queued*, not
|
|
123
|
+
* absorbed: joining the running pass would silently discard the one thing the
|
|
124
|
+
* button promises, that the retry cap and the toggle are bypassed now.
|
|
125
|
+
*/
|
|
126
|
+
tick(manual?: boolean): Promise<void>;
|
|
127
|
+
private drain;
|
|
128
|
+
private runQueue;
|
|
129
|
+
private run;
|
|
130
|
+
/** Wait for the preference store's warmup read, once. */
|
|
131
|
+
private ready;
|
|
132
|
+
/**
|
|
133
|
+
* Resolve the account's realUserID, cached across days.
|
|
134
|
+
*
|
|
135
|
+
* The OAuth document does not carry it and the check-in query string needs
|
|
136
|
+
* it, so it is fetched from the identity surface once and kept in the state
|
|
137
|
+
* document. The region is cached alongside because the identity call's
|
|
138
|
+
* origin depends on it.
|
|
139
|
+
*
|
|
140
|
+
* The account identity of the resolving credential is pinned to the entry as
|
|
141
|
+
* well: the pin records which sign-in this realUserID was learned FOR, and it
|
|
142
|
+
* outlives the token that resolved it.
|
|
143
|
+
*
|
|
144
|
+
* **A re-pointed row is a state change, not a fault.** When the pin no longer
|
|
145
|
+
* matches the credential in hand, the pool row now holds a different account
|
|
146
|
+
* (the user signed a second account into the desktop app's sheet, or adopted
|
|
147
|
+
* another session into this row). Following it is the correct outcome: a pool
|
|
148
|
+
* row IS one account this plugin manages, and the check-in exists to sign in
|
|
149
|
+
* whatever account that row now holds. Holding the stale pin instead would
|
|
150
|
+
* mean asking the panel with A's realUserID while presenting B's token —
|
|
151
|
+
* precisely "B's credential used to check in A" — and would have no exit,
|
|
152
|
+
* because nothing clears a state document the card cannot reach.
|
|
153
|
+
*
|
|
154
|
+
* So a diverging pin re-resolves the identity WITH the credential in hand and
|
|
155
|
+
* re-pins the entry to it. An entry written before the pin existed carries
|
|
156
|
+
* `undefined` and re-resolves once too, which is how an old state document
|
|
157
|
+
* heals itself into a pinned one.
|
|
158
|
+
*
|
|
159
|
+
* The one thing that must still never happen — an account changing halfway
|
|
160
|
+
* through a single attempt — is caught elsewhere, because it cannot be caught
|
|
161
|
+
* here: {@link attemptOnce}'s panel/claim pair and the forced-renewal guard in
|
|
162
|
+
* {@link checkinOne}.
|
|
163
|
+
*/
|
|
164
|
+
private identityFor;
|
|
165
|
+
/** Check one account in, recording the outcome in its today's entry. */
|
|
166
|
+
private checkinOne;
|
|
167
|
+
/**
|
|
168
|
+
* One full try for one account: identity, panel, and — when today is
|
|
169
|
+
* claimable — the claim. Settles the entry on every outcome; throws for the
|
|
170
|
+
* caller's renew-and-retry or attempt bookkeeping.
|
|
171
|
+
*/
|
|
172
|
+
private attemptOnce;
|
|
173
|
+
/**
|
|
174
|
+
* The status call, against the current credential.
|
|
175
|
+
*
|
|
176
|
+
* The guard runs BEFORE the panel is read: the credential making this request
|
|
177
|
+
* must still be the one the identity was resolved with a moment ago.
|
|
178
|
+
*/
|
|
179
|
+
private panel;
|
|
180
|
+
/**
|
|
181
|
+
* The claim call, against the current credential.
|
|
182
|
+
*
|
|
183
|
+
* The guard runs again here — the pair the official client protects
|
|
184
|
+
* (`getSigninPanel` then `claimSignin`) — so a panel read for one account can
|
|
185
|
+
* never be followed by a claim posted as another, and both calls carry the
|
|
186
|
+
* same identity value by construction.
|
|
187
|
+
*/
|
|
188
|
+
private claim;
|
|
189
|
+
/**
|
|
190
|
+
* Fold one panel into the day's entry.
|
|
191
|
+
*
|
|
192
|
+
* Returns true when the entry is settled for the day (claimed already, or
|
|
193
|
+
* parked inactive): the caller then skips the claim. Today claimable is the
|
|
194
|
+
* one answer that returns false.
|
|
195
|
+
*/
|
|
196
|
+
private recordPanelOutcome;
|
|
197
|
+
/** Record a confirmed sign-in, clearing the transient failure bookkeeping. */
|
|
198
|
+
private markSignedIn;
|
|
199
|
+
/**
|
|
200
|
+
* The aggregate the settings card renders. Reads only local state and the
|
|
201
|
+
* account list; it never spends a network request.
|
|
202
|
+
*/
|
|
203
|
+
summary(): Promise<MinimaxCodeCheckinSummary>;
|
|
204
|
+
private load;
|
|
205
|
+
private save;
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=checkin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/checkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AACvF,OAAO,KAAK,EAAE,sBAAsB,EAAgC,MAAM,mBAAmB,CAAA;AAc7F;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAiB,CAAA;AAC7C,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAA;AAEzD,yEAAyE;AACzE,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKrD;AAiCD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,sCAAuC,SAAQ,KAAK;IAE7D,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,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CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,0DAA0D;IAC1D,OAAO,CAAC,QAAQ,CAA6B;IAE7C,OAAO,CAAC,SAAS,CAAsB;IACvC,iFAAiF;IACjF,OAAO,CAAC,SAAS,CAA6B;gBAG3B,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE,gCAAgC;IAS5D;;;;;;;;OAQG;IACG,IAAI,CAAC,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzC,OAAO,CAAC,KAAK;YAQC,QAAQ;YAoBR,GAAG;IAmCjB,yDAAyD;YAC3C,KAAK;IAOnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;YACW,WAAW;IAgCzB,wEAAwE;YAC1D,UAAU;IAiDxB;;;;OAIG;YACW,WAAW;IA2BzB;;;;;OAKG;YACW,KAAK;IAcnB;;;;;;;OAOG;YACW,KAAK;IAcnB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAsB1B,8EAA8E;IAC9E,OAAO,CAAC,YAAY;IAQpB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,yBAAyB,CAAC;YAwCrC,IAAI;YAoCJ,IAAI;CAYnB"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP surface of the MiniMax Code subscription.
|
|
3
|
+
*
|
|
4
|
+
* ONE header rule governs this whole file, and it is the one the brief calls out as
|
|
5
|
+
* a hard constraint: credentials are sent as `authorization: Bearer <accessToken>`.
|
|
6
|
+
* The endpoint also speaks the Anthropic wire format, whose client normally
|
|
7
|
+
* authenticates with `x-api-key`, and that difference was measured directly — an
|
|
8
|
+
* `x-api-key` request answers 401 `{"code":401,"message":"token is required"}`
|
|
9
|
+
* while the bearer form answers 200. There is deliberately no fallback that tries
|
|
10
|
+
* `x-api-key` after a 401: the measured verdict is that it cannot succeed, and a
|
|
11
|
+
* retry would only add a request to the subscription's bill.
|
|
12
|
+
*
|
|
13
|
+
* The second rule is an absence: this file has no `/v1/models` call and must never
|
|
14
|
+
* grow one. That route is not configured for subscription traffic and answers 503
|
|
15
|
+
* `{"errorCode":50115,"errorReason":"direct_route_not_configured"}`; the model
|
|
16
|
+
* directory is hardcoded in ./model-catalog.ts instead.
|
|
17
|
+
*/
|
|
18
|
+
import { DEFAULT_DEVICE_INTERVAL_SECONDS, MESSAGES_PATH, agentBaseUrl, MINIMAX_CODE_BUILD_ENV, redactToken } from './types.ts';
|
|
19
|
+
import { MinimaxCodeCredentialStore, type MinimaxCodeCredentials } from './token-store.ts';
|
|
20
|
+
import { MinimaxCodeUnauthorizedError } from './oauth.ts';
|
|
21
|
+
import type { MinimaxCodeAccount, MinimaxCodeQuota, MinimaxCodeRegion } from '../../shared/minimax-code-contracts.ts';
|
|
22
|
+
/**
|
|
23
|
+
* Headers for one Messages request.
|
|
24
|
+
*
|
|
25
|
+
* `authorization: Bearer` is REQUIRED and is the only credential field sent —
|
|
26
|
+
* see this file's header comment for the measured reason an `x-api-key` variant
|
|
27
|
+
* must not exist.
|
|
28
|
+
*
|
|
29
|
+
* The token itself never appears in a log line or an error: callers that need to
|
|
30
|
+
* name a credential do so through `redactToken`.
|
|
31
|
+
*
|
|
32
|
+
* @param context the session identity the managed agent expects on a request
|
|
33
|
+
* that belongs to a session: the session id, the agent id inside it, and the
|
|
34
|
+
* caller's timezone offset. They are sent only when there IS a session — a
|
|
35
|
+
* request without one carries none of them.
|
|
36
|
+
*/
|
|
37
|
+
export declare function modelRequestHeaders(accessToken: string, context?: {
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
agentId?: string;
|
|
40
|
+
timezoneOffsetSec?: number;
|
|
41
|
+
}): Record<string, string>;
|
|
42
|
+
/** Headers for a non-streaming call (the probe). */
|
|
43
|
+
export declare function probeRequestHeaders(accessToken: string): Record<string, string>;
|
|
44
|
+
/** One parsed Anthropic `usage` object. */
|
|
45
|
+
export interface MinimaxUsage {
|
|
46
|
+
inputTokens: number;
|
|
47
|
+
outputTokens: number;
|
|
48
|
+
cacheReadTokens: number;
|
|
49
|
+
cacheWriteTokens: number;
|
|
50
|
+
}
|
|
51
|
+
/** Read the four token counters the Messages response reports. */
|
|
52
|
+
export declare function parseAnthropicUsage(payload: unknown): MinimaxUsage | null;
|
|
53
|
+
/** Short, single-line excerpt of one error body, safe to show a user. */
|
|
54
|
+
export declare function summarizeFailureBody(raw: string): string;
|
|
55
|
+
export interface MinimaxProbeResult {
|
|
56
|
+
ok: boolean;
|
|
57
|
+
/** Model the probe used, when it reached the service. */
|
|
58
|
+
model?: string;
|
|
59
|
+
/** Failure sentence, already safe to render. */
|
|
60
|
+
error?: string;
|
|
61
|
+
latencyMs: number;
|
|
62
|
+
account?: MinimaxCodeAccount | null;
|
|
63
|
+
usage?: MinimaxUsage;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Model the connection probe uses.
|
|
67
|
+
*
|
|
68
|
+
* M3 is the model the measured request used, so a probe against it exercises the
|
|
69
|
+
* exact shape the reconnaissance attested rather than a preview id that may not be
|
|
70
|
+
* entitled on every account.
|
|
71
|
+
*/
|
|
72
|
+
export declare const PROBE_MODEL = "MiniMax-M3";
|
|
73
|
+
/**
|
|
74
|
+
* Prove the stored credential still authenticates.
|
|
75
|
+
*
|
|
76
|
+
* The probe is the real Messages endpoint, because that is the only surface the
|
|
77
|
+
* subscription exposes to a third-party client: there is no account-profile route
|
|
78
|
+
* and `/v1/models` is unavailable, so a 200 from `/messages` is what "signed in"
|
|
79
|
+
* means here. The request is deliberately tiny — one word, 16 output tokens — so a
|
|
80
|
+
* probe the user triggered by pressing a button costs almost nothing.
|
|
81
|
+
*/
|
|
82
|
+
export declare function testConnection(store: MinimaxCodeCredentialStore, options?: {
|
|
83
|
+
fetchFn?: typeof fetch;
|
|
84
|
+
signal?: AbortSignal;
|
|
85
|
+
}): Promise<MinimaxProbeResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Non-streaming Messages call, used by callers that want the body rather than a stream.
|
|
88
|
+
*
|
|
89
|
+
* It exists so the streaming path is not the only implementation of the request
|
|
90
|
+
* shape: the probe and any future test use the same headers and URL builder, which
|
|
91
|
+
* is what keeps the Bearer rule from drifting in a second place.
|
|
92
|
+
*/
|
|
93
|
+
export declare function createMessage(store: MinimaxCodeCredentialStore, request: {
|
|
94
|
+
model: string;
|
|
95
|
+
maxTokens: number;
|
|
96
|
+
prompt: string;
|
|
97
|
+
}, options?: {
|
|
98
|
+
fetchFn?: typeof fetch;
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
ok: boolean;
|
|
102
|
+
status: number;
|
|
103
|
+
payload?: unknown;
|
|
104
|
+
error?: string;
|
|
105
|
+
latencyMs: number;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Headers for the Token Plan usage read.
|
|
109
|
+
*
|
|
110
|
+
* NOT {@link modelRequestHeaders}: that set asks for `text/event-stream` because
|
|
111
|
+
* the Messages route streams, and this route answers one JSON document. The
|
|
112
|
+
* credential is still the same bearer token.
|
|
113
|
+
*/
|
|
114
|
+
export declare function quotaRequestHeaders(accessToken: string, pathWithSearch: string, requestTime?: number): Record<string, string>;
|
|
115
|
+
/**
|
|
116
|
+
* The host that last answered.
|
|
117
|
+
*
|
|
118
|
+
* Only a live call can settle which candidate serves this subscription, so the
|
|
119
|
+
* winner is remembered and probed first from then on.
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Why a usage snapshot is absent, when the reason is worth stating on the card.
|
|
123
|
+
*
|
|
124
|
+
* - `credential-not-accepted` — the endpoint answered, and refused THIS line's
|
|
125
|
+
* credential because it needs a platform API key. Measured: every candidate
|
|
126
|
+
* host answers HTTP 200 with `base_resp.status_code: 1004` for an
|
|
127
|
+
* `mcode-public` (MiniMax Code) token, under every auth shape tried.
|
|
128
|
+
* - `unreachable` — no candidate host produced a usable answer at all.
|
|
129
|
+
* - `token-expired` — every candidate refused the bearer with 401/403, and the
|
|
130
|
+
* one refresh that follows also failed.
|
|
131
|
+
*
|
|
132
|
+
* `token-expired` exists because a refusal and an outage are different facts for
|
|
133
|
+
* the person looking at the card: an outage means "try again in a minute", while a
|
|
134
|
+
* refused bearer means the access token aged out. Collapsing the two into
|
|
135
|
+
* `unreachable` is what made a perfectly healthy account read as signed-out.
|
|
136
|
+
* - `stale` - the newest read failed, but the card is still being served the last
|
|
137
|
+
* numbers that parsed. The value is real; only its age is not.
|
|
138
|
+
*/
|
|
139
|
+
export type MinimaxCodeQuotaUnavailable = 'credential-not-accepted' | 'unreachable' | 'token-expired' | 'stale';
|
|
140
|
+
/** Forget the cached usage snapshot (a sign-out, a sign-in, a test). */
|
|
141
|
+
export declare function clearCachedQuota(): void;
|
|
142
|
+
/** The last usage snapshot without touching the network. */
|
|
143
|
+
export declare function getCachedQuota(): MinimaxCodeQuota | null;
|
|
144
|
+
/**
|
|
145
|
+
* The cached snapshot only when it belongs to this account, without touching the
|
|
146
|
+
* network.
|
|
147
|
+
*
|
|
148
|
+
* Quota follows the account: a rotation decides whose credential is spent next,
|
|
149
|
+
* so the snapshot a read produced describes the row it was made for. The pool
|
|
150
|
+
* asks here while it builds the settings card's account list, which must never
|
|
151
|
+
* wait on — or trigger — an upstream read.
|
|
152
|
+
*
|
|
153
|
+
* An absent, empty or null id keeps the pre-pool behaviour and answers with the
|
|
154
|
+
* newest read, which is what the page-level block wants.
|
|
155
|
+
*/
|
|
156
|
+
export declare function getCachedQuotaFor(accountId?: string | null): MinimaxCodeQuota | null;
|
|
157
|
+
/** Why the last read produced no snapshot, or null when it produced one. */
|
|
158
|
+
export declare function getQuotaUnavailable(): MinimaxCodeQuotaUnavailable | null;
|
|
159
|
+
/**
|
|
160
|
+
* Resolve the ambiguous `*_usage_count` fields.
|
|
161
|
+
*
|
|
162
|
+
* TRANSCRIBED from the official CLI (`src/utils/quota.ts`), because the ambiguity
|
|
163
|
+
* is real and reading the field naively inverts the bar: older responses report
|
|
164
|
+
* it as a REMAINING count while newer ones report it as a CONSUMED count. When the
|
|
165
|
+
* server also returns an explicit remaining percentage, that percentage selects
|
|
166
|
+
* whichever reading agrees with it; when the counts agree with neither, this
|
|
167
|
+
* returns undefined and the window falls back to the percentage alone rather than
|
|
168
|
+
* inventing a number.
|
|
169
|
+
*/
|
|
170
|
+
export declare function resolveQuotaCounts(reportedCount: number, total: number, remainingPercent: number | undefined): {
|
|
171
|
+
used: number;
|
|
172
|
+
remaining: number;
|
|
173
|
+
total: number;
|
|
174
|
+
} | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Map one `/v1/token_plan/remains` document onto the card's quota shape.
|
|
177
|
+
*
|
|
178
|
+
* Returns null when nothing usable is present, which the contract defines as the
|
|
179
|
+
* card's graceful degradation.
|
|
180
|
+
*/
|
|
181
|
+
export declare function parseTokenPlanQuota(payload: unknown, now?: number): MinimaxCodeQuota | null;
|
|
182
|
+
/**
|
|
183
|
+
* Read the Token Plan usage snapshot.
|
|
184
|
+
*
|
|
185
|
+
* The endpoint is undocumented (it was found in the official CLI, not in MiniMax's
|
|
186
|
+
* API docs), and which host serves THIS subscription has never been measured, so
|
|
187
|
+
* the candidates are tried in order and the winner is remembered. Any failure
|
|
188
|
+
* yields null: the contract makes `quota` optional precisely so a usage read can
|
|
189
|
+
* never break the connection half of the card.
|
|
190
|
+
*/
|
|
191
|
+
export declare function fetchTokenPlanQuota(credentials: MinimaxCodeCredentials, options?: {
|
|
192
|
+
fetchFn?: typeof fetch;
|
|
193
|
+
signal?: AbortSignal;
|
|
194
|
+
force?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* The pooled account this read is made for.
|
|
197
|
+
*
|
|
198
|
+
* The credential cannot identify the account: both tokens rotate, and two
|
|
199
|
+
* rows may share a region. The caller names none of that itself — it asks the
|
|
200
|
+
* pool for the account that would serve the next request, so the row it
|
|
201
|
+
* asked for is the row these numbers describe, and the snapshot is
|
|
202
|
+
* remembered against that id rather than against the line.
|
|
203
|
+
*/
|
|
204
|
+
accountId?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Renew the credential and hand back the pair to retry with.
|
|
207
|
+
*
|
|
208
|
+
* Injected by the route, which owns the store: this module reads credentials,
|
|
209
|
+
* it does not write them. Returns null when the credential cannot be renewed,
|
|
210
|
+
* and callers treat that as "still expired" rather than "signed out".
|
|
211
|
+
*/
|
|
212
|
+
renewCredential?: () => Promise<MinimaxCodeCredentials | null>;
|
|
213
|
+
/**
|
|
214
|
+
* Whether the credential this read presented has already been replaced.
|
|
215
|
+
*
|
|
216
|
+
* Set by the caller, which can see the credential in force. A 401 that arrives
|
|
217
|
+
* for a token that is no longer current is not a verdict on the account, and
|
|
218
|
+
* reporting it as `token-expired` would put "sign in again" on a card whose
|
|
219
|
+
* sign-in is in perfect health.
|
|
220
|
+
*/
|
|
221
|
+
isCredentialStale?: () => Promise<boolean>;
|
|
222
|
+
}): Promise<MinimaxCodeQuota | null>;
|
|
223
|
+
/**
|
|
224
|
+
* Every model id the hardcoded directory offers.
|
|
225
|
+
*
|
|
226
|
+
* Exposed as a function rather than re-exported directly so the status route
|
|
227
|
+
* cannot accidentally treat the catalog as live data: it is shipped, not fetched.
|
|
228
|
+
*/
|
|
229
|
+
export declare function listModelIds(): string[];
|
|
230
|
+
/** The catalog entry count, for a status line that reports what is shipped. */
|
|
231
|
+
export declare function catalogSize(): number;
|
|
232
|
+
/**
|
|
233
|
+
* Whether a credential is worth reporting as signed in.
|
|
234
|
+
*
|
|
235
|
+
* A stored-but-expired credential still counts: the card's job is to show who is
|
|
236
|
+
* signed in and let the refresh path repair the token, not to hide an account whose
|
|
237
|
+
* access token happens to have aged out between two calls.
|
|
238
|
+
*/
|
|
239
|
+
export declare function describeCredentials(credentials: MinimaxCodeCredentials | null): MinimaxCodeAccount | null;
|
|
240
|
+
export { MinimaxCodeUnauthorizedError, agentBaseUrl, MESSAGES_PATH, DEFAULT_DEVICE_INTERVAL_SECONDS, MINIMAX_CODE_BUILD_ENV, redactToken };
|
|
241
|
+
export type { MinimaxCodeRegion };
|
|
242
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/host/minimax-code/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAGL,+BAA+B,EAC/B,aAAa,EACb,YAAY,EAMZ,sBAAsB,EAGtB,WAAW,EACZ,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,0BAA0B,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAA6C,4BAA4B,EAAE,MAAM,YAAY,CAAA;AAEpG,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,wCAAwC,CAAA;AAU/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAyBxB;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE/E;AAED,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAYD,kEAAkE;AAClE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CASzE;AAED,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0BxD;AAED,MAAM,WAAW,kB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