@tormentalabs/claude-code-wire-compat 0.1.0-rc.17 → 0.2.0
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 +101 -2
- package/README.md +67 -2
- package/dist/betas.d.ts +37 -0
- package/dist/betas.d.ts.map +1 -1
- package/dist/betas.js +55 -23
- package/dist/betas.js.map +1 -1
- package/dist/build-request.d.ts +11 -0
- package/dist/build-request.d.ts.map +1 -1
- package/dist/build-request.js +133 -11
- package/dist/build-request.js.map +1 -1
- package/dist/contracts.d.ts +53 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/fingerprint.d.ts +29 -2
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +60 -7
- package/dist/fingerprint.js.map +1 -1
- package/dist/headers.d.ts.map +1 -1
- package/dist/headers.js +12 -4
- package/dist/headers.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model-capabilities.d.ts +31 -3
- package/dist/model-capabilities.d.ts.map +1 -1
- package/dist/model-capabilities.js +145 -12
- package/dist/model-capabilities.js.map +1 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +8 -4
- package/dist/models.js.map +1 -1
- package/dist/profile-behaviors.d.ts +61 -0
- package/dist/profile-behaviors.d.ts.map +1 -0
- package/dist/profile-behaviors.js +53 -0
- package/dist/profile-behaviors.js.map +1 -0
- package/dist/profiles/beta-registry-2.1.233.d.ts +140 -0
- package/dist/profiles/beta-registry-2.1.233.d.ts.map +1 -0
- package/dist/profiles/beta-registry-2.1.233.js +183 -0
- package/dist/profiles/beta-registry-2.1.233.js.map +1 -0
- package/dist/profiles/claude-code-2.1.195.d.ts.map +1 -1
- package/dist/profiles/claude-code-2.1.195.js +14 -0
- package/dist/profiles/claude-code-2.1.195.js.map +1 -1
- package/dist/profiles/claude-code-2.1.233.d.ts +3 -0
- package/dist/profiles/claude-code-2.1.233.d.ts.map +1 -0
- package/dist/profiles/claude-code-2.1.233.js +235 -0
- package/dist/profiles/claude-code-2.1.233.js.map +1 -0
- package/dist/redaction.d.ts.map +1 -1
- package/dist/redaction.js +14 -1
- package/dist/redaction.js.map +1 -1
- package/dist/request-body.d.ts.map +1 -1
- package/dist/request-body.js +12 -10
- package/dist/request-body.js.map +1 -1
- package/dist/thinking.d.ts +33 -7
- package/dist/thinking.d.ts.map +1 -1
- package/dist/thinking.js +105 -36
- package/dist/thinking.js.map +1 -1
- package/package.json +10 -2
- package/src/anti-verbosity.ts +219 -0
- package/src/beta-registry.ts +140 -0
- package/src/betas.ts +302 -0
- package/src/build-request.ts +1799 -0
- package/src/contracts.ts +1286 -0
- package/src/count-tokens.ts +84 -0
- package/src/fingerprint.ts +155 -0
- package/src/headers.ts +448 -0
- package/src/index.ts +63 -0
- package/src/metadata.ts +331 -0
- package/src/model-capabilities.ts +453 -0
- package/src/model-identity.ts +45 -0
- package/src/models.ts +50 -0
- package/src/profile-behaviors.ts +114 -0
- package/src/profiles/beta-registry-2.1.233.ts +200 -0
- package/src/profiles/claude-code-2.1.195.ts +168 -0
- package/src/profiles/claude-code-2.1.233.ts +240 -0
- package/src/redaction.ts +536 -0
- package/src/request-body.ts +1931 -0
- package/src/sha256.ts +114 -0
- package/src/system-prompt.ts +222 -0
- package/src/thinking.ts +346 -0
- package/src/unicode.ts +24 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
interface BetaRegistryEntry {
|
|
4
|
+
readonly featureKey: string;
|
|
5
|
+
readonly header: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* `deepFreeze` is duplicated from `src/beta-registry.ts` rather than imported.
|
|
10
|
+
* A shared helper module would make the two registries import-coupled for four
|
|
11
|
+
* lines of code, and the 2.1.195 registry already carries its own copy; keeping
|
|
12
|
+
* each registry a leaf keeps a version bump from rippling.
|
|
13
|
+
*/
|
|
14
|
+
function deepFreeze<T>(value: T): T {
|
|
15
|
+
if (value !== null && typeof value === "object") {
|
|
16
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
17
|
+
deepFreeze(Reflect.get(value, key));
|
|
18
|
+
}
|
|
19
|
+
Object.freeze(value);
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Genuine-client beta registry as of 2.1.233, upstream `Fb_` (byte offset
|
|
26
|
+
* 287505865).
|
|
27
|
+
*
|
|
28
|
+
* KEY ORDER IS LOAD-BEARING. Upstream neither sorts this object nor keeps a
|
|
29
|
+
* canonical list elsewhere, and `src/betas.ts` emits headers in the order its
|
|
30
|
+
* push sites fire, not in registry order -- but the registry order is the
|
|
31
|
+
* transcription of record and the only thing that makes a diff against a future
|
|
32
|
+
* build meaningful. Do not reorder for tidiness, alphabetisation, or grouping.
|
|
33
|
+
*/
|
|
34
|
+
export const BETA_REGISTRY_2_1_233 = deepFreeze({
|
|
35
|
+
CLAUDE_CODE: { featureKey: "claude_code", header: "claude-code-20250219" },
|
|
36
|
+
OAUTH_AUTH: { featureKey: "oauth_auth", header: "oauth-2025-04-20" },
|
|
37
|
+
INTERLEAVED_THINKING: {
|
|
38
|
+
featureKey: "interleaved_thinking",
|
|
39
|
+
header: "interleaved-thinking-2025-05-14",
|
|
40
|
+
},
|
|
41
|
+
LONG_CONTEXT: { featureKey: "long_context", header: "context-1m-2025-08-07" },
|
|
42
|
+
CONTEXT_MANAGEMENT: {
|
|
43
|
+
featureKey: "context_management",
|
|
44
|
+
header: "context-management-2025-06-27",
|
|
45
|
+
},
|
|
46
|
+
STRUCTURED_OUTPUTS: {
|
|
47
|
+
featureKey: "structured_outputs",
|
|
48
|
+
header: "structured-outputs-2025-12-15",
|
|
49
|
+
},
|
|
50
|
+
WEB_SEARCH: { featureKey: "web_search", header: "web-search-2025-03-05" },
|
|
51
|
+
ADVANCED_TOOL_USE: {
|
|
52
|
+
featureKey: "tool_search",
|
|
53
|
+
header: "advanced-tool-use-2025-11-20",
|
|
54
|
+
},
|
|
55
|
+
TOOL_SEARCH: {
|
|
56
|
+
featureKey: "tool_search",
|
|
57
|
+
header: "tool-search-tool-2025-10-19",
|
|
58
|
+
},
|
|
59
|
+
EFFORT: { featureKey: "effort", header: "effort-2025-11-24" },
|
|
60
|
+
TASK_BUDGETS: {
|
|
61
|
+
featureKey: "task_budgets",
|
|
62
|
+
header: "task-budgets-2026-03-13",
|
|
63
|
+
},
|
|
64
|
+
PROMPT_CACHING_SCOPE: {
|
|
65
|
+
featureKey: "prompt_caching_scope",
|
|
66
|
+
header: "prompt-caching-scope-2026-01-05",
|
|
67
|
+
},
|
|
68
|
+
PROMPT_CACHING_EVICT: {
|
|
69
|
+
featureKey: "prompt_caching_evict",
|
|
70
|
+
header: "prompt-caching-evict-2026-05-12",
|
|
71
|
+
},
|
|
72
|
+
EXTENDED_CACHE_TTL: {
|
|
73
|
+
featureKey: "extended_cache_ttl",
|
|
74
|
+
header: "extended-cache-ttl-2025-04-11",
|
|
75
|
+
},
|
|
76
|
+
SPEED: { featureKey: "speed", header: "fast-mode-2026-02-01" },
|
|
77
|
+
REDACT_THINKING: {
|
|
78
|
+
featureKey: "redact_thinking",
|
|
79
|
+
header: "redact-thinking-2026-02-12",
|
|
80
|
+
},
|
|
81
|
+
THINKING_TOKEN_COUNT: {
|
|
82
|
+
featureKey: "thinking_token_count",
|
|
83
|
+
header: "thinking-token-count-2026-05-13",
|
|
84
|
+
},
|
|
85
|
+
AFK_MODE: { featureKey: "afk_mode", header: "afk-mode-2026-01-31" },
|
|
86
|
+
ADVISOR_TOOL: {
|
|
87
|
+
featureKey: "advisor_tool",
|
|
88
|
+
header: "advisor-tool-2026-03-01",
|
|
89
|
+
},
|
|
90
|
+
CACHE_DIAGNOSIS: {
|
|
91
|
+
featureKey: "cache_diagnosis",
|
|
92
|
+
header: "cache-diagnosis-2026-04-07",
|
|
93
|
+
},
|
|
94
|
+
CONTEXT_HINT: {
|
|
95
|
+
featureKey: "context_hint",
|
|
96
|
+
header: "context-hint-2026-04-09",
|
|
97
|
+
},
|
|
98
|
+
MCP_SERVERS: {
|
|
99
|
+
featureKey: "mcp_servers",
|
|
100
|
+
header: "mcp-servers-2025-12-04",
|
|
101
|
+
},
|
|
102
|
+
FILES_API: { featureKey: "files_api", header: "files-api-2025-04-14" },
|
|
103
|
+
ENVIRONMENTS: {
|
|
104
|
+
featureKey: "environments",
|
|
105
|
+
header: "environments-2025-11-01",
|
|
106
|
+
},
|
|
107
|
+
CCR_BYOC: { featureKey: "ccr_byoc", header: "ccr-byoc-2025-07-29" },
|
|
108
|
+
MID_CONVERSATION_SYSTEM: {
|
|
109
|
+
featureKey: "mid_conversation_system",
|
|
110
|
+
header: "mid-conversation-system-2026-04-07",
|
|
111
|
+
},
|
|
112
|
+
PER_MESSAGE_EFFORT: {
|
|
113
|
+
featureKey: "per_message_effort",
|
|
114
|
+
header: "per-turn-control-2026-07-01",
|
|
115
|
+
},
|
|
116
|
+
SERVER_SIDE_FALLBACK: {
|
|
117
|
+
featureKey: "server_side_fallback",
|
|
118
|
+
header: "server-side-fallback-2026-06-01",
|
|
119
|
+
},
|
|
120
|
+
SERVER_SIDE_FALLBACK_CATEGORY: {
|
|
121
|
+
featureKey: "server_side_fallback_category",
|
|
122
|
+
header: "server-side-fallback-2026-07-01",
|
|
123
|
+
},
|
|
124
|
+
FALLBACK_CREDIT: {
|
|
125
|
+
featureKey: "fallback_credit",
|
|
126
|
+
header: "fallback-credit-2026-06-01",
|
|
127
|
+
},
|
|
128
|
+
/*
|
|
129
|
+
* NARRATION_SUMMARIES BELONGS HERE AND IS DELIBERATELY ABSENT.
|
|
130
|
+
*
|
|
131
|
+
* 2.1.195 carried `NARRATION_SUMMARIES` (`narration_summaries` /
|
|
132
|
+
* `summarize-connector-text-2026-03-13`, upstream `RPt`) at exactly this
|
|
133
|
+
* position, between `FALLBACK_CREDIT` and `AUTO_MODE_CLASSIFIER`. Upstream
|
|
134
|
+
* removed it in 2.1.222+: the frozen array in the 2.1.233 build has a null
|
|
135
|
+
* slot here and the header string appears nowhere in the binary.
|
|
136
|
+
*
|
|
137
|
+
* This is a REMOVAL, not a transcription gap. Re-adding the entry would
|
|
138
|
+
* reintroduce a header the genuine client no longer sends and would break the
|
|
139
|
+
* wire-compatibility claim on the first request. `src/betas.ts` treats the
|
|
140
|
+
* narration push site as conditional on the entry's presence precisely so
|
|
141
|
+
* this absence needs no special-casing anywhere else. Do not "fix" it.
|
|
142
|
+
*/
|
|
143
|
+
AUTO_MODE_CLASSIFIER: {
|
|
144
|
+
featureKey: "auto_mode_classifier",
|
|
145
|
+
header: "auto-mode-classifier-2026-07-16",
|
|
146
|
+
},
|
|
147
|
+
} satisfies Record<string, BetaRegistryEntry>);
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
* Third-party filtering as of 2.1.233, upstream `X5p` (consumed by `J4u`).
|
|
151
|
+
*
|
|
152
|
+
* Delta against the 2.1.195 set (`Pvi`): `mid-conversation-system-2026-04-07`
|
|
153
|
+
* was ADDED; nothing was removed. Eleven headers, extracted from the 2.1.233
|
|
154
|
+
* build rather than assumed to have carried over.
|
|
155
|
+
*/
|
|
156
|
+
export const THIRD_PARTY_ALLOWED_BETAS_2_1_233: ReadonlySet<string> =
|
|
157
|
+
Object.freeze(
|
|
158
|
+
new Set([
|
|
159
|
+
BETA_REGISTRY_2_1_233.CLAUDE_CODE.header,
|
|
160
|
+
BETA_REGISTRY_2_1_233.INTERLEAVED_THINKING.header,
|
|
161
|
+
BETA_REGISTRY_2_1_233.LONG_CONTEXT.header,
|
|
162
|
+
BETA_REGISTRY_2_1_233.CONTEXT_MANAGEMENT.header,
|
|
163
|
+
BETA_REGISTRY_2_1_233.STRUCTURED_OUTPUTS.header,
|
|
164
|
+
BETA_REGISTRY_2_1_233.WEB_SEARCH.header,
|
|
165
|
+
BETA_REGISTRY_2_1_233.EFFORT.header,
|
|
166
|
+
BETA_REGISTRY_2_1_233.TOOL_SEARCH.header,
|
|
167
|
+
BETA_REGISTRY_2_1_233.AFK_MODE.header,
|
|
168
|
+
BETA_REGISTRY_2_1_233.FALLBACK_CREDIT.header,
|
|
169
|
+
BETA_REGISTRY_2_1_233.MID_CONVERSATION_SYSTEM.header,
|
|
170
|
+
]),
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
/*
|
|
174
|
+
* Provider filtering as of 2.1.233, upstream `pts` (consumed by `y1s`).
|
|
175
|
+
* Extracted, not assumed: the set is byte-identical to the 2.1.195 one (`S2r`).
|
|
176
|
+
*
|
|
177
|
+
* Static reference data with no call site in `src/`, exactly like its 2.1.195
|
|
178
|
+
* counterpart. See `test/governance/provider-scope.test.ts`.
|
|
179
|
+
*/
|
|
180
|
+
export const BEDROCK_UNSUPPORTED_BETAS_2_1_233: ReadonlySet<string> =
|
|
181
|
+
Object.freeze(
|
|
182
|
+
new Set([
|
|
183
|
+
BETA_REGISTRY_2_1_233.INTERLEAVED_THINKING.header,
|
|
184
|
+
BETA_REGISTRY_2_1_233.LONG_CONTEXT.header,
|
|
185
|
+
BETA_REGISTRY_2_1_233.TOOL_SEARCH.header,
|
|
186
|
+
]),
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
/*
|
|
190
|
+
* Count-tokens selection as of 2.1.233, upstream `fts` (consumed by `_1s`).
|
|
191
|
+
* Extracted, not assumed: identical to the 2.1.195 set (`E2r`).
|
|
192
|
+
*/
|
|
193
|
+
export const COUNT_TOKENS_BETAS_2_1_233: ReadonlySet<string> = Object.freeze(
|
|
194
|
+
new Set([
|
|
195
|
+
BETA_REGISTRY_2_1_233.CLAUDE_CODE.header,
|
|
196
|
+
BETA_REGISTRY_2_1_233.INTERLEAVED_THINKING.header,
|
|
197
|
+
BETA_REGISTRY_2_1_233.CONTEXT_MANAGEMENT.header,
|
|
198
|
+
BETA_REGISTRY_2_1_233.OAUTH_AUTH.header,
|
|
199
|
+
]),
|
|
200
|
+
);
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
import type { ClaudeCodeProtocolProfile } from "../contracts.js";
|
|
4
|
+
import { COUNT_TOKENS_ENDPOINT } from "../count-tokens.js";
|
|
5
|
+
|
|
6
|
+
function deepFreeze<T>(value: T): T {
|
|
7
|
+
if (value !== null && typeof value === "object") {
|
|
8
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
9
|
+
deepFreeze(Reflect.get(value, key));
|
|
10
|
+
}
|
|
11
|
+
Object.freeze(value);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const CLAUDE_CODE_2_1_195_PROFILE: ClaudeCodeProtocolProfile =
|
|
17
|
+
deepFreeze({
|
|
18
|
+
id: "claude-code-2.1.195-sdk-0.94.0",
|
|
19
|
+
cliVersion: "2.1.195",
|
|
20
|
+
sdkVersion: "0.94.0",
|
|
21
|
+
endpoint: "https://api.anthropic.com/v1/messages?beta=true",
|
|
22
|
+
countTokensEndpoint: COUNT_TOKENS_ENDPOINT,
|
|
23
|
+
entrypoint: "cli",
|
|
24
|
+
userAgent: "claude-cli/2.1.195 (external, cli)",
|
|
25
|
+
buildTime: "2026-06-26T01:00:56Z",
|
|
26
|
+
gitSha: "4603aa3f2ea164bd0974f82eb413ae7acc99a7ee",
|
|
27
|
+
attributionHeaderEnabled: true,
|
|
28
|
+
provider: "anthropic",
|
|
29
|
+
anthropicVersion: "2023-06-01",
|
|
30
|
+
contextHintEnabled: false,
|
|
31
|
+
betaPolicy: {
|
|
32
|
+
oauthAuthenticated: true,
|
|
33
|
+
experimentalBetasEnabled: true,
|
|
34
|
+
oneMillionContextEnabled: true,
|
|
35
|
+
interleavedThinkingEnabled: true,
|
|
36
|
+
interactive: true,
|
|
37
|
+
thinkingSummariesShown: false,
|
|
38
|
+
thinkingTokenCountEnabled: true,
|
|
39
|
+
narrationSummariesEnabled: false,
|
|
40
|
+
structuredOutputsEnabled: false,
|
|
41
|
+
afkModeEnabled: false,
|
|
42
|
+
cacheDiagnosisEnabled: false,
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Verbatim genuine-client catalogue at byte offset 226599191.
|
|
46
|
+
* `defaultEffort` is policy exposed as catalogue data; this package must
|
|
47
|
+
* never apply it to a request.
|
|
48
|
+
*/
|
|
49
|
+
supportedModels: {
|
|
50
|
+
"claude-3-5-haiku": {
|
|
51
|
+
family: "haiku",
|
|
52
|
+
capabilities: [],
|
|
53
|
+
maxOutputTokens: { default: 8192, upper: 8192 },
|
|
54
|
+
},
|
|
55
|
+
"claude-haiku-4-5": {
|
|
56
|
+
family: "haiku",
|
|
57
|
+
capabilities: ["context_management"],
|
|
58
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
59
|
+
},
|
|
60
|
+
"claude-3-5-sonnet": {
|
|
61
|
+
family: "sonnet",
|
|
62
|
+
capabilities: [],
|
|
63
|
+
maxOutputTokens: { default: 8192, upper: 8192 },
|
|
64
|
+
},
|
|
65
|
+
"claude-3-7-sonnet": {
|
|
66
|
+
family: "sonnet",
|
|
67
|
+
capabilities: [],
|
|
68
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
69
|
+
},
|
|
70
|
+
"claude-sonnet-4-0": {
|
|
71
|
+
family: "sonnet",
|
|
72
|
+
context: { window: 200000, supports1mBeta: true },
|
|
73
|
+
capabilities: ["context_management"],
|
|
74
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
75
|
+
},
|
|
76
|
+
"claude-sonnet-4-5": {
|
|
77
|
+
family: "sonnet",
|
|
78
|
+
context: { window: 200000, supports1mBeta: true },
|
|
79
|
+
capabilities: ["context_management"],
|
|
80
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
81
|
+
},
|
|
82
|
+
"claude-sonnet-4-6": {
|
|
83
|
+
family: "sonnet",
|
|
84
|
+
context: { window: 200000, supports1mBeta: true },
|
|
85
|
+
maxOutputTokens: { default: 32000, upper: 128000 },
|
|
86
|
+
capabilities: [
|
|
87
|
+
"effort",
|
|
88
|
+
"max_effort",
|
|
89
|
+
"adaptive_thinking",
|
|
90
|
+
"context_management",
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
"claude-opus-4-0": {
|
|
94
|
+
family: "opus",
|
|
95
|
+
capabilities: ["context_management"],
|
|
96
|
+
maxOutputTokens: { default: 32000, upper: 32000 },
|
|
97
|
+
},
|
|
98
|
+
"claude-opus-4-1": {
|
|
99
|
+
family: "opus",
|
|
100
|
+
capabilities: ["context_management"],
|
|
101
|
+
maxOutputTokens: { default: 32000, upper: 32000 },
|
|
102
|
+
},
|
|
103
|
+
"claude-opus-4-5": {
|
|
104
|
+
family: "opus",
|
|
105
|
+
capabilities: ["context_management"],
|
|
106
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
107
|
+
},
|
|
108
|
+
"claude-opus-4-6": {
|
|
109
|
+
family: "opus",
|
|
110
|
+
context: { window: 200000, supports1mBeta: true },
|
|
111
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
112
|
+
capabilities: [
|
|
113
|
+
"effort",
|
|
114
|
+
"max_effort",
|
|
115
|
+
"adaptive_thinking",
|
|
116
|
+
"context_management",
|
|
117
|
+
"fast_mode",
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
"claude-opus-4-7": {
|
|
121
|
+
family: "opus",
|
|
122
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
123
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
124
|
+
capabilities: [
|
|
125
|
+
"effort",
|
|
126
|
+
"max_effort",
|
|
127
|
+
"xhigh_effort",
|
|
128
|
+
"adaptive_thinking",
|
|
129
|
+
"context_management",
|
|
130
|
+
"fast_mode",
|
|
131
|
+
],
|
|
132
|
+
defaultEffort: "xhigh",
|
|
133
|
+
},
|
|
134
|
+
"claude-opus-4-8": {
|
|
135
|
+
family: "opus",
|
|
136
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
137
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
138
|
+
capabilities: [
|
|
139
|
+
"effort",
|
|
140
|
+
"max_effort",
|
|
141
|
+
"xhigh_effort",
|
|
142
|
+
"adaptive_thinking",
|
|
143
|
+
"mid_conv_system",
|
|
144
|
+
"context_management",
|
|
145
|
+
"fast_mode",
|
|
146
|
+
"lean_prompt",
|
|
147
|
+
],
|
|
148
|
+
defaultEffort: "high",
|
|
149
|
+
},
|
|
150
|
+
"claude-fable-5": {
|
|
151
|
+
family: "fable",
|
|
152
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
153
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
154
|
+
capabilities: [
|
|
155
|
+
"effort",
|
|
156
|
+
"max_effort",
|
|
157
|
+
"xhigh_effort",
|
|
158
|
+
"adaptive_thinking",
|
|
159
|
+
"rejects_disabled_thinking",
|
|
160
|
+
"mid_conv_system",
|
|
161
|
+
"context_management",
|
|
162
|
+
"lean_prompt",
|
|
163
|
+
"fable_5_mitigations",
|
|
164
|
+
],
|
|
165
|
+
defaultEffort: "high",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
import type { ClaudeCodeProtocolProfile } from "../contracts.js";
|
|
4
|
+
import { COUNT_TOKENS_ENDPOINT } from "../count-tokens.js";
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Protocol profile for genuine client 2.1.233.
|
|
8
|
+
*
|
|
9
|
+
* Provenance: extracted from the official 2.1.233 win32-x64 binary. The
|
|
10
|
+
* catalogue and every scalar below are transcribed from
|
|
11
|
+
* `docs/protocol/versions/claude-code-2.1.233-analysis.md`, which records the
|
|
12
|
+
* byte offsets they came from.
|
|
13
|
+
*
|
|
14
|
+
* `effort_cost_index` -- the only static-catalogue field added between 2.1.222
|
|
15
|
+
* and 2.1.233 -- is deliberately omitted; the decision is recorded in
|
|
16
|
+
* `docs/source-trace.md`.
|
|
17
|
+
*
|
|
18
|
+
* Context modelling follows 2.1.195 exactly wherever the upstream flags are
|
|
19
|
+
* the same. `supports_1m_suffix` is not modelled, so an entry declaring a
|
|
20
|
+
* 200000 window with nothing but that flag carries no `context` object here,
|
|
21
|
+
* as in the 2.1.195 profile.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
function deepFreeze<T>(value: T): T {
|
|
25
|
+
if (value !== null && typeof value === "object") {
|
|
26
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
27
|
+
deepFreeze(Reflect.get(value, key));
|
|
28
|
+
}
|
|
29
|
+
Object.freeze(value);
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const CLAUDE_CODE_2_1_233_PROFILE: ClaudeCodeProtocolProfile =
|
|
35
|
+
deepFreeze({
|
|
36
|
+
id: "claude-code-2.1.233-sdk-0.112.1",
|
|
37
|
+
cliVersion: "2.1.233",
|
|
38
|
+
sdkVersion: "0.112.1",
|
|
39
|
+
endpoint: "https://api.anthropic.com/v1/messages?beta=true",
|
|
40
|
+
countTokensEndpoint: COUNT_TOKENS_ENDPOINT,
|
|
41
|
+
entrypoint: "cli",
|
|
42
|
+
userAgent: "claude-cli/2.1.233 (external, cli)",
|
|
43
|
+
buildTime: "2026-08-14T17:21:48Z",
|
|
44
|
+
gitSha: "f8d57569aaf350fe25dc4dfa10cad59db8ea4d45",
|
|
45
|
+
attributionHeaderEnabled: true,
|
|
46
|
+
provider: "anthropic",
|
|
47
|
+
anthropicVersion: "2023-06-01",
|
|
48
|
+
contextHintEnabled: false,
|
|
49
|
+
betaPolicy: {
|
|
50
|
+
oauthAuthenticated: true,
|
|
51
|
+
experimentalBetasEnabled: true,
|
|
52
|
+
oneMillionContextEnabled: true,
|
|
53
|
+
interleavedThinkingEnabled: true,
|
|
54
|
+
interactive: true,
|
|
55
|
+
thinkingSummariesShown: false,
|
|
56
|
+
thinkingTokenCountEnabled: true,
|
|
57
|
+
// Inert for this profile: 2.1.233 removed `narration_summaries` from the
|
|
58
|
+
// beta registry, so there is no entry for this flag to gate.
|
|
59
|
+
narrationSummariesEnabled: false,
|
|
60
|
+
structuredOutputsEnabled: false,
|
|
61
|
+
afkModeEnabled: false,
|
|
62
|
+
cacheDiagnosisEnabled: false,
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Verbatim genuine-client catalogue, 17 entries in the catalogue's own
|
|
66
|
+
* order. `defaultEffort` is policy exposed as catalogue data; this package
|
|
67
|
+
* must never apply it to a request.
|
|
68
|
+
*/
|
|
69
|
+
supportedModels: {
|
|
70
|
+
"claude-3-5-haiku": {
|
|
71
|
+
family: "haiku",
|
|
72
|
+
capabilities: [],
|
|
73
|
+
maxOutputTokens: { default: 8192, upper: 8192 },
|
|
74
|
+
},
|
|
75
|
+
"claude-haiku-4-5": {
|
|
76
|
+
family: "haiku",
|
|
77
|
+
capabilities: ["context_management"],
|
|
78
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
79
|
+
},
|
|
80
|
+
"claude-3-5-sonnet": {
|
|
81
|
+
family: "sonnet",
|
|
82
|
+
capabilities: [],
|
|
83
|
+
maxOutputTokens: { default: 8192, upper: 8192 },
|
|
84
|
+
},
|
|
85
|
+
"claude-3-7-sonnet": {
|
|
86
|
+
family: "sonnet",
|
|
87
|
+
capabilities: [],
|
|
88
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
89
|
+
},
|
|
90
|
+
"claude-sonnet-4-0": {
|
|
91
|
+
family: "sonnet",
|
|
92
|
+
context: { window: 200000, supports1mBeta: true },
|
|
93
|
+
capabilities: ["context_management"],
|
|
94
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
95
|
+
},
|
|
96
|
+
"claude-sonnet-4-5": {
|
|
97
|
+
family: "sonnet",
|
|
98
|
+
context: { window: 200000, supports1mBeta: true },
|
|
99
|
+
capabilities: ["context_management"],
|
|
100
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
101
|
+
},
|
|
102
|
+
"claude-sonnet-4-6": {
|
|
103
|
+
family: "sonnet",
|
|
104
|
+
context: { window: 200000, supports1mBeta: true },
|
|
105
|
+
maxOutputTokens: { default: 32000, upper: 128000 },
|
|
106
|
+
capabilities: [
|
|
107
|
+
"effort",
|
|
108
|
+
"max_effort",
|
|
109
|
+
"adaptive_thinking",
|
|
110
|
+
"context_management",
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
// New at 2.1.233. The entry also declares `native_1m_3p` for
|
|
114
|
+
// bedrock/vertex/foundry; this package is anthropic-only, so that flag
|
|
115
|
+
// is not modelled.
|
|
116
|
+
"claude-sonnet-5": {
|
|
117
|
+
family: "sonnet",
|
|
118
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
119
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
120
|
+
capabilities: [
|
|
121
|
+
"effort",
|
|
122
|
+
"max_effort",
|
|
123
|
+
"xhigh_effort",
|
|
124
|
+
"adaptive_thinking",
|
|
125
|
+
"mid_conv_system",
|
|
126
|
+
"context_management",
|
|
127
|
+
],
|
|
128
|
+
defaultEffort: "high",
|
|
129
|
+
},
|
|
130
|
+
"claude-opus-4-0": {
|
|
131
|
+
family: "opus",
|
|
132
|
+
capabilities: ["context_management"],
|
|
133
|
+
maxOutputTokens: { default: 32000, upper: 32000 },
|
|
134
|
+
},
|
|
135
|
+
"claude-opus-4-1": {
|
|
136
|
+
family: "opus",
|
|
137
|
+
capabilities: ["context_management"],
|
|
138
|
+
maxOutputTokens: { default: 32000, upper: 32000 },
|
|
139
|
+
},
|
|
140
|
+
// No `effort`, and no exception restoring it. The C1 exception in
|
|
141
|
+
// `model-capabilities.ts` belongs to 2.1.195, whose derivation ran off
|
|
142
|
+
// predicates; 2.1.233 derives from this catalogue, so the omission is
|
|
143
|
+
// the genuine answer here.
|
|
144
|
+
"claude-opus-4-5": {
|
|
145
|
+
family: "opus",
|
|
146
|
+
capabilities: ["context_management"],
|
|
147
|
+
maxOutputTokens: { default: 32000, upper: 64000 },
|
|
148
|
+
},
|
|
149
|
+
// Delta D3 vs 2.1.195: `fast_mode` is gone from this entry.
|
|
150
|
+
"claude-opus-4-6": {
|
|
151
|
+
family: "opus",
|
|
152
|
+
context: { window: 200000, supports1mBeta: true },
|
|
153
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
154
|
+
capabilities: [
|
|
155
|
+
"effort",
|
|
156
|
+
"max_effort",
|
|
157
|
+
"adaptive_thinking",
|
|
158
|
+
"context_management",
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
// Delta D3 vs 2.1.195: `fast_mode` is gone from this entry too.
|
|
162
|
+
"claude-opus-4-7": {
|
|
163
|
+
family: "opus",
|
|
164
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
165
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
166
|
+
capabilities: [
|
|
167
|
+
"effort",
|
|
168
|
+
"max_effort",
|
|
169
|
+
"xhigh_effort",
|
|
170
|
+
"adaptive_thinking",
|
|
171
|
+
"context_management",
|
|
172
|
+
],
|
|
173
|
+
defaultEffort: "xhigh",
|
|
174
|
+
},
|
|
175
|
+
"claude-opus-4-8": {
|
|
176
|
+
family: "opus",
|
|
177
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
178
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
179
|
+
capabilities: [
|
|
180
|
+
"effort",
|
|
181
|
+
"max_effort",
|
|
182
|
+
"xhigh_effort",
|
|
183
|
+
"adaptive_thinking",
|
|
184
|
+
"mid_conv_system",
|
|
185
|
+
"context_management",
|
|
186
|
+
"fast_mode",
|
|
187
|
+
"lean_prompt",
|
|
188
|
+
],
|
|
189
|
+
defaultEffort: "high",
|
|
190
|
+
},
|
|
191
|
+
// New at 2.1.233.
|
|
192
|
+
"claude-opus-5": {
|
|
193
|
+
family: "opus",
|
|
194
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
195
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
196
|
+
capabilities: [
|
|
197
|
+
"effort",
|
|
198
|
+
"max_effort",
|
|
199
|
+
"xhigh_effort",
|
|
200
|
+
"adaptive_thinking",
|
|
201
|
+
"mid_conv_system",
|
|
202
|
+
"context_management",
|
|
203
|
+
"fast_mode",
|
|
204
|
+
"lean_prompt",
|
|
205
|
+
"refusal_fallback",
|
|
206
|
+
"opus_5_prompt_bundle",
|
|
207
|
+
],
|
|
208
|
+
defaultEffort: "high",
|
|
209
|
+
},
|
|
210
|
+
"claude-fable-5": {
|
|
211
|
+
family: "fable",
|
|
212
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
213
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
214
|
+
capabilities: [
|
|
215
|
+
"effort",
|
|
216
|
+
"max_effort",
|
|
217
|
+
"xhigh_effort",
|
|
218
|
+
"adaptive_thinking",
|
|
219
|
+
"rejects_disabled_thinking",
|
|
220
|
+
"mid_conv_system",
|
|
221
|
+
"context_management",
|
|
222
|
+
"lean_prompt",
|
|
223
|
+
"fable_5_mitigations",
|
|
224
|
+
"refusal_fallback",
|
|
225
|
+
],
|
|
226
|
+
defaultEffort: "high",
|
|
227
|
+
},
|
|
228
|
+
// New at 2.1.233, and the notable one: under 2.1.195 `claude-mythos-5`
|
|
229
|
+
// had no catalogue entry at all (product decision D-1) and was
|
|
230
|
+
// recognised only by name in individual predicates. Here it is
|
|
231
|
+
// catalogued with an empty capability array, which is a denial rather
|
|
232
|
+
// than the maximally permissive predicate fallback.
|
|
233
|
+
"claude-mythos-5": {
|
|
234
|
+
family: "mythos",
|
|
235
|
+
context: { window: 1e6, native1m: true, supports1mBeta: true },
|
|
236
|
+
capabilities: [],
|
|
237
|
+
maxOutputTokens: { default: 64000, upper: 128000 },
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
});
|