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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/generated/artifact-read-request.d.ts +24 -0
  2. package/dist/generated/artifact-read-request.d.ts.map +1 -0
  3. package/dist/generated/artifact-read-request.js +2 -0
  4. package/dist/generated/execution-provenance.d.ts +8 -1
  5. package/dist/generated/execution-provenance.d.ts.map +1 -1
  6. package/dist/generated/inderun-error.d.ts +8 -1
  7. package/dist/generated/inderun-error.d.ts.map +1 -1
  8. package/dist/generated/index.d.ts +6 -0
  9. package/dist/generated/index.d.ts.map +1 -1
  10. package/dist/generated/media-artifact.d.ts +53 -0
  11. package/dist/generated/media-artifact.d.ts.map +1 -0
  12. package/dist/generated/media-artifact.js +2 -0
  13. package/dist/generated/provider-capability-snapshot.d.ts +370 -0
  14. package/dist/generated/provider-capability-snapshot.d.ts.map +1 -0
  15. package/dist/generated/provider-capability-snapshot.js +2 -0
  16. package/dist/generated/provider-descriptor.d.ts +264 -0
  17. package/dist/generated/provider-descriptor.d.ts.map +1 -0
  18. package/dist/generated/provider-descriptor.js +2 -0
  19. package/dist/generated/provider-dynamic-capabilities.d.ts +99 -0
  20. package/dist/generated/provider-dynamic-capabilities.d.ts.map +1 -0
  21. package/dist/generated/provider-dynamic-capabilities.js +2 -0
  22. package/dist/generated/route-plan.d.ts +47 -3
  23. package/dist/generated/route-plan.d.ts.map +1 -1
  24. package/dist/generated/route-planner-input.d.ts +417 -32
  25. package/dist/generated/route-planner-input.d.ts.map +1 -1
  26. package/dist/generated/schemas.d.ts +833 -115
  27. package/dist/generated/schemas.d.ts.map +1 -1
  28. package/dist/generated/schemas.js +1038 -160
  29. package/dist/generated/stream-event.d.ts +136 -1
  30. package/dist/generated/stream-event.d.ts.map +1 -1
  31. package/dist/generated/stream-terminal-outcome.d.ts +182 -18
  32. package/dist/generated/stream-terminal-outcome.d.ts.map +1 -1
  33. package/dist/generated/task-output.d.ts +128 -0
  34. package/dist/generated/task-output.d.ts.map +1 -0
  35. package/dist/generated/task-output.js +2 -0
  36. package/dist/generated/task-request.d.ts +116 -11
  37. package/dist/generated/task-request.d.ts.map +1 -1
  38. package/dist/generated/task-result.d.ts +139 -15
  39. package/dist/generated/task-result.d.ts.map +1 -1
  40. package/dist/generated/telemetry-event.d.ts +2 -2
  41. package/dist/generated/telemetry-event.d.ts.map +1 -1
  42. package/dist/host.d.ts +24 -1
  43. package/dist/host.d.ts.map +1 -1
  44. package/dist/index.d.ts +5 -5
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -2
  47. package/dist/types.d.ts +46 -2
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/validators.d.ts +18 -0
  50. package/dist/validators.d.ts.map +1 -1
  51. package/dist/validators.js +49 -1
  52. package/package.json +1 -1
  53. package/src/generated/artifact-read-request.ts +25 -0
  54. package/src/generated/execution-provenance.ts +8 -1
  55. package/src/generated/inderun-error.ts +8 -1
  56. package/src/generated/index.ts +6 -0
  57. package/src/generated/media-artifact.ts +56 -0
  58. package/src/generated/provider-capability-snapshot.ts +388 -0
  59. package/src/generated/provider-descriptor.ts +278 -0
  60. package/src/generated/provider-dynamic-capabilities.ts +103 -0
  61. package/src/generated/route-plan.ts +49 -3
  62. package/src/generated/route-planner-input.ts +437 -36
  63. package/src/generated/schemas.ts +1044 -160
  64. package/src/generated/stream-event.ts +145 -1
  65. package/src/generated/stream-terminal-outcome.ts +191 -18
  66. package/src/generated/task-output.ts +137 -0
  67. package/src/generated/task-request.ts +124 -11
  68. package/src/generated/task-result.ts +147 -15
  69. package/src/generated/telemetry-event.ts +2 -2
  70. package/src/host.ts +30 -1
  71. package/src/index.ts +28 -1
  72. package/src/types.ts +38 -1
  73. package/src/validators.ts +76 -0
@@ -105,6 +105,7 @@ export type Payload = {
105
105
  finalText?: string;
106
106
  finishReason?: FinishReason;
107
107
  outcome?: Outcome;
108
+ output?: TaskOutput;
108
109
  /**
109
110
  * Normalized execution provenance: which target ran, its declared locality, the configured
110
111
  * and reported model, and how fallback and routing played out. See
@@ -207,6 +208,13 @@ export type ExecutionProvenance = {
207
208
  [property: string]: unknown;
208
209
  };
209
210
  export type ExecutionProvenanceAttempt = {
211
+ /**
212
+ * Whether the run committed to this provider during the attempt: its first content was
213
+ * delivered, it signalled the first possible audible effect, or it handed over an artifact.
214
+ * After commit a failure ends the run instead of falling back. Absent means the attempt did
215
+ * not commit.
216
+ */
217
+ committed?: boolean;
210
218
  /**
211
219
  * Normalized error class of a failed attempt.
212
220
  */
@@ -235,9 +243,136 @@ export type ExecutionProvenanceRouteRejection = {
235
243
  providerId: string;
236
244
  [property: string]: unknown;
237
245
  };
238
- export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile";
246
+ export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile" | "input_not_supported" | "output_delivery_not_supported" | "output_format_not_supported" | "locale_not_supported" | "voice_not_available";
239
247
  export type FinishReason = "stop" | "length" | "cancelled" | "error";
240
248
  export type Outcome = "completed" | "error" | "cancelled";
249
+ /**
250
+ * The normalized output of a run, shared by TaskResult and the completed and cancelled
251
+ * stream terminal outcomes (ADR 016). 'type' describes the content representation, not the
252
+ * task: 'text' carries inline text, 'playback' reports a managed, audible effect that has
253
+ * no retrievable bytes, and 'artifact' references retrievable media (ADR 017). A playback
254
+ * output is never an artifact, and an artifact output never implies that anything was
255
+ * played.
256
+ */
257
+ export type TaskOutput = {
258
+ /**
259
+ * The retrievable media the run produced. Required when type is 'artifact'.
260
+ */
261
+ artifact?: MediaArtifact;
262
+ /**
263
+ * Completion of managed playback. Required when type is 'playback'. Carries no media.
264
+ */
265
+ playback?: PlaybackOutput;
266
+ /**
267
+ * The locale and voice traits a text-to-speech run actually used, so an unmet preference is
268
+ * visible without being an error.
269
+ */
270
+ speech?: SpeechOutput;
271
+ /**
272
+ * The text the run produced. Required when type is 'text'.
273
+ */
274
+ text?: string;
275
+ /**
276
+ * The content representation: 'text', 'playback' or 'artifact'.
277
+ */
278
+ type: TaskOutputType;
279
+ [property: string]: unknown;
280
+ };
281
+ /**
282
+ * The retrievable media the run produced. Required when type is 'artifact'.
283
+ *
284
+ * A reference to retrievable media a run produced (ADR 017). It carries no bytes and no
285
+ * location: an engine-owned artifact is read through the engine by id, and an
286
+ * application-owned one was written to an application destination. Media-neutral: audio,
287
+ * images and video share this shape and differ only in mediaType.
288
+ */
289
+ export type MediaArtifact = {
290
+ /**
291
+ * Size of the media in bytes. Always set for an artifact the engine materialized.
292
+ */
293
+ byteLength?: number;
294
+ /**
295
+ * The request's delivery.destinationRef the bytes were written to. Set exactly when owner
296
+ * is 'application'.
297
+ */
298
+ destinationRef?: string;
299
+ /**
300
+ * Duration of time-based media in milliseconds, where the producer knows it.
301
+ */
302
+ durationMs?: number;
303
+ /**
304
+ * Opaque, engine-issued identifier. Never a path, URL or provider identifier.
305
+ */
306
+ id: string;
307
+ /**
308
+ * How long the engine keeps the bytes. 'until_disposed': until the application disposes the
309
+ * artifact or the process ends; the artifact outlives the run that produced it.
310
+ */
311
+ lifetime: "until_disposed";
312
+ /**
313
+ * IANA media type of the bytes, e.g. 'audio/wav'. Encoding parameters ride on the media
314
+ * type (e.g. 'audio/L16;rate=22050').
315
+ */
316
+ mediaType: string;
317
+ /**
318
+ * 'engine': the engine holds the bytes and the application reads them by id until it
319
+ * disposes the artifact. 'application': the bytes were written to the application
320
+ * destination named by destinationRef and the engine holds nothing.
321
+ */
322
+ owner: ArtifactOwner;
323
+ [property: string]: unknown;
324
+ };
325
+ /**
326
+ * How long the engine keeps the bytes. 'until_disposed': until the application disposes the
327
+ * artifact or the process ends; the artifact outlives the run that produced it.
328
+ */
329
+ /**
330
+ * 'engine': the engine holds the bytes and the application reads them by id until it
331
+ * disposes the artifact. 'application': the bytes were written to the application
332
+ * destination named by destinationRef and the engine holds nothing.
333
+ */
334
+ export type ArtifactOwner = "engine" | "application";
335
+ /**
336
+ * Completion of managed playback. Required when type is 'playback'. Carries no media.
337
+ */
338
+ export type PlaybackOutput = {
339
+ /**
340
+ * How long audible playback lasted, in milliseconds. For a cancelled run, how long it
341
+ * played before it was stopped.
342
+ */
343
+ durationMs?: number;
344
+ [property: string]: unknown;
345
+ };
346
+ /**
347
+ * The locale and voice traits a text-to-speech run actually used, so an unmet preference is
348
+ * visible without being an error.
349
+ */
350
+ export type SpeechOutput = {
351
+ /**
352
+ * BCP 47 tag of the locale that was spoken.
353
+ */
354
+ locale: string;
355
+ /**
356
+ * Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.
357
+ */
358
+ voice?: SpeechOutputVoice;
359
+ [property: string]: unknown;
360
+ };
361
+ /**
362
+ * Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.
363
+ */
364
+ export type SpeechOutputVoice = {
365
+ gender?: VoiceGender;
366
+ [property: string]: unknown;
367
+ };
368
+ /**
369
+ * Perceived gender of a voice, as the platform reports it.
370
+ */
371
+ export type VoiceGender = "female" | "male" | "neutral";
372
+ /**
373
+ * The content representation: 'text', 'playback' or 'artifact'.
374
+ */
375
+ export type TaskOutputType = "text" | "playback" | "artifact";
241
376
  /**
242
377
  * The lifecycle phase reached.
243
378
  */
@@ -1 +1 @@
1
- {"version":3,"file":"stream-event.d.ts","sourceRoot":"","sources":["../../src/generated/stream-event.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;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AC;AAErD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,mBAAmB,GAAG,SAAS,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAO,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,CAAC,EAAG,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAG,MAAM,CAAC;IACtB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA"}
@@ -2,23 +2,25 @@
2
2
  * How a Mode 2 stream run ended. Completion, error, and cancellation are mutually exclusive
3
3
  * terminal outcomes, enforced here as a closed set of three oneOf branches discriminated by
4
4
  * 'outcome' (unlike StreamEvent.type, this set is not open-ended: the three-way terminal
5
- * outcome is a fixed architectural guarantee, not something new outcome kinds get added
6
- * to). Exactly one StreamTerminalOutcome is produced per run, and no further StreamEvent is
7
- * delivered after it (see docs/architecture/architecture.md, 'Cancellation And Fallback').
8
- * This shape is also embedded by value as the payload of the terminal StreamEvent
9
- * (stream-event.schema.json) so it can additionally be exposed standalone, e.g. as a
10
- * completion future/promise a stream handle resolves independently of consuming the full
11
- * event sequence; the two copies must stay structurally identical. Note on
12
- * additionalProperties: per this repo's forward-compatible convention every branch permits
13
- * unknown extra fields, so mutual exclusivity is enforced via the required 'outcome'
14
- * discriminator plus each branch's own required peer field (finalText/error/partialText)
15
- * being present, not by forbidding a payload from also carrying an unrelated stray field
16
- * from another branch's vocabulary.
5
+ * outcome is a fixed architectural guarantee, not something new outcome kinds get added to;
6
+ * the payload of each branch may grow additively). Exactly one StreamTerminalOutcome is
7
+ * produced per run, and no further StreamEvent is delivered after it (see
8
+ * docs/architecture/architecture.md, 'Cancellation And Fallback'). This shape is also
9
+ * embedded by value as the payload of the terminal StreamEvent (stream-event.schema.json)
10
+ * so it can additionally be exposed standalone, e.g. as a completion future/promise a
11
+ * stream handle resolves independently of consuming the full event sequence; the two copies
12
+ * must stay structurally identical. Note on additionalProperties: per this repo's
13
+ * forward-compatible convention every branch permits unknown extra fields, so mutual
14
+ * exclusivity is enforced via the required 'outcome' discriminator plus each branch's own
15
+ * required peer field being present (finalText or output / error), and for 'cancelled' by
16
+ * the discriminator alone, not by forbidding a payload from also carrying an unrelated
17
+ * stray field from another branch's vocabulary.
17
18
  */
18
19
  export type StreamTerminalOutcome = {
19
20
  /**
20
- * The full, cumulative text produced by the run. Equivalent in role to
21
- * TaskResult.output.text for Mode 1.
21
+ * The full, cumulative text produced by a text run. Equivalent in role to
22
+ * TaskResult.output.text for Mode 1. A text run sets it; a non-text run carries output
23
+ * instead.
22
24
  */
23
25
  finalText?: string;
24
26
  /**
@@ -40,6 +42,19 @@ export type StreamTerminalOutcome = {
40
42
  * further fallback attempt is made, per the engine's cancellation guarantee.
41
43
  */
42
44
  outcome: Outcome;
45
+ /**
46
+ * The normalized output of the run, the same shape run() returns in TaskResult.output. Set
47
+ * for every non-text run; a text run may set it alongside finalText. See
48
+ * task-output.schema.json.
49
+ *
50
+ * What a cancelled non-text run had already produced: a playback run that committed (audio
51
+ * may have been heard) carries a playback output, and an artifact run cancelled while the
52
+ * engine was writing its artifact to an application destination carries that
53
+ * application-owned artifact, whose bytes the write left at the destination. Absent when
54
+ * nothing was produced, e.g. an artifact run cancelled before its artifact was handed over,
55
+ * whose partial media the engine discards. See task-output.schema.json.
56
+ */
57
+ output?: TaskOutput;
43
58
  /**
44
59
  * Normalized execution provenance: which target ran, its declared locality, the configured
45
60
  * and reported model, and how fallback and routing played out. See
@@ -74,9 +89,13 @@ export type StreamTerminalOutcome = {
74
89
  */
75
90
  error?: Error;
76
91
  /**
77
- * Whatever cumulative text had already been delivered via content_delta/content_snapshot
78
- * StreamEvents before the cancellation point. May be empty if cancellation occurred before
79
- * any content was produced.
92
+ * Whatever cumulative text a text run had already delivered before it failed after
93
+ * committing to its provider. Absent when nothing was delivered.
94
+ *
95
+ * Whatever cumulative text a text run had already delivered via
96
+ * content_delta/content_snapshot StreamEvents before the cancellation point. Always set for
97
+ * a text run, and empty if cancellation occurred before any content was produced. A
98
+ * non-text run never sets it.
80
99
  */
81
100
  partialText?: string;
82
101
  /**
@@ -212,6 +231,13 @@ export type ExecutionProvenance = {
212
231
  [property: string]: unknown;
213
232
  };
214
233
  export type ExecutionProvenanceAttempt = {
234
+ /**
235
+ * Whether the run committed to this provider during the attempt: its first content was
236
+ * delivered, it signalled the first possible audible effect, or it handed over an artifact.
237
+ * After commit a failure ends the run instead of falling back. Absent means the attempt did
238
+ * not commit.
239
+ */
240
+ committed?: boolean;
215
241
  /**
216
242
  * Normalized error class of a failed attempt.
217
243
  */
@@ -240,7 +266,7 @@ export type ExecutionProvenanceRouteRejection = {
240
266
  providerId: string;
241
267
  [property: string]: unknown;
242
268
  };
243
- export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile";
269
+ export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile" | "input_not_supported" | "output_delivery_not_supported" | "output_format_not_supported" | "locale_not_supported" | "voice_not_available";
244
270
  /**
245
271
  * How generation ended, mirroring TaskResult.finishReason for Mode 1: 'stop' (natural end),
246
272
  * 'length' (hit maxOutputTokens), 'error' (provider reported a non-fatal issue on an
@@ -250,6 +276,144 @@ export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_s
250
276
  */
251
277
  export type FinishReason = "stop" | "length" | "cancelled" | "error";
252
278
  export type Outcome = "completed" | "error" | "cancelled";
279
+ /**
280
+ * The normalized output of the run, the same shape run() returns in TaskResult.output. Set
281
+ * for every non-text run; a text run may set it alongside finalText. See
282
+ * task-output.schema.json.
283
+ *
284
+ * The normalized output of a run, shared by TaskResult and the completed and cancelled
285
+ * stream terminal outcomes (ADR 016). 'type' describes the content representation, not the
286
+ * task: 'text' carries inline text, 'playback' reports a managed, audible effect that has
287
+ * no retrievable bytes, and 'artifact' references retrievable media (ADR 017). A playback
288
+ * output is never an artifact, and an artifact output never implies that anything was
289
+ * played.
290
+ *
291
+ * What a cancelled non-text run had already produced: a playback run that committed (audio
292
+ * may have been heard) carries a playback output, and an artifact run cancelled while the
293
+ * engine was writing its artifact to an application destination carries that
294
+ * application-owned artifact, whose bytes the write left at the destination. Absent when
295
+ * nothing was produced, e.g. an artifact run cancelled before its artifact was handed over,
296
+ * whose partial media the engine discards. See task-output.schema.json.
297
+ */
298
+ export type TaskOutput = {
299
+ /**
300
+ * The retrievable media the run produced. Required when type is 'artifact'.
301
+ */
302
+ artifact?: MediaArtifact;
303
+ /**
304
+ * Completion of managed playback. Required when type is 'playback'. Carries no media.
305
+ */
306
+ playback?: PlaybackOutput;
307
+ /**
308
+ * The locale and voice traits a text-to-speech run actually used, so an unmet preference is
309
+ * visible without being an error.
310
+ */
311
+ speech?: SpeechOutput;
312
+ /**
313
+ * The text the run produced. Required when type is 'text'.
314
+ */
315
+ text?: string;
316
+ /**
317
+ * The content representation: 'text', 'playback' or 'artifact'.
318
+ */
319
+ type: TaskOutputType;
320
+ [property: string]: unknown;
321
+ };
322
+ /**
323
+ * The retrievable media the run produced. Required when type is 'artifact'.
324
+ *
325
+ * A reference to retrievable media a run produced (ADR 017). It carries no bytes and no
326
+ * location: an engine-owned artifact is read through the engine by id, and an
327
+ * application-owned one was written to an application destination. Media-neutral: audio,
328
+ * images and video share this shape and differ only in mediaType.
329
+ */
330
+ export type MediaArtifact = {
331
+ /**
332
+ * Size of the media in bytes. Always set for an artifact the engine materialized.
333
+ */
334
+ byteLength?: number;
335
+ /**
336
+ * The request's delivery.destinationRef the bytes were written to. Set exactly when owner
337
+ * is 'application'.
338
+ */
339
+ destinationRef?: string;
340
+ /**
341
+ * Duration of time-based media in milliseconds, where the producer knows it.
342
+ */
343
+ durationMs?: number;
344
+ /**
345
+ * Opaque, engine-issued identifier. Never a path, URL or provider identifier.
346
+ */
347
+ id: string;
348
+ /**
349
+ * How long the engine keeps the bytes. 'until_disposed': until the application disposes the
350
+ * artifact or the process ends; the artifact outlives the run that produced it.
351
+ */
352
+ lifetime: "until_disposed";
353
+ /**
354
+ * IANA media type of the bytes, e.g. 'audio/wav'. Encoding parameters ride on the media
355
+ * type (e.g. 'audio/L16;rate=22050').
356
+ */
357
+ mediaType: string;
358
+ /**
359
+ * 'engine': the engine holds the bytes and the application reads them by id until it
360
+ * disposes the artifact. 'application': the bytes were written to the application
361
+ * destination named by destinationRef and the engine holds nothing.
362
+ */
363
+ owner: ArtifactOwner;
364
+ [property: string]: unknown;
365
+ };
366
+ /**
367
+ * How long the engine keeps the bytes. 'until_disposed': until the application disposes the
368
+ * artifact or the process ends; the artifact outlives the run that produced it.
369
+ */
370
+ /**
371
+ * 'engine': the engine holds the bytes and the application reads them by id until it
372
+ * disposes the artifact. 'application': the bytes were written to the application
373
+ * destination named by destinationRef and the engine holds nothing.
374
+ */
375
+ export type ArtifactOwner = "engine" | "application";
376
+ /**
377
+ * Completion of managed playback. Required when type is 'playback'. Carries no media.
378
+ */
379
+ export type PlaybackOutput = {
380
+ /**
381
+ * How long audible playback lasted, in milliseconds. For a cancelled run, how long it
382
+ * played before it was stopped.
383
+ */
384
+ durationMs?: number;
385
+ [property: string]: unknown;
386
+ };
387
+ /**
388
+ * The locale and voice traits a text-to-speech run actually used, so an unmet preference is
389
+ * visible without being an error.
390
+ */
391
+ export type SpeechOutput = {
392
+ /**
393
+ * BCP 47 tag of the locale that was spoken.
394
+ */
395
+ locale: string;
396
+ /**
397
+ * Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.
398
+ */
399
+ voice?: SpeechOutputVoice;
400
+ [property: string]: unknown;
401
+ };
402
+ /**
403
+ * Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.
404
+ */
405
+ export type SpeechOutputVoice = {
406
+ gender?: VoiceGender;
407
+ [property: string]: unknown;
408
+ };
409
+ /**
410
+ * Perceived gender of a voice, as the platform reports it.
411
+ */
412
+ export type VoiceGender = "female" | "male" | "neutral";
413
+ /**
414
+ * The content representation: 'text', 'playback' or 'artifact'.
415
+ */
416
+ export type TaskOutputType = "text" | "playback" | "artifact";
253
417
  /**
254
418
  * Required metadata providing an overview of the execution result and performance metrics.
255
419
  * Same shape as TaskResult.telemetry.
@@ -1 +1 @@
1
- {"version":3,"file":"stream-terminal-outcome.d.ts","sourceRoot":"","sources":["../../src/generated/stream-terminal-outcome.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,Y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AG,sBAAsB,CAAC;AAEhO;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAErE,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,KAAK,GAAG;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA"}
1
+ {"version":3,"file":"stream-terminal-outcome.d.ts","sourceRoot":"","sources":["../../src/generated/stream-terminal-outcome.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;;;;;OASG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;I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C/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,KAAK,GAAG;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * The normalized output of a run, shared by TaskResult and the completed and cancelled
3
+ * stream terminal outcomes (ADR 016). 'type' describes the content representation, not the
4
+ * task: 'text' carries inline text, 'playback' reports a managed, audible effect that has
5
+ * no retrievable bytes, and 'artifact' references retrievable media (ADR 017). A playback
6
+ * output is never an artifact, and an artifact output never implies that anything was
7
+ * played.
8
+ */
9
+ export type TaskOutput = {
10
+ /**
11
+ * The retrievable media the run produced. Required when type is 'artifact'.
12
+ */
13
+ artifact?: MediaArtifact;
14
+ /**
15
+ * Completion of managed playback. Required when type is 'playback'. Carries no media.
16
+ */
17
+ playback?: PlaybackOutput;
18
+ /**
19
+ * The locale and voice traits a text-to-speech run actually used, so an unmet preference is
20
+ * visible without being an error.
21
+ */
22
+ speech?: SpeechOutput;
23
+ /**
24
+ * The text the run produced. Required when type is 'text'.
25
+ */
26
+ text?: string;
27
+ /**
28
+ * The content representation: 'text', 'playback' or 'artifact'.
29
+ */
30
+ type: TaskOutputType;
31
+ [property: string]: unknown;
32
+ };
33
+ /**
34
+ * The retrievable media the run produced. Required when type is 'artifact'.
35
+ *
36
+ * A reference to retrievable media a run produced (ADR 017). It carries no bytes and no
37
+ * location: an engine-owned artifact is read through the engine by id, and an
38
+ * application-owned one was written to an application destination. Media-neutral: audio,
39
+ * images and video share this shape and differ only in mediaType.
40
+ */
41
+ export type MediaArtifact = {
42
+ /**
43
+ * Size of the media in bytes. Always set for an artifact the engine materialized.
44
+ */
45
+ byteLength?: number;
46
+ /**
47
+ * The request's delivery.destinationRef the bytes were written to. Set exactly when owner
48
+ * is 'application'.
49
+ */
50
+ destinationRef?: string;
51
+ /**
52
+ * Duration of time-based media in milliseconds, where the producer knows it.
53
+ */
54
+ durationMs?: number;
55
+ /**
56
+ * Opaque, engine-issued identifier. Never a path, URL or provider identifier.
57
+ */
58
+ id: string;
59
+ /**
60
+ * How long the engine keeps the bytes. 'until_disposed': until the application disposes the
61
+ * artifact or the process ends; the artifact outlives the run that produced it.
62
+ */
63
+ lifetime: "until_disposed";
64
+ /**
65
+ * IANA media type of the bytes, e.g. 'audio/wav'. Encoding parameters ride on the media
66
+ * type (e.g. 'audio/L16;rate=22050').
67
+ */
68
+ mediaType: string;
69
+ /**
70
+ * 'engine': the engine holds the bytes and the application reads them by id until it
71
+ * disposes the artifact. 'application': the bytes were written to the application
72
+ * destination named by destinationRef and the engine holds nothing.
73
+ */
74
+ owner: ArtifactOwner;
75
+ [property: string]: unknown;
76
+ };
77
+ /**
78
+ * How long the engine keeps the bytes. 'until_disposed': until the application disposes the
79
+ * artifact or the process ends; the artifact outlives the run that produced it.
80
+ */
81
+ /**
82
+ * 'engine': the engine holds the bytes and the application reads them by id until it
83
+ * disposes the artifact. 'application': the bytes were written to the application
84
+ * destination named by destinationRef and the engine holds nothing.
85
+ */
86
+ export type ArtifactOwner = "engine" | "application";
87
+ /**
88
+ * Completion of managed playback. Required when type is 'playback'. Carries no media.
89
+ */
90
+ export type PlaybackOutput = {
91
+ /**
92
+ * How long audible playback lasted, in milliseconds. For a cancelled run, how long it
93
+ * played before it was stopped.
94
+ */
95
+ durationMs?: number;
96
+ [property: string]: unknown;
97
+ };
98
+ /**
99
+ * The locale and voice traits a text-to-speech run actually used, so an unmet preference is
100
+ * visible without being an error.
101
+ */
102
+ export type SpeechOutput = {
103
+ /**
104
+ * BCP 47 tag of the locale that was spoken.
105
+ */
106
+ locale: string;
107
+ /**
108
+ * Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.
109
+ */
110
+ voice?: SpeechOutputVoice;
111
+ [property: string]: unknown;
112
+ };
113
+ /**
114
+ * Provider-neutral traits of the voice that spoke. Carries no provider voice identifier.
115
+ */
116
+ export type SpeechOutputVoice = {
117
+ gender?: VoiceGender;
118
+ [property: string]: unknown;
119
+ };
120
+ /**
121
+ * Perceived gender of a voice, as the platform reports it.
122
+ */
123
+ export type VoiceGender = "female" | "male" | "neutral";
124
+ /**
125
+ * The content representation: 'text', 'playback' or 'artifact'.
126
+ */
127
+ export type TaskOutputType = "text" | "playback" | "artifact";
128
+ //# sourceMappingURL=task-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-output.d.ts","sourceRoot":"","sources":["../../src/generated/task-output.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IACrB,CAAC,QAAQ,EA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