mulmocast 1.2.9 → 1.2.11
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/lib/actions/audio.js +2 -1
- package/lib/actions/pdf.js +3 -2
- package/lib/actions/translate.js +1 -1
- package/lib/index.common.d.ts +3 -0
- package/lib/index.common.js +3 -0
- package/lib/methods/mulmo_presentation_style.d.ts +0 -1
- package/lib/methods/mulmo_presentation_style.js +1 -1
- package/lib/methods/mulmo_script.js +1 -0
- package/lib/utils/common.d.ts +1 -0
- package/lib/utils/common.js +4 -0
- package/lib/utils/filters.js +1 -1
- package/lib/utils/utils.d.ts +1 -2
- package/lib/utils/utils.js +1 -4
- package/lib/utils/utils_node.d.ts +1 -0
- package/lib/utils/utils_node.js +4 -0
- package/package.json +1 -1
package/lib/actions/audio.js
CHANGED
|
@@ -6,7 +6,8 @@ import { ttsNijivoiceAgent, ttsOpenaiAgent, ttsGoogleAgent, ttsElevenlabsAgent,
|
|
|
6
6
|
import { text2SpeechProviderSchema } from "../types/index.js";
|
|
7
7
|
import { fileCacheAgentFilter, nijovoiceTextAgentFilter } from "../utils/filters.js";
|
|
8
8
|
import { getAudioArtifactFilePath, getAudioFilePath, getOutputStudioFilePath, resolveDirPath, defaultBGMPath, mkdir, writingMessage } from "../utils/file.js";
|
|
9
|
-
import {
|
|
9
|
+
import { localizedText, settings2GraphAIConfig } from "../utils/utils.js";
|
|
10
|
+
import { text2hash } from "../utils/utils_node.js";
|
|
10
11
|
import { provider2TTSAgent } from "../utils/provider2agent.js";
|
|
11
12
|
import { MulmoPresentationStyleMethods } from "../methods/index.js";
|
|
12
13
|
import { MulmoStudioContextMethods } from "../methods/mulmo_studio_context.js";
|
package/lib/actions/pdf.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import puppeteer from "puppeteer";
|
|
4
|
-
import { GraphAILogger } from "graphai";
|
|
4
|
+
import { GraphAILogger, sleep } from "graphai";
|
|
5
5
|
import { MulmoPresentationStyleMethods } from "../methods/index.js";
|
|
6
6
|
import { localizedText, isHttp } from "../utils/utils.js";
|
|
7
7
|
import { getOutputPdfFilePath, writingMessage, getHTMLFile } from "../utils/file.js";
|
|
@@ -142,7 +142,8 @@ const generatePDF = async (context, pdfMode, pdfSize) => {
|
|
|
142
142
|
});
|
|
143
143
|
try {
|
|
144
144
|
const page = await browser.newPage();
|
|
145
|
-
await page.setContent(html, { waitUntil: "
|
|
145
|
+
await page.setContent(html, { waitUntil: "domcontentloaded" });
|
|
146
|
+
await sleep(1000);
|
|
146
147
|
await page.pdf({
|
|
147
148
|
path: outputPdfPath,
|
|
148
149
|
printBackground: true,
|
package/lib/actions/translate.js
CHANGED
package/lib/index.common.d.ts
CHANGED
|
@@ -2,3 +2,6 @@ export * from "./types/index.js";
|
|
|
2
2
|
export * from "./utils/provider2agent.js";
|
|
3
3
|
export * from "./utils/const.js";
|
|
4
4
|
export * from "./utils/string.js";
|
|
5
|
+
export * from "./utils/utils.js";
|
|
6
|
+
export * from "./methods/mulmo_presentation_style.js";
|
|
7
|
+
export * from "./methods/mulmo_script.js";
|
package/lib/index.common.js
CHANGED
|
@@ -3,3 +3,6 @@ export * from "./types/index.js";
|
|
|
3
3
|
export * from "./utils/provider2agent.js";
|
|
4
4
|
export * from "./utils/const.js";
|
|
5
5
|
export * from "./utils/string.js";
|
|
6
|
+
export * from "./utils/utils.js";
|
|
7
|
+
export * from "./methods/mulmo_presentation_style.js";
|
|
8
|
+
export * from "./methods/mulmo_script.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
2
1
|
import { MulmoCanvasDimension, MulmoBeat, Text2SpeechProvider, Text2ImageAgentInfo, Text2HtmlAgentInfo, BeatMediaType, MulmoPresentationStyle, SpeakerData, Text2ImageProvider, MulmoStudioContext } from "../types/index.js";
|
|
3
2
|
export declare const MulmoPresentationStyleMethods: {
|
|
4
3
|
getCanvasSize(presentationStyle: MulmoPresentationStyle): MulmoCanvasDimension;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node & browser
|
|
2
2
|
import { isNull } from "graphai";
|
|
3
3
|
import { userAssert } from "../utils/utils.js";
|
|
4
4
|
import { text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoCanvasDimensionSchema, } from "../types/schema.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const beatId: (id: string | undefined, index: number) => string;
|
package/lib/utils/filters.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from "path";
|
|
|
4
4
|
import fsPromise from "fs/promises";
|
|
5
5
|
import { GraphAILogger } from "graphai";
|
|
6
6
|
import { writingMessage } from "./file.js";
|
|
7
|
-
import { text2hash } from "./
|
|
7
|
+
import { text2hash } from "./utils_node.js";
|
|
8
8
|
import { MulmoStudioContextMethods } from "../methods/mulmo_studio_context.js";
|
|
9
9
|
import { replacementsJa, replacePairsJa } from "../utils/string.js";
|
|
10
10
|
export const nijovoiceTextAgentFilter = async (context, next) => {
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfigDataDictionary, DefaultConfigData } from "graphai";
|
|
2
2
|
import { MulmoBeat, MulmoStudioBeat, MulmoStudioMultiLingual, MulmoStudioMultiLingualData } from "../types/index.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type LLM } from "./provider2agent.js";
|
|
4
4
|
export declare const llmPair: (_llm?: LLM, _model?: string) => {
|
|
5
5
|
agent: "mediaMockAgent" | "openAIAgent" | "anthropicAgent" | "geminiAgent" | "groqAgent";
|
|
6
6
|
model: string;
|
|
@@ -8,7 +8,6 @@ export declare const llmPair: (_llm?: LLM, _model?: string) => {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const chunkArray: <T>(array: T[], size?: number) => T[][];
|
|
10
10
|
export declare const isHttp: (fileOrUrl: string) => boolean;
|
|
11
|
-
export declare const text2hash: (input: string) => string;
|
|
12
11
|
export declare const localizedText: (beat: MulmoBeat, multiLingualData?: MulmoStudioMultiLingualData, targetLang?: string, defaultLang?: string) => string;
|
|
13
12
|
export declare function userAssert(condition: boolean, message: string): asserts condition;
|
|
14
13
|
export declare const settings2GraphAIConfig: (settings?: Record<string, string>, env?: Record<string, string | undefined>) => ConfigDataDictionary<DefaultConfigData>;
|
package/lib/utils/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node & browser
|
|
2
2
|
import { provider2LLMAgent } from "./provider2agent.js";
|
|
3
3
|
export const llmPair = (_llm, _model) => {
|
|
4
4
|
const llmKey = _llm ?? "openai";
|
|
@@ -17,9 +17,6 @@ export const chunkArray = (array, size = 3) => {
|
|
|
17
17
|
export const isHttp = (fileOrUrl) => {
|
|
18
18
|
return /^https?:\/\//.test(fileOrUrl);
|
|
19
19
|
};
|
|
20
|
-
export const text2hash = (input) => {
|
|
21
|
-
return crypto.createHash("sha256").update(input).digest("hex");
|
|
22
|
-
};
|
|
23
20
|
export const localizedText = (beat, multiLingualData, targetLang, defaultLang) => {
|
|
24
21
|
if (targetLang === defaultLang) {
|
|
25
22
|
return beat.text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const text2hash: (input: string) => string;
|