mulmocast 0.0.1 → 0.0.3

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.
Files changed (115) hide show
  1. package/README.md +129 -15
  2. package/assets/font/NotoSansJP-Regular.ttf +0 -0
  3. package/assets/html/chart.html +38 -0
  4. package/assets/html/mermaid.html +51 -0
  5. package/assets/templates/business.json +57 -14
  6. package/assets/templates/children_book.json +1 -3
  7. package/assets/templates/coding.json +140 -0
  8. package/lib/actions/audio.d.ts +2 -2
  9. package/lib/actions/audio.js +88 -101
  10. package/lib/actions/images.d.ts +1 -1
  11. package/lib/actions/images.js +50 -88
  12. package/lib/actions/index.d.ts +5 -0
  13. package/lib/actions/index.js +5 -0
  14. package/lib/actions/movie.d.ts +9 -1
  15. package/lib/actions/movie.js +124 -65
  16. package/lib/actions/pdf.d.ts +2 -0
  17. package/lib/actions/pdf.js +211 -0
  18. package/lib/actions/pdf2.d.ts +2 -0
  19. package/lib/actions/pdf2.js +203 -0
  20. package/lib/actions/translate.d.ts +1 -1
  21. package/lib/actions/translate.js +38 -61
  22. package/lib/agents/add_bgm_agent.d.ts +1 -1
  23. package/lib/agents/add_bgm_agent.js +10 -14
  24. package/lib/agents/anthropic_agent.d.ts +23 -0
  25. package/lib/agents/anthropic_agent.js +162 -0
  26. package/lib/agents/combine_audio_files_agent.d.ts +1 -1
  27. package/lib/agents/combine_audio_files_agent.js +33 -32
  28. package/lib/agents/image_google_agent.d.ts +1 -1
  29. package/lib/agents/image_google_agent.js +8 -11
  30. package/lib/agents/image_openai_agent.js +7 -14
  31. package/lib/agents/index.d.ts +8 -8
  32. package/lib/agents/index.js +13 -30
  33. package/lib/agents/mulmo_prompts_agent.d.ts +1 -1
  34. package/lib/agents/mulmo_prompts_agent.js +7 -11
  35. package/lib/agents/nested_agent.d.ts +9 -0
  36. package/lib/agents/nested_agent.js +138 -0
  37. package/lib/agents/prompts_data.js +1 -4
  38. package/lib/agents/tts_nijivoice_agent.d.ts +1 -1
  39. package/lib/agents/tts_nijivoice_agent.js +8 -12
  40. package/lib/agents/tts_openai_agent.js +9 -16
  41. package/lib/agents/validate_mulmo_script_agent.d.ts +1 -1
  42. package/lib/agents/validate_mulmo_script_agent.js +6 -10
  43. package/lib/cli/args.d.ts +5 -2
  44. package/lib/cli/args.js +52 -35
  45. package/lib/cli/cli.d.ts +14 -0
  46. package/lib/cli/cli.js +74 -57
  47. package/lib/cli/common.js +1 -5
  48. package/lib/cli/tool-args.d.ts +4 -1
  49. package/lib/cli/tool-args.js +29 -18
  50. package/lib/cli/tool-cli.js +34 -51
  51. package/lib/methods/index.d.ts +4 -3
  52. package/lib/methods/index.js +4 -19
  53. package/lib/methods/mulmo_media_source.d.ts +4 -0
  54. package/lib/methods/mulmo_media_source.js +21 -0
  55. package/lib/methods/mulmo_script.d.ts +6 -5
  56. package/lib/methods/mulmo_script.js +29 -16
  57. package/lib/methods/mulmo_script_template.d.ts +1 -1
  58. package/lib/methods/mulmo_script_template.js +4 -10
  59. package/lib/methods/mulmo_studio_context.d.ts +1 -1
  60. package/lib/methods/mulmo_studio_context.js +3 -9
  61. package/lib/tools/create_mulmo_script_from_url.d.ts +3 -0
  62. package/lib/tools/create_mulmo_script_from_url.js +152 -0
  63. package/lib/tools/create_mulmo_script_interactively.d.ts +3 -0
  64. package/lib/tools/create_mulmo_script_interactively.js +258 -0
  65. package/lib/tools/dump_prompt.js +5 -8
  66. package/lib/tools/prompt.js +9 -11
  67. package/lib/tools/seed_from_url2.d.ts +3 -0
  68. package/lib/tools/seed_from_url2.js +154 -0
  69. package/lib/types/index.d.ts +2 -1
  70. package/lib/types/index.js +2 -17
  71. package/lib/types/schema.d.ts +3624 -2798
  72. package/lib/types/schema.js +172 -123
  73. package/lib/types/type.d.ts +34 -3
  74. package/lib/types/type.js +1 -2
  75. package/lib/utils/const.d.ts +4 -1
  76. package/lib/utils/const.js +6 -6
  77. package/lib/utils/file.d.ts +22 -4
  78. package/lib/utils/file.js +100 -79
  79. package/lib/utils/filters.d.ts +1 -0
  80. package/lib/utils/filters.js +47 -26
  81. package/lib/utils/image_plugins/chart.d.ts +3 -0
  82. package/lib/utils/image_plugins/chart.js +18 -0
  83. package/lib/utils/image_plugins/image.d.ts +2 -0
  84. package/lib/utils/image_plugins/image.js +3 -0
  85. package/lib/utils/image_plugins/index.d.ts +7 -0
  86. package/lib/utils/image_plugins/index.js +7 -0
  87. package/lib/utils/image_plugins/markdown.d.ts +3 -0
  88. package/lib/utils/image_plugins/markdown.js +11 -0
  89. package/lib/utils/image_plugins/mermaid.d.ts +3 -0
  90. package/lib/utils/image_plugins/mermaid.js +21 -0
  91. package/lib/utils/image_plugins/movie.d.ts +2 -0
  92. package/lib/utils/image_plugins/movie.js +3 -0
  93. package/lib/utils/image_plugins/source.d.ts +4 -0
  94. package/lib/utils/image_plugins/source.js +15 -0
  95. package/lib/utils/image_plugins/text_slide.d.ts +3 -0
  96. package/lib/utils/image_plugins/text_slide.js +12 -0
  97. package/lib/utils/image_plugins/type_guards.d.ts +6 -0
  98. package/lib/utils/image_plugins/type_guards.js +21 -0
  99. package/lib/utils/image_preprocess.d.ts +14 -0
  100. package/lib/utils/image_preprocess.js +52 -0
  101. package/lib/utils/inquirer.d.ts +2 -0
  102. package/lib/utils/inquirer.js +33 -0
  103. package/lib/utils/markdown.d.ts +3 -1
  104. package/lib/utils/markdown.js +20 -19
  105. package/lib/utils/pdf.d.ts +8 -0
  106. package/lib/utils/pdf.js +75 -0
  107. package/lib/utils/plugins.d.ts +5 -0
  108. package/lib/utils/plugins.js +11 -0
  109. package/lib/utils/preprocess.d.ts +70 -123
  110. package/lib/utils/preprocess.js +37 -43
  111. package/lib/utils/string.js +4 -10
  112. package/lib/utils/text_hash.js +2 -39
  113. package/lib/utils/utils.d.ts +12 -0
  114. package/lib/utils/utils.js +34 -0
  115. package/package.json +23 -8
@@ -1,207 +1,256 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.urlsSchema = exports.mulmoScriptTemplateSchema = exports.mulmoStudioSchema = exports.mulmoStudioBeatSchema = exports.mulmoScriptSchema = exports.mulmoSpeechParamsSchema = exports.mulmoCastCreditSchema = exports.mulmoDimensionSchema = exports.mulmoBeatSchema = exports.videoParamsSchema = exports.textSlideParamsSchema = exports.mulmoImageParamsSchema = exports.mulmoAudioAssetSchema = exports.mulmoMediaSchema = exports.speakerDictionarySchema = exports.speechOptionsSchema = exports.multiLingualTextsSchema = exports.localizedTextSchema = exports.langSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.langSchema = zod_1.z.string();
6
- const URLStringSchema = zod_1.z.string().url();
7
- exports.localizedTextSchema = zod_1.z
8
- .object({
9
- text: zod_1.z.string(),
10
- lang: zod_1.z.string(),
1
+ import { z } from "zod";
2
+ export const langSchema = z.string();
3
+ const URLStringSchema = z.string().url();
4
+ export const localizedTextSchema = z
5
+ .object({
6
+ text: z.string(),
7
+ lang: z.string(),
11
8
  // caption: z.string(),
12
- texts: zod_1.z.array(zod_1.z.string()).optional(),
13
- ttsTexts: zod_1.z.array(zod_1.z.string()).optional(),
14
- duration: zod_1.z.number().optional(), // generated // video duration time(ms)
9
+ texts: z.array(z.string()).optional(),
10
+ ttsTexts: z.array(z.string()).optional(),
11
+ duration: z.number().optional(), // generated // video duration time(ms)
15
12
  // filename: z.string().optional(), // generated //
16
13
  })
17
14
  .strict();
18
- exports.multiLingualTextsSchema = zod_1.z.record(exports.langSchema, exports.localizedTextSchema);
19
- exports.speechOptionsSchema = zod_1.z
15
+ export const multiLingualTextsSchema = z.record(langSchema, localizedTextSchema);
16
+ export const speechOptionsSchema = z
20
17
  .object({
21
- speed: zod_1.z.number().optional(), // default: 1.0
22
- instruction: zod_1.z.string().optional(),
18
+ speed: z.number().optional(), // default: 1.0
19
+ instruction: z.string().optional(),
23
20
  })
24
21
  .strict();
25
- const speakerIdSchema = zod_1.z.string();
26
- const speakerDataSchema = zod_1.z
22
+ const speakerIdSchema = z.string();
23
+ const speakerDataSchema = z
27
24
  .object({
28
- displayName: zod_1.z.record(exports.langSchema, zod_1.z.string()),
29
- voiceId: zod_1.z.string(),
30
- speechOptions: exports.speechOptionsSchema.optional(),
25
+ displayName: z.record(langSchema, z.string()).optional(),
26
+ voiceId: z.string(),
27
+ speechOptions: speechOptionsSchema.optional(),
31
28
  })
32
29
  .strict();
33
- exports.speakerDictionarySchema = zod_1.z.record(speakerIdSchema, speakerDataSchema);
34
- const mediaSourceSchema = zod_1.z.discriminatedUnion("kind", [
35
- zod_1.z.object({ kind: zod_1.z.literal("url"), url: URLStringSchema }).strict(), // https://example.com/foo.pdf
36
- zod_1.z.object({ kind: zod_1.z.literal("data"), data: zod_1.z.string() }).strict(), // base64
37
- zod_1.z.object({ kind: zod_1.z.literal("path"), path: zod_1.z.string() }).strict(), // foo.pdf
30
+ export const speakerDictionarySchema = z.record(speakerIdSchema, speakerDataSchema);
31
+ export const mediaSourceSchema = z.discriminatedUnion("kind", [
32
+ z.object({ kind: z.literal("url"), url: URLStringSchema }).strict(), // https://example.com/foo.pdf
33
+ z.object({ kind: z.literal("base64"), data: z.string() }).strict(), // base64
34
+ z.object({ kind: z.literal("text"), text: z.string() }).strict(), // plain text
35
+ z.object({ kind: z.literal("path"), path: z.string() }).strict(), // foo.pdf
38
36
  ]);
39
37
  // String is easier for AI, string array is easier for human
40
- const stringOrStringArray = zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]);
41
- const MulmoMarkdownMediaSchema = zod_1.z
38
+ const stringOrStringArray = z.union([z.string(), z.array(z.string())]);
39
+ export const mulmoMarkdownMediaSchema = z
42
40
  .object({
43
- type: zod_1.z.literal("markdown"),
41
+ type: z.literal("markdown"),
44
42
  markdown: stringOrStringArray,
45
43
  })
46
44
  .strict();
47
- const MulmoWebMediaSchema = zod_1.z
45
+ const mulmoWebMediaSchema = z
48
46
  .object({
49
- type: zod_1.z.literal("web"),
47
+ type: z.literal("web"),
50
48
  url: URLStringSchema,
51
49
  })
52
50
  .strict();
53
- const MulmoPdfMediaSchema = zod_1.z
51
+ const mulmoPdfMediaSchema = z
54
52
  .object({
55
- type: zod_1.z.literal("pdf"),
53
+ type: z.literal("pdf"),
56
54
  source: mediaSourceSchema,
57
55
  })
58
56
  .strict();
59
- const MulmoImageMediaSchema = zod_1.z
57
+ export const mulmoImageMediaSchema = z
60
58
  .object({
61
- type: zod_1.z.literal("image"),
59
+ type: z.literal("image"),
62
60
  source: mediaSourceSchema,
63
61
  })
64
62
  .strict();
65
- const MulmoSvgMediaSchema = zod_1.z
63
+ const mulmoSvgMediaSchema = z
66
64
  .object({
67
- type: zod_1.z.literal("svg"),
65
+ type: z.literal("svg"),
68
66
  source: mediaSourceSchema,
69
67
  })
70
68
  .strict();
71
- const MulmoMovieMediaSchema = zod_1.z
69
+ const mulmoMovieMediaSchema = z
72
70
  .object({
73
- type: zod_1.z.literal("movie"),
71
+ type: z.literal("movie"),
74
72
  source: mediaSourceSchema,
75
73
  })
76
74
  .strict();
77
- const MulmoTextSlideMediaSchema = zod_1.z
75
+ export const mulmoTextSlideMediaSchema = z
78
76
  .object({
79
- type: zod_1.z.literal("textSlide"),
80
- slide: zod_1.z.object({
81
- title: zod_1.z.string(),
82
- bullets: zod_1.z.array(zod_1.z.string()),
77
+ type: z.literal("textSlide"),
78
+ slide: z.object({
79
+ title: z.string(),
80
+ bullets: z.array(z.string()),
83
81
  }),
84
82
  })
85
83
  .strict();
86
- exports.mulmoMediaSchema = zod_1.z.union([
87
- MulmoMarkdownMediaSchema,
88
- MulmoWebMediaSchema,
89
- MulmoPdfMediaSchema,
90
- MulmoImageMediaSchema,
91
- MulmoSvgMediaSchema,
92
- MulmoMovieMediaSchema,
93
- MulmoTextSlideMediaSchema,
84
+ export const mulmoChartMediaSchema = z
85
+ .object({
86
+ type: z.literal("chart"),
87
+ title: z.string(),
88
+ chartData: z.record(z.any()),
89
+ })
90
+ .strict();
91
+ export const mulmoMermaidMediaSchema = z
92
+ .object({
93
+ type: z.literal("mermaid"),
94
+ title: z.string().describe("The title of the diagram"),
95
+ code: mediaSourceSchema.describe("The code of the mermaid diagram"),
96
+ appendix: z.array(z.string()).optional().describe("The appendix of the mermaid diagram; typically, style information."),
97
+ })
98
+ .strict();
99
+ export const mulmoImageAssetSchema = z.union([
100
+ mulmoMarkdownMediaSchema,
101
+ mulmoWebMediaSchema,
102
+ mulmoPdfMediaSchema,
103
+ mulmoImageMediaSchema,
104
+ mulmoSvgMediaSchema,
105
+ mulmoMovieMediaSchema,
106
+ mulmoTextSlideMediaSchema,
107
+ mulmoChartMediaSchema,
108
+ mulmoMermaidMediaSchema,
94
109
  ]);
95
- const MulmoAudioMediaSchema = zod_1.z
110
+ const mulmoAudioMediaSchema = z
96
111
  .object({
97
- type: zod_1.z.literal("audio"),
112
+ type: z.literal("audio"),
98
113
  source: mediaSourceSchema,
99
114
  })
100
115
  .strict();
101
- const MulmoMidiMediaSchema = zod_1.z
116
+ const mulmoMidiMediaSchema = z
102
117
  .object({
103
- type: zod_1.z.literal("midi"),
104
- source: zod_1.z.string(), // TODO: define it later
118
+ type: z.literal("midi"),
119
+ source: z.string(), // TODO: define it later
105
120
  })
106
121
  .strict();
107
- exports.mulmoAudioAssetSchema = zod_1.z.union([MulmoAudioMediaSchema, MulmoMidiMediaSchema]);
108
- exports.mulmoImageParamsSchema = zod_1.z
122
+ export const mulmoAudioAssetSchema = z.union([mulmoAudioMediaSchema, mulmoMidiMediaSchema]);
123
+ export const mulmoImageParamsSchema = z
109
124
  .object({
110
- model: zod_1.z.string().optional(), // default: provider specific
111
- size: zod_1.z.string().optional(), // default: provider specific
112
- style: zod_1.z.string().optional(), // optional image style
113
- moderation: zod_1.z.string().optional(), // optional image style
125
+ model: z.string().optional(), // default: provider specific
126
+ size: z.string().optional(), // default: provider specific
127
+ style: z.string().optional(), // optional image style
128
+ moderation: z.string().optional(), // optional image style
114
129
  })
115
130
  .strict();
116
- exports.textSlideParamsSchema = zod_1.z
131
+ export const textSlideParamsSchema = z
117
132
  .object({
118
- cssStyles: zod_1.z.array(zod_1.z.string()),
133
+ cssStyles: stringOrStringArray,
119
134
  })
120
135
  .strict();
121
- exports.videoParamsSchema = zod_1.z
136
+ export const videoParamsSchema = z
122
137
  .object({
123
- padding: zod_1.z.number().optional(), // msec
138
+ padding: z.number().optional(), // msec
124
139
  })
125
140
  .strict();
126
- exports.mulmoBeatSchema = zod_1.z
141
+ export const mulmoBeatSchema = z
127
142
  .object({
128
- speaker: speakerIdSchema,
129
- text: zod_1.z.string(),
130
- image: exports.mulmoMediaSchema.optional(),
131
- audio: exports.mulmoAudioAssetSchema.optional(),
132
- imageParams: exports.mulmoImageParamsSchema.optional(), // beat specific parameters
133
- speechOptions: exports.speechOptionsSchema.optional(),
134
- textSlideParams: exports.textSlideParamsSchema.optional(),
135
- imagePrompt: zod_1.z.string().optional(), // specified or inserted by preprocessor
143
+ speaker: speakerIdSchema.default("Presenter"),
144
+ text: z.string(),
145
+ image: mulmoImageAssetSchema.optional(),
146
+ audio: mulmoAudioAssetSchema.optional(),
147
+ imageParams: mulmoImageParamsSchema.optional(), // beat specific parameters
148
+ speechOptions: speechOptionsSchema.optional(),
149
+ textSlideParams: textSlideParamsSchema.optional(),
150
+ imagePrompt: z.string().optional(), // specified or inserted by preprocessor
136
151
  })
137
152
  .strict();
138
- exports.mulmoDimensionSchema = zod_1.z
153
+ export const mulmoCanvasDimensionSchema = z
139
154
  .object({
140
- width: zod_1.z.number(),
141
- height: zod_1.z.number(),
155
+ width: z.number(),
156
+ height: z.number(),
142
157
  })
143
- .strict();
158
+ .default({ width: 1280, height: 720 });
144
159
  // export const voiceMapSchema = z.record(speakerIdSchema, z.string())
145
- exports.mulmoCastCreditSchema = zod_1.z
160
+ export const mulmoCastCreditSchema = z
146
161
  .object({
147
- version: zod_1.z.literal("1.0"),
148
- credit: zod_1.z.literal("closing").optional(),
162
+ version: z.literal("1.0"),
163
+ credit: z.literal("closing").optional(),
149
164
  })
150
165
  .strict();
151
- exports.mulmoSpeechParamsSchema = zod_1.z
166
+ export const text2SpeechProviderSchema = z.union([z.literal("openai"), z.literal("nijivoice")]).default("openai");
167
+ export const mulmoSpeechParamsSchema = z
152
168
  .object({
153
- provider: zod_1.z.string().optional(),
154
- speakers: exports.speakerDictionarySchema,
169
+ provider: text2SpeechProviderSchema, // has default value
170
+ speakers: speakerDictionarySchema,
155
171
  })
156
172
  .strict();
157
- exports.mulmoScriptSchema = zod_1.z
158
- .object({
159
- // global settings
160
- $mulmocast: exports.mulmoCastCreditSchema,
161
- title: zod_1.z.string(),
162
- description: zod_1.z.string().optional(),
163
- reference: zod_1.z.string().optional(),
164
- lang: exports.langSchema.optional(), // default "en"
165
- canvasSize: exports.mulmoDimensionSchema.optional(),
166
- beats: zod_1.z.array(exports.mulmoBeatSchema),
167
- speechParams: exports.mulmoSpeechParamsSchema,
168
- imageParams: exports.mulmoImageParamsSchema
173
+ export const text2ImageProviderSchema = z.union([z.literal("openai"), z.literal("google")]).default("openai");
174
+ export const mulmoPresentationStyleSchema = z.object({
175
+ $mulmocast: mulmoCastCreditSchema,
176
+ canvasSize: mulmoCanvasDimensionSchema, // has default value
177
+ speechParams: mulmoSpeechParamsSchema.default({
178
+ speakers: {
179
+ Presenter: {
180
+ voiceId: "shimmer",
181
+ displayName: {
182
+ en: "Presenter",
183
+ },
184
+ },
185
+ },
186
+ }),
187
+ imageParams: mulmoImageParamsSchema
169
188
  .extend({
170
- provider: zod_1.z.string().optional(),
189
+ provider: text2ImageProviderSchema, // has default value
171
190
  })
172
191
  .optional(),
173
192
  // for textSlides
174
- textSlideParams: exports.textSlideParamsSchema.optional(),
175
- videoParams: exports.videoParamsSchema.optional(),
176
- // images: ImageInfo[] // generated
177
- imagePath: zod_1.z.string().optional(), // for keynote images movie ??
178
- omitCaptions: zod_1.z.boolean().optional(), // default is false
193
+ textSlideParams: textSlideParamsSchema.optional(),
194
+ videoParams: videoParamsSchema.optional(),
195
+ // TODO: Switch to showCaptions later
196
+ omitCaptions: z.boolean().optional(), // default is false
197
+ });
198
+ export const mulmoReferenceSchema = z.object({
199
+ url: URLStringSchema,
200
+ title: z.string().optional(),
201
+ description: z.string().optional(),
202
+ type: z.union([z.literal("article"), z.literal("image"), z.literal("video"), z.literal("audio")]).default("article"),
203
+ });
204
+ export const mulmoScriptSchema = mulmoPresentationStyleSchema
205
+ .extend({
206
+ title: z.string().optional(),
207
+ description: z.string().optional(),
208
+ references: z.array(mulmoReferenceSchema).optional(),
209
+ lang: langSchema.optional(), // default "en"
210
+ beats: z.array(mulmoBeatSchema).min(1),
211
+ // TODO: Delete it later
212
+ imagePath: z.string().optional(), // for keynote images movie ??
179
213
  // for debugging
180
- __test_invalid__: zod_1.z.boolean().optional(),
214
+ __test_invalid__: z.boolean().optional(),
181
215
  })
182
216
  .strict();
183
- exports.mulmoStudioBeatSchema = exports.mulmoBeatSchema
184
- .extend({
185
- multiLingualTexts: exports.multiLingualTextsSchema.optional(),
186
- hash: zod_1.z.string().optional(),
187
- duration: zod_1.z.number().optional(),
188
- audioFile: zod_1.z.string().optional(),
189
- imageFile: zod_1.z.string().optional(), // path to the image
217
+ export const mulmoStudioBeatSchema = z
218
+ .object({
219
+ multiLingualTexts: multiLingualTextsSchema.optional(),
220
+ hash: z.string().optional(),
221
+ duration: z.number().optional(),
222
+ audioFile: z.string().optional(),
223
+ imageFile: z.string().optional(), // path to the image
224
+ })
225
+ .strict();
226
+ export const mulmoStudioSchema = z
227
+ .object({
228
+ script: mulmoScriptSchema,
229
+ filename: z.string(),
230
+ beats: z.array(mulmoStudioBeatSchema).min(1),
231
+ })
232
+ .strict();
233
+ export const mulmoScriptTemplateSchema = z
234
+ .object({
235
+ title: z.string(),
236
+ description: z.string(),
237
+ systemPrompt: z.string(),
238
+ script: mulmoScriptSchema.optional(),
190
239
  })
191
240
  .strict();
192
- exports.mulmoStudioSchema = zod_1.z
241
+ export const mulmoStoryboardSceneSchema = z
193
242
  .object({
194
- script: exports.mulmoScriptSchema,
195
- filename: zod_1.z.string(),
196
- beats: zod_1.z.array(exports.mulmoStudioBeatSchema),
243
+ description: z.string(),
244
+ references: z.array(mulmoReferenceSchema).optional(),
197
245
  })
246
+ .describe("A detailed description of the content of the scene, not the presentation style")
198
247
  .strict();
199
- exports.mulmoScriptTemplateSchema = zod_1.z
248
+ export const mulmoStoryboardSchema = z
200
249
  .object({
201
- title: zod_1.z.string(),
202
- description: zod_1.z.string(),
203
- systemPrompt: zod_1.z.string(),
204
- script: exports.mulmoScriptSchema.optional(),
250
+ title: z.string(),
251
+ references: z.array(mulmoReferenceSchema).optional(),
252
+ scenes: z.array(mulmoStoryboardSceneSchema),
205
253
  })
254
+ .describe("A storyboard for a presentation, a story, a video, etc.")
206
255
  .strict();
207
- exports.urlsSchema = zod_1.z.array(zod_1.z.string().url({ message: "Invalid URL format" }));
256
+ export const urlsSchema = z.array(z.string().url({ message: "Invalid URL format" }));
@@ -1,4 +1,5 @@
1
- import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoSpeechParamsSchema, textSlideParamsSchema, speechOptionsSchema, mulmoDimensionSchema, mulmoScriptTemplateSchema } from "./schema";
1
+ import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoSpeechParamsSchema, textSlideParamsSchema, speechOptionsSchema, mulmoCanvasDimensionSchema, mulmoScriptTemplateSchema, text2ImageProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema } from "./schema.js";
2
+ import { pdf_modes, pdf_sizes } from "../utils/const.js";
2
3
  import { z } from "zod";
3
4
  export type LANG = z.infer<typeof langSchema>;
4
5
  export type MulmoBeat = z.infer<typeof mulmoBeatSchema>;
@@ -7,27 +8,57 @@ export type MulmoSpeechParams = z.infer<typeof mulmoSpeechParamsSchema>;
7
8
  export type SpeechOptions = z.infer<typeof speechOptionsSchema>;
8
9
  export type MulmoImageParams = z.infer<typeof mulmoImageParamsSchema>;
9
10
  export type TextSlideParams = z.infer<typeof textSlideParamsSchema>;
11
+ export type Text2ImageProvider = z.infer<typeof text2ImageProviderSchema>;
12
+ export type Text2SpeechProvider = z.infer<typeof text2SpeechProviderSchema>;
10
13
  export type LocalizedText = z.infer<typeof localizedTextSchema>;
11
14
  export type MulmoScript = z.infer<typeof mulmoScriptSchema>;
12
- export type MulmoDimension = z.infer<typeof mulmoDimensionSchema>;
15
+ export type MulmoPresentationStyle = z.infer<typeof mulmoPresentationStyleSchema>;
16
+ export type MulmoCanvasDimension = z.infer<typeof mulmoCanvasDimensionSchema>;
17
+ export type MulmoStoryboardScene = z.infer<typeof mulmoStoryboardSceneSchema>;
18
+ export type MulmoStoryboard = z.infer<typeof mulmoStoryboardSchema>;
13
19
  export type MulmoStudioBeat = z.infer<typeof mulmoStudioBeatSchema>;
20
+ export type MulmoMediaSource = z.infer<typeof mediaSourceSchema>;
14
21
  export type MulmoStudio = z.infer<typeof mulmoStudioSchema>;
15
22
  export type MulmoScriptTemplate = z.infer<typeof mulmoScriptTemplateSchema>;
23
+ export type MulmoTextSlideMedia = z.infer<typeof mulmoTextSlideMediaSchema>;
24
+ export type MulmoMarkdownMedia = z.infer<typeof mulmoMarkdownMediaSchema>;
25
+ export type MulmoImageMedia = z.infer<typeof mulmoImageMediaSchema>;
26
+ export type MulmoChartMedia = z.infer<typeof mulmoChartMediaSchema>;
27
+ export type MulmoMermaidMedia = z.infer<typeof mulmoMermaidMediaSchema>;
16
28
  export type FileDirs = {
17
29
  mulmoFilePath: string;
18
30
  mulmoFileDirPath: string;
19
31
  baseDirPath: string;
20
32
  outDirPath: string;
21
33
  imageDirPath: string;
22
- scratchpadDirPath: string;
34
+ audioDirPath: string;
23
35
  };
24
36
  export type MulmoStudioContext = {
25
37
  fileDirs: FileDirs;
26
38
  studio: MulmoStudio;
39
+ force: boolean;
27
40
  };
28
41
  export type ScriptingParams = {
29
42
  urls: string[];
30
43
  outDirPath: string;
44
+ cacheDirPath: string;
31
45
  templateName: string;
32
46
  filename: string;
47
+ llm_model?: string;
48
+ llm_agent?: string;
33
49
  };
50
+ export type ImageProcessorParams = {
51
+ beat: MulmoBeat;
52
+ context: MulmoStudioContext;
53
+ imagePath: string;
54
+ textSlideStyle: string;
55
+ canvasSize: MulmoCanvasDimension;
56
+ };
57
+ export type PDFMode = (typeof pdf_modes)[number];
58
+ export type PDFSize = (typeof pdf_sizes)[number];
59
+ export type Text2ImageAgentInfo = {
60
+ provider: Text2ImageProvider;
61
+ agent: string;
62
+ imageParams: MulmoImageParams;
63
+ };
64
+ export type BeatMediaType = "movie" | "image";
package/lib/types/type.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,3 +1,6 @@
1
1
  export declare const outDirName = "output";
2
- export declare const scratchpadDirName = "scratchpad";
2
+ export declare const audioDirName = "audio";
3
3
  export declare const imageDirName = "images";
4
+ export declare const cacheDirName = "cache";
5
+ export declare const pdf_modes: string[];
6
+ export declare const pdf_sizes: string[];
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.imageDirName = exports.scratchpadDirName = exports.outDirName = void 0;
4
- exports.outDirName = "output";
5
- exports.scratchpadDirName = "scratchpad";
6
- exports.imageDirName = "images";
1
+ export const outDirName = "output";
2
+ export const audioDirName = "audio";
3
+ export const imageDirName = "images";
4
+ export const cacheDirName = "cache";
5
+ export const pdf_modes = ["slide", "talk", "handout"];
6
+ export const pdf_sizes = ["letter", "a4"];
@@ -1,4 +1,5 @@
1
- import { MulmoScript, MulmoScriptTemplate } from "../types";
1
+ import { MulmoScript, MulmoScriptTemplate, MulmoMediaSource, MulmoStudioContext } from "../types/index.js";
2
+ import { PDFMode } from "../types/index.js";
2
3
  export declare function readMulmoScriptFile<T = MulmoScript>(path: string, errorMessage: string): {
3
4
  mulmoData: T;
4
5
  mulmoDataPath: string;
@@ -9,16 +10,32 @@ export declare function readMulmoScriptFile<T = MulmoScript>(path: string): {
9
10
  mulmoDataPath: string;
10
11
  fileName: string;
11
12
  } | null;
13
+ export declare const fetchMulmoScriptFile: (url: string) => Promise<{
14
+ result: boolean;
15
+ status: number;
16
+ script?: undefined;
17
+ } | {
18
+ result: boolean;
19
+ script: any;
20
+ status?: undefined;
21
+ } | {
22
+ result: boolean;
23
+ status: string;
24
+ script?: undefined;
25
+ }>;
12
26
  export declare const getOutputStudioFilePath: (outDirPath: string, fileName: string) => string;
13
- export declare const getOutputBGMFilePath: (outDirPath: string, fileName: string) => string;
27
+ export declare const getAudioSegmentDirPath: (audioDirPath: string, studioFileName: string) => string;
28
+ export declare const getAudioSegmentFilePath: (audioDirPath: string, studioFileName: string, fileName: string) => string;
29
+ export declare const getAudioCombinedFilePath: (audioDirPath: string, fileName: string) => string;
30
+ export declare const getAudioArtifactFilePath: (outDirPath: string, fileName: string) => string;
14
31
  export declare const getOutputVideoFilePath: (outDirPath: string, fileName: string) => string;
15
- export declare const getOutputAudioFilePath: (outDirPath: string, fileName: string) => string;
16
- export declare const getScratchpadFilePath: (scratchpadDirName: string, fileName: string) => string;
32
+ export declare const getOutputPdfFilePath: (outDirPath: string, fileName: string, pdfMode: PDFMode) => string;
17
33
  export declare const getTemplateFilePath: (templateName: string) => string;
18
34
  export declare const mkdir: (dirPath: string) => void;
19
35
  export declare const silentPath: string;
20
36
  export declare const silentLastPath: string;
21
37
  export declare const defaultBGMPath: string;
38
+ export declare const getHTMLFile: (filename: string) => string;
22
39
  export declare const getBaseDirPath: (basedir?: string) => string;
23
40
  export declare const getFullPath: (baseDirPath: string | undefined, file: string) => string;
24
41
  export declare const readTemplatePrompt: (templateName: string) => string;
@@ -26,3 +43,4 @@ export declare const getAvailableTemplates: () => (MulmoScriptTemplate & {
26
43
  filename: string;
27
44
  })[];
28
45
  export declare const writingMessage: (filePath: string) => void;
46
+ export declare const resolveMediaSource: (source: MulmoMediaSource, context: MulmoStudioContext) => string | null;