@aeye/core 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -521,6 +521,7 @@ The descriptor's full field list is exported as the `FormatDescriptor` interface
521
521
  | `optionalAsNullable` | Whether `optional` fields are emitted as `T \| null` (OpenAI strict) vs omitted from `required[]`. |
522
522
  | `supportsRecursion` | Whether `$ref` self-reference works under this dialect. |
523
523
  | `maxStrictTools` / `maxStrictOptionalParams` / `maxStrictUnionTypes` | Per-request budget caps; `undefined` means no documented limit. |
524
+ | `schemaSizeLimits` | Per-SCHEMA size ceilings (properties, nesting, total string characters, enum values); `undefined` means no documented limit. An over-size schema degrades on its own, even when it asked for `strict: true`. |
524
525
 
525
526
  You don't need to set every field — spread an existing descriptor and override deltas. Tested via `analyzeSchema` + the schema test suite; see the strict-mode guide in `@aeye/docs` for end-to-end examples.
526
527
 
@@ -29,11 +29,61 @@ A descriptor (see `src/schema.ts` line ~26 for the fully documented interface) d
29
29
  | `tupleEncoding` | `'object-numeric-keys'` vs `'prefix-items'` vs `'items-union'`. |
30
30
  | `optionalAsNullable` | Emit optionals as `T \| null` (OpenAI strict) vs drop from `required[]`. |
31
31
  | `allowAllOf` / `allowAnyOf` / `allowOneOf` | Combinator support. |
32
- | `allowRootRef` / `allowDefsRef` | Whether `$ref: '#'` / `$ref: '#/$defs/X'` are permitted. |
32
+ | `allowRootRef` / `allowDefsRef` | Whether `$ref: '#'` / `$ref: '#/$defs/X'` are permitted. Under `allowDefsRef: false` the emitter never produces a `$defs` section at all: a shared node is **inlined** at each use site, and a non-root cycle takes the bounded placeholder (`supportsRecursion` alone does not license a `$ref` the descriptor cannot spell). |
33
33
  | `anyEncoding` | How `z.any()` / `z.unknown()` is emitted — see below. |
34
34
  | `supportedStringFormats` | `'all'` or a `Set<string>` whitelist. |
35
35
  | `supportsRecursion` | Whether `$ref` self-reference works. |
36
36
  | `maxStrictTools` / `maxStrictOptionalParams` / `maxStrictUnionTypes` | Per-request slot budgets (`undefined` = no documented limit). |
37
+ | `schemaSizeLimits` | Per-SCHEMA size ceilings — properties, nesting, total string characters, enum values (`undefined` = no documented limit) — see below. |
38
+ | `maxEnumValues` | Opt-in ceiling on how many values ONE emitted `enum` may carry (`undefined` = no cap, and that is what every built-in declares) — see below. |
39
+
40
+ ### `schemaSizeLimits` — how BIG one strict schema may be
41
+
42
+ Separate from the per-request slot budgets above: every bound here is a **sum over ONE schema** (one tool's `parameters`, or one structured-output schema), so no other item in the request can change the verdict. `SchemaBudget` therefore treats an over-size schema as a feasibility failure rather than a budget one — that single item degrades to the family's non-strict descriptor **even when it asked for `strict: true`**, and the rest of the request is untouched.
43
+
44
+ ```typescript
45
+ interface SchemaSizeLimits {
46
+ maxObjectProperties: number; // summed over every nesting level
47
+ maxNestingDepth: number; // levels of nested containers below the root
48
+ maxTotalStringChars: number; // property names + enum values + const values
49
+ maxTotalEnumValues: number; // summed across every enum property
50
+ largeEnumValueCount: number; // the single-enum value count above which…
51
+ maxLargeEnumStringChars: number; // …that one enum's string values are also bounded
52
+ }
53
+ ```
54
+
55
+ **`OPENAI_STRICT` is the only built-in that declares them**, because Structured Outputs is the only one of the three dialects that documents them. Verified against developers.openai.com "Supported schemas" on 2026-08-23: *"A schema may have up to 5000 object properties total, with up to 10 levels of nesting"*, *"total string length of all property names, definition names, enum values, and const values cannot exceed 120,000 characters"*, *"A schema may have up to 1000 enum values across all enum properties"*, and *"For a single enum property with string values, the total string length of all enum values cannot exceed 15,000 characters when there are more than 250 enum values"*. Every one of those was raised in July 2025 (100→5000 properties, 15,000→120,000 characters, 500→1000 enum values, 7,500→15,000 for the >250-value enum); the pre-raise numbers are still widely quoted secondhand.
56
+
57
+ Scope is Structured Outputs — a tool carrying `strict: true`, or a `json_schema` response format. Non-strict function calling is best-effort with no compiled decoder, which is exactly why degrading the offending item is a complete answer rather than a partial one.
58
+
59
+ `checkSchemaSizeLimits(schema, descriptor)` is the public form and returns one line per bound broken (empty = it fits, or the dialect publishes none) — the answer to "why did my tool silently stop being strict?".
60
+
61
+ The measurement is taken from the **Zod** schema rather than from the emitted JSON, so where an encoding is descriptor-dependent it counts the widest one (a record as its `{key, value}` pair form, a tuple as its numeric-key form). Over-counting costs strictness on a schema that would have fitted; under-counting costs an HTTP 400, so the rounding goes up. `$defs` entry names are not counted: they are generated at emit time, few, and short against a 120,000-character budget.
62
+
63
+ ### `maxEnumValues` — an opt-in dialect ceiling that WIDENS, and why no built-in sets one
64
+
65
+ Some providers may reject a schema whose `enum` is simply too long. That is **not** one of the per-request budgets above: those are strict-mode allowances the `SchemaBudget` spends across a whole request, degrading an item that no longer fits to the family's non-strict descriptor, whereas this one would fire whatever the strictness, so it is enforced structurally at the point an `enum` is emitted.
66
+
67
+ Over the cap the emitter **widens** — it does not truncate. It drops the `enum` keyword, emits the node's plain scalar `type`, and puts **every** value into the `description`:
68
+
69
+ ```jsonc
70
+ // z.enum([...20 values]) under a descriptor with maxEnumValues: 8
71
+ { "type": "string", "description": "One of these 20 values: name_0, name_1, …, name_19" }
72
+ ```
73
+
74
+ Truncating would make the values past the cap **unreachable** — the wire schema would constrain them away, so a caller whose 96 values are all legitimately selectable would lose 56 of them. Widening removes only the cardinality the dialect cannot compile, and the model keeps complete information. If the source schema carries its own `.describe()`, the value list is appended to it rather than replacing it.
75
+
76
+ The trade is enforcement: a widened node no longer rejects a value structurally, so whatever validates the model's output afterwards must. `Tool.parse` does — it runs against the ORIGINAL zod schema, whose `enum` is untouched — so a hallucinated member comes back as a normal, re-promptable validation error.
77
+
78
+ **No built-in descriptor declares a cap, and that is a measured result.** The field exists because a large `enum` was believed to make Gemini answer `400 INVALID_ARGUMENT`. Measured against `google/gemini-3-flash-preview` through OpenRouter (2026-08-23), it does not: single-parameter enums at 50/64/72/80/96/128/256/512/1024/**2048** values (52 KB of tool schema) all returned HTTP 200 with the expected tool call, under `tool_choice` both `required` (which is what makes Gemini compile a decoding grammar) and `auto` — as did 96 values with 80-character members, 20 tools each carrying a 96-value enum in one request, a 96-value enum next to `strict: true` / `minItems` / `propertyOrdering` / a sibling `anyOf`, and a 2048-value enum inside a `response_format` schema. Reliability was compared too, since a cap's whole cost is losing the enum's can't-hallucinate guarantee: 10 trials each of `enum` vs plain-string-with-full-list, over confusable near-duplicate names, at 96 and again at 512 values — both picked the correct member 10/10 with zero off-list answers.
79
+
80
+ A second pass answered the obvious objection — that an isolated probe is not what a real session sends. Same date and model, upstream **pinned to Google AI Studio** with fallbacks off (the upstream that served the production failures), an eleven-tool roster emitted through this library for a Google model and modelled on a real kind-authoring agent (`fn_load` / `fn_search` / `type_load` / `api_signature` / `api_set` / …, real descriptions, real system prompt): a 96-value enum on one of those tools returned 200 with the expected tool call under `tool_choice` `required` and `auto` alike, as did the same roster at 8 values and a tool carrying a bare typeless `{}` property.
81
+
82
+ The caveat that keeps that from being proof: the **control** — the recursive `$defs/Any` shape documented elsewhere in this file as 100% reproducible HTTP 400 — also returned 200, pinned and unpinned, forced and automatic, both hand-built and as the product's real 32 KB gin `api_set` schema. That failure class is not visible from this route today, so treat the numbers as evidence, not a verdict.
83
+
84
+ One trap for whoever measures this next: at `max_tokens: 64` the `$defs/Any` tool answered `finish_reason: "length"` with no tool call and empty content, which reads exactly like a grammar that produced nothing. It is not — this model spends reasoning tokens first, and at 400 the identical request emitted a correct call in 28 output tokens. Give a forced-tool probe room before calling an empty completion a failure.
85
+
86
+ So: **set this only against a measured provider rejection, and set it as high as the measurement allows.** An `enum` that fits is the more correct encoding, because it is the one the model cannot answer outside of.
37
87
 
38
88
  ### `anyEncoding` — and what each mode requires
39
89
 
@@ -80,8 +130,9 @@ strictPriority(requested: boolean | number | undefined): number
80
130
 
81
131
  - `toJSONSchema` accepts a descriptor, a `ToJSONSchemaOptions` object, or a boolean (back-compat: `true` ⇒ `OPENAI_STRICT`, `false` ⇒ `LENIENT`).
82
132
  - `strictify` rewrites a Zod schema in place per the descriptor (results cached in a WeakMap; same OOM-safe pattern as `analyzeSchema`).
83
- - `analyzeSchema` returns `SchemaFeatures`: `{ hasRecursion, optionalParameterCount, unionTypeCount, recordCount, tupleCount }` — cached per schema.
84
- - `checkDescriptorConsistency` reports settings that ask the emitter for a keyword the same descriptor forbids (today: `anyEncoding` vs `allowAnyOf` / `allowDefsRef` / `supportsRecursion`). `registerDescriptor` runs it and `console.warn`s each problem, because otherwise the first report of a contradiction is a provider HTTP 400.
133
+ - `analyzeSchema` returns `SchemaFeatures`: `{ hasRecursion, optionalParameterCount, unionTypeCount, recordCount, tupleCount, enums, objectPropertyCount, maxNestingDepth, stringSizeChars }` — cached per schema. The last four feed `schemaSizeLimits`; `enums` keeps a per-enum `{valueCount, stringValueChars}` breakdown because the large-enum character rule is conditional on that SAME enum's value count, which a pair of totals cannot answer.
134
+ - `checkSchemaSizeLimits(schema, descriptor)` reports the per-schema size bounds a schema breaks (see `schemaSizeLimits`).
135
+ - `checkDescriptorConsistency` reports settings that ask the emitter for a keyword the same descriptor forbids (`anyEncoding` vs `allowAnyOf` / `allowDefsRef` / `supportsRecursion`), or a limit that would quietly stop governing anything: a `maxEnumValues` below 1 or non-integer (which widens every enum the dialect emits), a non-positive `schemaSizeLimits` bound (which degrades every schema), a `largeEnumValueCount` at or above `maxTotalEnumValues` (unreachable rule), or size limits on a non-strict descriptor (the API applies none). `registerDescriptor` runs it and `console.warn`s each problem, because otherwise the first report of a contradiction is a provider HTTP 400.
85
136
 
86
137
  ```typescript
87
138
  import { OPENAI_STRICT, ANTHROPIC_STRICT, getDescriptor, toJSONSchema } from '@aeye/core';
@@ -103,11 +154,15 @@ toJSONSchema(schema, false); // === LENIENT
103
154
  `new SchemaBudget(descriptor)` allocates strict "slots" across a single request when a descriptor has per-request limits (e.g. Anthropic). Providers call:
104
155
 
105
156
  ```typescript
106
- budget.allocateTool(schema, requested): FormatDescriptor // returns strict or LENIENT, decrements
157
+ budget.allocateTool(schema, requested): FormatDescriptor // returns strict or the family's non-strict, decrements
107
158
  budget.allocateOutput(schema, requested): FormatDescriptor // output schema; consumes param/union budget, not a tool slot
108
159
  ```
109
160
 
110
- It returns `LENIENT` when `requested === false`, when the schema uses an unrepresentable feature, or when a positive-number request can't fit the remaining budget (priority order; `true` always wins subject to feasibility).
161
+ It falls back when `requested === false`, when the schema uses an unrepresentable feature, when the schema exceeds the dialect's `schemaSizeLimits`, or when a positive-number request can't fit the remaining budget (priority order; `true` always wins subject to *budget*, never subject to feasibility or size).
162
+
163
+ **The fallback is the descriptor's own family, non-strict — never the family-blind `LENIENT`.** A dialect rule can outlive strict mode: `GOOGLE_NON_STRICT` exists for exactly one such rule, the `unconstrained` encoding of `z.any()`, because Gemini compiles a decoding grammar whenever a tool call is forced and no per-tool `strict` flag is involved. Degrading to `LENIENT` put the self-referencing `$defs/Any` that encoding was created to avoid straight back on the Google wire — and did so for *every* schema that degrades, which under `GOOGLE_STRICT` (`allowAnyOf: false`) is every recursive gin/query program schema there is. For the other families the change is behaviour-neutral by construction: `OPENAI_NON_STRICT` / `ANTHROPIC_NON_STRICT` are `LENIENT` with a family tag, and a family that registers no non-strict variant resolves to `LENIENT`. Only the `descriptor` id pinned on the tool differs, and it round-trips through `getDescriptorById`.
164
+
165
+ "Unrepresentable" here means a **combinator the descriptor forbids** (`z.union` → `anyOf`, `z.intersection` → `allOf`), because nothing rewrites those away — a schema carrying one under `GOOGLE_STRICT` is a provider HTTP 400. **Recursion is not unrepresentable**: the emitter replaces any back-edge the descriptor cannot spell with a bounded placeholder, so a recursive schema stays strict (looser at the back-edge, never rejected). That is the difference between this check and `canExpress`, which additionally treats a widened back-edge as a reason to fall back — the right answer for a structured *output* (it can be delivered as prompt text instead) and the wrong one for a *tool* (it cannot).
111
166
 
112
167
  ## Registering a custom descriptor
113
168
 
package/dist/schema.d.ts CHANGED
@@ -11,6 +11,48 @@ import z from 'zod';
11
11
  * registry functions, model declarations, etc.
12
12
  */
13
13
  export type DescriptorFamily = 'openai' | 'anthropic' | 'google' | (string & {});
14
+ /**
15
+ * Documented ceilings on how BIG one strict schema may be, as opposed to which
16
+ * keywords it may use. Every limit here is a SUM taken over a single schema —
17
+ * one tool's `parameters`, or one structured-output schema — not a per-request
18
+ * allowance shared between them (that is `maxStrictTools` and friends, which
19
+ * the `SchemaBudget` spends across the whole request).
20
+ *
21
+ * A schema that exceeds one of these is a guaranteed provider rejection under
22
+ * strict mode, so `SchemaBudget.allocate` treats it like any other
23
+ * infeasibility and degrades that ONE item to the family's non-strict
24
+ * descriptor, where no size rule applies. The rest of the request is
25
+ * unaffected.
26
+ *
27
+ * Declared as one object rather than six optional fields on purpose: a
28
+ * provider documents these together, and the object being present is what says
29
+ * "this dialect publishes size limits". Adding a rule here is then a compile
30
+ * error at every descriptor that declares the group, which is the point
31
+ * (a missed limit is invisible until a 400).
32
+ */
33
+ export interface SchemaSizeLimits {
34
+ /** Maximum object properties in one schema, summed over every nesting level. */
35
+ readonly maxObjectProperties: number;
36
+ /** Maximum levels of nested containers below the schema root. */
37
+ readonly maxNestingDepth: number;
38
+ /**
39
+ * Maximum total characters over the schema's property names, `enum` values
40
+ * and `const` values together.
41
+ */
42
+ readonly maxTotalStringChars: number;
43
+ /** Maximum `enum` values summed across every enum property in one schema. */
44
+ readonly maxTotalEnumValues: number;
45
+ /**
46
+ * The single-enum value count above which `maxLargeEnumStringChars` starts
47
+ * to apply. A smaller enum is bounded only by the two totals above.
48
+ */
49
+ readonly largeEnumValueCount: number;
50
+ /**
51
+ * Maximum total characters of ONE enum's string values, applied only to an
52
+ * enum carrying more than `largeEnumValueCount` values.
53
+ */
54
+ readonly maxLargeEnumStringChars: number;
55
+ }
14
56
  /**
15
57
  * Format descriptor — describes the JSON Schema dialect of a target.
16
58
  *
@@ -95,6 +137,107 @@ export interface FormatDescriptor {
95
137
  readonly maxStrictOptionalParams?: number;
96
138
  /** Maximum total union-type parameters across all strict schemas in one request. */
97
139
  readonly maxStrictUnionTypes?: number;
140
+ /**
141
+ * Documented ceilings on the SIZE of one strict schema (properties, nesting,
142
+ * total string bytes, enum values), or `undefined` when the dialect
143
+ * publishes none. See {@link SchemaSizeLimits} for what each bound counts and
144
+ * why it is per-schema rather than per-request.
145
+ *
146
+ * Only a STRICT descriptor declares these: they are Structured-Outputs rules
147
+ * — the API compiles the schema into a decoder and rejects one it cannot —
148
+ * and a non-strict schema is a best-effort hint the API does not compile. So
149
+ * degrading the offending item to the family's non-strict descriptor is both
150
+ * the fix and the reason the limits stop applying to it
151
+ * (`SchemaBudget.allocate`, `checkSchemaSizeLimits`).
152
+ *
153
+ * The measurement is taken from the ZOD schema, not from the emitted JSON,
154
+ * so it is deliberately CONSERVATIVE where an encoding is descriptor-
155
+ * dependent (a record counts as its widest encoding, a tuple as its
156
+ * numeric-key one). Over-counting costs strictness on a schema that would
157
+ * have fit; under-counting costs an HTTP 400, so the round goes up.
158
+ */
159
+ readonly schemaSizeLimits?: SchemaSizeLimits;
160
+ /**
161
+ * Maximum number of values ONE emitted `enum` may carry, or `undefined`
162
+ * (the default) for no cap.
163
+ *
164
+ * This is deliberately NOT one of the per-request budget fields above. Those
165
+ * are strict-mode allowances the SchemaBudget spends across a whole request,
166
+ * degrading an item that no longer fits to the family's non-strict
167
+ * descriptor; this one is a property of the dialect itself — it fires whatever the strictness — so it is enforced
168
+ * structurally at the point an `enum` is emitted (`convertSchema`), where
169
+ * the cardinality is actually known.
170
+ *
171
+ * Over the cap the emitter **widens** rather than truncates: it drops the
172
+ * `enum` keyword entirely, emits the node's plain scalar `type`
173
+ * (`{type: 'string'}` for a string enum), and puts EVERY value into the
174
+ * node's `description`. Nothing becomes unreachable — the model still has
175
+ * the complete list and can name any member — and the cardinality the
176
+ * dialect could not compile is simply no longer on the wire.
177
+ *
178
+ * The trade this makes is enforcement: a widened node no longer rejects a
179
+ * value structurally, so whatever validates the model's output afterwards
180
+ * has to. `Tool.parse` does, against the ORIGINAL zod schema — the enum is
181
+ * still there, only the emitted JSON Schema widened — so a hallucinated
182
+ * member comes back as a normal, re-promptable validation error.
183
+ *
184
+ * **NO BUILT-IN DESCRIPTOR DECLARES A CAP, and that is a measured result, not
185
+ * an omission.** This field exists because a large `enum` was believed to make
186
+ * Gemini answer `400 INVALID_ARGUMENT`; measured against
187
+ * `google/gemini-3-flash-preview` through OpenRouter (2026-08-23), it does
188
+ * not. Every one of these returned HTTP 200 with the expected tool call, under
189
+ * `tool_choice` both `required` (which is what makes Gemini compile the tool
190
+ * schemas into a decoding grammar) and `auto`:
191
+ *
192
+ * - single-parameter `enum` at 50 / 64 / 72 / 80 / 96 / 128 / 256 / 512 /
193
+ * 1024 / **2048** values (52 KB of tool schema);
194
+ * - 96 values with 80-character members (byte size, not member count);
195
+ * - 20 tools each carrying a 96-value `enum` in one request (51 KB);
196
+ * - a 96-value `enum` alongside `strict: true`, alongside `minItems` on an
197
+ * array-of-enum, alongside `propertyOrdering`, alongside a sibling `anyOf`;
198
+ * - a 2048-value `enum` inside a `response_format` JSON schema.
199
+ *
200
+ * A second pass answered the obvious objection — that an isolated probe is
201
+ * not what a real session sends. Same date, same model, upstream PINNED to
202
+ * Google AI Studio with fallbacks off (the upstream that served the
203
+ * production failures), an eleven-tool roster emitted through this library
204
+ * for a Google model and modelled on a real kind-authoring agent
205
+ * (`fn_load`/`fn_search`/`type_load`/`api_signature`/`api_set`/…, real
206
+ * descriptions, a real system prompt): a 96-value enum on one of those tools
207
+ * returned 200 with the expected tool call under `tool_choice` `required`
208
+ * and `auto` alike, as did the same roster at 8 values and a tool carrying a
209
+ * bare typeless `{}` property.
210
+ *
211
+ * **Caveat that keeps this from being proof**: the CONTROL — the recursive
212
+ * `$defs/Any` shape this file recorded as "100% reproducible" HTTP 400 —
213
+ * also returned 200, pinned and unpinned, forced and automatic, both
214
+ * hand-built and as the product's real 32 KB gin `api_set` schema. So that
215
+ * failure class is simply not visible from this route today (upstream fixed
216
+ * it, or sanitizes), and a negative here is evidence, not a verdict. What it
217
+ * does establish is that nothing reachable from a request — isolated or
218
+ * realistic — reproduces an enum-size limit, so declaring a cap would trade
219
+ * real structural enforcement for an unverified one.
220
+ *
221
+ * One trap for whoever measures this next: with `max_tokens` at 64, the
222
+ * $defs/Any tool came back `finish_reason: 'length'` with no tool call and
223
+ * empty content, which reads exactly like a grammar that produced nothing.
224
+ * It is not — this model spends reasoning tokens first, and at 400 the same
225
+ * request emitted a correct call in 28 output tokens. Give a forced-tool
226
+ * probe room before calling an empty completion a failure.
227
+ *
228
+ * Reliability was compared too, since a cap's whole cost is losing the
229
+ * `enum`'s can't-hallucinate guarantee: same tool and paraphrased prompt,
230
+ * 10 trials each, `enum` vs plain string with the full list in the
231
+ * description, over confusable near-duplicate names. At 96 values and again
232
+ * at 512, both encodings picked the correct member 10/10 with zero off-list
233
+ * answers. No measured reliability gap — but also no measured reason to give
234
+ * up the guarantee.
235
+ *
236
+ * So: set this only where a provider is MEASURED to reject a large enum, and
237
+ * set it as high as the measurement allows. An `enum` that fits is the more
238
+ * correct encoding, because it is the one the model cannot answer outside of.
239
+ */
240
+ readonly maxEnumValues?: number;
98
241
  /**
99
242
  * Whether the descriptor can express recursive `$ref` schemas (`$ref: '#'`
100
243
  * to root, or any `$ref: '#/$defs/X'` whose target transitively references
@@ -141,10 +284,28 @@ export declare const LENIENT: FormatDescriptor;
141
284
  * tuples→numeric-keys, optional→nullable.
142
285
  *
143
286
  * No documented per-request slot limit (max strict tools / optional params /
144
- * union types). The SchemaBudget treats those caps as `undefined` (no limit)
145
- * for OpenAI; OpenAI's own ~5000-property and ~5-level-depth schema caps
146
- * aren't enforced here either — they're rare in practice and produce a
147
- * server-side rejection that the user can react to.
287
+ * union types) — the SchemaBudget treats those caps as `undefined` for OpenAI.
288
+ *
289
+ * OpenAI DOES document per-SCHEMA size limits for Structured Outputs, and they
290
+ * are declared below (`schemaSizeLimits`). Verified against
291
+ * developers.openai.com/api/docs/guides/structured-outputs on 2026-08-23,
292
+ * section "Supported schemas": *"A schema may have up to 5000 object
293
+ * properties total, with up to 10 levels of nesting"*, *"total string length of
294
+ * all property names, definition names, enum values, and const values cannot
295
+ * exceed 120,000 characters"*, *"A schema may have up to 1000 enum values
296
+ * across all enum properties"*, and *"For a single enum property with string
297
+ * values, the total string length of all enum values cannot exceed 15,000
298
+ * characters when there are more than 250 enum values"*. Every one of those
299
+ * numbers was raised in July 2025 (100→5000 properties, 15,000→120,000
300
+ * characters, 500→1000 enum values, 7,500→15,000 for the >250-value enum) —
301
+ * the pre-raise figures are still widely quoted secondhand, so they are named
302
+ * here to keep a future reader from "correcting" these downward.
303
+ *
304
+ * Scope is Structured Outputs, i.e. a tool carrying `strict: true` or a
305
+ * `json_schema` response format — the function-calling guide defines strict
306
+ * mode as "leveraging our structured outputs feature", and non-strict function
307
+ * calling is best-effort with no compiled decoder. That is exactly why
308
+ * degrading the over-size item to `OPENAI_NON_STRICT` is a complete answer.
148
309
  */
149
310
  export declare const OPENAI_STRICT: FormatDescriptor;
150
311
  /** OpenAI non-strict — alias of LENIENT but tagged with the openai family. */
@@ -192,10 +353,21 @@ export declare const ANTHROPIC_NON_STRICT: FormatDescriptor;
192
353
  * this descriptor used to declare was a schema it says it cannot emit.
193
354
  * Gemini compiles the tool schemas into a decoding grammar whenever the
194
355
  * caller forces a tool call (`toolChoice: 'required'` → Google's function
195
- * calling mode `ANY`), and a self-referencing `$defs/Any` fails that
196
- * compile with `400 INVALID_ARGUMENT` — the same request succeeds under
356
+ * calling mode `ANY`), and a self-referencing `$defs/Any` failed that
357
+ * compile with `400 INVALID_ARGUMENT` — the same request succeeded under
197
358
  * `toolChoice: 'auto'`, where no grammar is built. Reported against
198
- * `google/gemini-3-flash-preview` via OpenRouter, 100% reproducible.
359
+ * `google/gemini-3-flash-preview` via OpenRouter as 100% reproducible.
360
+ *
361
+ * **That 400 no longer reproduces (re-measured 2026-08-23)** and the
362
+ * encoding stays anyway. Same model, same route, upstream pinned to Google
363
+ * AI Studio with fallbacks off, `tool_choice` forced to one named tool: the
364
+ * hand-built recursive `$defs/Any` tool, and the product's real 32 KB gin
365
+ * `api_set` schema carrying nine `#/$defs/Any` references, both answered
366
+ * HTTP 200 with a valid tool call. So the upstream either fixed or now
367
+ * sanitizes it. The descriptor still declares what this dialect's own
368
+ * documented keyword list supports; depending on a provider's current
369
+ * leniency for a shape we say it cannot express is how the first version of
370
+ * this descriptor shipped a guaranteed 400 in the first place.
199
371
  */
200
372
  export declare const GOOGLE_STRICT: FormatDescriptor;
201
373
  /**
@@ -217,7 +389,8 @@ export declare const GOOGLE_STRICT: FormatDescriptor;
217
389
  export declare const GOOGLE_NON_STRICT: FormatDescriptor;
218
390
  /**
219
391
  * Report the ways a `FormatDescriptor` contradicts itself — settings that ask
220
- * the emitter to produce a keyword the same descriptor forbids. Returns one
392
+ * the emitter to produce a keyword the same descriptor forbids, or a limit
393
+ * that would quietly strip every constraint it governs. Returns one
221
394
  * human-readable line per problem; an empty array means the descriptor is
222
395
  * internally consistent.
223
396
  *
@@ -331,7 +504,7 @@ export declare function resolveDescriptor(input: FormatDescriptor | ToJSONSchema
331
504
  * are always expressible. The structure mirrors the descriptor flags so more
332
505
  * feasibility checks are easy to add.
333
506
  */
334
- export declare function canExpress(schema: z.ZodType, descriptor: FormatDescriptor): boolean;
507
+ export declare function canExpress(schema: z.ZodType | z.core.$ZodType, descriptor: FormatDescriptor): boolean;
335
508
  /**
336
509
  * Recursively transforms a Zod schema to a target dialect.
337
510
  *
@@ -463,10 +636,27 @@ export interface JSONSchema {
463
636
  * ```
464
637
  */
465
638
  export declare function toJSONSchema(schema: z.ZodType, options: ToJSONSchemaOptions | boolean | FormatDescriptor): JSONSchema;
639
+ /**
640
+ * One emitted `enum` node's contribution to a dialect's size limits. A dialect
641
+ * bounds the TOTAL number of enum values in a schema and, separately, the
642
+ * character length of a SINGLE large enum — so the per-enum breakdown has to
643
+ * survive the walk; a pair of totals cannot answer the second question
644
+ * (two enums, one long-valued and one many-valued, would answer it wrongly).
645
+ */
646
+ export interface EnumFeature {
647
+ /** How many members the enum emits. */
648
+ readonly valueCount: number;
649
+ /**
650
+ * Total character length of its STRING members. Non-string members
651
+ * contribute nothing: the character rules are written for string values.
652
+ */
653
+ readonly stringValueChars: number;
654
+ }
466
655
  /**
467
656
  * Structural feature counts for a Zod schema, used by the SchemaBudget to
468
- * decide whether an item fits a descriptor's per-request budget and whether
469
- * the descriptor can express it at all.
657
+ * decide whether an item fits a descriptor's per-request budget, whether it
658
+ * fits the dialect's per-schema size limits, and whether the descriptor can
659
+ * express it at all.
470
660
  */
471
661
  export interface SchemaFeatures {
472
662
  /** True if the schema (or any subschema) uses `z.lazy` / self-recursion. */
@@ -483,21 +673,69 @@ export interface SchemaFeatures {
483
673
  recordCount: number;
484
674
  /** Count of `z.tuple` nodes. */
485
675
  tupleCount: number;
676
+ /** One entry per emitted `enum` node, in walk order. */
677
+ enums: readonly EnumFeature[];
678
+ /**
679
+ * Object properties the schema emits, summed over every nesting level. A
680
+ * record counts as the 2 properties its widest encoding emits
681
+ * (`{key, value}` pairs) and a tuple as one per item (numeric-key
682
+ * encoding) — the count is descriptor-independent, so it takes the largest
683
+ * encoding any dialect could choose (see `schemaSizeLimits`).
684
+ */
685
+ objectPropertyCount: number;
686
+ /** Deepest container nesting below the root (an object of scalars is 1). */
687
+ maxNestingDepth: number;
688
+ /**
689
+ * Total characters over property names plus `enum` and `const` string
690
+ * values — the "total string size" a dialect bounds. `$defs` entry names are
691
+ * NOT included: they are generated at emit time, are few, and are short
692
+ * relative to a 120,000-character budget.
693
+ */
694
+ stringSizeChars: number;
486
695
  }
487
696
  /**
488
697
  * Walk a Zod schema once and count its structural features. Result is
489
698
  * cached per schema in a WeakMap — second-and-subsequent calls are O(1) and
490
699
  * the entry is GC'd with the schema (same OOM-safe pattern as `strictify`).
700
+ *
701
+ * The walk is EAGER (it has to descend to count), so its cycle guard keys on
702
+ * `walkKey`, not on object identity: a `z.lazy` that rebuilds its inner schema
703
+ * per call would otherwise never re-enter the same object and the walk would
704
+ * never terminate. That is not hypothetical — it is a measured, reproducible
705
+ * heap-death, and this function is on the hot path of EVERY tool of EVERY
706
+ * request to a strict-family model (`SchemaBudget.allocate`).
491
707
  */
492
708
  export declare function analyzeSchema(schema: z.ZodType | z.core.$ZodType): SchemaFeatures;
709
+ /**
710
+ * Report the ways ONE schema exceeds the descriptor's documented per-schema
711
+ * size limits (`FormatDescriptor.schemaSizeLimits`). Empty means it fits, or
712
+ * that the dialect publishes no limits.
713
+ *
714
+ * This is a FEASIBILITY question, not a budget one: the numbers bound a single
715
+ * schema, so no other tool in the request can change the answer, and
716
+ * `SchemaBudget.allocate` therefore treats a hit exactly like an
717
+ * unrepresentable keyword — that item degrades to the family's non-strict
718
+ * descriptor and the rest of the request is untouched.
719
+ *
720
+ * Exported because "why did my tool silently stop being strict?" needs an
721
+ * answer a caller can print; each line names the bound and the measurement.
722
+ *
723
+ * @example
724
+ * ```ts
725
+ * checkSchemaSizeLimits(z.object({ pick: z.enum(tenThousandNames) }), OPENAI_STRICT);
726
+ * // → ['enum values 10000 exceed maxTotalEnumValues 1000']
727
+ * ```
728
+ */
729
+ export declare function checkSchemaSizeLimits(schema: z.ZodType | z.core.$ZodType, descriptor: FormatDescriptor): readonly string[];
493
730
  /**
494
731
  * Per-request strict-mode allocator.
495
732
  *
496
733
  * Constructed once per outgoing request with the chosen model's strictest
497
734
  * descriptor. Tracks remaining slots (strict tools, optional parameters,
498
735
  * union types) against the descriptor's documented per-request limits and
499
- * decides per-tool / per-output whether to emit strict or fall back to
500
- * LENIENT.
736
+ * decides per-tool / per-output whether to emit strict or fall back to the
737
+ * SAME FAMILY's non-strict descriptor (`degraded` — never the family-blind
738
+ * `LENIENT`, which would undo dialect rules that outlive strict mode).
501
739
  *
502
740
  * Selection guarantees that any tool with `strict: true` (hard requirement)
503
741
  * has a model that supports the family — `allocate` therefore always grants
@@ -511,6 +749,29 @@ export declare function analyzeSchema(schema: z.ZodType | z.core.$ZodType): Sche
511
749
  */
512
750
  export declare class SchemaBudget {
513
751
  private readonly descriptor;
752
+ /**
753
+ * What an item that does NOT get strict is emitted through: the descriptor's
754
+ * own family, non-strict.
755
+ *
756
+ * It is deliberately NOT the family-blind `LENIENT`. A dialect restriction
757
+ * can belong to the DIALECT rather than to strict mode — `GOOGLE_NON_STRICT`
758
+ * exists for exactly one such rule, the `unconstrained` encoding of
759
+ * `z.any()`, because Gemini builds a decoding grammar whenever a tool call is
760
+ * forced, with no per-tool strict flag involved. Degrading to `LENIENT` put
761
+ * the self-referencing `$defs/Any` that encoding was created to avoid back on
762
+ * the Google wire — and it did so for every gin/query-style recursive `anyOf`
763
+ * schema, i.e. the schemas that ALWAYS degrade, since `GOOGLE_STRICT` cannot
764
+ * express `anyOf` at all (measured: the product's real `api_set` tool schema
765
+ * allocates to `lenient` under `GOOGLE_STRICT`, and its emitted JSON carries
766
+ * nine `#/$defs/Any` references).
767
+ *
768
+ * For the other families this is behaviour-neutral by construction:
769
+ * `OPENAI_NON_STRICT` and `ANTHROPIC_NON_STRICT` are `LENIENT` with a family
770
+ * tag, and a family with no registered non-strict variant resolves to
771
+ * `LENIENT` (`getDescriptor`). Only the pinned `descriptor` id on the tool
772
+ * changes, which round-trips through `getDescriptorById`.
773
+ */
774
+ private readonly degraded;
514
775
  private remainingTools;
515
776
  private remainingOptionalParams;
516
777
  private remainingUnionTypes;
@@ -519,12 +780,15 @@ export declare class SchemaBudget {
519
780
  * Decide the effective descriptor for a tool's parameter schema given the
520
781
  * dev's strict request, the schema's features, and the remaining budget.
521
782
  *
522
- * Returns `LENIENT` when:
783
+ * Returns the family's NON-STRICT descriptor (`LENIENT` for a family that
784
+ * registers none) when:
523
785
  * - `requested === false`
524
786
  * - the schema uses a feature the descriptor can't represent
787
+ * - the schema exceeds the dialect's per-schema size limits
788
+ * (`checkSchemaSizeLimits`)
525
789
  * - the descriptor has slot limits and the budget is exhausted (only
526
790
  * applies to `requested` being a positive number; `true` always wins
527
- * subject to feasibility)
791
+ * subject to feasibility and size)
528
792
  *
529
793
  * Returns the strict descriptor (and decrements the budget) otherwise.
530
794
  */
@@ -550,6 +814,13 @@ export declare class SchemaBudget {
550
814
  * shared between `convertTools` and `convertResponseFormat` — Anthropic's
551
815
  * documented limits apply across the whole request, so the strictest
552
816
  * descriptor wins.
817
+ *
818
+ * `schemaSizeLimits` deliberately does NOT participate. Those bounds are
819
+ * per-schema, so they are evaluated against whichever descriptor this returns
820
+ * rather than shared between the two — and every provider here passes two
821
+ * descriptors resolved from the SAME family, so there is nothing to break the
822
+ * tie on. Ranking six size bounds against three slot budgets would be an
823
+ * invented ordering, not a documented one.
553
824
  */
554
825
  export declare function strictestOf(a: FormatDescriptor, b: FormatDescriptor): FormatDescriptor;
555
826
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAGzB,6EAA6E;IAC7E,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,mEAAmE;IACnE,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IAGxC,sCAAsC;IACtC,QAAQ,CAAC,cAAc,EAAE,gBAAgB,GAAG,aAAa,CAAC;IAG1D;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,qBAAqB,GAAG,cAAc,GAAG,aAAa,CAAC;IAG/E,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UA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