@tormentalabs/claude-code-wire-compat 0.5.0 → 0.7.0-rc.1
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 +226 -0
- package/README.md +19 -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 +93 -50
- 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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +3 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +4 -0
- package/dist/limits.js.map +1 -0
- 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 +19 -1
- package/dist/model-identity.js.map +1 -1
- package/dist/model-queries.d.ts +17 -5
- package/dist/model-queries.d.ts.map +1 -1
- package/dist/model-queries.js +33 -6
- package/dist/model-queries.js.map +1 -1
- 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 +48 -2
- package/dist/redaction.js.map +1 -1
- package/dist/request-body.d.ts +4 -2
- package/dist/request-body.d.ts.map +1 -1
- package/dist/request-body.js +77 -48
- package/dist/request-body.js.map +1 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +23 -22
- package/dist/system-prompt.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/dist/unicode.d.ts +41 -0
- package/dist/unicode.d.ts.map +1 -1
- package/dist/unicode.js +37 -0
- package/dist/unicode.js.map +1 -1
- package/dist/violation.d.ts +23 -0
- package/dist/violation.d.ts.map +1 -0
- package/dist/violation.js +210 -0
- package/dist/violation.js.map +1 -0
- package/package.json +6 -2
- package/src/betas.ts +208 -9
- package/src/build-request.ts +120 -56
- package/src/contracts.ts +7 -2
- package/src/fingerprint.ts +5 -0
- package/src/headers.ts +4 -2
- package/src/index.ts +2 -0
- package/src/limits.ts +4 -0
- package/src/model-capabilities.ts +55 -19
- package/src/model-identity.ts +14 -1
- package/src/model-queries.ts +38 -6
- 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 +65 -2
- package/src/request-body.ts +107 -49
- package/src/system-prompt.ts +32 -24
- package/src/thinking.ts +148 -26
- package/src/unicode.ts +71 -0
- package/src/violation.ts +226 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,232 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.7.0-rc.1]
|
|
6
|
+
|
|
7
|
+
### Breaking
|
|
8
|
+
|
|
9
|
+
- **Body prose now accepts every well-formed UTF-16 string.** The graph
|
|
10
|
+
screeners (`src/build-request.ts`, `src/request-body.ts`,
|
|
11
|
+
`src/system-prompt.ts`) no longer reject C0 control characters (TAB/LF/CR
|
|
12
|
+
were already allowed), DEL or the C1 range in body text — message content,
|
|
13
|
+
`tool_result` content, `tool_use` input, tool descriptions and the `system`
|
|
14
|
+
field. Lone surrogates remain rejected: raw UTF-8 encoding replaces them,
|
|
15
|
+
whereas JSON serialization escapes them. Neither is valid scalar text.
|
|
16
|
+
|
|
17
|
+
This was a library-local defensive policy with no upstream provenance, and
|
|
18
|
+
synthetic tool-output probes reproduced local rejection of ESC (ANSI colour),
|
|
19
|
+
NUL, FF and DEL before fetch. The original incident's exact input remains
|
|
20
|
+
unknown. The system field's stricter C1
|
|
21
|
+
rule (U+0085 accepted in a message but rejected in `system`) was the same
|
|
22
|
+
defect in asymmetric form.
|
|
23
|
+
|
|
24
|
+
Bytes for every input accepted before this change are unchanged; no golden
|
|
25
|
+
fixture or digest was resealed. Headers, metadata identifiers and runtime
|
|
26
|
+
identity fields keep their strict rules unchanged. Model and tool identifiers
|
|
27
|
+
retain control screening; header/beta error codes remain compatible with 0.6.0.
|
|
28
|
+
|
|
29
|
+
Consumers that relied on the library to scrub control characters must now
|
|
30
|
+
do so at their own display boundary. A request the remote API rejects now
|
|
31
|
+
surfaces as a remote error instead of a local pre-flight abort.
|
|
32
|
+
|
|
33
|
+
Rollback: pin `0.6.0`, or pre-sanitize content in the consumer.
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Unicode failures carry safe, additive `violationReason`, `violationPath`,
|
|
38
|
+
`violationOffset`, `violationCodeUnit`, `violationTextLength` and
|
|
39
|
+
`violationInKey` details through the public builder and error sanitizer.
|
|
40
|
+
Dynamic user keys are masked, paths are capped at segment boundaries, and
|
|
41
|
+
numeric diagnostics are bounded. No caller text excerpts are included.
|
|
42
|
+
- The three body walkers share an internal text validator. These helpers and
|
|
43
|
+
policy presets are not new public exports. `classifySurrogateAt` remains the
|
|
44
|
+
single surrogate authority.
|
|
45
|
+
|
|
46
|
+
The input graph budget counts UTF-8 string bytes and structural overhead, not
|
|
47
|
+
serialized JSON size. A control character may require six JSON bytes. Callers
|
|
48
|
+
must not treat this budget as a serialized request-size guarantee.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- Parsing built requests now screens decoded JSON strings as well as the
|
|
53
|
+
serialized wrapper, rejecting escaped lone surrogates and controls in
|
|
54
|
+
non-prose wire roots. Standalone internal inspectors report paths relative
|
|
55
|
+
to their input when no root hint is supplied.
|
|
56
|
+
- Opaque image/file/URL data, thinking signatures, redacted-thinking data and
|
|
57
|
+
search-result source identifiers retain control screening; document plain
|
|
58
|
+
text remains prose. Unknown diagnostic subtrees remain masked recursively.
|
|
59
|
+
|
|
60
|
+
Building also budgets evidence containing both the serialized body and the
|
|
61
|
+
normalized request. The input-only cap is therefore not a promise that every
|
|
62
|
+
request below it will fit later aggregate budgets; these caps are unchanged.
|
|
63
|
+
|
|
64
|
+
## [0.6.0] - 2026-09-24
|
|
65
|
+
|
|
66
|
+
### Breaking
|
|
67
|
+
|
|
68
|
+
- **The default protocol profile is now Claude Code 2.1.280 with SDK
|
|
69
|
+
0.112.1** (profile id `claude-code-2.1.280-sdk-0.112.1`). A caller that does
|
|
70
|
+
not pin a profile now emits different bytes: the version strings, beta
|
|
71
|
+
header, fingerprint and model catalogue all follow the new release.
|
|
72
|
+
|
|
73
|
+
Rollback: pin the previous profile singleton explicitly.
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import {
|
|
77
|
+
CLAUDE_CODE_2_1_233_PROFILE,
|
|
78
|
+
buildClaudeCodeCountTokensRequest,
|
|
79
|
+
buildClaudeCodeRequest,
|
|
80
|
+
parseBuiltClaudeCodeRequest,
|
|
81
|
+
} from "@tormentalabs/claude-code-wire-compat";
|
|
82
|
+
|
|
83
|
+
const built = await buildClaudeCodeRequest(
|
|
84
|
+
input,
|
|
85
|
+
CLAUDE_CODE_2_1_233_PROFILE,
|
|
86
|
+
);
|
|
87
|
+
const counted = await buildClaudeCodeCountTokensRequest(
|
|
88
|
+
countInput,
|
|
89
|
+
CLAUDE_CODE_2_1_233_PROFILE,
|
|
90
|
+
);
|
|
91
|
+
const parsed = parseBuiltClaudeCodeRequest(
|
|
92
|
+
persisted,
|
|
93
|
+
CLAUDE_CODE_2_1_233_PROFILE,
|
|
94
|
+
);
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The pin has to be passed on every call to each of the three entry points
|
|
98
|
+
that read the default seam — `buildClaudeCodeRequest`,
|
|
99
|
+
`buildClaudeCodeCountTokensRequest` and `parseBuiltClaudeCodeRequest`.
|
|
100
|
+
Pinning the builders alone is not enough: `parseBuiltClaudeCodeRequest`
|
|
101
|
+
recomputes the expected headers under the profile it is given, so a
|
|
102
|
+
`BuiltClaudeCodeRequest` persisted under the old default and parsed unpinned
|
|
103
|
+
after upgrading is rejected with `ClaudeCodeWireError` code `INVALID_INPUT`.
|
|
104
|
+
|
|
105
|
+
Pinning restores the previous profile's data, not every byte it used to
|
|
106
|
+
produce. Three behaviours in this release are shared by every profile, the
|
|
107
|
+
previous pin included, and pinning does not undo them: the model-id
|
|
108
|
+
normalizer rungs and the extended-thinking budget floor and caller-type guard
|
|
109
|
+
(both under Fixed), and the `tool_choice` `any` demotion (under Changed).
|
|
110
|
+
|
|
111
|
+
- **`ClaudeCodeCapabilities` gains two required booleans**,
|
|
112
|
+
`midConvToolChange` and `perTurnEffort`. Because
|
|
113
|
+
`ClaudeCodeCapabilityDecisions` is keyed off that type,
|
|
114
|
+
`evidence.capabilityDecisions` gains the same two required keys.
|
|
115
|
+
|
|
116
|
+
Compatibility: callers supplying capabilities on input are unaffected,
|
|
117
|
+
because `ClaudeCodeRequestInput.capabilities` is a `Partial` of that type.
|
|
118
|
+
Only code that constructs a complete `ClaudeCodeCapabilities` value, or that
|
|
119
|
+
exhaustively destructures `evidence.capabilityDecisions`, needs updating.
|
|
120
|
+
|
|
121
|
+
Persisted artefacts: a `BuiltClaudeCodeRequest` persisted by 0.5.0 or
|
|
122
|
+
earlier is rejected by `parseBuiltClaudeCodeRequest` with
|
|
123
|
+
`ClaudeCodeWireError` code `INVALID_INPUT` under every profile, including
|
|
124
|
+
the previous pin, because its `evidence.capabilityDecisions` lacks the two
|
|
125
|
+
new keys. The parser requires the decisions record to carry exactly the
|
|
126
|
+
expected key set and reads both new booleans as mandatory. Re-build those
|
|
127
|
+
requests, or keep parsing them with 0.5.0. The rollback snippet above
|
|
128
|
+
restores the previous profile for new builds; it does not restore
|
|
129
|
+
parseability of artefacts persisted before this version.
|
|
130
|
+
|
|
131
|
+
### Added
|
|
132
|
+
|
|
133
|
+
- **Claude Code 2.1.280 protocol profile**, extracted from the release binary
|
|
134
|
+
rather than inferred:
|
|
135
|
+
- a 40-entry beta registry, nine of whose entries are new to this release;
|
|
136
|
+
- three auxiliary beta sets;
|
|
137
|
+
- five new beta push sites plus one coupled removal: when the
|
|
138
|
+
thinking-display-updates site fires it also removes the previously composed
|
|
139
|
+
redact-thinking identifier;
|
|
140
|
+
- a 20-model catalogue, adding `claude-opus-5-5`, `claude-fable-5-1` and
|
|
141
|
+
`claude-mythos-5-1`.
|
|
142
|
+
|
|
143
|
+
- **New exports for 2.1.280**: the profile singleton
|
|
144
|
+
`CLAUDE_CODE_2_1_280_PROFILE` and its ordered beta registry
|
|
145
|
+
`BETA_REGISTRY_2_1_280`, both from the package entry point, plus the subpath
|
|
146
|
+
export `@tormentalabs/claude-code-wire-compat/profiles/claude-code-2.1.280`.
|
|
147
|
+
|
|
148
|
+
- **A third frozen packed-consumer digest**, pinned across node, bun and
|
|
149
|
+
workerd from the packed tarball:
|
|
150
|
+
`9a531ed01ddd3440ce5b7f25c6caf5f045a9b4e78d885b5317508e21a22ada90`.
|
|
151
|
+
|
|
152
|
+
- **Fingerprint known-answer vectors for 2.1.280**, computed independently
|
|
153
|
+
outside this package so they prove the formula rather than the code's
|
|
154
|
+
consistency with itself.
|
|
155
|
+
|
|
156
|
+
### Changed
|
|
157
|
+
|
|
158
|
+
- **`cacheDiagnosisEnabled` is `true` for the 2.1.280 profile.** The 2.1.233
|
|
159
|
+
profile is deliberately unchanged: whether its `false` was always wrong
|
|
160
|
+
cannot be settled without that release's binary.
|
|
161
|
+
- **`tool_choice` of type `any` is demoted to `{type:"auto"}` while extended
|
|
162
|
+
thinking is active**, on every profile, alongside the existing `tool`
|
|
163
|
+
demotion. Upstream demotes only `tool`; this is a deliberate, recorded
|
|
164
|
+
divergence (2.1.280 analysis §6.6 amendment, `MEMORY.md` 2026-09-24)
|
|
165
|
+
because the Messages API rejects forced tool use under extended thinking.
|
|
166
|
+
A caller that previously received an HTTP 400 for `any` under thinking now
|
|
167
|
+
gets an `auto` request; `disable_parallel_tool_use` on the demoted `any` is
|
|
168
|
+
dropped, as it already was for `tool`. `auto`/`none`, and `any` with
|
|
169
|
+
thinking inactive, are unchanged. No sealed fixture or frozen digest moved.
|
|
170
|
+
|
|
171
|
+
### Removed
|
|
172
|
+
|
|
173
|
+
- **The `drift:check` maintainer script is retired**, and the packed-consumer
|
|
174
|
+
canary script now builds before it packs. Neither is consumer-facing: the
|
|
175
|
+
scripts directory is not published in the package.
|
|
176
|
+
|
|
177
|
+
### Fixed
|
|
178
|
+
|
|
179
|
+
- **The packed-consumer pack-policy test accepts npm 12's output shape.**
|
|
180
|
+
|
|
181
|
+
- **Model-id normalizer**: new rungs for `claude-fable-5-1`,
|
|
182
|
+
`claude-mythos-5-1`, `claude-opus-5-5`, `claude-opus-5` and
|
|
183
|
+
`claude-sonnet-5`. `claude-fable-5-1` and `claude-mythos-5-1` previously
|
|
184
|
+
collapsed onto their base ids, which silently suppressed the per-turn-control
|
|
185
|
+
push site for `claude-fable-5-1`. Both now normalise to their own ids, so
|
|
186
|
+
`isFable5Model("claude-fable-5-1")` now answers `false` for every caller,
|
|
187
|
+
pinned or not.
|
|
188
|
+
|
|
189
|
+
Compatibility: the `claude-opus-5` and `claude-sonnet-5` rungs also change
|
|
190
|
+
how decorated forms of those ids, already catalogued in the previous pin
|
|
191
|
+
since 2.1.233, resolve — a decorated form being a `-latest` suffix, a vendor
|
|
192
|
+
prefix or an unlisted minor version. Bare ids and date-suffixed ids are
|
|
193
|
+
unaffected. The wire `model` field is never affected, because the wire id
|
|
194
|
+
comes from the marker-stripping helper, not from the normalizer. Because the
|
|
195
|
+
ladder is shared by every profile, the new rungs also reach the previous pin:
|
|
196
|
+
under `CLAUDE_CODE_2_1_233_PROFILE`, `claude-mythos-5-1` previously collapsed
|
|
197
|
+
onto `claude-mythos-5` and now keeps its own id, which adds three beta
|
|
198
|
+
identifiers to the header (`context-management-2025-06-27`,
|
|
199
|
+
`mid-conversation-system-2026-04-07` and `effort-2025-11-24`) and changes the
|
|
200
|
+
emitted thinking object from a budgeted one to an adaptive one. The ids
|
|
201
|
+
concerned are not in that pin's own model catalogue, so this affects only a
|
|
202
|
+
caller naming a model that release never shipped.
|
|
203
|
+
|
|
204
|
+
- **The extended-thinking budget follows the transcribed upstream
|
|
205
|
+
computation.** When the emitted `thinking` block is `enabled`,
|
|
206
|
+
`budget_tokens` now has a floor of 1024, applied after the clamp to
|
|
207
|
+
`max_tokens` minus one, so the floor wins when the two conflict; a small
|
|
208
|
+
`max_tokens` previously produced a budget of zero or a negative number that
|
|
209
|
+
no client sends. The caller's `budgetTokens` is now honoured only when the
|
|
210
|
+
caller itself declared an `enabled` request: an `adaptive` request downgraded
|
|
211
|
+
to `enabled` on a model without adaptive thinking now uses the default budget
|
|
212
|
+
(the model's upper limit minus one, then clamped and floored) instead of its
|
|
213
|
+
own.
|
|
214
|
+
|
|
215
|
+
Compatibility: only the 2.1.280 analysis transcribes this computation, so the
|
|
216
|
+
floor and the guard are evidenced for the newest pin only. They are applied
|
|
217
|
+
to every profile as one shared behaviour rather than gated, because gating
|
|
218
|
+
would assert that older clients lacked them. Under every pin, `budget_tokens`
|
|
219
|
+
therefore changes for an `enabled` block whose clamped budget was below 1024,
|
|
220
|
+
including a caller `budgetTokens` below 1024, and for a downgraded `adaptive`
|
|
221
|
+
request that carried a budget. No sealed fixture or frozen digest moved.
|
|
222
|
+
|
|
223
|
+
- **`isAdaptiveThinkingModel` covers every catalogue-adaptive id.** It was a
|
|
224
|
+
union of six named predicates and answered `false` for `claude-opus-5`,
|
|
225
|
+
`claude-opus-5-5` and `claude-sonnet-5`, while the builder emitted an
|
|
226
|
+
adaptive `thinking` block for the same model. The omission predates this
|
|
227
|
+
release: two of those ids are catalogued adaptive in the 2.1.233 pin as
|
|
228
|
+
well. The union now covers every id any pinned profile's catalogue marks
|
|
229
|
+
`adaptive_thinking`. No new symbol is exported from the entry point.
|
|
230
|
+
|
|
5
231
|
## [0.5.0] - 2026-08-16
|
|
6
232
|
|
|
7
233
|
### Added
|
package/README.md
CHANGED
|
@@ -16,18 +16,24 @@ The package targets Node.js 20 or newer and is designed to remain portable to Bu
|
|
|
16
16
|
|
|
17
17
|
## Protocol profile
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
The pinned profiles are exported:
|
|
20
20
|
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
21
|
+
- `CLAUDE_CODE_2_1_280_PROFILE` — Claude Code 2.1.280 with SDK 0.112.1. This is the profile the request-building entry points use when `profile` is omitted.
|
|
22
|
+
- `CLAUDE_CODE_2_1_233_PROFILE` — the previous pin, Claude Code 2.1.233 with SDK 0.112.1.
|
|
23
|
+
- `CLAUDE_CODE_2_1_195_PROFILE` — the oldest pin, Claude Code 2.1.195 with SDK 0.94.0.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
The model-query helpers (`modelCapability`, `isEligibleFor1MContext`) and the anti-verbosity helpers (`antiVerbosityText`, `selectAntiVerbositySection`) keep their own separately declared default and are not governed by that seam; a caller relying on them for a newer model must pass the profile explicitly.
|
|
26
|
+
|
|
27
|
+
Any of them can be selected explicitly by passing the singleton as the `profile` argument, from the package root or from its own subpath export:
|
|
25
28
|
|
|
26
29
|
```ts
|
|
27
30
|
import { CLAUDE_CODE_2_1_195_PROFILE } from "@tormentalabs/claude-code-wire-compat/profiles/claude-code-2.1.195";
|
|
28
31
|
import { CLAUDE_CODE_2_1_233_PROFILE } from "@tormentalabs/claude-code-wire-compat/profiles/claude-code-2.1.233";
|
|
32
|
+
import { CLAUDE_CODE_2_1_280_PROFILE } from "@tormentalabs/claude-code-wire-compat/profiles/claude-code-2.1.280";
|
|
29
33
|
```
|
|
30
34
|
|
|
35
|
+
Rollback: a consumer who wants the previous default's bytes must pass `CLAUDE_CODE_2_1_233_PROFILE` explicitly on every call to each entry point that reads the default seam — `buildClaudeCodeRequest`, `buildClaudeCodeCountTokensRequest`, and `parseBuiltClaudeCodeRequest`. Pinning the builders alone is not enough: `parseBuiltClaudeCodeRequest` recomputes the expected headers under the profile it is given, so a request built under the old default and parsed unpinned after upgrading is rejected with `ClaudeCodeWireError` code `INVALID_INPUT`.
|
|
36
|
+
|
|
31
37
|
The fail-closed rule is unchanged: only these exported singletons are accepted. Any other object, even a structurally identical clone, is rejected with `ClaudeCodeWireError` code `INVALID_INPUT`. This prevents callers from substituting an unpinned protocol profile.
|
|
32
38
|
|
|
33
39
|
## Endpoint URL and custom base URLs
|
|
@@ -90,8 +96,10 @@ Protocol knowledge corpus:
|
|
|
90
96
|
tool_result pairing in practice.
|
|
91
97
|
- [Code comparison reference](./docs/protocol/code-comparison-reference.md) —
|
|
92
98
|
side-by-side comparison against the genuine client.
|
|
93
|
-
- [Divergence analysis](./docs/protocol/divergence-analysis.md) —
|
|
94
|
-
|
|
99
|
+
- [Divergence analysis](./docs/protocol/divergence-analysis.md) — ported
|
|
100
|
+
analysis of system-prompt block construction, genuine client versus the
|
|
101
|
+
earlier plugin. Package-level divergences are recorded in each version
|
|
102
|
+
analysis's port table and in `MEMORY.md`.
|
|
95
103
|
- [Divergence executive summary](./docs/protocol/divergence-executive-summary.md)
|
|
96
104
|
— the condensed version of that analysis.
|
|
97
105
|
- [Quick reference](./docs/protocol/quick-reference.md) — condensed lookup of
|
|
@@ -113,7 +121,11 @@ required](./docs/protocol/versions/README.md):
|
|
|
113
121
|
- [Claude Code 2.1.159](./docs/protocol/versions/claude-code-2.1.159-analysis.md)
|
|
114
122
|
- [Claude Code 2.1.195](./docs/protocol/versions/claude-code-2.1.195-analysis.md)
|
|
115
123
|
- [Claude Code 2.1.233](./docs/protocol/versions/claude-code-2.1.233-analysis.md)
|
|
116
|
-
— the
|
|
124
|
+
— the previous pin; its profile is still exported and selectable.
|
|
125
|
+
- [Claude Code 2.1.280](./docs/protocol/versions/claude-code-2.1.280-analysis.md)
|
|
126
|
+
— the release this package's default profile pins; records the build-shape
|
|
127
|
+
change that breaks the old carving rule, nine new betas, three new models,
|
|
128
|
+
and the first wire-visible `thinking` sub-fields since 2.1.222.
|
|
117
129
|
|
|
118
130
|
## Development
|
|
119
131
|
|
package/dist/betas.d.ts
CHANGED
|
@@ -8,13 +8,22 @@ interface BetaRegistryEntry {
|
|
|
8
8
|
* The entries the push sites below require, as a structural contract rather
|
|
9
9
|
* than a reference to one concrete registry.
|
|
10
10
|
*
|
|
11
|
-
* Registry versions have different key sets. Every key here
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* optionality part of the TYPE is what forces every future registry
|
|
17
|
-
* checked against the push sites at compile time instead of at runtime.
|
|
11
|
+
* Registry versions have different key sets. Every REQUIRED key here is present
|
|
12
|
+
* in all of them, so those push sites index directly. The optional ones are
|
|
13
|
+
* optional because they exist in some registry versions and not others, and a
|
|
14
|
+
* push site whose key is absent becomes inert: it evaluates its gates, finds no
|
|
15
|
+
* entry, pushes nothing, and the surrounding order closes up with no gap.
|
|
16
|
+
* Making the optionality part of the TYPE is what forces every future registry
|
|
17
|
+
* to be checked against the push sites at compile time instead of at runtime.
|
|
18
|
+
*
|
|
19
|
+
* `NARRATION_SUMMARIES` is optional in the older direction -- upstream removed
|
|
20
|
+
* it after 2.1.195 (see `src/profiles/beta-registry-2.1.233.ts`). The keys
|
|
21
|
+
* added for 2.1.280 -- the remaining optional members declared below -- are
|
|
22
|
+
* optional in the newer direction: they are absent from the 2.1.195 registry,
|
|
23
|
+
* and all but `PER_MESSAGE_EFFORT` are absent from the 2.1.233 one. `PER_MESSAGE_EFFORT` IS declared by the 2.1.233 registry, so
|
|
24
|
+
* registry absence does not keep its site inert there; what does is the
|
|
25
|
+
* catalogue, because no 2.1.233 model declares the backing capability. The two
|
|
26
|
+
* mechanisms are not interchangeable and both are load-bearing.
|
|
18
27
|
*/
|
|
19
28
|
export interface ComposableBetaRegistry {
|
|
20
29
|
readonly CLAUDE_CODE: BetaRegistryEntry;
|
|
@@ -27,7 +36,12 @@ export interface ComposableBetaRegistry {
|
|
|
27
36
|
readonly STRUCTURED_OUTPUTS: BetaRegistryEntry;
|
|
28
37
|
readonly PROMPT_CACHING_SCOPE: BetaRegistryEntry;
|
|
29
38
|
readonly MID_CONVERSATION_SYSTEM: BetaRegistryEntry;
|
|
39
|
+
readonly PER_MESSAGE_EFFORT?: BetaRegistryEntry;
|
|
40
|
+
readonly MID_CONV_TOOL_CHANGE?: BetaRegistryEntry;
|
|
41
|
+
readonly MID_CONVERSATION_SYSTEM_CLEAR_AT?: BetaRegistryEntry;
|
|
30
42
|
readonly EFFORT: BetaRegistryEntry;
|
|
43
|
+
readonly THINKING_BINDING_CONTROLS?: BetaRegistryEntry;
|
|
44
|
+
readonly THINKING_DISPLAY_UPDATES?: BetaRegistryEntry;
|
|
31
45
|
readonly SPEED: BetaRegistryEntry;
|
|
32
46
|
readonly AFK_MODE: BetaRegistryEntry;
|
|
33
47
|
readonly EXTENDED_CACHE_TTL: BetaRegistryEntry;
|
|
@@ -35,11 +49,42 @@ export interface ComposableBetaRegistry {
|
|
|
35
49
|
readonly CACHE_DIAGNOSIS: BetaRegistryEntry;
|
|
36
50
|
readonly NARRATION_SUMMARIES?: BetaRegistryEntry;
|
|
37
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Selects the registry a profile composes against.
|
|
54
|
+
*
|
|
55
|
+
* An unrecognised id falls back to the 2.1.195 registry rather than throwing.
|
|
56
|
+
* Rejecting unknown profiles is the request builder's job -- it validates the
|
|
57
|
+
* profile before any of this runs -- and duplicating that rejection here would
|
|
58
|
+
* give `composeBetas` a second, differently-worded opinion about profile
|
|
59
|
+
* validity. Standalone callers keep the 2.1.195 behaviour they had before
|
|
60
|
+
* profiles were a parameter.
|
|
61
|
+
*
|
|
62
|
+
* Exported for tests only, and deliberately NOT re-exported from
|
|
63
|
+
* `src/index.ts`: the public runtime surface stays closed. That fallback is
|
|
64
|
+
* precisely why a test needs to reach this function. A profile bound to the
|
|
65
|
+
* wrong registry, or to none, silently composes against 2.1.195 instead of
|
|
66
|
+
* failing, and every required key of `ComposableBetaRegistry` currently
|
|
67
|
+
* carries an identical header in all three registries -- so a mis-binding
|
|
68
|
+
* changes no emitted byte and no behavioural suite can see it. Asking this
|
|
69
|
+
* function directly is the only way to observe the binding at all.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveBetaRegistry(profile: ClaudeCodeProtocolProfile): ComposableBetaRegistry;
|
|
38
72
|
export interface ComposeBetasInput {
|
|
39
73
|
readonly rawModel: string;
|
|
40
74
|
readonly normalizedId: string;
|
|
41
75
|
readonly capabilities: ClaudeCodeCapabilities;
|
|
42
76
|
readonly thinkingDisplayActive: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether a `thinking` object of type `adaptive` or `enabled` will reach the
|
|
79
|
+
* wire for this request AND the model is interleaved-thinking capable, i.e.
|
|
80
|
+
* upstream `ac` minus its `Fg()` term. Compute it with `isThinkingActive`
|
|
81
|
+
* from `./thinking.js`; never re-derive it at a call site.
|
|
82
|
+
*
|
|
83
|
+
* Required rather than optional: it is a total function of inputs every call
|
|
84
|
+
* site already holds, and requiring it is what forces a new call site to
|
|
85
|
+
* decide rather than silently inherit a default.
|
|
86
|
+
*/
|
|
87
|
+
readonly thinkingActive: boolean;
|
|
43
88
|
readonly cacheTtl?: "5m" | "1h" | null;
|
|
44
89
|
readonly speed?: "standard" | "fast" | null;
|
|
45
90
|
/**
|
|
@@ -72,6 +117,19 @@ export interface ComposeBetasInput {
|
|
|
72
117
|
export interface ComposedBetas {
|
|
73
118
|
readonly betas: readonly string[];
|
|
74
119
|
readonly suppressedBetaNames: readonly string[];
|
|
120
|
+
/**
|
|
121
|
+
* Present only when push site 12b fired. This is the body-side half of a
|
|
122
|
+
* beta/body pair: the site pushes the display-updates beta AND decides that
|
|
123
|
+
* the body's `thinking` object carries `display: "updates"`. The consumer is
|
|
124
|
+
* the canonical body builder (`buildCanonicalBody`), which hands it to
|
|
125
|
+
* `resolveThinking`.
|
|
126
|
+
*
|
|
127
|
+
* `suppressBetas` cannot unset it. Suppressing the beta identifier removes
|
|
128
|
+
* the HEADER only; the body keeps `display: "updates"`. That matches the
|
|
129
|
+
* existing coupled pair where suppressing `effort-2025-11-24` leaves
|
|
130
|
+
* `output_config.effort` in the body.
|
|
131
|
+
*/
|
|
132
|
+
readonly thinkingDisplayOverride?: "updates";
|
|
75
133
|
}
|
|
76
134
|
export declare function composeBetas(input: ComposeBetasInput, profile?: ClaudeCodeProtocolProfile): readonly string[];
|
|
77
135
|
export declare function composeBetasWithAudit(input: ComposeBetasInput, profile?: ClaudeCodeProtocolProfile): ComposedBetas;
|
package/dist/betas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betas.d.ts","sourceRoot":"","sources":["../src/betas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"betas.d.ts","sourceRoot":"","sources":["../src/betas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,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E,yBAAuD,GAC/D,aAAa,CAmRf"}
|
package/dist/betas.js
CHANGED
|
@@ -3,11 +3,14 @@ import { BETA_REGISTRY } from "./beta-registry.js";
|
|
|
3
3
|
import { ClaudeCodeWireError } from "./contracts.js";
|
|
4
4
|
import { supportsMidConversationSystem, supportsStructuredOutputs, } from "./model-capabilities.js";
|
|
5
5
|
import { BETA_REGISTRY_2_1_233 } from "./profiles/beta-registry-2.1.233.js";
|
|
6
|
+
import { BETA_REGISTRY_2_1_280 } from "./profiles/beta-registry-2.1.280.js";
|
|
6
7
|
import { CLAUDE_CODE_2_1_195_PROFILE } from "./profiles/claude-code-2.1.195.js";
|
|
7
8
|
import { CLAUDE_CODE_2_1_233_PROFILE } from "./profiles/claude-code-2.1.233.js";
|
|
9
|
+
import { CLAUDE_CODE_2_1_280_PROFILE } from "./profiles/claude-code-2.1.280.js";
|
|
8
10
|
const PROFILE_BETA_REGISTRIES = new Map([
|
|
9
11
|
[CLAUDE_CODE_2_1_195_PROFILE.id, BETA_REGISTRY],
|
|
10
12
|
[CLAUDE_CODE_2_1_233_PROFILE.id, BETA_REGISTRY_2_1_233],
|
|
13
|
+
[CLAUDE_CODE_2_1_280_PROFILE.id, BETA_REGISTRY_2_1_280],
|
|
11
14
|
]);
|
|
12
15
|
/**
|
|
13
16
|
* Selects the registry a profile composes against.
|
|
@@ -18,8 +21,17 @@ const PROFILE_BETA_REGISTRIES = new Map([
|
|
|
18
21
|
* give `composeBetas` a second, differently-worded opinion about profile
|
|
19
22
|
* validity. Standalone callers keep the 2.1.195 behaviour they had before
|
|
20
23
|
* profiles were a parameter.
|
|
24
|
+
*
|
|
25
|
+
* Exported for tests only, and deliberately NOT re-exported from
|
|
26
|
+
* `src/index.ts`: the public runtime surface stays closed. That fallback is
|
|
27
|
+
* precisely why a test needs to reach this function. A profile bound to the
|
|
28
|
+
* wrong registry, or to none, silently composes against 2.1.195 instead of
|
|
29
|
+
* failing, and every required key of `ComposableBetaRegistry` currently
|
|
30
|
+
* carries an identical header in all three registries -- so a mis-binding
|
|
31
|
+
* changes no emitted byte and no behavioural suite can see it. Asking this
|
|
32
|
+
* function directly is the only way to observe the binding at all.
|
|
21
33
|
*/
|
|
22
|
-
function resolveBetaRegistry(profile) {
|
|
34
|
+
export function resolveBetaRegistry(profile) {
|
|
23
35
|
return PROFILE_BETA_REGISTRIES.get(profile.id) ?? BETA_REGISTRY;
|
|
24
36
|
}
|
|
25
37
|
/**
|
|
@@ -108,10 +120,131 @@ export function composeBetasWithAudit(input, profile = CLAUDE_CODE_2_1_195_PROFI
|
|
|
108
120
|
// No web-search beta: upstream pushes it only for vertex and foundry.
|
|
109
121
|
if (experimental)
|
|
110
122
|
out.push(registry.PROMPT_CACHING_SCOPE.header);
|
|
111
|
-
|
|
123
|
+
/*
|
|
124
|
+
* Upstream `jR`. The local boolean below records that this site PUSHED, which
|
|
125
|
+
* is what sites 11b and 11c gate on -- upstream reads `Ee.includes(jR)`, the
|
|
126
|
+
* composed array, not the registry. Asking the registry instead would fire
|
|
127
|
+
* those two sites for a model this one skipped.
|
|
128
|
+
*/
|
|
129
|
+
const midConversationSystemFired = supportsMidConversationSystem(input.normalizedId, profile);
|
|
130
|
+
if (midConversationSystemFired) {
|
|
112
131
|
out.push(registry.MID_CONVERSATION_SYSTEM.header);
|
|
132
|
+
}
|
|
133
|
+
/*
|
|
134
|
+
* Site 11a. Upstream `wRt`, which reduces to
|
|
135
|
+
* `Fg() && mD(provider) && catalogue-declares-per_turn_effort`; the provider
|
|
136
|
+
* term is first-party here by construction.
|
|
137
|
+
*/
|
|
138
|
+
const perMessageEffort = registry.PER_MESSAGE_EFFORT;
|
|
139
|
+
if (experimental &&
|
|
140
|
+
input.capabilities.perTurnEffort &&
|
|
141
|
+
perMessageEffort !== undefined) {
|
|
142
|
+
out.push(perMessageEffort.header);
|
|
143
|
+
}
|
|
144
|
+
/*
|
|
145
|
+
* Site 11b. Upstream `oQt() && Tue(model)`. `Tue` opens with
|
|
146
|
+
* `if (!Fg() || !kue(e)) return false`, so the experimental gate is upstream's
|
|
147
|
+
* and not an addition. Step 3 of `Tue` -- which sends the beta for any model
|
|
148
|
+
* with NO catalogue entry -- is deliberately not ported; see the analysis
|
|
149
|
+
* document's divergence record.
|
|
150
|
+
*/
|
|
151
|
+
const midConvToolChange = registry.MID_CONV_TOOL_CHANGE;
|
|
152
|
+
if (experimental &&
|
|
153
|
+
midConversationSystemFired &&
|
|
154
|
+
input.capabilities.midConvToolChange &&
|
|
155
|
+
midConvToolChange !== undefined) {
|
|
156
|
+
out.push(midConvToolChange.header);
|
|
157
|
+
}
|
|
158
|
+
/*
|
|
159
|
+
* Site 11c. Upstream `Mo`, which is the one site whose experimental gate is
|
|
160
|
+
* invisible at the statement level -- `Mo` names no `Fg()` at all. The gate is
|
|
161
|
+
* reached three calls deep instead: `Mee` is `oRt(model) !== "off"`, `oRt`
|
|
162
|
+
* wraps `fur`, and `fur` opens by returning `"off"` when `Fg()` is false. So
|
|
163
|
+
* `experimental` is upstream's own conjunct here exactly as it is at 11a and
|
|
164
|
+
* 11b, and a reader who checks only the `Mo` expression will wrongly conclude
|
|
165
|
+
* it was invented. It was not.
|
|
166
|
+
*
|
|
167
|
+
* `Mo`'s remaining conjuncts are constants for this package. `!l7(querySource)`
|
|
168
|
+
* holds because `l7` is true only for the two auto-mode query sources. `!Vr`
|
|
169
|
+
* holds because `Vr` is a per-session latch, and a stateless package composes
|
|
170
|
+
* every request as a first request. `Mee`'s other terms are fixed on the
|
|
171
|
+
* first-party path. What is left is `Ee.includes(jR)`, which is precisely the
|
|
172
|
+
* `midConversationSystemFired` outcome recorded at site 11.
|
|
173
|
+
*/
|
|
174
|
+
const midConversationSystemClearAt = registry.MID_CONVERSATION_SYSTEM_CLEAR_AT;
|
|
175
|
+
if (experimental &&
|
|
176
|
+
midConversationSystemFired &&
|
|
177
|
+
midConversationSystemClearAt !== undefined) {
|
|
178
|
+
out.push(midConversationSystemClearAt.header);
|
|
179
|
+
}
|
|
180
|
+
// Site 12.
|
|
113
181
|
if (input.capabilities.effort)
|
|
114
182
|
out.push(registry.EFFORT.header);
|
|
183
|
+
/*
|
|
184
|
+
* Site 12a. Upstream `er && Fg()` with the latch write, which on the pinned
|
|
185
|
+
* first-party path collapses to thinking-active AND experimental.
|
|
186
|
+
* The coupled body field `thinking.block_binding` is NOT emitted: it needs a
|
|
187
|
+
* host override this package cannot observe.
|
|
188
|
+
*/
|
|
189
|
+
const thinkingBindingControls = registry.THINKING_BINDING_CONTROLS;
|
|
190
|
+
if (experimental &&
|
|
191
|
+
input.thinkingActive &&
|
|
192
|
+
thinkingBindingControls !== undefined) {
|
|
193
|
+
out.push(thinkingBindingControls.header);
|
|
194
|
+
}
|
|
195
|
+
/*
|
|
196
|
+
* Site 12b. Upstream guards the push with
|
|
197
|
+
* `(yc?.type === "adaptive" || yc?.type === "enabled") && ac && firstParty
|
|
198
|
+
* && !callerSuppliedDisplay && ...` plus the simulate-proxy environment
|
|
199
|
+
* variable and a per-session latch. The reachable remainder of that guard is
|
|
200
|
+
* modelled below: `experimental` is upstream's `Fg()` term inside `ac`,
|
|
201
|
+
* `input.thinkingActive` is the thinking-type test together with the rest of
|
|
202
|
+
* `ac`, and `!input.thinkingDisplayActive` is the caller-supplied-display
|
|
203
|
+
* test. First-party is not modelled because this package only builds the
|
|
204
|
+
* first-party path, the simulate-proxy env var is not modelled because the
|
|
205
|
+
* package reads no environment, and the per-session latch is always empty in
|
|
206
|
+
* a stateless package that composes every request as a first request.
|
|
207
|
+
*
|
|
208
|
+
* The branch is additionally reached only when the display-mode resolver
|
|
209
|
+
* `Gxt` returns its connector-text result; its other results break out
|
|
210
|
+
* before the push. `!policy.thinkingSummariesShown` is that resolver's
|
|
211
|
+
* `sQt()` term, mapped onto the profile flag exactly as at the
|
|
212
|
+
* redact-thinking site above. See the 2.1.280 analysis document, §6.4, for
|
|
213
|
+
* the resolver itself.
|
|
214
|
+
*
|
|
215
|
+
* The resolver's other two diverting branches are already covered by
|
|
216
|
+
* `!thinkingDisplayActive`. A caller display of `"summarized"` takes the
|
|
217
|
+
* first branch, and `"omitted"` takes the second whenever the
|
|
218
|
+
* explicit-display flag is falsy, which is the only state this package can
|
|
219
|
+
* express -- it models no equivalent of that flag. Under a truthy
|
|
220
|
+
* explicit-display flag upstream would fall through and overwrite an
|
|
221
|
+
* explicit `"omitted"` with `"updates"`; that input is unreachable here, and
|
|
222
|
+
* is recorded rather than modelled.
|
|
223
|
+
*
|
|
224
|
+
* The site is coupled: it pushes the beta, records `display: "updates"` for
|
|
225
|
+
* the body builder, and removes the previously composed redact-thinking beta
|
|
226
|
+
* (upstream `qu()`).
|
|
227
|
+
*
|
|
228
|
+
* The splice sits INSIDE this block and is deliberately the LAST thing it
|
|
229
|
+
* does. At this point `out` holds only canonical pushes, because the caller
|
|
230
|
+
* `additionalBetas` merge runs later. So a caller who explicitly supplies
|
|
231
|
+
* `redact-thinking-2026-02-12` in `additionalBetas` still gets it, precisely
|
|
232
|
+
* because the merge's `if (!out.includes(beta))` test now succeeds. Moving
|
|
233
|
+
* the splice after the merge would silently eat that caller's entry.
|
|
234
|
+
*/
|
|
235
|
+
const thinkingDisplayUpdates = registry.THINKING_DISPLAY_UPDATES;
|
|
236
|
+
let thinkingDisplayOverride;
|
|
237
|
+
if (experimental &&
|
|
238
|
+
input.thinkingActive &&
|
|
239
|
+
!policy.thinkingSummariesShown &&
|
|
240
|
+
!input.thinkingDisplayActive &&
|
|
241
|
+
thinkingDisplayUpdates !== undefined) {
|
|
242
|
+
out.push(thinkingDisplayUpdates.header);
|
|
243
|
+
thinkingDisplayOverride = "updates";
|
|
244
|
+
const redactIndex = out.indexOf(registry.REDACT_THINKING.header);
|
|
245
|
+
if (redactIndex !== -1)
|
|
246
|
+
out.splice(redactIndex, 1);
|
|
247
|
+
}
|
|
115
248
|
if (input.speed === "fast" && !out.includes(registry.SPEED.header)) {
|
|
116
249
|
out.push(registry.SPEED.header);
|
|
117
250
|
}
|
|
@@ -149,6 +282,9 @@ export function composeBetasWithAudit(input, profile = CLAUDE_CODE_2_1_195_PROFI
|
|
|
149
282
|
return Object.freeze({
|
|
150
283
|
betas: Object.freeze(out),
|
|
151
284
|
suppressedBetaNames: NO_SUPPRESSED_BETAS,
|
|
285
|
+
...(thinkingDisplayOverride === undefined
|
|
286
|
+
? {}
|
|
287
|
+
: { thinkingDisplayOverride }),
|
|
152
288
|
});
|
|
153
289
|
}
|
|
154
290
|
const suppressed = new Set(validateAdditionalBetas(input.suppressBetas));
|
|
@@ -163,6 +299,11 @@ export function composeBetasWithAudit(input, profile = CLAUDE_CODE_2_1_195_PROFI
|
|
|
163
299
|
return Object.freeze({
|
|
164
300
|
betas: Object.freeze(kept),
|
|
165
301
|
suppressedBetaNames: Object.freeze(removed),
|
|
302
|
+
// The suppression filter above touches only the header list; the body
|
|
303
|
+
// half of the site-12b pair survives it by design.
|
|
304
|
+
...(thinkingDisplayOverride === undefined
|
|
305
|
+
? {}
|
|
306
|
+
: { thinkingDisplayOverride }),
|
|
166
307
|
});
|
|
167
308
|
}
|
|
168
309
|
//# sourceMappingURL=betas.js.map
|
package/dist/betas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betas.js","sourceRoot":"","sources":["../src/betas.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"betas.js","sourceRoot":"","sources":["../src/betas.ts"],"names":[],"mappings":"AAAA,4CAA4C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