mulmocast 1.2.19 → 1.2.21
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/cli/helpers.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export declare const getFileObject: (args: {
|
|
|
9
9
|
audiodir?: string;
|
|
10
10
|
presentationStyle?: string;
|
|
11
11
|
file: string;
|
|
12
|
+
nodeModuleRootPath?: string;
|
|
12
13
|
}) => FileObject;
|
|
13
14
|
export declare const initializeContext: (argv: CliArgs<InitOptions>, raiseError?: boolean) => Promise<MulmoStudioContext | null>;
|
package/lib/cli/helpers.js
CHANGED
|
@@ -29,7 +29,7 @@ export const setGraphAILogger = (verbose, logValues) => {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
export const getFileObject = (args) => {
|
|
32
|
-
const { basedir, outdir, imagedir, audiodir, file, presentationStyle } = args;
|
|
32
|
+
const { basedir, outdir, imagedir, audiodir, file, presentationStyle, nodeModuleRootPath } = args;
|
|
33
33
|
const baseDirPath = getBaseDirPath(basedir);
|
|
34
34
|
const outDirPath = getFullPath(baseDirPath, outdir ?? outDirName);
|
|
35
35
|
const { fileOrUrl, fileName } = (() => {
|
|
@@ -69,6 +69,7 @@ export const getFileObject = (args) => {
|
|
|
69
69
|
outputMultilingualFilePath,
|
|
70
70
|
presentationStylePath,
|
|
71
71
|
fileName,
|
|
72
|
+
nodeModuleRootPath,
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
75
|
export const initializeContext = async (argv, raiseError = false) => {
|
package/lib/types/type.d.ts
CHANGED
|
@@ -45,16 +45,8 @@ export type MulmoImageMedia = z.infer<typeof mulmoImageMediaSchema>;
|
|
|
45
45
|
export type MulmoChartMedia = z.infer<typeof mulmoChartMediaSchema>;
|
|
46
46
|
export type MulmoMermaidMedia = z.infer<typeof mulmoMermaidMediaSchema>;
|
|
47
47
|
export type MulmoSessionState = z.infer<typeof mulmoSessionStateSchema>;
|
|
48
|
-
export type FileDirs = {
|
|
49
|
-
mulmoFilePath: string;
|
|
50
|
-
mulmoFileDirPath: string;
|
|
51
|
-
baseDirPath: string;
|
|
52
|
-
outDirPath: string;
|
|
53
|
-
imageDirPath: string;
|
|
54
|
-
audioDirPath: string;
|
|
55
|
-
};
|
|
56
48
|
export type MulmoStudioContext = {
|
|
57
|
-
fileDirs:
|
|
49
|
+
fileDirs: FileObject;
|
|
58
50
|
studio: MulmoStudio;
|
|
59
51
|
lang: string;
|
|
60
52
|
force: boolean;
|
|
@@ -113,6 +105,7 @@ export interface FileObject {
|
|
|
113
105
|
outDirPath: string;
|
|
114
106
|
imageDirPath: string;
|
|
115
107
|
audioDirPath: string;
|
|
108
|
+
nodeModuleRootPath?: string;
|
|
116
109
|
isHttpPath: boolean;
|
|
117
110
|
fileOrUrl: string;
|
|
118
111
|
outputStudioFilePath: string;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { parrotingImagePath } from "./utils.js";
|
|
2
2
|
import { htmlPlugin } from "mulmocast-vision";
|
|
3
|
+
import { resolve as resolvePath } from "path";
|
|
3
4
|
export const imageType = "vision";
|
|
4
5
|
const toCreateName = (str) => {
|
|
5
6
|
return "create" + str.charAt(0).toUpperCase() + str.slice(1);
|
|
6
7
|
};
|
|
7
8
|
const processVision = async (params) => {
|
|
8
|
-
const { beat, imagePath } = params;
|
|
9
|
+
const { beat, imagePath, context } = params;
|
|
10
|
+
const rootDir = context.fileDirs.nodeModuleRootPath ? resolvePath(context.fileDirs.nodeModuleRootPath, "mulmocast-vision") : undefined;
|
|
9
11
|
if (!beat?.image || beat.image.type !== imageType)
|
|
10
12
|
return;
|
|
11
|
-
const handler = new htmlPlugin({
|
|
13
|
+
const handler = new htmlPlugin({ rootDir });
|
|
12
14
|
await handler[toCreateName(beat.image.name)](beat.image.data, {
|
|
13
15
|
name: beat.image.name,
|
|
14
16
|
imageFilePath: imagePath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.node.js",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"graphai": "^2.0.14",
|
|
88
88
|
"jsdom": "^26.1.0",
|
|
89
89
|
"marked": "^16.2.0",
|
|
90
|
-
"mulmocast-vision": "^0.0.
|
|
90
|
+
"mulmocast-vision": "^0.0.2",
|
|
91
91
|
"ora": "^8.2.0",
|
|
92
92
|
"puppeteer": "^24.17.0",
|
|
93
93
|
"replicate": "^1.1.0",
|