mulmocast 1.2.51 → 1.2.53

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.
@@ -47,7 +47,7 @@ export const generateReferenceImage = async (inputs) => {
47
47
  catch (error) {
48
48
  GraphAILogger.error(error);
49
49
  throw new Error(`generateReferenceImage: generate error: key=${key}`, {
50
- cause: agentGenerationError("imageReference", imageReferenceAction, imageFileTarget),
50
+ cause: agentGenerationError(imageAgentInfo.agent, imageReferenceAction, imageFileTarget),
51
51
  });
52
52
  }
53
53
  };
@@ -313,7 +313,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
313
313
  export declare const fetchScript: (isHttpPath: boolean, mulmoFilePath: string, fileOrUrl: string) => Promise<MulmoScript | null>;
314
314
  export declare const getMultiLingual: (multilingualFilePath: string, beats: MulmoStudioBeat[]) => MulmoStudioMultiLingual;
315
315
  export declare const getPresentationStyle: (presentationStylePath: string | undefined) => MulmoPresentationStyle | null;
316
- export declare const initializeContextFromFiles: (files: FileObject, raiseError: boolean, force?: boolean, captionLang?: string, targetLang?: string) => Promise<{
316
+ export declare const initializeContextFromFiles: (files: FileObject, raiseError: boolean, force?: boolean, captionLang?: string, targetLang?: string, index?: number) => Promise<{
317
317
  studio: {
318
318
  beats: {
319
319
  duration?: number | undefined;
@@ -1,4 +1,4 @@
1
- import { GraphAILogger } from "graphai";
1
+ import { GraphAILogger, isNull } from "graphai";
2
2
  import { readMulmoScriptFile, fetchMulmoScriptFile, isFile } from "./file.js";
3
3
  import { beatId, multiLingualObjectToArray } from "./utils.js";
4
4
  import { mulmoStudioSchema, mulmoCaptionParamsSchema, mulmoPresentationStyleSchema } from "../types/schema.js";
@@ -112,12 +112,16 @@ export const getPresentationStyle = (presentationStylePath) => {
112
112
  const jsonData = readMulmoScriptFile(presentationStylePath, "ERROR: File does not exist " + presentationStylePath)?.mulmoData ?? null;
113
113
  return mulmoPresentationStyleSchema.parse(jsonData);
114
114
  };
115
- export const initializeContextFromFiles = async (files, raiseError, force, captionLang, targetLang) => {
115
+ export const initializeContextFromFiles = async (files, raiseError, force, captionLang, targetLang, index) => {
116
116
  const { fileName, isHttpPath, fileOrUrl, mulmoFilePath, presentationStylePath, outputMultilingualFilePath } = files;
117
117
  const mulmoScript = await fetchScript(isHttpPath, mulmoFilePath, fileOrUrl);
118
118
  if (!mulmoScript) {
119
119
  return null;
120
120
  }
121
+ // The index param is used when you want to process only a specific beat in an app, etc. This is to avoid parser errors.
122
+ if (!isNull(index) && mulmoScript.beats[index]) {
123
+ mulmoScript.beats = [mulmoScript.beats[index]];
124
+ }
121
125
  try {
122
126
  const presentationStyle = getPresentationStyle(presentationStylePath);
123
127
  const studio = createStudioData(mulmoScript, fileName, captionLang, presentationStyle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.51",
3
+ "version": "1.2.53",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -112,7 +112,7 @@
112
112
  "prettier": "^3.6.2",
113
113
  "tsx": "^4.20.6",
114
114
  "typescript": "^5.9.3",
115
- "typescript-eslint": "^8.45.0"
115
+ "typescript-eslint": "^8.46.0"
116
116
  },
117
117
  "engines": {
118
118
  "node": ">=20.0.0"