@eddyskywalker/dsh-chatgpt-subscription 0.80.5 → 0.81.3
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 +69 -0
- package/README.md +17 -7
- package/lib/aws-quick-mcp.js +54 -0
- package/lib/client.js +4232 -2203
- package/lib/client.js.map +1 -1
- package/lib/entry-plan-mode-pipeline-BCAZPcOz.js +433 -0
- package/lib/entry-tool-result-pruner-DY67oa5d.js +545 -0
- package/lib/index.js +64969 -58737
- package/lib/plan-mode-pipeline.js +1 -432
- package/lib/tool-result-pruner.js +1 -404
- package/lib/types/client/aws-quick/AwsQuickSection.d.ts +8 -0
- package/lib/types/client/aws-quick/AwsQuickSection.d.ts.map +1 -0
- package/lib/types/client/aws-quick/api.d.ts +11 -0
- package/lib/types/client/aws-quick/api.d.ts.map +1 -0
- package/lib/types/client/aws-quick/locales.d.ts +117 -0
- package/lib/types/client/aws-quick/locales.d.ts.map +1 -0
- package/lib/types/client/aws-quick/styles.d.ts +2 -0
- package/lib/types/client/aws-quick/styles.d.ts.map +1 -0
- package/lib/types/client/claude/ClaudeSection.d.ts.map +1 -1
- package/lib/types/client/claude/locales.d.ts +17 -5
- package/lib/types/client/claude/locales.d.ts.map +1 -1
- package/lib/types/client/claude/useClaudeSection.d.ts +2 -0
- package/lib/types/client/claude/useClaudeSection.d.ts.map +1 -1
- 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/command-code/locales.d.ts +2 -2
- package/lib/types/client/glm-coding-plan/locales.d.ts +2 -2
- package/lib/types/client/hub/HubOverview.d.ts +2 -0
- package/lib/types/client/hub/HubOverview.d.ts.map +1 -1
- package/lib/types/client/hub/brand-icons.d.ts +1 -1
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
- package/lib/types/client/hub/hub-styles.d.ts.map +1 -1
- package/lib/types/client/hub/providers.d.ts +3 -0
- package/lib/types/client/hub/providers.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +4 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +29 -2
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/kimi-code/styles.d.ts.map +1 -1
- package/lib/types/client/locales-ru/aws-quick.d.ts +3 -0
- package/lib/types/client/locales-ru/aws-quick.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.map +1 -1
- package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
- package/lib/types/client/locales-ru/index.d.ts.map +1 -1
- package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +21 -3
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/minimax-code/locales.d.ts +2 -2
- package/lib/types/client/progress-updates/locales.d.ts +3 -3
- package/lib/types/client/qianwen-token-plan/locales.d.ts +1 -1
- package/lib/types/client/qoder/locales.d.ts +1 -1
- package/lib/types/client/relayone/locales.d.ts +1 -1
- package/lib/types/client/step-code/locales.d.ts +2 -2
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/entry-tool-result-pruner.d.ts.map +1 -1
- package/lib/types/host/aws-quick/adapter.d.ts +35 -0
- package/lib/types/host/aws-quick/adapter.d.ts.map +1 -0
- package/lib/types/host/aws-quick/binary.d.ts +3 -0
- package/lib/types/host/aws-quick/binary.d.ts.map +1 -0
- package/lib/types/host/aws-quick/client.d.ts +76 -0
- package/lib/types/host/aws-quick/client.d.ts.map +1 -0
- package/lib/types/host/aws-quick/execution-broker.d.ts +25 -0
- package/lib/types/host/aws-quick/execution-broker.d.ts.map +1 -0
- package/lib/types/host/aws-quick/images.d.ts +21 -0
- package/lib/types/host/aws-quick/images.d.ts.map +1 -0
- package/lib/types/host/aws-quick/outpost.d.ts +55 -0
- package/lib/types/host/aws-quick/outpost.d.ts.map +1 -0
- package/lib/types/host/aws-quick/protocol.d.ts +34 -0
- package/lib/types/host/aws-quick/protocol.d.ts.map +1 -0
- package/lib/types/host/aws-quick/routes.d.ts +15 -0
- package/lib/types/host/aws-quick/routes.d.ts.map +1 -0
- package/lib/types/host/aws-quick/settings.d.ts +24 -0
- package/lib/types/host/aws-quick/settings.d.ts.map +1 -0
- package/lib/types/host/aws-quick/tool-bridge.d.ts +39 -0
- package/lib/types/host/aws-quick/tool-bridge.d.ts.map +1 -0
- package/lib/types/host/aws-quick/types.d.ts +12 -0
- package/lib/types/host/aws-quick/types.d.ts.map +1 -0
- package/lib/types/host/claude/adapter.d.ts +19 -1
- package/lib/types/host/claude/adapter.d.ts.map +1 -1
- package/lib/types/host/claude/client.d.ts +22 -20
- package/lib/types/host/claude/client.d.ts.map +1 -1
- package/lib/types/host/claude/mapper.d.ts +37 -16
- package/lib/types/host/claude/mapper.d.ts.map +1 -1
- package/lib/types/host/claude/model-catalog.d.ts +9 -1
- package/lib/types/host/claude/model-catalog.d.ts.map +1 -1
- package/lib/types/host/claude/routes.d.ts +3 -0
- package/lib/types/host/claude/routes.d.ts.map +1 -1
- package/lib/types/host/claude/token-store.d.ts +10 -0
- package/lib/types/host/claude/token-store.d.ts.map +1 -1
- package/lib/types/host/claude/types.d.ts +2 -2
- package/lib/types/host/claude/types.d.ts.map +1 -1
- package/lib/types/host/claude-api/adapter.d.ts +74 -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-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/codex-catalog.d.ts +4 -0
- package/lib/types/host/codex-catalog.d.ts.map +1 -1
- 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/common/brand-compat.d.ts +2 -0
- package/lib/types/host/common/brand-compat.d.ts.map +1 -1
- package/lib/types/host/common/cache-activity.d.ts +3 -1
- package/lib/types/host/common/cache-activity.d.ts.map +1 -1
- package/lib/types/host/common/capabilities.d.ts.map +1 -1
- 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 +20 -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/i18n/en.d.ts.map +1 -1
- package/lib/types/host/common/i18n/provider-name.d.ts.map +1 -1
- package/lib/types/host/common/i18n/ru.d.ts.map +1 -1
- package/lib/types/host/common/i18n/zh.d.ts +2 -0
- package/lib/types/host/common/i18n/zh.d.ts.map +1 -1
- package/lib/types/host/common/model-request-control.d.ts +1 -1
- package/lib/types/host/common/model-request-control.d.ts.map +1 -1
- package/lib/types/host/common/prompt-cache-policy.d.ts +4 -0
- package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
- package/lib/types/host/compaction-policy-guard.d.ts +7 -0
- package/lib/types/host/compaction-policy-guard.d.ts.map +1 -1
- package/lib/types/host/kimi-code/account-pool.d.ts +11 -0
- package/lib/types/host/kimi-code/account-pool.d.ts.map +1 -1
- 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-wait.d.ts +20 -3
- package/lib/types/host/kimi-code/cache-wait.d.ts.map +1 -1
- package/lib/types/host/kimi-code/oauth.d.ts.map +1 -1
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/kimi-code/token-store.d.ts +13 -0
- package/lib/types/host/kimi-code/token-store.d.ts.map +1 -1
- package/lib/types/host/model-catalog.d.ts.map +1 -1
- package/lib/types/host/responses-client.d.ts +5 -1
- package/lib/types/host/responses-client.d.ts.map +1 -1
- package/lib/types/host/responses-mapper.d.ts +5 -0
- package/lib/types/host/responses-mapper.d.ts.map +1 -1
- package/lib/types/index.d.ts +7 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/aws-quick-contracts.d.ts +61 -0
- package/lib/types/shared/aws-quick-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 +6 -0
- package/lib/types/shared/claude-contracts.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +1 -1
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +5 -0
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/model-catalog.d.ts +6 -0
- package/lib/types/shared/model-catalog.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -54,6 +54,7 @@ import { type BeginLoginOptions } from './oauth.ts';
|
|
|
54
54
|
import { claudeCodeCredentialPaths, claudeCodeCredentialPresence } from './adopt.ts';
|
|
55
55
|
import { DEFAULT_CONTEXT_WINDOW, PROVIDER_ID, PROVIDER_NAME } from './types.ts';
|
|
56
56
|
import type { ClaudeAccountPool } from './account-pool.ts';
|
|
57
|
+
import type { ClaudeCodeVersionResolver } from '../common/claude-code-version.ts';
|
|
57
58
|
import { type ClaudeModelOption, type ClaudeWebStatus,
|
|
58
59
|
/** The shared declaration, imported under its own name so it can be re-exported below. */
|
|
59
60
|
type ClaudeAccountSummaryDto } from '../../shared/claude-contracts.ts';
|
|
@@ -74,6 +75,8 @@ export declare function resolveEnabledModelIds(stored: readonly string[], availa
|
|
|
74
75
|
export declare function buildClaudeModelOptions(catalog: readonly ClaudeModelEntry[], available: readonly string[], enabledModelIds: readonly string[], overrides: Record<string, number>): ClaudeModelOption[];
|
|
75
76
|
export interface ClaudeStatusOptions {
|
|
76
77
|
fetchFn?: typeof fetch;
|
|
78
|
+
/** Shared Claude Code version used by the Messages connectivity probe. */
|
|
79
|
+
version?: ClaudeCodeVersionResolver;
|
|
77
80
|
/** Whether this plugin currently owns the provider route; re-read on every status. */
|
|
78
81
|
serving?: boolean | (() => boolean);
|
|
79
82
|
/** Diagnostic when another plugin owns the provider route; re-read on every status. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,EAE3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAWL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAEhB,cAAc,EAGf,MAAM,aAAa,CAAA;AACpB,OAAO,EAML,KAAK,iBAAiB,EAGvB,MAAM,YAAY,CAAA;AACnB,OAAO,EAEL,yBAAyB,EACzB,4BAA4B,EAE7B,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,aAAa,EAEd,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EASL,KAAK,iBAAiB,EAGtB,KAAK,eAAe;AACpB,0FAA0F;AAC1F,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AAKzC,sDAAsD;AACtD,eAAO,MAAM,YAAY,gBAAgB,CAAA;AAwCzC;;;;;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GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,mBAAmB,EAC1B,aAAa,EAAE,sBAAsB,EACrC,WAAW,CAAC,EAAE,qBAAqB,EACnC,OAAO,GAAE,mBAAwB,GAChC,MAAM,IAAI,CAkhBZ;AAiED,6FAA6F;AAC7F,wBAAgB,0BAA0B,IAAI;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAQnF;AAQD,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,KAAK,uBAAuB,GAC7B,CAAA"}
|
|
@@ -142,6 +142,12 @@ export interface ClaudeModelSettings {
|
|
|
142
142
|
enabledModelIds: string[];
|
|
143
143
|
contextWindowOverrides: Record<string, number>;
|
|
144
144
|
defaultReasoningEffort: string | null;
|
|
145
|
+
/** Send speed: fast on models whose catalog entry supports it. */
|
|
146
|
+
fastMode: boolean;
|
|
147
|
+
/** Permit first-party cache_touch for 1h main requests. Default off. */
|
|
148
|
+
cacheKeepalive: boolean;
|
|
149
|
+
/** Host-only install id used in metadata.user_id; never included in ClaudeWebStatus. */
|
|
150
|
+
deviceId: string;
|
|
145
151
|
/**
|
|
146
152
|
* Prompt-cache tier the line asks for. `null` means "follow the official
|
|
147
153
|
* subscription client", which is the one-hour tier while a plan is drawing
|
|
@@ -161,6 +167,8 @@ export interface ClaudeSettingsPatch {
|
|
|
161
167
|
/** `null` deletes one override and falls back to the catalog default. */
|
|
162
168
|
contextWindowOverrides?: ContextWindowOverridePatch;
|
|
163
169
|
defaultReasoningEffort?: string | null;
|
|
170
|
+
fastMode?: boolean;
|
|
171
|
+
cacheKeepalive?: boolean;
|
|
164
172
|
/** `null` restores the subscription default (the one-hour tier). */
|
|
165
173
|
cacheTtl?: ClaudeCacheTtl | null;
|
|
166
174
|
selectedAccountId?: string | null;
|
|
@@ -302,6 +310,8 @@ export declare class FileModelSettingsStore {
|
|
|
302
310
|
path(): string;
|
|
303
311
|
read(): Promise<ClaudeModelSettings>;
|
|
304
312
|
write(settings: ClaudeModelSettings): Promise<void>;
|
|
313
|
+
/** Generate the host-only metadata device id once, under the settings write lock. */
|
|
314
|
+
ensureDeviceId(): Promise<string>;
|
|
305
315
|
/**
|
|
306
316
|
* Read-modify-write under the same per-path lock the credentials use.
|
|
307
317
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/token-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAOH,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAA+B,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAA;AAMpH,iFAAiF;AACjF,eAAO,MAAM,4BAA4B,eAAe,CAAA;AAExD,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,QAAQ,CAAA;AAKvC,2EAA2E;AAC3E,eAAO,MAAM,4BAA4B,mBAAmB,CAAA;AAC5D,mDAAmD;AACnD,eAAO,MAAM,2BAA2B,IAAI,CAAA;AAK5C,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAA;IACnB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,SA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C;IAUvC;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAOzE;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,CAAC,EAAE,OAAO,EAClB,aAAa,yBAA+B,GAC3C,qBAAqB,CAkEvB"}
|
|
@@ -46,7 +46,7 @@ export declare const USAGE_PATH = "/api/oauth/usage";
|
|
|
46
46
|
*
|
|
47
47
|
* Overridable: see {@link oauthAuthorizeUrl}.
|
|
48
48
|
*/
|
|
49
|
-
export declare const OAUTH_AUTHORIZE_URL = "https://claude.
|
|
49
|
+
export declare const OAUTH_AUTHORIZE_URL = "https://claude.com/cai/oauth/authorize";
|
|
50
50
|
/** Token endpoint for both the authorization-code grant and refresh. */
|
|
51
51
|
export declare const OAUTH_TOKEN_URL = "https://platform.claude.com/v1/oauth/token";
|
|
52
52
|
/**
|
|
@@ -203,7 +203,7 @@ export declare const ANTHROPIC_VERSION = "2023-06-01";
|
|
|
203
203
|
* to raise it without waiting for a release. Read the effective value with
|
|
204
204
|
* {@link claudeCliVersion}, pin one with {@link setClaudeCliVersion}.
|
|
205
205
|
*/
|
|
206
|
-
export declare const CLAUDE_CLI_VERSION = "2.1.
|
|
206
|
+
export declare const CLAUDE_CLI_VERSION = "2.1.330";
|
|
207
207
|
/**
|
|
208
208
|
* Loopback callback port the subscription flow defaults to.
|
|
209
209
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,uCAAuC;AACvC,eAAO,MAAM,WAAW,wBAAwB,CAAA;AAChD,kEAAkE;AAClE,eAAO,MA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;;;;;GAUG;AACH,eAAO,MAAM,UAAU;IACrB,qFAAqF;;IAErF,+EAA+E;;IAE/E,iFAAiF;;IAEjF,mFAAmF;;IAEnF,uEAAuE;;IAEvE,kDAAkD;;IAElD,+CAA+C;;IAE/C,mFAAmF;;CAE3E,CAAA;AAEV,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,gCAAgC,CAAA;AAE9E,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAA8B,CAAA;AAEvF,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAKD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAI9D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAIhF;AAoBD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAG1C;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,MAA8B,GAAG,MAAM,CAEhF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LlmAdapter, type GenerateOptions, type LlmProviderInfo, type LlmResolvedModelInfo, type PreparedAdapterCall, type ResolvedRetryPolicy, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
2
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
import { LlmError } from '../common/llm-compat.ts';
|
|
4
|
+
import { type AttachmentImageReader } from '../common/request-images.ts';
|
|
5
|
+
import type { PromptCacheOverride } from '../common/prompt-cache-policy.ts';
|
|
6
|
+
import { ClaudeApiCatalogManager } from './catalog-manager.ts';
|
|
7
|
+
import { ClaudeApiCredentialStore, ClaudeApiSettingsStore } from './token-store.ts';
|
|
8
|
+
import type { ClaudeApiClientVersionResolver } from './client-version.ts';
|
|
9
|
+
import type { ClaudeApiCompactionStore } from './compaction-store.ts';
|
|
10
|
+
import { ClaudeApiCapabilityMemory } from './capability-memory.ts';
|
|
11
|
+
import { PROVIDER_ID, PROVIDER_NAME } from './types.ts';
|
|
12
|
+
/** Model-level refusals ("'<model>' does not support ... compaction ...") describe the
|
|
13
|
+
* model and last for the process; parameter/beta-level refusals describe the endpoint,
|
|
14
|
+
* which may be upgraded, and expire after the TTL. */
|
|
15
|
+
export declare function claudeApiUnsupportedUntil(now: number, bodyText: string): number | null;
|
|
16
|
+
/** The verified "model does not support the speed parameter" refusal (any error envelope). */
|
|
17
|
+
export declare function isClaudeApiSpeedUnsupported(bodyText: string): boolean;
|
|
18
|
+
/** The verified "model rejects the system role inside messages" refusal. A placement
|
|
19
|
+
* error ("role 'system' must follow ...") is a request bug, NOT a model limitation. */
|
|
20
|
+
export declare function isClaudeApiSystemRoleUnsupported(bodyText: string): boolean;
|
|
21
|
+
/** The verified "speed needs the fast-mode beta header" refusal (any error envelope). */
|
|
22
|
+
export declare function isClaudeApiSpeedNeedsBeta(bodyText: string): boolean;
|
|
23
|
+
export interface ClaudeApiAdapterOptions {
|
|
24
|
+
fetchFn?: typeof fetch;
|
|
25
|
+
attachments?: AttachmentImageReader;
|
|
26
|
+
promptCache?: PromptCacheOverride;
|
|
27
|
+
version: ClaudeApiClientVersionResolver;
|
|
28
|
+
compactionStore: ClaudeApiCompactionStore;
|
|
29
|
+
capabilityMemory?: ClaudeApiCapabilityMemory;
|
|
30
|
+
}
|
|
31
|
+
interface ClassifiedError extends LlmError {
|
|
32
|
+
status?: number;
|
|
33
|
+
claudeApiStatus?: number;
|
|
34
|
+
claudeApiDetail?: string;
|
|
35
|
+
/** Redacted raw error body, so the compaction predicates can read code/type fields too. */
|
|
36
|
+
claudeApiBody?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function classifyClaudeApiResponse(response: Response, apiKey?: string): Promise<ClassifiedError>;
|
|
39
|
+
export declare class ClaudeApiAdapter extends LlmAdapter {
|
|
40
|
+
private readonly store;
|
|
41
|
+
private readonly settingsStore;
|
|
42
|
+
private readonly catalog;
|
|
43
|
+
private readonly options;
|
|
44
|
+
private readonly fetchFn;
|
|
45
|
+
private readonly capabilityMemory;
|
|
46
|
+
private readonly firstParty;
|
|
47
|
+
/** Endpoint-level compaction refusals (30 min, in memory only); model-level facts live in the capability memory. */
|
|
48
|
+
private readonly unsupported;
|
|
49
|
+
/** The effort each session's most recent MAIN turn resolved; null means "no effort sent". */
|
|
50
|
+
private readonly sessionEfforts;
|
|
51
|
+
constructor(store: ClaudeApiCredentialStore, settingsStore: ClaudeApiSettingsStore, catalog: ClaudeApiCatalogManager, options: ClaudeApiAdapterOptions);
|
|
52
|
+
providerInfo(provider: string): LlmProviderInfo;
|
|
53
|
+
providerRetryPolicy(): ResolvedRetryPolicy;
|
|
54
|
+
imageRequestPricing(): undefined;
|
|
55
|
+
imageRequestTarget(_provider: string, _model: string, image: ImageAttachmentRef): {
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
maxBytes: number;
|
|
59
|
+
};
|
|
60
|
+
listModels(provider?: string): Promise<readonly LlmResolvedModelInfo[]>;
|
|
61
|
+
resolveModel(provider: string, model: string, signal?: AbortSignal): Promise<LlmResolvedModelInfo>;
|
|
62
|
+
private modelInfo;
|
|
63
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;
|
|
64
|
+
stream(options: GenerateOptions): AsyncIterable<StreamChunk>;
|
|
65
|
+
private streamWithEntry;
|
|
66
|
+
private rememberSessionEffort;
|
|
67
|
+
private isUnsupported;
|
|
68
|
+
private markUnsupported;
|
|
69
|
+
private openRequest;
|
|
70
|
+
private pump;
|
|
71
|
+
private requestStream;
|
|
72
|
+
}
|
|
73
|
+
export { PROVIDER_ID, PROVIDER_NAME };
|
|
74
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGV,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,OAAO,EAAE,QAAQ,EAA4B,MAAM,yBAAyB,CAAA;AAG5E,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAQ3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAO9D,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAA0D,MAAM,kBAAkB,CAAA;AAC3I,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAGL,WAAW,EACX,aAAa,EAId,MAAM,YAAY,CAAA;AA8BnB;;sDAEsD;AACtD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,G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7F,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAmC;gBAE/C,KAAK,EAAE,wBAAwB,EAC/B,aAAa,EAAE,sBAAsB,EACrC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,uBAAuB;IAOnD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAG/C,mBAAmB,IAAI,mBAAmB;IAC1C,mBAAmB,IAAI,SAAS;IAChC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;;;;;IAIzE,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC;IAUvE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWxG,OAAO,CAAC,SAAS;IAoBX,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAM/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAMpD,eAAe;IAO9B,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,aAAa;YAQP,eAAe;YAMf,WAAW;YA2BV,IAAI;YAgCJ,aAAa;CAoO7B;AAED,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Compatibility exports for the API line; implementation is shared in common. */
|
|
2
|
+
export { ClaudeApiCapabilityMemory, ClaudeCapabilityMemory, claudeApiCapabilityMemoryPath, claudeCapabilityMemoryPath, parseClaudeApiCapabilityMemory, parseClaudeCapabilityMemory, serializeClaudeApiCapabilityMemory, serializeClaudeCapabilityMemory, CLAUDE_API_CAPABILITY_MEMORY_MAX_KEYS, CLAUDE_API_CAPABILITY_MEMORY_TTL_MS, CLAUDE_CAPABILITY_MEMORY_MAX_KEYS, CLAUDE_CAPABILITY_MEMORY_TTL_MS, } from '../common/claude-capability-memory.ts';
|
|
3
|
+
export type { ClaudeApiCapabilityFacts, ClaudeApiCapabilityRecord, ClaudeApiFastModeConclusion, ClaudeCapabilityFacts, ClaudeCapabilityRecord, ClaudeFastModeConclusion, } from '../common/claude-capability-memory.ts';
|
|
4
|
+
//# sourceMappingURL=capability-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-memory.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/capability-memory.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,kCAAkC,EAClC,+BAA+B,EAC/B,qCAAqC,EACrC,mCAAmC,EACnC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,uCAAuC,CAAA;AAC9C,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ClaudeApiCatalogDto } from '../../shared/claude-api-contracts.ts';
|
|
2
|
+
import { ClaudeApiClientVersionResolver } from './client-version.ts';
|
|
3
|
+
import { type ClaudeApiModelEntry } from './model-catalog.ts';
|
|
4
|
+
import { type ClaudeApiCredentialStore, type ClaudeApiSettingsStore } from './token-store.ts';
|
|
5
|
+
export interface ClaudeApiCatalogSnapshot {
|
|
6
|
+
entries: readonly ClaudeApiModelEntry[];
|
|
7
|
+
fetchedAt: number | null;
|
|
8
|
+
error: string | null;
|
|
9
|
+
state: ClaudeApiCatalogDto['state'];
|
|
10
|
+
credentialScope: string | null;
|
|
11
|
+
/** false while entries are the shipped fallback table rather than a listing this key produced. */
|
|
12
|
+
live: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ClaudeApiCatalogManagerOptions {
|
|
15
|
+
/** Supplies the client version the listing request reports. */
|
|
16
|
+
version: ClaudeApiClientVersionResolver;
|
|
17
|
+
fetchFn?: typeof fetch;
|
|
18
|
+
now?: () => number;
|
|
19
|
+
ttlMs?: number;
|
|
20
|
+
onChanged?: (entries: readonly ClaudeApiModelEntry[]) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Live, credential-and-endpoint-scoped model catalog with local-first rehydration.
|
|
24
|
+
*
|
|
25
|
+
* Before any listing this key produced, the catalog is the shipped fallback table
|
|
26
|
+
* and is reported as NOT live, so a user's whitelist never filters it away.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ClaudeApiCatalogManager {
|
|
29
|
+
private readonly store;
|
|
30
|
+
private readonly settingsStore;
|
|
31
|
+
private readonly version;
|
|
32
|
+
private readonly fetchFn;
|
|
33
|
+
private readonly now;
|
|
34
|
+
private readonly ttlMs;
|
|
35
|
+
private readonly onChanged;
|
|
36
|
+
private entries;
|
|
37
|
+
private fetchedAt;
|
|
38
|
+
private error;
|
|
39
|
+
private state;
|
|
40
|
+
private live;
|
|
41
|
+
private credentialScope;
|
|
42
|
+
private warmedScope;
|
|
43
|
+
private warming;
|
|
44
|
+
private refreshing;
|
|
45
|
+
private refreshScope;
|
|
46
|
+
private epoch;
|
|
47
|
+
constructor(store: ClaudeApiCredentialStore, settingsStore: ClaudeApiSettingsStore, options: ClaudeApiCatalogManagerOptions);
|
|
48
|
+
snapshot(): ClaudeApiCatalogSnapshot;
|
|
49
|
+
dto(): ClaudeApiCatalogDto;
|
|
50
|
+
reset(): void;
|
|
51
|
+
/** Local disk only. Returns the post-rehydration fingerprint, never the pre-warm one. */
|
|
52
|
+
warm(): Promise<string>;
|
|
53
|
+
startRefresh(force?: boolean): void;
|
|
54
|
+
/** Network refresh, deduplicated per credential scope. Never waits in warm(). */
|
|
55
|
+
refresh(force?: boolean): Promise<boolean>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=catalog-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-manager.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/catalog-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AAQ/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA;AAGzB,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAA;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,kGAAkG;IAClG,IAAI,EAAE,OAAO,CAAA;CACd;AAED,MAAM,WAAW,8BAA8B;IAC7C,+DAA+D;IAC/D,OAAO,EAAE,8BAA8B,CAAA;IACvC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,KAAK,IAAI,CAAA;CAC9D;AAOD;;;;;GAKG;AACH,qBAAa,uBAAuB;IAmBhC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAnBhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmD;IAC7E,OAAO,CAAC,OAAO,CAA6D;IAC5E,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,KAAK,CAAuC;IACpD,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,KAAK,CAAI;gBAGE,KAAK,EAAE,wBAAwB,EAC/B,aAAa,EAAE,sBAAsB,EACtD,OAAO,EAAE,8BAA8B;IASzC,QAAQ,IAAI,wBAAwB;IAWpC,GAAG,IAAI,mBAAmB;IAI1B,KAAK,IAAI,IAAI;IAcb,yFAAyF;IACzF,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAyDvB,YAAY,CAAC,KAAK,UAAQ,GAAG,IAAI;IAIjC,iFAAiF;IAC3E,OAAO,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAkE/C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Compatibility exports; the shared implementation lives in common/claude-code-version.ts. */
|
|
2
|
+
export { ClaudeApiClientVersionResolver, ClaudeCodeVersionResolver, ClaudeCodeVersionConfigurationError, claudeApiClientVersionPath, claudeCodeClientVersionPath, isClaudeApiCliVersion, isClaudeCodeCliVersion, parseClaudeApiClientVersion, parseClaudeCodeClientVersion, serializeClaudeApiClientVersion, serializeClaudeCodeClientVersion, setClaudeCodeVersionPin, } from '../common/claude-code-version.ts';
|
|
3
|
+
export type { ClaudeApiClientVersionOptions, ClaudeCodeLine, ClaudeCodeVersionOptions, ClaudeCodeVersionProfile, ClaudeCodeVersionSelection, PersistedClaudeApiClientVersion, PersistedClaudeCodeClientVersion, } from '../common/claude-code-version.ts';
|
|
4
|
+
//# sourceMappingURL=client-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-version.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/client-version.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,mCAAmC,EACnC,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,kCAAkC,CAAA;AACzC,YAAY,EACV,6BAA6B,EAC7B,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ClaudeApiConnectionDto } from '../../shared/claude-api-contracts.ts';
|
|
2
|
+
import { type ClaudeCodeFirstPartyContext } from '../common/claude-code-first-party.ts';
|
|
3
|
+
import { type ClaudeApiModelEntry } from './model-catalog.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Host I/O of the Claude API line: the official Claude Code header set, the
|
|
6
|
+
* paginated model listing and the explicit connectivity check.
|
|
7
|
+
*
|
|
8
|
+
* Every wire constant is imported from ./types.ts (capture-backed); this module
|
|
9
|
+
* only assembles requests and parses answers. See docs/claude-api-line-plan.md.
|
|
10
|
+
*/
|
|
11
|
+
export interface ClaudeApiHeadersInput {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
version: string;
|
|
14
|
+
sessionUuid: string;
|
|
15
|
+
betas: readonly string[];
|
|
16
|
+
firstParty?: ClaudeCodeFirstPartyContext;
|
|
17
|
+
/**
|
|
18
|
+
* Accepted so a caller can state its intent, but it does NOT change the header
|
|
19
|
+
* set: the captured client sends accept: application/json on stream:true
|
|
20
|
+
* requests too (both requests of test/fixtures/claude-api/request-2.1.330.json).
|
|
21
|
+
*/
|
|
22
|
+
stream?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Lower-case header names, exactly the captured set. */
|
|
25
|
+
export declare function buildClaudeApiHeaders(input: ClaudeApiHeadersInput): Record<string, string>;
|
|
26
|
+
export interface ClaudeApiErrorDetail {
|
|
27
|
+
message: string;
|
|
28
|
+
type: string | null;
|
|
29
|
+
code: string | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The three body shapes of the plan's "error body" section: the official
|
|
33
|
+
* {type,error:{message,type,details:{error_code}},request_id}, the gateway's
|
|
34
|
+
* {error:{message,type},type} and the bare {code,message}. The public message
|
|
35
|
+
* always carries the HTTP status and is redacted before it can reach a DTO.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseClaudeApiError(status: number, text: string, apiKey?: string): ClaudeApiErrorDetail;
|
|
38
|
+
export interface ClaudeApiListingInput {
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
apiKey: string;
|
|
41
|
+
version: string;
|
|
42
|
+
fetchFn: typeof fetch;
|
|
43
|
+
signal?: AbortSignal;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* GET <baseUrl>/v1/models?limit=1000, following has_more/last_id with after_id.
|
|
47
|
+
* The page cap bounds a gateway that always answers has_more:true; ids are
|
|
48
|
+
* de-duplicated across pages because a cursor may repeat the boundary row.
|
|
49
|
+
*/
|
|
50
|
+
export declare function listClaudeApiModels(input: ClaudeApiListingInput): Promise<ClaudeApiModelEntry[]>;
|
|
51
|
+
/** Explicit connectivity check through the real listing, never a paid generation. Never throws. */
|
|
52
|
+
export declare function testClaudeApiConnection(input: ClaudeApiListingInput & {
|
|
53
|
+
now?: () => number;
|
|
54
|
+
}): Promise<ClaudeApiConnectionDto>;
|
|
55
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAClF,OAAO,EAA+B,KAAK,2BAA2B,EAAE,MAAM,sCAAsC,CAAA;AACpH,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAazF;;;;;;GAMG;AAEH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,2BAA2B,CAAA;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,yDAAyD;AACzD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB1F;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AASD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAcvG;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,KAAK,CAAA;IACrB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAKD;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA+BtG;AAED,mGAAmG;AACnG,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAepI"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistence for server-compaction blocks of the claude-api line. A block is keyed by
|
|
3
|
+
* the SHA-256 of its TRIMMED content, so a checkpoint summary that was edited by even
|
|
4
|
+
* one character is not found and the request falls back to the text form. The file is
|
|
5
|
+
* owner-only (0600), capped at 200 entries and 30 days, and written atomically.
|
|
6
|
+
*
|
|
7
|
+
* The writer/reader pair (serializeClaudeApiCompactionBlocks / parseClaudeApiCompactionBlocks)
|
|
8
|
+
* is the whole persistence contract and is tested as a pair through the production writer.
|
|
9
|
+
*/
|
|
10
|
+
/** One stored compaction block, exactly as the wire sent it plus provenance. */
|
|
11
|
+
export interface StoredBlock {
|
|
12
|
+
content: string;
|
|
13
|
+
signature: string;
|
|
14
|
+
toolChanges?: unknown;
|
|
15
|
+
model: string;
|
|
16
|
+
createdAt: number;
|
|
17
|
+
/** Credential fingerprint + endpoint this block was produced against; absent on legacy entries. */
|
|
18
|
+
scope?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const CLAUDE_API_COMPACTION_MAX_ENTRIES = 200;
|
|
21
|
+
export declare const CLAUDE_API_COMPACTION_MAX_AGE_MS: number;
|
|
22
|
+
export declare function claudeApiCompactionBlocksPath(): string;
|
|
23
|
+
/** The storage key of one summary: SHA-256 of the trimmed content, hex. */
|
|
24
|
+
export declare function compactionBlockKey(summary: string): string;
|
|
25
|
+
/** Writer half: the on-disk document for one key->block table. */
|
|
26
|
+
export declare function serializeClaudeApiCompactionBlocks(blocks: Readonly<Record<string, StoredBlock>>): string;
|
|
27
|
+
/**
|
|
28
|
+
* Reader half: the inverse of serializeClaudeApiCompactionBlocks after JSON.parse.
|
|
29
|
+
* Damaged entries are dropped, and an entry whose key does not match its content is
|
|
30
|
+
* dropped too (the key IS the integrity check).
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseClaudeApiCompactionBlocks(value: unknown): Record<string, StoredBlock>;
|
|
33
|
+
export declare class ClaudeApiCompactionStore {
|
|
34
|
+
private readonly filePath;
|
|
35
|
+
private readonly now;
|
|
36
|
+
private blocks;
|
|
37
|
+
private warmed;
|
|
38
|
+
private writeSequence;
|
|
39
|
+
constructor(filePath?: string, now?: () => number);
|
|
40
|
+
path(): string;
|
|
41
|
+
/** Load the persisted table once. A missing or damaged file is simply "nothing stored". */
|
|
42
|
+
warm(): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Synchronous, from memory: the adapter warms the store at startup. A block is returned
|
|
45
|
+
* only for the SAME scope (credential fingerprint + endpoint) it was stored under;
|
|
46
|
+
* entries without a scope are never found. The model is deliberately not part of the
|
|
47
|
+
* match: upstream accepts a block on another model that supports compaction.
|
|
48
|
+
*/
|
|
49
|
+
lookup(summary: string, scope: string): StoredBlock | undefined;
|
|
50
|
+
remember(block: {
|
|
51
|
+
content: string;
|
|
52
|
+
signature: string;
|
|
53
|
+
toolChanges?: unknown;
|
|
54
|
+
model: string;
|
|
55
|
+
scope: string;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
/** Removes only the entry of this scope; another scope's block survives. */
|
|
58
|
+
forget(summary: string, scope: string): Promise<void>;
|
|
59
|
+
private prune;
|
|
60
|
+
private persist;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=compaction-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction-store.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/compaction-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,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AAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAcjI,4EAA4E;IACtE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS3D,OAAO,CAAC,KAAK;YAQC,OAAO;CAatB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side compaction for the claude-api line (spec: docs/claude-api-line-plan.md,
|
|
3
|
+
* server compaction section). The request is built THROUGH buildClaudeApiRequest so system, tools,
|
|
4
|
+
* cache markers and thinking are byte-identical to a main turn, then adjusted: the
|
|
5
|
+
* trailing directive message is stripped, context_management / stop_sequences /
|
|
6
|
+
* structured output / forced tool_choice are removed, compaction: { type: 'summarize',
|
|
7
|
+
* instructions } is added, and max_tokens is at least 8192.
|
|
8
|
+
*/
|
|
9
|
+
import type { GenerateOptions } from '../common/llm-compat.ts';
|
|
10
|
+
import type { ResolvedRequestImages } from '../common/request-images.ts';
|
|
11
|
+
import { type ClaudeApiRequestContext } from './mapper.ts';
|
|
12
|
+
/** The compaction engine's auxiliary call is the one with purpose 'compaction'. */
|
|
13
|
+
export declare function isClaudeApiCompactionRequest(options: GenerateOptions): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* A copy of the options without the trailing directive user message, or null when the
|
|
16
|
+
* last message is not that directive. The directive is recognized by the FIRST LINE of
|
|
17
|
+
* either the shipped instruction or this repo's replacement (both exported by
|
|
18
|
+
* src/host/compaction-prompt.ts); the harness may reword later sections without warning.
|
|
19
|
+
*/
|
|
20
|
+
export declare function stripClaudeApiCompactionDirective(options: GenerateOptions): GenerateOptions | null;
|
|
21
|
+
/**
|
|
22
|
+
* One compaction request. The shared mapper adds a wire-only user continuation when
|
|
23
|
+
* the stripped history ends in assistant content, because upstream rejects prefill.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildClaudeApiCompactionRequest(options: GenerateOptions, images: ResolvedRequestImages, context: ClaudeApiRequestContext): Record<string, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* A 400 about the compaction BLOCK itself - its content/signature or its placement.
|
|
28
|
+
* Such a block is stale or misplaced, not a missing capability: the caller forgets the
|
|
29
|
+
* stored summary and retries once. Co-usage errors (compaction + context_management)
|
|
30
|
+
* are request-shape problems and match neither predicate.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isClaudeApiCompactionBlockInvalid(status: number, bodyText: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether an upstream 400 is a real "server compaction not supported" signal: the
|
|
35
|
+
* compaction parameter refused as an unknown/extra input, an unexpected/unsupported
|
|
36
|
+
* anthropic-beta value naming compact-2026-09-04, or a message saying the model does
|
|
37
|
+
* not support compaction. Block-validity errors and the context_management co-usage
|
|
38
|
+
* error are explicitly NOT unsupported signals.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isClaudeApiCompactionUnsupported(status: number, bodyText: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The trimmed text between <compacted-summary> and </compacted-summary> (the marker
|
|
43
|
+
* the harness wraps a checkpoint in, see compaction-prompt.ts PRIOR_CHECKPOINT_OPEN_TAG),
|
|
44
|
+
* or null when the text carries no such block.
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractCheckpointSummary(text: string): string | null;
|
|
47
|
+
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/compaction.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAExE,OAAO,EAAyB,KAAK,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAUjF,mFAAmF;AACnF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAE9E;AAID;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,IAAI,CAQlG;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,uBAAuB,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAwBD;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3F;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAW1F;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIpE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure wire mapping for the claude-api line: DSH GenerateOptions -> the body of
|
|
3
|
+
* POST <baseUrl>/v1/messages?beta=true in the official Claude Code shape.
|
|
4
|
+
*
|
|
5
|
+
* SPEC: docs/claude-api-line-plan.md (request shape / beta rules / message mapping). Wire constants and
|
|
6
|
+
* the identity/billing/fingerprint functions are frozen in ./types.ts; per-model
|
|
7
|
+
* capabilities are frozen in ./model-catalog.ts. This module holds no credential,
|
|
8
|
+
* performs no I/O and is deterministic: the same (options, images, context) always
|
|
9
|
+
* produces the same body, byte for byte.
|
|
10
|
+
*
|
|
11
|
+
* Reference implementations read but NOT imported: relayone/mapper-anthropic.ts
|
|
12
|
+
* (closest template; it drops system/developer messages, this line must not) and
|
|
13
|
+
* claude/mapper.ts (system-in-place rule, tool changes, placeholder tool, cache
|
|
14
|
+
* breakpoints, signed-thinking replay).
|
|
15
|
+
*/
|
|
16
|
+
import type { GenerateOptions } from '../common/llm-compat.ts';
|
|
17
|
+
import { type ClaudeCodeFirstPartyContext } from '../common/claude-code-first-party.ts';
|
|
18
|
+
import { type ResolvedRequestImages } from '../common/request-images.ts';
|
|
19
|
+
import type { ClaudeApiModelEntry } from './model-catalog.ts';
|
|
20
|
+
import type { ClaudeApiSettings } from './token-store.ts';
|
|
21
|
+
/** Everything one request build needs beyond the options and the resolved images. */
|
|
22
|
+
export interface ClaudeApiRequestContext {
|
|
23
|
+
entry: ClaudeApiModelEntry;
|
|
24
|
+
settings: ClaudeApiSettings;
|
|
25
|
+
/** The ONE version this request reports: billing block and fingerprint share it (the UA is the adapter's job). */
|
|
26
|
+
version: string;
|
|
27
|
+
deviceId: string;
|
|
28
|
+
sessionUuid: string;
|
|
29
|
+
firstParty: ClaudeCodeFirstPartyContext;
|
|
30
|
+
/** Synchronous lookup of stored server-compaction blocks, keyed by summary text. */
|
|
31
|
+
compactionBlocks?: {
|
|
32
|
+
lookup(summary: string): {
|
|
33
|
+
content: string;
|
|
34
|
+
signature: string;
|
|
35
|
+
toolChanges?: unknown;
|
|
36
|
+
} | undefined;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The user's OWN first prompt text: the first non-reminder text block of the first user
|
|
41
|
+
* turn that carries one. Tool-result turns are skipped, and so are <system-reminder>
|
|
42
|
+
* blocks placed ahead of the user's text (the capture shows both in the first turn).
|
|
43
|
+
* CHOICE: a reminder-only user turn is skipped entirely and the scan continues, because
|
|
44
|
+
* DSH appends reminder-only records that contain no user text at all.
|
|
45
|
+
*/
|
|
46
|
+
export declare function claudeApiFirstUserText(options: GenerateOptions): string;
|
|
47
|
+
/** How many cache_control markers one built body carries (walks the bytes, not the marking calls). */
|
|
48
|
+
export declare function countClaudeApiCacheBreakpoints(body: unknown): number;
|
|
49
|
+
/**
|
|
50
|
+
* Build one main-turn Messages request body. Pure: no clock, no randomness, no I/O.
|
|
51
|
+
* The leading compact-checkpoint message is replaced by the stored compaction block
|
|
52
|
+
* when the context's lookup finds it; otherwise it keeps its text form.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildClaudeApiRequest(options: GenerateOptions, images: ResolvedRequestImages, context: ClaudeApiRequestContext): Record<string, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* The anthropic-beta list derived from the FINAL BODY (never from settings): the base
|
|
57
|
+
* set first, then the conditional betas in the spec table's order. A gateway silently
|
|
58
|
+
* strips unlicensed fields, so the header must follow the bytes.
|
|
59
|
+
*/
|
|
60
|
+
export declare function deriveClaudeApiBetas(body: Record<string, unknown>, entry: ClaudeApiModelEntry, thinkingTokenCount?: boolean): string[];
|
|
61
|
+
//# sourceMappingURL=mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAgB,eAAe,EAAW,MAAM,yBAAyB,CAAA;AAErF,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,sCAAsC,CAAA;AAG7C,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAczD,qFAAqF;AACrF,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,mBAAmB,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kHAAkH;IAClH,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,2BAA2B,CAAA;IACvC,oFAAoF;IACpF,gBAAgB,CAAC,EAAE;QAAE,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,SAAS,CAAA;KAAE,CAAA;CAC1H;AAmJD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAEvE;AAgSD,sGAAsG;AACtG,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAUpE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,uBAAuB,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA6HzB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,mBAAmB,EAC1B,kBAAkB,UAAO,GACxB,MAAM,EAAE,CAkBV"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ClaudeApiModelDto, ClaudeApiReasoningEffort } from '../../shared/claude-api-contracts.ts';
|
|
2
|
+
import type { ClaudeApiSettings } from './token-store.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Per-model capability table of the Claude API line.
|
|
5
|
+
*
|
|
6
|
+
* SOURCES. Support lists are the featureMetadata.supportedModels blocks of the official
|
|
7
|
+
* pages fetched 2026-11-21 under https://platform.claude.com/docs/en/ :
|
|
8
|
+
* build-with-claude/mid-conversation-system-messages -> midConversationSystem
|
|
9
|
+
* build-with-claude/preserved-thinking/prefix-checks -> preservedThinking
|
|
10
|
+
* build-with-claude/compaction-on-demand -> serverCompaction
|
|
11
|
+
* build-with-claude/fast-mode -> fastMode ('beta' = needs the fast-mode header)
|
|
12
|
+
* build-with-claude/context-editing -> contextEditing
|
|
13
|
+
* Window, output cap, thinking form, effort ladder and temperature come from the in-repo
|
|
14
|
+
* transcription src/host/claude/model-catalog.ts (read as a reference, not imported), and
|
|
15
|
+
* three of them were re-checked live: claude-haiku-5-5 rejects budget thinking and a
|
|
16
|
+
* non-default temperature, and 128000 is the output cap of claude-haiku-5-5 and claude-opus-5-5.
|
|
17
|
+
* UNVERIFIED: the Mythos rows mirror their Fable siblings because the docs list them together.
|
|
18
|
+
*/
|
|
19
|
+
export type ClaudeApiThinkingMode = 'adaptive' | 'budget' | 'none';
|
|
20
|
+
export type ClaudeApiFastMode = 'ga' | 'beta' | null;
|
|
21
|
+
type Effort = Exclude<ClaudeApiReasoningEffort, 'none'>;
|
|
22
|
+
export interface ClaudeApiModelEntry {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
contextWindow: number;
|
|
26
|
+
maxOutputTokens: number;
|
|
27
|
+
supportsImages: boolean;
|
|
28
|
+
supportsTemperature: boolean;
|
|
29
|
+
thinkingMode: ClaudeApiThinkingMode;
|
|
30
|
+
/** Selectable effort levels, lowest first; never contains 'none'. */
|
|
31
|
+
reasoningEfforts: readonly Effort[];
|
|
32
|
+
canDisableThinking: boolean;
|
|
33
|
+
/** Accepts role:system entries inside messages (and tool_addition / tool_removal in them). */
|
|
34
|
+
midConversationSystem: boolean;
|
|
35
|
+
/** Runs the preserved-thinking prefix check, so block_binding is sent. */
|
|
36
|
+
preservedThinking: boolean;
|
|
37
|
+
fastMode: ClaudeApiFastMode;
|
|
38
|
+
serverCompaction: boolean;
|
|
39
|
+
contextEditing: boolean;
|
|
40
|
+
/** false when the id is not in the shipped table and a template was used. */
|
|
41
|
+
known: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare const CLAUDE_API_MODELS: readonly ClaudeApiModelEntry[];
|
|
44
|
+
/** Facts for one model id: the caller's catalog first, then the shipped table, then a template. */
|
|
45
|
+
export declare function resolveClaudeApiModel(id: string, catalog?: readonly ClaudeApiModelEntry[]): ClaudeApiModelEntry;
|
|
46
|
+
/** The shipped table as a fresh array; the cold-start placeholder before any live listing. */
|
|
47
|
+
export declare function claudeApiFallbackEntries(): ClaudeApiModelEntry[];
|
|
48
|
+
/**
|
|
49
|
+
* Parse the live GET /v1/models envelope ({ data: [{ id, display_name }] }).
|
|
50
|
+
* Capabilities always come from this module, never from the listing: a gateway may
|
|
51
|
+
* synthesize the listing (observed: display_name equal to the id and no capability fields).
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseClaudeApiModelListing(payload: unknown): ClaudeApiModelEntry[];
|
|
54
|
+
/** One persisted snapshot record. Written by persistedClaudeApiModelRecord, read by parsePersistedClaudeApiModelEntries. */
|
|
55
|
+
export interface PersistedClaudeApiModelRecord {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
}
|
|
59
|
+
/** Snapshot writer half. Only identity is persisted; capabilities are recomputed on read so a table fix reaches old snapshots. */
|
|
60
|
+
export declare function persistedClaudeApiModelRecord(entry: ClaudeApiModelEntry): PersistedClaudeApiModelRecord;
|
|
61
|
+
/** Snapshot reader half: the inverse of mapping persistedClaudeApiModelRecord over a catalog. */
|
|
62
|
+
export declare function parsePersistedClaudeApiModelEntries(value: unknown): ClaudeApiModelEntry[];
|
|
63
|
+
/**
|
|
64
|
+
* The ids a request may use: THE one selection rule for listModels, the settings card and the hub count.
|
|
65
|
+
*
|
|
66
|
+
* null means every listed model. An explicit [] means none, in both phases. An explicit list is
|
|
67
|
+
* applied only to a LIVE catalog: the shipped fallback table and a user's list are different id
|
|
68
|
+
* vocabularies, so filtering the fallback through the list could hide the whole line on a cold start.
|
|
69
|
+
*/
|
|
70
|
+
export declare function convergeClaudeApiSelection(entries: readonly ClaudeApiModelEntry[], settings: Pick<ClaudeApiSettings, 'enabledModelIds'>, live: boolean): Set<string>;
|
|
71
|
+
/** Context window after the user's override, or the model default. */
|
|
72
|
+
export declare function claudeApiContextWindow(entry: ClaudeApiModelEntry, settings: Pick<ClaudeApiSettings, 'contextWindowOverrides'>): number;
|
|
73
|
+
/** Public rows for the settings card. */
|
|
74
|
+
export declare function claudeApiModelOptions(entries: readonly ClaudeApiModelEntry[], settings: ClaudeApiSettings, live: boolean): ClaudeApiModelDto[];
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/claude-api/model-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAA;AAClE,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;AACpD,KAAK,MAAM,GAAG,OAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAA;AAEvD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;IACvB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,YAAY,EAAE,qBAAqB,CAAA;IACnC,qEAAqE;IACrE,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,kBAAkB,EAAE,OAAO,CAAA;IAC3B,8FAA8F;IAC9F,qBAAqB,EAAE,OAAO,CAAA;IAC9B,0EAA0E;IAC1E,iBAAiB,EAAE,OAAO,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,EAAE,OAAO,CAAA;IACvB,6EAA6E;IAC7E,KAAK,EAAE,OAAO,CAAA;CACf;AAoBD,eAAO,MAAM,iBAAiB,EAAE,SAAS,mBAAmB,EAuB1D,CAAA;AAeF,mGAAmG;AACnG,wBAAgB,qBAAqB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