@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.
- package/dist/generated/artifact-read-request.d.ts +24 -0
- package/dist/generated/artifact-read-request.d.ts.map +1 -0
- package/dist/generated/artifact-read-request.js +2 -0
- package/dist/generated/execution-provenance.d.ts +8 -1
- package/dist/generated/execution-provenance.d.ts.map +1 -1
- package/dist/generated/inderun-error.d.ts +8 -1
- package/dist/generated/inderun-error.d.ts.map +1 -1
- package/dist/generated/index.d.ts +6 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/media-artifact.d.ts +53 -0
- package/dist/generated/media-artifact.d.ts.map +1 -0
- package/dist/generated/media-artifact.js +2 -0
- package/dist/generated/provider-capability-snapshot.d.ts +370 -0
- package/dist/generated/provider-capability-snapshot.d.ts.map +1 -0
- package/dist/generated/provider-capability-snapshot.js +2 -0
- package/dist/generated/provider-descriptor.d.ts +264 -0
- package/dist/generated/provider-descriptor.d.ts.map +1 -0
- package/dist/generated/provider-descriptor.js +2 -0
- package/dist/generated/provider-dynamic-capabilities.d.ts +99 -0
- package/dist/generated/provider-dynamic-capabilities.d.ts.map +1 -0
- package/dist/generated/provider-dynamic-capabilities.js +2 -0
- package/dist/generated/route-plan.d.ts +47 -3
- package/dist/generated/route-plan.d.ts.map +1 -1
- package/dist/generated/route-planner-input.d.ts +417 -32
- package/dist/generated/route-planner-input.d.ts.map +1 -1
- package/dist/generated/schemas.d.ts +833 -115
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +1038 -160
- package/dist/generated/stream-event.d.ts +136 -1
- package/dist/generated/stream-event.d.ts.map +1 -1
- package/dist/generated/stream-terminal-outcome.d.ts +182 -18
- package/dist/generated/stream-terminal-outcome.d.ts.map +1 -1
- package/dist/generated/task-output.d.ts +128 -0
- package/dist/generated/task-output.d.ts.map +1 -0
- package/dist/generated/task-output.js +2 -0
- package/dist/generated/task-request.d.ts +116 -11
- package/dist/generated/task-request.d.ts.map +1 -1
- package/dist/generated/task-result.d.ts +139 -15
- package/dist/generated/task-result.d.ts.map +1 -1
- package/dist/generated/telemetry-event.d.ts +2 -2
- package/dist/generated/telemetry-event.d.ts.map +1 -1
- package/dist/host.d.ts +24 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +46 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/validators.d.ts +18 -0
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +49 -1
- package/package.json +1 -1
- package/src/generated/artifact-read-request.ts +25 -0
- package/src/generated/execution-provenance.ts +8 -1
- package/src/generated/inderun-error.ts +8 -1
- package/src/generated/index.ts +6 -0
- package/src/generated/media-artifact.ts +56 -0
- package/src/generated/provider-capability-snapshot.ts +388 -0
- package/src/generated/provider-descriptor.ts +278 -0
- package/src/generated/provider-dynamic-capabilities.ts +103 -0
- package/src/generated/route-plan.ts +49 -3
- package/src/generated/route-planner-input.ts +437 -36
- package/src/generated/schemas.ts +1044 -160
- package/src/generated/stream-event.ts +145 -1
- package/src/generated/stream-terminal-outcome.ts +191 -18
- package/src/generated/task-output.ts +137 -0
- package/src/generated/task-request.ts +124 -11
- package/src/generated/task-result.ts +147 -15
- package/src/generated/telemetry-event.ts +2 -2
- package/src/host.ts +30 -1
- package/src/index.ts +28 -1
- package/src/types.ts +38 -1
- package/src/validators.ts +76 -0
package/src/generated/schemas.ts
CHANGED
|
@@ -4,23 +4,107 @@ export const taskRequestSchema = {
|
|
|
4
4
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
5
5
|
"$id": "https://schemas.inderun.dev/1.0/task-request.schema.json",
|
|
6
6
|
"title": "TaskRequest",
|
|
7
|
-
"description": "The request payload for a
|
|
7
|
+
"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.",
|
|
8
8
|
"type": "object",
|
|
9
9
|
"additionalProperties": true,
|
|
10
10
|
"required": [
|
|
11
11
|
"schemaVersion",
|
|
12
12
|
"task"
|
|
13
13
|
],
|
|
14
|
-
"
|
|
14
|
+
"allOf": [
|
|
15
15
|
{
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
16
|
+
"if": {
|
|
17
|
+
"properties": {
|
|
18
|
+
"task": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"properties": {
|
|
21
|
+
"kind": {
|
|
22
|
+
"const": "text_to_text"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"then": {
|
|
29
|
+
"anyOf": [
|
|
30
|
+
{
|
|
31
|
+
"required": [
|
|
32
|
+
"prompt"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"required": [
|
|
37
|
+
"messages"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"not": {
|
|
42
|
+
"anyOf": [
|
|
43
|
+
{
|
|
44
|
+
"required": [
|
|
45
|
+
"speech"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"required": [
|
|
50
|
+
"delivery"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
19
56
|
},
|
|
20
57
|
{
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
58
|
+
"if": {
|
|
59
|
+
"properties": {
|
|
60
|
+
"task": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"kind": {
|
|
64
|
+
"const": "text_to_speech"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"then": {
|
|
71
|
+
"required": [
|
|
72
|
+
"speech",
|
|
73
|
+
"delivery"
|
|
74
|
+
],
|
|
75
|
+
"not": {
|
|
76
|
+
"anyOf": [
|
|
77
|
+
{
|
|
78
|
+
"required": [
|
|
79
|
+
"prompt"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"required": [
|
|
84
|
+
"messages"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"required": [
|
|
89
|
+
"generation"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"properties": {
|
|
95
|
+
"delivery": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"mode": {
|
|
99
|
+
"enum": [
|
|
100
|
+
"playback",
|
|
101
|
+
"artifact"
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
24
108
|
}
|
|
25
109
|
],
|
|
26
110
|
"properties": {
|
|
@@ -34,7 +118,7 @@ export const taskRequestSchema = {
|
|
|
34
118
|
"minLength": 1
|
|
35
119
|
},
|
|
36
120
|
"task": {
|
|
37
|
-
"description": "A descriptor specifying the type of work to be performed.
|
|
121
|
+
"description": "A descriptor specifying the type of work to be performed. The kind selects which payload the request must carry.",
|
|
38
122
|
"type": "object",
|
|
39
123
|
"additionalProperties": true,
|
|
40
124
|
"required": [
|
|
@@ -42,8 +126,12 @@ export const taskRequestSchema = {
|
|
|
42
126
|
],
|
|
43
127
|
"properties": {
|
|
44
128
|
"kind": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
129
|
+
"title": "TaskKind",
|
|
130
|
+
"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.",
|
|
131
|
+
"enum": [
|
|
132
|
+
"text_to_text",
|
|
133
|
+
"text_to_speech"
|
|
134
|
+
]
|
|
47
135
|
}
|
|
48
136
|
}
|
|
49
137
|
},
|
|
@@ -81,6 +169,122 @@ export const taskRequestSchema = {
|
|
|
81
169
|
}
|
|
82
170
|
}
|
|
83
171
|
},
|
|
172
|
+
"speech": {
|
|
173
|
+
"title": "SpeechInput",
|
|
174
|
+
"description": "The text_to_speech payload. Required for text_to_speech and forbidden for every other kind.",
|
|
175
|
+
"type": "object",
|
|
176
|
+
"additionalProperties": true,
|
|
177
|
+
"required": [
|
|
178
|
+
"text",
|
|
179
|
+
"locale"
|
|
180
|
+
],
|
|
181
|
+
"properties": {
|
|
182
|
+
"text": {
|
|
183
|
+
"description": "Plain text to speak. Markup such as SSML is out of scope.",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"minLength": 1
|
|
186
|
+
},
|
|
187
|
+
"locale": {
|
|
188
|
+
"description": "BCP 47 tag of the language to speak, e.g. 'de-AT'.",
|
|
189
|
+
"type": "string",
|
|
190
|
+
"minLength": 1
|
|
191
|
+
},
|
|
192
|
+
"localeMatch": {
|
|
193
|
+
"title": "LocaleMatch",
|
|
194
|
+
"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.",
|
|
195
|
+
"enum": [
|
|
196
|
+
"exact",
|
|
197
|
+
"language"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"voice": {
|
|
201
|
+
"title": "SpeechVoice",
|
|
202
|
+
"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.",
|
|
203
|
+
"type": "object",
|
|
204
|
+
"additionalProperties": true,
|
|
205
|
+
"if": {
|
|
206
|
+
"properties": {
|
|
207
|
+
"requirement": {
|
|
208
|
+
"const": "required"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"required": [
|
|
212
|
+
"requirement"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
"then": {
|
|
216
|
+
"required": [
|
|
217
|
+
"gender"
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
"properties": {
|
|
221
|
+
"gender": {
|
|
222
|
+
"$ref": "provider-dynamic-capabilities.schema.json#/$defs/voiceGender"
|
|
223
|
+
},
|
|
224
|
+
"requirement": {
|
|
225
|
+
"title": "RequirementLevel",
|
|
226
|
+
"description": "'preferred' (default) or 'required'. A required voice must name at least one trait.",
|
|
227
|
+
"enum": [
|
|
228
|
+
"required",
|
|
229
|
+
"preferred"
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"delivery": {
|
|
237
|
+
"title": "OutputDeliveryRequest",
|
|
238
|
+
"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.",
|
|
239
|
+
"type": "object",
|
|
240
|
+
"additionalProperties": true,
|
|
241
|
+
"required": [
|
|
242
|
+
"mode"
|
|
243
|
+
],
|
|
244
|
+
"if": {
|
|
245
|
+
"properties": {
|
|
246
|
+
"mode": {
|
|
247
|
+
"const": "artifact"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"else": {
|
|
252
|
+
"not": {
|
|
253
|
+
"anyOf": [
|
|
254
|
+
{
|
|
255
|
+
"required": [
|
|
256
|
+
"mediaTypes"
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"required": [
|
|
261
|
+
"destinationRef"
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"properties": {
|
|
268
|
+
"mode": {
|
|
269
|
+
"$ref": "provider-descriptor.schema.json#/$defs/outputDelivery"
|
|
270
|
+
},
|
|
271
|
+
"mediaTypes": {
|
|
272
|
+
"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.",
|
|
273
|
+
"type": "array",
|
|
274
|
+
"minItems": 1,
|
|
275
|
+
"uniqueItems": true,
|
|
276
|
+
"items": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"minLength": 1
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"destinationRef": {
|
|
282
|
+
"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.",
|
|
283
|
+
"type": "string",
|
|
284
|
+
"minLength": 1
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
84
288
|
"modelProfile": {
|
|
85
289
|
"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.",
|
|
86
290
|
"type": "string",
|
|
@@ -144,7 +348,7 @@ export const taskRequestSchema = {
|
|
|
144
348
|
]
|
|
145
349
|
},
|
|
146
350
|
"timeoutMs": {
|
|
147
|
-
"description": "Optional
|
|
351
|
+
"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.",
|
|
148
352
|
"type": "integer",
|
|
149
353
|
"minimum": 1
|
|
150
354
|
}
|
|
@@ -204,7 +408,7 @@ export const taskResultSchema = {
|
|
|
204
408
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
205
409
|
"$id": "https://schemas.inderun.dev/1.0/task-result.schema.json",
|
|
206
410
|
"title": "TaskResult",
|
|
207
|
-
"description": "The response payload for a completed
|
|
411
|
+
"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).",
|
|
208
412
|
"type": "object",
|
|
209
413
|
"additionalProperties": true,
|
|
210
414
|
"required": [
|
|
@@ -225,23 +429,8 @@ export const taskResultSchema = {
|
|
|
225
429
|
"minLength": 1
|
|
226
430
|
},
|
|
227
431
|
"output": {
|
|
228
|
-
"description": "The normalized
|
|
229
|
-
"
|
|
230
|
-
"additionalProperties": true,
|
|
231
|
-
"required": [
|
|
232
|
-
"type",
|
|
233
|
-
"text"
|
|
234
|
-
],
|
|
235
|
-
"properties": {
|
|
236
|
-
"type": {
|
|
237
|
-
"description": "Output payload category (e.g., 'text' for Mode 1 text-to-text).",
|
|
238
|
-
"const": "text"
|
|
239
|
-
},
|
|
240
|
-
"text": {
|
|
241
|
-
"description": "The actual text generated by the execution.",
|
|
242
|
-
"type": "string"
|
|
243
|
-
}
|
|
244
|
-
}
|
|
432
|
+
"description": "The normalized output of the selected provider. See task-output.schema.json.",
|
|
433
|
+
"$ref": "task-output.schema.json"
|
|
245
434
|
},
|
|
246
435
|
"finishReason": {
|
|
247
436
|
"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.",
|
|
@@ -483,6 +672,7 @@ export const telemetryEventSchema = {
|
|
|
483
672
|
],
|
|
484
673
|
"properties": {
|
|
485
674
|
"type": {
|
|
675
|
+
"title": "TelemetryEventType",
|
|
486
676
|
"description": "Telemetry event kind emitted by the orchestrator or provider integration.",
|
|
487
677
|
"enum": [
|
|
488
678
|
"route_decided",
|
|
@@ -529,7 +719,7 @@ export const routePlannerInputSchema = {
|
|
|
529
719
|
],
|
|
530
720
|
"properties": {
|
|
531
721
|
"task": {
|
|
532
|
-
"description": "
|
|
722
|
+
"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.",
|
|
533
723
|
"type": "object",
|
|
534
724
|
"additionalProperties": true,
|
|
535
725
|
"required": [
|
|
@@ -537,8 +727,85 @@ export const routePlannerInputSchema = {
|
|
|
537
727
|
],
|
|
538
728
|
"properties": {
|
|
539
729
|
"kind": {
|
|
730
|
+
"description": "The task kind, matched against the providers' task capabilities.",
|
|
540
731
|
"type": "string",
|
|
541
732
|
"minLength": 1
|
|
733
|
+
},
|
|
734
|
+
"inputs": {
|
|
735
|
+
"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.",
|
|
736
|
+
"type": "array",
|
|
737
|
+
"items": {
|
|
738
|
+
"$ref": "provider-descriptor.schema.json#/$defs/inputKind"
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
"delivery": {
|
|
742
|
+
"title": "DeliveryRequirement",
|
|
743
|
+
"description": "The output delivery the request requires. Absent for text, whose delivery is implicitly inline.",
|
|
744
|
+
"type": "object",
|
|
745
|
+
"additionalProperties": true,
|
|
746
|
+
"required": [
|
|
747
|
+
"mode"
|
|
748
|
+
],
|
|
749
|
+
"properties": {
|
|
750
|
+
"mode": {
|
|
751
|
+
"$ref": "provider-descriptor.schema.json#/$defs/outputDelivery"
|
|
752
|
+
},
|
|
753
|
+
"mediaTypes": {
|
|
754
|
+
"description": "Acceptable media types; the provider must declare at least one for the requested delivery. Absent means any.",
|
|
755
|
+
"type": "array",
|
|
756
|
+
"items": {
|
|
757
|
+
"type": "string",
|
|
758
|
+
"minLength": 1
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
"locale": {
|
|
764
|
+
"title": "LocaleRequirement",
|
|
765
|
+
"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.",
|
|
766
|
+
"type": "object",
|
|
767
|
+
"additionalProperties": true,
|
|
768
|
+
"required": [
|
|
769
|
+
"tag",
|
|
770
|
+
"match"
|
|
771
|
+
],
|
|
772
|
+
"properties": {
|
|
773
|
+
"tag": {
|
|
774
|
+
"description": "BCP 47 tag.",
|
|
775
|
+
"type": "string",
|
|
776
|
+
"minLength": 1
|
|
777
|
+
},
|
|
778
|
+
"match": {
|
|
779
|
+
"title": "LocaleMatch",
|
|
780
|
+
"description": "'exact' requires the full tag; 'language' requires only the primary language subtag and treats the region as a preference.",
|
|
781
|
+
"enum": [
|
|
782
|
+
"exact",
|
|
783
|
+
"language"
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
"voice": {
|
|
789
|
+
"title": "VoiceRequirement",
|
|
790
|
+
"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.",
|
|
791
|
+
"type": "object",
|
|
792
|
+
"additionalProperties": true,
|
|
793
|
+
"required": [
|
|
794
|
+
"requirement"
|
|
795
|
+
],
|
|
796
|
+
"properties": {
|
|
797
|
+
"gender": {
|
|
798
|
+
"$ref": "provider-dynamic-capabilities.schema.json#/$defs/voiceGender"
|
|
799
|
+
},
|
|
800
|
+
"requirement": {
|
|
801
|
+
"title": "RequirementLevel",
|
|
802
|
+
"description": "'required' takes part in routing; 'preferred' does not.",
|
|
803
|
+
"enum": [
|
|
804
|
+
"required",
|
|
805
|
+
"preferred"
|
|
806
|
+
]
|
|
807
|
+
}
|
|
808
|
+
}
|
|
542
809
|
}
|
|
543
810
|
}
|
|
544
811
|
},
|
|
@@ -619,7 +886,7 @@ export const routePlannerInputSchema = {
|
|
|
619
886
|
}
|
|
620
887
|
},
|
|
621
888
|
"providers": {
|
|
622
|
-
"description": "Static descriptors plus dynamic capability
|
|
889
|
+
"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.",
|
|
623
890
|
"type": "array",
|
|
624
891
|
"items": {
|
|
625
892
|
"type": "object",
|
|
@@ -630,107 +897,12 @@ export const routePlannerInputSchema = {
|
|
|
630
897
|
],
|
|
631
898
|
"properties": {
|
|
632
899
|
"descriptor": {
|
|
633
|
-
"
|
|
634
|
-
"
|
|
635
|
-
"required": [
|
|
636
|
-
"id",
|
|
637
|
-
"type",
|
|
638
|
-
"supports",
|
|
639
|
-
"tasks"
|
|
640
|
-
],
|
|
641
|
-
"properties": {
|
|
642
|
-
"id": {
|
|
643
|
-
"type": "string",
|
|
644
|
-
"minLength": 1
|
|
645
|
-
},
|
|
646
|
-
"type": {
|
|
647
|
-
"enum": [
|
|
648
|
-
"local",
|
|
649
|
-
"edge",
|
|
650
|
-
"cloud"
|
|
651
|
-
]
|
|
652
|
-
},
|
|
653
|
-
"supports": {
|
|
654
|
-
"type": "object",
|
|
655
|
-
"additionalProperties": true,
|
|
656
|
-
"required": [
|
|
657
|
-
"run"
|
|
658
|
-
],
|
|
659
|
-
"properties": {
|
|
660
|
-
"run": {
|
|
661
|
-
"type": "boolean"
|
|
662
|
-
},
|
|
663
|
-
"streaming": {
|
|
664
|
-
"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.",
|
|
665
|
-
"type": "boolean"
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
"cancel": {
|
|
670
|
-
"description": "Cancellation guarantee the provider offers. Carried for route explanations and telemetry; the planner does not filter on it.",
|
|
671
|
-
"enum": [
|
|
672
|
-
"hard",
|
|
673
|
-
"soft",
|
|
674
|
-
"none"
|
|
675
|
-
]
|
|
676
|
-
},
|
|
677
|
-
"tasks": {
|
|
678
|
-
"type": "array",
|
|
679
|
-
"items": {
|
|
680
|
-
"type": "string",
|
|
681
|
-
"minLength": 1
|
|
682
|
-
}
|
|
683
|
-
},
|
|
684
|
-
"privacy": {
|
|
685
|
-
"description": "Descriptor privacy metadata used to enforce local/cloud routing rules.",
|
|
686
|
-
"type": "object",
|
|
687
|
-
"additionalProperties": true,
|
|
688
|
-
"required": [
|
|
689
|
-
"dataLeavesDevice"
|
|
690
|
-
],
|
|
691
|
-
"properties": {
|
|
692
|
-
"dataLeavesDevice": {
|
|
693
|
-
"type": "boolean"
|
|
694
|
-
},
|
|
695
|
-
"regions": {
|
|
696
|
-
"type": "array",
|
|
697
|
-
"items": {
|
|
698
|
-
"type": "string",
|
|
699
|
-
"minLength": 1
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
}
|
|
900
|
+
"description": "The provider's static capability declaration.",
|
|
901
|
+
"$ref": "provider-descriptor.schema.json"
|
|
705
902
|
},
|
|
706
903
|
"capabilities": {
|
|
707
|
-
"
|
|
708
|
-
"
|
|
709
|
-
"required": [
|
|
710
|
-
"available"
|
|
711
|
-
],
|
|
712
|
-
"properties": {
|
|
713
|
-
"available": {
|
|
714
|
-
"type": "boolean"
|
|
715
|
-
},
|
|
716
|
-
"reason": {
|
|
717
|
-
"type": "string",
|
|
718
|
-
"minLength": 1
|
|
719
|
-
},
|
|
720
|
-
"streamingAvailable": {
|
|
721
|
-
"description": "Whether the provider can stream right now in this host environment. Absent inherits the static descriptor.supports.streaming value.",
|
|
722
|
-
"type": "boolean"
|
|
723
|
-
},
|
|
724
|
-
"streamingUnavailableReason": {
|
|
725
|
-
"description": "Human-readable explanation used when streamingAvailable is false. Absent lets the planner synthesize a default message.",
|
|
726
|
-
"type": "string",
|
|
727
|
-
"minLength": 1
|
|
728
|
-
},
|
|
729
|
-
"cancellationAvailable": {
|
|
730
|
-
"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).",
|
|
731
|
-
"type": "boolean"
|
|
732
|
-
}
|
|
733
|
-
}
|
|
904
|
+
"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).",
|
|
905
|
+
"$ref": "provider-dynamic-capabilities.schema.json"
|
|
734
906
|
}
|
|
735
907
|
}
|
|
736
908
|
}
|
|
@@ -783,6 +955,10 @@ export const routePlanSchema = {
|
|
|
783
955
|
"order": {
|
|
784
956
|
"type": "integer",
|
|
785
957
|
"minimum": 0
|
|
958
|
+
},
|
|
959
|
+
"voice": {
|
|
960
|
+
"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.",
|
|
961
|
+
"$ref": "provider-dynamic-capabilities.schema.json#/$defs/voice"
|
|
786
962
|
}
|
|
787
963
|
}
|
|
788
964
|
}
|
|
@@ -813,7 +989,7 @@ export const routePlanSchema = {
|
|
|
813
989
|
],
|
|
814
990
|
"properties": {
|
|
815
991
|
"code": {
|
|
816
|
-
"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.",
|
|
992
|
+
"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.",
|
|
817
993
|
"enum": [
|
|
818
994
|
"task_not_supported",
|
|
819
995
|
"run_not_supported",
|
|
@@ -823,7 +999,12 @@ export const routePlanSchema = {
|
|
|
823
999
|
"cloud_constraint",
|
|
824
1000
|
"offline",
|
|
825
1001
|
"capability_unavailable",
|
|
826
|
-
"not_in_model_profile"
|
|
1002
|
+
"not_in_model_profile",
|
|
1003
|
+
"input_not_supported",
|
|
1004
|
+
"output_delivery_not_supported",
|
|
1005
|
+
"output_format_not_supported",
|
|
1006
|
+
"locale_not_supported",
|
|
1007
|
+
"voice_not_available"
|
|
827
1008
|
]
|
|
828
1009
|
},
|
|
829
1010
|
"message": {
|
|
@@ -1320,8 +1501,19 @@ export const streamEventSchema = {
|
|
|
1320
1501
|
"required": [
|
|
1321
1502
|
"schemaVersion",
|
|
1322
1503
|
"runId",
|
|
1323
|
-
"outcome"
|
|
1324
|
-
|
|
1504
|
+
"outcome"
|
|
1505
|
+
],
|
|
1506
|
+
"anyOf": [
|
|
1507
|
+
{
|
|
1508
|
+
"required": [
|
|
1509
|
+
"finalText"
|
|
1510
|
+
]
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
"required": [
|
|
1514
|
+
"output"
|
|
1515
|
+
]
|
|
1516
|
+
}
|
|
1325
1517
|
],
|
|
1326
1518
|
"properties": {
|
|
1327
1519
|
"schemaVersion": {
|
|
@@ -1337,6 +1529,9 @@ export const streamEventSchema = {
|
|
|
1337
1529
|
"finalText": {
|
|
1338
1530
|
"type": "string"
|
|
1339
1531
|
},
|
|
1532
|
+
"output": {
|
|
1533
|
+
"$ref": "task-output.schema.json"
|
|
1534
|
+
},
|
|
1340
1535
|
"finishReason": {
|
|
1341
1536
|
"enum": [
|
|
1342
1537
|
"stop",
|
|
@@ -1407,6 +1602,9 @@ export const streamEventSchema = {
|
|
|
1407
1602
|
"outcome": {
|
|
1408
1603
|
"const": "error"
|
|
1409
1604
|
},
|
|
1605
|
+
"partialText": {
|
|
1606
|
+
"type": "string"
|
|
1607
|
+
},
|
|
1410
1608
|
"error": {
|
|
1411
1609
|
"type": "object",
|
|
1412
1610
|
"additionalProperties": true,
|
|
@@ -1467,8 +1665,7 @@ export const streamEventSchema = {
|
|
|
1467
1665
|
"required": [
|
|
1468
1666
|
"schemaVersion",
|
|
1469
1667
|
"runId",
|
|
1470
|
-
"outcome"
|
|
1471
|
-
"partialText"
|
|
1668
|
+
"outcome"
|
|
1472
1669
|
],
|
|
1473
1670
|
"properties": {
|
|
1474
1671
|
"schemaVersion": {
|
|
@@ -1484,6 +1681,9 @@ export const streamEventSchema = {
|
|
|
1484
1681
|
"partialText": {
|
|
1485
1682
|
"type": "string"
|
|
1486
1683
|
},
|
|
1684
|
+
"output": {
|
|
1685
|
+
"$ref": "task-output.schema.json"
|
|
1686
|
+
},
|
|
1487
1687
|
"reason": {
|
|
1488
1688
|
"type": "string"
|
|
1489
1689
|
},
|
|
@@ -1554,7 +1754,7 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1554
1754
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1555
1755
|
"$id": "https://schemas.inderun.dev/1.0/stream-terminal-outcome.schema.json",
|
|
1556
1756
|
"title": "StreamTerminalOutcome",
|
|
1557
|
-
"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
|
|
1757
|
+
"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.",
|
|
1558
1758
|
"oneOf": [
|
|
1559
1759
|
{
|
|
1560
1760
|
"type": "object",
|
|
@@ -1562,8 +1762,19 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1562
1762
|
"required": [
|
|
1563
1763
|
"schemaVersion",
|
|
1564
1764
|
"runId",
|
|
1565
|
-
"outcome"
|
|
1566
|
-
|
|
1765
|
+
"outcome"
|
|
1766
|
+
],
|
|
1767
|
+
"anyOf": [
|
|
1768
|
+
{
|
|
1769
|
+
"required": [
|
|
1770
|
+
"finalText"
|
|
1771
|
+
]
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
"required": [
|
|
1775
|
+
"output"
|
|
1776
|
+
]
|
|
1777
|
+
}
|
|
1567
1778
|
],
|
|
1568
1779
|
"properties": {
|
|
1569
1780
|
"schemaVersion": {
|
|
@@ -1580,9 +1791,13 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1580
1791
|
"const": "completed"
|
|
1581
1792
|
},
|
|
1582
1793
|
"finalText": {
|
|
1583
|
-
"description": "The full, cumulative text produced by
|
|
1794
|
+
"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.",
|
|
1584
1795
|
"type": "string"
|
|
1585
1796
|
},
|
|
1797
|
+
"output": {
|
|
1798
|
+
"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.",
|
|
1799
|
+
"$ref": "task-output.schema.json"
|
|
1800
|
+
},
|
|
1586
1801
|
"finishReason": {
|
|
1587
1802
|
"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.",
|
|
1588
1803
|
"enum": [
|
|
@@ -1720,6 +1935,10 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1720
1935
|
}
|
|
1721
1936
|
}
|
|
1722
1937
|
},
|
|
1938
|
+
"partialText": {
|
|
1939
|
+
"description": "Whatever cumulative text a text run had already delivered before it failed after committing to its provider. Absent when nothing was delivered.",
|
|
1940
|
+
"type": "string"
|
|
1941
|
+
},
|
|
1723
1942
|
"provenance": {
|
|
1724
1943
|
"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.",
|
|
1725
1944
|
"$ref": "execution-provenance.schema.json"
|
|
@@ -1732,8 +1951,7 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1732
1951
|
"required": [
|
|
1733
1952
|
"schemaVersion",
|
|
1734
1953
|
"runId",
|
|
1735
|
-
"outcome"
|
|
1736
|
-
"partialText"
|
|
1954
|
+
"outcome"
|
|
1737
1955
|
],
|
|
1738
1956
|
"properties": {
|
|
1739
1957
|
"schemaVersion": {
|
|
@@ -1750,9 +1968,13 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1750
1968
|
"const": "cancelled"
|
|
1751
1969
|
},
|
|
1752
1970
|
"partialText": {
|
|
1753
|
-
"description": "Whatever cumulative text had already
|
|
1971
|
+
"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.",
|
|
1754
1972
|
"type": "string"
|
|
1755
1973
|
},
|
|
1974
|
+
"output": {
|
|
1975
|
+
"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.",
|
|
1976
|
+
"$ref": "task-output.schema.json"
|
|
1977
|
+
},
|
|
1756
1978
|
"reason": {
|
|
1757
1979
|
"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.",
|
|
1758
1980
|
"type": "string"
|
|
@@ -1766,27 +1988,680 @@ export const streamTerminalOutcomeSchema = {
|
|
|
1766
1988
|
]
|
|
1767
1989
|
} as const;
|
|
1768
1990
|
|
|
1769
|
-
export const
|
|
1991
|
+
export const providerCapabilitySnapshotSchema = {
|
|
1770
1992
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1771
|
-
"$id": "https://schemas.inderun.dev/1.0/
|
|
1772
|
-
"title": "
|
|
1773
|
-
"description": "
|
|
1993
|
+
"$id": "https://schemas.inderun.dev/1.0/provider-capability-snapshot.schema.json",
|
|
1994
|
+
"title": "ProviderCapabilitySnapshot",
|
|
1995
|
+
"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.",
|
|
1774
1996
|
"type": "object",
|
|
1775
1997
|
"additionalProperties": true,
|
|
1776
1998
|
"required": [
|
|
1777
|
-
"
|
|
1778
|
-
"
|
|
1779
|
-
"
|
|
1780
|
-
"attemptCount",
|
|
1781
|
-
"fallbackOccurred",
|
|
1782
|
-
"attempts",
|
|
1783
|
-
"routeRejections"
|
|
1999
|
+
"providerId",
|
|
2000
|
+
"descriptor",
|
|
2001
|
+
"capabilities"
|
|
1784
2002
|
],
|
|
1785
2003
|
"properties": {
|
|
1786
|
-
"
|
|
1787
|
-
"description": "
|
|
1788
|
-
"
|
|
1789
|
-
|
|
2004
|
+
"providerId": {
|
|
2005
|
+
"description": "Identifier of the provider; equal to descriptor.id.",
|
|
2006
|
+
"type": "string",
|
|
2007
|
+
"minLength": 1
|
|
2008
|
+
},
|
|
2009
|
+
"descriptor": {
|
|
2010
|
+
"description": "The provider's static capability declaration.",
|
|
2011
|
+
"$ref": "provider-descriptor.schema.json"
|
|
2012
|
+
},
|
|
2013
|
+
"capabilities": {
|
|
2014
|
+
"description": "The provider's live capability check at the time of the call.",
|
|
2015
|
+
"$ref": "provider-dynamic-capabilities.schema.json"
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
} as const;
|
|
2019
|
+
|
|
2020
|
+
export const providerDescriptorSchema = {
|
|
2021
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2022
|
+
"$id": "https://schemas.inderun.dev/1.0/provider-descriptor.schema.json",
|
|
2023
|
+
"title": "ProviderDescriptor",
|
|
2024
|
+
"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.",
|
|
2025
|
+
"type": "object",
|
|
2026
|
+
"additionalProperties": true,
|
|
2027
|
+
"required": [
|
|
2028
|
+
"id",
|
|
2029
|
+
"type",
|
|
2030
|
+
"transport",
|
|
2031
|
+
"supports",
|
|
2032
|
+
"cancel",
|
|
2033
|
+
"tasks"
|
|
2034
|
+
],
|
|
2035
|
+
"properties": {
|
|
2036
|
+
"id": {
|
|
2037
|
+
"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.",
|
|
2038
|
+
"type": "string",
|
|
2039
|
+
"minLength": 1
|
|
2040
|
+
},
|
|
2041
|
+
"type": {
|
|
2042
|
+
"title": "ProviderType",
|
|
2043
|
+
"description": "Execution placement: 'local' (on the device), 'edge', or 'cloud'.",
|
|
2044
|
+
"enum": [
|
|
2045
|
+
"local",
|
|
2046
|
+
"edge",
|
|
2047
|
+
"cloud"
|
|
2048
|
+
]
|
|
2049
|
+
},
|
|
2050
|
+
"model": {
|
|
2051
|
+
"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.",
|
|
2052
|
+
"type": "string",
|
|
2053
|
+
"minLength": 1
|
|
2054
|
+
},
|
|
2055
|
+
"transport": {
|
|
2056
|
+
"title": "ProviderTransport",
|
|
2057
|
+
"description": "How the engine reaches the provider: in-process runtime, operating-system service, buffered HTTP, server-sent events, or a realtime connection.",
|
|
2058
|
+
"enum": [
|
|
2059
|
+
"in_process",
|
|
2060
|
+
"system_service",
|
|
2061
|
+
"http",
|
|
2062
|
+
"sse",
|
|
2063
|
+
"realtime"
|
|
2064
|
+
]
|
|
2065
|
+
},
|
|
2066
|
+
"streamingStyle": {
|
|
2067
|
+
"title": "StreamingStyle",
|
|
2068
|
+
"description": "How a streaming provider delivers incremental output: individual tokens, larger chunks, or whole snapshots. Absent for providers that do not stream.",
|
|
2069
|
+
"enum": [
|
|
2070
|
+
"tokens",
|
|
2071
|
+
"chunks",
|
|
2072
|
+
"snapshots"
|
|
2073
|
+
]
|
|
2074
|
+
},
|
|
2075
|
+
"supports": {
|
|
2076
|
+
"title": "ProviderSupports",
|
|
2077
|
+
"description": "Interaction modes and features the provider statically declares.",
|
|
2078
|
+
"type": "object",
|
|
2079
|
+
"additionalProperties": true,
|
|
2080
|
+
"required": [
|
|
2081
|
+
"run",
|
|
2082
|
+
"streaming",
|
|
2083
|
+
"realtime",
|
|
2084
|
+
"tools",
|
|
2085
|
+
"reasoningEvents",
|
|
2086
|
+
"structuredOutput",
|
|
2087
|
+
"multimodal"
|
|
2088
|
+
],
|
|
2089
|
+
"properties": {
|
|
2090
|
+
"run": {
|
|
2091
|
+
"description": "Whether the provider supports Mode 1 run (request/response).",
|
|
2092
|
+
"type": "boolean"
|
|
2093
|
+
},
|
|
2094
|
+
"streaming": {
|
|
2095
|
+
"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.",
|
|
2096
|
+
"type": "boolean"
|
|
2097
|
+
},
|
|
2098
|
+
"realtime": {
|
|
2099
|
+
"description": "Whether the provider supports Mode 3 realtime sessions. Reserved; no engine implements Mode 3 yet.",
|
|
2100
|
+
"type": "boolean"
|
|
2101
|
+
},
|
|
2102
|
+
"tools": {
|
|
2103
|
+
"description": "Whether the provider supports tool calling.",
|
|
2104
|
+
"type": "boolean"
|
|
2105
|
+
},
|
|
2106
|
+
"reasoningEvents": {
|
|
2107
|
+
"description": "Whether the provider emits reasoning events alongside content.",
|
|
2108
|
+
"type": "boolean"
|
|
2109
|
+
},
|
|
2110
|
+
"structuredOutput": {
|
|
2111
|
+
"description": "Whether the provider supports structured output constrained by a JSON schema.",
|
|
2112
|
+
"type": "boolean"
|
|
2113
|
+
},
|
|
2114
|
+
"multimodal": {
|
|
2115
|
+
"description": "Whether the provider accepts non-text inputs such as images or audio.",
|
|
2116
|
+
"type": "boolean"
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
"cancel": {
|
|
2121
|
+
"title": "CancelSemantics",
|
|
2122
|
+
"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.",
|
|
2123
|
+
"enum": [
|
|
2124
|
+
"hard",
|
|
2125
|
+
"soft",
|
|
2126
|
+
"none"
|
|
2127
|
+
]
|
|
2128
|
+
},
|
|
2129
|
+
"tasks": {
|
|
2130
|
+
"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).",
|
|
2131
|
+
"type": "array",
|
|
2132
|
+
"items": {
|
|
2133
|
+
"type": "string",
|
|
2134
|
+
"minLength": 1
|
|
2135
|
+
}
|
|
2136
|
+
},
|
|
2137
|
+
"limits": {
|
|
2138
|
+
"title": "ProviderLimits",
|
|
2139
|
+
"description": "Optional input and output resource limits.",
|
|
2140
|
+
"type": "object",
|
|
2141
|
+
"additionalProperties": true,
|
|
2142
|
+
"properties": {
|
|
2143
|
+
"maxInputTokens": {
|
|
2144
|
+
"description": "Largest accepted input, in tokens.",
|
|
2145
|
+
"type": "integer",
|
|
2146
|
+
"minimum": 1
|
|
2147
|
+
},
|
|
2148
|
+
"maxOutputTokens": {
|
|
2149
|
+
"description": "Largest output the provider produces, in tokens.",
|
|
2150
|
+
"type": "integer",
|
|
2151
|
+
"minimum": 1
|
|
2152
|
+
},
|
|
2153
|
+
"maxImageBytes": {
|
|
2154
|
+
"description": "Largest accepted image, in bytes.",
|
|
2155
|
+
"type": "integer",
|
|
2156
|
+
"minimum": 1
|
|
2157
|
+
},
|
|
2158
|
+
"maxAudioSeconds": {
|
|
2159
|
+
"description": "Longest accepted or produced audio, in seconds.",
|
|
2160
|
+
"type": "integer",
|
|
2161
|
+
"minimum": 1
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
},
|
|
2165
|
+
"privacy": {
|
|
2166
|
+
"title": "ProviderPrivacy",
|
|
2167
|
+
"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.",
|
|
2168
|
+
"type": "object",
|
|
2169
|
+
"additionalProperties": true,
|
|
2170
|
+
"required": [
|
|
2171
|
+
"dataLeavesDevice"
|
|
2172
|
+
],
|
|
2173
|
+
"properties": {
|
|
2174
|
+
"dataLeavesDevice": {
|
|
2175
|
+
"description": "Whether request content leaves the device.",
|
|
2176
|
+
"type": "boolean"
|
|
2177
|
+
},
|
|
2178
|
+
"regions": {
|
|
2179
|
+
"description": "Geographic regions where a cloud provider processes data.",
|
|
2180
|
+
"type": "array",
|
|
2181
|
+
"items": {
|
|
2182
|
+
"type": "string",
|
|
2183
|
+
"minLength": 1
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
},
|
|
2188
|
+
"taskCapabilities": {
|
|
2189
|
+
"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.",
|
|
2190
|
+
"type": "array",
|
|
2191
|
+
"items": {
|
|
2192
|
+
"$ref": "#/$defs/taskCapability"
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
"$defs": {
|
|
2197
|
+
"taskCapability": {
|
|
2198
|
+
"title": "ProviderTaskCapability",
|
|
2199
|
+
"description": "The provider's static capabilities for one task kind.",
|
|
2200
|
+
"type": "object",
|
|
2201
|
+
"additionalProperties": true,
|
|
2202
|
+
"required": [
|
|
2203
|
+
"kind",
|
|
2204
|
+
"inputs",
|
|
2205
|
+
"interaction",
|
|
2206
|
+
"cancel",
|
|
2207
|
+
"outputs"
|
|
2208
|
+
],
|
|
2209
|
+
"properties": {
|
|
2210
|
+
"kind": {
|
|
2211
|
+
"description": "The task kind this entry describes, e.g. 'text_to_speech'.",
|
|
2212
|
+
"type": "string",
|
|
2213
|
+
"minLength": 1
|
|
2214
|
+
},
|
|
2215
|
+
"inputs": {
|
|
2216
|
+
"description": "Input media kinds the provider accepts for this task.",
|
|
2217
|
+
"type": "array",
|
|
2218
|
+
"minItems": 1,
|
|
2219
|
+
"items": {
|
|
2220
|
+
"$ref": "#/$defs/inputKind"
|
|
2221
|
+
}
|
|
2222
|
+
},
|
|
2223
|
+
"interaction": {
|
|
2224
|
+
"title": "ProviderTaskInteraction",
|
|
2225
|
+
"description": "Interaction modes the provider supports for this task.",
|
|
2226
|
+
"type": "object",
|
|
2227
|
+
"additionalProperties": true,
|
|
2228
|
+
"required": [
|
|
2229
|
+
"run",
|
|
2230
|
+
"stream"
|
|
2231
|
+
],
|
|
2232
|
+
"properties": {
|
|
2233
|
+
"run": {
|
|
2234
|
+
"description": "Whether the provider supports Mode 1 run for this task.",
|
|
2235
|
+
"type": "boolean"
|
|
2236
|
+
},
|
|
2237
|
+
"stream": {
|
|
2238
|
+
"description": "Whether the provider supports Mode 2 stream for this task.",
|
|
2239
|
+
"type": "boolean"
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
},
|
|
2243
|
+
"cancel": {
|
|
2244
|
+
"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.",
|
|
2245
|
+
"$ref": "#/properties/cancel"
|
|
2246
|
+
},
|
|
2247
|
+
"outputs": {
|
|
2248
|
+
"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'.",
|
|
2249
|
+
"type": "array",
|
|
2250
|
+
"minItems": 1,
|
|
2251
|
+
"items": {
|
|
2252
|
+
"$ref": "#/$defs/taskOutput"
|
|
2253
|
+
}
|
|
2254
|
+
},
|
|
2255
|
+
"locales": {
|
|
2256
|
+
"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.",
|
|
2257
|
+
"type": "array",
|
|
2258
|
+
"items": {
|
|
2259
|
+
"type": "string",
|
|
2260
|
+
"minLength": 1
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
"privacy": {
|
|
2264
|
+
"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.",
|
|
2265
|
+
"$ref": "#/properties/privacy"
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
},
|
|
2269
|
+
"taskOutput": {
|
|
2270
|
+
"title": "ProviderTaskOutput",
|
|
2271
|
+
"description": "One way the provider can deliver a task's result.",
|
|
2272
|
+
"type": "object",
|
|
2273
|
+
"additionalProperties": true,
|
|
2274
|
+
"required": [
|
|
2275
|
+
"delivery"
|
|
2276
|
+
],
|
|
2277
|
+
"properties": {
|
|
2278
|
+
"delivery": {
|
|
2279
|
+
"$ref": "#/$defs/outputDelivery"
|
|
2280
|
+
},
|
|
2281
|
+
"mediaTypes": {
|
|
2282
|
+
"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.",
|
|
2283
|
+
"type": "array",
|
|
2284
|
+
"items": {
|
|
2285
|
+
"type": "string",
|
|
2286
|
+
"minLength": 1
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
},
|
|
2291
|
+
"inputKind": {
|
|
2292
|
+
"title": "TaskInputKind",
|
|
2293
|
+
"description": "A kind of input medium a task consumes.",
|
|
2294
|
+
"enum": [
|
|
2295
|
+
"text",
|
|
2296
|
+
"image",
|
|
2297
|
+
"audio"
|
|
2298
|
+
]
|
|
2299
|
+
},
|
|
2300
|
+
"outputDelivery": {
|
|
2301
|
+
"title": "OutputDelivery",
|
|
2302
|
+
"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.",
|
|
2303
|
+
"enum": [
|
|
2304
|
+
"inline",
|
|
2305
|
+
"playback",
|
|
2306
|
+
"artifact"
|
|
2307
|
+
]
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
} as const;
|
|
2311
|
+
|
|
2312
|
+
export const providerDynamicCapabilitiesSchema = {
|
|
2313
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2314
|
+
"$id": "https://schemas.inderun.dev/1.0/provider-dynamic-capabilities.schema.json",
|
|
2315
|
+
"title": "ProviderDynamicCapabilities",
|
|
2316
|
+
"$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'.",
|
|
2317
|
+
"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.",
|
|
2318
|
+
"type": "object",
|
|
2319
|
+
"additionalProperties": true,
|
|
2320
|
+
"required": [
|
|
2321
|
+
"available"
|
|
2322
|
+
],
|
|
2323
|
+
"properties": {
|
|
2324
|
+
"available": {
|
|
2325
|
+
"description": "Whether the provider is available and functional on this host right now.",
|
|
2326
|
+
"type": "boolean"
|
|
2327
|
+
},
|
|
2328
|
+
"reason": {
|
|
2329
|
+
"description": "Why the provider is unavailable, when available is false.",
|
|
2330
|
+
"type": "string",
|
|
2331
|
+
"minLength": 1
|
|
2332
|
+
},
|
|
2333
|
+
"streamingAvailable": {
|
|
2334
|
+
"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.",
|
|
2335
|
+
"type": "boolean"
|
|
2336
|
+
},
|
|
2337
|
+
"streamingUnavailableReason": {
|
|
2338
|
+
"description": "Why streaming is unavailable, when streamingAvailable is false. Absent lets the route planner synthesize a default message.",
|
|
2339
|
+
"type": "string",
|
|
2340
|
+
"minLength": 1
|
|
2341
|
+
},
|
|
2342
|
+
"cancellationAvailable": {
|
|
2343
|
+
"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.",
|
|
2344
|
+
"type": "boolean"
|
|
2345
|
+
},
|
|
2346
|
+
"taskCapabilities": {
|
|
2347
|
+
"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.",
|
|
2348
|
+
"type": "array",
|
|
2349
|
+
"items": {
|
|
2350
|
+
"$ref": "#/$defs/taskAvailability"
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
},
|
|
2354
|
+
"$defs": {
|
|
2355
|
+
"taskAvailability": {
|
|
2356
|
+
"title": "ProviderTaskAvailability",
|
|
2357
|
+
"description": "The live check for one task kind.",
|
|
2358
|
+
"type": "object",
|
|
2359
|
+
"additionalProperties": true,
|
|
2360
|
+
"required": [
|
|
2361
|
+
"kind"
|
|
2362
|
+
],
|
|
2363
|
+
"properties": {
|
|
2364
|
+
"kind": {
|
|
2365
|
+
"description": "The task kind this entry describes.",
|
|
2366
|
+
"type": "string",
|
|
2367
|
+
"minLength": 1
|
|
2368
|
+
},
|
|
2369
|
+
"available": {
|
|
2370
|
+
"description": "Whether the task can run on this host right now. Absent inherits the provider-level available. Never null.",
|
|
2371
|
+
"type": "boolean"
|
|
2372
|
+
},
|
|
2373
|
+
"reason": {
|
|
2374
|
+
"description": "Why the task is unavailable, when available is false.",
|
|
2375
|
+
"type": "string",
|
|
2376
|
+
"minLength": 1
|
|
2377
|
+
},
|
|
2378
|
+
"streamingAvailable": {
|
|
2379
|
+
"description": "Whether the task can stream on this host right now. Absent inherits. Never null.",
|
|
2380
|
+
"type": "boolean"
|
|
2381
|
+
},
|
|
2382
|
+
"streamingUnavailableReason": {
|
|
2383
|
+
"description": "Why streaming is unavailable for this task, when streamingAvailable is false.",
|
|
2384
|
+
"type": "string",
|
|
2385
|
+
"minLength": 1
|
|
2386
|
+
},
|
|
2387
|
+
"cancellationAvailable": {
|
|
2388
|
+
"description": "Whether cancellation is honored for this task right now. Absent inherits. Never null.",
|
|
2389
|
+
"type": "boolean"
|
|
2390
|
+
},
|
|
2391
|
+
"locales": {
|
|
2392
|
+
"description": "BCP 47 locales available for this task right now. Absent means the provider cannot enumerate them.",
|
|
2393
|
+
"type": "array",
|
|
2394
|
+
"items": {
|
|
2395
|
+
"type": "string",
|
|
2396
|
+
"minLength": 1
|
|
2397
|
+
}
|
|
2398
|
+
},
|
|
2399
|
+
"voices": {
|
|
2400
|
+
"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.",
|
|
2401
|
+
"type": "array",
|
|
2402
|
+
"items": {
|
|
2403
|
+
"$ref": "#/$defs/voice"
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
},
|
|
2408
|
+
"voice": {
|
|
2409
|
+
"title": "ProviderVoice",
|
|
2410
|
+
"description": "Provider-neutral traits of one available voice. Carries no provider voice identifier.",
|
|
2411
|
+
"type": "object",
|
|
2412
|
+
"additionalProperties": true,
|
|
2413
|
+
"required": [
|
|
2414
|
+
"locale"
|
|
2415
|
+
],
|
|
2416
|
+
"properties": {
|
|
2417
|
+
"locale": {
|
|
2418
|
+
"description": "BCP 47 locale the voice speaks.",
|
|
2419
|
+
"type": "string",
|
|
2420
|
+
"minLength": 1
|
|
2421
|
+
},
|
|
2422
|
+
"gender": {
|
|
2423
|
+
"$ref": "#/$defs/voiceGender"
|
|
2424
|
+
},
|
|
2425
|
+
"networkRequired": {
|
|
2426
|
+
"description": "Whether using the voice sends data off the device. Absent inherits the task's privacy posture.",
|
|
2427
|
+
"type": "boolean"
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
},
|
|
2431
|
+
"voiceGender": {
|
|
2432
|
+
"title": "VoiceGender",
|
|
2433
|
+
"description": "Perceived gender of a voice, as the platform reports it.",
|
|
2434
|
+
"enum": [
|
|
2435
|
+
"female",
|
|
2436
|
+
"male",
|
|
2437
|
+
"neutral"
|
|
2438
|
+
]
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
} as const;
|
|
2442
|
+
|
|
2443
|
+
export const artifactReadRequestSchema = {
|
|
2444
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2445
|
+
"$id": "https://schemas.inderun.dev/1.0/artifact-read-request.schema.json",
|
|
2446
|
+
"title": "ArtifactReadRequest",
|
|
2447
|
+
"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.",
|
|
2448
|
+
"type": "object",
|
|
2449
|
+
"additionalProperties": true,
|
|
2450
|
+
"required": [
|
|
2451
|
+
"artifactId"
|
|
2452
|
+
],
|
|
2453
|
+
"properties": {
|
|
2454
|
+
"artifactId": {
|
|
2455
|
+
"description": "MediaArtifact.id of the artifact to read.",
|
|
2456
|
+
"type": "string",
|
|
2457
|
+
"minLength": 1
|
|
2458
|
+
},
|
|
2459
|
+
"offset": {
|
|
2460
|
+
"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.",
|
|
2461
|
+
"type": "integer",
|
|
2462
|
+
"minimum": 0
|
|
2463
|
+
},
|
|
2464
|
+
"maxBytes": {
|
|
2465
|
+
"description": "Most bytes to return. Absent, or larger than the engine's maximum read size, means that maximum.",
|
|
2466
|
+
"type": "integer",
|
|
2467
|
+
"minimum": 1
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
} as const;
|
|
2471
|
+
|
|
2472
|
+
export const taskOutputSchema = {
|
|
2473
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2474
|
+
"$id": "https://schemas.inderun.dev/1.0/task-output.schema.json",
|
|
2475
|
+
"title": "TaskOutput",
|
|
2476
|
+
"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.",
|
|
2477
|
+
"type": "object",
|
|
2478
|
+
"additionalProperties": true,
|
|
2479
|
+
"required": [
|
|
2480
|
+
"type"
|
|
2481
|
+
],
|
|
2482
|
+
"allOf": [
|
|
2483
|
+
{
|
|
2484
|
+
"if": {
|
|
2485
|
+
"properties": {
|
|
2486
|
+
"type": {
|
|
2487
|
+
"const": "text"
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
},
|
|
2491
|
+
"then": {
|
|
2492
|
+
"required": [
|
|
2493
|
+
"text"
|
|
2494
|
+
]
|
|
2495
|
+
}
|
|
2496
|
+
},
|
|
2497
|
+
{
|
|
2498
|
+
"if": {
|
|
2499
|
+
"properties": {
|
|
2500
|
+
"type": {
|
|
2501
|
+
"const": "playback"
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
},
|
|
2505
|
+
"then": {
|
|
2506
|
+
"required": [
|
|
2507
|
+
"playback"
|
|
2508
|
+
]
|
|
2509
|
+
}
|
|
2510
|
+
},
|
|
2511
|
+
{
|
|
2512
|
+
"if": {
|
|
2513
|
+
"properties": {
|
|
2514
|
+
"type": {
|
|
2515
|
+
"const": "artifact"
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
},
|
|
2519
|
+
"then": {
|
|
2520
|
+
"required": [
|
|
2521
|
+
"artifact"
|
|
2522
|
+
]
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
],
|
|
2526
|
+
"properties": {
|
|
2527
|
+
"type": {
|
|
2528
|
+
"title": "TaskOutputType",
|
|
2529
|
+
"description": "The content representation: 'text', 'playback' or 'artifact'.",
|
|
2530
|
+
"enum": [
|
|
2531
|
+
"text",
|
|
2532
|
+
"playback",
|
|
2533
|
+
"artifact"
|
|
2534
|
+
]
|
|
2535
|
+
},
|
|
2536
|
+
"text": {
|
|
2537
|
+
"description": "The text the run produced. Required when type is 'text'.",
|
|
2538
|
+
"type": "string"
|
|
2539
|
+
},
|
|
2540
|
+
"playback": {
|
|
2541
|
+
"title": "PlaybackOutput",
|
|
2542
|
+
"description": "Completion of managed playback. Required when type is 'playback'. Carries no media.",
|
|
2543
|
+
"type": "object",
|
|
2544
|
+
"additionalProperties": true,
|
|
2545
|
+
"properties": {
|
|
2546
|
+
"durationMs": {
|
|
2547
|
+
"description": "How long audible playback lasted, in milliseconds. For a cancelled run, how long it played before it was stopped.",
|
|
2548
|
+
"type": "number",
|
|
2549
|
+
"minimum": 0
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
},
|
|
2553
|
+
"artifact": {
|
|
2554
|
+
"description": "The retrievable media the run produced. Required when type is 'artifact'.",
|
|
2555
|
+
"$ref": "media-artifact.schema.json"
|
|
2556
|
+
},
|
|
2557
|
+
"speech": {
|
|
2558
|
+
"title": "SpeechOutput",
|
|
2559
|
+
"description": "The locale and voice traits a text-to-speech run actually used, so an unmet preference is visible without being an error.",
|
|
2560
|
+
"type": "object",
|
|
2561
|
+
"additionalProperties": true,
|
|
2562
|
+
"required": [
|
|
2563
|
+
"locale"
|
|
2564
|
+
],
|
|
2565
|
+
"properties": {
|
|
2566
|
+
"locale": {
|
|
2567
|
+
"description": "BCP 47 tag of the locale that was spoken.",
|
|
2568
|
+
"type": "string",
|
|
2569
|
+
"minLength": 1
|
|
2570
|
+
},
|
|
2571
|
+
"voice": {
|
|
2572
|
+
"title": "SpeechOutputVoice",
|
|
2573
|
+
"description": "Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.",
|
|
2574
|
+
"type": "object",
|
|
2575
|
+
"additionalProperties": true,
|
|
2576
|
+
"properties": {
|
|
2577
|
+
"gender": {
|
|
2578
|
+
"$ref": "provider-dynamic-capabilities.schema.json#/$defs/voiceGender"
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
} as const;
|
|
2586
|
+
|
|
2587
|
+
export const mediaArtifactSchema = {
|
|
2588
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2589
|
+
"$id": "https://schemas.inderun.dev/1.0/media-artifact.schema.json",
|
|
2590
|
+
"title": "MediaArtifact",
|
|
2591
|
+
"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.",
|
|
2592
|
+
"type": "object",
|
|
2593
|
+
"additionalProperties": true,
|
|
2594
|
+
"required": [
|
|
2595
|
+
"id",
|
|
2596
|
+
"mediaType",
|
|
2597
|
+
"owner",
|
|
2598
|
+
"lifetime"
|
|
2599
|
+
],
|
|
2600
|
+
"properties": {
|
|
2601
|
+
"id": {
|
|
2602
|
+
"description": "Opaque, engine-issued identifier. Never a path, URL or provider identifier.",
|
|
2603
|
+
"type": "string",
|
|
2604
|
+
"minLength": 1
|
|
2605
|
+
},
|
|
2606
|
+
"mediaType": {
|
|
2607
|
+
"description": "IANA media type of the bytes, e.g. 'audio/wav'. Encoding parameters ride on the media type (e.g. 'audio/L16;rate=22050').",
|
|
2608
|
+
"type": "string",
|
|
2609
|
+
"minLength": 1
|
|
2610
|
+
},
|
|
2611
|
+
"owner": {
|
|
2612
|
+
"title": "ArtifactOwner",
|
|
2613
|
+
"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.",
|
|
2614
|
+
"enum": [
|
|
2615
|
+
"engine",
|
|
2616
|
+
"application"
|
|
2617
|
+
]
|
|
2618
|
+
},
|
|
2619
|
+
"lifetime": {
|
|
2620
|
+
"title": "ArtifactLifetime",
|
|
2621
|
+
"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.",
|
|
2622
|
+
"enum": [
|
|
2623
|
+
"until_disposed"
|
|
2624
|
+
]
|
|
2625
|
+
},
|
|
2626
|
+
"byteLength": {
|
|
2627
|
+
"description": "Size of the media in bytes. Always set for an artifact the engine materialized.",
|
|
2628
|
+
"type": "integer",
|
|
2629
|
+
"minimum": 0
|
|
2630
|
+
},
|
|
2631
|
+
"durationMs": {
|
|
2632
|
+
"description": "Duration of time-based media in milliseconds, where the producer knows it.",
|
|
2633
|
+
"type": "number",
|
|
2634
|
+
"minimum": 0
|
|
2635
|
+
},
|
|
2636
|
+
"destinationRef": {
|
|
2637
|
+
"description": "The request's delivery.destinationRef the bytes were written to. Set exactly when owner is 'application'.",
|
|
2638
|
+
"type": "string",
|
|
2639
|
+
"minLength": 1
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
} as const;
|
|
2643
|
+
|
|
2644
|
+
export const executionProvenanceSchema = {
|
|
2645
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
2646
|
+
"$id": "https://schemas.inderun.dev/1.0/execution-provenance.schema.json",
|
|
2647
|
+
"title": "ExecutionProvenance",
|
|
2648
|
+
"description": "Provider-neutral record of how an execution was carried out: the target the outcome is attributed to, its declared locality, the configured and provider-reported model, every attempt, and why other candidates were rejected. Carried on TaskResult, on every StreamTerminalOutcome branch, and on IndeRunError. It reports what the engine observed and what providers declared or reported; it never infers a model or locality a provider did not state, and it never contains request content, credentials, or provider payloads.",
|
|
2649
|
+
"type": "object",
|
|
2650
|
+
"additionalProperties": true,
|
|
2651
|
+
"required": [
|
|
2652
|
+
"schemaVersion",
|
|
2653
|
+
"modelProfile",
|
|
2654
|
+
"locality",
|
|
2655
|
+
"attemptCount",
|
|
2656
|
+
"fallbackOccurred",
|
|
2657
|
+
"attempts",
|
|
2658
|
+
"routeRejections"
|
|
2659
|
+
],
|
|
2660
|
+
"properties": {
|
|
2661
|
+
"schemaVersion": {
|
|
2662
|
+
"description": "Contract schema version used to interpret this provenance record.",
|
|
2663
|
+
"const": "1.0"
|
|
2664
|
+
},
|
|
1790
2665
|
"modelProfile": {
|
|
1791
2666
|
"description": "The model profile the request routed within; 'auto' when the request named none.",
|
|
1792
2667
|
"type": "string",
|
|
@@ -1850,6 +2725,10 @@ export const executionProvenanceSchema = {
|
|
|
1850
2725
|
"cancelled"
|
|
1851
2726
|
]
|
|
1852
2727
|
},
|
|
2728
|
+
"committed": {
|
|
2729
|
+
"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.",
|
|
2730
|
+
"type": "boolean"
|
|
2731
|
+
},
|
|
1853
2732
|
"errorClass": {
|
|
1854
2733
|
"description": "Normalized error class of a failed attempt.",
|
|
1855
2734
|
"enum": [
|
|
@@ -1893,7 +2772,12 @@ export const executionProvenanceSchema = {
|
|
|
1893
2772
|
"cloud_constraint",
|
|
1894
2773
|
"offline",
|
|
1895
2774
|
"capability_unavailable",
|
|
1896
|
-
"not_in_model_profile"
|
|
2775
|
+
"not_in_model_profile",
|
|
2776
|
+
"input_not_supported",
|
|
2777
|
+
"output_delivery_not_supported",
|
|
2778
|
+
"output_format_not_supported",
|
|
2779
|
+
"locale_not_supported",
|
|
2780
|
+
"voice_not_available"
|
|
1897
2781
|
]
|
|
1898
2782
|
}
|
|
1899
2783
|
}
|