@tormentalabs/claude-code-wire-compat 0.4.0 → 0.6.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 +217 -0
- package/README.md +51 -7
- package/dist/betas.d.ts +65 -7
- package/dist/betas.d.ts.map +1 -1
- package/dist/betas.js +143 -2
- package/dist/betas.js.map +1 -1
- package/dist/build-request.d.ts +12 -6
- package/dist/build-request.d.ts.map +1 -1
- package/dist/build-request.js +44 -15
- package/dist/build-request.js.map +1 -1
- package/dist/contracts.d.ts +7 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +5 -0
- package/dist/fingerprint.js.map +1 -1
- package/dist/headers.d.ts.map +1 -1
- package/dist/headers.js +5 -2
- package/dist/headers.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/model-capabilities.d.ts +3 -3
- package/dist/model-capabilities.d.ts.map +1 -1
- package/dist/model-capabilities.js +55 -19
- package/dist/model-capabilities.js.map +1 -1
- package/dist/model-identity.d.ts +9 -1
- package/dist/model-identity.d.ts.map +1 -1
- package/dist/model-identity.js +33 -2
- package/dist/model-identity.js.map +1 -1
- package/dist/model-queries.d.ts +89 -0
- package/dist/model-queries.d.ts.map +1 -0
- package/dist/model-queries.js +232 -0
- package/dist/model-queries.js.map +1 -0
- package/dist/models.js +1 -1
- package/dist/models.js.map +1 -1
- package/dist/profiles/beta-registry-2.1.280.d.ts +211 -0
- package/dist/profiles/beta-registry-2.1.280.d.ts.map +1 -0
- package/dist/profiles/beta-registry-2.1.280.js +292 -0
- package/dist/profiles/beta-registry-2.1.280.js.map +1 -0
- package/dist/profiles/claude-code-2.1.280.d.ts +3 -0
- package/dist/profiles/claude-code-2.1.280.d.ts.map +1 -0
- package/dist/profiles/claude-code-2.1.280.js +359 -0
- package/dist/profiles/claude-code-2.1.280.js.map +1 -0
- package/dist/redaction.d.ts.map +1 -1
- package/dist/redaction.js +3 -0
- package/dist/redaction.js.map +1 -1
- package/dist/request-body.d.ts +1 -1
- package/dist/request-body.d.ts.map +1 -1
- package/dist/request-body.js +16 -5
- package/dist/request-body.js.map +1 -1
- package/dist/thinking.d.ts +53 -2
- package/dist/thinking.d.ts.map +1 -1
- package/dist/thinking.js +124 -26
- package/dist/thinking.js.map +1 -1
- package/package.json +6 -3
- package/src/betas.ts +208 -9
- package/src/build-request.ts +54 -21
- package/src/contracts.ts +7 -2
- package/src/fingerprint.ts +5 -0
- package/src/headers.ts +4 -2
- package/src/index.ts +28 -3
- package/src/model-capabilities.ts +55 -19
- package/src/model-identity.ts +29 -2
- package/src/model-queries.ts +273 -0
- package/src/models.ts +1 -1
- package/src/profiles/beta-registry-2.1.280.ts +309 -0
- package/src/profiles/claude-code-2.1.280.ts +364 -0
- package/src/redaction.ts +3 -0
- package/src/request-body.ts +25 -3
- package/src/thinking.ts +148 -26
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
import { supportsStructuredOutputs as portedStructuredOutputs } from "./model-capabilities.js";
|
|
3
|
+
import { modelFamilyOf, normalizeModelId } from "./model-identity.js";
|
|
4
|
+
import { CLAUDE_CODE_2_1_195_PROFILE } from "./profiles/claude-code-2.1.195.js";
|
|
5
|
+
/*
|
|
6
|
+
* Read-only model queries.
|
|
7
|
+
*
|
|
8
|
+
* DESIGN DECISION (Phase 1.1). Two surfaces, deliberately separate:
|
|
9
|
+
*
|
|
10
|
+
* 1. `modelCapability(model, capability, profile)` -- the GENERIC query. The
|
|
11
|
+
* catalogue is the source of truth: it normalizes the id, looks the entry
|
|
12
|
+
* up in `profile.supportedModels` and asks whether the verbatim upstream
|
|
13
|
+
* capability string is present. It invents nothing, maps nothing, and
|
|
14
|
+
* therefore answers for capability strings this package does not model as
|
|
15
|
+
* a `ClaudeCodeCapabilities` field (`fast_mode`, `lean_prompt`,
|
|
16
|
+
* `fable_5_mitigations`, `mid_conv_system`, ...) as readily as for the
|
|
17
|
+
* six that it does.
|
|
18
|
+
*
|
|
19
|
+
* 2. The NAMED family/version predicates below -- `isOpus47Model` and
|
|
20
|
+
* friends. A family is not a catalogue capability; it is an identity
|
|
21
|
+
* question. They are therefore written over `normalizeModelId` and
|
|
22
|
+
* `modelFamilyOf`, NOT over a new family regex and NOT over the
|
|
23
|
+
* catalogue. Consequence, and it is intended: an id normalizing to
|
|
24
|
+
* `claude-opus-4-7` answers `isOpus47Model` true whether or not the
|
|
25
|
+
* active profile catalogues it.
|
|
26
|
+
*
|
|
27
|
+
* Do not fold (2) into (1). Asking `modelCapability(model, "adaptive_thinking")`
|
|
28
|
+
* and asking `isAdaptiveThinkingModel(model)` are different questions with
|
|
29
|
+
* different answers for ids the active profile does not catalogue, and both
|
|
30
|
+
* questions have callers.
|
|
31
|
+
*
|
|
32
|
+
* INVALID INPUT. Every predicate here returns `false` for a non-string or an
|
|
33
|
+
* empty id rather than throwing. This departs from `resolveModel`
|
|
34
|
+
* (`ClaudeCodeWireError("INVALID_INPUT")`) on purpose: these are predicates,
|
|
35
|
+
* their upstream counterparts are total functions returning `false` on a
|
|
36
|
+
* falsy model, and a predicate that throws cannot be used in the boolean
|
|
37
|
+
* position its callers put it in.
|
|
38
|
+
*
|
|
39
|
+
* RUNTIME NEUTRALITY. No builtins, no clock, no randomness, no I/O.
|
|
40
|
+
*/
|
|
41
|
+
/** Lowercased + dotted-to-dashed id, or `null` for input no predicate can answer for. */
|
|
42
|
+
function normalizedOrNull(model) {
|
|
43
|
+
if (typeof model !== "string" || model.length === 0) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return normalizeModelId(model);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Explicit 1M markers a caller can spell into the model id.
|
|
50
|
+
*
|
|
51
|
+
* `\[1m\]` is deliberately absent: it marks a request-time context selection,
|
|
52
|
+
* not an always-1M id, and the upstream marker check does not accept it.
|
|
53
|
+
*/
|
|
54
|
+
const ONE_MILLION_MARKER_RE = /(^|[-_ ])1m($|[-_ ])|context[-_]?1m/iu;
|
|
55
|
+
/** As `ONE_MILLION_MARKER_RE`, plus the bracketed request-time marker. */
|
|
56
|
+
const ONE_MILLION_ELIGIBLE_MARKER_RE = /(^|[-_ ])1m($|[-_ ])|context[-_]?1m|\[1m\]/iu;
|
|
57
|
+
/**
|
|
58
|
+
* Vendor tokens the upstream web-search gate accepts. Transcribed as a token
|
|
59
|
+
* list rather than a regex so it stays a data question, not a pattern-matching
|
|
60
|
+
* one.
|
|
61
|
+
*/
|
|
62
|
+
const WEB_SEARCH_VENDOR_TOKENS = Object.freeze([
|
|
63
|
+
"claude",
|
|
64
|
+
"sonnet",
|
|
65
|
+
"opus",
|
|
66
|
+
"haiku",
|
|
67
|
+
"gpt",
|
|
68
|
+
"gemini",
|
|
69
|
+
]);
|
|
70
|
+
/**
|
|
71
|
+
* Whether the active profile's catalogue records `capability` for `model`.
|
|
72
|
+
*
|
|
73
|
+
* `capability` is a verbatim upstream capability string. Ids the profile does
|
|
74
|
+
* not catalogue answer `false` for every capability: the catalogue is the only
|
|
75
|
+
* evidence this query consults, and absence of evidence is reported as
|
|
76
|
+
* absence. Callers wanting the derived nine-boolean view -- which falls back
|
|
77
|
+
* to the ported predicates for uncatalogued ids -- want `resolveModel`.
|
|
78
|
+
*/
|
|
79
|
+
export function modelCapability(model, capability, profile = CLAUDE_CODE_2_1_195_PROFILE) {
|
|
80
|
+
const id = normalizedOrNull(model);
|
|
81
|
+
if (id === null ||
|
|
82
|
+
typeof capability !== "string" ||
|
|
83
|
+
capability.length === 0) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const entry = profile.supportedModels[id];
|
|
87
|
+
if (entry === undefined) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
return entry.capabilities.includes(capability);
|
|
91
|
+
}
|
|
92
|
+
/** Whether `model` normalizes to `claude-opus-4-6`. */
|
|
93
|
+
export function isOpus46Model(model) {
|
|
94
|
+
return normalizedOrNull(model) === "claude-opus-4-6";
|
|
95
|
+
}
|
|
96
|
+
/** Whether `model` normalizes to `claude-opus-4-7`. */
|
|
97
|
+
export function isOpus47Model(model) {
|
|
98
|
+
return normalizedOrNull(model) === "claude-opus-4-7";
|
|
99
|
+
}
|
|
100
|
+
/** Whether `model` normalizes to `claude-opus-4-8`. */
|
|
101
|
+
export function isOpus48Model(model) {
|
|
102
|
+
return normalizedOrNull(model) === "claude-opus-4-8";
|
|
103
|
+
}
|
|
104
|
+
/** Whether `model` normalizes to `claude-opus-5`. */
|
|
105
|
+
export function isOpus5Model(model) {
|
|
106
|
+
return normalizedOrNull(model) === "claude-opus-5";
|
|
107
|
+
}
|
|
108
|
+
/** Whether `model` normalizes to `claude-opus-5-5`. */
|
|
109
|
+
export function isOpus55Model(model) {
|
|
110
|
+
return normalizedOrNull(model) === "claude-opus-5-5";
|
|
111
|
+
}
|
|
112
|
+
/** Whether `model` normalizes to `claude-sonnet-4-6`. */
|
|
113
|
+
export function isSonnet46Model(model) {
|
|
114
|
+
return normalizedOrNull(model) === "claude-sonnet-4-6";
|
|
115
|
+
}
|
|
116
|
+
/** Whether `model` normalizes to `claude-sonnet-5`. */
|
|
117
|
+
export function isSonnet5Model(model) {
|
|
118
|
+
return normalizedOrNull(model) === "claude-sonnet-5";
|
|
119
|
+
}
|
|
120
|
+
/** Whether `model` normalizes to `claude-fable-5`. */
|
|
121
|
+
export function isFable5Model(model) {
|
|
122
|
+
return normalizedOrNull(model) === "claude-fable-5";
|
|
123
|
+
}
|
|
124
|
+
/** Whether `model` normalizes to `claude-fable-5-1`. */
|
|
125
|
+
export function isFable51Model(model) {
|
|
126
|
+
return normalizedOrNull(model) === "claude-fable-5-1";
|
|
127
|
+
}
|
|
128
|
+
/** Whether `model` normalizes to `claude-mythos-5`. */
|
|
129
|
+
export function isMythos5Model(model) {
|
|
130
|
+
return normalizedOrNull(model) === "claude-mythos-5";
|
|
131
|
+
}
|
|
132
|
+
/** Whether `model` normalizes to `claude-mythos-5-1`. */
|
|
133
|
+
export function isMythos51Model(model) {
|
|
134
|
+
return normalizedOrNull(model) === "claude-mythos-5-1";
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Whether `model` belongs to the haiku family.
|
|
138
|
+
*
|
|
139
|
+
* Reuses `modelFamilyOf`, the package's one family classifier, so a new haiku
|
|
140
|
+
* id is classified in exactly one place.
|
|
141
|
+
*/
|
|
142
|
+
export function isHaikuModel(model) {
|
|
143
|
+
const id = normalizedOrNull(model);
|
|
144
|
+
return id !== null && modelFamilyOf(id) === "haiku";
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Whether `model` is a Claude 3 generation id.
|
|
148
|
+
*
|
|
149
|
+
* The `claude-3-` substring test is the same one the ported capability
|
|
150
|
+
* predicates open with (`model-capabilities.ts`), applied to the normalized
|
|
151
|
+
* id, so a Claude 3 id spelled with a dotted version (`claude-3.5-sonnet`)
|
|
152
|
+
* classifies with its hyphenated spelling.
|
|
153
|
+
*/
|
|
154
|
+
export function isClaude3Model(model) {
|
|
155
|
+
return normalizedOrNull(model)?.includes("claude-3-") ?? false;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether `model` may receive the 1M-context beta.
|
|
159
|
+
*
|
|
160
|
+
* Three sources, in order: an explicit 1M marker in the id, the active
|
|
161
|
+
* profile's `context.supports1mBeta`, and -- for ids the profile does not
|
|
162
|
+
* catalogue -- the ported family set (`claude-sonnet-4*`, Opus 4.6/4.7/4.8).
|
|
163
|
+
*/
|
|
164
|
+
export function isEligibleFor1MContext(model, profile = CLAUDE_CODE_2_1_195_PROFILE) {
|
|
165
|
+
const id = normalizedOrNull(model);
|
|
166
|
+
if (id === null) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
if (ONE_MILLION_ELIGIBLE_MARKER_RE.test(model)) {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
const entry = profile.supportedModels[id];
|
|
173
|
+
if (entry !== undefined) {
|
|
174
|
+
return entry.context?.supports1mBeta === true;
|
|
175
|
+
}
|
|
176
|
+
return (id.startsWith("claude-sonnet-4") ||
|
|
177
|
+
id === "claude-opus-4-6" ||
|
|
178
|
+
id === "claude-opus-4-7" ||
|
|
179
|
+
id === "claude-opus-4-8");
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Whether `model` names 1M context explicitly and therefore always uses it.
|
|
183
|
+
*
|
|
184
|
+
* Marker-only by design. The catalogue's `context.native1m` is a DIFFERENT
|
|
185
|
+
* question -- the model's native window -- and consulting it here would make
|
|
186
|
+
* every natively-1M id answer true, which is not what a static "always send
|
|
187
|
+
* 1M" gate means. Use `modelContextWindow`-shaped catalogue reads for that.
|
|
188
|
+
*/
|
|
189
|
+
export function hasOneMillionContext(model) {
|
|
190
|
+
return normalizedOrNull(model) !== null && ONE_MILLION_MARKER_RE.test(model);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Whether `model` supports the structured-outputs beta.
|
|
194
|
+
*
|
|
195
|
+
* Delegates to the predicate ported from the genuine client (`j4e`), which is
|
|
196
|
+
* narrower and better evidenced than a family-shaped heuristic.
|
|
197
|
+
*/
|
|
198
|
+
export function supportsStructuredOutputs(model) {
|
|
199
|
+
const id = normalizedOrNull(model);
|
|
200
|
+
return id !== null && portedStructuredOutputs(id);
|
|
201
|
+
}
|
|
202
|
+
/** Whether `model` supports the web-search tool. */
|
|
203
|
+
export function supportsWebSearch(model) {
|
|
204
|
+
const id = normalizedOrNull(model);
|
|
205
|
+
return (id !== null && WEB_SEARCH_VENDOR_TOKENS.some((token) => id.includes(token)));
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Whether `model` uses adaptive thinking (`{type: "adaptive"}`) instead of a
|
|
209
|
+
* manual `budget_tokens`.
|
|
210
|
+
*
|
|
211
|
+
* The union of the named per-model predicates, not a catalogue read: this
|
|
212
|
+
* gates the shape of the emitted `thinking` block, and an uncatalogued id must
|
|
213
|
+
* not inherit adaptive thinking from the permissive capability fallback. The
|
|
214
|
+
* union covers every id any pinned profile's catalogue marks
|
|
215
|
+
* `adaptive_thinking` (the 2.1.280 catalogue is the widest). Ask
|
|
216
|
+
* `modelCapability(model, "adaptive_thinking", profile)` for a specific
|
|
217
|
+
* profile's answer.
|
|
218
|
+
*/
|
|
219
|
+
export function isAdaptiveThinkingModel(model) {
|
|
220
|
+
return (isOpus46Model(model) ||
|
|
221
|
+
isOpus47Model(model) ||
|
|
222
|
+
isOpus48Model(model) ||
|
|
223
|
+
isOpus5Model(model) ||
|
|
224
|
+
isOpus55Model(model) ||
|
|
225
|
+
isSonnet46Model(model) ||
|
|
226
|
+
isSonnet5Model(model) ||
|
|
227
|
+
isFable5Model(model) ||
|
|
228
|
+
isFable51Model(model) ||
|
|
229
|
+
isMythos5Model(model) ||
|
|
230
|
+
isMythos51Model(model));
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=model-queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-queries.js","sourceRoot":"","sources":["../src/model-queries.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAG5C,OAAO,EAAE,yBAAyB,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,yFAAyF;AACzF,SAAS,gBAAgB,CAAC,KAAa;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAC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CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAa;IACnD,OAAO,CACL,aAAa,CAAC,KAAK,CAAC;QACpB,aAAa,CAAC,KAAK,CAAC;QACpB,aAAa,CAAC,KAAK,CAAC;QACpB,YAAY,CAAC,KAAK,CAAC;QACnB,aAAa,CAAC,KAAK,CAAC;QACpB,eAAe,CAAC,KAAK,CAAC;QACtB,cAAc,CAAC,KAAK,CAAC;QACrB,aAAa,CAAC,KAAK,CAAC;QACpB,cAAc,CAAC,KAAK,CAAC;QACrB,cAAc,CAAC,KAAK,CAAC;QACrB,eAAe,CAAC,KAAK,CAAC,CACvB,CAAC;AACJ,CAAC"}
|
package/dist/models.js
CHANGED
|
@@ -16,7 +16,7 @@ export function resolveModel(model, profile = CLAUDE_CODE_2_1_195_PROFILE) {
|
|
|
16
16
|
id,
|
|
17
17
|
wireId,
|
|
18
18
|
// The catalogue supplies the family here, and -- since T1.1.2 -- also
|
|
19
|
-
// supplies the
|
|
19
|
+
// supplies the catalogue-backed capabilities. Both now honour THIS
|
|
20
20
|
// profile: `deriveCapabilities` takes the active profile, so a request
|
|
21
21
|
// built against a non-pinned profile derives from that profile's
|
|
22
22
|
// catalogue rather than from 2.1.195's. Ids with no catalogue entry fall
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAO5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EA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MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;QACtD,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC7B,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,EAAE;QACF,MAAM;QACN,sEAAsE;QACtE,mEAAmE;QACnE,uEAAuE;QACvE,iEAAiE;QACjE,yEAAyE;QACzE,iEAAiE;QACjE,4DAA4D;QAC5D,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,aAAa,CAAC,EAAE,CAAC;QAC1C,YAAY,EAAE,kBAAkB,CAAC,EAAE,EAAE,OAAO,CAAC;KAC9C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Genuine-client beta registry as of 2.1.280, upstream factory chain at byte
|
|
3
|
+
* offset 6277485 and ordered array `oy` immediately after it.
|
|
4
|
+
*
|
|
5
|
+
* KEY ORDER IS LOAD-BEARING, and for 2.1.280 it is load-bearing in a way it was
|
|
6
|
+
* not before: upstream's array is NOT append-only. `thinking_resumption` is
|
|
7
|
+
* inserted at position 17, and `per_turn_timing`, `mid_conv_tool_change` and
|
|
8
|
+
* `inline_tools` are inserted at 29-31, ahead of four entries that already
|
|
9
|
+
* existed. A diff that assumes new identifiers only ever land at the end will
|
|
10
|
+
* mis-align fifteen entries: 2.1.233 positions 17-27 shift by one and 28-31
|
|
11
|
+
* shift by four. See
|
|
12
|
+
* `docs/protocol/versions/claude-code-2.1.280-analysis.md` section 4.2.
|
|
13
|
+
*
|
|
14
|
+
* The upstream array carries 42 slots with two explicit `null`s (indices 34 and
|
|
15
|
+
* 37, `kAt` at byte 6279405 and `hZt` at byte 6279537) which `.filter(e => e
|
|
16
|
+
* !== null)` removes, leaving the forty entries below. Both slots are null IN
|
|
17
|
+
* THIS BUILD, which is all the bytes establish: upstream treats registry
|
|
18
|
+
* members as nullable per build -- `Dg` carries `...BR ? [BR] : []` and `hRr`
|
|
19
|
+
* guards on `kAt === null` -- so a compile-time feature gate fits the evidence
|
|
20
|
+
* as well as a removal does, and this file claims neither. `kAt` still has two
|
|
21
|
+
* consumers at byte 14167580: `hRr`, short-circuited by that null check, and
|
|
22
|
+
* `yRr`, which reads `kAt.name` with no null guard and so is either unreachable
|
|
23
|
+
* or a throw path. Neither says WHICH beta the slot held; see the note above
|
|
24
|
+
* `AUTO_MODE_CLASSIFIER`. Neither null slot is transcribed here; a null is not
|
|
25
|
+
* an entry.
|
|
26
|
+
*
|
|
27
|
+
* Two further registry members are deliberately absent:
|
|
28
|
+
* `mid_conv_cache_promotion_latch` and `mid_conv_cache_promotion_ok_latch`
|
|
29
|
+
* (`x-cc-internal-mid-conv-cache-promotion` and its `-ok` sibling). Upstream
|
|
30
|
+
* declares them through the same factory but excludes them from the ordered
|
|
31
|
+
* array, and their "header" values are internal `x-cc-*` names, not beta
|
|
32
|
+
* identifiers. Transcribing them would corrupt the registry.
|
|
33
|
+
*
|
|
34
|
+
* Every one of the nine entries new since 2.1.233 was confirmed against its own
|
|
35
|
+
* `N(alias, header)` declaration in the carved dump rather than against the
|
|
36
|
+
* analysis document alone, so no new header rests on a single reading:
|
|
37
|
+
* `rrt` 6278299, `w$` 6278910, `j_` 6278959, `W_` 6279023, and `qk`, `Aoe`,
|
|
38
|
+
* `cD`, `V1`, `lD` in the window at 6279405.
|
|
39
|
+
*
|
|
40
|
+
* `oauth_auth` is the one entry whose header is NOT a string literal upstream:
|
|
41
|
+
* the declaration reads `swe=N("oauth_auth",Ru)`. `Ru` is an imported binding,
|
|
42
|
+
* re-exported as `OAUTH_BETA_HEADER` at byte 25341943, and the only beta-shaped
|
|
43
|
+
* `oauth-*` literal in the bundle is `"oauth-2025-04-20"` at byte 4418398.
|
|
44
|
+
* Resolved by that binding, not by name similarity.
|
|
45
|
+
*/
|
|
46
|
+
export declare const BETA_REGISTRY_2_1_280: {
|
|
47
|
+
CLAUDE_CODE: {
|
|
48
|
+
featureKey: string;
|
|
49
|
+
header: string;
|
|
50
|
+
};
|
|
51
|
+
OAUTH_AUTH: {
|
|
52
|
+
featureKey: string;
|
|
53
|
+
header: string;
|
|
54
|
+
};
|
|
55
|
+
INTERLEAVED_THINKING: {
|
|
56
|
+
featureKey: string;
|
|
57
|
+
header: string;
|
|
58
|
+
};
|
|
59
|
+
LONG_CONTEXT: {
|
|
60
|
+
featureKey: string;
|
|
61
|
+
header: string;
|
|
62
|
+
};
|
|
63
|
+
CONTEXT_MANAGEMENT: {
|
|
64
|
+
featureKey: string;
|
|
65
|
+
header: string;
|
|
66
|
+
};
|
|
67
|
+
STRUCTURED_OUTPUTS: {
|
|
68
|
+
featureKey: string;
|
|
69
|
+
header: string;
|
|
70
|
+
};
|
|
71
|
+
WEB_SEARCH: {
|
|
72
|
+
featureKey: string;
|
|
73
|
+
header: string;
|
|
74
|
+
};
|
|
75
|
+
ADVANCED_TOOL_USE: {
|
|
76
|
+
featureKey: string;
|
|
77
|
+
header: string;
|
|
78
|
+
};
|
|
79
|
+
TOOL_SEARCH: {
|
|
80
|
+
featureKey: string;
|
|
81
|
+
header: string;
|
|
82
|
+
};
|
|
83
|
+
EFFORT: {
|
|
84
|
+
featureKey: string;
|
|
85
|
+
header: string;
|
|
86
|
+
};
|
|
87
|
+
TASK_BUDGETS: {
|
|
88
|
+
featureKey: string;
|
|
89
|
+
header: string;
|
|
90
|
+
};
|
|
91
|
+
PROMPT_CACHING_SCOPE: {
|
|
92
|
+
featureKey: string;
|
|
93
|
+
header: string;
|
|
94
|
+
};
|
|
95
|
+
PROMPT_CACHING_EVICT: {
|
|
96
|
+
featureKey: string;
|
|
97
|
+
header: string;
|
|
98
|
+
};
|
|
99
|
+
EXTENDED_CACHE_TTL: {
|
|
100
|
+
featureKey: string;
|
|
101
|
+
header: string;
|
|
102
|
+
};
|
|
103
|
+
SPEED: {
|
|
104
|
+
featureKey: string;
|
|
105
|
+
header: string;
|
|
106
|
+
};
|
|
107
|
+
REDACT_THINKING: {
|
|
108
|
+
featureKey: string;
|
|
109
|
+
header: string;
|
|
110
|
+
};
|
|
111
|
+
THINKING_RESUMPTION: {
|
|
112
|
+
featureKey: string;
|
|
113
|
+
header: string;
|
|
114
|
+
};
|
|
115
|
+
THINKING_TOKEN_COUNT: {
|
|
116
|
+
featureKey: string;
|
|
117
|
+
header: string;
|
|
118
|
+
};
|
|
119
|
+
AFK_MODE: {
|
|
120
|
+
featureKey: string;
|
|
121
|
+
header: string;
|
|
122
|
+
};
|
|
123
|
+
ADVISOR_TOOL: {
|
|
124
|
+
featureKey: string;
|
|
125
|
+
header: string;
|
|
126
|
+
};
|
|
127
|
+
CACHE_DIAGNOSIS: {
|
|
128
|
+
featureKey: string;
|
|
129
|
+
header: string;
|
|
130
|
+
};
|
|
131
|
+
CONTEXT_HINT: {
|
|
132
|
+
featureKey: string;
|
|
133
|
+
header: string;
|
|
134
|
+
};
|
|
135
|
+
MCP_SERVERS: {
|
|
136
|
+
featureKey: string;
|
|
137
|
+
header: string;
|
|
138
|
+
};
|
|
139
|
+
FILES_API: {
|
|
140
|
+
featureKey: string;
|
|
141
|
+
header: string;
|
|
142
|
+
};
|
|
143
|
+
ENVIRONMENTS: {
|
|
144
|
+
featureKey: string;
|
|
145
|
+
header: string;
|
|
146
|
+
};
|
|
147
|
+
CCR_BYOC: {
|
|
148
|
+
featureKey: string;
|
|
149
|
+
header: string;
|
|
150
|
+
};
|
|
151
|
+
MID_CONVERSATION_SYSTEM: {
|
|
152
|
+
featureKey: string;
|
|
153
|
+
header: string;
|
|
154
|
+
};
|
|
155
|
+
PER_MESSAGE_EFFORT: {
|
|
156
|
+
featureKey: string;
|
|
157
|
+
header: string;
|
|
158
|
+
};
|
|
159
|
+
PER_TURN_TIMING: {
|
|
160
|
+
featureKey: string;
|
|
161
|
+
header: string;
|
|
162
|
+
};
|
|
163
|
+
MID_CONV_TOOL_CHANGE: {
|
|
164
|
+
featureKey: string;
|
|
165
|
+
header: string;
|
|
166
|
+
};
|
|
167
|
+
INLINE_TOOLS: {
|
|
168
|
+
featureKey: string;
|
|
169
|
+
header: string;
|
|
170
|
+
};
|
|
171
|
+
SERVER_SIDE_FALLBACK: {
|
|
172
|
+
featureKey: string;
|
|
173
|
+
header: string;
|
|
174
|
+
};
|
|
175
|
+
SERVER_SIDE_FALLBACK_CATEGORY: {
|
|
176
|
+
featureKey: string;
|
|
177
|
+
header: string;
|
|
178
|
+
};
|
|
179
|
+
FALLBACK_CREDIT: {
|
|
180
|
+
featureKey: string;
|
|
181
|
+
header: string;
|
|
182
|
+
};
|
|
183
|
+
AUTO_MODE_CLASSIFIER: {
|
|
184
|
+
featureKey: string;
|
|
185
|
+
header: string;
|
|
186
|
+
};
|
|
187
|
+
DANGEROUS_TOOL_USE: {
|
|
188
|
+
featureKey: string;
|
|
189
|
+
header: string;
|
|
190
|
+
};
|
|
191
|
+
THINKING_DISPLAY_UPDATES: {
|
|
192
|
+
featureKey: string;
|
|
193
|
+
header: string;
|
|
194
|
+
};
|
|
195
|
+
MESSAGE_THREADS: {
|
|
196
|
+
featureKey: string;
|
|
197
|
+
header: string;
|
|
198
|
+
};
|
|
199
|
+
MID_CONVERSATION_SYSTEM_CLEAR_AT: {
|
|
200
|
+
featureKey: string;
|
|
201
|
+
header: string;
|
|
202
|
+
};
|
|
203
|
+
THINKING_BINDING_CONTROLS: {
|
|
204
|
+
featureKey: string;
|
|
205
|
+
header: string;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
export declare const THIRD_PARTY_ALLOWED_BETAS_2_1_280: ReadonlySet<string>;
|
|
209
|
+
export declare const BEDROCK_UNSUPPORTED_BETAS_2_1_280: ReadonlySet<string>;
|
|
210
|
+
export declare const COUNT_TOKENS_BETAS_2_1_280: ReadonlySet<string>;
|
|
211
|
+
//# sourceMappingURL=beta-registry-2.1.280.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beta-registry-2.1.280.d.ts","sourceRoot":"","sources":["../../src/profiles/beta-registry-2.1.280.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoKY,CAAC;AAmB/C,eAAO,MAAM,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAkB/D,CAAC;AAiBJ,eAAO,MAAM,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAO/D,CAAC;AAQJ,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAO1D,CAAC"}
|