@independo/inderun-contracts 0.4.0 → 0.5.0-rc.1
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/execution-provenance.d.ts +1 -1
- package/dist/generated/execution-provenance.d.ts.map +1 -1
- package/dist/generated/inderun-error.d.ts +1 -1
- package/dist/generated/inderun-error.d.ts.map +1 -1
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.d.ts.map +1 -1
- 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 +458 -85
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +549 -104
- package/dist/generated/stream-event.d.ts +1 -1
- package/dist/generated/stream-event.d.ts.map +1 -1
- package/dist/generated/stream-terminal-outcome.d.ts +1 -1
- package/dist/generated/stream-terminal-outcome.d.ts.map +1 -1
- package/dist/generated/task-result.d.ts +1 -1
- package/dist/generated/task-result.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validators.d.ts +9 -0
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +24 -1
- package/package.json +1 -1
- package/src/generated/execution-provenance.ts +1 -1
- package/src/generated/inderun-error.ts +1 -1
- package/src/generated/index.ts +3 -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 +552 -104
- package/src/generated/stream-event.ts +1 -1
- package/src/generated/stream-terminal-outcome.ts +1 -1
- package/src/generated/task-result.ts +1 -1
- package/src/index.ts +13 -1
- package/src/types.ts +7 -0
- package/src/validators.ts +39 -0
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
/* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* One registered provider's identity, static declaration and live capability check, as
|
|
5
|
+
* returned by checkCapabilities(). A read-only snapshot: producing it executes no task and
|
|
6
|
+
* has no side effects.
|
|
7
|
+
*/
|
|
8
|
+
export type ProviderCapabilitySnapshot = {
|
|
9
|
+
/**
|
|
10
|
+
* The provider's live capability check at the time of the call.
|
|
11
|
+
*/
|
|
12
|
+
capabilities: ProviderDynamicCapabilities;
|
|
13
|
+
/**
|
|
14
|
+
* The provider's static capability declaration.
|
|
15
|
+
*/
|
|
16
|
+
descriptor: ProviderDescriptor;
|
|
17
|
+
/**
|
|
18
|
+
* Identifier of the provider; equal to descriptor.id.
|
|
19
|
+
*/
|
|
20
|
+
providerId: string;
|
|
21
|
+
[property: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The provider's live capability check at the time of the call.
|
|
26
|
+
*
|
|
27
|
+
* A provider's live capability check, evaluated on the current host when routing or when
|
|
28
|
+
* checkCapabilities() is called. Unlike the descriptor it can change between calls.
|
|
29
|
+
*/
|
|
30
|
+
export type ProviderDynamicCapabilities = {
|
|
31
|
+
/**
|
|
32
|
+
* Whether the provider is available and functional on this host right now.
|
|
33
|
+
*/
|
|
34
|
+
available: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether cancellation is honored on this host right now. Absent inherits the static
|
|
37
|
+
* descriptor.cancel value: any value other than 'none' means available. Never null.
|
|
38
|
+
*/
|
|
39
|
+
cancellationAvailable?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Why the provider is unavailable, when available is false.
|
|
42
|
+
*/
|
|
43
|
+
reason?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the provider can stream (Mode 2) on this host right now. Absent inherits the
|
|
46
|
+
* static descriptor.supports.streaming value; only set it when the host takes streaming
|
|
47
|
+
* away from a provider that otherwise declares it. Never null.
|
|
48
|
+
*/
|
|
49
|
+
streamingAvailable?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Why streaming is unavailable, when streamingAvailable is false. Absent lets the route
|
|
52
|
+
* planner synthesize a default message.
|
|
53
|
+
*/
|
|
54
|
+
streamingUnavailableReason?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Per-task overrides of the provider-level check, for tasks whose availability differs on
|
|
57
|
+
* this host, e.g. a voice that is not installed. Every field of an entry is optional and
|
|
58
|
+
* absent inherits the provider-level value; a false at either level wins.
|
|
59
|
+
*/
|
|
60
|
+
taskCapabilities?: ProviderTaskAvailability[];
|
|
61
|
+
[property: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The live check for one task kind.
|
|
66
|
+
*/
|
|
67
|
+
export type ProviderTaskAvailability = {
|
|
68
|
+
/**
|
|
69
|
+
* Whether the task can run on this host right now. Absent inherits the provider-level
|
|
70
|
+
* available. Never null.
|
|
71
|
+
*/
|
|
72
|
+
available?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether cancellation is honored for this task right now. Absent inherits. Never null.
|
|
75
|
+
*/
|
|
76
|
+
cancellationAvailable?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The task kind this entry describes.
|
|
79
|
+
*/
|
|
80
|
+
kind: string;
|
|
81
|
+
/**
|
|
82
|
+
* BCP 47 locales available for this task right now. Absent means the provider cannot
|
|
83
|
+
* enumerate them.
|
|
84
|
+
*/
|
|
85
|
+
locales?: string[];
|
|
86
|
+
/**
|
|
87
|
+
* Why the task is unavailable, when available is false.
|
|
88
|
+
*/
|
|
89
|
+
reason?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the task can stream on this host right now. Absent inherits. Never null.
|
|
92
|
+
*/
|
|
93
|
+
streamingAvailable?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Why streaming is unavailable for this task, when streamingAvailable is false.
|
|
96
|
+
*/
|
|
97
|
+
streamingUnavailableReason?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Voices available for this task right now. Absent means the provider cannot enumerate
|
|
100
|
+
* them; a request that requires a voice then never routes to it.
|
|
101
|
+
*/
|
|
102
|
+
voices?: ProviderVoice[];
|
|
103
|
+
[property: string]: unknown;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Provider-neutral traits of one available voice. Carries no provider voice identifier.
|
|
108
|
+
*/
|
|
109
|
+
export type ProviderVoice = {
|
|
110
|
+
gender?: VoiceGender;
|
|
111
|
+
/**
|
|
112
|
+
* BCP 47 locale the voice speaks.
|
|
113
|
+
*/
|
|
114
|
+
locale: string;
|
|
115
|
+
/**
|
|
116
|
+
* Whether using the voice sends data off the device. Absent inherits the task's privacy
|
|
117
|
+
* posture.
|
|
118
|
+
*/
|
|
119
|
+
networkRequired?: boolean;
|
|
120
|
+
[property: string]: unknown;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Perceived gender of a voice, as the platform reports it.
|
|
125
|
+
*/
|
|
126
|
+
export type VoiceGender = "female" | "male" | "neutral";
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The provider's static capability declaration.
|
|
130
|
+
*
|
|
131
|
+
* A provider's static capability declaration: identity, placement, transport, supported
|
|
132
|
+
* interaction modes and tasks, cancellation guarantee, resource limits and privacy posture.
|
|
133
|
+
* It does not change while the provider is registered. The route planner,
|
|
134
|
+
* checkCapabilities() and execution provenance all read this one shape.
|
|
135
|
+
*/
|
|
136
|
+
export type ProviderDescriptor = {
|
|
137
|
+
/**
|
|
138
|
+
* Cancellation guarantee: 'hard' stops processing including remote work, 'soft' stops
|
|
139
|
+
* reading locally while remote work may continue, 'none' means cancellation is unsupported.
|
|
140
|
+
* Independently of this value, the engine delivers no event after a cancel.
|
|
141
|
+
*/
|
|
142
|
+
cancel: CancelSemantics;
|
|
143
|
+
/**
|
|
144
|
+
* Unique identifier of the provider instance (a target), e.g. 'apple_foundation_models' or
|
|
145
|
+
* 'openai_compatible_cloud:gpt-5-mini'. Model profiles list targets by this id.
|
|
146
|
+
*/
|
|
147
|
+
id: string;
|
|
148
|
+
/**
|
|
149
|
+
* Optional input and output resource limits.
|
|
150
|
+
*/
|
|
151
|
+
limits?: ProviderLimits;
|
|
152
|
+
/**
|
|
153
|
+
* The model this provider instance is bound to, when it can name one. Cloud providers
|
|
154
|
+
* report the model id they send; platform-managed models report an opaque platform alias
|
|
155
|
+
* rather than a guessed weight name. Absent means the provider cannot name its model.
|
|
156
|
+
*/
|
|
157
|
+
model?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Data-egress posture, used to enforce local and cloud routing rules. Absent means a local
|
|
160
|
+
* or edge provider is treated as keeping data on the device and a cloud provider as sending
|
|
161
|
+
* it off.
|
|
162
|
+
*/
|
|
163
|
+
privacy?: ProviderPrivacy;
|
|
164
|
+
/**
|
|
165
|
+
* How a streaming provider delivers incremental output: individual tokens, larger chunks,
|
|
166
|
+
* or whole snapshots. Absent for providers that do not stream.
|
|
167
|
+
*/
|
|
168
|
+
streamingStyle?: StreamingStyle;
|
|
169
|
+
/**
|
|
170
|
+
* Interaction modes and features the provider statically declares.
|
|
171
|
+
*/
|
|
172
|
+
supports: ProviderSupports;
|
|
173
|
+
/**
|
|
174
|
+
* What the provider can do for each task: accepted inputs, interaction modes, output
|
|
175
|
+
* deliveries and formats, cancellation, locales and privacy. When present it is
|
|
176
|
+
* authoritative for routing and must list every task the provider serves. When absent (a
|
|
177
|
+
* legacy descriptor), routing infers exactly one entry — 'text_to_text' with text input,
|
|
178
|
+
* inline output, run/stream from supports and cancel from cancel — if tasks contains
|
|
179
|
+
* 'text_to_text', and nothing for any other task: a legacy descriptor is never treated as
|
|
180
|
+
* capable of a non-text task.
|
|
181
|
+
*/
|
|
182
|
+
taskCapabilities?: ProviderTaskCapability[];
|
|
183
|
+
/**
|
|
184
|
+
* Task kinds the provider supports, e.g. 'text_to_text'. When taskCapabilities is present
|
|
185
|
+
* it must describe the same kinds and is what routing reads; without it, routing infers
|
|
186
|
+
* capabilities for 'text_to_text' alone (see taskCapabilities).
|
|
187
|
+
*/
|
|
188
|
+
tasks: string[];
|
|
189
|
+
/**
|
|
190
|
+
* How the engine reaches the provider: in-process runtime, operating-system service,
|
|
191
|
+
* buffered HTTP, server-sent events, or a realtime connection.
|
|
192
|
+
*/
|
|
193
|
+
transport: ProviderTransport;
|
|
194
|
+
/**
|
|
195
|
+
* Execution placement: 'local' (on the device), 'edge', or 'cloud'.
|
|
196
|
+
*/
|
|
197
|
+
type: ProviderType;
|
|
198
|
+
[property: string]: unknown;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Cancellation guarantee: 'hard' stops processing including remote work, 'soft' stops
|
|
203
|
+
* reading locally while remote work may continue, 'none' means cancellation is unsupported.
|
|
204
|
+
* Independently of this value, the engine delivers no event after a cancel.
|
|
205
|
+
*
|
|
206
|
+
* Cancellation guarantee for this task. It may differ from the provider-level cancel, e.g.
|
|
207
|
+
* when stopping playback is immediate but a synthesis request cannot be aborted.
|
|
208
|
+
*/
|
|
209
|
+
export type CancelSemantics = "hard" | "soft" | "none";
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Optional input and output resource limits.
|
|
213
|
+
*/
|
|
214
|
+
export type ProviderLimits = {
|
|
215
|
+
/**
|
|
216
|
+
* Longest accepted or produced audio, in seconds.
|
|
217
|
+
*/
|
|
218
|
+
maxAudioSeconds?: number;
|
|
219
|
+
/**
|
|
220
|
+
* Largest accepted image, in bytes.
|
|
221
|
+
*/
|
|
222
|
+
maxImageBytes?: number;
|
|
223
|
+
/**
|
|
224
|
+
* Largest accepted input, in tokens.
|
|
225
|
+
*/
|
|
226
|
+
maxInputTokens?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Largest output the provider produces, in tokens.
|
|
229
|
+
*/
|
|
230
|
+
maxOutputTokens?: number;
|
|
231
|
+
[property: string]: unknown;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Data-egress posture, used to enforce local and cloud routing rules. Absent means a local
|
|
236
|
+
* or edge provider is treated as keeping data on the device and a cloud provider as sending
|
|
237
|
+
* it off.
|
|
238
|
+
*
|
|
239
|
+
* Data-egress posture for this task when it differs from the provider-level privacy, e.g. a
|
|
240
|
+
* provider whose speech synthesis uses a network service. Absent inherits
|
|
241
|
+
* descriptor.privacy.
|
|
242
|
+
*/
|
|
243
|
+
export type ProviderPrivacy = {
|
|
244
|
+
/**
|
|
245
|
+
* Whether request content leaves the device.
|
|
246
|
+
*/
|
|
247
|
+
dataLeavesDevice: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Geographic regions where a cloud provider processes data.
|
|
250
|
+
*/
|
|
251
|
+
regions?: string[];
|
|
252
|
+
[property: string]: unknown;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* How a streaming provider delivers incremental output: individual tokens, larger chunks,
|
|
257
|
+
* or whole snapshots. Absent for providers that do not stream.
|
|
258
|
+
*/
|
|
259
|
+
export type StreamingStyle = "tokens" | "chunks" | "snapshots";
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Interaction modes and features the provider statically declares.
|
|
263
|
+
*/
|
|
264
|
+
export type ProviderSupports = {
|
|
265
|
+
/**
|
|
266
|
+
* Whether the provider accepts non-text inputs such as images or audio.
|
|
267
|
+
*/
|
|
268
|
+
multimodal: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Whether the provider supports Mode 3 realtime sessions. Reserved; no engine implements
|
|
271
|
+
* Mode 3 yet.
|
|
272
|
+
*/
|
|
273
|
+
realtime: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Whether the provider emits reasoning events alongside content.
|
|
276
|
+
*/
|
|
277
|
+
reasoningEvents: boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Whether the provider supports Mode 1 run (request/response).
|
|
280
|
+
*/
|
|
281
|
+
run: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Whether the provider supports Mode 2 stream. A provider that declares it must also
|
|
284
|
+
* implement the streaming adapter; the engines report it as unavailable otherwise.
|
|
285
|
+
*/
|
|
286
|
+
streaming: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Whether the provider supports structured output constrained by a JSON schema.
|
|
289
|
+
*/
|
|
290
|
+
structuredOutput: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Whether the provider supports tool calling.
|
|
293
|
+
*/
|
|
294
|
+
tools: boolean;
|
|
295
|
+
[property: string]: unknown;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* The provider's static capabilities for one task kind.
|
|
300
|
+
*/
|
|
301
|
+
export type ProviderTaskCapability = {
|
|
302
|
+
/**
|
|
303
|
+
* Cancellation guarantee for this task. It may differ from the provider-level cancel, e.g.
|
|
304
|
+
* when stopping playback is immediate but a synthesis request cannot be aborted.
|
|
305
|
+
*/
|
|
306
|
+
cancel: CancelSemantics;
|
|
307
|
+
/**
|
|
308
|
+
* Input media kinds the provider accepts for this task.
|
|
309
|
+
*/
|
|
310
|
+
inputs: [TaskInputKind, ...TaskInputKind[]];
|
|
311
|
+
/**
|
|
312
|
+
* Interaction modes the provider supports for this task.
|
|
313
|
+
*/
|
|
314
|
+
interaction: ProviderTaskInteraction;
|
|
315
|
+
/**
|
|
316
|
+
* The task kind this entry describes, e.g. 'text_to_speech'.
|
|
317
|
+
*/
|
|
318
|
+
kind: string;
|
|
319
|
+
/**
|
|
320
|
+
* BCP 47 locales the provider can serve for this task, when it knows them statically.
|
|
321
|
+
* Absent means unknown; the dynamic check may report them instead.
|
|
322
|
+
*/
|
|
323
|
+
locales?: string[];
|
|
324
|
+
/**
|
|
325
|
+
* How results of this task can be delivered. A provider lists only what it really produces:
|
|
326
|
+
* a provider that can only play audio lists 'playback' and never 'artifact'.
|
|
327
|
+
*/
|
|
328
|
+
outputs: [ProviderTaskOutput, ...ProviderTaskOutput[]];
|
|
329
|
+
/**
|
|
330
|
+
* Data-egress posture for this task when it differs from the provider-level privacy, e.g. a
|
|
331
|
+
* provider whose speech synthesis uses a network service. Absent inherits
|
|
332
|
+
* descriptor.privacy.
|
|
333
|
+
*/
|
|
334
|
+
privacy?: ProviderPrivacy;
|
|
335
|
+
[property: string]: unknown;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* A kind of input medium a task consumes.
|
|
340
|
+
*/
|
|
341
|
+
export type TaskInputKind = "text" | "image" | "audio";
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Interaction modes the provider supports for this task.
|
|
345
|
+
*/
|
|
346
|
+
export type ProviderTaskInteraction = {
|
|
347
|
+
/**
|
|
348
|
+
* Whether the provider supports Mode 1 run for this task.
|
|
349
|
+
*/
|
|
350
|
+
run: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Whether the provider supports Mode 2 stream for this task.
|
|
353
|
+
*/
|
|
354
|
+
stream: boolean;
|
|
355
|
+
[property: string]: unknown;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* One way the provider can deliver a task's result.
|
|
360
|
+
*/
|
|
361
|
+
export type ProviderTaskOutput = {
|
|
362
|
+
delivery: OutputDelivery;
|
|
363
|
+
/**
|
|
364
|
+
* Media types the provider can produce with this delivery, e.g. 'audio/wav'. Absent means
|
|
365
|
+
* the provider does not declare them; a request that requires specific media types never
|
|
366
|
+
* routes to such an output.
|
|
367
|
+
*/
|
|
368
|
+
mediaTypes?: string[];
|
|
369
|
+
[property: string]: unknown;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* How a task's result reaches the application: 'inline' content in the result (text),
|
|
374
|
+
* 'playback' as a managed, audible effect on the device with no retrievable bytes, or
|
|
375
|
+
* 'artifact' as retrievable media.
|
|
376
|
+
*/
|
|
377
|
+
export type OutputDelivery = "inline" | "playback" | "artifact";
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* How the engine reaches the provider: in-process runtime, operating-system service,
|
|
381
|
+
* buffered HTTP, server-sent events, or a realtime connection.
|
|
382
|
+
*/
|
|
383
|
+
export type ProviderTransport = "in_process" | "system_service" | "http" | "sse" | "realtime";
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Execution placement: 'local' (on the device), 'edge', or 'cloud'.
|
|
387
|
+
*/
|
|
388
|
+
export type ProviderType = "local" | "edge" | "cloud";
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A provider's static capability declaration: identity, placement, transport, supported
|
|
5
|
+
* interaction modes and tasks, cancellation guarantee, resource limits and privacy posture.
|
|
6
|
+
* It does not change while the provider is registered. The route planner,
|
|
7
|
+
* checkCapabilities() and execution provenance all read this one shape.
|
|
8
|
+
*/
|
|
9
|
+
export type ProviderDescriptor = {
|
|
10
|
+
/**
|
|
11
|
+
* Cancellation guarantee: 'hard' stops processing including remote work, 'soft' stops
|
|
12
|
+
* reading locally while remote work may continue, 'none' means cancellation is unsupported.
|
|
13
|
+
* Independently of this value, the engine delivers no event after a cancel.
|
|
14
|
+
*/
|
|
15
|
+
cancel: CancelSemantics;
|
|
16
|
+
/**
|
|
17
|
+
* Unique identifier of the provider instance (a target), e.g. 'apple_foundation_models' or
|
|
18
|
+
* 'openai_compatible_cloud:gpt-5-mini'. Model profiles list targets by this id.
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional input and output resource limits.
|
|
23
|
+
*/
|
|
24
|
+
limits?: ProviderLimits;
|
|
25
|
+
/**
|
|
26
|
+
* The model this provider instance is bound to, when it can name one. Cloud providers
|
|
27
|
+
* report the model id they send; platform-managed models report an opaque platform alias
|
|
28
|
+
* rather than a guessed weight name. Absent means the provider cannot name its model.
|
|
29
|
+
*/
|
|
30
|
+
model?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Data-egress posture, used to enforce local and cloud routing rules. Absent means a local
|
|
33
|
+
* or edge provider is treated as keeping data on the device and a cloud provider as sending
|
|
34
|
+
* it off.
|
|
35
|
+
*/
|
|
36
|
+
privacy?: ProviderDescriptorPrivacy;
|
|
37
|
+
/**
|
|
38
|
+
* How a streaming provider delivers incremental output: individual tokens, larger chunks,
|
|
39
|
+
* or whole snapshots. Absent for providers that do not stream.
|
|
40
|
+
*/
|
|
41
|
+
streamingStyle?: StreamingStyle;
|
|
42
|
+
/**
|
|
43
|
+
* Interaction modes and features the provider statically declares.
|
|
44
|
+
*/
|
|
45
|
+
supports: ProviderSupports;
|
|
46
|
+
/**
|
|
47
|
+
* What the provider can do for each task: accepted inputs, interaction modes, output
|
|
48
|
+
* deliveries and formats, cancellation, locales and privacy. When present it is
|
|
49
|
+
* authoritative for routing and must list every task the provider serves. When absent (a
|
|
50
|
+
* legacy descriptor), routing infers exactly one entry — 'text_to_text' with text input,
|
|
51
|
+
* inline output, run/stream from supports and cancel from cancel — if tasks contains
|
|
52
|
+
* 'text_to_text', and nothing for any other task: a legacy descriptor is never treated as
|
|
53
|
+
* capable of a non-text task.
|
|
54
|
+
*/
|
|
55
|
+
taskCapabilities?: ProviderTaskCapability[];
|
|
56
|
+
/**
|
|
57
|
+
* Task kinds the provider supports, e.g. 'text_to_text'. When taskCapabilities is present
|
|
58
|
+
* it must describe the same kinds and is what routing reads; without it, routing infers
|
|
59
|
+
* capabilities for 'text_to_text' alone (see taskCapabilities).
|
|
60
|
+
*/
|
|
61
|
+
tasks: string[];
|
|
62
|
+
/**
|
|
63
|
+
* How the engine reaches the provider: in-process runtime, operating-system service,
|
|
64
|
+
* buffered HTTP, server-sent events, or a realtime connection.
|
|
65
|
+
*/
|
|
66
|
+
transport: ProviderTransport;
|
|
67
|
+
/**
|
|
68
|
+
* Execution placement: 'local' (on the device), 'edge', or 'cloud'.
|
|
69
|
+
*/
|
|
70
|
+
type: ProviderType;
|
|
71
|
+
[property: string]: unknown;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Cancellation guarantee: 'hard' stops processing including remote work, 'soft' stops
|
|
76
|
+
* reading locally while remote work may continue, 'none' means cancellation is unsupported.
|
|
77
|
+
* Independently of this value, the engine delivers no event after a cancel.
|
|
78
|
+
*
|
|
79
|
+
* Cancellation guarantee for this task. It may differ from the provider-level cancel, e.g.
|
|
80
|
+
* when stopping playback is immediate but a synthesis request cannot be aborted.
|
|
81
|
+
*/
|
|
82
|
+
export type CancelSemantics = "hard" | "soft" | "none";
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Optional input and output resource limits.
|
|
86
|
+
*/
|
|
87
|
+
export type ProviderLimits = {
|
|
88
|
+
/**
|
|
89
|
+
* Longest accepted or produced audio, in seconds.
|
|
90
|
+
*/
|
|
91
|
+
maxAudioSeconds?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Largest accepted image, in bytes.
|
|
94
|
+
*/
|
|
95
|
+
maxImageBytes?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Largest accepted input, in tokens.
|
|
98
|
+
*/
|
|
99
|
+
maxInputTokens?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Largest output the provider produces, in tokens.
|
|
102
|
+
*/
|
|
103
|
+
maxOutputTokens?: number;
|
|
104
|
+
[property: string]: unknown;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Data-egress posture, used to enforce local and cloud routing rules. Absent means a local
|
|
109
|
+
* or edge provider is treated as keeping data on the device and a cloud provider as sending
|
|
110
|
+
* it off.
|
|
111
|
+
*/
|
|
112
|
+
export type ProviderDescriptorPrivacy = {
|
|
113
|
+
/**
|
|
114
|
+
* Whether request content leaves the device.
|
|
115
|
+
*/
|
|
116
|
+
dataLeavesDevice: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Geographic regions where a cloud provider processes data.
|
|
119
|
+
*/
|
|
120
|
+
regions?: string[];
|
|
121
|
+
[property: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* How a streaming provider delivers incremental output: individual tokens, larger chunks,
|
|
126
|
+
* or whole snapshots. Absent for providers that do not stream.
|
|
127
|
+
*/
|
|
128
|
+
export type StreamingStyle = "tokens" | "chunks" | "snapshots";
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Interaction modes and features the provider statically declares.
|
|
132
|
+
*/
|
|
133
|
+
export type ProviderSupports = {
|
|
134
|
+
/**
|
|
135
|
+
* Whether the provider accepts non-text inputs such as images or audio.
|
|
136
|
+
*/
|
|
137
|
+
multimodal: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the provider supports Mode 3 realtime sessions. Reserved; no engine implements
|
|
140
|
+
* Mode 3 yet.
|
|
141
|
+
*/
|
|
142
|
+
realtime: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the provider emits reasoning events alongside content.
|
|
145
|
+
*/
|
|
146
|
+
reasoningEvents: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Whether the provider supports Mode 1 run (request/response).
|
|
149
|
+
*/
|
|
150
|
+
run: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Whether the provider supports Mode 2 stream. A provider that declares it must also
|
|
153
|
+
* implement the streaming adapter; the engines report it as unavailable otherwise.
|
|
154
|
+
*/
|
|
155
|
+
streaming: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Whether the provider supports structured output constrained by a JSON schema.
|
|
158
|
+
*/
|
|
159
|
+
structuredOutput: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Whether the provider supports tool calling.
|
|
162
|
+
*/
|
|
163
|
+
tools: boolean;
|
|
164
|
+
[property: string]: unknown;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The provider's static capabilities for one task kind.
|
|
169
|
+
*/
|
|
170
|
+
export type ProviderTaskCapability = {
|
|
171
|
+
/**
|
|
172
|
+
* Cancellation guarantee for this task. It may differ from the provider-level cancel, e.g.
|
|
173
|
+
* when stopping playback is immediate but a synthesis request cannot be aborted.
|
|
174
|
+
*/
|
|
175
|
+
cancel: CancelSemantics;
|
|
176
|
+
/**
|
|
177
|
+
* Input media kinds the provider accepts for this task.
|
|
178
|
+
*/
|
|
179
|
+
inputs: [TaskInputKind, ...TaskInputKind[]];
|
|
180
|
+
/**
|
|
181
|
+
* Interaction modes the provider supports for this task.
|
|
182
|
+
*/
|
|
183
|
+
interaction: ProviderTaskInteraction;
|
|
184
|
+
/**
|
|
185
|
+
* The task kind this entry describes, e.g. 'text_to_speech'.
|
|
186
|
+
*/
|
|
187
|
+
kind: string;
|
|
188
|
+
/**
|
|
189
|
+
* BCP 47 locales the provider can serve for this task, when it knows them statically.
|
|
190
|
+
* Absent means unknown; the dynamic check may report them instead.
|
|
191
|
+
*/
|
|
192
|
+
locales?: string[];
|
|
193
|
+
/**
|
|
194
|
+
* How results of this task can be delivered. A provider lists only what it really produces:
|
|
195
|
+
* a provider that can only play audio lists 'playback' and never 'artifact'.
|
|
196
|
+
*/
|
|
197
|
+
outputs: [ProviderTaskOutput, ...ProviderTaskOutput[]];
|
|
198
|
+
/**
|
|
199
|
+
* Data-egress posture for this task when it differs from the provider-level privacy, e.g. a
|
|
200
|
+
* provider whose speech synthesis uses a network service. Absent inherits
|
|
201
|
+
* descriptor.privacy.
|
|
202
|
+
*/
|
|
203
|
+
privacy?: TaskCapabilityPrivacy;
|
|
204
|
+
[property: string]: unknown;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* A kind of input medium a task consumes.
|
|
209
|
+
*/
|
|
210
|
+
export type TaskInputKind = "text" | "image" | "audio";
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Interaction modes the provider supports for this task.
|
|
214
|
+
*/
|
|
215
|
+
export type ProviderTaskInteraction = {
|
|
216
|
+
/**
|
|
217
|
+
* Whether the provider supports Mode 1 run for this task.
|
|
218
|
+
*/
|
|
219
|
+
run: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Whether the provider supports Mode 2 stream for this task.
|
|
222
|
+
*/
|
|
223
|
+
stream: boolean;
|
|
224
|
+
[property: string]: unknown;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* One way the provider can deliver a task's result.
|
|
229
|
+
*/
|
|
230
|
+
export type ProviderTaskOutput = {
|
|
231
|
+
delivery: OutputDelivery;
|
|
232
|
+
/**
|
|
233
|
+
* Media types the provider can produce with this delivery, e.g. 'audio/wav'. Absent means
|
|
234
|
+
* the provider does not declare them; a request that requires specific media types never
|
|
235
|
+
* routes to such an output.
|
|
236
|
+
*/
|
|
237
|
+
mediaTypes?: string[];
|
|
238
|
+
[property: string]: unknown;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* How a task's result reaches the application: 'inline' content in the result (text),
|
|
243
|
+
* 'playback' as a managed, audible effect on the device with no retrievable bytes, or
|
|
244
|
+
* 'artifact' as retrievable media.
|
|
245
|
+
*/
|
|
246
|
+
export type OutputDelivery = "inline" | "playback" | "artifact";
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Data-egress posture for this task when it differs from the provider-level privacy, e.g. a
|
|
250
|
+
* provider whose speech synthesis uses a network service. Absent inherits
|
|
251
|
+
* descriptor.privacy.
|
|
252
|
+
*
|
|
253
|
+
* Data-egress posture, used to enforce local and cloud routing rules. Absent means a local
|
|
254
|
+
* or edge provider is treated as keeping data on the device and a cloud provider as sending
|
|
255
|
+
* it off.
|
|
256
|
+
*/
|
|
257
|
+
export type TaskCapabilityPrivacy = {
|
|
258
|
+
/**
|
|
259
|
+
* Whether request content leaves the device.
|
|
260
|
+
*/
|
|
261
|
+
dataLeavesDevice: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Geographic regions where a cloud provider processes data.
|
|
264
|
+
*/
|
|
265
|
+
regions?: string[];
|
|
266
|
+
[property: string]: unknown;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* How the engine reaches the provider: in-process runtime, operating-system service,
|
|
271
|
+
* buffered HTTP, server-sent events, or a realtime connection.
|
|
272
|
+
*/
|
|
273
|
+
export type ProviderTransport = "in_process" | "system_service" | "http" | "sse" | "realtime";
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Execution placement: 'local' (on the device), 'edge', or 'cloud'.
|
|
277
|
+
*/
|
|
278
|
+
export type ProviderType = "local" | "edge" | "cloud";
|