@mux/ai 0.67.0-canary.109 → 0.67.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.d.ts CHANGED
@@ -11,7 +11,7 @@ import '@ai-sdk/anthropic';
11
11
  import '@ai-sdk/google';
12
12
  import '@ai-sdk/openai';
13
13
 
14
- var version = "0.67.0-canary.109";
14
+ var version = "0.67.0";
15
15
 
16
16
  interface DependencyErrorInit {
17
17
  dependency: MuxAiErrorDependency;
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // package.json
8
- var version = "0.67.0-canary.109";
8
+ var version = "0.67.0";
9
9
 
10
10
  // node_modules/@workflow/serde/dist/index.js
11
11
  var WORKFLOW_SERIALIZE = /* @__PURE__ */ Symbol.for("workflow-serialize");
@@ -6858,7 +6858,7 @@ function buildUserPrompt2(promptOverrides) {
6858
6858
  var DEFAULT_PROVIDER = "openai";
6859
6859
  async function fetchImageAsBase642(imageUrl, imageDownloadOptions) {
6860
6860
  "use step";
6861
- const downloadResult = await downloadImageAsBase64(imageUrl, imageDownloadOptions);
6861
+ const downloadResult = await downloadImageAsBase64(imageUrl, imageDownloadOptions, { classifiedErrors: true, call: "fetch_storyboard" });
6862
6862
  return downloadResult.base64Data;
6863
6863
  }
6864
6864
  async function analyzeStoryboard({
@@ -6871,6 +6871,7 @@ async function analyzeStoryboard({
6871
6871
  }) {
6872
6872
  "use step";
6873
6873
  const model = await createLanguageModelFromConfig(provider, modelId, credentials);
6874
+ const context = { call: "detect_burned_in_captions", provider, model: modelId };
6874
6875
  const response = await withContentPolicyAwareRetry(() => generateText3({
6875
6876
  model,
6876
6877
  maxRetries: 0,
@@ -6886,8 +6887,10 @@ async function analyzeStoryboard({
6886
6887
  ]
6887
6888
  }
6888
6889
  ]
6889
- }));
6890
- const output = getGeneratedOutputWithContentPolicyHandling(response);
6890
+ }), void 0, context).catch((error) => {
6891
+ throw modelStepError(error, "Burned-in captions model call failed", { ...context });
6892
+ });
6893
+ const output = getGeneratedOutputWithContentPolicyHandling(response, context);
6891
6894
  const unexpectedKeys = detectUnexpectedKeysFromRawText(
6892
6895
  response.text,
6893
6896
  burnedInCaptionsSchema.keyof().options
@@ -6934,12 +6937,13 @@ async function hasBurnedInCaptionsInternal(assetId, options, collectedUsage) {
6934
6937
  model,
6935
6938
  provider
6936
6939
  });
6937
- const { asset: assetData, playbackId, policy } = await getPlaybackIdForAsset(assetId, credentials, options.assetSnapshot);
6940
+ const { asset: assetData, playbackId, policy } = await getPlaybackIdForAsset(assetId, credentials, options.assetSnapshot, { classifiedErrors: true });
6938
6941
  const assetDurationSeconds = getAssetDurationSecondsFromAsset(assetData);
6939
6942
  const storyboardScope = resolveRenderableVideoScope(
6940
6943
  scope,
6941
6944
  assetDurationSeconds,
6942
- getVideoTrackDurationSecondsFromAsset(assetData)
6945
+ getVideoTrackDurationSecondsFromAsset(assetData),
6946
+ { classifiedErrors: true, assetId }
6943
6947
  );
6944
6948
  const imageUrl = await getStoryboardUrl(
6945
6949
  playbackId,
@@ -6948,31 +6952,17 @@ async function hasBurnedInCaptionsInternal(assetId, options, collectedUsage) {
6948
6952
  credentials,
6949
6953
  storyboardScope
6950
6954
  );
6951
- let analysisResponse;
6952
- if (imageSubmissionMode === "base64") {
6953
- const base64Data = await fetchImageAsBase642(imageUrl, imageDownloadOptions);
6954
- analysisResponse = await analyzeStoryboard({
6955
- imageDataUrl: base64Data,
6956
- provider: modelConfig.provider,
6957
- modelId: modelConfig.modelId,
6958
- userPrompt,
6959
- systemPrompt: SYSTEM_PROMPT2,
6960
- credentials
6961
- });
6962
- } else {
6963
- analysisResponse = await analyzeStoryboard({
6964
- imageDataUrl: imageUrl,
6965
- provider: modelConfig.provider,
6966
- modelId: modelConfig.modelId,
6967
- userPrompt,
6968
- systemPrompt: SYSTEM_PROMPT2,
6969
- credentials
6970
- });
6971
- }
6955
+ const imageDataUrl = imageSubmissionMode === "base64" ? await fetchImageAsBase642(imageUrl, imageDownloadOptions) : imageUrl;
6956
+ const modelFacts = { call: "detect_burned_in_captions", provider: modelConfig.provider, model: modelConfig.modelId, assetId };
6957
+ const analysisResponse = await analyzeStoryboard({
6958
+ imageDataUrl,
6959
+ provider: modelConfig.provider,
6960
+ modelId: modelConfig.modelId,
6961
+ userPrompt,
6962
+ systemPrompt: SYSTEM_PROMPT2,
6963
+ credentials
6964
+ }).catch((error) => wrapError(error, `Failed to analyze storyboard with ${modelConfig.provider}`, modelFacts));
6972
6965
  collectedUsage.push(analysisResponse.usage);
6973
- if (!analysisResponse.result) {
6974
- throw new Error("No analysis result received from AI provider");
6975
- }
6976
6966
  const safety = createSafetyReporter();
6977
6967
  if (analysisResponse.unexpectedKeys.length > 0) {
6978
6968
  console.warn(