@mux/ai 0.29.0 → 0.31.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.
@@ -1,3 +1,3 @@
1
- export { D as DEFAULT_STORYBOARD_WIDTH, H as HeatmapOptions, a as HeatmapResponse, L as LOW_CONFIDENCE_THRESHOLD, M as MAX_CUE_TEXT_CHARS, T as ThumbnailOptions, b as TranscriptFetchOptions, c as TranscriptResult, V as VTTCue, d as VTTCueBudgetChunkingOptions, e as VTTDurationChunk, f as VTTDurationChunkingOptions, g as buildTranscriptUrl, h as buildVttFromCueBlocks, j as buildVttFromTranslatedCueBlocks, k as chunkByTokens, l as chunkText, m as chunkVTTCues, n as chunkVTTCuesByBudget, o as chunkVTTCuesByDuration, p as concatenateVttSegments, q as estimateTokenCount, r as extractTextFromVTT, s as extractTimestampedTranscript, t as fetchTranscriptForAsset, u as filterVttByScope, v as findCaptionTrack, w as getHeatmapForAsset, x as getHeatmapForPlaybackId, y as getHeatmapForVideo, z as getReadyTextTracks, A as getReliableLanguageCode, B as getStoryboardUrl, C as getThumbnailUrls, E as parseVTTCues, F as replaceCueText, G as sanitizeUntrustedText, I as secondsToTimestamp, J as splitVttPreambleAndCueBlocks, K as stripVttMetadataBlocks, N as vttTimestampToSeconds } from '../index-CXwsu679.js';
2
- export { q as CompletedShotsResult, r as ErroredShotsResult, H as Hotspot, s as HotspotOptions, t as HotspotResponse, u as PendingShotsResult, v as Shot, w as ShotRequestOptions, x as ShotsResult, y as WaitForShotsOptions, z as getHotspotsForAsset, B as getHotspotsForPlaybackId, D as getHotspotsForVideo, F as getShotsForAsset, G as requestShotsForAsset, J as waitForShotsForAsset } from '../shots-BKd7TMFN.js';
1
+ export { D as DEFAULT_STORYBOARD_WIDTH, H as HeatmapOptions, a as HeatmapResponse, L as LOW_CONFIDENCE_THRESHOLD, M as MAX_CUE_TEXT_CHARS, T as ThumbnailOptions, b as TranscriptFetchOptions, c as TranscriptResult, V as VTTCue, d as VTTCueBudgetChunkingOptions, e as VTTDurationChunk, f as VTTDurationChunkingOptions, g as buildTranscriptUrl, h as buildVttFromCueBlocks, j as buildVttFromTranslatedCueBlocks, k as chunkByTokens, l as chunkText, m as chunkVTTCues, n as chunkVTTCuesByBudget, o as chunkVTTCuesByDuration, p as concatenateVttSegments, q as estimateTokenCount, r as extractTextFromVTT, s as extractTimestampedTranscript, t as fetchTranscriptForAsset, u as filterVttByScope, v as findCaptionTrack, w as getHeatmapForAsset, x as getHeatmapForPlaybackId, y as getHeatmapForVideo, z as getReadyTextTracks, A as getReliableLanguageCode, B as getStoryboardUrl, C as getThumbnailUrls, E as parseVTTCues, F as replaceCueText, G as sanitizeUntrustedText, I as secondsToTimestamp, J as splitVttPreambleAndCueBlocks, K as stripVttMetadataBlocks, N as vttTimestampToSeconds } from '../index-CJtQiGj7.js';
2
+ export { q as CompletedShotsResult, r as ErroredShotsResult, H as Hotspot, s as HotspotOptions, t as HotspotResponse, u as PendingShotsResult, v as Shot, w as ShotRequestOptions, x as ShotsResult, y as WaitForShotsOptions, z as getHotspotsForAsset, B as getHotspotsForPlaybackId, D as getHotspotsForVideo, F as getShotsForAsset, G as requestShotsForAsset, J as waitForShotsForAsset } from '../shots-Bh0GrvLx.js';
3
3
  import '@mux/mux-node';
@@ -69,7 +69,7 @@ var EnvSchema = z.object({
69
69
  MUX_TEST_ASSET_ID_VIOLENT_AUDIO_ONLY: optionalString("Mux test asset ID for audio-only assets with violent content.", "Mux test asset id for audio-only assets with violent content for testing"),
70
70
  // Eval config
71
71
  MUX_AI_EVAL_MODEL_SET: optionalString("Eval model selection mode.", "Choose between 'default' (provider defaults only) or 'all' (all configured models)"),
72
- MUX_AI_EVAL_MODELS: optionalString("Comma-separated eval model pairs.", "Comma-separated provider:model pairs (e.g. 'openai:gpt-5.1,anthropic:claude-sonnet-4-5,google:gemini-3-flash-preview')"),
72
+ MUX_AI_EVAL_MODELS: optionalString("Comma-separated eval model pairs.", "Comma-separated provider:model pairs (e.g. 'openai:gpt-5.6-luna,anthropic:claude-sonnet-4-5,google:gemini-3-flash-preview')"),
73
73
  // AI Providers
74
74
  OPENAI_API_KEY: optionalString("OpenAI API key for OpenAI-backed workflows.", "OpenAI API key"),
75
75
  ANTHROPIC_API_KEY: optionalString("Anthropic API key for Claude-backed workflows.", "Anthropic API key"),
@@ -407,16 +407,26 @@ async function resolveMuxSigningContext(credentials) {
407
407
 
408
408
  // src/lib/providers.ts
409
409
  var DEFAULT_LANGUAGE_MODELS = {
410
- openai: "gpt-5.1",
410
+ // GPT-5.6 models default to medium reasoning when no effort is specified.
411
+ openai: "gpt-5.6-luna",
411
412
  anthropic: "claude-sonnet-4-5",
412
413
  google: "gemini-3-flash-preview"
413
414
  };
414
415
  var LANGUAGE_MODELS = {
415
- openai: ["gpt-5.1", "gpt-5-mini"],
416
+ openai: ["gpt-5.6-luna", "gpt-5.1", "gpt-5-mini"],
416
417
  anthropic: ["claude-sonnet-4-5"],
417
418
  google: ["gemini-3-flash-preview", "gemini-3.1-flash-lite", "gemini-2.5-flash"]
418
419
  };
419
420
  var LANGUAGE_MODEL_DEPRECATIONS = [
421
+ {
422
+ provider: "openai",
423
+ modelId: "gpt-5.1",
424
+ replacementModelId: "gpt-5.6-luna",
425
+ phase: "warn",
426
+ deprecatedOn: "2026-08-01",
427
+ sunsetOn: "2026-10-01",
428
+ reason: "GPT-5.6 Luna with its default medium reasoning effort is the new OpenAI default."
429
+ },
420
430
  {
421
431
  provider: "google",
422
432
  modelId: "gemini-2.5-flash",
@@ -477,7 +487,7 @@ function parseEvalModelPair(value) {
477
487
  const modelId = modelIdRaw?.trim();
478
488
  if (!provider || !modelId) {
479
489
  throw new Error(
480
- `Invalid eval model pair "${value}". Use "provider:model" (example: "openai:gpt-5.1").`
490
+ `Invalid eval model pair "${value}". Use "provider:model" (example: "openai:gpt-5.6-luna").`
481
491
  );
482
492
  }
483
493
  if (!isSupportedProvider(provider)) {
@@ -798,7 +808,8 @@ var TOKEN_USAGE_FIELDS = [
798
808
  "outputTokens",
799
809
  "totalTokens",
800
810
  "reasoningTokens",
801
- "cachedInputTokens"
811
+ "cachedInputTokens",
812
+ "cacheWriteTokens"
802
813
  ];
803
814
  function getErrorTokenUsage(error) {
804
815
  if (typeof error !== "object" || error === null) {
@@ -828,6 +839,12 @@ function getErrorTokenUsage(error) {
828
839
  extracted.cachedInputTokens = cacheReadTokens;
829
840
  }
830
841
  }
842
+ if (extracted.cacheWriteTokens === void 0) {
843
+ const cacheWriteTokens = source.inputTokenDetails?.cacheWriteTokens;
844
+ if (typeof cacheWriteTokens === "number") {
845
+ extracted.cacheWriteTokens = cacheWriteTokens;
846
+ }
847
+ }
831
848
  return Object.keys(extracted).length > 0 ? extracted : void 0;
832
849
  }
833
850
 
@@ -842,6 +859,9 @@ var MuxAiError = class extends Error {
842
859
  this.publicMessage = message;
843
860
  this.retryable = opts?.retryable ?? false;
844
861
  }
862
+ static is(value) {
863
+ return typeof value === "object" && value !== null && "__robots_error" in value && value.__robots_error === true;
864
+ }
845
865
  };
846
866
  function extractErrorDetail(error) {
847
867
  if (error instanceof Error && error.message) {
@@ -859,7 +879,7 @@ function extractErrorDetail(error) {
859
879
  return "Unknown error";
860
880
  }
861
881
  function wrapError(error, message) {
862
- if (error instanceof MuxAiError) {
882
+ if (MuxAiError.is(error)) {
863
883
  throw error;
864
884
  }
865
885
  const rawDetail = extractErrorDetail(error);