@mux/ai 0.16.1 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-CuBu_u5-.d.ts → index-3G00N5QH.d.ts} +26 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +331 -300
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.js +153 -6
- package/dist/primitives/index.js.map +1 -1
- package/dist/workflows/index.js +328 -299
- package/dist/workflows/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -84,6 +84,28 @@ interface TranscriptResult {
|
|
|
84
84
|
}
|
|
85
85
|
declare function getReadyTextTracks(asset: MuxAsset): AssetTextTrack[];
|
|
86
86
|
declare function findCaptionTrack(asset: MuxAsset, languageCode?: string): AssetTextTrack | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Default minimum auto-detection confidence required to trust a track's language code.
|
|
89
|
+
* Below this threshold, the language is treated as undetermined.
|
|
90
|
+
*/
|
|
91
|
+
declare const LOW_CONFIDENCE_THRESHOLD = 0.5;
|
|
92
|
+
/**
|
|
93
|
+
* Extracts a trustworthy language code from a track, returning `undefined`
|
|
94
|
+
* when the language metadata shouldn't be used as an LLM output language.
|
|
95
|
+
*
|
|
96
|
+
* Returns `undefined` when:
|
|
97
|
+
* - The track or its language code is missing
|
|
98
|
+
* - The language code is undetermined (`und`, `mul`, `mis`, `zxx`)
|
|
99
|
+
* - The language was auto-detected with confidence below the threshold
|
|
100
|
+
*
|
|
101
|
+
* Trusts the language code when:
|
|
102
|
+
* - `auto_language_confidence` is absent (manually set or non-auto tracks)
|
|
103
|
+
* - `auto_language_confidence` meets the threshold
|
|
104
|
+
*
|
|
105
|
+
* @param track - The text track to inspect
|
|
106
|
+
* @param confidenceThreshold - Minimum confidence to trust auto-detected language (default: {@link LOW_CONFIDENCE_THRESHOLD})
|
|
107
|
+
*/
|
|
108
|
+
declare function getReliableLanguageCode(track: AssetTextTrack | undefined, confidenceThreshold?: number): string | undefined;
|
|
87
109
|
declare function extractTextFromVTT(vttContent: string): string;
|
|
88
110
|
declare function vttTimestampToSeconds(timestamp: string): number;
|
|
89
111
|
/**
|
|
@@ -224,6 +246,7 @@ type index_HeatmapResponse = HeatmapResponse;
|
|
|
224
246
|
declare const index_Hotspot: typeof Hotspot;
|
|
225
247
|
declare const index_HotspotOptions: typeof HotspotOptions;
|
|
226
248
|
declare const index_HotspotResponse: typeof HotspotResponse;
|
|
249
|
+
declare const index_LOW_CONFIDENCE_THRESHOLD: typeof LOW_CONFIDENCE_THRESHOLD;
|
|
227
250
|
declare const index_PendingShotsResult: typeof PendingShotsResult;
|
|
228
251
|
declare const index_Shot: typeof Shot;
|
|
229
252
|
declare const index_ShotRequestOptions: typeof ShotRequestOptions;
|
|
@@ -257,6 +280,7 @@ declare const index_getHotspotsForAsset: typeof getHotspotsForAsset;
|
|
|
257
280
|
declare const index_getHotspotsForPlaybackId: typeof getHotspotsForPlaybackId;
|
|
258
281
|
declare const index_getHotspotsForVideo: typeof getHotspotsForVideo;
|
|
259
282
|
declare const index_getReadyTextTracks: typeof getReadyTextTracks;
|
|
283
|
+
declare const index_getReliableLanguageCode: typeof getReliableLanguageCode;
|
|
260
284
|
declare const index_getShotsForAsset: typeof getShotsForAsset;
|
|
261
285
|
declare const index_getStoryboardUrl: typeof getStoryboardUrl;
|
|
262
286
|
declare const index_getThumbnailUrls: typeof getThumbnailUrls;
|
|
@@ -268,7 +292,7 @@ declare const index_splitVttPreambleAndCueBlocks: typeof splitVttPreambleAndCueB
|
|
|
268
292
|
declare const index_vttTimestampToSeconds: typeof vttTimestampToSeconds;
|
|
269
293
|
declare const index_waitForShotsForAsset: typeof waitForShotsForAsset;
|
|
270
294
|
declare namespace index {
|
|
271
|
-
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_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_getShotsForAsset as getShotsForAsset, index_getStoryboardUrl as getStoryboardUrl, index_getThumbnailUrls as getThumbnailUrls, index_parseVTTCues as parseVTTCues, index_replaceCueText as replaceCueText, index_requestShotsForAsset as requestShotsForAsset, index_secondsToTimestamp as secondsToTimestamp, index_splitVttPreambleAndCueBlocks as splitVttPreambleAndCueBlocks, index_vttTimestampToSeconds as vttTimestampToSeconds, index_waitForShotsForAsset as waitForShotsForAsset };
|
|
295
|
+
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_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_secondsToTimestamp as secondsToTimestamp, index_splitVttPreambleAndCueBlocks as splitVttPreambleAndCueBlocks, index_vttTimestampToSeconds as vttTimestampToSeconds, index_waitForShotsForAsset as waitForShotsForAsset };
|
|
272
296
|
}
|
|
273
297
|
|
|
274
|
-
export {
|
|
298
|
+
export { getStoryboardUrl as A, getThumbnailUrls as B, parseVTTCues as C, DEFAULT_STORYBOARD_WIDTH as D, replaceCueText as E, secondsToTimestamp as F, splitVttPreambleAndCueBlocks as G, type HeatmapOptions as H, vttTimestampToSeconds as I, LOW_CONFIDENCE_THRESHOLD as L, 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, findCaptionTrack as u, getHeatmapForAsset as v, getHeatmapForPlaybackId as w, getHeatmapForVideo as x, getReadyTextTracks as y, getReliableLanguageCode as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './shots-BFYOfBgN.js';
|
|
2
2
|
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, g as TokenChunkingConfig, h as TokenUsage, i as ToneType, U as UsageMetadata, V as VTTChunkingConfig, j as VideoEmbeddingsResult, k as WorkflowCredentialsInput, l as WorkflowMuxClient, m as decryptFromWorkflow, n as encryptForWorkflow } from './shots-BFYOfBgN.js';
|
|
3
3
|
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
|
|
4
|
-
export { i as primitives } from './index-
|
|
4
|
+
export { i as primitives } from './index-3G00N5QH.js';
|
|
5
5
|
export { i as workflows } from './index-BfsJvx3r.js';
|
|
6
6
|
import '@mux/mux-node';
|
|
7
7
|
import 'zod';
|
|
@@ -9,7 +9,7 @@ import '@ai-sdk/anthropic';
|
|
|
9
9
|
import '@ai-sdk/google';
|
|
10
10
|
import '@ai-sdk/openai';
|
|
11
11
|
|
|
12
|
-
var version = "0.
|
|
12
|
+
var version = "0.17.1";
|
|
13
13
|
|
|
14
14
|
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
|
|
15
15
|
/**
|