@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/dist/system-prompt.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
import { MAX_INPUT_SIZE } from "./limits.js";
|
|
2
3
|
import { ClaudeCodeWireError } from "./contracts.js";
|
|
3
|
-
import {
|
|
4
|
+
import { inspectText, TEXT_POLICY_PROSE } from "./unicode.js";
|
|
5
|
+
import { violationDetails } from "./violation.js";
|
|
4
6
|
/**
|
|
5
7
|
* The pinned identity text, byte-exact.
|
|
6
8
|
*
|
|
@@ -18,26 +20,15 @@ import { classifySurrogateAt } from "./unicode.js";
|
|
|
18
20
|
*/
|
|
19
21
|
export const IDENTITY_TEXT = "You are Claude Code, Anthropic's official CLI for Claude.";
|
|
20
22
|
const MAX_INPUT_DEPTH = 64;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
throw new ClaudeCodeWireError(code);
|
|
23
|
+
function fail(code, safeDetails = {}) {
|
|
24
|
+
throw new ClaudeCodeWireError(code, safeDetails);
|
|
24
25
|
}
|
|
25
|
-
function validateText(text) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
codeUnit !== 0x0a &&
|
|
32
|
-
codeUnit !== 0x0d) ||
|
|
33
|
-
(codeUnit >= 0x7f && codeUnit <= 0x9f)) {
|
|
34
|
-
fail("INVALID_UNICODE");
|
|
35
|
-
}
|
|
36
|
-
const classification = classifySurrogateAt(text, index);
|
|
37
|
-
if (classification === "loneSurrogate")
|
|
38
|
-
fail("INVALID_UNICODE");
|
|
39
|
-
if (classification === "surrogatePair")
|
|
40
|
-
index += 1;
|
|
26
|
+
function validateText(text, path, inKey) {
|
|
27
|
+
// Body prose policy (P1.T1): the system field follows the same rule as
|
|
28
|
+
// every other body lane — only lone surrogates are rejected.
|
|
29
|
+
const violation = inspectText(text, TEXT_POLICY_PROSE);
|
|
30
|
+
if (violation !== null) {
|
|
31
|
+
fail("INVALID_UNICODE", violationDetails(violation, path, text.length, inKey));
|
|
41
32
|
}
|
|
42
33
|
}
|
|
43
34
|
function isUnknownRecord(value) {
|
|
@@ -46,6 +37,7 @@ function isUnknownRecord(value) {
|
|
|
46
37
|
function validateStructure(value) {
|
|
47
38
|
const ancestors = new WeakSet();
|
|
48
39
|
let size = 0;
|
|
40
|
+
const path = ["system"];
|
|
49
41
|
function visit(current, depth) {
|
|
50
42
|
if (depth > MAX_INPUT_DEPTH)
|
|
51
43
|
fail("INPUT_TOO_DEEP");
|
|
@@ -53,7 +45,7 @@ function validateStructure(value) {
|
|
|
53
45
|
size += current.length;
|
|
54
46
|
if (size > MAX_INPUT_SIZE)
|
|
55
47
|
fail("INPUT_TOO_LARGE");
|
|
56
|
-
validateText(current);
|
|
48
|
+
validateText(current, path, false);
|
|
57
49
|
return;
|
|
58
50
|
}
|
|
59
51
|
if (!isUnknownRecord(current))
|
|
@@ -62,13 +54,22 @@ function validateStructure(value) {
|
|
|
62
54
|
fail("CYCLIC_INPUT");
|
|
63
55
|
ancestors.add(current);
|
|
64
56
|
for (const key of Reflect.ownKeys(current)) {
|
|
57
|
+
// Only ARRAY indices become numeric segments (QA F1/F4); object keys
|
|
58
|
+
// stay strings and digits inside them render as `*`.
|
|
59
|
+
const segment = typeof key !== "string"
|
|
60
|
+
? "*"
|
|
61
|
+
: Array.isArray(current) && /^(?:0|[1-9]\d{0,5})$/u.test(key)
|
|
62
|
+
? Number(key)
|
|
63
|
+
: key;
|
|
64
|
+
path.push(segment);
|
|
65
65
|
if (typeof key === "string") {
|
|
66
66
|
size += key.length;
|
|
67
67
|
if (size > MAX_INPUT_SIZE)
|
|
68
68
|
fail("INPUT_TOO_LARGE");
|
|
69
|
-
validateText(key);
|
|
69
|
+
validateText(key, path, true);
|
|
70
70
|
}
|
|
71
71
|
visit(current[key], depth + 1);
|
|
72
|
+
path.pop();
|
|
72
73
|
}
|
|
73
74
|
ancestors.delete(current);
|
|
74
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA,4CAA4C;
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","s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BACtB,GAAG,GAAG,KAAK,CAAC;YACd,CAAC;iBAAM,IAAI,iBAAiB,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;gBACrE,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACnC,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACjB,GAAG,GAAG,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QACD,IAAI,GAAG,KAAK,SAAS;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/thinking.d.ts
CHANGED
|
@@ -57,7 +57,12 @@ export interface ResolvedThinking {
|
|
|
57
57
|
* suppresses `temperature`, matching upstream `nr`.
|
|
58
58
|
*/
|
|
59
59
|
readonly requestActive: boolean;
|
|
60
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Whether a forced `tool_choice` (type `tool` or `any`) must be demoted to
|
|
62
|
+
* `auto`. Upstream demotes only `tool`; demoting `any` as well is a
|
|
63
|
+
* deliberate divergence, because the API rejects any forced tool choice
|
|
64
|
+
* while extended thinking is on (see `MEMORY.md`, 2026-09-24).
|
|
65
|
+
*/
|
|
61
66
|
readonly extendedThinkingActive: boolean;
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
@@ -142,6 +147,45 @@ export declare function clampMaxTokens(requested: number, normalizedId: string,
|
|
|
142
147
|
* false here and is rejected later by `buildCanonicalBody`.
|
|
143
148
|
*/
|
|
144
149
|
export declare function isThinkingDisplayActive(request: unknown, capabilities: ClaudeCodeCapabilities, betaPolicy: ClaudeCodeBetaPolicy): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* The three thinking types the resolver can emit, or `undefined` when no
|
|
152
|
+
* `thinking` object reaches the wire at all.
|
|
153
|
+
*/
|
|
154
|
+
export type ResolvedThinkingType = "adaptive" | "enabled" | "disabled";
|
|
155
|
+
/**
|
|
156
|
+
* Decides WHICH thinking object `resolveThinking` will emit, without building
|
|
157
|
+
* it.
|
|
158
|
+
*
|
|
159
|
+
* Split out of `resolveThinking` so that beta composition and body emission
|
|
160
|
+
* answer the same question from one place. A second, independently written
|
|
161
|
+
* copy of this predicate is exactly how a beta header and the body field it
|
|
162
|
+
* is coupled to drift apart.
|
|
163
|
+
*/
|
|
164
|
+
export declare function resolveThinkingType(requestType: ThinkingRequest["type"] | undefined, capabilities: ClaudeCodeCapabilities): ResolvedThinkingType | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Upstream `ac = Kg && Fg() && iQt(model)`, the predicate the 2.1.280 thinking
|
|
167
|
+
* push sites gate on, with `Fg()` (`experimentalBetasEnabled`) factored OUT.
|
|
168
|
+
*
|
|
169
|
+
* Every push site conjoins the experimental gate itself, so folding it in here
|
|
170
|
+
* would count it twice and make the one site that legitimately does not want it
|
|
171
|
+
* impossible to express. `Kg`'s environment-disable term is not modelled: this
|
|
172
|
+
* package reads no environment.
|
|
173
|
+
*
|
|
174
|
+
* This is deliberately NOT `ResolvedThinking.requestActive`. That one is true
|
|
175
|
+
* whenever the caller asked for thinking at all, including for a model whose
|
|
176
|
+
* capabilities emit no thinking object — which would ship a thinking beta
|
|
177
|
+
* header for a body that carries no thinking block.
|
|
178
|
+
*
|
|
179
|
+
* Upstream `ac` conjoins only the interleaved predicate `iQt`; requiring a
|
|
180
|
+
* resolved `"adaptive"`/`"enabled"` type additionally requires
|
|
181
|
+
* `capabilities.thinking`, one conjunct more than upstream. That extra term is
|
|
182
|
+
* unobservable in practice: `supportsThinking` and `supportsInterleavedThinking`
|
|
183
|
+
* in `model-capabilities.ts` are the same expression, so no derived capability
|
|
184
|
+
* set separates them. Only an explicit caller capability override can, and then
|
|
185
|
+
* the package declines to announce a thinking beta for a request whose body
|
|
186
|
+
* will carry no thinking object.
|
|
187
|
+
*/
|
|
188
|
+
export declare function isThinkingActive(request: unknown, capabilities: ClaudeCodeCapabilities): boolean;
|
|
145
189
|
/**
|
|
146
190
|
* Resolves the caller's thinking request into the object the genuine client
|
|
147
191
|
* would put on the wire.
|
|
@@ -150,6 +194,13 @@ export declare function isThinkingDisplayActive(request: unknown, capabilities:
|
|
|
150
194
|
* for the enabled branch — `budget_tokens` FIRST — and `{type, display}` for
|
|
151
195
|
* adaptive. Serialised bodies are compared byte for byte, so the insertion
|
|
152
196
|
* order below must not be rearranged.
|
|
197
|
+
*
|
|
198
|
+
* `displayOverride` is the body-side half of beta push site 12b
|
|
199
|
+
* (`thinkingDisplayOverride` from `composeBetasWithAudit`); it is not
|
|
200
|
+
* caller-facing, which is why `ThinkingDisplay` stays unwidened. When both it
|
|
201
|
+
* and a caller display are present the override wins -- a combination the
|
|
202
|
+
* composition guard makes unreachable, since site 12b requires that the caller
|
|
203
|
+
* supplied no display.
|
|
153
204
|
*/
|
|
154
|
-
export declare function resolveThinking(request: ThinkingRequest | undefined, normalizedId: string, capabilities: ClaudeCodeCapabilities, betaPolicy: ClaudeCodeBetaPolicy, maxTokens: number, profile?: ClaudeCodeProtocolProfile): ResolvedThinking;
|
|
205
|
+
export declare function resolveThinking(request: ThinkingRequest | undefined, normalizedId: string, capabilities: ClaudeCodeCapabilities, betaPolicy: ClaudeCodeBetaPolicy, maxTokens: number, profile?: ClaudeCodeProtocolProfile, displayOverride?: "updates"): ResolvedThinking;
|
|
155
206
|
//# sourceMappingURL=thinking.d.ts.map
|
package/dist/thinking.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../src/thinking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,gFAAgF;A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,EAAE,oBAAoB,EAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,yBAAuD,EAChE,eAAe,CAAC,EAAE,SAAS,GAC1B,gBAAgB,CA2ElB"}
|
package/dist/thinking.js
CHANGED
|
@@ -176,6 +176,72 @@ export function isThinkingDisplayActive(request, capabilities, betaPolicy) {
|
|
|
176
176
|
capabilities.interleavedThinking &&
|
|
177
177
|
betaPolicy.experimentalBetasEnabled);
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Narrows an unvalidated caller `thinking` value to its `type` literal.
|
|
181
|
+
*
|
|
182
|
+
* Deliberately tolerant of unvalidated input for the same reason
|
|
183
|
+
* `isThinkingDisplayActive` is: beta composition asks this question before
|
|
184
|
+
* `buildCanonicalBody` has validated the shape. Anything malformed answers
|
|
185
|
+
* `undefined` here and is rejected later by the body validator.
|
|
186
|
+
*/
|
|
187
|
+
function thinkingRequestType(request) {
|
|
188
|
+
if (request === null || typeof request !== "object")
|
|
189
|
+
return undefined;
|
|
190
|
+
const type = request["type"];
|
|
191
|
+
if (type === "enabled" || type === "adaptive" || type === "disabled") {
|
|
192
|
+
return type;
|
|
193
|
+
}
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Decides WHICH thinking object `resolveThinking` will emit, without building
|
|
198
|
+
* it.
|
|
199
|
+
*
|
|
200
|
+
* Split out of `resolveThinking` so that beta composition and body emission
|
|
201
|
+
* answer the same question from one place. A second, independently written
|
|
202
|
+
* copy of this predicate is exactly how a beta header and the body field it
|
|
203
|
+
* is coupled to drift apart.
|
|
204
|
+
*/
|
|
205
|
+
export function resolveThinkingType(requestType, capabilities) {
|
|
206
|
+
const requestActive = requestType !== undefined && requestType !== "disabled";
|
|
207
|
+
if (requestActive && capabilities.thinking) {
|
|
208
|
+
return capabilities.adaptiveThinking ? "adaptive" : "enabled";
|
|
209
|
+
}
|
|
210
|
+
if (requestType === "disabled" &&
|
|
211
|
+
capabilities.thinking &&
|
|
212
|
+
!capabilities.rejectsDisabledThinking) {
|
|
213
|
+
return "disabled";
|
|
214
|
+
}
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Upstream `ac = Kg && Fg() && iQt(model)`, the predicate the 2.1.280 thinking
|
|
219
|
+
* push sites gate on, with `Fg()` (`experimentalBetasEnabled`) factored OUT.
|
|
220
|
+
*
|
|
221
|
+
* Every push site conjoins the experimental gate itself, so folding it in here
|
|
222
|
+
* would count it twice and make the one site that legitimately does not want it
|
|
223
|
+
* impossible to express. `Kg`'s environment-disable term is not modelled: this
|
|
224
|
+
* package reads no environment.
|
|
225
|
+
*
|
|
226
|
+
* This is deliberately NOT `ResolvedThinking.requestActive`. That one is true
|
|
227
|
+
* whenever the caller asked for thinking at all, including for a model whose
|
|
228
|
+
* capabilities emit no thinking object — which would ship a thinking beta
|
|
229
|
+
* header for a body that carries no thinking block.
|
|
230
|
+
*
|
|
231
|
+
* Upstream `ac` conjoins only the interleaved predicate `iQt`; requiring a
|
|
232
|
+
* resolved `"adaptive"`/`"enabled"` type additionally requires
|
|
233
|
+
* `capabilities.thinking`, one conjunct more than upstream. That extra term is
|
|
234
|
+
* unobservable in practice: `supportsThinking` and `supportsInterleavedThinking`
|
|
235
|
+
* in `model-capabilities.ts` are the same expression, so no derived capability
|
|
236
|
+
* set separates them. Only an explicit caller capability override can, and then
|
|
237
|
+
* the package declines to announce a thinking beta for a request whose body
|
|
238
|
+
* will carry no thinking object.
|
|
239
|
+
*/
|
|
240
|
+
export function isThinkingActive(request, capabilities) {
|
|
241
|
+
const type = resolveThinkingType(thinkingRequestType(request), capabilities);
|
|
242
|
+
return ((type === "adaptive" || type === "enabled") &&
|
|
243
|
+
capabilities.interleavedThinking);
|
|
244
|
+
}
|
|
179
245
|
/**
|
|
180
246
|
* Resolves the caller's thinking request into the object the genuine client
|
|
181
247
|
* would put on the wire.
|
|
@@ -184,43 +250,75 @@ export function isThinkingDisplayActive(request, capabilities, betaPolicy) {
|
|
|
184
250
|
* for the enabled branch — `budget_tokens` FIRST — and `{type, display}` for
|
|
185
251
|
* adaptive. Serialised bodies are compared byte for byte, so the insertion
|
|
186
252
|
* order below must not be rearranged.
|
|
253
|
+
*
|
|
254
|
+
* `displayOverride` is the body-side half of beta push site 12b
|
|
255
|
+
* (`thinkingDisplayOverride` from `composeBetasWithAudit`); it is not
|
|
256
|
+
* caller-facing, which is why `ThinkingDisplay` stays unwidened. When both it
|
|
257
|
+
* and a caller display are present the override wins -- a combination the
|
|
258
|
+
* composition guard makes unreachable, since site 12b requires that the caller
|
|
259
|
+
* supplied no display.
|
|
187
260
|
*/
|
|
188
|
-
export function resolveThinking(request, normalizedId, capabilities, betaPolicy, maxTokens, profile = CLAUDE_CODE_2_1_195_PROFILE) {
|
|
261
|
+
export function resolveThinking(request, normalizedId, capabilities, betaPolicy, maxTokens, profile = CLAUDE_CODE_2_1_195_PROFILE, displayOverride) {
|
|
189
262
|
// Upstream `nr = n.type !== "disabled" && !CLAUDE_CODE_DISABLE_THINKING`.
|
|
190
263
|
const requestActive = request !== undefined && request.type !== "disabled";
|
|
191
264
|
const displayActive = isThinkingDisplayActive(request, capabilities, betaPolicy);
|
|
192
265
|
const display = displayActive ? request?.display : undefined;
|
|
266
|
+
const resolvedType = resolveThinkingType(request?.type, capabilities);
|
|
193
267
|
let emitted;
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
// overridden by the caller's budget when supplied, then clamped by
|
|
203
|
-
// `Tr = Math.min(Fi - 1, Tr)` where `Fi` is the emitted `max_tokens`.
|
|
204
|
-
//
|
|
205
|
-
// This is the one wire-visible consumer of the request-derived bound: on
|
|
206
|
-
// a 2.1.222+ profile a caller asking for a `max_tokens` above the
|
|
207
|
-
// catalogue's upper limit seeds the default budget from THEIR number
|
|
208
|
-
// minus one, not from the catalogue's.
|
|
209
|
-
const requested = request.budgetTokens ??
|
|
210
|
-
modelOutputTokenLimits(normalizedId, profile, maxTokens).upperLimit - 1;
|
|
211
|
-
emitted = { budget_tokens: Math.min(maxTokens - 1, requested) };
|
|
212
|
-
emitted["type"] = "enabled";
|
|
213
|
-
if (display !== undefined)
|
|
214
|
-
emitted["display"] = display;
|
|
215
|
-
}
|
|
268
|
+
if (resolvedType === "adaptive") {
|
|
269
|
+
emitted = { type: "adaptive" };
|
|
270
|
+
if (display !== undefined)
|
|
271
|
+
emitted["display"] = display;
|
|
272
|
+
// Assignment, not reconstruction: an existing key keeps its position and a
|
|
273
|
+
// new one appends last, matching upstream `{...yc, display: "updates"}`.
|
|
274
|
+
if (displayOverride !== undefined)
|
|
275
|
+
emitted["display"] = displayOverride;
|
|
216
276
|
}
|
|
217
|
-
else if (
|
|
218
|
-
|
|
219
|
-
|
|
277
|
+
else if (resolvedType === "enabled") {
|
|
278
|
+
// Transcribed from the 2.1.280 analysis document:
|
|
279
|
+
// let hf = mlo(_e);
|
|
280
|
+
// if (r.type === "enabled" && r.budgetTokens !== void 0) hf = r.budgetTokens;
|
|
281
|
+
// hf = Math.max(1024, Math.min(Rv - 1, hf));
|
|
282
|
+
// The default budget is the model's upper limit minus one. The caller's
|
|
283
|
+
// `budgetTokens` replaces it only when the caller itself declared an
|
|
284
|
+
// `enabled` request -- the guard reads the caller's raw `type`, not the
|
|
285
|
+
// resolved one, so an `adaptive` request downgraded to `enabled` on a
|
|
286
|
+
// model without adaptive thinking ignores its budget. The result is
|
|
287
|
+
// clamped to the emitted `max_tokens` minus one, and the floor of 1024 is
|
|
288
|
+
// applied after that clamp, so the floor wins when the two conflict.
|
|
289
|
+
//
|
|
290
|
+
// No older analysis document in this repository transcribes this
|
|
291
|
+
// computation at all, so the floor and the type guard are evidenced for
|
|
292
|
+
// 2.1.280 only. They are applied to every profile as one shared
|
|
293
|
+
// behaviour -- the same deliberate choice already made for the model-id
|
|
294
|
+
// normalizer ladder -- and nothing here asserts whether older clients
|
|
295
|
+
// had them.
|
|
296
|
+
//
|
|
297
|
+
// This is the one wire-visible consumer of the request-derived bound: on
|
|
298
|
+
// a 2.1.222+ profile a caller asking for a `max_tokens` above the
|
|
299
|
+
// catalogue's upper limit seeds the default budget from THEIR number
|
|
300
|
+
// minus one, not from the catalogue's.
|
|
301
|
+
const callerBudget = request?.type === "enabled" ? request.budgetTokens : undefined;
|
|
302
|
+
const requested = callerBudget ??
|
|
303
|
+
modelOutputTokenLimits(normalizedId, profile, maxTokens).upperLimit - 1;
|
|
304
|
+
emitted = {
|
|
305
|
+
budget_tokens: Math.max(1024, Math.min(maxTokens - 1, requested)),
|
|
306
|
+
};
|
|
307
|
+
emitted["type"] = "enabled";
|
|
308
|
+
if (display !== undefined)
|
|
309
|
+
emitted["display"] = display;
|
|
310
|
+
// Same in-place assignment as the adaptive arm: order stays
|
|
311
|
+
// `budget_tokens, type, display`.
|
|
312
|
+
if (displayOverride !== undefined)
|
|
313
|
+
emitted["display"] = displayOverride;
|
|
314
|
+
}
|
|
315
|
+
else if (resolvedType === "disabled") {
|
|
220
316
|
emitted = { type: "disabled" };
|
|
221
317
|
}
|
|
222
318
|
// Upstream `Jr = Xn?.type === "enabled" || Xn?.type === "adaptive"
|
|
223
319
|
// || Xn === void 0 && U4e(u)`.
|
|
320
|
+
// Upstream uses this to demote `tool_choice` of type `tool`; the
|
|
321
|
+
// request body also demotes type `any` on it, a documented divergence.
|
|
224
322
|
const extendedThinkingActive = emitted?.["type"] === "enabled" ||
|
|
225
323
|
emitted?.["type"] === "adaptive" ||
|
|
226
324
|
(emitted === undefined && capabilities.rejectsDisabledThinking);
|
package/dist/thinking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinking.js","sourceRoot":"","sources":["../src/thinking.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAO5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,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ogatePair" | "loneSu
|
|
|
7
7
|
* a negated in-range test rather than an out-of-range test.
|
|
8
8
|
*/
|
|
9
9
|
export declare function classifySurrogateAt(value: string, index: number): SurrogateClassification;
|
|
10
|
+
export type TextViolationReason = "control-char" | "lone-surrogate";
|
|
11
|
+
/**
|
|
12
|
+
* One character-level policy violation found while screening a string.
|
|
13
|
+
*
|
|
14
|
+
* `offset` is the UTF-16 code-unit index of the offending unit and `codeUnit`
|
|
15
|
+
* is the unit itself. Both are safe diagnostics: offsets are numbers and the
|
|
16
|
+
* only code units ever reported are control characters or surrogate halves,
|
|
17
|
+
* never prose content.
|
|
18
|
+
*/
|
|
19
|
+
export interface TextViolation {
|
|
20
|
+
readonly reason: TextViolationReason;
|
|
21
|
+
readonly offset: number;
|
|
22
|
+
readonly codeUnit: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Character-level acceptance policy for one string lane.
|
|
26
|
+
*
|
|
27
|
+
* `rejectControls` rejects every C0 control except TAB (0x09), LF (0x0A) and
|
|
28
|
+
* CR (0x0D), plus DEL (0x7F). Lone surrogates are always rejected, rather than
|
|
29
|
+
* depending on whether a caller serializes or directly encodes the string.
|
|
30
|
+
*/
|
|
31
|
+
export interface TextPolicy {
|
|
32
|
+
readonly rejectControls: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Body prose: every well-formed UTF-16 string is accepted. */
|
|
35
|
+
export declare const TEXT_POLICY_PROSE: TextPolicy;
|
|
36
|
+
/**
|
|
37
|
+
* Identifier graph screening: C0 except TAB/LF/CR, plus DEL, plus lone
|
|
38
|
+
* surrogates. This is exactly the set the graph inspectors rejected before the
|
|
39
|
+
* shared validator existed.
|
|
40
|
+
*/
|
|
41
|
+
export declare const TEXT_POLICY_IDENTIFIER: TextPolicy;
|
|
42
|
+
/**
|
|
43
|
+
* Screens one string under `policy`, returning the first violation or null.
|
|
44
|
+
*
|
|
45
|
+
* The walk order matches the historical per-module inspectors: at each index
|
|
46
|
+
* the control check runs before the surrogate check, and a well-formed pair
|
|
47
|
+
* consumes two code units. `classifySurrogateAt` is the single surrogate
|
|
48
|
+
* authority; this function never re-implements it.
|
|
49
|
+
*/
|
|
50
|
+
export declare function inspectText(value: string, policy: TextPolicy): TextViolation | null;
|
|
10
51
|
//# sourceMappingURL=unicode.d.ts.map
|
package/dist/unicode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicode.d.ts","sourceRoot":"","sources":["../src/unicode.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GACjC,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,uBAAuB,CAQzB"}
|
|
1
|
+
{"version":3,"file":"unicode.d.ts","sourceRoot":"","sources":["../src/unicode.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GACjC,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,uBAAuB,CAQzB;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,EAAE,UAE9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAEnC,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,UAAU,GACjB,aAAa,GAAG,IAAI,CAiBtB"}
|
package/dist/unicode.js
CHANGED
|
@@ -16,4 +16,41 @@ export function classifySurrogateAt(value, index) {
|
|
|
16
16
|
return "loneSurrogate";
|
|
17
17
|
return "notSurrogate";
|
|
18
18
|
}
|
|
19
|
+
/** Body prose: every well-formed UTF-16 string is accepted. */
|
|
20
|
+
export const TEXT_POLICY_PROSE = Object.freeze({
|
|
21
|
+
rejectControls: false,
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Identifier graph screening: C0 except TAB/LF/CR, plus DEL, plus lone
|
|
25
|
+
* surrogates. This is exactly the set the graph inspectors rejected before the
|
|
26
|
+
* shared validator existed.
|
|
27
|
+
*/
|
|
28
|
+
export const TEXT_POLICY_IDENTIFIER = Object.freeze({
|
|
29
|
+
rejectControls: true,
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Screens one string under `policy`, returning the first violation or null.
|
|
33
|
+
*
|
|
34
|
+
* The walk order matches the historical per-module inspectors: at each index
|
|
35
|
+
* the control check runs before the surrogate check, and a well-formed pair
|
|
36
|
+
* consumes two code units. `classifySurrogateAt` is the single surrogate
|
|
37
|
+
* authority; this function never re-implements it.
|
|
38
|
+
*/
|
|
39
|
+
export function inspectText(value, policy) {
|
|
40
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
41
|
+
const unit = value.charCodeAt(index);
|
|
42
|
+
if (policy.rejectControls &&
|
|
43
|
+
((unit <= 0x1f && unit !== 0x09 && unit !== 0x0a && unit !== 0x0d) ||
|
|
44
|
+
unit === 0x7f)) {
|
|
45
|
+
return { reason: "control-char", offset: index, codeUnit: unit };
|
|
46
|
+
}
|
|
47
|
+
const classification = classifySurrogateAt(value, index);
|
|
48
|
+
if (classification === "loneSurrogate") {
|
|
49
|
+
return { reason: "lone-surrogate", offset: index, codeUnit: unit };
|
|
50
|
+
}
|
|
51
|
+
if (classification === "surrogatePair")
|
|
52
|
+
index += 1;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
19
56
|
//# sourceMappingURL=unicode.js.map
|
package/dist/unicode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicode.js","sourceRoot":"","sources":["../src/unicode.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAK5C;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAa,EACb,KAAa;IAEb,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;IAC9E,CAAC;IACD,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,eAAe,CAAC;IAC7D,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"unicode.js","sourceRoot":"","sources":["../src/unicode.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAK5C;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAa,EACb,KAAa;IAEb,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe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CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TextViolation } from "./unicode.js";
|
|
2
|
+
export declare const VIOLATION_REASONS: ReadonlySet<string>;
|
|
3
|
+
export type ViolationPathSegment = string | number;
|
|
4
|
+
/**
|
|
5
|
+
* Renders a pointer-like path (`/messages/0/content`) from walk segments.
|
|
6
|
+
* At most 16 segments, then a trailing `/...`; at most 256 characters.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatViolationPath(segments: readonly ViolationPathSegment[]): string;
|
|
9
|
+
export declare function isValidViolationReason(value: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Revalidates a formatted violation path for the redaction allowlist. Every
|
|
12
|
+
* segment must be a vocabulary key, a decimal index of at most 6 digits, `*`,
|
|
13
|
+
* or the single trailing truncation marker; the whole string is capped.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isValidViolationPath(value: string): boolean;
|
|
16
|
+
/** Numeric range guard for `violationCodeUnit`: controls or surrogates only. */
|
|
17
|
+
export declare function isValidViolationCodeUnit(value: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Builds the safeDetails record for one text violation found at `path`.
|
|
20
|
+
* `inKey` distinguishes an offending object key from an offending value.
|
|
21
|
+
*/
|
|
22
|
+
export declare function violationDetails(violation: TextViolation, path: readonly ViolationPathSegment[], textLength: number, inKey: boolean): Readonly<Record<string, string | number | boolean>>;
|
|
23
|
+
//# sourceMappingURL=violation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"violation.d.ts","sourceRoot":"","sources":["../src/violation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAYlD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAGhD,CAAC;AA2GH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAcnD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,GACxC,MAAM,CAgBR;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7D;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAqB3D;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,SAAS,oBAAoB,EAAE,EACrC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,GACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CASrD"}
|