mulmocast 2.1.6 → 2.1.8

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.
@@ -30,7 +30,17 @@ const getAudioPathOrUrl = (context, beat, maybeAudioFile) => {
30
30
  export const getBeatAudioPathOrUrl = (text, context, beat, lang) => {
31
31
  const audioDirPath = MulmoStudioContextMethods.getAudioDirPath(context);
32
32
  const { voiceId, provider, speechOptions, model } = MulmoStudioContextMethods.getAudioParam(context, beat, lang);
33
- const hash_string = [text, voiceId, speechOptions?.instruction ?? "", speechOptions?.speed ?? 1.0, provider, model ?? ""].join(":");
33
+ const hash_string = [
34
+ text,
35
+ voiceId,
36
+ speechOptions?.instruction ?? "",
37
+ speechOptions?.speed ?? 1.0,
38
+ provider,
39
+ model ?? "",
40
+ speechOptions?.decoration ?? "",
41
+ speechOptions?.stability ?? "",
42
+ speechOptions?.similarity_boost ?? "",
43
+ ].join(":");
34
44
  GraphAILogger.log(`getBeatAudioPathOrUrl [${hash_string}]`);
35
45
  const audioFileName = `${context.studio.filename}_${text2hash(hash_string)}`;
36
46
  const maybeAudioFile = getAudioFilePath(audioDirPath, context.studio.filename, audioFileName, lang);
@@ -109,6 +119,8 @@ const graph_tts = {
109
119
  speed: ":preprocessor.speechOptions.speed",
110
120
  instructions: ":preprocessor.speechOptions.instruction",
111
121
  decoration: ":preprocessor.speechOptions.decoration",
122
+ stability: ":preprocessor.speechOptions.stability",
123
+ similarityBoost: ":preprocessor.speechOptions.similarity_boost",
112
124
  model: ":preprocessor.model",
113
125
  },
114
126
  },
@@ -2,7 +2,7 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import { GraphAILogger } from "graphai";
4
4
  import OpenAI, { toFile, AuthenticationError, RateLimitError, APIError } from "openai";
5
- import { provider2ImageAgent } from "../utils/provider2agent.js";
5
+ import { provider2ImageAgent, gptImages } from "../utils/provider2agent.js";
6
6
  import { apiKeyMissingError, agentGenerationError, openAIAgentGenerationError, agentIncorrectAPIKeyError, agentAPIRateLimitError, agentInvalidResponseError, imageAction, imageFileTarget, } from "../utils/error_cause.js";
7
7
  // https://platform.openai.com/docs/guides/image-generation
8
8
  export const imageOpenaiAgent = async ({ namedInputs, params, config, }) => {
@@ -17,7 +17,7 @@ export const imageOpenaiAgent = async ({ namedInputs, params, config, }) => {
17
17
  const model = params.model ?? provider2ImageAgent["openai"].defaultModel;
18
18
  const openai = new OpenAI({ apiKey, baseURL });
19
19
  const size = (() => {
20
- if (model === "gpt-image-1" || model === "gpt-image-1-mini") {
20
+ if (gptImages.includes(model)) {
21
21
  if (canvasSize.width > canvasSize.height) {
22
22
  return "1536x1024";
23
23
  }
@@ -46,7 +46,7 @@ export const imageOpenaiAgent = async ({ namedInputs, params, config, }) => {
46
46
  n: 1,
47
47
  size,
48
48
  };
49
- if (model === "gpt-image-1" || model === "gpt-image-1-mini") {
49
+ if (gptImages.includes(model)) {
50
50
  imageOptions.moderation = moderation || "auto";
51
51
  imageOptions.background = "opaque";
52
52
  if (quality) {
@@ -3,7 +3,7 @@ import { provider2TTSAgent } from "../utils/provider2agent.js";
3
3
  import { apiKeyMissingError, agentVoiceLimitReachedError, agentIncorrectAPIKeyError, agentGenerationError, audioAction, audioFileTarget, } from "../utils/error_cause.js";
4
4
  export const ttsElevenlabsAgent = async ({ namedInputs, params, config, }) => {
5
5
  const { text } = namedInputs;
6
- const { voice, model, stability, similarityBoost, suppressError } = params;
6
+ const { voice, model, stability, similarityBoost, speed, suppressError } = params;
7
7
  const apiKey = config?.apiKey;
8
8
  if (!apiKey) {
9
9
  throw new Error("ElevenLabs API key is required (ELEVENLABS_API_KEY)", {
@@ -21,6 +21,7 @@ export const ttsElevenlabsAgent = async ({ namedInputs, params, config, }) => {
21
21
  voice_settings: {
22
22
  stability: stability ?? 0.5,
23
23
  similarity_boost: similarityBoost ?? 0.75,
24
+ speed: speed ?? 1.0,
24
25
  },
25
26
  };
26
27
  GraphAILogger.log("ElevenLabs TTS options", requestBody);
@@ -127,4 +127,5 @@ export type ElevenlabsTTSAgentParams = TTSAgentParams & {
127
127
  model: string;
128
128
  stability: number;
129
129
  similarityBoost: number;
130
+ speed: number;
130
131
  };
@@ -21,6 +21,8 @@ export declare const speechOptionsSchema: z.ZodObject<{
21
21
  speed: z.ZodOptional<z.ZodNumber>;
22
22
  instruction: z.ZodOptional<z.ZodString>;
23
23
  decoration: z.ZodOptional<z.ZodString>;
24
+ stability: z.ZodOptional<z.ZodNumber>;
25
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
24
26
  }, z.core.$strict>;
25
27
  export declare const defaultSpeaker = "Presenter";
26
28
  export declare const text2SpeechProviderSchema: z.ZodDefault<z.ZodEnum<{
@@ -34,6 +36,8 @@ export declare const speakerDataSchema: z.ZodObject<{
34
36
  speed: z.ZodOptional<z.ZodNumber>;
35
37
  instruction: z.ZodOptional<z.ZodString>;
36
38
  decoration: z.ZodOptional<z.ZodString>;
39
+ stability: z.ZodOptional<z.ZodNumber>;
40
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
37
41
  }, z.core.$strict>>;
38
42
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
39
43
  [x: string]: string;
@@ -48,6 +52,8 @@ export declare const speakerSchema: z.ZodObject<{
48
52
  speed: z.ZodOptional<z.ZodNumber>;
49
53
  instruction: z.ZodOptional<z.ZodString>;
50
54
  decoration: z.ZodOptional<z.ZodString>;
55
+ stability: z.ZodOptional<z.ZodNumber>;
56
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
51
57
  }, z.core.$strict>>;
52
58
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
53
59
  [x: string]: string;
@@ -61,6 +67,8 @@ export declare const speakerSchema: z.ZodObject<{
61
67
  speed: z.ZodOptional<z.ZodNumber>;
62
68
  instruction: z.ZodOptional<z.ZodString>;
63
69
  decoration: z.ZodOptional<z.ZodString>;
70
+ stability: z.ZodOptional<z.ZodNumber>;
71
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
64
72
  }, z.core.$strict>>;
65
73
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
66
74
  [x: string]: string;
@@ -76,6 +84,8 @@ export declare const speakerDictionarySchema: z.ZodRecord<z.ZodString, z.ZodObje
76
84
  speed: z.ZodOptional<z.ZodNumber>;
77
85
  instruction: z.ZodOptional<z.ZodString>;
78
86
  decoration: z.ZodOptional<z.ZodString>;
87
+ stability: z.ZodOptional<z.ZodNumber>;
88
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
79
89
  }, z.core.$strict>>;
80
90
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
81
91
  [x: string]: string;
@@ -89,6 +99,8 @@ export declare const speakerDictionarySchema: z.ZodRecord<z.ZodString, z.ZodObje
89
99
  speed: z.ZodOptional<z.ZodNumber>;
90
100
  instruction: z.ZodOptional<z.ZodString>;
91
101
  decoration: z.ZodOptional<z.ZodString>;
102
+ stability: z.ZodOptional<z.ZodNumber>;
103
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
92
104
  }, z.core.$strict>>;
93
105
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
94
106
  [x: string]: string;
@@ -105,6 +117,8 @@ export declare const mulmoSpeechParamsSchema: z.ZodDefault<z.ZodObject<{
105
117
  speed: z.ZodOptional<z.ZodNumber>;
106
118
  instruction: z.ZodOptional<z.ZodString>;
107
119
  decoration: z.ZodOptional<z.ZodString>;
120
+ stability: z.ZodOptional<z.ZodNumber>;
121
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
108
122
  }, z.core.$strict>>;
109
123
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
110
124
  [x: string]: string;
@@ -118,6 +132,8 @@ export declare const mulmoSpeechParamsSchema: z.ZodDefault<z.ZodObject<{
118
132
  speed: z.ZodOptional<z.ZodNumber>;
119
133
  instruction: z.ZodOptional<z.ZodString>;
120
134
  decoration: z.ZodOptional<z.ZodString>;
135
+ stability: z.ZodOptional<z.ZodNumber>;
136
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
121
137
  }, z.core.$strict>>;
122
138
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
123
139
  [x: string]: string;
@@ -1105,6 +1121,8 @@ export declare const mulmoBeatSchema: z.ZodObject<{
1105
1121
  speed: z.ZodOptional<z.ZodNumber>;
1106
1122
  instruction: z.ZodOptional<z.ZodString>;
1107
1123
  decoration: z.ZodOptional<z.ZodString>;
1124
+ stability: z.ZodOptional<z.ZodNumber>;
1125
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
1108
1126
  }, z.core.$strict>>;
1109
1127
  textSlideParams: z.ZodOptional<z.ZodObject<{
1110
1128
  cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
@@ -1167,6 +1185,8 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
1167
1185
  speed: z.ZodOptional<z.ZodNumber>;
1168
1186
  instruction: z.ZodOptional<z.ZodString>;
1169
1187
  decoration: z.ZodOptional<z.ZodString>;
1188
+ stability: z.ZodOptional<z.ZodNumber>;
1189
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
1170
1190
  }, z.core.$strict>>;
1171
1191
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1172
1192
  [x: string]: string;
@@ -1180,6 +1200,8 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
1180
1200
  speed: z.ZodOptional<z.ZodNumber>;
1181
1201
  instruction: z.ZodOptional<z.ZodString>;
1182
1202
  decoration: z.ZodOptional<z.ZodString>;
1203
+ stability: z.ZodOptional<z.ZodNumber>;
1204
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
1183
1205
  }, z.core.$strict>>;
1184
1206
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1185
1207
  [x: string]: string;
@@ -1514,6 +1536,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
1514
1536
  speed: z.ZodOptional<z.ZodNumber>;
1515
1537
  instruction: z.ZodOptional<z.ZodString>;
1516
1538
  decoration: z.ZodOptional<z.ZodString>;
1539
+ stability: z.ZodOptional<z.ZodNumber>;
1540
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
1517
1541
  }, z.core.$strict>>;
1518
1542
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1519
1543
  [x: string]: string;
@@ -1527,6 +1551,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
1527
1551
  speed: z.ZodOptional<z.ZodNumber>;
1528
1552
  instruction: z.ZodOptional<z.ZodString>;
1529
1553
  decoration: z.ZodOptional<z.ZodString>;
1554
+ stability: z.ZodOptional<z.ZodNumber>;
1555
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
1530
1556
  }, z.core.$strict>>;
1531
1557
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1532
1558
  [x: string]: string;
@@ -2222,6 +2248,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
2222
2248
  speed: z.ZodOptional<z.ZodNumber>;
2223
2249
  instruction: z.ZodOptional<z.ZodString>;
2224
2250
  decoration: z.ZodOptional<z.ZodString>;
2251
+ stability: z.ZodOptional<z.ZodNumber>;
2252
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
2225
2253
  }, z.core.$strict>>;
2226
2254
  textSlideParams: z.ZodOptional<z.ZodObject<{
2227
2255
  cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
@@ -2354,6 +2382,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
2354
2382
  speed: z.ZodOptional<z.ZodNumber>;
2355
2383
  instruction: z.ZodOptional<z.ZodString>;
2356
2384
  decoration: z.ZodOptional<z.ZodString>;
2385
+ stability: z.ZodOptional<z.ZodNumber>;
2386
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
2357
2387
  }, z.core.$strict>>;
2358
2388
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
2359
2389
  [x: string]: string;
@@ -2367,6 +2397,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
2367
2397
  speed: z.ZodOptional<z.ZodNumber>;
2368
2398
  instruction: z.ZodOptional<z.ZodString>;
2369
2399
  decoration: z.ZodOptional<z.ZodString>;
2400
+ stability: z.ZodOptional<z.ZodNumber>;
2401
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
2370
2402
  }, z.core.$strict>>;
2371
2403
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
2372
2404
  [x: string]: string;
@@ -3062,6 +3094,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
3062
3094
  speed: z.ZodOptional<z.ZodNumber>;
3063
3095
  instruction: z.ZodOptional<z.ZodString>;
3064
3096
  decoration: z.ZodOptional<z.ZodString>;
3097
+ stability: z.ZodOptional<z.ZodNumber>;
3098
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
3065
3099
  }, z.core.$strict>>;
3066
3100
  textSlideParams: z.ZodOptional<z.ZodObject<{
3067
3101
  cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
@@ -3130,6 +3164,8 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
3130
3164
  speed: z.ZodOptional<z.ZodNumber>;
3131
3165
  instruction: z.ZodOptional<z.ZodString>;
3132
3166
  decoration: z.ZodOptional<z.ZodString>;
3167
+ stability: z.ZodOptional<z.ZodNumber>;
3168
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
3133
3169
  }, z.core.$strict>>;
3134
3170
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
3135
3171
  [x: string]: string;
@@ -3143,6 +3179,8 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
3143
3179
  speed: z.ZodOptional<z.ZodNumber>;
3144
3180
  instruction: z.ZodOptional<z.ZodString>;
3145
3181
  decoration: z.ZodOptional<z.ZodString>;
3182
+ stability: z.ZodOptional<z.ZodNumber>;
3183
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
3146
3184
  }, z.core.$strict>>;
3147
3185
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
3148
3186
  [x: string]: string;
@@ -3471,6 +3509,8 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
3471
3509
  speed: z.ZodOptional<z.ZodNumber>;
3472
3510
  instruction: z.ZodOptional<z.ZodString>;
3473
3511
  decoration: z.ZodOptional<z.ZodString>;
3512
+ stability: z.ZodOptional<z.ZodNumber>;
3513
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
3474
3514
  }, z.core.$strict>>;
3475
3515
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
3476
3516
  [x: string]: string;
@@ -3484,6 +3524,8 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
3484
3524
  speed: z.ZodOptional<z.ZodNumber>;
3485
3525
  instruction: z.ZodOptional<z.ZodString>;
3486
3526
  decoration: z.ZodOptional<z.ZodString>;
3527
+ stability: z.ZodOptional<z.ZodNumber>;
3528
+ similarity_boost: z.ZodOptional<z.ZodNumber>;
3487
3529
  }, z.core.$strict>>;
3488
3530
  provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
3489
3531
  [x: string]: string;
@@ -21,9 +21,11 @@ export const localizedTextSchema = z
21
21
  export const multiLingualTextsSchema = z.record(langSchema, localizedTextSchema);
22
22
  export const speechOptionsSchema = z
23
23
  .object({
24
- speed: z.number().optional(), // default: 1.0 for google and niji voice
24
+ speed: z.number().optional(), // default: 1.0 for google and niji voice, elevenLabs
25
25
  instruction: z.string().optional(), // for tts openai
26
26
  decoration: z.string().optional(), // for kotodama. default: neutral
27
+ stability: z.number().optional(), // for elevenLabs
28
+ similarity_boost: z.number().optional(), // for elevenLabs
27
29
  })
28
30
  .strict();
29
31
  const speakerIdSchema = z.string();
@@ -18,6 +18,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
18
18
  speed?: number | undefined;
19
19
  instruction?: string | undefined;
20
20
  decoration?: string | undefined;
21
+ stability?: number | undefined;
22
+ similarity_boost?: number | undefined;
21
23
  } | undefined;
22
24
  provider?: string | undefined;
23
25
  model?: string | undefined;
@@ -29,6 +31,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
29
31
  speed?: number | undefined;
30
32
  instruction?: string | undefined;
31
33
  decoration?: string | undefined;
34
+ stability?: number | undefined;
35
+ similarity_boost?: number | undefined;
32
36
  } | undefined;
33
37
  provider?: string | undefined;
34
38
  model?: string | undefined;
@@ -541,6 +545,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
541
545
  speed?: number | undefined;
542
546
  instruction?: string | undefined;
543
547
  decoration?: string | undefined;
548
+ stability?: number | undefined;
549
+ similarity_boost?: number | undefined;
544
550
  } | undefined;
545
551
  textSlideParams?: {
546
552
  cssStyles: string | string[];
@@ -632,6 +638,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
632
638
  speed?: number | undefined;
633
639
  instruction?: string | undefined;
634
640
  decoration?: string | undefined;
641
+ stability?: number | undefined;
642
+ similarity_boost?: number | undefined;
635
643
  } | undefined;
636
644
  provider?: string | undefined;
637
645
  model?: string | undefined;
@@ -643,6 +651,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
643
651
  speed?: number | undefined;
644
652
  instruction?: string | undefined;
645
653
  decoration?: string | undefined;
654
+ stability?: number | undefined;
655
+ similarity_boost?: number | undefined;
646
656
  } | undefined;
647
657
  provider?: string | undefined;
648
658
  model?: string | undefined;
@@ -1155,6 +1165,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
1155
1165
  speed?: number | undefined;
1156
1166
  instruction?: string | undefined;
1157
1167
  decoration?: string | undefined;
1168
+ stability?: number | undefined;
1169
+ similarity_boost?: number | undefined;
1158
1170
  } | undefined;
1159
1171
  textSlideParams?: {
1160
1172
  cssStyles: string | string[];
@@ -1253,6 +1265,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
1253
1265
  speed?: number | undefined;
1254
1266
  instruction?: string | undefined;
1255
1267
  decoration?: string | undefined;
1268
+ stability?: number | undefined;
1269
+ similarity_boost?: number | undefined;
1256
1270
  } | undefined;
1257
1271
  provider?: string | undefined;
1258
1272
  model?: string | undefined;
@@ -1264,6 +1278,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
1264
1278
  speed?: number | undefined;
1265
1279
  instruction?: string | undefined;
1266
1280
  decoration?: string | undefined;
1281
+ stability?: number | undefined;
1282
+ similarity_boost?: number | undefined;
1267
1283
  } | undefined;
1268
1284
  provider?: string | undefined;
1269
1285
  model?: string | undefined;
@@ -17,10 +17,12 @@ export const nijovoiceTextAgentFilter = async (context, next) => {
17
17
  };
18
18
  export const fileCacheAgentFilter = async (context, next) => {
19
19
  const { force, file, index, mulmoContext, sessionType, id, withBackup } = context.namedInputs.cache;
20
+ /*
20
21
  const fileName = path.resolve(path.dirname(file), id + ".mp3");
21
22
  if (fs.existsSync(file)) {
22
- fs.copyFileSync(file, fileName);
23
+ fs.copyFileSync(file, fileName);
23
24
  }
25
+ */
24
26
  const shouldUseCache = async () => {
25
27
  if (force && force.some((element) => element)) {
26
28
  return false;
@@ -46,6 +46,7 @@ export declare const provider2TTSAgent: {
46
46
  models: string[];
47
47
  };
48
48
  };
49
+ export declare const gptImages: string[];
49
50
  export declare const provider2ImageAgent: {
50
51
  openai: {
51
52
  agentName: string;
@@ -49,11 +49,12 @@ export const provider2TTSAgent = {
49
49
  models: ["mock-model"],
50
50
  },
51
51
  };
52
+ export const gptImages = ["gpt-image-1.5", "gpt-image-1", "gpt-image-1-mini"];
52
53
  export const provider2ImageAgent = {
53
54
  openai: {
54
55
  agentName: "imageOpenaiAgent",
55
56
  defaultModel: "gpt-image-1",
56
- models: ["dall-e-3", "gpt-image-1"],
57
+ models: ["dall-e-3", ...gptImages],
57
58
  keyName: "OPENAI_API_KEY",
58
59
  baseURLKeyName: "OPENAI_BASE_URL",
59
60
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -74,7 +74,7 @@
74
74
  "homepage": "https://github.com/receptron/mulmocast-cli#readme",
75
75
  "dependencies": {
76
76
  "@google-cloud/text-to-speech": "^6.4.0",
77
- "@google/genai": "^1.32.0",
77
+ "@google/genai": "^1.33.0",
78
78
  "@graphai/anthropic_agent": "^2.0.12",
79
79
  "@graphai/browserless_agent": "^2.0.1",
80
80
  "@graphai/gemini_agent": "^2.0.1",
@@ -86,7 +86,7 @@
86
86
  "@graphai/vanilla_node_agents": "^2.0.4",
87
87
  "@inquirer/input": "^4.3.0",
88
88
  "@inquirer/select": "^4.4.1",
89
- "@modelcontextprotocol/sdk": "^1.22.0",
89
+ "@modelcontextprotocol/sdk": "^1.24.3",
90
90
  "@mozilla/readability": "^0.6.0",
91
91
  "@tavily/core": "^0.5.11",
92
92
  "archiver": "^7.0.1",
@@ -98,7 +98,7 @@
98
98
  "marked": "^17.0.1",
99
99
  "mulmocast-vision": "^1.0.8",
100
100
  "ora": "^9.0.0",
101
- "puppeteer": "^24.32.1",
101
+ "puppeteer": "^24.33.0",
102
102
  "replicate": "^1.4.0",
103
103
  "yaml": "^2.8.2",
104
104
  "yargs": "^18.0.0",
@@ -110,7 +110,7 @@
110
110
  "@types/fluent-ffmpeg": "^2.1.28",
111
111
  "@types/jsdom": "^27.0.0",
112
112
  "@types/yargs": "^17.0.35",
113
- "eslint": "^9.39.1",
113
+ "eslint": "^9.39.2",
114
114
  "eslint-config-prettier": "^10.1.8",
115
115
  "eslint-plugin-prettier": "^5.5.4",
116
116
  "eslint-plugin-sonarjs": "^3.0.5",
@@ -18,6 +18,15 @@
18
18
  "model": "gpt-image-1"
19
19
  }
20
20
  },
21
+ {
22
+ "speaker": "Presenter",
23
+ "text": "こんにちは、テストです。",
24
+ "imagePrompt": "美しい日本庭園",
25
+ "imageParams": {
26
+ "provider": "openai",
27
+ "model": "gpt-image-1.5"
28
+ }
29
+ },
21
30
  {
22
31
  "speaker": "Presenter",
23
32
  "text": "こんにちは、テストです。",
@@ -0,0 +1,30 @@
1
+ {
2
+ "$mulmocast": {
3
+ "version": "1.0",
4
+ "credit": "closing"
5
+ },
6
+ "speechParams": {
7
+ "speakers": {
8
+ "otan": {
9
+ "provider": "elevenlabs",
10
+ "voiceId": "21m00Tcm4TlvDq8ikWAM",
11
+ "speechOptions": {
12
+ "speed": 0.8,
13
+ "stability": 0.6,
14
+ "similarity_boost": 0.8
15
+ }
16
+ }
17
+ }
18
+ },
19
+ "beats": [
20
+ {
21
+ "id": "otan",
22
+ "speaker": "otan",
23
+ "text": "こんにちは, 良い天気です",
24
+ "image": {
25
+ "type": "markdown",
26
+ "markdown": ["# Voice is otan"]
27
+ }
28
+ }
29
+ ]
30
+ }
@@ -1 +0,0 @@
1
- import "dotenv/config";
@@ -1,12 +0,0 @@
1
- import "dotenv/config";
2
- import { ttsKotodamaAgent } from "./tts_kotodama_agent.js";
3
- const kotodamaApiKey = process.env.KOTODAMA_API_KEY ?? "";
4
- const main = async () => {
5
- const result = await ttsKotodamaAgent({
6
- namedInputs: { text: "こんにちは" },
7
- params: { voice: "Atla", decoration: "neutral", suppressError: false },
8
- config: { apiKey: kotodamaApiKey },
9
- });
10
- console.log("Result:", result);
11
- };
12
- main();
@@ -1,24 +0,0 @@
1
- /**
2
- * Wraps agent execution with standardized error handling
3
- *
4
- * @param agentName - Name of the agent for error reporting
5
- * @param action - Action being performed (e.g., "audio", "image", "movie")
6
- * @param target - Target of the action (e.g., "audioFile", "imageFile")
7
- * @param suppressError - If true, returns error object instead of throwing
8
- * @param fn - Async function to execute
9
- * @returns Result of fn or error object if suppressError is true
10
- */
11
- export declare const wrapAgentError: <T>(agentName: string, action: string, target: string, suppressError: boolean | undefined, fn: () => Promise<T>) => Promise<T | {
12
- error: unknown;
13
- }>;
14
- /**
15
- * Validates that an API key is present, throwing an error if missing
16
- *
17
- * @param apiKey - API key to validate
18
- * @param agentName - Name of the agent for error reporting
19
- * @param action - Action being performed
20
- * @param envVarName - Environment variable name for the API key
21
- * @returns The validated API key
22
- * @throws Error if API key is missing
23
- */
24
- export declare const requireApiKey: (apiKey: string | undefined, agentName: string, action: string, envVarName: string) => string;
@@ -1,59 +0,0 @@
1
- import { GraphAILogger } from "graphai";
2
- import { AuthenticationError, RateLimitError } from "openai";
3
- import { agentIncorrectAPIKeyError, agentAPIRateLimitError, agentGenerationError, hasCause, } from "./error_cause.js";
4
- /**
5
- * Wraps agent execution with standardized error handling
6
- *
7
- * @param agentName - Name of the agent for error reporting
8
- * @param action - Action being performed (e.g., "audio", "image", "movie")
9
- * @param target - Target of the action (e.g., "audioFile", "imageFile")
10
- * @param suppressError - If true, returns error object instead of throwing
11
- * @param fn - Async function to execute
12
- * @returns Result of fn or error object if suppressError is true
13
- */
14
- export const wrapAgentError = async (agentName, action, target, suppressError, fn) => {
15
- try {
16
- return await fn();
17
- }
18
- catch (error) {
19
- if (suppressError) {
20
- return { error };
21
- }
22
- GraphAILogger.info(error);
23
- if (error instanceof AuthenticationError) {
24
- throw new Error(`Failed: 401 Incorrect API key provided`, {
25
- cause: agentIncorrectAPIKeyError(agentName, action, target),
26
- });
27
- }
28
- if (error instanceof RateLimitError) {
29
- throw new Error("You exceeded your current quota, please check your plan and billing details", {
30
- cause: agentAPIRateLimitError(agentName, action, target),
31
- });
32
- }
33
- if (hasCause(error)) {
34
- throw error;
35
- }
36
- throw new Error(`Failed with ${agentName}`, {
37
- cause: agentGenerationError(agentName, action, target),
38
- });
39
- }
40
- };
41
- /**
42
- * Validates that an API key is present, throwing an error if missing
43
- *
44
- * @param apiKey - API key to validate
45
- * @param agentName - Name of the agent for error reporting
46
- * @param action - Action being performed
47
- * @param envVarName - Environment variable name for the API key
48
- * @returns The validated API key
49
- * @throws Error if API key is missing
50
- */
51
- export const requireApiKey = (apiKey, agentName, action, envVarName) => {
52
- if (!apiKey) {
53
- const { apiKeyMissingError } = require("./error_cause.js");
54
- throw new Error(`${envVarName} is required`, {
55
- cause: apiKeyMissingError(agentName, action, envVarName),
56
- });
57
- }
58
- return apiKey;
59
- };
@@ -1,12 +0,0 @@
1
- import type { AgentFunction, AgentFunctionInfo } from "graphai";
2
- /**
3
- * Creates standardized AgentFunctionInfo metadata for agents
4
- *
5
- * @param name - Agent name (e.g., "ttsOpenaiAgent")
6
- * @param agent - Agent function implementation
7
- * @param category - Agent categories (e.g., ["tts"], ["image"])
8
- * @param description - Human-readable description
9
- * @param environmentVariables - Required environment variables (e.g., ["OPENAI_API_KEY"])
10
- * @returns AgentFunctionInfo with standardized metadata
11
- */
12
- export declare const createAgentInfo: <P = unknown, R = unknown, I = unknown, C = unknown>(name: string, agent: AgentFunction<P, R, I, C>, category: string[], description: string, environmentVariables?: string[]) => AgentFunctionInfo;
@@ -1,23 +0,0 @@
1
- import { PROJECT_METADATA } from "./const.js";
2
- /**
3
- * Creates standardized AgentFunctionInfo metadata for agents
4
- *
5
- * @param name - Agent name (e.g., "ttsOpenaiAgent")
6
- * @param agent - Agent function implementation
7
- * @param category - Agent categories (e.g., ["tts"], ["image"])
8
- * @param description - Human-readable description
9
- * @param environmentVariables - Required environment variables (e.g., ["OPENAI_API_KEY"])
10
- * @returns AgentFunctionInfo with standardized metadata
11
- */
12
- export const createAgentInfo = (name, agent, category, description, environmentVariables = []) => ({
13
- name,
14
- agent,
15
- mock: agent,
16
- samples: [],
17
- description,
18
- category,
19
- author: PROJECT_METADATA.author,
20
- repository: PROJECT_METADATA.repository,
21
- license: PROJECT_METADATA.license,
22
- environmentVariables,
23
- });
@@ -1,62 +0,0 @@
1
- {
2
- "$mulmocast": {
3
- "version": "1.1"
4
- },
5
- "lang": "en",
6
- "title": "Transition Test",
7
- "movieParams": {
8
- "transition": {
9
- "type": "fade",
10
- "duration": 1.0
11
- }
12
- },
13
- "beats": [
14
- {
15
- "speaker": "Presenter",
16
- "text": "",
17
- "image": {
18
- "type": "image",
19
- "source": {
20
- "kind": "path",
21
- "path": "../../assets/images/mulmocast_credit.png"
22
- }
23
- }
24
- },
25
- {
26
- "speaker": "Presenter",
27
- "duration": 3.0,
28
- "image": {
29
- "type": "textSlide",
30
- "slide": {
31
- "title": "3.0 second with no Audio"
32
- }
33
- }
34
- },
35
- {
36
- "speaker": "Presenter",
37
- "duration": 3.0,
38
- "movieParams": {
39
- "transition": {
40
- "type": "slideout_left",
41
- "duration": 1.0
42
- }
43
- },
44
- "image": {
45
- "type": "textSlide",
46
- "slide": {
47
- "title": "3.0 second with no Audio"
48
- }
49
- }
50
- },
51
- {
52
- "speaker": "Presenter",
53
- "image": {
54
- "type": "movie",
55
- "source": {
56
- "kind": "url",
57
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/test/pingpong.mov"
58
- }
59
- }
60
- }
61
- ]
62
- }
@@ -1,76 +0,0 @@
1
- {
2
- "$mulmocast": {
3
- "version": "1.1"
4
- },
5
- "lang": "en",
6
- "title": "Transition Test",
7
- "movieParams": {
8
- "transition": {
9
- "type": "fade",
10
- "duration": 1.0
11
- }
12
- },
13
- "beats": [
14
- {
15
- "speaker": "Presenter",
16
- "text": "",
17
- "image": {
18
- "type": "image",
19
- "source": {
20
- "kind": "path",
21
- "path": "../../assets/images/mulmocast_credit.png"
22
- }
23
- }
24
- },
25
- {
26
- "speaker": "Presenter",
27
- "image": {
28
- "type": "textSlide",
29
- "slide": {
30
- "title": "1"
31
- }
32
- }
33
- },
34
- {
35
- "speaker": "Presenter",
36
- "movieParams": {
37
- "transition": {
38
- "type": "slideout_left",
39
- "duration": 1.0
40
- }
41
- },
42
- "image": {
43
- "type": "textSlide",
44
- "slide": {
45
- "title": "2"
46
- }
47
- }
48
- },
49
- {
50
- "speaker": "Presenter",
51
- "image": {
52
- "type": "movie",
53
- "source": {
54
- "kind": "url",
55
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/tv.mov"
56
- }
57
- }
58
- },
59
- {
60
- "speaker": "Presenter",
61
- "movieParams": {
62
- "transition": {
63
- "type": "slideout_left",
64
- "duration": 1.0
65
- }
66
- },
67
- "image": {
68
- "type": "movie",
69
- "source": {
70
- "kind": "url",
71
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/test/pingpong.mov"
72
- }
73
- }
74
- }
75
- ]
76
- }
@@ -1,227 +0,0 @@
1
- {
2
- "$mulmocast": {
3
- "version": "1.1"
4
- },
5
- "lang": "en",
6
- "title": "Video Filter Test",
7
- "speechParams": {
8
- "speakers": {
9
- "Presenter": {
10
- "voiceId": "shimmer",
11
- "displayName": {
12
- "en": "Presenter"
13
- }
14
- }
15
- }
16
- },
17
- "beats": [
18
- {
19
- "speaker": "Presenter",
20
- "text": "Original.",
21
- "image": {
22
- "type": "movie",
23
- "source": {
24
- "kind": "url",
25
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
26
- }
27
- }
28
- },
29
- {
30
- "speaker": "Presenter",
31
- "text": "Mono filter.",
32
- "movieParams": {
33
- "filters": [
34
- {
35
- "type": "mono"
36
- }
37
- ]
38
- },
39
- "image": {
40
- "type": "movie",
41
- "source": {
42
- "kind": "url",
43
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
44
- }
45
- }
46
- },
47
- {
48
- "speaker": "Presenter",
49
- "text": "Sepia filter.",
50
- "movieParams": {
51
- "filters": [
52
- {
53
- "type": "sepia"
54
- }
55
- ]
56
- },
57
- "image": {
58
- "type": "movie",
59
- "source": {
60
- "kind": "url",
61
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
62
- }
63
- }
64
- },
65
- {
66
- "speaker": "Presenter",
67
- "text": "Brightness and contrast filter.",
68
- "movieParams": {
69
- "filters": [
70
- {
71
- "type": "brightness_contrast",
72
- "brightness": 0.05,
73
- "contrast": 1.3
74
- }
75
- ]
76
- },
77
- "image": {
78
- "type": "movie",
79
- "source": {
80
- "kind": "url",
81
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
82
- }
83
- }
84
- },
85
- {
86
- "speaker": "Presenter",
87
- "text": "Box blur filter.",
88
- "movieParams": {
89
- "filters": [
90
- {
91
- "type": "blur",
92
- "radius": 10,
93
- "power": 1
94
- }
95
- ]
96
- },
97
- "image": {
98
- "type": "movie",
99
- "source": {
100
- "kind": "url",
101
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
102
- }
103
- }
104
- },
105
- {
106
- "speaker": "Presenter",
107
- "text": "Gaussian blur filter.",
108
- "movieParams": {
109
- "filters": [
110
- {
111
- "type": "gblur",
112
- "sigma": 30
113
- }
114
- ]
115
- },
116
- "image": {
117
- "type": "movie",
118
- "source": {
119
- "kind": "url",
120
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
121
- }
122
- }
123
- },
124
- {
125
- "speaker": "Presenter",
126
- "text": "Glitch noise filter.",
127
- "movieParams": {
128
- "filters": [
129
- {
130
- "type": "glitch",
131
- "intensity": 20,
132
- "style": "noise"
133
- }
134
- ]
135
- },
136
- "image": {
137
- "type": "movie",
138
- "source": {
139
- "kind": "url",
140
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
141
- }
142
- }
143
- },
144
- {
145
- "speaker": "Presenter",
146
- "text": "Glitch blend filter.",
147
- "movieParams": {
148
- "filters": [
149
- {
150
- "type": "glitch",
151
- "intensity": 40,
152
- "style": "blend"
153
- }
154
- ]
155
- },
156
- "image": {
157
- "type": "movie",
158
- "source": {
159
- "kind": "url",
160
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
161
- }
162
- }
163
- },
164
- {
165
- "speaker": "Presenter",
166
- "text": "Grain filter.",
167
- "movieParams": {
168
- "filters": [
169
- {
170
- "type": "grain",
171
- "intensity": 10
172
- }
173
- ]
174
- },
175
- "image": {
176
- "type": "movie",
177
- "source": {
178
- "kind": "url",
179
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
180
- }
181
- }
182
- },
183
- {
184
- "speaker": "Presenter",
185
- "text": "Combined contrast and grain filters.",
186
- "movieParams": {
187
- "filters": [
188
- {
189
- "type": "brightness_contrast",
190
- "brightness": 0,
191
- "contrast": 1.2
192
- },
193
- {
194
- "type": "grain",
195
- "intensity": 6
196
- }
197
- ]
198
- },
199
- "image": {
200
- "type": "movie",
201
- "source": {
202
- "kind": "url",
203
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
204
- }
205
- }
206
- },
207
- {
208
- "speaker": "Presenter",
209
- "text": "Custom horizontal flip filter.",
210
- "movieParams": {
211
- "filters": [
212
- {
213
- "type": "custom",
214
- "filter": "hflip"
215
- }
216
- ]
217
- },
218
- "image": {
219
- "type": "movie",
220
- "source": {
221
- "kind": "url",
222
- "url": "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/movies/horse_galloping.mov"
223
- }
224
- }
225
- }
226
- ]
227
- }