mulmocast 1.2.53 → 1.2.54

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.
@@ -8,7 +8,7 @@ import { splitText } from "../utils/string.js";
8
8
  import { settings2GraphAIConfig, beatId, multiLingualObjectToArray } from "../utils/utils.js";
9
9
  import { getMultiLingual } from "../utils/context.js";
10
10
  import { currentMulmoScriptVersion } from "../utils/const.js";
11
- import { translateApiKeyMissingError } from "../utils/error_cause.js";
11
+ import { translateApiKeyMissingError, hasCause, agentGenerationError, translateAction, multiLingualFileTarget } from "../utils/error_cause.js";
12
12
  import { getOutputMultilingualFilePath, mkdir, writingMessage, hashSHA256 } from "../utils/file.js";
13
13
  import { translateSystemPrompt, translatePrompts } from "../utils/prompt.js";
14
14
  import { MulmoStudioContextMethods } from "../methods/mulmo_studio_context.js";
@@ -266,7 +266,12 @@ export const translateBeat = async (index, context, targetLangs, args) => {
266
266
  }
267
267
  catch (error) {
268
268
  GraphAILogger.log(error);
269
- throw error;
269
+ if (hasCause(error) && error.cause) {
270
+ throw error;
271
+ }
272
+ throw new Error("Failed to translate", {
273
+ cause: agentGenerationError("translateBeat", translateAction, multiLingualFileTarget),
274
+ });
270
275
  }
271
276
  };
272
277
  export const translate = async (context, args) => {
@@ -298,7 +303,12 @@ export const translate = async (context, args) => {
298
303
  }
299
304
  catch (error) {
300
305
  MulmoStudioContextMethods.setSessionState(context, "multiLingual", false, false);
301
- throw error;
306
+ if (hasCause(error) && error.cause) {
307
+ throw error;
308
+ }
309
+ throw new Error("Failed to translate", {
310
+ cause: agentGenerationError("translateBeat", translateAction, multiLingualFileTarget),
311
+ });
302
312
  }
303
313
  return context;
304
314
  };
@@ -62,6 +62,7 @@ export declare const translateAction = "translate";
62
62
  export declare const audioFileTarget = "audioFile";
63
63
  export declare const imageFileTarget = "imageFile";
64
64
  export declare const movieFileTarget = "movieFile";
65
+ export declare const multiLingualFileTarget = "multiLingualFile";
65
66
  export declare const videoSourceTarget = "videoSource";
66
67
  export declare const audioSourceTarget = "audioSource";
67
68
  export declare const codeTextTarget = "codeText";
@@ -65,6 +65,7 @@ export const translateAction = "translate";
65
65
  export const audioFileTarget = "audioFile";
66
66
  export const imageFileTarget = "imageFile";
67
67
  export const movieFileTarget = "movieFile";
68
+ export const multiLingualFileTarget = "multiLingualFile";
68
69
  export const videoSourceTarget = "videoSource";
69
70
  export const audioSourceTarget = "audioSource";
70
71
  export const codeTextTarget = "codeText";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.53",
3
+ "version": "1.2.54",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",