@claudexor/schema 3.25.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/account-resources.d.ts +372 -0
  2. package/dist/account-resources.d.ts.map +1 -1
  3. package/dist/account-resources.js +4 -0
  4. package/dist/account-resources.js.map +1 -1
  5. package/dist/config.d.ts +74 -12
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +2 -1
  8. package/dist/config.js.map +1 -1
  9. package/dist/control.d.ts +226 -18
  10. package/dist/control.d.ts.map +1 -1
  11. package/dist/daemon-status.d.ts +671 -5
  12. package/dist/daemon-status.d.ts.map +1 -1
  13. package/dist/daemon-status.js +31 -1
  14. package/dist/daemon-status.js.map +1 -1
  15. package/dist/host-binding.d.ts +23 -0
  16. package/dist/host-binding.d.ts.map +1 -0
  17. package/dist/host-binding.js +14 -0
  18. package/dist/host-binding.js.map +1 -0
  19. package/dist/index.d.ts +3 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +3 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/model-operation.d.ts +93 -0
  24. package/dist/model-operation.d.ts.map +1 -1
  25. package/dist/model-operation.js +4 -0
  26. package/dist/model-operation.js.map +1 -1
  27. package/dist/project.d.ts +48 -0
  28. package/dist/project.d.ts.map +1 -1
  29. package/dist/project.js +8 -0
  30. package/dist/project.js.map +1 -1
  31. package/dist/quota-read.d.ts +554 -0
  32. package/dist/quota-read.d.ts.map +1 -0
  33. package/dist/quota-read.js +18 -0
  34. package/dist/quota-read.js.map +1 -0
  35. package/dist/runtime-concurrency.d.ts +359 -23
  36. package/dist/runtime-concurrency.d.ts.map +1 -1
  37. package/dist/runtime-concurrency.js +61 -17
  38. package/dist/runtime-concurrency.js.map +1 -1
  39. package/dist/store-status.d.ts +439 -0
  40. package/dist/store-status.d.ts.map +1 -0
  41. package/dist/store-status.js +58 -0
  42. package/dist/store-status.js.map +1 -0
  43. package/generated/ControlDaemonStatus.schema.json +535 -7
  44. package/generated/ControlModelOperationDetail.schema.json +103 -0
  45. package/generated/ControlProjectRegisterResponse.schema.json +82 -0
  46. package/generated/ControlQuotaFreshnessResponse.schema.json +377 -0
  47. package/generated/ControlQuotaQueryResponse.schema.json +109 -0
  48. package/generated/ControlQuotaReadRequest.schema.json +19 -0
  49. package/generated/ControlSettingsSnapshot.schema.json +59 -6
  50. package/generated/ExternalHostBinding.schema.json +43 -0
  51. package/generated/GlobalConfig.schema.json +26 -8
  52. package/package.json +3 -3
@@ -0,0 +1,554 @@
1
+ import { z } from "zod/v3";
2
+ /** Response-only schemas: neither persisted evidence nor legacy wire shapes
3
+ * accept constraint freshness. Clients explicitly select the read projection;
4
+ * operation discovery is optional, and old engines may return strict legacy data
5
+ * (3.24) or reject the selector with HTTP 400 (3.25.0/3.25.1). */
6
+ export declare const ControlQuotaReadRequest: z.ZodObject<{
7
+ view: z.ZodOptional<z.ZodEnum<["resources", "constraint_freshness"]>>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ view?: "constraint_freshness" | "resources" | undefined;
10
+ }, {
11
+ view?: "constraint_freshness" | "resources" | undefined;
12
+ }>;
13
+ export type ControlQuotaReadRequest = z.infer<typeof ControlQuotaReadRequest>;
14
+ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
15
+ subject: z.ZodObject<{
16
+ harness: z.ZodString;
17
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
18
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
19
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
20
+ }, "strict", z.ZodTypeAny, {
21
+ harness: string;
22
+ credential_route: "local" | "managed_api_key" | "vendor_native";
23
+ plan_label: string | null;
24
+ subject_id: string | null;
25
+ }, {
26
+ harness: string;
27
+ credential_route: "local" | "managed_api_key" | "vendor_native";
28
+ plan_label?: string | null | undefined;
29
+ subject_id?: string | null | undefined;
30
+ }>;
31
+ 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"]>;
32
+ observed_at: z.ZodString;
33
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
34
+ snapshot_id: z.ZodOptional<z.ZodString>;
35
+ availability: z.ZodOptional<z.ZodObject<{
36
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
37
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
38
+ resets_at: z.ZodNullable<z.ZodString>;
39
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
40
+ constraint_id: z.ZodString;
41
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
42
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ resets_at: z.ZodNullable<z.ZodString>;
44
+ }, "strict", z.ZodTypeAny, {
45
+ constraint_id: string;
46
+ applies_to_models: string[];
47
+ applies_to_model_prefixes?: string[] | undefined;
48
+ resets_at: string | null;
49
+ }, {
50
+ constraint_id: string;
51
+ applies_to_models: string[];
52
+ applies_to_model_prefixes?: string[] | undefined;
53
+ resets_at: string | null;
54
+ }>, "many">;
55
+ }, "strict", z.ZodTypeAny, {
56
+ state: "available" | "cooldown" | "exhausted";
57
+ blocking_constraints: string[];
58
+ resets_at: string | null;
59
+ model_scoped_exhaustions: {
60
+ constraint_id: string;
61
+ applies_to_models: string[];
62
+ applies_to_model_prefixes?: string[] | undefined;
63
+ resets_at: string | null;
64
+ }[];
65
+ }, {
66
+ state: "available" | "cooldown" | "exhausted";
67
+ blocking_constraints: string[];
68
+ resets_at: string | null;
69
+ model_scoped_exhaustions: {
70
+ constraint_id: string;
71
+ applies_to_models: string[];
72
+ applies_to_model_prefixes?: string[] | undefined;
73
+ resets_at: string | null;
74
+ }[];
75
+ }>>;
76
+ } & {
77
+ constraints: z.ZodArray<z.ZodObject<{
78
+ id: z.ZodString;
79
+ label: z.ZodString;
80
+ applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
81
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
82
+ applies_to_unspecified_model: z.ZodOptional<z.ZodBoolean>;
83
+ used_ratio: z.ZodNullable<z.ZodNumber>;
84
+ window_seconds: z.ZodNullable<z.ZodNumber>;
85
+ resets_at: z.ZodNullable<z.ZodString>;
86
+ cooldown_until: z.ZodDefault<z.ZodNullable<z.ZodString>>;
87
+ } & {
88
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
89
+ }, "strict", z.ZodTypeAny, {
90
+ id: string;
91
+ label: string;
92
+ applies_to_models?: string[] | null | undefined;
93
+ applies_to_model_prefixes?: string[] | undefined;
94
+ applies_to_unspecified_model?: boolean | undefined;
95
+ used_ratio: number | null;
96
+ window_seconds: number | null;
97
+ resets_at: string | null;
98
+ cooldown_until: string | null;
99
+ freshness: "fresh" | "stale" | "unknown";
100
+ }, {
101
+ id: string;
102
+ label: string;
103
+ applies_to_models?: string[] | null | undefined;
104
+ applies_to_model_prefixes?: string[] | undefined;
105
+ applies_to_unspecified_model?: boolean | undefined;
106
+ used_ratio: number | null;
107
+ window_seconds: number | null;
108
+ resets_at: string | null;
109
+ cooldown_until?: string | null | undefined;
110
+ freshness: "fresh" | "stale" | "unknown";
111
+ }>, "many">;
112
+ }, "strict", z.ZodTypeAny, {
113
+ subject: {
114
+ harness: string;
115
+ credential_route: "local" | "managed_api_key" | "vendor_native";
116
+ plan_label: string | null;
117
+ subject_id: string | null;
118
+ };
119
+ 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";
120
+ observed_at: string;
121
+ freshness: "fresh" | "stale" | "unknown";
122
+ snapshot_id?: string | undefined;
123
+ availability?: {
124
+ state: "available" | "cooldown" | "exhausted";
125
+ blocking_constraints: string[];
126
+ resets_at: string | null;
127
+ model_scoped_exhaustions: {
128
+ constraint_id: string;
129
+ applies_to_models: string[];
130
+ applies_to_model_prefixes?: string[] | undefined;
131
+ resets_at: string | null;
132
+ }[];
133
+ } | undefined;
134
+ constraints: {
135
+ id: string;
136
+ label: string;
137
+ applies_to_models?: string[] | null | undefined;
138
+ applies_to_model_prefixes?: string[] | undefined;
139
+ applies_to_unspecified_model?: boolean | undefined;
140
+ used_ratio: number | null;
141
+ window_seconds: number | null;
142
+ resets_at: string | null;
143
+ cooldown_until: string | null;
144
+ freshness: "fresh" | "stale" | "unknown";
145
+ }[];
146
+ }, {
147
+ subject: {
148
+ harness: string;
149
+ credential_route: "local" | "managed_api_key" | "vendor_native";
150
+ plan_label?: string | null | undefined;
151
+ subject_id?: string | null | undefined;
152
+ };
153
+ 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";
154
+ observed_at: string;
155
+ freshness: "fresh" | "stale" | "unknown";
156
+ snapshot_id?: string | undefined;
157
+ availability?: {
158
+ state: "available" | "cooldown" | "exhausted";
159
+ blocking_constraints: string[];
160
+ resets_at: string | null;
161
+ model_scoped_exhaustions: {
162
+ constraint_id: string;
163
+ applies_to_models: string[];
164
+ applies_to_model_prefixes?: string[] | undefined;
165
+ resets_at: string | null;
166
+ }[];
167
+ } | undefined;
168
+ constraints: {
169
+ id: string;
170
+ label: string;
171
+ applies_to_models?: string[] | null | undefined;
172
+ applies_to_model_prefixes?: string[] | undefined;
173
+ applies_to_unspecified_model?: boolean | undefined;
174
+ used_ratio: number | null;
175
+ window_seconds: number | null;
176
+ resets_at: string | null;
177
+ cooldown_until?: string | null | undefined;
178
+ freshness: "fresh" | "stale" | "unknown";
179
+ }[];
180
+ }>;
181
+ export type ControlQuotaFreshnessSnapshot = z.infer<typeof ControlQuotaFreshnessSnapshot>;
182
+ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
183
+ absences: z.ZodDefault<z.ZodArray<z.ZodObject<{
184
+ subject: z.ZodObject<{
185
+ harness: z.ZodString;
186
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
187
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
188
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
189
+ }, "strict", z.ZodTypeAny, {
190
+ harness: string;
191
+ credential_route: "local" | "managed_api_key" | "vendor_native";
192
+ plan_label: string | null;
193
+ subject_id: string | null;
194
+ }, {
195
+ harness: string;
196
+ credential_route: "local" | "managed_api_key" | "vendor_native";
197
+ plan_label?: string | null | undefined;
198
+ subject_id?: string | null | undefined;
199
+ }>;
200
+ reason: 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"]>;
201
+ detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
202
+ observed_at: z.ZodString;
203
+ retry_after_ms: z.ZodOptional<z.ZodNumber>;
204
+ }, "strict", z.ZodTypeAny, {
205
+ subject: {
206
+ harness: string;
207
+ credential_route: "local" | "managed_api_key" | "vendor_native";
208
+ plan_label: string | null;
209
+ subject_id: string | null;
210
+ };
211
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "poll_paced" | "probe_skipped_rate_limited" | "rate_limited" | "refresh_failed" | "transport_unavailable";
212
+ detail: string | null;
213
+ observed_at: string;
214
+ retry_after_ms?: number | undefined;
215
+ }, {
216
+ subject: {
217
+ harness: string;
218
+ credential_route: "local" | "managed_api_key" | "vendor_native";
219
+ plan_label?: string | null | undefined;
220
+ subject_id?: string | null | undefined;
221
+ };
222
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "poll_paced" | "probe_skipped_rate_limited" | "rate_limited" | "refresh_failed" | "transport_unavailable";
223
+ detail?: string | null | undefined;
224
+ observed_at: string;
225
+ retry_after_ms?: number | undefined;
226
+ }>, "many">>;
227
+ refreshed_at: z.ZodNullable<z.ZodString>;
228
+ refresh_skipped: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ vendor: z.ZodString;
230
+ subject: z.ZodOptional<z.ZodObject<{
231
+ harness: z.ZodString;
232
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
233
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
234
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
235
+ }, "strict", z.ZodTypeAny, {
236
+ harness: string;
237
+ credential_route: "local" | "managed_api_key" | "vendor_native";
238
+ plan_label: string | null;
239
+ subject_id: string | null;
240
+ }, {
241
+ harness: string;
242
+ credential_route: "local" | "managed_api_key" | "vendor_native";
243
+ plan_label?: string | null | undefined;
244
+ subject_id?: string | null | undefined;
245
+ }>>;
246
+ not_before: z.ZodString;
247
+ }, "strict", z.ZodTypeAny, {
248
+ vendor: string;
249
+ subject?: {
250
+ harness: string;
251
+ credential_route: "local" | "managed_api_key" | "vendor_native";
252
+ plan_label: string | null;
253
+ subject_id: string | null;
254
+ } | undefined;
255
+ not_before: string;
256
+ }, {
257
+ vendor: string;
258
+ subject?: {
259
+ harness: string;
260
+ credential_route: "local" | "managed_api_key" | "vendor_native";
261
+ plan_label?: string | null | undefined;
262
+ subject_id?: string | null | undefined;
263
+ } | undefined;
264
+ not_before: string;
265
+ }>, "many">>;
266
+ } & {
267
+ snapshots: z.ZodArray<z.ZodObject<{
268
+ subject: z.ZodObject<{
269
+ harness: z.ZodString;
270
+ credential_route: z.ZodEnum<["vendor_native", "managed_api_key", "local"]>;
271
+ plan_label: z.ZodDefault<z.ZodNullable<z.ZodString>>;
272
+ subject_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
273
+ }, "strict", z.ZodTypeAny, {
274
+ harness: string;
275
+ credential_route: "local" | "managed_api_key" | "vendor_native";
276
+ plan_label: string | null;
277
+ subject_id: string | null;
278
+ }, {
279
+ harness: string;
280
+ credential_route: "local" | "managed_api_key" | "vendor_native";
281
+ plan_label?: string | null | undefined;
282
+ subject_id?: string | null | undefined;
283
+ }>;
284
+ 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"]>;
285
+ observed_at: z.ZodString;
286
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
287
+ snapshot_id: z.ZodOptional<z.ZodString>;
288
+ availability: z.ZodOptional<z.ZodObject<{
289
+ state: z.ZodEnum<["available", "exhausted", "cooldown"]>;
290
+ blocking_constraints: z.ZodArray<z.ZodString, "many">;
291
+ resets_at: z.ZodNullable<z.ZodString>;
292
+ model_scoped_exhaustions: z.ZodArray<z.ZodObject<{
293
+ constraint_id: z.ZodString;
294
+ applies_to_models: z.ZodArray<z.ZodString, "many">;
295
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
296
+ resets_at: z.ZodNullable<z.ZodString>;
297
+ }, "strict", z.ZodTypeAny, {
298
+ constraint_id: string;
299
+ applies_to_models: string[];
300
+ applies_to_model_prefixes?: string[] | undefined;
301
+ resets_at: string | null;
302
+ }, {
303
+ constraint_id: string;
304
+ applies_to_models: string[];
305
+ applies_to_model_prefixes?: string[] | undefined;
306
+ resets_at: string | null;
307
+ }>, "many">;
308
+ }, "strict", z.ZodTypeAny, {
309
+ state: "available" | "cooldown" | "exhausted";
310
+ blocking_constraints: string[];
311
+ resets_at: string | null;
312
+ model_scoped_exhaustions: {
313
+ constraint_id: string;
314
+ applies_to_models: string[];
315
+ applies_to_model_prefixes?: string[] | undefined;
316
+ resets_at: string | null;
317
+ }[];
318
+ }, {
319
+ state: "available" | "cooldown" | "exhausted";
320
+ blocking_constraints: string[];
321
+ resets_at: string | null;
322
+ model_scoped_exhaustions: {
323
+ constraint_id: string;
324
+ applies_to_models: string[];
325
+ applies_to_model_prefixes?: string[] | undefined;
326
+ resets_at: string | null;
327
+ }[];
328
+ }>>;
329
+ } & {
330
+ constraints: z.ZodArray<z.ZodObject<{
331
+ id: z.ZodString;
332
+ label: z.ZodString;
333
+ applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
334
+ applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
335
+ applies_to_unspecified_model: z.ZodOptional<z.ZodBoolean>;
336
+ used_ratio: z.ZodNullable<z.ZodNumber>;
337
+ window_seconds: z.ZodNullable<z.ZodNumber>;
338
+ resets_at: z.ZodNullable<z.ZodString>;
339
+ cooldown_until: z.ZodDefault<z.ZodNullable<z.ZodString>>;
340
+ } & {
341
+ freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
342
+ }, "strict", z.ZodTypeAny, {
343
+ id: string;
344
+ label: string;
345
+ applies_to_models?: string[] | null | undefined;
346
+ applies_to_model_prefixes?: string[] | undefined;
347
+ applies_to_unspecified_model?: boolean | undefined;
348
+ used_ratio: number | null;
349
+ window_seconds: number | null;
350
+ resets_at: string | null;
351
+ cooldown_until: string | null;
352
+ freshness: "fresh" | "stale" | "unknown";
353
+ }, {
354
+ id: string;
355
+ label: string;
356
+ applies_to_models?: string[] | null | undefined;
357
+ applies_to_model_prefixes?: string[] | undefined;
358
+ applies_to_unspecified_model?: boolean | undefined;
359
+ used_ratio: number | null;
360
+ window_seconds: number | null;
361
+ resets_at: string | null;
362
+ cooldown_until?: string | null | undefined;
363
+ freshness: "fresh" | "stale" | "unknown";
364
+ }>, "many">;
365
+ }, "strict", z.ZodTypeAny, {
366
+ subject: {
367
+ harness: string;
368
+ credential_route: "local" | "managed_api_key" | "vendor_native";
369
+ plan_label: string | null;
370
+ subject_id: string | null;
371
+ };
372
+ 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";
373
+ observed_at: string;
374
+ freshness: "fresh" | "stale" | "unknown";
375
+ snapshot_id?: string | undefined;
376
+ availability?: {
377
+ state: "available" | "cooldown" | "exhausted";
378
+ blocking_constraints: string[];
379
+ resets_at: string | null;
380
+ model_scoped_exhaustions: {
381
+ constraint_id: string;
382
+ applies_to_models: string[];
383
+ applies_to_model_prefixes?: string[] | undefined;
384
+ resets_at: string | null;
385
+ }[];
386
+ } | undefined;
387
+ constraints: {
388
+ id: string;
389
+ label: string;
390
+ applies_to_models?: string[] | null | undefined;
391
+ applies_to_model_prefixes?: string[] | undefined;
392
+ applies_to_unspecified_model?: boolean | undefined;
393
+ used_ratio: number | null;
394
+ window_seconds: number | null;
395
+ resets_at: string | null;
396
+ cooldown_until: string | null;
397
+ freshness: "fresh" | "stale" | "unknown";
398
+ }[];
399
+ }, {
400
+ subject: {
401
+ harness: string;
402
+ credential_route: "local" | "managed_api_key" | "vendor_native";
403
+ plan_label?: string | null | undefined;
404
+ subject_id?: string | null | undefined;
405
+ };
406
+ 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";
407
+ observed_at: string;
408
+ freshness: "fresh" | "stale" | "unknown";
409
+ snapshot_id?: string | undefined;
410
+ availability?: {
411
+ state: "available" | "cooldown" | "exhausted";
412
+ blocking_constraints: string[];
413
+ resets_at: string | null;
414
+ model_scoped_exhaustions: {
415
+ constraint_id: string;
416
+ applies_to_models: string[];
417
+ applies_to_model_prefixes?: string[] | undefined;
418
+ resets_at: string | null;
419
+ }[];
420
+ } | undefined;
421
+ constraints: {
422
+ id: string;
423
+ label: string;
424
+ applies_to_models?: string[] | null | undefined;
425
+ applies_to_model_prefixes?: string[] | undefined;
426
+ applies_to_unspecified_model?: boolean | undefined;
427
+ used_ratio: number | null;
428
+ window_seconds: number | null;
429
+ resets_at: string | null;
430
+ cooldown_until?: string | null | undefined;
431
+ freshness: "fresh" | "stale" | "unknown";
432
+ }[];
433
+ }>, "many">;
434
+ }, "strict", z.ZodTypeAny, {
435
+ absences: {
436
+ subject: {
437
+ harness: string;
438
+ credential_route: "local" | "managed_api_key" | "vendor_native";
439
+ plan_label: string | null;
440
+ subject_id: string | null;
441
+ };
442
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "poll_paced" | "probe_skipped_rate_limited" | "rate_limited" | "refresh_failed" | "transport_unavailable";
443
+ detail: string | null;
444
+ observed_at: string;
445
+ retry_after_ms?: number | undefined;
446
+ }[];
447
+ refreshed_at: string | null;
448
+ refresh_skipped?: {
449
+ vendor: string;
450
+ subject?: {
451
+ harness: string;
452
+ credential_route: "local" | "managed_api_key" | "vendor_native";
453
+ plan_label: string | null;
454
+ subject_id: string | null;
455
+ } | undefined;
456
+ not_before: string;
457
+ }[] | undefined;
458
+ snapshots: {
459
+ subject: {
460
+ harness: string;
461
+ credential_route: "local" | "managed_api_key" | "vendor_native";
462
+ plan_label: string | null;
463
+ subject_id: string | null;
464
+ };
465
+ 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";
466
+ observed_at: string;
467
+ freshness: "fresh" | "stale" | "unknown";
468
+ snapshot_id?: string | undefined;
469
+ availability?: {
470
+ state: "available" | "cooldown" | "exhausted";
471
+ blocking_constraints: string[];
472
+ resets_at: string | null;
473
+ model_scoped_exhaustions: {
474
+ constraint_id: string;
475
+ applies_to_models: string[];
476
+ applies_to_model_prefixes?: string[] | undefined;
477
+ resets_at: string | null;
478
+ }[];
479
+ } | undefined;
480
+ constraints: {
481
+ id: string;
482
+ label: string;
483
+ applies_to_models?: string[] | null | undefined;
484
+ applies_to_model_prefixes?: string[] | undefined;
485
+ applies_to_unspecified_model?: boolean | undefined;
486
+ used_ratio: number | null;
487
+ window_seconds: number | null;
488
+ resets_at: string | null;
489
+ cooldown_until: string | null;
490
+ freshness: "fresh" | "stale" | "unknown";
491
+ }[];
492
+ }[];
493
+ }, {
494
+ absences?: {
495
+ subject: {
496
+ harness: string;
497
+ credential_route: "local" | "managed_api_key" | "vendor_native";
498
+ plan_label?: string | null | undefined;
499
+ subject_id?: string | null | undefined;
500
+ };
501
+ reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "poll_paced" | "probe_skipped_rate_limited" | "rate_limited" | "refresh_failed" | "transport_unavailable";
502
+ detail?: string | null | undefined;
503
+ observed_at: string;
504
+ retry_after_ms?: number | undefined;
505
+ }[] | undefined;
506
+ refreshed_at: string | null;
507
+ refresh_skipped?: {
508
+ vendor: string;
509
+ subject?: {
510
+ harness: string;
511
+ credential_route: "local" | "managed_api_key" | "vendor_native";
512
+ plan_label?: string | null | undefined;
513
+ subject_id?: string | null | undefined;
514
+ } | undefined;
515
+ not_before: string;
516
+ }[] | undefined;
517
+ snapshots: {
518
+ subject: {
519
+ harness: string;
520
+ credential_route: "local" | "managed_api_key" | "vendor_native";
521
+ plan_label?: string | null | undefined;
522
+ subject_id?: string | null | undefined;
523
+ };
524
+ 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";
525
+ observed_at: string;
526
+ freshness: "fresh" | "stale" | "unknown";
527
+ snapshot_id?: string | undefined;
528
+ availability?: {
529
+ state: "available" | "cooldown" | "exhausted";
530
+ blocking_constraints: string[];
531
+ resets_at: string | null;
532
+ model_scoped_exhaustions: {
533
+ constraint_id: string;
534
+ applies_to_models: string[];
535
+ applies_to_model_prefixes?: string[] | undefined;
536
+ resets_at: string | null;
537
+ }[];
538
+ } | undefined;
539
+ constraints: {
540
+ id: string;
541
+ label: string;
542
+ applies_to_models?: string[] | null | undefined;
543
+ applies_to_model_prefixes?: string[] | undefined;
544
+ applies_to_unspecified_model?: boolean | undefined;
545
+ used_ratio: number | null;
546
+ window_seconds: number | null;
547
+ resets_at: string | null;
548
+ cooldown_until?: string | null | undefined;
549
+ freshness: "fresh" | "stale" | "unknown";
550
+ }[];
551
+ }[];
552
+ }>;
553
+ export type ControlQuotaFreshnessResponse = z.infer<typeof ControlQuotaFreshnessResponse>;
554
+ //# sourceMappingURL=quota-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-read.d.ts","sourceRoot":"","sources":["../src/quota-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAQ3B;;;kEAGkE;AAClE,eAAO,MAAM,uBAAuB;;;;;;EAEzB,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQxC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE1F,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzC,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from "zod/v3";
2
+ import { ControlQuotaResponse, ControlQuotaSnapshot, QuotaConstraint, QuotaFreshness, } from "./quota.js";
3
+ /** Response-only schemas: neither persisted evidence nor legacy wire shapes
4
+ * accept constraint freshness. Clients explicitly select the read projection;
5
+ * operation discovery is optional, and old engines may return strict legacy data
6
+ * (3.24) or reject the selector with HTTP 400 (3.25.0/3.25.1). */
7
+ export const ControlQuotaReadRequest = z
8
+ .object({ view: z.enum(["resources", "constraint_freshness"]).optional() })
9
+ .strict();
10
+ export const ControlQuotaFreshnessSnapshot = ControlQuotaSnapshot.extend({
11
+ constraints: z.array(QuotaConstraint.extend({
12
+ freshness: QuotaFreshness.describe("Read-time freshness from raw snapshot freshness, observation age (stale after 300000ms), and this constraint's own reset (stale at equality); a reset cutoff stales earlier evidence. Never inferred from aggregate freshness or a sibling reset; no refill is inferred. The compatibility reset_credits row reports its resets facet's freshness instead."),
13
+ })),
14
+ });
15
+ export const ControlQuotaFreshnessResponse = ControlQuotaResponse.extend({
16
+ snapshots: z.array(ControlQuotaFreshnessSnapshot),
17
+ }).describe("Opt-in GET /v2/quota?view=constraint_freshness response. Adds constraint freshness while preserving aggregate snapshot freshness and all observed values. No refresh or durable write.");
18
+ //# sourceMappingURL=quota-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-read.js","sourceRoot":"","sources":["../src/quota-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB;;;kEAGkE;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;KAC1E,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC,MAAM,CAAC;IACvE,WAAW,EAAE,CAAC,CAAC,KAAK,CAClB,eAAe,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE,cAAc,CAAC,QAAQ,CAChC,4VAA4V,CAC7V;KACF,CAAC,CACH;CACF,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC,MAAM,CAAC;IACvE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;CAClD,CAAC,CAAC,QAAQ,CACT,wLAAwL,CACzL,CAAC"}