@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,913 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-wire mapping for the Kimi Code coding endpoints.
|
|
3
|
+
*
|
|
4
|
+
* Two surfaces serve the same models:
|
|
5
|
+
*
|
|
6
|
+
* - the OpenAI-compatible `/coding/v1/chat/completions`, which is what the
|
|
7
|
+
* official CLI configures for its managed provider and therefore the default
|
|
8
|
+
* here; and
|
|
9
|
+
* - the Anthropic-compatible `/coding/v1/messages?beta=true`, which authenticates
|
|
10
|
+
* with `x-api-key` rather than a bearer token.
|
|
11
|
+
*
|
|
12
|
+
* Both are mapped here, and both streams are normalized into DSH's block/delta
|
|
13
|
+
* vocabulary.
|
|
14
|
+
*
|
|
15
|
+
* Two Kimi-specific behaviours shape the request builders:
|
|
16
|
+
*
|
|
17
|
+
* 1. Thinking is selected with `reasoning_effort` and accepts only
|
|
18
|
+
* low/high/max; anything else the client sends is answered with HTTP 400, so
|
|
19
|
+
* a caller's broader effort vocabulary is narrowed here rather than passed
|
|
20
|
+
* through. Thinking off is expressed as `thinking: {type: "disabled"}`.
|
|
21
|
+
* 2. When thinking is on, Kimi requires `reasoning_content` on an assistant
|
|
22
|
+
* message that also carries tool calls — the service answers 400
|
|
23
|
+
* "thinking is enabled but reasoning_content is missing" otherwise. Reasoning
|
|
24
|
+
* blocks are therefore replayed on the OpenAI wire, unlike the sibling routes
|
|
25
|
+
* which drop them.
|
|
26
|
+
*
|
|
27
|
+
* See https://www.kimi.com/code/docs/en/kimi-code/error-reference.html
|
|
28
|
+
*/
|
|
29
|
+
import { type OutboundContentBlock, type GenerateOptions, type Message, type StreamChunk } from '../common/llm-compat.ts';
|
|
30
|
+
import { normalizeKimiToolSchema } from '../common/tool-schema.ts';
|
|
31
|
+
import { estimatedInputTokens } from '../common/prompt-estimate.ts';
|
|
32
|
+
import { ReasoningKeyDialect as SharedReasoningKeyDialect } from '../common/reasoning-dialect.ts';
|
|
33
|
+
export { estimatedInputTokens, normalizeKimiToolSchema };
|
|
34
|
+
import { MAX_MESSAGE_BODY_BYTES, MAX_REQUEST_IMAGE_BYTES, MAX_REQUEST_VIDEO_BYTES, MAX_VIDEO_MESSAGE_BODY_BYTES, NO_RESOLVED_IMAGES, REQUEST_IMAGE_MAX_EDGE, collectRemainingImageKeys, offloadOldestRequestImages, offloadRequestImagesWithStickyBudget, requestImageKey, requestImageTarget, resolveRequestImages, type AttachmentImageReader, type ResolvedRequestImage, type ResolvedRequestImages, type StickyImageOffloadResult } from '../common/request-images.ts';
|
|
35
|
+
export { MAX_MESSAGE_BODY_BYTES, MAX_REQUEST_IMAGE_BYTES, MAX_REQUEST_VIDEO_BYTES, MAX_VIDEO_MESSAGE_BODY_BYTES, NO_RESOLVED_IMAGES, REQUEST_IMAGE_MAX_EDGE, collectRemainingImageKeys, offloadOldestRequestImages, offloadRequestImagesWithStickyBudget, requestImageKey, requestImageTarget, resolveRequestImages, type AttachmentImageReader, type ResolvedRequestImage, type ResolvedRequestImages, type StickyImageOffloadResult, };
|
|
36
|
+
export { DEFAULT_LOW_REQUEST_IMAGE_BYTES, lowRequestImageBytes } from './types.ts';
|
|
37
|
+
import { offloadOldestRequestVideos as offloadVideosWithinBudget, requestHasVideo, resolveRequestVideos, type AttachmentVideoReader, type ResolvedRequestVideos } from '../common/video-request.ts';
|
|
38
|
+
export { offloadVideosWithinBudget as offloadOldestRequestVideos, requestHasVideo, resolveRequestVideos, type AttachmentVideoReader, type ResolvedRequestVideos, };
|
|
39
|
+
import type { KimiCodeReasoningEffort, KimiCodeRequestDiagnostic, KimiCodeWire } from '../../shared/kimi-code-contracts.ts';
|
|
40
|
+
import { KimiToolArgumentGuard } from './tool-argument-guard.ts';
|
|
41
|
+
/**
|
|
42
|
+
* Wire keys an OpenAI-compatible response can carry reasoning under.
|
|
43
|
+
*
|
|
44
|
+
* The Chat Completions ecosystem never standardized one. Kimi answers with
|
|
45
|
+
* `reasoning_content`; newer vLLM builds renamed the field to `reasoning` and
|
|
46
|
+
* accept only that name on the request side, and gateways in between use
|
|
47
|
+
* `reasoning_details`. The first entry doubles as the default for a request
|
|
48
|
+
* made before any response has been seen.
|
|
49
|
+
*/
|
|
50
|
+
export declare const KNOWN_REASONING_KEYS: readonly ["reasoning_content", "reasoning_details", "reasoning"];
|
|
51
|
+
/** Default outbound reasoning key, used until a response proves otherwise. */
|
|
52
|
+
export declare const DEFAULT_REASONING_KEY: string;
|
|
53
|
+
/**
|
|
54
|
+
* How one `reasoning_details` fragment arrived on the wire.
|
|
55
|
+
*
|
|
56
|
+
* - `string` — the older bare-string spelling of the whole field;
|
|
57
|
+
* - `summary` — a visible summary element: official `type: 'summary'`, no
|
|
58
|
+
* `type` at all, or the `reasoning.summary` gateway spelling;
|
|
59
|
+
* - `encrypted` — official opaque provider state, which carries no visible text;
|
|
60
|
+
* - `text` — the `reasoning.text` compatibility spelling.
|
|
61
|
+
*
|
|
62
|
+
* The form is recorded because the same text has to be written back in the shape
|
|
63
|
+
* it arrived in: a bare string must not become an array, and an official
|
|
64
|
+
* encrypted element must stay one.
|
|
65
|
+
*/
|
|
66
|
+
export type ReasoningForm = 'string' | 'text' | 'summary' | 'encrypted';
|
|
67
|
+
/**
|
|
68
|
+
* One reasoning fragment, together with how it arrived.
|
|
69
|
+
*
|
|
70
|
+
* The key is carried per fragment rather than per message because one delta can
|
|
71
|
+
* legitimately carry several at once: Kimi answers under `reasoning_content`,
|
|
72
|
+
* gateways add `reasoning_details`, and newer vLLM builds reply under
|
|
73
|
+
* `reasoning`. Stopping at the first field loses text the service already
|
|
74
|
+
* charged for, and flattening every field onto one outbound key is what makes a
|
|
75
|
+
* replay read as a field the peer never sent.
|
|
76
|
+
*
|
|
77
|
+
* An encrypted fragment is the one shape with no visible text: its `text` is ''
|
|
78
|
+
* and its payload stays in `encrypted`, which is opaque provider state and is
|
|
79
|
+
* never decoded, rendered, or logged.
|
|
80
|
+
*/
|
|
81
|
+
export interface ReasoningFragment {
|
|
82
|
+
/** Wire field the fragment arrived under. */
|
|
83
|
+
readonly key: string;
|
|
84
|
+
/** Wire form, only meaningful when `key` is `reasoning_details`. */
|
|
85
|
+
readonly form?: ReasoningForm;
|
|
86
|
+
/** Element `type` exactly as received; absent when the element carried none. */
|
|
87
|
+
readonly wireType?: string;
|
|
88
|
+
/** Element index: the wire's own number, else the element's position. */
|
|
89
|
+
readonly index?: number;
|
|
90
|
+
/** Opaque encrypted provider state (`form: 'encrypted'`); never text. */
|
|
91
|
+
readonly encrypted?: string;
|
|
92
|
+
/** Visible text; always '' for an encrypted fragment. */
|
|
93
|
+
readonly text: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Every reasoning fragment one inbound object (a stream delta or a message)
|
|
97
|
+
* carries, in a fixed, documented order.
|
|
98
|
+
*
|
|
99
|
+
* `reasoning_content` comes first and `reasoning` last because that is the
|
|
100
|
+
* order of {@link KNOWN_REASONING_KEYS}: the Kimi field is the one this route is
|
|
101
|
+
* documented against and `reasoning` is the newer vLLM rename, so a delta
|
|
102
|
+
* carrying both keeps its text in the order a single-key endpoint would have
|
|
103
|
+
* produced it in. A `reasoning_details` array keeps its arrival order; `index` is
|
|
104
|
+
* carried as metadata and never reorders it (see reasoningDetailFragments).
|
|
105
|
+
*/
|
|
106
|
+
export declare function reasoningFragmentsOf(source: unknown): ReasoningFragment[];
|
|
107
|
+
/**
|
|
108
|
+
* Per-endpoint reasoning-field dialect: observes what the endpoint actually
|
|
109
|
+
* sends, and echoes thinking back under the same key.
|
|
110
|
+
*
|
|
111
|
+
* Sending `reasoning_content` to an endpoint that only reads `reasoning` is not
|
|
112
|
+
* a cosmetic mismatch — preserved thinking then reports the thinking as
|
|
113
|
+
* missing, so the model loses the reasoning chain of every prior assistant
|
|
114
|
+
* turn. Detection never clears: a response with no reasoning keeps the last
|
|
115
|
+
* known dialect, and an endpoint that switches is adapted on its next reply.
|
|
116
|
+
*/
|
|
117
|
+
export declare class ReasoningKeyDialect extends SharedReasoningKeyDialect {
|
|
118
|
+
/**
|
|
119
|
+
* Every reasoning fragment one inbound delta carries, remembering the dialect.
|
|
120
|
+
*
|
|
121
|
+
* The FIRST string-shaped fragment names the key this endpoint speaks, which is
|
|
122
|
+
* exactly the field the earlier single-match read picked: an endpoint answering
|
|
123
|
+
* under `reasoning_content` keeps that outbound key even when the same delta
|
|
124
|
+
* also carries a sibling field, so learning does not change just because a peer
|
|
125
|
+
* became chattier.
|
|
126
|
+
*
|
|
127
|
+
* An element of a `reasoning_details` ARRAY never teaches the dialect: the
|
|
128
|
+
* outbound key must be a field that takes a plain string, and array elements
|
|
129
|
+
* could only teach `reasoning_details`, which on that wire is an array. A bare
|
|
130
|
+
* string `reasoning_details` still teaches it, because that spelling really is
|
|
131
|
+
* a string.
|
|
132
|
+
*/
|
|
133
|
+
observeAll(source: unknown): ReasoningFragment[];
|
|
134
|
+
/** First reasoning fragment on an inbound message or delta, remembering its key. */
|
|
135
|
+
observe(source: unknown): string | undefined;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The reasoning key an outbound assistant message should use.
|
|
139
|
+
*
|
|
140
|
+
* Exposed for tests and for the request builder, which builds outside any
|
|
141
|
+
* stream state.
|
|
142
|
+
*/
|
|
143
|
+
export declare function outboundReasoningKey(): string;
|
|
144
|
+
/** Reset the learned dialect. Test seam only. */
|
|
145
|
+
export declare function resetReasoningDialect(): void;
|
|
146
|
+
/**
|
|
147
|
+
* Sanitize one id into the shape the service accepts, without dedup.
|
|
148
|
+
*
|
|
149
|
+
* Exported because the request builders and the stream readers must agree on
|
|
150
|
+
* the result, and the guarantee callers actually rely on is that this is
|
|
151
|
+
* idempotent: sanitizing an already-sanitized id returns it unchanged, so an id
|
|
152
|
+
* that has been through here once stays stable across every later turn.
|
|
153
|
+
*
|
|
154
|
+
* Use {@link ToolCallIdNormalizer} instead wherever more than one id in the
|
|
155
|
+
* same request must be kept distinct.
|
|
156
|
+
*/
|
|
157
|
+
export declare function clampToolCallId(id: string): string;
|
|
158
|
+
/**
|
|
159
|
+
* Assigns collision-free tool-call ids across one request.
|
|
160
|
+
*
|
|
161
|
+
* Truncation alone is not injective: two ids sharing a 64-character prefix
|
|
162
|
+
* clamp to the same value, and a later tool result then resolves against the
|
|
163
|
+
* wrong call. This maps each raw id to a unique sanitized id, appending
|
|
164
|
+
* `_2`, `_3`, … on collision, and returns the same answer for the same
|
|
165
|
+
* input for the lifetime of the normalizer.
|
|
166
|
+
*
|
|
167
|
+
* One normalizer serves one request (or one stream), so the mapping is
|
|
168
|
+
* request-scoped by construction: a conversation whose history is replayed
|
|
169
|
+
* re-derives the same assignment from the same inputs, which is what keeps
|
|
170
|
+
* a tool result answerable by the call it belongs to.
|
|
171
|
+
*/
|
|
172
|
+
export declare class ToolCallIdNormalizer {
|
|
173
|
+
private readonly assigned;
|
|
174
|
+
private readonly used;
|
|
175
|
+
/** The unique sanitized id for `id`, stable for the life of this normalizer. */
|
|
176
|
+
normalize(id: string): string;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Service limits on the request shape, from the official error reference.
|
|
180
|
+
*
|
|
181
|
+
* Both were documented as hard 400s, so exceeding them costs the whole turn
|
|
182
|
+
* rather than degrading gracefully — which is why the request is trimmed to fit
|
|
183
|
+
* instead of being sent and rejected.
|
|
184
|
+
*/
|
|
185
|
+
export declare const MAX_STOP_SEQUENCES = 5;
|
|
186
|
+
export declare const MAX_STOP_SEQUENCE_BYTES = 32;
|
|
187
|
+
/**
|
|
188
|
+
* Whether one request asks the service to keep reasoning across turns.
|
|
189
|
+
*
|
|
190
|
+
* Kimi's models reason by default and the official CLI ships Preserved Thinking
|
|
191
|
+
* ON (`[thinking] keep = "all"`), which is what its own error reference assumes
|
|
192
|
+
* when it demands `reasoning_content` on every assistant message. An
|
|
193
|
+
* environment opt-out exists for a deployment that would rather not pay for the
|
|
194
|
+
* replayed reasoning tokens.
|
|
195
|
+
*/
|
|
196
|
+
export declare function preserveThinkingEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Trim stop sequences to what the service accepts.
|
|
199
|
+
*
|
|
200
|
+
* At most five entries, each at most 32 bytes; a longer sequence is dropped
|
|
201
|
+
* rather than truncated, because a shortened stop string would halt generation
|
|
202
|
+
* at the wrong place — silently changing the answer is worse than not stopping.
|
|
203
|
+
*/
|
|
204
|
+
export declare function stopSequences(stop: readonly string[] | undefined): string[];
|
|
205
|
+
/**
|
|
206
|
+
* Narrow a caller's effort onto the levels Kimi accepts.
|
|
207
|
+
*
|
|
208
|
+
* DSH exposes low/high/max/none for these models, but a conversation can hold
|
|
209
|
+
* an effort chosen for a different provider, so the broader vocabulary the rest
|
|
210
|
+
* of the plugin uses is mapped rather than rejected: an unknown value would be
|
|
211
|
+
* answered with HTTP 400 and fail the turn.
|
|
212
|
+
*/
|
|
213
|
+
export declare function mapReasoningEffort(effort: string | undefined | null): KimiCodeReasoningEffort | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Thinking-token budget one Anthropic-route level asks for.
|
|
216
|
+
*
|
|
217
|
+
* Kimi's Anthropic surface takes the standard `thinking` block, so the budget is
|
|
218
|
+
* derived from the same three levels the OpenAI surface uses.
|
|
219
|
+
*/
|
|
220
|
+
export declare function thinkingBudgetFor(effort: KimiCodeReasoningEffort | undefined, maxTokens: number): number | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Media a single request build may carry.
|
|
223
|
+
*
|
|
224
|
+
* Passed as one object so adding a media kind never grows a positional
|
|
225
|
+
* signature the existing callers already bind.
|
|
226
|
+
*/
|
|
227
|
+
export interface RequestMediaOptions {
|
|
228
|
+
/** Videos read for this request; absent means none are readable. */
|
|
229
|
+
videos?: ResolvedRequestVideos;
|
|
230
|
+
/** Whether the selected model declares video input. */
|
|
231
|
+
videoAccepted?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Whether the selected model accepts message-level tool declarations
|
|
234
|
+
* (`messages[].tools`), Kimi's `dynamically_loaded_tools` capability.
|
|
235
|
+
*/
|
|
236
|
+
messageTools?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Hosted references this request already uploaded, keyed by ATTACHMENT ID.
|
|
239
|
+
*
|
|
240
|
+
* The value is the `ms://<id>` reference the upload returned, and citing it
|
|
241
|
+
* instead of the bytes is the whole point: the service reads the stored file,
|
|
242
|
+
* so the body carries a ~20-byte URL where it used to carry a megabyte of
|
|
243
|
+
* base64. Only the OpenAI-compatible surface documents this; the Anthropic
|
|
244
|
+
* one keeps its inline block (see anthropicUserContent).
|
|
245
|
+
*
|
|
246
|
+
* A miss is not an error: an occurrence with no entry here is sent exactly as
|
|
247
|
+
* it always was (inline when readable, the unavailable placeholder when not),
|
|
248
|
+
* which is what makes a per-media upload failure degrade instead of fail.
|
|
249
|
+
*/
|
|
250
|
+
imageReferences?: ReadonlyMap<string, string>;
|
|
251
|
+
/** Hosted video references, keyed by attachment id; see imageReferences. */
|
|
252
|
+
videoReferences?: ReadonlyMap<string, string>;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Stability tier for an initial bootstrap reminder message (`1` = most static, `4` = session-scoped).
|
|
256
|
+
*
|
|
257
|
+
* The harness appends bootstrap reminders (`agent-instructions`, `runtime-context`,
|
|
258
|
+
* `skill-catalog`) AFTER the first user prompt (or
|
|
259
|
+
* after the retained tail following a compaction checkpoint). Because Kimi's
|
|
260
|
+
* prefix cache matches strictly from byte 0, leaving the dynamic user prompt at
|
|
261
|
+
* index 0 prevents subagents, forked sessions, and post-compaction turns from
|
|
262
|
+
* sharing the ~8,300-token `AGENTS.md` + `skill-catalog` prefix.
|
|
263
|
+
*
|
|
264
|
+
* Mid-conversation delta reminders (`Updated instructions from:`, `Additional
|
|
265
|
+
* instructions from:`, `Instructions removed:`, `The available skill catalog changed.`)
|
|
266
|
+
* return `null` so they stay anchored at the exact history position where they
|
|
267
|
+
* arrived (append-only in-history).
|
|
268
|
+
*/
|
|
269
|
+
export declare function classifyBootstrapUserMessage(message: Message): 2 | 3 | 4 | null;
|
|
270
|
+
/**
|
|
271
|
+
* Deterministic entropy-sorted ordering for leading bootstrap reminders.
|
|
272
|
+
*
|
|
273
|
+
* 1. Within the leading pre-assistant `user` message run, orders the first
|
|
274
|
+
* occurrence of each bootstrap tier (`2: agent-instructions` ->
|
|
275
|
+
* `3: skill-catalog` -> `4: runtime-context`)
|
|
276
|
+
* ahead of the dynamic `user` prompt (`5`).
|
|
277
|
+
* 2. When the surface starts with a `compact-checkpoint` that shadowed the
|
|
278
|
+
* original bootstrap run and the harness re-injected Tier 2/3 reminders
|
|
279
|
+
* after the retained tail, hoists the first occurrence of Tier 2/3 ahead
|
|
280
|
+
* of `compact-checkpoint` so the ~21k static prefix stays intact across
|
|
281
|
+
* compaction boundaries and every step after compaction.
|
|
282
|
+
*/
|
|
283
|
+
export declare function orderStaticPrefixMessages(messages: readonly Message[]): Message[];
|
|
284
|
+
/**
|
|
285
|
+
* One `reasoning_details` element, rebuilt from the provenance the stream
|
|
286
|
+
* recorded.
|
|
287
|
+
*
|
|
288
|
+
* Each variant is written back in the shape it arrived in: `text` and `summary`
|
|
289
|
+
* keep the wire `type` they were sent with (a summary may legitimately have
|
|
290
|
+
* none), `encrypted` keeps the opaque payload verbatim, and no variant invents
|
|
291
|
+
* an `index` the wire did not carry.
|
|
292
|
+
*/
|
|
293
|
+
export type ReplayedReasoningDetail = {
|
|
294
|
+
readonly form: 'text';
|
|
295
|
+
readonly text: string;
|
|
296
|
+
readonly index?: number;
|
|
297
|
+
} | {
|
|
298
|
+
readonly form: 'summary';
|
|
299
|
+
readonly summary: string;
|
|
300
|
+
readonly wireType?: string;
|
|
301
|
+
readonly index?: number;
|
|
302
|
+
} | {
|
|
303
|
+
readonly form: 'encrypted';
|
|
304
|
+
readonly encrypted: string;
|
|
305
|
+
readonly wireType?: string;
|
|
306
|
+
readonly index?: number;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Reasoning of one assistant message, split by the wire shape it arrived in.
|
|
310
|
+
*
|
|
311
|
+
* `fields` holds text that belongs under a plain string field, `detailsString`
|
|
312
|
+
* is the older bare-string `reasoning_details` value (which must stay a
|
|
313
|
+
* string), and `details` holds array elements; `joined` is everything
|
|
314
|
+
* concatenated, which is what a message with no provenance still sends.
|
|
315
|
+
*/
|
|
316
|
+
export interface ReplayedReasoning {
|
|
317
|
+
/** Text per plain string field, in first-seen order. */
|
|
318
|
+
readonly fields: ReadonlyArray<{
|
|
319
|
+
readonly key: string;
|
|
320
|
+
readonly text: string;
|
|
321
|
+
}>;
|
|
322
|
+
/** The legacy bare-string `reasoning_details` value, when one was recorded. */
|
|
323
|
+
readonly detailsString?: string;
|
|
324
|
+
/** `reasoning_details` elements rebuilt from their provenance, in wire order. */
|
|
325
|
+
readonly details: ReadonlyArray<ReplayedReasoningDetail>;
|
|
326
|
+
/** Every reasoning block concatenated, used when no provenance survives. */
|
|
327
|
+
readonly joined: string;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* One complete tool definition, in the shape the function-calling wire wants.
|
|
331
|
+
*
|
|
332
|
+
* The service rejects a bare tool name: a message-level declaration must carry
|
|
333
|
+
* the same name/description/parameters triple the top-level list carries, so
|
|
334
|
+
* the caller cannot pass a reference and let the model guess.
|
|
335
|
+
*/
|
|
336
|
+
export interface DynamicToolDeclaration {
|
|
337
|
+
name: string;
|
|
338
|
+
description: string;
|
|
339
|
+
parameters: Record<string, unknown>;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* A tool declaration that belongs to a message rather than the request.
|
|
343
|
+
*
|
|
344
|
+
* DSH has no message-level tool field, so the producer sets this symbol on a
|
|
345
|
+
* system-role {@link Message} to ask for one. A symbol is used rather than a
|
|
346
|
+
* string key because every other reader of a message — the session log, the
|
|
347
|
+
* transcript UI, another adapter — must not start seeing a field it cannot
|
|
348
|
+
* honor; the property is invisible to them and only this mapper looks for it.
|
|
349
|
+
*/
|
|
350
|
+
export declare const MESSAGE_TOOLS: unique symbol;
|
|
351
|
+
/**
|
|
352
|
+
* Serializable key the declaration travels under.
|
|
353
|
+
*
|
|
354
|
+
* A symbol alone is not enough: the session log persists messages through
|
|
355
|
+
* JSON, which drops symbol-keyed properties, so a restored session would lose
|
|
356
|
+
* every declaration and the model would believe it had tools the request no
|
|
357
|
+
* longer carries. The declaration is therefore stored under a plain string key
|
|
358
|
+
* AND the symbol, so in-process readers keep the exempt-from-`Object.keys`
|
|
359
|
+
* behaviour while a round trip through persistence still reconstructs it.
|
|
360
|
+
*/
|
|
361
|
+
export declare const MESSAGE_TOOLS_KEY = "kimiCodeMessageTools";
|
|
362
|
+
/**
|
|
363
|
+
* Attach message-level tool declarations to one system message.
|
|
364
|
+
*
|
|
365
|
+
* Two copies are written deliberately, and they differ in visibility:
|
|
366
|
+
*
|
|
367
|
+
* - the SYMBOL copy is non-enumerable, so a reader that inspects a message the
|
|
368
|
+
* ordinary way (the transcript UI, a sibling adapter) sees nothing new and
|
|
369
|
+
* cannot mistake an unhandled field for something it must act on;
|
|
370
|
+
* - the STRING-KEYED copy is enumerable, because JSON persistence only
|
|
371
|
+
* serializes enumerable string keys and a declaration that vanishes on
|
|
372
|
+
* session resume is worse than one that is visible. Readers that do walk the
|
|
373
|
+
* keys will see `kimiCodeMessageTools`; the convention is that only this
|
|
374
|
+
* route's mapper interprets it.
|
|
375
|
+
*/
|
|
376
|
+
export declare function withMessageTools<T extends Message>(message: T, tools: readonly DynamicToolDeclaration[]): T;
|
|
377
|
+
/** Message-level tool declarations one message carries, when any. */
|
|
378
|
+
export declare function messageToolsOf(message: Message): readonly DynamicToolDeclaration[] | undefined;
|
|
379
|
+
/**
|
|
380
|
+
* Re-attach declarations after a message has been through JSON.
|
|
381
|
+
*
|
|
382
|
+
* Persistence keeps the declarations but necessarily loses the symbol, so a
|
|
383
|
+
* restored message exposes them only under {@link MESSAGE_TOOLS_KEY}. This
|
|
384
|
+
* restores the symbol too, which is what makes a declaration survive a resumed
|
|
385
|
+
* session instead of silently disappearing.
|
|
386
|
+
*/
|
|
387
|
+
export declare function rehydrateMessageTools<T extends Message>(message: T): T;
|
|
388
|
+
/** Build one `/chat/completions` body. */
|
|
389
|
+
export declare function buildOpenAIRequest(options: GenerateOptions, images?: ResolvedRequestImages, preserveThinking?: boolean, media?: RequestMediaOptions): Record<string, unknown>;
|
|
390
|
+
/**
|
|
391
|
+
* Provenance kind the harness stamps on the side-channel title request.
|
|
392
|
+
*
|
|
393
|
+
* The title request runs on this route and borrows the conversation's session
|
|
394
|
+
* id, but it is a DIFFERENT conversation: its system prompt and its (empty)
|
|
395
|
+
* tool list have nothing to do with the prefix the session cached. Naming the
|
|
396
|
+
* kind is what lets the two be told apart without reading prompt text.
|
|
397
|
+
*/
|
|
398
|
+
export declare const SESSION_TITLE_SOURCE_KIND = "dsh-session-title-llm";
|
|
399
|
+
/**
|
|
400
|
+
* Whether this request is the side-channel one that titles a session.
|
|
401
|
+
*
|
|
402
|
+
* A title request is asked on the same adapter, under the same session id, and
|
|
403
|
+
* with the same credential as the conversation it titles - but it shares
|
|
404
|
+
* nothing else with it. Left alone it would:
|
|
405
|
+
*
|
|
406
|
+
* - send the session's prompt cache key, so the service would route the title
|
|
407
|
+
* prompt at the entry the conversation cached;
|
|
408
|
+
* - overwrite the session's prefix snapshot, so the next real turn would be
|
|
409
|
+
* told its system prompt or its tool list changed; and
|
|
410
|
+
* - file its usage under the session, so the session's cache ratio would
|
|
411
|
+
* describe a prompt the session never sent.
|
|
412
|
+
*
|
|
413
|
+
* The detection is deliberately structural rather than a flag on the options:
|
|
414
|
+
* the caller is the harness, and the harness states a title request by its
|
|
415
|
+
* CONTENT, not by anything this route could switch on.
|
|
416
|
+
*
|
|
417
|
+
* @param options - The request about to be mapped.
|
|
418
|
+
* @returns Whether the request is the side-channel title request.
|
|
419
|
+
*/
|
|
420
|
+
export declare function isSideChannelTitleRequest(options: GenerateOptions): boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Stable identifier for the conversation this request belongs to.
|
|
423
|
+
*
|
|
424
|
+
* The key is derived from the session identifier alone — never from message
|
|
425
|
+
* content. The official agent keys its cache on the conversation (its
|
|
426
|
+
* sessionId) so the key survives context compaction and multimodal churn
|
|
427
|
+
* byte-for-byte. Deriving it from the first user message (as a fallback once
|
|
428
|
+
* did) produces a key that CHANGES the moment compaction rewrites that first
|
|
429
|
+
* message, silently re-routing the whole session to a cold cache entry and
|
|
430
|
+
* collapsing the hit rate. A session that has no identity yet sends no key at
|
|
431
|
+
* all rather than a key that will drift.
|
|
432
|
+
*/
|
|
433
|
+
export declare function promptCacheKey(options: GenerateOptions): string | undefined;
|
|
434
|
+
/**
|
|
435
|
+
* The Anthropic beta that carries the context-management edit.
|
|
436
|
+
*
|
|
437
|
+
* `clear_thinking_20251015` is honoured only on the beta Messages API, so the
|
|
438
|
+
* beta has to travel WITH the request; the official Kimi Anthropic protocol
|
|
439
|
+
* asks for it on every thinking request (see the upstream
|
|
440
|
+
* `kimiAnthropicProtocol`, which returns `betaFeatures: [CONTEXT_MANAGEMENT_BETA]`
|
|
441
|
+
* for both the enabled and the disabled encoding).
|
|
442
|
+
*/
|
|
443
|
+
export declare const CONTEXT_MANAGEMENT_BETA = "context-management-2025-06-27";
|
|
444
|
+
/**
|
|
445
|
+
* The Anthropic context edit that clears stale thinking blocks.
|
|
446
|
+
*
|
|
447
|
+
* The edit is what "keep the thinking across turns" means on this wire: the
|
|
448
|
+
* service clears the thinking it has already consumed instead of replaying it,
|
|
449
|
+
* so a preserved thinking block stays affordable.
|
|
450
|
+
*/
|
|
451
|
+
export declare const CLEAR_THINKING_EDIT = "clear_thinking_20251015";
|
|
452
|
+
/** Build one `/v1/messages` body. */
|
|
453
|
+
export declare function buildAnthropicRequest(options: GenerateOptions, images?: ResolvedRequestImages, media?: RequestMediaOptions, preserveThinking?: boolean): Record<string, unknown>;
|
|
454
|
+
/** Build the body for whichever endpoint serves `wire`. */
|
|
455
|
+
export declare function buildRequest(options: GenerateOptions, wire: KimiCodeWire, images?: ResolvedRequestImages, preserveThinking?: boolean, media?: RequestMediaOptions): Record<string, unknown>;
|
|
456
|
+
/**
|
|
457
|
+
* What the body-fit loop actually did, so the remedy can describe it.
|
|
458
|
+
*
|
|
459
|
+
* Optional by design: a caller that has not run the loop leaves it undefined and
|
|
460
|
+
* gets the composition-based message, so every direct assertion of this guard
|
|
461
|
+
* keeps its exact text.
|
|
462
|
+
*/
|
|
463
|
+
export interface BodyFitContext {
|
|
464
|
+
/** How many image occurrences the loop already replaced with a placeholder. */
|
|
465
|
+
readonly droppedImages: number;
|
|
466
|
+
/** How many sendable image occurrences the body still carries. */
|
|
467
|
+
readonly sendableImagesRemaining: number;
|
|
468
|
+
/** The overflow that remained after the last drop. */
|
|
469
|
+
readonly excessBytes: number;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Reject a request the service would refuse for its size.
|
|
473
|
+
*
|
|
474
|
+
* This is the most frequently reported 400 on the coding endpoint, and it is
|
|
475
|
+
* worth catching locally for two reasons: the message can name the actual
|
|
476
|
+
* remedy (DSH's compaction), and a request that cannot succeed should not be
|
|
477
|
+
* sent at all. The measured size is the real serialized body, so it accounts
|
|
478
|
+
* for tool schemas and inlined images the caller cannot easily estimate.
|
|
479
|
+
*
|
|
480
|
+
* The ceiling is the caller's when it passes one, because the text/image tier is
|
|
481
|
+
* graded by model and only the caller knows which model the turn is for; omitted,
|
|
482
|
+
* the guard resolves the model-less default (or the video tier) itself.
|
|
483
|
+
*
|
|
484
|
+
* The error code is CONTEXT_OVERFLOW_CODE, not PROVIDER_ERROR, because naming the
|
|
485
|
+
* remedy in prose is not the same as being able to act on it: DSH forces a
|
|
486
|
+
* compaction and retries the same step only for that one code, and every other
|
|
487
|
+
* 400-shaped failure ends the turn. A byte ceiling is answered by the same
|
|
488
|
+
* compression a token ceiling is — the conversation shrinks either way — so the
|
|
489
|
+
* body of the message stays as specific as it was while the code becomes one the
|
|
490
|
+
* host can recover from.
|
|
491
|
+
*
|
|
492
|
+
* @param body the request body about to be serialized and sent.
|
|
493
|
+
* @param carriesVideo whether the request attaches video, which has its own tier.
|
|
494
|
+
* @param context what the body-fit loop already did, when it ran.
|
|
495
|
+
* @param limit the ceiling already resolved for this request's model.
|
|
496
|
+
* @returns the serialized body, so a caller that is about to send it does not
|
|
497
|
+
* serialize a body of up to tens of megabytes a second time.
|
|
498
|
+
*/
|
|
499
|
+
export declare function assertRequestBodyFits(body: Record<string, unknown>, carriesVideo?: boolean, context?: BodyFitContext, limit?: number): string;
|
|
500
|
+
/**
|
|
501
|
+
* How a request body splits into the parts that share the ceiling.
|
|
502
|
+
*
|
|
503
|
+
* The body ceiling — 2 MB on the 256K tier, larger on the 1M tier — covers
|
|
504
|
+
* images, conversation text, tool schemas and the system prompt together, but
|
|
505
|
+
* only the first is compressible by dropping something. A
|
|
506
|
+
* message that names which part dominates is the difference between a user who
|
|
507
|
+
* compacts the conversation and a user who deletes images and fails again.
|
|
508
|
+
*/
|
|
509
|
+
export interface RequestBodyBreakdown {
|
|
510
|
+
readonly totalBytes: number;
|
|
511
|
+
readonly imageBytes: number;
|
|
512
|
+
readonly toolSchemaBytes: number;
|
|
513
|
+
readonly otherBytes: number;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Measure one already-serialized body by composition.
|
|
517
|
+
*
|
|
518
|
+
* Image payload is found structurally (a base64 `data:` URL or an Anthropic
|
|
519
|
+
* base64 source) rather than by searching for a marker substring, so a user
|
|
520
|
+
* message that happens to contain that text cannot inflate the image share.
|
|
521
|
+
*/
|
|
522
|
+
export declare function requestBodyBreakdown(body: Record<string, unknown>, carriesVideo?: boolean): RequestBodyBreakdown;
|
|
523
|
+
/** One tool call accumulating across `chat/completions` deltas. */
|
|
524
|
+
interface PendingToolCall {
|
|
525
|
+
blockIndex: number;
|
|
526
|
+
id: string;
|
|
527
|
+
name: string;
|
|
528
|
+
arguments: string;
|
|
529
|
+
started: boolean;
|
|
530
|
+
guard?: KimiToolArgumentGuard;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* One failure the stream reported itself, as the wire stated it.
|
|
534
|
+
*
|
|
535
|
+
* The vocabulary travels with the object because the two wires do not spell a
|
|
536
|
+
* transient failure the same way — an Anthropic frame is an `error` EVENT, an
|
|
537
|
+
* OpenAI one an `error` field on an ordinary data frame — so the same verdict is
|
|
538
|
+
* reached by two different rules, and the adapter cannot re-derive which one
|
|
539
|
+
* applied from the wire it happened to send the request on.
|
|
540
|
+
*/
|
|
541
|
+
export interface KimiCodeInBandStreamError {
|
|
542
|
+
/** Wire the event was read with; it selects the vocabulary it reclassifies by. */
|
|
543
|
+
vocabulary: KimiCodeWire;
|
|
544
|
+
/** The event's wire `error` object, as received. */
|
|
545
|
+
error: Record<string, unknown>;
|
|
546
|
+
/** The provider's own diagnostic, without this mapper's prefix. */
|
|
547
|
+
message: string;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* One run of reasoning and how it arrived.
|
|
551
|
+
*
|
|
552
|
+
* Length, not text: the run describes where a slice of the block came from
|
|
553
|
+
* without storing the thinking twice, which keeps the persisted replay state
|
|
554
|
+
* small and keeps it a plain JSON value. An encrypted run has `length: 0` — it
|
|
555
|
+
* carries no visible text, only the opaque payload that must be handed back.
|
|
556
|
+
*/
|
|
557
|
+
export interface ReasoningRun {
|
|
558
|
+
/** Wire field the slice arrived under. */
|
|
559
|
+
readonly key: string;
|
|
560
|
+
/** Wire form, only meaningful when `key` is `reasoning_details`. */
|
|
561
|
+
readonly form?: ReasoningForm;
|
|
562
|
+
/** Element `type` exactly as received; absent when the element carried none. */
|
|
563
|
+
readonly wireType?: string;
|
|
564
|
+
/** Element index: the wire's own number, else the element's position. */
|
|
565
|
+
readonly index?: number;
|
|
566
|
+
/** Opaque encrypted provider state (`form: 'encrypted'`); never text. */
|
|
567
|
+
readonly encrypted?: string;
|
|
568
|
+
/** Length of the slice in the assembled block's text; 0 when there is none. */
|
|
569
|
+
readonly length: number;
|
|
570
|
+
}
|
|
571
|
+
export interface KimiCodeStreamState {
|
|
572
|
+
wire: KimiCodeWire;
|
|
573
|
+
blocks: OutboundContentBlock[];
|
|
574
|
+
current: {
|
|
575
|
+
index: number;
|
|
576
|
+
type: 'text' | 'reasoning';
|
|
577
|
+
text: string;
|
|
578
|
+
} | null;
|
|
579
|
+
/**
|
|
580
|
+
* Which wire field the reasoning text of each block arrived under.
|
|
581
|
+
*
|
|
582
|
+
* One block can mix fields: a delta may carry `reasoning_content` and
|
|
583
|
+
* `reasoning` together, and consecutive deltas may alternate spellings without
|
|
584
|
+
* the block boundary moving. Each run records the key and the LENGTH of its
|
|
585
|
+
* slice rather than the slice itself, so the provenance never duplicates the
|
|
586
|
+
* thinking it describes and a replay can put every slice back under the field
|
|
587
|
+
* it came from. Keyed by block index and serialized by
|
|
588
|
+
* {@link reasoningReplayState}.
|
|
589
|
+
*/
|
|
590
|
+
reasoningRuns: Map<number, ReasoningRun[]>;
|
|
591
|
+
/** wire tool index -> accumulating call (OpenAI route). */
|
|
592
|
+
toolCalls: Map<number, PendingToolCall>;
|
|
593
|
+
/** anthropic content-block index -> our block index. */
|
|
594
|
+
contentIndexes: Map<number, number>;
|
|
595
|
+
/** anthropic content index of the block currently open. */
|
|
596
|
+
openContentIndex: number | null;
|
|
597
|
+
hasContent: boolean;
|
|
598
|
+
hasToolCall: boolean;
|
|
599
|
+
finishReason: string | null;
|
|
600
|
+
/**
|
|
601
|
+
* An in-band failure, recorded just before the mapper throws on it.
|
|
602
|
+
*
|
|
603
|
+
* The mapper cannot tell whether anything has reached the caller yet and has
|
|
604
|
+
* no other verdict to give the event; the adapter can, and reclassifies a
|
|
605
|
+
* transient one from this while nothing has. Both wires record into the one
|
|
606
|
+
* field because one request is served by one of them, never both.
|
|
607
|
+
*/
|
|
608
|
+
streamError?: KimiCodeInBandStreamError;
|
|
609
|
+
done: boolean;
|
|
610
|
+
finished: boolean;
|
|
611
|
+
inputTokens: number;
|
|
612
|
+
outputTokens: number;
|
|
613
|
+
cacheReadTokens: number;
|
|
614
|
+
cacheWriteTokens: number;
|
|
615
|
+
/**
|
|
616
|
+
* How the cache write above splits across the two TTL tiers.
|
|
617
|
+
*
|
|
618
|
+
* Read from the RESPONSE HEADERS rather than from the body: the service states
|
|
619
|
+
* the totals in `usage`, and the per-tier split only in
|
|
620
|
+
* `Msh-Usage-Cache-Write-Tokens-5m` / `...-1h`. The adapter reads them off the
|
|
621
|
+
* `Response` it just received (the only place they exist) and writes them here,
|
|
622
|
+
* so the rolling totals below have both halves. Absent headers leave both at
|
|
623
|
+
* 0, which the contract defines as silence rather than as a claim.
|
|
624
|
+
*/
|
|
625
|
+
cacheWrite5mTokens: number;
|
|
626
|
+
cacheWrite1hTokens: number;
|
|
627
|
+
reasoningTokens: number;
|
|
628
|
+
/** Whether the upstream actually carried each optional usage field. */
|
|
629
|
+
cacheReadReported: boolean;
|
|
630
|
+
cacheWriteReported: boolean;
|
|
631
|
+
reasoningReported: boolean;
|
|
632
|
+
sawUsage: boolean;
|
|
633
|
+
/**
|
|
634
|
+
* Per-request tool-call id assignment.
|
|
635
|
+
*
|
|
636
|
+
* The request side and the stream side must hand the service the same id for
|
|
637
|
+
* the same call, and truncation alone cannot guarantee that across a
|
|
638
|
+
* multi-call response. Shared by reference so both halves of one turn agree.
|
|
639
|
+
*/
|
|
640
|
+
toolCallIds: ToolCallIdNormalizer;
|
|
641
|
+
/**
|
|
642
|
+
* Session this turn belongs to, when the caller stated one.
|
|
643
|
+
*
|
|
644
|
+
* Carried so usage can be filed under the right conversation at close time,
|
|
645
|
+
* even if the caller does not pass the session again.
|
|
646
|
+
*/
|
|
647
|
+
sessionId: string | undefined;
|
|
648
|
+
/**
|
|
649
|
+
* Whether this turn is the side-channel request that titles a session.
|
|
650
|
+
*
|
|
651
|
+
* Such a request runs under the session's identity but is a DIFFERENT
|
|
652
|
+
* conversation, so its usage must not be filed under the session: the
|
|
653
|
+
* rolling cache ratio would then describe a prompt the session never sent.
|
|
654
|
+
*/
|
|
655
|
+
sideChannel: boolean;
|
|
656
|
+
/** Actual pooled account behind this response, retained through terminal events. */
|
|
657
|
+
accountId?: string;
|
|
658
|
+
/** Bounded guard evidence; never includes the tool argument payload. */
|
|
659
|
+
toolGuard?: NonNullable<KimiCodeRequestDiagnostic['toolGuard']>;
|
|
660
|
+
}
|
|
661
|
+
export declare function createStreamState(wire: KimiCodeWire, sessionId?: string, sideChannel?: boolean): KimiCodeStreamState;
|
|
662
|
+
/** Feed one SSE `data:` payload from `/chat/completions`. */
|
|
663
|
+
export declare function processOpenAIStreamLine(line: string, state: KimiCodeStreamState): StreamChunk[];
|
|
664
|
+
/** Feed one SSE `data:` payload from `/v1/messages`. */
|
|
665
|
+
export declare function processAnthropicStreamLine(line: string, state: KimiCodeStreamState): StreamChunk[];
|
|
666
|
+
/**
|
|
667
|
+
* The prefix-breaking inputs of the previous request, kept so a cache miss can
|
|
668
|
+
* be attributed to the change that caused it rather than guessed at.
|
|
669
|
+
*
|
|
670
|
+
* kimi-code's own agent tracks exactly this pair (its `systemPromptHash` /
|
|
671
|
+
* `toolsHash` telemetry) for the same reason: a bare hit ratio cannot say
|
|
672
|
+
* *why* a turn went cold, but a diff of the stability inputs can.
|
|
673
|
+
*/
|
|
674
|
+
export interface PrefixStabilitySnapshot {
|
|
675
|
+
systemPromptHash: string | null;
|
|
676
|
+
toolsHash: string | null;
|
|
677
|
+
cacheKey: string | null;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Which stability input changed relative to the previous request, if any.
|
|
681
|
+
*
|
|
682
|
+
* `'stable'` means the prefix should have held; a miss then points at the
|
|
683
|
+
* service or at content below the head. Anything else names the input that
|
|
684
|
+
* broke the prefix. `'cold-key'` means no cache key was sent, so the request
|
|
685
|
+
* could not be routed to the warm entry at all.
|
|
686
|
+
*/
|
|
687
|
+
export type PrefixDriftCause = 'first-request' | 'stable' | 'system-prompt' | 'tools' | 'cache-key' | 'cold-key' | 'image-offload';
|
|
688
|
+
/**
|
|
689
|
+
* The prefix-breaking inputs of one request, hashed.
|
|
690
|
+
*
|
|
691
|
+
* Two requests that share these hashes address the same cached prefix, so the
|
|
692
|
+
* hashes are also what groups requests that must not start a cold prefix at
|
|
693
|
+
* the same time. Exposed for that reason; the values are the same ones
|
|
694
|
+
* {@link trackPrefixStability} diffs.
|
|
695
|
+
*/
|
|
696
|
+
export interface PrefixFingerprints {
|
|
697
|
+
/** Hash of the system prompt, or null when the request carries none. */
|
|
698
|
+
readonly systemPromptHash: string | null;
|
|
699
|
+
/** Hash of the tool list, or null when the request carries no tools. */
|
|
700
|
+
readonly toolsHash: string | null;
|
|
701
|
+
/** Hash of leading workspace-static bootstrap reminders (Tiers 2–3), when present. */
|
|
702
|
+
readonly staticPrefixHash?: string | null;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Hash the prefix-breaking inputs of one request.
|
|
706
|
+
*
|
|
707
|
+
* @param options - The request about to be built.
|
|
708
|
+
* @returns The hashes of its system prompt, tool list, and optional static bootstrap prefix.
|
|
709
|
+
*/
|
|
710
|
+
export declare function prefixFingerprints(options: GenerateOptions): PrefixFingerprints;
|
|
711
|
+
/**
|
|
712
|
+
* Fingerprint the current request's stability inputs and diff them against the
|
|
713
|
+
* last request. Called once per request build; the result is read back when the
|
|
714
|
+
* stream reports usage so a low-or-zero cache read can be explained.
|
|
715
|
+
*/
|
|
716
|
+
export declare function trackPrefixStability(options: GenerateOptions): PrefixDriftCause;
|
|
717
|
+
/**
|
|
718
|
+
* Record the cause computed for one in-flight request.
|
|
719
|
+
*
|
|
720
|
+
* The options are optional and only used to recognise a side-channel request:
|
|
721
|
+
* a title request carries its own prefix, so attributing it to the session
|
|
722
|
+
* would blame the session's next cache miss on the title request's system
|
|
723
|
+
* prompt or on its (absent) tool list.
|
|
724
|
+
*/
|
|
725
|
+
export declare function recordDriftCause(cause: PrefixDriftCause, sessionId?: string, options?: GenerateOptions): void;
|
|
726
|
+
/**
|
|
727
|
+
* The cause attributed to the most recent request of one session.
|
|
728
|
+
*
|
|
729
|
+
* `undefined` for a session that has not made a request, rather than a default
|
|
730
|
+
* value: an absent attribution and an unattributed first request are different
|
|
731
|
+
* facts, and the caller can only tell them apart if absence is expressible.
|
|
732
|
+
*/
|
|
733
|
+
export declare function getLastDriftCause(sessionId?: string): PrefixDriftCause | undefined;
|
|
734
|
+
/**
|
|
735
|
+
* What one session's last request carried of images.
|
|
736
|
+
*/
|
|
737
|
+
export interface KimiCodeSessionImageBudgetStats {
|
|
738
|
+
/** Base64 image bytes the most recent request carried. */
|
|
739
|
+
requestImageBytes: number;
|
|
740
|
+
/** Image occurrences the most recent request replaced with a placeholder. */
|
|
741
|
+
droppedImages: number;
|
|
742
|
+
/** Every image identity this session has dropped so far. */
|
|
743
|
+
droppedKeys: string[];
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* The image identities this session has already dropped.
|
|
747
|
+
*
|
|
748
|
+
* `durableDropped` seeds the memory the first time a session is asked about,
|
|
749
|
+
* so a session that ran before the restart keeps the omissions it made: the
|
|
750
|
+
* budget is sticky, and a picture that was given back must stay given back.
|
|
751
|
+
*/
|
|
752
|
+
export declare function getSessionDroppedImageKeys(sessionId?: string, durableDropped?: readonly string[]): ReadonlySet<string>;
|
|
753
|
+
/**
|
|
754
|
+
* Note that the request being built has dropped images, before its body is built.
|
|
755
|
+
*
|
|
756
|
+
* The drift attribution reads this back when the prefix is fingerprinted, so
|
|
757
|
+
* the order of the two does not matter: a request that drops an image is
|
|
758
|
+
* attributed to the offload whether the body was built before or after the
|
|
759
|
+
* drop was recorded.
|
|
760
|
+
*/
|
|
761
|
+
export declare function markPendingImageOffload(sessionId: string | undefined, newlyDroppedCount: number): void;
|
|
762
|
+
/**
|
|
763
|
+
* Record what one request's image budget did.
|
|
764
|
+
*
|
|
765
|
+
* The dropped identities are kept for the whole session: the budget is sticky,
|
|
766
|
+
* so an image given back stays given back, and the next turn has to know
|
|
767
|
+
* which ones those are.
|
|
768
|
+
*/
|
|
769
|
+
export declare function recordSessionImageBudget(sessionId: string | undefined, input: {
|
|
770
|
+
allDroppedKeys: Iterable<string>;
|
|
771
|
+
newlyDroppedCount: number;
|
|
772
|
+
requestImageBytes: number;
|
|
773
|
+
droppedImages: number;
|
|
774
|
+
}, options?: GenerateOptions): void;
|
|
775
|
+
/**
|
|
776
|
+
* What one session's last request carried of images, when it is known.
|
|
777
|
+
*
|
|
778
|
+
* `undefined` for a session that has not sent a request, rather than a zeroed
|
|
779
|
+
* answer: "no request yet" and "a request that carried no images" are
|
|
780
|
+
* different facts.
|
|
781
|
+
*/
|
|
782
|
+
export declare function getSessionImageBudgetStats(sessionId?: string): KimiCodeSessionImageBudgetStats | undefined;
|
|
783
|
+
/**
|
|
784
|
+
* One request whose disabled-thinking level had to be raised.
|
|
785
|
+
*
|
|
786
|
+
* The service answers HTTP 400 for "thinking off" on a model that cannot stop
|
|
787
|
+
* reasoning, and the user's real intent there is "spend less", not "fail the
|
|
788
|
+
* turn" — so the latch lifts the level to the model's own default (see
|
|
789
|
+
* coerceThinkingEffort). Lifting it silently would spend more quota than was
|
|
790
|
+
* asked for with nothing saying why, which is why the lift is both RECORDED here
|
|
791
|
+
* (so a caller can read it back per session, the way the drift cause is read
|
|
792
|
+
* back) and ANNOUNCED on the process warning channel.
|
|
793
|
+
*/
|
|
794
|
+
export interface KimiCodeThinkingCoercion {
|
|
795
|
+
/** Model whose declaration forbade the requested level. */
|
|
796
|
+
model: string;
|
|
797
|
+
/** Wire the request was built for, since the gate runs for both. */
|
|
798
|
+
wire: KimiCodeWire;
|
|
799
|
+
/** The level that could not be sent. Only 'none' is ever lifted. */
|
|
800
|
+
from: 'none';
|
|
801
|
+
/** The level actually sent; undefined means "no level at all". */
|
|
802
|
+
to: KimiCodeReasoningEffort | undefined;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Record one lift, and make it visible.
|
|
806
|
+
*
|
|
807
|
+
* `process.emitWarning` rather than a thrown error or a silently swallowed
|
|
808
|
+
* value: the request must still go out (that is the whole point of the lift),
|
|
809
|
+
* but a diagnostic that reaches stderr with a stable code is what keeps it from
|
|
810
|
+
* being invisible. It is emitted once per turn, and only for a model that
|
|
811
|
+
* actually declares thinking-only, so a deployment that never asks for 'none'
|
|
812
|
+
* never sees one.
|
|
813
|
+
*/
|
|
814
|
+
export declare function recordThinkingCoercion(coercion: KimiCodeThinkingCoercion, sessionId?: string): void;
|
|
815
|
+
/**
|
|
816
|
+
* The lift recorded for one session, if any.
|
|
817
|
+
*
|
|
818
|
+
* `undefined` for a session that never asked for a disabled level, rather than a
|
|
819
|
+
* default value: "no lift happened" and "a lift happened to the same value" are
|
|
820
|
+
* different facts and only the absent case can say the first.
|
|
821
|
+
*/
|
|
822
|
+
export declare function getLastThinkingCoercion(sessionId?: string): KimiCodeThinkingCoercion | undefined;
|
|
823
|
+
/**
|
|
824
|
+
* Response headers that split a cache write across its two TTL tiers.
|
|
825
|
+
*
|
|
826
|
+
* The service states the write TOTAL in 'usage' and the per-tier split only in
|
|
827
|
+
* these headers, so the split has to be read off the HTTP response — there is no
|
|
828
|
+
* body field for it. Both are decimal integers; a missing or non-numeric value
|
|
829
|
+
* means the header said nothing, which is recorded as 0 rather than guessed at
|
|
830
|
+
* (see KimiCodeCacheStatsDto.cacheWrite5mTokens: an absent header is silence,
|
|
831
|
+
* not a claim that nothing was written to that tier).
|
|
832
|
+
*/
|
|
833
|
+
export declare const CACHE_WRITE_5M_HEADER = "Msh-Usage-Cache-Write-Tokens-5m";
|
|
834
|
+
export declare const CACHE_WRITE_1H_HEADER = "Msh-Usage-Cache-Write-Tokens-1h";
|
|
835
|
+
/** The two tier counts one response's headers state. */
|
|
836
|
+
export declare function cacheWriteTiers(headers: Headers): {
|
|
837
|
+
write5m: number;
|
|
838
|
+
write1h: number;
|
|
839
|
+
};
|
|
840
|
+
/**
|
|
841
|
+
* File one response's tier counts on the stream state that will close it.
|
|
842
|
+
*
|
|
843
|
+
* Called by the adapter on the Response itself, which is the only place the
|
|
844
|
+
* headers exist; the totals are then filed with the rest of the usage when the
|
|
845
|
+
* stream closes, so one turn's numbers stay one turn's numbers.
|
|
846
|
+
*/
|
|
847
|
+
export declare function applyCacheWriteTiers(state: KimiCodeStreamState, headers: Headers): void;
|
|
848
|
+
/**
|
|
849
|
+
* Rolling per-process view of how well the prefix cache is working.
|
|
850
|
+
*
|
|
851
|
+
* Kimi's cache is automatic and content-hash based, so the only way to know
|
|
852
|
+
* whether a session is actually benefiting is to watch the read ratio. It is a
|
|
853
|
+
* diagnostic: nothing here changes a request.
|
|
854
|
+
*/
|
|
855
|
+
export interface KimiCodeCacheStats {
|
|
856
|
+
/** Requests that reported usage. */
|
|
857
|
+
requests: number;
|
|
858
|
+
/** Prompt tokens that were served from cache. */
|
|
859
|
+
cachedTokens: number;
|
|
860
|
+
/** Prompt tokens that had to be processed fresh. */
|
|
861
|
+
freshTokens: number;
|
|
862
|
+
/** Output tokens, which reasoning is billed against. */
|
|
863
|
+
outputTokens: number;
|
|
864
|
+
/**
|
|
865
|
+
* Prompt tokens the provider counted as cache writes.
|
|
866
|
+
*
|
|
867
|
+
* Reported by both wires this line speaks: `cache_creation_input_tokens` on
|
|
868
|
+
* the Anthropic surface and `prompt_tokens_details.cache_write_tokens` on
|
|
869
|
+
* chat-completions. Never derived from the read count — a write is a
|
|
870
|
+
* different billed event.
|
|
871
|
+
*/
|
|
872
|
+
cacheWriteTokens: number;
|
|
873
|
+
/** Share of the writes above the service attributed to the 5m tier (headers). */
|
|
874
|
+
cacheWrite5mTokens: number;
|
|
875
|
+
/** Share of the writes above the service attributed to the 1h tier (headers). */
|
|
876
|
+
cacheWrite1hTokens: number;
|
|
877
|
+
/**
|
|
878
|
+
* Whether ANY request behind these totals stated a cache-write count.
|
|
879
|
+
*
|
|
880
|
+
* A live probe of both wires this line speaks found the write field absent
|
|
881
|
+
* rather than zero on chat-completions (`prompt_tokens_details` carries
|
|
882
|
+
* `cached_tokens` and nothing else), while the Anthropic surface states
|
|
883
|
+
* `cache_creation_input_tokens: 0` explicitly. So a zero total means one of
|
|
884
|
+
* two different things and only this flag tells them apart: "the service
|
|
885
|
+
* reported zero writes" versus "the service never answered". Rendering the
|
|
886
|
+
* second as 0 turns silence into a measurement — exactly what a cost card
|
|
887
|
+
* must not do.
|
|
888
|
+
*/
|
|
889
|
+
cacheWriteReported: boolean;
|
|
890
|
+
}
|
|
891
|
+
/** Record one request's usage into its own session's totals. */
|
|
892
|
+
export declare function recordCacheStats(state: KimiCodeStreamState, sessionId?: string, accountId?: string): void;
|
|
893
|
+
/**
|
|
894
|
+
* Totals for one account's share of a session, one whole session, or every
|
|
895
|
+
* tracked session.
|
|
896
|
+
*
|
|
897
|
+
* The three cases are not a convenience: each answers a different question a
|
|
898
|
+
* caller actually has. Naming an account answers "is this account's cache
|
|
899
|
+
* warm", naming only a session answers "how is this conversation doing
|
|
900
|
+
* overall", and naming neither answers "how is this install doing". Summing
|
|
901
|
+
* the per-scope entries rather than keeping a second running total means the
|
|
902
|
+
* aggregate can never drift out of step with the parts it summarises.
|
|
903
|
+
*/
|
|
904
|
+
export declare function getCacheStats(sessionId?: string, accountId?: string): KimiCodeCacheStats & {
|
|
905
|
+
hitRatio: number | null;
|
|
906
|
+
};
|
|
907
|
+
/** Forget one session's numbers, or all of them. Test seam and session teardown. */
|
|
908
|
+
export declare function resetCacheStats(sessionId?: string): void;
|
|
909
|
+
/** Flush every open block, then emit usage and the terminal finish. */
|
|
910
|
+
export declare function closeStream(state: KimiCodeStreamState, accountId?: string): StreamChunk[];
|
|
911
|
+
/** Model families whose stream never carried a terminal event. */
|
|
912
|
+
export declare function assertStreamComplete(state: KimiCodeStreamState): void;
|
|
913
|
+
//# sourceMappingURL=mapper.d.ts.map
|