@techis/ai-contracts 0.0.0-stage → 0.3.0-rc.15

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 (171) hide show
  1. package/LICENSE +122 -0
  2. package/README.md +28 -3
  3. package/THIRD_PARTY_NOTICES +34 -0
  4. package/dist/availability.d.ts +21 -0
  5. package/dist/availability.d.ts.map +1 -0
  6. package/dist/availability.js +2 -0
  7. package/dist/availability.js.map +1 -0
  8. package/dist/catalog-adoption.d.ts +20 -0
  9. package/dist/catalog-adoption.d.ts.map +1 -0
  10. package/dist/catalog-adoption.js +76 -0
  11. package/dist/catalog-adoption.js.map +1 -0
  12. package/dist/catalog-composition.d.ts +10 -0
  13. package/dist/catalog-composition.d.ts.map +1 -0
  14. package/dist/catalog-composition.js +58 -0
  15. package/dist/catalog-composition.js.map +1 -0
  16. package/dist/catalog-delivery.d.ts +47 -0
  17. package/dist/catalog-delivery.d.ts.map +1 -0
  18. package/dist/catalog-delivery.js +83 -0
  19. package/dist/catalog-delivery.js.map +1 -0
  20. package/dist/catalog-package-data.d.ts +8 -0
  21. package/dist/catalog-package-data.d.ts.map +1 -0
  22. package/dist/catalog-package-data.js +2640 -0
  23. package/dist/catalog-package-data.js.map +1 -0
  24. package/dist/compatibility.d.ts +68 -0
  25. package/dist/compatibility.d.ts.map +1 -0
  26. package/dist/compatibility.js +207 -0
  27. package/dist/compatibility.js.map +1 -0
  28. package/dist/configuration-bundle.d.ts +201 -0
  29. package/dist/configuration-bundle.d.ts.map +1 -0
  30. package/dist/configuration-bundle.js +619 -0
  31. package/dist/configuration-bundle.js.map +1 -0
  32. package/dist/entities.d.ts +619 -0
  33. package/dist/entities.d.ts.map +1 -0
  34. package/dist/entities.js +2 -0
  35. package/dist/entities.js.map +1 -0
  36. package/dist/fixtures.d.ts +25 -0
  37. package/dist/fixtures.d.ts.map +1 -0
  38. package/dist/fixtures.js +546 -0
  39. package/dist/fixtures.js.map +1 -0
  40. package/dist/hash.d.ts +8 -0
  41. package/dist/hash.d.ts.map +1 -0
  42. package/dist/hash.js +13 -0
  43. package/dist/hash.js.map +1 -0
  44. package/dist/host-qualification.d.ts +90 -0
  45. package/dist/host-qualification.d.ts.map +1 -0
  46. package/dist/host-qualification.js +65 -0
  47. package/dist/host-qualification.js.map +1 -0
  48. package/dist/icc-catalog.d.ts +31 -0
  49. package/dist/icc-catalog.d.ts.map +1 -0
  50. package/dist/icc-catalog.js +321 -0
  51. package/dist/icc-catalog.js.map +1 -0
  52. package/dist/icc-csf-profiles.d.ts +28 -0
  53. package/dist/icc-csf-profiles.d.ts.map +1 -0
  54. package/dist/icc-csf-profiles.js +394 -0
  55. package/dist/icc-csf-profiles.js.map +1 -0
  56. package/dist/index.d.ts +24 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.js +24 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/model-maintenance.d.ts +216 -0
  61. package/dist/model-maintenance.d.ts.map +1 -0
  62. package/dist/model-maintenance.js +387 -0
  63. package/dist/model-maintenance.js.map +1 -0
  64. package/dist/model-package-data.d.ts +3 -0
  65. package/dist/model-package-data.d.ts.map +1 -0
  66. package/dist/model-package-data.js +867 -0
  67. package/dist/model-package-data.js.map +1 -0
  68. package/dist/persona-inventory.d.ts +143 -0
  69. package/dist/persona-inventory.d.ts.map +1 -0
  70. package/dist/persona-inventory.js +56 -0
  71. package/dist/persona-inventory.js.map +1 -0
  72. package/dist/profile-identity.d.ts +27 -0
  73. package/dist/profile-identity.d.ts.map +1 -0
  74. package/dist/profile-identity.js +30 -0
  75. package/dist/profile-identity.js.map +1 -0
  76. package/dist/reasoning-validation.d.ts +9 -0
  77. package/dist/reasoning-validation.d.ts.map +1 -0
  78. package/dist/reasoning-validation.js +79 -0
  79. package/dist/reasoning-validation.js.map +1 -0
  80. package/dist/reasoning.d.ts +55 -0
  81. package/dist/reasoning.d.ts.map +1 -0
  82. package/dist/reasoning.js +13 -0
  83. package/dist/reasoning.js.map +1 -0
  84. package/dist/receipt.d.ts +16 -0
  85. package/dist/receipt.d.ts.map +1 -0
  86. package/dist/receipt.js +18 -0
  87. package/dist/receipt.js.map +1 -0
  88. package/dist/schemas/adoption-change-set.schema.json +91 -0
  89. package/dist/schemas/bundle.d.ts +124 -0
  90. package/dist/schemas/bundle.d.ts.map +1 -0
  91. package/dist/schemas/bundle.js +84 -0
  92. package/dist/schemas/bundle.js.map +1 -0
  93. package/dist/schemas/catalog-release.schema.json +110 -0
  94. package/dist/schemas/catalog-review-input.schema.json +179 -0
  95. package/dist/schemas/catalog-review-output.schema.json +259 -0
  96. package/dist/schemas/catalog-review-output.v2.schema.json +251 -0
  97. package/dist/schemas/catalog-review-record.schema.json +391 -0
  98. package/dist/schemas/client-persona-inventory.schema.json +107 -0
  99. package/dist/schemas/common.schema.json +324 -0
  100. package/dist/schemas/config.d.ts +1106 -0
  101. package/dist/schemas/config.d.ts.map +1 -0
  102. package/dist/schemas/config.js +496 -0
  103. package/dist/schemas/config.js.map +1 -0
  104. package/dist/schemas/configuration-bundle-manifest.schema.json +143 -0
  105. package/dist/schemas/configuration-manifest.schema.json +109 -0
  106. package/dist/schemas/connection.schema.json +49 -0
  107. package/dist/schemas/core.d.ts +1333 -0
  108. package/dist/schemas/core.d.ts.map +1 -0
  109. package/dist/schemas/core.js +341 -0
  110. package/dist/schemas/core.js.map +1 -0
  111. package/dist/schemas/desktop-configuration-revision.schema.json +146 -0
  112. package/dist/schemas/execution-profile-revision.schema.json +235 -0
  113. package/dist/schemas/execution-receipt.schema.json +431 -0
  114. package/dist/schemas/host-adapter-qualification.schema.json +161 -0
  115. package/dist/schemas/host-qualification-policy.schema.json +50 -0
  116. package/dist/schemas/index.d.ts +11 -0
  117. package/dist/schemas/index.d.ts.map +1 -0
  118. package/dist/schemas/index.js +34 -0
  119. package/dist/schemas/index.js.map +1 -0
  120. package/dist/schemas/inventory.d.ts +170 -0
  121. package/dist/schemas/inventory.d.ts.map +1 -0
  122. package/dist/schemas/inventory.js +87 -0
  123. package/dist/schemas/inventory.js.map +1 -0
  124. package/dist/schemas/model-definition.schema.json +429 -0
  125. package/dist/schemas/model-package-release.schema.json +594 -0
  126. package/dist/schemas/model-upgrade-advisory.schema.json +191 -0
  127. package/dist/schemas/operation-contract-document.schema.json +153 -0
  128. package/dist/schemas/persona-assignments.schema.json +125 -0
  129. package/dist/schemas/persona-registry-overlay.schema.json +93 -0
  130. package/dist/schemas/persona-source-document.schema.json +86 -0
  131. package/dist/schemas/persona-specification.schema.json +122 -0
  132. package/dist/schemas/price-revision.schema.json +299 -0
  133. package/dist/schemas/profile-assessment.schema.json +288 -0
  134. package/dist/schemas/scoped.d.ts +424 -0
  135. package/dist/schemas/scoped.d.ts.map +1 -0
  136. package/dist/schemas/scoped.js +203 -0
  137. package/dist/schemas/scoped.js.map +1 -0
  138. package/dist/schemas/usage-aggregate-query.schema.json +86 -0
  139. package/dist/schemas/usage-page.schema.json +22 -0
  140. package/dist/schemas/usage-query.schema.json +77 -0
  141. package/dist/schemas/usage-summary.schema.json +468 -0
  142. package/dist/schemas/usage.d.ts +527 -0
  143. package/dist/schemas/usage.d.ts.map +1 -0
  144. package/dist/schemas/usage.js +142 -0
  145. package/dist/schemas/usage.js.map +1 -0
  146. package/dist/scoped-configuration.d.ts +208 -0
  147. package/dist/scoped-configuration.d.ts.map +1 -0
  148. package/dist/scoped-configuration.js +425 -0
  149. package/dist/scoped-configuration.js.map +1 -0
  150. package/dist/scripts/emit-schemas.d.ts +2 -0
  151. package/dist/scripts/emit-schemas.d.ts.map +1 -0
  152. package/dist/scripts/emit-schemas.js +24 -0
  153. package/dist/scripts/emit-schemas.js.map +1 -0
  154. package/dist/scripts/verify-bundle.d.ts +3 -0
  155. package/dist/scripts/verify-bundle.d.ts.map +1 -0
  156. package/dist/scripts/verify-bundle.js +59 -0
  157. package/dist/scripts/verify-bundle.js.map +1 -0
  158. package/dist/validation.d.ts +11 -0
  159. package/dist/validation.d.ts.map +1 -0
  160. package/dist/validation.js +41 -0
  161. package/dist/validation.js.map +1 -0
  162. package/package.json +33 -6
  163. package/third-party-licenses/ajv-formats@3.0.1/LICENSE +21 -0
  164. package/third-party-licenses/ajv@8.20.0/LICENSE +22 -0
  165. package/third-party-licenses/fast-deep-equal@3.1.3/LICENSE +21 -0
  166. package/third-party-licenses/fast-uri@3.1.7/LICENSE +30 -0
  167. package/third-party-licenses/json-schema-traverse@1.0.0/LICENSE +21 -0
  168. package/third-party-licenses/require-from-string@2.0.2/license +21 -0
  169. package/third-party-licenses/typescript@5.9.3/LICENSE.txt +55 -0
  170. package/third-party-licenses/typescript@5.9.3/ThirdPartyNoticeText.txt +193 -0
  171. package/third-party-licenses.json +102 -0
@@ -0,0 +1,527 @@
1
+ export declare const usageQuerySchemaId = "https://techis.dev/ai/contracts/usage-query.schema.json";
2
+ export declare const usageQuerySchema: {
3
+ readonly $id: "https://techis.dev/ai/contracts/usage-query.schema.json";
4
+ readonly type: "object";
5
+ readonly additionalProperties: false;
6
+ readonly properties: {
7
+ readonly from: {
8
+ readonly $ref: "https://techis.dev/ai/contracts/common.schema.json#/definitions/isoDateTime";
9
+ };
10
+ readonly to: {
11
+ readonly $ref: "https://techis.dev/ai/contracts/common.schema.json#/definitions/isoDateTime";
12
+ };
13
+ readonly applicationId: {
14
+ readonly type: "string";
15
+ readonly minLength: 1;
16
+ readonly maxLength: 256;
17
+ };
18
+ readonly environmentId: {
19
+ readonly type: "string";
20
+ readonly minLength: 1;
21
+ readonly maxLength: 256;
22
+ };
23
+ readonly workspaceId: {
24
+ readonly type: "string";
25
+ readonly minLength: 1;
26
+ readonly maxLength: 256;
27
+ };
28
+ readonly profileId: {
29
+ readonly type: "string";
30
+ readonly minLength: 1;
31
+ readonly maxLength: 256;
32
+ };
33
+ readonly personaId: {
34
+ readonly type: "string";
35
+ readonly minLength: 1;
36
+ readonly maxLength: 256;
37
+ };
38
+ readonly operationId: {
39
+ readonly type: "string";
40
+ readonly minLength: 1;
41
+ readonly maxLength: 256;
42
+ };
43
+ readonly modelId: {
44
+ readonly type: "string";
45
+ readonly minLength: 1;
46
+ readonly maxLength: 256;
47
+ };
48
+ readonly provider: {
49
+ readonly type: "string";
50
+ readonly minLength: 1;
51
+ readonly maxLength: 256;
52
+ };
53
+ readonly status: {
54
+ readonly enum: readonly ["succeeded", "failed", "cancelled", "rejected"];
55
+ };
56
+ readonly fallbackUsed: {
57
+ readonly type: "boolean";
58
+ };
59
+ readonly priceKnown: {
60
+ readonly type: "boolean";
61
+ };
62
+ readonly limit: {
63
+ readonly type: "integer";
64
+ readonly minimum: 1;
65
+ readonly maximum: 500;
66
+ };
67
+ readonly cursor: {
68
+ readonly type: "string";
69
+ readonly minLength: 1;
70
+ readonly maxLength: 2048;
71
+ };
72
+ };
73
+ };
74
+ export declare const usagePageSchemaId = "https://techis.dev/ai/contracts/usage-page.schema.json";
75
+ export declare const usagePageSchema: {
76
+ readonly $id: "https://techis.dev/ai/contracts/usage-page.schema.json";
77
+ readonly type: "object";
78
+ readonly additionalProperties: false;
79
+ readonly required: readonly ["receipts"];
80
+ readonly properties: {
81
+ readonly receipts: {
82
+ readonly type: "array";
83
+ readonly maxItems: 500;
84
+ readonly items: {
85
+ readonly $ref: "https://techis.dev/ai/contracts/execution-receipt.schema.json";
86
+ };
87
+ };
88
+ readonly nextCursor: {
89
+ readonly type: "string";
90
+ readonly minLength: 1;
91
+ readonly maxLength: 2048;
92
+ };
93
+ };
94
+ };
95
+ export declare const usageAggregateQuerySchemaId = "https://techis.dev/ai/contracts/usage-aggregate-query.schema.json";
96
+ export declare const usageAggregateQuerySchema: {
97
+ readonly $id: "https://techis.dev/ai/contracts/usage-aggregate-query.schema.json";
98
+ readonly type: "object";
99
+ readonly additionalProperties: false;
100
+ readonly properties: {
101
+ readonly groupBy: {
102
+ readonly type: "array";
103
+ readonly maxItems: 10;
104
+ readonly uniqueItems: true;
105
+ readonly items: {
106
+ readonly enum: readonly ["day", "applicationId", "environmentId", "workspaceId", "profileId", "personaId", "operationId", "modelId", "provider", "status"];
107
+ };
108
+ };
109
+ readonly from: {
110
+ readonly $ref: "https://techis.dev/ai/contracts/common.schema.json#/definitions/isoDateTime";
111
+ };
112
+ readonly to: {
113
+ readonly $ref: "https://techis.dev/ai/contracts/common.schema.json#/definitions/isoDateTime";
114
+ };
115
+ readonly applicationId: {
116
+ readonly type: "string";
117
+ readonly minLength: 1;
118
+ readonly maxLength: 256;
119
+ };
120
+ readonly environmentId: {
121
+ readonly type: "string";
122
+ readonly minLength: 1;
123
+ readonly maxLength: 256;
124
+ };
125
+ readonly workspaceId: {
126
+ readonly type: "string";
127
+ readonly minLength: 1;
128
+ readonly maxLength: 256;
129
+ };
130
+ readonly profileId: {
131
+ readonly type: "string";
132
+ readonly minLength: 1;
133
+ readonly maxLength: 256;
134
+ };
135
+ readonly personaId: {
136
+ readonly type: "string";
137
+ readonly minLength: 1;
138
+ readonly maxLength: 256;
139
+ };
140
+ readonly operationId: {
141
+ readonly type: "string";
142
+ readonly minLength: 1;
143
+ readonly maxLength: 256;
144
+ };
145
+ readonly modelId: {
146
+ readonly type: "string";
147
+ readonly minLength: 1;
148
+ readonly maxLength: 256;
149
+ };
150
+ readonly provider: {
151
+ readonly type: "string";
152
+ readonly minLength: 1;
153
+ readonly maxLength: 256;
154
+ };
155
+ readonly status: {
156
+ readonly enum: readonly ["succeeded", "failed", "cancelled", "rejected"];
157
+ };
158
+ readonly fallbackUsed: {
159
+ readonly type: "boolean";
160
+ };
161
+ readonly priceKnown: {
162
+ readonly type: "boolean";
163
+ };
164
+ };
165
+ };
166
+ export declare const usageSummarySchemaId = "https://techis.dev/ai/contracts/usage-summary.schema.json";
167
+ export declare const usageSummarySchema: {
168
+ readonly $id: "https://techis.dev/ai/contracts/usage-summary.schema.json";
169
+ readonly type: "object";
170
+ readonly additionalProperties: false;
171
+ readonly required: readonly ["totals", "groups"];
172
+ readonly properties: {
173
+ readonly totals: {
174
+ readonly type: "object";
175
+ readonly additionalProperties: false;
176
+ readonly required: readonly ["calls", "statusCounts", "tokens", "unknownUsageCount", "costByCurrency", "unknownCostCount", "retriedCalls", "failedAttempts", "fallbackCalls", "latency", "outputTokens"];
177
+ readonly properties: {
178
+ readonly calls: {
179
+ readonly type: "integer";
180
+ readonly minimum: 0;
181
+ };
182
+ readonly statusCounts: {
183
+ readonly type: "object";
184
+ readonly additionalProperties: false;
185
+ readonly required: readonly ["succeeded", "failed", "cancelled", "rejected"];
186
+ readonly properties: {
187
+ readonly succeeded: {
188
+ readonly type: "integer";
189
+ readonly minimum: 0;
190
+ };
191
+ readonly failed: {
192
+ readonly type: "integer";
193
+ readonly minimum: 0;
194
+ };
195
+ readonly cancelled: {
196
+ readonly type: "integer";
197
+ readonly minimum: 0;
198
+ };
199
+ readonly rejected: {
200
+ readonly type: "integer";
201
+ readonly minimum: 0;
202
+ };
203
+ };
204
+ };
205
+ readonly tokens: {
206
+ readonly type: "object";
207
+ readonly additionalProperties: false;
208
+ readonly required: readonly ["input", "output", "reasoning", "cachedInput", "cacheWriteInput"];
209
+ readonly properties: {
210
+ readonly input: {
211
+ readonly type: "integer";
212
+ readonly minimum: 0;
213
+ };
214
+ readonly output: {
215
+ readonly type: "integer";
216
+ readonly minimum: 0;
217
+ };
218
+ readonly reasoning: {
219
+ readonly type: "integer";
220
+ readonly minimum: 0;
221
+ };
222
+ readonly cachedInput: {
223
+ readonly type: "integer";
224
+ readonly minimum: 0;
225
+ };
226
+ readonly cacheWriteInput: {
227
+ readonly type: "integer";
228
+ readonly minimum: 0;
229
+ };
230
+ };
231
+ };
232
+ readonly unknownUsageCount: {
233
+ readonly type: "integer";
234
+ readonly minimum: 0;
235
+ };
236
+ readonly costByCurrency: {
237
+ readonly type: "object";
238
+ readonly propertyNames: {
239
+ readonly type: "string";
240
+ readonly minLength: 3;
241
+ readonly maxLength: 3;
242
+ };
243
+ readonly additionalProperties: {
244
+ readonly type: "number";
245
+ readonly minimum: 0;
246
+ };
247
+ };
248
+ readonly unknownCostCount: {
249
+ readonly type: "integer";
250
+ readonly minimum: 0;
251
+ };
252
+ readonly retriedCalls: {
253
+ readonly type: "integer";
254
+ readonly minimum: 0;
255
+ };
256
+ readonly failedAttempts: {
257
+ readonly type: "integer";
258
+ readonly minimum: 0;
259
+ };
260
+ readonly fallbackCalls: {
261
+ readonly type: "integer";
262
+ readonly minimum: 0;
263
+ };
264
+ readonly latency: {
265
+ readonly type: "object";
266
+ readonly additionalProperties: false;
267
+ readonly required: readonly ["samples", "minMs", "maxMs", "meanMs", "buckets"];
268
+ readonly properties: {
269
+ readonly samples: {
270
+ readonly type: "integer";
271
+ readonly minimum: 0;
272
+ };
273
+ readonly minMs: {
274
+ readonly anyOf: readonly [{
275
+ readonly type: "number";
276
+ readonly minimum: 0;
277
+ }, {
278
+ readonly type: "null";
279
+ }];
280
+ };
281
+ readonly maxMs: {
282
+ readonly anyOf: readonly [{
283
+ readonly type: "number";
284
+ readonly minimum: 0;
285
+ }, {
286
+ readonly type: "null";
287
+ }];
288
+ };
289
+ readonly meanMs: {
290
+ readonly anyOf: readonly [{
291
+ readonly type: "number";
292
+ readonly minimum: 0;
293
+ }, {
294
+ readonly type: "null";
295
+ }];
296
+ };
297
+ readonly buckets: {
298
+ readonly type: "array";
299
+ readonly maxItems: 32;
300
+ readonly items: {
301
+ readonly type: "object";
302
+ readonly additionalProperties: false;
303
+ readonly required: readonly ["label", "count"];
304
+ readonly properties: {
305
+ readonly label: {
306
+ readonly type: "string";
307
+ readonly minLength: 1;
308
+ readonly maxLength: 64;
309
+ };
310
+ readonly count: {
311
+ readonly type: "integer";
312
+ readonly minimum: 0;
313
+ };
314
+ };
315
+ };
316
+ };
317
+ };
318
+ };
319
+ readonly outputTokens: {
320
+ readonly type: "object";
321
+ readonly additionalProperties: false;
322
+ readonly required: readonly ["requestedSum", "effectiveSum", "cappedCalls"];
323
+ readonly properties: {
324
+ readonly requestedSum: {
325
+ readonly type: "integer";
326
+ readonly minimum: 0;
327
+ };
328
+ readonly effectiveSum: {
329
+ readonly type: "integer";
330
+ readonly minimum: 0;
331
+ };
332
+ readonly cappedCalls: {
333
+ readonly type: "integer";
334
+ readonly minimum: 0;
335
+ };
336
+ };
337
+ };
338
+ };
339
+ };
340
+ readonly groups: {
341
+ readonly type: "array";
342
+ readonly items: {
343
+ readonly type: "object";
344
+ readonly additionalProperties: false;
345
+ readonly required: readonly ["dimension", "value", "totals"];
346
+ readonly properties: {
347
+ readonly dimension: {
348
+ readonly enum: readonly ["day", "applicationId", "environmentId", "workspaceId", "profileId", "personaId", "operationId", "modelId", "provider", "status"];
349
+ };
350
+ readonly value: {
351
+ readonly type: "string";
352
+ readonly minLength: 1;
353
+ readonly maxLength: 256;
354
+ };
355
+ readonly totals: {
356
+ readonly type: "object";
357
+ readonly additionalProperties: false;
358
+ readonly required: readonly ["calls", "statusCounts", "tokens", "unknownUsageCount", "costByCurrency", "unknownCostCount", "retriedCalls", "failedAttempts", "fallbackCalls", "latency", "outputTokens"];
359
+ readonly properties: {
360
+ readonly calls: {
361
+ readonly type: "integer";
362
+ readonly minimum: 0;
363
+ };
364
+ readonly statusCounts: {
365
+ readonly type: "object";
366
+ readonly additionalProperties: false;
367
+ readonly required: readonly ["succeeded", "failed", "cancelled", "rejected"];
368
+ readonly properties: {
369
+ readonly succeeded: {
370
+ readonly type: "integer";
371
+ readonly minimum: 0;
372
+ };
373
+ readonly failed: {
374
+ readonly type: "integer";
375
+ readonly minimum: 0;
376
+ };
377
+ readonly cancelled: {
378
+ readonly type: "integer";
379
+ readonly minimum: 0;
380
+ };
381
+ readonly rejected: {
382
+ readonly type: "integer";
383
+ readonly minimum: 0;
384
+ };
385
+ };
386
+ };
387
+ readonly tokens: {
388
+ readonly type: "object";
389
+ readonly additionalProperties: false;
390
+ readonly required: readonly ["input", "output", "reasoning", "cachedInput", "cacheWriteInput"];
391
+ readonly properties: {
392
+ readonly input: {
393
+ readonly type: "integer";
394
+ readonly minimum: 0;
395
+ };
396
+ readonly output: {
397
+ readonly type: "integer";
398
+ readonly minimum: 0;
399
+ };
400
+ readonly reasoning: {
401
+ readonly type: "integer";
402
+ readonly minimum: 0;
403
+ };
404
+ readonly cachedInput: {
405
+ readonly type: "integer";
406
+ readonly minimum: 0;
407
+ };
408
+ readonly cacheWriteInput: {
409
+ readonly type: "integer";
410
+ readonly minimum: 0;
411
+ };
412
+ };
413
+ };
414
+ readonly unknownUsageCount: {
415
+ readonly type: "integer";
416
+ readonly minimum: 0;
417
+ };
418
+ readonly costByCurrency: {
419
+ readonly type: "object";
420
+ readonly propertyNames: {
421
+ readonly type: "string";
422
+ readonly minLength: 3;
423
+ readonly maxLength: 3;
424
+ };
425
+ readonly additionalProperties: {
426
+ readonly type: "number";
427
+ readonly minimum: 0;
428
+ };
429
+ };
430
+ readonly unknownCostCount: {
431
+ readonly type: "integer";
432
+ readonly minimum: 0;
433
+ };
434
+ readonly retriedCalls: {
435
+ readonly type: "integer";
436
+ readonly minimum: 0;
437
+ };
438
+ readonly failedAttempts: {
439
+ readonly type: "integer";
440
+ readonly minimum: 0;
441
+ };
442
+ readonly fallbackCalls: {
443
+ readonly type: "integer";
444
+ readonly minimum: 0;
445
+ };
446
+ readonly latency: {
447
+ readonly type: "object";
448
+ readonly additionalProperties: false;
449
+ readonly required: readonly ["samples", "minMs", "maxMs", "meanMs", "buckets"];
450
+ readonly properties: {
451
+ readonly samples: {
452
+ readonly type: "integer";
453
+ readonly minimum: 0;
454
+ };
455
+ readonly minMs: {
456
+ readonly anyOf: readonly [{
457
+ readonly type: "number";
458
+ readonly minimum: 0;
459
+ }, {
460
+ readonly type: "null";
461
+ }];
462
+ };
463
+ readonly maxMs: {
464
+ readonly anyOf: readonly [{
465
+ readonly type: "number";
466
+ readonly minimum: 0;
467
+ }, {
468
+ readonly type: "null";
469
+ }];
470
+ };
471
+ readonly meanMs: {
472
+ readonly anyOf: readonly [{
473
+ readonly type: "number";
474
+ readonly minimum: 0;
475
+ }, {
476
+ readonly type: "null";
477
+ }];
478
+ };
479
+ readonly buckets: {
480
+ readonly type: "array";
481
+ readonly maxItems: 32;
482
+ readonly items: {
483
+ readonly type: "object";
484
+ readonly additionalProperties: false;
485
+ readonly required: readonly ["label", "count"];
486
+ readonly properties: {
487
+ readonly label: {
488
+ readonly type: "string";
489
+ readonly minLength: 1;
490
+ readonly maxLength: 64;
491
+ };
492
+ readonly count: {
493
+ readonly type: "integer";
494
+ readonly minimum: 0;
495
+ };
496
+ };
497
+ };
498
+ };
499
+ };
500
+ };
501
+ readonly outputTokens: {
502
+ readonly type: "object";
503
+ readonly additionalProperties: false;
504
+ readonly required: readonly ["requestedSum", "effectiveSum", "cappedCalls"];
505
+ readonly properties: {
506
+ readonly requestedSum: {
507
+ readonly type: "integer";
508
+ readonly minimum: 0;
509
+ };
510
+ readonly effectiveSum: {
511
+ readonly type: "integer";
512
+ readonly minimum: 0;
513
+ };
514
+ readonly cappedCalls: {
515
+ readonly type: "integer";
516
+ readonly minimum: 0;
517
+ };
518
+ };
519
+ };
520
+ };
521
+ };
522
+ };
523
+ };
524
+ };
525
+ };
526
+ };
527
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/schemas/usage.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,kBAAkB,4DAA2C,CAAC;AAC3E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASnB,CAAC;AAEX,eAAO,MAAM,iBAAiB,2DAA0C,CAAC;AACzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;CASlB,CAAC;AAEX,eAAO,MAAM,2BAA2B,sEAAqD,CAAC;AAC9F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ5B,CAAC;AAsEX,eAAO,MAAM,oBAAoB,8DAA6C,CAAC;AAC/E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBrB,CAAC"}
@@ -0,0 +1,142 @@
1
+ import { SCHEMA_BASE, commonSchemaId } from "./core.js";
2
+ import { executionReceiptSchemaId } from "./config.js";
3
+ const D = `${commonSchemaId}#/definitions/`;
4
+ const status = { enum: ["succeeded", "failed", "cancelled", "rejected"] };
5
+ const groupDimension = {
6
+ enum: ["day", "applicationId", "environmentId", "workspaceId", "profileId", "personaId", "operationId", "modelId", "provider", "status"]
7
+ };
8
+ const boundedString = { type: "string", minLength: 1, maxLength: 256 };
9
+ const filterProperties = {
10
+ from: { $ref: `${D}isoDateTime` },
11
+ to: { $ref: `${D}isoDateTime` },
12
+ applicationId: boundedString,
13
+ environmentId: boundedString,
14
+ workspaceId: boundedString,
15
+ profileId: boundedString,
16
+ personaId: boundedString,
17
+ operationId: boundedString,
18
+ modelId: boundedString,
19
+ provider: boundedString,
20
+ status,
21
+ fallbackUsed: { type: "boolean" },
22
+ priceKnown: { type: "boolean" }
23
+ };
24
+ export const usageQuerySchemaId = `${SCHEMA_BASE}/usage-query.schema.json`;
25
+ export const usageQuerySchema = {
26
+ $id: usageQuerySchemaId,
27
+ type: "object",
28
+ additionalProperties: false,
29
+ properties: {
30
+ limit: { type: "integer", minimum: 1, maximum: 500 },
31
+ cursor: { type: "string", minLength: 1, maxLength: 2048 },
32
+ ...filterProperties
33
+ }
34
+ };
35
+ export const usagePageSchemaId = `${SCHEMA_BASE}/usage-page.schema.json`;
36
+ export const usagePageSchema = {
37
+ $id: usagePageSchemaId,
38
+ type: "object",
39
+ additionalProperties: false,
40
+ required: ["receipts"],
41
+ properties: {
42
+ receipts: { type: "array", maxItems: 500, items: { $ref: executionReceiptSchemaId } },
43
+ nextCursor: { type: "string", minLength: 1, maxLength: 2048 }
44
+ }
45
+ };
46
+ export const usageAggregateQuerySchemaId = `${SCHEMA_BASE}/usage-aggregate-query.schema.json`;
47
+ export const usageAggregateQuerySchema = {
48
+ $id: usageAggregateQuerySchemaId,
49
+ type: "object",
50
+ additionalProperties: false,
51
+ properties: {
52
+ ...filterProperties,
53
+ groupBy: { type: "array", maxItems: 10, uniqueItems: true, items: groupDimension }
54
+ }
55
+ };
56
+ const nonnegativeInteger = { type: "integer", minimum: 0 };
57
+ const usageTotalsSchema = {
58
+ type: "object",
59
+ additionalProperties: false,
60
+ required: [
61
+ "calls", "statusCounts", "tokens", "unknownUsageCount", "costByCurrency", "unknownCostCount",
62
+ "retriedCalls", "failedAttempts", "fallbackCalls", "latency", "outputTokens"
63
+ ],
64
+ properties: {
65
+ calls: nonnegativeInteger,
66
+ statusCounts: {
67
+ type: "object",
68
+ additionalProperties: false,
69
+ required: ["succeeded", "failed", "cancelled", "rejected"],
70
+ properties: { succeeded: nonnegativeInteger, failed: nonnegativeInteger, cancelled: nonnegativeInteger, rejected: nonnegativeInteger }
71
+ },
72
+ tokens: {
73
+ type: "object",
74
+ additionalProperties: false,
75
+ required: ["input", "output", "reasoning", "cachedInput", "cacheWriteInput"],
76
+ properties: {
77
+ input: nonnegativeInteger,
78
+ output: nonnegativeInteger,
79
+ reasoning: nonnegativeInteger,
80
+ cachedInput: nonnegativeInteger,
81
+ cacheWriteInput: nonnegativeInteger
82
+ }
83
+ },
84
+ unknownUsageCount: nonnegativeInteger,
85
+ costByCurrency: {
86
+ type: "object",
87
+ propertyNames: { type: "string", minLength: 3, maxLength: 3 },
88
+ additionalProperties: { type: "number", minimum: 0 }
89
+ },
90
+ unknownCostCount: nonnegativeInteger,
91
+ retriedCalls: nonnegativeInteger,
92
+ failedAttempts: nonnegativeInteger,
93
+ fallbackCalls: nonnegativeInteger,
94
+ latency: {
95
+ type: "object",
96
+ additionalProperties: false,
97
+ required: ["samples", "minMs", "maxMs", "meanMs", "buckets"],
98
+ properties: {
99
+ samples: nonnegativeInteger,
100
+ minMs: { anyOf: [{ type: "number", minimum: 0 }, { type: "null" }] },
101
+ maxMs: { anyOf: [{ type: "number", minimum: 0 }, { type: "null" }] },
102
+ meanMs: { anyOf: [{ type: "number", minimum: 0 }, { type: "null" }] },
103
+ buckets: {
104
+ type: "array",
105
+ maxItems: 32,
106
+ items: {
107
+ type: "object",
108
+ additionalProperties: false,
109
+ required: ["label", "count"],
110
+ properties: { label: { type: "string", minLength: 1, maxLength: 64 }, count: nonnegativeInteger }
111
+ }
112
+ }
113
+ }
114
+ },
115
+ outputTokens: {
116
+ type: "object",
117
+ additionalProperties: false,
118
+ required: ["requestedSum", "effectiveSum", "cappedCalls"],
119
+ properties: { requestedSum: nonnegativeInteger, effectiveSum: nonnegativeInteger, cappedCalls: nonnegativeInteger }
120
+ }
121
+ }
122
+ };
123
+ export const usageSummarySchemaId = `${SCHEMA_BASE}/usage-summary.schema.json`;
124
+ export const usageSummarySchema = {
125
+ $id: usageSummarySchemaId,
126
+ type: "object",
127
+ additionalProperties: false,
128
+ required: ["totals", "groups"],
129
+ properties: {
130
+ totals: usageTotalsSchema,
131
+ groups: {
132
+ type: "array",
133
+ items: {
134
+ type: "object",
135
+ additionalProperties: false,
136
+ required: ["dimension", "value", "totals"],
137
+ properties: { dimension: groupDimension, value: boundedString, totals: usageTotalsSchema }
138
+ }
139
+ }
140
+ }
141
+ };
142
+ //# sourceMappingURL=usage.js.map