@mux/ai 0.53.0 → 0.54.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/dist/{index-BbxJ0X25.d.ts → index-CmTC1w4V.d.ts} +10 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.js +10 -2
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1488,8 +1488,9 @@ type ThumbnailModerationSkipReason = "no_video_track" | "no_video_in_scope";
|
|
|
1488
1488
|
* body was empty, had no parseable cues, or no cue fell inside `scope`.
|
|
1489
1489
|
* Treated as valid-but-empty, not as an error.
|
|
1490
1490
|
* - `"unsupported_provider"` — the selected provider is image-only.
|
|
1491
|
+
* - `"disabled"` — the caller passed `includeTranscript: false` for a video asset.
|
|
1491
1492
|
*/
|
|
1492
|
-
type TranscriptModerationSkipReason = "no_ready_text_track" | "no_cues" | "unsupported_provider";
|
|
1493
|
+
type TranscriptModerationSkipReason = "no_ready_text_track" | "no_cues" | "unsupported_provider" | "disabled";
|
|
1493
1494
|
type ThumbnailModerationStatus = ModerationSurfaceStatus<ThumbnailModerationSkipReason>;
|
|
1494
1495
|
type TranscriptModerationStatus = ModerationSurfaceStatus<TranscriptModerationSkipReason>;
|
|
1495
1496
|
/** Aggregated moderation payload returned from `getModerationScores`. */
|
|
@@ -1575,6 +1576,12 @@ interface ModerationOptions extends ScopedMuxAIOptions {
|
|
|
1575
1576
|
* subtitles track is preferred and otherwise the first ready text track is used.
|
|
1576
1577
|
*/
|
|
1577
1578
|
languageCode?: string;
|
|
1579
|
+
/**
|
|
1580
|
+
* Moderate the caption transcript alongside thumbnails (defaults to true). When false,
|
|
1581
|
+
* video assets are moderated on thumbnails only. Ignored for audio-only assets, where
|
|
1582
|
+
* the transcript is the only surface that can be moderated.
|
|
1583
|
+
*/
|
|
1584
|
+
includeTranscript?: boolean;
|
|
1578
1585
|
/** Override the default sexual/violence thresholds (0-1). */
|
|
1579
1586
|
thresholds?: {
|
|
1580
1587
|
sexual?: number;
|
|
@@ -1654,7 +1661,8 @@ declare function buildTranscriptWindows(cues: VTTCue[], duration: number): Trans
|
|
|
1654
1661
|
* Moderate a Mux asset. By default both surfaces are moderated where available:
|
|
1655
1662
|
* - Thumbnails: sampled storyboard frames (image moderation). Skipped for audio-only assets.
|
|
1656
1663
|
* - Transcript: caption text in time windows (text moderation). Skipped when no
|
|
1657
|
-
* usable caption track exists
|
|
1664
|
+
* usable caption track exists, the provider is image-only, or `includeTranscript`
|
|
1665
|
+
* is false for a video asset.
|
|
1658
1666
|
*
|
|
1659
1667
|
* Each surface reports its outcome in `thumbnailModeration` / `transcriptModeration`.
|
|
1660
1668
|
* Throws when neither surface can be moderated, since a result with nothing
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, M as MUX_TRACK_PASSTHROUGH_MAX_CHARS, R as ReplaceAndCreateTextTrackInput, b as ReplaceAndCreateTextTrackResult, c as ReplaceAndCreateTrackInput, d as ReplaceExistingTracksPolicy, e as ReplaceSourceTrackInput, f as ReplaceableTrackType, S as SourceTrackReplacementPolicy, g as SupportedISO639_1, h as SupportedISO639_3, T as TextTrackReplacementPlan, i as TextTrackSummary, j as TextTrackTarget, k as TrackSummary, l as TrackTarget, m as buildMuxAiTrackPassthrough, n as findNameCollisionTextTracks, o as findSameLanguageTextTracks, p as getLanguageCodePair, q as getLanguageName, r as isDuplicateTrackNameError, s as isMuxGeneratedTextTrack, t as isUndeterminedLanguageCode, u as isValidISO639_1, v as isValidISO639_3, w as normalizeTrackLanguageCode, x as normalizeTrackName, y as planSourceTrackReplacement, z as planTextTrackReplacement, A as replaceAndCreateTextTrack, B as replaceAndCreateTrack, C as replaceSourceTrack, D as summarizeTextTrack, E as toISO639_1, F as toISO639_3, G as validateTrackPassthrough, H as workflows } from './index-
|
|
1
|
+
export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, M as MUX_TRACK_PASSTHROUGH_MAX_CHARS, R as ReplaceAndCreateTextTrackInput, b as ReplaceAndCreateTextTrackResult, c as ReplaceAndCreateTrackInput, d as ReplaceExistingTracksPolicy, e as ReplaceSourceTrackInput, f as ReplaceableTrackType, S as SourceTrackReplacementPolicy, g as SupportedISO639_1, h as SupportedISO639_3, T as TextTrackReplacementPlan, i as TextTrackSummary, j as TextTrackTarget, k as TrackSummary, l as TrackTarget, m as buildMuxAiTrackPassthrough, n as findNameCollisionTextTracks, o as findSameLanguageTextTracks, p as getLanguageCodePair, q as getLanguageName, r as isDuplicateTrackNameError, s as isMuxGeneratedTextTrack, t as isUndeterminedLanguageCode, u as isValidISO639_1, v as isValidISO639_3, w as normalizeTrackLanguageCode, x as normalizeTrackName, y as planSourceTrackReplacement, z as planTextTrackReplacement, A as replaceAndCreateTextTrack, B as replaceAndCreateTrack, C as replaceSourceTrack, D as summarizeTextTrack, E as toISO639_1, F as toISO639_3, G as validateTrackPassthrough, H as workflows } from './index-CmTC1w4V.js';
|
|
2
2
|
import { M as MuxAsset, W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './transcripts-BCtzC8hZ.js';
|
|
3
3
|
export { A as AssetTextTrack, C as ChunkEmbedding, b as ChunkingStrategy, E as Encrypted, c as EncryptedPayload, I as ImageSubmissionMode, d as MuxAIOptions, 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 './transcripts-BCtzC8hZ.js';
|
|
4
4
|
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
|
|
@@ -11,7 +11,7 @@ import '@ai-sdk/google';
|
|
|
11
11
|
import '@ai-sdk/openai';
|
|
12
12
|
import '@mux/ts';
|
|
13
13
|
|
|
14
|
-
var version = "0.
|
|
14
|
+
var version = "0.54.0";
|
|
15
15
|
|
|
16
16
|
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error" | "content_policy_error";
|
|
17
17
|
/**
|
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.
|
|
8
|
+
var version = "0.54.0";
|
|
9
9
|
|
|
10
10
|
// src/lib/language-codes.ts
|
|
11
11
|
var ISO639_1_TO_3 = {
|
|
@@ -8199,6 +8199,7 @@ async function getModerationScores(assetId, options = {}) {
|
|
|
8199
8199
|
provider = DEFAULT_PROVIDER2,
|
|
8200
8200
|
model = provider === "openai" ? "omni-moderation-latest" : void 0,
|
|
8201
8201
|
languageCode,
|
|
8202
|
+
includeTranscript = true,
|
|
8202
8203
|
thresholds = DEFAULT_THRESHOLDS,
|
|
8203
8204
|
thumbnailInterval = 10,
|
|
8204
8205
|
thumbnailWidth = 640,
|
|
@@ -8279,8 +8280,15 @@ async function getModerationScores(assetId, options = {}) {
|
|
|
8279
8280
|
let transcriptModeration = { status: "completed" };
|
|
8280
8281
|
let transcriptCues = [];
|
|
8281
8282
|
let shouldRunTranscript = false;
|
|
8282
|
-
const
|
|
8283
|
-
|
|
8283
|
+
const transcriptEnabled = includeTranscript || isAudioOnly;
|
|
8284
|
+
const captionTrack = transcriptEnabled && provider === "openai" ? findCaptionTrack(asset, languageCode) : void 0;
|
|
8285
|
+
if (!transcriptEnabled) {
|
|
8286
|
+
transcriptModeration = {
|
|
8287
|
+
status: "skipped",
|
|
8288
|
+
skipReason: "disabled",
|
|
8289
|
+
skipMessage: "Transcript moderation was disabled with includeTranscript: false."
|
|
8290
|
+
};
|
|
8291
|
+
} else if (provider !== "openai") {
|
|
8284
8292
|
transcriptModeration = {
|
|
8285
8293
|
status: "skipped",
|
|
8286
8294
|
skipReason: "unsupported_provider",
|