@mux/ai 0.27.1 → 0.28.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.
@@ -1265,6 +1265,8 @@ interface AudioTranslationOptions extends MuxAIOptions {
1265
1265
  storageAdapter?: StorageAdapter;
1266
1266
  /** Expiry duration in seconds for S3 presigned GET URLs. Defaults to 86400 (24 hours). */
1267
1267
  s3SignedUrlExpirySeconds?: number;
1268
+ /** Maximum time in seconds to wait before timing out. Defaults to 7200 (2 hours). */
1269
+ dubbingPollTimeoutSeconds?: number;
1268
1270
  }
1269
1271
  declare function translateAudio(assetId: string, toLanguageCode: string, options?: AudioTranslationOptions): Promise<AudioTranslationResult>;
1270
1272
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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-Zwh0Bwq3.js';
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-DUVBpnj5.js';
2
2
  import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './shots-mGJfYGiO.js';
3
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, 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-mGJfYGiO.js';
4
4
  import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
@@ -9,7 +9,7 @@ import '@ai-sdk/google';
9
9
  import '@ai-sdk/openai';
10
10
  import '@mux/mux-node';
11
11
 
12
- var version = "0.27.1";
12
+ var version = "0.28.0";
13
13
 
14
14
  type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
15
15
  /**
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.27.1";
8
+ var version = "0.28.0";
9
9
 
10
10
  // src/lib/language-codes.ts
11
11
  var ISO639_1_TO_3 = {
@@ -6589,6 +6589,8 @@ async function getSummaryAndTagsInternal(assetId, options, collectedUsage) {
6589
6589
  import { sleep as sleep2 } from "workflow";
6590
6590
  var STATIC_RENDITION_POLL_INTERVAL_MS = 5e3;
6591
6591
  var STATIC_RENDITION_MAX_ATTEMPTS = 36;
6592
+ var DUBBING_POLL_INTERVAL_MS = 1e4;
6593
+ var DEFAULT_DUBBING_POLL_TIMEOUT_SECONDS = 7200;
6592
6594
  function getReadyAudioStaticRendition(asset) {
6593
6595
  const files = asset.static_renditions?.files;
6594
6596
  if (!files || files.length === 0) {
@@ -6871,12 +6873,13 @@ async function translateAudio(assetId, toLanguageCode, options = {}) {
6871
6873
  wrapError(error, "Failed to create ElevenLabs dubbing job");
6872
6874
  }
6873
6875
  console.warn("\u23F3 Waiting for dubbing to complete...");
6876
+ const dubbingPollTimeoutSeconds = options.dubbingPollTimeoutSeconds ?? DEFAULT_DUBBING_POLL_TIMEOUT_SECONDS;
6877
+ const maxPollAttempts = Math.max(1, Math.ceil(dubbingPollTimeoutSeconds * 1e3 / DUBBING_POLL_INTERVAL_MS));
6874
6878
  let dubbingStatus = "dubbing";
6875
6879
  let pollAttempts = 0;
6876
- const maxPollAttempts = 180;
6877
6880
  let targetLanguages = [];
6878
6881
  while (dubbingStatus !== "dubbed" && pollAttempts < maxPollAttempts) {
6879
- await sleep2(1e4);
6882
+ await sleep2(DUBBING_POLL_INTERVAL_MS);
6880
6883
  pollAttempts++;
6881
6884
  try {
6882
6885
  const statusResult = await checkElevenLabsDubbingStatus({