@mux/ai 0.26.0 → 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.
- package/dist/{index-C5zhbQHK.d.ts → index-DUVBpnj5.d.ts} +5 -1
- package/dist/index.d.ts +2 -28
- package/dist/index.js +271 -97
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.js +64 -5
- package/dist/primitives/index.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.js +270 -96
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1265,9 +1265,13 @@ 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
|
|
|
1273
|
+
declare function aggregateTokenUsage(usages: TokenUsage[]): TokenUsage;
|
|
1274
|
+
|
|
1271
1275
|
/** Output returned from `translateCaptions`. */
|
|
1272
1276
|
interface TranslationResult {
|
|
1273
1277
|
assetId: string;
|
|
@@ -1372,8 +1376,8 @@ declare const translationSchema: z.ZodObject<{
|
|
|
1372
1376
|
}>;
|
|
1373
1377
|
/** Inferred shape returned by `translationSchema`. */
|
|
1374
1378
|
type TranslationPayload = z.infer<typeof translationSchema>;
|
|
1379
|
+
|
|
1375
1380
|
declare function shouldSplitChunkTranslationError(error: unknown): boolean;
|
|
1376
|
-
declare function aggregateTokenUsage(usages: TokenUsage[]): TokenUsage;
|
|
1377
1381
|
/**
|
|
1378
1382
|
* Normalise a model-returned VTT string for robustness against
|
|
1379
1383
|
* provider wrapping quirks.
|
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-
|
|
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.
|
|
12
|
+
var version = "0.28.0";
|
|
13
13
|
|
|
14
14
|
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
|
|
15
15
|
/**
|
|
@@ -39,32 +39,6 @@ declare class MuxAiError extends Error {
|
|
|
39
39
|
retryable?: boolean;
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Re-throws {@link MuxAiError} instances to preserve the structural brand,
|
|
44
|
-
* wraps everything else in a plain `Error` with a contextual message.
|
|
45
|
-
*
|
|
46
|
-
* Use this in catch blocks that re-throw so a customer-safe error from a
|
|
47
|
-
* callee isn't accidentally converted into an internal error.
|
|
48
|
-
*
|
|
49
|
-
* The upstream `detail` is scrubbed for **high-confidence** signs of a
|
|
50
|
-
* system-prompt leak before being folded into the thrown message.
|
|
51
|
-
* Rationale: the AI SDK and some providers include the offending model
|
|
52
|
-
* output in their error messages (e.g. "Failed to parse structured
|
|
53
|
-
* output: { reasoning: '<role>…' }"). If an injection payload caused
|
|
54
|
-
* the parse failure, the raw output would otherwise bypass the
|
|
55
|
-
* free-text scrubber and reach the caller through the error channel.
|
|
56
|
-
*
|
|
57
|
-
* Only the `canary` and `prompt_tag` detectors trigger suppression
|
|
58
|
-
* here — they have very low false-positive rates. The `encoded_blob`
|
|
59
|
-
* heuristic is intentionally NOT applied to error messages: legitimate
|
|
60
|
-
* upstream errors from infrastructure (S3 errors containing ETags,
|
|
61
|
-
* git errors containing SHAs, AWS request IDs, content hashes) can
|
|
62
|
-
* match the encoded-blob shape without being a prompt leak. Suppressing
|
|
63
|
-
* those would erase useful debugging information with no security
|
|
64
|
-
* benefit, because an attacker exfiltrating through a shaped blob would
|
|
65
|
-
* trigger the much stronger field-level scrubber on the preceding
|
|
66
|
-
* model output.
|
|
67
|
-
*/
|
|
68
42
|
declare function wrapError(error: unknown, message: string): never;
|
|
69
43
|
|
|
70
44
|
/**
|