mulmocast 2.6.3 → 2.6.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.
- package/README.md +2 -1
- package/assets/html/chart.html +40 -7
- package/lib/actions/image_agents.d.ts +6 -0
- package/lib/actions/image_agents.js +28 -2
- package/lib/actions/image_references.d.ts +1 -0
- package/lib/actions/image_references.js +49 -11
- package/lib/actions/images.d.ts +26 -0
- package/lib/actions/images.js +2 -0
- package/lib/agents/movie_genai_agent.js +36 -6
- package/lib/agents/movie_replicate_agent.js +20 -3
- package/lib/methods/mulmo_presentation_style.d.ts +6 -0
- package/lib/slide/layouts/index.js +3 -0
- package/lib/slide/layouts/waterfall.d.ts +2 -0
- package/lib/slide/layouts/waterfall.js +63 -0
- package/lib/slide/render.js +4 -1
- package/lib/slide/schema.d.ts +176 -0
- package/lib/slide/schema.js +18 -0
- package/lib/slide/utils.d.ts +1 -0
- package/lib/slide/utils.js +21 -1
- package/lib/types/agent.d.ts +6 -0
- package/lib/types/provider2agent.d.ts +6 -11
- package/lib/types/provider2agent.js +10 -0
- package/lib/types/schema.d.ts +532 -0
- package/lib/types/schema.js +14 -0
- package/lib/types/slide.d.ts +176 -0
- package/lib/types/slide.js +18 -0
- package/lib/utils/context.d.ts +167 -0
- package/lib/utils/html_render.js +4 -3
- package/lib/utils/image_plugins/chart.js +19 -6
- package/lib/utils/image_plugins/mermaid.js +5 -1
- package/package.json +7 -7
- package/scripts/test/test_image_prompt_reference.json +55 -0
- package/scripts/test/test_ir_visualizations.json +317 -0
- package/scripts/test/test_movie_references.json +101 -0
- package/scripts/test/test_plugin_features.json +151 -0
package/lib/slide/schema.d.ts
CHANGED
|
@@ -4284,6 +4284,74 @@ export declare const tableSlideSchema: z.ZodObject<{
|
|
|
4284
4284
|
}, z.core.$strip>>;
|
|
4285
4285
|
layout: z.ZodLiteral<"table">;
|
|
4286
4286
|
}, z.core.$strip>;
|
|
4287
|
+
export declare const waterfallItemSchema: z.ZodObject<{
|
|
4288
|
+
label: z.ZodString;
|
|
4289
|
+
value: z.ZodNumber;
|
|
4290
|
+
isTotal: z.ZodOptional<z.ZodBoolean>;
|
|
4291
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
4292
|
+
success: "success";
|
|
4293
|
+
primary: "primary";
|
|
4294
|
+
accent: "accent";
|
|
4295
|
+
warning: "warning";
|
|
4296
|
+
danger: "danger";
|
|
4297
|
+
info: "info";
|
|
4298
|
+
highlight: "highlight";
|
|
4299
|
+
}>>;
|
|
4300
|
+
}, z.core.$strip>;
|
|
4301
|
+
export declare const waterfallSlideSchema: z.ZodObject<{
|
|
4302
|
+
title: z.ZodString;
|
|
4303
|
+
stepLabel: z.ZodOptional<z.ZodString>;
|
|
4304
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
4305
|
+
items: z.ZodArray<z.ZodObject<{
|
|
4306
|
+
label: z.ZodString;
|
|
4307
|
+
value: z.ZodNumber;
|
|
4308
|
+
isTotal: z.ZodOptional<z.ZodBoolean>;
|
|
4309
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
4310
|
+
success: "success";
|
|
4311
|
+
primary: "primary";
|
|
4312
|
+
accent: "accent";
|
|
4313
|
+
warning: "warning";
|
|
4314
|
+
danger: "danger";
|
|
4315
|
+
info: "info";
|
|
4316
|
+
highlight: "highlight";
|
|
4317
|
+
}>>;
|
|
4318
|
+
}, z.core.$strip>>;
|
|
4319
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
4320
|
+
callout: z.ZodOptional<z.ZodObject<{
|
|
4321
|
+
text: z.ZodString;
|
|
4322
|
+
label: z.ZodOptional<z.ZodString>;
|
|
4323
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
4324
|
+
success: "success";
|
|
4325
|
+
primary: "primary";
|
|
4326
|
+
accent: "accent";
|
|
4327
|
+
warning: "warning";
|
|
4328
|
+
danger: "danger";
|
|
4329
|
+
info: "info";
|
|
4330
|
+
highlight: "highlight";
|
|
4331
|
+
}>>;
|
|
4332
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
4333
|
+
left: "left";
|
|
4334
|
+
center: "center";
|
|
4335
|
+
}>>;
|
|
4336
|
+
leftBar: z.ZodOptional<z.ZodBoolean>;
|
|
4337
|
+
}, z.core.$strip>>;
|
|
4338
|
+
accentColor: z.ZodOptional<z.ZodEnum<{
|
|
4339
|
+
success: "success";
|
|
4340
|
+
primary: "primary";
|
|
4341
|
+
accent: "accent";
|
|
4342
|
+
warning: "warning";
|
|
4343
|
+
danger: "danger";
|
|
4344
|
+
info: "info";
|
|
4345
|
+
highlight: "highlight";
|
|
4346
|
+
}>>;
|
|
4347
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
4348
|
+
bgColor: z.ZodOptional<z.ZodString>;
|
|
4349
|
+
decorations: z.ZodOptional<z.ZodBoolean>;
|
|
4350
|
+
bgOpacity: z.ZodOptional<z.ZodNumber>;
|
|
4351
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
4352
|
+
}, z.core.$strip>>;
|
|
4353
|
+
layout: z.ZodLiteral<"waterfall">;
|
|
4354
|
+
}, z.core.$strip>;
|
|
4287
4355
|
export declare const funnelStageSchema: z.ZodObject<{
|
|
4288
4356
|
label: z.ZodString;
|
|
4289
4357
|
value: z.ZodOptional<z.ZodString>;
|
|
@@ -6714,6 +6782,59 @@ export declare const slideLayoutSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6714
6782
|
footer: z.ZodOptional<z.ZodString>;
|
|
6715
6783
|
}, z.core.$strip>>;
|
|
6716
6784
|
layout: z.ZodLiteral<"funnel">;
|
|
6785
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6786
|
+
title: z.ZodString;
|
|
6787
|
+
stepLabel: z.ZodOptional<z.ZodString>;
|
|
6788
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
6789
|
+
items: z.ZodArray<z.ZodObject<{
|
|
6790
|
+
label: z.ZodString;
|
|
6791
|
+
value: z.ZodNumber;
|
|
6792
|
+
isTotal: z.ZodOptional<z.ZodBoolean>;
|
|
6793
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
6794
|
+
success: "success";
|
|
6795
|
+
primary: "primary";
|
|
6796
|
+
accent: "accent";
|
|
6797
|
+
warning: "warning";
|
|
6798
|
+
danger: "danger";
|
|
6799
|
+
info: "info";
|
|
6800
|
+
highlight: "highlight";
|
|
6801
|
+
}>>;
|
|
6802
|
+
}, z.core.$strip>>;
|
|
6803
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
6804
|
+
callout: z.ZodOptional<z.ZodObject<{
|
|
6805
|
+
text: z.ZodString;
|
|
6806
|
+
label: z.ZodOptional<z.ZodString>;
|
|
6807
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
6808
|
+
success: "success";
|
|
6809
|
+
primary: "primary";
|
|
6810
|
+
accent: "accent";
|
|
6811
|
+
warning: "warning";
|
|
6812
|
+
danger: "danger";
|
|
6813
|
+
info: "info";
|
|
6814
|
+
highlight: "highlight";
|
|
6815
|
+
}>>;
|
|
6816
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
6817
|
+
left: "left";
|
|
6818
|
+
center: "center";
|
|
6819
|
+
}>>;
|
|
6820
|
+
leftBar: z.ZodOptional<z.ZodBoolean>;
|
|
6821
|
+
}, z.core.$strip>>;
|
|
6822
|
+
accentColor: z.ZodOptional<z.ZodEnum<{
|
|
6823
|
+
success: "success";
|
|
6824
|
+
primary: "primary";
|
|
6825
|
+
accent: "accent";
|
|
6826
|
+
warning: "warning";
|
|
6827
|
+
danger: "danger";
|
|
6828
|
+
info: "info";
|
|
6829
|
+
highlight: "highlight";
|
|
6830
|
+
}>>;
|
|
6831
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
6832
|
+
bgColor: z.ZodOptional<z.ZodString>;
|
|
6833
|
+
decorations: z.ZodOptional<z.ZodBoolean>;
|
|
6834
|
+
bgOpacity: z.ZodOptional<z.ZodNumber>;
|
|
6835
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
6836
|
+
}, z.core.$strip>>;
|
|
6837
|
+
layout: z.ZodLiteral<"waterfall">;
|
|
6717
6838
|
}, z.core.$strip>], "layout">;
|
|
6718
6839
|
/** Media schema registered in mulmoImageAssetSchema */
|
|
6719
6840
|
export declare const mulmoSlideMediaSchema: z.ZodObject<{
|
|
@@ -9043,6 +9164,59 @@ export declare const mulmoSlideMediaSchema: z.ZodObject<{
|
|
|
9043
9164
|
footer: z.ZodOptional<z.ZodString>;
|
|
9044
9165
|
}, z.core.$strip>>;
|
|
9045
9166
|
layout: z.ZodLiteral<"funnel">;
|
|
9167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9168
|
+
title: z.ZodString;
|
|
9169
|
+
stepLabel: z.ZodOptional<z.ZodString>;
|
|
9170
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
9171
|
+
items: z.ZodArray<z.ZodObject<{
|
|
9172
|
+
label: z.ZodString;
|
|
9173
|
+
value: z.ZodNumber;
|
|
9174
|
+
isTotal: z.ZodOptional<z.ZodBoolean>;
|
|
9175
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
9176
|
+
success: "success";
|
|
9177
|
+
primary: "primary";
|
|
9178
|
+
accent: "accent";
|
|
9179
|
+
warning: "warning";
|
|
9180
|
+
danger: "danger";
|
|
9181
|
+
info: "info";
|
|
9182
|
+
highlight: "highlight";
|
|
9183
|
+
}>>;
|
|
9184
|
+
}, z.core.$strip>>;
|
|
9185
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
9186
|
+
callout: z.ZodOptional<z.ZodObject<{
|
|
9187
|
+
text: z.ZodString;
|
|
9188
|
+
label: z.ZodOptional<z.ZodString>;
|
|
9189
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
9190
|
+
success: "success";
|
|
9191
|
+
primary: "primary";
|
|
9192
|
+
accent: "accent";
|
|
9193
|
+
warning: "warning";
|
|
9194
|
+
danger: "danger";
|
|
9195
|
+
info: "info";
|
|
9196
|
+
highlight: "highlight";
|
|
9197
|
+
}>>;
|
|
9198
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
9199
|
+
left: "left";
|
|
9200
|
+
center: "center";
|
|
9201
|
+
}>>;
|
|
9202
|
+
leftBar: z.ZodOptional<z.ZodBoolean>;
|
|
9203
|
+
}, z.core.$strip>>;
|
|
9204
|
+
accentColor: z.ZodOptional<z.ZodEnum<{
|
|
9205
|
+
success: "success";
|
|
9206
|
+
primary: "primary";
|
|
9207
|
+
accent: "accent";
|
|
9208
|
+
warning: "warning";
|
|
9209
|
+
danger: "danger";
|
|
9210
|
+
info: "info";
|
|
9211
|
+
highlight: "highlight";
|
|
9212
|
+
}>>;
|
|
9213
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
9214
|
+
bgColor: z.ZodOptional<z.ZodString>;
|
|
9215
|
+
decorations: z.ZodOptional<z.ZodBoolean>;
|
|
9216
|
+
bgOpacity: z.ZodOptional<z.ZodNumber>;
|
|
9217
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
9218
|
+
}, z.core.$strip>>;
|
|
9219
|
+
layout: z.ZodLiteral<"waterfall">;
|
|
9046
9220
|
}, z.core.$strip>], "layout">;
|
|
9047
9221
|
reference: z.ZodOptional<z.ZodString>;
|
|
9048
9222
|
branding: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -9128,6 +9302,8 @@ export type TableCellValue = z.infer<typeof tableCellValueSchema>;
|
|
|
9128
9302
|
export type TableSlide = z.infer<typeof tableSlideSchema>;
|
|
9129
9303
|
export type FunnelStage = z.infer<typeof funnelStageSchema>;
|
|
9130
9304
|
export type FunnelSlide = z.infer<typeof funnelSlideSchema>;
|
|
9305
|
+
export type WaterfallItem = z.infer<typeof waterfallItemSchema>;
|
|
9306
|
+
export type WaterfallSlide = z.infer<typeof waterfallSlideSchema>;
|
|
9131
9307
|
export type SlideBrandingLogo = z.infer<typeof slideBrandingLogoSchema>;
|
|
9132
9308
|
export type SlideBranding = z.infer<typeof slideBrandingSchema>;
|
|
9133
9309
|
export type MulmoSlideMedia = z.infer<typeof mulmoSlideMediaSchema>;
|
package/lib/slide/schema.js
CHANGED
|
@@ -341,6 +341,23 @@ export const tableSlideSchema = z.object({
|
|
|
341
341
|
striped: z.boolean().optional(),
|
|
342
342
|
callout: calloutBarSchema.optional(),
|
|
343
343
|
});
|
|
344
|
+
// ─── waterfall ───
|
|
345
|
+
export const waterfallItemSchema = z.object({
|
|
346
|
+
label: z.string(),
|
|
347
|
+
value: z.number(),
|
|
348
|
+
isTotal: z.boolean().optional(),
|
|
349
|
+
color: accentColorKeySchema.optional(),
|
|
350
|
+
});
|
|
351
|
+
export const waterfallSlideSchema = z.object({
|
|
352
|
+
layout: z.literal("waterfall"),
|
|
353
|
+
...slideBaseFields,
|
|
354
|
+
title: z.string(),
|
|
355
|
+
stepLabel: z.string().optional(),
|
|
356
|
+
subtitle: z.string().optional(),
|
|
357
|
+
items: z.array(waterfallItemSchema),
|
|
358
|
+
unit: z.string().optional(),
|
|
359
|
+
callout: calloutBarSchema.optional(),
|
|
360
|
+
});
|
|
344
361
|
// ─── funnel ───
|
|
345
362
|
export const funnelStageSchema = z.object({
|
|
346
363
|
label: z.string(),
|
|
@@ -403,6 +420,7 @@ export const slideLayoutSchema = z.discriminatedUnion("layout", [
|
|
|
403
420
|
matrixSlideSchema,
|
|
404
421
|
tableSlideSchema,
|
|
405
422
|
funnelSlideSchema,
|
|
423
|
+
waterfallSlideSchema,
|
|
406
424
|
]);
|
|
407
425
|
/** Media schema registered in mulmoImageAssetSchema */
|
|
408
426
|
export const mulmoSlideMediaSchema = z
|
package/lib/slide/utils.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export declare const resetSlideIdCounter: () => void;
|
|
|
69
69
|
type BlockTypeFlags = {
|
|
70
70
|
hasChart: boolean;
|
|
71
71
|
hasMermaid: boolean;
|
|
72
|
+
chartPlugins: string[];
|
|
72
73
|
};
|
|
73
74
|
/** Detect whether chart or mermaid content blocks exist in a slide */
|
|
74
75
|
export declare const detectBlockTypes: (slide: SlideLayout) => BlockTypeFlags;
|
package/lib/slide/utils.js
CHANGED
|
@@ -170,6 +170,14 @@ export const generateSlideId = (prefix) => `${prefix}-${slideIdCounter++}`;
|
|
|
170
170
|
export const resetSlideIdCounter = () => {
|
|
171
171
|
slideIdCounter = 0;
|
|
172
172
|
};
|
|
173
|
+
// ═══════════════════════════════════════════════════════════
|
|
174
|
+
// Content block type detection
|
|
175
|
+
// ═══════════════════════════════════════════════════════════
|
|
176
|
+
/** Chart.js plugin CDN URLs keyed by chart type */
|
|
177
|
+
const CHART_PLUGIN_CDNS = {
|
|
178
|
+
sankey: "https://cdn.jsdelivr.net/npm/chartjs-chart-sankey",
|
|
179
|
+
treemap: "https://cdn.jsdelivr.net/npm/chartjs-chart-treemap@3",
|
|
180
|
+
};
|
|
173
181
|
/** Collect all content block arrays from a slide layout */
|
|
174
182
|
const collectContentArrays = (slide) => {
|
|
175
183
|
const arrays = [];
|
|
@@ -198,26 +206,38 @@ const collectContentArrays = (slide) => {
|
|
|
198
206
|
}
|
|
199
207
|
return arrays;
|
|
200
208
|
};
|
|
209
|
+
/** Collect chart type from a chart block */
|
|
210
|
+
const collectChartPlugin = (block, plugins) => {
|
|
211
|
+
if (block.type === "chart") {
|
|
212
|
+
const chartType = block.chartData?.type;
|
|
213
|
+
if (chartType && CHART_PLUGIN_CDNS[chartType]) {
|
|
214
|
+
plugins.add(CHART_PLUGIN_CDNS[chartType]);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
201
218
|
/** Detect whether chart or mermaid content blocks exist in a slide */
|
|
202
219
|
export const detectBlockTypes = (slide) => {
|
|
203
220
|
const arrays = collectContentArrays(slide);
|
|
204
221
|
let hasChart = false;
|
|
205
222
|
let hasMermaid = false;
|
|
223
|
+
const plugins = new Set();
|
|
206
224
|
arrays.forEach((blocks) => {
|
|
207
225
|
blocks.forEach((block) => {
|
|
208
226
|
if (block.type === "chart")
|
|
209
227
|
hasChart = true;
|
|
210
228
|
if (block.type === "mermaid")
|
|
211
229
|
hasMermaid = true;
|
|
230
|
+
collectChartPlugin(block, plugins);
|
|
212
231
|
if (block.type === "section" && block.content) {
|
|
213
232
|
block.content.forEach((inner) => {
|
|
214
233
|
if (inner.type === "chart")
|
|
215
234
|
hasChart = true;
|
|
216
235
|
if (inner.type === "mermaid")
|
|
217
236
|
hasMermaid = true;
|
|
237
|
+
collectChartPlugin(inner, plugins);
|
|
218
238
|
});
|
|
219
239
|
}
|
|
220
240
|
});
|
|
221
241
|
});
|
|
222
|
-
return { hasChart, hasMermaid };
|
|
242
|
+
return { hasChart, hasMermaid, chartPlugins: [...plugins] };
|
|
223
243
|
};
|
package/lib/types/agent.d.ts
CHANGED
|
@@ -70,8 +70,14 @@ export type GenAIImageAgentConfig = {
|
|
|
70
70
|
apiKey?: string;
|
|
71
71
|
};
|
|
72
72
|
export type ReplicateImageAgentConfig = AgentConfig;
|
|
73
|
+
export type MovieReferenceImage = {
|
|
74
|
+
imagePath: string;
|
|
75
|
+
referenceType: "ASSET" | "STYLE";
|
|
76
|
+
};
|
|
73
77
|
export type MovieAgentInputs = AgentPromptInputs & {
|
|
74
78
|
imagePath?: string;
|
|
79
|
+
lastFrameImagePath?: string;
|
|
80
|
+
referenceImages?: MovieReferenceImage[];
|
|
75
81
|
movieFile: string;
|
|
76
82
|
};
|
|
77
83
|
export type GoogleMovieAgentParams = ImageAgentParams & {
|
|
@@ -88,17 +88,12 @@ export declare const provider2MovieAgent: {
|
|
|
88
88
|
defaultModel: string;
|
|
89
89
|
models: string[];
|
|
90
90
|
keyName: string;
|
|
91
|
-
modelParams: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
};
|
|
98
|
-
"veo-2.0-generate-001": {
|
|
99
|
-
durations: number[];
|
|
100
|
-
};
|
|
101
|
-
};
|
|
91
|
+
modelParams: Record<string, {
|
|
92
|
+
durations: number[];
|
|
93
|
+
supportsLastFrame: boolean;
|
|
94
|
+
supportsReferenceImages: boolean;
|
|
95
|
+
supportsPersonGeneration: boolean;
|
|
96
|
+
}>;
|
|
102
97
|
};
|
|
103
98
|
mock: {
|
|
104
99
|
agentName: string;
|
|
@@ -151,6 +151,7 @@ export const provider2MovieAgent = {
|
|
|
151
151
|
"minimax/hailuo-02": {
|
|
152
152
|
durations: [6], // NOTE: 10 for only 720p
|
|
153
153
|
start_image: "first_frame_image",
|
|
154
|
+
last_image: "end_image",
|
|
154
155
|
price_per_sec: 0.08,
|
|
155
156
|
},
|
|
156
157
|
"minimax/hailuo-02-fast": {
|
|
@@ -184,12 +185,21 @@ export const provider2MovieAgent = {
|
|
|
184
185
|
modelParams: {
|
|
185
186
|
"veo-3.1-generate-preview": {
|
|
186
187
|
durations: [4, 6, 8],
|
|
188
|
+
supportsLastFrame: true,
|
|
189
|
+
supportsReferenceImages: true,
|
|
190
|
+
supportsPersonGeneration: false,
|
|
187
191
|
},
|
|
188
192
|
"veo-3.0-generate-001": {
|
|
189
193
|
durations: [4, 6, 8],
|
|
194
|
+
supportsLastFrame: false,
|
|
195
|
+
supportsReferenceImages: false,
|
|
196
|
+
supportsPersonGeneration: false,
|
|
190
197
|
},
|
|
191
198
|
"veo-2.0-generate-001": {
|
|
192
199
|
durations: [5, 6, 7, 8],
|
|
200
|
+
supportsLastFrame: false, // Vertex AI only
|
|
201
|
+
supportsReferenceImages: false,
|
|
202
|
+
supportsPersonGeneration: true,
|
|
193
203
|
},
|
|
194
204
|
},
|
|
195
205
|
},
|