mulmocast 2.1.10 → 2.1.12

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.
@@ -127,7 +127,7 @@ export const mulmoViewerBundle = async (context) => {
127
127
  });
128
128
  // BGM
129
129
  const bgmFileName = await processBgm(context.studio?.script.audioParams?.bgm, dir, zipper);
130
- const bundleData = { beats: resultJson, bgmSource: bgmFileName };
130
+ const bundleData = { beats: resultJson, bgmSource: bgmFileName, title: context.studio.script.title };
131
131
  fs.writeFileSync(path.resolve(dir, viewJsonFileName), JSON.stringify(bundleData, null, 2));
132
132
  zipper.addFile(path.resolve(dir, viewJsonFileName));
133
133
  if (isZip) {
@@ -1,6 +1,5 @@
1
1
  import type { AgentFunction, AgentFunctionInfo } from "graphai";
2
2
  import type { AgentBufferResult, ImageAgentInputs, ImageAgentParams, GenAIImageAgentConfig } from "../types/agent.js";
3
- export declare const ratio2BlankPath: (aspectRatio: string) => string;
4
3
  export declare const imageGenAIAgent: AgentFunction<ImageAgentParams, AgentBufferResult, ImageAgentInputs, GenAIImageAgentConfig>;
5
4
  declare const imageGenAIAgentInfo: AgentFunctionInfo;
6
5
  export default imageGenAIAgentInfo;
@@ -3,25 +3,11 @@ import { GraphAILogger } from "graphai";
3
3
  import { provider2ImageAgent } from "../utils/provider2agent.js";
4
4
  import { apiKeyMissingError, agentIncorrectAPIKeyError, agentGenerationError, agentInvalidResponseError, imageAction, imageFileTarget, hasCause, getGenAIErrorReason, resultify, } from "../utils/error_cause.js";
5
5
  import { getAspectRatio } from "../utils/utils.js";
6
- import { ASPECT_RATIOS } from "../utils/const.js";
6
+ import { ASPECT_RATIOS, PRO_ASPECT_RATIOS } from "../utils/const.js";
7
7
  import { GoogleGenAI, PersonGeneration } from "@google/genai";
8
- import { blankImagePath, blankSquareImagePath, blankVerticalImagePath } from "../utils/file.js";
9
- export const ratio2BlankPath = (aspectRatio) => {
10
- if (aspectRatio === "9:16") {
11
- return blankVerticalImagePath();
12
- }
13
- else if (aspectRatio === "1:1") {
14
- return blankSquareImagePath();
15
- }
16
- return blankImagePath();
17
- };
18
- const getGeminiContents = (prompt, referenceImages, aspectRatio) => {
8
+ const getGeminiContents = (prompt, referenceImages) => {
19
9
  const contents = [{ text: prompt }];
20
10
  const images = [...(referenceImages ?? [])];
21
- // NOTE: There is no way to explicitly specify the aspect ratio for Gemini. This is just a hint.
22
- if (aspectRatio) {
23
- images.push(ratio2BlankPath(aspectRatio));
24
- }
25
11
  images.forEach((imagePath) => {
26
12
  const imageData = fs.readFileSync(imagePath);
27
13
  const base64Image = imageData.toString("base64");
@@ -71,7 +57,6 @@ const errorProcess = (error) => {
71
57
  };
72
58
  export const imageGenAIAgent = async ({ namedInputs, params, config, }) => {
73
59
  const { prompt, referenceImages } = namedInputs;
74
- const aspectRatio = getAspectRatio(params.canvasSize, ASPECT_RATIOS);
75
60
  const model = params.model ?? provider2ImageAgent["google"].defaultModel;
76
61
  const apiKey = config?.apiKey;
77
62
  if (!apiKey) {
@@ -82,13 +67,7 @@ export const imageGenAIAgent = async ({ namedInputs, params, config, }) => {
82
67
  const ai = new GoogleGenAI({ apiKey });
83
68
  if (model === "gemini-2.5-flash-image" || model === "gemini-3-pro-image-preview") {
84
69
  const contentParams = (() => {
85
- if (model === "gemini-2.5-flash-image") {
86
- const contents = getGeminiContents(prompt, referenceImages, aspectRatio);
87
- return { model, contents };
88
- }
89
- // gemini-3-pro-image-preview
90
70
  const contents = getGeminiContents(prompt, referenceImages);
91
- const PRO_ASPECT_RATIOS = ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"];
92
71
  return {
93
72
  model,
94
73
  contents,
@@ -111,7 +90,7 @@ export const imageGenAIAgent = async ({ namedInputs, params, config, }) => {
111
90
  prompt,
112
91
  config: {
113
92
  numberOfImages: 1, // default is 4!
114
- aspectRatio,
93
+ aspectRatio: getAspectRatio(params.canvasSize, ASPECT_RATIOS),
115
94
  personGeneration: PersonGeneration.ALLOW_ALL,
116
95
  // safetyFilterLevel: SafetyFilterLevel.BLOCK_ONLY_HIGH,
117
96
  },
@@ -154,4 +154,5 @@ export type MulmoViewerBeat = {
154
154
  export type MulmoViewerData = {
155
155
  beats: MulmoViewerBeat[];
156
156
  bgmSource?: string;
157
+ title?: string;
157
158
  };
@@ -12,3 +12,4 @@ export declare const storyToScriptGenerateMode: {
12
12
  };
13
13
  export declare const bundleTargetLang: string[];
14
14
  export declare const ASPECT_RATIOS: string[];
15
+ export declare const PRO_ASPECT_RATIOS: string[];
@@ -12,3 +12,4 @@ export const storyToScriptGenerateMode = {
12
12
  };
13
13
  export const bundleTargetLang = ["ja", "en"];
14
14
  export const ASPECT_RATIOS = ["1:1", "9:16", "16:9"];
15
+ export const PRO_ASPECT_RATIOS = ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.1.10",
3
+ "version": "2.1.12",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -84,13 +84,13 @@
84
84
  "@graphai/stream_agent_filter": "^2.0.2",
85
85
  "@graphai/vanilla": "^2.0.12",
86
86
  "@graphai/vanilla_node_agents": "^2.0.4",
87
- "@inquirer/input": "^4.3.0",
88
- "@inquirer/select": "^4.4.1",
87
+ "@inquirer/input": "^5.0.3",
88
+ "@inquirer/select": "^5.0.3",
89
89
  "@modelcontextprotocol/sdk": "^1.25.1",
90
90
  "@mozilla/readability": "^0.6.0",
91
91
  "@tavily/core": "^0.5.11",
92
92
  "archiver": "^7.0.1",
93
- "clipboardy": "^4.0.0",
93
+ "clipboardy": "^5.0.2",
94
94
  "dotenv": "^17.2.3",
95
95
  "fluent-ffmpeg": "^2.1.3",
96
96
  "graphai": "^2.0.16",
@@ -98,7 +98,7 @@
98
98
  "marked": "^17.0.1",
99
99
  "mulmocast-vision": "^1.0.8",
100
100
  "ora": "^9.0.0",
101
- "puppeteer": "^24.33.0",
101
+ "puppeteer": "^24.34.0",
102
102
  "replicate": "^1.4.0",
103
103
  "yaml": "^2.8.2",
104
104
  "yargs": "^18.0.0",
@@ -117,7 +117,7 @@
117
117
  "prettier": "^3.7.4",
118
118
  "tsx": "^4.21.0",
119
119
  "typescript": "^5.9.3",
120
- "typescript-eslint": "^8.50.0"
120
+ "typescript-eslint": "^8.50.1"
121
121
  },
122
122
  "engines": {
123
123
  "node": ">=20.0.0"