mulmocast 2.10.0 → 2.11.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.
@@ -202,8 +202,8 @@ export const imagePreprocessAgent = async (namedInputs) => {
202
202
  if (beat.image) {
203
203
  const plugin = MulmoBeatMethods.getPlugin(beat);
204
204
  const pluginPath = plugin.path({ beat, context, imagePath, ...htmlStyle(context, beat) });
205
- const markdown = plugin.markdown ? plugin.markdown({ beat, context, imagePath, ...htmlStyle(context, beat) }) : undefined;
206
- const html = plugin.html ? await plugin.html({ beat, context, imagePath, ...htmlStyle(context, beat) }) : undefined;
205
+ const markdown = plugin.markdown ? plugin.markdown({ beat, context }) : undefined;
206
+ const html = plugin.html ? await plugin.html({ beat, context }) : undefined;
207
207
  const isTypeMovie = beat.image.type === ImageMediaType.Movie;
208
208
  const isAnimatedHtml = MulmoBeatMethods.isAnimatedHtmlTailwind(beat);
209
209
  // animation and moviePrompt cannot be used together
@@ -3,9 +3,9 @@ export declare const MulmoBeatMethods: {
3
3
  getPlugin(beat: MulmoBeat): {
4
4
  imageType: string;
5
5
  process: (params: import("../types/type.js").ImageProcessorParams) => Promise<string | undefined> | void;
6
- path: (params: import("../types/type.js").ImageProcessorParams) => string | undefined;
7
- markdown?: (params: import("../types/type.js").ImageProcessorParams) => string | undefined;
8
- html?: (params: import("../types/type.js").ImageProcessorParams) => Promise<string | undefined>;
6
+ path: (params: import("../types/type.js").BeatPathParams) => string | undefined;
7
+ markdown?: (params: import("../types/type.js").BeatRenderParams) => string | undefined;
8
+ html?: (params: import("../types/type.js").BeatRenderParams) => Promise<string | undefined>;
9
9
  };
10
10
  isAnimationEnabled: (animation: unknown) => animation is true | {
11
11
  fps?: number;
@@ -93,6 +93,14 @@ export type ImageProcessorParams = {
93
93
  movieRefs?: Record<string, string>;
94
94
  beatDuration?: number;
95
95
  };
96
+ /**
97
+ * What a plugin's `markdown()` / `html()` reads. They return a string and touch no file, so
98
+ * the paths and sizes `process()` needs are not theirs. `imageRefs` is here because a slide
99
+ * resolves image references while rendering; it is optional, so a caller with none omits it.
100
+ */
101
+ export type BeatRenderParams = Pick<ImageProcessorParams, "beat" | "context" | "imageRefs">;
102
+ /** What a plugin's `path()` reads: the source-backed ones resolve against beat and context. */
103
+ export type BeatPathParams = Pick<ImageProcessorParams, "beat" | "context" | "imagePath">;
96
104
  export type PDFMode = (typeof pdf_modes)[number];
97
105
  export type PDFSize = (typeof pdf_sizes)[number];
98
106
  export type Text2ImageAgentInfo = {
@@ -3,6 +3,30 @@ import { UsageCollector } from "./usage_collector.js";
3
3
  export declare const silentMp3 = "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/audio/silent300.mp3";
4
4
  export type MulmoErrorFormatter = (error: unknown) => string | null;
5
5
  export declare const setMulmoErrorFormatter: (formatter: MulmoErrorFormatter | null) => void;
6
+ export declare const initSessionState: () => {
7
+ inSession: {
8
+ audio: boolean;
9
+ image: boolean;
10
+ video: boolean;
11
+ multiLingual: boolean;
12
+ caption: boolean;
13
+ pdf: boolean;
14
+ markdown: boolean;
15
+ html: boolean;
16
+ viewer: boolean;
17
+ };
18
+ inBeatSession: {
19
+ audio: {};
20
+ image: {};
21
+ movie: {};
22
+ multiLingual: {};
23
+ caption: {};
24
+ html: {};
25
+ imageReference: {};
26
+ soundEffect: {};
27
+ lipSync: {};
28
+ };
29
+ };
6
30
  export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: string, videoCaptionLang?: string, presentationStyle?: MulmoPresentationStyle | null) => {
7
31
  script: {
8
32
  $mulmocast: {
@@ -36,7 +36,7 @@ const mulmoCredit = (speaker, isPortrait) => {
36
36
  },
37
37
  };
38
38
  };
39
- const initSessionState = () => {
39
+ export const initSessionState = () => {
40
40
  return {
41
41
  inSession: {
42
42
  audio: false,
@@ -1,5 +1,5 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatPathParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "beat";
3
3
  export declare const processBeatReference: (__: ImageProcessorParams) => Promise<undefined>;
4
4
  export declare const process: (__: ImageProcessorParams) => Promise<undefined>;
5
- export declare const path: (__: ImageProcessorParams) => undefined;
5
+ export declare const path: (__: BeatPathParams) => undefined;
@@ -5,9 +5,12 @@ import { BackgroundImage, MulmoStudioContext, ImageProcessorParams } from "../..
5
5
  * null explicitly disables background image.
6
6
  */
7
7
  export declare const resolveBackgroundImage: (beatBackgroundImage: BackgroundImage | undefined, globalBackgroundImage: BackgroundImage | undefined) => BackgroundImage | undefined;
8
+ /** The background image comes from the script, the style from the beat; the paths and sizes `process()` needs are not read here. */
9
+ type CombinedStyleParams = Pick<ImageProcessorParams, "context" | "textSlideStyle">;
8
10
  /**
9
11
  * Resolve combined style from background image and custom style.
10
12
  * Common pattern used by markdown, textSlide, mermaid plugins.
11
13
  */
12
- export declare const resolveCombinedStyle: (params: ImageProcessorParams, beatBackgroundImage: BackgroundImage | undefined, beatStyle: string | undefined) => Promise<string>;
14
+ export declare const resolveCombinedStyle: (params: CombinedStyleParams, beatBackgroundImage: BackgroundImage | undefined, beatStyle: string | undefined) => Promise<string>;
13
15
  export declare const backgroundImageToCSS: (backgroundImage: BackgroundImage | undefined, context: MulmoStudioContext) => Promise<string>;
16
+ export {};
@@ -1,5 +1,5 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "chart";
3
3
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
4
- export declare const path: (params: ImageProcessorParams) => string;
5
- export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
4
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
5
+ export declare const html: (params: BeatRenderParams) => Promise<string | undefined>;
@@ -1,4 +1,4 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "html_tailwind";
3
3
  /**
4
4
  * Resolve image:name references to file:// absolute paths using imageRefs.
@@ -21,5 +21,5 @@ export declare const resolveRelativeImagePaths: (html: string, baseDirPath: stri
21
21
  */
22
22
  export declare const resolveRelativeModelPathsInScript: (html: string, baseDirPath: string) => string;
23
23
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
24
- export declare const path: (params: ImageProcessorParams) => string;
25
- export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
24
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
25
+ export declare const html: (params: BeatRenderParams) => Promise<string | undefined>;
@@ -1,3 +1,3 @@
1
1
  export declare const imageType = "image";
2
2
  export declare const process: (params: import("../../index.common.js").ImageProcessorParams) => Promise<string | undefined>;
3
- export declare const path: (params: import("../../index.common.js").ImageProcessorParams) => string | undefined;
3
+ export declare const path: (params: import("../../index.common.js").BeatPathParams) => string | undefined;
@@ -1,15 +1,15 @@
1
- import { ImageProcessorParams, MulmoBeat } from "../../types/index.js";
1
+ import { BeatPathParams, BeatRenderParams, ImageProcessorParams, MulmoBeat } from "../../types/index.js";
2
2
  export declare const findImagePlugin: (imageType?: string) => {
3
3
  imageType: string;
4
4
  process: (params: ImageProcessorParams) => Promise<string | undefined> | void;
5
- path: (params: ImageProcessorParams) => string | undefined;
6
- markdown?: (params: ImageProcessorParams) => string | undefined;
7
- html?: (params: ImageProcessorParams) => Promise<string | undefined>;
5
+ path: (params: BeatPathParams) => string | undefined;
6
+ markdown?: (params: BeatRenderParams) => string | undefined;
7
+ html?: (params: BeatRenderParams) => Promise<string | undefined>;
8
8
  } | undefined;
9
9
  export declare const getBeatPlugin: (beat: MulmoBeat) => {
10
10
  imageType: string;
11
11
  process: (params: ImageProcessorParams) => Promise<string | undefined> | void;
12
- path: (params: ImageProcessorParams) => string | undefined;
13
- markdown?: (params: ImageProcessorParams) => string | undefined;
14
- html?: (params: ImageProcessorParams) => Promise<string | undefined>;
12
+ path: (params: BeatPathParams) => string | undefined;
13
+ markdown?: (params: BeatRenderParams) => string | undefined;
14
+ html?: (params: BeatRenderParams) => Promise<string | undefined>;
15
15
  };
@@ -1,6 +1,6 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "markdown";
3
3
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
4
- export declare const path: (params: ImageProcessorParams) => string;
5
- export declare const markdown: (params: ImageProcessorParams) => string | undefined;
6
- export declare const html: (params: ImageProcessorParams) => Promise<string>;
4
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
5
+ export declare const markdown: (params: BeatRenderParams) => string | undefined;
6
+ export declare const html: (params: BeatRenderParams) => Promise<string>;
@@ -1,8 +1,8 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "mermaid";
3
3
  /** Mermaid markup for this path. The markup itself is shared with the browser path. */
4
4
  export declare const generateMermaidHtml: (code: string, title?: string) => string;
5
5
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
6
- export declare const path: (params: ImageProcessorParams) => string;
7
- export declare const markdown: (params: ImageProcessorParams) => string | undefined;
8
- export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
6
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
7
+ export declare const markdown: (params: BeatRenderParams) => string | undefined;
8
+ export declare const html: (params: BeatRenderParams) => Promise<string | undefined>;
@@ -1,5 +1,5 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams } from "../../types/index.js";
2
2
  export declare const imageType = "movie";
3
- export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
4
- export declare const path: (params: ImageProcessorParams) => string | undefined;
5
- export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
3
+ export declare const process: (params: import("../../types/type.js").ImageProcessorParams) => Promise<string | undefined>;
4
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string | undefined;
5
+ export declare const html: (params: BeatRenderParams) => Promise<string | undefined>;
@@ -1,4 +1,4 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  import type { SlideLayout, ContentBlock } from "@mulmocast/deck";
3
3
  export declare const imageType = "slide";
4
4
  /**
@@ -15,5 +15,5 @@ export declare const collectContentArrays: (slide: SlideLayout) => ContentBlock[
15
15
  */
16
16
  export declare const resolveSlideImageRefs: (slide: SlideLayout, imageRefs: Record<string, string>, converter?: (filePath: string) => string) => SlideLayout;
17
17
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
18
- export declare const path: (params: ImageProcessorParams) => string;
19
- export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
18
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
19
+ export declare const html: (params: BeatRenderParams) => Promise<string | undefined>;
@@ -1,3 +1,3 @@
1
- import { type ImageProcessorParams, type ImageType } from "../../types/index.js";
1
+ import { BeatPathParams, type ImageProcessorParams, type ImageType } from "../../types/index.js";
2
2
  export declare const processSource: (imageType: ImageType) => (params: ImageProcessorParams) => Promise<string | undefined>;
3
- export declare const pathSource: (imageType: ImageType) => (params: ImageProcessorParams) => string | undefined;
3
+ export declare const pathSource: (imageType: ImageType) => (params: BeatPathParams) => string | undefined;
@@ -1,6 +1,6 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "textSlide";
3
3
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
4
- export declare const path: (params: ImageProcessorParams) => string;
5
- export declare const markdown: (params: ImageProcessorParams) => string | undefined;
6
- export declare const html: (params: ImageProcessorParams) => Promise<string>;
4
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
5
+ export declare const markdown: (params: BeatRenderParams) => string | undefined;
6
+ export declare const html: (params: BeatRenderParams) => Promise<string>;
@@ -1,4 +1,4 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
2
- export declare const parrotingImagePath: (params: ImageProcessorParams) => string;
1
+ import { BeatPathParams } from "../../types/index.js";
2
+ export declare const parrotingImagePath: (params: BeatPathParams) => string;
3
3
  export declare const resolveStyle: (styleName: string | undefined, fallbackStyle: string) => string;
4
4
  export declare const generateUniqueId: (prefix: string) => string;
@@ -1,5 +1,5 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatRenderParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "vision";
3
3
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
4
- export declare const path: (params: ImageProcessorParams) => string;
5
- export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
4
+ export declare const path: (params: import("../../types/type.js").BeatPathParams) => string;
5
+ export declare const html: (params: BeatRenderParams) => Promise<string | undefined>;
@@ -1,5 +1,5 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
1
+ import { BeatPathParams, ImageProcessorParams } from "../../types/index.js";
2
2
  export declare const imageType = "voice_over";
3
3
  export declare const processBeatReference: (__: ImageProcessorParams) => Promise<undefined>;
4
4
  export declare const process: (__: ImageProcessorParams) => Promise<undefined>;
5
- export declare const path: (__: ImageProcessorParams) => undefined;
5
+ export declare const path: (__: BeatPathParams) => undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -56,10 +56,11 @@
56
56
  "images": "npx tsx ./src/cli/bin.ts images",
57
57
  "preprocess": "npx tsx ./src/cli/bin.ts preprocess",
58
58
  "pdf": "npx tsx ./src/cli/bin.ts pdf",
59
- "test": "rm -f scratchpad/test*.* && npx tsx ./src/audio.ts scripts/test/test.json && npx tsx ./src/images.ts scripts/test/test.json && npx tsx ./src/movie.ts scripts/test/test.json",
59
+ "test": "rm -f scratchpad/test*.* && npx tsx ./src/cli/bin.ts audio scripts/test/test.json && npx tsx ./src/cli/bin.ts images scripts/test/test.json && npx tsx ./src/cli/bin.ts movie scripts/test/test.json",
60
60
  "ci_test": "cross-env NODE_ENV=test tsx --test --experimental-test-coverage ./test/*/test_*.ts",
61
61
  "lint": "eslint src test assets/html/js",
62
62
  "build": "tsc",
63
+ "typecheck:test": "tsc --noEmit -p tsconfig.test.json",
63
64
  "build_test": "tsc && git checkout -- lib/*",
64
65
  "cli": "npx tsx ./src/cli/bin.ts",
65
66
  "scripting": "npx tsx ./src/cli/bin.ts tool scripting",
@@ -89,7 +90,7 @@
89
90
  "homepage": "https://github.com/receptron/mulmocast-cli#readme",
90
91
  "dependencies": {
91
92
  "@google-cloud/text-to-speech": "^6.4.1",
92
- "@google/genai": "^2.15.0",
93
+ "@google/genai": "^2.17.1",
93
94
  "@graphai/anthropic_agent": "^2.0.12",
94
95
  "@graphai/browserless_agent": "^2.0.3",
95
96
  "@graphai/gemini_agent": "^2.0.5",
@@ -112,10 +113,10 @@
112
113
  "graphai": "^2.0.18",
113
114
  "js-tiktoken": "^1.0.21",
114
115
  "jsdom": "^29.1.1",
115
- "marked": "^18.0.7",
116
+ "marked": "^18.0.10",
116
117
  "mulmocast-vision": "^1.0.12",
117
118
  "ora": "^9.4.1",
118
- "puppeteer": "^25.4.0",
119
+ "puppeteer": "^25.8.0",
119
120
  "replicate": "^1.4.0",
120
121
  "yaml": "^2.9.0",
121
122
  "yargs": "^18.1.0",
@@ -129,16 +130,16 @@
129
130
  "@types/yargs": "^17.0.35",
130
131
  "cross-env": "^10.1.0",
131
132
  "esbuild": "^0.28.2",
132
- "eslint": "^10.8.0",
133
+ "eslint": "^10.8.1",
133
134
  "eslint-config-prettier": "^10.1.8",
134
135
  "eslint-plugin-import": "^2.32.0",
135
136
  "eslint-plugin-prettier": "^5.5.6",
136
137
  "eslint-plugin-sonarjs": "^4.2.0",
137
- "globals": "^17.9.0",
138
+ "globals": "^17.11.0",
138
139
  "prettier": "^3.9.6",
139
- "tsx": "^4.23.5",
140
+ "tsx": "^4.23.12",
140
141
  "typescript": "6.0.3",
141
- "typescript-eslint": "^8.66.0"
142
+ "typescript-eslint": "^8.67.0"
142
143
  },
143
144
  "engines": {
144
145
  "node": ">=22.0.0"
@@ -1,3 +0,0 @@
1
- export declare const GENAI_REQUEST_TIMEOUT_MS = 120000;
2
- export declare const REPLICATE_RUN_TIMEOUT_MS = 600000;
3
- export declare const VIDEO_POLL_TIMEOUT_MS = 1200000;
@@ -1,7 +0,0 @@
1
- // Timeout budgets for provider SDK calls (OpenAI has its own in openai_client.ts).
2
- // Generous safety nets against a stalled connection or a never-completing
3
- // operation — NOT tight deadlines. A stall becomes a rejection so the caller's
4
- // GraphAI `retry` can recover instead of hanging forever.
5
- export const GENAI_REQUEST_TIMEOUT_MS = 120_000; // per @google/genai API call (kick-off / each poll)
6
- export const REPLICATE_RUN_TIMEOUT_MS = 600_000; // whole replicate.run() job (video models run minutes)
7
- export const VIDEO_POLL_TIMEOUT_MS = 1_200_000; // wall-clock cap for a long-running Veo video operation