@claudexor/schema 3.3.10 → 3.3.11

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.
@@ -930,6 +930,43 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
930
930
  source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage"]>;
931
931
  observed_at: z.ZodString;
932
932
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
933
+ } & {
934
+ availability: z.ZodOptional<z.ZodObject<{
935
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
936
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
937
+ resets_at: z.ZodNullable<z.ZodString>;
938
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
939
+ constraint_id: z.ZodString;
940
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
941
+ resets_at: z.ZodNullable<z.ZodString>;
942
+ }, "strict", z.ZodTypeAny, {
943
+ constraint_id: string;
944
+ applies_to_models: string[];
945
+ resets_at: string | null;
946
+ }, {
947
+ constraint_id: string;
948
+ applies_to_models: string[];
949
+ resets_at: string | null;
950
+ }>, "many">;
951
+ }, "strict", z.ZodTypeAny, {
952
+ state: "available" | "cooldown" | "exhausted";
953
+ blocking_constraints: string[];
954
+ resets_at: string | null;
955
+ model_scoped_exhaustions: {
956
+ constraint_id: string;
957
+ applies_to_models: string[];
958
+ resets_at: string | null;
959
+ }[];
960
+ }, {
961
+ state: "available" | "cooldown" | "exhausted";
962
+ blocking_constraints: string[];
963
+ resets_at: string | null;
964
+ model_scoped_exhaustions: {
965
+ constraint_id: string;
966
+ applies_to_models: string[];
967
+ resets_at: string | null;
968
+ }[];
969
+ }>>;
933
970
  }, "strict", z.ZodTypeAny, {
934
971
  subject: {
935
972
  harness: string;
@@ -949,6 +986,16 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
949
986
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
950
987
  observed_at: string;
951
988
  freshness: "fresh" | "stale" | "unknown";
989
+ availability?: {
990
+ state: "available" | "cooldown" | "exhausted";
991
+ blocking_constraints: string[];
992
+ resets_at: string | null;
993
+ model_scoped_exhaustions: {
994
+ constraint_id: string;
995
+ applies_to_models: string[];
996
+ resets_at: string | null;
997
+ }[];
998
+ } | undefined;
952
999
  }, {
953
1000
  subject: {
954
1001
  harness: string;
@@ -968,6 +1015,16 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
968
1015
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
969
1016
  observed_at: string;
970
1017
  freshness: "fresh" | "stale" | "unknown";
1018
+ availability?: {
1019
+ state: "available" | "cooldown" | "exhausted";
1020
+ blocking_constraints: string[];
1021
+ resets_at: string | null;
1022
+ model_scoped_exhaustions: {
1023
+ constraint_id: string;
1024
+ applies_to_models: string[];
1025
+ resets_at: string | null;
1026
+ }[];
1027
+ } | undefined;
971
1028
  }>, "many">;
972
1029
  absences: z.ZodDefault<z.ZodArray<z.ZodObject<{
973
1030
  subject: z.ZodObject<{
@@ -1031,6 +1088,16 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
1031
1088
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
1032
1089
  observed_at: string;
1033
1090
  freshness: "fresh" | "stale" | "unknown";
1091
+ availability?: {
1092
+ state: "available" | "cooldown" | "exhausted";
1093
+ blocking_constraints: string[];
1094
+ resets_at: string | null;
1095
+ model_scoped_exhaustions: {
1096
+ constraint_id: string;
1097
+ applies_to_models: string[];
1098
+ resets_at: string | null;
1099
+ }[];
1100
+ } | undefined;
1034
1101
  }[];
1035
1102
  absences: {
1036
1103
  subject: {
@@ -1064,6 +1131,16 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
1064
1131
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
1065
1132
  observed_at: string;
1066
1133
  freshness: "fresh" | "stale" | "unknown";
1134
+ availability?: {
1135
+ state: "available" | "cooldown" | "exhausted";
1136
+ blocking_constraints: string[];
1137
+ resets_at: string | null;
1138
+ model_scoped_exhaustions: {
1139
+ constraint_id: string;
1140
+ applies_to_models: string[];
1141
+ resets_at: string | null;
1142
+ }[];
1143
+ } | undefined;
1067
1144
  }[];
1068
1145
  absences?: {
1069
1146
  subject: {
@@ -1253,6 +1330,16 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
1253
1330
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
1254
1331
  observed_at: string;
1255
1332
  freshness: "fresh" | "stale" | "unknown";
1333
+ availability?: {
1334
+ state: "available" | "cooldown" | "exhausted";
1335
+ blocking_constraints: string[];
1336
+ resets_at: string | null;
1337
+ model_scoped_exhaustions: {
1338
+ constraint_id: string;
1339
+ applies_to_models: string[];
1340
+ resets_at: string | null;
1341
+ }[];
1342
+ } | undefined;
1256
1343
  }[];
1257
1344
  absences: {
1258
1345
  subject: {
@@ -1442,6 +1529,16 @@ export declare const ControlCredentialProfilesSnapshotResponse: z.ZodObject<{
1442
1529
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
1443
1530
  observed_at: string;
1444
1531
  freshness: "fresh" | "stale" | "unknown";
1532
+ availability?: {
1533
+ state: "available" | "cooldown" | "exhausted";
1534
+ blocking_constraints: string[];
1535
+ resets_at: string | null;
1536
+ model_scoped_exhaustions: {
1537
+ constraint_id: string;
1538
+ applies_to_models: string[];
1539
+ resets_at: string | null;
1540
+ }[];
1541
+ } | undefined;
1445
1542
  }[];
1446
1543
  absences?: {
1447
1544
  subject: {
@@ -2692,6 +2789,43 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
2692
2789
  source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage"]>;
2693
2790
  observed_at: z.ZodString;
2694
2791
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
2792
+ } & {
2793
+ availability: z.ZodOptional<z.ZodObject<{
2794
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
2795
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
2796
+ resets_at: z.ZodNullable<z.ZodString>;
2797
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
2798
+ constraint_id: z.ZodString;
2799
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
2800
+ resets_at: z.ZodNullable<z.ZodString>;
2801
+ }, "strict", z.ZodTypeAny, {
2802
+ constraint_id: string;
2803
+ applies_to_models: string[];
2804
+ resets_at: string | null;
2805
+ }, {
2806
+ constraint_id: string;
2807
+ applies_to_models: string[];
2808
+ resets_at: string | null;
2809
+ }>, "many">;
2810
+ }, "strict", z.ZodTypeAny, {
2811
+ state: "available" | "cooldown" | "exhausted";
2812
+ blocking_constraints: string[];
2813
+ resets_at: string | null;
2814
+ model_scoped_exhaustions: {
2815
+ constraint_id: string;
2816
+ applies_to_models: string[];
2817
+ resets_at: string | null;
2818
+ }[];
2819
+ }, {
2820
+ state: "available" | "cooldown" | "exhausted";
2821
+ blocking_constraints: string[];
2822
+ resets_at: string | null;
2823
+ model_scoped_exhaustions: {
2824
+ constraint_id: string;
2825
+ applies_to_models: string[];
2826
+ resets_at: string | null;
2827
+ }[];
2828
+ }>>;
2695
2829
  }, "strict", z.ZodTypeAny, {
2696
2830
  subject: {
2697
2831
  harness: string;
@@ -2711,6 +2845,16 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
2711
2845
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
2712
2846
  observed_at: string;
2713
2847
  freshness: "fresh" | "stale" | "unknown";
2848
+ availability?: {
2849
+ state: "available" | "cooldown" | "exhausted";
2850
+ blocking_constraints: string[];
2851
+ resets_at: string | null;
2852
+ model_scoped_exhaustions: {
2853
+ constraint_id: string;
2854
+ applies_to_models: string[];
2855
+ resets_at: string | null;
2856
+ }[];
2857
+ } | undefined;
2714
2858
  }, {
2715
2859
  subject: {
2716
2860
  harness: string;
@@ -2730,6 +2874,16 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
2730
2874
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
2731
2875
  observed_at: string;
2732
2876
  freshness: "fresh" | "stale" | "unknown";
2877
+ availability?: {
2878
+ state: "available" | "cooldown" | "exhausted";
2879
+ blocking_constraints: string[];
2880
+ resets_at: string | null;
2881
+ model_scoped_exhaustions: {
2882
+ constraint_id: string;
2883
+ applies_to_models: string[];
2884
+ resets_at: string | null;
2885
+ }[];
2886
+ } | undefined;
2733
2887
  }>, "many">;
2734
2888
  absences: z.ZodDefault<z.ZodArray<z.ZodObject<{
2735
2889
  subject: z.ZodObject<{
@@ -2793,6 +2947,16 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
2793
2947
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
2794
2948
  observed_at: string;
2795
2949
  freshness: "fresh" | "stale" | "unknown";
2950
+ availability?: {
2951
+ state: "available" | "cooldown" | "exhausted";
2952
+ blocking_constraints: string[];
2953
+ resets_at: string | null;
2954
+ model_scoped_exhaustions: {
2955
+ constraint_id: string;
2956
+ applies_to_models: string[];
2957
+ resets_at: string | null;
2958
+ }[];
2959
+ } | undefined;
2796
2960
  }[];
2797
2961
  absences: {
2798
2962
  subject: {
@@ -2826,6 +2990,16 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
2826
2990
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
2827
2991
  observed_at: string;
2828
2992
  freshness: "fresh" | "stale" | "unknown";
2993
+ availability?: {
2994
+ state: "available" | "cooldown" | "exhausted";
2995
+ blocking_constraints: string[];
2996
+ resets_at: string | null;
2997
+ model_scoped_exhaustions: {
2998
+ constraint_id: string;
2999
+ applies_to_models: string[];
3000
+ resets_at: string | null;
3001
+ }[];
3002
+ } | undefined;
2829
3003
  }[];
2830
3004
  absences?: {
2831
3005
  subject: {
@@ -3015,6 +3189,16 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
3015
3189
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
3016
3190
  observed_at: string;
3017
3191
  freshness: "fresh" | "stale" | "unknown";
3192
+ availability?: {
3193
+ state: "available" | "cooldown" | "exhausted";
3194
+ blocking_constraints: string[];
3195
+ resets_at: string | null;
3196
+ model_scoped_exhaustions: {
3197
+ constraint_id: string;
3198
+ applies_to_models: string[];
3199
+ resets_at: string | null;
3200
+ }[];
3201
+ } | undefined;
3018
3202
  }[];
3019
3203
  absences: {
3020
3204
  subject: {
@@ -3204,6 +3388,16 @@ export declare const ControlCredentialProfilesQueryResponse: z.ZodUnion<[z.ZodOb
3204
3388
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
3205
3389
  observed_at: string;
3206
3390
  freshness: "fresh" | "stale" | "unknown";
3391
+ availability?: {
3392
+ state: "available" | "cooldown" | "exhausted";
3393
+ blocking_constraints: string[];
3394
+ resets_at: string | null;
3395
+ model_scoped_exhaustions: {
3396
+ constraint_id: string;
3397
+ applies_to_models: string[];
3398
+ resets_at: string | null;
3399
+ }[];
3400
+ } | undefined;
3207
3401
  }[];
3208
3402
  absences?: {
3209
3403
  subject: {
@@ -1 +1 @@
1
- {"version":3,"file":"credential-profile-snapshot.d.ts","sourceRoot":"","sources":["../src/credential-profile-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,E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AAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAC"}
package/dist/quota.d.ts CHANGED
@@ -199,6 +199,218 @@ export declare const QuotaAbsence: z.ZodObject<{
199
199
  observed_at: string;
200
200
  }>;
201
201
  export type QuotaAbsence = z.infer<typeof QuotaAbsence>;
202
+ export declare const QuotaAvailabilityState: z.ZodEnum<["available", "exhausted", "cooldown"]>;
203
+ export type QuotaAvailabilityState = z.infer<typeof QuotaAvailabilityState>;
204
+ export declare const QuotaModelScopedExhaustion: z.ZodObject<{
205
+ constraint_id: z.ZodString;
206
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
207
+ resets_at: z.ZodNullable<z.ZodString>;
208
+ }, "strict", z.ZodTypeAny, {
209
+ constraint_id: string;
210
+ applies_to_models: string[];
211
+ resets_at: string | null;
212
+ }, {
213
+ constraint_id: string;
214
+ applies_to_models: string[];
215
+ resets_at: string | null;
216
+ }>;
217
+ export type QuotaModelScopedExhaustion = z.infer<typeof QuotaModelScopedExhaustion>;
218
+ export declare const QuotaAvailability: z.ZodObject<{
219
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
220
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
221
+ resets_at: z.ZodNullable<z.ZodString>;
222
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
223
+ constraint_id: z.ZodString;
224
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
225
+ resets_at: z.ZodNullable<z.ZodString>;
226
+ }, "strict", z.ZodTypeAny, {
227
+ constraint_id: string;
228
+ applies_to_models: string[];
229
+ resets_at: string | null;
230
+ }, {
231
+ constraint_id: string;
232
+ applies_to_models: string[];
233
+ resets_at: string | null;
234
+ }>, "many">;
235
+ }, "strict", z.ZodTypeAny, {
236
+ state: "available" | "cooldown" | "exhausted";
237
+ blocking_constraints: string[];
238
+ resets_at: string | null;
239
+ model_scoped_exhaustions: {
240
+ constraint_id: string;
241
+ applies_to_models: string[];
242
+ resets_at: string | null;
243
+ }[];
244
+ }, {
245
+ state: "available" | "cooldown" | "exhausted";
246
+ blocking_constraints: string[];
247
+ resets_at: string | null;
248
+ model_scoped_exhaustions: {
249
+ constraint_id: string;
250
+ applies_to_models: string[];
251
+ resets_at: string | null;
252
+ }[];
253
+ }>;
254
+ export type QuotaAvailability = z.infer<typeof QuotaAvailability>;
255
+ export declare const ControlQuotaSnapshot: z.ZodObject<{
256
+ subject: z.ZodObject<{
257
+ harness: z.ZodString;
258
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
259
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
260
+ /** The CREDENTIAL SUBJECT the windows belong to (release wave round-16
261
+ * #2): a Claudexor credential-profile id, or null for the harness's
262
+ * engine-default credential. Every producer (oauth-usage refresher,
263
+ * typed-event registry, adapter quota events) uses exactly this
264
+ * vocabulary; budget routing filters snapshots by exact subject so one
265
+ * account's exhaustion never cools another. */
266
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
267
+ }, "strict", z.ZodTypeAny, {
268
+ harness: string;
269
+ credential_route: "local" | "managed_api_key" | "vendor_native";
270
+ plan_label: string | null;
271
+ subject_id: string | null;
272
+ }, {
273
+ harness: string;
274
+ credential_route: "local" | "managed_api_key" | "vendor_native";
275
+ plan_label?: string | null | undefined;
276
+ subject_id?: string | null | undefined;
277
+ }>;
278
+ constraints: z.ZodArray<z.ZodObject<{
279
+ id: z.ZodString;
280
+ label: z.ZodString;
281
+ /** omitted/null = this vendor window applies to every model. A non-null
282
+ * list is the producer's canonical model-id/alias scope, so a
283
+ * model-specific cap never cools a different model on the same subject. */
284
+ applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
285
+ used_ratio: z.ZodNullable<z.ZodNumber>;
286
+ window_seconds: z.ZodNullable<z.ZodNumber>;
287
+ resets_at: z.ZodNullable<z.ZodString>;
288
+ cooldown_until: z.ZodDefault<z.ZodNullable<z.ZodString>>;
289
+ }, "strict", z.ZodTypeAny, {
290
+ id: string;
291
+ label: string;
292
+ applies_to_models?: string[] | null | undefined;
293
+ used_ratio: number | null;
294
+ window_seconds: number | null;
295
+ resets_at: string | null;
296
+ cooldown_until: string | null;
297
+ }, {
298
+ id: string;
299
+ label: string;
300
+ applies_to_models?: string[] | null | undefined;
301
+ used_ratio: number | null;
302
+ window_seconds: number | null;
303
+ resets_at: string | null;
304
+ cooldown_until?: string | null | undefined;
305
+ }>, "many">;
306
+ source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage"]>;
307
+ observed_at: z.ZodString;
308
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
309
+ } & {
310
+ availability: z.ZodOptional<z.ZodObject<{
311
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
312
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
313
+ resets_at: z.ZodNullable<z.ZodString>;
314
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
315
+ constraint_id: z.ZodString;
316
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
317
+ resets_at: z.ZodNullable<z.ZodString>;
318
+ }, "strict", z.ZodTypeAny, {
319
+ constraint_id: string;
320
+ applies_to_models: string[];
321
+ resets_at: string | null;
322
+ }, {
323
+ constraint_id: string;
324
+ applies_to_models: string[];
325
+ resets_at: string | null;
326
+ }>, "many">;
327
+ }, "strict", z.ZodTypeAny, {
328
+ state: "available" | "cooldown" | "exhausted";
329
+ blocking_constraints: string[];
330
+ resets_at: string | null;
331
+ model_scoped_exhaustions: {
332
+ constraint_id: string;
333
+ applies_to_models: string[];
334
+ resets_at: string | null;
335
+ }[];
336
+ }, {
337
+ state: "available" | "cooldown" | "exhausted";
338
+ blocking_constraints: string[];
339
+ resets_at: string | null;
340
+ model_scoped_exhaustions: {
341
+ constraint_id: string;
342
+ applies_to_models: string[];
343
+ resets_at: string | null;
344
+ }[];
345
+ }>>;
346
+ }, "strict", z.ZodTypeAny, {
347
+ subject: {
348
+ harness: string;
349
+ credential_route: "local" | "managed_api_key" | "vendor_native";
350
+ plan_label: string | null;
351
+ subject_id: string | null;
352
+ };
353
+ constraints: {
354
+ id: string;
355
+ label: string;
356
+ applies_to_models?: string[] | null | undefined;
357
+ used_ratio: number | null;
358
+ window_seconds: number | null;
359
+ resets_at: string | null;
360
+ cooldown_until: string | null;
361
+ }[];
362
+ source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
363
+ observed_at: string;
364
+ freshness: "fresh" | "stale" | "unknown";
365
+ availability?: {
366
+ state: "available" | "cooldown" | "exhausted";
367
+ blocking_constraints: string[];
368
+ resets_at: string | null;
369
+ model_scoped_exhaustions: {
370
+ constraint_id: string;
371
+ applies_to_models: string[];
372
+ resets_at: string | null;
373
+ }[];
374
+ } | undefined;
375
+ }, {
376
+ subject: {
377
+ harness: string;
378
+ credential_route: "local" | "managed_api_key" | "vendor_native";
379
+ plan_label?: string | null | undefined;
380
+ subject_id?: string | null | undefined;
381
+ };
382
+ constraints: {
383
+ id: string;
384
+ label: string;
385
+ applies_to_models?: string[] | null | undefined;
386
+ used_ratio: number | null;
387
+ window_seconds: number | null;
388
+ resets_at: string | null;
389
+ cooldown_until?: string | null | undefined;
390
+ }[];
391
+ source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
392
+ observed_at: string;
393
+ freshness: "fresh" | "stale" | "unknown";
394
+ availability?: {
395
+ state: "available" | "cooldown" | "exhausted";
396
+ blocking_constraints: string[];
397
+ resets_at: string | null;
398
+ model_scoped_exhaustions: {
399
+ constraint_id: string;
400
+ applies_to_models: string[];
401
+ resets_at: string | null;
402
+ }[];
403
+ } | undefined;
404
+ }>;
405
+ export type ControlQuotaSnapshot = z.infer<typeof ControlQuotaSnapshot>;
406
+ export declare const ControlQuotaRefreshRequest: z.ZodObject<{
407
+ model: z.ZodOptional<z.ZodString>;
408
+ }, "strict", z.ZodTypeAny, {
409
+ model?: string | undefined;
410
+ }, {
411
+ model?: string | undefined;
412
+ }>;
413
+ export type ControlQuotaRefreshRequest = z.infer<typeof ControlQuotaRefreshRequest>;
202
414
  export declare const ControlQuotaResponse: z.ZodObject<{
203
415
  snapshots: z.ZodArray<z.ZodObject<{
204
416
  subject: z.ZodObject<{
@@ -254,6 +466,43 @@ export declare const ControlQuotaResponse: z.ZodObject<{
254
466
  source: z.ZodEnum<["codex_app_server", "codex_rollout", "claude_statusline", "claude_api_retry", "claude_oauth_usage"]>;
255
467
  observed_at: z.ZodString;
256
468
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
469
+ } & {
470
+ availability: z.ZodOptional<z.ZodObject<{
471
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
472
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
473
+ resets_at: z.ZodNullable<z.ZodString>;
474
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
475
+ constraint_id: z.ZodString;
476
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
477
+ resets_at: z.ZodNullable<z.ZodString>;
478
+ }, "strict", z.ZodTypeAny, {
479
+ constraint_id: string;
480
+ applies_to_models: string[];
481
+ resets_at: string | null;
482
+ }, {
483
+ constraint_id: string;
484
+ applies_to_models: string[];
485
+ resets_at: string | null;
486
+ }>, "many">;
487
+ }, "strict", z.ZodTypeAny, {
488
+ state: "available" | "cooldown" | "exhausted";
489
+ blocking_constraints: string[];
490
+ resets_at: string | null;
491
+ model_scoped_exhaustions: {
492
+ constraint_id: string;
493
+ applies_to_models: string[];
494
+ resets_at: string | null;
495
+ }[];
496
+ }, {
497
+ state: "available" | "cooldown" | "exhausted";
498
+ blocking_constraints: string[];
499
+ resets_at: string | null;
500
+ model_scoped_exhaustions: {
501
+ constraint_id: string;
502
+ applies_to_models: string[];
503
+ resets_at: string | null;
504
+ }[];
505
+ }>>;
257
506
  }, "strict", z.ZodTypeAny, {
258
507
  subject: {
259
508
  harness: string;
@@ -273,6 +522,16 @@ export declare const ControlQuotaResponse: z.ZodObject<{
273
522
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
274
523
  observed_at: string;
275
524
  freshness: "fresh" | "stale" | "unknown";
525
+ availability?: {
526
+ state: "available" | "cooldown" | "exhausted";
527
+ blocking_constraints: string[];
528
+ resets_at: string | null;
529
+ model_scoped_exhaustions: {
530
+ constraint_id: string;
531
+ applies_to_models: string[];
532
+ resets_at: string | null;
533
+ }[];
534
+ } | undefined;
276
535
  }, {
277
536
  subject: {
278
537
  harness: string;
@@ -292,6 +551,16 @@ export declare const ControlQuotaResponse: z.ZodObject<{
292
551
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
293
552
  observed_at: string;
294
553
  freshness: "fresh" | "stale" | "unknown";
554
+ availability?: {
555
+ state: "available" | "cooldown" | "exhausted";
556
+ blocking_constraints: string[];
557
+ resets_at: string | null;
558
+ model_scoped_exhaustions: {
559
+ constraint_id: string;
560
+ applies_to_models: string[];
561
+ resets_at: string | null;
562
+ }[];
563
+ } | undefined;
295
564
  }>, "many">;
296
565
  absences: z.ZodDefault<z.ZodArray<z.ZodObject<{
297
566
  subject: z.ZodObject<{
@@ -361,6 +630,16 @@ export declare const ControlQuotaResponse: z.ZodObject<{
361
630
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
362
631
  observed_at: string;
363
632
  freshness: "fresh" | "stale" | "unknown";
633
+ availability?: {
634
+ state: "available" | "cooldown" | "exhausted";
635
+ blocking_constraints: string[];
636
+ resets_at: string | null;
637
+ model_scoped_exhaustions: {
638
+ constraint_id: string;
639
+ applies_to_models: string[];
640
+ resets_at: string | null;
641
+ }[];
642
+ } | undefined;
364
643
  }[];
365
644
  absences: {
366
645
  subject: {
@@ -394,6 +673,16 @@ export declare const ControlQuotaResponse: z.ZodObject<{
394
673
  source: "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
395
674
  observed_at: string;
396
675
  freshness: "fresh" | "stale" | "unknown";
676
+ availability?: {
677
+ state: "available" | "cooldown" | "exhausted";
678
+ blocking_constraints: string[];
679
+ resets_at: string | null;
680
+ model_scoped_exhaustions: {
681
+ constraint_id: string;
682
+ applies_to_models: string[];
683
+ resets_at: string | null;
684
+ }[];
685
+ } | undefined;
397
686
  }[];
398
687
  absences?: {
399
688
  subject: {
@@ -409,4 +698,29 @@ export declare const ControlQuotaResponse: z.ZodObject<{
409
698
  refreshed_at: string | null;
410
699
  }>;
411
700
  export type ControlQuotaResponse = z.infer<typeof ControlQuotaResponse>;
701
+ /** Derive one snapshot's typed model-aware availability — a pure projection
702
+ * over the snapshot's own constraints, never an aggregate across subjects.
703
+ * Blocking semantics mirror the router's `BudgetLedger`: a window
704
+ * blocks while its cooldown_until is in the future, or while used_ratio >= 1
705
+ * with a still-future resets_at (a spent ratio whose reset elapsed or is
706
+ * unknown is stale data, not a live block). Without `model`, only windows that
707
+ * apply to EVERY model can block; model-scoped spent windows are disclosed in
708
+ * model_scoped_exhaustions and leave state available — including a spent
709
+ * scoped window whose reset is UNKNOWN (disclosed with resets_at null, never
710
+ * blocking); one whose reset ELAPSED is provably released and not disclosed.
711
+ * With `model`, scoped windows matching it block too.
712
+ * Full-coverage inference ("every model is
713
+ * covered by some spent scoped window") is deliberately not attempted: the
714
+ * model universe is unknowable here, so that case stays available + disclosed. */
715
+ export declare function quotaSnapshotAvailability(snapshot: Pick<QuotaSnapshot, "constraints">, opts?: {
716
+ now?: Date;
717
+ model?: string | null;
718
+ }): QuotaAvailability;
719
+ /** Decorate a quota response with per-snapshot availability projections —
720
+ * applied at the /v2/quota boundary so journals, projection signatures, and
721
+ * embedded raw snapshots stay byte-identical. */
722
+ export declare function withQuotaAvailability(response: ControlQuotaResponse, opts?: {
723
+ now?: Date;
724
+ model?: string | null;
725
+ }): ControlQu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,eAAO,MAAM,0BAA0B;;;;;;EAapC,CAAC;AACJ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEpF,eAAO,MAAM,oBAAoB;;;;;;YA3I7B;;;;;2DAK+C;;;;;;;;;;;;;;;;YAa/C;;uFAE2E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YApB3E;;;;;2DAK+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJmB,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AA4BxE;;;;;;;;;;;;;kFAakF;AAClF,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,EAC5C,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC/C,iBAAiB,CAyDnB;AAED;;iDAEiD;AACjD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC/C,oBAAoB,CAQtB"}
package/dist/quota.js CHANGED
@@ -75,9 +75,50 @@ export const QuotaAbsence = z
75
75
  })
76
76
  .strict()
77
77
  .describe("A registered subject's typed missing-snapshot — absence is stated, never inferred.");
78
+ export const QuotaAvailabilityState = z
79
+ .enum(["available", "exhausted", "cooldown"])
80
+ .describe("Spendability verdict for one snapshot: exhausted = a spent window blocks every applicable request; cooldown = an applicable window is only rate-limit-cooling; available = nothing applicable blocks.");
81
+ export const QuotaModelScopedExhaustion = z
82
+ .object({
83
+ constraint_id: Id,
84
+ applies_to_models: z.array(Id).min(1),
85
+ resets_at: z.string().datetime({ offset: true }).nullable(),
86
+ })
87
+ .strict()
88
+ .describe("A spent or cooling window that applies only to the named models. Without a requested model it never sets the whole subject exhausted; when the request names a model it covers, it blocks that request too (and is then also listed in blocking_constraints). resets_at is its earliest known release instant (null = unknown).");
89
+ export const QuotaAvailability = z
90
+ .object({
91
+ state: QuotaAvailabilityState,
92
+ blocking_constraints: z
93
+ .array(Id)
94
+ .describe("Ids of the constraints that produced a non-available state."),
95
+ resets_at: z
96
+ .string()
97
+ .datetime({ offset: true })
98
+ .nullable()
99
+ .describe("Earliest known instant at which any blocking constraint may release; null when nothing blocks or no reset is known."),
100
+ model_scoped_exhaustions: z
101
+ .array(QuotaModelScopedExhaustion)
102
+ .describe("Every spent/cooling model-scoped window, listed regardless of state so consumers see partial exhaustion without re-deriving constraint scope."),
103
+ })
104
+ .strict()
105
+ .describe("Derived model-aware availability projection for one quota snapshot. Without a requested model, only windows applying to EVERY model can set exhausted/cooldown — a model-scoped spent window keeps state available and is disclosed in model_scoped_exhaustions.");
106
+ export const ControlQuotaSnapshot = QuotaSnapshot.extend({
107
+ availability: QuotaAvailability.optional().describe("Typed availability projection derived by the /v2/quota route; absent on surfaces that embed raw snapshots."),
108
+ }).describe("One vendor-owned quota snapshot plus its derived availability projection.");
109
+ export const ControlQuotaRefreshRequest = z
110
+ .object({
111
+ model: z
112
+ .string()
113
+ .min(1)
114
+ .optional()
115
+ .describe("Optional model id/alias the caller intends to spend against. When present, each snapshot's availability.state is computed against this model (case-insensitive alias containment in either direction), so windows scoped to OTHER models never report the subject exhausted."),
116
+ })
117
+ .strict()
118
+ .describe("Optional POST /v2/quota body; an empty or absent body keeps the model-agnostic projection.");
78
119
  export const ControlQuotaResponse = z
79
120
  .object({
80
- snapshots: z.array(QuotaSnapshot),
121
+ snapshots: z.array(ControlQuotaSnapshot),
81
122
  absences: z
82
123
  .array(QuotaAbsence)
83
124
  .default([])
@@ -86,4 +127,113 @@ export const ControlQuotaResponse = z
86
127
  })
87
128
  .strict()
88
129
  .describe("Current quota snapshots without a fabricated aggregate.");
130
+ /** Millisecond instant of a still-future ISO timestamp, else null. */
131
+ function futureMs(iso, now) {
132
+ if (!iso)
133
+ return null;
134
+ const at = Date.parse(iso);
135
+ return Number.isFinite(at) && at > now ? at : null;
136
+ }
137
+ /** API-parameter model matching, deliberately looser than the router's exact
138
+ * `quotaConstraintAppliesToModel` (@claudexor/budget): consumers pass whatever
139
+ * model string they route with ("claude-fable-5", "fable", a bracketed
140
+ * variant), while producers publish vendor alias lists — so match by
141
+ * case-insensitive alias containment in either direction. A null/empty scope
142
+ * list is a vendor-wide window and matches every model. */
143
+ function modelScopeMatches(scope, model) {
144
+ if (scope == null || scope.length === 0)
145
+ return true;
146
+ const target = model.trim().toLowerCase();
147
+ return scope.some((alias) => {
148
+ const candidate = alias.trim().toLowerCase();
149
+ return (candidate !== "" &&
150
+ target !== "" &&
151
+ (candidate.includes(target) || target.includes(candidate)));
152
+ });
153
+ }
154
+ /** Derive one snapshot's typed model-aware availability — a pure projection
155
+ * over the snapshot's own constraints, never an aggregate across subjects.
156
+ * Blocking semantics mirror the router's `BudgetLedger`: a window
157
+ * blocks while its cooldown_until is in the future, or while used_ratio >= 1
158
+ * with a still-future resets_at (a spent ratio whose reset elapsed or is
159
+ * unknown is stale data, not a live block). Without `model`, only windows that
160
+ * apply to EVERY model can block; model-scoped spent windows are disclosed in
161
+ * model_scoped_exhaustions and leave state available — including a spent
162
+ * scoped window whose reset is UNKNOWN (disclosed with resets_at null, never
163
+ * blocking); one whose reset ELAPSED is provably released and not disclosed.
164
+ * With `model`, scoped windows matching it block too.
165
+ * Full-coverage inference ("every model is
166
+ * covered by some spent scoped window") is deliberately not attempted: the
167
+ * model universe is unknowable here, so that case stays available + disclosed. */
168
+ export function quotaSnapshotAvailability(snapshot, opts = {}) {
169
+ const now = (opts.now ?? new Date()).getTime();
170
+ const model = opts.model ?? null;
171
+ const blocking = [];
172
+ const scopedExhaustions = [];
173
+ let sawExhausted = false;
174
+ let earliestRelease = null;
175
+ for (const constraint of snapshot.constraints) {
176
+ const resetAt = futureMs(constraint.resets_at, now);
177
+ const cooldownAt = futureMs(constraint.cooldown_until, now);
178
+ const exhausted = constraint.used_ratio !== null && constraint.used_ratio >= 1 && resetAt !== null;
179
+ const cooling = cooldownAt !== null;
180
+ // A spent ratio with an UNKNOWN reset never blocks (BudgetLedger mirror:
181
+ // stale data, not a live block), but a scoped one is still DISCLOSED below
182
+ // with resets_at null; an elapsed reset is provably released and stays
183
+ // undisclosed.
184
+ const spentUnknownReset = constraint.used_ratio !== null && constraint.used_ratio >= 1 && constraint.resets_at === null;
185
+ if (!exhausted && !cooling && !spentUnknownReset)
186
+ continue;
187
+ // A constraint stays blocked until EVERY active condition lifts, so its
188
+ // own release is the LATER of the two; the snapshot-level resets_at below
189
+ // is the EARLIEST such release across blocking constraints. A
190
+ // disclosure-only window (spent, unknown reset) has no release instant.
191
+ const release = !exhausted && !cooling
192
+ ? null
193
+ : exhausted && cooling
194
+ ? resetAt >= cooldownAt
195
+ ? { iso: constraint.resets_at, at: resetAt }
196
+ : { iso: constraint.cooldown_until, at: cooldownAt }
197
+ : exhausted
198
+ ? { iso: constraint.resets_at, at: resetAt }
199
+ : { iso: constraint.cooldown_until, at: cooldownAt };
200
+ const scope = constraint.applies_to_models ?? null;
201
+ const scoped = scope !== null && scope.length > 0;
202
+ if (scoped) {
203
+ scopedExhaustions.push({
204
+ constraint_id: constraint.id,
205
+ applies_to_models: [...scope],
206
+ resets_at: release?.iso ?? null,
207
+ });
208
+ }
209
+ if (release === null)
210
+ continue;
211
+ if (scoped && (model === null || !modelScopeMatches(scope, model)))
212
+ continue;
213
+ blocking.push(constraint.id);
214
+ if (exhausted)
215
+ sawExhausted = true;
216
+ if (earliestRelease === null || release.at < earliestRelease.at) {
217
+ earliestRelease = release;
218
+ }
219
+ }
220
+ return QuotaAvailability.parse({
221
+ state: blocking.length === 0 ? "available" : sawExhausted ? "exhausted" : "cooldown",
222
+ blocking_constraints: blocking,
223
+ resets_at: earliestRelease?.iso ?? null,
224
+ model_scoped_exhaustions: scopedExhaustions,
225
+ });
226
+ }
227
+ /** Decorate a quota response with per-snapshot availability projections —
228
+ * applied at the /v2/quota boundary so journals, projection signatures, and
229
+ * embedded raw snapshots stay byte-identical. */
230
+ export function withQuotaAvailability(response, opts = {}) {
231
+ return {
232
+ ...response,
233
+ snapshots: response.snapshots.map((snapshot) => ({
234
+ ...snapshot,
235
+ availability: quotaSnapshotAvailability(snapshot, opts),
236
+ })),
237
+ };
238
+ }
89
239
  //# sourceMappingURL=quota.js.map
package/dist/quota.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"quota.js","sourceRoot":"","sources":["../src/quota.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,IAAI,CAAC;IACJ,kBAAkB;IAClB,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;CACrB,CAAC;KACD,QAAQ,CAAC,2DAA2D,CAAC,CAAC;AAGzE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;KACnC,QAAQ,CAAC,6CAA6C,CAAC,CAAC;AAG3D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,OAAO,EAAE,EAAE;IACX,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe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{
1261
+ "type": "object",
1262
+ "properties": {
1263
+ "state": {
1264
+ "type": "string",
1265
+ "enum": [
1266
+ "available",
1267
+ "exhausted",
1268
+ "cooldown"
1269
+ ],
1270
+ "description": "Spendability verdict for one snapshot: exhausted = a spent window blocks every applicable request; cooldown = an applicable window is only rate-limit-cooling; available = nothing applicable blocks."
1271
+ },
1272
+ "blocking_constraints": {
1273
+ "type": "array",
1274
+ "items": {
1275
+ "$ref": "#/definitions/ControlCredentialProfilesQueryResponse/anyOf/0/properties/profiles/items/properties/status/properties/profile_id"
1276
+ },
1277
+ "description": "Ids of the constraints that produced a non-available state."
1278
+ },
1279
+ "resets_at": {
1280
+ "anyOf": [
1281
+ {
1282
+ "type": "string",
1283
+ "format": "date-time"
1284
+ },
1285
+ {
1286
+ "type": "null"
1287
+ }
1288
+ ],
1289
+ "description": "Earliest known instant at which any blocking constraint may release; null when nothing blocks or no reset is known."
1290
+ },
1291
+ "model_scoped_exhaustions": {
1292
+ "type": "array",
1293
+ "items": {
1294
+ "type": "object",
1295
+ "properties": {
1296
+ "constraint_id": {
1297
+ "$ref": "#/definitions/ControlCredentialProfilesQueryResponse/anyOf/0/properties/profiles/items/properties/status/properties/profile_id"
1298
+ },
1299
+ "applies_to_models": {
1300
+ "type": "array",
1301
+ "items": {
1302
+ "$ref": "#/definitions/ControlCredentialProfilesQueryResponse/anyOf/0/properties/profiles/items/properties/status/properties/profile_id"
1303
+ },
1304
+ "minItems": 1
1305
+ },
1306
+ "resets_at": {
1307
+ "anyOf": [
1308
+ {
1309
+ "type": "string",
1310
+ "format": "date-time"
1311
+ },
1312
+ {
1313
+ "type": "null"
1314
+ }
1315
+ ]
1316
+ }
1317
+ },
1318
+ "required": [
1319
+ "constraint_id",
1320
+ "applies_to_models",
1321
+ "resets_at"
1322
+ ],
1323
+ "additionalProperties": false,
1324
+ "description": "A spent or cooling window that applies only to the named models. Without a requested model it never sets the whole subject exhausted; when the request names a model it covers, it blocks that request too (and is then also listed in blocking_constraints). resets_at is its earliest known release instant (null = unknown)."
1325
+ },
1326
+ "description": "Every spent/cooling model-scoped window, listed regardless of state so consumers see partial exhaustion without re-deriving constraint scope."
1327
+ }
1328
+ },
1329
+ "required": [
1330
+ "state",
1331
+ "blocking_constraints",
1332
+ "resets_at",
1333
+ "model_scoped_exhaustions"
1334
+ ],
1335
+ "additionalProperties": false,
1336
+ "description": "Typed availability projection derived by the /v2/quota route; absent on surfaces that embed raw snapshots."
1259
1337
  }
1260
1338
  },
1261
1339
  "required": [
@@ -1266,7 +1344,7 @@
1266
1344
  "freshness"
1267
1345
  ],
1268
1346
  "additionalProperties": false,
1269
- "description": "All independently reported quota windows for one vendor-owned subject."
1347
+ "description": "One vendor-owned quota snapshot plus its derived availability projection."
1270
1348
  }
1271
1349
  },
1272
1350
  "absences": {
@@ -1238,6 +1238,84 @@
1238
1238
  "unknown"
1239
1239
  ],
1240
1240
  "description": "Freshness of a quota snapshot at read time."
1241
+ },
1242
+ "availability": {
1243
+ "type": "object",
1244
+ "properties": {
1245
+ "state": {
1246
+ "type": "string",
1247
+ "enum": [
1248
+ "available",
1249
+ "exhausted",
1250
+ "cooldown"
1251
+ ],
1252
+ "description": "Spendability verdict for one snapshot: exhausted = a spent window blocks every applicable request; cooldown = an applicable window is only rate-limit-cooling; available = nothing applicable blocks."
1253
+ },
1254
+ "blocking_constraints": {
1255
+ "type": "array",
1256
+ "items": {
1257
+ "$ref": "#/definitions/ControlCredentialProfilesSnapshotResponse/properties/profiles/items/properties/status/properties/profile_id"
1258
+ },
1259
+ "description": "Ids of the constraints that produced a non-available state."
1260
+ },
1261
+ "resets_at": {
1262
+ "anyOf": [
1263
+ {
1264
+ "type": "string",
1265
+ "format": "date-time"
1266
+ },
1267
+ {
1268
+ "type": "null"
1269
+ }
1270
+ ],
1271
+ "description": "Earliest known instant at which any blocking constraint may release; null when nothing blocks or no reset is known."
1272
+ },
1273
+ "model_scoped_exhaustions": {
1274
+ "type": "array",
1275
+ "items": {
1276
+ "type": "object",
1277
+ "properties": {
1278
+ "constraint_id": {
1279
+ "$ref": "#/definitions/ControlCredentialProfilesSnapshotResponse/properties/profiles/items/properties/status/properties/profile_id"
1280
+ },
1281
+ "applies_to_models": {
1282
+ "type": "array",
1283
+ "items": {
1284
+ "$ref": "#/definitions/ControlCredentialProfilesSnapshotResponse/properties/profiles/items/properties/status/properties/profile_id"
1285
+ },
1286
+ "minItems": 1
1287
+ },
1288
+ "resets_at": {
1289
+ "anyOf": [
1290
+ {
1291
+ "type": "string",
1292
+ "format": "date-time"
1293
+ },
1294
+ {
1295
+ "type": "null"
1296
+ }
1297
+ ]
1298
+ }
1299
+ },
1300
+ "required": [
1301
+ "constraint_id",
1302
+ "applies_to_models",
1303
+ "resets_at"
1304
+ ],
1305
+ "additionalProperties": false,
1306
+ "description": "A spent or cooling window that applies only to the named models. Without a requested model it never sets the whole subject exhausted; when the request names a model it covers, it blocks that request too (and is then also listed in blocking_constraints). resets_at is its earliest known release instant (null = unknown)."
1307
+ },
1308
+ "description": "Every spent/cooling model-scoped window, listed regardless of state so consumers see partial exhaustion without re-deriving constraint scope."
1309
+ }
1310
+ },
1311
+ "required": [
1312
+ "state",
1313
+ "blocking_constraints",
1314
+ "resets_at",
1315
+ "model_scoped_exhaustions"
1316
+ ],
1317
+ "additionalProperties": false,
1318
+ "description": "Typed availability projection derived by the /v2/quota route; absent on surfaces that embed raw snapshots."
1241
1319
  }
1242
1320
  },
1243
1321
  "required": [
@@ -1248,7 +1326,7 @@
1248
1326
  "freshness"
1249
1327
  ],
1250
1328
  "additionalProperties": false,
1251
- "description": "All independently reported quota windows for one vendor-owned subject."
1329
+ "description": "One vendor-owned quota snapshot plus its derived availability projection."
1252
1330
  }
1253
1331
  },
1254
1332
  "absences": {
@@ -0,0 +1,18 @@
1
+ {
2
+ "$ref": "#/definitions/ControlQuotaRefreshRequest",
3
+ "definitions": {
4
+ "ControlQuotaRefreshRequest": {
5
+ "type": "object",
6
+ "properties": {
7
+ "model": {
8
+ "type": "string",
9
+ "minLength": 1,
10
+ "description": "Optional model id/alias the caller intends to spend against. When present, each snapshot's availability.state is computed against this model (case-insensitive alias containment in either direction), so windows scoped to OTHER models never report the subject exhausted."
11
+ }
12
+ },
13
+ "additionalProperties": false,
14
+ "description": "Optional POST /v2/quota body; an empty or absent body keeps the model-agnostic projection."
15
+ }
16
+ },
17
+ "$schema": "http://json-schema.org/draft-07/schema#"
18
+ }
@@ -153,6 +153,84 @@
153
153
  "unknown"
154
154
  ],
155
155
  "description": "Freshness of a quota snapshot at read time."
156
+ },
157
+ "availability": {
158
+ "type": "object",
159
+ "properties": {
160
+ "state": {
161
+ "type": "string",
162
+ "enum": [
163
+ "available",
164
+ "exhausted",
165
+ "cooldown"
166
+ ],
167
+ "description": "Spendability verdict for one snapshot: exhausted = a spent window blocks every applicable request; cooldown = an applicable window is only rate-limit-cooling; available = nothing applicable blocks."
168
+ },
169
+ "blocking_constraints": {
170
+ "type": "array",
171
+ "items": {
172
+ "$ref": "#/definitions/ControlQuotaResponse/properties/snapshots/items/properties/subject/properties/harness"
173
+ },
174
+ "description": "Ids of the constraints that produced a non-available state."
175
+ },
176
+ "resets_at": {
177
+ "anyOf": [
178
+ {
179
+ "type": "string",
180
+ "format": "date-time"
181
+ },
182
+ {
183
+ "type": "null"
184
+ }
185
+ ],
186
+ "description": "Earliest known instant at which any blocking constraint may release; null when nothing blocks or no reset is known."
187
+ },
188
+ "model_scoped_exhaustions": {
189
+ "type": "array",
190
+ "items": {
191
+ "type": "object",
192
+ "properties": {
193
+ "constraint_id": {
194
+ "$ref": "#/definitions/ControlQuotaResponse/properties/snapshots/items/properties/subject/properties/harness"
195
+ },
196
+ "applies_to_models": {
197
+ "type": "array",
198
+ "items": {
199
+ "$ref": "#/definitions/ControlQuotaResponse/properties/snapshots/items/properties/subject/properties/harness"
200
+ },
201
+ "minItems": 1
202
+ },
203
+ "resets_at": {
204
+ "anyOf": [
205
+ {
206
+ "type": "string",
207
+ "format": "date-time"
208
+ },
209
+ {
210
+ "type": "null"
211
+ }
212
+ ]
213
+ }
214
+ },
215
+ "required": [
216
+ "constraint_id",
217
+ "applies_to_models",
218
+ "resets_at"
219
+ ],
220
+ "additionalProperties": false,
221
+ "description": "A spent or cooling window that applies only to the named models. Without a requested model it never sets the whole subject exhausted; when the request names a model it covers, it blocks that request too (and is then also listed in blocking_constraints). resets_at is its earliest known release instant (null = unknown)."
222
+ },
223
+ "description": "Every spent/cooling model-scoped window, listed regardless of state so consumers see partial exhaustion without re-deriving constraint scope."
224
+ }
225
+ },
226
+ "required": [
227
+ "state",
228
+ "blocking_constraints",
229
+ "resets_at",
230
+ "model_scoped_exhaustions"
231
+ ],
232
+ "additionalProperties": false,
233
+ "description": "Typed availability projection derived by the /v2/quota route; absent on surfaces that embed raw snapshots."
156
234
  }
157
235
  },
158
236
  "required": [
@@ -163,7 +241,7 @@
163
241
  "freshness"
164
242
  ],
165
243
  "additionalProperties": false,
166
- "description": "All independently reported quota windows for one vendor-owned subject."
244
+ "description": "One vendor-owned quota snapshot plus its derived availability projection."
167
245
  }
168
246
  },
169
247
  "absences": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudexor/schema",
3
- "version": "3.3.10",
3
+ "version": "3.3.11",
4
4
  "license": "MIT",
5
5
  "description": "Single source of truth for all Claudexor data shapes (Zod + generated JSON Schema).",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "zod": "^4.4.3",
22
22
  "zod-to-json-schema": "^3.24.1",
23
- "@claudexor/util": "3.3.10"
23
+ "@claudexor/util": "3.3.11"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",