mulmocast 1.2.9 → 1.2.10

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.
@@ -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: "networkidle0" });
145
+ await page.setContent(html, { waitUntil: "domcontentloaded" });
146
+ await sleep(1000);
146
147
  await page.pdf({
147
148
  path: outputPdfPath,
148
149
  printBackground: true,
@@ -5,7 +5,8 @@ import * as agents from "@graphai/vanilla";
5
5
  import { openAIAgent } from "@graphai/openai_agent";
6
6
  import { fileWriteAgent } from "@graphai/vanilla_node_agents";
7
7
  import { splitText } from "../utils/string.js";
8
- import { settings2GraphAIConfig, beatId, multiLingualObjectToArray } from "../utils/utils.js";
8
+ import { settings2GraphAIConfig, multiLingualObjectToArray } from "../utils/utils.js";
9
+ import { beatId } from "../utils/common.js";
9
10
  import { getMultiLingual } from "../utils/context.js";
10
11
  import { currentMulmoScriptVersion } from "../utils/const.js";
11
12
  import { getOutputMultilingualFilePath, mkdir, writingMessage, hashSHA256 } from "../utils/file.js";
@@ -151,7 +152,7 @@ const translateGraph = {
151
152
  return tmp;
152
153
  }, {});
153
154
  return {
154
- version: "1.1",
155
+ version: currentMulmoScriptVersion,
155
156
  multiLingual: multiLingualObject,
156
157
  };
157
158
  },
@@ -2,3 +2,4 @@ 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/common.js";
@@ -3,3 +3,4 @@ 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/common.js";
@@ -1,6 +1,6 @@
1
1
  import { GraphAILogger } from "graphai";
2
2
  import { mulmoScriptSchema, mulmoStudioMultiLingualFileSchema } from "../types/index.js";
3
- import { beatId } from "../utils/utils.js";
3
+ import { beatId } from "../utils/common.js";
4
4
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
5
  const validate_1_0 = (script) => {
6
6
  if (script.speechParams?.provider) {
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { beatId } from "../utils/utils.js";
2
+ import { beatId } from "../utils/common.js";
3
3
  import { GraphAILogger } from "graphai";
4
4
  const sessionProgressCallbacks = new Set();
5
5
  export const addSessionProgressCallback = (cb) => {
@@ -0,0 +1 @@
1
+ export declare const beatId: (id: string | undefined, index: number) => string;
@@ -0,0 +1,4 @@
1
+ export const beatId = (id, index) => {
2
+ const key = id ?? `__index__${index}`;
3
+ return key;
4
+ };
@@ -1,7 +1,8 @@
1
1
  import { GraphAILogger } from "graphai";
2
2
  import fs from "fs";
3
3
  import { readMulmoScriptFile, fetchMulmoScriptFile } from "./file.js";
4
- import { beatId, multiLingualObjectToArray } from "./utils.js";
4
+ import { multiLingualObjectToArray } from "./utils.js";
5
+ import { beatId } from "./common.js";
5
6
  import { mulmoStudioSchema, mulmoCaptionParamsSchema, mulmoPresentationStyleSchema } from "../types/schema.js";
6
7
  import { MulmoPresentationStyleMethods, MulmoScriptMethods, MulmoStudioMultiLingualMethod } from "../methods/index.js";
7
8
  const mulmoCredit = (speaker) => {
@@ -19,7 +19,6 @@ type CleanableObject = {
19
19
  [key: string]: CleanableValue;
20
20
  };
21
21
  export declare const deepClean: <T extends CleanableValue>(input: T) => T | undefined;
22
- export declare const beatId: (id: string | undefined, index: number) => string;
23
22
  export declare const multiLingualObjectToArray: (multiLingual: MulmoStudioMultiLingual | undefined, beats: MulmoStudioBeat[]) => {
24
23
  multiLingualTexts: Record<string, {
25
24
  text: string;
@@ -1,5 +1,6 @@
1
1
  import * as crypto from "crypto";
2
2
  import { provider2LLMAgent } from "./provider2agent.js";
3
+ import { beatId } from "./common.js";
3
4
  export const llmPair = (_llm, _model) => {
4
5
  const llmKey = _llm ?? "openai";
5
6
  const agent = provider2LLMAgent[llmKey]?.agentName ?? provider2LLMAgent.openai.agentName;
@@ -117,10 +118,6 @@ export const deepClean = (input) => {
117
118
  }
118
119
  return input;
119
120
  };
120
- export const beatId = (id, index) => {
121
- const key = id ?? `__index__${index}`;
122
- return key;
123
- };
124
121
  export const multiLingualObjectToArray = (multiLingual, beats) => {
125
122
  return beats.map((beat, index) => {
126
123
  const key = beatId(beat?.id, index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",