@claudexor/schema 4.0.1 → 4.1.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 (98) hide show
  1. package/dist/account-resources.d.ts +64 -27
  2. package/dist/account-resources.d.ts.map +1 -1
  3. package/dist/account-target.d.ts +3 -0
  4. package/dist/account-target.d.ts.map +1 -1
  5. package/dist/account-target.js +2 -0
  6. package/dist/account-target.js.map +1 -1
  7. package/dist/attachment.js +1 -1
  8. package/dist/attachment.js.map +1 -1
  9. package/dist/budget.d.ts +3 -0
  10. package/dist/budget.d.ts.map +1 -1
  11. package/dist/budget.js +2 -0
  12. package/dist/budget.js.map +1 -1
  13. package/dist/control-operation-responses.d.ts +54 -0
  14. package/dist/control-operation-responses.d.ts.map +1 -1
  15. package/dist/control-process-scope.d.ts +58 -0
  16. package/dist/control-process-scope.d.ts.map +1 -0
  17. package/dist/control-process-scope.js +39 -0
  18. package/dist/control-process-scope.js.map +1 -0
  19. package/dist/control-run-detail.d.ts +108 -0
  20. package/dist/control-run-detail.d.ts.map +1 -1
  21. package/dist/control.d.ts +39 -0
  22. package/dist/control.d.ts.map +1 -1
  23. package/dist/control.js +3 -0
  24. package/dist/control.js.map +1 -1
  25. package/dist/credential-profile-snapshot.d.ts +64 -28
  26. package/dist/credential-profile-snapshot.d.ts.map +1 -1
  27. package/dist/daemon-status.d.ts +40 -0
  28. package/dist/daemon-status.d.ts.map +1 -1
  29. package/dist/gate.d.ts.map +1 -1
  30. package/dist/gate.js +1 -1
  31. package/dist/gate.js.map +1 -1
  32. package/dist/harness-quota.d.ts +8 -3
  33. package/dist/harness-quota.d.ts.map +1 -1
  34. package/dist/harness.d.ts +17 -5
  35. package/dist/harness.d.ts.map +1 -1
  36. package/dist/index.d.ts +3 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +3 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/model-image.d.ts +416 -0
  41. package/dist/model-image.d.ts.map +1 -0
  42. package/dist/model-image.js +77 -0
  43. package/dist/model-image.js.map +1 -0
  44. package/dist/model-operation.d.ts +143 -0
  45. package/dist/model-operation.d.ts.map +1 -1
  46. package/dist/model-operation.js +22 -0
  47. package/dist/model-operation.js.map +1 -1
  48. package/dist/process-scope.d.ts +125 -0
  49. package/dist/process-scope.d.ts.map +1 -0
  50. package/dist/process-scope.js +81 -0
  51. package/dist/process-scope.js.map +1 -0
  52. package/dist/quota-availability.d.ts +33 -0
  53. package/dist/quota-availability.d.ts.map +1 -0
  54. package/dist/quota-availability.js +130 -0
  55. package/dist/quota-availability.js.map +1 -0
  56. package/dist/quota-read.d.ts +38 -9
  57. package/dist/quota-read.d.ts.map +1 -1
  58. package/dist/quota-read.js +5 -3
  59. package/dist/quota-read.js.map +1 -1
  60. package/dist/quota-request-kind.d.ts +9 -0
  61. package/dist/quota-request-kind.d.ts.map +1 -0
  62. package/dist/quota-request-kind.js +8 -0
  63. package/dist/quota-request-kind.js.map +1 -0
  64. package/dist/quota.d.ts +60 -49
  65. package/dist/quota.d.ts.map +1 -1
  66. package/dist/quota.js +17 -126
  67. package/dist/quota.js.map +1 -1
  68. package/dist/rate-limit.d.ts +3 -0
  69. package/dist/rate-limit.d.ts.map +1 -1
  70. package/dist/rate-limit.js +2 -0
  71. package/dist/rate-limit.js.map +1 -1
  72. package/dist/store-status.d.ts +28 -0
  73. package/dist/store-status.d.ts.map +1 -1
  74. package/dist/store-status.js +10 -0
  75. package/dist/store-status.js.map +1 -1
  76. package/generated/BudgetObservation.schema.json +11 -0
  77. package/generated/ControlAccountResetResponse.schema.json +14 -1
  78. package/generated/ControlAccountResourcesResponse.schema.json +14 -1
  79. package/generated/ControlCredentialProfilesQueryResponse.schema.json +14 -1
  80. package/generated/ControlCredentialProfilesResourcesResponse.schema.json +14 -1
  81. package/generated/ControlCredentialProfilesSnapshotResponse.schema.json +14 -1
  82. package/generated/ControlDaemonStatus.schema.json +52 -0
  83. package/generated/ControlModelSourcesAccountsResponse.schema.json +62 -0
  84. package/generated/ControlModelSourcesQueryResponse.schema.json +62 -0
  85. package/generated/ControlQuotaFreshnessResponse.schema.json +14 -1
  86. package/generated/ControlQuotaQueryResponse.schema.json +17 -1
  87. package/generated/ControlQuotaReadRequest.schema.json +15 -1
  88. package/generated/ControlQuotaRefreshRequest.schema.json +8 -0
  89. package/generated/ControlQuotaResponse.schema.json +14 -1
  90. package/generated/ControlRunDetail.schema.json +62 -0
  91. package/generated/ControlRunListResponse.schema.json +62 -0
  92. package/generated/ControlRunSummary.schema.json +62 -0
  93. package/generated/ControlUploadCreateRequest.schema.json +1 -1
  94. package/generated/GateResult.schema.json +1 -1
  95. package/generated/HarnessEvent.schema.json +21 -1
  96. package/generated/ImageCallRequest.schema.json +145 -0
  97. package/generated/ImageCallResult.schema.json +415 -0
  98. package/package.json +2 -2
@@ -0,0 +1,130 @@
1
+ import { QuotaAvailability, quotaSnapshotIdentity, quotaConstraintAppliesToRequestKind, } from "./quota.js";
2
+ /** Millisecond instant of a still-future ISO timestamp, else null. */
3
+ function futureMs(iso, now) {
4
+ if (!iso)
5
+ return null;
6
+ const at = Date.parse(iso);
7
+ return Number.isFinite(at) && at > now ? at : null;
8
+ }
9
+ /** Literal family matching belongs to the quota contract, shared by display
10
+ * and admission. Prefixes must be declared by the vendor-specific producer;
11
+ * neither a missing model nor an unknown family proves a match. */
12
+ export function quotaModelPrefixMatches(prefixes, model) {
13
+ return prefixes?.some((prefix) => prefix.length > 0 && model.startsWith(prefix)) === true;
14
+ }
15
+ /** API-parameter model matching, deliberately looser than the router's exact
16
+ * `quotaConstraintAppliesToModel` (@claudexor/budget): consumers pass whatever
17
+ * model string they route with ("claude-fable-5", "fable", a bracketed
18
+ * variant), while producers publish vendor alias lists — so match by
19
+ * case-insensitive alias containment in either direction. A null/empty scope
20
+ * list is a vendor-wide window and matches every model. */
21
+ function modelScopeMatches(scope, model) {
22
+ if (scope == null || scope.length === 0)
23
+ return true;
24
+ const target = model.trim().toLowerCase();
25
+ return scope.some((alias) => {
26
+ const candidate = alias.trim().toLowerCase();
27
+ return (candidate !== "" &&
28
+ target !== "" &&
29
+ (candidate.includes(target) || target.includes(candidate)));
30
+ });
31
+ }
32
+ /** Derive one snapshot's typed model-aware availability — a pure projection
33
+ * over the snapshot's own constraints, never an aggregate across subjects.
34
+ * Blocking semantics mirror the router's `BudgetLedger`: a window
35
+ * blocks while its cooldown_until is in the future, or while used_ratio >= 1
36
+ * with a still-future resets_at (a spent ratio whose reset elapsed or is
37
+ * unknown is stale data, not a live block). Without `model`, only windows that
38
+ * apply to EVERY model can block; model-scoped spent windows are disclosed in
39
+ * model_scoped_exhaustions and leave state available — including a spent
40
+ * scoped window whose reset is UNKNOWN (disclosed with resets_at null, never
41
+ * blocking); one whose reset ELAPSED is provably released and not disclosed.
42
+ * With `model`, scoped windows matching it block too.
43
+ * Full-coverage inference ("every model is
44
+ * covered by some spent scoped window") is deliberately not attempted: the
45
+ * model universe is unknowable here, so that case stays available + disclosed. */
46
+ export function quotaSnapshotAvailability(snapshot, opts = {}) {
47
+ const now = (opts.now ?? new Date()).getTime();
48
+ const model = opts.model ?? null;
49
+ const blocking = [];
50
+ const scopedExhaustions = [];
51
+ let sawExhausted = false;
52
+ let earliestRelease = null;
53
+ for (const constraint of snapshot.constraints) {
54
+ if (!quotaConstraintAppliesToRequestKind(constraint, opts.requestKind))
55
+ continue;
56
+ const resetAt = futureMs(constraint.resets_at, now);
57
+ const cooldownAt = futureMs(constraint.cooldown_until, now);
58
+ const exhausted = constraint.used_ratio !== null && constraint.used_ratio >= 1 && resetAt !== null;
59
+ const cooling = cooldownAt !== null;
60
+ // A spent ratio with an UNKNOWN reset never blocks (BudgetLedger mirror:
61
+ // stale data, not a live block), but a scoped one is still DISCLOSED below
62
+ // with resets_at null; an elapsed reset is provably released and stays
63
+ // undisclosed.
64
+ const spentUnknownReset = constraint.used_ratio !== null && constraint.used_ratio >= 1 && constraint.resets_at === null;
65
+ if (!exhausted && !cooling && !spentUnknownReset)
66
+ continue;
67
+ // A constraint stays blocked until EVERY active condition lifts, so its
68
+ // own release is the LATER of the two; the snapshot-level resets_at below
69
+ // is the EARLIEST such release across blocking constraints. A
70
+ // disclosure-only window (spent, unknown reset) has no release instant.
71
+ const release = !exhausted && !cooling
72
+ ? null
73
+ : exhausted && cooling
74
+ ? resetAt >= cooldownAt
75
+ ? { iso: constraint.resets_at, at: resetAt }
76
+ : { iso: constraint.cooldown_until, at: cooldownAt }
77
+ : exhausted
78
+ ? { iso: constraint.resets_at, at: resetAt }
79
+ : { iso: constraint.cooldown_until, at: cooldownAt };
80
+ const scope = constraint.applies_to_models ?? null;
81
+ const prefixes = constraint.applies_to_model_prefixes;
82
+ const scoped = (scope !== null && scope.length > 0) || (prefixes?.length ?? 0) > 0;
83
+ if (scoped) {
84
+ scopedExhaustions.push({
85
+ constraint_id: constraint.id,
86
+ applies_to_models: [...(scope ?? [])],
87
+ ...(prefixes?.length ? { applies_to_model_prefixes: [...prefixes] } : {}),
88
+ resets_at: release?.iso ?? null,
89
+ });
90
+ }
91
+ if (release === null)
92
+ continue;
93
+ // The projection and the router must answer the SAME question: a scoped
94
+ // window that declares it governs the unspecified-model route blocks a
95
+ // bare run, or the Accounts card would read "available" for an account the
96
+ // router is already refusing.
97
+ if (scoped &&
98
+ (model === null
99
+ ? constraint.applies_to_unspecified_model !== true
100
+ : !(quotaModelPrefixMatches(prefixes, model) ||
101
+ (scope !== null && scope.length > 0 && modelScopeMatches(scope, model)))))
102
+ continue;
103
+ blocking.push(constraint.id);
104
+ if (exhausted)
105
+ sawExhausted = true;
106
+ if (earliestRelease === null || release.at < earliestRelease.at) {
107
+ earliestRelease = release;
108
+ }
109
+ }
110
+ return QuotaAvailability.parse({
111
+ state: blocking.length === 0 ? "available" : sawExhausted ? "exhausted" : "cooldown",
112
+ blocking_constraints: blocking,
113
+ resets_at: earliestRelease?.iso ?? null,
114
+ model_scoped_exhaustions: scopedExhaustions,
115
+ });
116
+ }
117
+ /** Decorate a quota response with per-snapshot availability projections —
118
+ * applied at the /v2/quota and atomic Accounts response boundaries so
119
+ * journals and raw projection signatures stay byte-identical. */
120
+ export function withQuotaAvailability(response, opts = {}) {
121
+ return {
122
+ ...response,
123
+ snapshots: response.snapshots.map((snapshot) => ({
124
+ ...snapshot,
125
+ snapshot_id: quotaSnapshotIdentity(snapshot),
126
+ availability: quotaSnapshotAvailability(snapshot, opts),
127
+ })),
128
+ };
129
+ }
130
+ //# sourceMappingURL=quota-availability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-availability.js","sourceRoot":"","sources":["../src/quota-availability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mCAAmC,GAKpC,MAAM,YAAY,CAAC;AAEpB,sEAAsE;AACtE,SAAS,QAAQ,CAAC,GAAkB,EAAE,GAAW;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC;AAED;;mEAEmE;AACnE,MAAM,UAAU,uBAAuB,CACrC,QAAuC,EACvC,KAAa;IAEb,OAAO,QAAQ,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC;AAC5F,CAAC;AAED;;;;;2DAK2D;AAC3D,SAAS,iBAAiB,CAAC,KAA2C,EAAE,KAAa;IACnF,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,MAAM,MAAM,GAAG,KAAK,CAAC,IA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AAI;QACvC,wBAAwB,EAAE,iBAAiB;KAC5C,CAAC,CAAC;AACL,CAAC;AAED;;iEAEiE;AACjE,MAAM,UAAU,qBAAqB,CACnC,QAA8B,EAC9B,IAAI,GAA0E,EAAE;IAEhF,OAAO;QACL,GAAG,QAAQ;QACX,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC/C,GAAG,QAAQ;YACX,WAAW,EAAE,qBAAqB,CAAC,QAAQ,CAAC;YAC5C,YAAY,EAAE,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC;SACxD,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
@@ -3,11 +3,28 @@ import { z } from "zod/v3";
3
3
  * accept constraint freshness. Clients explicitly select the read projection;
4
4
  * operation discovery is optional, and old engines may return strict legacy data
5
5
  * (3.24) or reject the selector with HTTP 400 (3.25.0/3.25.1). */
6
- export declare const ControlQuotaReadRequest: z.ZodObject<{
6
+ export declare const ControlQuotaReadRequest: z.ZodObject<Omit<{
7
+ target: z.ZodOptional<z.ZodObject<{
8
+ harness: z.ZodString;
9
+ profile_id: z.ZodString;
10
+ }, "strict", z.ZodTypeAny, {
11
+ harness: string;
12
+ profile_id: string;
13
+ }, {
14
+ harness: string;
15
+ profile_id: string;
16
+ }>>;
17
+ requestKind: z.ZodOptional<z.ZodEnum<["text", "image"]>>;
18
+ model: z.ZodOptional<z.ZodString>;
19
+ }, "target"> & {
7
20
  view: z.ZodOptional<z.ZodEnum<["resources", "constraint_freshness"]>>;
8
21
  }, "strict", z.ZodTypeAny, {
22
+ requestKind?: "image" | "text" | undefined;
23
+ model?: string | undefined;
9
24
  view?: "constraint_freshness" | "resources" | undefined;
10
25
  }, {
26
+ requestKind?: "image" | "text" | undefined;
27
+ model?: string | undefined;
11
28
  view?: "constraint_freshness" | "resources" | undefined;
12
29
  }>;
13
30
  export type ControlQuotaReadRequest = z.infer<typeof ControlQuotaReadRequest>;
@@ -28,7 +45,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
28
45
  plan_label?: string | null | undefined;
29
46
  subject_id?: string | null | undefined;
30
47
  }>;
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"]>;
48
+ 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", "codex_image_response"]>;
32
49
  observed_at: z.ZodString;
33
50
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
34
51
  snapshot_id: z.ZodOptional<z.ZodString>;
@@ -80,6 +97,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
80
97
  applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
81
98
  applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
82
99
  applies_to_unspecified_model: z.ZodOptional<z.ZodBoolean>;
100
+ applies_to_request_kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["text", "image"]>, "many">>;
83
101
  used_ratio: z.ZodNullable<z.ZodNumber>;
84
102
  window_seconds: z.ZodNullable<z.ZodNumber>;
85
103
  resets_at: z.ZodNullable<z.ZodString>;
@@ -92,6 +110,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
92
110
  applies_to_models?: string[] | null | undefined;
93
111
  applies_to_model_prefixes?: string[] | undefined;
94
112
  applies_to_unspecified_model?: boolean | undefined;
113
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
95
114
  used_ratio: number | null;
96
115
  window_seconds: number | null;
97
116
  resets_at: string | null;
@@ -103,6 +122,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
103
122
  applies_to_models?: string[] | null | undefined;
104
123
  applies_to_model_prefixes?: string[] | undefined;
105
124
  applies_to_unspecified_model?: boolean | undefined;
125
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
106
126
  used_ratio: number | null;
107
127
  window_seconds: number | null;
108
128
  resets_at: string | null;
@@ -116,7 +136,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
116
136
  plan_label: string | null;
117
137
  subject_id: string | null;
118
138
  };
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";
139
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit";
120
140
  observed_at: string;
121
141
  freshness: "fresh" | "stale" | "unknown";
122
142
  snapshot_id?: string | undefined;
@@ -137,6 +157,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
137
157
  applies_to_models?: string[] | null | undefined;
138
158
  applies_to_model_prefixes?: string[] | undefined;
139
159
  applies_to_unspecified_model?: boolean | undefined;
160
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
140
161
  used_ratio: number | null;
141
162
  window_seconds: number | null;
142
163
  resets_at: string | null;
@@ -150,7 +171,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
150
171
  plan_label?: string | null | undefined;
151
172
  subject_id?: string | null | undefined;
152
173
  };
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";
174
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit";
154
175
  observed_at: string;
155
176
  freshness: "fresh" | "stale" | "unknown";
156
177
  snapshot_id?: string | undefined;
@@ -171,6 +192,7 @@ export declare const ControlQuotaFreshnessSnapshot: z.ZodObject<{
171
192
  applies_to_models?: string[] | null | undefined;
172
193
  applies_to_model_prefixes?: string[] | undefined;
173
194
  applies_to_unspecified_model?: boolean | undefined;
195
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
174
196
  used_ratio: number | null;
175
197
  window_seconds: number | null;
176
198
  resets_at: string | null;
@@ -281,7 +303,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
281
303
  plan_label?: string | null | undefined;
282
304
  subject_id?: string | null | undefined;
283
305
  }>;
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"]>;
306
+ 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", "codex_image_response"]>;
285
307
  observed_at: z.ZodString;
286
308
  freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
287
309
  snapshot_id: z.ZodOptional<z.ZodString>;
@@ -333,6 +355,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
333
355
  applies_to_models: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
334
356
  applies_to_model_prefixes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
335
357
  applies_to_unspecified_model: z.ZodOptional<z.ZodBoolean>;
358
+ applies_to_request_kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["text", "image"]>, "many">>;
336
359
  used_ratio: z.ZodNullable<z.ZodNumber>;
337
360
  window_seconds: z.ZodNullable<z.ZodNumber>;
338
361
  resets_at: z.ZodNullable<z.ZodString>;
@@ -345,6 +368,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
345
368
  applies_to_models?: string[] | null | undefined;
346
369
  applies_to_model_prefixes?: string[] | undefined;
347
370
  applies_to_unspecified_model?: boolean | undefined;
371
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
348
372
  used_ratio: number | null;
349
373
  window_seconds: number | null;
350
374
  resets_at: string | null;
@@ -356,6 +380,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
356
380
  applies_to_models?: string[] | null | undefined;
357
381
  applies_to_model_prefixes?: string[] | undefined;
358
382
  applies_to_unspecified_model?: boolean | undefined;
383
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
359
384
  used_ratio: number | null;
360
385
  window_seconds: number | null;
361
386
  resets_at: string | null;
@@ -369,7 +394,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
369
394
  plan_label: string | null;
370
395
  subject_id: string | null;
371
396
  };
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";
397
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit";
373
398
  observed_at: string;
374
399
  freshness: "fresh" | "stale" | "unknown";
375
400
  snapshot_id?: string | undefined;
@@ -390,6 +415,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
390
415
  applies_to_models?: string[] | null | undefined;
391
416
  applies_to_model_prefixes?: string[] | undefined;
392
417
  applies_to_unspecified_model?: boolean | undefined;
418
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
393
419
  used_ratio: number | null;
394
420
  window_seconds: number | null;
395
421
  resets_at: string | null;
@@ -403,7 +429,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
403
429
  plan_label?: string | null | undefined;
404
430
  subject_id?: string | null | undefined;
405
431
  };
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";
432
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit";
407
433
  observed_at: string;
408
434
  freshness: "fresh" | "stale" | "unknown";
409
435
  snapshot_id?: string | undefined;
@@ -424,6 +450,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
424
450
  applies_to_models?: string[] | null | undefined;
425
451
  applies_to_model_prefixes?: string[] | undefined;
426
452
  applies_to_unspecified_model?: boolean | undefined;
453
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
427
454
  used_ratio: number | null;
428
455
  window_seconds: number | null;
429
456
  resets_at: string | null;
@@ -462,7 +489,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
462
489
  plan_label: string | null;
463
490
  subject_id: string | null;
464
491
  };
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";
492
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit";
466
493
  observed_at: string;
467
494
  freshness: "fresh" | "stale" | "unknown";
468
495
  snapshot_id?: string | undefined;
@@ -483,6 +510,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
483
510
  applies_to_models?: string[] | null | undefined;
484
511
  applies_to_model_prefixes?: string[] | undefined;
485
512
  applies_to_unspecified_model?: boolean | undefined;
513
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
486
514
  used_ratio: number | null;
487
515
  window_seconds: number | null;
488
516
  resets_at: string | null;
@@ -521,7 +549,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
521
549
  plan_label?: string | null | undefined;
522
550
  subject_id?: string | null | undefined;
523
551
  };
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";
552
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_image_response" | "codex_rollout" | "cursor_rate_limit";
525
553
  observed_at: string;
526
554
  freshness: "fresh" | "stale" | "unknown";
527
555
  snapshot_id?: string | undefined;
@@ -542,6 +570,7 @@ export declare const ControlQuotaFreshnessResponse: z.ZodObject<{
542
570
  applies_to_models?: string[] | null | undefined;
543
571
  applies_to_model_prefixes?: string[] | undefined;
544
572
  applies_to_unspecified_model?: boolean | undefined;
573
+ applies_to_request_kinds?: ("image" | "text")[] | undefined;
545
574
  used_ratio: number | null;
546
575
  window_seconds: number | null;
547
576
  resets_at: string | null;
@@ -1 +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;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzC,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { z } from "zod/v3";
2
+ import { ControlQuotaRefreshRequest } from "./account-target.js";
2
3
  import { ControlQuotaResponse, ControlQuotaSnapshot, QuotaConstraint, QuotaFreshness, } from "./quota.js";
3
4
  /** Response-only schemas: neither persisted evidence nor legacy wire shapes
4
5
  * accept constraint freshness. Clients explicitly select the read projection;
5
6
  * operation discovery is optional, and old engines may return strict legacy data
6
7
  * (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();
8
+ export const ControlQuotaReadRequest = ControlQuotaRefreshRequest.omit({ target: true })
9
+ .extend({ view: z.enum(["resources", "constraint_freshness"]).optional() })
10
+ .strict()
11
+ .describe("GET /v2/quota query selectors, each at most once; there is no body. Omitted requestKind means text availability, omitted model keeps the model-agnostic projection, and omitted view keeps the legacy shape. Reads cached snapshots without refreshing quota.");
10
12
  export const ControlQuotaFreshnessSnapshot = ControlQuotaSnapshot.extend({
11
13
  constraints: z.array(QuotaConstraint.extend({
12
14
  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."),
@@ -1 +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"}
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,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB;;;kEAGkE;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KACrF,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;KAC1E,MAAM,EAAE;KACR,QAAQ,CACP,+PAA+P,CAChQ,CAAC;AAGJ,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"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod/v3";
2
+ /** Shared by quota evidence and account read/refresh requests without a schema cycle. */
3
+ export declare const QuotaRequestKind: z.ZodEnum<["text", "image"]>;
4
+ export type QuotaRequestKind = z.infer<typeof QuotaRequestKind>;
5
+ /** Operation applicability is independent of any vendor model-id spelling. */
6
+ export declare function quotaConstraintAppliesToRequestKind(constraint: {
7
+ applies_to_request_kinds?: QuotaRequestKind[];
8
+ }, requestKind?: QuotaRequestKind): boolean;
9
+ //# sourceMappingURL=quota-request-kind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-request-kind.d.ts","sourceRoot":"","sources":["../src/quota-request-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,8BAA4B,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,8EAA8E;AAC9E,wBAAgB,mCAAmC,CACjD,UAAU,EAAE;IAAE,wBAAwB,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAAE,EAC7D,WAAW,GAAE,gBAAyB,GACrC,OAAO,CAET"}
@@ -0,0 +1,8 @@
1
+ import { z } from "zod/v3";
2
+ /** Shared by quota evidence and account read/refresh requests without a schema cycle. */
3
+ export const QuotaRequestKind = z.enum(["text", "image"]);
4
+ /** Operation applicability is independent of any vendor model-id spelling. */
5
+ export function quotaConstraintAppliesToRequestKind(constraint, requestKind = "text") {
6
+ return constraint.applies_to_request_kinds?.includes(requestKind) ?? true;
7
+ }
8
+ //# sourceMappingURL=quota-request-kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-request-kind.js","sourceRoot":"","sources":["../src/quota-request-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,yFAAyF;AACzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAG1D,8EAA8E;AAC9E,MAAM,UAAU,mCAAmC,CACjD,UAA6D,EAC7D,WAAW,GAAqB,MAAM;IAEtC,OAAO,UAAU,CAAC,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;AAC5E,CAAC"}