@mux/ai 0.12.1 → 0.13.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.
@@ -239,4 +239,119 @@ interface TokenUsage {
239
239
  metadata?: UsageMetadata;
240
240
  }
241
241
 
242
- export { type AssetTextTrack as A, type ChunkEmbedding as C, type Encrypted as E, type ImageSubmissionMode as I, type MuxAIOptions as M, type PlaybackAsset as P, type StoragePutObjectInput as S, type TextChunk as T, type UsageMetadata as U, type VTTChunkingConfig as V, type WorkflowCredentials as W, type StoragePresignGetObjectInput as a, type ChunkingStrategy as b, type EncryptedPayload as c, type MuxAsset as d, type PlaybackPolicy as e, type StorageAdapter as f, type TokenChunkingConfig as g, type TokenUsage as h, type ToneType as i, type VideoEmbeddingsResult as j, type WorkflowCredentialsInput as k, type WorkflowMuxClient as l, decryptFromWorkflow as m, encryptForWorkflow as n };
242
+ interface Hotspot {
243
+ /** Inclusive start time in milliseconds */
244
+ startMs: number;
245
+ /** Exclusive end time in milliseconds */
246
+ endMs: number;
247
+ /** Hotspot score using distribution-based normalization (0-1) */
248
+ score: number;
249
+ }
250
+ interface HotspotOptions {
251
+ /** Maximum number of hotspots to return (default: 5) */
252
+ limit?: number;
253
+ /** Sort order: 'asc' or 'desc' (default: 'desc') */
254
+ orderDirection?: "asc" | "desc";
255
+ /** Order by field (default: 'score') */
256
+ orderBy?: "score";
257
+ /** Time window for results, e.g., '7:days' (default: '7:days') */
258
+ timeframe?: string;
259
+ /** Optional workflow credentials */
260
+ credentials?: WorkflowCredentialsInput;
261
+ }
262
+ interface HotspotResponse {
263
+ assetId?: string;
264
+ videoId?: string;
265
+ playbackId?: string;
266
+ hotspots: Hotspot[];
267
+ }
268
+ /**
269
+ * Fetches engagement hotspots for a Mux asset.
270
+ * Returns the top N "hot" time ranges based on engagement data.
271
+ *
272
+ * @param assetId - The Mux asset ID
273
+ * @param options - Hotspot query options
274
+ * @returns Array of hotspots with time ranges and scores
275
+ */
276
+ declare function getHotspotsForAsset(assetId: string, options?: HotspotOptions): Promise<Hotspot[]>;
277
+ /**
278
+ * Fetches engagement hotspots for a Mux video ID.
279
+ * Returns the top N "hot" time ranges based on engagement data.
280
+ *
281
+ * @param videoId - The Mux video ID
282
+ * @param options - Hotspot query options
283
+ * @returns Array of hotspots with time ranges and scores
284
+ */
285
+ declare function getHotspotsForVideo(videoId: string, options?: HotspotOptions): Promise<Hotspot[]>;
286
+ /**
287
+ * Fetches engagement hotspots for a Mux playback ID.
288
+ * Returns the top N "hot" time ranges based on engagement data.
289
+ *
290
+ * @param playbackId - The Mux playback ID
291
+ * @param options - Hotspot query options
292
+ * @returns Array of hotspots with time ranges and scores
293
+ */
294
+ declare function getHotspotsForPlaybackId(playbackId: string, options?: HotspotOptions): Promise<Hotspot[]>;
295
+
296
+ interface Shot {
297
+ /** Start time of the shot in seconds from the beginning of the asset. */
298
+ startTime: number;
299
+ /** Signed URL for a representative image of the shot. */
300
+ imageUrl: string;
301
+ }
302
+ interface PendingShotsResult {
303
+ status: "pending";
304
+ createdAt: string;
305
+ }
306
+ interface ErroredShotsResult {
307
+ status: "errored";
308
+ createdAt: string;
309
+ error: {
310
+ type: string;
311
+ messages: string[];
312
+ };
313
+ }
314
+ interface CompletedShotsResult {
315
+ status: "completed";
316
+ createdAt: string;
317
+ shots: Shot[];
318
+ }
319
+ type ShotsResult = PendingShotsResult | ErroredShotsResult | CompletedShotsResult;
320
+ interface ShotRequestOptions {
321
+ /** Optional workflow credentials */
322
+ credentials?: WorkflowCredentialsInput;
323
+ }
324
+ interface WaitForShotsOptions extends ShotRequestOptions {
325
+ /** Polling interval in milliseconds (default: 2000, minimum enforced: 1000) */
326
+ pollIntervalMs?: number;
327
+ /** Maximum number of polling attempts (default: 60) */
328
+ maxAttempts?: number;
329
+ /** When true, request shot generation before polling (default: true) */
330
+ createIfMissing?: boolean;
331
+ }
332
+ /**
333
+ * Starts generating shots for an asset.
334
+ *
335
+ * @param assetId - The Mux asset ID
336
+ * @param options - Request options
337
+ * @returns Pending shot generation state
338
+ */
339
+ declare function requestShotsForAsset(assetId: string, options?: ShotRequestOptions): Promise<PendingShotsResult>;
340
+ /**
341
+ * Gets the current shot generation status for an asset.
342
+ *
343
+ * @param assetId - The Mux asset ID
344
+ * @param options - Request options
345
+ * @returns Pending, errored, or completed shot result
346
+ */
347
+ declare function getShotsForAsset(assetId: string, options?: ShotRequestOptions): Promise<ShotsResult>;
348
+ /**
349
+ * Requests shot generation if needed and polls until shots are completed.
350
+ *
351
+ * @param assetId - The Mux asset ID
352
+ * @param options - Polling options
353
+ * @returns Completed shot result
354
+ */
355
+ declare function waitForShotsForAsset(assetId: string, options?: WaitForShotsOptions): Promise<CompletedShotsResult>;
356
+
357
+ export { type AssetTextTrack as A, getShotsForAsset as B, type ChunkEmbedding as C, requestShotsForAsset as D, type Encrypted as E, waitForShotsForAsset as F, type Hotspot as H, type ImageSubmissionMode as I, type MuxAIOptions as M, type PlaybackAsset as P, type StoragePutObjectInput as S, type TextChunk as T, type UsageMetadata as U, type VTTChunkingConfig as V, type WorkflowCredentials as W, type StoragePresignGetObjectInput as a, type ChunkingStrategy as b, type EncryptedPayload as c, type MuxAsset as d, type PlaybackPolicy as e, type StorageAdapter as f, type TokenChunkingConfig as g, type TokenUsage as h, type ToneType as i, type VideoEmbeddingsResult as j, type WorkflowCredentialsInput as k, type WorkflowMuxClient as l, decryptFromWorkflow as m, encryptForWorkflow as n, type CompletedShotsResult as o, type ErroredShotsResult as p, type HotspotOptions as q, type HotspotResponse as r, type PendingShotsResult as s, type Shot as t, type ShotRequestOptions as u, type ShotsResult as v, type WaitForShotsOptions as w, getHotspotsForAsset as x, getHotspotsForPlaybackId as y, getHotspotsForVideo as z };
@@ -1,7 +1,7 @@
1
- export { A as AskQuestionsOptions, a as AskQuestionsResult, b as AskQuestionsType, c as AudioTranslationOptions, d as AudioTranslationResult, e as AutoCensorProfanityOptions, B as BurnedInCaptionsAnalysis, f as BurnedInCaptionsOptions, g as BurnedInCaptionsPromptOverrides, h as BurnedInCaptionsPromptSections, j as BurnedInCaptionsResult, C as CaptionReplacement, k as CensorMode, l as Chapter, m as ChapterSystemPromptSections, n as ChaptersOptions, o as ChaptersPromptOverrides, p as ChaptersPromptSections, q as ChaptersResult, r as ChaptersType, D as DEFAULT_DESCRIPTION_LENGTH, s as DEFAULT_SUMMARY_KEYWORD_LIMIT, t as DEFAULT_TITLE_LENGTH, E as EditCaptionsOptions, u as EditCaptionsResult, v as EmbeddingsOptions, w as EmbeddingsResult, H as HIVE_SEXUAL_CATEGORIES, x as HIVE_VIOLENCE_CATEGORIES, y as HiveModerationOutput, z as HiveModerationSource, M as ModerationOptions, F as ModerationProvider, G as ModerationResult, P as ProfanityDetectionPayload, Q as Question, I as QuestionAnswer, J as QuestionAnswerType, R as ReplacementRecord, S as SummarizationOptions, K as SummarizationPromptOverrides, L as SummarizationPromptSections, N as SummaryAndTagsResult, O as SummaryType, T as ThumbnailModerationScore, U as TranslationChunkingOptions, V as TranslationOptions, W as TranslationPayload, X as TranslationResult, Y as aggregateTokenUsage, Z as applyOverrideLists, _ as applyReplacements, $ as askQuestions, a0 as buildReplacementRegex, a1 as burnedInCaptionsSchema, a2 as censorVttContent, a3 as chapterSchema, a4 as chaptersSchema, a5 as createReplacer, a6 as editCaptions, a7 as generateChapters, a8 as generateEmbeddings, a9 as generateVideoEmbeddings, aa as getModerationScores, ab as getSummaryAndTags, ac as hasBurnedInCaptions, ad as profanityDetectionSchema, ae as questionAnswerSchema, af as shouldSplitChunkTranslationError, ag as summarySchema, ah as transformCueText, ai as translateAudio, aj as translateCaptions, ak as translationSchema } from '../index-B6IY5dhq.js';
1
+ export { A as AskQuestionsOptions, a as AskQuestionsResult, b as AskQuestionsType, c as AudioTranslationOptions, d as AudioTranslationResult, e as AutoCensorProfanityOptions, B as BurnedInCaptionsAnalysis, f as BurnedInCaptionsOptions, g as BurnedInCaptionsPromptOverrides, h as BurnedInCaptionsPromptSections, j as BurnedInCaptionsResult, C as CaptionReplacement, k as CensorMode, l as Chapter, m as ChapterSystemPromptSections, n as ChaptersOptions, o as ChaptersPromptOverrides, p as ChaptersPromptSections, q as ChaptersResult, r as ChaptersType, D as DEFAULT_DESCRIPTION_LENGTH, s as DEFAULT_SUMMARY_KEYWORD_LIMIT, t as DEFAULT_TITLE_LENGTH, E as EditCaptionsOptions, u as EditCaptionsResult, v as EmbeddingsOptions, w as EmbeddingsResult, x as EngagementInsightsOptions, y as EngagementInsightsResult, H as HIVE_SEXUAL_CATEGORIES, z as HIVE_VIOLENCE_CATEGORIES, F as HiveModerationOutput, G as HiveModerationSource, M as ModerationOptions, I as ModerationProvider, J as ModerationResult, K as MomentInsight, O as OverallInsight, P as ProfanityDetectionPayload, Q as Question, L as QuestionAnswer, N as QuestionAnswerType, R as ReplacementRecord, S as SummarizationOptions, T as SummarizationPromptOverrides, U as SummarizationPromptSections, V as SummaryAndTagsResult, W as SummaryType, X as ThumbnailModerationScore, Y as TranslationChunkingOptions, Z as TranslationOptions, _ as TranslationPayload, $ as TranslationResult, a0 as aggregateTokenUsage, a1 as applyOverrideLists, a2 as applyReplacements, a3 as askQuestions, a4 as buildReplacementRegex, a5 as burnedInCaptionsSchema, a6 as censorVttContent, a7 as chapterSchema, a8 as chaptersSchema, a9 as createReplacer, aa as editCaptions, ab as extractTranscriptSegmentsForHotspots, ac as generateChapters, ad as generateEmbeddings, ae as generateEngagementInsights, af as generateVideoEmbeddings, ag as getModerationScores, ah as getSummaryAndTags, ai as hasBurnedInCaptions, aj as mapShotsToHotspots, ak as profanityDetectionSchema, al as questionAnswerSchema, am as shouldSplitChunkTranslationError, an as summarySchema, ao as transformCueText, ap as translateAudio, aq as translateCaptions, ar as translationSchema } from '../index-BeX_4DL7.js';
2
2
  import 'zod';
3
3
  import '@ai-sdk/anthropic';
4
4
  import '@ai-sdk/google';
5
5
  import '@ai-sdk/openai';
6
- import '../types-BRbaGW3t.js';
6
+ import '../shots-BFYOfBgN.js';
7
7
  import '@mux/mux-node';