mulmocast 1.2.4 → 1.2.5

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,6 +1,5 @@
1
1
  import "dotenv/config";
2
- import type { CallbackFunction } from "graphai";
3
- import { MulmoStudioContext, MulmoBeat } from "../types/index.js";
2
+ import { MulmoStudioContext, MulmoBeat, PublicAPIArgs } from "../types/index.js";
4
3
  export declare const getBeatAudioPath: (text: string, context: MulmoStudioContext, beat: MulmoBeat, lang?: string) => string | undefined;
5
- export declare const generateBeatAudio: (index: number, context: MulmoStudioContext, settings?: Record<string, string>, callbacks?: CallbackFunction[]) => Promise<void>;
6
- export declare const audio: (context: MulmoStudioContext, settings?: Record<string, string>, callbacks?: CallbackFunction[]) => Promise<MulmoStudioContext>;
4
+ export declare const generateBeatAudio: (index: number, context: MulmoStudioContext, args?: PublicAPIArgs) => Promise<void>;
5
+ export declare const audio: (context: MulmoStudioContext, args?: PublicAPIArgs) => Promise<MulmoStudioContext>;
@@ -186,7 +186,8 @@ const audioAgents = {
186
186
  addBGMAgent,
187
187
  combineAudioFilesAgent,
188
188
  };
189
- export const generateBeatAudio = async (index, context, settings, callbacks) => {
189
+ export const generateBeatAudio = async (index, context, args) => {
190
+ const { settings, callbacks } = args ?? {};
190
191
  try {
191
192
  MulmoStudioContextMethods.setSessionState(context, "audio", true);
192
193
  const fileName = MulmoStudioContextMethods.getFileName(context);
@@ -214,7 +215,8 @@ export const generateBeatAudio = async (index, context, settings, callbacks) =>
214
215
  MulmoStudioContextMethods.setSessionState(context, "audio", false);
215
216
  }
216
217
  };
217
- export const audio = async (context, settings, callbacks) => {
218
+ export const audio = async (context, args) => {
219
+ const { settings, callbacks } = args ?? {};
218
220
  try {
219
221
  MulmoStudioContextMethods.setSessionState(context, "audio", true);
220
222
  const fileName = MulmoStudioContextMethods.getFileName(context);
@@ -1,3 +1,2 @@
1
- import { MulmoStudioContext } from "../types/index.js";
2
- import type { CallbackFunction } from "graphai";
3
- export declare const captions: (context: MulmoStudioContext, callbacks?: CallbackFunction[]) => Promise<MulmoStudioContext>;
1
+ import { MulmoStudioContext, PublicAPIArgs } from "../types/index.js";
2
+ export declare const captions: (context: MulmoStudioContext, args?: PublicAPIArgs) => Promise<MulmoStudioContext>;
@@ -69,7 +69,8 @@ const graph_data = {
69
69
  },
70
70
  },
71
71
  };
72
- export const captions = async (context, callbacks) => {
72
+ export const captions = async (context, args) => {
73
+ const { callbacks } = args ?? {};
73
74
  if (MulmoStudioContextMethods.getCaption(context)) {
74
75
  try {
75
76
  MulmoStudioContextMethods.setSessionState(context, "caption", true);
@@ -1,20 +1,18 @@
1
- import type { GraphOptions, CallbackFunction } from "graphai";
2
- import { MulmoStudioContext } from "../types/index.js";
1
+ import type { GraphOptions } from "graphai";
2
+ import { MulmoStudioContext, PublicAPIArgs } from "../types/index.js";
3
3
  export declare const graphOption: (context: MulmoStudioContext, settings?: Record<string, string>) => Promise<GraphOptions>;
4
4
  type ImageOptions = {
5
5
  imageAgents: Record<string, unknown>;
6
6
  };
7
- export declare const images: (context: MulmoStudioContext, args?: {
8
- settings?: Record<string, string>;
9
- callbacks?: CallbackFunction[];
7
+ export declare const images: (context: MulmoStudioContext, args?: PublicAPIArgs & {
10
8
  options?: ImageOptions;
11
9
  }) => Promise<MulmoStudioContext>;
12
10
  export declare const generateBeatImage: (inputs: {
13
11
  index: number;
14
12
  context: MulmoStudioContext;
15
- settings?: Record<string, string>;
16
- callbacks?: CallbackFunction[];
17
- forceMovie?: boolean;
18
- forceImage?: boolean;
13
+ args?: PublicAPIArgs & {
14
+ forceMovie?: boolean;
15
+ forceImage?: boolean;
16
+ };
19
17
  }) => Promise<void>;
20
18
  export {};
@@ -346,8 +346,8 @@ export const graphOption = async (context, settings) => {
346
346
  },
347
347
  ],
348
348
  taskManager: new TaskManager(MulmoPresentationStyleMethods.getConcurrency(context.presentationStyle)),
349
+ config: settings2GraphAIConfig(settings, process.env),
349
350
  };
350
- options.config = settings2GraphAIConfig(settings, process.env);
351
351
  return options;
352
352
  };
353
353
  const prepareGenerateImages = async (context) => {
@@ -367,7 +367,8 @@ const prepareGenerateImages = async (context) => {
367
367
  };
368
368
  return injections;
369
369
  };
370
- const generateImages = async (context, settings, callbacks, options) => {
370
+ const generateImages = async (context, args) => {
371
+ const { settings, callbacks, options } = args ?? {};
371
372
  const optionImageAgents = options?.imageAgents ?? {};
372
373
  const injections = await prepareGenerateImages(context);
373
374
  const graphaiAgent = {
@@ -388,10 +389,9 @@ const generateImages = async (context, settings, callbacks, options) => {
388
389
  };
389
390
  // public api
390
391
  export const images = async (context, args) => {
391
- const { settings, callbacks, options } = args ?? {};
392
392
  try {
393
393
  MulmoStudioContextMethods.setSessionState(context, "image", true);
394
- const newContext = await generateImages(context, settings, callbacks, options);
394
+ const newContext = await generateImages(context, args);
395
395
  MulmoStudioContextMethods.setSessionState(context, "image", false);
396
396
  return newContext;
397
397
  }
@@ -402,7 +402,8 @@ export const images = async (context, args) => {
402
402
  };
403
403
  // public api
404
404
  export const generateBeatImage = async (inputs) => {
405
- const { index, context, settings, callbacks, forceMovie, forceImage } = inputs;
405
+ const { index, context, args } = inputs;
406
+ const { settings, callbacks, forceMovie, forceImage } = args ?? {};
406
407
  const options = await graphOption(context, settings);
407
408
  const injections = await prepareGenerateImages(context);
408
409
  const graph = new GraphAI(beat_graph_data, defaultAgents, options);
@@ -1,6 +1,5 @@
1
1
  import "dotenv/config";
2
- import type { CallbackFunction } from "graphai";
3
- import type { LANG, MulmoStudioContext } from "../types/index.js";
2
+ import type { LANG, MulmoStudioContext, PublicAPIArgs } from "../types/index.js";
4
3
  export declare const translateTextGraph: {
5
4
  version: number;
6
5
  nodes: {
@@ -50,11 +49,5 @@ export declare const getOutputMultilingualFilePathAndMkdir: (context: MulmoStudi
50
49
  outputMultilingualFilePath: string;
51
50
  outDirPath: string;
52
51
  };
53
- export declare const translateBeat: (index: number, context: MulmoStudioContext, targetLangs: string[], args?: {
54
- settings?: Record<string, string>;
55
- callbacks?: CallbackFunction[];
56
- }) => Promise<void>;
57
- export declare const translate: (context: MulmoStudioContext, args?: {
58
- callbacks?: CallbackFunction[];
59
- settings?: Record<string, string>;
60
- }) => Promise<MulmoStudioContext>;
52
+ export declare const translateBeat: (index: number, context: MulmoStudioContext, targetLangs: string[], args?: PublicAPIArgs) => Promise<void>;
53
+ export declare const translate: (context: MulmoStudioContext, args?: PublicAPIArgs) => Promise<MulmoStudioContext>;
@@ -1,3 +1,4 @@
1
+ import { type CallbackFunction } from "graphai";
1
2
  import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, mulmoStudioMultiLingualFileSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoPromptTemplateSchema, mulmoPromptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoImageAssetSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema, mulmoGoogleMovieModelSchema, mulmoReplicateMovieModelSchema, mulmoImagePromptMediaSchema } from "./schema.js";
2
3
  import { pdf_modes, pdf_sizes, storyToScriptGenerateMode } from "../utils/const.js";
3
4
  import type { LLM } from "../utils/provider2agent.js";
@@ -128,3 +129,7 @@ export type InitOptions = {
128
129
  c?: string;
129
130
  p?: string;
130
131
  };
132
+ export type PublicAPIArgs = {
133
+ settings?: Record<string, string>;
134
+ callbacks?: CallbackFunction[];
135
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -67,25 +67,25 @@
67
67
  "dependencies": {
68
68
  "@google-cloud/text-to-speech": "^6.2.0",
69
69
  "@google/genai": "^1.13.0",
70
- "@graphai/anthropic_agent": "^2.0.9",
70
+ "@graphai/anthropic_agent": "^2.0.11",
71
71
  "@graphai/browserless_agent": "^2.0.1",
72
72
  "@graphai/gemini_agent": "^2.0.1",
73
73
  "@graphai/groq_agent": "^2.0.2",
74
74
  "@graphai/input_agents": "^1.0.2",
75
- "@graphai/openai_agent": "^2.0.4",
75
+ "@graphai/openai_agent": "^2.0.5",
76
76
  "@graphai/stream_agent_filter": "^2.0.2",
77
- "@graphai/vanilla": "^2.0.10",
78
- "@graphai/vanilla_node_agents": "^2.0.1",
77
+ "@graphai/vanilla": "^2.0.12",
78
+ "@graphai/vanilla_node_agents": "^2.0.4",
79
79
  "@inquirer/input": "^4.2.1",
80
80
  "@inquirer/select": "^4.3.1",
81
81
  "@modelcontextprotocol/sdk": "^1.15.1",
82
82
  "@tavily/core": "^0.5.9",
83
- "canvas": "^3.1.2",
83
+ "canvas": "^3.2.0",
84
84
  "clipboardy": "^4.0.0",
85
85
  "dotenv": "^17.2.1",
86
86
  "fluent-ffmpeg": "^2.1.3",
87
87
  "graphai": "^2.0.14",
88
- "marked": "^16.1.2",
88
+ "marked": "^16.2.0",
89
89
  "ora": "^8.2.0",
90
90
  "puppeteer": "^24.16.2",
91
91
  "replicate": "^1.0.1",
@@ -97,7 +97,7 @@
97
97
  "devDependencies": {
98
98
  "@anatine/zod-mock": "^3.14.0",
99
99
  "@faker-js/faker": "^9.9.0",
100
- "@receptron/test_utils": "^2.0.1",
100
+ "@receptron/test_utils": "^2.0.3",
101
101
  "@types/fluent-ffmpeg": "^2.1.26",
102
102
  "@types/yargs": "^17.0.33",
103
103
  "eslint": "^9.33.0",
@@ -108,7 +108,7 @@
108
108
  "ts-node": "^10.9.2",
109
109
  "tsx": "^4.20.4",
110
110
  "typescript": "^5.9.2",
111
- "typescript-eslint": "^8.39.1"
111
+ "typescript-eslint": "^8.40.0"
112
112
  },
113
113
  "engines": {
114
114
  "node": ">=18.0.0"