@mux/ai 0.28.1 → 0.30.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.
- package/README.md +1 -1
- package/dist/{index-bjQi1ZCj.d.ts → index-CJtQiGj7.d.ts} +18 -4
- package/dist/{index-DUVBpnj5.d.ts → index-D3cB2ltG.d.ts} +47 -15
- package/dist/index.d.ts +7 -6
- package/dist/index.js +571 -189
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.d.ts +2 -2
- package/dist/primitives/index.js +122 -21
- package/dist/primitives/index.js.map +1 -1
- package/dist/{shots-mGJfYGiO.d.ts → shots-Bh0GrvLx.d.ts} +21 -1
- package/dist/workflows/index.d.ts +2 -2
- package/dist/workflows/index.js +678 -295
- package/dist/workflows/index.js.map +1 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ console.log(result.tags); // ["typescript", "tutorial", "programming"]
|
|
|
56
56
|
- **Support for video and audio assets.** The same workflows work with video and [audio-only assets](./docs/AUDIO-ONLY.md), including summarization, moderation, chaptering, and more.
|
|
57
57
|
- **Provider-flexible API.** Choose OpenAI, Anthropic, or Google through workflow options while keeping the same workflow interface.
|
|
58
58
|
- **Published evaluation coverage.** Workflows include [evals](./docs/EVALS.md) for quality, latency, and cost, with results [published publicly](https://evaluating-mux-ai.vercel.app/) on pushes to `main`.
|
|
59
|
-
- **Sensible default models.** Defaults (`gpt-5.
|
|
59
|
+
- **Sensible default models.** Defaults (`gpt-5.6-luna` at medium reasoning, `claude-sonnet-4-5`, `gemini-3-flash-preview`) are selected to balance output quality and runtime cost.
|
|
60
60
|
- **Typed end-to-end.** Workflow inputs, options, and outputs are fully typed in TypeScript.
|
|
61
61
|
- **Operational defaults included.** Retry handling, error handling, signed playback support, and [Workflow DevKit](https://useworkflow.dev) compatibility are built in.
|
|
62
62
|
- **Prompt customization support.** Use `promptOverrides` to adjust sections of workflow prompts for your domain or product requirements.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as WorkflowCredentialsInput, n as WorkflowScope, A as AssetTextTrack, d as MuxAsset, T as TextChunk, b as ChunkingStrategy, q as CompletedShotsResult, r as ErroredShotsResult, H as Hotspot, s as HotspotOptions, t as HotspotResponse, u as PendingShotsResult, v as Shot, w as ShotRequestOptions, x as ShotsResult, y as WaitForShotsOptions, z as getHotspotsForAsset, B as getHotspotsForPlaybackId, D as getHotspotsForVideo, F as getShotsForAsset, G as requestShotsForAsset, J as waitForShotsForAsset } from './shots-Bh0GrvLx.js';
|
|
2
2
|
|
|
3
3
|
interface HeatmapOptions {
|
|
4
4
|
/** Time window for results, e.g., '7:days' (default: '7:days') */
|
|
@@ -53,9 +53,11 @@ declare const DEFAULT_STORYBOARD_WIDTH = 640;
|
|
|
53
53
|
* @param playbackId - The Mux playback ID
|
|
54
54
|
* @param width - Width of the storyboard in pixels (default: 640)
|
|
55
55
|
* @param shouldSign - Flag for whether or not to use signed playback IDs (default: false)
|
|
56
|
+
* @param credentials - Optional workflow credentials used for signing
|
|
57
|
+
* @param scope - Optional asset-relative range for storyboard tiles
|
|
56
58
|
* @returns Storyboard URL (signed if shouldSign is true)
|
|
57
59
|
*/
|
|
58
|
-
declare function getStoryboardUrl(playbackId: string, width?: number, shouldSign?: boolean, credentials?: WorkflowCredentialsInput): Promise<string>;
|
|
60
|
+
declare function getStoryboardUrl(playbackId: string, width?: number, shouldSign?: boolean, credentials?: WorkflowCredentialsInput, scope?: WorkflowScope): Promise<string>;
|
|
59
61
|
|
|
60
62
|
/** A single cue from a VTT file with timing info. */
|
|
61
63
|
interface VTTCue {
|
|
@@ -66,6 +68,8 @@ interface VTTCue {
|
|
|
66
68
|
interface TranscriptFetchOptions {
|
|
67
69
|
languageCode?: string;
|
|
68
70
|
cleanTranscript?: boolean;
|
|
71
|
+
/** Optional asset-relative time range used to filter transcript cues. */
|
|
72
|
+
scope?: WorkflowScope;
|
|
69
73
|
/** Optional signing context for signed playback IDs */
|
|
70
74
|
shouldSign?: boolean;
|
|
71
75
|
credentials?: WorkflowCredentialsInput;
|
|
@@ -194,6 +198,13 @@ declare function extractTimestampedTranscript(vttContent: string): string;
|
|
|
194
198
|
* @returns Array of VTT cues with start/end times and text
|
|
195
199
|
*/
|
|
196
200
|
declare function parseVTTCues(vttContent: string): VTTCue[];
|
|
201
|
+
/**
|
|
202
|
+
* Keeps only VTT cues that overlap an asset-relative time range.
|
|
203
|
+
*
|
|
204
|
+
* Cue timestamps remain relative to the original asset; they are not rebased
|
|
205
|
+
* to the start of the scope.
|
|
206
|
+
*/
|
|
207
|
+
declare function filterVttByScope(vttContent: string, scope: WorkflowScope | undefined): string;
|
|
197
208
|
declare function splitVttPreambleAndCueBlocks(vttContent: string): {
|
|
198
209
|
preamble: string;
|
|
199
210
|
cueBlocks: string[];
|
|
@@ -293,6 +304,8 @@ interface ThumbnailOptions {
|
|
|
293
304
|
maxSamples?: number;
|
|
294
305
|
/** Workflow credentials for signing (optional). */
|
|
295
306
|
credentials?: WorkflowCredentialsInput;
|
|
307
|
+
/** Optional asset-relative range from which thumbnails should be sampled. */
|
|
308
|
+
scope?: WorkflowScope;
|
|
296
309
|
}
|
|
297
310
|
/**
|
|
298
311
|
* Generates thumbnail URLs at regular intervals based on video duration.
|
|
@@ -343,6 +356,7 @@ declare const index_estimateTokenCount: typeof estimateTokenCount;
|
|
|
343
356
|
declare const index_extractTextFromVTT: typeof extractTextFromVTT;
|
|
344
357
|
declare const index_extractTimestampedTranscript: typeof extractTimestampedTranscript;
|
|
345
358
|
declare const index_fetchTranscriptForAsset: typeof fetchTranscriptForAsset;
|
|
359
|
+
declare const index_filterVttByScope: typeof filterVttByScope;
|
|
346
360
|
declare const index_findCaptionTrack: typeof findCaptionTrack;
|
|
347
361
|
declare const index_getHeatmapForAsset: typeof getHeatmapForAsset;
|
|
348
362
|
declare const index_getHeatmapForPlaybackId: typeof getHeatmapForPlaybackId;
|
|
@@ -365,7 +379,7 @@ declare const index_stripVttMetadataBlocks: typeof stripVttMetadataBlocks;
|
|
|
365
379
|
declare const index_vttTimestampToSeconds: typeof vttTimestampToSeconds;
|
|
366
380
|
declare const index_waitForShotsForAsset: typeof waitForShotsForAsset;
|
|
367
381
|
declare namespace index {
|
|
368
|
-
export { index_CompletedShotsResult as CompletedShotsResult, index_DEFAULT_STORYBOARD_WIDTH as DEFAULT_STORYBOARD_WIDTH, index_ErroredShotsResult as ErroredShotsResult, type index_HeatmapOptions as HeatmapOptions, type index_HeatmapResponse as HeatmapResponse, index_Hotspot as Hotspot, index_HotspotOptions as HotspotOptions, index_HotspotResponse as HotspotResponse, index_LOW_CONFIDENCE_THRESHOLD as LOW_CONFIDENCE_THRESHOLD, index_MAX_CUE_TEXT_CHARS as MAX_CUE_TEXT_CHARS, index_PendingShotsResult as PendingShotsResult, index_Shot as Shot, index_ShotRequestOptions as ShotRequestOptions, index_ShotsResult as ShotsResult, type index_ThumbnailOptions as ThumbnailOptions, type index_TranscriptFetchOptions as TranscriptFetchOptions, type index_TranscriptResult as TranscriptResult, type index_VTTCue as VTTCue, type index_VTTCueBudgetChunkingOptions as VTTCueBudgetChunkingOptions, type index_VTTDurationChunk as VTTDurationChunk, type index_VTTDurationChunkingOptions as VTTDurationChunkingOptions, index_WaitForShotsOptions as WaitForShotsOptions, index_buildTranscriptUrl as buildTranscriptUrl, index_buildVttFromCueBlocks as buildVttFromCueBlocks, index_buildVttFromTranslatedCueBlocks as buildVttFromTranslatedCueBlocks, index_chunkByTokens as chunkByTokens, index_chunkText as chunkText, index_chunkVTTCues as chunkVTTCues, index_chunkVTTCuesByBudget as chunkVTTCuesByBudget, index_chunkVTTCuesByDuration as chunkVTTCuesByDuration, index_concatenateVttSegments as concatenateVttSegments, index_estimateTokenCount as estimateTokenCount, index_extractTextFromVTT as extractTextFromVTT, index_extractTimestampedTranscript as extractTimestampedTranscript, index_fetchTranscriptForAsset as fetchTranscriptForAsset, index_findCaptionTrack as findCaptionTrack, index_getHeatmapForAsset as getHeatmapForAsset, index_getHeatmapForPlaybackId as getHeatmapForPlaybackId, index_getHeatmapForVideo as getHeatmapForVideo, index_getHotspotsForAsset as getHotspotsForAsset, index_getHotspotsForPlaybackId as getHotspotsForPlaybackId, index_getHotspotsForVideo as getHotspotsForVideo, index_getReadyTextTracks as getReadyTextTracks, index_getReliableLanguageCode as getReliableLanguageCode, index_getShotsForAsset as getShotsForAsset, index_getStoryboardUrl as getStoryboardUrl, index_getThumbnailUrls as getThumbnailUrls, index_parseVTTCues as parseVTTCues, index_replaceCueText as replaceCueText, index_requestShotsForAsset as requestShotsForAsset, index_sanitizeUntrustedText as sanitizeUntrustedText, index_secondsToTimestamp as secondsToTimestamp, index_splitVttPreambleAndCueBlocks as splitVttPreambleAndCueBlocks, index_stripVttMetadataBlocks as stripVttMetadataBlocks, index_vttTimestampToSeconds as vttTimestampToSeconds, index_waitForShotsForAsset as waitForShotsForAsset };
|
|
382
|
+
export { index_CompletedShotsResult as CompletedShotsResult, index_DEFAULT_STORYBOARD_WIDTH as DEFAULT_STORYBOARD_WIDTH, index_ErroredShotsResult as ErroredShotsResult, type index_HeatmapOptions as HeatmapOptions, type index_HeatmapResponse as HeatmapResponse, index_Hotspot as Hotspot, index_HotspotOptions as HotspotOptions, index_HotspotResponse as HotspotResponse, index_LOW_CONFIDENCE_THRESHOLD as LOW_CONFIDENCE_THRESHOLD, index_MAX_CUE_TEXT_CHARS as MAX_CUE_TEXT_CHARS, index_PendingShotsResult as PendingShotsResult, index_Shot as Shot, index_ShotRequestOptions as ShotRequestOptions, index_ShotsResult as ShotsResult, type index_ThumbnailOptions as ThumbnailOptions, type index_TranscriptFetchOptions as TranscriptFetchOptions, type index_TranscriptResult as TranscriptResult, type index_VTTCue as VTTCue, type index_VTTCueBudgetChunkingOptions as VTTCueBudgetChunkingOptions, type index_VTTDurationChunk as VTTDurationChunk, type index_VTTDurationChunkingOptions as VTTDurationChunkingOptions, index_WaitForShotsOptions as WaitForShotsOptions, index_buildTranscriptUrl as buildTranscriptUrl, index_buildVttFromCueBlocks as buildVttFromCueBlocks, index_buildVttFromTranslatedCueBlocks as buildVttFromTranslatedCueBlocks, index_chunkByTokens as chunkByTokens, index_chunkText as chunkText, index_chunkVTTCues as chunkVTTCues, index_chunkVTTCuesByBudget as chunkVTTCuesByBudget, index_chunkVTTCuesByDuration as chunkVTTCuesByDuration, index_concatenateVttSegments as concatenateVttSegments, index_estimateTokenCount as estimateTokenCount, index_extractTextFromVTT as extractTextFromVTT, index_extractTimestampedTranscript as extractTimestampedTranscript, index_fetchTranscriptForAsset as fetchTranscriptForAsset, index_filterVttByScope as filterVttByScope, index_findCaptionTrack as findCaptionTrack, index_getHeatmapForAsset as getHeatmapForAsset, index_getHeatmapForPlaybackId as getHeatmapForPlaybackId, index_getHeatmapForVideo as getHeatmapForVideo, index_getHotspotsForAsset as getHotspotsForAsset, index_getHotspotsForPlaybackId as getHotspotsForPlaybackId, index_getHotspotsForVideo as getHotspotsForVideo, index_getReadyTextTracks as getReadyTextTracks, index_getReliableLanguageCode as getReliableLanguageCode, index_getShotsForAsset as getShotsForAsset, index_getStoryboardUrl as getStoryboardUrl, index_getThumbnailUrls as getThumbnailUrls, index_parseVTTCues as parseVTTCues, index_replaceCueText as replaceCueText, index_requestShotsForAsset as requestShotsForAsset, index_sanitizeUntrustedText as sanitizeUntrustedText, index_secondsToTimestamp as secondsToTimestamp, index_splitVttPreambleAndCueBlocks as splitVttPreambleAndCueBlocks, index_stripVttMetadataBlocks as stripVttMetadataBlocks, index_vttTimestampToSeconds as vttTimestampToSeconds, index_waitForShotsForAsset as waitForShotsForAsset };
|
|
369
383
|
}
|
|
370
384
|
|
|
371
|
-
export {
|
|
385
|
+
export { getReliableLanguageCode as A, getStoryboardUrl as B, getThumbnailUrls as C, DEFAULT_STORYBOARD_WIDTH as D, parseVTTCues as E, replaceCueText as F, sanitizeUntrustedText as G, type HeatmapOptions as H, secondsToTimestamp as I, splitVttPreambleAndCueBlocks as J, stripVttMetadataBlocks as K, LOW_CONFIDENCE_THRESHOLD as L, MAX_CUE_TEXT_CHARS as M, vttTimestampToSeconds as N, type ThumbnailOptions as T, type VTTCue as V, type HeatmapResponse as a, type TranscriptFetchOptions as b, type TranscriptResult as c, type VTTCueBudgetChunkingOptions as d, type VTTDurationChunk as e, type VTTDurationChunkingOptions as f, buildTranscriptUrl as g, buildVttFromCueBlocks as h, index as i, buildVttFromTranslatedCueBlocks as j, chunkByTokens as k, chunkText as l, chunkVTTCues as m, chunkVTTCuesByBudget as n, chunkVTTCuesByDuration as o, concatenateVttSegments as p, estimateTokenCount as q, extractTextFromVTT as r, extractTimestampedTranscript as s, fetchTranscriptForAsset as t, filterVttByScope as u, findCaptionTrack as v, getHeatmapForAsset as w, getHeatmapForPlaybackId as x, getHeatmapForVideo as y, getReadyTextTracks as z };
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
3
3
|
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
4
4
|
import { createOpenAI } from '@ai-sdk/openai';
|
|
5
|
-
import {
|
|
5
|
+
import { f as ScopedMuxAIOptions, I as ImageSubmissionMode, i as TokenUsage, M as MuxAIOptions, b as ChunkingStrategy, k as VideoEmbeddingsResult, H as Hotspot, v as Shot, j as ToneType, g as StorageAdapter } from './shots-Bh0GrvLx.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Language Code Conversion Utilities
|
|
@@ -249,6 +249,35 @@ interface EmbeddingModelIdByProvider {
|
|
|
249
249
|
google: GoogleEmbeddingModelId;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
/**
|
|
253
|
+
* Maximum length (in characters) of a single question. Not configurable.
|
|
254
|
+
*
|
|
255
|
+
* Reasonable human-authored questions are well under a few hundred
|
|
256
|
+
* characters; anything longer is almost certainly either a misuse
|
|
257
|
+
* (pasting a whole document) or a prompt-injection payload trying to
|
|
258
|
+
* hide instructions in a long blob. Rejecting at the boundary is a
|
|
259
|
+
* cheap, deterministic defence that the model never sees.
|
|
260
|
+
*
|
|
261
|
+
* Exported so API layers wrapping this workflow can mirror the limit in
|
|
262
|
+
* their own request validation instead of surfacing it as an
|
|
263
|
+
* asynchronous job failure.
|
|
264
|
+
*/
|
|
265
|
+
declare const ASK_QUESTIONS_MAX_QUESTION_LENGTH = 600;
|
|
266
|
+
/**
|
|
267
|
+
* Default for {@link AskQuestionsOptions.maxAnswerOptionLength}.
|
|
268
|
+
*
|
|
269
|
+
* Answer options are meant to be short labels ("yes", "no", "low",
|
|
270
|
+
* "appropriate") or domain-specific category strings (moderation
|
|
271
|
+
* labels, compliance categories). A common prompt-injection shape
|
|
272
|
+
* smuggles the payload through option content — e.g. pairing two long
|
|
273
|
+
* sentences that both presuppose the desired outcome. The cap rejects
|
|
274
|
+
* instruction-shaped options before they reach the model, while
|
|
275
|
+
* comfortably passing category labels that legitimately run 40–80
|
|
276
|
+
* characters.
|
|
277
|
+
*/
|
|
278
|
+
declare const ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH = 150;
|
|
279
|
+
/** Default for {@link AskQuestionsOptions.maxFreeFormAnswerLength}. */
|
|
280
|
+
declare const ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH = 500;
|
|
252
281
|
/** A single question to be answered about asset content. */
|
|
253
282
|
interface Question {
|
|
254
283
|
/** The question text */
|
|
@@ -278,7 +307,7 @@ interface QuestionAnswer {
|
|
|
278
307
|
skipped: boolean;
|
|
279
308
|
}
|
|
280
309
|
/** Configuration options for askQuestions workflow. */
|
|
281
|
-
interface AskQuestionsOptions extends
|
|
310
|
+
interface AskQuestionsOptions extends ScopedMuxAIOptions {
|
|
282
311
|
/** AI provider to run (defaults to 'openai'). */
|
|
283
312
|
provider?: SupportedProvider;
|
|
284
313
|
/** Provider-specific chat model identifier. */
|
|
@@ -518,7 +547,7 @@ type BurnedInCaptionsPromptSections = "task" | "analysisSteps" | "positiveIndica
|
|
|
518
547
|
*/
|
|
519
548
|
type BurnedInCaptionsPromptOverrides = PromptOverrides<BurnedInCaptionsPromptSections>;
|
|
520
549
|
/** Configuration accepted by `hasBurnedInCaptions`. */
|
|
521
|
-
interface BurnedInCaptionsOptions extends
|
|
550
|
+
interface BurnedInCaptionsOptions extends ScopedMuxAIOptions {
|
|
522
551
|
/** AI provider used for storyboard inspection (defaults to 'openai'). */
|
|
523
552
|
provider?: SupportedProvider;
|
|
524
553
|
/** Provider-specific model identifier. */
|
|
@@ -592,11 +621,11 @@ declare const chapterSchema: z.ZodObject<{
|
|
|
592
621
|
startTime: z.ZodNumber;
|
|
593
622
|
title: z.ZodString;
|
|
594
623
|
}, "strip", z.ZodTypeAny, {
|
|
595
|
-
title: string;
|
|
596
624
|
startTime: number;
|
|
597
|
-
}, {
|
|
598
625
|
title: string;
|
|
626
|
+
}, {
|
|
599
627
|
startTime: number;
|
|
628
|
+
title: string;
|
|
600
629
|
}>;
|
|
601
630
|
type Chapter = z.infer<typeof chapterSchema>;
|
|
602
631
|
declare const chaptersSchema: z.ZodObject<{
|
|
@@ -604,21 +633,21 @@ declare const chaptersSchema: z.ZodObject<{
|
|
|
604
633
|
startTime: z.ZodNumber;
|
|
605
634
|
title: z.ZodString;
|
|
606
635
|
}, "strip", z.ZodTypeAny, {
|
|
607
|
-
title: string;
|
|
608
636
|
startTime: number;
|
|
609
|
-
}, {
|
|
610
637
|
title: string;
|
|
638
|
+
}, {
|
|
611
639
|
startTime: number;
|
|
640
|
+
title: string;
|
|
612
641
|
}>, "many">;
|
|
613
642
|
}, "strip", z.ZodTypeAny, {
|
|
614
643
|
chapters: {
|
|
615
|
-
title: string;
|
|
616
644
|
startTime: number;
|
|
645
|
+
title: string;
|
|
617
646
|
}[];
|
|
618
647
|
}, {
|
|
619
648
|
chapters: {
|
|
620
|
-
title: string;
|
|
621
649
|
startTime: number;
|
|
650
|
+
title: string;
|
|
622
651
|
}[];
|
|
623
652
|
}>;
|
|
624
653
|
type ChaptersType = z.infer<typeof chaptersSchema>;
|
|
@@ -658,7 +687,7 @@ type ChaptersPromptSections = "task" | "outputFormat" | "chapterGuidelines" | "t
|
|
|
658
687
|
*/
|
|
659
688
|
type ChaptersPromptOverrides = PromptOverrides<ChaptersPromptSections>;
|
|
660
689
|
/** Configuration accepted by `generateChapters`. */
|
|
661
|
-
interface ChaptersOptions extends
|
|
690
|
+
interface ChaptersOptions extends ScopedMuxAIOptions {
|
|
662
691
|
/** BCP 47 language code of the caption track to use (e.g. "en", "fr"). When omitted, prefers English if available. */
|
|
663
692
|
languageCode?: string;
|
|
664
693
|
/** AI provider used to interpret the transcript (defaults to 'openai'). */
|
|
@@ -850,7 +879,7 @@ declare function applyReplacements(rawVtt: string, replacements: CaptionReplacem
|
|
|
850
879
|
declare function editCaptions<P extends SupportedProvider = SupportedProvider>(assetId: string, trackId: string, options: EditCaptionsOptions<P>): Promise<EditCaptionsResult>;
|
|
851
880
|
|
|
852
881
|
/** Configuration accepted by `generateEmbeddings`. */
|
|
853
|
-
interface EmbeddingsOptions extends
|
|
882
|
+
interface EmbeddingsOptions extends ScopedMuxAIOptions {
|
|
854
883
|
/** AI provider used to generate embeddings (defaults to 'openai'). */
|
|
855
884
|
provider?: SupportedEmbeddingProvider;
|
|
856
885
|
/** Provider-specific model identifier (defaults to text-embedding-3-small for OpenAI). */
|
|
@@ -1037,7 +1066,7 @@ interface HiveModerationOutput {
|
|
|
1037
1066
|
}>;
|
|
1038
1067
|
}
|
|
1039
1068
|
/** Configuration accepted by `getModerationScores`. */
|
|
1040
|
-
interface ModerationOptions extends
|
|
1069
|
+
interface ModerationOptions extends ScopedMuxAIOptions {
|
|
1041
1070
|
/** Provider used for moderation (defaults to 'openai'). */
|
|
1042
1071
|
provider?: ModerationProvider;
|
|
1043
1072
|
/** OpenAI moderation model identifier (defaults to 'omni-moderation-latest'). */
|
|
@@ -1176,7 +1205,7 @@ type SummarizationPromptSections = "task" | "title" | "description" | "keywords"
|
|
|
1176
1205
|
*/
|
|
1177
1206
|
type SummarizationPromptOverrides = PromptOverrides<SummarizationPromptSections>;
|
|
1178
1207
|
/** Configuration accepted by `getSummaryAndTags`. */
|
|
1179
|
-
interface SummarizationOptions extends
|
|
1208
|
+
interface SummarizationOptions extends ScopedMuxAIOptions {
|
|
1180
1209
|
/** AI provider to run (defaults to 'openai'). */
|
|
1181
1210
|
provider?: SupportedProvider;
|
|
1182
1211
|
/** Provider-specific chat model identifier. */
|
|
@@ -1413,6 +1442,9 @@ declare function shouldSplitChunkTranslationError(error: unknown): boolean;
|
|
|
1413
1442
|
declare function normalizeTranslatedVtt(translation: string): string;
|
|
1414
1443
|
declare function translateCaptions<P extends SupportedProvider = SupportedProvider>(assetId: string, trackId: string, toLanguageCode: string, options: TranslationOptions<P>): Promise<TranslationResult>;
|
|
1415
1444
|
|
|
1445
|
+
declare const index_ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH: typeof ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH;
|
|
1446
|
+
declare const index_ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH: typeof ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH;
|
|
1447
|
+
declare const index_ASK_QUESTIONS_MAX_QUESTION_LENGTH: typeof ASK_QUESTIONS_MAX_QUESTION_LENGTH;
|
|
1416
1448
|
type index_AskQuestionsOptions = AskQuestionsOptions;
|
|
1417
1449
|
type index_AskQuestionsResult = AskQuestionsResult;
|
|
1418
1450
|
type index_AskQuestionsType = AskQuestionsType;
|
|
@@ -1497,7 +1529,7 @@ declare const index_translateAudio: typeof translateAudio;
|
|
|
1497
1529
|
declare const index_translateCaptions: typeof translateCaptions;
|
|
1498
1530
|
declare const index_translationSchema: typeof translationSchema;
|
|
1499
1531
|
declare namespace index {
|
|
1500
|
-
export { 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, 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_GOOGLE_VISION_LIKELIHOOD_TO_SCORE as GOOGLE_VISION_LIKELIHOOD_TO_SCORE, 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_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_ReplacementRecord as ReplacementRecord, 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_ThumbnailModerationScore as ThumbnailModerationScore, 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_askQuestions as askQuestions, index_buildReplacementRegex as buildReplacementRegex, index_burnedInCaptionsSchema as burnedInCaptionsSchema, index_censorVttContent as censorVttContent, index_chapterSchema as chapterSchema, index_chaptersSchema as chaptersSchema, index_createReplacer as createReplacer, index_editCaptions as editCaptions, index_extractTranscriptSegmentsForHotspots as extractTranscriptSegmentsForHotspots, index_generateChapters as generateChapters, index_generateEmbeddings as generateEmbeddings, index_generateEngagementInsights as generateEngagementInsights, index_generateVideoEmbeddings as generateVideoEmbeddings, index_getModerationScores as getModerationScores, index_getSummaryAndTags as getSummaryAndTags, index_hasBurnedInCaptions as hasBurnedInCaptions, index_mapShotsToHotspots as mapShotsToHotspots, index_normalizeTranslatedVtt as normalizeTranslatedVtt, index_profanityDetectionSchema as profanityDetectionSchema, index_questionAnswerSchema as questionAnswerSchema, index_shouldSplitChunkTranslationError as shouldSplitChunkTranslationError, index_summarySchema as summarySchema, index_transformCueText as transformCueText, index_translateAudio as translateAudio, index_translateCaptions as translateCaptions, index_translationSchema as translationSchema };
|
|
1532
|
+
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_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, 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_GOOGLE_VISION_LIKELIHOOD_TO_SCORE as GOOGLE_VISION_LIKELIHOOD_TO_SCORE, 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_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_ReplacementRecord as ReplacementRecord, 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_ThumbnailModerationScore as ThumbnailModerationScore, 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_askQuestions as askQuestions, index_buildReplacementRegex as buildReplacementRegex, index_burnedInCaptionsSchema as burnedInCaptionsSchema, index_censorVttContent as censorVttContent, index_chapterSchema as chapterSchema, index_chaptersSchema as chaptersSchema, index_createReplacer as createReplacer, index_editCaptions as editCaptions, index_extractTranscriptSegmentsForHotspots as extractTranscriptSegmentsForHotspots, index_generateChapters as generateChapters, index_generateEmbeddings as generateEmbeddings, index_generateEngagementInsights as generateEngagementInsights, index_generateVideoEmbeddings as generateVideoEmbeddings, index_getModerationScores as getModerationScores, index_getSummaryAndTags as getSummaryAndTags, index_hasBurnedInCaptions as hasBurnedInCaptions, index_mapShotsToHotspots as mapShotsToHotspots, index_normalizeTranslatedVtt as normalizeTranslatedVtt, index_profanityDetectionSchema as profanityDetectionSchema, index_questionAnswerSchema as questionAnswerSchema, index_shouldSplitChunkTranslationError as shouldSplitChunkTranslationError, index_summarySchema as summarySchema, index_transformCueText as transformCueText, index_translateAudio as translateAudio, index_translateCaptions as translateCaptions, index_translationSchema as translationSchema };
|
|
1501
1533
|
}
|
|
1502
1534
|
|
|
1503
|
-
export { type
|
|
1535
|
+
export { type MomentInsight as $, ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as A, type BurnedInCaptionsAnalysis as B, type CaptionReplacement as C, type ChaptersPromptOverrides as D, type ChaptersPromptSections as E, type ChaptersResult as F, type ChaptersType as G, DEFAULT_DESCRIPTION_LENGTH as H, type ISO639_1 as I, DEFAULT_SUMMARY_KEYWORD_LIMIT as J, DEFAULT_TITLE_LENGTH as K, type LanguageCodePair as L, type EditCaptionsOptions as M, type EditCaptionsResult as N, type EmbeddingsOptions as O, type EmbeddingsResult as P, type EngagementInsightsOptions as Q, type EngagementInsightsResult as R, type SupportedISO639_1 as S, GOOGLE_VISION_LIKELIHOOD_TO_SCORE as T, HIVE_SEXUAL_CATEGORIES as U, HIVE_VIOLENCE_CATEGORIES as V, type HiveModerationOutput as W, type HiveModerationSource as X, type ModerationOptions as Y, type ModerationProvider as Z, type ModerationResult as _, type ISO639_3 as a, type OverallInsight as a0, type ProfanityDetectionPayload as a1, type Question as a2, type QuestionAnswer as a3, type QuestionAnswerType as a4, type ReplacementRecord as a5, type SummarizationOptions as a6, type SummarizationPromptOverrides as a7, type SummarizationPromptSections as a8, type SummaryAndTagsResult as a9, normalizeTranslatedVtt as aA, profanityDetectionSchema as aB, questionAnswerSchema as aC, shouldSplitChunkTranslationError as aD, summarySchema as aE, transformCueText as aF, translateAudio as aG, translateCaptions as aH, translationSchema as aI, type SummaryType as aa, type ThumbnailModerationScore as ab, type TranslationChunkingOptions as ac, type TranslationOptions as ad, type TranslationPayload as ae, type TranslationResult as af, aggregateTokenUsage as ag, applyOverrideLists as ah, applyReplacements as ai, askQuestions as aj, buildReplacementRegex as ak, burnedInCaptionsSchema as al, censorVttContent as am, chapterSchema as an, chaptersSchema as ao, createReplacer as ap, editCaptions as aq, extractTranscriptSegmentsForHotspots as ar, generateChapters as as, generateEmbeddings as at, generateEngagementInsights as au, generateVideoEmbeddings as av, getModerationScores as aw, getSummaryAndTags as ax, hasBurnedInCaptions as ay, mapShotsToHotspots as az, type SupportedISO639_3 as b, getLanguageName as c, isValidISO639_1 as d, isValidISO639_3 as e, toISO639_3 as f, getLanguageCodePair as g, index as h, isUndeterminedLanguageCode as i, ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as j, ASK_QUESTIONS_MAX_QUESTION_LENGTH as k, type AskQuestionsOptions as l, type AskQuestionsResult as m, type AskQuestionsType as n, type AudioTranslationOptions as o, type AudioTranslationResult as p, type AutoCensorProfanityOptions as q, type BurnedInCaptionsOptions as r, type BurnedInCaptionsPromptOverrides as s, toISO639_1 as t, type BurnedInCaptionsPromptSections as u, type BurnedInCaptionsResult as v, type CensorMode as w, type Chapter as x, type ChapterSystemPromptSections as y, type ChaptersOptions as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, S as SupportedISO639_1, b as SupportedISO639_3, g as getLanguageCodePair, c as getLanguageName, i as isUndeterminedLanguageCode, d as isValidISO639_1, e as isValidISO639_3, t as toISO639_1, f as toISO639_3, h as workflows } from './index-
|
|
2
|
-
import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './shots-
|
|
3
|
-
export { A as AssetTextTrack, C as ChunkEmbedding, b as ChunkingStrategy, E as Encrypted, c as EncryptedPayload, I as ImageSubmissionMode, M as MuxAIOptions, d as MuxAsset, P as PlaybackAsset, e as PlaybackPolicy, f as StorageAdapter, T as TextChunk,
|
|
1
|
+
export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, S as SupportedISO639_1, b as SupportedISO639_3, g as getLanguageCodePair, c as getLanguageName, i as isUndeterminedLanguageCode, d as isValidISO639_1, e as isValidISO639_3, t as toISO639_1, f as toISO639_3, h as workflows } from './index-D3cB2ltG.js';
|
|
2
|
+
import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './shots-Bh0GrvLx.js';
|
|
3
|
+
export { A as AssetTextTrack, C as ChunkEmbedding, b as ChunkingStrategy, E as Encrypted, c as EncryptedPayload, I as ImageSubmissionMode, M as MuxAIOptions, d as MuxAsset, P as PlaybackAsset, e as PlaybackPolicy, f as ScopedMuxAIOptions, g as StorageAdapter, T as TextChunk, h as TokenChunkingConfig, i as TokenUsage, j as ToneType, U as UsageMetadata, V as VTTChunkingConfig, k as VideoEmbeddingsResult, l as WorkflowCredentialsInput, m as WorkflowMuxClient, n as WorkflowScope, o as decryptFromWorkflow, p as encryptForWorkflow } from './shots-Bh0GrvLx.js';
|
|
4
4
|
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
|
|
5
|
-
export { i as primitives } from './index-
|
|
5
|
+
export { i as primitives } from './index-CJtQiGj7.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import '@ai-sdk/anthropic';
|
|
8
8
|
import '@ai-sdk/google';
|
|
9
9
|
import '@ai-sdk/openai';
|
|
10
10
|
import '@mux/mux-node';
|
|
11
11
|
|
|
12
|
-
var version = "0.
|
|
12
|
+
var version = "0.30.0";
|
|
13
13
|
|
|
14
|
-
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
|
|
14
|
+
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error" | "content_policy_error";
|
|
15
15
|
/**
|
|
16
16
|
* An error whose message is safe to surface verbatim to the customer.
|
|
17
17
|
*
|
|
@@ -38,6 +38,7 @@ declare class MuxAiError extends Error {
|
|
|
38
38
|
type?: MuxAiErrorType;
|
|
39
39
|
retryable?: boolean;
|
|
40
40
|
});
|
|
41
|
+
static is(value: unknown): value is MuxAiError;
|
|
41
42
|
}
|
|
42
43
|
declare function wrapError(error: unknown, message: string): never;
|
|
43
44
|
|