mulmocast 1.2.20 → 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.
@@ -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>;
@@ -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) => {
@@ -6,4 +6,3 @@ export * from "./utils/context.js";
6
6
  export * from "./utils/ffmpeg_utils.js";
7
7
  export * from "./methods/index.js";
8
8
  export * from "./agents/index.js";
9
- export { updateVisionRootDir } from "./utils/image_plugins/vision.js";
package/lib/index.node.js CHANGED
@@ -7,4 +7,3 @@ export * from "./utils/context.js";
7
7
  export * from "./utils/ffmpeg_utils.js";
8
8
  export * from "./methods/index.js";
9
9
  export * from "./agents/index.js";
10
- export { updateVisionRootDir } from "./utils/image_plugins/vision.js";
@@ -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: 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,5 +1,4 @@
1
1
  import { ImageProcessorParams } from "../../types/index.js";
2
- export declare const updateVisionRootDir: (dir: string) => void;
3
2
  export declare const imageType = "vision";
4
3
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
5
4
  export declare const path: (params: ImageProcessorParams) => string;
@@ -1,15 +1,13 @@
1
1
  import { parrotingImagePath } from "./utils.js";
2
2
  import { htmlPlugin } from "mulmocast-vision";
3
- let rootDir = undefined;
4
- export const updateVisionRootDir = (dir) => {
5
- rootDir = dir;
6
- };
3
+ import { resolve as resolvePath } from "path";
7
4
  export const imageType = "vision";
8
5
  const toCreateName = (str) => {
9
6
  return "create" + str.charAt(0).toUpperCase() + str.slice(1);
10
7
  };
11
8
  const processVision = async (params) => {
12
- const { beat, imagePath } = params;
9
+ const { beat, imagePath, context } = params;
10
+ const rootDir = context.fileDirs.nodeModuleRootPath ? resolvePath(context.fileDirs.nodeModuleRootPath, "mulmocast-vision") : undefined;
13
11
  if (!beat?.image || beat.image.type !== imageType)
14
12
  return;
15
13
  const handler = new htmlPlugin({ rootDir });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",