optio-contracts 0.11.3 → 0.11.5

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.
@@ -0,0 +1,1071 @@
1
+ import { z } from 'zod';
2
+ /** Why a pool operation was refused (optio-agents-all's POOL_FAILURE_REASONS, same order). */
3
+ export declare const PoolFailureReason: z.ZodEnum<["unknown-kind", "unsupported", "invalid-owner", "setup-running", "launch-refused", "no-key", "key-rejected", "unreachable", "no-models", "unknown-model", "default-not-ticked", "unknown-region"]>;
4
+ export type PoolFailureReason = z.infer<typeof PoolFailureReason>;
5
+ /** The pool operations, as the stream's `allowed` lists them. */
6
+ export declare const PoolOperationSchema: z.ZodEnum<["setup", "configure", "retest", "bury-dead", "remove-all", "sort-out"]>;
7
+ export type PoolOperation = z.infer<typeof PoolOperationSchema>;
8
+ /** The same operations as optio-api's `authorize` sees them (with the `pool-` prefix). */
9
+ export declare const PoolActionSchema: z.ZodEnum<["pool-setup", "pool-configure", "pool-retest", "pool-bury-dead", "pool-remove-all", "pool-sort-out"]>;
10
+ export type PoolAction = z.infer<typeof PoolActionSchema>;
11
+ /** What a kind supports (spec section 5). */
12
+ export declare const PoolCapabilitiesSchema: z.ZodObject<{
13
+ lease: z.ZodBoolean;
14
+ verify: z.ZodBoolean;
15
+ accounts: z.ZodBoolean;
16
+ usageGating: z.ZodBoolean;
17
+ signature: z.ZodBoolean;
18
+ }, "strip", z.ZodTypeAny, {
19
+ lease: boolean;
20
+ verify: boolean;
21
+ accounts: boolean;
22
+ usageGating: boolean;
23
+ signature: boolean;
24
+ }, {
25
+ lease: boolean;
26
+ verify: boolean;
27
+ accounts: boolean;
28
+ usageGating: boolean;
29
+ signature: boolean;
30
+ }>;
31
+ export type PoolCapabilities = z.infer<typeof PoolCapabilitiesSchema>;
32
+ /** An enabled kind: `name` is the agent's display name; `regions` empty for login kinds. */
33
+ export declare const PoolKindInfoSchema: z.ZodObject<{
34
+ kind: z.ZodString;
35
+ name: z.ZodString;
36
+ setup: z.ZodEnum<["login", "form"]>;
37
+ capabilities: z.ZodObject<{
38
+ lease: z.ZodBoolean;
39
+ verify: z.ZodBoolean;
40
+ accounts: z.ZodBoolean;
41
+ usageGating: z.ZodBoolean;
42
+ signature: z.ZodBoolean;
43
+ }, "strip", z.ZodTypeAny, {
44
+ lease: boolean;
45
+ verify: boolean;
46
+ accounts: boolean;
47
+ usageGating: boolean;
48
+ signature: boolean;
49
+ }, {
50
+ lease: boolean;
51
+ verify: boolean;
52
+ accounts: boolean;
53
+ usageGating: boolean;
54
+ signature: boolean;
55
+ }>;
56
+ regions: z.ZodArray<z.ZodString, "many">;
57
+ }, "strip", z.ZodTypeAny, {
58
+ name: string;
59
+ kind: string;
60
+ setup: "login" | "form";
61
+ capabilities: {
62
+ lease: boolean;
63
+ verify: boolean;
64
+ accounts: boolean;
65
+ usageGating: boolean;
66
+ signature: boolean;
67
+ };
68
+ regions: string[];
69
+ }, {
70
+ name: string;
71
+ kind: string;
72
+ setup: "login" | "form";
73
+ capabilities: {
74
+ lease: boolean;
75
+ verify: boolean;
76
+ accounts: boolean;
77
+ usageGating: boolean;
78
+ signature: boolean;
79
+ };
80
+ regions: string[];
81
+ }>;
82
+ export type PoolKindInfo = z.infer<typeof PoolKindInfoSchema>;
83
+ /** The RPC's kind: also the seed collection, for optio-api's watch. Never sent to a browser. */
84
+ export declare const PoolKindInfoWithCollectionSchema: z.ZodObject<{
85
+ kind: z.ZodString;
86
+ name: z.ZodString;
87
+ setup: z.ZodEnum<["login", "form"]>;
88
+ capabilities: z.ZodObject<{
89
+ lease: z.ZodBoolean;
90
+ verify: z.ZodBoolean;
91
+ accounts: z.ZodBoolean;
92
+ usageGating: z.ZodBoolean;
93
+ signature: z.ZodBoolean;
94
+ }, "strip", z.ZodTypeAny, {
95
+ lease: boolean;
96
+ verify: boolean;
97
+ accounts: boolean;
98
+ usageGating: boolean;
99
+ signature: boolean;
100
+ }, {
101
+ lease: boolean;
102
+ verify: boolean;
103
+ accounts: boolean;
104
+ usageGating: boolean;
105
+ signature: boolean;
106
+ }>;
107
+ regions: z.ZodArray<z.ZodString, "many">;
108
+ } & {
109
+ seedCollection: z.ZodString;
110
+ }, "strip", z.ZodTypeAny, {
111
+ name: string;
112
+ kind: string;
113
+ setup: "login" | "form";
114
+ capabilities: {
115
+ lease: boolean;
116
+ verify: boolean;
117
+ accounts: boolean;
118
+ usageGating: boolean;
119
+ signature: boolean;
120
+ };
121
+ regions: string[];
122
+ seedCollection: string;
123
+ }, {
124
+ name: string;
125
+ kind: string;
126
+ setup: "login" | "form";
127
+ capabilities: {
128
+ lease: boolean;
129
+ verify: boolean;
130
+ accounts: boolean;
131
+ usageGating: boolean;
132
+ signature: boolean;
133
+ };
134
+ regions: string[];
135
+ seedCollection: string;
136
+ }>;
137
+ export type PoolKindInfoWithCollection = z.infer<typeof PoolKindInfoWithCollectionSchema>;
138
+ export declare const PoolSeedRowSchema: z.ZodObject<{
139
+ label: z.ZodNullable<z.ZodString>;
140
+ status: z.ZodEnum<["pending", "alive", "dead"]>;
141
+ leased: z.ZodBoolean;
142
+ }, "strip", z.ZodTypeAny, {
143
+ status: "pending" | "alive" | "dead";
144
+ label: string | null;
145
+ leased: boolean;
146
+ }, {
147
+ status: "pending" | "alive" | "dead";
148
+ label: string | null;
149
+ leased: boolean;
150
+ }>;
151
+ export type PoolSeedRow = z.infer<typeof PoolSeedRowSchema>;
152
+ export declare const PoolAccountRowSchema: z.ZodObject<{
153
+ accountId: z.ZodNullable<z.ZodString>;
154
+ summary: z.ZodNullable<z.ZodString>;
155
+ resetsAt: z.ZodNullable<z.ZodString>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ summary: string | null;
158
+ accountId: string | null;
159
+ resetsAt: string | null;
160
+ }, {
161
+ summary: string | null;
162
+ accountId: string | null;
163
+ resetsAt: string | null;
164
+ }>;
165
+ export type PoolAccountRow = z.infer<typeof PoolAccountRowSchema>;
166
+ export declare const PoolGatewayModelRowSchema: z.ZodObject<{
167
+ id: z.ZodString;
168
+ label: z.ZodString;
169
+ status: z.ZodEnum<["untested", "ok", "failed"]>;
170
+ reason: z.ZodNullable<z.ZodString>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ status: "failed" | "untested" | "ok";
173
+ reason: string | null;
174
+ id: string;
175
+ label: string;
176
+ }, {
177
+ status: "failed" | "untested" | "ok";
178
+ reason: string | null;
179
+ id: string;
180
+ label: string;
181
+ }>;
182
+ export type PoolGatewayModelRow = z.infer<typeof PoolGatewayModelRowSchema>;
183
+ /** The form kind's configuration. `keyHint`: the key's last characters, null for a short key. */
184
+ export declare const PoolGatewaySummarySchema: z.ZodObject<{
185
+ region: z.ZodString;
186
+ defaultModel: z.ZodString;
187
+ keyHint: z.ZodNullable<z.ZodString>;
188
+ testedAt: z.ZodNullable<z.ZodString>;
189
+ models: z.ZodArray<z.ZodObject<{
190
+ id: z.ZodString;
191
+ label: z.ZodString;
192
+ status: z.ZodEnum<["untested", "ok", "failed"]>;
193
+ reason: z.ZodNullable<z.ZodString>;
194
+ }, "strip", z.ZodTypeAny, {
195
+ status: "failed" | "untested" | "ok";
196
+ reason: string | null;
197
+ id: string;
198
+ label: string;
199
+ }, {
200
+ status: "failed" | "untested" | "ok";
201
+ reason: string | null;
202
+ id: string;
203
+ label: string;
204
+ }>, "many">;
205
+ }, "strip", z.ZodTypeAny, {
206
+ region: string;
207
+ defaultModel: string;
208
+ keyHint: string | null;
209
+ testedAt: string | null;
210
+ models: {
211
+ status: "failed" | "untested" | "ok";
212
+ reason: string | null;
213
+ id: string;
214
+ label: string;
215
+ }[];
216
+ }, {
217
+ region: string;
218
+ defaultModel: string;
219
+ keyHint: string | null;
220
+ testedAt: string | null;
221
+ models: {
222
+ status: "failed" | "untested" | "ok";
223
+ reason: string | null;
224
+ id: string;
225
+ label: string;
226
+ }[];
227
+ }>;
228
+ export type PoolGatewaySummary = z.infer<typeof PoolGatewaySummarySchema>;
229
+ /**
230
+ * A pool's stats. The optional fields hold a value exactly when the kind has the
231
+ * capability: `limited` / `notLimited` usage gating, `divergent` signature,
232
+ * `accounts` accounts, `gateway` the form kind once set up. Without it a field is
233
+ * null or absent, and both mean the same: the engine (clamator's Python server
234
+ * dumps results without leaving out None) sends null, the stream passes the null
235
+ * on, and a reader treats null exactly as absent.
236
+ */
237
+ export declare const PoolStatsSchema: z.ZodObject<{
238
+ total: z.ZodNumber;
239
+ dead: z.ZodNumber;
240
+ inUse: z.ZodNumber;
241
+ free: z.ZodNumber;
242
+ usable: z.ZodNumber;
243
+ seeds: z.ZodArray<z.ZodObject<{
244
+ label: z.ZodNullable<z.ZodString>;
245
+ status: z.ZodEnum<["pending", "alive", "dead"]>;
246
+ leased: z.ZodBoolean;
247
+ }, "strip", z.ZodTypeAny, {
248
+ status: "pending" | "alive" | "dead";
249
+ label: string | null;
250
+ leased: boolean;
251
+ }, {
252
+ status: "pending" | "alive" | "dead";
253
+ label: string | null;
254
+ leased: boolean;
255
+ }>, "many">;
256
+ limited: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
257
+ notLimited: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
258
+ divergent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
259
+ accounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
260
+ accountId: z.ZodNullable<z.ZodString>;
261
+ summary: z.ZodNullable<z.ZodString>;
262
+ resetsAt: z.ZodNullable<z.ZodString>;
263
+ }, "strip", z.ZodTypeAny, {
264
+ summary: string | null;
265
+ accountId: string | null;
266
+ resetsAt: string | null;
267
+ }, {
268
+ summary: string | null;
269
+ accountId: string | null;
270
+ resetsAt: string | null;
271
+ }>, "many">>>;
272
+ gateway: z.ZodOptional<z.ZodNullable<z.ZodObject<{
273
+ region: z.ZodString;
274
+ defaultModel: z.ZodString;
275
+ keyHint: z.ZodNullable<z.ZodString>;
276
+ testedAt: z.ZodNullable<z.ZodString>;
277
+ models: z.ZodArray<z.ZodObject<{
278
+ id: z.ZodString;
279
+ label: z.ZodString;
280
+ status: z.ZodEnum<["untested", "ok", "failed"]>;
281
+ reason: z.ZodNullable<z.ZodString>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ status: "failed" | "untested" | "ok";
284
+ reason: string | null;
285
+ id: string;
286
+ label: string;
287
+ }, {
288
+ status: "failed" | "untested" | "ok";
289
+ reason: string | null;
290
+ id: string;
291
+ label: string;
292
+ }>, "many">;
293
+ }, "strip", z.ZodTypeAny, {
294
+ region: string;
295
+ defaultModel: string;
296
+ keyHint: string | null;
297
+ testedAt: string | null;
298
+ models: {
299
+ status: "failed" | "untested" | "ok";
300
+ reason: string | null;
301
+ id: string;
302
+ label: string;
303
+ }[];
304
+ }, {
305
+ region: string;
306
+ defaultModel: string;
307
+ keyHint: string | null;
308
+ testedAt: string | null;
309
+ models: {
310
+ status: "failed" | "untested" | "ok";
311
+ reason: string | null;
312
+ id: string;
313
+ label: string;
314
+ }[];
315
+ }>>>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ dead: number;
318
+ total: number;
319
+ inUse: number;
320
+ free: number;
321
+ usable: number;
322
+ seeds: {
323
+ status: "pending" | "alive" | "dead";
324
+ label: string | null;
325
+ leased: boolean;
326
+ }[];
327
+ accounts?: {
328
+ summary: string | null;
329
+ accountId: string | null;
330
+ resetsAt: string | null;
331
+ }[] | null | undefined;
332
+ limited?: number | null | undefined;
333
+ notLimited?: number | null | undefined;
334
+ divergent?: number | null | undefined;
335
+ gateway?: {
336
+ region: string;
337
+ defaultModel: string;
338
+ keyHint: string | null;
339
+ testedAt: string | null;
340
+ models: {
341
+ status: "failed" | "untested" | "ok";
342
+ reason: string | null;
343
+ id: string;
344
+ label: string;
345
+ }[];
346
+ } | null | undefined;
347
+ }, {
348
+ dead: number;
349
+ total: number;
350
+ inUse: number;
351
+ free: number;
352
+ usable: number;
353
+ seeds: {
354
+ status: "pending" | "alive" | "dead";
355
+ label: string | null;
356
+ leased: boolean;
357
+ }[];
358
+ accounts?: {
359
+ summary: string | null;
360
+ accountId: string | null;
361
+ resetsAt: string | null;
362
+ }[] | null | undefined;
363
+ limited?: number | null | undefined;
364
+ notLimited?: number | null | undefined;
365
+ divergent?: number | null | undefined;
366
+ gateway?: {
367
+ region: string;
368
+ defaultModel: string;
369
+ keyHint: string | null;
370
+ testedAt: string | null;
371
+ models: {
372
+ status: "failed" | "untested" | "ok";
373
+ reason: string | null;
374
+ id: string;
375
+ label: string;
376
+ }[];
377
+ } | null | undefined;
378
+ }>;
379
+ export type PoolStats = z.infer<typeof PoolStatsSchema>;
380
+ /** One model a gateway account allows. `efforts` null for none; `euOnly` listed for `eu` only. */
381
+ export declare const ModelChoiceSchema: z.ZodObject<{
382
+ id: z.ZodString;
383
+ label: z.ZodString;
384
+ group: z.ZodEnum<["managed", "pinned", "policy"]>;
385
+ efforts: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
386
+ euOnly: z.ZodBoolean;
387
+ }, "strip", z.ZodTypeAny, {
388
+ id: string;
389
+ label: string;
390
+ group: "managed" | "pinned" | "policy";
391
+ efforts: string[] | null;
392
+ euOnly: boolean;
393
+ }, {
394
+ id: string;
395
+ label: string;
396
+ group: "managed" | "pinned" | "policy";
397
+ efforts: string[] | null;
398
+ euOnly: boolean;
399
+ }>;
400
+ export type ModelChoice = z.infer<typeof ModelChoiceSchema>;
401
+ /** A row of the pools stream: the kind, what the user may do, the stats. */
402
+ export declare const PoolRowSchema: z.ZodObject<{
403
+ kind: z.ZodString;
404
+ name: z.ZodString;
405
+ setup: z.ZodEnum<["login", "form"]>;
406
+ capabilities: z.ZodObject<{
407
+ lease: z.ZodBoolean;
408
+ verify: z.ZodBoolean;
409
+ accounts: z.ZodBoolean;
410
+ usageGating: z.ZodBoolean;
411
+ signature: z.ZodBoolean;
412
+ }, "strip", z.ZodTypeAny, {
413
+ lease: boolean;
414
+ verify: boolean;
415
+ accounts: boolean;
416
+ usageGating: boolean;
417
+ signature: boolean;
418
+ }, {
419
+ lease: boolean;
420
+ verify: boolean;
421
+ accounts: boolean;
422
+ usageGating: boolean;
423
+ signature: boolean;
424
+ }>;
425
+ regions: z.ZodArray<z.ZodString, "many">;
426
+ } & {
427
+ allowed: z.ZodArray<z.ZodEnum<["setup", "configure", "retest", "bury-dead", "remove-all", "sort-out"]>, "many">;
428
+ stats: z.ZodObject<{
429
+ total: z.ZodNumber;
430
+ dead: z.ZodNumber;
431
+ inUse: z.ZodNumber;
432
+ free: z.ZodNumber;
433
+ usable: z.ZodNumber;
434
+ seeds: z.ZodArray<z.ZodObject<{
435
+ label: z.ZodNullable<z.ZodString>;
436
+ status: z.ZodEnum<["pending", "alive", "dead"]>;
437
+ leased: z.ZodBoolean;
438
+ }, "strip", z.ZodTypeAny, {
439
+ status: "pending" | "alive" | "dead";
440
+ label: string | null;
441
+ leased: boolean;
442
+ }, {
443
+ status: "pending" | "alive" | "dead";
444
+ label: string | null;
445
+ leased: boolean;
446
+ }>, "many">;
447
+ limited: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
448
+ notLimited: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
449
+ divergent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
450
+ accounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
451
+ accountId: z.ZodNullable<z.ZodString>;
452
+ summary: z.ZodNullable<z.ZodString>;
453
+ resetsAt: z.ZodNullable<z.ZodString>;
454
+ }, "strip", z.ZodTypeAny, {
455
+ summary: string | null;
456
+ accountId: string | null;
457
+ resetsAt: string | null;
458
+ }, {
459
+ summary: string | null;
460
+ accountId: string | null;
461
+ resetsAt: string | null;
462
+ }>, "many">>>;
463
+ gateway: z.ZodOptional<z.ZodNullable<z.ZodObject<{
464
+ region: z.ZodString;
465
+ defaultModel: z.ZodString;
466
+ keyHint: z.ZodNullable<z.ZodString>;
467
+ testedAt: z.ZodNullable<z.ZodString>;
468
+ models: z.ZodArray<z.ZodObject<{
469
+ id: z.ZodString;
470
+ label: z.ZodString;
471
+ status: z.ZodEnum<["untested", "ok", "failed"]>;
472
+ reason: z.ZodNullable<z.ZodString>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ status: "failed" | "untested" | "ok";
475
+ reason: string | null;
476
+ id: string;
477
+ label: string;
478
+ }, {
479
+ status: "failed" | "untested" | "ok";
480
+ reason: string | null;
481
+ id: string;
482
+ label: string;
483
+ }>, "many">;
484
+ }, "strip", z.ZodTypeAny, {
485
+ region: string;
486
+ defaultModel: string;
487
+ keyHint: string | null;
488
+ testedAt: string | null;
489
+ models: {
490
+ status: "failed" | "untested" | "ok";
491
+ reason: string | null;
492
+ id: string;
493
+ label: string;
494
+ }[];
495
+ }, {
496
+ region: string;
497
+ defaultModel: string;
498
+ keyHint: string | null;
499
+ testedAt: string | null;
500
+ models: {
501
+ status: "failed" | "untested" | "ok";
502
+ reason: string | null;
503
+ id: string;
504
+ label: string;
505
+ }[];
506
+ }>>>;
507
+ }, "strip", z.ZodTypeAny, {
508
+ dead: number;
509
+ total: number;
510
+ inUse: number;
511
+ free: number;
512
+ usable: number;
513
+ seeds: {
514
+ status: "pending" | "alive" | "dead";
515
+ label: string | null;
516
+ leased: boolean;
517
+ }[];
518
+ accounts?: {
519
+ summary: string | null;
520
+ accountId: string | null;
521
+ resetsAt: string | null;
522
+ }[] | null | undefined;
523
+ limited?: number | null | undefined;
524
+ notLimited?: number | null | undefined;
525
+ divergent?: number | null | undefined;
526
+ gateway?: {
527
+ region: string;
528
+ defaultModel: string;
529
+ keyHint: string | null;
530
+ testedAt: string | null;
531
+ models: {
532
+ status: "failed" | "untested" | "ok";
533
+ reason: string | null;
534
+ id: string;
535
+ label: string;
536
+ }[];
537
+ } | null | undefined;
538
+ }, {
539
+ dead: number;
540
+ total: number;
541
+ inUse: number;
542
+ free: number;
543
+ usable: number;
544
+ seeds: {
545
+ status: "pending" | "alive" | "dead";
546
+ label: string | null;
547
+ leased: boolean;
548
+ }[];
549
+ accounts?: {
550
+ summary: string | null;
551
+ accountId: string | null;
552
+ resetsAt: string | null;
553
+ }[] | null | undefined;
554
+ limited?: number | null | undefined;
555
+ notLimited?: number | null | undefined;
556
+ divergent?: number | null | undefined;
557
+ gateway?: {
558
+ region: string;
559
+ defaultModel: string;
560
+ keyHint: string | null;
561
+ testedAt: string | null;
562
+ models: {
563
+ status: "failed" | "untested" | "ok";
564
+ reason: string | null;
565
+ id: string;
566
+ label: string;
567
+ }[];
568
+ } | null | undefined;
569
+ }>;
570
+ }, "strip", z.ZodTypeAny, {
571
+ name: string;
572
+ kind: string;
573
+ setup: "login" | "form";
574
+ capabilities: {
575
+ lease: boolean;
576
+ verify: boolean;
577
+ accounts: boolean;
578
+ usageGating: boolean;
579
+ signature: boolean;
580
+ };
581
+ regions: string[];
582
+ allowed: ("setup" | "configure" | "retest" | "bury-dead" | "remove-all" | "sort-out")[];
583
+ stats: {
584
+ dead: number;
585
+ total: number;
586
+ inUse: number;
587
+ free: number;
588
+ usable: number;
589
+ seeds: {
590
+ status: "pending" | "alive" | "dead";
591
+ label: string | null;
592
+ leased: boolean;
593
+ }[];
594
+ accounts?: {
595
+ summary: string | null;
596
+ accountId: string | null;
597
+ resetsAt: string | null;
598
+ }[] | null | undefined;
599
+ limited?: number | null | undefined;
600
+ notLimited?: number | null | undefined;
601
+ divergent?: number | null | undefined;
602
+ gateway?: {
603
+ region: string;
604
+ defaultModel: string;
605
+ keyHint: string | null;
606
+ testedAt: string | null;
607
+ models: {
608
+ status: "failed" | "untested" | "ok";
609
+ reason: string | null;
610
+ id: string;
611
+ label: string;
612
+ }[];
613
+ } | null | undefined;
614
+ };
615
+ }, {
616
+ name: string;
617
+ kind: string;
618
+ setup: "login" | "form";
619
+ capabilities: {
620
+ lease: boolean;
621
+ verify: boolean;
622
+ accounts: boolean;
623
+ usageGating: boolean;
624
+ signature: boolean;
625
+ };
626
+ regions: string[];
627
+ allowed: ("setup" | "configure" | "retest" | "bury-dead" | "remove-all" | "sort-out")[];
628
+ stats: {
629
+ dead: number;
630
+ total: number;
631
+ inUse: number;
632
+ free: number;
633
+ usable: number;
634
+ seeds: {
635
+ status: "pending" | "alive" | "dead";
636
+ label: string | null;
637
+ leased: boolean;
638
+ }[];
639
+ accounts?: {
640
+ summary: string | null;
641
+ accountId: string | null;
642
+ resetsAt: string | null;
643
+ }[] | null | undefined;
644
+ limited?: number | null | undefined;
645
+ notLimited?: number | null | undefined;
646
+ divergent?: number | null | undefined;
647
+ gateway?: {
648
+ region: string;
649
+ defaultModel: string;
650
+ keyHint: string | null;
651
+ testedAt: string | null;
652
+ models: {
653
+ status: "failed" | "untested" | "ok";
654
+ reason: string | null;
655
+ id: string;
656
+ label: string;
657
+ }[];
658
+ } | null | undefined;
659
+ };
660
+ }>;
661
+ export type PoolRow = z.infer<typeof PoolRowSchema>;
662
+ /** A frame of GET /api/pools/stream. */
663
+ export declare const PoolsStreamFrameSchema: z.ZodObject<{
664
+ type: z.ZodLiteral<"pools">;
665
+ owner: z.ZodString;
666
+ rows: z.ZodArray<z.ZodObject<{
667
+ kind: z.ZodString;
668
+ name: z.ZodString;
669
+ setup: z.ZodEnum<["login", "form"]>;
670
+ capabilities: z.ZodObject<{
671
+ lease: z.ZodBoolean;
672
+ verify: z.ZodBoolean;
673
+ accounts: z.ZodBoolean;
674
+ usageGating: z.ZodBoolean;
675
+ signature: z.ZodBoolean;
676
+ }, "strip", z.ZodTypeAny, {
677
+ lease: boolean;
678
+ verify: boolean;
679
+ accounts: boolean;
680
+ usageGating: boolean;
681
+ signature: boolean;
682
+ }, {
683
+ lease: boolean;
684
+ verify: boolean;
685
+ accounts: boolean;
686
+ usageGating: boolean;
687
+ signature: boolean;
688
+ }>;
689
+ regions: z.ZodArray<z.ZodString, "many">;
690
+ } & {
691
+ allowed: z.ZodArray<z.ZodEnum<["setup", "configure", "retest", "bury-dead", "remove-all", "sort-out"]>, "many">;
692
+ stats: z.ZodObject<{
693
+ total: z.ZodNumber;
694
+ dead: z.ZodNumber;
695
+ inUse: z.ZodNumber;
696
+ free: z.ZodNumber;
697
+ usable: z.ZodNumber;
698
+ seeds: z.ZodArray<z.ZodObject<{
699
+ label: z.ZodNullable<z.ZodString>;
700
+ status: z.ZodEnum<["pending", "alive", "dead"]>;
701
+ leased: z.ZodBoolean;
702
+ }, "strip", z.ZodTypeAny, {
703
+ status: "pending" | "alive" | "dead";
704
+ label: string | null;
705
+ leased: boolean;
706
+ }, {
707
+ status: "pending" | "alive" | "dead";
708
+ label: string | null;
709
+ leased: boolean;
710
+ }>, "many">;
711
+ limited: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
712
+ notLimited: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
713
+ divergent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
714
+ accounts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
715
+ accountId: z.ZodNullable<z.ZodString>;
716
+ summary: z.ZodNullable<z.ZodString>;
717
+ resetsAt: z.ZodNullable<z.ZodString>;
718
+ }, "strip", z.ZodTypeAny, {
719
+ summary: string | null;
720
+ accountId: string | null;
721
+ resetsAt: string | null;
722
+ }, {
723
+ summary: string | null;
724
+ accountId: string | null;
725
+ resetsAt: string | null;
726
+ }>, "many">>>;
727
+ gateway: z.ZodOptional<z.ZodNullable<z.ZodObject<{
728
+ region: z.ZodString;
729
+ defaultModel: z.ZodString;
730
+ keyHint: z.ZodNullable<z.ZodString>;
731
+ testedAt: z.ZodNullable<z.ZodString>;
732
+ models: z.ZodArray<z.ZodObject<{
733
+ id: z.ZodString;
734
+ label: z.ZodString;
735
+ status: z.ZodEnum<["untested", "ok", "failed"]>;
736
+ reason: z.ZodNullable<z.ZodString>;
737
+ }, "strip", z.ZodTypeAny, {
738
+ status: "failed" | "untested" | "ok";
739
+ reason: string | null;
740
+ id: string;
741
+ label: string;
742
+ }, {
743
+ status: "failed" | "untested" | "ok";
744
+ reason: string | null;
745
+ id: string;
746
+ label: string;
747
+ }>, "many">;
748
+ }, "strip", z.ZodTypeAny, {
749
+ region: string;
750
+ defaultModel: string;
751
+ keyHint: string | null;
752
+ testedAt: string | null;
753
+ models: {
754
+ status: "failed" | "untested" | "ok";
755
+ reason: string | null;
756
+ id: string;
757
+ label: string;
758
+ }[];
759
+ }, {
760
+ region: string;
761
+ defaultModel: string;
762
+ keyHint: string | null;
763
+ testedAt: string | null;
764
+ models: {
765
+ status: "failed" | "untested" | "ok";
766
+ reason: string | null;
767
+ id: string;
768
+ label: string;
769
+ }[];
770
+ }>>>;
771
+ }, "strip", z.ZodTypeAny, {
772
+ dead: number;
773
+ total: number;
774
+ inUse: number;
775
+ free: number;
776
+ usable: number;
777
+ seeds: {
778
+ status: "pending" | "alive" | "dead";
779
+ label: string | null;
780
+ leased: boolean;
781
+ }[];
782
+ accounts?: {
783
+ summary: string | null;
784
+ accountId: string | null;
785
+ resetsAt: string | null;
786
+ }[] | null | undefined;
787
+ limited?: number | null | undefined;
788
+ notLimited?: number | null | undefined;
789
+ divergent?: number | null | undefined;
790
+ gateway?: {
791
+ region: string;
792
+ defaultModel: string;
793
+ keyHint: string | null;
794
+ testedAt: string | null;
795
+ models: {
796
+ status: "failed" | "untested" | "ok";
797
+ reason: string | null;
798
+ id: string;
799
+ label: string;
800
+ }[];
801
+ } | null | undefined;
802
+ }, {
803
+ dead: number;
804
+ total: number;
805
+ inUse: number;
806
+ free: number;
807
+ usable: number;
808
+ seeds: {
809
+ status: "pending" | "alive" | "dead";
810
+ label: string | null;
811
+ leased: boolean;
812
+ }[];
813
+ accounts?: {
814
+ summary: string | null;
815
+ accountId: string | null;
816
+ resetsAt: string | null;
817
+ }[] | null | undefined;
818
+ limited?: number | null | undefined;
819
+ notLimited?: number | null | undefined;
820
+ divergent?: number | null | undefined;
821
+ gateway?: {
822
+ region: string;
823
+ defaultModel: string;
824
+ keyHint: string | null;
825
+ testedAt: string | null;
826
+ models: {
827
+ status: "failed" | "untested" | "ok";
828
+ reason: string | null;
829
+ id: string;
830
+ label: string;
831
+ }[];
832
+ } | null | undefined;
833
+ }>;
834
+ }, "strip", z.ZodTypeAny, {
835
+ name: string;
836
+ kind: string;
837
+ setup: "login" | "form";
838
+ capabilities: {
839
+ lease: boolean;
840
+ verify: boolean;
841
+ accounts: boolean;
842
+ usageGating: boolean;
843
+ signature: boolean;
844
+ };
845
+ regions: string[];
846
+ allowed: ("setup" | "configure" | "retest" | "bury-dead" | "remove-all" | "sort-out")[];
847
+ stats: {
848
+ dead: number;
849
+ total: number;
850
+ inUse: number;
851
+ free: number;
852
+ usable: number;
853
+ seeds: {
854
+ status: "pending" | "alive" | "dead";
855
+ label: string | null;
856
+ leased: boolean;
857
+ }[];
858
+ accounts?: {
859
+ summary: string | null;
860
+ accountId: string | null;
861
+ resetsAt: string | null;
862
+ }[] | null | undefined;
863
+ limited?: number | null | undefined;
864
+ notLimited?: number | null | undefined;
865
+ divergent?: number | null | undefined;
866
+ gateway?: {
867
+ region: string;
868
+ defaultModel: string;
869
+ keyHint: string | null;
870
+ testedAt: string | null;
871
+ models: {
872
+ status: "failed" | "untested" | "ok";
873
+ reason: string | null;
874
+ id: string;
875
+ label: string;
876
+ }[];
877
+ } | null | undefined;
878
+ };
879
+ }, {
880
+ name: string;
881
+ kind: string;
882
+ setup: "login" | "form";
883
+ capabilities: {
884
+ lease: boolean;
885
+ verify: boolean;
886
+ accounts: boolean;
887
+ usageGating: boolean;
888
+ signature: boolean;
889
+ };
890
+ regions: string[];
891
+ allowed: ("setup" | "configure" | "retest" | "bury-dead" | "remove-all" | "sort-out")[];
892
+ stats: {
893
+ dead: number;
894
+ total: number;
895
+ inUse: number;
896
+ free: number;
897
+ usable: number;
898
+ seeds: {
899
+ status: "pending" | "alive" | "dead";
900
+ label: string | null;
901
+ leased: boolean;
902
+ }[];
903
+ accounts?: {
904
+ summary: string | null;
905
+ accountId: string | null;
906
+ resetsAt: string | null;
907
+ }[] | null | undefined;
908
+ limited?: number | null | undefined;
909
+ notLimited?: number | null | undefined;
910
+ divergent?: number | null | undefined;
911
+ gateway?: {
912
+ region: string;
913
+ defaultModel: string;
914
+ keyHint: string | null;
915
+ testedAt: string | null;
916
+ models: {
917
+ status: "failed" | "untested" | "ok";
918
+ reason: string | null;
919
+ id: string;
920
+ label: string;
921
+ }[];
922
+ } | null | undefined;
923
+ };
924
+ }>, "many">;
925
+ }, "strip", z.ZodTypeAny, {
926
+ type: "pools";
927
+ owner: string;
928
+ rows: {
929
+ name: string;
930
+ kind: string;
931
+ setup: "login" | "form";
932
+ capabilities: {
933
+ lease: boolean;
934
+ verify: boolean;
935
+ accounts: boolean;
936
+ usageGating: boolean;
937
+ signature: boolean;
938
+ };
939
+ regions: string[];
940
+ allowed: ("setup" | "configure" | "retest" | "bury-dead" | "remove-all" | "sort-out")[];
941
+ stats: {
942
+ dead: number;
943
+ total: number;
944
+ inUse: number;
945
+ free: number;
946
+ usable: number;
947
+ seeds: {
948
+ status: "pending" | "alive" | "dead";
949
+ label: string | null;
950
+ leased: boolean;
951
+ }[];
952
+ accounts?: {
953
+ summary: string | null;
954
+ accountId: string | null;
955
+ resetsAt: string | null;
956
+ }[] | null | undefined;
957
+ limited?: number | null | undefined;
958
+ notLimited?: number | null | undefined;
959
+ divergent?: number | null | undefined;
960
+ gateway?: {
961
+ region: string;
962
+ defaultModel: string;
963
+ keyHint: string | null;
964
+ testedAt: string | null;
965
+ models: {
966
+ status: "failed" | "untested" | "ok";
967
+ reason: string | null;
968
+ id: string;
969
+ label: string;
970
+ }[];
971
+ } | null | undefined;
972
+ };
973
+ }[];
974
+ }, {
975
+ type: "pools";
976
+ owner: string;
977
+ rows: {
978
+ name: string;
979
+ kind: string;
980
+ setup: "login" | "form";
981
+ capabilities: {
982
+ lease: boolean;
983
+ verify: boolean;
984
+ accounts: boolean;
985
+ usageGating: boolean;
986
+ signature: boolean;
987
+ };
988
+ regions: string[];
989
+ allowed: ("setup" | "configure" | "retest" | "bury-dead" | "remove-all" | "sort-out")[];
990
+ stats: {
991
+ dead: number;
992
+ total: number;
993
+ inUse: number;
994
+ free: number;
995
+ usable: number;
996
+ seeds: {
997
+ status: "pending" | "alive" | "dead";
998
+ label: string | null;
999
+ leased: boolean;
1000
+ }[];
1001
+ accounts?: {
1002
+ summary: string | null;
1003
+ accountId: string | null;
1004
+ resetsAt: string | null;
1005
+ }[] | null | undefined;
1006
+ limited?: number | null | undefined;
1007
+ notLimited?: number | null | undefined;
1008
+ divergent?: number | null | undefined;
1009
+ gateway?: {
1010
+ region: string;
1011
+ defaultModel: string;
1012
+ keyHint: string | null;
1013
+ testedAt: string | null;
1014
+ models: {
1015
+ status: "failed" | "untested" | "ok";
1016
+ reason: string | null;
1017
+ id: string;
1018
+ label: string;
1019
+ }[];
1020
+ } | null | undefined;
1021
+ };
1022
+ }[];
1023
+ }>;
1024
+ export type PoolsStreamFrame = z.infer<typeof PoolsStreamFrameSchema>;
1025
+ /** Every pool route's query: the optio instance, and the owner a UI asks for. */
1026
+ export declare const PoolsQuerySchema: z.ZodObject<{
1027
+ database: z.ZodOptional<z.ZodString>;
1028
+ prefix: z.ZodOptional<z.ZodString>;
1029
+ owner: z.ZodOptional<z.ZodString>;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ database?: string | undefined;
1032
+ prefix?: string | undefined;
1033
+ owner?: string | undefined;
1034
+ }, {
1035
+ database?: string | undefined;
1036
+ prefix?: string | undefined;
1037
+ owner?: string | undefined;
1038
+ }>;
1039
+ export type PoolsQuery = z.infer<typeof PoolsQuerySchema>;
1040
+ /** The gateway model list's body. No `apiKey` (or a blank one): the stored configuration's key. */
1041
+ export declare const GatewayModelsBodySchema: z.ZodObject<{
1042
+ apiKey: z.ZodOptional<z.ZodString>;
1043
+ region: z.ZodString;
1044
+ }, "strip", z.ZodTypeAny, {
1045
+ region: string;
1046
+ apiKey?: string | undefined;
1047
+ }, {
1048
+ region: string;
1049
+ apiKey?: string | undefined;
1050
+ }>;
1051
+ export type GatewayModelsBody = z.infer<typeof GatewayModelsBodySchema>;
1052
+ /** The gateway configuration's body: the ticked models (at least one) and the default among them. */
1053
+ export declare const GatewayConfigureBodySchema: z.ZodObject<{
1054
+ apiKey: z.ZodOptional<z.ZodString>;
1055
+ region: z.ZodString;
1056
+ } & {
1057
+ models: z.ZodArray<z.ZodString, "many">;
1058
+ defaultModel: z.ZodString;
1059
+ }, "strip", z.ZodTypeAny, {
1060
+ region: string;
1061
+ defaultModel: string;
1062
+ models: string[];
1063
+ apiKey?: string | undefined;
1064
+ }, {
1065
+ region: string;
1066
+ defaultModel: string;
1067
+ models: string[];
1068
+ apiKey?: string | undefined;
1069
+ }>;
1070
+ export type GatewayConfigureBody = z.infer<typeof GatewayConfigureBodySchema>;
1071
+ //# sourceMappingURL=schemas.d.ts.map