@claudexor/schema 3.19.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/agent-capabilities.d.ts +1 -1
  2. package/dist/agent-capabilities.d.ts.map +1 -1
  3. package/dist/agent-capabilities.js +1 -0
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/continuation-admission.d.ts +41 -0
  6. package/dist/continuation-admission.d.ts.map +1 -0
  7. package/dist/continuation-admission.js +136 -0
  8. package/dist/continuation-admission.js.map +1 -0
  9. package/dist/control-gc.d.ts +9 -0
  10. package/dist/control-gc.d.ts.map +1 -1
  11. package/dist/control-gc.js +12 -0
  12. package/dist/control-gc.js.map +1 -1
  13. package/dist/control-operation-responses.d.ts +415 -9
  14. package/dist/control-operation-responses.d.ts.map +1 -1
  15. package/dist/control-operation-responses.js +2 -0
  16. package/dist/control-operation-responses.js.map +1 -1
  17. package/dist/control-run-detail.d.ts +891 -25
  18. package/dist/control-run-detail.d.ts.map +1 -1
  19. package/dist/control-run-failure.d.ts +36 -6
  20. package/dist/control-run-failure.d.ts.map +1 -1
  21. package/dist/control-run-failure.js +1 -0
  22. package/dist/control-run-failure.js.map +1 -1
  23. package/dist/control-thread-requests.d.ts +101 -0
  24. package/dist/control-thread-requests.d.ts.map +1 -0
  25. package/dist/control-thread-requests.js +52 -0
  26. package/dist/control-thread-requests.js.map +1 -0
  27. package/dist/control.d.ts +377 -106
  28. package/dist/control.d.ts.map +1 -1
  29. package/dist/control.js +26 -45
  30. package/dist/control.js.map +1 -1
  31. package/dist/credential-profile-snapshot.d.ts +172 -14
  32. package/dist/credential-profile-snapshot.d.ts.map +1 -1
  33. package/dist/credential-profile.d.ts +4 -1
  34. package/dist/credential-profile.d.ts.map +1 -1
  35. package/dist/credential-profile.js +3 -2
  36. package/dist/credential-profile.js.map +1 -1
  37. package/dist/decision.d.ts +12 -0
  38. package/dist/decision.d.ts.map +1 -1
  39. package/dist/effort.d.ts +33 -12
  40. package/dist/effort.d.ts.map +1 -1
  41. package/dist/effort.js +43 -13
  42. package/dist/effort.js.map +1 -1
  43. package/dist/events.d.ts +7 -4
  44. package/dist/events.d.ts.map +1 -1
  45. package/dist/events.js +11 -0
  46. package/dist/events.js.map +1 -1
  47. package/dist/harness-input.d.ts +20 -2
  48. package/dist/harness-input.d.ts.map +1 -1
  49. package/dist/harness-input.js +17 -6
  50. package/dist/harness-input.js.map +1 -1
  51. package/dist/harness.d.ts +57 -20
  52. package/dist/harness.d.ts.map +1 -1
  53. package/dist/harness.js +5 -5
  54. package/dist/index.d.ts +4 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +4 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/mcp-run-result.d.ts +253 -14
  59. package/dist/mcp-run-result.d.ts.map +1 -1
  60. package/dist/mcp-run-result.js +38 -0
  61. package/dist/mcp-run-result.js.map +1 -1
  62. package/dist/quota.d.ts +507 -12
  63. package/dist/quota.d.ts.map +1 -1
  64. package/dist/quota.js +111 -15
  65. package/dist/quota.js.map +1 -1
  66. package/dist/raw.d.ts +1 -1
  67. package/dist/raw.d.ts.map +1 -1
  68. package/dist/raw.js +0 -1
  69. package/dist/raw.js.map +1 -1
  70. package/dist/run-continuation.d.ts +166 -0
  71. package/dist/run-continuation.d.ts.map +1 -0
  72. package/dist/run-continuation.js +65 -0
  73. package/dist/run-continuation.js.map +1 -0
  74. package/dist/run-continuity.d.ts +215 -0
  75. package/dist/run-continuity.d.ts.map +1 -0
  76. package/dist/run-continuity.js +170 -0
  77. package/dist/run-continuity.js.map +1 -0
  78. package/dist/run-facts.d.ts +7 -0
  79. package/dist/run-facts.d.ts.map +1 -1
  80. package/dist/setup-login.d.ts +35 -0
  81. package/dist/setup-login.d.ts.map +1 -1
  82. package/dist/setup-login.js +10 -0
  83. package/dist/setup-login.js.map +1 -1
  84. package/dist/status-projection.d.ts +8 -1
  85. package/dist/status-projection.d.ts.map +1 -1
  86. package/dist/status-projection.js +22 -1
  87. package/dist/status-projection.js.map +1 -1
  88. package/dist/telemetry.d.ts +109 -7
  89. package/dist/telemetry.d.ts.map +1 -1
  90. package/dist/telemetry.js +3 -3
  91. package/dist/telemetry.js.map +1 -1
  92. package/dist/thread.d.ts +4 -0
  93. package/dist/thread.d.ts.map +1 -1
  94. package/dist/thread.js +10 -1
  95. package/dist/thread.js.map +1 -1
  96. package/dist/work-report.d.ts +18 -4
  97. package/dist/work-report.d.ts.map +1 -1
  98. package/dist/work-report.js +26 -5
  99. package/dist/work-report.js.map +1 -1
  100. package/generated/AgentCapabilityCatalog.schema.json +1 -1
  101. package/generated/ControlCredentialProfilesQueryResponse.schema.json +29 -7
  102. package/generated/ControlCredentialProfilesSnapshotResponse.schema.json +29 -7
  103. package/generated/ControlGcReceipt.schema.json +14 -0
  104. package/generated/ControlGcRequest.schema.json +4 -0
  105. package/generated/ControlHarnessListResponse.schema.json +1 -1
  106. package/generated/ControlHarnessSettingsPatch.schema.json +1 -1
  107. package/generated/ControlQuotaResponse.schema.json +28 -6
  108. package/generated/ControlRetainedEnvelope.schema.json +63 -0
  109. package/generated/ControlRunAgainDraft.schema.json +16 -0
  110. package/generated/ControlRunDetail.schema.json +503 -54
  111. package/generated/ControlRunListResponse.schema.json +503 -54
  112. package/generated/ControlRunStartRequest.schema.json +16 -0
  113. package/generated/ControlRunSummary.schema.json +503 -54
  114. package/generated/ControlSettingsSnapshot.schema.json +1 -1
  115. package/generated/ControlSettingsUpdateRequest.schema.json +1 -1
  116. package/generated/ControlThread.schema.json +16 -1
  117. package/generated/ControlThreadCreateRequest.schema.json +6 -0
  118. package/generated/ControlThreadDetail.schema.json +30 -2
  119. package/generated/ControlThreadListResponse.schema.json +16 -1
  120. package/generated/ControlThreadTurnRequest.schema.json +4 -0
  121. package/generated/ControlThreadUpdateRequest.schema.json +15 -1
  122. package/generated/DecisionRecord.schema.json +14 -1
  123. package/generated/EnvelopeCustody.schema.json +195 -0
  124. package/generated/GlobalConfig.schema.json +1 -1
  125. package/generated/HarnessEvent.schema.json +114 -56
  126. package/generated/HarnessManifest.schema.json +1 -1
  127. package/generated/HarnessStatusDto.schema.json +1 -1
  128. package/generated/McpRunHandleResult.schema.json +214 -54
  129. package/generated/McpRunToolResult.schema.json +119 -54
  130. package/generated/RunContinuityReceipt.schema.json +182 -0
  131. package/generated/RunEvent.schema.json +3 -1
  132. package/generated/RunFacts.schema.json +14 -1
  133. package/generated/RunFailure.schema.json +105 -53
  134. package/generated/RunResumable.schema.json +153 -0
  135. package/generated/RunTelemetry.schema.json +118 -54
  136. package/generated/SessionCapsule.schema.json +78 -0
  137. package/generated/TaskContract.schema.json +1 -1
  138. package/generated/Thread.schema.json +16 -1
  139. package/package.json +2 -2
package/dist/quota.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import { z } from "zod/v3";
2
- export declare const QuotaSource: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit"]>;
2
+ export declare const QuotaSource: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit", "claude_rate_limit_event", "codex_app_server_event"]>;
3
3
  export type QuotaSource = z.infer<typeof QuotaSource>;
4
4
  /** Orthogonal capabilities of every quota evidence source. Keep this
5
5
  * exhaustive registry beside the QuotaSource vocabulary so consumers cannot
6
6
  * silently invent their own source classifications. */
7
7
  export interface QuotaSourceTraits {
8
+ /** A full source replaces its inventory; an incremental source reports
9
+ * independently aged singleton windows. */
10
+ readonly snapshotMode: "full" | "window";
8
11
  /** The source is a vendor response authenticated with this subject's own
9
12
  * credential, and therefore evidence of credential liveness. */
10
13
  readonly vendorAuthenticated: boolean;
@@ -17,36 +20,55 @@ export interface QuotaSourceTraits {
17
20
  }
18
21
  export declare const QUOTA_SOURCE_TRAITS: {
19
22
  readonly codex_app_server: {
23
+ readonly snapshotMode: "full";
20
24
  readonly vendorAuthenticated: true;
21
25
  readonly refreshDemandHarness: "codex";
22
26
  readonly producedByRefresher: true;
23
27
  };
24
28
  readonly codex_rollout: {
29
+ readonly snapshotMode: "full";
25
30
  readonly vendorAuthenticated: false;
26
31
  readonly refreshDemandHarness: null;
27
32
  readonly producedByRefresher: false;
28
33
  };
29
34
  readonly claude_statusline: {
35
+ readonly snapshotMode: "full";
30
36
  readonly vendorAuthenticated: false;
31
37
  readonly refreshDemandHarness: null;
32
38
  readonly producedByRefresher: true;
33
39
  };
34
40
  readonly claude_api_retry: {
41
+ readonly snapshotMode: "full";
35
42
  readonly vendorAuthenticated: false;
36
43
  readonly refreshDemandHarness: null;
37
44
  readonly producedByRefresher: false;
38
45
  };
39
46
  readonly claude_oauth_usage: {
47
+ readonly snapshotMode: "full";
40
48
  readonly vendorAuthenticated: true;
41
49
  readonly refreshDemandHarness: "claude";
42
50
  readonly producedByRefresher: true;
43
51
  };
44
52
  readonly agy_command_usage: {
53
+ readonly snapshotMode: "full";
45
54
  readonly vendorAuthenticated: true;
46
55
  readonly refreshDemandHarness: "agy";
47
56
  readonly producedByRefresher: true;
48
57
  };
49
58
  readonly cursor_rate_limit: {
59
+ readonly snapshotMode: "full";
60
+ readonly vendorAuthenticated: false;
61
+ readonly refreshDemandHarness: null;
62
+ readonly producedByRefresher: false;
63
+ };
64
+ readonly claude_rate_limit_event: {
65
+ readonly snapshotMode: "window";
66
+ readonly vendorAuthenticated: false;
67
+ readonly refreshDemandHarness: null;
68
+ readonly producedByRefresher: false;
69
+ };
70
+ readonly codex_app_server_event: {
71
+ readonly snapshotMode: "window";
50
72
  readonly vendorAuthenticated: false;
51
73
  readonly refreshDemandHarness: null;
52
74
  readonly producedByRefresher: false;
@@ -103,6 +125,10 @@ export declare const QuotaConstraint: z.ZodObject<{
103
125
  * list is the producer's canonical model-id/alias scope, so a
104
126
  * model-specific cap never cools a different model on the same subject. */
105
127
  applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
128
+ /** Vendor-declared model families, matched as literal id prefixes. These
129
+ * augment exact ids without guessing that every unknown model belongs to
130
+ * a known group. An absent/empty list adds no family scope. */
131
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
132
  /**
107
133
  * Whether this MODEL-SCOPED window also governs a run that names no model.
108
134
  * Default (absent) is the conservative answer: a scoped window cannot
@@ -121,6 +147,7 @@ export declare const QuotaConstraint: z.ZodObject<{
121
147
  id: string;
122
148
  label: string;
123
149
  applies_to_models?: string[] | null | undefined;
150
+ applies_to_model_prefixes?: string[] | undefined;
124
151
  applies_to_unspecified_model?: boolean | undefined;
125
152
  used_ratio: number | null;
126
153
  window_seconds: number | null;
@@ -130,6 +157,7 @@ export declare const QuotaConstraint: z.ZodObject<{
130
157
  id: string;
131
158
  label: string;
132
159
  applies_to_models?: string[] | null | undefined;
160
+ applies_to_model_prefixes?: string[] | undefined;
133
161
  applies_to_unspecified_model?: boolean | undefined;
134
162
  used_ratio: number | null;
135
163
  window_seconds: number | null;
@@ -167,6 +195,10 @@ export declare const QuotaSnapshot: z.ZodObject<{
167
195
  * list is the producer's canonical model-id/alias scope, so a
168
196
  * model-specific cap never cools a different model on the same subject. */
169
197
  applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
198
+ /** Vendor-declared model families, matched as literal id prefixes. These
199
+ * augment exact ids without guessing that every unknown model belongs to
200
+ * a known group. An absent/empty list adds no family scope. */
201
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
170
202
  /**
171
203
  * Whether this MODEL-SCOPED window also governs a run that names no model.
172
204
  * Default (absent) is the conservative answer: a scoped window cannot
@@ -185,6 +217,7 @@ export declare const QuotaSnapshot: z.ZodObject<{
185
217
  id: string;
186
218
  label: string;
187
219
  applies_to_models?: string[] | null | undefined;
220
+ applies_to_model_prefixes?: string[] | undefined;
188
221
  applies_to_unspecified_model?: boolean | undefined;
189
222
  used_ratio: number | null;
190
223
  window_seconds: number | null;
@@ -194,13 +227,14 @@ export declare const QuotaSnapshot: z.ZodObject<{
194
227
  id: string;
195
228
  label: string;
196
229
  applies_to_models?: string[] | null | undefined;
230
+ applies_to_model_prefixes?: string[] | undefined;
197
231
  applies_to_unspecified_model?: boolean | undefined;
198
232
  used_ratio: number | null;
199
233
  window_seconds: number | null;
200
234
  resets_at: string | null;
201
235
  cooldown_until?: string | null | undefined;
202
236
  }>, "many">;
203
- source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit"]>;
237
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit", "claude_rate_limit_event", "codex_app_server_event"]>;
204
238
  observed_at: z.ZodString;
205
239
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
206
240
  }, "strict", z.ZodTypeAny, {
@@ -214,13 +248,14 @@ export declare const QuotaSnapshot: z.ZodObject<{
214
248
  id: string;
215
249
  label: string;
216
250
  applies_to_models?: string[] | null | undefined;
251
+ applies_to_model_prefixes?: string[] | undefined;
217
252
  applies_to_unspecified_model?: boolean | undefined;
218
253
  used_ratio: number | null;
219
254
  window_seconds: number | null;
220
255
  resets_at: string | null;
221
256
  cooldown_until: string | null;
222
257
  }[];
223
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
258
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
224
259
  observed_at: string;
225
260
  freshness: "fresh" | "stale" | "unknown";
226
261
  }, {
@@ -234,17 +269,343 @@ export declare const QuotaSnapshot: z.ZodObject<{
234
269
  id: string;
235
270
  label: string;
236
271
  applies_to_models?: string[] | null | undefined;
272
+ applies_to_model_prefixes?: string[] | undefined;
237
273
  applies_to_unspecified_model?: boolean | undefined;
238
274
  used_ratio: number | null;
239
275
  window_seconds: number | null;
240
276
  resets_at: string | null;
241
277
  cooldown_until?: string | null | undefined;
242
278
  }[];
243
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
279
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
244
280
  observed_at: string;
245
281
  freshness: "fresh" | "stale" | "unknown";
246
282
  }>;
247
283
  export type QuotaSnapshot = z.infer<typeof QuotaSnapshot>;
284
+ /** Stable vendor-window identity, independent of its measured value, reset,
285
+ * label and observation time. Unknown applicability is not representable as
286
+ * a global constraint: producers retain it as diagnostic evidence instead. */
287
+ export declare function quotaConstraintIdentity(constraint: QuotaConstraint): string;
288
+ /** One schema-owned storage identity for registry, budget and projections.
289
+ * Existing full sources retain their inventory slot. Incremental sources
290
+ * require one independently observed window in each stored snapshot. */
291
+ export declare function quotaSnapshotIdentity(snapshot: Pick<QuotaSnapshot, "subject" | "source" | "constraints">): string;
292
+ /** New journal type carrying a partial observation. Older readers ignore
293
+ * this type rather than replaying it as a fake complete/cooldown snapshot. */
294
+ export declare const QuotaWindowObservation: z.ZodEffects<z.ZodObject<{
295
+ version: z.ZodLiteral<1>;
296
+ snapshot: z.ZodObject<{
297
+ subject: z.ZodObject<{
298
+ harness: z.ZodString;
299
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
300
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
301
+ /** The CREDENTIAL SUBJECT the windows belong to (release wave round-16
302
+ * #2): a Claudexor credential-profile id, or null for the harness's
303
+ * engine-default credential. Every producer (oauth-usage refresher,
304
+ * typed-event registry, adapter quota events) uses exactly this
305
+ * vocabulary; budget routing filters snapshots by exact subject so one
306
+ * account's exhaustion never cools another. */
307
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
308
+ }, "strict", z.ZodTypeAny, {
309
+ harness: string;
310
+ credential_route: "local" | "managed_api_key" | "vendor_native";
311
+ plan_label: string | null;
312
+ subject_id: string | null;
313
+ }, {
314
+ harness: string;
315
+ credential_route: "local" | "managed_api_key" | "vendor_native";
316
+ plan_label?: string | null | undefined;
317
+ subject_id?: string | null | undefined;
318
+ }>;
319
+ constraints: z.ZodArray<z.ZodObject<{
320
+ id: z.ZodString;
321
+ label: z.ZodString;
322
+ /** omitted/null = this vendor window applies to every model. A non-null
323
+ * list is the producer's canonical model-id/alias scope, so a
324
+ * model-specific cap never cools a different model on the same subject. */
325
+ applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
326
+ /** Vendor-declared model families, matched as literal id prefixes. These
327
+ * augment exact ids without guessing that every unknown model belongs to
328
+ * a known group. An absent/empty list adds no family scope. */
329
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
330
+ /**
331
+ * Whether this MODEL-SCOPED window also governs a run that names no model.
332
+ * Default (absent) is the conservative answer: a scoped window cannot
333
+ * refuse a route whose concrete model is unknowable before spawn. A source
334
+ * sets it when the vendor's unspecified-model route provably consumes THIS
335
+ * window — the case where every window is scoped, so the conservative
336
+ * default would leave an exhausted subscription unrefusable and its
337
+ * profile rotation unreachable.
338
+ */
339
+ applies_to_unspecified_model: z.ZodOptional<z.ZodBoolean>;
340
+ used_ratio: z.ZodNullable<z.ZodNumber>;
341
+ window_seconds: z.ZodNullable<z.ZodNumber>;
342
+ resets_at: z.ZodNullable<z.ZodString>;
343
+ cooldown_until: z.ZodDefault<z.ZodNullable<z.ZodString>>;
344
+ }, "strict", z.ZodTypeAny, {
345
+ id: string;
346
+ label: string;
347
+ applies_to_models?: string[] | null | undefined;
348
+ applies_to_model_prefixes?: string[] | undefined;
349
+ applies_to_unspecified_model?: boolean | undefined;
350
+ used_ratio: number | null;
351
+ window_seconds: number | null;
352
+ resets_at: string | null;
353
+ cooldown_until: string | null;
354
+ }, {
355
+ id: string;
356
+ label: string;
357
+ applies_to_models?: string[] | null | undefined;
358
+ applies_to_model_prefixes?: string[] | undefined;
359
+ applies_to_unspecified_model?: boolean | undefined;
360
+ used_ratio: number | null;
361
+ window_seconds: number | null;
362
+ resets_at: string | null;
363
+ cooldown_until?: string | null | undefined;
364
+ }>, "many">;
365
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit", "claude_rate_limit_event", "codex_app_server_event"]>;
366
+ observed_at: z.ZodString;
367
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
368
+ }, "strict", z.ZodTypeAny, {
369
+ subject: {
370
+ harness: string;
371
+ credential_route: "local" | "managed_api_key" | "vendor_native";
372
+ plan_label: string | null;
373
+ subject_id: string | null;
374
+ };
375
+ constraints: {
376
+ id: string;
377
+ label: string;
378
+ applies_to_models?: string[] | null | undefined;
379
+ applies_to_model_prefixes?: string[] | undefined;
380
+ applies_to_unspecified_model?: boolean | undefined;
381
+ used_ratio: number | null;
382
+ window_seconds: number | null;
383
+ resets_at: string | null;
384
+ cooldown_until: string | null;
385
+ }[];
386
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
387
+ observed_at: string;
388
+ freshness: "fresh" | "stale" | "unknown";
389
+ }, {
390
+ subject: {
391
+ harness: string;
392
+ credential_route: "local" | "managed_api_key" | "vendor_native";
393
+ plan_label?: string | null | undefined;
394
+ subject_id?: string | null | undefined;
395
+ };
396
+ constraints: {
397
+ id: string;
398
+ label: string;
399
+ applies_to_models?: string[] | null | undefined;
400
+ applies_to_model_prefixes?: string[] | undefined;
401
+ applies_to_unspecified_model?: boolean | undefined;
402
+ used_ratio: number | null;
403
+ window_seconds: number | null;
404
+ resets_at: string | null;
405
+ cooldown_until?: string | null | undefined;
406
+ }[];
407
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
408
+ observed_at: string;
409
+ freshness: "fresh" | "stale" | "unknown";
410
+ }>;
411
+ }, "strict", z.ZodTypeAny, {
412
+ version: 1;
413
+ snapshot: {
414
+ subject: {
415
+ harness: string;
416
+ credential_route: "local" | "managed_api_key" | "vendor_native";
417
+ plan_label: string | null;
418
+ subject_id: string | null;
419
+ };
420
+ constraints: {
421
+ id: string;
422
+ label: string;
423
+ applies_to_models?: string[] | null | undefined;
424
+ applies_to_model_prefixes?: string[] | undefined;
425
+ applies_to_unspecified_model?: boolean | undefined;
426
+ used_ratio: number | null;
427
+ window_seconds: number | null;
428
+ resets_at: string | null;
429
+ cooldown_until: string | null;
430
+ }[];
431
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
432
+ observed_at: string;
433
+ freshness: "fresh" | "stale" | "unknown";
434
+ };
435
+ }, {
436
+ version: 1;
437
+ snapshot: {
438
+ subject: {
439
+ harness: string;
440
+ credential_route: "local" | "managed_api_key" | "vendor_native";
441
+ plan_label?: string | null | undefined;
442
+ subject_id?: string | null | undefined;
443
+ };
444
+ constraints: {
445
+ id: string;
446
+ label: string;
447
+ applies_to_models?: string[] | null | undefined;
448
+ applies_to_model_prefixes?: string[] | undefined;
449
+ applies_to_unspecified_model?: boolean | undefined;
450
+ used_ratio: number | null;
451
+ window_seconds: number | null;
452
+ resets_at: string | null;
453
+ cooldown_until?: string | null | undefined;
454
+ }[];
455
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
456
+ observed_at: string;
457
+ freshness: "fresh" | "stale" | "unknown";
458
+ };
459
+ }>, {
460
+ version: 1;
461
+ snapshot: {
462
+ subject: {
463
+ harness: string;
464
+ credential_route: "local" | "managed_api_key" | "vendor_native";
465
+ plan_label: string | null;
466
+ subject_id: string | null;
467
+ };
468
+ constraints: {
469
+ id: string;
470
+ label: string;
471
+ applies_to_models?: string[] | null | undefined;
472
+ applies_to_model_prefixes?: string[] | undefined;
473
+ applies_to_unspecified_model?: boolean | undefined;
474
+ used_ratio: number | null;
475
+ window_seconds: number | null;
476
+ resets_at: string | null;
477
+ cooldown_until: string | null;
478
+ }[];
479
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
480
+ observed_at: string;
481
+ freshness: "fresh" | "stale" | "unknown";
482
+ };
483
+ }, {
484
+ version: 1;
485
+ snapshot: {
486
+ subject: {
487
+ harness: string;
488
+ credential_route: "local" | "managed_api_key" | "vendor_native";
489
+ plan_label?: string | null | undefined;
490
+ subject_id?: string | null | undefined;
491
+ };
492
+ constraints: {
493
+ id: string;
494
+ label: string;
495
+ applies_to_models?: string[] | null | undefined;
496
+ applies_to_model_prefixes?: string[] | undefined;
497
+ applies_to_unspecified_model?: boolean | undefined;
498
+ used_ratio: number | null;
499
+ window_seconds: number | null;
500
+ resets_at: string | null;
501
+ cooldown_until?: string | null | undefined;
502
+ }[];
503
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
504
+ observed_at: string;
505
+ freshness: "fresh" | "stale" | "unknown";
506
+ };
507
+ }>;
508
+ export type QuotaWindowObservation = z.infer<typeof QuotaWindowObservation>;
509
+ /** A newer full read superseded this exact incremental window. The cutoff
510
+ * survives later full-inventory replacement and rejects delayed older events;
511
+ * raw measurements remain ordinary journal history until compaction. */
512
+ export declare const QuotaWindowSupersession: z.ZodObject<Pick<{
513
+ subject: z.ZodObject<{
514
+ harness: z.ZodString;
515
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
516
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
517
+ /** The CREDENTIAL SUBJECT the windows belong to (release wave round-16
518
+ * #2): a Claudexor credential-profile id, or null for the harness's
519
+ * engine-default credential. Every producer (oauth-usage refresher,
520
+ * typed-event registry, adapter quota events) uses exactly this
521
+ * vocabulary; budget routing filters snapshots by exact subject so one
522
+ * account's exhaustion never cools another. */
523
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
524
+ }, "strict", z.ZodTypeAny, {
525
+ harness: string;
526
+ credential_route: "local" | "managed_api_key" | "vendor_native";
527
+ plan_label: string | null;
528
+ subject_id: string | null;
529
+ }, {
530
+ harness: string;
531
+ credential_route: "local" | "managed_api_key" | "vendor_native";
532
+ plan_label?: string | null | undefined;
533
+ subject_id?: string | null | undefined;
534
+ }>;
535
+ constraints: z.ZodArray<z.ZodObject<{
536
+ id: z.ZodString;
537
+ label: z.ZodString;
538
+ /** omitted/null = this vendor window applies to every model. A non-null
539
+ * list is the producer's canonical model-id/alias scope, so a
540
+ * model-specific cap never cools a different model on the same subject. */
541
+ applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
542
+ /** Vendor-declared model families, matched as literal id prefixes. These
543
+ * augment exact ids without guessing that every unknown model belongs to
544
+ * a known group. An absent/empty list adds no family scope. */
545
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
546
+ /**
547
+ * Whether this MODEL-SCOPED window also governs a run that names no model.
548
+ * Default (absent) is the conservative answer: a scoped window cannot
549
+ * refuse a route whose concrete model is unknowable before spawn. A source
550
+ * sets it when the vendor's unspecified-model route provably consumes THIS
551
+ * window — the case where every window is scoped, so the conservative
552
+ * default would leave an exhausted subscription unrefusable and its
553
+ * profile rotation unreachable.
554
+ */
555
+ applies_to_unspecified_model: z.ZodOptional<z.ZodBoolean>;
556
+ used_ratio: z.ZodNullable<z.ZodNumber>;
557
+ window_seconds: z.ZodNullable<z.ZodNumber>;
558
+ resets_at: z.ZodNullable<z.ZodString>;
559
+ cooldown_until: z.ZodDefault<z.ZodNullable<z.ZodString>>;
560
+ }, "strict", z.ZodTypeAny, {
561
+ id: string;
562
+ label: string;
563
+ applies_to_models?: string[] | null | undefined;
564
+ applies_to_model_prefixes?: string[] | undefined;
565
+ applies_to_unspecified_model?: boolean | undefined;
566
+ used_ratio: number | null;
567
+ window_seconds: number | null;
568
+ resets_at: string | null;
569
+ cooldown_until: string | null;
570
+ }, {
571
+ id: string;
572
+ label: string;
573
+ applies_to_models?: string[] | null | undefined;
574
+ applies_to_model_prefixes?: string[] | undefined;
575
+ applies_to_unspecified_model?: boolean | undefined;
576
+ used_ratio: number | null;
577
+ window_seconds: number | null;
578
+ resets_at: string | null;
579
+ cooldown_until?: string | null | undefined;
580
+ }>, "many">;
581
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit", "claude_rate_limit_event", "codex_app_server_event"]>;
582
+ observed_at: z.ZodString;
583
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
584
+ }, "observed_at" | "subject"> & {
585
+ version: z.ZodLiteral<1>;
586
+ snapshot_id: z.ZodString;
587
+ }, "strict", z.ZodTypeAny, {
588
+ subject: {
589
+ harness: string;
590
+ credential_route: "local" | "managed_api_key" | "vendor_native";
591
+ plan_label: string | null;
592
+ subject_id: string | null;
593
+ };
594
+ observed_at: string;
595
+ version: 1;
596
+ snapshot_id: string;
597
+ }, {
598
+ subject: {
599
+ harness: string;
600
+ credential_route: "local" | "managed_api_key" | "vendor_native";
601
+ plan_label?: string | null | undefined;
602
+ subject_id?: string | null | undefined;
603
+ };
604
+ observed_at: string;
605
+ version: 1;
606
+ snapshot_id: string;
607
+ }>;
608
+ export type QuotaWindowSupersession = z.infer<typeof QuotaWindowSupersession>;
248
609
  export declare const QuotaAbsenceReason: z.ZodEnum<["not_logged_in", "transport_unavailable", "platform_unsupported", "refresh_failed", "no_source", "auth_revoked", "rate_limited", "probe_skipped_rate_limited", "poll_paced", "credential_profile_ambiguous"]>;
249
610
  export type QuotaAbsenceReason = z.infer<typeof QuotaAbsenceReason>;
250
611
  /** Refresh-gap reasons may coexist with a STALE snapshot: the last-known
@@ -312,14 +673,17 @@ export type QuotaAvailabilityState = z.infer<typeof QuotaAvailabilityState>;
312
673
  export declare const QuotaModelScopedExhaustion: z.ZodObject<{
313
674
  constraint_id: z.ZodString;
314
675
  applies_to_models: z.ZodArray<z.ZodString, "many">;
676
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
315
677
  resets_at: z.ZodNullable<z.ZodString>;
316
678
  }, "strict", z.ZodTypeAny, {
317
679
  constraint_id: string;
318
680
  applies_to_models: string[];
681
+ applies_to_model_prefixes?: string[] | undefined;
319
682
  resets_at: string | null;
320
683
  }, {
321
684
  constraint_id: string;
322
685
  applies_to_models: string[];
686
+ applies_to_model_prefixes?: string[] | undefined;
323
687
  resets_at: string | null;
324
688
  }>;
325
689
  export type QuotaModelScopedExhaustion = z.infer<typeof QuotaModelScopedExhaustion>;
@@ -330,14 +694,17 @@ export declare const QuotaAvailability: z.ZodObject<{
330
694
  model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
331
695
  constraint_id: z.ZodString;
332
696
  applies_to_models: z.ZodArray<z.ZodString, "many">;
697
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
333
698
  resets_at: z.ZodNullable<z.ZodString>;
334
699
  }, "strict", z.ZodTypeAny, {
335
700
  constraint_id: string;
336
701
  applies_to_models: string[];
702
+ applies_to_model_prefixes?: string[] | undefined;
337
703
  resets_at: string | null;
338
704
  }, {
339
705
  constraint_id: string;
340
706
  applies_to_models: string[];
707
+ applies_to_model_prefixes?: string[] | undefined;
341
708
  resets_at: string | null;
342
709
  }>, "many">;
343
710
  }, "strict", z.ZodTypeAny, {
@@ -347,6 +714,7 @@ export declare const QuotaAvailability: z.ZodObject<{
347
714
  model_scoped_exhaustions: {
348
715
  constraint_id: string;
349
716
  applies_to_models: string[];
717
+ applies_to_model_prefixes?: string[] | undefined;
350
718
  resets_at: string | null;
351
719
  }[];
352
720
  }, {
@@ -356,6 +724,7 @@ export declare const QuotaAvailability: z.ZodObject<{
356
724
  model_scoped_exhaustions: {
357
725
  constraint_id: string;
358
726
  applies_to_models: string[];
727
+ applies_to_model_prefixes?: string[] | undefined;
359
728
  resets_at: string | null;
360
729
  }[];
361
730
  }>;
@@ -390,6 +759,10 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
390
759
  * list is the producer's canonical model-id/alias scope, so a
391
760
  * model-specific cap never cools a different model on the same subject. */
392
761
  applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
762
+ /** Vendor-declared model families, matched as literal id prefixes. These
763
+ * augment exact ids without guessing that every unknown model belongs to
764
+ * a known group. An absent/empty list adds no family scope. */
765
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
393
766
  /**
394
767
  * Whether this MODEL-SCOPED window also governs a run that names no model.
395
768
  * Default (absent) is the conservative answer: a scoped window cannot
@@ -408,6 +781,7 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
408
781
  id: string;
409
782
  label: string;
410
783
  applies_to_models?: string[] | null | undefined;
784
+ applies_to_model_prefixes?: string[] | undefined;
411
785
  applies_to_unspecified_model?: boolean | undefined;
412
786
  used_ratio: number | null;
413
787
  window_seconds: number | null;
@@ -417,16 +791,18 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
417
791
  id: string;
418
792
  label: string;
419
793
  applies_to_models?: string[] | null | undefined;
794
+ applies_to_model_prefixes?: string[] | undefined;
420
795
  applies_to_unspecified_model?: boolean | undefined;
421
796
  used_ratio: number | null;
422
797
  window_seconds: number | null;
423
798
  resets_at: string | null;
424
799
  cooldown_until?: string | null | undefined;
425
800
  }>, "many">;
426
- source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit"]>;
801
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit", "claude_rate_limit_event", "codex_app_server_event"]>;
427
802
  observed_at: z.ZodString;
428
803
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
429
804
  } & {
805
+ snapshot_id: z.ZodOptional<z.ZodString>;
430
806
  availability: z.ZodOptional<z.ZodObject<{
431
807
  state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
432
808
  blocking_constraints: z.ZodArray<z.ZodString, "many">;
@@ -434,14 +810,17 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
434
810
  model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
435
811
  constraint_id: z.ZodString;
436
812
  applies_to_models: z.ZodArray<z.ZodString, "many">;
813
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
437
814
  resets_at: z.ZodNullable<z.ZodString>;
438
815
  }, "strict", z.ZodTypeAny, {
439
816
  constraint_id: string;
440
817
  applies_to_models: string[];
818
+ applies_to_model_prefixes?: string[] | undefined;
441
819
  resets_at: string | null;
442
820
  }, {
443
821
  constraint_id: string;
444
822
  applies_to_models: string[];
823
+ applies_to_model_prefixes?: string[] | undefined;
445
824
  resets_at: string | null;
446
825
  }>, "many">;
447
826
  }, "strict", z.ZodTypeAny, {
@@ -451,6 +830,7 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
451
830
  model_scoped_exhaustions: {
452
831
  constraint_id: string;
453
832
  applies_to_models: string[];
833
+ applies_to_model_prefixes?: string[] | undefined;
454
834
  resets_at: string | null;
455
835
  }[];
456
836
  }, {
@@ -460,6 +840,7 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
460
840
  model_scoped_exhaustions: {
461
841
  constraint_id: string;
462
842
  applies_to_models: string[];
843
+ applies_to_model_prefixes?: string[] | undefined;
463
844
  resets_at: string | null;
464
845
  }[];
465
846
  }>>;
@@ -474,15 +855,17 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
474
855
  id: string;
475
856
  label: string;
476
857
  applies_to_models?: string[] | null | undefined;
858
+ applies_to_model_prefixes?: string[] | undefined;
477
859
  applies_to_unspecified_model?: boolean | undefined;
478
860
  used_ratio: number | null;
479
861
  window_seconds: number | null;
480
862
  resets_at: string | null;
481
863
  cooldown_until: string | null;
482
864
  }[];
483
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
865
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
484
866
  observed_at: string;
485
867
  freshness: "fresh" | "stale" | "unknown";
868
+ snapshot_id?: string | undefined;
486
869
  availability?: {
487
870
  state: "available" | "cooldown" | "exhausted";
488
871
  blocking_constraints: string[];
@@ -490,6 +873,7 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
490
873
  model_scoped_exhaustions: {
491
874
  constraint_id: string;
492
875
  applies_to_models: string[];
876
+ applies_to_model_prefixes?: string[] | undefined;
493
877
  resets_at: string | null;
494
878
  }[];
495
879
  } | undefined;
@@ -504,15 +888,17 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
504
888
  id: string;
505
889
  label: string;
506
890
  applies_to_models?: string[] | null | undefined;
891
+ applies_to_model_prefixes?: string[] | undefined;
507
892
  applies_to_unspecified_model?: boolean | undefined;
508
893
  used_ratio: number | null;
509
894
  window_seconds: number | null;
510
895
  resets_at: string | null;
511
896
  cooldown_until?: string | null | undefined;
512
897
  }[];
513
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
898
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
514
899
  observed_at: string;
515
900
  freshness: "fresh" | "stale" | "unknown";
901
+ snapshot_id?: string | undefined;
516
902
  availability?: {
517
903
  state: "available" | "cooldown" | "exhausted";
518
904
  blocking_constraints: string[];
@@ -520,6 +906,7 @@ export declare const ControlQuotaSnapshot: z.ZodObject<{
520
906
  model_scoped_exhaustions: {
521
907
  constraint_id: string;
522
908
  applies_to_models: string[];
909
+ applies_to_model_prefixes?: string[] | undefined;
523
910
  resets_at: string | null;
524
911
  }[];
525
912
  } | undefined;
@@ -535,12 +922,46 @@ export declare const ControlQuotaRefreshRequest: z.ZodObject<{
535
922
  export type ControlQuotaRefreshRequest = z.infer<typeof ControlQuotaRefreshRequest>;
536
923
  export declare const QuotaRefreshSkipped: z.ZodObject<{
537
924
  vendor: z.ZodString;
925
+ subject: z.ZodOptional<z.ZodObject<{
926
+ harness: z.ZodString;
927
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
928
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
929
+ /** The CREDENTIAL SUBJECT the windows belong to (release wave round-16
930
+ * #2): a Claudexor credential-profile id, or null for the harness's
931
+ * engine-default credential. Every producer (oauth-usage refresher,
932
+ * typed-event registry, adapter quota events) uses exactly this
933
+ * vocabulary; budget routing filters snapshots by exact subject so one
934
+ * account's exhaustion never cools another. */
935
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
936
+ }, "strict", z.ZodTypeAny, {
937
+ harness: string;
938
+ credential_route: "local" | "managed_api_key" | "vendor_native";
939
+ plan_label: string | null;
940
+ subject_id: string | null;
941
+ }, {
942
+ harness: string;
943
+ credential_route: "local" | "managed_api_key" | "vendor_native";
944
+ plan_label?: string | null | undefined;
945
+ subject_id?: string | null | undefined;
946
+ }>>;
538
947
  not_before: z.ZodString;
539
948
  }, "strict", z.ZodTypeAny, {
540
949
  vendor: string;
950
+ subject?: {
951
+ harness: string;
952
+ credential_route: "local" | "managed_api_key" | "vendor_native";
953
+ plan_label: string | null;
954
+ subject_id: string | null;
955
+ } | undefined;
541
956
  not_before: string;
542
957
  }, {
543
958
  vendor: string;
959
+ subject?: {
960
+ harness: string;
961
+ credential_route: "local" | "managed_api_key" | "vendor_native";
962
+ plan_label?: string | null | undefined;
963
+ subject_id?: string | null | undefined;
964
+ } | undefined;
544
965
  not_before: string;
545
966
  }>;
546
967
  export type QuotaRefreshSkipped = z.infer<typeof QuotaRefreshSkipped>;
@@ -575,6 +996,10 @@ export declare const ControlQuotaResponse: z.ZodObject<{
575
996
  * list is the producer's canonical model-id/alias scope, so a
576
997
  * model-specific cap never cools a different model on the same subject. */
577
998
  applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
999
+ /** Vendor-declared model families, matched as literal id prefixes. These
1000
+ * augment exact ids without guessing that every unknown model belongs to
1001
+ * a known group. An absent/empty list adds no family scope. */
1002
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
578
1003
  /**
579
1004
  * Whether this MODEL-SCOPED window also governs a run that names no model.
580
1005
  * Default (absent) is the conservative answer: a scoped window cannot
@@ -593,6 +1018,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
593
1018
  id: string;
594
1019
  label: string;
595
1020
  applies_to_models?: string[] | null | undefined;
1021
+ applies_to_model_prefixes?: string[] | undefined;
596
1022
  applies_to_unspecified_model?: boolean | undefined;
597
1023
  used_ratio: number | null;
598
1024
  window_seconds: number | null;
@@ -602,16 +1028,18 @@ export declare const ControlQuotaResponse: z.ZodObject<{
602
1028
  id: string;
603
1029
  label: string;
604
1030
  applies_to_models?: string[] | null | undefined;
1031
+ applies_to_model_prefixes?: string[] | undefined;
605
1032
  applies_to_unspecified_model?: boolean | undefined;
606
1033
  used_ratio: number | null;
607
1034
  window_seconds: number | null;
608
1035
  resets_at: string | null;
609
1036
  cooldown_until?: string | null | undefined;
610
1037
  }>, "many">;
611
- source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit"]>;
1038
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage", "agy_command_usage", "cursor_rate_limit", "claude_rate_limit_event", "codex_app_server_event"]>;
612
1039
  observed_at: z.ZodString;
613
1040
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
614
1041
  } & {
1042
+ snapshot_id: z.ZodOptional<z.ZodString>;
615
1043
  availability: z.ZodOptional<z.ZodObject<{
616
1044
  state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
617
1045
  blocking_constraints: z.ZodArray<z.ZodString, "many">;
@@ -619,14 +1047,17 @@ export declare const ControlQuotaResponse: z.ZodObject<{
619
1047
  model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
620
1048
  constraint_id: z.ZodString;
621
1049
  applies_to_models: z.ZodArray<z.ZodString, "many">;
1050
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
622
1051
  resets_at: z.ZodNullable<z.ZodString>;
623
1052
  }, "strict", z.ZodTypeAny, {
624
1053
  constraint_id: string;
625
1054
  applies_to_models: string[];
1055
+ applies_to_model_prefixes?: string[] | undefined;
626
1056
  resets_at: string | null;
627
1057
  }, {
628
1058
  constraint_id: string;
629
1059
  applies_to_models: string[];
1060
+ applies_to_model_prefixes?: string[] | undefined;
630
1061
  resets_at: string | null;
631
1062
  }>, "many">;
632
1063
  }, "strict", z.ZodTypeAny, {
@@ -636,6 +1067,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
636
1067
  model_scoped_exhaustions: {
637
1068
  constraint_id: string;
638
1069
  applies_to_models: string[];
1070
+ applies_to_model_prefixes?: string[] | undefined;
639
1071
  resets_at: string | null;
640
1072
  }[];
641
1073
  }, {
@@ -645,6 +1077,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
645
1077
  model_scoped_exhaustions: {
646
1078
  constraint_id: string;
647
1079
  applies_to_models: string[];
1080
+ applies_to_model_prefixes?: string[] | undefined;
648
1081
  resets_at: string | null;
649
1082
  }[];
650
1083
  }>>;
@@ -659,15 +1092,17 @@ export declare const ControlQuotaResponse: z.ZodObject<{
659
1092
  id: string;
660
1093
  label: string;
661
1094
  applies_to_models?: string[] | null | undefined;
1095
+ applies_to_model_prefixes?: string[] | undefined;
662
1096
  applies_to_unspecified_model?: boolean | undefined;
663
1097
  used_ratio: number | null;
664
1098
  window_seconds: number | null;
665
1099
  resets_at: string | null;
666
1100
  cooldown_until: string | null;
667
1101
  }[];
668
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
1102
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
669
1103
  observed_at: string;
670
1104
  freshness: "fresh" | "stale" | "unknown";
1105
+ snapshot_id?: string | undefined;
671
1106
  availability?: {
672
1107
  state: "available" | "cooldown" | "exhausted";
673
1108
  blocking_constraints: string[];
@@ -675,6 +1110,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
675
1110
  model_scoped_exhaustions: {
676
1111
  constraint_id: string;
677
1112
  applies_to_models: string[];
1113
+ applies_to_model_prefixes?: string[] | undefined;
678
1114
  resets_at: string | null;
679
1115
  }[];
680
1116
  } | undefined;
@@ -689,15 +1125,17 @@ export declare const ControlQuotaResponse: z.ZodObject<{
689
1125
  id: string;
690
1126
  label: string;
691
1127
  applies_to_models?: string[] | null | undefined;
1128
+ applies_to_model_prefixes?: string[] | undefined;
692
1129
  applies_to_unspecified_model?: boolean | undefined;
693
1130
  used_ratio: number | null;
694
1131
  window_seconds: number | null;
695
1132
  resets_at: string | null;
696
1133
  cooldown_until?: string | null | undefined;
697
1134
  }[];
698
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
1135
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
699
1136
  observed_at: string;
700
1137
  freshness: "fresh" | "stale" | "unknown";
1138
+ snapshot_id?: string | undefined;
701
1139
  availability?: {
702
1140
  state: "available" | "cooldown" | "exhausted";
703
1141
  blocking_constraints: string[];
@@ -705,6 +1143,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
705
1143
  model_scoped_exhaustions: {
706
1144
  constraint_id: string;
707
1145
  applies_to_models: string[];
1146
+ applies_to_model_prefixes?: string[] | undefined;
708
1147
  resets_at: string | null;
709
1148
  }[];
710
1149
  } | undefined;
@@ -770,12 +1209,46 @@ export declare const ControlQuotaResponse: z.ZodObject<{
770
1209
  * that just said 429). Absent on plain reads and unskipped refreshes. */
771
1210
  refresh_skipped: z.ZodOptional<z.ZodArray<z.ZodObject<{
772
1211
  vendor: z.ZodString;
1212
+ subject: z.ZodOptional<z.ZodObject<{
1213
+ harness: z.ZodString;
1214
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
1215
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1216
+ /** The CREDENTIAL SUBJECT the windows belong to (release wave round-16
1217
+ * #2): a Claudexor credential-profile id, or null for the harness's
1218
+ * engine-default credential. Every producer (oauth-usage refresher,
1219
+ * typed-event registry, adapter quota events) uses exactly this
1220
+ * vocabulary; budget routing filters snapshots by exact subject so one
1221
+ * account's exhaustion never cools another. */
1222
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1223
+ }, "strict", z.ZodTypeAny, {
1224
+ harness: string;
1225
+ credential_route: "local" | "managed_api_key" | "vendor_native";
1226
+ plan_label: string | null;
1227
+ subject_id: string | null;
1228
+ }, {
1229
+ harness: string;
1230
+ credential_route: "local" | "managed_api_key" | "vendor_native";
1231
+ plan_label?: string | null | undefined;
1232
+ subject_id?: string | null | undefined;
1233
+ }>>;
773
1234
  not_before: z.ZodString;
774
1235
  }, "strict", z.ZodTypeAny, {
775
1236
  vendor: string;
1237
+ subject?: {
1238
+ harness: string;
1239
+ credential_route: "local" | "managed_api_key" | "vendor_native";
1240
+ plan_label: string | null;
1241
+ subject_id: string | null;
1242
+ } | undefined;
776
1243
  not_before: string;
777
1244
  }, {
778
1245
  vendor: string;
1246
+ subject?: {
1247
+ harness: string;
1248
+ credential_route: "local" | "managed_api_key" | "vendor_native";
1249
+ plan_label?: string | null | undefined;
1250
+ subject_id?: string | null | undefined;
1251
+ } | undefined;
779
1252
  not_before: string;
780
1253
  }>, "many">>;
781
1254
  }, "strict", z.ZodTypeAny, {
@@ -790,15 +1263,17 @@ export declare const ControlQuotaResponse: z.ZodObject<{
790
1263
  id: string;
791
1264
  label: string;
792
1265
  applies_to_models?: string[] | null | undefined;
1266
+ applies_to_model_prefixes?: string[] | undefined;
793
1267
  applies_to_unspecified_model?: boolean | undefined;
794
1268
  used_ratio: number | null;
795
1269
  window_seconds: number | null;
796
1270
  resets_at: string | null;
797
1271
  cooldown_until: string | null;
798
1272
  }[];
799
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
1273
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
800
1274
  observed_at: string;
801
1275
  freshness: "fresh" | "stale" | "unknown";
1276
+ snapshot_id?: string | undefined;
802
1277
  availability?: {
803
1278
  state: "available" | "cooldown" | "exhausted";
804
1279
  blocking_constraints: string[];
@@ -806,6 +1281,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
806
1281
  model_scoped_exhaustions: {
807
1282
  constraint_id: string;
808
1283
  applies_to_models: string[];
1284
+ applies_to_model_prefixes?: string[] | undefined;
809
1285
  resets_at: string | null;
810
1286
  }[];
811
1287
  } | undefined;
@@ -825,6 +1301,12 @@ export declare const ControlQuotaResponse: z.ZodObject<{
825
1301
  refreshed_at: string | null;
826
1302
  refresh_skipped?: {
827
1303
  vendor: string;
1304
+ subject?: {
1305
+ harness: string;
1306
+ credential_route: "local" | "managed_api_key" | "vendor_native";
1307
+ plan_label: string | null;
1308
+ subject_id: string | null;
1309
+ } | undefined;
828
1310
  not_before: string;
829
1311
  }[] | undefined;
830
1312
  }, {
@@ -839,15 +1321,17 @@ export declare const ControlQuotaResponse: z.ZodObject<{
839
1321
  id: string;
840
1322
  label: string;
841
1323
  applies_to_models?: string[] | null | undefined;
1324
+ applies_to_model_prefixes?: string[] | undefined;
842
1325
  applies_to_unspecified_model?: boolean | undefined;
843
1326
  used_ratio: number | null;
844
1327
  window_seconds: number | null;
845
1328
  resets_at: string | null;
846
1329
  cooldown_until?: string | null | undefined;
847
1330
  }[];
848
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
1331
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
849
1332
  observed_at: string;
850
1333
  freshness: "fresh" | "stale" | "unknown";
1334
+ snapshot_id?: string | undefined;
851
1335
  availability?: {
852
1336
  state: "available" | "cooldown" | "exhausted";
853
1337
  blocking_constraints: string[];
@@ -855,6 +1339,7 @@ export declare const ControlQuotaResponse: z.ZodObject<{
855
1339
  model_scoped_exhaustions: {
856
1340
  constraint_id: string;
857
1341
  applies_to_models: string[];
1342
+ applies_to_model_prefixes?: string[] | undefined;
858
1343
  resets_at: string | null;
859
1344
  }[];
860
1345
  } | undefined;
@@ -874,10 +1359,20 @@ export declare const ControlQuotaResponse: z.ZodObject<{
874
1359
  refreshed_at: string | null;
875
1360
  refresh_skipped?: {
876
1361
  vendor: string;
1362
+ subject?: {
1363
+ harness: string;
1364
+ credential_route: "local" | "managed_api_key" | "vendor_native";
1365
+ plan_label?: string | null | undefined;
1366
+ subject_id?: string | null | undefined;
1367
+ } | undefined;
877
1368
  not_before: string;
878
1369
  }[] | undefined;
879
1370
  }>;
880
1371
  export type ControlQuotaResponse = z.infer<typeof ControlQuotaResponse>;
1372
+ /** Literal family matching belongs to the quota contract, shared by display
1373
+ * and admission. Prefixes must be declared by the vendor-specific producer;
1374
+ * neither a missing model nor an unknown family proves a match. */
1375
+ export declare function quotaModelPrefixMatches(prefixes: readonly string[] | undefined, model: string): boolean;
881
1376
  /** Derive one snapshot's typed model-aware availability — a pure projection
882
1377
  * over the snapshot's own constraints, never an aggregate across subjects.
883
1378
  * Blocking semantics mirror the router's `BudgetLedger`: a window