@mulmocast/slide 0.1.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.
Files changed (47) hide show
  1. package/README.md +458 -0
  2. package/lib/actions/bundle.d.ts +3 -0
  3. package/lib/actions/bundle.d.ts.map +1 -0
  4. package/lib/actions/bundle.js +60 -0
  5. package/lib/actions/bundle.js.map +1 -0
  6. package/lib/actions/common.d.ts +21 -0
  7. package/lib/actions/common.d.ts.map +1 -0
  8. package/lib/actions/common.js +159 -0
  9. package/lib/actions/common.js.map +1 -0
  10. package/lib/actions/movie.d.ts +3 -0
  11. package/lib/actions/movie.d.ts.map +1 -0
  12. package/lib/actions/movie.js +58 -0
  13. package/lib/actions/movie.js.map +1 -0
  14. package/lib/actions/upload.d.ts +6 -0
  15. package/lib/actions/upload.d.ts.map +1 -0
  16. package/lib/actions/upload.js +172 -0
  17. package/lib/actions/upload.js.map +1 -0
  18. package/lib/cli.d.ts +3 -0
  19. package/lib/cli.d.ts.map +1 -0
  20. package/lib/cli.js +301 -0
  21. package/lib/cli.js.map +1 -0
  22. package/lib/convert/marp.d.ts +22 -0
  23. package/lib/convert/marp.d.ts.map +1 -0
  24. package/lib/convert/marp.js +375 -0
  25. package/lib/convert/marp.js.map +1 -0
  26. package/lib/convert/pdf.d.ts +14 -0
  27. package/lib/convert/pdf.d.ts.map +1 -0
  28. package/lib/convert/pdf.js +130 -0
  29. package/lib/convert/pdf.js.map +1 -0
  30. package/lib/convert/pptx.d.ts +13 -0
  31. package/lib/convert/pptx.d.ts.map +1 -0
  32. package/lib/convert/pptx.js +138 -0
  33. package/lib/convert/pptx.js.map +1 -0
  34. package/lib/utils/lang.d.ts +16 -0
  35. package/lib/utils/lang.d.ts.map +1 -0
  36. package/lib/utils/lang.js +37 -0
  37. package/lib/utils/lang.js.map +1 -0
  38. package/lib/utils/llm.d.ts +21 -0
  39. package/lib/utils/llm.d.ts.map +1 -0
  40. package/lib/utils/llm.js +200 -0
  41. package/lib/utils/llm.js.map +1 -0
  42. package/lib/utils/pdf.d.ts +37 -0
  43. package/lib/utils/pdf.d.ts.map +1 -0
  44. package/lib/utils/pdf.js +142 -0
  45. package/lib/utils/pdf.js.map +1 -0
  46. package/package.json +67 -0
  47. package/tools/keynote/extract.scpt +195 -0
package/README.md ADDED
@@ -0,0 +1,458 @@
1
+ # MulmoCast-Slides
2
+
3
+ A collection of tools to convert presentation files into MulmoScript format, enabling automated narration and processing of slide decks.
4
+
5
+ ## Overview
6
+
7
+ MulmoCast-Slides provides converters that extract slides and speaker notes from various presentation formats (Keynote, PowerPoint, PDF, etc.) and generate MulmoScript JSON files. Each slide is exported as an image paired with its speaker notes.
8
+
9
+ ## System Requirements
10
+
11
+ ### Node.js
12
+
13
+ - Node.js 22 or later
14
+ - yarn or npm
15
+
16
+ ### macOS
17
+
18
+ ```bash
19
+ # Required for PDF and PPTX conversion
20
+ brew install imagemagick ghostscript
21
+
22
+ # Required for PPTX conversion (converts PPTX to PDF)
23
+ brew install --cask libreoffice
24
+
25
+ # Required for Keynote conversion
26
+ # Keynote app must be installed from App Store
27
+ ```
28
+
29
+ ### Linux (Ubuntu/Debian)
30
+
31
+ ```bash
32
+ # Required for PDF and PPTX conversion
33
+ sudo apt-get update
34
+ sudo apt-get install -y imagemagick ghostscript
35
+
36
+ # Required for PPTX conversion
37
+ sudo apt-get install -y libreoffice
38
+ ```
39
+
40
+ ### Environment Variables
41
+
42
+ ```bash
43
+ # Required for LLM narration generation (-g option)
44
+ export OPENAI_API_KEY=your-openai-api-key
45
+
46
+ # Optional: Set default language (en, ja, fr, de)
47
+ export MULMO_LANG=ja
48
+ ```
49
+
50
+ ### Feature Requirements Summary
51
+
52
+ | Feature | macOS | Linux | Required Tools |
53
+ |---------|-------|-------|----------------|
54
+ | Marp (.md) | Yes | Yes | Node.js only |
55
+ | PPTX (.pptx) | Yes | Yes | LibreOffice, ImageMagick, Ghostscript |
56
+ | PDF (.pdf) | Yes | Yes | ImageMagick, Ghostscript |
57
+ | Keynote (.key) | Yes | No | Keynote app, Python 3 |
58
+ | LLM Narration (-g) | Yes | Yes | OPENAI_API_KEY |
59
+
60
+ ## Installation
61
+
62
+ ### npm (Global Installation)
63
+
64
+ ```bash
65
+ npm install -g @mulmocast/slide
66
+ ```
67
+
68
+ After installation, use the `mulmo-slide` command:
69
+
70
+ ```bash
71
+ mulmo-slide marp presentation.md
72
+ mulmo-slide pptx presentation.pptx
73
+ mulmo-slide pdf presentation.pdf
74
+ mulmo-slide movie presentation.pptx
75
+ ```
76
+
77
+ ### npx (No Installation)
78
+
79
+ ```bash
80
+ npx @mulmocast/slide marp presentation.md
81
+ npx @mulmocast/slide pptx presentation.pptx -g -l ja
82
+ ```
83
+
84
+ ### Development Setup
85
+
86
+ ```bash
87
+ git clone https://github.com/receptron/MulmoCast-Slides.git
88
+ cd MulmoCast-Slides
89
+ yarn install
90
+ yarn build # Build TypeScript to lib/
91
+ ```
92
+
93
+ ### Running Sample Files
94
+
95
+ The `samples/` directory contains example files for testing:
96
+
97
+ ```bash
98
+ # Marp markdown
99
+ yarn marp samples/sample.md
100
+ yarn marp samples/custom_theme_demo.md --theme samples/custom-ocean.css
101
+
102
+ # PowerPoint
103
+ yarn pptx samples/omochikaeri.pptx
104
+ yarn pptx samples/omochikaeri.pptx -g -l ja # with LLM narration
105
+
106
+ # PDF
107
+ yarn pdf samples/20251008_2.pdf
108
+ yarn pdf samples/20251008_2.pdf -g -l ja # with LLM narration
109
+
110
+ # Keynote (macOS only)
111
+ yarn keynote samples/GraphAI.key
112
+
113
+ # Generate movie from sample
114
+ yarn movie samples/omochikaeri.pptx -g -l ja
115
+
116
+ # Generate bundle from sample
117
+ yarn bundle samples/sample.md -g -l ja
118
+ ```
119
+
120
+ **Note:** When re-running commands, the existing `mulmo_script.json` will be reused. To regenerate:
121
+ - Delete the existing JSON file: `rm scripts/<basename>/mulmo_script.json`
122
+ - Or use the `-f` (force) flag with movie/bundle: `yarn movie samples/sample.pptx -f -g`
123
+
124
+ ## Unified CLI
125
+
126
+ All commands are available through the unified `mulmo-slide` CLI:
127
+
128
+ ```bash
129
+ mulmo-slide <command> [options]
130
+
131
+ Commands:
132
+ mulmo-slide marp <file> Convert Marp markdown to MulmoScript
133
+ mulmo-slide pptx <file> Convert PowerPoint to MulmoScript
134
+ mulmo-slide pdf <file> Convert PDF to MulmoScript
135
+ mulmo-slide keynote <file> Convert Keynote to MulmoScript (macOS only)
136
+ mulmo-slide movie <file> Generate movie from presentation
137
+ mulmo-slide bundle <file> Generate MulmoViewer bundle from presentation
138
+ ```
139
+
140
+ For development, you can also use yarn commands:
141
+
142
+ ```bash
143
+ yarn cli marp presentation.md
144
+ yarn marp presentation.md # shorthand
145
+ ```
146
+
147
+ ## MulmoScript Format
148
+
149
+ MulmoScript is a JSON-based format that combines images with text for multimedia presentations. It supports multiple image formats:
150
+
151
+ ### PNG Image Format
152
+
153
+ ```json
154
+ {
155
+ "$mulmocast": {
156
+ "version": "1.1",
157
+ "credit": "closing"
158
+ },
159
+ "beats": [
160
+ {
161
+ "text": "Speaker notes or narration text",
162
+ "image": {
163
+ "type": "image",
164
+ "source": {
165
+ "kind": "path",
166
+ "path": "/absolute/path/to/slide.png"
167
+ }
168
+ }
169
+ }
170
+ ]
171
+ }
172
+ ```
173
+
174
+ ### Markdown Format
175
+
176
+ ```json
177
+ {
178
+ "$mulmocast": {
179
+ "version": "1.1",
180
+ "credit": "closing"
181
+ },
182
+ "beats": [
183
+ {
184
+ "text": "Speaker notes or narration text",
185
+ "image": {
186
+ "type": "markdown",
187
+ "markdown": [
188
+ "# Slide Title",
189
+ "- Bullet point 1",
190
+ "- Bullet point 2"
191
+ ]
192
+ }
193
+ }
194
+ ]
195
+ }
196
+ ```
197
+
198
+ ## Available Tools
199
+
200
+ ### Keynote Extractor
201
+
202
+ Extracts slides and speaker notes from Apple Keynote presentations.
203
+
204
+ **Usage:**
205
+
206
+ ```bash
207
+ # CLI
208
+ mulmo-slide keynote path/to/presentation.key
209
+
210
+ # yarn (development)
211
+ yarn keynote path/to/presentation.key
212
+
213
+ # Test with sample
214
+ yarn test:keynote
215
+ ```
216
+
217
+ **Requirements:**
218
+ - macOS
219
+ - Keynote installed
220
+ - Python 3
221
+
222
+ **Output:**
223
+ - `scripts/<basename>/images/` - PNG images of each slide
224
+ - `scripts/<basename>/mulmo_script.json` - MulmoScript JSON file
225
+
226
+ ### Marp Extractor
227
+
228
+ Extracts slides and speaker notes from Marp markdown presentations, generating both PNG and Markdown formats.
229
+
230
+ **Usage:**
231
+
232
+ ```bash
233
+ # CLI
234
+ mulmo-slide marp path/to/presentation.md
235
+ mulmo-slide marp path/to/presentation.md -g -l en # with LLM narration
236
+
237
+ # yarn (development)
238
+ yarn marp path/to/presentation.md
239
+ yarn marp path/to/presentation.md -g -l en
240
+
241
+ # Test with sample
242
+ yarn test:marp
243
+ ```
244
+
245
+ **Options:**
246
+ - `-l, --lang` - Language for the MulmoScript (en, ja, fr, de)
247
+ - `-g, --generate-text` - Generate narration text using OpenAI LLM
248
+ - `--theme` - Path to custom theme CSS file
249
+ - `--allow-local-files` - Allow local file access in Marp
250
+
251
+ **Requirements:**
252
+ - Node.js
253
+ - @marp-team/marp-cli
254
+ - Puppeteer (installed automatically)
255
+ - OpenAI API key (for `-g` option)
256
+
257
+ **Output:**
258
+ - `scripts/<basename>/images/` - PNG images of each slide
259
+ - `scripts/<basename>/mulmo_script.json` - MulmoScript JSON file (PNG format)
260
+ - `scripts/<basename>/mulmo_script-markdown.json` - MulmoScript JSON file (Markdown format)
261
+
262
+ **Features:**
263
+ - Extracts speaker notes from HTML comments (`<!-- note text -->`)
264
+ - Generates both PNG images and structured Markdown output
265
+ - Preserves slide formatting and structure
266
+
267
+ ### PowerPoint (PPTX) Converter
268
+
269
+ Converts PowerPoint presentations to MulmoScript format with high-quality PNG exports.
270
+
271
+ **Usage:**
272
+
273
+ ```bash
274
+ # CLI
275
+ mulmo-slide pptx path/to/presentation.pptx
276
+ mulmo-slide pptx path/to/presentation.pptx -g -l ja # with LLM narration
277
+
278
+ # yarn (development)
279
+ yarn pptx path/to/presentation.pptx
280
+ yarn pptx path/to/presentation.pptx -g -l ja
281
+ ```
282
+
283
+ **Options:**
284
+ - `-l, --lang` - Language for the MulmoScript (en, ja, fr, de)
285
+ - `-g, --generate-text` - Generate narration text using OpenAI LLM
286
+
287
+ **Requirements:**
288
+ - Node.js
289
+ - LibreOffice (used for PPTX to PDF conversion)
290
+ - ImageMagick (for high-quality PNG export with antialiasing)
291
+ - OpenAI API key (for `-g` option)
292
+
293
+ **Output:**
294
+ - `scripts/<basename>/` - Directory named after input file
295
+ - `scripts/<basename>/images/<basename>-0.png, -1.png, ...` - PNG images of each slide
296
+ - `scripts/<basename>/mulmo_script.json` - MulmoScript JSON file
297
+
298
+ ### PDF Converter
299
+
300
+ Converts PDF files to MulmoScript format with high-quality PNG exports.
301
+
302
+ **Usage:**
303
+
304
+ ```bash
305
+ # CLI
306
+ mulmo-slide pdf path/to/presentation.pdf
307
+ mulmo-slide pdf path/to/presentation.pdf -g -l ja # with LLM narration
308
+
309
+ # yarn (development)
310
+ yarn pdf path/to/presentation.pdf
311
+ yarn pdf path/to/presentation.pdf -g -l ja
312
+ ```
313
+
314
+ **Options:**
315
+ - `-l, --lang` - Language for the MulmoScript (en, ja, fr, de)
316
+ - `-g, --generate-text` - Generate narration text using OpenAI LLM
317
+
318
+ **Requirements:**
319
+ - Node.js
320
+ - ImageMagick (for high-quality PNG export with antialiasing)
321
+ - OpenAI API key (for `-g` option)
322
+
323
+ **Output:**
324
+ - `scripts/<basename>/` - Directory named after input file
325
+ - `scripts/<basename>/images/<basename>-0.png, -1.png, ...` - PNG images of each page
326
+ - `scripts/<basename>/mulmo_script.json` - MulmoScript JSON file
327
+
328
+ ## Movie Generation
329
+
330
+ Generate a movie directly from any supported presentation format.
331
+
332
+ **Usage:**
333
+
334
+ ```bash
335
+ # CLI
336
+ mulmo-slide movie path/to/presentation.pptx
337
+ mulmo-slide movie path/to/presentation.pdf
338
+ mulmo-slide movie path/to/presentation.md
339
+ mulmo-slide movie path/to/presentation.key # macOS only
340
+ mulmo-slide movie path/to/presentation.pptx -f -g -l ja # force regenerate with LLM in Japanese
341
+
342
+ # yarn (development)
343
+ yarn movie path/to/presentation.pptx
344
+ yarn movie path/to/presentation.pptx -f -g -l ja
345
+ ```
346
+
347
+ **Options:**
348
+ - `-l, --lang` - Language for the MulmoScript (en, ja, fr, de)
349
+ - `-f, --force` - Force regenerate MulmoScript (default: use existing if available)
350
+ - `-g, --generate-text` - Generate narration text using OpenAI LLM (only when generating)
351
+
352
+ This command:
353
+ 1. Converts the presentation to MulmoScript format (or uses existing)
354
+ 2. Generates audio and images using mulmocast
355
+ 3. Creates the final movie
356
+
357
+ **Output:**
358
+ - `output/<basename>/` - Movie and related files
359
+
360
+ ## Bundle Generation
361
+
362
+ Generate a MulmoViewer bundle directly from any supported presentation format.
363
+
364
+ **Usage:**
365
+
366
+ ```bash
367
+ # CLI
368
+ mulmo-slide bundle path/to/presentation.pptx
369
+ mulmo-slide bundle path/to/presentation.pdf
370
+ mulmo-slide bundle path/to/presentation.md
371
+ mulmo-slide bundle path/to/presentation.key # macOS only
372
+ mulmo-slide bundle path/to/presentation.pptx -f -g -l ja # force regenerate with LLM in Japanese
373
+
374
+ # yarn (development)
375
+ yarn bundle path/to/presentation.pptx
376
+ yarn bundle path/to/presentation.pptx -f -g -l ja
377
+ ```
378
+
379
+ **Options:**
380
+ - `-l, --lang` - Language for the MulmoScript (en, ja, fr, de)
381
+ - `-f, --force` - Force regenerate MulmoScript (default: use existing if available)
382
+ - `-g, --generate-text` - Generate narration text using OpenAI LLM (only when generating)
383
+
384
+ This command:
385
+ 1. Converts the presentation to MulmoScript format (or uses existing)
386
+ 2. Translates content to multiple languages (ja, en)
387
+ 3. Generates audio and images
388
+ 4. Creates a bundle for MulmoViewer (skipZip mode)
389
+
390
+ **Output:**
391
+ - `output/<basename>/` - Bundle files for MulmoViewer
392
+
393
+ ## Language Setting
394
+
395
+ All converters support setting the language for the generated MulmoScript.
396
+
397
+ **Supported languages:** `en` (English), `ja` (Japanese), `fr` (French), `de` (German)
398
+
399
+ **Priority:** CLI option > Environment variable > Default (`en`)
400
+
401
+ **CLI option:**
402
+ ```bash
403
+ mulmo-slide pptx presentation.pptx -l ja
404
+ mulmo-slide marp presentation.md --lang fr
405
+ mulmo-slide keynote presentation.key -l de
406
+ ```
407
+
408
+ **Environment variable:**
409
+ ```bash
410
+ export MULMO_LANG=ja
411
+ yarn pptx presentation.pptx
412
+ ```
413
+
414
+ ## LLM Text Generation
415
+
416
+ Generate narration text for each slide using OpenAI's GPT-4o model.
417
+
418
+ **Usage:**
419
+ ```bash
420
+ # PPTX: Uses slide images with Vision API
421
+ mulmo-slide pptx presentation.pptx -g -l ja
422
+
423
+ # PDF: Uses page images with Vision API
424
+ mulmo-slide pdf presentation.pdf -g -l ja
425
+
426
+ # Marp: Uses markdown content
427
+ mulmo-slide marp presentation.md -g -l en
428
+
429
+ # Bundle/Movie: Use with -f to regenerate
430
+ mulmo-slide bundle presentation.pptx -f -g
431
+ ```
432
+
433
+ **Requirements:**
434
+ - `OPENAI_API_KEY` environment variable must be set
435
+
436
+ **How it works:**
437
+ - For PPTX/PDF: Converts slides/pages to images and uses OpenAI Vision API to understand content
438
+ - For Marp: Uses the markdown content directly
439
+ - The LLM considers the overall presentation structure to generate contextual narration
440
+ - Output is in the specified language (`-l` option)
441
+
442
+ ## Output Structure
443
+
444
+ All tools generate MulmoScript output in `scripts/<basename>/` with a unified structure:
445
+
446
+ ```
447
+ scripts/<basename>/
448
+ ├── images/
449
+ │ ├── <basename>-0.png (or images.001.png for Marp)
450
+ │ ├── <basename>-1.png (or images.002.png for Marp)
451
+ │ └── ...
452
+ ├── mulmo_script.json # MulmoScript (all formats)
453
+ └── mulmo_script-markdown.json # Marp only: Markdown format
454
+ ```
455
+
456
+ ## License
457
+
458
+ MIT
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env tsx
2
+ export {};
3
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/actions/bundle.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env tsx
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const mulmocast_1 = require("mulmocast");
8
+ const yargs_1 = __importDefault(require("yargs"));
9
+ const helpers_1 = require("yargs/helpers");
10
+ const common_1 = require("./common");
11
+ async function runMulmoBundle(mulmoScriptPath, outputDir) {
12
+ console.log(`\nGenerating bundle with mulmo...`);
13
+ console.log(` Input: ${mulmoScriptPath}`);
14
+ console.log(` Output: ${outputDir}`);
15
+ const context = await (0, common_1.initializeContext)(mulmoScriptPath, outputDir);
16
+ console.log(" Translating...");
17
+ await (0, mulmocast_1.translate)(context, { targetLangs: mulmocast_1.bundleTargetLang });
18
+ for (const lang of mulmocast_1.bundleTargetLang.filter((_lang) => _lang !== context.lang)) {
19
+ await (0, mulmocast_1.audio)({ ...context, lang });
20
+ }
21
+ console.log(" Generating audio...");
22
+ const audioContext = await (0, mulmocast_1.audio)(context);
23
+ console.log(" Generating images...");
24
+ const imageContext = await (0, mulmocast_1.images)(audioContext);
25
+ console.log(" Creating bundle...");
26
+ await (0, mulmocast_1.mulmoViewerBundle)(imageContext, { skipZip: true });
27
+ }
28
+ async function main() {
29
+ const argv = await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
30
+ .usage("Usage: $0 <presentation-file> [options]")
31
+ .command("$0 <file>", "Generate MulmoViewer bundle from presentation", (yargs) => {
32
+ return yargs.positional("file", {
33
+ describe: "Presentation file (.pptx, .md, .key)",
34
+ type: "string",
35
+ demandOption: true,
36
+ });
37
+ })
38
+ .options({
39
+ f: {
40
+ alias: "force",
41
+ type: "boolean",
42
+ description: "Force regenerate MulmoScript",
43
+ default: false,
44
+ },
45
+ g: {
46
+ alias: "generate-text",
47
+ type: "boolean",
48
+ description: "Generate narration text using LLM",
49
+ default: false,
50
+ },
51
+ })
52
+ .help()
53
+ .parse();
54
+ await (0, common_1.runAction)("Bundle", argv.file, runMulmoBundle, {
55
+ force: argv.f,
56
+ generateText: argv.g,
57
+ });
58
+ }
59
+ main();
60
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/actions/bundle.ts"],"names":[],"mappings":";;;;;;AAEA,yCAA0F;AAC1F,kDAA0B;AAC1B,2CAAwC;AACxC,qCAAwD;AAExD,KAAK,UAAU,cAAc,CAAC,eAAuB,EAAE,SAAiB;IACtE,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,YAAY,eAAe,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,aAAa,SAAS,EAAE,CAAC,CAAC;IAEtC,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAiB,EAAC,eAAe,EAAE,SAAS,CAAC,CAAC;IAEpE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAChC,MAAM,IAAA,qBAAS,EAAC,OAAO,EAAE,EAAE,WAAW,EAAE,4BAAgB,EAAE,CAAC,CAAC;IAE5D,KAAK,MAAM,IAAI,IAAI,4BAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9E,MAAM,IAAA,iBAAK,EAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,IAAA,iBAAK,EAAC,OAAO,CAAC,CAAC;IAE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utils/lang";
3
+ export declare function getPackageRoot(): string;
4
+ export declare function getKeynoteScriptPath(): string;
5
+ export type FileType = "pptx" | "marp" | "keynote" | "pdf";
6
+ export declare function detectFileType(filePath: string): FileType;
7
+ export declare function getBasename(filePath: string): string;
8
+ export interface ConvertOptions {
9
+ generateText?: boolean;
10
+ lang?: SupportedLang;
11
+ }
12
+ export declare function convertToMulmoScript(filePath: string, fileType: FileType, options?: ConvertOptions): Promise<string>;
13
+ export declare function initializeContext(mulmoScriptPath: string, outputDir: string): Promise<MulmoStudioContext>;
14
+ export type ActionRunner = (mulmoScriptPath: string, outputDir: string) => Promise<void>;
15
+ export interface RunActionOptions {
16
+ force?: boolean;
17
+ generateText?: boolean;
18
+ }
19
+ export declare function getMulmoScriptPath(basename: string): string;
20
+ export declare function runAction(commandName: string, inputFile: string, actionRunner: ActionRunner, options?: RunActionOptions): Promise<void>;
21
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/actions/common.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAGD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;AAE3D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAczD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EA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