@mux/ai 0.26.0 → 0.27.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-C5zhbQHK.d.ts → index-Zwh0Bwq3.d.ts} +3 -1
- package/dist/index.d.ts +2 -28
- package/dist/index.js +266 -95
- 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 +265 -94
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1268,6 +1268,8 @@ interface AudioTranslationOptions extends MuxAIOptions {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
declare function translateAudio(assetId: string, toLanguageCode: string, options?: AudioTranslationOptions): Promise<AudioTranslationResult>;
|
|
1270
1270
|
|
|
1271
|
+
declare function aggregateTokenUsage(usages: TokenUsage[]): TokenUsage;
|
|
1272
|
+
|
|
1271
1273
|
/** Output returned from `translateCaptions`. */
|
|
1272
1274
|
interface TranslationResult {
|
|
1273
1275
|
assetId: string;
|
|
@@ -1372,8 +1374,8 @@ declare const translationSchema: z.ZodObject<{
|
|
|
1372
1374
|
}>;
|
|
1373
1375
|
/** Inferred shape returned by `translationSchema`. */
|
|
1374
1376
|
type TranslationPayload = z.infer<typeof translationSchema>;
|
|
1377
|
+
|
|
1375
1378
|
declare function shouldSplitChunkTranslationError(error: unknown): boolean;
|
|
1376
|
-
declare function aggregateTokenUsage(usages: TokenUsage[]): TokenUsage;
|
|
1377
1379
|
/**
|
|
1378
1380
|
* Normalise a model-returned VTT string for robustness against
|
|
1379
1381
|
* 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-Zwh0Bwq3.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.27.1";
|
|
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
|
/**
|