@mux/ai 0.62.0 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,542 +1,10 @@
1
1
  import { LanguageModel, generateText as generateText$1 } from 'ai';
2
- import { i as TokenUsage, l as WorkflowCredentialsInput, M as MuxAsset, A as AssetTextTrack, f as ScopedMuxAIOptions, I as ImageSubmissionMode, d as MuxAIOptions, b as ChunkingStrategy, k as VideoEmbeddingsResult, H as Hotspot, y as Shot, q as VTTCue, j as ToneType, g as StorageAdapter } from './transcripts-DuNI058z.js';
2
+ import { aO as ClassifiedErrorsOption, O as WorkflowCredentialsInput, d as MuxAiError, e as MuxAsset, A as AssetTextTrack, a as MuxAiErrorFacts, K as TokenUsage, D as ScopedMuxAIOptions, I as ImageSubmissionMode, y as MuxAIOptions, j as ChunkingStrategy, N as VideoEmbeddingsResult, a9 as Hotspot, ag as Shot, a5 as VTTCue, L as ToneType, H as StorageAdapter } from './transcripts-So1KIXSI.js';
3
3
  import { z } from 'zod';
4
4
  import { S as SafetyReport, e as PromptOverrides, h as SceneContextItemV1, D as DEFAULT_DESCRIPTION_LENGTH, a as DEFAULT_SUMMARY_KEYWORD_LIMIT, b as DEFAULT_TITLE_LENGTH } from './summarization-BFmhXeAu.js';
5
5
  import { createAnthropic } from '@ai-sdk/anthropic';
6
6
  import { createGoogleGenerativeAI } from '@ai-sdk/google';
7
7
  import { createOpenAI } from '@ai-sdk/openai';
8
- import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
9
-
10
- /**
11
- * What a legacy error carries across a Workflow step boundary: the pre-classification
12
- * shape, so it revives with its end-user message.
13
- */
14
- interface LegacySerializedMuxAiError {
15
- message: string;
16
- publicType: MuxAiErrorType;
17
- retryable: boolean;
18
- stack?: string;
19
- usage?: TokenUsage;
20
- finishReason?: string;
21
- rawFinishReason?: string;
22
- diagnostics?: ModelCallDiagnostics;
23
- }
24
-
25
- /**
26
- * Public error categories for job outcomes. One list for the SDK and its consumers,
27
- * which may extend it with their own types (e.g. request-time HTTP errors). Treat
28
- * `type` as an open string, so adding a value is not a breaking change.
29
- */
30
- declare const MUX_AI_ERROR_TYPES: {
31
- /** The request, the asset or the account can't be used as it is. */
32
- readonly VALIDATION_ERROR: "validation_error";
33
- /** The work was attempted and failed. */
34
- readonly PROCESSING_ERROR: "processing_error";
35
- /** The work didn't finish in time. */
36
- readonly TIMEOUT_ERROR: "timeout_error";
37
- /** Content was refused by a content policy. */
38
- readonly CONTENT_POLICY_ERROR: "content_policy_error";
39
- /** A service is rate limiting or over capacity. */
40
- readonly CAPACITY_ERROR: "capacity_error";
41
- /** A fault in this code or its configuration. */
42
- readonly SERVER_ERROR: "server_error";
43
- };
44
- type MuxAiErrorType = typeof MUX_AI_ERROR_TYPES[keyof typeof MUX_AI_ERROR_TYPES];
45
- declare const MUX_AI_ERROR_TYPE_VALUES: readonly MuxAiErrorType[];
46
- /** Whose problem a failure is, judged from the SDK caller's side. A consumer may re-attribute it. */
47
- declare const MUX_AI_ERROR_SOURCES: {
48
- /** The caller's input, e.g. a scope past the end of the asset. */
49
- readonly REQUEST: "request";
50
- /** The Mux asset's state, e.g. no caption track in the requested language. */
51
- readonly ASSET: "asset";
52
- /** The Mux account or environment, e.g. missing permissions. */
53
- readonly ACCOUNT: "account";
54
- /** A remote service failed, e.g. the dubbing provider reported a failed dub. */
55
- readonly UPSTREAM: "upstream";
56
- /** This code, or the configuration of the service running it, e.g. missing signing keys. */
57
- readonly INTERNAL: "internal";
58
- };
59
- type MuxAiErrorSource = typeof MUX_AI_ERROR_SOURCES[keyof typeof MUX_AI_ERROR_SOURCES];
60
- declare const MUX_AI_ERROR_SOURCE_VALUES: readonly MuxAiErrorSource[];
61
- /** A remote service reached over the network. Libraries in this process are not dependencies. */
62
- declare const MUX_AI_ERROR_DEPENDENCIES: {
63
- /** Mux Video: the API, stream and image delivery, and its static renditions and tracks. */
64
- readonly MUX_VIDEO: "mux_video";
65
- /** Mux Data: its API, e.g. engagement data (heatmaps and hotspots). */
66
- readonly MUX_DATA: "mux_data";
67
- /** A model or AI service provider, e.g. a language model API or the dubbing provider. */
68
- readonly AI_PROVIDER: "ai_provider";
69
- /** Object storage the SDK writes to or reads from, e.g. an S3-compatible bucket. */
70
- readonly STORAGE: "storage";
71
- };
72
- type MuxAiErrorDependency = typeof MUX_AI_ERROR_DEPENDENCIES[keyof typeof MUX_AI_ERROR_DEPENDENCIES];
73
- declare const MUX_AI_ERROR_DEPENDENCY_VALUES: readonly MuxAiErrorDependency[];
74
- type MuxAiErrorFactValue = string | number | boolean | null | MuxAiErrorFactValue[] | {
75
- [key: string]: MuxAiErrorFactValue;
76
- };
77
- /**
78
- * Details of one occurrence, JSON-safe so they survive step boundaries. Internal by
79
- * default: a consumer chooses what, if anything, to show. Dependency errors always
80
- * carry `call` (the outside call's snake_case name), plus `status` and `requestId`
81
- * when there was a response. A failure blamed on an input the caller passed carries
82
- * `inputs`: the input names involved (e.g. `credentials`), so a caller that set that
83
- * input itself, rather than passing on its end user's, can re-attribute the failure.
84
- */
85
- type MuxAiErrorFacts = Readonly<Record<string, MuxAiErrorFactValue>>;
86
- /**
87
- * Opts a shared helper into raising classified errors. A workflow passes it once it has
88
- * moved onto the classified model; without it, the helper fails exactly as it did
89
- * before, so workflows that haven't moved see no change. It goes away once every
90
- * caller has moved and classified errors become the only behavior.
91
- */
92
- interface ClassifiedErrorsOption {
93
- classifiedErrors?: boolean;
94
- }
95
- /**
96
- * What a code implies, in any catalog built on {@link ClassifiedError}: its type,
97
- * source and dependency, and retry overrides that hold for every occurrence.
98
- */
99
- /**
100
- * A failure's source and the remote service involved, if any. An `upstream` failure is a
101
- * remote service's, so it always names the dependency; any other source names one when a
102
- * remote call was involved (e.g. Mux's 404 for the caller's asset).
103
- */
104
- type SourceAndDependency<TDependency extends string = string> = {
105
- source: typeof MUX_AI_ERROR_SOURCES.UPSTREAM;
106
- dependency: TDependency;
107
- } | {
108
- source: Exclude<MuxAiErrorSource, typeof MUX_AI_ERROR_SOURCES.UPSTREAM>;
109
- dependency?: TDependency;
110
- };
111
- type ErrorCatalogEntry<TType extends string = string, TDependency extends string = string> = {
112
- type: TType;
113
- /** Overrides the default from {@link defaultRetryable} for every error with this code. */
114
- retryable?: boolean;
115
- /** Overrides the default from {@link defaultTransient} for every error with this code. */
116
- transient?: boolean;
117
- } & SourceAndDependency<TDependency>;
118
- /**
119
- * Codes for conditions precise enough to name. A code implies its type, source and
120
- * dependency (see {@link MUX_AI_ERROR_CATALOG}), so a site raising it can't contradict
121
- * them. Codes name the condition, never the vendor.
122
- */
123
- declare const MUX_AI_ERROR_CODES: {
124
- /** The requested time range is invalid, or has nothing to work with. Facts: `reason` (`invalid_start_time`, `invalid_end_time`, `exceeds_duration`, `empty_range`, `no_video`, `no_transcript`) and the bounds involved. */
125
- readonly INVALID_SCOPE: "invalid_scope";
126
- /** Existing tracks block writing the output track under the chosen replacement policy. Facts: `reason` (`policy_fail`, `not_generated`, `name_collision`, `primary_audio`), `conflictingTracks` and the target track, plus `sourceRestored` and `restoredTrackId` when a source track was deleted first. */
127
- readonly TRACK_REPLACEMENT_BLOCKED: "track_replacement_blocked";
128
- /** An option's value can't be used. Facts: `parameter` (the caller's option name), `reason` (`too_many`, `empty`, `too_long`, `disallowed_characters`, `not_normalized`, `multiline`, `required_with`, `conflicts_with`, `not_allowed`, `one_of_required`) and the values the reason names: `count` and `max`, `index` (0-based entry), `length` and `maxLength`, `characters`, `with` and `withValue` (the other option), `allowed` and `value`, `parameters` (the options to choose from). */
129
- readonly INVALID_PARAMETER: "invalid_parameter";
130
- /** A numeric option is outside its allowed range. Facts: `parameter` (the caller's option name), `value`, `min`, `max`, and `integer` when it must be a whole number. */
131
- readonly PARAMETER_OUT_OF_RANGE: "parameter_out_of_range";
132
- /** No ready caption track matches the requested track or language. Facts: `trackId` or `languageCode`, and what is available. */
133
- readonly CAPTION_TRACK_NOT_FOUND: "caption_track_not_found";
134
- /** The caption track has no language, so its source language can't be determined. Facts: `trackId`. */
135
- readonly CAPTION_TRACK_LANGUAGE_MISSING: "caption_track_language_missing";
136
- /** The asset has no public or signed playback ID (DRM-only assets included). */
137
- readonly PLAYBACK_ID_NOT_FOUND: "playback_id_not_found";
138
- /** Mux has no asset with the requested ID in this environment. Facts: `assetId`. */
139
- readonly ASSET_NOT_FOUND: "asset_not_found";
140
- /** The transcript has no usable content. */
141
- readonly TRANSCRIPT_EMPTY: "transcript_empty";
142
- /** The asset has no valid duration, so work that depends on it can't run. Facts: `assetId`. */
143
- readonly ASSET_DURATION_UNAVAILABLE: "asset_duration_unavailable";
144
- /** Mux won't add an audio track to this asset. Facts: `reason` (`clip`, `live_stream`, `audio_only`). */
145
- readonly AUDIO_TRACK_UNSUPPORTED: "audio_track_unsupported";
146
- /** The asset's existing static rendition can't be used as a source. Facts: `reason` (`unusable`, `too_large`) and the rendition's details. */
147
- readonly STATIC_RENDITION_UNSUPPORTED: "static_rendition_unsupported";
148
- /** Signed playback needs signing keys the service running the SDK didn't provide. */
149
- readonly SIGNING_CREDENTIALS_MISSING: "signing_credentials_missing";
150
- /** Storage is needed but the service running the SDK didn't configure it. */
151
- readonly STORAGE_NOT_CONFIGURED: "storage_not_configured";
152
- /** A track write failed, but the opted-in result carried no classified error: a bug in the SDK's track-write path. Facts: `reason`, the raw failure's message. */
153
- readonly TRACK_WRITE_UNCLASSIFIED: "track_write_unclassified";
154
- /** Mux answered a track create without a track id. The track may exist, so it isn't step-retried. Facts: `call`, `assetId`. */
155
- readonly TRACK_ID_MISSING: "track_id_missing";
156
- /** The asset snapshot the service running the SDK passed in is for a different asset than the one requested. Facts: `assetId`, `snapshotAssetId`. */
157
- readonly ASSET_SNAPSHOT_MISMATCH: "asset_snapshot_mismatch";
158
- /** Mux answered an asset fetch with a different asset than the one requested. Facts: `assetId`, `returnedAssetId`. */
159
- readonly ASSET_ID_MISMATCH: "asset_id_mismatch";
160
- /** Translation needed to split a chunk of fewer than two cues: a bug in the SDK's chunking. Facts: `chunkId`, `cueCount`. */
161
- readonly TRANSLATION_CHUNK_UNSPLITTABLE: "translation_chunk_unsplittable";
162
- /** The model provider refused the content. Facts: `reason` and `category`. */
163
- readonly CONTENT_POLICY_BLOCKED: "content_policy_blocked";
164
- /** The model returned no output, or a required field was empty. Facts: `call`, `provider`, `model`, and `assetId` when there is one. */
165
- readonly MODEL_OUTPUT_MISSING: "model_output_missing";
166
- /** The model's output breaks the expected shape or constraints (counts, allowed values, limits). Facts: `call`, `provider`, `model`, and `assetId` when there is one. */
167
- readonly MODEL_OUTPUT_INVALID: "model_output_invalid";
168
- /** The model's output was withheld by the SDK's output safety filter (a suspected prompt leak). */
169
- readonly MODEL_OUTPUT_SUPPRESSED: "model_output_suppressed";
170
- /** The model stopped early for a reason other than the length limit. */
171
- readonly MODEL_OUTPUT_INCOMPLETE: "model_output_incomplete";
172
- /** The model hit the output length limit. */
173
- readonly MODEL_OUTPUT_TRUNCATED: "model_output_truncated";
174
- /** Mux reported the static rendition a workflow needs as errored. */
175
- readonly STATIC_RENDITION_FAILED: "static_rendition_failed";
176
- /** The dubbing provider doesn't support the requested language. Facts: `language` and `which` (`target` or `source`). */
177
- readonly DUBBING_LANGUAGE_UNSUPPORTED: "dubbing_language_unsupported";
178
- /** The dubbing provider ran the dub and reported it failed. Facts: `providerError`, the provider's display text, when it gave one. */
179
- readonly DUBBING_FAILED: "dubbing_failed";
180
- /** The dubbing provider didn't finish the dub within the polling budget. Facts: `dubbingId`, `timeoutSeconds`, `lastStatus`. */
181
- readonly DUBBING_TIMEOUT: "dubbing_timeout";
182
- /** The asset has no audio track, so there is no audio to work with. Facts: `assetId`. */
183
- readonly AUDIO_TRACK_MISSING: "audio_track_missing";
184
- /** Writing an audio track would replace the asset's primary audio track, which can't be replaced. Facts: `languageCode`, `conflictingTracks`. */
185
- readonly PRIMARY_AUDIO_TRACK_CONFLICT: "primary_audio_track_conflict";
186
- /** The asset's static rendition settings changed while waiting for its rendition. A new job uses the new settings. Facts: `assetId`. */
187
- readonly STATIC_RENDITION_CHANGED: "static_rendition_changed";
188
- /** Mux didn't finish the static rendition within the polling budget. Facts: `assetId`, `attempts`, `pollIntervalMs`, `lastStatus`. */
189
- readonly STATIC_RENDITION_TIMEOUT: "static_rendition_timeout";
190
- };
191
- type MuxAiErrorCode = typeof MUX_AI_ERROR_CODES[keyof typeof MUX_AI_ERROR_CODES];
192
- declare const MUX_AI_ERROR_CODE_VALUES: readonly MuxAiErrorCode[];
193
- /** The classification and retry policy each code implies. */
194
- declare const MUX_AI_ERROR_CATALOG: {
195
- readonly invalid_scope: {
196
- readonly type: "validation_error";
197
- readonly source: "request";
198
- };
199
- readonly track_replacement_blocked: {
200
- readonly type: "validation_error";
201
- readonly source: "request";
202
- };
203
- readonly invalid_parameter: {
204
- readonly type: "validation_error";
205
- readonly source: "request";
206
- };
207
- readonly parameter_out_of_range: {
208
- readonly type: "validation_error";
209
- readonly source: "request";
210
- };
211
- readonly asset_not_found: {
212
- readonly type: "validation_error";
213
- readonly source: "request";
214
- readonly dependency: "mux_video";
215
- };
216
- readonly caption_track_not_found: {
217
- readonly type: "validation_error";
218
- readonly source: "asset";
219
- };
220
- readonly playback_id_not_found: {
221
- readonly type: "validation_error";
222
- readonly source: "asset";
223
- };
224
- readonly asset_duration_unavailable: {
225
- readonly type: "validation_error";
226
- readonly source: "asset";
227
- };
228
- readonly transcript_empty: {
229
- readonly type: "validation_error";
230
- readonly source: "asset";
231
- };
232
- readonly audio_track_unsupported: {
233
- readonly type: "validation_error";
234
- readonly source: "asset";
235
- };
236
- readonly static_rendition_unsupported: {
237
- readonly type: "validation_error";
238
- readonly source: "asset";
239
- };
240
- readonly signing_credentials_missing: {
241
- readonly type: "server_error";
242
- readonly source: "internal";
243
- };
244
- readonly storage_not_configured: {
245
- readonly type: "server_error";
246
- readonly source: "internal";
247
- };
248
- readonly asset_snapshot_mismatch: {
249
- readonly type: "server_error";
250
- readonly source: "internal";
251
- };
252
- readonly track_write_unclassified: {
253
- readonly type: "server_error";
254
- readonly source: "internal";
255
- };
256
- readonly translation_chunk_unsplittable: {
257
- readonly type: "server_error";
258
- readonly source: "internal";
259
- };
260
- readonly caption_track_language_missing: {
261
- readonly type: "validation_error";
262
- readonly source: "asset";
263
- };
264
- readonly track_id_missing: {
265
- readonly type: "processing_error";
266
- readonly source: "upstream";
267
- readonly dependency: "mux_video";
268
- };
269
- readonly asset_id_mismatch: {
270
- readonly type: "processing_error";
271
- readonly source: "upstream";
272
- readonly dependency: "mux_video";
273
- };
274
- readonly content_policy_blocked: {
275
- readonly type: "content_policy_error";
276
- readonly source: "asset";
277
- readonly dependency: "ai_provider";
278
- };
279
- readonly model_output_missing: {
280
- readonly type: "processing_error";
281
- readonly source: "upstream";
282
- readonly dependency: "ai_provider";
283
- readonly transient: false;
284
- readonly retryable: false;
285
- };
286
- readonly model_output_invalid: {
287
- readonly type: "processing_error";
288
- readonly source: "upstream";
289
- readonly dependency: "ai_provider";
290
- readonly transient: false;
291
- readonly retryable: false;
292
- };
293
- readonly model_output_suppressed: {
294
- readonly type: "processing_error";
295
- readonly source: "upstream";
296
- readonly dependency: "ai_provider";
297
- readonly transient: false;
298
- readonly retryable: false;
299
- };
300
- readonly model_output_incomplete: {
301
- readonly type: "processing_error";
302
- readonly source: "upstream";
303
- readonly dependency: "ai_provider";
304
- readonly transient: false;
305
- readonly retryable: true;
306
- };
307
- readonly model_output_truncated: {
308
- readonly type: "processing_error";
309
- readonly source: "internal";
310
- readonly dependency: "ai_provider";
311
- };
312
- readonly static_rendition_failed: {
313
- readonly type: "processing_error";
314
- readonly source: "upstream";
315
- readonly dependency: "mux_video";
316
- readonly transient: false;
317
- readonly retryable: false;
318
- };
319
- readonly dubbing_language_unsupported: {
320
- readonly type: "validation_error";
321
- readonly source: "request";
322
- readonly dependency: "ai_provider";
323
- };
324
- readonly dubbing_failed: {
325
- readonly type: "processing_error";
326
- readonly source: "upstream";
327
- readonly dependency: "ai_provider";
328
- readonly transient: false;
329
- readonly retryable: true;
330
- };
331
- readonly dubbing_timeout: {
332
- readonly type: "timeout_error";
333
- readonly source: "upstream";
334
- readonly dependency: "ai_provider";
335
- readonly transient: false;
336
- readonly retryable: true;
337
- };
338
- readonly static_rendition_timeout: {
339
- readonly type: "timeout_error";
340
- readonly source: "upstream";
341
- readonly dependency: "mux_video";
342
- readonly transient: false;
343
- readonly retryable: true;
344
- };
345
- readonly audio_track_missing: {
346
- readonly type: "validation_error";
347
- readonly source: "asset";
348
- };
349
- readonly primary_audio_track_conflict: {
350
- readonly type: "validation_error";
351
- readonly source: "asset";
352
- };
353
- readonly static_rendition_changed: {
354
- readonly type: "processing_error";
355
- readonly source: "asset";
356
- readonly retryable: true;
357
- };
358
- };
359
- interface ModelCallDiagnostics {
360
- phase: "brief" | "draft" | "format_repair" | "length_repair";
361
- provider: string;
362
- modelId: string;
363
- maxOutputTokens?: number;
364
- }
365
- /**
366
- * No response, a timeout, "too early", rate limiting or a server error: worth retrying.
367
- * A 409 is not: unlike the AI SDK's own retry loop, a conflict here means state that
368
- * a retry would hit again.
369
- */
370
- declare function isTransientStatus(status: number | undefined): boolean;
371
- /** A short record of one raw cause, kept across step boundaries in place of the cause itself. */
372
- interface ErrorCauseSummary {
373
- name: string;
374
- message: string;
375
- status?: number;
376
- }
377
- /**
378
- * The classification a coded site states: the code, and the type, source and dependency
379
- * its catalog entry implies. Each code accepts only its own, so a site reads on its own
380
- * and can't contradict the catalog.
381
- */
382
- type CodedClassification<TCatalog extends Readonly<Record<string, ErrorCatalogEntry>>> = {
383
- [C in keyof TCatalog & string]: {
384
- code: C;
385
- type: TCatalog[C]["type"];
386
- source: TCatalog[C]["source"];
387
- } & (TCatalog[C] extends {
388
- dependency: infer D extends string;
389
- } ? {
390
- dependency: D;
391
- } : {
392
- dependency?: never;
393
- });
394
- }[keyof TCatalog & string];
395
- /**
396
- * How a site classifies an error: always a type and source (with the dependency for an
397
- * `upstream` failure), plus a code when the condition has one, plus what varies. With a
398
- * catalog type (`TCatalog`), a code accepts only the type, source and dependency its
399
- * catalog entry implies.
400
- */
401
- type ClassifiedErrorInit<TType extends string, TCode extends string, TDependency extends string, TCatalog extends Readonly<Record<string, ErrorCatalogEntry>> = never> = (([TCatalog] extends [never] ? ({
402
- code: TCode;
403
- type: TType;
404
- } & SourceAndDependency<TDependency>) : CodedClassification<TCatalog>) | ({
405
- code?: never;
406
- type: TType;
407
- } & SourceAndDependency<TDependency>)) & {
408
- facts?: MuxAiErrorFacts;
409
- /**
410
- * Whether submitting the same job again, unchanged, may succeed. Not "fixable":
411
- * whether the caller can change something first is what `source` and `code` say.
412
- * Defaults from the classification ({@link defaultRetryable}); set it only to
413
- * override, with a comment saying why. Ignored when the error is transient.
414
- */
415
- retryable?: boolean;
416
- /**
417
- * Whether the step runner should retry the step. Defaults from the classification
418
- * ({@link defaultTransient}); set it only to override, with a comment saying why
419
- * (e.g. a call that isn't idempotent).
420
- */
421
- transient?: boolean;
422
- /** The raw cause. Kept locally only; a bounded summary crosses step boundaries. */
423
- cause?: unknown;
424
- };
425
- type MuxAiErrorInit = ClassifiedErrorInit<MuxAiErrorType, MuxAiErrorCode, MuxAiErrorDependency, typeof MUX_AI_ERROR_CATALOG>;
426
- /**
427
- * A classified error's fields as JSON-safe data, for a subclass's Workflow serializer
428
- * (see {@link serializeClassification} and {@link restoreClassification}).
429
- */
430
- interface SerializedClassification<TType extends string = string, TCode extends string = string, TDependency extends string = string> {
431
- message: string;
432
- type: TType;
433
- source: MuxAiErrorSource;
434
- dependency?: TDependency;
435
- code?: TCode;
436
- facts: MuxAiErrorFacts;
437
- retryable: boolean;
438
- transient: boolean;
439
- causes: ErrorCauseSummary[];
440
- stack?: string;
441
- }
442
- /**
443
- * What crosses a Workflow step boundary. A run replays the events it already wrote,
444
- * so `v` is bumped on a shape change and earlier versions stay readable.
445
- */
446
- interface SerializedMuxAiError extends SerializedClassification<MuxAiErrorType, MuxAiErrorCode, MuxAiErrorDependency> {
447
- v: 2;
448
- usage?: TokenUsage;
449
- finishReason?: string;
450
- rawFinishReason?: string;
451
- diagnostics?: ModelCallDiagnostics;
452
- }
453
- /**
454
- * The shared error model: a `type` and `source` on every instance, a `dependency`
455
- * for remote failures, a `code` for conditions precise enough to name, JSON-safe
456
- * `facts`, and a retry policy derived from the classification. `message` is internal
457
- * detail, never end-user text (see `createPublicErrorView()`).
458
- *
459
- * `MuxAiError` is built on it, and consumers can build their own errors on it with
460
- * their own type list, code catalog and dependencies, so policy, serialization and
461
- * the public view work the same way everywhere. A subclass supplies its catalog,
462
- * a brand for its own `is()`, and Workflow serializer hooks built from
463
- * {@link serializeClassification} and {@link restoreClassification}.
464
- */
465
- declare class ClassifiedError<TType extends string = string, TCode extends string = string, TDependency extends string = string> extends Error {
466
- /** Structural brand shared by every classified error, for duck-type identification across realms. */
467
- readonly __classified_error = true;
468
- readonly type: TType;
469
- readonly source: MuxAiErrorSource;
470
- readonly dependency?: TDependency;
471
- readonly code?: TCode;
472
- readonly facts: MuxAiErrorFacts;
473
- /** Whether submitting the same job again, unchanged, may succeed. Always true when transient. */
474
- readonly retryable: boolean;
475
- /**
476
- * Whether the step runner should retry the step. Workflow DevKit skips retries
477
- * for errors named `FatalError`, so only non-transient errors take that name.
478
- */
479
- readonly transient: boolean;
480
- /** Raw cause; non-enumerable, local only. */
481
- readonly cause?: unknown;
482
- /** Bounded summary of the cause chain; non-enumerable, crosses step boundaries. */
483
- readonly causes: ErrorCauseSummary[];
484
- constructor(message: string, init: ClassifiedErrorInit<TType, TCode, TDependency>, catalog: Readonly<Partial<Record<TCode, ErrorCatalogEntry<TType, TDependency>>>>);
485
- /** Whether `value` is any classified error, from this copy of the SDK or another. */
486
- static isClassified(value: unknown): value is ClassifiedError;
487
- }
488
- /** The classification of `error`, for a subclass's `WORKFLOW_SERIALIZE` hook. */
489
- declare function serializeClassification<TType extends string, TCode extends string, TDependency extends string>(error: ClassifiedError<TType, TCode, TDependency>): SerializedClassification<TType, TCode, TDependency>;
490
- /**
491
- * The constructor options that rebuild a serialized classification, for a
492
- * subclass's `WORKFLOW_DESERIALIZE` hook; follow with {@link restoreClassification}.
493
- * The stored classification wins over the catalog's current mapping for a code.
494
- */
495
- declare function classificationInit<TType extends string, TCode extends string, TDependency extends string>(record: SerializedClassification<TType, TCode, TDependency>): ClassifiedErrorInit<TType, TCode, TDependency>;
496
- /** Restores what the constructor can't take back: the code, the cause summaries and the stack. */
497
- declare function restoreClassification<T extends ClassifiedError>(error: T, record: SerializedClassification): T;
498
- /**
499
- * A classified @mux/ai failure, built on {@link ClassifiedError} with the SDK's
500
- * catalog. `message` is internal detail for developers and logs, never end-user
501
- * text: render what end users see with `toPublicError()`, which only exposes
502
- * allowlisted codes and facts. See docs/ERRORS.md.
503
- *
504
- * Fields, not subclasses, carry the classification: a custom Workflow codec keeps
505
- * them across step boundaries, and every subclass revives as `MuxAiError`.
506
- */
507
- declare class MuxAiError extends ClassifiedError<MuxAiErrorType, MuxAiErrorCode, MuxAiErrorDependency> {
508
- /** Structural brand for duck-type identification across copies of the SDK. */
509
- readonly __mux_ai_error = true;
510
- usage?: TokenUsage;
511
- diagnostics?: ModelCallDiagnostics;
512
- constructor(message: string, init: MuxAiErrorInit);
513
- static is(value: unknown): value is MuxAiError;
514
- static [WORKFLOW_SERIALIZE](instance: MuxAiError): SerializedMuxAiError | LegacySerializedMuxAiError;
515
- static [WORKFLOW_DESERIALIZE](value: SerializedMuxAiError): MuxAiError;
516
- }
517
- /**
518
- * Prepares free text from a dependency (a provider's failure reason, a raw error
519
- * message) for an error's facts: URL tokens stripped, high-confidence prompt leaks
520
- * suppressed, length capped.
521
- */
522
- declare function errorDetailFact(text: string, maxLength?: number): string;
523
- /**
524
- * Re-throws a classified error unchanged, merging any `facts` into it (its own
525
- * values win). Anything else becomes an `internal` error: a remote failure would
526
- * already have been classified where the call was made, so what reaches here
527
- * unclassified is this code's own failure.
528
- *
529
- * Use this in catch blocks that re-throw, so a classified error from a callee
530
- * keeps its classification. Token usage carries over either way.
531
- */
532
- declare function wrapError(error: unknown, message: string, facts?: MuxAiErrorFacts): never;
533
- /**
534
- * This code's own failure: a broken invariant, an unexpected shape it produced, or
535
- * an in-process library throwing. Use it instead of `throw new Error(...)`.
536
- */
537
- declare function internalError(message: string, facts?: MuxAiErrorFacts, cause?: unknown): MuxAiError;
538
- /** Exhaustiveness guard for switch statements over closed unions. */
539
- declare function assertNever(value: never, what?: string): never;
540
8
 
541
9
  /**
542
10
  * Language Code Conversion Utilities
@@ -2874,4 +2342,4 @@ declare namespace index {
2874
2342
  export { index_ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH, index_ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH, index_ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL, index_ASK_QUESTIONS_MAX_QUESTION_LENGTH as ASK_QUESTIONS_MAX_QUESTION_LENGTH, type index_AskQuestionsOptions as AskQuestionsOptions, type index_AskQuestionsResult as AskQuestionsResult, type index_AskQuestionsType as AskQuestionsType, type index_AudioTranslationOptions as AudioTranslationOptions, type index_AudioTranslationResult as AudioTranslationResult, type index_AutoCensorProfanityOptions as AutoCensorProfanityOptions, type index_BurnedInCaptionsAnalysis as BurnedInCaptionsAnalysis, type index_BurnedInCaptionsOptions as BurnedInCaptionsOptions, type index_BurnedInCaptionsPromptOverrides as BurnedInCaptionsPromptOverrides, type index_BurnedInCaptionsPromptSections as BurnedInCaptionsPromptSections, type index_BurnedInCaptionsResult as BurnedInCaptionsResult, type index_CaptionReplacement as CaptionReplacement, type index_CensorMode as CensorMode, type index_Chapter as Chapter, type index_ChapterSystemPromptSections as ChapterSystemPromptSections, type index_ChaptersOptions as ChaptersOptions, type index_ChaptersPromptOverrides as ChaptersPromptOverrides, type index_ChaptersPromptSections as ChaptersPromptSections, type index_ChaptersResult as ChaptersResult, type index_ChaptersType as ChaptersType, index_DEFAULT_DESCRIPTION_LENGTH as DEFAULT_DESCRIPTION_LENGTH, index_DEFAULT_SUMMARY_KEYWORD_LIMIT as DEFAULT_SUMMARY_KEYWORD_LIMIT, index_DEFAULT_TITLE_LENGTH as DEFAULT_TITLE_LENGTH, index_DEFAULT_TRANSCRIPT_WINDOWING as DEFAULT_TRANSCRIPT_WINDOWING, type index_DubbedCaptionsOutcome as DubbedCaptionsOutcome, type index_EditCaptionsOptions as EditCaptionsOptions, type index_EditCaptionsResult as EditCaptionsResult, type index_EmbeddingsOptions as EmbeddingsOptions, type index_EmbeddingsResult as EmbeddingsResult, type index_EngagementInsightsOptions as EngagementInsightsOptions, type index_EngagementInsightsResult as EngagementInsightsResult, index_GENERATE_TEXT_CALLS_TO_ACTION as GENERATE_TEXT_CALLS_TO_ACTION, index_GENERATE_TEXT_CHANNELS as GENERATE_TEXT_CHANNELS, index_GENERATE_TEXT_CHANNEL_CEILINGS as GENERATE_TEXT_CHANNEL_CEILINGS, index_GENERATE_TEXT_FORMATS as GENERATE_TEXT_FORMATS, index_GENERATE_TEXT_LENGTH_BOUNDS as GENERATE_TEXT_LENGTH_BOUNDS, index_GENERATE_TEXT_MAX_ARTIFACTS as GENERATE_TEXT_MAX_ARTIFACTS, index_GENERATE_TEXT_MAX_AUDIENCE_CHARS as GENERATE_TEXT_MAX_AUDIENCE_CHARS, index_GENERATE_TEXT_MAX_BRAND_TERMS as GENERATE_TEXT_MAX_BRAND_TERMS, index_GENERATE_TEXT_MAX_BRAND_TERMS_TOTAL_CHARS as GENERATE_TEXT_MAX_BRAND_TERMS_TOTAL_CHARS, index_GENERATE_TEXT_MAX_BRAND_TERM_CHARS as GENERATE_TEXT_MAX_BRAND_TERM_CHARS, index_GENERATE_TEXT_MAX_CONCURRENT_GENERATIONS as GENERATE_TEXT_MAX_CONCURRENT_GENERATIONS, index_GENERATE_TEXT_MAX_INSTRUCTIONS_CHARS as GENERATE_TEXT_MAX_INSTRUCTIONS_CHARS, index_GENERATE_TEXT_MAX_SHOT_FRAMES as GENERATE_TEXT_MAX_SHOT_FRAMES, index_GENERATE_TEXT_MAX_VARIANTS as GENERATE_TEXT_MAX_VARIANTS, index_GENERATE_TEXT_VOICES as GENERATE_TEXT_VOICES, index_GOOGLE_VISION_LIKELIHOOD_TO_SCORE as GOOGLE_VISION_LIKELIHOOD_TO_SCORE, type index_GenerateTextArtifact as GenerateTextArtifact, type index_GenerateTextCallToAction as GenerateTextCallToAction, type index_GenerateTextChannel as GenerateTextChannel, type index_GenerateTextFormat as GenerateTextFormat, type index_GenerateTextKeyedItem as GenerateTextKeyedItem, type index_GenerateTextLengthLimit as GenerateTextLengthLimit, type index_GenerateTextOptions as GenerateTextOptions, type index_GenerateTextResult as GenerateTextResult, type index_GenerateTextVariant as GenerateTextVariant, type index_GenerateTextVoice as GenerateTextVoice, type index_GeneratedTextArtifact as GeneratedTextArtifact, type index_GeneratedTextVariant as GeneratedTextVariant, index_HIVE_SEXUAL_CATEGORIES as HIVE_SEXUAL_CATEGORIES, index_HIVE_VIOLENCE_CATEGORIES as HIVE_VIOLENCE_CATEGORIES, type index_HiveModerationOutput as HiveModerationOutput, type index_HiveModerationSource as HiveModerationSource, type index_ModerationOptions as ModerationOptions, type index_ModerationProvider as ModerationProvider, type index_ModerationResult as ModerationResult, type index_ModerationSurfaceStatus as ModerationSurfaceStatus, type index_MomentInsight as MomentInsight, type index_OverallInsight as OverallInsight, type index_ProfanityDetectionPayload as ProfanityDetectionPayload, type index_Question as Question, type index_QuestionAnswer as QuestionAnswer, type index_QuestionAnswerType as QuestionAnswerType, type index_RepairAttempt as RepairAttempt, type index_RepairCall as RepairCall, type index_RepairOptions as RepairOptions, type index_RepairPlan as RepairPlan, type index_RepairResult as RepairResult, type index_RepairSpan as RepairSpan, type index_ReplacementRecord as ReplacementRecord, type index_SpeakerReplacement as SpeakerReplacement, type index_StaticRenditionCleanupOutcome as StaticRenditionCleanupOutcome, type index_SummarizationOptions as SummarizationOptions, type index_SummarizationPromptOverrides as SummarizationPromptOverrides, type index_SummarizationPromptSections as SummarizationPromptSections, type index_SummaryAndTagsResult as SummaryAndTagsResult, type index_SummaryType as SummaryType, type index_TextLengthLimit as TextLengthLimit, type index_TextRepairModelOptions as TextRepairModelOptions, type index_ThumbnailModerationScore as ThumbnailModerationScore, type index_ThumbnailModerationSkipReason as ThumbnailModerationSkipReason, type index_ThumbnailModerationStatus as ThumbnailModerationStatus, type index_TranscriptModerationScore as TranscriptModerationScore, type index_TranscriptModerationSkipReason as TranscriptModerationSkipReason, type index_TranscriptModerationStatus as TranscriptModerationStatus, type index_TranslationChunkingOptions as TranslationChunkingOptions, type index_TranslationOptions as TranslationOptions, type index_TranslationPayload as TranslationPayload, type index_TranslationResult as TranslationResult, index_aggregateTokenUsage as aggregateTokenUsage, index_applyOverrideLists as applyOverrideLists, index_applyReplacements as applyReplacements, index_applySpeakerReplacements as applySpeakerReplacements, index_applyTextRepair as applyTextRepair, index_askQuestions as askQuestions, index_buildReplacementRegex as buildReplacementRegex, index_buildTranscriptWindows as buildTranscriptWindows, index_burnedInCaptionsSchema as burnedInCaptionsSchema, index_censorVttContent as censorVttContent, index_chapterSchema as chapterSchema, index_chaptersSchema as chaptersSchema, index_createReplacer as createReplacer, index_createTextRepairGenerator as createTextRepairGenerator, index_editCaptions as editCaptions, index_extractTranscriptSegmentsForHotspots as extractTranscriptSegmentsForHotspots, index_findGenerateTextLengthViolation as findGenerateTextLengthViolation, index_generateChapters as generateChapters, index_generateEmbeddings as generateEmbeddings, index_generateEngagementInsights as generateEngagementInsights, index_generateText as generateText, index_generateVideoEmbeddings as generateVideoEmbeddings, index_getModerationScores as getModerationScores, index_getSummaryAndTags as getSummaryAndTags, index_hasBurnedInCaptions as hasBurnedInCaptions, index_mapShotsToHotspots as mapShotsToHotspots, index_measureGenerateTextLength as measureGenerateTextLength, index_normalizeTranslatedVtt as normalizeTranslatedVtt, index_planTextRepair as planTextRepair, index_profanityDetectionSchema as profanityDetectionSchema, index_questionAnswerSchema as questionAnswerSchema, index_repairJsonSchema as repairJsonSchema, index_repairText as repairText, index_resolveGenerateTextLengthLimit as resolveGenerateTextLengthLimit, index_resolveGenerateTextLengthLimits as resolveGenerateTextLengthLimits, index_resolveGenerateTextOptions as resolveGenerateTextOptions, index_runTextRepairLoop as runTextRepairLoop, index_selectGenerateTextShotFrames as selectGenerateTextShotFrames, index_shouldSplitChunkTranslationError as shouldSplitChunkTranslationError, index_summarySchema as summarySchema, index_transformCueText as transformCueText, index_translateAudio as translateAudio, index_translateCaptions as translateCaptions, index_translationSchema as translationSchema, index_validateNeverTranslateTerms as validateNeverTranslateTerms, index_verifyNeverTranslateTerms as verifyNeverTranslateTerms };
2875
2343
  }
2876
2344
 
2877
- export { isDuplicateTrackNameError as $, type SourceAndDependency as A, type SourceTrackReplacementPolicy as B, ClassifiedError as C, type SupportedISO639_1 as D, type ErrorCatalogEntry as E, type SupportedISO639_3 as F, type TextTrackSummary as G, type TextTrackTarget as H, type ISO639_1 as I, type TrackReplacementBlocked as J, type TrackReplacementBlockedReason as K, type LanguageCodePair as L, type MuxAiErrorDependency as M, type TrackSummary as N, type TrackTarget as O, assertNever as P, buildMuxAiTrackPassthrough as Q, type ReplaceAndCreateTextTrackInput as R, type SerializedClassification as S, type TextTrackReplacementPlan as T, classificationInit as U, errorDetailFact as V, findNameCollisionTextTracks as W, findSameLanguageTextTracks as X, getLanguageCodePair as Y, getLanguageName as Z, internalError as _, type MuxAiErrorFacts as a, GENERATE_TEXT_MAX_BRAND_TERM_CHARS as a$, isMuxGeneratedTextTrack as a0, isTransientStatus as a1, isUndeterminedLanguageCode as a2, isValidISO639_1 as a3, isValidISO639_3 as a4, normalizeTrackLanguageCode as a5, normalizeTrackName as a6, planSourceTrackReplacement as a7, planTextTrackReplacement as a8, replaceAndCreateTextTrack as a9, type BurnedInCaptionsResult as aA, type CaptionReplacement as aB, type CensorMode as aC, type Chapter as aD, type ChapterSystemPromptSections as aE, type ChaptersOptions as aF, type ChaptersPromptOverrides as aG, type ChaptersPromptSections as aH, type ChaptersResult as aI, type ChaptersType as aJ, DEFAULT_TRANSCRIPT_WINDOWING as aK, type DubbedCaptionsOutcome as aL, type EditCaptionsOptions as aM, type EditCaptionsResult as aN, type EmbeddingsOptions as aO, type EmbeddingsResult as aP, type EngagementInsightsOptions as aQ, type EngagementInsightsResult as aR, GENERATE_TEXT_CALLS_TO_ACTION as aS, GENERATE_TEXT_CHANNELS as aT, GENERATE_TEXT_CHANNEL_CEILINGS as aU, GENERATE_TEXT_FORMATS as aV, GENERATE_TEXT_LENGTH_BOUNDS as aW, GENERATE_TEXT_MAX_ARTIFACTS as aX, GENERATE_TEXT_MAX_AUDIENCE_CHARS as aY, GENERATE_TEXT_MAX_BRAND_TERMS as aZ, GENERATE_TEXT_MAX_BRAND_TERMS_TOTAL_CHARS as a_, replaceAndCreateTrack as aa, replaceSourceTrack as ab, restoreClassification as ac, serializeClassification as ad, summarizeTextTrack as ae, toISO639_1 as af, toISO639_3 as ag, trackReplacementBlockedError as ah, trackTargetFacts as ai, validateTrackPassthrough as aj, index as ak, wrapError as al, ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as am, ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as an, ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as ao, ASK_QUESTIONS_MAX_QUESTION_LENGTH as ap, type AskQuestionsOptions as aq, type AskQuestionsResult as ar, type AskQuestionsType as as, type AudioTranslationOptions as at, type AudioTranslationResult as au, type AutoCensorProfanityOptions as av, type BurnedInCaptionsAnalysis as aw, type BurnedInCaptionsOptions as ax, type BurnedInCaptionsPromptOverrides as ay, type BurnedInCaptionsPromptSections as az, type MuxAiErrorSource as b, askQuestions as b$, GENERATE_TEXT_MAX_CONCURRENT_GENERATIONS as b0, GENERATE_TEXT_MAX_INSTRUCTIONS_CHARS as b1, GENERATE_TEXT_MAX_SHOT_FRAMES as b2, GENERATE_TEXT_MAX_VARIANTS as b3, GENERATE_TEXT_VOICES as b4, GOOGLE_VISION_LIKELIHOOD_TO_SCORE as b5, type GenerateTextArtifact as b6, type GenerateTextCallToAction as b7, type GenerateTextChannel as b8, type GenerateTextFormat as b9, type RepairResult as bA, type RepairSpan as bB, type ReplacementRecord as bC, type SpeakerReplacement as bD, type StaticRenditionCleanupOutcome as bE, type SummarizationOptions as bF, type SummarizationPromptOverrides as bG, type SummarizationPromptSections as bH, type SummaryAndTagsResult as bI, type SummaryType as bJ, type TextLengthLimit as bK, type TextRepairModelOptions as bL, type ThumbnailModerationScore as bM, type ThumbnailModerationSkipReason as bN, type ThumbnailModerationStatus as bO, type TranscriptModerationScore as bP, type TranscriptModerationSkipReason as bQ, type TranscriptModerationStatus as bR, type TranslationChunkingOptions as bS, type TranslationOptions as bT, type TranslationPayload as bU, type TranslationResult as bV, aggregateTokenUsage as bW, applyOverrideLists as bX, applyReplacements as bY, applySpeakerReplacements as bZ, applyTextRepair as b_, type GenerateTextKeyedItem as ba, type GenerateTextLengthLimit as bb, type GenerateTextOptions as bc, type GenerateTextResult as bd, type GenerateTextVariant as be, type GenerateTextVoice as bf, type GeneratedTextArtifact as bg, type GeneratedTextVariant as bh, HIVE_SEXUAL_CATEGORIES as bi, HIVE_VIOLENCE_CATEGORIES as bj, type HiveModerationOutput as bk, type HiveModerationSource as bl, type ModerationOptions as bm, type ModerationProvider as bn, type ModerationResult as bo, type ModerationSurfaceStatus as bp, type MomentInsight as bq, type OverallInsight as br, type ProfanityDetectionPayload as bs, type Question as bt, type QuestionAnswer as bu, type QuestionAnswerType as bv, type RepairAttempt as bw, type RepairCall as bx, type RepairOptions as by, type RepairPlan as bz, type MuxAiErrorType as c, buildReplacementRegex as c0, buildTranscriptWindows as c1, burnedInCaptionsSchema as c2, censorVttContent as c3, chapterSchema as c4, chaptersSchema as c5, createReplacer as c6, createTextRepairGenerator as c7, editCaptions as c8, extractTranscriptSegmentsForHotspots as c9, translateCaptions as cA, translationSchema as cB, validateNeverTranslateTerms as cC, verifyNeverTranslateTerms as cD, findGenerateTextLengthViolation as ca, generateChapters as cb, generateEmbeddings as cc, generateEngagementInsights as cd, generateText as ce, generateVideoEmbeddings as cf, getModerationScores as cg, getSummaryAndTags as ch, hasBurnedInCaptions as ci, mapShotsToHotspots as cj, measureGenerateTextLength as ck, normalizeTranslatedVtt as cl, planTextRepair as cm, profanityDetectionSchema as cn, questionAnswerSchema as co, repairJsonSchema as cp, repairText as cq, resolveGenerateTextLengthLimit as cr, resolveGenerateTextLengthLimits as cs, resolveGenerateTextOptions as ct, runTextRepairLoop as cu, selectGenerateTextShotFrames as cv, shouldSplitChunkTranslationError as cw, summarySchema as cx, transformCueText as cy, translateAudio as cz, MuxAiError as d, type MuxAiErrorFactValue as e, type MuxAiErrorCode as f, type ClassifiedErrorInit as g, type CodedClassification as h, type ErrorCauseSummary as i, type ISO639_3 as j, MUX_AI_ERROR_CATALOG as k, MUX_AI_ERROR_CODES as l, MUX_AI_ERROR_CODE_VALUES as m, MUX_AI_ERROR_DEPENDENCIES as n, MUX_AI_ERROR_DEPENDENCY_VALUES as o, MUX_AI_ERROR_SOURCES as p, MUX_AI_ERROR_SOURCE_VALUES as q, MUX_AI_ERROR_TYPES as r, MUX_AI_ERROR_TYPE_VALUES as s, MUX_TRACK_PASSTHROUGH_MAX_CHARS as t, type MuxAiErrorInit as u, type ReplaceAndCreateTextTrackResult as v, type ReplaceAndCreateTrackInput as w, type ReplaceExistingTracksPolicy as x, type ReplaceSourceTrackInput as y, type ReplaceableTrackType as z };
2345
+ export { type AutoCensorProfanityOptions as $, planSourceTrackReplacement as A, planTextTrackReplacement as B, replaceAndCreateTextTrack as C, replaceAndCreateTrack as D, replaceSourceTrack as E, summarizeTextTrack as F, toISO639_1 as G, toISO639_3 as H, type ISO639_1 as I, trackReplacementBlockedError as J, trackTargetFacts as K, type LanguageCodePair as L, MUX_TRACK_PASSTHROUGH_MAX_CHARS as M, validateTrackPassthrough as N, index as O, ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as P, ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as Q, type ReplaceAndCreateTextTrackInput as R, type SourceTrackReplacementPolicy as S, type TextTrackReplacementPlan as T, ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as U, ASK_QUESTIONS_MAX_QUESTION_LENGTH as V, type AskQuestionsOptions as W, type AskQuestionsResult as X, type AskQuestionsType as Y, type AudioTranslationOptions as Z, type AudioTranslationResult as _, type ISO639_3 as a, type QuestionAnswerType as a$, type BurnedInCaptionsAnalysis as a0, type BurnedInCaptionsOptions as a1, type BurnedInCaptionsPromptOverrides as a2, type BurnedInCaptionsPromptSections as a3, type BurnedInCaptionsResult as a4, type CaptionReplacement as a5, type CensorMode as a6, type Chapter as a7, type ChapterSystemPromptSections as a8, type ChaptersOptions as a9, GENERATE_TEXT_VOICES as aA, GOOGLE_VISION_LIKELIHOOD_TO_SCORE as aB, type GenerateTextArtifact as aC, type GenerateTextCallToAction as aD, type GenerateTextChannel as aE, type GenerateTextFormat as aF, type GenerateTextKeyedItem as aG, type GenerateTextLengthLimit as aH, type GenerateTextOptions as aI, type GenerateTextResult as aJ, type GenerateTextVariant as aK, type GenerateTextVoice as aL, type GeneratedTextArtifact as aM, type GeneratedTextVariant as aN, HIVE_SEXUAL_CATEGORIES as aO, HIVE_VIOLENCE_CATEGORIES as aP, type HiveModerationOutput as aQ, type HiveModerationSource as aR, type ModerationOptions as aS, type ModerationProvider as aT, type ModerationResult as aU, type ModerationSurfaceStatus as aV, type MomentInsight as aW, type OverallInsight as aX, type ProfanityDetectionPayload as aY, type Question as aZ, type QuestionAnswer as a_, type ChaptersPromptOverrides as aa, type ChaptersPromptSections as ab, type ChaptersResult as ac, type ChaptersType as ad, DEFAULT_TRANSCRIPT_WINDOWING as ae, type DubbedCaptionsOutcome as af, type EditCaptionsOptions as ag, type EditCaptionsResult as ah, type EmbeddingsOptions as ai, type EmbeddingsResult as aj, type EngagementInsightsOptions as ak, type EngagementInsightsResult as al, GENERATE_TEXT_CALLS_TO_ACTION as am, GENERATE_TEXT_CHANNELS as an, GENERATE_TEXT_CHANNEL_CEILINGS as ao, GENERATE_TEXT_FORMATS as ap, GENERATE_TEXT_LENGTH_BOUNDS as aq, GENERATE_TEXT_MAX_ARTIFACTS as ar, GENERATE_TEXT_MAX_AUDIENCE_CHARS as as, GENERATE_TEXT_MAX_BRAND_TERMS as at, GENERATE_TEXT_MAX_BRAND_TERMS_TOTAL_CHARS as au, GENERATE_TEXT_MAX_BRAND_TERM_CHARS as av, GENERATE_TEXT_MAX_CONCURRENT_GENERATIONS as aw, GENERATE_TEXT_MAX_INSTRUCTIONS_CHARS as ax, GENERATE_TEXT_MAX_SHOT_FRAMES as ay, GENERATE_TEXT_MAX_VARIANTS as az, type ReplaceAndCreateTextTrackResult as b, selectGenerateTextShotFrames as b$, type RepairAttempt as b0, type RepairCall as b1, type RepairOptions as b2, type RepairPlan as b3, type RepairResult as b4, type RepairSpan as b5, type ReplacementRecord as b6, type SpeakerReplacement as b7, type StaticRenditionCleanupOutcome as b8, type SummarizationOptions as b9, chapterSchema as bA, chaptersSchema as bB, createReplacer as bC, createTextRepairGenerator as bD, editCaptions as bE, extractTranscriptSegmentsForHotspots as bF, findGenerateTextLengthViolation as bG, generateChapters as bH, generateEmbeddings as bI, generateEngagementInsights as bJ, generateText as bK, generateVideoEmbeddings as bL, getModerationScores as bM, getSummaryAndTags as bN, hasBurnedInCaptions as bO, mapShotsToHotspots as bP, measureGenerateTextLength as bQ, normalizeTranslatedVtt as bR, planTextRepair as bS, profanityDetectionSchema as bT, questionAnswerSchema as bU, repairJsonSchema as bV, repairText as bW, resolveGenerateTextLengthLimit as bX, resolveGenerateTextLengthLimits as bY, resolveGenerateTextOptions as bZ, runTextRepairLoop as b_, type SummarizationPromptOverrides as ba, type SummarizationPromptSections as bb, type SummaryAndTagsResult as bc, type SummaryType as bd, type TextLengthLimit as be, type TextRepairModelOptions as bf, type ThumbnailModerationScore as bg, type ThumbnailModerationSkipReason as bh, type ThumbnailModerationStatus as bi, type TranscriptModerationScore as bj, type TranscriptModerationSkipReason as bk, type TranscriptModerationStatus as bl, type TranslationChunkingOptions as bm, type TranslationOptions as bn, type TranslationPayload as bo, type TranslationResult as bp, aggregateTokenUsage as bq, applyOverrideLists as br, applyReplacements as bs, applySpeakerReplacements as bt, applyTextRepair as bu, askQuestions as bv, buildReplacementRegex as bw, buildTranscriptWindows as bx, burnedInCaptionsSchema as by, censorVttContent as bz, type ReplaceAndCreateTrackInput as c, shouldSplitChunkTranslationError as c0, summarySchema as c1, transformCueText as c2, translateAudio as c3, translateCaptions as c4, translationSchema as c5, validateNeverTranslateTerms as c6, verifyNeverTranslateTerms as c7, type ReplaceExistingTracksPolicy as d, type ReplaceSourceTrackInput as e, type ReplaceableTrackType as f, type SupportedISO639_1 as g, type SupportedISO639_3 as h, type TextTrackSummary as i, type TextTrackTarget as j, type TrackReplacementBlocked as k, type TrackReplacementBlockedReason as l, type TrackSummary as m, type TrackTarget as n, buildMuxAiTrackPassthrough as o, findNameCollisionTextTracks as p, findSameLanguageTextTracks as q, getLanguageCodePair as r, getLanguageName as s, isDuplicateTrackNameError as t, isMuxGeneratedTextTrack as u, isUndeterminedLanguageCode as v, isValidISO639_1 as w, isValidISO639_3 as x, normalizeTrackLanguageCode as y, normalizeTrackName as z };
@@ -1,4 +1,4 @@
1
- import { l as WorkflowCredentialsInput, n as WorkflowScope, T as TextChunk, b as ChunkingStrategy, q as VTTCue, r as CompletedShotsResult, D as DeletedShotsResult, s as ErroredShotsResult, H as Hotspot, t as HotspotOptions, u as HotspotResponse, L as LOW_CONFIDENCE_THRESHOLD, v as MAX_CUE_TEXT_CHARS, w as ParseVTTCuesOptions, x as PendingShotsResult, y as Shot, z as ShotRequestOptions, B as ShotsResult, F as SkippedShotsResult, G as TranscriptEmptyReason, J as TranscriptFetchOptions, K as TranscriptFetchStepResult, N as TranscriptResult, O as WaitForShotsOptions, Q as buildTranscriptUrl, R as buildVttFromCueBlocks, X as buildVttFromTranslatedCueBlocks, Y as concatenateVttSegments, Z as extractTextFromVTT, _ as extractTimestampedTranscript, $ as fetchTranscriptDataForUrl, a0 as fetchTranscriptForAsset, a1 as filterVttByScope, a2 as findCaptionTrack, a3 as getHotspotsForAsset, a4 as getHotspotsForPlaybackId, a5 as getHotspotsForVideo, a6 as getReadyTextTracks, a7 as getReliableLanguageCode, a8 as getShotsForAsset, a9 as parseVTTCues, aa as replaceCueText, ab as requestShotsForAsset, ac as sanitizeUntrustedText, ad as secondsToTimestamp, ae as splitVttPreambleAndCueBlocks, af as stripVttMetadataBlocks, ag as vttTimestampToSeconds, ah as waitForShotsForAsset } from './transcripts-DuNI058z.js';
1
+ import { O as WorkflowCredentialsInput, R as WorkflowScope, T as TextChunk, j as ChunkingStrategy, a5 as VTTCue, a6 as CompletedShotsResult, a7 as DeletedShotsResult, a8 as ErroredShotsResult, a9 as Hotspot, aa as HotspotOptions, ab as HotspotResponse, ac as LOW_CONFIDENCE_THRESHOLD, ad as MAX_CUE_TEXT_CHARS, ae as ParseVTTCuesOptions, af as PendingShotsResult, ag as Shot, ah as ShotRequestOptions, ai as ShotsResult, aj as SkippedShotsResult, ak as TranscriptEmptyReason, al as TranscriptFetchOptions, am as TranscriptFetchStepResult, an as TranscriptResult, ao as WaitForShotsOptions, ap as buildTranscriptUrl, aq as buildVttFromCueBlocks, ar as buildVttFromTranslatedCueBlocks, as as concatenateVttSegments, at as extractTextFromVTT, au as extractTimestampedTranscript, av as fetchTranscriptDataForUrl, aw as fetchTranscriptForAsset, ax as filterVttByScope, ay as findCaptionTrack, az as getHotspotsForAsset, aA as getHotspotsForPlaybackId, aB as getHotspotsForVideo, aC as getReadyTextTracks, aD as getReliableLanguageCode, aE as getShotsForAsset, aF as parseVTTCues, aG as replaceCueText, aH as requestShotsForAsset, aI as sanitizeUntrustedText, aJ as secondsToTimestamp, aK as splitVttPreambleAndCueBlocks, aL as stripVttMetadataBlocks, aM as vttTimestampToSeconds, aN as waitForShotsForAsset } from './transcripts-So1KIXSI.js';
2
2
 
3
3
  interface HeatmapOptions {
4
4
  /** Time window for results, e.g., '7:days' (default: '7:days') */