@mux/ai 0.14.0 → 0.16.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-yn3fUDgv.d.ts → index-CXC5gAHs.d.ts} +2 -2
- package/dist/index.d.ts +40 -3
- package/dist/index.js +225 -149
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.js +30 -10
- package/dist/primitives/index.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.js +217 -144
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,6 +38,8 @@ interface EmbeddingModelIdByProvider {
|
|
|
38
38
|
interface Question {
|
|
39
39
|
/** The question text */
|
|
40
40
|
question: string;
|
|
41
|
+
/** Allowed answers for this question (defaults to ["yes", "no"]). */
|
|
42
|
+
answerOptions?: string[];
|
|
41
43
|
}
|
|
42
44
|
/** A single answer to a question. */
|
|
43
45
|
interface QuestionAnswer {
|
|
@@ -60,8 +62,6 @@ interface AskQuestionsOptions extends MuxAIOptions {
|
|
|
60
62
|
model?: ModelIdByProvider[SupportedProvider];
|
|
61
63
|
/** BCP 47 language code of the caption track to use (e.g. "en", "fr"). When omitted, prefers English if available. */
|
|
62
64
|
languageCode?: string;
|
|
63
|
-
/** Allowed answers for each question (defaults to ["yes", "no"]). */
|
|
64
|
-
answerOptions?: string[];
|
|
65
65
|
/** Fetch transcript alongside storyboard (defaults to true, required for audio-only assets). */
|
|
66
66
|
includeTranscript?: boolean;
|
|
67
67
|
/** Strip timestamps/markup from transcripts (defaults to true). */
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,51 @@ import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresi
|
|
|
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
4
|
export { i as primitives } from './index-CuBu_u5-.js';
|
|
5
|
-
export { i as workflows } from './index-
|
|
5
|
+
export { i as workflows } from './index-CXC5gAHs.js';
|
|
6
6
|
import '@mux/mux-node';
|
|
7
7
|
import 'zod';
|
|
8
8
|
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.16.0";
|
|
13
|
+
|
|
14
|
+
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
|
|
15
|
+
/**
|
|
16
|
+
* An error whose message is safe to surface verbatim to the customer.
|
|
17
|
+
*
|
|
18
|
+
* Uses a structural brand (`__robots_error = true`) so that downstream
|
|
19
|
+
* consumers can identify customer-safe errors via duck typing — no
|
|
20
|
+
* shared dependency required. Errors from @mux/ai that DON'T carry
|
|
21
|
+
* this brand (unexpected SDK failures, upstream provider errors, etc.)
|
|
22
|
+
* should be treated as internal and obfuscated.
|
|
23
|
+
*
|
|
24
|
+
* Own properties (`publicMessage`, `publicType`, `retryable`) survive
|
|
25
|
+
* JSON serialization across workflow step boundaries, unlike inherited
|
|
26
|
+
* `Error.message`.
|
|
27
|
+
*/
|
|
28
|
+
declare class MuxAiError extends Error {
|
|
29
|
+
/** Structural brand for duck-type identification. */
|
|
30
|
+
readonly __robots_error = true;
|
|
31
|
+
/** Error category shown in the API response. */
|
|
32
|
+
readonly publicType: MuxAiErrorType;
|
|
33
|
+
/** Customer-facing message. Must be safe to show verbatim. */
|
|
34
|
+
readonly publicMessage: string;
|
|
35
|
+
/** Whether the customer should retry the job. */
|
|
36
|
+
readonly retryable: boolean;
|
|
37
|
+
constructor(message: string, opts?: {
|
|
38
|
+
type?: MuxAiErrorType;
|
|
39
|
+
retryable?: boolean;
|
|
40
|
+
});
|
|
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
|
+
declare function wrapError(error: unknown, message: string): never;
|
|
13
50
|
|
|
14
51
|
/**
|
|
15
52
|
* A function that returns workflow credentials, either synchronously or asynchronously.
|
|
@@ -45,4 +82,4 @@ declare class WorkflowStorageClient {
|
|
|
45
82
|
}
|
|
46
83
|
declare function createWorkflowStorageClient(options?: WorkflowStorageClientOptions): WorkflowStorageClient;
|
|
47
84
|
|
|
48
|
-
export { StoragePresignGetObjectInput, StoragePutObjectInput, WorkflowCredentials, type WorkflowCredentialsProvider, WorkflowStorageClient, createWorkflowStorageClient, setWorkflowCredentialsProvider, version };
|
|
85
|
+
export { MuxAiError, type MuxAiErrorType, StoragePresignGetObjectInput, StoragePutObjectInput, WorkflowCredentials, type WorkflowCredentialsProvider, WorkflowStorageClient, createWorkflowStorageClient, setWorkflowCredentialsProvider, version, wrapError };
|