@mux/ai 0.6.0 → 0.7.2

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/README.md CHANGED
@@ -96,6 +96,9 @@ S3_SECRET_ACCESS_KEY=your-secret-key
96
96
 
97
97
  All workflows are compatible with [Workflow DevKit](https://useworkflow.dev). The workflows in this SDK are exported with `"use workflow"` directives and `"use step"` directives in the code.
98
98
 
99
+ Workflow DevKit serializes workflow inputs/outputs for observability. To avoid sending plaintext secrets through `start(...)`, encrypt credentials in the trigger host and decrypt them in workflow steps.
100
+ See the dedicated [Workflow Encryption guide](./docs/WORKFLOW-ENCRYPTION.md) for full setup and patterns.
101
+
99
102
  If you are using Workflow DevKit in your project, then you must call workflow functions like this:
100
103
 
101
104
  ```ts
@@ -109,18 +112,23 @@ const run = await start(getSummaryAndTags, [assetId]);
109
112
  // const result = await run.returnValue
110
113
  ```
111
114
 
112
- ### Multi-tenant credentials with Workflow Dev Kit (interim encryption pattern)
115
+ ### Multi-tenant credentials with Workflow Dev Kit
116
+
117
+ Set a shared workflow secret key (base64-encoded 32-byte value) in your environment:
118
+
119
+ ```bash
120
+ MUX_AI_WORKFLOW_SECRET_KEY=your_base64_32_byte_key
121
+ ```
113
122
 
114
- Workflow Dev Kit serializes workflow inputs and step I/O. Do not pass plaintext secrets through
115
- `start()`. Instead, encrypt credentials in userland and pass ciphertext only.
116
- Set `MUX_AI_WORKFLOW_SECRET_KEY` to a base64-encoded 32-byte key on the workflow execution host.
123
+ Then encrypt credentials before calling `start()`:
117
124
 
118
125
  ```ts
119
126
  import { start } from "workflow/api";
120
- import { encryptForWorkflow, getSummaryAndTags } from "@mux/ai/workflows";
127
+ import { encryptForWorkflow } from "@mux/ai";
128
+ import { getSummaryAndTags } from "@mux/ai/workflows";
121
129
 
122
130
  const workflowKey = process.env.MUX_AI_WORKFLOW_SECRET_KEY!;
123
- const encryptedCredentials = encryptForWorkflow(
131
+ const encryptedCredentials = await encryptForWorkflow(
124
132
  {
125
133
  muxTokenId: "mux-token-id",
126
134
  muxTokenSecret: "mux-token-secret",
@@ -131,33 +139,27 @@ const encryptedCredentials = encryptForWorkflow(
131
139
 
132
140
  const run = await start(getSummaryAndTags, [
133
141
  "your-asset-id",
134
- { provider: "openai", credentials: encryptedCredentials },
142
+ {
143
+ provider: "openai",
144
+ credentials: encryptedCredentials,
145
+ },
135
146
  ]);
136
147
  ```
137
148
 
138
- If you build custom steps, decrypt inside the step using the same workflow key:
139
-
140
- ```ts
141
- import { decryptFromWorkflow } from "@mux/ai/workflows";
142
-
143
- async function resolveCredentials(encrypted: unknown) {
144
- "use step";
145
- return decryptFromWorkflow(
146
- encrypted as any,
147
- process.env.MUX_AI_WORKFLOW_SECRET_KEY!,
148
- );
149
- }
150
- ```
149
+ For Mux tokens specifically, `setWorkflowCredentialsProvider(...)` (or environment variables) is still recommended so raw Mux secrets are never embedded in workflow input payloads.
151
150
 
152
- You can also register a credential provider on the execution host to resolve secrets inside steps:
151
+ You can also register a credential provider on the execution host to resolve secrets inside steps.
152
+ This is useful for dynamic key resolution, e.g. rotating keys or per-tenant secrets:
153
153
 
154
154
  ```ts
155
- import { setWorkflowCredentialsProvider } from "@mux/ai/workflows";
155
+ import {
156
+ setWorkflowCredentialsProvider,
157
+ } from "@mux/ai";
156
158
 
157
159
  setWorkflowCredentialsProvider(async () => ({
158
160
  muxTokenId: "mux-token-id",
159
161
  muxTokenSecret: "mux-token-secret",
160
- openaiApiKey: "openai-api-key",
162
+ openaiApiKey: await getOpenAIKeyForTenant(),
161
163
  }));
162
164
  ```
163
165
 
@@ -467,6 +469,8 @@ S3_SECRET_ACCESS_KEY=your-r2-secret-key
467
469
 
468
470
  - **[Workflows Guide](./docs/WORKFLOWS.md)** - Detailed guide to each pre-built workflow with examples
469
471
  - **[API Reference](./docs/API.md)** - Complete API documentation for all functions, parameters, and return types
472
+ - **[Workflow Encryption](./docs/WORKFLOW-ENCRYPTION.md)** - Encrypting credentials across Workflow DevKit boundaries
473
+ - **[Storage Adapters](./docs/STORAGE-ADAPTERS.md)** - Using custom storage SDKs (AWS, Cloudflare R2, MinIO)
470
474
  - **[Primitives Guide](./docs/PRIMITIVES.md)** - Low-level building blocks for custom workflows
471
475
  - **[Examples](./docs/EXAMPLES.md)** - Running examples from the repository
472
476
 
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { createAnthropic } from '@ai-sdk/anthropic';
3
3
  import { createGoogleGenerativeAI } from '@ai-sdk/google';
4
4
  import { createOpenAI } from '@ai-sdk/openai';
5
- import { M as MuxAIOptions, I as ImageSubmissionMode, k as TokenUsage, C as ChunkingStrategy, j as VideoEmbeddingsResult, T as ToneType } from './types-CqjLMB84.js';
5
+ import { M as MuxAIOptions, I as ImageSubmissionMode, h as TokenUsage, b as ChunkingStrategy, j as VideoEmbeddingsResult, i as ToneType, f as StorageAdapter } from './types-BQVi_wnh.js';
6
6
 
7
7
  interface ImageDownloadOptions {
8
8
  /** Request timeout in milliseconds (default: 10000) */
@@ -369,6 +369,7 @@ interface ThumbnailModerationScore {
369
369
  sexual: number;
370
370
  violence: number;
371
371
  error: boolean;
372
+ errorMessage?: string;
372
373
  }
373
374
  /** Aggregated moderation payload returned from `getModerationScores`. */
374
375
  interface ModerationResult {
@@ -651,8 +652,8 @@ interface AudioTranslationOptions extends MuxAIOptions {
651
652
  * bucket and attached to the Mux asset.
652
653
  */
653
654
  uploadToMux?: boolean;
654
- /** Override for env.ELEVENLABS_API_KEY. */
655
- elevenLabsApiKey?: string;
655
+ /** Optional storage adapter override for upload + presign operations. */
656
+ storageAdapter?: StorageAdapter;
656
657
  }
657
658
  declare function translateAudio(assetId: string, toLanguageCode: string, options?: AudioTranslationOptions): Promise<AudioTranslationResult>;
658
659
 
@@ -697,6 +698,8 @@ interface TranslationOptions<P extends SupportedProvider = SupportedProvider> ex
697
698
  * bucket and attached to the Mux asset.
698
699
  */
699
700
  uploadToMux?: boolean;
701
+ /** Optional storage adapter override for upload + presign operations. */
702
+ storageAdapter?: StorageAdapter;
700
703
  }
701
704
  /** Schema used when requesting caption translation from a language model. */
702
705
  declare const translationSchema: z.ZodObject<{
@@ -766,4 +769,4 @@ declare namespace index {
766
769
  export { type index_AskQuestionsOptions as AskQuestionsOptions, type index_AskQuestionsResult as AskQuestionsResult, type index_AskQuestionsType as AskQuestionsType, type index_AudioTranslationOptions as AudioTranslationOptions, type index_AudioTranslationResult as AudioTranslationResult, type index_BurnedInCaptionsAnalysis as BurnedInCaptionsAnalysis, type index_BurnedInCaptionsOptions as BurnedInCaptionsOptions, type index_BurnedInCaptionsPromptOverrides as BurnedInCaptionsPromptOverrides, type index_BurnedInCaptionsPromptSections as BurnedInCaptionsPromptSections, type index_BurnedInCaptionsResult as BurnedInCaptionsResult, type index_Chapter as Chapter, type index_ChapterSystemPromptSections as ChapterSystemPromptSections, type index_ChaptersOptions as ChaptersOptions, type index_ChaptersPromptOverrides as ChaptersPromptOverrides, type index_ChaptersPromptSections as ChaptersPromptSections, type index_ChaptersResult as ChaptersResult, type index_ChaptersType as ChaptersType, type index_EmbeddingsOptions as EmbeddingsOptions, type index_EmbeddingsResult as EmbeddingsResult, type index_HiveModerationOutput as HiveModerationOutput, type index_HiveModerationSource as HiveModerationSource, type index_ModerationOptions as ModerationOptions, type index_ModerationProvider as ModerationProvider, type index_ModerationResult as ModerationResult, type index_Question as Question, type index_QuestionAnswer as QuestionAnswer, type index_QuestionAnswerType as QuestionAnswerType, index_SUMMARY_KEYWORD_LIMIT as SUMMARY_KEYWORD_LIMIT, type index_SummarizationOptions as SummarizationOptions, type index_SummarizationPromptOverrides as SummarizationPromptOverrides, type index_SummarizationPromptSections as SummarizationPromptSections, type index_SummaryAndTagsResult as SummaryAndTagsResult, type index_SummaryType as SummaryType, type index_ThumbnailModerationScore as ThumbnailModerationScore, type index_TranslationOptions as TranslationOptions, type index_TranslationPayload as TranslationPayload, type index_TranslationResult as TranslationResult, index_askQuestions as askQuestions, index_burnedInCaptionsSchema as burnedInCaptionsSchema, index_chapterSchema as chapterSchema, index_chaptersSchema as chaptersSchema, index_generateChapters as generateChapters, index_generateEmbeddings as generateEmbeddings, index_generateVideoEmbeddings as generateVideoEmbeddings, index_getModerationScores as getModerationScores, index_getSummaryAndTags as getSummaryAndTags, index_hasBurnedInCaptions as hasBurnedInCaptions, index_questionAnswerSchema as questionAnswerSchema, index_summarySchema as summarySchema, index_translateAudio as translateAudio, index_translateCaptions as translateCaptions, index_translationSchema as translationSchema };
767
770
  }
768
771
 
769
- export { type AskQuestionsOptions as A, type BurnedInCaptionsResult as B, type Chapter as C, type HiveModerationOutput as D, type EmbeddingsOptions as E, type ModerationOptions as F, getModerationScores as G, type HiveModerationSource as H, summarySchema as I, type SummaryType as J, type SummaryAndTagsResult as K, type SummarizationPromptSections as L, type ModerationResult as M, type SummarizationPromptOverrides as N, type SummarizationOptions as O, getSummaryAndTags as P, type Question as Q, type AudioTranslationResult as R, SUMMARY_KEYWORD_LIMIT as S, type ThumbnailModerationScore as T, type AudioTranslationOptions as U, translateAudio as V, type TranslationResult as W, type TranslationOptions as X, translationSchema as Y, type TranslationPayload as Z, translateCaptions as _, type QuestionAnswer as a, type AskQuestionsResult as b, type QuestionAnswerType as c, type AskQuestionsType as d, askQuestions as e, type BurnedInCaptionsPromptSections as f, type BurnedInCaptionsPromptOverrides as g, type BurnedInCaptionsOptions as h, index as i, burnedInCaptionsSchema as j, type BurnedInCaptionsAnalysis as k, hasBurnedInCaptions as l, chapterSchema as m, chaptersSchema as n, type ChaptersType as o, type ChaptersResult as p, questionAnswerSchema as q, type ChaptersPromptSections as r, type ChaptersPromptOverrides as s, type ChaptersOptions as t, type ChapterSystemPromptSections as u, generateChapters as v, type EmbeddingsResult as w, generateEmbeddings as x, generateVideoEmbeddings as y, type ModerationProvider as z };
772
+ export { type AskQuestionsOptions as A, type BurnedInCaptionsAnalysis as B, type Chapter as C, type TranslationOptions as D, type EmbeddingsOptions as E, type TranslationPayload as F, type TranslationResult as G, type HiveModerationOutput as H, askQuestions as I, burnedInCaptionsSchema as J, chapterSchema as K, chaptersSchema as L, type ModerationOptions as M, generateChapters as N, generateEmbeddings as O, generateVideoEmbeddings as P, type Question as Q, getModerationScores as R, SUMMARY_KEYWORD_LIMIT as S, type ThumbnailModerationScore as T, getSummaryAndTags as U, hasBurnedInCaptions as V, questionAnswerSchema as W, summarySchema as X, translateAudio as Y, translateCaptions as Z, translationSchema as _, type AskQuestionsResult as a, type AskQuestionsType as b, type AudioTranslationOptions as c, type AudioTranslationResult as d, type BurnedInCaptionsOptions as e, type BurnedInCaptionsPromptOverrides as f, type BurnedInCaptionsPromptSections as g, type BurnedInCaptionsResult as h, index as i, type ChapterSystemPromptSections as j, type ChaptersOptions as k, type ChaptersPromptOverrides as l, type ChaptersPromptSections as m, type ChaptersResult as n, type ChaptersType as o, type EmbeddingsResult as p, type HiveModerationSource as q, type ModerationProvider as r, type ModerationResult as s, type QuestionAnswer as t, type QuestionAnswerType as u, type SummarizationOptions as v, type SummarizationPromptOverrides as w, type SummarizationPromptSections as x, type SummaryAndTagsResult as y, type SummaryType as z };
@@ -1,4 +1,103 @@
1
- import { b as WorkflowCredentialsInput, A as AssetTextTrack, c as MuxAsset, h as TextChunk, C as ChunkingStrategy } from './types-CqjLMB84.js';
1
+ import { k as WorkflowCredentialsInput, A as AssetTextTrack, d as MuxAsset, T as TextChunk, b as ChunkingStrategy } from './types-BQVi_wnh.js';
2
+
3
+ interface HeatmapOptions {
4
+ /** Time window for results, e.g., ['7:days'] (default: ['7:days']) */
5
+ timeframe?: string;
6
+ /** Optional workflow credentials */
7
+ credentials?: WorkflowCredentialsInput;
8
+ }
9
+ interface HeatmapResponse {
10
+ assetId?: string;
11
+ videoId?: string;
12
+ playbackId?: string;
13
+ /** Array of 100 values representing engagement for each 1/100th of the video */
14
+ heatmap: number[];
15
+ timeframe: [number, number];
16
+ }
17
+ /**
18
+ * Fetches engagement heatmap for a Mux asset.
19
+ * Returns a length 100 array where each value represents how many times
20
+ * that 1/100th of the video was watched.
21
+ *
22
+ * @param assetId - The Mux asset ID
23
+ * @param options - Heatmap query options
24
+ * @returns Heatmap data with 100 engagement values
25
+ */
26
+ declare function getHeatmapForAsset(assetId: string, options?: HeatmapOptions): Promise<HeatmapResponse>;
27
+ /**
28
+ * Fetches engagement heatmap for a Mux video ID.
29
+ * Returns a length 100 array where each value represents how many times
30
+ * that 1/100th of the video was watched.
31
+ *
32
+ * @param videoId - The Mux video ID
33
+ * @param options - Heatmap query options
34
+ * @returns Heatmap data with 100 engagement values
35
+ */
36
+ declare function getHeatmapForVideo(videoId: string, options?: HeatmapOptions): Promise<HeatmapResponse>;
37
+ /**
38
+ * Fetches engagement heatmap for a Mux playback ID.
39
+ * Returns a length 100 array where each value represents how many times
40
+ * that 1/100th of the video was watched.
41
+ *
42
+ * @param playbackId - The Mux playback ID
43
+ * @param options - Heatmap query options
44
+ * @returns Heatmap data with 100 engagement values
45
+ */
46
+ declare function getHeatmapForPlaybackId(playbackId: string, options?: HeatmapOptions): Promise<HeatmapResponse>;
47
+
48
+ interface Hotspot {
49
+ /** Inclusive start time in milliseconds */
50
+ startMs: number;
51
+ /** Exclusive end time in milliseconds */
52
+ endMs: number;
53
+ /** Hotspot score using distribution-based normalization (0-1) */
54
+ score: number;
55
+ }
56
+ interface HotspotOptions {
57
+ /** Maximum number of hotspots to return (default: 5) */
58
+ limit?: number;
59
+ /** Sort order: 'asc' or 'desc' (default: 'desc') */
60
+ orderDirection?: "asc" | "desc";
61
+ /** Order by field (default: 'score') */
62
+ orderBy?: "score";
63
+ /** Time window for results, e.g., ['7:days'] (default: ['7:days']) */
64
+ timeframe?: string;
65
+ /** Optional workflow credentials */
66
+ credentials?: WorkflowCredentialsInput;
67
+ }
68
+ interface HotspotResponse {
69
+ assetId?: string;
70
+ videoId?: string;
71
+ playbackId?: string;
72
+ hotspots: Hotspot[];
73
+ }
74
+ /**
75
+ * Fetches engagement hotspots for a Mux asset.
76
+ * Returns the top N "hot" time ranges based on engagement data.
77
+ *
78
+ * @param assetId - The Mux asset ID
79
+ * @param options - Hotspot query options
80
+ * @returns Array of hotspots with time ranges and scores
81
+ */
82
+ declare function getHotspotsForAsset(assetId: string, options?: HotspotOptions): Promise<Hotspot[]>;
83
+ /**
84
+ * Fetches engagement hotspots for a Mux video ID.
85
+ * Returns the top N "hot" time ranges based on engagement data.
86
+ *
87
+ * @param videoId - The Mux video ID
88
+ * @param options - Hotspot query options
89
+ * @returns Array of hotspots with time ranges and scores
90
+ */
91
+ declare function getHotspotsForVideo(videoId: string, options?: HotspotOptions): Promise<Hotspot[]>;
92
+ /**
93
+ * Fetches engagement hotspots for a Mux playback ID.
94
+ * Returns the top N "hot" time ranges based on engagement data.
95
+ *
96
+ * @param playbackId - The Mux playback ID
97
+ * @param options - Hotspot query options
98
+ * @returns Array of hotspots with time ranges and scores
99
+ */
100
+ declare function getHotspotsForPlaybackId(playbackId: string, options?: HotspotOptions): Promise<Hotspot[]>;
2
101
 
3
102
  declare const DEFAULT_STORYBOARD_WIDTH = 640;
4
103
  /**
@@ -127,6 +226,11 @@ interface ThumbnailOptions {
127
226
  declare function getThumbnailUrls(playbackId: string, duration: number, options?: ThumbnailOptions): Promise<string[]>;
128
227
 
129
228
  declare const index_DEFAULT_STORYBOARD_WIDTH: typeof DEFAULT_STORYBOARD_WIDTH;
229
+ type index_HeatmapOptions = HeatmapOptions;
230
+ type index_HeatmapResponse = HeatmapResponse;
231
+ type index_Hotspot = Hotspot;
232
+ type index_HotspotOptions = HotspotOptions;
233
+ type index_HotspotResponse = HotspotResponse;
130
234
  type index_ThumbnailOptions = ThumbnailOptions;
131
235
  type index_TranscriptFetchOptions = TranscriptFetchOptions;
132
236
  type index_TranscriptResult = TranscriptResult;
@@ -140,6 +244,12 @@ declare const index_extractTextFromVTT: typeof extractTextFromVTT;
140
244
  declare const index_extractTimestampedTranscript: typeof extractTimestampedTranscript;
141
245
  declare const index_fetchTranscriptForAsset: typeof fetchTranscriptForAsset;
142
246
  declare const index_findCaptionTrack: typeof findCaptionTrack;
247
+ declare const index_getHeatmapForAsset: typeof getHeatmapForAsset;
248
+ declare const index_getHeatmapForPlaybackId: typeof getHeatmapForPlaybackId;
249
+ declare const index_getHeatmapForVideo: typeof getHeatmapForVideo;
250
+ declare const index_getHotspotsForAsset: typeof getHotspotsForAsset;
251
+ declare const index_getHotspotsForPlaybackId: typeof getHotspotsForPlaybackId;
252
+ declare const index_getHotspotsForVideo: typeof getHotspotsForVideo;
143
253
  declare const index_getReadyTextTracks: typeof getReadyTextTracks;
144
254
  declare const index_getStoryboardUrl: typeof getStoryboardUrl;
145
255
  declare const index_getThumbnailUrls: typeof getThumbnailUrls;
@@ -147,7 +257,7 @@ declare const index_parseVTTCues: typeof parseVTTCues;
147
257
  declare const index_secondsToTimestamp: typeof secondsToTimestamp;
148
258
  declare const index_vttTimestampToSeconds: typeof vttTimestampToSeconds;
149
259
  declare namespace index {
150
- export { index_DEFAULT_STORYBOARD_WIDTH as DEFAULT_STORYBOARD_WIDTH, type index_ThumbnailOptions as ThumbnailOptions, type index_TranscriptFetchOptions as TranscriptFetchOptions, type index_TranscriptResult as TranscriptResult, type index_VTTCue as VTTCue, index_buildTranscriptUrl as buildTranscriptUrl, index_chunkByTokens as chunkByTokens, index_chunkText as chunkText, index_chunkVTTCues as chunkVTTCues, index_estimateTokenCount as estimateTokenCount, index_extractTextFromVTT as extractTextFromVTT, index_extractTimestampedTranscript as extractTimestampedTranscript, index_fetchTranscriptForAsset as fetchTranscriptForAsset, index_findCaptionTrack as findCaptionTrack, index_getReadyTextTracks as getReadyTextTracks, index_getStoryboardUrl as getStoryboardUrl, index_getThumbnailUrls as getThumbnailUrls, index_parseVTTCues as parseVTTCues, index_secondsToTimestamp as secondsToTimestamp, index_vttTimestampToSeconds as vttTimestampToSeconds };
260
+ export { index_DEFAULT_STORYBOARD_WIDTH as DEFAULT_STORYBOARD_WIDTH, type index_HeatmapOptions as HeatmapOptions, type index_HeatmapResponse as HeatmapResponse, type index_Hotspot as Hotspot, type index_HotspotOptions as HotspotOptions, type index_HotspotResponse as HotspotResponse, type index_ThumbnailOptions as ThumbnailOptions, type index_TranscriptFetchOptions as TranscriptFetchOptions, type index_TranscriptResult as TranscriptResult, type index_VTTCue as VTTCue, index_buildTranscriptUrl as buildTranscriptUrl, index_chunkByTokens as chunkByTokens, index_chunkText as chunkText, index_chunkVTTCues as chunkVTTCues, index_estimateTokenCount as estimateTokenCount, index_extractTextFromVTT as extractTextFromVTT, index_extractTimestampedTranscript as extractTimestampedTranscript, index_fetchTranscriptForAsset as fetchTranscriptForAsset, index_findCaptionTrack as findCaptionTrack, index_getHeatmapForAsset as getHeatmapForAsset, index_getHeatmapForPlaybackId as getHeatmapForPlaybackId, index_getHeatmapForVideo as getHeatmapForVideo, index_getHotspotsForAsset as getHotspotsForAsset, index_getHotspotsForPlaybackId as getHotspotsForPlaybackId, index_getHotspotsForVideo as getHotspotsForVideo, index_getReadyTextTracks as getReadyTextTracks, index_getStoryboardUrl as getStoryboardUrl, index_getThumbnailUrls as getThumbnailUrls, index_parseVTTCues as parseVTTCues, index_secondsToTimestamp as secondsToTimestamp, index_vttTimestampToSeconds as vttTimestampToSeconds };
151
261
  }
152
262
 
153
- export { DEFAULT_STORYBOARD_WIDTH as D, type ThumbnailOptions as T, type VTTCue as V, chunkVTTCues as a, chunkText as b, chunkByTokens as c, getThumbnailUrls as d, estimateTokenCount as e, type TranscriptFetchOptions as f, getStoryboardUrl as g, type TranscriptResult as h, index as i, getReadyTextTracks as j, findCaptionTrack as k, extractTextFromVTT as l, extractTimestampedTranscript as m, buildTranscriptUrl as n, fetchTranscriptForAsset as o, parseVTTCues as p, secondsToTimestamp as s, vttTimestampToSeconds as v };
263
+ export { secondsToTimestamp as A, vttTimestampToSeconds as B, DEFAULT_STORYBOARD_WIDTH as D, type HeatmapOptions as H, type ThumbnailOptions as T, type VTTCue as V, type HeatmapResponse as a, type Hotspot as b, type HotspotOptions as c, type HotspotResponse as d, type TranscriptFetchOptions as e, type TranscriptResult as f, buildTranscriptUrl as g, chunkByTokens as h, index as i, chunkText as j, chunkVTTCues as k, estimateTokenCount as l, extractTextFromVTT as m, extractTimestampedTranscript as n, fetchTranscriptForAsset as o, findCaptionTrack as p, getHeatmapForAsset as q, getHeatmapForPlaybackId as r, getHeatmapForVideo as s, getHotspotsForAsset as t, getHotspotsForPlaybackId as u, getHotspotsForVideo as v, getReadyTextTracks as w, getStoryboardUrl as x, getThumbnailUrls as y, parseVTTCues as z };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { W as WorkflowCredentials } from './types-CqjLMB84.js';
2
- export { A as AssetTextTrack, i as ChunkEmbedding, C as ChunkingStrategy, E as Encrypted, a as EncryptedPayload, I as ImageSubmissionMode, M as MuxAIOptions, c as MuxAsset, f as PlaybackAsset, P as PlaybackPolicy, h as TextChunk, g as TokenChunkingConfig, k as TokenUsage, T as ToneType, U as UsageMetadata, V as VTTChunkingConfig, j as VideoEmbeddingsResult, b as WorkflowCredentialsInput, d as decryptFromWorkflow, e as encryptForWorkflow } from './types-CqjLMB84.js';
3
- export { i as primitives } from './index-DAlX4SNJ.js';
4
- export { i as workflows } from './index-B6ro59tn.js';
1
+ import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './types-BQVi_wnh.js';
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 './types-BQVi_wnh.js';
3
+ import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
4
+ export { i as primitives } from './index-DZlygsvb.js';
5
+ export { i as workflows } from './index-BMqnP1RV.js';
5
6
  import '@mux/mux-node';
6
7
  import 'zod';
7
8
  import '@ai-sdk/anthropic';
8
9
  import '@ai-sdk/google';
9
10
  import '@ai-sdk/openai';
10
11
 
11
- var version = "0.6.0";
12
+ var version = "0.7.2";
12
13
 
13
14
  /**
14
15
  * A function that returns workflow credentials, either synchronously or asynchronously.
@@ -21,4 +22,27 @@ type WorkflowCredentialsProvider = () => Promise<WorkflowCredentials | undefined
21
22
  */
22
23
  declare function setWorkflowCredentialsProvider(provider?: WorkflowCredentialsProvider): void;
23
24
 
24
- export { WorkflowCredentials, type WorkflowCredentialsProvider, setWorkflowCredentialsProvider, version };
25
+ interface WorkflowStorageClientOptions {
26
+ accessKeyId?: string;
27
+ secretAccessKey?: string;
28
+ }
29
+ /**
30
+ * Serializable storage client wrapper for workflow boundaries.
31
+ *
32
+ * By default, this uses the internal SigV4 implementation to keep object
33
+ * operations compatible across edge/ESM and Node runtimes.
34
+ */
35
+ declare class WorkflowStorageClient {
36
+ static classId: string;
37
+ private readonly accessKeyId?;
38
+ private readonly secretAccessKey?;
39
+ constructor(options?: WorkflowStorageClientOptions);
40
+ private resolveCredentials;
41
+ putObject(input: StoragePutObjectInput): Promise<void>;
42
+ createPresignedGetUrl(input: StoragePresignGetObjectInput): Promise<string>;
43
+ static [WORKFLOW_SERIALIZE](instance: WorkflowStorageClient): WorkflowStorageClientOptions;
44
+ static [WORKFLOW_DESERIALIZE](this: typeof WorkflowStorageClient, value: WorkflowStorageClientOptions): WorkflowStorageClient;
45
+ }
46
+ declare function createWorkflowStorageClient(options?: WorkflowStorageClientOptions): WorkflowStorageClient;
47
+
48
+ export { StoragePresignGetObjectInput, StoragePutObjectInput, WorkflowCredentials, type WorkflowCredentialsProvider, WorkflowStorageClient, createWorkflowStorageClient, setWorkflowCredentialsProvider, version };