@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,242 @@
|
|
|
1
|
+
import type { DeviceLoginStartDto, LoginEventDto, LoginStartDto, OAuthStatusDto, PublicErrorDto } from '../shared/contracts.ts';
|
|
2
|
+
import type { CodexAccountPool } from './codex-account-pool.ts';
|
|
3
|
+
import type { StoredOAuthCredentials, TokenStore } from './token-store.ts';
|
|
4
|
+
type FetchLike = typeof fetch;
|
|
5
|
+
type LoginListener = (event: LoginEventDto) => void;
|
|
6
|
+
export declare class OAuthServiceError extends Error {
|
|
7
|
+
readonly code: PublicErrorDto['code'];
|
|
8
|
+
/** Token-endpoint status when the failure came from a response. */
|
|
9
|
+
readonly status?: number | undefined;
|
|
10
|
+
constructor(code: PublicErrorDto['code'], message: string,
|
|
11
|
+
/** Token-endpoint status when the failure came from a response. */
|
|
12
|
+
status?: number | undefined);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* How the credential will be used, which decides who may serve it.
|
|
16
|
+
*
|
|
17
|
+
* `'request'` (default) is a metered model request: rotation, cooldowns and the
|
|
18
|
+
* pool's cached-quota verdict all apply.
|
|
19
|
+
*
|
|
20
|
+
* `'tool'` is a ChatGPT call that is *not* metered against the Codex
|
|
21
|
+
* rate-limit window — web search, web fetch, image generation. It reads the
|
|
22
|
+
* account already serving the conversation and ignores cooldowns, because a
|
|
23
|
+
* spent Codex window must not take those tools offline; they keep working with
|
|
24
|
+
* the very same access token.
|
|
25
|
+
*/
|
|
26
|
+
export type CredentialPurpose = 'request' | 'tool';
|
|
27
|
+
export interface CredentialAccess {
|
|
28
|
+
/** Defaults to `'request'`. */
|
|
29
|
+
purpose?: CredentialPurpose;
|
|
30
|
+
}
|
|
31
|
+
export interface OAuthServiceOptions {
|
|
32
|
+
fetchFn?: FetchLike;
|
|
33
|
+
now?: () => number;
|
|
34
|
+
random?: (size: number) => Buffer;
|
|
35
|
+
logger?: Pick<Console, 'info' | 'warn'>;
|
|
36
|
+
/** Test seam; production always uses the five-minute compatibility default. */
|
|
37
|
+
loginTimeoutMs?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Account pool this service drives.
|
|
40
|
+
*
|
|
41
|
+
* With a pool the service signs accounts in and refreshes them per account
|
|
42
|
+
* while the pool decides which one serves a request; without one it keeps
|
|
43
|
+
* serving the single stored credential exactly as before.
|
|
44
|
+
*/
|
|
45
|
+
pool?: CodexAccountPool;
|
|
46
|
+
}
|
|
47
|
+
export declare class OAuthService {
|
|
48
|
+
private readonly store;
|
|
49
|
+
private readonly fetchFn;
|
|
50
|
+
private readonly now;
|
|
51
|
+
private readonly random;
|
|
52
|
+
private readonly logger;
|
|
53
|
+
private readonly loginTimeoutMs;
|
|
54
|
+
private readonly loginEvents;
|
|
55
|
+
private readonly listeners;
|
|
56
|
+
private activeLogin;
|
|
57
|
+
/**
|
|
58
|
+
* True between taking the login slot and having something to put in
|
|
59
|
+
* {@link activeLogin}.
|
|
60
|
+
*
|
|
61
|
+
* Both starts have work to do before the login exists (a storage read, the
|
|
62
|
+
* device grant), and that work is awaited. A check made before the first
|
|
63
|
+
* `await` and an assignment made after it do not exclude each other: two
|
|
64
|
+
* overlapping calls both pass the check, the second overwrites the first, and
|
|
65
|
+
* the first flow's `AbortController` becomes unreachable — Cancel stops the
|
|
66
|
+
* wrong flow and the abandoned one keeps polling until its grant expires.
|
|
67
|
+
*/
|
|
68
|
+
private startPending;
|
|
69
|
+
private refreshPromise;
|
|
70
|
+
private lastLoginError;
|
|
71
|
+
private disposed;
|
|
72
|
+
private readonly pool;
|
|
73
|
+
/**
|
|
74
|
+
* Bumped whenever this process writes credentials.
|
|
75
|
+
*
|
|
76
|
+
* Combined with the pool's own revision by {@link currentIdentityRevision} so
|
|
77
|
+
* a caller can tell whether the account behind the credentials may have moved
|
|
78
|
+
* without paying for a credential read to find out.
|
|
79
|
+
*/
|
|
80
|
+
private credentialRevision;
|
|
81
|
+
private readonly refreshInFlight;
|
|
82
|
+
constructor(store: TokenStore, options?: OAuthServiceOptions);
|
|
83
|
+
status(): Promise<OAuthStatusDto>;
|
|
84
|
+
/**
|
|
85
|
+
* The pool slice of the status DTO.
|
|
86
|
+
*
|
|
87
|
+
* A pool that cannot be read is reported as empty rather than failing the
|
|
88
|
+
* whole status call: the card must still render the connection section.
|
|
89
|
+
*/
|
|
90
|
+
private readPoolStatus;
|
|
91
|
+
/**
|
|
92
|
+
* Take the one login slot, or say that it is taken.
|
|
93
|
+
*
|
|
94
|
+
* Called synchronously, before the first `await` of the start it belongs to:
|
|
95
|
+
* nothing can suspend between the check and the flag, so two overlapping
|
|
96
|
+
* starts cannot both get through. The caller's `finally` releases the flag once
|
|
97
|
+
* the login itself is in {@link activeLogin} (or the start has failed).
|
|
98
|
+
*/
|
|
99
|
+
private beginStart;
|
|
100
|
+
startLogin(): Promise<LoginStartDto>;
|
|
101
|
+
/** The body of {@link startLogin}, with the slot already taken. */
|
|
102
|
+
private startBrowserLogin;
|
|
103
|
+
cancelLogin(loginId: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Start a device-code sign-in, the path a headless host can finish.
|
|
106
|
+
*
|
|
107
|
+
* Answers as soon as the grant exists, with the code the user has to type and
|
|
108
|
+
* the page to type it on; the wait for confirmation runs in the background and
|
|
109
|
+
* reports through the same event stream the browser flow uses, so the card
|
|
110
|
+
* needs no second mechanism and cancellation is the same call.
|
|
111
|
+
*/
|
|
112
|
+
startDeviceLogin(): Promise<DeviceLoginStartDto>;
|
|
113
|
+
/** The body of {@link startDeviceLogin}, with the slot already taken. */
|
|
114
|
+
private startDeviceLoginInner;
|
|
115
|
+
subscribe(loginId: string, listener: LoginListener): (() => void) | null;
|
|
116
|
+
refresh(): Promise<OAuthStatusDto>;
|
|
117
|
+
/**
|
|
118
|
+
* Sign out.
|
|
119
|
+
*
|
|
120
|
+
* @param accountId - pooled account to remove; omit to remove the account
|
|
121
|
+
* that would serve the next request (the pool promotes another one), which
|
|
122
|
+
* is what a single "sign out" button means to a pool user.
|
|
123
|
+
*/
|
|
124
|
+
logout(accountId?: string): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* A cheap, in-memory verdict on whether the serving account may have changed.
|
|
127
|
+
*
|
|
128
|
+
* Reading a credential is expensive — on Windows it is a DPAPI unprotect
|
|
129
|
+
* through a spawned `powershell.exe` (~200 ms) — so a per-account cache must
|
|
130
|
+
* not have to read one just to learn that it is still the same account.
|
|
131
|
+
* Comparing this value against a previously observed one costs nothing, and
|
|
132
|
+
* any path that can move which account serves a request bumps it: a pool
|
|
133
|
+
* write (sign-in, delete, pin, rotation) or a credential write in this
|
|
134
|
+
* process (sign-in, logout, token refresh).
|
|
135
|
+
*
|
|
136
|
+
* It is deliberately conservative: a spurious change costs one credential
|
|
137
|
+
* read, while a missed change would report one account's data under another
|
|
138
|
+
* account's name.
|
|
139
|
+
*/
|
|
140
|
+
currentIdentityRevision(): number;
|
|
141
|
+
/**
|
|
142
|
+
* The credential to use next.
|
|
143
|
+
*
|
|
144
|
+
* @param forceRefresh - refresh even a token that is not close to expiry,
|
|
145
|
+
* which is how a 401 discovered mid-request recovers.
|
|
146
|
+
* @param access - who is asking. A `'tool'` caller (web search, fetch, image
|
|
147
|
+
* generation) bypasses the pool's rotation state: an account cooling down
|
|
148
|
+
* after a Codex 429 still holds a working token for those endpoints, and
|
|
149
|
+
* refusing it there turned "your Codex window is spent" into a bogus
|
|
150
|
+
* "credentials are required" on every web search.
|
|
151
|
+
*/
|
|
152
|
+
credentials(forceRefresh?: boolean, access?: CredentialAccess): Promise<StoredOAuthCredentials>;
|
|
153
|
+
/**
|
|
154
|
+
* The credential to use next, together with the pool row that owns it.
|
|
155
|
+
*
|
|
156
|
+
* The settings card keys each account's quota snapshot by the row the reading
|
|
157
|
+
* was made for, and the credential cannot do that job: a refresh rotates its
|
|
158
|
+
* tokens, and an account may state no id of its own. Callers that care about
|
|
159
|
+
* identity ask here; every other caller keeps using {@link credentials} and
|
|
160
|
+
* sees no difference.
|
|
161
|
+
*
|
|
162
|
+
* @param forceRefresh - refresh even a token that is not close to expiry.
|
|
163
|
+
* @param access - who is asking; see {@link credentials}.
|
|
164
|
+
*/
|
|
165
|
+
credentialSelection(forceRefresh?: boolean, access?: CredentialAccess): Promise<{
|
|
166
|
+
accountId?: string;
|
|
167
|
+
credentials: StoredOAuthCredentials;
|
|
168
|
+
}>;
|
|
169
|
+
dispose(): void;
|
|
170
|
+
private exchangeCode;
|
|
171
|
+
/**
|
|
172
|
+
* Write freshly redeemed credentials into the pool, unless the sign-in was
|
|
173
|
+
* cancelled while the token answer was on its way.
|
|
174
|
+
*
|
|
175
|
+
* The abort check used to live only in the poll loop, *after* the exchange, so
|
|
176
|
+
* a Cancel landing between the token `200` and the write left the host having
|
|
177
|
+
* answered `{cancelled:true}` and published `cancelled` while the pool quietly
|
|
178
|
+
* gained an account. The check belongs at the last moment before the write —
|
|
179
|
+
* the narrower the window, the fewer writes it misses.
|
|
180
|
+
*/
|
|
181
|
+
private persistCredentials;
|
|
182
|
+
/**
|
|
183
|
+
* Ask for a device code, and normalise what the grant says about itself.
|
|
184
|
+
*
|
|
185
|
+
* `interval` arrives as a *string* (`"5"`) on the live service and
|
|
186
|
+
* `expires_at` as an ISO timestamp, so both are parsed rather than trusted to
|
|
187
|
+
* be the type they should be. A grant that states neither still works: the
|
|
188
|
+
* defaults are the values the service actually uses.
|
|
189
|
+
*/
|
|
190
|
+
private requestDeviceGrant;
|
|
191
|
+
/**
|
|
192
|
+
* Wait for the user to confirm the code, then redeem the grant.
|
|
193
|
+
*
|
|
194
|
+
* Three rules, and each one is a way this loop goes wrong if it is dropped:
|
|
195
|
+
* the wait between polls is the grant's own `interval` (clamped, see
|
|
196
|
+
* {@link pollDelayMs}); no single wait runs past the deadline; and nothing is
|
|
197
|
+
* accepted at or after the deadline, because a grant that expired upstream is
|
|
198
|
+
* not a sign-in — redeeming it would surface the server's error as if the
|
|
199
|
+
* user's code had failed.
|
|
200
|
+
*/
|
|
201
|
+
private pollDeviceGrant;
|
|
202
|
+
/**
|
|
203
|
+
* One confirmation check.
|
|
204
|
+
*
|
|
205
|
+
* `403`/`404` (and any payload whose status says pending) mean "not yet" — the
|
|
206
|
+
* user has not typed the code or has not confirmed it. Everything else is
|
|
207
|
+
* terminal and carries the status with any error code the service named, so
|
|
208
|
+
* the card can say what happened instead of polling until the deadline.
|
|
209
|
+
*/
|
|
210
|
+
private pollDeviceToken;
|
|
211
|
+
private refreshCredentials;
|
|
212
|
+
/**
|
|
213
|
+
* Refresh one account's tokens on behalf of the pool.
|
|
214
|
+
*
|
|
215
|
+
* Deliberately different from the single-credential path: a rejected refresh
|
|
216
|
+
* token must NOT wipe the whole credential store (other pooled accounts are
|
|
217
|
+
* unaffected), and the write-back belongs to the pool, which owns the account
|
|
218
|
+
* record. Concurrent calls for one identity share a single redemption, since
|
|
219
|
+
* the refresh token rotates.
|
|
220
|
+
*/
|
|
221
|
+
refreshAccount(credentials: StoredOAuthCredentials, fetchFn?: FetchLike): Promise<StoredOAuthCredentials>;
|
|
222
|
+
private performRefresh;
|
|
223
|
+
private loadAuthenticated;
|
|
224
|
+
private statusFromCredentials;
|
|
225
|
+
/**
|
|
226
|
+
* The `login` slice of the status, shared by both branches above.
|
|
227
|
+
*
|
|
228
|
+
* A device flow also carries its code: the card is the only place the user can
|
|
229
|
+
* read it, and a settings page opened a second time (or reloaded) would
|
|
230
|
+
* otherwise show "waiting" with nothing to type anywhere on it.
|
|
231
|
+
*/
|
|
232
|
+
private loginStatus;
|
|
233
|
+
private completeLogin;
|
|
234
|
+
private failLogin;
|
|
235
|
+
private cancelActive;
|
|
236
|
+
private publish;
|
|
237
|
+
private assertAvailable;
|
|
238
|
+
}
|
|
239
|
+
export declare function buildAuthorizationUrl(verifier: string, state: string): string;
|
|
240
|
+
export declare function publicError(error: unknown, fallback?: PublicErrorDto['code']): PublicErrorDto;
|
|
241
|
+
export {};
|
|
242
|
+
//# sourceMappingURL=oauth-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-service.d.ts","sourceRoot":"","sources":["../../../src/host/oauth-service.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACf,MAAM,wBAAwB,CAAA;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE1E,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAC7B,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK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AsB,CAAA;KAAE,CAAC;IAkBvE,OAAO,IAAI,IAAI;YAUD,YAAY;IA6B1B;;;;;;;;;OASG;YACW,kBAAkB;IAmBhC;;;;;;;OAOG;YACW,kBAAkB;IAkChC;;;;;;;;;OASG;YACW,eAAe;IAkC7B;;;;;;;OAOG;YACW,eAAe;IA6B7B,OAAO,CAAC,kBAAkB;IAQ1B;;;;;;;;OAQG;IACG,cAAc,CAClB,WAAW,EAAE,sBAAsB,EACnC,OAAO,GAAE,SAAwB,GAChC,OAAO,CAAC,sBAAsB,CAAC;YAYpB,cAAc;YA4Cd,iBAAiB;IAQ/B,OAAO,CAAC,qBAAqB;IAwC7B;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,eAAe;CAGxB;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAe7E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,cAAc,CAAC,MAAM,CAAc,GAAG,cAAc,CAGzG"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AccountPoolCore, type PoolAccountShape, type PoolData } from '../common/account-pool.ts';
|
|
2
|
+
import type { CredentialStore } from '../token-store.ts';
|
|
3
|
+
import { FileCredentialStore, type OllamaCredentials } from './token-store.ts';
|
|
4
|
+
import type { AccountPoolStatusDto } from '../../shared/account-pool-contracts.ts';
|
|
5
|
+
import type { OllamaAccountSummaryDto } from '../../shared/ollama-contracts.ts';
|
|
6
|
+
/** One pooled Ollama key: the bearer key plus the display facts the card renders. */
|
|
7
|
+
export interface OllamaPoolAccount extends PoolAccountShape<OllamaCredentials> {
|
|
8
|
+
/** Model id this account last served, for the card's detail line. */
|
|
9
|
+
lastModelId?: string;
|
|
10
|
+
usage?: {
|
|
11
|
+
inputTokens: number;
|
|
12
|
+
outputTokens: number;
|
|
13
|
+
requestCount: number;
|
|
14
|
+
/** Unix milliseconds the last completed turn was counted. */
|
|
15
|
+
lastCountedAt?: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export type { OllamaAccountSummaryDto };
|
|
19
|
+
export type OllamaPoolStatusDto = AccountPoolStatusDto;
|
|
20
|
+
/** Encrypted pool file this line owns. */
|
|
21
|
+
export declare function ollamaPoolPath(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Stable identity of one key.
|
|
24
|
+
*
|
|
25
|
+
* Ollama hands the user a bare key and nothing else — no account id, no email —
|
|
26
|
+
* so the key's own digest is the only identity available. It is never written
|
|
27
|
+
* anywhere: it exists to tell two pasted keys apart inside the pool document,
|
|
28
|
+
* and it is not a credential and cannot be used as one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ollamaAccountKey(credentials: OllamaCredentials): string;
|
|
31
|
+
/** Validate and normalize one whole pool document. */
|
|
32
|
+
export declare function parseOllamaPoolData(value: unknown): PoolData<OllamaPoolAccount>;
|
|
33
|
+
export interface OllamaAccountPoolOptions {
|
|
34
|
+
/** Pre-pool credential file the pool mirrors its primary account into. */
|
|
35
|
+
store?: FileCredentialStore;
|
|
36
|
+
/** Test seam; production builds the platform backend from the pool path. */
|
|
37
|
+
backend?: CredentialStore<PoolData<OllamaPoolAccount>>;
|
|
38
|
+
maxAccounts?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Ollama's account pool.
|
|
42
|
+
*
|
|
43
|
+
* An Ollama credential is a static key that never expires, so this wrapper
|
|
44
|
+
* supplies identity, the display alias a user chose, and the mirror of the
|
|
45
|
+
* single-credential file — no refresh logic is needed anywhere.
|
|
46
|
+
*/
|
|
47
|
+
export declare class OllamaAccountPool extends AccountPoolCore<OllamaCredentials, OllamaPoolAccount, OllamaAccountSummaryDto> {
|
|
48
|
+
private readonly store;
|
|
49
|
+
constructor(options?: OllamaAccountPoolOptions);
|
|
50
|
+
/**
|
|
51
|
+
* Pick the key for the next request, skipping accounts already tried.
|
|
52
|
+
*
|
|
53
|
+
* Ollama's credential carries no deployment dimension - there is one cloud
|
|
54
|
+
* endpoint and every key is valid for it - so the account and its key are
|
|
55
|
+
* returned together and nothing has to be attached to the credential.
|
|
56
|
+
*/
|
|
57
|
+
getEffectiveCredential(excludeIds?: ReadonlySet<string>, fetchFn?: typeof fetch): Promise<{
|
|
58
|
+
account: OllamaPoolAccount;
|
|
59
|
+
credentials: OllamaCredentials;
|
|
60
|
+
}>;
|
|
61
|
+
/** The pre-pool credential file this pool mirrors its primary account into. */
|
|
62
|
+
mirrorStore(): FileCredentialStore;
|
|
63
|
+
recordUsage(accountId: string, inputTokens: number, outputTokens: number): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=account-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-pool.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/account-pool.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAGf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,mBAAmB,EAEnB,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAE/E,qFAAqF;AACrF,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB,CAAC,iBAAiB,CAAC;IAC5E,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;IAOpB,KAAK,CAAC,EAAE;QACN,WAAW,EAAE,MAAM,CAAA;QACnB,YAAY,EAAE,MAAM,CAAA;QACpB,YAAY,EA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GenerateOptions as HarnessGenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
import { type GenerateOptions } from '../common/llm-compat.ts';
|
|
4
|
+
import { type OllamaCatalogModel, type OllamaThinkingCapability } from './types.ts';
|
|
5
|
+
import { FileCredentialStore, FileModelSettingsStore, type OllamaCredentials } from './token-store.ts';
|
|
6
|
+
import { OllamaAccountPool } from './account-pool.ts';
|
|
7
|
+
import { type OllamaRequest } from './client.ts';
|
|
8
|
+
export interface OllamaAdapterOptions {
|
|
9
|
+
fetchFn?: typeof fetch;
|
|
10
|
+
/** Test seam; production reads `/api/tags` with the active account's key. */
|
|
11
|
+
loadCatalog?: (fetchFn: typeof fetch, credentials: OllamaCredentials) => Promise<OllamaCatalogModel[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Attachment store used to read image bytes for the request.
|
|
14
|
+
*
|
|
15
|
+
* DSH delivers an image as a durable reference, not as bytes, so a route that
|
|
16
|
+
* declares image input has to resolve those references before building the
|
|
17
|
+
* body. Without it the image is dropped and the turn silently becomes
|
|
18
|
+
* text-only while the model picker still advertises image support.
|
|
19
|
+
*/
|
|
20
|
+
attachments?: Pick<AttachmentStore, 'readImage'>;
|
|
21
|
+
}
|
|
22
|
+
export declare class OllamaAdapter extends LlmAdapter {
|
|
23
|
+
private readonly store;
|
|
24
|
+
private readonly modelSettings;
|
|
25
|
+
private readonly options;
|
|
26
|
+
/**
|
|
27
|
+
* Rotation pool, or null for the single stored key.
|
|
28
|
+
*
|
|
29
|
+
* Only the plugin entry installs it, because the entry owns the storage; an
|
|
30
|
+
* adapter built without one must keep reading the one credential file rather
|
|
31
|
+
* than minting pool state that would outlive the process.
|
|
32
|
+
*/
|
|
33
|
+
private readonly accountPool;
|
|
34
|
+
/**
|
|
35
|
+
* What `/api/show` has already said, per model id.
|
|
36
|
+
*
|
|
37
|
+
* Only a successful read is remembered. A failed one is a transient condition
|
|
38
|
+
* (no key, a 500, a proxy), and caching it would pin every model to the
|
|
39
|
+
* fallback ladder for the life of the process - so it is asked again next time.
|
|
40
|
+
*/
|
|
41
|
+
private readonly thinkingCache;
|
|
42
|
+
/** Probes currently in flight, so one model asked twice at once is read once. */
|
|
43
|
+
private readonly thinkingProbes;
|
|
44
|
+
/**
|
|
45
|
+
* Remembers the last main turn's effort so an unnamed auxiliary request
|
|
46
|
+
* repeats it instead of the settings default, keeping it on the cached prefix.
|
|
47
|
+
*/
|
|
48
|
+
private readonly effortMemory;
|
|
49
|
+
constructor(store?: FileCredentialStore, modelSettings?: FileModelSettingsStore, options?: OllamaAdapterOptions, accountPool?: OllamaAccountPool);
|
|
50
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
51
|
+
providerRetryPolicy(): ResolvedRetryPolicy;
|
|
52
|
+
imageRequestPricing(): undefined;
|
|
53
|
+
private settings;
|
|
54
|
+
/**
|
|
55
|
+
* Catalog for the picker: the live `/api/tags` listing when a key can reach it,
|
|
56
|
+
* the shipped fallback otherwise, narrowed by the user's enabled selection.
|
|
57
|
+
*
|
|
58
|
+
* Ollama's model set moves quickly, so a stale local table would be the wrong
|
|
59
|
+
* default; the fallback exists only so the line is usable before the first
|
|
60
|
+
* successful sync.
|
|
61
|
+
*/
|
|
62
|
+
private catalog;
|
|
63
|
+
/** Any usable key, for the catalog call; the pool decides real routing later. */
|
|
64
|
+
private anyCredentials;
|
|
65
|
+
/**
|
|
66
|
+
* What this model says about its own thinking, read once and remembered.
|
|
67
|
+
*
|
|
68
|
+
* Never throws and never rejects: an adapter that cannot reach `/api/show`
|
|
69
|
+
* (no key stored yet, service down) is a line that still resolves models and
|
|
70
|
+
* still chats, one step behind on the ladder.
|
|
71
|
+
*/
|
|
72
|
+
private thinkingCapability;
|
|
73
|
+
listModels(provider?: string): Promise<readonly LlmModelInfo[]>;
|
|
74
|
+
resolveModel(provider: string, modelId: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
75
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
76
|
+
stream(options: HarnessGenerateOptions): AsyncIterable<StreamChunk>;
|
|
77
|
+
private requestStream;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Project DSH's request shape onto Ollama's, per surface.
|
|
81
|
+
* Consumes the canonical Message vocabulary produced by normalizeGenerateOptions.
|
|
82
|
+
*/
|
|
83
|
+
export declare function toOllamaRequest(options: GenerateOptions, attachments?: Pick<AttachmentStore, 'readImage'>, signal?: AbortSignal,
|
|
84
|
+
/**
|
|
85
|
+
* What the target model says about its own thinking, when it was read. Passed
|
|
86
|
+
* in rather than looked up here because this is a pure projection: it must not
|
|
87
|
+
* spend a network read to decide what one request may send.
|
|
88
|
+
*/
|
|
89
|
+
declared?: OllamaThinkingCapability): Promise<Omit<OllamaRequest, 'signal'>>;
|
|
90
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EAGV,KAAK,eAAe,IAAI,sBAAsB,EAC9C,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,6BAA6B,CAAA;AACtF,OAAO,EAIL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAcL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,KAAK,iBAAiB,EAA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AAE,CAAC;IAqB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgCpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa,CAAC,WAAW,CAAC;YAU3D,aAAa;CA0L7B;AAsND;;;GAGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,EAChD,MAAM,CAAC,EAAE,WAAW;AACpB;;;;GAIG;AACH,QAAQ,CAAC,EAAE,wBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAqGxC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { type OllamaCatalogModel, type OllamaThinkingCapability, type OllamaWire } from './types.ts';
|
|
2
|
+
import type { OllamaCredentials } from './token-store.ts';
|
|
3
|
+
import type { StreamActivity } from '../common/idle-watchdog.ts';
|
|
4
|
+
/** One message on the wire, in either surface's shape. */
|
|
5
|
+
export interface OllamaChatMessage {
|
|
6
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
7
|
+
content: string;
|
|
8
|
+
/** Image parts this turn carries; the OpenAI surface takes an array, the native one too. */
|
|
9
|
+
images?: string[];
|
|
10
|
+
/** Tool call id a `tool` result answers. */
|
|
11
|
+
toolCallId?: string;
|
|
12
|
+
/** Assistant tool calls that produced this turn. */
|
|
13
|
+
toolCalls?: OllamaToolCall[];
|
|
14
|
+
}
|
|
15
|
+
export interface OllamaToolCall {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
/** Raw JSON the model produced for the arguments. */
|
|
19
|
+
arguments: string;
|
|
20
|
+
}
|
|
21
|
+
export interface OllamaRequest {
|
|
22
|
+
model: string;
|
|
23
|
+
messages: OllamaChatMessage[];
|
|
24
|
+
tools?: {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
parameters: unknown;
|
|
28
|
+
}[];
|
|
29
|
+
maxOutputTokens?: number;
|
|
30
|
+
temperature?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Thinking control, in Ollama's own vocabulary: a boolean for on/off, or a
|
|
33
|
+
* model-defined level name taken from that model's metadata. It is never
|
|
34
|
+
* guessed here — the adapter only sends a value the model declares.
|
|
35
|
+
*/
|
|
36
|
+
think?: boolean | string;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Token accounting one completed turn reports.
|
|
41
|
+
*
|
|
42
|
+
* These are the counts Ollama's own OpenAPI documents on the chat response
|
|
43
|
+
* (`prompt_eval_count` and `eval_count`), so they measure what this key has
|
|
44
|
+
* actually spent rather than anything inferred from the text.
|
|
45
|
+
*
|
|
46
|
+
* They are NOT a quota. The service publishes no account limit, no remaining
|
|
47
|
+
* balance and no reset time anywhere in its API: upstream issues #15132 and
|
|
48
|
+
* #15663 asked for one and both were closed. So nothing here can say how much
|
|
49
|
+
* is left - only what has been consumed.
|
|
50
|
+
*/
|
|
51
|
+
export interface OllamaUsage {
|
|
52
|
+
inputTokens: number;
|
|
53
|
+
outputTokens: number;
|
|
54
|
+
}
|
|
55
|
+
export type OllamaStreamEvent = {
|
|
56
|
+
type: 'text';
|
|
57
|
+
text: string;
|
|
58
|
+
} | {
|
|
59
|
+
type: 'thinking';
|
|
60
|
+
text: string;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'tool_call';
|
|
63
|
+
call: OllamaToolCall;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'done';
|
|
66
|
+
finishReason?: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'usage';
|
|
69
|
+
usage: OllamaUsage;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'error';
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
export interface OllamaCallResult {
|
|
75
|
+
events: AsyncGenerator<OllamaStreamEvent>;
|
|
76
|
+
/** Resolves the HTTP status once the response headers arrive. */
|
|
77
|
+
status: Promise<number>;
|
|
78
|
+
}
|
|
79
|
+
/** Headers both surfaces require, per docs/api/authentication. */
|
|
80
|
+
export declare function headersFor(credentials: OllamaCredentials, accept: string): Record<string, string>;
|
|
81
|
+
/**
|
|
82
|
+
* Build the request body for one wire shape.
|
|
83
|
+
*
|
|
84
|
+
* The two surfaces are not translations of each other — the native API nests the
|
|
85
|
+
* assistant's tool calls under `message.tool_calls` and expects results under a
|
|
86
|
+
* `tool` role without ids, while the OpenAI surface uses `tool_calls` and
|
|
87
|
+
* `tool_call_id`. Mapping them through one shared builder would have to guess at
|
|
88
|
+
* the fields the other surface does not carry, so each is written out where its
|
|
89
|
+
* own rules stay visible.
|
|
90
|
+
*/
|
|
91
|
+
export declare function buildBody(wire: OllamaWire, request: OllamaRequest): unknown;
|
|
92
|
+
export declare function toBareBase64(image: string): string;
|
|
93
|
+
export declare function toDataUrl(image: string, defaultMediaType?: string): string;
|
|
94
|
+
export declare function parseArguments(raw: unknown): Record<string, unknown>;
|
|
95
|
+
/** The endpoint one request goes to. */
|
|
96
|
+
export declare function chatUrl(wire: OllamaWire): string;
|
|
97
|
+
/**
|
|
98
|
+
* Start one streaming chat call.
|
|
99
|
+
*
|
|
100
|
+
* The HTTP status is surfaced through a promise rather than by handing back the
|
|
101
|
+
* Response, because the caller has to decide between retrying this account and
|
|
102
|
+
* failing the turn, and both need the status before any body is read.
|
|
103
|
+
*/
|
|
104
|
+
export declare function startChat(fetchFn: typeof fetch, credentials: OllamaCredentials, wire: OllamaWire, request: OllamaRequest,
|
|
105
|
+
/**
|
|
106
|
+
* Transport-level liveness reporter for a caller that wraps this stream in an
|
|
107
|
+
* idle watchdog. Optional: without it, heartbeats and status frames that
|
|
108
|
+
* produce no event stay invisible to the caller's timeout, exactly as before.
|
|
109
|
+
*/
|
|
110
|
+
activity?: StreamActivity): OllamaCallResult;
|
|
111
|
+
/**
|
|
112
|
+
* Why a catalog read came back without a list.
|
|
113
|
+
*
|
|
114
|
+
* These are the four things that can go wrong between the card asking for a sync
|
|
115
|
+
* and the service answering, and they are kept apart because each one has a
|
|
116
|
+
* different fix on the user's side: `auth` is a key Ollama refused, `upstream` is
|
|
117
|
+
* Ollama refusing for some other reason, `unreachable` is a network or proxy
|
|
118
|
+
* problem, and `malformed` is a reply that is not the documented `/api/tags`
|
|
119
|
+
* document at all. Collapsing them into one "could not read the model list"
|
|
120
|
+
* sentence leaves the user with nothing to act on, which is the complaint behind
|
|
121
|
+
* issue #36.
|
|
122
|
+
*/
|
|
123
|
+
export type OllamaCatalogFailure = 'auth' | 'upstream' | 'unreachable' | 'malformed';
|
|
124
|
+
/** One catalog read, with the reason it produced no list. */
|
|
125
|
+
export interface OllamaCatalogResult {
|
|
126
|
+
models: OllamaCatalogModel[];
|
|
127
|
+
/** Absent on success. An account entitled to nothing succeeds with an empty list. */
|
|
128
|
+
failure?: OllamaCatalogFailure;
|
|
129
|
+
/** The HTTP status behind an `auth` or `upstream` failure. */
|
|
130
|
+
status?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Read the model catalog.
|
|
134
|
+
*
|
|
135
|
+
* `/api/tags` is the native surface's own list and needs no translation; the
|
|
136
|
+
* OpenAI `/models` endpoint would be a subset of it. Returns an empty list rather
|
|
137
|
+
* than throwing, so a failed sync degrades to the cached selection instead of
|
|
138
|
+
* making the line unusable.
|
|
139
|
+
*/
|
|
140
|
+
export declare function loadCatalog(fetchFn: typeof fetch, credentials: OllamaCredentials): Promise<OllamaCatalogModel[]>;
|
|
141
|
+
/**
|
|
142
|
+
* The same read as {@link loadCatalog}, keeping the reason it failed.
|
|
143
|
+
*
|
|
144
|
+
* Never throws, for the reason its wrapper has always given. What it adds is that
|
|
145
|
+
* "failed" stops being one opaque state, so the settings card can name the
|
|
146
|
+
* cause instead of asking the user to guess.
|
|
147
|
+
*/
|
|
148
|
+
export declare function fetchCatalog(fetchFn: typeof fetch, credentials: OllamaCredentials): Promise<OllamaCatalogResult>;
|
|
149
|
+
/** The OpenAI-compatible model list, for callers that prefer that surface's view. */
|
|
150
|
+
export declare function loadOpenAIModels(fetchFn: typeof fetch, credentials: OllamaCredentials): Promise<string[]>;
|
|
151
|
+
/**
|
|
152
|
+
* Read what one model says about its own thinking.
|
|
153
|
+
*
|
|
154
|
+
* `POST /api/show` is the only place a model states the values `think` accepts,
|
|
155
|
+
* and the ladder this line offers has to be exactly those values: DSH rejects an
|
|
156
|
+
* effort that is not on the ladder before a request is built, and the service
|
|
157
|
+
* rejects a `think` it does not know. So the metadata, not a prefix list, is
|
|
158
|
+
* what the picker is built from.
|
|
159
|
+
*
|
|
160
|
+
* Returns undefined rather than throwing for every way this can fail - no key, a
|
|
161
|
+
* 401, a 500, a proxy's HTML where JSON was promised, a document that is not
|
|
162
|
+
* `/api/show`. The caller falls back to what it already knew about the model,
|
|
163
|
+
* and a failed probe must never be what breaks a turn.
|
|
164
|
+
*/
|
|
165
|
+
export declare function fetchModelThinking(fetchFn: typeof fetch, credentials: OllamaCredentials, modelId: string): Promise<OllamaThinkingCapability | undefined>;
|
|
166
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EAChB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,0DAA0D;AAC1D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AAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,qFAAqF;IACrF,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAE/B;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CA6C9B;AAED,qFAAqF;AACrF,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,KAAK,EACrB,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CA6C/C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { StreamChunk } from '../common/llm-compat.ts';
|
|
2
|
+
import type { OllamaStreamEvent, OllamaToolCall } from './client.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Translate Ollama's stream events into DSH's block protocol.
|
|
5
|
+
*
|
|
6
|
+
* DSH wants a block opened, filled with deltas, then closed with the assembled
|
|
7
|
+
* content. Ollama's surface streams text and tool calls as two interleaved
|
|
8
|
+
* kinds of delta with no block framing of its own, so this state machine owns
|
|
9
|
+
* the framing: one text block at a time, and one block per tool call that is
|
|
10
|
+
* closed only once its arguments are complete.
|
|
11
|
+
*
|
|
12
|
+
* Closing a tool call late is the point. An arguments string arrives in pieces,
|
|
13
|
+
* and a block closed on the first piece would hand the agent a truncated tool
|
|
14
|
+
* invocation - which fails as a JSON parse error inside the model loop rather
|
|
15
|
+
* than as anything that names the real cause.
|
|
16
|
+
*/
|
|
17
|
+
export interface OllamaStreamState {
|
|
18
|
+
/** Index the next opened block takes. */
|
|
19
|
+
nextBlockIndex: number;
|
|
20
|
+
/** The open text block, or null when the stream is on a tool call. */
|
|
21
|
+
textBlock: {
|
|
22
|
+
index: number;
|
|
23
|
+
text: string;
|
|
24
|
+
} | null;
|
|
25
|
+
/** The open reasoning block, closed when the answer starts or a tool is called. */
|
|
26
|
+
thinkingBlock: {
|
|
27
|
+
index: number;
|
|
28
|
+
text: string;
|
|
29
|
+
} | null;
|
|
30
|
+
/** Call id -> the call being accumulated, with the block it will close. */
|
|
31
|
+
toolCalls: Map<string, {
|
|
32
|
+
call: OllamaToolCall;
|
|
33
|
+
blockIndex: number;
|
|
34
|
+
}>;
|
|
35
|
+
/** True once any content has been produced. */
|
|
36
|
+
hasContent: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function createStreamState(): OllamaStreamState;
|
|
39
|
+
/** Fold one event into chunks, opening and closing blocks as the stream needs. */
|
|
40
|
+
export declare function applyEvent(state: OllamaStreamState, event: OllamaStreamEvent): StreamChunk[];
|
|
41
|
+
/**
|
|
42
|
+
* Close the turn.
|
|
43
|
+
*
|
|
44
|
+
* A stream that ends while a text block is still open is a real possibility - the
|
|
45
|
+
* model can be cut off mid-sentence - so the block is closed with what arrived
|
|
46
|
+
* rather than dropped, and the text the user sees is the text that streamed.
|
|
47
|
+
*/
|
|
48
|
+
export declare function closeStream(state: OllamaStreamState): StreamChunk[];
|
|
49
|
+
//# sourceMappingURL=mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/ollama/mapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEpE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACjD,mFAAmF;IACnF,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACrD,2EAA2E;IAC3E,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,iBAAiB,IAAI,iBAAiB,CAErD;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,WAAW,EAAE,CAK5F;AAmGD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,EAAE,CASnE"}
|