@mux/ai 0.68.0 → 0.69.0-canary.116

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/README.md CHANGED
@@ -84,6 +84,8 @@ Workflows are high-level functions that handle complete media AI tasks end-to-en
84
84
  | [`editCaptions`](./docs/WORKFLOWS.md#caption-editing) | Edit captions: censor profanity and/or apply static replacements | OpenAI, Anthropic, Google, Baseten, OpenAI-compatible | Yes |
85
85
  | [`translateAudio`](./docs/WORKFLOWS.md#audio-dubbing) | Create AI-dubbed audio tracks | ElevenLabs | Yes |
86
86
 
87
+ `summarize`, `moderate`, and `generateContextualText` are aliases that match the [Mux Robots workflow names](./docs/WORKFLOWS.md#mux-robots-workflow-names).
88
+
87
89
  See the [Workflows guide](./docs/WORKFLOWS.md) for detailed documentation, options, and examples for each workflow. See the [API Reference](./docs/API.md) for complete parameter and return type details. See the [Errors guide](./docs/ERRORS.md) for how failures are classified and what to show end users.
88
90
 
89
91
  ### Quick Examples
@@ -1,4 +1,4 @@
1
- import { Z as WorkflowCredentialsInput, $ as WorkflowScope, T as TextChunk, n as ChunkingStrategy, aa as VTTCue, ab as CompletedShotsResult, ac as DeletedShotsResult, ad as ErroredShotsResult, ae as Hotspot, af as HotspotOptions, ag as HotspotResponse, ah as LOW_CONFIDENCE_THRESHOLD, ai as MAX_CUE_TEXT_CHARS, aj as ParseVTTCuesOptions, ak as PendingShotsResult, al as Shot, am as ShotRequestOptions, an as ShotsResult, ao as SkippedShotsResult, ap as TranscriptEmptyReason, aq as TranscriptFetchOptions, ar as TranscriptFetchStepResult, as as TranscriptResult, at as WaitForShotsOptions, au as buildTranscriptUrl, av as buildVttFromCueBlocks, aw as buildVttFromTranslatedCueBlocks, ax as concatenateVttSegments, ay as extractTextFromVTT, az as extractTimestampedTranscript, aA as fetchTranscriptDataForUrl, aB as fetchTranscriptForAsset, aC as filterVttByScope, aD as findCaptionTrack, aE as getHotspotsForAsset, aF as getHotspotsForPlaybackId, aG as getHotspotsForVideo, aH as getReadyTextTracks, aI as getReliableLanguageCode, aJ as getShotsForAsset, aK as parseVTTCues, aL as replaceCueText, aM as requestShotsForAsset, aN as sanitizeUntrustedText, aO as secondsToTimestamp, aP as splitVttPreambleAndCueBlocks, aQ as stripVttMetadataBlocks, aR as vttTimestampToSeconds, aS as waitForShotsForAsset } from './transcripts-Cs-n8X_l.js';
1
+ import { Z as WorkflowCredentialsInput, $ as WorkflowScope, T as TextChunk, n as ChunkingStrategy, ab as VTTCue, ac as CompletedShotsResult, ad as DeletedShotsResult, ae as ErroredShotsResult, af as Hotspot, ag as HotspotOptions, ah as HotspotResponse, ai as LOW_CONFIDENCE_THRESHOLD, aj as MAX_CUE_TEXT_CHARS, ak as ParseVTTCuesOptions, al as PendingShotsResult, am as Shot, an as ShotRequestOptions, ao as ShotsResult, ap as SkippedShotsResult, aq as TranscriptEmptyReason, ar as TranscriptFetchOptions, as as TranscriptFetchStepResult, at as TranscriptResult, au as WaitForShotsOptions, av as buildTranscriptUrl, aw as buildVttFromCueBlocks, ax as buildVttFromTranslatedCueBlocks, ay as concatenateVttSegments, az as extractTextFromVTT, aA as extractTimestampedTranscript, aB as fetchTranscriptDataForUrl, aC as fetchTranscriptForAsset, aD as filterVttByScope, aE as findCaptionTrack, aF as getHotspotsForAsset, aG as getHotspotsForPlaybackId, aH as getHotspotsForVideo, aI as getReadyTextTracks, aJ as getReliableLanguageCode, aK as getShotsForAsset, aL as parseVTTCues, aM as replaceCueText, aN as requestShotsForAsset, aO as sanitizeUntrustedText, aP as secondsToTimestamp, aQ as splitVttPreambleAndCueBlocks, aR as stripVttMetadataBlocks, aS as vttTimestampToSeconds, aT as waitForShotsForAsset } from './transcripts-S4CdWuUq.js';
2
2
 
3
3
  interface HeatmapOptions {
4
4
  /** Time window for results, e.g., '7:days' (default: '7:days') */
@@ -1,5 +1,5 @@
1
1
  import { LanguageModel, generateText as generateText$1 } from 'ai';
2
- import { f as MuxAiError, k as ClassifiedErrorsOption, Z as WorkflowCredentialsInput, h as MuxAsset, A as AssetTextTrack, a as MuxAiErrorFacts, R as TokenUsage, K as ScopedMuxAIOptions, I as ImageSubmissionMode, G as MuxAIOptions, n as ChunkingStrategy, Y as VideoEmbeddingsResult, ae as Hotspot, al as Shot, aa as VTTCue, U as ToneType, O as StorageAdapter } from './transcripts-Cs-n8X_l.js';
2
+ import { f as MuxAiError, k as ClassifiedErrorsOption, Z as WorkflowCredentialsInput, h as MuxAsset, A as AssetTextTrack, a as MuxAiErrorFacts, R as TokenUsage, K as ScopedMuxAIOptions, I as ImageSubmissionMode, G as MuxAIOptions, n as ChunkingStrategy, Y as VideoEmbeddingsResult, af as Hotspot, am as Shot, ab as VTTCue, U as ToneType, O as StorageAdapter } from './transcripts-S4CdWuUq.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';
@@ -2379,7 +2379,7 @@ declare const index_translationSchema: typeof translationSchema;
2379
2379
  declare const index_validateNeverTranslateTerms: typeof validateNeverTranslateTerms;
2380
2380
  declare const index_verifyNeverTranslateTerms: typeof verifyNeverTranslateTerms;
2381
2381
  declare namespace index {
2382
- 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_RepairFailureOutcome as RepairFailureOutcome, type index_RepairOptions as RepairOptions, type index_RepairPlan as RepairPlan, type index_RepairRejectionCode as RepairRejectionCode, 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 };
2382
+ 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_RepairFailureOutcome as RepairFailureOutcome, type index_RepairOptions as RepairOptions, type index_RepairPlan as RepairPlan, type index_RepairRejectionCode as RepairRejectionCode, 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, generateText as generateContextualText, 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, getModerationScores as moderate, 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, getSummaryAndTags as summarize, 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 };
2383
2383
  }
2384
2384
 
2385
- export { type AudioTranslationOptions as $, normalizeTrackLanguageCode as A, normalizeTrackName as B, planSourceTrackReplacement as C, planTextTrackReplacement as D, replaceAndCreateTextTrack as E, replaceAndCreateTrack as F, replaceSourceTrack as G, summarizeTextTrack as H, type ISO639_1 as I, toISO639_1 as J, toISO639_3 as K, type LanguageCodePair as L, MUX_TRACK_PASSTHROUGH_MAX_CHARS as M, trackReplacementBlockedError as N, trackTargetFacts as O, validateTrackPassthrough as P, index as Q, type ReplaceAndCreateTextTrackInput as R, type SourceTrackReplacementPolicy as S, type TextTrackReplacementPlan as T, ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as U, ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as V, ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as W, ASK_QUESTIONS_MAX_QUESTION_LENGTH as X, type AskQuestionsOptions as Y, type AskQuestionsResult as Z, type AskQuestionsType as _, type ISO639_3 as a, type Question as a$, type AudioTranslationResult as a0, type AutoCensorProfanityOptions as a1, type BurnedInCaptionsAnalysis as a2, type BurnedInCaptionsOptions as a3, type BurnedInCaptionsPromptOverrides as a4, type BurnedInCaptionsPromptSections as a5, type BurnedInCaptionsResult as a6, type CaptionReplacement as a7, type CensorMode as a8, type Chapter as a9, GENERATE_TEXT_MAX_SHOT_FRAMES as aA, GENERATE_TEXT_MAX_VARIANTS as aB, GENERATE_TEXT_VOICES as aC, GOOGLE_VISION_LIKELIHOOD_TO_SCORE as aD, type GenerateTextArtifact as aE, type GenerateTextCallToAction as aF, type GenerateTextChannel as aG, type GenerateTextFormat as aH, type GenerateTextKeyedItem as aI, type GenerateTextLengthLimit as aJ, type GenerateTextOptions as aK, type GenerateTextResult as aL, type GenerateTextVariant as aM, type GenerateTextVoice as aN, type GeneratedTextArtifact as aO, type GeneratedTextVariant as aP, HIVE_SEXUAL_CATEGORIES as aQ, HIVE_VIOLENCE_CATEGORIES as aR, type HiveModerationOutput as aS, type HiveModerationSource as aT, type ModerationOptions as aU, type ModerationProvider as aV, type ModerationResult as aW, type ModerationSurfaceStatus as aX, type MomentInsight as aY, type OverallInsight as aZ, type ProfanityDetectionPayload as a_, type ChapterSystemPromptSections as aa, type ChaptersOptions as ab, type ChaptersPromptOverrides as ac, type ChaptersPromptSections as ad, type ChaptersResult as ae, type ChaptersType as af, DEFAULT_TRANSCRIPT_WINDOWING as ag, type DubbedCaptionsOutcome as ah, type EditCaptionsOptions as ai, type EditCaptionsResult as aj, type EmbeddingsOptions as ak, type EmbeddingsResult as al, type EngagementInsightsOptions as am, type EngagementInsightsResult as an, GENERATE_TEXT_CALLS_TO_ACTION as ao, GENERATE_TEXT_CHANNELS as ap, GENERATE_TEXT_CHANNEL_CEILINGS as aq, GENERATE_TEXT_FORMATS as ar, GENERATE_TEXT_LENGTH_BOUNDS as as, GENERATE_TEXT_MAX_ARTIFACTS as at, GENERATE_TEXT_MAX_AUDIENCE_CHARS as au, GENERATE_TEXT_MAX_BRAND_TERMS as av, GENERATE_TEXT_MAX_BRAND_TERMS_TOTAL_CHARS as aw, GENERATE_TEXT_MAX_BRAND_TERM_CHARS as ax, GENERATE_TEXT_MAX_CONCURRENT_GENERATIONS as ay, GENERATE_TEXT_MAX_INSTRUCTIONS_CHARS as az, type ModelCallContext as b, resolveGenerateTextLengthLimit as b$, type QuestionAnswer as b0, type QuestionAnswerType as b1, type RepairAttempt as b2, type RepairCall as b3, type RepairFailureOutcome as b4, type RepairOptions as b5, type RepairPlan as b6, type RepairRejectionCode as b7, type RepairResult as b8, type RepairSpan as b9, buildReplacementRegex as bA, buildTranscriptWindows as bB, burnedInCaptionsSchema as bC, censorVttContent as bD, chapterSchema as bE, chaptersSchema as bF, createReplacer as bG, createTextRepairGenerator as bH, editCaptions as bI, extractTranscriptSegmentsForHotspots as bJ, findGenerateTextLengthViolation as bK, generateChapters as bL, generateEmbeddings as bM, generateEngagementInsights as bN, generateText as bO, generateVideoEmbeddings as bP, getModerationScores as bQ, getSummaryAndTags as bR, hasBurnedInCaptions as bS, mapShotsToHotspots as bT, measureGenerateTextLength as bU, normalizeTranslatedVtt as bV, planTextRepair as bW, profanityDetectionSchema as bX, questionAnswerSchema as bY, repairJsonSchema as bZ, repairText as b_, type ReplacementRecord as ba, type SpeakerReplacement as bb, type StaticRenditionCleanupOutcome as bc, type SummarizationOptions as bd, type SummarizationPromptOverrides as be, type SummarizationPromptSections as bf, type SummaryAndTagsResult as bg, type SummaryType as bh, type TextLengthLimit as bi, type TextRepairModelOptions as bj, type ThumbnailModerationScore as bk, type ThumbnailModerationSkipReason as bl, type ThumbnailModerationStatus as bm, type TranscriptModerationScore as bn, type TranscriptModerationSkipReason as bo, type TranscriptModerationStatus as bp, type TranslationChunkingOptions as bq, type TranslationOptions as br, type TranslationPayload as bs, type TranslationResult as bt, aggregateTokenUsage as bu, applyOverrideLists as bv, applyReplacements as bw, applySpeakerReplacements as bx, applyTextRepair as by, askQuestions as bz, type ReplaceAndCreateTextTrackResult as c, resolveGenerateTextLengthLimits as c0, resolveGenerateTextOptions as c1, runTextRepairLoop as c2, selectGenerateTextShotFrames as c3, shouldSplitChunkTranslationError as c4, summarySchema as c5, transformCueText as c6, translateAudio as c7, translateCaptions as c8, translationSchema as c9, validateNeverTranslateTerms as ca, verifyNeverTranslateTerms as cb, type ReplaceAndCreateTrackInput as d, type ReplaceExistingTracksPolicy as e, type ReplaceSourceTrackInput as f, type ReplaceableTrackType as g, type SupportedISO639_1 as h, type SupportedISO639_3 as i, type TextTrackSummary as j, type TextTrackTarget as k, type TrackReplacementBlocked as l, type TrackReplacementBlockedReason as m, type TrackSummary as n, type TrackTarget as o, buildMuxAiTrackPassthrough as p, findNameCollisionTextTracks as q, findSameLanguageTextTracks as r, getLanguageCodePair as s, getLanguageName as t, isDuplicateTrackNameError as u, isMuxGeneratedTextTrack as v, isUndeterminedLanguageCode as w, isValidISO639_1 as x, isValidISO639_3 as y, modelCallError as z };
2385
+ export { type AudioTranslationOptions as $, normalizeTrackLanguageCode as A, normalizeTrackName as B, planSourceTrackReplacement as C, planTextTrackReplacement as D, replaceAndCreateTextTrack as E, replaceAndCreateTrack as F, replaceSourceTrack as G, summarizeTextTrack as H, type ISO639_1 as I, toISO639_1 as J, toISO639_3 as K, type LanguageCodePair as L, MUX_TRACK_PASSTHROUGH_MAX_CHARS as M, trackReplacementBlockedError as N, trackTargetFacts as O, validateTrackPassthrough as P, index as Q, type ReplaceAndCreateTextTrackInput as R, type SourceTrackReplacementPolicy as S, type TextTrackReplacementPlan as T, ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as U, ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as V, ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as W, ASK_QUESTIONS_MAX_QUESTION_LENGTH as X, type AskQuestionsOptions as Y, type AskQuestionsResult as Z, type AskQuestionsType as _, type ISO639_3 as a, type Question as a$, type AudioTranslationResult as a0, type AutoCensorProfanityOptions as a1, type BurnedInCaptionsAnalysis as a2, type BurnedInCaptionsOptions as a3, type BurnedInCaptionsPromptOverrides as a4, type BurnedInCaptionsPromptSections as a5, type BurnedInCaptionsResult as a6, type CaptionReplacement as a7, type CensorMode as a8, type Chapter as a9, GENERATE_TEXT_MAX_SHOT_FRAMES as aA, GENERATE_TEXT_MAX_VARIANTS as aB, GENERATE_TEXT_VOICES as aC, GOOGLE_VISION_LIKELIHOOD_TO_SCORE as aD, type GenerateTextArtifact as aE, type GenerateTextCallToAction as aF, type GenerateTextChannel as aG, type GenerateTextFormat as aH, type GenerateTextKeyedItem as aI, type GenerateTextLengthLimit as aJ, type GenerateTextOptions as aK, type GenerateTextResult as aL, type GenerateTextVariant as aM, type GenerateTextVoice as aN, type GeneratedTextArtifact as aO, type GeneratedTextVariant as aP, HIVE_SEXUAL_CATEGORIES as aQ, HIVE_VIOLENCE_CATEGORIES as aR, type HiveModerationOutput as aS, type HiveModerationSource as aT, type ModerationOptions as aU, type ModerationProvider as aV, type ModerationResult as aW, type ModerationSurfaceStatus as aX, type MomentInsight as aY, type OverallInsight as aZ, type ProfanityDetectionPayload as a_, type ChapterSystemPromptSections as aa, type ChaptersOptions as ab, type ChaptersPromptOverrides as ac, type ChaptersPromptSections as ad, type ChaptersResult as ae, type ChaptersType as af, DEFAULT_TRANSCRIPT_WINDOWING as ag, type DubbedCaptionsOutcome as ah, type EditCaptionsOptions as ai, type EditCaptionsResult as aj, type EmbeddingsOptions as ak, type EmbeddingsResult as al, type EngagementInsightsOptions as am, type EngagementInsightsResult as an, GENERATE_TEXT_CALLS_TO_ACTION as ao, GENERATE_TEXT_CHANNELS as ap, GENERATE_TEXT_CHANNEL_CEILINGS as aq, GENERATE_TEXT_FORMATS as ar, GENERATE_TEXT_LENGTH_BOUNDS as as, GENERATE_TEXT_MAX_ARTIFACTS as at, GENERATE_TEXT_MAX_AUDIENCE_CHARS as au, GENERATE_TEXT_MAX_BRAND_TERMS as av, GENERATE_TEXT_MAX_BRAND_TERMS_TOTAL_CHARS as aw, GENERATE_TEXT_MAX_BRAND_TERM_CHARS as ax, GENERATE_TEXT_MAX_CONCURRENT_GENERATIONS as ay, GENERATE_TEXT_MAX_INSTRUCTIONS_CHARS as az, type ModelCallContext as b, resolveGenerateTextLengthLimit as b$, type QuestionAnswer as b0, type QuestionAnswerType as b1, type RepairAttempt as b2, type RepairCall as b3, type RepairFailureOutcome as b4, type RepairOptions as b5, type RepairPlan as b6, type RepairRejectionCode as b7, type RepairResult as b8, type RepairSpan as b9, buildReplacementRegex as bA, buildTranscriptWindows as bB, burnedInCaptionsSchema as bC, censorVttContent as bD, chapterSchema as bE, chaptersSchema as bF, createReplacer as bG, createTextRepairGenerator as bH, editCaptions as bI, extractTranscriptSegmentsForHotspots as bJ, findGenerateTextLengthViolation as bK, generateChapters as bL, generateText as bM, generateEmbeddings as bN, generateEngagementInsights as bO, generateVideoEmbeddings as bP, getModerationScores as bQ, getSummaryAndTags as bR, hasBurnedInCaptions as bS, mapShotsToHotspots as bT, measureGenerateTextLength as bU, normalizeTranslatedVtt as bV, planTextRepair as bW, profanityDetectionSchema as bX, questionAnswerSchema as bY, repairJsonSchema as bZ, repairText as b_, type ReplacementRecord as ba, type SpeakerReplacement as bb, type StaticRenditionCleanupOutcome as bc, type SummarizationOptions as bd, type SummarizationPromptOverrides as be, type SummarizationPromptSections as bf, type SummaryAndTagsResult as bg, type SummaryType as bh, type TextLengthLimit as bi, type TextRepairModelOptions as bj, type ThumbnailModerationScore as bk, type ThumbnailModerationSkipReason as bl, type ThumbnailModerationStatus as bm, type TranscriptModerationScore as bn, type TranscriptModerationSkipReason as bo, type TranscriptModerationStatus as bp, type TranslationChunkingOptions as bq, type TranslationOptions as br, type TranslationPayload as bs, type TranslationResult as bt, aggregateTokenUsage as bu, applyOverrideLists as bv, applyReplacements as bw, applySpeakerReplacements as bx, applyTextRepair as by, askQuestions as bz, type ReplaceAndCreateTextTrackResult as c, resolveGenerateTextLengthLimits as c0, resolveGenerateTextOptions as c1, runTextRepairLoop as c2, selectGenerateTextShotFrames as c3, shouldSplitChunkTranslationError as c4, summarySchema as c5, transformCueText as c6, translateAudio as c7, translateCaptions as c8, translationSchema as c9, validateNeverTranslateTerms as ca, verifyNeverTranslateTerms as cb, type ReplaceAndCreateTrackInput as d, type ReplaceExistingTracksPolicy as e, type ReplaceSourceTrackInput as f, type ReplaceableTrackType as g, type SupportedISO639_1 as h, type SupportedISO639_3 as i, type TextTrackSummary as j, type TextTrackTarget as k, type TrackReplacementBlocked as l, type TrackReplacementBlockedReason as m, type TrackSummary as n, type TrackTarget as o, buildMuxAiTrackPassthrough as p, findNameCollisionTextTracks as q, findSameLanguageTextTracks as r, getLanguageCodePair as s, getLanguageName as t, isDuplicateTrackNameError as u, isMuxGeneratedTextTrack as v, isUndeterminedLanguageCode as w, isValidISO639_1 as x, isValidISO639_3 as y, modelCallError as z };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, M as MUX_TRACK_PASSTHROUGH_MAX_CHARS, b as ModelCallContext, R as ReplaceAndCreateTextTrackInput, c as ReplaceAndCreateTextTrackResult, d as ReplaceAndCreateTrackInput, e as ReplaceExistingTracksPolicy, f as ReplaceSourceTrackInput, g as ReplaceableTrackType, S as SourceTrackReplacementPolicy, h as SupportedISO639_1, i as SupportedISO639_3, T as TextTrackReplacementPlan, j as TextTrackSummary, k as TextTrackTarget, l as TrackReplacementBlocked, m as TrackReplacementBlockedReason, n as TrackSummary, o as TrackTarget, p as buildMuxAiTrackPassthrough, q as findNameCollisionTextTracks, r as findSameLanguageTextTracks, s as getLanguageCodePair, t as getLanguageName, u as isDuplicateTrackNameError, v as isMuxGeneratedTextTrack, w as isUndeterminedLanguageCode, x as isValidISO639_1, y as isValidISO639_3, z as modelCallError, A as normalizeTrackLanguageCode, B as normalizeTrackName, C as planSourceTrackReplacement, D as planTextTrackReplacement, E as replaceAndCreateTextTrack, F as replaceAndCreateTrack, G as replaceSourceTrack, H as summarizeTextTrack, J as toISO639_1, K as toISO639_3, N as trackReplacementBlockedError, O as trackTargetFacts, P as validateTrackPassthrough, Q as workflows } from './index-CxDX1bX1.js';
2
- import { M as MuxAiErrorDependency, a as MuxAiErrorFacts, b as MUX_AI_ERROR_SOURCES, c as MuxAiErrorSource, d as MuxAiSiteDependencyCode, e as MuxAiErrorType, f as MuxAiError, g as MuxAiDependencyStatusCode, h as MuxAsset, i as MuxAiErrorFactValue, j as MuxAiErrorCode, C as ClassifiedError, W as WorkflowCredentials, k as ClassifiedErrorsOption, S as StoragePutObjectInput, l as StoragePresignGetObjectInput } from './transcripts-Cs-n8X_l.js';
3
- export { A as AssetTextTrack, m as ChunkEmbedding, n as ChunkingStrategy, o as ClassifiedErrorInit, p as CodedClassification, E as Encrypted, q as EncryptedPayload, r as ErrorCatalogEntry, s as ErrorCauseSummary, I as ImageSubmissionMode, t as MUX_AI_DEPENDENCY_STATUS_CODES, u as MUX_AI_DEPENDENCY_STATUS_CODE_VALUES, v as MUX_AI_ERROR_CATALOG, w as MUX_AI_ERROR_CODES, x as MUX_AI_ERROR_CODE_VALUES, y as MUX_AI_ERROR_DEPENDENCIES, z as MUX_AI_ERROR_DEPENDENCY_VALUES, B as MUX_AI_ERROR_SOURCE_VALUES, D as MUX_AI_ERROR_TYPES, F as MUX_AI_ERROR_TYPE_VALUES, G as MuxAIOptions, H as MuxAiErrorInit, P as PlaybackAsset, J as PlaybackPolicy, K as ScopedMuxAIOptions, L as SerializedClassification, N as SourceAndDependency, O as StorageAdapter, T as TextChunk, Q as TokenChunkingConfig, R as TokenUsage, U as ToneType, V as UsageMetadata, X as VTTChunkingConfig, Y as VideoEmbeddingsResult, Z as WorkflowCredentialsInput, _ as WorkflowMuxClient, $ as WorkflowScope, a0 as assertNever, a1 as classificationInit, a2 as decryptFromWorkflow, a3 as encryptForWorkflow, a4 as errorDetailFact, a5 as internalError, a6 as isTransientStatus, a7 as restoreClassification, a8 as serializeClassification, a9 as wrapError } from './transcripts-Cs-n8X_l.js';
1
+ export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, M as MUX_TRACK_PASSTHROUGH_MAX_CHARS, b as ModelCallContext, R as ReplaceAndCreateTextTrackInput, c as ReplaceAndCreateTextTrackResult, d as ReplaceAndCreateTrackInput, e as ReplaceExistingTracksPolicy, f as ReplaceSourceTrackInput, g as ReplaceableTrackType, S as SourceTrackReplacementPolicy, h as SupportedISO639_1, i as SupportedISO639_3, T as TextTrackReplacementPlan, j as TextTrackSummary, k as TextTrackTarget, l as TrackReplacementBlocked, m as TrackReplacementBlockedReason, n as TrackSummary, o as TrackTarget, p as buildMuxAiTrackPassthrough, q as findNameCollisionTextTracks, r as findSameLanguageTextTracks, s as getLanguageCodePair, t as getLanguageName, u as isDuplicateTrackNameError, v as isMuxGeneratedTextTrack, w as isUndeterminedLanguageCode, x as isValidISO639_1, y as isValidISO639_3, z as modelCallError, A as normalizeTrackLanguageCode, B as normalizeTrackName, C as planSourceTrackReplacement, D as planTextTrackReplacement, E as replaceAndCreateTextTrack, F as replaceAndCreateTrack, G as replaceSourceTrack, H as summarizeTextTrack, J as toISO639_1, K as toISO639_3, N as trackReplacementBlockedError, O as trackTargetFacts, P as validateTrackPassthrough, Q as workflows } from './index-D9gsq_-m.js';
2
+ import { C as ClassifiedError, M as MuxAiErrorDependency, a as MuxAiErrorFacts, b as MUX_AI_ERROR_SOURCES, c as MuxAiErrorSource, d as MuxAiSiteDependencyCode, e as MuxAiErrorType, f as MuxAiError, g as MuxAiDependencyStatusCode, h as MuxAsset, i as MuxAiErrorFactValue, j as MuxAiErrorCode, W as WorkflowCredentials, k as ClassifiedErrorsOption, S as StoragePutObjectInput, l as StoragePresignGetObjectInput } from './transcripts-S4CdWuUq.js';
3
+ export { A as AssetTextTrack, m as ChunkEmbedding, n as ChunkingStrategy, o as ClassifiedErrorInit, p as CodedClassification, E as Encrypted, q as EncryptedPayload, r as ErrorCatalogEntry, s as ErrorCauseSummary, I as ImageSubmissionMode, t as MUX_AI_DEPENDENCY_STATUS_CODES, u as MUX_AI_DEPENDENCY_STATUS_CODE_VALUES, v as MUX_AI_ERROR_CATALOG, w as MUX_AI_ERROR_CODES, x as MUX_AI_ERROR_CODE_VALUES, y as MUX_AI_ERROR_DEPENDENCIES, z as MUX_AI_ERROR_DEPENDENCY_VALUES, B as MUX_AI_ERROR_SOURCE_VALUES, D as MUX_AI_ERROR_TYPES, F as MUX_AI_ERROR_TYPE_VALUES, G as MuxAIOptions, H as MuxAiErrorInit, P as PlaybackAsset, J as PlaybackPolicy, K as ScopedMuxAIOptions, L as SerializedClassification, N as SourceAndDependency, O as StorageAdapter, T as TextChunk, Q as TokenChunkingConfig, R as TokenUsage, U as ToneType, V as UsageMetadata, X as VTTChunkingConfig, Y as VideoEmbeddingsResult, Z as WorkflowCredentialsInput, _ as WorkflowMuxClient, $ as WorkflowScope, a0 as assertNever, a1 as classificationInit, a2 as decryptFromWorkflow, a3 as encryptForWorkflow, a4 as errorDetailFact, a5 as internalError, a6 as isTransientStatus, a7 as readSerializedClassification, a8 as restoreClassification, a9 as serializeClassification, aa as wrapError } from './transcripts-S4CdWuUq.js';
4
4
  import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
5
- export { i as primitives } from './index-DbEwilAW.js';
5
+ export { i as primitives } from './index-C5HUMIv0.js';
6
6
  import 'ai';
7
7
  import 'zod';
8
8
  import './summarization-BFmhXeAu.js';
@@ -11,7 +11,30 @@ import '@ai-sdk/google';
11
11
  import '@ai-sdk/openai';
12
12
  import '@mux/ts';
13
13
 
14
- var version = "0.68.0";
14
+ var version = "0.69.0-canary.116";
15
+
16
+ /**
17
+ * The classified error `error` is, or the first one in its `cause` chain.
18
+ *
19
+ * Workflow DevKit doesn't always hand a workflow the error a step threw. Once a step's last
20
+ * attempt fails, it throws a new `FatalError` ("Step "…" failed after N retries: …", or "…
21
+ * exceeded max retries …") with the step's error as its `cause`, so a workflow body that inspects
22
+ * what a step threw sees an unclassified wrapper once a transient failure has used up its retries.
23
+ * Looking down the chain, rather than matching that wrapper's shape or message, also covers any
24
+ * other wrapper that keeps the original as its `cause`.
25
+ *
26
+ * Stops at a legacy error: returns it when it's classified (the SDK's are) and `undefined` when
27
+ * it isn't, so a legacy error is never mistaken for the classified error it wraps. Returns
28
+ * `undefined` for anything else with no classified error within {@link MAX_CAUSE_DEPTH} links.
29
+ * Callers that want the original back use `classifiedErrorOf(error) ?? error`.
30
+ */
31
+ declare function classifiedErrorOf(error: unknown): ClassifiedError | undefined;
32
+ /**
33
+ * Whether `value` is one of Workflow DevKit's control-flow errors. Workflow code that catches a
34
+ * step's error must rethrow one unchanged: wrapping it, swallowing it or recording it as a
35
+ * failure turns a run the runtime would recover into a failed one.
36
+ */
37
+ declare function isWorkflowControlFlowError(value: unknown): value is Error;
15
38
 
16
39
  interface DependencyErrorInit {
17
40
  dependency: MuxAiErrorDependency;
@@ -415,4 +438,4 @@ declare class WorkflowStorageClient {
415
438
  }
416
439
  declare function createWorkflowStorageClient(options?: WorkflowStorageClientOptions): WorkflowStorageClient;
417
440
 
418
- export { ClassifiedError, type DependencyErrorInit, type DependencyFailureInit, type ElevenLabsFailure, type LegacyMp4SupportRendition, MUX_AI_ERROR_GENERIC_MESSAGES, MUX_AI_ERROR_PUBLIC_MAPPINGS, MUX_AI_ERROR_SOURCES, MuxAiDependencyStatusCode, MuxAiError, MuxAiErrorCode, MuxAiErrorDependency, MuxAiErrorFactValue, MuxAiErrorFacts, MuxAiErrorSource, MuxAiErrorType, type MuxAiPublicError, MuxAiSiteDependencyCode, MuxAsset, type MuxPlaybackService, type PublicError, type PublicErrorMapping, type RecognizedDependencyErrorInit, STATIC_RENDITIONS_GUIDE_URL, StoragePresignGetObjectInput, StoragePutObjectInput, WorkflowCredentials, type WorkflowCredentialsProvider, WorkflowStorageClient, classifyDependencyFailure, createPublicErrorView, createWorkflowStorageClient, dependencyError, dependencyFailureCode, elevenLabsErrorRule, elevenLabsFailureError, elevenLabsResponseFailure, elevenLabsSdkFailure, genericPublicMessage, getLegacyMp4SupportRenditionSizeError, getMuxPlaybackOrigin, httpStatusOf, requestIdOf, resolveLegacyMp4SupportRendition, setWorkflowCredentialsProvider, toPublicError, usesLegacyMp4Support, version };
441
+ export { ClassifiedError, type DependencyErrorInit, type DependencyFailureInit, type ElevenLabsFailure, type LegacyMp4SupportRendition, MUX_AI_ERROR_GENERIC_MESSAGES, MUX_AI_ERROR_PUBLIC_MAPPINGS, MUX_AI_ERROR_SOURCES, MuxAiDependencyStatusCode, MuxAiError, MuxAiErrorCode, MuxAiErrorDependency, MuxAiErrorFactValue, MuxAiErrorFacts, MuxAiErrorSource, MuxAiErrorType, type MuxAiPublicError, MuxAiSiteDependencyCode, MuxAsset, type MuxPlaybackService, type PublicError, type PublicErrorMapping, type RecognizedDependencyErrorInit, STATIC_RENDITIONS_GUIDE_URL, StoragePresignGetObjectInput, StoragePutObjectInput, WorkflowCredentials, type WorkflowCredentialsProvider, WorkflowStorageClient, classifiedErrorOf, classifyDependencyFailure, createPublicErrorView, createWorkflowStorageClient, dependencyError, dependencyFailureCode, elevenLabsErrorRule, elevenLabsFailureError, elevenLabsResponseFailure, elevenLabsSdkFailure, genericPublicMessage, getLegacyMp4SupportRenditionSizeError, getMuxPlaybackOrigin, httpStatusOf, isWorkflowControlFlowError, requestIdOf, resolveLegacyMp4SupportRendition, setWorkflowCredentialsProvider, toPublicError, usesLegacyMp4Support, version };
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // package.json
8
- var version = "0.68.0";
8
+ var version = "0.69.0-canary.116";
9
9
 
10
10
  // src/lib/content-policy-error.ts
11
11
  import { APICallError as APICallError2, NoObjectGeneratedError, NoOutputGeneratedError as NoOutputGeneratedError2, RetryError, TypeValidationError } from "ai";
@@ -15,6 +15,38 @@ import { z as z4 } from "zod";
15
15
  var WORKFLOW_SERIALIZE = /* @__PURE__ */ Symbol.for("workflow-serialize");
16
16
  var WORKFLOW_DESERIALIZE = /* @__PURE__ */ Symbol.for("workflow-deserialize");
17
17
 
18
+ // src/lib/error-guards.ts
19
+ function isClassifiedError(value) {
20
+ return typeof value === "object" && value !== null && "__classified_error" in value && value.__classified_error === true;
21
+ }
22
+ function isLegacyMuxAiError(value) {
23
+ return typeof value === "object" && value !== null && "__robots_error" in value && value.__robots_error === true && typeof value.publicMessage === "string";
24
+ }
25
+ var MAX_CAUSE_DEPTH = 5;
26
+ function classifiedErrorOf(error) {
27
+ const seen = /* @__PURE__ */ new Set();
28
+ let current = error;
29
+ for (let depth = 0; depth < MAX_CAUSE_DEPTH && typeof current === "object" && current !== null && !seen.has(current); depth += 1) {
30
+ if (isLegacyMuxAiError(current)) {
31
+ return isClassifiedError(current) ? current : void 0;
32
+ }
33
+ if (isClassifiedError(current)) {
34
+ return current;
35
+ }
36
+ seen.add(current);
37
+ current = current.cause;
38
+ }
39
+ return void 0;
40
+ }
41
+ var WORKFLOW_CONTROL_FLOW_ERROR_NAMES = /* @__PURE__ */ new Set(["ReplayDivergenceError", "WorkflowSuspension"]);
42
+ function isWorkflowControlFlowError(value) {
43
+ if (typeof value !== "object" || value === null) {
44
+ return false;
45
+ }
46
+ const { name } = value;
47
+ return typeof name === "string" && WORKFLOW_CONTROL_FLOW_ERROR_NAMES.has(name);
48
+ }
49
+
18
50
  // src/lib/prompt-fragments.ts
19
51
  import dedent from "dedent";
20
52
 
@@ -493,7 +525,8 @@ function getErrorTokenUsage(error) {
493
525
  }
494
526
  const usage = error.usage;
495
527
  if (typeof usage !== "object" || usage === null) {
496
- return void 0;
528
+ const classified = classifiedErrorOf(error);
529
+ return classified && classified !== error ? getErrorTokenUsage(classified) : void 0;
497
530
  }
498
531
  const source = usage;
499
532
  const extracted = {};
@@ -524,8 +557,12 @@ function getErrorTokenUsage(error) {
524
557
  return Object.keys(extracted).length > 0 ? extracted : void 0;
525
558
  }
526
559
  function rethrowWithTokenUsage(error, collectedUsage) {
527
- const usages = [...collectedUsage];
560
+ if (isWorkflowControlFlowError(error)) {
561
+ throw error;
562
+ }
528
563
  const errorUsage = getErrorTokenUsage(error);
564
+ error = classifiedErrorOf(error) ?? error;
565
+ const usages = [...collectedUsage];
529
566
  if (errorUsage) {
530
567
  usages.push(errorUsage);
531
568
  }
@@ -811,7 +848,7 @@ var MUX_AI_DEPENDENCY_STATUS_CODES = {
811
848
  RESPONSE_FAILED: MUX_AI_ERROR_CODES.DEPENDENCY_RESPONSE_FAILED
812
849
  };
813
850
  var MUX_AI_DEPENDENCY_STATUS_CODE_VALUES = Object.values(MUX_AI_DEPENDENCY_STATUS_CODES);
814
- var MAX_CAUSE_DEPTH = 3;
851
+ var MAX_CAUSE_DEPTH2 = 3;
815
852
  var MAX_CAUSE_MESSAGE_LENGTH = 500;
816
853
  function statusOf(value) {
817
854
  if (typeof value !== "object" || value === null) {
@@ -824,9 +861,9 @@ function statusOf(value) {
824
861
  function summarizeCauses(cause) {
825
862
  const causes = [];
826
863
  let current = cause;
827
- while (current !== void 0 && current !== null && causes.length < MAX_CAUSE_DEPTH) {
864
+ while (current !== void 0 && current !== null && causes.length < MAX_CAUSE_DEPTH2) {
828
865
  if (ClassifiedError.isClassified(current)) {
829
- causes.push(...current.causes.slice(0, MAX_CAUSE_DEPTH - causes.length));
866
+ causes.push(...current.causes.slice(0, MAX_CAUSE_DEPTH2 - causes.length));
830
867
  break;
831
868
  }
832
869
  const status = statusOf(current);
@@ -866,7 +903,7 @@ var ClassifiedError = class extends Error {
866
903
  }
867
904
  /** Whether `value` is any classified error, from this copy of the SDK or another. */
868
905
  static isClassified(value) {
869
- return typeof value === "object" && value !== null && "__classified_error" in value && value.__classified_error === true;
906
+ return isClassifiedError(value);
870
907
  }
871
908
  };
872
909
  function serializeClassification(error) {
@@ -876,6 +913,8 @@ function serializeClassification(error) {
876
913
  source: error.source,
877
914
  ...error.dependency && { dependency: error.dependency },
878
915
  ...error.code && { code: error.code },
916
+ // JSON-safe by type, but not checked at runtime: a value Workflow DevKit can't serialize
917
+ // would stop the step's failure from being recorded at all.
879
918
  facts: error.facts,
880
919
  retryable: error.retryable,
881
920
  transient: error.transient,
@@ -883,7 +922,41 @@ function serializeClassification(error) {
883
922
  stack: error.stack
884
923
  };
885
924
  }
925
+ function readString(value) {
926
+ return typeof value === "string" && value.length > 0 ? value : void 0;
927
+ }
928
+ function readPlainRecord(value) {
929
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
930
+ }
931
+ function readSerializedClassification(record) {
932
+ const value = readPlainRecord(record) ?? {};
933
+ const dependency = readString(value.dependency);
934
+ const code = readString(value.code);
935
+ const stack = readString(value.stack);
936
+ const causes = Array.isArray(value.causes) ? value.causes.flatMap((cause) => {
937
+ const entry = readPlainRecord(cause);
938
+ const name = readString(entry?.name);
939
+ const message = typeof entry?.message === "string" ? entry.message : void 0;
940
+ if (!name || message === void 0) {
941
+ return [];
942
+ }
943
+ return [{ name, message, ...typeof entry?.status === "number" && { status: entry.status } }];
944
+ }) : [];
945
+ return {
946
+ message: typeof value.message === "string" ? value.message : "Unknown error",
947
+ type: readString(value.type) ?? MUX_AI_ERROR_TYPES.SERVER_ERROR,
948
+ source: readString(value.source) ?? MUX_AI_ERROR_SOURCES.INTERNAL,
949
+ ...dependency && { dependency },
950
+ ...code && { code },
951
+ facts: readPlainRecord(value.facts) ?? {},
952
+ retryable: value.retryable === true,
953
+ transient: value.transient === true,
954
+ causes,
955
+ ...stack && { stack }
956
+ };
957
+ }
886
958
  function classificationInit(record) {
959
+ record = readSerializedClassification(record);
887
960
  return {
888
961
  type: record.type,
889
962
  source: record.source,
@@ -894,6 +967,7 @@ function classificationInit(record) {
894
967
  };
895
968
  }
896
969
  function restoreClassification(error, record) {
970
+ record = readSerializedClassification(record);
897
971
  if (record.code) {
898
972
  Object.assign(error, { code: record.code });
899
973
  }
@@ -925,14 +999,20 @@ var MuxAiError = class _MuxAiError extends ClassifiedError {
925
999
  };
926
1000
  }
927
1001
  static [WORKFLOW_DESERIALIZE](value) {
928
- const error = restoreClassification(new _MuxAiError(value.message, classificationInit(value)), value);
929
- Object.assign(error, {
930
- usage: value.usage,
931
- diagnostics: value.diagnostics,
932
- ...value.finishReason !== void 0 && { finishReason: value.finishReason },
933
- ...value.rawFinishReason !== void 0 && { rawFinishReason: value.rawFinishReason }
934
- });
935
- return error;
1002
+ try {
1003
+ const record = readSerializedClassification(value);
1004
+ const fields = readPlainRecord(value) ?? {};
1005
+ const error = restoreClassification(new _MuxAiError(record.message, classificationInit(record)), record);
1006
+ Object.assign(error, {
1007
+ usage: readPlainRecord(fields.usage),
1008
+ diagnostics: readPlainRecord(fields.diagnostics),
1009
+ ...typeof fields.finishReason === "string" && { finishReason: fields.finishReason },
1010
+ ...typeof fields.rawFinishReason === "string" && { rawFinishReason: fields.rawFinishReason }
1011
+ });
1012
+ return error;
1013
+ } catch {
1014
+ return new _MuxAiError("Unknown error", { type: MUX_AI_ERROR_TYPES.SERVER_ERROR, source: MUX_AI_ERROR_SOURCES.INTERNAL });
1015
+ }
936
1016
  }
937
1017
  };
938
1018
  function extractErrorDetail(error) {
@@ -978,10 +1058,18 @@ function scrubDetail(detail, context) {
978
1058
  return "Upstream error details suppressed by safety filter";
979
1059
  }
980
1060
  function wrapError(error, message, facts) {
1061
+ if (isWorkflowControlFlowError(error)) {
1062
+ throw error;
1063
+ }
1064
+ const usage = getErrorTokenUsage(error);
1065
+ error = classifiedErrorOf(error) ?? error;
981
1066
  if (MuxAiError.is(error)) {
982
1067
  if (facts) {
983
1068
  Object.assign(error, { facts: { ...facts, ...error.facts } });
984
1069
  }
1070
+ if (usage) {
1071
+ error.usage = usage;
1072
+ }
985
1073
  throw error;
986
1074
  }
987
1075
  const wrapped = new MuxAiError(`${message}: ${scrubDetail(extractErrorDetail(error), message)}`, {
@@ -990,7 +1078,6 @@ function wrapError(error, message, facts) {
990
1078
  facts,
991
1079
  cause: error
992
1080
  });
993
- const usage = getErrorTokenUsage(error);
994
1081
  if (usage) {
995
1082
  wrapped.usage = usage;
996
1083
  }
@@ -1262,9 +1349,6 @@ var LegacyMuxAiError = class _LegacyMuxAiError extends MuxAiError {
1262
1349
  return error;
1263
1350
  }
1264
1351
  };
1265
- function isLegacyMuxAiError(value) {
1266
- return typeof value === "object" && value !== null && "__robots_error" in value && value.__robots_error === true && typeof value.publicMessage === "string";
1267
- }
1268
1352
  function legacyWrapError(error, message) {
1269
1353
  if (MuxAiError.is(error) || isLegacyMuxAiError(error)) {
1270
1354
  throw error;
@@ -2669,16 +2753,16 @@ async function resolveWorkflowCredentials(credentials) {
2669
2753
  }
2670
2754
  return { ...resolved, ...credentials };
2671
2755
  }
2672
- function readString(record, key) {
2756
+ function readString2(record, key) {
2673
2757
  const value = record?.[key];
2674
2758
  return typeof value === "string" && value.length > 0 ? value : void 0;
2675
2759
  }
2676
2760
  function resolveDirectMuxCredentials(record) {
2677
- const tokenId = readString(record, "muxTokenId");
2678
- const tokenSecret = readString(record, "muxTokenSecret");
2679
- const authorizationToken = readString(record, "muxAuthorizationToken");
2680
- const signingKey = readString(record, "muxSigningKey");
2681
- const privateKey = readString(record, "muxPrivateKey");
2761
+ const tokenId = readString2(record, "muxTokenId");
2762
+ const tokenSecret = readString2(record, "muxTokenSecret");
2763
+ const authorizationToken = readString2(record, "muxAuthorizationToken");
2764
+ const signingKey = readString2(record, "muxSigningKey");
2765
+ const privateKey = readString2(record, "muxPrivateKey");
2682
2766
  if (!tokenId && !tokenSecret && !authorizationToken && !signingKey && !privateKey) {
2683
2767
  return void 0;
2684
2768
  }
@@ -2736,13 +2820,13 @@ async function resolveMuxClient(credentials) {
2736
2820
  }
2737
2821
  function resolveProviderApiKeyFromCredentials(provider, resolved) {
2738
2822
  const record = resolved;
2739
- const openaiApiKey = readString(record, "openaiApiKey");
2740
- const basetenApiKey = readString(record, "basetenApiKey");
2741
- const anthropicApiKey = readString(record, "anthropicApiKey");
2742
- const googleApiKey = readString(record, "googleApiKey");
2743
- const googleVisionApiKey = readString(record, "googleVisionApiKey");
2744
- const hiveApiKey = readString(record, "hiveApiKey");
2745
- const elevenLabsApiKey = readString(record, "elevenLabsApiKey");
2823
+ const openaiApiKey = readString2(record, "openaiApiKey");
2824
+ const basetenApiKey = readString2(record, "basetenApiKey");
2825
+ const anthropicApiKey = readString2(record, "anthropicApiKey");
2826
+ const googleApiKey = readString2(record, "googleApiKey");
2827
+ const googleVisionApiKey = readString2(record, "googleVisionApiKey");
2828
+ const hiveApiKey = readString2(record, "hiveApiKey");
2829
+ const elevenLabsApiKey = readString2(record, "elevenLabsApiKey");
2746
2830
  const apiKeyMap = {
2747
2831
  "openai": openaiApiKey ?? env_default.OPENAI_API_KEY,
2748
2832
  "baseten": basetenApiKey ?? env_default.BASETEN_API_KEY,
@@ -2776,8 +2860,8 @@ async function resolveProviderApiKey(provider, credentials) {
2776
2860
  async function resolveMuxSigningContext(credentials) {
2777
2861
  const resolved = await resolveWorkflowCredentials(credentials);
2778
2862
  const resolvedRecord = resolved;
2779
- const keyId = readString(resolvedRecord, "muxSigningKey") ?? env_default.MUX_SIGNING_KEY;
2780
- const keySecret = readString(resolvedRecord, "muxPrivateKey") ?? env_default.MUX_PRIVATE_KEY;
2863
+ const keyId = readString2(resolvedRecord, "muxSigningKey") ?? env_default.MUX_SIGNING_KEY;
2864
+ const keySecret = readString2(resolvedRecord, "muxPrivateKey") ?? env_default.MUX_PRIVATE_KEY;
2781
2865
  if (!keyId || !keySecret) {
2782
2866
  return void 0;
2783
2867
  }
@@ -5578,7 +5662,7 @@ async function fetchTranscriptForAsset(asset, playbackId, options = {}) {
5578
5662
  try {
5579
5663
  result = await fetchTranscriptDataForUrl(transcriptUrl, { cleanTranscript, scope, classifiedErrors });
5580
5664
  } catch (error) {
5581
- if (required) {
5665
+ if (required || isWorkflowControlFlowError(error)) {
5582
5666
  throw error;
5583
5667
  }
5584
5668
  console.warn("Failed to fetch transcript:", error);
@@ -5657,6 +5741,7 @@ __export(workflows_exports, {
5657
5741
  extractTranscriptSegmentsForHotspots: () => extractTranscriptSegmentsForHotspots,
5658
5742
  findGenerateTextLengthViolation: () => findGenerateTextLengthViolation,
5659
5743
  generateChapters: () => generateChapters,
5744
+ generateContextualText: () => generateText7,
5660
5745
  generateEmbeddings: () => generateEmbeddings,
5661
5746
  generateEngagementInsights: () => generateEngagementInsights,
5662
5747
  generateText: () => generateText7,
@@ -5666,6 +5751,7 @@ __export(workflows_exports, {
5666
5751
  hasBurnedInCaptions: () => hasBurnedInCaptions,
5667
5752
  mapShotsToHotspots: () => mapShotsToHotspots,
5668
5753
  measureGenerateTextLength: () => measureGenerateTextLength,
5754
+ moderate: () => getModerationScores,
5669
5755
  normalizeTranslatedVtt: () => normalizeTranslatedVtt,
5670
5756
  planTextRepair: () => planTextRepair,
5671
5757
  profanityDetectionSchema: () => profanityDetectionSchema,
@@ -5678,6 +5764,7 @@ __export(workflows_exports, {
5678
5764
  runTextRepairLoop: () => runTextRepairLoop,
5679
5765
  selectGenerateTextShotFrames: () => selectGenerateTextShotFrames,
5680
5766
  shouldSplitChunkTranslationError: () => shouldSplitChunkTranslationError,
5767
+ summarize: () => getSummaryAndTags,
5681
5768
  summarySchema: () => summarySchema,
5682
5769
  transformCueText: () => transformCueText,
5683
5770
  translateAudio: () => translateAudio,
@@ -7791,6 +7878,7 @@ async function deleteTrackOnMux(assetId, trackId, credentials) {
7791
7878
  }
7792
7879
  }
7793
7880
  function restoreFailureFacts(error) {
7881
+ error = classifiedErrorOf(error) ?? error;
7794
7882
  if (!MuxAiError.is(error)) {
7795
7883
  return { restoreError: errorDetailFact(extractErrorDetail(error)) };
7796
7884
  }
@@ -8128,6 +8216,9 @@ async function editCaptionsInternal(assetId, trackId, options, collectedUsage) {
8128
8216
  restoreNote = ` The source track was restored as ${restoredTrackId}.`;
8129
8217
  restoreFacts = { sourceRestored: true, restoredTrackId };
8130
8218
  } catch (restoreError) {
8219
+ if (isWorkflowControlFlowError(restoreError)) {
8220
+ throw restoreError;
8221
+ }
8131
8222
  restoreNote = " Restoring the source track also failed.";
8132
8223
  restoreFacts = { sourceRestored: false, ...restoreFailureFacts(restoreError) };
8133
8224
  }
@@ -8762,6 +8853,11 @@ async function generateEngagementInsightsInternal(assetId, options, collectedUsa
8762
8853
  }),
8763
8854
  storyboardPromise
8764
8855
  ]);
8856
+ for (const result of [engagementResult, shotsResult, transcriptResult, storyboardResult]) {
8857
+ if (result.status === "rejected" && isWorkflowControlFlowError(result.reason)) {
8858
+ throw result.reason;
8859
+ }
8860
+ }
8765
8861
  if (engagementResult.status === "rejected") {
8766
8862
  wrapError(engagementResult.reason, `Failed to fetch engagement data for asset ${assetId}`, { assetId, timeframe });
8767
8863
  }
@@ -9145,7 +9241,10 @@ async function getCompletedShots(assetId, credentials) {
9145
9241
  return result;
9146
9242
  }
9147
9243
  console.warn(`[@mux/ai] Shots are not ready for asset ${assetId} (status: ${result.status}). Using the storyboard only.`);
9148
- } catch {
9244
+ } catch (error) {
9245
+ if (isWorkflowControlFlowError(error)) {
9246
+ throw error;
9247
+ }
9149
9248
  console.warn(`[@mux/ai] Shots lookup failed for asset ${assetId}. Using the storyboard only.`);
9150
9249
  }
9151
9250
  return void 0;
@@ -9581,6 +9680,10 @@ async function generateArtifactsInBatches(requests, collectedUsage, provider, mo
9581
9680
  }
9582
9681
  }
9583
9682
  if (failures.length > 0) {
9683
+ const controlFlow = failures.find(isWorkflowControlFlowError);
9684
+ if (controlFlow) {
9685
+ throw controlFlow;
9686
+ }
9584
9687
  for (const failure of failures.slice(1)) {
9585
9688
  const usage = getErrorTokenUsage(failure);
9586
9689
  if (usage) {
@@ -10637,6 +10740,13 @@ function allSamplesFailedError(message, failures, facts) {
10637
10740
  }
10638
10741
  async function getModerationScores(assetId, options = {}) {
10639
10742
  "use workflow";
10743
+ try {
10744
+ return await getModerationScoresInternal(assetId, options);
10745
+ } catch (error) {
10746
+ rethrowWithTokenUsage(error, []);
10747
+ }
10748
+ }
10749
+ async function getModerationScoresInternal(assetId, options) {
10640
10750
  const {
10641
10751
  provider = DEFAULT_PROVIDER2,
10642
10752
  model = provider === "openai" ? "omni-moderation-latest" : void 0,
@@ -12035,6 +12145,13 @@ async function attachDubbedCaptions(input) {
12035
12145
  }
12036
12146
  async function translateAudio(assetId, toLanguageCode, options = {}) {
12037
12147
  "use workflow";
12148
+ try {
12149
+ return await translateAudioInternal(assetId, toLanguageCode, options);
12150
+ } catch (error) {
12151
+ rethrowWithTokenUsage(error, []);
12152
+ }
12153
+ }
12154
+ async function translateAudioInternal(assetId, toLanguageCode, options) {
12038
12155
  const {
12039
12156
  provider = "elevenlabs",
12040
12157
  fromLanguageCode,
@@ -12390,6 +12507,9 @@ async function translateAudio(assetId, toLanguageCode, options = {}) {
12390
12507
  }
12391
12508
  }
12392
12509
  } catch (error) {
12510
+ if (isWorkflowControlFlowError(error)) {
12511
+ throw error;
12512
+ }
12393
12513
  captionsOutcome = captionsPresignedUrl ? { status: "failed", message: CAPTIONS_ATTACHMENT_FAILED_MESSAGE, retryable: true, replacedTracks: [] } : { status: "unavailable", message: CAPTIONS_UNAVAILABLE_MESSAGE, retryable: true };
12394
12514
  console.warn(`\u26A0\uFE0F Failed to attach dubbed captions: ${extractErrorDetail(error)}`);
12395
12515
  if (captionsPresignedUrl) {
@@ -13329,6 +13449,7 @@ export {
13329
13449
  assertNever,
13330
13450
  buildMuxAiTrackPassthrough,
13331
13451
  classificationInit,
13452
+ classifiedErrorOf,
13332
13453
  classifyDependencyFailure,
13333
13454
  createPublicErrorView,
13334
13455
  createWorkflowStorageClient,
@@ -13356,12 +13477,14 @@ export {
13356
13477
  isUndeterminedLanguageCode,
13357
13478
  isValidISO639_1,
13358
13479
  isValidISO639_3,
13480
+ isWorkflowControlFlowError,
13359
13481
  modelCallError,
13360
13482
  normalizeTrackLanguageCode,
13361
13483
  normalizeTrackName,
13362
13484
  planSourceTrackReplacement,
13363
13485
  planTextTrackReplacement,
13364
13486
  primitives_exports as primitives,
13487
+ readSerializedClassification,
13365
13488
  replaceAndCreateTextTrack,
13366
13489
  replaceAndCreateTrack,
13367
13490
  replaceSourceTrack,