@independo/inderun-contracts 0.4.0 → 0.5.0-rc.2

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 (73) hide show
  1. package/dist/generated/artifact-read-request.d.ts +24 -0
  2. package/dist/generated/artifact-read-request.d.ts.map +1 -0
  3. package/dist/generated/artifact-read-request.js +2 -0
  4. package/dist/generated/execution-provenance.d.ts +8 -1
  5. package/dist/generated/execution-provenance.d.ts.map +1 -1
  6. package/dist/generated/inderun-error.d.ts +8 -1
  7. package/dist/generated/inderun-error.d.ts.map +1 -1
  8. package/dist/generated/index.d.ts +6 -0
  9. package/dist/generated/index.d.ts.map +1 -1
  10. package/dist/generated/media-artifact.d.ts +53 -0
  11. package/dist/generated/media-artifact.d.ts.map +1 -0
  12. package/dist/generated/media-artifact.js +2 -0
  13. package/dist/generated/provider-capability-snapshot.d.ts +370 -0
  14. package/dist/generated/provider-capability-snapshot.d.ts.map +1 -0
  15. package/dist/generated/provider-capability-snapshot.js +2 -0
  16. package/dist/generated/provider-descriptor.d.ts +264 -0
  17. package/dist/generated/provider-descriptor.d.ts.map +1 -0
  18. package/dist/generated/provider-descriptor.js +2 -0
  19. package/dist/generated/provider-dynamic-capabilities.d.ts +99 -0
  20. package/dist/generated/provider-dynamic-capabilities.d.ts.map +1 -0
  21. package/dist/generated/provider-dynamic-capabilities.js +2 -0
  22. package/dist/generated/route-plan.d.ts +47 -3
  23. package/dist/generated/route-plan.d.ts.map +1 -1
  24. package/dist/generated/route-planner-input.d.ts +417 -32
  25. package/dist/generated/route-planner-input.d.ts.map +1 -1
  26. package/dist/generated/schemas.d.ts +833 -115
  27. package/dist/generated/schemas.d.ts.map +1 -1
  28. package/dist/generated/schemas.js +1038 -160
  29. package/dist/generated/stream-event.d.ts +136 -1
  30. package/dist/generated/stream-event.d.ts.map +1 -1
  31. package/dist/generated/stream-terminal-outcome.d.ts +182 -18
  32. package/dist/generated/stream-terminal-outcome.d.ts.map +1 -1
  33. package/dist/generated/task-output.d.ts +128 -0
  34. package/dist/generated/task-output.d.ts.map +1 -0
  35. package/dist/generated/task-output.js +2 -0
  36. package/dist/generated/task-request.d.ts +116 -11
  37. package/dist/generated/task-request.d.ts.map +1 -1
  38. package/dist/generated/task-result.d.ts +139 -15
  39. package/dist/generated/task-result.d.ts.map +1 -1
  40. package/dist/generated/telemetry-event.d.ts +2 -2
  41. package/dist/generated/telemetry-event.d.ts.map +1 -1
  42. package/dist/host.d.ts +24 -1
  43. package/dist/host.d.ts.map +1 -1
  44. package/dist/index.d.ts +5 -5
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -2
  47. package/dist/types.d.ts +46 -2
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/validators.d.ts +18 -0
  50. package/dist/validators.d.ts.map +1 -1
  51. package/dist/validators.js +49 -1
  52. package/package.json +1 -1
  53. package/src/generated/artifact-read-request.ts +25 -0
  54. package/src/generated/execution-provenance.ts +8 -1
  55. package/src/generated/inderun-error.ts +8 -1
  56. package/src/generated/index.ts +6 -0
  57. package/src/generated/media-artifact.ts +56 -0
  58. package/src/generated/provider-capability-snapshot.ts +388 -0
  59. package/src/generated/provider-descriptor.ts +278 -0
  60. package/src/generated/provider-dynamic-capabilities.ts +103 -0
  61. package/src/generated/route-plan.ts +49 -3
  62. package/src/generated/route-planner-input.ts +437 -36
  63. package/src/generated/schemas.ts +1044 -160
  64. package/src/generated/stream-event.ts +145 -1
  65. package/src/generated/stream-terminal-outcome.ts +191 -18
  66. package/src/generated/task-output.ts +137 -0
  67. package/src/generated/task-request.ts +124 -11
  68. package/src/generated/task-result.ts +147 -15
  69. package/src/generated/telemetry-event.ts +2 -2
  70. package/src/host.ts +30 -1
  71. package/src/index.ts +28 -1
  72. package/src/types.ts +38 -1
  73. package/src/validators.ts +76 -0
@@ -2,14 +2,72 @@ export declare const taskRequestSchema: {
2
2
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
3
3
  readonly $id: "https://schemas.inderun.dev/1.0/task-request.schema.json";
4
4
  readonly title: "TaskRequest";
5
- readonly description: "The request payload for a Mode 1 (request/response) text-to-text execution. At least one of `prompt` (single-turn) or `messages` (multi-turn) must be present — both may be present together, though callers should typically supply just one; `constraints`/`preferences` steer routing but never select a provider directly.";
5
+ readonly description: "The request payload for a run() or stream() execution. The common envelope (schemaVersion, requestId, task, modelProfile, constraints, preferences, telemetry, authContextRef) is task-agnostic; each task kind owns its payload (ADR 016). text_to_text: at least one of `prompt` (single-turn) or `messages` (multi-turn) must be present — both may be present together, though callers should typically supply just one — and `speech`/`delivery` are forbidden. text_to_speech: `speech` and `delivery` are required and `prompt`, `messages` and `generation` are forbidden. `constraints`/`preferences` steer routing but never select a provider directly.";
6
6
  readonly type: "object";
7
7
  readonly additionalProperties: true;
8
8
  readonly required: readonly ["schemaVersion", "task"];
9
- readonly anyOf: readonly [{
10
- readonly required: readonly ["prompt"];
9
+ readonly allOf: readonly [{
10
+ readonly if: {
11
+ readonly properties: {
12
+ readonly task: {
13
+ readonly type: "object";
14
+ readonly properties: {
15
+ readonly kind: {
16
+ readonly const: "text_to_text";
17
+ };
18
+ };
19
+ };
20
+ };
21
+ };
22
+ readonly then: {
23
+ readonly anyOf: readonly [{
24
+ readonly required: readonly ["prompt"];
25
+ }, {
26
+ readonly required: readonly ["messages"];
27
+ }];
28
+ readonly not: {
29
+ readonly anyOf: readonly [{
30
+ readonly required: readonly ["speech"];
31
+ }, {
32
+ readonly required: readonly ["delivery"];
33
+ }];
34
+ };
35
+ };
11
36
  }, {
12
- readonly required: readonly ["messages"];
37
+ readonly if: {
38
+ readonly properties: {
39
+ readonly task: {
40
+ readonly type: "object";
41
+ readonly properties: {
42
+ readonly kind: {
43
+ readonly const: "text_to_speech";
44
+ };
45
+ };
46
+ };
47
+ };
48
+ };
49
+ readonly then: {
50
+ readonly required: readonly ["speech", "delivery"];
51
+ readonly not: {
52
+ readonly anyOf: readonly [{
53
+ readonly required: readonly ["prompt"];
54
+ }, {
55
+ readonly required: readonly ["messages"];
56
+ }, {
57
+ readonly required: readonly ["generation"];
58
+ }];
59
+ };
60
+ readonly properties: {
61
+ readonly delivery: {
62
+ readonly type: "object";
63
+ readonly properties: {
64
+ readonly mode: {
65
+ readonly enum: readonly ["playback", "artifact"];
66
+ };
67
+ };
68
+ };
69
+ };
70
+ };
13
71
  }];
14
72
  readonly properties: {
15
73
  readonly schemaVersion: {
@@ -22,14 +80,15 @@ export declare const taskRequestSchema: {
22
80
  readonly minLength: 1;
23
81
  };
24
82
  readonly task: {
25
- readonly description: "A descriptor specifying the type of work to be performed. For text-to-text, the kind must be 'text_to_text'.";
83
+ readonly description: "A descriptor specifying the type of work to be performed. The kind selects which payload the request must carry.";
26
84
  readonly type: "object";
27
85
  readonly additionalProperties: true;
28
86
  readonly required: readonly ["kind"];
29
87
  readonly properties: {
30
88
  readonly kind: {
31
- readonly description: "The standard task category. Currently supports 'text_to_text' for prompt-based interactions.";
32
- readonly const: "text_to_text";
89
+ readonly title: "TaskKind";
90
+ readonly description: "The operation: 'text_to_text' (prompt-based text generation) or 'text_to_speech' (speech synthesis from text). A consumer built against an older revision rejects a kind it does not know through validation.";
91
+ readonly enum: readonly ["text_to_text", "text_to_speech"];
33
92
  };
34
93
  };
35
94
  };
@@ -60,6 +119,100 @@ export declare const taskRequestSchema: {
60
119
  };
61
120
  };
62
121
  };
122
+ readonly speech: {
123
+ readonly title: "SpeechInput";
124
+ readonly description: "The text_to_speech payload. Required for text_to_speech and forbidden for every other kind.";
125
+ readonly type: "object";
126
+ readonly additionalProperties: true;
127
+ readonly required: readonly ["text", "locale"];
128
+ readonly properties: {
129
+ readonly text: {
130
+ readonly description: "Plain text to speak. Markup such as SSML is out of scope.";
131
+ readonly type: "string";
132
+ readonly minLength: 1;
133
+ };
134
+ readonly locale: {
135
+ readonly description: "BCP 47 tag of the language to speak, e.g. 'de-AT'.";
136
+ readonly type: "string";
137
+ readonly minLength: 1;
138
+ };
139
+ readonly localeMatch: {
140
+ readonly title: "LocaleMatch";
141
+ readonly description: "'language' (default): the primary language subtag is a hard requirement and the region is a preference. 'exact': the full tag is a hard requirement.";
142
+ readonly enum: readonly ["exact", "language"];
143
+ };
144
+ readonly voice: {
145
+ readonly title: "SpeechVoice";
146
+ readonly description: "Provider-neutral voice traits. A 'preferred' voice (default) shapes which voice speaks and is never a reason to fail; a 'required' one takes part in routing and is never relaxed silently. Carries no provider voice identifier.";
147
+ readonly type: "object";
148
+ readonly additionalProperties: true;
149
+ readonly if: {
150
+ readonly properties: {
151
+ readonly requirement: {
152
+ readonly const: "required";
153
+ };
154
+ };
155
+ readonly required: readonly ["requirement"];
156
+ };
157
+ readonly then: {
158
+ readonly required: readonly ["gender"];
159
+ };
160
+ readonly properties: {
161
+ readonly gender: {
162
+ readonly $ref: "provider-dynamic-capabilities.schema.json#/$defs/voiceGender";
163
+ };
164
+ readonly requirement: {
165
+ readonly title: "RequirementLevel";
166
+ readonly description: "'preferred' (default) or 'required'. A required voice must name at least one trait.";
167
+ readonly enum: readonly ["required", "preferred"];
168
+ };
169
+ };
170
+ };
171
+ };
172
+ };
173
+ readonly delivery: {
174
+ readonly title: "OutputDeliveryRequest";
175
+ readonly description: "How the result of a non-text task must reach the application (ADR 016). Required for non-text tasks and forbidden for text_to_text, whose output is implicitly inline. A provider never substitutes playback for an artifact or the reverse.";
176
+ readonly type: "object";
177
+ readonly additionalProperties: true;
178
+ readonly required: readonly ["mode"];
179
+ readonly if: {
180
+ readonly properties: {
181
+ readonly mode: {
182
+ readonly const: "artifact";
183
+ };
184
+ };
185
+ };
186
+ readonly else: {
187
+ readonly not: {
188
+ readonly anyOf: readonly [{
189
+ readonly required: readonly ["mediaTypes"];
190
+ }, {
191
+ readonly required: readonly ["destinationRef"];
192
+ }];
193
+ };
194
+ };
195
+ readonly properties: {
196
+ readonly mode: {
197
+ readonly $ref: "provider-descriptor.schema.json#/$defs/outputDelivery";
198
+ };
199
+ readonly mediaTypes: {
200
+ readonly description: "Only valid with 'artifact' delivery: the acceptable media types, always a hard requirement. Absent means the provider chooses and the artifact reports what it produced.";
201
+ readonly type: "array";
202
+ readonly minItems: 1;
203
+ readonly uniqueItems: true;
204
+ readonly items: {
205
+ readonly type: "string";
206
+ readonly minLength: 1;
207
+ };
208
+ };
209
+ readonly destinationRef: {
210
+ readonly description: "Only valid with 'artifact' delivery: an opaque reference to an application destination the engine writes the finished artifact to, resolved by the host's artifact-destination service (ADR 017) -- never a raw path or URL, like authContextRef for credentials. The result's artifact is then application-owned and the engine keeps no copy. A host without the service refuses the request before routing.";
211
+ readonly type: "string";
212
+ readonly minLength: 1;
213
+ };
214
+ };
215
+ };
63
216
  readonly modelProfile: {
64
217
  readonly description: "Name of the model profile to route within, as configured on the engine. Absent or 'auto' means every registered target, ranked by constraints and preferences alone. A profile is an application-defined, ordered allow-list of targets (provider instances bound to one model each); raw model or provider identifiers are never accepted here. An unknown profile name fails request validation.";
65
218
  readonly type: "string";
@@ -114,7 +267,7 @@ export declare const taskRequestSchema: {
114
267
  readonly enum: readonly ["forbidden", "allowed", "required"];
115
268
  };
116
269
  readonly timeoutMs: {
117
- readonly description: "Optional routing timeout budget in milliseconds.";
270
+ readonly description: "Optional timeout budget in milliseconds, passed to the planner and to providers. It bounds the time until the run commits to a provider -- its first content, its first possible audible effect, or its artifact handoff -- not the duration of audio it plays. The engines add no timers of their own.";
118
271
  readonly type: "integer";
119
272
  readonly minimum: 1;
120
273
  };
@@ -164,7 +317,7 @@ export declare const taskResultSchema: {
164
317
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
165
318
  readonly $id: "https://schemas.inderun.dev/1.0/task-result.schema.json";
166
319
  readonly title: "TaskResult";
167
- readonly description: "The response payload for a completed text-to-text execution. A full execution failure (validation, routing, or every attempted provider failing) is surfaced by run() throwing an IndeRunError instead of returning a TaskResult; finishReason and telemetry.errorClass are reserved for a provider reporting a non-fatal, degraded outcome on an otherwise-successful result (finishReason 'error' is produced by the Android ML Kit GenAI provider; telemetry.errorClass is not currently set by any provider in this codebase).";
320
+ readonly description: "The response payload for a completed run() execution, for every task kind; output.type tells the content representation apart (text, managed playback, retrievable artifact). A full execution failure (validation, routing, or every attempted provider failing) is surfaced by run() throwing an IndeRunError instead of returning a TaskResult; finishReason and telemetry.errorClass are reserved for a provider reporting a non-fatal, degraded outcome on an otherwise-successful result (finishReason 'error' is produced by the Android ML Kit GenAI provider; telemetry.errorClass is not currently set by any provider in this codebase).";
168
321
  readonly type: "object";
169
322
  readonly additionalProperties: true;
170
323
  readonly required: readonly ["schemaVersion", "runId", "output", "finishReason", "telemetry"];
@@ -179,20 +332,8 @@ export declare const taskResultSchema: {
179
332
  readonly minLength: 1;
180
333
  };
181
334
  readonly output: {
182
- readonly description: "The normalized content returned from the selected provider.";
183
- readonly type: "object";
184
- readonly additionalProperties: true;
185
- readonly required: readonly ["type", "text"];
186
- readonly properties: {
187
- readonly type: {
188
- readonly description: "Output payload category (e.g., 'text' for Mode 1 text-to-text).";
189
- readonly const: "text";
190
- };
191
- readonly text: {
192
- readonly description: "The actual text generated by the execution.";
193
- readonly type: "string";
194
- };
195
- };
335
+ readonly description: "The normalized output of the selected provider. See task-output.schema.json.";
336
+ readonly $ref: "task-output.schema.json";
196
337
  };
197
338
  readonly finishReason: {
198
339
  readonly description: "How generation ended: 'stop' (natural end), 'length' (hit maxOutputTokens), or 'cancelled'. 'error' is reserved for a provider reporting a non-fatal issue on an otherwise-returned result — the Android ML Kit GenAI provider produces it when Gemini Nano reports a finish reason that is neither a natural stop nor the token limit. A full execution failure is instead surfaced by run() throwing an IndeRunError.";
@@ -383,6 +524,7 @@ export declare const telemetryEventSchema: {
383
524
  readonly required: readonly ["type", "runId", "timestamp", "payload"];
384
525
  readonly properties: {
385
526
  readonly type: {
527
+ readonly title: "TelemetryEventType";
386
528
  readonly description: "Telemetry event kind emitted by the orchestrator or provider integration.";
387
529
  readonly enum: readonly ["route_decided", "attempt_succeeded", "attempt_failed", "stream_attempt_started", "stream_attempt_succeeded", "stream_attempt_failed", "stream_completed", "stream_failed", "stream_cancelled"];
388
530
  };
@@ -413,15 +555,79 @@ export declare const routePlannerInputSchema: {
413
555
  readonly required: readonly ["task", "constraints", "preferences", "providers"];
414
556
  readonly properties: {
415
557
  readonly task: {
416
- readonly description: "Minimal task descriptor for provider task matching.";
558
+ readonly description: "Task descriptor for provider task matching: the kind plus the requirements routing can check against declared capabilities. Absent requirement fields are never checked, so a text request carries the kind alone.";
417
559
  readonly type: "object";
418
560
  readonly additionalProperties: true;
419
561
  readonly required: readonly ["kind"];
420
562
  readonly properties: {
421
563
  readonly kind: {
564
+ readonly description: "The task kind, matched against the providers' task capabilities.";
422
565
  readonly type: "string";
423
566
  readonly minLength: 1;
424
567
  };
568
+ readonly inputs: {
569
+ readonly description: "Input media kinds the request carries. Every one must be accepted by the provider's task capability. The SDKs send ['text'] for text_to_text.";
570
+ readonly type: "array";
571
+ readonly items: {
572
+ readonly $ref: "provider-descriptor.schema.json#/$defs/inputKind";
573
+ };
574
+ };
575
+ readonly delivery: {
576
+ readonly title: "DeliveryRequirement";
577
+ readonly description: "The output delivery the request requires. Absent for text, whose delivery is implicitly inline.";
578
+ readonly type: "object";
579
+ readonly additionalProperties: true;
580
+ readonly required: readonly ["mode"];
581
+ readonly properties: {
582
+ readonly mode: {
583
+ readonly $ref: "provider-descriptor.schema.json#/$defs/outputDelivery";
584
+ };
585
+ readonly mediaTypes: {
586
+ readonly description: "Acceptable media types; the provider must declare at least one for the requested delivery. Absent means any.";
587
+ readonly type: "array";
588
+ readonly items: {
589
+ readonly type: "string";
590
+ readonly minLength: 1;
591
+ };
592
+ };
593
+ };
594
+ };
595
+ readonly locale: {
596
+ readonly title: "LocaleRequirement";
597
+ readonly description: "The locale the request requires. Under 'language' matching the region is a preference: a provider known to offer the exact tag ranks ahead of an otherwise equal one. A provider that cannot enumerate its locales is not rejected on this basis; it must fail before committing instead.";
598
+ readonly type: "object";
599
+ readonly additionalProperties: true;
600
+ readonly required: readonly ["tag", "match"];
601
+ readonly properties: {
602
+ readonly tag: {
603
+ readonly description: "BCP 47 tag.";
604
+ readonly type: "string";
605
+ readonly minLength: 1;
606
+ };
607
+ readonly match: {
608
+ readonly title: "LocaleMatch";
609
+ readonly description: "'exact' requires the full tag; 'language' requires only the primary language subtag and treats the region as a preference.";
610
+ readonly enum: readonly ["exact", "language"];
611
+ };
612
+ };
613
+ };
614
+ readonly voice: {
615
+ readonly title: "VoiceRequirement";
616
+ readonly description: "Voice traits the request asks for. Only a 'required' voice can reject a provider; a 'preferred' one shapes which listed voice the plan binds a candidate to, always within the request's privacy policy.";
617
+ readonly type: "object";
618
+ readonly additionalProperties: true;
619
+ readonly required: readonly ["requirement"];
620
+ readonly properties: {
621
+ readonly gender: {
622
+ readonly $ref: "provider-dynamic-capabilities.schema.json#/$defs/voiceGender";
623
+ };
624
+ readonly requirement: {
625
+ readonly title: "RequirementLevel";
626
+ readonly description: "'required' takes part in routing; 'preferred' does not.";
627
+ readonly enum: readonly ["required", "preferred"];
628
+ };
629
+ };
630
+ };
425
631
  };
426
632
  };
427
633
  readonly interactionMode: {
@@ -481,7 +687,7 @@ export declare const routePlannerInputSchema: {
481
687
  };
482
688
  };
483
689
  readonly providers: {
484
- readonly description: "Static descriptors plus dynamic capability snapshots for planning.";
690
+ readonly description: "Static descriptors plus dynamic capability checks for planning. Both shapes are the provider schemas themselves, shared by $ref, so the planner reads exactly what checkCapabilities() reports.";
485
691
  readonly type: "array";
486
692
  readonly items: {
487
693
  readonly type: "object";
@@ -489,88 +695,12 @@ export declare const routePlannerInputSchema: {
489
695
  readonly required: readonly ["descriptor", "capabilities"];
490
696
  readonly properties: {
491
697
  readonly descriptor: {
492
- readonly type: "object";
493
- readonly additionalProperties: true;
494
- readonly required: readonly ["id", "type", "supports", "tasks"];
495
- readonly properties: {
496
- readonly id: {
497
- readonly type: "string";
498
- readonly minLength: 1;
499
- };
500
- readonly type: {
501
- readonly enum: readonly ["local", "edge", "cloud"];
502
- };
503
- readonly supports: {
504
- readonly type: "object";
505
- readonly additionalProperties: true;
506
- readonly required: readonly ["run"];
507
- readonly properties: {
508
- readonly run: {
509
- readonly type: "boolean";
510
- };
511
- readonly streaming: {
512
- readonly description: "Whether the provider statically declares Mode-2 streaming. Absent is treated as false: a descriptor that predates this field cannot be assumed to stream.";
513
- readonly type: "boolean";
514
- };
515
- };
516
- };
517
- readonly cancel: {
518
- readonly description: "Cancellation guarantee the provider offers. Carried for route explanations and telemetry; the planner does not filter on it.";
519
- readonly enum: readonly ["hard", "soft", "none"];
520
- };
521
- readonly tasks: {
522
- readonly type: "array";
523
- readonly items: {
524
- readonly type: "string";
525
- readonly minLength: 1;
526
- };
527
- };
528
- readonly privacy: {
529
- readonly description: "Descriptor privacy metadata used to enforce local/cloud routing rules.";
530
- readonly type: "object";
531
- readonly additionalProperties: true;
532
- readonly required: readonly ["dataLeavesDevice"];
533
- readonly properties: {
534
- readonly dataLeavesDevice: {
535
- readonly type: "boolean";
536
- };
537
- readonly regions: {
538
- readonly type: "array";
539
- readonly items: {
540
- readonly type: "string";
541
- readonly minLength: 1;
542
- };
543
- };
544
- };
545
- };
546
- };
698
+ readonly description: "The provider's static capability declaration.";
699
+ readonly $ref: "provider-descriptor.schema.json";
547
700
  };
548
701
  readonly capabilities: {
549
- readonly type: "object";
550
- readonly additionalProperties: true;
551
- readonly required: readonly ["available"];
552
- readonly properties: {
553
- readonly available: {
554
- readonly type: "boolean";
555
- };
556
- readonly reason: {
557
- readonly type: "string";
558
- readonly minLength: 1;
559
- };
560
- readonly streamingAvailable: {
561
- readonly description: "Whether the provider can stream right now in this host environment. Absent inherits the static descriptor.supports.streaming value.";
562
- readonly type: "boolean";
563
- };
564
- readonly streamingUnavailableReason: {
565
- readonly description: "Human-readable explanation used when streamingAvailable is false. Absent lets the planner synthesize a default message.";
566
- readonly type: "string";
567
- readonly minLength: 1;
568
- };
569
- readonly cancellationAvailable: {
570
- readonly description: "Whether cancellation is honored right now in this host environment. Absent inherits the static descriptor.cancel value (any value other than 'none' means available).";
571
- readonly type: "boolean";
572
- };
573
- };
702
+ readonly description: "The provider's live capability check, already folded by the engine (for example, streamingAvailable is false when the provider declares streaming but does not implement it).";
703
+ readonly $ref: "provider-dynamic-capabilities.schema.json";
574
704
  };
575
705
  };
576
706
  };
@@ -615,6 +745,10 @@ export declare const routePlanSchema: {
615
745
  readonly type: "integer";
616
746
  readonly minimum: 0;
617
747
  };
748
+ readonly voice: {
749
+ readonly description: "The voice this candidate must use if it is attempted, chosen by the planner from the provider's dynamic voice inventory. It is the best voice that satisfies the request's locale, required voice traits and privacy — under local-required privacy always one that keeps data on the device — ranked by preferred gender, then exact locale region, then on-device before network. The adapter must use a voice with exactly these traits. Absent when the request names no locale or voice, or the provider does not list its voices; the adapter then chooses itself under the same rules.";
750
+ readonly $ref: "provider-dynamic-capabilities.schema.json#/$defs/voice";
751
+ };
618
752
  };
619
753
  };
620
754
  };
@@ -638,8 +772,8 @@ export declare const routePlanSchema: {
638
772
  readonly required: readonly ["code", "message"];
639
773
  readonly properties: {
640
774
  readonly code: {
641
- readonly description: "Normalized rejection reason. 'streaming_not_supported' means the descriptor does not statically declare Mode-2 streaming; 'streaming_unavailable' means it declares streaming but the dynamic capability snapshot reports it cannot stream in the current host environment. 'not_in_model_profile' means the request named a model profile that does not list this provider.";
642
- readonly enum: readonly ["task_not_supported", "run_not_supported", "streaming_not_supported", "streaming_unavailable", "privacy_constraint", "cloud_constraint", "offline", "capability_unavailable", "not_in_model_profile"];
775
+ readonly description: "Normalized rejection reason. 'streaming_not_supported' means the descriptor does not statically declare Mode-2 streaming; 'streaming_unavailable' means it declares streaming but the dynamic capability snapshot reports it cannot stream in the current host environment. 'not_in_model_profile' means the request named a model profile that does not list this provider. 'input_not_supported', 'output_delivery_not_supported', 'output_format_not_supported', 'locale_not_supported' and 'voice_not_available' mean the provider's task capability lacks an input kind, output delivery, media type, locale or voice the request requires.";
776
+ readonly enum: readonly ["task_not_supported", "run_not_supported", "streaming_not_supported", "streaming_unavailable", "privacy_constraint", "cloud_constraint", "offline", "capability_unavailable", "not_in_model_profile", "input_not_supported", "output_delivery_not_supported", "output_format_not_supported", "locale_not_supported", "voice_not_available"];
643
777
  };
644
778
  readonly message: {
645
779
  readonly type: "string";
@@ -1053,7 +1187,12 @@ export declare const streamEventSchema: {
1053
1187
  readonly oneOf: readonly [{
1054
1188
  readonly type: "object";
1055
1189
  readonly additionalProperties: true;
1056
- readonly required: readonly ["schemaVersion", "runId", "outcome", "finalText"];
1190
+ readonly required: readonly ["schemaVersion", "runId", "outcome"];
1191
+ readonly anyOf: readonly [{
1192
+ readonly required: readonly ["finalText"];
1193
+ }, {
1194
+ readonly required: readonly ["output"];
1195
+ }];
1057
1196
  readonly properties: {
1058
1197
  readonly schemaVersion: {
1059
1198
  readonly const: "1.0";
@@ -1068,6 +1207,9 @@ export declare const streamEventSchema: {
1068
1207
  readonly finalText: {
1069
1208
  readonly type: "string";
1070
1209
  };
1210
+ readonly output: {
1211
+ readonly $ref: "task-output.schema.json";
1212
+ };
1071
1213
  readonly finishReason: {
1072
1214
  readonly enum: readonly ["stop", "length", "cancelled", "error"];
1073
1215
  };
@@ -1124,6 +1266,9 @@ export declare const streamEventSchema: {
1124
1266
  readonly outcome: {
1125
1267
  readonly const: "error";
1126
1268
  };
1269
+ readonly partialText: {
1270
+ readonly type: "string";
1271
+ };
1127
1272
  readonly error: {
1128
1273
  readonly type: "object";
1129
1274
  readonly additionalProperties: true;
@@ -1168,7 +1313,7 @@ export declare const streamEventSchema: {
1168
1313
  }, {
1169
1314
  readonly type: "object";
1170
1315
  readonly additionalProperties: true;
1171
- readonly required: readonly ["schemaVersion", "runId", "outcome", "partialText"];
1316
+ readonly required: readonly ["schemaVersion", "runId", "outcome"];
1172
1317
  readonly properties: {
1173
1318
  readonly schemaVersion: {
1174
1319
  readonly const: "1.0";
@@ -1183,6 +1328,9 @@ export declare const streamEventSchema: {
1183
1328
  readonly partialText: {
1184
1329
  readonly type: "string";
1185
1330
  };
1331
+ readonly output: {
1332
+ readonly $ref: "task-output.schema.json";
1333
+ };
1186
1334
  readonly reason: {
1187
1335
  readonly type: "string";
1188
1336
  };
@@ -1237,11 +1385,16 @@ export declare const streamTerminalOutcomeSchema: {
1237
1385
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1238
1386
  readonly $id: "https://schemas.inderun.dev/1.0/stream-terminal-outcome.schema.json";
1239
1387
  readonly title: "StreamTerminalOutcome";
1240
- readonly description: "How a Mode 2 stream run ended. Completion, error, and cancellation are mutually exclusive terminal outcomes, enforced here as a closed set of three oneOf branches discriminated by 'outcome' (unlike StreamEvent.type, this set is not open-ended: the three-way terminal outcome is a fixed architectural guarantee, not something new outcome kinds get added to). Exactly one StreamTerminalOutcome is produced per run, and no further StreamEvent is delivered after it (see docs/architecture/architecture.md, 'Cancellation And Fallback'). This shape is also embedded by value as the payload of the terminal StreamEvent (stream-event.schema.json) so it can additionally be exposed standalone, e.g. as a completion future/promise a stream handle resolves independently of consuming the full event sequence; the two copies must stay structurally identical. Note on additionalProperties: per this repo's forward-compatible convention every branch permits unknown extra fields, so mutual exclusivity is enforced via the required 'outcome' discriminator plus each branch's own required peer field (finalText/error/partialText) being present, not by forbidding a payload from also carrying an unrelated stray field from another branch's vocabulary.";
1388
+ readonly description: "How a Mode 2 stream run ended. Completion, error, and cancellation are mutually exclusive terminal outcomes, enforced here as a closed set of three oneOf branches discriminated by 'outcome' (unlike StreamEvent.type, this set is not open-ended: the three-way terminal outcome is a fixed architectural guarantee, not something new outcome kinds get added to; the payload of each branch may grow additively). Exactly one StreamTerminalOutcome is produced per run, and no further StreamEvent is delivered after it (see docs/architecture/architecture.md, 'Cancellation And Fallback'). This shape is also embedded by value as the payload of the terminal StreamEvent (stream-event.schema.json) so it can additionally be exposed standalone, e.g. as a completion future/promise a stream handle resolves independently of consuming the full event sequence; the two copies must stay structurally identical. Note on additionalProperties: per this repo's forward-compatible convention every branch permits unknown extra fields, so mutual exclusivity is enforced via the required 'outcome' discriminator plus each branch's own required peer field being present (finalText or output / error), and for 'cancelled' by the discriminator alone, not by forbidding a payload from also carrying an unrelated stray field from another branch's vocabulary.";
1241
1389
  readonly oneOf: readonly [{
1242
1390
  readonly type: "object";
1243
1391
  readonly additionalProperties: true;
1244
- readonly required: readonly ["schemaVersion", "runId", "outcome", "finalText"];
1392
+ readonly required: readonly ["schemaVersion", "runId", "outcome"];
1393
+ readonly anyOf: readonly [{
1394
+ readonly required: readonly ["finalText"];
1395
+ }, {
1396
+ readonly required: readonly ["output"];
1397
+ }];
1245
1398
  readonly properties: {
1246
1399
  readonly schemaVersion: {
1247
1400
  readonly description: "Contract schema version used to interpret this outcome payload.";
@@ -1257,9 +1410,13 @@ export declare const streamTerminalOutcomeSchema: {
1257
1410
  readonly const: "completed";
1258
1411
  };
1259
1412
  readonly finalText: {
1260
- readonly description: "The full, cumulative text produced by the run. Equivalent in role to TaskResult.output.text for Mode 1.";
1413
+ readonly description: "The full, cumulative text produced by a text run. Equivalent in role to TaskResult.output.text for Mode 1. A text run sets it; a non-text run carries output instead.";
1261
1414
  readonly type: "string";
1262
1415
  };
1416
+ readonly output: {
1417
+ readonly description: "The normalized output of the run, the same shape run() returns in TaskResult.output. Set for every non-text run; a text run may set it alongside finalText. See task-output.schema.json.";
1418
+ readonly $ref: "task-output.schema.json";
1419
+ };
1263
1420
  readonly finishReason: {
1264
1421
  readonly description: "How generation ended, mirroring TaskResult.finishReason for Mode 1: 'stop' (natural end), 'length' (hit maxOutputTokens), 'error' (provider reported a non-fatal issue on an otherwise completed run). 'cancelled' is included so this enum stays identical to TaskResult.finishReason, but it is unreachable here: cancellation is its own terminal outcome branch. Optional: providers that do not report a finish reason omit it.";
1265
1422
  readonly enum: readonly ["stop", "length", "cancelled", "error"];
@@ -1371,6 +1528,10 @@ export declare const streamTerminalOutcomeSchema: {
1371
1528
  };
1372
1529
  };
1373
1530
  };
1531
+ readonly partialText: {
1532
+ readonly description: "Whatever cumulative text a text run had already delivered before it failed after committing to its provider. Absent when nothing was delivered.";
1533
+ readonly type: "string";
1534
+ };
1374
1535
  readonly provenance: {
1375
1536
  readonly description: "Normalized execution provenance: which target ran, its declared locality, the configured and reported model, and how fallback and routing played out. See execution-provenance.schema.json.";
1376
1537
  readonly $ref: "execution-provenance.schema.json";
@@ -1379,7 +1540,7 @@ export declare const streamTerminalOutcomeSchema: {
1379
1540
  }, {
1380
1541
  readonly type: "object";
1381
1542
  readonly additionalProperties: true;
1382
- readonly required: readonly ["schemaVersion", "runId", "outcome", "partialText"];
1543
+ readonly required: readonly ["schemaVersion", "runId", "outcome"];
1383
1544
  readonly properties: {
1384
1545
  readonly schemaVersion: {
1385
1546
  readonly description: "Contract schema version used to interpret this outcome payload.";
@@ -1395,9 +1556,13 @@ export declare const streamTerminalOutcomeSchema: {
1395
1556
  readonly const: "cancelled";
1396
1557
  };
1397
1558
  readonly partialText: {
1398
- readonly description: "Whatever cumulative text had already been delivered via content_delta/content_snapshot StreamEvents before the cancellation point. May be empty if cancellation occurred before any content was produced.";
1559
+ readonly description: "Whatever cumulative text a text run had already delivered via content_delta/content_snapshot StreamEvents before the cancellation point. Always set for a text run, and empty if cancellation occurred before any content was produced. A non-text run never sets it.";
1399
1560
  readonly type: "string";
1400
1561
  };
1562
+ readonly output: {
1563
+ readonly description: "What a cancelled non-text run had already produced: a playback run that committed (audio may have been heard) carries a playback output, and an artifact run cancelled while the engine was writing its artifact to an application destination carries that application-owned artifact, whose bytes the write left at the destination. Absent when nothing was produced, e.g. an artifact run cancelled before its artifact was handed over, whose partial media the engine discards. See task-output.schema.json.";
1564
+ readonly $ref: "task-output.schema.json";
1565
+ };
1401
1566
  readonly reason: {
1402
1567
  readonly description: "Optional human-readable reason the run was cancelled (e.g. caller-initiated abort). Not a machine-taxonomy field; use errorClass on the 'error' outcome branch for failure classification.";
1403
1568
  readonly type: "string";
@@ -1409,6 +1574,555 @@ export declare const streamTerminalOutcomeSchema: {
1409
1574
  };
1410
1575
  }];
1411
1576
  };
1577
+ export declare const providerCapabilitySnapshotSchema: {
1578
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1579
+ readonly $id: "https://schemas.inderun.dev/1.0/provider-capability-snapshot.schema.json";
1580
+ readonly title: "ProviderCapabilitySnapshot";
1581
+ readonly description: "One registered provider's identity, static declaration and live capability check, as returned by checkCapabilities(). A read-only snapshot: producing it executes no task and has no side effects.";
1582
+ readonly type: "object";
1583
+ readonly additionalProperties: true;
1584
+ readonly required: readonly ["providerId", "descriptor", "capabilities"];
1585
+ readonly properties: {
1586
+ readonly providerId: {
1587
+ readonly description: "Identifier of the provider; equal to descriptor.id.";
1588
+ readonly type: "string";
1589
+ readonly minLength: 1;
1590
+ };
1591
+ readonly descriptor: {
1592
+ readonly description: "The provider's static capability declaration.";
1593
+ readonly $ref: "provider-descriptor.schema.json";
1594
+ };
1595
+ readonly capabilities: {
1596
+ readonly description: "The provider's live capability check at the time of the call.";
1597
+ readonly $ref: "provider-dynamic-capabilities.schema.json";
1598
+ };
1599
+ };
1600
+ };
1601
+ export declare const providerDescriptorSchema: {
1602
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1603
+ readonly $id: "https://schemas.inderun.dev/1.0/provider-descriptor.schema.json";
1604
+ readonly title: "ProviderDescriptor";
1605
+ readonly description: "A provider's static capability declaration: identity, placement, transport, supported interaction modes and tasks, cancellation guarantee, resource limits and privacy posture. It does not change while the provider is registered. The route planner, checkCapabilities() and execution provenance all read this one shape.";
1606
+ readonly type: "object";
1607
+ readonly additionalProperties: true;
1608
+ readonly required: readonly ["id", "type", "transport", "supports", "cancel", "tasks"];
1609
+ readonly properties: {
1610
+ readonly id: {
1611
+ readonly description: "Unique identifier of the provider instance (a target), e.g. 'apple_foundation_models' or 'openai_compatible_cloud:gpt-5-mini'. Model profiles list targets by this id.";
1612
+ readonly type: "string";
1613
+ readonly minLength: 1;
1614
+ };
1615
+ readonly type: {
1616
+ readonly title: "ProviderType";
1617
+ readonly description: "Execution placement: 'local' (on the device), 'edge', or 'cloud'.";
1618
+ readonly enum: readonly ["local", "edge", "cloud"];
1619
+ };
1620
+ readonly model: {
1621
+ readonly description: "The model this provider instance is bound to, when it can name one. Cloud providers report the model id they send; platform-managed models report an opaque platform alias rather than a guessed weight name. Absent means the provider cannot name its model.";
1622
+ readonly type: "string";
1623
+ readonly minLength: 1;
1624
+ };
1625
+ readonly transport: {
1626
+ readonly title: "ProviderTransport";
1627
+ readonly description: "How the engine reaches the provider: in-process runtime, operating-system service, buffered HTTP, server-sent events, or a realtime connection.";
1628
+ readonly enum: readonly ["in_process", "system_service", "http", "sse", "realtime"];
1629
+ };
1630
+ readonly streamingStyle: {
1631
+ readonly title: "StreamingStyle";
1632
+ readonly description: "How a streaming provider delivers incremental output: individual tokens, larger chunks, or whole snapshots. Absent for providers that do not stream.";
1633
+ readonly enum: readonly ["tokens", "chunks", "snapshots"];
1634
+ };
1635
+ readonly supports: {
1636
+ readonly title: "ProviderSupports";
1637
+ readonly description: "Interaction modes and features the provider statically declares.";
1638
+ readonly type: "object";
1639
+ readonly additionalProperties: true;
1640
+ readonly required: readonly ["run", "streaming", "realtime", "tools", "reasoningEvents", "structuredOutput", "multimodal"];
1641
+ readonly properties: {
1642
+ readonly run: {
1643
+ readonly description: "Whether the provider supports Mode 1 run (request/response).";
1644
+ readonly type: "boolean";
1645
+ };
1646
+ readonly streaming: {
1647
+ readonly description: "Whether the provider supports Mode 2 stream. A provider that declares it must also implement the streaming adapter; the engines report it as unavailable otherwise.";
1648
+ readonly type: "boolean";
1649
+ };
1650
+ readonly realtime: {
1651
+ readonly description: "Whether the provider supports Mode 3 realtime sessions. Reserved; no engine implements Mode 3 yet.";
1652
+ readonly type: "boolean";
1653
+ };
1654
+ readonly tools: {
1655
+ readonly description: "Whether the provider supports tool calling.";
1656
+ readonly type: "boolean";
1657
+ };
1658
+ readonly reasoningEvents: {
1659
+ readonly description: "Whether the provider emits reasoning events alongside content.";
1660
+ readonly type: "boolean";
1661
+ };
1662
+ readonly structuredOutput: {
1663
+ readonly description: "Whether the provider supports structured output constrained by a JSON schema.";
1664
+ readonly type: "boolean";
1665
+ };
1666
+ readonly multimodal: {
1667
+ readonly description: "Whether the provider accepts non-text inputs such as images or audio.";
1668
+ readonly type: "boolean";
1669
+ };
1670
+ };
1671
+ };
1672
+ readonly cancel: {
1673
+ readonly title: "CancelSemantics";
1674
+ readonly description: "Cancellation guarantee: 'hard' stops processing including remote work, 'soft' stops reading locally while remote work may continue, 'none' means cancellation is unsupported. Independently of this value, the engine delivers no event after a cancel.";
1675
+ readonly enum: readonly ["hard", "soft", "none"];
1676
+ };
1677
+ readonly tasks: {
1678
+ readonly description: "Task kinds the provider supports, e.g. 'text_to_text'. When taskCapabilities is present it must describe the same kinds and is what routing reads; without it, routing infers capabilities for 'text_to_text' alone (see taskCapabilities).";
1679
+ readonly type: "array";
1680
+ readonly items: {
1681
+ readonly type: "string";
1682
+ readonly minLength: 1;
1683
+ };
1684
+ };
1685
+ readonly limits: {
1686
+ readonly title: "ProviderLimits";
1687
+ readonly description: "Optional input and output resource limits.";
1688
+ readonly type: "object";
1689
+ readonly additionalProperties: true;
1690
+ readonly properties: {
1691
+ readonly maxInputTokens: {
1692
+ readonly description: "Largest accepted input, in tokens.";
1693
+ readonly type: "integer";
1694
+ readonly minimum: 1;
1695
+ };
1696
+ readonly maxOutputTokens: {
1697
+ readonly description: "Largest output the provider produces, in tokens.";
1698
+ readonly type: "integer";
1699
+ readonly minimum: 1;
1700
+ };
1701
+ readonly maxImageBytes: {
1702
+ readonly description: "Largest accepted image, in bytes.";
1703
+ readonly type: "integer";
1704
+ readonly minimum: 1;
1705
+ };
1706
+ readonly maxAudioSeconds: {
1707
+ readonly description: "Longest accepted or produced audio, in seconds.";
1708
+ readonly type: "integer";
1709
+ readonly minimum: 1;
1710
+ };
1711
+ };
1712
+ };
1713
+ readonly privacy: {
1714
+ readonly title: "ProviderPrivacy";
1715
+ readonly description: "Data-egress posture, used to enforce local and cloud routing rules. Absent means a local or edge provider is treated as keeping data on the device and a cloud provider as sending it off.";
1716
+ readonly type: "object";
1717
+ readonly additionalProperties: true;
1718
+ readonly required: readonly ["dataLeavesDevice"];
1719
+ readonly properties: {
1720
+ readonly dataLeavesDevice: {
1721
+ readonly description: "Whether request content leaves the device.";
1722
+ readonly type: "boolean";
1723
+ };
1724
+ readonly regions: {
1725
+ readonly description: "Geographic regions where a cloud provider processes data.";
1726
+ readonly type: "array";
1727
+ readonly items: {
1728
+ readonly type: "string";
1729
+ readonly minLength: 1;
1730
+ };
1731
+ };
1732
+ };
1733
+ };
1734
+ readonly taskCapabilities: {
1735
+ readonly description: "What the provider can do for each task: accepted inputs, interaction modes, output deliveries and formats, cancellation, locales and privacy. When present it is authoritative for routing and must list every task the provider serves. When absent (a legacy descriptor), routing infers exactly one entry — 'text_to_text' with text input, inline output, run/stream from supports and cancel from cancel — if tasks contains 'text_to_text', and nothing for any other task: a legacy descriptor is never treated as capable of a non-text task.";
1736
+ readonly type: "array";
1737
+ readonly items: {
1738
+ readonly $ref: "#/$defs/taskCapability";
1739
+ };
1740
+ };
1741
+ };
1742
+ readonly $defs: {
1743
+ readonly taskCapability: {
1744
+ readonly title: "ProviderTaskCapability";
1745
+ readonly description: "The provider's static capabilities for one task kind.";
1746
+ readonly type: "object";
1747
+ readonly additionalProperties: true;
1748
+ readonly required: readonly ["kind", "inputs", "interaction", "cancel", "outputs"];
1749
+ readonly properties: {
1750
+ readonly kind: {
1751
+ readonly description: "The task kind this entry describes, e.g. 'text_to_speech'.";
1752
+ readonly type: "string";
1753
+ readonly minLength: 1;
1754
+ };
1755
+ readonly inputs: {
1756
+ readonly description: "Input media kinds the provider accepts for this task.";
1757
+ readonly type: "array";
1758
+ readonly minItems: 1;
1759
+ readonly items: {
1760
+ readonly $ref: "#/$defs/inputKind";
1761
+ };
1762
+ };
1763
+ readonly interaction: {
1764
+ readonly title: "ProviderTaskInteraction";
1765
+ readonly description: "Interaction modes the provider supports for this task.";
1766
+ readonly type: "object";
1767
+ readonly additionalProperties: true;
1768
+ readonly required: readonly ["run", "stream"];
1769
+ readonly properties: {
1770
+ readonly run: {
1771
+ readonly description: "Whether the provider supports Mode 1 run for this task.";
1772
+ readonly type: "boolean";
1773
+ };
1774
+ readonly stream: {
1775
+ readonly description: "Whether the provider supports Mode 2 stream for this task.";
1776
+ readonly type: "boolean";
1777
+ };
1778
+ };
1779
+ };
1780
+ readonly cancel: {
1781
+ readonly description: "Cancellation guarantee for this task. It may differ from the provider-level cancel, e.g. when stopping playback is immediate but a synthesis request cannot be aborted.";
1782
+ readonly $ref: "#/properties/cancel";
1783
+ };
1784
+ readonly outputs: {
1785
+ readonly description: "How results of this task can be delivered. A provider lists only what it really produces: a provider that can only play audio lists 'playback' and never 'artifact'.";
1786
+ readonly type: "array";
1787
+ readonly minItems: 1;
1788
+ readonly items: {
1789
+ readonly $ref: "#/$defs/taskOutput";
1790
+ };
1791
+ };
1792
+ readonly locales: {
1793
+ readonly description: "BCP 47 locales the provider can serve for this task, when it knows them statically. Absent means unknown; the dynamic check may report them instead.";
1794
+ readonly type: "array";
1795
+ readonly items: {
1796
+ readonly type: "string";
1797
+ readonly minLength: 1;
1798
+ };
1799
+ };
1800
+ readonly privacy: {
1801
+ readonly description: "Data-egress posture for this task when it differs from the provider-level privacy, e.g. a provider whose speech synthesis uses a network service. Absent inherits descriptor.privacy.";
1802
+ readonly $ref: "#/properties/privacy";
1803
+ };
1804
+ };
1805
+ };
1806
+ readonly taskOutput: {
1807
+ readonly title: "ProviderTaskOutput";
1808
+ readonly description: "One way the provider can deliver a task's result.";
1809
+ readonly type: "object";
1810
+ readonly additionalProperties: true;
1811
+ readonly required: readonly ["delivery"];
1812
+ readonly properties: {
1813
+ readonly delivery: {
1814
+ readonly $ref: "#/$defs/outputDelivery";
1815
+ };
1816
+ readonly mediaTypes: {
1817
+ readonly description: "Media types the provider can produce with this delivery, e.g. 'audio/wav'. Absent means the provider does not declare them; a request that requires specific media types never routes to such an output.";
1818
+ readonly type: "array";
1819
+ readonly items: {
1820
+ readonly type: "string";
1821
+ readonly minLength: 1;
1822
+ };
1823
+ };
1824
+ };
1825
+ };
1826
+ readonly inputKind: {
1827
+ readonly title: "TaskInputKind";
1828
+ readonly description: "A kind of input medium a task consumes.";
1829
+ readonly enum: readonly ["text", "image", "audio"];
1830
+ };
1831
+ readonly outputDelivery: {
1832
+ readonly title: "OutputDelivery";
1833
+ readonly description: "How a task's result reaches the application: 'inline' content in the result (text), 'playback' as a managed, audible effect on the device with no retrievable bytes, or 'artifact' as retrievable media.";
1834
+ readonly enum: readonly ["inline", "playback", "artifact"];
1835
+ };
1836
+ };
1837
+ };
1838
+ export declare const providerDynamicCapabilitiesSchema: {
1839
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1840
+ readonly $id: "https://schemas.inderun.dev/1.0/provider-dynamic-capabilities.schema.json";
1841
+ readonly title: "ProviderDynamicCapabilities";
1842
+ readonly $comment: "streamingAvailable and cancellationAvailable are tri-state on purpose: true, false, or absent. Absent means 'inherit the static declaration' and is a distinct state from both booleans. They must never become nullable: null would be a fourth state no consumer handles, and bridges omit the key specifically to preserve 'absent'.";
1843
+ readonly description: "A provider's live capability check, evaluated on the current host when routing or when checkCapabilities() is called. Unlike the descriptor it can change between calls.";
1844
+ readonly type: "object";
1845
+ readonly additionalProperties: true;
1846
+ readonly required: readonly ["available"];
1847
+ readonly properties: {
1848
+ readonly available: {
1849
+ readonly description: "Whether the provider is available and functional on this host right now.";
1850
+ readonly type: "boolean";
1851
+ };
1852
+ readonly reason: {
1853
+ readonly description: "Why the provider is unavailable, when available is false.";
1854
+ readonly type: "string";
1855
+ readonly minLength: 1;
1856
+ };
1857
+ readonly streamingAvailable: {
1858
+ readonly description: "Whether the provider can stream (Mode 2) on this host right now. Absent inherits the static descriptor.supports.streaming value; only set it when the host takes streaming away from a provider that otherwise declares it. Never null.";
1859
+ readonly type: "boolean";
1860
+ };
1861
+ readonly streamingUnavailableReason: {
1862
+ readonly description: "Why streaming is unavailable, when streamingAvailable is false. Absent lets the route planner synthesize a default message.";
1863
+ readonly type: "string";
1864
+ readonly minLength: 1;
1865
+ };
1866
+ readonly cancellationAvailable: {
1867
+ readonly description: "Whether cancellation is honored on this host right now. Absent inherits the static descriptor.cancel value: any value other than 'none' means available. Never null.";
1868
+ readonly type: "boolean";
1869
+ };
1870
+ readonly taskCapabilities: {
1871
+ readonly description: "Per-task overrides of the provider-level check, for tasks whose availability differs on this host, e.g. a voice that is not installed. Every field of an entry is optional and absent inherits the provider-level value; a false at either level wins.";
1872
+ readonly type: "array";
1873
+ readonly items: {
1874
+ readonly $ref: "#/$defs/taskAvailability";
1875
+ };
1876
+ };
1877
+ };
1878
+ readonly $defs: {
1879
+ readonly taskAvailability: {
1880
+ readonly title: "ProviderTaskAvailability";
1881
+ readonly description: "The live check for one task kind.";
1882
+ readonly type: "object";
1883
+ readonly additionalProperties: true;
1884
+ readonly required: readonly ["kind"];
1885
+ readonly properties: {
1886
+ readonly kind: {
1887
+ readonly description: "The task kind this entry describes.";
1888
+ readonly type: "string";
1889
+ readonly minLength: 1;
1890
+ };
1891
+ readonly available: {
1892
+ readonly description: "Whether the task can run on this host right now. Absent inherits the provider-level available. Never null.";
1893
+ readonly type: "boolean";
1894
+ };
1895
+ readonly reason: {
1896
+ readonly description: "Why the task is unavailable, when available is false.";
1897
+ readonly type: "string";
1898
+ readonly minLength: 1;
1899
+ };
1900
+ readonly streamingAvailable: {
1901
+ readonly description: "Whether the task can stream on this host right now. Absent inherits. Never null.";
1902
+ readonly type: "boolean";
1903
+ };
1904
+ readonly streamingUnavailableReason: {
1905
+ readonly description: "Why streaming is unavailable for this task, when streamingAvailable is false.";
1906
+ readonly type: "string";
1907
+ readonly minLength: 1;
1908
+ };
1909
+ readonly cancellationAvailable: {
1910
+ readonly description: "Whether cancellation is honored for this task right now. Absent inherits. Never null.";
1911
+ readonly type: "boolean";
1912
+ };
1913
+ readonly locales: {
1914
+ readonly description: "BCP 47 locales available for this task right now. Absent means the provider cannot enumerate them.";
1915
+ readonly type: "array";
1916
+ readonly items: {
1917
+ readonly type: "string";
1918
+ readonly minLength: 1;
1919
+ };
1920
+ };
1921
+ readonly voices: {
1922
+ readonly description: "Voices available for this task right now. Absent means the provider cannot enumerate them; a request that requires a voice then never routes to it.";
1923
+ readonly type: "array";
1924
+ readonly items: {
1925
+ readonly $ref: "#/$defs/voice";
1926
+ };
1927
+ };
1928
+ };
1929
+ };
1930
+ readonly voice: {
1931
+ readonly title: "ProviderVoice";
1932
+ readonly description: "Provider-neutral traits of one available voice. Carries no provider voice identifier.";
1933
+ readonly type: "object";
1934
+ readonly additionalProperties: true;
1935
+ readonly required: readonly ["locale"];
1936
+ readonly properties: {
1937
+ readonly locale: {
1938
+ readonly description: "BCP 47 locale the voice speaks.";
1939
+ readonly type: "string";
1940
+ readonly minLength: 1;
1941
+ };
1942
+ readonly gender: {
1943
+ readonly $ref: "#/$defs/voiceGender";
1944
+ };
1945
+ readonly networkRequired: {
1946
+ readonly description: "Whether using the voice sends data off the device. Absent inherits the task's privacy posture.";
1947
+ readonly type: "boolean";
1948
+ };
1949
+ };
1950
+ };
1951
+ readonly voiceGender: {
1952
+ readonly title: "VoiceGender";
1953
+ readonly description: "Perceived gender of a voice, as the platform reports it.";
1954
+ readonly enum: readonly ["female", "male", "neutral"];
1955
+ };
1956
+ };
1957
+ };
1958
+ export declare const artifactReadRequestSchema: {
1959
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1960
+ readonly $id: "https://schemas.inderun.dev/1.0/artifact-read-request.schema.json";
1961
+ readonly title: "ArtifactReadRequest";
1962
+ readonly description: "A ranged read of an engine-owned media artifact through IndeRunApi.readArtifact (ADR 017). Reads are repeatable until the artifact is disposed; each returns at most the engine's configured maximum read size, which bounds what one call -- and one bridge message -- carries.";
1963
+ readonly type: "object";
1964
+ readonly additionalProperties: true;
1965
+ readonly required: readonly ["artifactId"];
1966
+ readonly properties: {
1967
+ readonly artifactId: {
1968
+ readonly description: "MediaArtifact.id of the artifact to read.";
1969
+ readonly type: "string";
1970
+ readonly minLength: 1;
1971
+ };
1972
+ readonly offset: {
1973
+ readonly description: "Byte offset to read from. Absent means 0. An offset equal to the artifact's size returns an empty, final chunk; a larger one is rejected.";
1974
+ readonly type: "integer";
1975
+ readonly minimum: 0;
1976
+ };
1977
+ readonly maxBytes: {
1978
+ readonly description: "Most bytes to return. Absent, or larger than the engine's maximum read size, means that maximum.";
1979
+ readonly type: "integer";
1980
+ readonly minimum: 1;
1981
+ };
1982
+ };
1983
+ };
1984
+ export declare const taskOutputSchema: {
1985
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1986
+ readonly $id: "https://schemas.inderun.dev/1.0/task-output.schema.json";
1987
+ readonly title: "TaskOutput";
1988
+ readonly description: "The normalized output of a run, shared by TaskResult and the completed and cancelled stream terminal outcomes (ADR 016). 'type' describes the content representation, not the task: 'text' carries inline text, 'playback' reports a managed, audible effect that has no retrievable bytes, and 'artifact' references retrievable media (ADR 017). A playback output is never an artifact, and an artifact output never implies that anything was played.";
1989
+ readonly type: "object";
1990
+ readonly additionalProperties: true;
1991
+ readonly required: readonly ["type"];
1992
+ readonly allOf: readonly [{
1993
+ readonly if: {
1994
+ readonly properties: {
1995
+ readonly type: {
1996
+ readonly const: "text";
1997
+ };
1998
+ };
1999
+ };
2000
+ readonly then: {
2001
+ readonly required: readonly ["text"];
2002
+ };
2003
+ }, {
2004
+ readonly if: {
2005
+ readonly properties: {
2006
+ readonly type: {
2007
+ readonly const: "playback";
2008
+ };
2009
+ };
2010
+ };
2011
+ readonly then: {
2012
+ readonly required: readonly ["playback"];
2013
+ };
2014
+ }, {
2015
+ readonly if: {
2016
+ readonly properties: {
2017
+ readonly type: {
2018
+ readonly const: "artifact";
2019
+ };
2020
+ };
2021
+ };
2022
+ readonly then: {
2023
+ readonly required: readonly ["artifact"];
2024
+ };
2025
+ }];
2026
+ readonly properties: {
2027
+ readonly type: {
2028
+ readonly title: "TaskOutputType";
2029
+ readonly description: "The content representation: 'text', 'playback' or 'artifact'.";
2030
+ readonly enum: readonly ["text", "playback", "artifact"];
2031
+ };
2032
+ readonly text: {
2033
+ readonly description: "The text the run produced. Required when type is 'text'.";
2034
+ readonly type: "string";
2035
+ };
2036
+ readonly playback: {
2037
+ readonly title: "PlaybackOutput";
2038
+ readonly description: "Completion of managed playback. Required when type is 'playback'. Carries no media.";
2039
+ readonly type: "object";
2040
+ readonly additionalProperties: true;
2041
+ readonly properties: {
2042
+ readonly durationMs: {
2043
+ readonly description: "How long audible playback lasted, in milliseconds. For a cancelled run, how long it played before it was stopped.";
2044
+ readonly type: "number";
2045
+ readonly minimum: 0;
2046
+ };
2047
+ };
2048
+ };
2049
+ readonly artifact: {
2050
+ readonly description: "The retrievable media the run produced. Required when type is 'artifact'.";
2051
+ readonly $ref: "media-artifact.schema.json";
2052
+ };
2053
+ readonly speech: {
2054
+ readonly title: "SpeechOutput";
2055
+ readonly description: "The locale and voice traits a text-to-speech run actually used, so an unmet preference is visible without being an error.";
2056
+ readonly type: "object";
2057
+ readonly additionalProperties: true;
2058
+ readonly required: readonly ["locale"];
2059
+ readonly properties: {
2060
+ readonly locale: {
2061
+ readonly description: "BCP 47 tag of the locale that was spoken.";
2062
+ readonly type: "string";
2063
+ readonly minLength: 1;
2064
+ };
2065
+ readonly voice: {
2066
+ readonly title: "SpeechOutputVoice";
2067
+ readonly description: "Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.";
2068
+ readonly type: "object";
2069
+ readonly additionalProperties: true;
2070
+ readonly properties: {
2071
+ readonly gender: {
2072
+ readonly $ref: "provider-dynamic-capabilities.schema.json#/$defs/voiceGender";
2073
+ };
2074
+ };
2075
+ };
2076
+ };
2077
+ };
2078
+ };
2079
+ };
2080
+ export declare const mediaArtifactSchema: {
2081
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
2082
+ readonly $id: "https://schemas.inderun.dev/1.0/media-artifact.schema.json";
2083
+ readonly title: "MediaArtifact";
2084
+ readonly description: "A reference to retrievable media a run produced (ADR 017). It carries no bytes and no location: an engine-owned artifact is read through the engine by id, and an application-owned one was written to an application destination. Media-neutral: audio, images and video share this shape and differ only in mediaType.";
2085
+ readonly type: "object";
2086
+ readonly additionalProperties: true;
2087
+ readonly required: readonly ["id", "mediaType", "owner", "lifetime"];
2088
+ readonly properties: {
2089
+ readonly id: {
2090
+ readonly description: "Opaque, engine-issued identifier. Never a path, URL or provider identifier.";
2091
+ readonly type: "string";
2092
+ readonly minLength: 1;
2093
+ };
2094
+ readonly mediaType: {
2095
+ readonly description: "IANA media type of the bytes, e.g. 'audio/wav'. Encoding parameters ride on the media type (e.g. 'audio/L16;rate=22050').";
2096
+ readonly type: "string";
2097
+ readonly minLength: 1;
2098
+ };
2099
+ readonly owner: {
2100
+ readonly title: "ArtifactOwner";
2101
+ readonly description: "'engine': the engine holds the bytes and the application reads them by id until it disposes the artifact. 'application': the bytes were written to the application destination named by destinationRef and the engine holds nothing.";
2102
+ readonly enum: readonly ["engine", "application"];
2103
+ };
2104
+ readonly lifetime: {
2105
+ readonly title: "ArtifactLifetime";
2106
+ readonly description: "How long the engine keeps the bytes. 'until_disposed': until the application disposes the artifact or the process ends; the artifact outlives the run that produced it.";
2107
+ readonly enum: readonly ["until_disposed"];
2108
+ };
2109
+ readonly byteLength: {
2110
+ readonly description: "Size of the media in bytes. Always set for an artifact the engine materialized.";
2111
+ readonly type: "integer";
2112
+ readonly minimum: 0;
2113
+ };
2114
+ readonly durationMs: {
2115
+ readonly description: "Duration of time-based media in milliseconds, where the producer knows it.";
2116
+ readonly type: "number";
2117
+ readonly minimum: 0;
2118
+ };
2119
+ readonly destinationRef: {
2120
+ readonly description: "The request's delivery.destinationRef the bytes were written to. Set exactly when owner is 'application'.";
2121
+ readonly type: "string";
2122
+ readonly minLength: 1;
2123
+ };
2124
+ };
2125
+ };
1412
2126
  export declare const executionProvenanceSchema: {
1413
2127
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1414
2128
  readonly $id: "https://schemas.inderun.dev/1.0/execution-provenance.schema.json";
@@ -1473,6 +2187,10 @@ export declare const executionProvenanceSchema: {
1473
2187
  readonly description: "'succeeded' (produced the result or was committed to and completed), 'failed', or 'cancelled'.";
1474
2188
  readonly enum: readonly ["succeeded", "failed", "cancelled"];
1475
2189
  };
2190
+ readonly committed: {
2191
+ readonly description: "Whether the run committed to this provider during the attempt: its first content was delivered, it signalled the first possible audible effect, or it handed over an artifact. After commit a failure ends the run instead of falling back. Absent means the attempt did not commit.";
2192
+ readonly type: "boolean";
2193
+ };
1476
2194
  readonly errorClass: {
1477
2195
  readonly description: "Normalized error class of a failed attempt.";
1478
2196
  readonly enum: readonly ["CapabilityMismatch", "Offline", "AuthError", "RateLimited", "Timeout", "Unavailable", "Internal"];
@@ -1496,7 +2214,7 @@ export declare const executionProvenanceSchema: {
1496
2214
  readonly codes: {
1497
2215
  readonly type: "array";
1498
2216
  readonly items: {
1499
- readonly enum: readonly ["task_not_supported", "run_not_supported", "streaming_not_supported", "streaming_unavailable", "privacy_constraint", "cloud_constraint", "offline", "capability_unavailable", "not_in_model_profile"];
2217
+ readonly enum: readonly ["task_not_supported", "run_not_supported", "streaming_not_supported", "streaming_unavailable", "privacy_constraint", "cloud_constraint", "offline", "capability_unavailable", "not_in_model_profile", "input_not_supported", "output_delivery_not_supported", "output_format_not_supported", "locale_not_supported", "voice_not_available"];
1500
2218
  };
1501
2219
  };
1502
2220
  };