@crewhaus/spec 0.1.7 → 0.2.0

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 (3) hide show
  1. package/dist/index.d.ts +2798 -187
  2. package/dist/index.js +255 -1
  3. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -65,6 +65,93 @@ declare const subAgentDefinitionSchema: z.ZodObject<{
65
65
  } | undefined;
66
66
  inherit_bypass?: boolean | undefined;
67
67
  }>;
68
+ /**
69
+ * Item 22 — spec-declared provider failover chain, on the agent blocks of
70
+ * the shapes whose emitted runtime calls `runChatLoop` with a single
71
+ * primary model (cli, channel, managed today).
72
+ *
73
+ * `model_fallbacks` is an ordered list of model strings tried when the
74
+ * primary's circuit breaker is open — each entry follows the SAME
75
+ * model-string grammar as `agent.model` (`claude-*`, `openai/*`,
76
+ * `bedrock/*`, `groq/*`, …; validated like `agent.model` at parse time,
77
+ * with the full grammar enforced by the model-router when resolved).
78
+ * Cross-provider fallbacks resolve their own credentials lazily via the
79
+ * normal model-router path — a fallback with a missing key warns at boot
80
+ * and is skipped when tried, never hard-failing the run.
81
+ *
82
+ * `circuit_breaker` tunes the per-candidate breakers. Field names mirror
83
+ * `CircuitBreakerOptions` in `@crewhaus/circuit-breaker` exactly
84
+ * (failureThreshold / windowMs / cooldownMs); package defaults (5 failures
85
+ * / 60s window / 30s cooldown) apply per field when omitted. Declaring
86
+ * `circuit_breaker` WITHOUT `model_fallbacks` is valid: the primary
87
+ * adapter alone gets breaker-wrapped (fail-fast on a degraded provider
88
+ * instead of hammering it).
89
+ */
90
+ declare const modelFallbacksBlock: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
91
+ declare const circuitBreakerBlock: z.ZodOptional<z.ZodObject<{
92
+ /** Consecutive failures inside windowMs that trip the breaker. */
93
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
94
+ /** Window for counting consecutive failures (ms). */
95
+ windowMs: z.ZodOptional<z.ZodNumber>;
96
+ /** How long the breaker stays open before allowing a probe (ms). */
97
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
98
+ }, "strict", z.ZodTypeAny, {
99
+ failureThreshold?: number | undefined;
100
+ windowMs?: number | undefined;
101
+ cooldownMs?: number | undefined;
102
+ }, {
103
+ failureThreshold?: number | undefined;
104
+ windowMs?: number | undefined;
105
+ cooldownMs?: number | undefined;
106
+ }>>;
107
+ /**
108
+ * Item 26 — opt-in two-tier turn-difficulty router. When present, the runtime
109
+ * picks a model tier PER TURN from deterministic signals (estimated context
110
+ * tokens, whether tools are in play, turn index, prior-turn tool_use density):
111
+ * the cheap `fast` model for easy turns, the `default` model for hard ones. A
112
+ * fast-tier turn that FAILS re-runs on `default` (misroute recovery). Both are
113
+ * full model-router grammar strings. `routing` tunes the escalation thresholds
114
+ * (all optional — sensible defaults apply). Omitted entirely → single-model
115
+ * behaviour, byte-identical bundles.
116
+ */
117
+ declare const modelTiersBlock: z.ZodOptional<z.ZodObject<{
118
+ fast: z.ZodString;
119
+ default: z.ZodString;
120
+ routing: z.ZodOptional<z.ZodObject<{
121
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
122
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
123
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
124
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
125
+ }, "strict", z.ZodTypeAny, {
126
+ contextTokenThreshold?: number | undefined;
127
+ toolsToDefault?: boolean | undefined;
128
+ firstTurnToDefault?: boolean | undefined;
129
+ priorToolDensityThreshold?: number | undefined;
130
+ }, {
131
+ contextTokenThreshold?: number | undefined;
132
+ toolsToDefault?: boolean | undefined;
133
+ firstTurnToDefault?: boolean | undefined;
134
+ priorToolDensityThreshold?: number | undefined;
135
+ }>>;
136
+ }, "strict", z.ZodTypeAny, {
137
+ default: string;
138
+ fast: string;
139
+ routing?: {
140
+ contextTokenThreshold?: number | undefined;
141
+ toolsToDefault?: boolean | undefined;
142
+ firstTurnToDefault?: boolean | undefined;
143
+ priorToolDensityThreshold?: number | undefined;
144
+ } | undefined;
145
+ }, {
146
+ default: string;
147
+ fast: string;
148
+ routing?: {
149
+ contextTokenThreshold?: number | undefined;
150
+ toolsToDefault?: boolean | undefined;
151
+ firstTurnToDefault?: boolean | undefined;
152
+ priorToolDensityThreshold?: number | undefined;
153
+ } | undefined;
154
+ }>>;
68
155
  /**
69
156
  * Section 17 — optional override for the model used by
70
157
  * `compaction-autocompact` when summarising long conversations. Defaults
@@ -185,42 +272,237 @@ declare const securityBlock: z.ZodOptional<z.ZodObject<{
185
272
  declare const failureTaxonomyEntrySchema: z.ZodObject<{
186
273
  class: z.ZodString;
187
274
  pattern: z.ZodString;
188
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
275
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
189
276
  hint: z.ZodOptional<z.ZodString>;
190
277
  }, "strict", z.ZodTypeAny, {
191
278
  pattern: string;
192
279
  class: string;
193
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
280
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
194
281
  hint?: string | undefined;
195
282
  }, {
196
283
  pattern: string;
197
284
  class: string;
198
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
285
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
199
286
  hint?: string | undefined;
200
287
  }>;
201
288
  declare const failureTaxonomyBlock: z.ZodOptional<z.ZodArray<z.ZodObject<{
202
289
  class: z.ZodString;
203
290
  pattern: z.ZodString;
204
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
291
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
205
292
  hint: z.ZodOptional<z.ZodString>;
206
293
  }, "strict", z.ZodTypeAny, {
207
294
  pattern: string;
208
295
  class: string;
209
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
296
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
210
297
  hint?: string | undefined;
211
298
  }, {
212
299
  pattern: string;
213
300
  class: string;
214
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
301
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
215
302
  hint?: string | undefined;
216
303
  }>, "many">>;
304
+ /**
305
+ * Item 27 — run-level spend cap with a degradation ladder. Generalizes the
306
+ * optimizer's `--budget-usd` to normal runs. `usd` is the dollar ceiling;
307
+ * when the run's accrued spend reaches it, `on_exceed` decides:
308
+ * - `{ action: "stop" }` — end the run cleanly before the next turn.
309
+ * - `{ action: "degrade", model }` — re-resolve the primary model to the
310
+ * cheaper `model` (one rung) and continue; a later breach on the
311
+ * degraded model stops the run.
312
+ * The check is PRE-TURN (beside compaction), so an in-flight turn always
313
+ * completes. Carried on the same interactive shapes as the failover chain
314
+ * (cli, channel, managed). `on_exceed.model` follows the agent.model
315
+ * grammar. Defaults to `{ action: "stop" }` when `on_exceed` is omitted.
316
+ */
317
+ declare const budgetBlock: z.ZodOptional<z.ZodObject<{
318
+ usd: z.ZodNumber;
319
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
320
+ action: z.ZodLiteral<"stop">;
321
+ }, "strict", z.ZodTypeAny, {
322
+ action: "stop";
323
+ }, {
324
+ action: "stop";
325
+ }>, z.ZodObject<{
326
+ action: z.ZodLiteral<"degrade">;
327
+ model: z.ZodString;
328
+ }, "strict", z.ZodTypeAny, {
329
+ model: string;
330
+ action: "degrade";
331
+ }, {
332
+ model: string;
333
+ action: "degrade";
334
+ }>]>>;
335
+ }, "strict", z.ZodTypeAny, {
336
+ usd: number;
337
+ on_exceed: {
338
+ action: "stop";
339
+ } | {
340
+ model: string;
341
+ action: "degrade";
342
+ };
343
+ }, {
344
+ usd: number;
345
+ on_exceed?: {
346
+ action: "stop";
347
+ } | {
348
+ model: string;
349
+ action: "degrade";
350
+ } | undefined;
351
+ }>>;
352
+ /**
353
+ * Response-feedback block — declares that a harness collects human ratings on
354
+ * agent responses (thumbs/stars/scale/comment) which `crewhaus distill` turns
355
+ * into eval datasets + graders. Cross-cutting like security: carried on the
356
+ * interactive shapes that consume it (cli, channel). `channelReactions` gates
357
+ * codegen of Slack 👍/👎 → feedback in the channel target; `modality`/`storage`
358
+ * configure the capture surfaces; `autoDistill` turns accumulated ratings into
359
+ * versioned `<name>-ratings` registry datasets at CLI run teardown (item 1);
360
+ * `exitPrompt` gates the one-keystroke REPL exit rating prompt (default on
361
+ * when the block is present; set `false` to keep capture surfaces without the
362
+ * prompt). `.strict()` so a typo'd sub-key fails the build.
363
+ */
364
+ declare const feedbackBlock: z.ZodOptional<z.ZodObject<{
365
+ enabled: z.ZodOptional<z.ZodBoolean>;
366
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
367
+ scale: z.ZodOptional<z.ZodObject<{
368
+ min: z.ZodNumber;
369
+ max: z.ZodNumber;
370
+ }, "strict", z.ZodTypeAny, {
371
+ min: number;
372
+ max: number;
373
+ }, {
374
+ min: number;
375
+ max: number;
376
+ }>>;
377
+ storage: z.ZodOptional<z.ZodObject<{
378
+ location: z.ZodString;
379
+ }, "strict", z.ZodTypeAny, {
380
+ location: string;
381
+ }, {
382
+ location: string;
383
+ }>>;
384
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
385
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
386
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
387
+ }, "strict", z.ZodTypeAny, {
388
+ modality: "binary" | "stars" | "scale" | "comment";
389
+ enabled?: boolean | undefined;
390
+ scale?: {
391
+ min: number;
392
+ max: number;
393
+ } | undefined;
394
+ storage?: {
395
+ location: string;
396
+ } | undefined;
397
+ autoDistill?: boolean | undefined;
398
+ exitPrompt?: boolean | undefined;
399
+ channelReactions?: boolean | undefined;
400
+ }, {
401
+ enabled?: boolean | undefined;
402
+ scale?: {
403
+ min: number;
404
+ max: number;
405
+ } | undefined;
406
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
407
+ storage?: {
408
+ location: string;
409
+ } | undefined;
410
+ autoDistill?: boolean | undefined;
411
+ exitPrompt?: boolean | undefined;
412
+ channelReactions?: boolean | undefined;
413
+ }>>;
414
+ /**
415
+ * Feature #53 — cross-session memory block. Its mere presence wires the
416
+ * Remember/Recall tools into the harness (no hand-editing). The auto-*
417
+ * switches layer on top: `autoCapture` summarizes the session's durable
418
+ * outcomes into `.crewhaus/memories/<name>.jsonl` at run teardown;
419
+ * `autoRecall` injects the top-`recallK` relevant memories into the system
420
+ * prompt at session start (mirrors project-memory auto-load). Carried on the
421
+ * interactive shapes that run a chat loop (cli, channel, managed, research).
422
+ * `.strict()` so a typo'd sub-key fails the build.
423
+ */
424
+ declare const memoryBlock: z.ZodOptional<z.ZodObject<{
425
+ enabled: z.ZodOptional<z.ZodBoolean>;
426
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
427
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
428
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
429
+ recallK: z.ZodOptional<z.ZodNumber>;
430
+ }, "strict", z.ZodTypeAny, {
431
+ enabled?: boolean | undefined;
432
+ autoCapture?: boolean | undefined;
433
+ autoCaptureThreshold?: number | undefined;
434
+ autoRecall?: boolean | undefined;
435
+ recallK?: number | undefined;
436
+ }, {
437
+ enabled?: boolean | undefined;
438
+ autoCapture?: boolean | undefined;
439
+ autoCaptureThreshold?: number | undefined;
440
+ autoRecall?: boolean | undefined;
441
+ recallK?: number | undefined;
442
+ }>>;
217
443
  declare const cliSchema: z.ZodObject<{
218
444
  name: z.ZodString;
445
+ version: z.ZodOptional<z.ZodNumber>;
219
446
  target: z.ZodLiteral<"cli">;
220
447
  agent: z.ZodObject<{
221
448
  model: z.ZodString;
222
449
  instructions: z.ZodString;
223
450
  max_tokens: z.ZodOptional<z.ZodNumber>;
451
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
452
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
453
+ /** Consecutive failures inside windowMs that trip the breaker. */
454
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
455
+ /** Window for counting consecutive failures (ms). */
456
+ windowMs: z.ZodOptional<z.ZodNumber>;
457
+ /** How long the breaker stays open before allowing a probe (ms). */
458
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
459
+ }, "strict", z.ZodTypeAny, {
460
+ failureThreshold?: number | undefined;
461
+ windowMs?: number | undefined;
462
+ cooldownMs?: number | undefined;
463
+ }, {
464
+ failureThreshold?: number | undefined;
465
+ windowMs?: number | undefined;
466
+ cooldownMs?: number | undefined;
467
+ }>>;
468
+ model_tiers: z.ZodOptional<z.ZodObject<{
469
+ fast: z.ZodString;
470
+ default: z.ZodString;
471
+ routing: z.ZodOptional<z.ZodObject<{
472
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
473
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
474
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
475
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
476
+ }, "strict", z.ZodTypeAny, {
477
+ contextTokenThreshold?: number | undefined;
478
+ toolsToDefault?: boolean | undefined;
479
+ firstTurnToDefault?: boolean | undefined;
480
+ priorToolDensityThreshold?: number | undefined;
481
+ }, {
482
+ contextTokenThreshold?: number | undefined;
483
+ toolsToDefault?: boolean | undefined;
484
+ firstTurnToDefault?: boolean | undefined;
485
+ priorToolDensityThreshold?: number | undefined;
486
+ }>>;
487
+ }, "strict", z.ZodTypeAny, {
488
+ default: string;
489
+ fast: string;
490
+ routing?: {
491
+ contextTokenThreshold?: number | undefined;
492
+ toolsToDefault?: boolean | undefined;
493
+ firstTurnToDefault?: boolean | undefined;
494
+ priorToolDensityThreshold?: number | undefined;
495
+ } | undefined;
496
+ }, {
497
+ default: string;
498
+ fast: string;
499
+ routing?: {
500
+ contextTokenThreshold?: number | undefined;
501
+ toolsToDefault?: boolean | undefined;
502
+ firstTurnToDefault?: boolean | undefined;
503
+ priorToolDensityThreshold?: number | undefined;
504
+ } | undefined;
505
+ }>>;
224
506
  sub_agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
225
507
  description: z.ZodString;
226
508
  instructions: z.ZodString;
@@ -262,6 +544,22 @@ declare const cliSchema: z.ZodObject<{
262
544
  instructions: string;
263
545
  model: string;
264
546
  max_tokens?: number | undefined;
547
+ model_fallbacks?: string[] | undefined;
548
+ circuit_breaker?: {
549
+ failureThreshold?: number | undefined;
550
+ windowMs?: number | undefined;
551
+ cooldownMs?: number | undefined;
552
+ } | undefined;
553
+ model_tiers?: {
554
+ default: string;
555
+ fast: string;
556
+ routing?: {
557
+ contextTokenThreshold?: number | undefined;
558
+ toolsToDefault?: boolean | undefined;
559
+ firstTurnToDefault?: boolean | undefined;
560
+ priorToolDensityThreshold?: number | undefined;
561
+ } | undefined;
562
+ } | undefined;
265
563
  sub_agents?: Record<string, {
266
564
  description: string;
267
565
  instructions: string;
@@ -277,6 +575,22 @@ declare const cliSchema: z.ZodObject<{
277
575
  instructions: string;
278
576
  model: string;
279
577
  max_tokens?: number | undefined;
578
+ model_fallbacks?: string[] | undefined;
579
+ circuit_breaker?: {
580
+ failureThreshold?: number | undefined;
581
+ windowMs?: number | undefined;
582
+ cooldownMs?: number | undefined;
583
+ } | undefined;
584
+ model_tiers?: {
585
+ default: string;
586
+ fast: string;
587
+ routing?: {
588
+ contextTokenThreshold?: number | undefined;
589
+ toolsToDefault?: boolean | undefined;
590
+ firstTurnToDefault?: boolean | undefined;
591
+ priorToolDensityThreshold?: number | undefined;
592
+ } | undefined;
593
+ } | undefined;
280
594
  sub_agents?: Record<string, {
281
595
  description: string;
282
596
  instructions: string;
@@ -426,19 +740,201 @@ declare const cliSchema: z.ZodObject<{
426
740
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
427
741
  class: z.ZodString;
428
742
  pattern: z.ZodString;
429
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
743
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
430
744
  hint: z.ZodOptional<z.ZodString>;
431
745
  }, "strict", z.ZodTypeAny, {
432
746
  pattern: string;
433
747
  class: string;
434
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
748
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
435
749
  hint?: string | undefined;
436
750
  }, {
437
751
  pattern: string;
438
752
  class: string;
439
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
753
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
440
754
  hint?: string | undefined;
441
755
  }>, "many">>;
756
+ budget: z.ZodOptional<z.ZodObject<{
757
+ usd: z.ZodNumber;
758
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
759
+ action: z.ZodLiteral<"stop">;
760
+ }, "strict", z.ZodTypeAny, {
761
+ action: "stop";
762
+ }, {
763
+ action: "stop";
764
+ }>, z.ZodObject<{
765
+ action: z.ZodLiteral<"degrade">;
766
+ model: z.ZodString;
767
+ }, "strict", z.ZodTypeAny, {
768
+ model: string;
769
+ action: "degrade";
770
+ }, {
771
+ model: string;
772
+ action: "degrade";
773
+ }>]>>;
774
+ }, "strict", z.ZodTypeAny, {
775
+ usd: number;
776
+ on_exceed: {
777
+ action: "stop";
778
+ } | {
779
+ model: string;
780
+ action: "degrade";
781
+ };
782
+ }, {
783
+ usd: number;
784
+ on_exceed?: {
785
+ action: "stop";
786
+ } | {
787
+ model: string;
788
+ action: "degrade";
789
+ } | undefined;
790
+ }>>;
791
+ feedback: z.ZodOptional<z.ZodObject<{
792
+ enabled: z.ZodOptional<z.ZodBoolean>;
793
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
794
+ scale: z.ZodOptional<z.ZodObject<{
795
+ min: z.ZodNumber;
796
+ max: z.ZodNumber;
797
+ }, "strict", z.ZodTypeAny, {
798
+ min: number;
799
+ max: number;
800
+ }, {
801
+ min: number;
802
+ max: number;
803
+ }>>;
804
+ storage: z.ZodOptional<z.ZodObject<{
805
+ location: z.ZodString;
806
+ }, "strict", z.ZodTypeAny, {
807
+ location: string;
808
+ }, {
809
+ location: string;
810
+ }>>;
811
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
812
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
813
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
814
+ }, "strict", z.ZodTypeAny, {
815
+ modality: "binary" | "stars" | "scale" | "comment";
816
+ enabled?: boolean | undefined;
817
+ scale?: {
818
+ min: number;
819
+ max: number;
820
+ } | undefined;
821
+ storage?: {
822
+ location: string;
823
+ } | undefined;
824
+ autoDistill?: boolean | undefined;
825
+ exitPrompt?: boolean | undefined;
826
+ channelReactions?: boolean | undefined;
827
+ }, {
828
+ enabled?: boolean | undefined;
829
+ scale?: {
830
+ min: number;
831
+ max: number;
832
+ } | undefined;
833
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
834
+ storage?: {
835
+ location: string;
836
+ } | undefined;
837
+ autoDistill?: boolean | undefined;
838
+ exitPrompt?: boolean | undefined;
839
+ channelReactions?: boolean | undefined;
840
+ }>>;
841
+ memory: z.ZodOptional<z.ZodObject<{
842
+ enabled: z.ZodOptional<z.ZodBoolean>;
843
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
844
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
845
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
846
+ recallK: z.ZodOptional<z.ZodNumber>;
847
+ }, "strict", z.ZodTypeAny, {
848
+ enabled?: boolean | undefined;
849
+ autoCapture?: boolean | undefined;
850
+ autoCaptureThreshold?: number | undefined;
851
+ autoRecall?: boolean | undefined;
852
+ recallK?: number | undefined;
853
+ }, {
854
+ enabled?: boolean | undefined;
855
+ autoCapture?: boolean | undefined;
856
+ autoCaptureThreshold?: number | undefined;
857
+ autoRecall?: boolean | undefined;
858
+ recallK?: number | undefined;
859
+ }>>;
860
+ observability: z.ZodOptional<z.ZodObject<{
861
+ slo: z.ZodOptional<z.ZodEffects<z.ZodObject<{
862
+ /** Fractional error rate ceiling (unrecovered errors / model calls), e.g. 0.05. */
863
+ error_rate: z.ZodOptional<z.ZodNumber>;
864
+ /** p95 per-turn latency ceiling, milliseconds. */
865
+ p95_latency_ms: z.ZodOptional<z.ZodNumber>;
866
+ /** p95 time-to-first-token ceiling, milliseconds. */
867
+ ttft_ms: z.ZodOptional<z.ZodNumber>;
868
+ /** Cost burn ceiling, USD per hour of wall-clock. */
869
+ cost_per_hour_usd: z.ZodOptional<z.ZodNumber>;
870
+ /** Fractional egress-block rate ceiling (egress-blocked / external calls), e.g. 0.1. */
871
+ egress_block_rate: z.ZodOptional<z.ZodNumber>;
872
+ /**
873
+ * Rolling window (seconds) a breach must persist before the ladder fires.
874
+ * A single blip never mitigates — the monitor only acts on a SUSTAINED
875
+ * breach across this window. Default 300s (5 min).
876
+ */
877
+ window_seconds: z.ZodOptional<z.ZodNumber>;
878
+ /**
879
+ * Mitigation ladder, walked in declared order on a sustained breach. Each
880
+ * rung is executed at most once per session. `alert` is always safe;
881
+ * `pause-intake` / `rollback` touch traffic + deploys so they are opt-in.
882
+ */
883
+ mitigation: z.ZodOptional<z.ZodArray<z.ZodEnum<["alert", "pause-intake", "rollback"]>, "atleastone">>;
884
+ }, "strict", z.ZodTypeAny, {
885
+ error_rate?: number | undefined;
886
+ p95_latency_ms?: number | undefined;
887
+ ttft_ms?: number | undefined;
888
+ cost_per_hour_usd?: number | undefined;
889
+ egress_block_rate?: number | undefined;
890
+ window_seconds?: number | undefined;
891
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
892
+ }, {
893
+ error_rate?: number | undefined;
894
+ p95_latency_ms?: number | undefined;
895
+ ttft_ms?: number | undefined;
896
+ cost_per_hour_usd?: number | undefined;
897
+ egress_block_rate?: number | undefined;
898
+ window_seconds?: number | undefined;
899
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
900
+ }>, {
901
+ error_rate?: number | undefined;
902
+ p95_latency_ms?: number | undefined;
903
+ ttft_ms?: number | undefined;
904
+ cost_per_hour_usd?: number | undefined;
905
+ egress_block_rate?: number | undefined;
906
+ window_seconds?: number | undefined;
907
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
908
+ }, {
909
+ error_rate?: number | undefined;
910
+ p95_latency_ms?: number | undefined;
911
+ ttft_ms?: number | undefined;
912
+ cost_per_hour_usd?: number | undefined;
913
+ egress_block_rate?: number | undefined;
914
+ window_seconds?: number | undefined;
915
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
916
+ }>>;
917
+ }, "strict", z.ZodTypeAny, {
918
+ slo?: {
919
+ error_rate?: number | undefined;
920
+ p95_latency_ms?: number | undefined;
921
+ ttft_ms?: number | undefined;
922
+ cost_per_hour_usd?: number | undefined;
923
+ egress_block_rate?: number | undefined;
924
+ window_seconds?: number | undefined;
925
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
926
+ } | undefined;
927
+ }, {
928
+ slo?: {
929
+ error_rate?: number | undefined;
930
+ p95_latency_ms?: number | undefined;
931
+ ttft_ms?: number | undefined;
932
+ cost_per_hour_usd?: number | undefined;
933
+ egress_block_rate?: number | undefined;
934
+ window_seconds?: number | undefined;
935
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
936
+ } | undefined;
937
+ }>>;
442
938
  cli: z.ZodOptional<z.ZodObject<{
443
939
  banner: z.ZodOptional<z.ZodObject<{
444
940
  taglineMode: z.ZodDefault<z.ZodEnum<["static", "random"]>>;
@@ -588,6 +1084,22 @@ declare const cliSchema: z.ZodObject<{
588
1084
  instructions: string;
589
1085
  model: string;
590
1086
  max_tokens?: number | undefined;
1087
+ model_fallbacks?: string[] | undefined;
1088
+ circuit_breaker?: {
1089
+ failureThreshold?: number | undefined;
1090
+ windowMs?: number | undefined;
1091
+ cooldownMs?: number | undefined;
1092
+ } | undefined;
1093
+ model_tiers?: {
1094
+ default: string;
1095
+ fast: string;
1096
+ routing?: {
1097
+ contextTokenThreshold?: number | undefined;
1098
+ toolsToDefault?: boolean | undefined;
1099
+ firstTurnToDefault?: boolean | undefined;
1100
+ priorToolDensityThreshold?: number | undefined;
1101
+ } | undefined;
1102
+ } | undefined;
591
1103
  sub_agents?: Record<string, {
592
1104
  description: string;
593
1105
  instructions: string;
@@ -608,6 +1120,7 @@ declare const cliSchema: z.ZodObject<{
608
1120
  pattern: string;
609
1121
  }[] | undefined;
610
1122
  } | undefined;
1123
+ version?: number | undefined;
611
1124
  cli?: {
612
1125
  tui: "basic" | "rich";
613
1126
  banner?: {
@@ -642,9 +1155,50 @@ declare const cliSchema: z.ZodObject<{
642
1155
  failure_taxonomy?: {
643
1156
  pattern: string;
644
1157
  class: string;
645
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
1158
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
646
1159
  hint?: string | undefined;
647
1160
  }[] | undefined;
1161
+ budget?: {
1162
+ usd: number;
1163
+ on_exceed: {
1164
+ action: "stop";
1165
+ } | {
1166
+ model: string;
1167
+ action: "degrade";
1168
+ };
1169
+ } | undefined;
1170
+ feedback?: {
1171
+ modality: "binary" | "stars" | "scale" | "comment";
1172
+ enabled?: boolean | undefined;
1173
+ scale?: {
1174
+ min: number;
1175
+ max: number;
1176
+ } | undefined;
1177
+ storage?: {
1178
+ location: string;
1179
+ } | undefined;
1180
+ autoDistill?: boolean | undefined;
1181
+ exitPrompt?: boolean | undefined;
1182
+ channelReactions?: boolean | undefined;
1183
+ } | undefined;
1184
+ memory?: {
1185
+ enabled?: boolean | undefined;
1186
+ autoCapture?: boolean | undefined;
1187
+ autoCaptureThreshold?: number | undefined;
1188
+ autoRecall?: boolean | undefined;
1189
+ recallK?: number | undefined;
1190
+ } | undefined;
1191
+ observability?: {
1192
+ slo?: {
1193
+ error_rate?: number | undefined;
1194
+ p95_latency_ms?: number | undefined;
1195
+ ttft_ms?: number | undefined;
1196
+ cost_per_hour_usd?: number | undefined;
1197
+ egress_block_rate?: number | undefined;
1198
+ window_seconds?: number | undefined;
1199
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
1200
+ } | undefined;
1201
+ } | undefined;
648
1202
  chains?: {
649
1203
  kind: "evm";
650
1204
  id: string;
@@ -687,6 +1241,22 @@ declare const cliSchema: z.ZodObject<{
687
1241
  instructions: string;
688
1242
  model: string;
689
1243
  max_tokens?: number | undefined;
1244
+ model_fallbacks?: string[] | undefined;
1245
+ circuit_breaker?: {
1246
+ failureThreshold?: number | undefined;
1247
+ windowMs?: number | undefined;
1248
+ cooldownMs?: number | undefined;
1249
+ } | undefined;
1250
+ model_tiers?: {
1251
+ default: string;
1252
+ fast: string;
1253
+ routing?: {
1254
+ contextTokenThreshold?: number | undefined;
1255
+ toolsToDefault?: boolean | undefined;
1256
+ firstTurnToDefault?: boolean | undefined;
1257
+ priorToolDensityThreshold?: number | undefined;
1258
+ } | undefined;
1259
+ } | undefined;
690
1260
  sub_agents?: Record<string, {
691
1261
  description: string;
692
1262
  instructions: string;
@@ -707,6 +1277,7 @@ declare const cliSchema: z.ZodObject<{
707
1277
  pattern: string;
708
1278
  }[] | undefined;
709
1279
  } | undefined;
1280
+ version?: number | undefined;
710
1281
  cli?: {
711
1282
  banner?: {
712
1283
  taglines: string[];
@@ -741,9 +1312,50 @@ declare const cliSchema: z.ZodObject<{
741
1312
  failure_taxonomy?: {
742
1313
  pattern: string;
743
1314
  class: string;
744
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
1315
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
745
1316
  hint?: string | undefined;
746
1317
  }[] | undefined;
1318
+ budget?: {
1319
+ usd: number;
1320
+ on_exceed?: {
1321
+ action: "stop";
1322
+ } | {
1323
+ model: string;
1324
+ action: "degrade";
1325
+ } | undefined;
1326
+ } | undefined;
1327
+ feedback?: {
1328
+ enabled?: boolean | undefined;
1329
+ scale?: {
1330
+ min: number;
1331
+ max: number;
1332
+ } | undefined;
1333
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
1334
+ storage?: {
1335
+ location: string;
1336
+ } | undefined;
1337
+ autoDistill?: boolean | undefined;
1338
+ exitPrompt?: boolean | undefined;
1339
+ channelReactions?: boolean | undefined;
1340
+ } | undefined;
1341
+ memory?: {
1342
+ enabled?: boolean | undefined;
1343
+ autoCapture?: boolean | undefined;
1344
+ autoCaptureThreshold?: number | undefined;
1345
+ autoRecall?: boolean | undefined;
1346
+ recallK?: number | undefined;
1347
+ } | undefined;
1348
+ observability?: {
1349
+ slo?: {
1350
+ error_rate?: number | undefined;
1351
+ p95_latency_ms?: number | undefined;
1352
+ ttft_ms?: number | undefined;
1353
+ cost_per_hour_usd?: number | undefined;
1354
+ egress_block_rate?: number | undefined;
1355
+ window_seconds?: number | undefined;
1356
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
1357
+ } | undefined;
1358
+ } | undefined;
747
1359
  chains?: {
748
1360
  kind: "evm";
749
1361
  id: string;
@@ -801,6 +1413,7 @@ declare const workflowStepSchema: z.ZodObject<{
801
1413
  }>;
802
1414
  declare const workflowSchema: z.ZodObject<{
803
1415
  name: z.ZodString;
1416
+ version: z.ZodOptional<z.ZodNumber>;
804
1417
  target: z.ZodLiteral<"workflow">;
805
1418
  model: z.ZodString;
806
1419
  steps: z.ZodArray<z.ZodObject<{
@@ -906,17 +1519,17 @@ declare const workflowSchema: z.ZodObject<{
906
1519
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
907
1520
  class: z.ZodString;
908
1521
  pattern: z.ZodString;
909
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
1522
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
910
1523
  hint: z.ZodOptional<z.ZodString>;
911
1524
  }, "strict", z.ZodTypeAny, {
912
1525
  pattern: string;
913
1526
  class: string;
914
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
1527
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
915
1528
  hint?: string | undefined;
916
1529
  }, {
917
1530
  pattern: string;
918
1531
  class: string;
919
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
1532
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
920
1533
  hint?: string | undefined;
921
1534
  }>, "many">>;
922
1535
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1048,6 +1661,7 @@ declare const workflowSchema: z.ZodObject<{
1048
1661
  pattern: string;
1049
1662
  }[] | undefined;
1050
1663
  } | undefined;
1664
+ version?: number | undefined;
1051
1665
  mcp_servers?: Record<string, {
1052
1666
  transport: "stdio";
1053
1667
  command: string;
@@ -1067,7 +1681,7 @@ declare const workflowSchema: z.ZodObject<{
1067
1681
  failure_taxonomy?: {
1068
1682
  pattern: string;
1069
1683
  class: string;
1070
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
1684
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
1071
1685
  hint?: string | undefined;
1072
1686
  }[] | undefined;
1073
1687
  chains?: {
@@ -1123,6 +1737,7 @@ declare const workflowSchema: z.ZodObject<{
1123
1737
  pattern: string;
1124
1738
  }[] | undefined;
1125
1739
  } | undefined;
1740
+ version?: number | undefined;
1126
1741
  mcp_servers?: Record<string, {
1127
1742
  transport: "stdio";
1128
1743
  command: string;
@@ -1142,7 +1757,7 @@ declare const workflowSchema: z.ZodObject<{
1142
1757
  failure_taxonomy?: {
1143
1758
  pattern: string;
1144
1759
  class: string;
1145
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
1760
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
1146
1761
  hint?: string | undefined;
1147
1762
  }[] | undefined;
1148
1763
  chains?: {
@@ -1243,6 +1858,61 @@ declare const imessageChannelSchema: z.ZodObject<{
1243
1858
  declare const channelAgentSchema: z.ZodObject<{
1244
1859
  model: z.ZodString;
1245
1860
  instructions: z.ZodString;
1861
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1862
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
1863
+ /** Consecutive failures inside windowMs that trip the breaker. */
1864
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
1865
+ /** Window for counting consecutive failures (ms). */
1866
+ windowMs: z.ZodOptional<z.ZodNumber>;
1867
+ /** How long the breaker stays open before allowing a probe (ms). */
1868
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
1869
+ }, "strict", z.ZodTypeAny, {
1870
+ failureThreshold?: number | undefined;
1871
+ windowMs?: number | undefined;
1872
+ cooldownMs?: number | undefined;
1873
+ }, {
1874
+ failureThreshold?: number | undefined;
1875
+ windowMs?: number | undefined;
1876
+ cooldownMs?: number | undefined;
1877
+ }>>;
1878
+ model_tiers: z.ZodOptional<z.ZodObject<{
1879
+ fast: z.ZodString;
1880
+ default: z.ZodString;
1881
+ routing: z.ZodOptional<z.ZodObject<{
1882
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
1883
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
1884
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
1885
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
1886
+ }, "strict", z.ZodTypeAny, {
1887
+ contextTokenThreshold?: number | undefined;
1888
+ toolsToDefault?: boolean | undefined;
1889
+ firstTurnToDefault?: boolean | undefined;
1890
+ priorToolDensityThreshold?: number | undefined;
1891
+ }, {
1892
+ contextTokenThreshold?: number | undefined;
1893
+ toolsToDefault?: boolean | undefined;
1894
+ firstTurnToDefault?: boolean | undefined;
1895
+ priorToolDensityThreshold?: number | undefined;
1896
+ }>>;
1897
+ }, "strict", z.ZodTypeAny, {
1898
+ default: string;
1899
+ fast: string;
1900
+ routing?: {
1901
+ contextTokenThreshold?: number | undefined;
1902
+ toolsToDefault?: boolean | undefined;
1903
+ firstTurnToDefault?: boolean | undefined;
1904
+ priorToolDensityThreshold?: number | undefined;
1905
+ } | undefined;
1906
+ }, {
1907
+ default: string;
1908
+ fast: string;
1909
+ routing?: {
1910
+ contextTokenThreshold?: number | undefined;
1911
+ toolsToDefault?: boolean | undefined;
1912
+ firstTurnToDefault?: boolean | undefined;
1913
+ priorToolDensityThreshold?: number | undefined;
1914
+ } | undefined;
1915
+ }>>;
1246
1916
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1247
1917
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
1248
1918
  sub_agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1286,6 +1956,22 @@ declare const channelAgentSchema: z.ZodObject<{
1286
1956
  instructions: string;
1287
1957
  model: string;
1288
1958
  tools?: string[] | undefined;
1959
+ model_fallbacks?: string[] | undefined;
1960
+ circuit_breaker?: {
1961
+ failureThreshold?: number | undefined;
1962
+ windowMs?: number | undefined;
1963
+ cooldownMs?: number | undefined;
1964
+ } | undefined;
1965
+ model_tiers?: {
1966
+ default: string;
1967
+ fast: string;
1968
+ routing?: {
1969
+ contextTokenThreshold?: number | undefined;
1970
+ toolsToDefault?: boolean | undefined;
1971
+ firstTurnToDefault?: boolean | undefined;
1972
+ priorToolDensityThreshold?: number | undefined;
1973
+ } | undefined;
1974
+ } | undefined;
1289
1975
  sub_agents?: Record<string, {
1290
1976
  description: string;
1291
1977
  instructions: string;
@@ -1302,6 +1988,22 @@ declare const channelAgentSchema: z.ZodObject<{
1302
1988
  instructions: string;
1303
1989
  model: string;
1304
1990
  tools?: string[] | undefined;
1991
+ model_fallbacks?: string[] | undefined;
1992
+ circuit_breaker?: {
1993
+ failureThreshold?: number | undefined;
1994
+ windowMs?: number | undefined;
1995
+ cooldownMs?: number | undefined;
1996
+ } | undefined;
1997
+ model_tiers?: {
1998
+ default: string;
1999
+ fast: string;
2000
+ routing?: {
2001
+ contextTokenThreshold?: number | undefined;
2002
+ toolsToDefault?: boolean | undefined;
2003
+ firstTurnToDefault?: boolean | undefined;
2004
+ priorToolDensityThreshold?: number | undefined;
2005
+ } | undefined;
2006
+ } | undefined;
1305
2007
  sub_agents?: Record<string, {
1306
2008
  description: string;
1307
2009
  instructions: string;
@@ -1317,10 +2019,66 @@ declare const channelAgentSchema: z.ZodObject<{
1317
2019
  }>;
1318
2020
  declare const channelSchema: z.ZodObject<{
1319
2021
  name: z.ZodString;
2022
+ version: z.ZodOptional<z.ZodNumber>;
1320
2023
  target: z.ZodLiteral<"channel">;
1321
2024
  agent: z.ZodObject<{
1322
2025
  model: z.ZodString;
1323
2026
  instructions: z.ZodString;
2027
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2028
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
2029
+ /** Consecutive failures inside windowMs that trip the breaker. */
2030
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
2031
+ /** Window for counting consecutive failures (ms). */
2032
+ windowMs: z.ZodOptional<z.ZodNumber>;
2033
+ /** How long the breaker stays open before allowing a probe (ms). */
2034
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
2035
+ }, "strict", z.ZodTypeAny, {
2036
+ failureThreshold?: number | undefined;
2037
+ windowMs?: number | undefined;
2038
+ cooldownMs?: number | undefined;
2039
+ }, {
2040
+ failureThreshold?: number | undefined;
2041
+ windowMs?: number | undefined;
2042
+ cooldownMs?: number | undefined;
2043
+ }>>;
2044
+ model_tiers: z.ZodOptional<z.ZodObject<{
2045
+ fast: z.ZodString;
2046
+ default: z.ZodString;
2047
+ routing: z.ZodOptional<z.ZodObject<{
2048
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
2049
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
2050
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
2051
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
2052
+ }, "strict", z.ZodTypeAny, {
2053
+ contextTokenThreshold?: number | undefined;
2054
+ toolsToDefault?: boolean | undefined;
2055
+ firstTurnToDefault?: boolean | undefined;
2056
+ priorToolDensityThreshold?: number | undefined;
2057
+ }, {
2058
+ contextTokenThreshold?: number | undefined;
2059
+ toolsToDefault?: boolean | undefined;
2060
+ firstTurnToDefault?: boolean | undefined;
2061
+ priorToolDensityThreshold?: number | undefined;
2062
+ }>>;
2063
+ }, "strict", z.ZodTypeAny, {
2064
+ default: string;
2065
+ fast: string;
2066
+ routing?: {
2067
+ contextTokenThreshold?: number | undefined;
2068
+ toolsToDefault?: boolean | undefined;
2069
+ firstTurnToDefault?: boolean | undefined;
2070
+ priorToolDensityThreshold?: number | undefined;
2071
+ } | undefined;
2072
+ }, {
2073
+ default: string;
2074
+ fast: string;
2075
+ routing?: {
2076
+ contextTokenThreshold?: number | undefined;
2077
+ toolsToDefault?: boolean | undefined;
2078
+ firstTurnToDefault?: boolean | undefined;
2079
+ priorToolDensityThreshold?: number | undefined;
2080
+ } | undefined;
2081
+ }>>;
1324
2082
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1325
2083
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
1326
2084
  sub_agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1364,6 +2122,22 @@ declare const channelSchema: z.ZodObject<{
1364
2122
  instructions: string;
1365
2123
  model: string;
1366
2124
  tools?: string[] | undefined;
2125
+ model_fallbacks?: string[] | undefined;
2126
+ circuit_breaker?: {
2127
+ failureThreshold?: number | undefined;
2128
+ windowMs?: number | undefined;
2129
+ cooldownMs?: number | undefined;
2130
+ } | undefined;
2131
+ model_tiers?: {
2132
+ default: string;
2133
+ fast: string;
2134
+ routing?: {
2135
+ contextTokenThreshold?: number | undefined;
2136
+ toolsToDefault?: boolean | undefined;
2137
+ firstTurnToDefault?: boolean | undefined;
2138
+ priorToolDensityThreshold?: number | undefined;
2139
+ } | undefined;
2140
+ } | undefined;
1367
2141
  sub_agents?: Record<string, {
1368
2142
  description: string;
1369
2143
  instructions: string;
@@ -1380,6 +2154,22 @@ declare const channelSchema: z.ZodObject<{
1380
2154
  instructions: string;
1381
2155
  model: string;
1382
2156
  tools?: string[] | undefined;
2157
+ model_fallbacks?: string[] | undefined;
2158
+ circuit_breaker?: {
2159
+ failureThreshold?: number | undefined;
2160
+ windowMs?: number | undefined;
2161
+ cooldownMs?: number | undefined;
2162
+ } | undefined;
2163
+ model_tiers?: {
2164
+ default: string;
2165
+ fast: string;
2166
+ routing?: {
2167
+ contextTokenThreshold?: number | undefined;
2168
+ toolsToDefault?: boolean | undefined;
2169
+ firstTurnToDefault?: boolean | undefined;
2170
+ priorToolDensityThreshold?: number | undefined;
2171
+ } | undefined;
2172
+ } | undefined;
1383
2173
  sub_agents?: Record<string, {
1384
2174
  description: string;
1385
2175
  instructions: string;
@@ -1641,19 +2431,201 @@ declare const channelSchema: z.ZodObject<{
1641
2431
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
1642
2432
  class: z.ZodString;
1643
2433
  pattern: z.ZodString;
1644
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
2434
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
1645
2435
  hint: z.ZodOptional<z.ZodString>;
1646
2436
  }, "strict", z.ZodTypeAny, {
1647
2437
  pattern: string;
1648
2438
  class: string;
1649
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
2439
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
1650
2440
  hint?: string | undefined;
1651
2441
  }, {
1652
2442
  pattern: string;
1653
2443
  class: string;
1654
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
2444
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
1655
2445
  hint?: string | undefined;
1656
2446
  }>, "many">>;
2447
+ budget: z.ZodOptional<z.ZodObject<{
2448
+ usd: z.ZodNumber;
2449
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
2450
+ action: z.ZodLiteral<"stop">;
2451
+ }, "strict", z.ZodTypeAny, {
2452
+ action: "stop";
2453
+ }, {
2454
+ action: "stop";
2455
+ }>, z.ZodObject<{
2456
+ action: z.ZodLiteral<"degrade">;
2457
+ model: z.ZodString;
2458
+ }, "strict", z.ZodTypeAny, {
2459
+ model: string;
2460
+ action: "degrade";
2461
+ }, {
2462
+ model: string;
2463
+ action: "degrade";
2464
+ }>]>>;
2465
+ }, "strict", z.ZodTypeAny, {
2466
+ usd: number;
2467
+ on_exceed: {
2468
+ action: "stop";
2469
+ } | {
2470
+ model: string;
2471
+ action: "degrade";
2472
+ };
2473
+ }, {
2474
+ usd: number;
2475
+ on_exceed?: {
2476
+ action: "stop";
2477
+ } | {
2478
+ model: string;
2479
+ action: "degrade";
2480
+ } | undefined;
2481
+ }>>;
2482
+ feedback: z.ZodOptional<z.ZodObject<{
2483
+ enabled: z.ZodOptional<z.ZodBoolean>;
2484
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
2485
+ scale: z.ZodOptional<z.ZodObject<{
2486
+ min: z.ZodNumber;
2487
+ max: z.ZodNumber;
2488
+ }, "strict", z.ZodTypeAny, {
2489
+ min: number;
2490
+ max: number;
2491
+ }, {
2492
+ min: number;
2493
+ max: number;
2494
+ }>>;
2495
+ storage: z.ZodOptional<z.ZodObject<{
2496
+ location: z.ZodString;
2497
+ }, "strict", z.ZodTypeAny, {
2498
+ location: string;
2499
+ }, {
2500
+ location: string;
2501
+ }>>;
2502
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
2503
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
2504
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
2505
+ }, "strict", z.ZodTypeAny, {
2506
+ modality: "binary" | "stars" | "scale" | "comment";
2507
+ enabled?: boolean | undefined;
2508
+ scale?: {
2509
+ min: number;
2510
+ max: number;
2511
+ } | undefined;
2512
+ storage?: {
2513
+ location: string;
2514
+ } | undefined;
2515
+ autoDistill?: boolean | undefined;
2516
+ exitPrompt?: boolean | undefined;
2517
+ channelReactions?: boolean | undefined;
2518
+ }, {
2519
+ enabled?: boolean | undefined;
2520
+ scale?: {
2521
+ min: number;
2522
+ max: number;
2523
+ } | undefined;
2524
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
2525
+ storage?: {
2526
+ location: string;
2527
+ } | undefined;
2528
+ autoDistill?: boolean | undefined;
2529
+ exitPrompt?: boolean | undefined;
2530
+ channelReactions?: boolean | undefined;
2531
+ }>>;
2532
+ memory: z.ZodOptional<z.ZodObject<{
2533
+ enabled: z.ZodOptional<z.ZodBoolean>;
2534
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
2535
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
2536
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
2537
+ recallK: z.ZodOptional<z.ZodNumber>;
2538
+ }, "strict", z.ZodTypeAny, {
2539
+ enabled?: boolean | undefined;
2540
+ autoCapture?: boolean | undefined;
2541
+ autoCaptureThreshold?: number | undefined;
2542
+ autoRecall?: boolean | undefined;
2543
+ recallK?: number | undefined;
2544
+ }, {
2545
+ enabled?: boolean | undefined;
2546
+ autoCapture?: boolean | undefined;
2547
+ autoCaptureThreshold?: number | undefined;
2548
+ autoRecall?: boolean | undefined;
2549
+ recallK?: number | undefined;
2550
+ }>>;
2551
+ observability: z.ZodOptional<z.ZodObject<{
2552
+ slo: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2553
+ /** Fractional error rate ceiling (unrecovered errors / model calls), e.g. 0.05. */
2554
+ error_rate: z.ZodOptional<z.ZodNumber>;
2555
+ /** p95 per-turn latency ceiling, milliseconds. */
2556
+ p95_latency_ms: z.ZodOptional<z.ZodNumber>;
2557
+ /** p95 time-to-first-token ceiling, milliseconds. */
2558
+ ttft_ms: z.ZodOptional<z.ZodNumber>;
2559
+ /** Cost burn ceiling, USD per hour of wall-clock. */
2560
+ cost_per_hour_usd: z.ZodOptional<z.ZodNumber>;
2561
+ /** Fractional egress-block rate ceiling (egress-blocked / external calls), e.g. 0.1. */
2562
+ egress_block_rate: z.ZodOptional<z.ZodNumber>;
2563
+ /**
2564
+ * Rolling window (seconds) a breach must persist before the ladder fires.
2565
+ * A single blip never mitigates — the monitor only acts on a SUSTAINED
2566
+ * breach across this window. Default 300s (5 min).
2567
+ */
2568
+ window_seconds: z.ZodOptional<z.ZodNumber>;
2569
+ /**
2570
+ * Mitigation ladder, walked in declared order on a sustained breach. Each
2571
+ * rung is executed at most once per session. `alert` is always safe;
2572
+ * `pause-intake` / `rollback` touch traffic + deploys so they are opt-in.
2573
+ */
2574
+ mitigation: z.ZodOptional<z.ZodArray<z.ZodEnum<["alert", "pause-intake", "rollback"]>, "atleastone">>;
2575
+ }, "strict", z.ZodTypeAny, {
2576
+ error_rate?: number | undefined;
2577
+ p95_latency_ms?: number | undefined;
2578
+ ttft_ms?: number | undefined;
2579
+ cost_per_hour_usd?: number | undefined;
2580
+ egress_block_rate?: number | undefined;
2581
+ window_seconds?: number | undefined;
2582
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2583
+ }, {
2584
+ error_rate?: number | undefined;
2585
+ p95_latency_ms?: number | undefined;
2586
+ ttft_ms?: number | undefined;
2587
+ cost_per_hour_usd?: number | undefined;
2588
+ egress_block_rate?: number | undefined;
2589
+ window_seconds?: number | undefined;
2590
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2591
+ }>, {
2592
+ error_rate?: number | undefined;
2593
+ p95_latency_ms?: number | undefined;
2594
+ ttft_ms?: number | undefined;
2595
+ cost_per_hour_usd?: number | undefined;
2596
+ egress_block_rate?: number | undefined;
2597
+ window_seconds?: number | undefined;
2598
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2599
+ }, {
2600
+ error_rate?: number | undefined;
2601
+ p95_latency_ms?: number | undefined;
2602
+ ttft_ms?: number | undefined;
2603
+ cost_per_hour_usd?: number | undefined;
2604
+ egress_block_rate?: number | undefined;
2605
+ window_seconds?: number | undefined;
2606
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2607
+ }>>;
2608
+ }, "strict", z.ZodTypeAny, {
2609
+ slo?: {
2610
+ error_rate?: number | undefined;
2611
+ p95_latency_ms?: number | undefined;
2612
+ ttft_ms?: number | undefined;
2613
+ cost_per_hour_usd?: number | undefined;
2614
+ egress_block_rate?: number | undefined;
2615
+ window_seconds?: number | undefined;
2616
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2617
+ } | undefined;
2618
+ }, {
2619
+ slo?: {
2620
+ error_rate?: number | undefined;
2621
+ p95_latency_ms?: number | undefined;
2622
+ ttft_ms?: number | undefined;
2623
+ cost_per_hour_usd?: number | undefined;
2624
+ egress_block_rate?: number | undefined;
2625
+ window_seconds?: number | undefined;
2626
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2627
+ } | undefined;
2628
+ }>>;
1657
2629
  heartbeat: z.ZodOptional<z.ZodObject<{
1658
2630
  every: z.ZodString;
1659
2631
  instructions: z.ZodString;
@@ -1786,12 +2758,31 @@ declare const channelSchema: z.ZodObject<{
1786
2758
  simulationRequired?: boolean | undefined;
1787
2759
  }>>;
1788
2760
  }, "strict", z.ZodTypeAny, {
2761
+ routing: {
2762
+ sessionKey: "thread" | "user" | "channel";
2763
+ };
1789
2764
  name: string;
1790
2765
  target: "channel";
1791
2766
  agent: {
1792
2767
  instructions: string;
1793
2768
  model: string;
1794
2769
  tools?: string[] | undefined;
2770
+ model_fallbacks?: string[] | undefined;
2771
+ circuit_breaker?: {
2772
+ failureThreshold?: number | undefined;
2773
+ windowMs?: number | undefined;
2774
+ cooldownMs?: number | undefined;
2775
+ } | undefined;
2776
+ model_tiers?: {
2777
+ default: string;
2778
+ fast: string;
2779
+ routing?: {
2780
+ contextTokenThreshold?: number | undefined;
2781
+ toolsToDefault?: boolean | undefined;
2782
+ firstTurnToDefault?: boolean | undefined;
2783
+ priorToolDensityThreshold?: number | undefined;
2784
+ } | undefined;
2785
+ } | undefined;
1795
2786
  sub_agents?: Record<string, {
1796
2787
  description: string;
1797
2788
  instructions: string;
@@ -1830,9 +2821,6 @@ declare const channelSchema: z.ZodObject<{
1830
2821
  cursorPath?: string | undefined;
1831
2822
  } | undefined;
1832
2823
  };
1833
- routing: {
1834
- sessionKey: "thread" | "user" | "channel";
1835
- };
1836
2824
  permissions?: {
1837
2825
  mode?: "default" | "plan" | "auto" | undefined;
1838
2826
  rules?: {
@@ -1840,6 +2828,7 @@ declare const channelSchema: z.ZodObject<{
1840
2828
  pattern: string;
1841
2829
  }[] | undefined;
1842
2830
  } | undefined;
2831
+ version?: number | undefined;
1843
2832
  mcp_servers?: Record<string, {
1844
2833
  transport: "stdio";
1845
2834
  command: string;
@@ -1859,9 +2848,50 @@ declare const channelSchema: z.ZodObject<{
1859
2848
  failure_taxonomy?: {
1860
2849
  pattern: string;
1861
2850
  class: string;
1862
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
2851
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
1863
2852
  hint?: string | undefined;
1864
2853
  }[] | undefined;
2854
+ budget?: {
2855
+ usd: number;
2856
+ on_exceed: {
2857
+ action: "stop";
2858
+ } | {
2859
+ model: string;
2860
+ action: "degrade";
2861
+ };
2862
+ } | undefined;
2863
+ feedback?: {
2864
+ modality: "binary" | "stars" | "scale" | "comment";
2865
+ enabled?: boolean | undefined;
2866
+ scale?: {
2867
+ min: number;
2868
+ max: number;
2869
+ } | undefined;
2870
+ storage?: {
2871
+ location: string;
2872
+ } | undefined;
2873
+ autoDistill?: boolean | undefined;
2874
+ exitPrompt?: boolean | undefined;
2875
+ channelReactions?: boolean | undefined;
2876
+ } | undefined;
2877
+ memory?: {
2878
+ enabled?: boolean | undefined;
2879
+ autoCapture?: boolean | undefined;
2880
+ autoCaptureThreshold?: number | undefined;
2881
+ autoRecall?: boolean | undefined;
2882
+ recallK?: number | undefined;
2883
+ } | undefined;
2884
+ observability?: {
2885
+ slo?: {
2886
+ error_rate?: number | undefined;
2887
+ p95_latency_ms?: number | undefined;
2888
+ ttft_ms?: number | undefined;
2889
+ cost_per_hour_usd?: number | undefined;
2890
+ egress_block_rate?: number | undefined;
2891
+ window_seconds?: number | undefined;
2892
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
2893
+ } | undefined;
2894
+ } | undefined;
1865
2895
  chains?: {
1866
2896
  kind: "evm";
1867
2897
  id: string;
@@ -1906,12 +2936,31 @@ declare const channelSchema: z.ZodObject<{
1906
2936
  ui: boolean;
1907
2937
  } | undefined;
1908
2938
  }, {
2939
+ routing: {
2940
+ sessionKey: "thread" | "user" | "channel";
2941
+ };
1909
2942
  name: string;
1910
2943
  target: "channel";
1911
2944
  agent: {
1912
2945
  instructions: string;
1913
2946
  model: string;
1914
2947
  tools?: string[] | undefined;
2948
+ model_fallbacks?: string[] | undefined;
2949
+ circuit_breaker?: {
2950
+ failureThreshold?: number | undefined;
2951
+ windowMs?: number | undefined;
2952
+ cooldownMs?: number | undefined;
2953
+ } | undefined;
2954
+ model_tiers?: {
2955
+ default: string;
2956
+ fast: string;
2957
+ routing?: {
2958
+ contextTokenThreshold?: number | undefined;
2959
+ toolsToDefault?: boolean | undefined;
2960
+ firstTurnToDefault?: boolean | undefined;
2961
+ priorToolDensityThreshold?: number | undefined;
2962
+ } | undefined;
2963
+ } | undefined;
1915
2964
  sub_agents?: Record<string, {
1916
2965
  description: string;
1917
2966
  instructions: string;
@@ -1950,9 +2999,6 @@ declare const channelSchema: z.ZodObject<{
1950
2999
  cursorPath?: string | undefined;
1951
3000
  } | undefined;
1952
3001
  };
1953
- routing: {
1954
- sessionKey: "thread" | "user" | "channel";
1955
- };
1956
3002
  permissions?: {
1957
3003
  mode?: "default" | "plan" | "auto" | undefined;
1958
3004
  rules?: {
@@ -1960,6 +3006,7 @@ declare const channelSchema: z.ZodObject<{
1960
3006
  pattern: string;
1961
3007
  }[] | undefined;
1962
3008
  } | undefined;
3009
+ version?: number | undefined;
1963
3010
  mcp_servers?: Record<string, {
1964
3011
  transport: "stdio";
1965
3012
  command: string;
@@ -1979,9 +3026,50 @@ declare const channelSchema: z.ZodObject<{
1979
3026
  failure_taxonomy?: {
1980
3027
  pattern: string;
1981
3028
  class: string;
1982
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3029
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
1983
3030
  hint?: string | undefined;
1984
3031
  }[] | undefined;
3032
+ budget?: {
3033
+ usd: number;
3034
+ on_exceed?: {
3035
+ action: "stop";
3036
+ } | {
3037
+ model: string;
3038
+ action: "degrade";
3039
+ } | undefined;
3040
+ } | undefined;
3041
+ feedback?: {
3042
+ enabled?: boolean | undefined;
3043
+ scale?: {
3044
+ min: number;
3045
+ max: number;
3046
+ } | undefined;
3047
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
3048
+ storage?: {
3049
+ location: string;
3050
+ } | undefined;
3051
+ autoDistill?: boolean | undefined;
3052
+ exitPrompt?: boolean | undefined;
3053
+ channelReactions?: boolean | undefined;
3054
+ } | undefined;
3055
+ memory?: {
3056
+ enabled?: boolean | undefined;
3057
+ autoCapture?: boolean | undefined;
3058
+ autoCaptureThreshold?: number | undefined;
3059
+ autoRecall?: boolean | undefined;
3060
+ recallK?: number | undefined;
3061
+ } | undefined;
3062
+ observability?: {
3063
+ slo?: {
3064
+ error_rate?: number | undefined;
3065
+ p95_latency_ms?: number | undefined;
3066
+ ttft_ms?: number | undefined;
3067
+ cost_per_hour_usd?: number | undefined;
3068
+ egress_block_rate?: number | undefined;
3069
+ window_seconds?: number | undefined;
3070
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3071
+ } | undefined;
3072
+ } | undefined;
1985
3073
  chains?: {
1986
3074
  kind: "evm";
1987
3075
  id: string;
@@ -2072,6 +3160,7 @@ declare const graphEdgeSchema: z.ZodObject<{
2072
3160
  }>;
2073
3161
  declare const graphSchema: z.ZodObject<{
2074
3162
  name: z.ZodString;
3163
+ version: z.ZodOptional<z.ZodNumber>;
2075
3164
  target: z.ZodLiteral<"graph">;
2076
3165
  model: z.ZodString;
2077
3166
  entry: z.ZodString;
@@ -2175,17 +3264,17 @@ declare const graphSchema: z.ZodObject<{
2175
3264
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
2176
3265
  class: z.ZodString;
2177
3266
  pattern: z.ZodString;
2178
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
3267
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
2179
3268
  hint: z.ZodOptional<z.ZodString>;
2180
3269
  }, "strict", z.ZodTypeAny, {
2181
3270
  pattern: string;
2182
3271
  class: string;
2183
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3272
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2184
3273
  hint?: string | undefined;
2185
3274
  }, {
2186
3275
  pattern: string;
2187
3276
  class: string;
2188
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3277
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2189
3278
  hint?: string | undefined;
2190
3279
  }>, "many">>;
2191
3280
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2324,6 +3413,7 @@ declare const graphSchema: z.ZodObject<{
2324
3413
  pattern: string;
2325
3414
  }[] | undefined;
2326
3415
  } | undefined;
3416
+ version?: number | undefined;
2327
3417
  compaction?: {
2328
3418
  model?: string | undefined;
2329
3419
  curate?: boolean | undefined;
@@ -2333,7 +3423,7 @@ declare const graphSchema: z.ZodObject<{
2333
3423
  failure_taxonomy?: {
2334
3424
  pattern: string;
2335
3425
  class: string;
2336
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3426
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2337
3427
  hint?: string | undefined;
2338
3428
  }[] | undefined;
2339
3429
  chains?: {
@@ -2392,6 +3482,7 @@ declare const graphSchema: z.ZodObject<{
2392
3482
  pattern: string;
2393
3483
  }[] | undefined;
2394
3484
  } | undefined;
3485
+ version?: number | undefined;
2395
3486
  compaction?: {
2396
3487
  model?: string | undefined;
2397
3488
  curate?: boolean | undefined;
@@ -2401,7 +3492,7 @@ declare const graphSchema: z.ZodObject<{
2401
3492
  failure_taxonomy?: {
2402
3493
  pattern: string;
2403
3494
  class: string;
2404
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3495
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2405
3496
  hint?: string | undefined;
2406
3497
  }[] | undefined;
2407
3498
  chains?: {
@@ -2471,16 +3562,104 @@ declare const managedTenantSchema: z.ZodObject<{
2471
3562
  }>;
2472
3563
  declare const managedSchema: z.ZodObject<{
2473
3564
  name: z.ZodString;
3565
+ version: z.ZodOptional<z.ZodNumber>;
2474
3566
  target: z.ZodLiteral<"managed">;
2475
3567
  agent: z.ZodObject<{
2476
3568
  model: z.ZodString;
2477
3569
  instructions: z.ZodString;
3570
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3571
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
3572
+ /** Consecutive failures inside windowMs that trip the breaker. */
3573
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
3574
+ /** Window for counting consecutive failures (ms). */
3575
+ windowMs: z.ZodOptional<z.ZodNumber>;
3576
+ /** How long the breaker stays open before allowing a probe (ms). */
3577
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
3578
+ }, "strict", z.ZodTypeAny, {
3579
+ failureThreshold?: number | undefined;
3580
+ windowMs?: number | undefined;
3581
+ cooldownMs?: number | undefined;
3582
+ }, {
3583
+ failureThreshold?: number | undefined;
3584
+ windowMs?: number | undefined;
3585
+ cooldownMs?: number | undefined;
3586
+ }>>;
3587
+ model_tiers: z.ZodOptional<z.ZodObject<{
3588
+ fast: z.ZodString;
3589
+ default: z.ZodString;
3590
+ routing: z.ZodOptional<z.ZodObject<{
3591
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
3592
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
3593
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
3594
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
3595
+ }, "strict", z.ZodTypeAny, {
3596
+ contextTokenThreshold?: number | undefined;
3597
+ toolsToDefault?: boolean | undefined;
3598
+ firstTurnToDefault?: boolean | undefined;
3599
+ priorToolDensityThreshold?: number | undefined;
3600
+ }, {
3601
+ contextTokenThreshold?: number | undefined;
3602
+ toolsToDefault?: boolean | undefined;
3603
+ firstTurnToDefault?: boolean | undefined;
3604
+ priorToolDensityThreshold?: number | undefined;
3605
+ }>>;
3606
+ }, "strict", z.ZodTypeAny, {
3607
+ default: string;
3608
+ fast: string;
3609
+ routing?: {
3610
+ contextTokenThreshold?: number | undefined;
3611
+ toolsToDefault?: boolean | undefined;
3612
+ firstTurnToDefault?: boolean | undefined;
3613
+ priorToolDensityThreshold?: number | undefined;
3614
+ } | undefined;
3615
+ }, {
3616
+ default: string;
3617
+ fast: string;
3618
+ routing?: {
3619
+ contextTokenThreshold?: number | undefined;
3620
+ toolsToDefault?: boolean | undefined;
3621
+ firstTurnToDefault?: boolean | undefined;
3622
+ priorToolDensityThreshold?: number | undefined;
3623
+ } | undefined;
3624
+ }>>;
2478
3625
  }, "strict", z.ZodTypeAny, {
2479
3626
  instructions: string;
2480
3627
  model: string;
3628
+ model_fallbacks?: string[] | undefined;
3629
+ circuit_breaker?: {
3630
+ failureThreshold?: number | undefined;
3631
+ windowMs?: number | undefined;
3632
+ cooldownMs?: number | undefined;
3633
+ } | undefined;
3634
+ model_tiers?: {
3635
+ default: string;
3636
+ fast: string;
3637
+ routing?: {
3638
+ contextTokenThreshold?: number | undefined;
3639
+ toolsToDefault?: boolean | undefined;
3640
+ firstTurnToDefault?: boolean | undefined;
3641
+ priorToolDensityThreshold?: number | undefined;
3642
+ } | undefined;
3643
+ } | undefined;
2481
3644
  }, {
2482
3645
  instructions: string;
2483
3646
  model: string;
3647
+ model_fallbacks?: string[] | undefined;
3648
+ circuit_breaker?: {
3649
+ failureThreshold?: number | undefined;
3650
+ windowMs?: number | undefined;
3651
+ cooldownMs?: number | undefined;
3652
+ } | undefined;
3653
+ model_tiers?: {
3654
+ default: string;
3655
+ fast: string;
3656
+ routing?: {
3657
+ contextTokenThreshold?: number | undefined;
3658
+ toolsToDefault?: boolean | undefined;
3659
+ firstTurnToDefault?: boolean | undefined;
3660
+ priorToolDensityThreshold?: number | undefined;
3661
+ } | undefined;
3662
+ } | undefined;
2484
3663
  }>;
2485
3664
  tenants: z.ZodArray<z.ZodObject<{
2486
3665
  id: z.ZodString;
@@ -2563,25 +3742,173 @@ declare const managedSchema: z.ZodObject<{
2563
3742
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
2564
3743
  class: z.ZodString;
2565
3744
  pattern: z.ZodString;
2566
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
3745
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
2567
3746
  hint: z.ZodOptional<z.ZodString>;
2568
3747
  }, "strict", z.ZodTypeAny, {
2569
3748
  pattern: string;
2570
3749
  class: string;
2571
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3750
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2572
3751
  hint?: string | undefined;
2573
3752
  }, {
2574
3753
  pattern: string;
2575
3754
  class: string;
2576
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3755
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2577
3756
  hint?: string | undefined;
2578
3757
  }>, "many">>;
3758
+ budget: z.ZodOptional<z.ZodObject<{
3759
+ usd: z.ZodNumber;
3760
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
3761
+ action: z.ZodLiteral<"stop">;
3762
+ }, "strict", z.ZodTypeAny, {
3763
+ action: "stop";
3764
+ }, {
3765
+ action: "stop";
3766
+ }>, z.ZodObject<{
3767
+ action: z.ZodLiteral<"degrade">;
3768
+ model: z.ZodString;
3769
+ }, "strict", z.ZodTypeAny, {
3770
+ model: string;
3771
+ action: "degrade";
3772
+ }, {
3773
+ model: string;
3774
+ action: "degrade";
3775
+ }>]>>;
3776
+ }, "strict", z.ZodTypeAny, {
3777
+ usd: number;
3778
+ on_exceed: {
3779
+ action: "stop";
3780
+ } | {
3781
+ model: string;
3782
+ action: "degrade";
3783
+ };
3784
+ }, {
3785
+ usd: number;
3786
+ on_exceed?: {
3787
+ action: "stop";
3788
+ } | {
3789
+ model: string;
3790
+ action: "degrade";
3791
+ } | undefined;
3792
+ }>>;
3793
+ memory: z.ZodOptional<z.ZodObject<{
3794
+ enabled: z.ZodOptional<z.ZodBoolean>;
3795
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
3796
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
3797
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
3798
+ recallK: z.ZodOptional<z.ZodNumber>;
3799
+ }, "strict", z.ZodTypeAny, {
3800
+ enabled?: boolean | undefined;
3801
+ autoCapture?: boolean | undefined;
3802
+ autoCaptureThreshold?: number | undefined;
3803
+ autoRecall?: boolean | undefined;
3804
+ recallK?: number | undefined;
3805
+ }, {
3806
+ enabled?: boolean | undefined;
3807
+ autoCapture?: boolean | undefined;
3808
+ autoCaptureThreshold?: number | undefined;
3809
+ autoRecall?: boolean | undefined;
3810
+ recallK?: number | undefined;
3811
+ }>>;
3812
+ observability: z.ZodOptional<z.ZodObject<{
3813
+ slo: z.ZodOptional<z.ZodEffects<z.ZodObject<{
3814
+ /** Fractional error rate ceiling (unrecovered errors / model calls), e.g. 0.05. */
3815
+ error_rate: z.ZodOptional<z.ZodNumber>;
3816
+ /** p95 per-turn latency ceiling, milliseconds. */
3817
+ p95_latency_ms: z.ZodOptional<z.ZodNumber>;
3818
+ /** p95 time-to-first-token ceiling, milliseconds. */
3819
+ ttft_ms: z.ZodOptional<z.ZodNumber>;
3820
+ /** Cost burn ceiling, USD per hour of wall-clock. */
3821
+ cost_per_hour_usd: z.ZodOptional<z.ZodNumber>;
3822
+ /** Fractional egress-block rate ceiling (egress-blocked / external calls), e.g. 0.1. */
3823
+ egress_block_rate: z.ZodOptional<z.ZodNumber>;
3824
+ /**
3825
+ * Rolling window (seconds) a breach must persist before the ladder fires.
3826
+ * A single blip never mitigates — the monitor only acts on a SUSTAINED
3827
+ * breach across this window. Default 300s (5 min).
3828
+ */
3829
+ window_seconds: z.ZodOptional<z.ZodNumber>;
3830
+ /**
3831
+ * Mitigation ladder, walked in declared order on a sustained breach. Each
3832
+ * rung is executed at most once per session. `alert` is always safe;
3833
+ * `pause-intake` / `rollback` touch traffic + deploys so they are opt-in.
3834
+ */
3835
+ mitigation: z.ZodOptional<z.ZodArray<z.ZodEnum<["alert", "pause-intake", "rollback"]>, "atleastone">>;
3836
+ }, "strict", z.ZodTypeAny, {
3837
+ error_rate?: number | undefined;
3838
+ p95_latency_ms?: number | undefined;
3839
+ ttft_ms?: number | undefined;
3840
+ cost_per_hour_usd?: number | undefined;
3841
+ egress_block_rate?: number | undefined;
3842
+ window_seconds?: number | undefined;
3843
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3844
+ }, {
3845
+ error_rate?: number | undefined;
3846
+ p95_latency_ms?: number | undefined;
3847
+ ttft_ms?: number | undefined;
3848
+ cost_per_hour_usd?: number | undefined;
3849
+ egress_block_rate?: number | undefined;
3850
+ window_seconds?: number | undefined;
3851
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3852
+ }>, {
3853
+ error_rate?: number | undefined;
3854
+ p95_latency_ms?: number | undefined;
3855
+ ttft_ms?: number | undefined;
3856
+ cost_per_hour_usd?: number | undefined;
3857
+ egress_block_rate?: number | undefined;
3858
+ window_seconds?: number | undefined;
3859
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3860
+ }, {
3861
+ error_rate?: number | undefined;
3862
+ p95_latency_ms?: number | undefined;
3863
+ ttft_ms?: number | undefined;
3864
+ cost_per_hour_usd?: number | undefined;
3865
+ egress_block_rate?: number | undefined;
3866
+ window_seconds?: number | undefined;
3867
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3868
+ }>>;
3869
+ }, "strict", z.ZodTypeAny, {
3870
+ slo?: {
3871
+ error_rate?: number | undefined;
3872
+ p95_latency_ms?: number | undefined;
3873
+ ttft_ms?: number | undefined;
3874
+ cost_per_hour_usd?: number | undefined;
3875
+ egress_block_rate?: number | undefined;
3876
+ window_seconds?: number | undefined;
3877
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3878
+ } | undefined;
3879
+ }, {
3880
+ slo?: {
3881
+ error_rate?: number | undefined;
3882
+ p95_latency_ms?: number | undefined;
3883
+ ttft_ms?: number | undefined;
3884
+ cost_per_hour_usd?: number | undefined;
3885
+ egress_block_rate?: number | undefined;
3886
+ window_seconds?: number | undefined;
3887
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3888
+ } | undefined;
3889
+ }>>;
2579
3890
  }, "strict", z.ZodTypeAny, {
2580
3891
  name: string;
2581
3892
  target: "managed";
2582
3893
  agent: {
2583
3894
  instructions: string;
2584
3895
  model: string;
3896
+ model_fallbacks?: string[] | undefined;
3897
+ circuit_breaker?: {
3898
+ failureThreshold?: number | undefined;
3899
+ windowMs?: number | undefined;
3900
+ cooldownMs?: number | undefined;
3901
+ } | undefined;
3902
+ model_tiers?: {
3903
+ default: string;
3904
+ fast: string;
3905
+ routing?: {
3906
+ contextTokenThreshold?: number | undefined;
3907
+ toolsToDefault?: boolean | undefined;
3908
+ firstTurnToDefault?: boolean | undefined;
3909
+ priorToolDensityThreshold?: number | undefined;
3910
+ } | undefined;
3911
+ } | undefined;
2585
3912
  };
2586
3913
  tenants: {
2587
3914
  id: string;
@@ -2597,6 +3924,7 @@ declare const managedSchema: z.ZodObject<{
2597
3924
  pattern: string;
2598
3925
  }[] | undefined;
2599
3926
  } | undefined;
3927
+ version?: number | undefined;
2600
3928
  compaction?: {
2601
3929
  model?: string | undefined;
2602
3930
  curate?: boolean | undefined;
@@ -2606,15 +3934,58 @@ declare const managedSchema: z.ZodObject<{
2606
3934
  failure_taxonomy?: {
2607
3935
  pattern: string;
2608
3936
  class: string;
2609
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
3937
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2610
3938
  hint?: string | undefined;
2611
3939
  }[] | undefined;
3940
+ budget?: {
3941
+ usd: number;
3942
+ on_exceed: {
3943
+ action: "stop";
3944
+ } | {
3945
+ model: string;
3946
+ action: "degrade";
3947
+ };
3948
+ } | undefined;
3949
+ memory?: {
3950
+ enabled?: boolean | undefined;
3951
+ autoCapture?: boolean | undefined;
3952
+ autoCaptureThreshold?: number | undefined;
3953
+ autoRecall?: boolean | undefined;
3954
+ recallK?: number | undefined;
3955
+ } | undefined;
3956
+ observability?: {
3957
+ slo?: {
3958
+ error_rate?: number | undefined;
3959
+ p95_latency_ms?: number | undefined;
3960
+ ttft_ms?: number | undefined;
3961
+ cost_per_hour_usd?: number | undefined;
3962
+ egress_block_rate?: number | undefined;
3963
+ window_seconds?: number | undefined;
3964
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
3965
+ } | undefined;
3966
+ } | undefined;
2612
3967
  }, {
2613
3968
  name: string;
2614
3969
  target: "managed";
2615
3970
  agent: {
2616
3971
  instructions: string;
2617
3972
  model: string;
3973
+ model_fallbacks?: string[] | undefined;
3974
+ circuit_breaker?: {
3975
+ failureThreshold?: number | undefined;
3976
+ windowMs?: number | undefined;
3977
+ cooldownMs?: number | undefined;
3978
+ } | undefined;
3979
+ model_tiers?: {
3980
+ default: string;
3981
+ fast: string;
3982
+ routing?: {
3983
+ contextTokenThreshold?: number | undefined;
3984
+ toolsToDefault?: boolean | undefined;
3985
+ firstTurnToDefault?: boolean | undefined;
3986
+ priorToolDensityThreshold?: number | undefined;
3987
+ } | undefined;
3988
+ } | undefined;
2618
3989
  };
2619
3990
  tenants: {
2620
3991
  id: string;
@@ -2630,6 +4001,7 @@ declare const managedSchema: z.ZodObject<{
2630
4001
  pattern: string;
2631
4002
  }[] | undefined;
2632
4003
  } | undefined;
4004
+ version?: number | undefined;
2633
4005
  compaction?: {
2634
4006
  model?: string | undefined;
2635
4007
  curate?: boolean | undefined;
@@ -2639,9 +4011,36 @@ declare const managedSchema: z.ZodObject<{
2639
4011
  failure_taxonomy?: {
2640
4012
  pattern: string;
2641
4013
  class: string;
2642
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4014
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2643
4015
  hint?: string | undefined;
2644
4016
  }[] | undefined;
4017
+ budget?: {
4018
+ usd: number;
4019
+ on_exceed?: {
4020
+ action: "stop";
4021
+ } | {
4022
+ model: string;
4023
+ action: "degrade";
4024
+ } | undefined;
4025
+ } | undefined;
4026
+ memory?: {
4027
+ enabled?: boolean | undefined;
4028
+ autoCapture?: boolean | undefined;
4029
+ autoCaptureThreshold?: number | undefined;
4030
+ autoRecall?: boolean | undefined;
4031
+ recallK?: number | undefined;
4032
+ } | undefined;
4033
+ observability?: {
4034
+ slo?: {
4035
+ error_rate?: number | undefined;
4036
+ p95_latency_ms?: number | undefined;
4037
+ ttft_ms?: number | undefined;
4038
+ cost_per_hour_usd?: number | undefined;
4039
+ egress_block_rate?: number | undefined;
4040
+ window_seconds?: number | undefined;
4041
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
4042
+ } | undefined;
4043
+ } | undefined;
2645
4044
  }>;
2646
4045
  declare const pipelineDocumentSchema: z.ZodObject<{
2647
4046
  id: z.ZodString;
@@ -2658,6 +4057,7 @@ declare const pipelineDocumentSchema: z.ZodObject<{
2658
4057
  }>;
2659
4058
  declare const pipelineSchema: z.ZodObject<{
2660
4059
  name: z.ZodString;
4060
+ version: z.ZodOptional<z.ZodNumber>;
2661
4061
  target: z.ZodLiteral<"pipeline">;
2662
4062
  agent: z.ZodObject<{
2663
4063
  model: z.ZodString;
@@ -2783,17 +4183,17 @@ declare const pipelineSchema: z.ZodObject<{
2783
4183
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
2784
4184
  class: z.ZodString;
2785
4185
  pattern: z.ZodString;
2786
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
4186
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
2787
4187
  hint: z.ZodOptional<z.ZodString>;
2788
4188
  }, "strict", z.ZodTypeAny, {
2789
4189
  pattern: string;
2790
4190
  class: string;
2791
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4191
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2792
4192
  hint?: string | undefined;
2793
4193
  }, {
2794
4194
  pattern: string;
2795
4195
  class: string;
2796
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4196
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2797
4197
  hint?: string | undefined;
2798
4198
  }>, "many">>;
2799
4199
  }, "strict", z.ZodTypeAny, {
@@ -2828,6 +4228,7 @@ declare const pipelineSchema: z.ZodObject<{
2828
4228
  pattern: string;
2829
4229
  }[] | undefined;
2830
4230
  } | undefined;
4231
+ version?: number | undefined;
2831
4232
  compaction?: {
2832
4233
  model?: string | undefined;
2833
4234
  curate?: boolean | undefined;
@@ -2837,7 +4238,7 @@ declare const pipelineSchema: z.ZodObject<{
2837
4238
  failure_taxonomy?: {
2838
4239
  pattern: string;
2839
4240
  class: string;
2840
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4241
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2841
4242
  hint?: string | undefined;
2842
4243
  }[] | undefined;
2843
4244
  }, {
@@ -2872,6 +4273,7 @@ declare const pipelineSchema: z.ZodObject<{
2872
4273
  pattern: string;
2873
4274
  }[] | undefined;
2874
4275
  } | undefined;
4276
+ version?: number | undefined;
2875
4277
  compaction?: {
2876
4278
  model?: string | undefined;
2877
4279
  curate?: boolean | undefined;
@@ -2881,7 +4283,7 @@ declare const pipelineSchema: z.ZodObject<{
2881
4283
  failure_taxonomy?: {
2882
4284
  pattern: string;
2883
4285
  class: string;
2884
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4286
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
2885
4287
  hint?: string | undefined;
2886
4288
  }[] | undefined;
2887
4289
  }>;
@@ -2987,6 +4389,7 @@ declare const crewRoutingSchema: z.ZodObject<{
2987
4389
  }>;
2988
4390
  declare const crewSchema: z.ZodObject<{
2989
4391
  name: z.ZodString;
4392
+ version: z.ZodOptional<z.ZodNumber>;
2990
4393
  target: z.ZodLiteral<"crew">;
2991
4394
  /** Crew-wide model fallback used by any role that omits `role.model`. */
2992
4395
  model: z.ZodString;
@@ -3175,17 +4578,17 @@ declare const crewSchema: z.ZodObject<{
3175
4578
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
3176
4579
  class: z.ZodString;
3177
4580
  pattern: z.ZodString;
3178
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
4581
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
3179
4582
  hint: z.ZodOptional<z.ZodString>;
3180
4583
  }, "strict", z.ZodTypeAny, {
3181
4584
  pattern: string;
3182
4585
  class: string;
3183
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4586
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3184
4587
  hint?: string | undefined;
3185
4588
  }, {
3186
4589
  pattern: string;
3187
4590
  class: string;
3188
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4591
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3189
4592
  hint?: string | undefined;
3190
4593
  }>, "many">>;
3191
4594
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -3328,6 +4731,14 @@ declare const crewSchema: z.ZodObject<{
3328
4731
  pattern: string;
3329
4732
  }[] | undefined;
3330
4733
  } | undefined;
4734
+ routing?: {
4735
+ kind: "match" | "llm";
4736
+ match?: Record<string, {
4737
+ to: string;
4738
+ contains: string;
4739
+ }[]> | undefined;
4740
+ } | undefined;
4741
+ version?: number | undefined;
3331
4742
  mcp_servers?: Record<string, {
3332
4743
  transport: "stdio";
3333
4744
  command: string;
@@ -3347,7 +4758,7 @@ declare const crewSchema: z.ZodObject<{
3347
4758
  failure_taxonomy?: {
3348
4759
  pattern: string;
3349
4760
  class: string;
3350
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4761
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3351
4762
  hint?: string | undefined;
3352
4763
  }[] | undefined;
3353
4764
  chains?: {
@@ -3383,14 +4794,7 @@ declare const crewSchema: z.ZodObject<{
3383
4794
  allowedContracts: string[];
3384
4795
  simulationRequired: boolean;
3385
4796
  maxValueUsd?: number | undefined;
3386
- maxValueWei?: string | undefined;
3387
- } | undefined;
3388
- routing?: {
3389
- kind: "match" | "llm";
3390
- match?: Record<string, {
3391
- to: string;
3392
- contains: string;
3393
- }[]> | undefined;
4797
+ maxValueWei?: string | undefined;
3394
4798
  } | undefined;
3395
4799
  }, {
3396
4800
  model: string;
@@ -3421,6 +4825,14 @@ declare const crewSchema: z.ZodObject<{
3421
4825
  pattern: string;
3422
4826
  }[] | undefined;
3423
4827
  } | undefined;
4828
+ routing?: {
4829
+ kind: "match" | "llm";
4830
+ match?: Record<string, {
4831
+ to: string;
4832
+ contains: string;
4833
+ }[]> | undefined;
4834
+ } | undefined;
4835
+ version?: number | undefined;
3424
4836
  mcp_servers?: Record<string, {
3425
4837
  transport: "stdio";
3426
4838
  command: string;
@@ -3440,7 +4852,7 @@ declare const crewSchema: z.ZodObject<{
3440
4852
  failure_taxonomy?: {
3441
4853
  pattern: string;
3442
4854
  class: string;
3443
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
4855
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3444
4856
  hint?: string | undefined;
3445
4857
  }[] | undefined;
3446
4858
  chains?: {
@@ -3478,13 +4890,6 @@ declare const crewSchema: z.ZodObject<{
3478
4890
  allowedContracts?: string[] | undefined;
3479
4891
  simulationRequired?: boolean | undefined;
3480
4892
  } | undefined;
3481
- routing?: {
3482
- kind: "match" | "llm";
3483
- match?: Record<string, {
3484
- to: string;
3485
- contains: string;
3486
- }[]> | undefined;
3487
- } | undefined;
3488
4893
  }>;
3489
4894
  declare const researchRetrieveSchema: z.ZodObject<{
3490
4895
  allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -3501,6 +4906,7 @@ declare const researchRetrieveSchema: z.ZodObject<{
3501
4906
  }>;
3502
4907
  declare const researchSchema: z.ZodObject<{
3503
4908
  name: z.ZodString;
4909
+ version: z.ZodOptional<z.ZodNumber>;
3504
4910
  target: z.ZodLiteral<"research">;
3505
4911
  agent: z.ZodObject<{
3506
4912
  model: z.ZodString;
@@ -3614,19 +5020,38 @@ declare const researchSchema: z.ZodObject<{
3614
5020
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
3615
5021
  class: z.ZodString;
3616
5022
  pattern: z.ZodString;
3617
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
5023
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
3618
5024
  hint: z.ZodOptional<z.ZodString>;
3619
5025
  }, "strict", z.ZodTypeAny, {
3620
5026
  pattern: string;
3621
5027
  class: string;
3622
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5028
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3623
5029
  hint?: string | undefined;
3624
5030
  }, {
3625
5031
  pattern: string;
3626
5032
  class: string;
3627
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5033
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3628
5034
  hint?: string | undefined;
3629
5035
  }>, "many">>;
5036
+ memory: z.ZodOptional<z.ZodObject<{
5037
+ enabled: z.ZodOptional<z.ZodBoolean>;
5038
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
5039
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
5040
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
5041
+ recallK: z.ZodOptional<z.ZodNumber>;
5042
+ }, "strict", z.ZodTypeAny, {
5043
+ enabled?: boolean | undefined;
5044
+ autoCapture?: boolean | undefined;
5045
+ autoCaptureThreshold?: number | undefined;
5046
+ autoRecall?: boolean | undefined;
5047
+ recallK?: number | undefined;
5048
+ }, {
5049
+ enabled?: boolean | undefined;
5050
+ autoCapture?: boolean | undefined;
5051
+ autoCaptureThreshold?: number | undefined;
5052
+ autoRecall?: boolean | undefined;
5053
+ recallK?: number | undefined;
5054
+ }>>;
3630
5055
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
3631
5056
  id: z.ZodString;
3632
5057
  kind: z.ZodLiteral<"evm">;
@@ -3761,6 +5186,7 @@ declare const researchSchema: z.ZodObject<{
3761
5186
  pattern: string;
3762
5187
  }[] | undefined;
3763
5188
  } | undefined;
5189
+ version?: number | undefined;
3764
5190
  tool_config?: Record<string, unknown> | undefined;
3765
5191
  mcp_servers?: Record<string, {
3766
5192
  transport: "stdio";
@@ -3781,9 +5207,16 @@ declare const researchSchema: z.ZodObject<{
3781
5207
  failure_taxonomy?: {
3782
5208
  pattern: string;
3783
5209
  class: string;
3784
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5210
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3785
5211
  hint?: string | undefined;
3786
5212
  }[] | undefined;
5213
+ memory?: {
5214
+ enabled?: boolean | undefined;
5215
+ autoCapture?: boolean | undefined;
5216
+ autoCaptureThreshold?: number | undefined;
5217
+ autoRecall?: boolean | undefined;
5218
+ recallK?: number | undefined;
5219
+ } | undefined;
3787
5220
  chains?: {
3788
5221
  kind: "evm";
3789
5222
  id: string;
@@ -3835,6 +5268,7 @@ declare const researchSchema: z.ZodObject<{
3835
5268
  pattern: string;
3836
5269
  }[] | undefined;
3837
5270
  } | undefined;
5271
+ version?: number | undefined;
3838
5272
  tool_config?: Record<string, unknown> | undefined;
3839
5273
  mcp_servers?: Record<string, {
3840
5274
  transport: "stdio";
@@ -3855,9 +5289,16 @@ declare const researchSchema: z.ZodObject<{
3855
5289
  failure_taxonomy?: {
3856
5290
  pattern: string;
3857
5291
  class: string;
3858
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5292
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
3859
5293
  hint?: string | undefined;
3860
5294
  }[] | undefined;
5295
+ memory?: {
5296
+ enabled?: boolean | undefined;
5297
+ autoCapture?: boolean | undefined;
5298
+ autoCaptureThreshold?: number | undefined;
5299
+ autoRecall?: boolean | undefined;
5300
+ recallK?: number | undefined;
5301
+ } | undefined;
3861
5302
  chains?: {
3862
5303
  kind: "evm";
3863
5304
  id: string;
@@ -3922,6 +5363,7 @@ declare const batchQueueSchema: z.ZodObject<{
3922
5363
  }>;
3923
5364
  declare const batchSchema: z.ZodObject<{
3924
5365
  name: z.ZodString;
5366
+ version: z.ZodOptional<z.ZodNumber>;
3925
5367
  target: z.ZodLiteral<"batch">;
3926
5368
  agent: z.ZodObject<{
3927
5369
  model: z.ZodString;
@@ -4040,17 +5482,17 @@ declare const batchSchema: z.ZodObject<{
4040
5482
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
4041
5483
  class: z.ZodString;
4042
5484
  pattern: z.ZodString;
4043
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
5485
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
4044
5486
  hint: z.ZodOptional<z.ZodString>;
4045
5487
  }, "strict", z.ZodTypeAny, {
4046
5488
  pattern: string;
4047
5489
  class: string;
4048
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5490
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4049
5491
  hint?: string | undefined;
4050
5492
  }, {
4051
5493
  pattern: string;
4052
5494
  class: string;
4053
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5495
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4054
5496
  hint?: string | undefined;
4055
5497
  }>, "many">>;
4056
5498
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -4188,6 +5630,7 @@ declare const batchSchema: z.ZodObject<{
4188
5630
  pattern: string;
4189
5631
  }[] | undefined;
4190
5632
  } | undefined;
5633
+ version?: number | undefined;
4191
5634
  tool_config?: Record<string, unknown> | undefined;
4192
5635
  mcp_servers?: Record<string, {
4193
5636
  transport: "stdio";
@@ -4208,7 +5651,7 @@ declare const batchSchema: z.ZodObject<{
4208
5651
  failure_taxonomy?: {
4209
5652
  pattern: string;
4210
5653
  class: string;
4211
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5654
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4212
5655
  hint?: string | undefined;
4213
5656
  }[] | undefined;
4214
5657
  chains?: {
@@ -4268,6 +5711,7 @@ declare const batchSchema: z.ZodObject<{
4268
5711
  pattern: string;
4269
5712
  }[] | undefined;
4270
5713
  } | undefined;
5714
+ version?: number | undefined;
4271
5715
  tool_config?: Record<string, unknown> | undefined;
4272
5716
  mcp_servers?: Record<string, {
4273
5717
  transport: "stdio";
@@ -4288,7 +5732,7 @@ declare const batchSchema: z.ZodObject<{
4288
5732
  failure_taxonomy?: {
4289
5733
  pattern: string;
4290
5734
  class: string;
4291
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5735
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4292
5736
  hint?: string | undefined;
4293
5737
  }[] | undefined;
4294
5738
  chains?: {
@@ -4357,6 +5801,7 @@ declare const voiceTelephonySchema: z.ZodObject<{
4357
5801
  }>;
4358
5802
  declare const voiceSchema: z.ZodObject<{
4359
5803
  name: z.ZodString;
5804
+ version: z.ZodOptional<z.ZodNumber>;
4360
5805
  target: z.ZodLiteral<"voice">;
4361
5806
  agent: z.ZodObject<{
4362
5807
  model: z.ZodString;
@@ -4480,17 +5925,17 @@ declare const voiceSchema: z.ZodObject<{
4480
5925
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
4481
5926
  class: z.ZodString;
4482
5927
  pattern: z.ZodString;
4483
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
5928
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
4484
5929
  hint: z.ZodOptional<z.ZodString>;
4485
5930
  }, "strict", z.ZodTypeAny, {
4486
5931
  pattern: string;
4487
5932
  class: string;
4488
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5933
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4489
5934
  hint?: string | undefined;
4490
5935
  }, {
4491
5936
  pattern: string;
4492
5937
  class: string;
4493
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5938
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4494
5939
  hint?: string | undefined;
4495
5940
  }>, "many">>;
4496
5941
  }, "strict", z.ZodTypeAny, {
@@ -4515,6 +5960,7 @@ declare const voiceSchema: z.ZodObject<{
4515
5960
  pattern: string;
4516
5961
  }[] | undefined;
4517
5962
  } | undefined;
5963
+ version?: number | undefined;
4518
5964
  tool_config?: Record<string, unknown> | undefined;
4519
5965
  mcp_servers?: Record<string, {
4520
5966
  transport: "stdio";
@@ -4535,7 +5981,7 @@ declare const voiceSchema: z.ZodObject<{
4535
5981
  failure_taxonomy?: {
4536
5982
  pattern: string;
4537
5983
  class: string;
4538
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
5984
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4539
5985
  hint?: string | undefined;
4540
5986
  }[] | undefined;
4541
5987
  telephony?: {
@@ -4563,6 +6009,7 @@ declare const voiceSchema: z.ZodObject<{
4563
6009
  pattern: string;
4564
6010
  }[] | undefined;
4565
6011
  } | undefined;
6012
+ version?: number | undefined;
4566
6013
  tool_config?: Record<string, unknown> | undefined;
4567
6014
  mcp_servers?: Record<string, {
4568
6015
  transport: "stdio";
@@ -4583,7 +6030,7 @@ declare const voiceSchema: z.ZodObject<{
4583
6030
  failure_taxonomy?: {
4584
6031
  pattern: string;
4585
6032
  class: string;
4586
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6033
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4587
6034
  hint?: string | undefined;
4588
6035
  }[] | undefined;
4589
6036
  telephony?: {
@@ -4620,6 +6067,7 @@ declare const browserDriverSchema: z.ZodObject<{
4620
6067
  }>;
4621
6068
  declare const browserSchema: z.ZodObject<{
4622
6069
  name: z.ZodString;
6070
+ version: z.ZodOptional<z.ZodNumber>;
4623
6071
  target: z.ZodLiteral<"browser">;
4624
6072
  agent: z.ZodObject<{
4625
6073
  model: z.ZodString;
@@ -4747,17 +6195,17 @@ declare const browserSchema: z.ZodObject<{
4747
6195
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
4748
6196
  class: z.ZodString;
4749
6197
  pattern: z.ZodString;
4750
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
6198
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
4751
6199
  hint: z.ZodOptional<z.ZodString>;
4752
6200
  }, "strict", z.ZodTypeAny, {
4753
6201
  pattern: string;
4754
6202
  class: string;
4755
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6203
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4756
6204
  hint?: string | undefined;
4757
6205
  }, {
4758
6206
  pattern: string;
4759
6207
  class: string;
4760
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6208
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4761
6209
  hint?: string | undefined;
4762
6210
  }>, "many">>;
4763
6211
  }, "strict", z.ZodTypeAny, {
@@ -4783,6 +6231,7 @@ declare const browserSchema: z.ZodObject<{
4783
6231
  pattern: string;
4784
6232
  }[] | undefined;
4785
6233
  } | undefined;
6234
+ version?: number | undefined;
4786
6235
  tool_config?: Record<string, unknown> | undefined;
4787
6236
  mcp_servers?: Record<string, {
4788
6237
  transport: "stdio";
@@ -4803,7 +6252,7 @@ declare const browserSchema: z.ZodObject<{
4803
6252
  failure_taxonomy?: {
4804
6253
  pattern: string;
4805
6254
  class: string;
4806
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6255
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4807
6256
  hint?: string | undefined;
4808
6257
  }[] | undefined;
4809
6258
  groundingModel?: string | undefined;
@@ -4822,6 +6271,7 @@ declare const browserSchema: z.ZodObject<{
4822
6271
  pattern: string;
4823
6272
  }[] | undefined;
4824
6273
  } | undefined;
6274
+ version?: number | undefined;
4825
6275
  tool_config?: Record<string, unknown> | undefined;
4826
6276
  mcp_servers?: Record<string, {
4827
6277
  transport: "stdio";
@@ -4842,7 +6292,7 @@ declare const browserSchema: z.ZodObject<{
4842
6292
  failure_taxonomy?: {
4843
6293
  pattern: string;
4844
6294
  class: string;
4845
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6295
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4846
6296
  hint?: string | undefined;
4847
6297
  }[] | undefined;
4848
6298
  driver?: {
@@ -4865,6 +6315,7 @@ declare const browserSchema: z.ZodObject<{
4865
6315
  */
4866
6316
  declare const evalSchema: z.ZodObject<{
4867
6317
  name: z.ZodString;
6318
+ version: z.ZodOptional<z.ZodNumber>;
4868
6319
  target: z.ZodLiteral<"eval">;
4869
6320
  agent: z.ZodObject<{
4870
6321
  model: z.ZodString;
@@ -4907,17 +6358,17 @@ declare const evalSchema: z.ZodObject<{
4907
6358
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
4908
6359
  class: z.ZodString;
4909
6360
  pattern: z.ZodString;
4910
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
6361
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
4911
6362
  hint: z.ZodOptional<z.ZodString>;
4912
6363
  }, "strict", z.ZodTypeAny, {
4913
6364
  pattern: string;
4914
6365
  class: string;
4915
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6366
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4916
6367
  hint?: string | undefined;
4917
6368
  }, {
4918
6369
  pattern: string;
4919
6370
  class: string;
4920
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6371
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4921
6372
  hint?: string | undefined;
4922
6373
  }>, "many">>;
4923
6374
  }, "strict", z.ZodTypeAny, {
@@ -4938,10 +6389,11 @@ declare const evalSchema: z.ZodObject<{
4938
6389
  name: string;
4939
6390
  opts?: Record<string, unknown> | undefined;
4940
6391
  }[];
6392
+ version?: number | undefined;
4941
6393
  failure_taxonomy?: {
4942
6394
  pattern: string;
4943
6395
  class: string;
4944
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6396
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4945
6397
  hint?: string | undefined;
4946
6398
  }[] | undefined;
4947
6399
  seed?: number | undefined;
@@ -4962,10 +6414,11 @@ declare const evalSchema: z.ZodObject<{
4962
6414
  name: string;
4963
6415
  opts?: Record<string, unknown> | undefined;
4964
6416
  }[];
6417
+ version?: number | undefined;
4965
6418
  failure_taxonomy?: {
4966
6419
  pattern: string;
4967
6420
  class: string;
4968
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6421
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
4969
6422
  hint?: string | undefined;
4970
6423
  }[] | undefined;
4971
6424
  concurrency?: number | undefined;
@@ -5026,6 +6479,7 @@ declare const onchainTriggerSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject
5026
6479
  }>]>;
5027
6480
  declare const onchainSchema: z.ZodObject<{
5028
6481
  name: z.ZodString;
6482
+ version: z.ZodOptional<z.ZodNumber>;
5029
6483
  target: z.ZodLiteral<"onchain">;
5030
6484
  agent: z.ZodObject<{
5031
6485
  model: z.ZodString;
@@ -5281,17 +6735,17 @@ declare const onchainSchema: z.ZodObject<{
5281
6735
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
5282
6736
  class: z.ZodString;
5283
6737
  pattern: z.ZodString;
5284
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
6738
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
5285
6739
  hint: z.ZodOptional<z.ZodString>;
5286
6740
  }, "strict", z.ZodTypeAny, {
5287
6741
  pattern: string;
5288
6742
  class: string;
5289
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6743
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5290
6744
  hint?: string | undefined;
5291
6745
  }, {
5292
6746
  pattern: string;
5293
6747
  class: string;
5294
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6748
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5295
6749
  hint?: string | undefined;
5296
6750
  }>, "many">>;
5297
6751
  }, "strict", z.ZodTypeAny, {
@@ -5361,6 +6815,7 @@ declare const onchainSchema: z.ZodObject<{
5361
6815
  pattern: string;
5362
6816
  }[] | undefined;
5363
6817
  } | undefined;
6818
+ version?: number | undefined;
5364
6819
  tool_config?: Record<string, unknown> | undefined;
5365
6820
  mcp_servers?: Record<string, {
5366
6821
  transport: "stdio";
@@ -5381,7 +6836,7 @@ declare const onchainSchema: z.ZodObject<{
5381
6836
  failure_taxonomy?: {
5382
6837
  pattern: string;
5383
6838
  class: string;
5384
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6839
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5385
6840
  hint?: string | undefined;
5386
6841
  }[] | undefined;
5387
6842
  }, {
@@ -5430,6 +6885,7 @@ declare const onchainSchema: z.ZodObject<{
5430
6885
  pattern: string;
5431
6886
  }[] | undefined;
5432
6887
  } | undefined;
6888
+ version?: number | undefined;
5433
6889
  tool_config?: Record<string, unknown> | undefined;
5434
6890
  mcp_servers?: Record<string, {
5435
6891
  transport: "stdio";
@@ -5450,7 +6906,7 @@ declare const onchainSchema: z.ZodObject<{
5450
6906
  failure_taxonomy?: {
5451
6907
  pattern: string;
5452
6908
  class: string;
5453
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
6909
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5454
6910
  hint?: string | undefined;
5455
6911
  }[] | undefined;
5456
6912
  wallets?: {
@@ -5483,6 +6939,7 @@ declare const onchainSchema: z.ZodObject<{
5483
6939
  */
5484
6940
  declare const onchainGameSchema: z.ZodObject<{
5485
6941
  name: z.ZodString;
6942
+ version: z.ZodOptional<z.ZodNumber>;
5486
6943
  target: z.ZodLiteral<"onchain-game">;
5487
6944
  agent: z.ZodObject<{
5488
6945
  model: z.ZodString;
@@ -5722,17 +7179,17 @@ declare const onchainGameSchema: z.ZodObject<{
5722
7179
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
5723
7180
  class: z.ZodString;
5724
7181
  pattern: z.ZodString;
5725
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
7182
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
5726
7183
  hint: z.ZodOptional<z.ZodString>;
5727
7184
  }, "strict", z.ZodTypeAny, {
5728
7185
  pattern: string;
5729
7186
  class: string;
5730
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
7187
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5731
7188
  hint?: string | undefined;
5732
7189
  }, {
5733
7190
  pattern: string;
5734
7191
  class: string;
5735
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
7192
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5736
7193
  hint?: string | undefined;
5737
7194
  }>, "many">>;
5738
7195
  }, "strict", z.ZodTypeAny, {
@@ -5792,6 +7249,7 @@ declare const onchainGameSchema: z.ZodObject<{
5792
7249
  pattern: string;
5793
7250
  }[] | undefined;
5794
7251
  } | undefined;
7252
+ version?: number | undefined;
5795
7253
  tool_config?: Record<string, unknown> | undefined;
5796
7254
  mcp_servers?: Record<string, {
5797
7255
  transport: "stdio";
@@ -5812,7 +7270,7 @@ declare const onchainGameSchema: z.ZodObject<{
5812
7270
  failure_taxonomy?: {
5813
7271
  pattern: string;
5814
7272
  class: string;
5815
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
7273
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5816
7274
  hint?: string | undefined;
5817
7275
  }[] | undefined;
5818
7276
  }, {
@@ -5865,6 +7323,7 @@ declare const onchainGameSchema: z.ZodObject<{
5865
7323
  pattern: string;
5866
7324
  }[] | undefined;
5867
7325
  } | undefined;
7326
+ version?: number | undefined;
5868
7327
  tool_config?: Record<string, unknown> | undefined;
5869
7328
  mcp_servers?: Record<string, {
5870
7329
  transport: "stdio";
@@ -5885,7 +7344,7 @@ declare const onchainGameSchema: z.ZodObject<{
5885
7344
  failure_taxonomy?: {
5886
7345
  pattern: string;
5887
7346
  class: string;
5888
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
7347
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
5889
7348
  hint?: string | undefined;
5890
7349
  }[] | undefined;
5891
7350
  transaction_policy?: {
@@ -5898,11 +7357,67 @@ declare const onchainGameSchema: z.ZodObject<{
5898
7357
  }>;
5899
7358
  export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
5900
7359
  name: z.ZodString;
7360
+ version: z.ZodOptional<z.ZodNumber>;
5901
7361
  target: z.ZodLiteral<"cli">;
5902
7362
  agent: z.ZodObject<{
5903
7363
  model: z.ZodString;
5904
7364
  instructions: z.ZodString;
5905
7365
  max_tokens: z.ZodOptional<z.ZodNumber>;
7366
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7367
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
7368
+ /** Consecutive failures inside windowMs that trip the breaker. */
7369
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
7370
+ /** Window for counting consecutive failures (ms). */
7371
+ windowMs: z.ZodOptional<z.ZodNumber>;
7372
+ /** How long the breaker stays open before allowing a probe (ms). */
7373
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
7374
+ }, "strict", z.ZodTypeAny, {
7375
+ failureThreshold?: number | undefined;
7376
+ windowMs?: number | undefined;
7377
+ cooldownMs?: number | undefined;
7378
+ }, {
7379
+ failureThreshold?: number | undefined;
7380
+ windowMs?: number | undefined;
7381
+ cooldownMs?: number | undefined;
7382
+ }>>;
7383
+ model_tiers: z.ZodOptional<z.ZodObject<{
7384
+ fast: z.ZodString;
7385
+ default: z.ZodString;
7386
+ routing: z.ZodOptional<z.ZodObject<{
7387
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
7388
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
7389
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
7390
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
7391
+ }, "strict", z.ZodTypeAny, {
7392
+ contextTokenThreshold?: number | undefined;
7393
+ toolsToDefault?: boolean | undefined;
7394
+ firstTurnToDefault?: boolean | undefined;
7395
+ priorToolDensityThreshold?: number | undefined;
7396
+ }, {
7397
+ contextTokenThreshold?: number | undefined;
7398
+ toolsToDefault?: boolean | undefined;
7399
+ firstTurnToDefault?: boolean | undefined;
7400
+ priorToolDensityThreshold?: number | undefined;
7401
+ }>>;
7402
+ }, "strict", z.ZodTypeAny, {
7403
+ default: string;
7404
+ fast: string;
7405
+ routing?: {
7406
+ contextTokenThreshold?: number | undefined;
7407
+ toolsToDefault?: boolean | undefined;
7408
+ firstTurnToDefault?: boolean | undefined;
7409
+ priorToolDensityThreshold?: number | undefined;
7410
+ } | undefined;
7411
+ }, {
7412
+ default: string;
7413
+ fast: string;
7414
+ routing?: {
7415
+ contextTokenThreshold?: number | undefined;
7416
+ toolsToDefault?: boolean | undefined;
7417
+ firstTurnToDefault?: boolean | undefined;
7418
+ priorToolDensityThreshold?: number | undefined;
7419
+ } | undefined;
7420
+ }>>;
5906
7421
  sub_agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
5907
7422
  description: z.ZodString;
5908
7423
  instructions: z.ZodString;
@@ -5944,6 +7459,22 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
5944
7459
  instructions: string;
5945
7460
  model: string;
5946
7461
  max_tokens?: number | undefined;
7462
+ model_fallbacks?: string[] | undefined;
7463
+ circuit_breaker?: {
7464
+ failureThreshold?: number | undefined;
7465
+ windowMs?: number | undefined;
7466
+ cooldownMs?: number | undefined;
7467
+ } | undefined;
7468
+ model_tiers?: {
7469
+ default: string;
7470
+ fast: string;
7471
+ routing?: {
7472
+ contextTokenThreshold?: number | undefined;
7473
+ toolsToDefault?: boolean | undefined;
7474
+ firstTurnToDefault?: boolean | undefined;
7475
+ priorToolDensityThreshold?: number | undefined;
7476
+ } | undefined;
7477
+ } | undefined;
5947
7478
  sub_agents?: Record<string, {
5948
7479
  description: string;
5949
7480
  instructions: string;
@@ -5959,6 +7490,22 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
5959
7490
  instructions: string;
5960
7491
  model: string;
5961
7492
  max_tokens?: number | undefined;
7493
+ model_fallbacks?: string[] | undefined;
7494
+ circuit_breaker?: {
7495
+ failureThreshold?: number | undefined;
7496
+ windowMs?: number | undefined;
7497
+ cooldownMs?: number | undefined;
7498
+ } | undefined;
7499
+ model_tiers?: {
7500
+ default: string;
7501
+ fast: string;
7502
+ routing?: {
7503
+ contextTokenThreshold?: number | undefined;
7504
+ toolsToDefault?: boolean | undefined;
7505
+ firstTurnToDefault?: boolean | undefined;
7506
+ priorToolDensityThreshold?: number | undefined;
7507
+ } | undefined;
7508
+ } | undefined;
5962
7509
  sub_agents?: Record<string, {
5963
7510
  description: string;
5964
7511
  instructions: string;
@@ -6108,19 +7655,201 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6108
7655
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
6109
7656
  class: z.ZodString;
6110
7657
  pattern: z.ZodString;
6111
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
7658
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
6112
7659
  hint: z.ZodOptional<z.ZodString>;
6113
7660
  }, "strict", z.ZodTypeAny, {
6114
7661
  pattern: string;
6115
7662
  class: string;
6116
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
7663
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6117
7664
  hint?: string | undefined;
6118
7665
  }, {
6119
7666
  pattern: string;
6120
7667
  class: string;
6121
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
7668
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6122
7669
  hint?: string | undefined;
6123
7670
  }>, "many">>;
7671
+ budget: z.ZodOptional<z.ZodObject<{
7672
+ usd: z.ZodNumber;
7673
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
7674
+ action: z.ZodLiteral<"stop">;
7675
+ }, "strict", z.ZodTypeAny, {
7676
+ action: "stop";
7677
+ }, {
7678
+ action: "stop";
7679
+ }>, z.ZodObject<{
7680
+ action: z.ZodLiteral<"degrade">;
7681
+ model: z.ZodString;
7682
+ }, "strict", z.ZodTypeAny, {
7683
+ model: string;
7684
+ action: "degrade";
7685
+ }, {
7686
+ model: string;
7687
+ action: "degrade";
7688
+ }>]>>;
7689
+ }, "strict", z.ZodTypeAny, {
7690
+ usd: number;
7691
+ on_exceed: {
7692
+ action: "stop";
7693
+ } | {
7694
+ model: string;
7695
+ action: "degrade";
7696
+ };
7697
+ }, {
7698
+ usd: number;
7699
+ on_exceed?: {
7700
+ action: "stop";
7701
+ } | {
7702
+ model: string;
7703
+ action: "degrade";
7704
+ } | undefined;
7705
+ }>>;
7706
+ feedback: z.ZodOptional<z.ZodObject<{
7707
+ enabled: z.ZodOptional<z.ZodBoolean>;
7708
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
7709
+ scale: z.ZodOptional<z.ZodObject<{
7710
+ min: z.ZodNumber;
7711
+ max: z.ZodNumber;
7712
+ }, "strict", z.ZodTypeAny, {
7713
+ min: number;
7714
+ max: number;
7715
+ }, {
7716
+ min: number;
7717
+ max: number;
7718
+ }>>;
7719
+ storage: z.ZodOptional<z.ZodObject<{
7720
+ location: z.ZodString;
7721
+ }, "strict", z.ZodTypeAny, {
7722
+ location: string;
7723
+ }, {
7724
+ location: string;
7725
+ }>>;
7726
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
7727
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
7728
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
7729
+ }, "strict", z.ZodTypeAny, {
7730
+ modality: "binary" | "stars" | "scale" | "comment";
7731
+ enabled?: boolean | undefined;
7732
+ scale?: {
7733
+ min: number;
7734
+ max: number;
7735
+ } | undefined;
7736
+ storage?: {
7737
+ location: string;
7738
+ } | undefined;
7739
+ autoDistill?: boolean | undefined;
7740
+ exitPrompt?: boolean | undefined;
7741
+ channelReactions?: boolean | undefined;
7742
+ }, {
7743
+ enabled?: boolean | undefined;
7744
+ scale?: {
7745
+ min: number;
7746
+ max: number;
7747
+ } | undefined;
7748
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
7749
+ storage?: {
7750
+ location: string;
7751
+ } | undefined;
7752
+ autoDistill?: boolean | undefined;
7753
+ exitPrompt?: boolean | undefined;
7754
+ channelReactions?: boolean | undefined;
7755
+ }>>;
7756
+ memory: z.ZodOptional<z.ZodObject<{
7757
+ enabled: z.ZodOptional<z.ZodBoolean>;
7758
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
7759
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
7760
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
7761
+ recallK: z.ZodOptional<z.ZodNumber>;
7762
+ }, "strict", z.ZodTypeAny, {
7763
+ enabled?: boolean | undefined;
7764
+ autoCapture?: boolean | undefined;
7765
+ autoCaptureThreshold?: number | undefined;
7766
+ autoRecall?: boolean | undefined;
7767
+ recallK?: number | undefined;
7768
+ }, {
7769
+ enabled?: boolean | undefined;
7770
+ autoCapture?: boolean | undefined;
7771
+ autoCaptureThreshold?: number | undefined;
7772
+ autoRecall?: boolean | undefined;
7773
+ recallK?: number | undefined;
7774
+ }>>;
7775
+ observability: z.ZodOptional<z.ZodObject<{
7776
+ slo: z.ZodOptional<z.ZodEffects<z.ZodObject<{
7777
+ /** Fractional error rate ceiling (unrecovered errors / model calls), e.g. 0.05. */
7778
+ error_rate: z.ZodOptional<z.ZodNumber>;
7779
+ /** p95 per-turn latency ceiling, milliseconds. */
7780
+ p95_latency_ms: z.ZodOptional<z.ZodNumber>;
7781
+ /** p95 time-to-first-token ceiling, milliseconds. */
7782
+ ttft_ms: z.ZodOptional<z.ZodNumber>;
7783
+ /** Cost burn ceiling, USD per hour of wall-clock. */
7784
+ cost_per_hour_usd: z.ZodOptional<z.ZodNumber>;
7785
+ /** Fractional egress-block rate ceiling (egress-blocked / external calls), e.g. 0.1. */
7786
+ egress_block_rate: z.ZodOptional<z.ZodNumber>;
7787
+ /**
7788
+ * Rolling window (seconds) a breach must persist before the ladder fires.
7789
+ * A single blip never mitigates — the monitor only acts on a SUSTAINED
7790
+ * breach across this window. Default 300s (5 min).
7791
+ */
7792
+ window_seconds: z.ZodOptional<z.ZodNumber>;
7793
+ /**
7794
+ * Mitigation ladder, walked in declared order on a sustained breach. Each
7795
+ * rung is executed at most once per session. `alert` is always safe;
7796
+ * `pause-intake` / `rollback` touch traffic + deploys so they are opt-in.
7797
+ */
7798
+ mitigation: z.ZodOptional<z.ZodArray<z.ZodEnum<["alert", "pause-intake", "rollback"]>, "atleastone">>;
7799
+ }, "strict", z.ZodTypeAny, {
7800
+ error_rate?: number | undefined;
7801
+ p95_latency_ms?: number | undefined;
7802
+ ttft_ms?: number | undefined;
7803
+ cost_per_hour_usd?: number | undefined;
7804
+ egress_block_rate?: number | undefined;
7805
+ window_seconds?: number | undefined;
7806
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
7807
+ }, {
7808
+ error_rate?: number | undefined;
7809
+ p95_latency_ms?: number | undefined;
7810
+ ttft_ms?: number | undefined;
7811
+ cost_per_hour_usd?: number | undefined;
7812
+ egress_block_rate?: number | undefined;
7813
+ window_seconds?: number | undefined;
7814
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
7815
+ }>, {
7816
+ error_rate?: number | undefined;
7817
+ p95_latency_ms?: number | undefined;
7818
+ ttft_ms?: number | undefined;
7819
+ cost_per_hour_usd?: number | undefined;
7820
+ egress_block_rate?: number | undefined;
7821
+ window_seconds?: number | undefined;
7822
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
7823
+ }, {
7824
+ error_rate?: number | undefined;
7825
+ p95_latency_ms?: number | undefined;
7826
+ ttft_ms?: number | undefined;
7827
+ cost_per_hour_usd?: number | undefined;
7828
+ egress_block_rate?: number | undefined;
7829
+ window_seconds?: number | undefined;
7830
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
7831
+ }>>;
7832
+ }, "strict", z.ZodTypeAny, {
7833
+ slo?: {
7834
+ error_rate?: number | undefined;
7835
+ p95_latency_ms?: number | undefined;
7836
+ ttft_ms?: number | undefined;
7837
+ cost_per_hour_usd?: number | undefined;
7838
+ egress_block_rate?: number | undefined;
7839
+ window_seconds?: number | undefined;
7840
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
7841
+ } | undefined;
7842
+ }, {
7843
+ slo?: {
7844
+ error_rate?: number | undefined;
7845
+ p95_latency_ms?: number | undefined;
7846
+ ttft_ms?: number | undefined;
7847
+ cost_per_hour_usd?: number | undefined;
7848
+ egress_block_rate?: number | undefined;
7849
+ window_seconds?: number | undefined;
7850
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
7851
+ } | undefined;
7852
+ }>>;
6124
7853
  cli: z.ZodOptional<z.ZodObject<{
6125
7854
  banner: z.ZodOptional<z.ZodObject<{
6126
7855
  taglineMode: z.ZodDefault<z.ZodEnum<["static", "random"]>>;
@@ -6270,6 +7999,22 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6270
7999
  instructions: string;
6271
8000
  model: string;
6272
8001
  max_tokens?: number | undefined;
8002
+ model_fallbacks?: string[] | undefined;
8003
+ circuit_breaker?: {
8004
+ failureThreshold?: number | undefined;
8005
+ windowMs?: number | undefined;
8006
+ cooldownMs?: number | undefined;
8007
+ } | undefined;
8008
+ model_tiers?: {
8009
+ default: string;
8010
+ fast: string;
8011
+ routing?: {
8012
+ contextTokenThreshold?: number | undefined;
8013
+ toolsToDefault?: boolean | undefined;
8014
+ firstTurnToDefault?: boolean | undefined;
8015
+ priorToolDensityThreshold?: number | undefined;
8016
+ } | undefined;
8017
+ } | undefined;
6273
8018
  sub_agents?: Record<string, {
6274
8019
  description: string;
6275
8020
  instructions: string;
@@ -6290,6 +8035,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6290
8035
  pattern: string;
6291
8036
  }[] | undefined;
6292
8037
  } | undefined;
8038
+ version?: number | undefined;
6293
8039
  cli?: {
6294
8040
  tui: "basic" | "rich";
6295
8041
  banner?: {
@@ -6324,9 +8070,50 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6324
8070
  failure_taxonomy?: {
6325
8071
  pattern: string;
6326
8072
  class: string;
6327
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
8073
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6328
8074
  hint?: string | undefined;
6329
8075
  }[] | undefined;
8076
+ budget?: {
8077
+ usd: number;
8078
+ on_exceed: {
8079
+ action: "stop";
8080
+ } | {
8081
+ model: string;
8082
+ action: "degrade";
8083
+ };
8084
+ } | undefined;
8085
+ feedback?: {
8086
+ modality: "binary" | "stars" | "scale" | "comment";
8087
+ enabled?: boolean | undefined;
8088
+ scale?: {
8089
+ min: number;
8090
+ max: number;
8091
+ } | undefined;
8092
+ storage?: {
8093
+ location: string;
8094
+ } | undefined;
8095
+ autoDistill?: boolean | undefined;
8096
+ exitPrompt?: boolean | undefined;
8097
+ channelReactions?: boolean | undefined;
8098
+ } | undefined;
8099
+ memory?: {
8100
+ enabled?: boolean | undefined;
8101
+ autoCapture?: boolean | undefined;
8102
+ autoCaptureThreshold?: number | undefined;
8103
+ autoRecall?: boolean | undefined;
8104
+ recallK?: number | undefined;
8105
+ } | undefined;
8106
+ observability?: {
8107
+ slo?: {
8108
+ error_rate?: number | undefined;
8109
+ p95_latency_ms?: number | undefined;
8110
+ ttft_ms?: number | undefined;
8111
+ cost_per_hour_usd?: number | undefined;
8112
+ egress_block_rate?: number | undefined;
8113
+ window_seconds?: number | undefined;
8114
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
8115
+ } | undefined;
8116
+ } | undefined;
6330
8117
  chains?: {
6331
8118
  kind: "evm";
6332
8119
  id: string;
@@ -6369,6 +8156,22 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6369
8156
  instructions: string;
6370
8157
  model: string;
6371
8158
  max_tokens?: number | undefined;
8159
+ model_fallbacks?: string[] | undefined;
8160
+ circuit_breaker?: {
8161
+ failureThreshold?: number | undefined;
8162
+ windowMs?: number | undefined;
8163
+ cooldownMs?: number | undefined;
8164
+ } | undefined;
8165
+ model_tiers?: {
8166
+ default: string;
8167
+ fast: string;
8168
+ routing?: {
8169
+ contextTokenThreshold?: number | undefined;
8170
+ toolsToDefault?: boolean | undefined;
8171
+ firstTurnToDefault?: boolean | undefined;
8172
+ priorToolDensityThreshold?: number | undefined;
8173
+ } | undefined;
8174
+ } | undefined;
6372
8175
  sub_agents?: Record<string, {
6373
8176
  description: string;
6374
8177
  instructions: string;
@@ -6389,6 +8192,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6389
8192
  pattern: string;
6390
8193
  }[] | undefined;
6391
8194
  } | undefined;
8195
+ version?: number | undefined;
6392
8196
  cli?: {
6393
8197
  banner?: {
6394
8198
  taglines: string[];
@@ -6423,9 +8227,50 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6423
8227
  failure_taxonomy?: {
6424
8228
  pattern: string;
6425
8229
  class: string;
6426
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
8230
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6427
8231
  hint?: string | undefined;
6428
8232
  }[] | undefined;
8233
+ budget?: {
8234
+ usd: number;
8235
+ on_exceed?: {
8236
+ action: "stop";
8237
+ } | {
8238
+ model: string;
8239
+ action: "degrade";
8240
+ } | undefined;
8241
+ } | undefined;
8242
+ feedback?: {
8243
+ enabled?: boolean | undefined;
8244
+ scale?: {
8245
+ min: number;
8246
+ max: number;
8247
+ } | undefined;
8248
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
8249
+ storage?: {
8250
+ location: string;
8251
+ } | undefined;
8252
+ autoDistill?: boolean | undefined;
8253
+ exitPrompt?: boolean | undefined;
8254
+ channelReactions?: boolean | undefined;
8255
+ } | undefined;
8256
+ memory?: {
8257
+ enabled?: boolean | undefined;
8258
+ autoCapture?: boolean | undefined;
8259
+ autoCaptureThreshold?: number | undefined;
8260
+ autoRecall?: boolean | undefined;
8261
+ recallK?: number | undefined;
8262
+ } | undefined;
8263
+ observability?: {
8264
+ slo?: {
8265
+ error_rate?: number | undefined;
8266
+ p95_latency_ms?: number | undefined;
8267
+ ttft_ms?: number | undefined;
8268
+ cost_per_hour_usd?: number | undefined;
8269
+ egress_block_rate?: number | undefined;
8270
+ window_seconds?: number | undefined;
8271
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
8272
+ } | undefined;
8273
+ } | undefined;
6429
8274
  chains?: {
6430
8275
  kind: "evm";
6431
8276
  id: string;
@@ -6463,6 +8308,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6463
8308
  } | undefined;
6464
8309
  }>, z.ZodObject<{
6465
8310
  name: z.ZodString;
8311
+ version: z.ZodOptional<z.ZodNumber>;
6466
8312
  target: z.ZodLiteral<"workflow">;
6467
8313
  model: z.ZodString;
6468
8314
  steps: z.ZodArray<z.ZodObject<{
@@ -6568,17 +8414,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6568
8414
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
6569
8415
  class: z.ZodString;
6570
8416
  pattern: z.ZodString;
6571
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
8417
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
6572
8418
  hint: z.ZodOptional<z.ZodString>;
6573
8419
  }, "strict", z.ZodTypeAny, {
6574
8420
  pattern: string;
6575
8421
  class: string;
6576
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
8422
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6577
8423
  hint?: string | undefined;
6578
8424
  }, {
6579
8425
  pattern: string;
6580
8426
  class: string;
6581
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
8427
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6582
8428
  hint?: string | undefined;
6583
8429
  }>, "many">>;
6584
8430
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -6710,6 +8556,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6710
8556
  pattern: string;
6711
8557
  }[] | undefined;
6712
8558
  } | undefined;
8559
+ version?: number | undefined;
6713
8560
  mcp_servers?: Record<string, {
6714
8561
  transport: "stdio";
6715
8562
  command: string;
@@ -6729,7 +8576,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6729
8576
  failure_taxonomy?: {
6730
8577
  pattern: string;
6731
8578
  class: string;
6732
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
8579
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6733
8580
  hint?: string | undefined;
6734
8581
  }[] | undefined;
6735
8582
  chains?: {
@@ -6785,6 +8632,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6785
8632
  pattern: string;
6786
8633
  }[] | undefined;
6787
8634
  } | undefined;
8635
+ version?: number | undefined;
6788
8636
  mcp_servers?: Record<string, {
6789
8637
  transport: "stdio";
6790
8638
  command: string;
@@ -6804,7 +8652,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6804
8652
  failure_taxonomy?: {
6805
8653
  pattern: string;
6806
8654
  class: string;
6807
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
8655
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
6808
8656
  hint?: string | undefined;
6809
8657
  }[] | undefined;
6810
8658
  chains?: {
@@ -6844,10 +8692,66 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6844
8692
  } | undefined;
6845
8693
  }>, z.ZodObject<{
6846
8694
  name: z.ZodString;
8695
+ version: z.ZodOptional<z.ZodNumber>;
6847
8696
  target: z.ZodLiteral<"channel">;
6848
8697
  agent: z.ZodObject<{
6849
8698
  model: z.ZodString;
6850
8699
  instructions: z.ZodString;
8700
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8701
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
8702
+ /** Consecutive failures inside windowMs that trip the breaker. */
8703
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
8704
+ /** Window for counting consecutive failures (ms). */
8705
+ windowMs: z.ZodOptional<z.ZodNumber>;
8706
+ /** How long the breaker stays open before allowing a probe (ms). */
8707
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
8708
+ }, "strict", z.ZodTypeAny, {
8709
+ failureThreshold?: number | undefined;
8710
+ windowMs?: number | undefined;
8711
+ cooldownMs?: number | undefined;
8712
+ }, {
8713
+ failureThreshold?: number | undefined;
8714
+ windowMs?: number | undefined;
8715
+ cooldownMs?: number | undefined;
8716
+ }>>;
8717
+ model_tiers: z.ZodOptional<z.ZodObject<{
8718
+ fast: z.ZodString;
8719
+ default: z.ZodString;
8720
+ routing: z.ZodOptional<z.ZodObject<{
8721
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
8722
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
8723
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
8724
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
8725
+ }, "strict", z.ZodTypeAny, {
8726
+ contextTokenThreshold?: number | undefined;
8727
+ toolsToDefault?: boolean | undefined;
8728
+ firstTurnToDefault?: boolean | undefined;
8729
+ priorToolDensityThreshold?: number | undefined;
8730
+ }, {
8731
+ contextTokenThreshold?: number | undefined;
8732
+ toolsToDefault?: boolean | undefined;
8733
+ firstTurnToDefault?: boolean | undefined;
8734
+ priorToolDensityThreshold?: number | undefined;
8735
+ }>>;
8736
+ }, "strict", z.ZodTypeAny, {
8737
+ default: string;
8738
+ fast: string;
8739
+ routing?: {
8740
+ contextTokenThreshold?: number | undefined;
8741
+ toolsToDefault?: boolean | undefined;
8742
+ firstTurnToDefault?: boolean | undefined;
8743
+ priorToolDensityThreshold?: number | undefined;
8744
+ } | undefined;
8745
+ }, {
8746
+ default: string;
8747
+ fast: string;
8748
+ routing?: {
8749
+ contextTokenThreshold?: number | undefined;
8750
+ toolsToDefault?: boolean | undefined;
8751
+ firstTurnToDefault?: boolean | undefined;
8752
+ priorToolDensityThreshold?: number | undefined;
8753
+ } | undefined;
8754
+ }>>;
6851
8755
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6852
8756
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
6853
8757
  sub_agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -6891,6 +8795,22 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6891
8795
  instructions: string;
6892
8796
  model: string;
6893
8797
  tools?: string[] | undefined;
8798
+ model_fallbacks?: string[] | undefined;
8799
+ circuit_breaker?: {
8800
+ failureThreshold?: number | undefined;
8801
+ windowMs?: number | undefined;
8802
+ cooldownMs?: number | undefined;
8803
+ } | undefined;
8804
+ model_tiers?: {
8805
+ default: string;
8806
+ fast: string;
8807
+ routing?: {
8808
+ contextTokenThreshold?: number | undefined;
8809
+ toolsToDefault?: boolean | undefined;
8810
+ firstTurnToDefault?: boolean | undefined;
8811
+ priorToolDensityThreshold?: number | undefined;
8812
+ } | undefined;
8813
+ } | undefined;
6894
8814
  sub_agents?: Record<string, {
6895
8815
  description: string;
6896
8816
  instructions: string;
@@ -6907,6 +8827,22 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
6907
8827
  instructions: string;
6908
8828
  model: string;
6909
8829
  tools?: string[] | undefined;
8830
+ model_fallbacks?: string[] | undefined;
8831
+ circuit_breaker?: {
8832
+ failureThreshold?: number | undefined;
8833
+ windowMs?: number | undefined;
8834
+ cooldownMs?: number | undefined;
8835
+ } | undefined;
8836
+ model_tiers?: {
8837
+ default: string;
8838
+ fast: string;
8839
+ routing?: {
8840
+ contextTokenThreshold?: number | undefined;
8841
+ toolsToDefault?: boolean | undefined;
8842
+ firstTurnToDefault?: boolean | undefined;
8843
+ priorToolDensityThreshold?: number | undefined;
8844
+ } | undefined;
8845
+ } | undefined;
6910
8846
  sub_agents?: Record<string, {
6911
8847
  description: string;
6912
8848
  instructions: string;
@@ -7168,19 +9104,201 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7168
9104
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
7169
9105
  class: z.ZodString;
7170
9106
  pattern: z.ZodString;
7171
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
9107
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
7172
9108
  hint: z.ZodOptional<z.ZodString>;
7173
9109
  }, "strict", z.ZodTypeAny, {
7174
9110
  pattern: string;
7175
9111
  class: string;
7176
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
9112
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7177
9113
  hint?: string | undefined;
7178
9114
  }, {
7179
9115
  pattern: string;
7180
9116
  class: string;
7181
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
9117
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7182
9118
  hint?: string | undefined;
7183
9119
  }>, "many">>;
9120
+ budget: z.ZodOptional<z.ZodObject<{
9121
+ usd: z.ZodNumber;
9122
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
9123
+ action: z.ZodLiteral<"stop">;
9124
+ }, "strict", z.ZodTypeAny, {
9125
+ action: "stop";
9126
+ }, {
9127
+ action: "stop";
9128
+ }>, z.ZodObject<{
9129
+ action: z.ZodLiteral<"degrade">;
9130
+ model: z.ZodString;
9131
+ }, "strict", z.ZodTypeAny, {
9132
+ model: string;
9133
+ action: "degrade";
9134
+ }, {
9135
+ model: string;
9136
+ action: "degrade";
9137
+ }>]>>;
9138
+ }, "strict", z.ZodTypeAny, {
9139
+ usd: number;
9140
+ on_exceed: {
9141
+ action: "stop";
9142
+ } | {
9143
+ model: string;
9144
+ action: "degrade";
9145
+ };
9146
+ }, {
9147
+ usd: number;
9148
+ on_exceed?: {
9149
+ action: "stop";
9150
+ } | {
9151
+ model: string;
9152
+ action: "degrade";
9153
+ } | undefined;
9154
+ }>>;
9155
+ feedback: z.ZodOptional<z.ZodObject<{
9156
+ enabled: z.ZodOptional<z.ZodBoolean>;
9157
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
9158
+ scale: z.ZodOptional<z.ZodObject<{
9159
+ min: z.ZodNumber;
9160
+ max: z.ZodNumber;
9161
+ }, "strict", z.ZodTypeAny, {
9162
+ min: number;
9163
+ max: number;
9164
+ }, {
9165
+ min: number;
9166
+ max: number;
9167
+ }>>;
9168
+ storage: z.ZodOptional<z.ZodObject<{
9169
+ location: z.ZodString;
9170
+ }, "strict", z.ZodTypeAny, {
9171
+ location: string;
9172
+ }, {
9173
+ location: string;
9174
+ }>>;
9175
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
9176
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
9177
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
9178
+ }, "strict", z.ZodTypeAny, {
9179
+ modality: "binary" | "stars" | "scale" | "comment";
9180
+ enabled?: boolean | undefined;
9181
+ scale?: {
9182
+ min: number;
9183
+ max: number;
9184
+ } | undefined;
9185
+ storage?: {
9186
+ location: string;
9187
+ } | undefined;
9188
+ autoDistill?: boolean | undefined;
9189
+ exitPrompt?: boolean | undefined;
9190
+ channelReactions?: boolean | undefined;
9191
+ }, {
9192
+ enabled?: boolean | undefined;
9193
+ scale?: {
9194
+ min: number;
9195
+ max: number;
9196
+ } | undefined;
9197
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
9198
+ storage?: {
9199
+ location: string;
9200
+ } | undefined;
9201
+ autoDistill?: boolean | undefined;
9202
+ exitPrompt?: boolean | undefined;
9203
+ channelReactions?: boolean | undefined;
9204
+ }>>;
9205
+ memory: z.ZodOptional<z.ZodObject<{
9206
+ enabled: z.ZodOptional<z.ZodBoolean>;
9207
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
9208
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
9209
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
9210
+ recallK: z.ZodOptional<z.ZodNumber>;
9211
+ }, "strict", z.ZodTypeAny, {
9212
+ enabled?: boolean | undefined;
9213
+ autoCapture?: boolean | undefined;
9214
+ autoCaptureThreshold?: number | undefined;
9215
+ autoRecall?: boolean | undefined;
9216
+ recallK?: number | undefined;
9217
+ }, {
9218
+ enabled?: boolean | undefined;
9219
+ autoCapture?: boolean | undefined;
9220
+ autoCaptureThreshold?: number | undefined;
9221
+ autoRecall?: boolean | undefined;
9222
+ recallK?: number | undefined;
9223
+ }>>;
9224
+ observability: z.ZodOptional<z.ZodObject<{
9225
+ slo: z.ZodOptional<z.ZodEffects<z.ZodObject<{
9226
+ /** Fractional error rate ceiling (unrecovered errors / model calls), e.g. 0.05. */
9227
+ error_rate: z.ZodOptional<z.ZodNumber>;
9228
+ /** p95 per-turn latency ceiling, milliseconds. */
9229
+ p95_latency_ms: z.ZodOptional<z.ZodNumber>;
9230
+ /** p95 time-to-first-token ceiling, milliseconds. */
9231
+ ttft_ms: z.ZodOptional<z.ZodNumber>;
9232
+ /** Cost burn ceiling, USD per hour of wall-clock. */
9233
+ cost_per_hour_usd: z.ZodOptional<z.ZodNumber>;
9234
+ /** Fractional egress-block rate ceiling (egress-blocked / external calls), e.g. 0.1. */
9235
+ egress_block_rate: z.ZodOptional<z.ZodNumber>;
9236
+ /**
9237
+ * Rolling window (seconds) a breach must persist before the ladder fires.
9238
+ * A single blip never mitigates — the monitor only acts on a SUSTAINED
9239
+ * breach across this window. Default 300s (5 min).
9240
+ */
9241
+ window_seconds: z.ZodOptional<z.ZodNumber>;
9242
+ /**
9243
+ * Mitigation ladder, walked in declared order on a sustained breach. Each
9244
+ * rung is executed at most once per session. `alert` is always safe;
9245
+ * `pause-intake` / `rollback` touch traffic + deploys so they are opt-in.
9246
+ */
9247
+ mitigation: z.ZodOptional<z.ZodArray<z.ZodEnum<["alert", "pause-intake", "rollback"]>, "atleastone">>;
9248
+ }, "strict", z.ZodTypeAny, {
9249
+ error_rate?: number | undefined;
9250
+ p95_latency_ms?: number | undefined;
9251
+ ttft_ms?: number | undefined;
9252
+ cost_per_hour_usd?: number | undefined;
9253
+ egress_block_rate?: number | undefined;
9254
+ window_seconds?: number | undefined;
9255
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9256
+ }, {
9257
+ error_rate?: number | undefined;
9258
+ p95_latency_ms?: number | undefined;
9259
+ ttft_ms?: number | undefined;
9260
+ cost_per_hour_usd?: number | undefined;
9261
+ egress_block_rate?: number | undefined;
9262
+ window_seconds?: number | undefined;
9263
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9264
+ }>, {
9265
+ error_rate?: number | undefined;
9266
+ p95_latency_ms?: number | undefined;
9267
+ ttft_ms?: number | undefined;
9268
+ cost_per_hour_usd?: number | undefined;
9269
+ egress_block_rate?: number | undefined;
9270
+ window_seconds?: number | undefined;
9271
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9272
+ }, {
9273
+ error_rate?: number | undefined;
9274
+ p95_latency_ms?: number | undefined;
9275
+ ttft_ms?: number | undefined;
9276
+ cost_per_hour_usd?: number | undefined;
9277
+ egress_block_rate?: number | undefined;
9278
+ window_seconds?: number | undefined;
9279
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9280
+ }>>;
9281
+ }, "strict", z.ZodTypeAny, {
9282
+ slo?: {
9283
+ error_rate?: number | undefined;
9284
+ p95_latency_ms?: number | undefined;
9285
+ ttft_ms?: number | undefined;
9286
+ cost_per_hour_usd?: number | undefined;
9287
+ egress_block_rate?: number | undefined;
9288
+ window_seconds?: number | undefined;
9289
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9290
+ } | undefined;
9291
+ }, {
9292
+ slo?: {
9293
+ error_rate?: number | undefined;
9294
+ p95_latency_ms?: number | undefined;
9295
+ ttft_ms?: number | undefined;
9296
+ cost_per_hour_usd?: number | undefined;
9297
+ egress_block_rate?: number | undefined;
9298
+ window_seconds?: number | undefined;
9299
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9300
+ } | undefined;
9301
+ }>>;
7184
9302
  heartbeat: z.ZodOptional<z.ZodObject<{
7185
9303
  every: z.ZodString;
7186
9304
  instructions: z.ZodString;
@@ -7313,12 +9431,31 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7313
9431
  simulationRequired?: boolean | undefined;
7314
9432
  }>>;
7315
9433
  }, "strict", z.ZodTypeAny, {
9434
+ routing: {
9435
+ sessionKey: "thread" | "user" | "channel";
9436
+ };
7316
9437
  name: string;
7317
9438
  target: "channel";
7318
9439
  agent: {
7319
9440
  instructions: string;
7320
9441
  model: string;
7321
9442
  tools?: string[] | undefined;
9443
+ model_fallbacks?: string[] | undefined;
9444
+ circuit_breaker?: {
9445
+ failureThreshold?: number | undefined;
9446
+ windowMs?: number | undefined;
9447
+ cooldownMs?: number | undefined;
9448
+ } | undefined;
9449
+ model_tiers?: {
9450
+ default: string;
9451
+ fast: string;
9452
+ routing?: {
9453
+ contextTokenThreshold?: number | undefined;
9454
+ toolsToDefault?: boolean | undefined;
9455
+ firstTurnToDefault?: boolean | undefined;
9456
+ priorToolDensityThreshold?: number | undefined;
9457
+ } | undefined;
9458
+ } | undefined;
7322
9459
  sub_agents?: Record<string, {
7323
9460
  description: string;
7324
9461
  instructions: string;
@@ -7357,9 +9494,6 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7357
9494
  cursorPath?: string | undefined;
7358
9495
  } | undefined;
7359
9496
  };
7360
- routing: {
7361
- sessionKey: "thread" | "user" | "channel";
7362
- };
7363
9497
  permissions?: {
7364
9498
  mode?: "default" | "plan" | "auto" | undefined;
7365
9499
  rules?: {
@@ -7367,6 +9501,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7367
9501
  pattern: string;
7368
9502
  }[] | undefined;
7369
9503
  } | undefined;
9504
+ version?: number | undefined;
7370
9505
  mcp_servers?: Record<string, {
7371
9506
  transport: "stdio";
7372
9507
  command: string;
@@ -7386,9 +9521,50 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7386
9521
  failure_taxonomy?: {
7387
9522
  pattern: string;
7388
9523
  class: string;
7389
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
9524
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7390
9525
  hint?: string | undefined;
7391
9526
  }[] | undefined;
9527
+ budget?: {
9528
+ usd: number;
9529
+ on_exceed: {
9530
+ action: "stop";
9531
+ } | {
9532
+ model: string;
9533
+ action: "degrade";
9534
+ };
9535
+ } | undefined;
9536
+ feedback?: {
9537
+ modality: "binary" | "stars" | "scale" | "comment";
9538
+ enabled?: boolean | undefined;
9539
+ scale?: {
9540
+ min: number;
9541
+ max: number;
9542
+ } | undefined;
9543
+ storage?: {
9544
+ location: string;
9545
+ } | undefined;
9546
+ autoDistill?: boolean | undefined;
9547
+ exitPrompt?: boolean | undefined;
9548
+ channelReactions?: boolean | undefined;
9549
+ } | undefined;
9550
+ memory?: {
9551
+ enabled?: boolean | undefined;
9552
+ autoCapture?: boolean | undefined;
9553
+ autoCaptureThreshold?: number | undefined;
9554
+ autoRecall?: boolean | undefined;
9555
+ recallK?: number | undefined;
9556
+ } | undefined;
9557
+ observability?: {
9558
+ slo?: {
9559
+ error_rate?: number | undefined;
9560
+ p95_latency_ms?: number | undefined;
9561
+ ttft_ms?: number | undefined;
9562
+ cost_per_hour_usd?: number | undefined;
9563
+ egress_block_rate?: number | undefined;
9564
+ window_seconds?: number | undefined;
9565
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9566
+ } | undefined;
9567
+ } | undefined;
7392
9568
  chains?: {
7393
9569
  kind: "evm";
7394
9570
  id: string;
@@ -7433,12 +9609,31 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7433
9609
  ui: boolean;
7434
9610
  } | undefined;
7435
9611
  }, {
9612
+ routing: {
9613
+ sessionKey: "thread" | "user" | "channel";
9614
+ };
7436
9615
  name: string;
7437
9616
  target: "channel";
7438
9617
  agent: {
7439
9618
  instructions: string;
7440
9619
  model: string;
7441
9620
  tools?: string[] | undefined;
9621
+ model_fallbacks?: string[] | undefined;
9622
+ circuit_breaker?: {
9623
+ failureThreshold?: number | undefined;
9624
+ windowMs?: number | undefined;
9625
+ cooldownMs?: number | undefined;
9626
+ } | undefined;
9627
+ model_tiers?: {
9628
+ default: string;
9629
+ fast: string;
9630
+ routing?: {
9631
+ contextTokenThreshold?: number | undefined;
9632
+ toolsToDefault?: boolean | undefined;
9633
+ firstTurnToDefault?: boolean | undefined;
9634
+ priorToolDensityThreshold?: number | undefined;
9635
+ } | undefined;
9636
+ } | undefined;
7442
9637
  sub_agents?: Record<string, {
7443
9638
  description: string;
7444
9639
  instructions: string;
@@ -7477,9 +9672,6 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7477
9672
  cursorPath?: string | undefined;
7478
9673
  } | undefined;
7479
9674
  };
7480
- routing: {
7481
- sessionKey: "thread" | "user" | "channel";
7482
- };
7483
9675
  permissions?: {
7484
9676
  mode?: "default" | "plan" | "auto" | undefined;
7485
9677
  rules?: {
@@ -7487,6 +9679,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7487
9679
  pattern: string;
7488
9680
  }[] | undefined;
7489
9681
  } | undefined;
9682
+ version?: number | undefined;
7490
9683
  mcp_servers?: Record<string, {
7491
9684
  transport: "stdio";
7492
9685
  command: string;
@@ -7506,9 +9699,50 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7506
9699
  failure_taxonomy?: {
7507
9700
  pattern: string;
7508
9701
  class: string;
7509
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
9702
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7510
9703
  hint?: string | undefined;
7511
9704
  }[] | undefined;
9705
+ budget?: {
9706
+ usd: number;
9707
+ on_exceed?: {
9708
+ action: "stop";
9709
+ } | {
9710
+ model: string;
9711
+ action: "degrade";
9712
+ } | undefined;
9713
+ } | undefined;
9714
+ feedback?: {
9715
+ enabled?: boolean | undefined;
9716
+ scale?: {
9717
+ min: number;
9718
+ max: number;
9719
+ } | undefined;
9720
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
9721
+ storage?: {
9722
+ location: string;
9723
+ } | undefined;
9724
+ autoDistill?: boolean | undefined;
9725
+ exitPrompt?: boolean | undefined;
9726
+ channelReactions?: boolean | undefined;
9727
+ } | undefined;
9728
+ memory?: {
9729
+ enabled?: boolean | undefined;
9730
+ autoCapture?: boolean | undefined;
9731
+ autoCaptureThreshold?: number | undefined;
9732
+ autoRecall?: boolean | undefined;
9733
+ recallK?: number | undefined;
9734
+ } | undefined;
9735
+ observability?: {
9736
+ slo?: {
9737
+ error_rate?: number | undefined;
9738
+ p95_latency_ms?: number | undefined;
9739
+ ttft_ms?: number | undefined;
9740
+ cost_per_hour_usd?: number | undefined;
9741
+ egress_block_rate?: number | undefined;
9742
+ window_seconds?: number | undefined;
9743
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
9744
+ } | undefined;
9745
+ } | undefined;
7512
9746
  chains?: {
7513
9747
  kind: "evm";
7514
9748
  id: string;
@@ -7554,6 +9788,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7554
9788
  } | undefined;
7555
9789
  }>, z.ZodObject<{
7556
9790
  name: z.ZodString;
9791
+ version: z.ZodOptional<z.ZodNumber>;
7557
9792
  target: z.ZodLiteral<"graph">;
7558
9793
  model: z.ZodString;
7559
9794
  entry: z.ZodString;
@@ -7657,17 +9892,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7657
9892
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
7658
9893
  class: z.ZodString;
7659
9894
  pattern: z.ZodString;
7660
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
9895
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
7661
9896
  hint: z.ZodOptional<z.ZodString>;
7662
9897
  }, "strict", z.ZodTypeAny, {
7663
9898
  pattern: string;
7664
9899
  class: string;
7665
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
9900
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7666
9901
  hint?: string | undefined;
7667
9902
  }, {
7668
9903
  pattern: string;
7669
9904
  class: string;
7670
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
9905
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7671
9906
  hint?: string | undefined;
7672
9907
  }>, "many">>;
7673
9908
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -7806,6 +10041,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7806
10041
  pattern: string;
7807
10042
  }[] | undefined;
7808
10043
  } | undefined;
10044
+ version?: number | undefined;
7809
10045
  compaction?: {
7810
10046
  model?: string | undefined;
7811
10047
  curate?: boolean | undefined;
@@ -7815,7 +10051,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7815
10051
  failure_taxonomy?: {
7816
10052
  pattern: string;
7817
10053
  class: string;
7818
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10054
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7819
10055
  hint?: string | undefined;
7820
10056
  }[] | undefined;
7821
10057
  chains?: {
@@ -7874,6 +10110,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7874
10110
  pattern: string;
7875
10111
  }[] | undefined;
7876
10112
  } | undefined;
10113
+ version?: number | undefined;
7877
10114
  compaction?: {
7878
10115
  model?: string | undefined;
7879
10116
  curate?: boolean | undefined;
@@ -7883,7 +10120,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7883
10120
  failure_taxonomy?: {
7884
10121
  pattern: string;
7885
10122
  class: string;
7886
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10123
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
7887
10124
  hint?: string | undefined;
7888
10125
  }[] | undefined;
7889
10126
  chains?: {
@@ -7927,16 +10164,104 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
7927
10164
  }[] | undefined;
7928
10165
  }>, z.ZodObject<{
7929
10166
  name: z.ZodString;
10167
+ version: z.ZodOptional<z.ZodNumber>;
7930
10168
  target: z.ZodLiteral<"managed">;
7931
10169
  agent: z.ZodObject<{
7932
10170
  model: z.ZodString;
7933
10171
  instructions: z.ZodString;
10172
+ model_fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10173
+ circuit_breaker: z.ZodOptional<z.ZodObject<{
10174
+ /** Consecutive failures inside windowMs that trip the breaker. */
10175
+ failureThreshold: z.ZodOptional<z.ZodNumber>;
10176
+ /** Window for counting consecutive failures (ms). */
10177
+ windowMs: z.ZodOptional<z.ZodNumber>;
10178
+ /** How long the breaker stays open before allowing a probe (ms). */
10179
+ cooldownMs: z.ZodOptional<z.ZodNumber>;
10180
+ }, "strict", z.ZodTypeAny, {
10181
+ failureThreshold?: number | undefined;
10182
+ windowMs?: number | undefined;
10183
+ cooldownMs?: number | undefined;
10184
+ }, {
10185
+ failureThreshold?: number | undefined;
10186
+ windowMs?: number | undefined;
10187
+ cooldownMs?: number | undefined;
10188
+ }>>;
10189
+ model_tiers: z.ZodOptional<z.ZodObject<{
10190
+ fast: z.ZodString;
10191
+ default: z.ZodString;
10192
+ routing: z.ZodOptional<z.ZodObject<{
10193
+ contextTokenThreshold: z.ZodOptional<z.ZodNumber>;
10194
+ toolsToDefault: z.ZodOptional<z.ZodBoolean>;
10195
+ firstTurnToDefault: z.ZodOptional<z.ZodBoolean>;
10196
+ priorToolDensityThreshold: z.ZodOptional<z.ZodNumber>;
10197
+ }, "strict", z.ZodTypeAny, {
10198
+ contextTokenThreshold?: number | undefined;
10199
+ toolsToDefault?: boolean | undefined;
10200
+ firstTurnToDefault?: boolean | undefined;
10201
+ priorToolDensityThreshold?: number | undefined;
10202
+ }, {
10203
+ contextTokenThreshold?: number | undefined;
10204
+ toolsToDefault?: boolean | undefined;
10205
+ firstTurnToDefault?: boolean | undefined;
10206
+ priorToolDensityThreshold?: number | undefined;
10207
+ }>>;
10208
+ }, "strict", z.ZodTypeAny, {
10209
+ default: string;
10210
+ fast: string;
10211
+ routing?: {
10212
+ contextTokenThreshold?: number | undefined;
10213
+ toolsToDefault?: boolean | undefined;
10214
+ firstTurnToDefault?: boolean | undefined;
10215
+ priorToolDensityThreshold?: number | undefined;
10216
+ } | undefined;
10217
+ }, {
10218
+ default: string;
10219
+ fast: string;
10220
+ routing?: {
10221
+ contextTokenThreshold?: number | undefined;
10222
+ toolsToDefault?: boolean | undefined;
10223
+ firstTurnToDefault?: boolean | undefined;
10224
+ priorToolDensityThreshold?: number | undefined;
10225
+ } | undefined;
10226
+ }>>;
7934
10227
  }, "strict", z.ZodTypeAny, {
7935
10228
  instructions: string;
7936
10229
  model: string;
10230
+ model_fallbacks?: string[] | undefined;
10231
+ circuit_breaker?: {
10232
+ failureThreshold?: number | undefined;
10233
+ windowMs?: number | undefined;
10234
+ cooldownMs?: number | undefined;
10235
+ } | undefined;
10236
+ model_tiers?: {
10237
+ default: string;
10238
+ fast: string;
10239
+ routing?: {
10240
+ contextTokenThreshold?: number | undefined;
10241
+ toolsToDefault?: boolean | undefined;
10242
+ firstTurnToDefault?: boolean | undefined;
10243
+ priorToolDensityThreshold?: number | undefined;
10244
+ } | undefined;
10245
+ } | undefined;
7937
10246
  }, {
7938
10247
  instructions: string;
7939
10248
  model: string;
10249
+ model_fallbacks?: string[] | undefined;
10250
+ circuit_breaker?: {
10251
+ failureThreshold?: number | undefined;
10252
+ windowMs?: number | undefined;
10253
+ cooldownMs?: number | undefined;
10254
+ } | undefined;
10255
+ model_tiers?: {
10256
+ default: string;
10257
+ fast: string;
10258
+ routing?: {
10259
+ contextTokenThreshold?: number | undefined;
10260
+ toolsToDefault?: boolean | undefined;
10261
+ firstTurnToDefault?: boolean | undefined;
10262
+ priorToolDensityThreshold?: number | undefined;
10263
+ } | undefined;
10264
+ } | undefined;
7940
10265
  }>;
7941
10266
  tenants: z.ZodArray<z.ZodObject<{
7942
10267
  id: z.ZodString;
@@ -8019,25 +10344,173 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8019
10344
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
8020
10345
  class: z.ZodString;
8021
10346
  pattern: z.ZodString;
8022
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
10347
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
8023
10348
  hint: z.ZodOptional<z.ZodString>;
8024
10349
  }, "strict", z.ZodTypeAny, {
8025
10350
  pattern: string;
8026
10351
  class: string;
8027
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10352
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8028
10353
  hint?: string | undefined;
8029
10354
  }, {
8030
10355
  pattern: string;
8031
10356
  class: string;
8032
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10357
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8033
10358
  hint?: string | undefined;
8034
10359
  }>, "many">>;
10360
+ budget: z.ZodOptional<z.ZodObject<{
10361
+ usd: z.ZodNumber;
10362
+ on_exceed: z.ZodDefault<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
10363
+ action: z.ZodLiteral<"stop">;
10364
+ }, "strict", z.ZodTypeAny, {
10365
+ action: "stop";
10366
+ }, {
10367
+ action: "stop";
10368
+ }>, z.ZodObject<{
10369
+ action: z.ZodLiteral<"degrade">;
10370
+ model: z.ZodString;
10371
+ }, "strict", z.ZodTypeAny, {
10372
+ model: string;
10373
+ action: "degrade";
10374
+ }, {
10375
+ model: string;
10376
+ action: "degrade";
10377
+ }>]>>;
10378
+ }, "strict", z.ZodTypeAny, {
10379
+ usd: number;
10380
+ on_exceed: {
10381
+ action: "stop";
10382
+ } | {
10383
+ model: string;
10384
+ action: "degrade";
10385
+ };
10386
+ }, {
10387
+ usd: number;
10388
+ on_exceed?: {
10389
+ action: "stop";
10390
+ } | {
10391
+ model: string;
10392
+ action: "degrade";
10393
+ } | undefined;
10394
+ }>>;
10395
+ memory: z.ZodOptional<z.ZodObject<{
10396
+ enabled: z.ZodOptional<z.ZodBoolean>;
10397
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
10398
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
10399
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
10400
+ recallK: z.ZodOptional<z.ZodNumber>;
10401
+ }, "strict", z.ZodTypeAny, {
10402
+ enabled?: boolean | undefined;
10403
+ autoCapture?: boolean | undefined;
10404
+ autoCaptureThreshold?: number | undefined;
10405
+ autoRecall?: boolean | undefined;
10406
+ recallK?: number | undefined;
10407
+ }, {
10408
+ enabled?: boolean | undefined;
10409
+ autoCapture?: boolean | undefined;
10410
+ autoCaptureThreshold?: number | undefined;
10411
+ autoRecall?: boolean | undefined;
10412
+ recallK?: number | undefined;
10413
+ }>>;
10414
+ observability: z.ZodOptional<z.ZodObject<{
10415
+ slo: z.ZodOptional<z.ZodEffects<z.ZodObject<{
10416
+ /** Fractional error rate ceiling (unrecovered errors / model calls), e.g. 0.05. */
10417
+ error_rate: z.ZodOptional<z.ZodNumber>;
10418
+ /** p95 per-turn latency ceiling, milliseconds. */
10419
+ p95_latency_ms: z.ZodOptional<z.ZodNumber>;
10420
+ /** p95 time-to-first-token ceiling, milliseconds. */
10421
+ ttft_ms: z.ZodOptional<z.ZodNumber>;
10422
+ /** Cost burn ceiling, USD per hour of wall-clock. */
10423
+ cost_per_hour_usd: z.ZodOptional<z.ZodNumber>;
10424
+ /** Fractional egress-block rate ceiling (egress-blocked / external calls), e.g. 0.1. */
10425
+ egress_block_rate: z.ZodOptional<z.ZodNumber>;
10426
+ /**
10427
+ * Rolling window (seconds) a breach must persist before the ladder fires.
10428
+ * A single blip never mitigates — the monitor only acts on a SUSTAINED
10429
+ * breach across this window. Default 300s (5 min).
10430
+ */
10431
+ window_seconds: z.ZodOptional<z.ZodNumber>;
10432
+ /**
10433
+ * Mitigation ladder, walked in declared order on a sustained breach. Each
10434
+ * rung is executed at most once per session. `alert` is always safe;
10435
+ * `pause-intake` / `rollback` touch traffic + deploys so they are opt-in.
10436
+ */
10437
+ mitigation: z.ZodOptional<z.ZodArray<z.ZodEnum<["alert", "pause-intake", "rollback"]>, "atleastone">>;
10438
+ }, "strict", z.ZodTypeAny, {
10439
+ error_rate?: number | undefined;
10440
+ p95_latency_ms?: number | undefined;
10441
+ ttft_ms?: number | undefined;
10442
+ cost_per_hour_usd?: number | undefined;
10443
+ egress_block_rate?: number | undefined;
10444
+ window_seconds?: number | undefined;
10445
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10446
+ }, {
10447
+ error_rate?: number | undefined;
10448
+ p95_latency_ms?: number | undefined;
10449
+ ttft_ms?: number | undefined;
10450
+ cost_per_hour_usd?: number | undefined;
10451
+ egress_block_rate?: number | undefined;
10452
+ window_seconds?: number | undefined;
10453
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10454
+ }>, {
10455
+ error_rate?: number | undefined;
10456
+ p95_latency_ms?: number | undefined;
10457
+ ttft_ms?: number | undefined;
10458
+ cost_per_hour_usd?: number | undefined;
10459
+ egress_block_rate?: number | undefined;
10460
+ window_seconds?: number | undefined;
10461
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10462
+ }, {
10463
+ error_rate?: number | undefined;
10464
+ p95_latency_ms?: number | undefined;
10465
+ ttft_ms?: number | undefined;
10466
+ cost_per_hour_usd?: number | undefined;
10467
+ egress_block_rate?: number | undefined;
10468
+ window_seconds?: number | undefined;
10469
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10470
+ }>>;
10471
+ }, "strict", z.ZodTypeAny, {
10472
+ slo?: {
10473
+ error_rate?: number | undefined;
10474
+ p95_latency_ms?: number | undefined;
10475
+ ttft_ms?: number | undefined;
10476
+ cost_per_hour_usd?: number | undefined;
10477
+ egress_block_rate?: number | undefined;
10478
+ window_seconds?: number | undefined;
10479
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10480
+ } | undefined;
10481
+ }, {
10482
+ slo?: {
10483
+ error_rate?: number | undefined;
10484
+ p95_latency_ms?: number | undefined;
10485
+ ttft_ms?: number | undefined;
10486
+ cost_per_hour_usd?: number | undefined;
10487
+ egress_block_rate?: number | undefined;
10488
+ window_seconds?: number | undefined;
10489
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10490
+ } | undefined;
10491
+ }>>;
8035
10492
  }, "strict", z.ZodTypeAny, {
8036
10493
  name: string;
8037
10494
  target: "managed";
8038
10495
  agent: {
8039
10496
  instructions: string;
8040
10497
  model: string;
10498
+ model_fallbacks?: string[] | undefined;
10499
+ circuit_breaker?: {
10500
+ failureThreshold?: number | undefined;
10501
+ windowMs?: number | undefined;
10502
+ cooldownMs?: number | undefined;
10503
+ } | undefined;
10504
+ model_tiers?: {
10505
+ default: string;
10506
+ fast: string;
10507
+ routing?: {
10508
+ contextTokenThreshold?: number | undefined;
10509
+ toolsToDefault?: boolean | undefined;
10510
+ firstTurnToDefault?: boolean | undefined;
10511
+ priorToolDensityThreshold?: number | undefined;
10512
+ } | undefined;
10513
+ } | undefined;
8041
10514
  };
8042
10515
  tenants: {
8043
10516
  id: string;
@@ -8053,6 +10526,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8053
10526
  pattern: string;
8054
10527
  }[] | undefined;
8055
10528
  } | undefined;
10529
+ version?: number | undefined;
8056
10530
  compaction?: {
8057
10531
  model?: string | undefined;
8058
10532
  curate?: boolean | undefined;
@@ -8062,15 +10536,58 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8062
10536
  failure_taxonomy?: {
8063
10537
  pattern: string;
8064
10538
  class: string;
8065
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10539
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8066
10540
  hint?: string | undefined;
8067
10541
  }[] | undefined;
10542
+ budget?: {
10543
+ usd: number;
10544
+ on_exceed: {
10545
+ action: "stop";
10546
+ } | {
10547
+ model: string;
10548
+ action: "degrade";
10549
+ };
10550
+ } | undefined;
10551
+ memory?: {
10552
+ enabled?: boolean | undefined;
10553
+ autoCapture?: boolean | undefined;
10554
+ autoCaptureThreshold?: number | undefined;
10555
+ autoRecall?: boolean | undefined;
10556
+ recallK?: number | undefined;
10557
+ } | undefined;
10558
+ observability?: {
10559
+ slo?: {
10560
+ error_rate?: number | undefined;
10561
+ p95_latency_ms?: number | undefined;
10562
+ ttft_ms?: number | undefined;
10563
+ cost_per_hour_usd?: number | undefined;
10564
+ egress_block_rate?: number | undefined;
10565
+ window_seconds?: number | undefined;
10566
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10567
+ } | undefined;
10568
+ } | undefined;
8068
10569
  }, {
8069
10570
  name: string;
8070
10571
  target: "managed";
8071
10572
  agent: {
8072
10573
  instructions: string;
8073
10574
  model: string;
10575
+ model_fallbacks?: string[] | undefined;
10576
+ circuit_breaker?: {
10577
+ failureThreshold?: number | undefined;
10578
+ windowMs?: number | undefined;
10579
+ cooldownMs?: number | undefined;
10580
+ } | undefined;
10581
+ model_tiers?: {
10582
+ default: string;
10583
+ fast: string;
10584
+ routing?: {
10585
+ contextTokenThreshold?: number | undefined;
10586
+ toolsToDefault?: boolean | undefined;
10587
+ firstTurnToDefault?: boolean | undefined;
10588
+ priorToolDensityThreshold?: number | undefined;
10589
+ } | undefined;
10590
+ } | undefined;
8074
10591
  };
8075
10592
  tenants: {
8076
10593
  id: string;
@@ -8086,6 +10603,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8086
10603
  pattern: string;
8087
10604
  }[] | undefined;
8088
10605
  } | undefined;
10606
+ version?: number | undefined;
8089
10607
  compaction?: {
8090
10608
  model?: string | undefined;
8091
10609
  curate?: boolean | undefined;
@@ -8095,11 +10613,39 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8095
10613
  failure_taxonomy?: {
8096
10614
  pattern: string;
8097
10615
  class: string;
8098
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10616
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8099
10617
  hint?: string | undefined;
8100
10618
  }[] | undefined;
10619
+ budget?: {
10620
+ usd: number;
10621
+ on_exceed?: {
10622
+ action: "stop";
10623
+ } | {
10624
+ model: string;
10625
+ action: "degrade";
10626
+ } | undefined;
10627
+ } | undefined;
10628
+ memory?: {
10629
+ enabled?: boolean | undefined;
10630
+ autoCapture?: boolean | undefined;
10631
+ autoCaptureThreshold?: number | undefined;
10632
+ autoRecall?: boolean | undefined;
10633
+ recallK?: number | undefined;
10634
+ } | undefined;
10635
+ observability?: {
10636
+ slo?: {
10637
+ error_rate?: number | undefined;
10638
+ p95_latency_ms?: number | undefined;
10639
+ ttft_ms?: number | undefined;
10640
+ cost_per_hour_usd?: number | undefined;
10641
+ egress_block_rate?: number | undefined;
10642
+ window_seconds?: number | undefined;
10643
+ mitigation?: ["alert" | "pause-intake" | "rollback", ...("alert" | "pause-intake" | "rollback")[]] | undefined;
10644
+ } | undefined;
10645
+ } | undefined;
8101
10646
  }>, z.ZodObject<{
8102
10647
  name: z.ZodString;
10648
+ version: z.ZodOptional<z.ZodNumber>;
8103
10649
  target: z.ZodLiteral<"pipeline">;
8104
10650
  agent: z.ZodObject<{
8105
10651
  model: z.ZodString;
@@ -8225,17 +10771,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8225
10771
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
8226
10772
  class: z.ZodString;
8227
10773
  pattern: z.ZodString;
8228
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
10774
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
8229
10775
  hint: z.ZodOptional<z.ZodString>;
8230
10776
  }, "strict", z.ZodTypeAny, {
8231
10777
  pattern: string;
8232
10778
  class: string;
8233
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10779
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8234
10780
  hint?: string | undefined;
8235
10781
  }, {
8236
10782
  pattern: string;
8237
10783
  class: string;
8238
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10784
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8239
10785
  hint?: string | undefined;
8240
10786
  }>, "many">>;
8241
10787
  }, "strict", z.ZodTypeAny, {
@@ -8270,6 +10816,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8270
10816
  pattern: string;
8271
10817
  }[] | undefined;
8272
10818
  } | undefined;
10819
+ version?: number | undefined;
8273
10820
  compaction?: {
8274
10821
  model?: string | undefined;
8275
10822
  curate?: boolean | undefined;
@@ -8279,7 +10826,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8279
10826
  failure_taxonomy?: {
8280
10827
  pattern: string;
8281
10828
  class: string;
8282
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10829
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8283
10830
  hint?: string | undefined;
8284
10831
  }[] | undefined;
8285
10832
  }, {
@@ -8314,6 +10861,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8314
10861
  pattern: string;
8315
10862
  }[] | undefined;
8316
10863
  } | undefined;
10864
+ version?: number | undefined;
8317
10865
  compaction?: {
8318
10866
  model?: string | undefined;
8319
10867
  curate?: boolean | undefined;
@@ -8323,11 +10871,12 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8323
10871
  failure_taxonomy?: {
8324
10872
  pattern: string;
8325
10873
  class: string;
8326
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
10874
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8327
10875
  hint?: string | undefined;
8328
10876
  }[] | undefined;
8329
10877
  }>, z.ZodObject<{
8330
10878
  name: z.ZodString;
10879
+ version: z.ZodOptional<z.ZodNumber>;
8331
10880
  target: z.ZodLiteral<"crew">;
8332
10881
  /** Crew-wide model fallback used by any role that omits `role.model`. */
8333
10882
  model: z.ZodString;
@@ -8516,17 +11065,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8516
11065
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
8517
11066
  class: z.ZodString;
8518
11067
  pattern: z.ZodString;
8519
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
11068
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
8520
11069
  hint: z.ZodOptional<z.ZodString>;
8521
11070
  }, "strict", z.ZodTypeAny, {
8522
11071
  pattern: string;
8523
11072
  class: string;
8524
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11073
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8525
11074
  hint?: string | undefined;
8526
11075
  }, {
8527
11076
  pattern: string;
8528
11077
  class: string;
8529
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11078
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8530
11079
  hint?: string | undefined;
8531
11080
  }>, "many">>;
8532
11081
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -8669,6 +11218,14 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8669
11218
  pattern: string;
8670
11219
  }[] | undefined;
8671
11220
  } | undefined;
11221
+ routing?: {
11222
+ kind: "match" | "llm";
11223
+ match?: Record<string, {
11224
+ to: string;
11225
+ contains: string;
11226
+ }[]> | undefined;
11227
+ } | undefined;
11228
+ version?: number | undefined;
8672
11229
  mcp_servers?: Record<string, {
8673
11230
  transport: "stdio";
8674
11231
  command: string;
@@ -8688,7 +11245,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8688
11245
  failure_taxonomy?: {
8689
11246
  pattern: string;
8690
11247
  class: string;
8691
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11248
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8692
11249
  hint?: string | undefined;
8693
11250
  }[] | undefined;
8694
11251
  chains?: {
@@ -8726,13 +11283,6 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8726
11283
  maxValueUsd?: number | undefined;
8727
11284
  maxValueWei?: string | undefined;
8728
11285
  } | undefined;
8729
- routing?: {
8730
- kind: "match" | "llm";
8731
- match?: Record<string, {
8732
- to: string;
8733
- contains: string;
8734
- }[]> | undefined;
8735
- } | undefined;
8736
11286
  }, {
8737
11287
  model: string;
8738
11288
  name: string;
@@ -8762,6 +11312,14 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8762
11312
  pattern: string;
8763
11313
  }[] | undefined;
8764
11314
  } | undefined;
11315
+ routing?: {
11316
+ kind: "match" | "llm";
11317
+ match?: Record<string, {
11318
+ to: string;
11319
+ contains: string;
11320
+ }[]> | undefined;
11321
+ } | undefined;
11322
+ version?: number | undefined;
8765
11323
  mcp_servers?: Record<string, {
8766
11324
  transport: "stdio";
8767
11325
  command: string;
@@ -8781,7 +11339,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8781
11339
  failure_taxonomy?: {
8782
11340
  pattern: string;
8783
11341
  class: string;
8784
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11342
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8785
11343
  hint?: string | undefined;
8786
11344
  }[] | undefined;
8787
11345
  chains?: {
@@ -8819,15 +11377,9 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8819
11377
  allowedContracts?: string[] | undefined;
8820
11378
  simulationRequired?: boolean | undefined;
8821
11379
  } | undefined;
8822
- routing?: {
8823
- kind: "match" | "llm";
8824
- match?: Record<string, {
8825
- to: string;
8826
- contains: string;
8827
- }[]> | undefined;
8828
- } | undefined;
8829
11380
  }>, z.ZodObject<{
8830
11381
  name: z.ZodString;
11382
+ version: z.ZodOptional<z.ZodNumber>;
8831
11383
  target: z.ZodLiteral<"research">;
8832
11384
  agent: z.ZodObject<{
8833
11385
  model: z.ZodString;
@@ -8941,19 +11493,38 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
8941
11493
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
8942
11494
  class: z.ZodString;
8943
11495
  pattern: z.ZodString;
8944
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
11496
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
8945
11497
  hint: z.ZodOptional<z.ZodString>;
8946
11498
  }, "strict", z.ZodTypeAny, {
8947
11499
  pattern: string;
8948
11500
  class: string;
8949
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11501
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8950
11502
  hint?: string | undefined;
8951
11503
  }, {
8952
11504
  pattern: string;
8953
11505
  class: string;
8954
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11506
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
8955
11507
  hint?: string | undefined;
8956
11508
  }>, "many">>;
11509
+ memory: z.ZodOptional<z.ZodObject<{
11510
+ enabled: z.ZodOptional<z.ZodBoolean>;
11511
+ autoCapture: z.ZodOptional<z.ZodBoolean>;
11512
+ autoCaptureThreshold: z.ZodOptional<z.ZodNumber>;
11513
+ autoRecall: z.ZodOptional<z.ZodBoolean>;
11514
+ recallK: z.ZodOptional<z.ZodNumber>;
11515
+ }, "strict", z.ZodTypeAny, {
11516
+ enabled?: boolean | undefined;
11517
+ autoCapture?: boolean | undefined;
11518
+ autoCaptureThreshold?: number | undefined;
11519
+ autoRecall?: boolean | undefined;
11520
+ recallK?: number | undefined;
11521
+ }, {
11522
+ enabled?: boolean | undefined;
11523
+ autoCapture?: boolean | undefined;
11524
+ autoCaptureThreshold?: number | undefined;
11525
+ autoRecall?: boolean | undefined;
11526
+ recallK?: number | undefined;
11527
+ }>>;
8957
11528
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
8958
11529
  id: z.ZodString;
8959
11530
  kind: z.ZodLiteral<"evm">;
@@ -9088,6 +11659,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9088
11659
  pattern: string;
9089
11660
  }[] | undefined;
9090
11661
  } | undefined;
11662
+ version?: number | undefined;
9091
11663
  tool_config?: Record<string, unknown> | undefined;
9092
11664
  mcp_servers?: Record<string, {
9093
11665
  transport: "stdio";
@@ -9108,9 +11680,16 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9108
11680
  failure_taxonomy?: {
9109
11681
  pattern: string;
9110
11682
  class: string;
9111
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11683
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9112
11684
  hint?: string | undefined;
9113
11685
  }[] | undefined;
11686
+ memory?: {
11687
+ enabled?: boolean | undefined;
11688
+ autoCapture?: boolean | undefined;
11689
+ autoCaptureThreshold?: number | undefined;
11690
+ autoRecall?: boolean | undefined;
11691
+ recallK?: number | undefined;
11692
+ } | undefined;
9114
11693
  chains?: {
9115
11694
  kind: "evm";
9116
11695
  id: string;
@@ -9162,6 +11741,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9162
11741
  pattern: string;
9163
11742
  }[] | undefined;
9164
11743
  } | undefined;
11744
+ version?: number | undefined;
9165
11745
  tool_config?: Record<string, unknown> | undefined;
9166
11746
  mcp_servers?: Record<string, {
9167
11747
  transport: "stdio";
@@ -9182,9 +11762,16 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9182
11762
  failure_taxonomy?: {
9183
11763
  pattern: string;
9184
11764
  class: string;
9185
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11765
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9186
11766
  hint?: string | undefined;
9187
11767
  }[] | undefined;
11768
+ memory?: {
11769
+ enabled?: boolean | undefined;
11770
+ autoCapture?: boolean | undefined;
11771
+ autoCaptureThreshold?: number | undefined;
11772
+ autoRecall?: boolean | undefined;
11773
+ recallK?: number | undefined;
11774
+ } | undefined;
9188
11775
  chains?: {
9189
11776
  kind: "evm";
9190
11777
  id: string;
@@ -9229,6 +11816,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9229
11816
  maxDurationMs?: number | undefined;
9230
11817
  }>, z.ZodObject<{
9231
11818
  name: z.ZodString;
11819
+ version: z.ZodOptional<z.ZodNumber>;
9232
11820
  target: z.ZodLiteral<"batch">;
9233
11821
  agent: z.ZodObject<{
9234
11822
  model: z.ZodString;
@@ -9347,17 +11935,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9347
11935
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
9348
11936
  class: z.ZodString;
9349
11937
  pattern: z.ZodString;
9350
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
11938
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
9351
11939
  hint: z.ZodOptional<z.ZodString>;
9352
11940
  }, "strict", z.ZodTypeAny, {
9353
11941
  pattern: string;
9354
11942
  class: string;
9355
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11943
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9356
11944
  hint?: string | undefined;
9357
11945
  }, {
9358
11946
  pattern: string;
9359
11947
  class: string;
9360
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
11948
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9361
11949
  hint?: string | undefined;
9362
11950
  }>, "many">>;
9363
11951
  chains: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -9495,6 +12083,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9495
12083
  pattern: string;
9496
12084
  }[] | undefined;
9497
12085
  } | undefined;
12086
+ version?: number | undefined;
9498
12087
  tool_config?: Record<string, unknown> | undefined;
9499
12088
  mcp_servers?: Record<string, {
9500
12089
  transport: "stdio";
@@ -9515,7 +12104,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9515
12104
  failure_taxonomy?: {
9516
12105
  pattern: string;
9517
12106
  class: string;
9518
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12107
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9519
12108
  hint?: string | undefined;
9520
12109
  }[] | undefined;
9521
12110
  chains?: {
@@ -9575,6 +12164,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9575
12164
  pattern: string;
9576
12165
  }[] | undefined;
9577
12166
  } | undefined;
12167
+ version?: number | undefined;
9578
12168
  tool_config?: Record<string, unknown> | undefined;
9579
12169
  mcp_servers?: Record<string, {
9580
12170
  transport: "stdio";
@@ -9595,7 +12185,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9595
12185
  failure_taxonomy?: {
9596
12186
  pattern: string;
9597
12187
  class: string;
9598
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12188
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9599
12189
  hint?: string | undefined;
9600
12190
  }[] | undefined;
9601
12191
  chains?: {
@@ -9637,6 +12227,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9637
12227
  idempotencyWindowMs?: number | undefined;
9638
12228
  }>, z.ZodObject<{
9639
12229
  name: z.ZodString;
12230
+ version: z.ZodOptional<z.ZodNumber>;
9640
12231
  target: z.ZodLiteral<"voice">;
9641
12232
  agent: z.ZodObject<{
9642
12233
  model: z.ZodString;
@@ -9760,17 +12351,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9760
12351
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
9761
12352
  class: z.ZodString;
9762
12353
  pattern: z.ZodString;
9763
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
12354
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
9764
12355
  hint: z.ZodOptional<z.ZodString>;
9765
12356
  }, "strict", z.ZodTypeAny, {
9766
12357
  pattern: string;
9767
12358
  class: string;
9768
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12359
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9769
12360
  hint?: string | undefined;
9770
12361
  }, {
9771
12362
  pattern: string;
9772
12363
  class: string;
9773
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12364
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9774
12365
  hint?: string | undefined;
9775
12366
  }>, "many">>;
9776
12367
  }, "strict", z.ZodTypeAny, {
@@ -9795,6 +12386,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9795
12386
  pattern: string;
9796
12387
  }[] | undefined;
9797
12388
  } | undefined;
12389
+ version?: number | undefined;
9798
12390
  tool_config?: Record<string, unknown> | undefined;
9799
12391
  mcp_servers?: Record<string, {
9800
12392
  transport: "stdio";
@@ -9815,7 +12407,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9815
12407
  failure_taxonomy?: {
9816
12408
  pattern: string;
9817
12409
  class: string;
9818
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12410
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9819
12411
  hint?: string | undefined;
9820
12412
  }[] | undefined;
9821
12413
  telephony?: {
@@ -9843,6 +12435,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9843
12435
  pattern: string;
9844
12436
  }[] | undefined;
9845
12437
  } | undefined;
12438
+ version?: number | undefined;
9846
12439
  tool_config?: Record<string, unknown> | undefined;
9847
12440
  mcp_servers?: Record<string, {
9848
12441
  transport: "stdio";
@@ -9863,7 +12456,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9863
12456
  failure_taxonomy?: {
9864
12457
  pattern: string;
9865
12458
  class: string;
9866
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12459
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
9867
12460
  hint?: string | undefined;
9868
12461
  }[] | undefined;
9869
12462
  telephony?: {
@@ -9871,6 +12464,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9871
12464
  } | undefined;
9872
12465
  }>, z.ZodObject<{
9873
12466
  name: z.ZodString;
12467
+ version: z.ZodOptional<z.ZodNumber>;
9874
12468
  target: z.ZodLiteral<"browser">;
9875
12469
  agent: z.ZodObject<{
9876
12470
  model: z.ZodString;
@@ -9998,17 +12592,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
9998
12592
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
9999
12593
  class: z.ZodString;
10000
12594
  pattern: z.ZodString;
10001
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
12595
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
10002
12596
  hint: z.ZodOptional<z.ZodString>;
10003
12597
  }, "strict", z.ZodTypeAny, {
10004
12598
  pattern: string;
10005
12599
  class: string;
10006
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12600
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10007
12601
  hint?: string | undefined;
10008
12602
  }, {
10009
12603
  pattern: string;
10010
12604
  class: string;
10011
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12605
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10012
12606
  hint?: string | undefined;
10013
12607
  }>, "many">>;
10014
12608
  }, "strict", z.ZodTypeAny, {
@@ -10034,6 +12628,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10034
12628
  pattern: string;
10035
12629
  }[] | undefined;
10036
12630
  } | undefined;
12631
+ version?: number | undefined;
10037
12632
  tool_config?: Record<string, unknown> | undefined;
10038
12633
  mcp_servers?: Record<string, {
10039
12634
  transport: "stdio";
@@ -10054,7 +12649,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10054
12649
  failure_taxonomy?: {
10055
12650
  pattern: string;
10056
12651
  class: string;
10057
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12652
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10058
12653
  hint?: string | undefined;
10059
12654
  }[] | undefined;
10060
12655
  groundingModel?: string | undefined;
@@ -10073,6 +12668,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10073
12668
  pattern: string;
10074
12669
  }[] | undefined;
10075
12670
  } | undefined;
12671
+ version?: number | undefined;
10076
12672
  tool_config?: Record<string, unknown> | undefined;
10077
12673
  mcp_servers?: Record<string, {
10078
12674
  transport: "stdio";
@@ -10093,7 +12689,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10093
12689
  failure_taxonomy?: {
10094
12690
  pattern: string;
10095
12691
  class: string;
10096
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12692
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10097
12693
  hint?: string | undefined;
10098
12694
  }[] | undefined;
10099
12695
  driver?: {
@@ -10107,6 +12703,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10107
12703
  groundingModel?: string | undefined;
10108
12704
  }>, z.ZodObject<{
10109
12705
  name: z.ZodString;
12706
+ version: z.ZodOptional<z.ZodNumber>;
10110
12707
  target: z.ZodLiteral<"eval">;
10111
12708
  agent: z.ZodObject<{
10112
12709
  model: z.ZodString;
@@ -10149,17 +12746,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10149
12746
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
10150
12747
  class: z.ZodString;
10151
12748
  pattern: z.ZodString;
10152
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
12749
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
10153
12750
  hint: z.ZodOptional<z.ZodString>;
10154
12751
  }, "strict", z.ZodTypeAny, {
10155
12752
  pattern: string;
10156
12753
  class: string;
10157
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12754
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10158
12755
  hint?: string | undefined;
10159
12756
  }, {
10160
12757
  pattern: string;
10161
12758
  class: string;
10162
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12759
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10163
12760
  hint?: string | undefined;
10164
12761
  }>, "many">>;
10165
12762
  }, "strict", z.ZodTypeAny, {
@@ -10180,10 +12777,11 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10180
12777
  name: string;
10181
12778
  opts?: Record<string, unknown> | undefined;
10182
12779
  }[];
12780
+ version?: number | undefined;
10183
12781
  failure_taxonomy?: {
10184
12782
  pattern: string;
10185
12783
  class: string;
10186
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12784
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10187
12785
  hint?: string | undefined;
10188
12786
  }[] | undefined;
10189
12787
  seed?: number | undefined;
@@ -10204,16 +12802,18 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10204
12802
  name: string;
10205
12803
  opts?: Record<string, unknown> | undefined;
10206
12804
  }[];
12805
+ version?: number | undefined;
10207
12806
  failure_taxonomy?: {
10208
12807
  pattern: string;
10209
12808
  class: string;
10210
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
12809
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10211
12810
  hint?: string | undefined;
10212
12811
  }[] | undefined;
10213
12812
  concurrency?: number | undefined;
10214
12813
  seed?: number | undefined;
10215
12814
  }>, z.ZodObject<{
10216
12815
  name: z.ZodString;
12816
+ version: z.ZodOptional<z.ZodNumber>;
10217
12817
  target: z.ZodLiteral<"onchain">;
10218
12818
  agent: z.ZodObject<{
10219
12819
  model: z.ZodString;
@@ -10469,17 +13069,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10469
13069
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
10470
13070
  class: z.ZodString;
10471
13071
  pattern: z.ZodString;
10472
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
13072
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
10473
13073
  hint: z.ZodOptional<z.ZodString>;
10474
13074
  }, "strict", z.ZodTypeAny, {
10475
13075
  pattern: string;
10476
13076
  class: string;
10477
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13077
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10478
13078
  hint?: string | undefined;
10479
13079
  }, {
10480
13080
  pattern: string;
10481
13081
  class: string;
10482
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13082
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10483
13083
  hint?: string | undefined;
10484
13084
  }>, "many">>;
10485
13085
  }, "strict", z.ZodTypeAny, {
@@ -10549,6 +13149,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10549
13149
  pattern: string;
10550
13150
  }[] | undefined;
10551
13151
  } | undefined;
13152
+ version?: number | undefined;
10552
13153
  tool_config?: Record<string, unknown> | undefined;
10553
13154
  mcp_servers?: Record<string, {
10554
13155
  transport: "stdio";
@@ -10569,7 +13170,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10569
13170
  failure_taxonomy?: {
10570
13171
  pattern: string;
10571
13172
  class: string;
10572
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13173
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10573
13174
  hint?: string | undefined;
10574
13175
  }[] | undefined;
10575
13176
  }, {
@@ -10618,6 +13219,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10618
13219
  pattern: string;
10619
13220
  }[] | undefined;
10620
13221
  } | undefined;
13222
+ version?: number | undefined;
10621
13223
  tool_config?: Record<string, unknown> | undefined;
10622
13224
  mcp_servers?: Record<string, {
10623
13225
  transport: "stdio";
@@ -10638,7 +13240,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10638
13240
  failure_taxonomy?: {
10639
13241
  pattern: string;
10640
13242
  class: string;
10641
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13243
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10642
13244
  hint?: string | undefined;
10643
13245
  }[] | undefined;
10644
13246
  wallets?: {
@@ -10664,6 +13266,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10664
13266
  idempotencyWindowMs?: number | undefined;
10665
13267
  }>, z.ZodObject<{
10666
13268
  name: z.ZodString;
13269
+ version: z.ZodOptional<z.ZodNumber>;
10667
13270
  target: z.ZodLiteral<"onchain-game">;
10668
13271
  agent: z.ZodObject<{
10669
13272
  model: z.ZodString;
@@ -10903,17 +13506,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10903
13506
  failure_taxonomy: z.ZodOptional<z.ZodArray<z.ZodObject<{
10904
13507
  class: z.ZodString;
10905
13508
  pattern: z.ZodString;
10906
- recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "fail"]>;
13509
+ recovery: z.ZodEnum<["retry", "compact", "continue", "tombstone", "switch-model", "fail"]>;
10907
13510
  hint: z.ZodOptional<z.ZodString>;
10908
13511
  }, "strict", z.ZodTypeAny, {
10909
13512
  pattern: string;
10910
13513
  class: string;
10911
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13514
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10912
13515
  hint?: string | undefined;
10913
13516
  }, {
10914
13517
  pattern: string;
10915
13518
  class: string;
10916
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13519
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10917
13520
  hint?: string | undefined;
10918
13521
  }>, "many">>;
10919
13522
  }, "strict", z.ZodTypeAny, {
@@ -10973,6 +13576,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10973
13576
  pattern: string;
10974
13577
  }[] | undefined;
10975
13578
  } | undefined;
13579
+ version?: number | undefined;
10976
13580
  tool_config?: Record<string, unknown> | undefined;
10977
13581
  mcp_servers?: Record<string, {
10978
13582
  transport: "stdio";
@@ -10993,7 +13597,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
10993
13597
  failure_taxonomy?: {
10994
13598
  pattern: string;
10995
13599
  class: string;
10996
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13600
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
10997
13601
  hint?: string | undefined;
10998
13602
  }[] | undefined;
10999
13603
  }, {
@@ -11046,6 +13650,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
11046
13650
  pattern: string;
11047
13651
  }[] | undefined;
11048
13652
  } | undefined;
13653
+ version?: number | undefined;
11049
13654
  tool_config?: Record<string, unknown> | undefined;
11050
13655
  mcp_servers?: Record<string, {
11051
13656
  transport: "stdio";
@@ -11066,7 +13671,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
11066
13671
  failure_taxonomy?: {
11067
13672
  pattern: string;
11068
13673
  class: string;
11069
- recovery: "retry" | "compact" | "continue" | "tombstone" | "fail";
13674
+ recovery: "retry" | "compact" | "continue" | "tombstone" | "switch-model" | "fail";
11070
13675
  hint?: string | undefined;
11071
13676
  }[] | undefined;
11072
13677
  transaction_policy?: {
@@ -11114,7 +13719,13 @@ export type SpecEval = z.infer<typeof evalSchema>;
11114
13719
  export type SpecMcpServerConfig = z.infer<typeof mcpServerConfigSchema>;
11115
13720
  export type SpecSubAgentDefinition = z.infer<typeof subAgentDefinitionSchema>;
11116
13721
  export type SpecCompactionBlock = z.infer<typeof compactionBlock>;
13722
+ export type SpecModelFallbacks = z.infer<typeof modelFallbacksBlock>;
13723
+ export type SpecCircuitBreakerBlock = z.infer<typeof circuitBreakerBlock>;
13724
+ export type SpecModelTiersBlock = z.infer<typeof modelTiersBlock>;
13725
+ export type SpecBudgetBlock = z.infer<typeof budgetBlock>;
11117
13726
  export type SpecSecurityBlock = z.infer<typeof securityBlock>;
13727
+ export type SpecFeedbackBlock = z.infer<typeof feedbackBlock>;
13728
+ export type SpecMemoryBlock = z.infer<typeof memoryBlock>;
11118
13729
  export type SpecFailureTaxonomyEntry = z.infer<typeof failureTaxonomyEntrySchema>;
11119
13730
  export type SpecFailureTaxonomy = z.infer<typeof failureTaxonomyBlock>;
11120
13731
  export { SpecParseError };