@juspay/neurolink 9.64.0 → 9.65.1
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/CHANGELOG.md +12 -0
- package/README.md +18 -17
- package/dist/adapters/providerImageAdapter.js +29 -1
- package/dist/adapters/replicate/auth.d.ts +19 -0
- package/dist/adapters/replicate/auth.js +32 -0
- package/dist/adapters/replicate/predictionLifecycle.d.ts +46 -0
- package/dist/adapters/replicate/predictionLifecycle.js +283 -0
- package/dist/adapters/video/klingVideoHandler.d.ts +37 -0
- package/dist/adapters/video/klingVideoHandler.js +305 -0
- package/dist/adapters/video/replicateVideoHandler.d.ts +29 -0
- package/dist/adapters/video/replicateVideoHandler.js +157 -0
- package/dist/adapters/video/runwayVideoHandler.d.ts +32 -0
- package/dist/adapters/video/runwayVideoHandler.js +316 -0
- package/dist/adapters/video/vertexVideoHandler.d.ts +19 -1
- package/dist/adapters/video/vertexVideoHandler.js +33 -9
- package/dist/agent/directTools.js +11 -3
- package/dist/autoresearch/runner.js +8 -2
- package/dist/avatar/index.d.ts +13 -0
- package/dist/avatar/index.js +13 -0
- package/dist/avatar/providers/DIDAvatar.d.ts +49 -0
- package/dist/avatar/providers/DIDAvatar.js +501 -0
- package/dist/avatar/providers/HeyGenAvatar.d.ts +30 -0
- package/dist/avatar/providers/HeyGenAvatar.js +337 -0
- package/dist/avatar/providers/ReplicateAvatar.d.ts +36 -0
- package/dist/avatar/providers/ReplicateAvatar.js +267 -0
- package/dist/browser/neurolink.min.js +624 -601
- package/dist/cli/commands/mcp.js +29 -0
- package/dist/cli/commands/proxy.js +24 -5
- package/dist/cli/factories/commandFactory.d.ts +11 -1
- package/dist/cli/factories/commandFactory.js +291 -38
- package/dist/constants/contextWindows.js +101 -0
- package/dist/constants/enums.d.ts +273 -2
- package/dist/constants/enums.js +290 -1
- package/dist/constants/videoErrors.d.ts +4 -0
- package/dist/constants/videoErrors.js +4 -0
- package/dist/core/baseProvider.d.ts +22 -2
- package/dist/core/baseProvider.js +217 -11
- package/dist/core/constants.d.ts +12 -0
- package/dist/core/constants.js +72 -1
- package/dist/evaluation/index.d.ts +2 -0
- package/dist/evaluation/index.js +4 -0
- package/dist/factories/providerFactory.js +7 -1
- package/dist/factories/providerRegistry.js +202 -5
- package/dist/features/ppt/contentPlanner.js +42 -14
- package/dist/index.d.ts +9 -1
- package/dist/index.js +16 -1
- package/dist/lib/adapters/providerImageAdapter.js +29 -1
- package/dist/lib/adapters/replicate/auth.d.ts +19 -0
- package/dist/lib/adapters/replicate/auth.js +33 -0
- package/dist/lib/adapters/replicate/predictionLifecycle.d.ts +46 -0
- package/dist/lib/adapters/replicate/predictionLifecycle.js +284 -0
- package/dist/lib/adapters/video/klingVideoHandler.d.ts +37 -0
- package/dist/lib/adapters/video/klingVideoHandler.js +306 -0
- package/dist/lib/adapters/video/replicateVideoHandler.d.ts +29 -0
- package/dist/lib/adapters/video/replicateVideoHandler.js +158 -0
- package/dist/lib/adapters/video/runwayVideoHandler.d.ts +32 -0
- package/dist/lib/adapters/video/runwayVideoHandler.js +317 -0
- package/dist/lib/adapters/video/vertexVideoHandler.d.ts +19 -1
- package/dist/lib/adapters/video/vertexVideoHandler.js +33 -9
- package/dist/lib/agent/directTools.js +11 -3
- package/dist/lib/autoresearch/runner.js +8 -2
- package/dist/lib/avatar/index.d.ts +13 -0
- package/dist/lib/avatar/index.js +14 -0
- package/dist/lib/avatar/providers/DIDAvatar.d.ts +49 -0
- package/dist/lib/avatar/providers/DIDAvatar.js +502 -0
- package/dist/lib/avatar/providers/HeyGenAvatar.d.ts +30 -0
- package/dist/lib/avatar/providers/HeyGenAvatar.js +338 -0
- package/dist/lib/avatar/providers/ReplicateAvatar.d.ts +36 -0
- package/dist/lib/avatar/providers/ReplicateAvatar.js +268 -0
- package/dist/lib/constants/contextWindows.js +101 -0
- package/dist/lib/constants/enums.d.ts +273 -2
- package/dist/lib/constants/enums.js +290 -1
- package/dist/lib/constants/videoErrors.d.ts +4 -0
- package/dist/lib/constants/videoErrors.js +4 -0
- package/dist/lib/core/baseProvider.d.ts +22 -2
- package/dist/lib/core/baseProvider.js +217 -11
- package/dist/lib/core/constants.d.ts +12 -0
- package/dist/lib/core/constants.js +72 -1
- package/dist/lib/evaluation/index.d.ts +2 -0
- package/dist/lib/evaluation/index.js +4 -0
- package/dist/lib/factories/providerFactory.js +7 -1
- package/dist/lib/factories/providerRegistry.js +202 -5
- package/dist/lib/features/ppt/contentPlanner.js +42 -14
- package/dist/lib/index.d.ts +9 -1
- package/dist/lib/index.js +16 -1
- package/dist/lib/middleware/builtin/lifecycle.js +39 -9
- package/dist/lib/music/index.d.ts +13 -0
- package/dist/lib/music/index.js +14 -0
- package/dist/lib/music/providers/BeatovenMusic.d.ts +31 -0
- package/dist/lib/music/providers/BeatovenMusic.js +334 -0
- package/dist/lib/music/providers/ElevenLabsMusic.d.ts +30 -0
- package/dist/lib/music/providers/ElevenLabsMusic.js +169 -0
- package/dist/lib/music/providers/LyriaMusic.d.ts +29 -0
- package/dist/lib/music/providers/LyriaMusic.js +173 -0
- package/dist/lib/music/providers/ReplicateMusic.d.ts +31 -0
- package/dist/lib/music/providers/ReplicateMusic.js +262 -0
- package/dist/lib/neurolink.d.ts +30 -0
- package/dist/lib/neurolink.js +323 -77
- package/dist/lib/providers/amazonBedrock.d.ts +10 -0
- package/dist/lib/providers/amazonBedrock.js +94 -39
- package/dist/lib/providers/anthropic.js +55 -7
- package/dist/lib/providers/anthropicBaseProvider.js +1 -1
- package/dist/lib/providers/azureOpenai.js +66 -17
- package/dist/lib/providers/cloudflare.d.ts +35 -0
- package/dist/lib/providers/cloudflare.js +174 -0
- package/dist/lib/providers/cohere.d.ts +52 -0
- package/dist/lib/providers/cohere.js +253 -0
- package/dist/lib/providers/deepseek.js +72 -17
- package/dist/lib/providers/fireworks.d.ts +33 -0
- package/dist/lib/providers/fireworks.js +164 -0
- package/dist/lib/providers/googleAiStudio.js +126 -10
- package/dist/lib/providers/googleNativeGemini3.d.ts +26 -6
- package/dist/lib/providers/googleNativeGemini3.js +276 -29
- package/dist/lib/providers/googleVertex.js +639 -181
- package/dist/lib/providers/groq.d.ts +33 -0
- package/dist/lib/providers/groq.js +181 -0
- package/dist/lib/providers/huggingFace.js +9 -8
- package/dist/lib/providers/ideogram.d.ts +34 -0
- package/dist/lib/providers/ideogram.js +184 -0
- package/dist/lib/providers/index.d.ts +13 -0
- package/dist/lib/providers/index.js +13 -0
- package/dist/lib/providers/jina.d.ts +59 -0
- package/dist/lib/providers/jina.js +218 -0
- package/dist/lib/providers/llamaCpp.js +14 -46
- package/dist/lib/providers/lmStudio.js +14 -47
- package/dist/lib/providers/mistral.js +7 -7
- package/dist/lib/providers/nvidiaNim.js +160 -19
- package/dist/lib/providers/ollama.js +7 -7
- package/dist/lib/providers/openAI.d.ts +22 -1
- package/dist/lib/providers/openAI.js +181 -0
- package/dist/lib/providers/openRouter.js +35 -23
- package/dist/lib/providers/openaiCompatible.js +9 -8
- package/dist/lib/providers/perplexity.d.ts +33 -0
- package/dist/lib/providers/perplexity.js +179 -0
- package/dist/lib/providers/recraft.d.ts +34 -0
- package/dist/lib/providers/recraft.js +197 -0
- package/dist/lib/providers/replicate.d.ts +75 -0
- package/dist/lib/providers/replicate.js +403 -0
- package/dist/lib/providers/stability.d.ts +37 -0
- package/dist/lib/providers/stability.js +191 -0
- package/dist/lib/providers/togetherAi.d.ts +33 -0
- package/dist/lib/providers/togetherAi.js +176 -0
- package/dist/lib/providers/voyage.d.ts +47 -0
- package/dist/lib/providers/voyage.js +177 -0
- package/dist/lib/providers/xai.d.ts +33 -0
- package/dist/lib/providers/xai.js +172 -0
- package/dist/lib/telemetry/index.d.ts +1 -1
- package/dist/lib/telemetry/index.js +1 -1
- package/dist/lib/telemetry/tracers.d.ts +19 -0
- package/dist/lib/telemetry/tracers.js +19 -0
- package/dist/lib/telemetry/withSpan.d.ts +35 -0
- package/dist/lib/telemetry/withSpan.js +103 -0
- package/dist/lib/types/avatar.d.ts +143 -0
- package/dist/lib/types/avatar.js +20 -0
- package/dist/lib/types/cli.d.ts +6 -0
- package/dist/lib/types/conversation.d.ts +16 -0
- package/dist/lib/types/generate.d.ts +62 -5
- package/dist/lib/types/index.d.ts +5 -0
- package/dist/lib/types/index.js +7 -0
- package/dist/lib/types/middleware.d.ts +27 -0
- package/dist/lib/types/multimodal.d.ts +35 -2
- package/dist/lib/types/music.d.ts +165 -0
- package/dist/lib/types/music.js +21 -0
- package/dist/lib/types/providers.d.ts +144 -1
- package/dist/lib/types/replicate.d.ts +67 -0
- package/dist/lib/types/replicate.js +10 -0
- package/dist/lib/types/safeFetch.d.ts +15 -0
- package/dist/lib/types/safeFetch.js +7 -0
- package/dist/lib/types/stream.d.ts +2 -1
- package/dist/lib/types/tools.d.ts +13 -0
- package/dist/lib/types/video.d.ts +89 -0
- package/dist/lib/types/video.js +15 -0
- package/dist/lib/utils/avatarProcessor.d.ts +68 -0
- package/dist/lib/utils/avatarProcessor.js +172 -0
- package/dist/lib/utils/cloneOptions.d.ts +36 -0
- package/dist/lib/utils/cloneOptions.js +62 -0
- package/dist/lib/utils/lifecycleCallbacks.d.ts +51 -8
- package/dist/lib/utils/lifecycleCallbacks.js +82 -26
- package/dist/lib/utils/lifecycleTimeout.d.ts +25 -0
- package/dist/lib/utils/lifecycleTimeout.js +39 -0
- package/dist/lib/utils/logSanitize.d.ts +49 -0
- package/dist/lib/utils/logSanitize.js +170 -0
- package/dist/lib/utils/loggingFetch.d.ts +29 -0
- package/dist/lib/utils/loggingFetch.js +60 -0
- package/dist/lib/utils/messageBuilder.js +43 -25
- package/dist/lib/utils/modelChoices.js +236 -3
- package/dist/lib/utils/musicProcessor.d.ts +67 -0
- package/dist/lib/utils/musicProcessor.js +189 -0
- package/dist/lib/utils/optionsConversion.js +3 -2
- package/dist/lib/utils/parameterValidation.js +14 -4
- package/dist/lib/utils/pricing.js +193 -0
- package/dist/lib/utils/providerConfig.d.ts +55 -0
- package/dist/lib/utils/providerConfig.js +224 -0
- package/dist/lib/utils/safeFetch.d.ts +26 -0
- package/dist/lib/utils/safeFetch.js +83 -0
- package/dist/lib/utils/sizeGuard.d.ts +34 -0
- package/dist/lib/utils/sizeGuard.js +45 -0
- package/dist/lib/utils/ssrfGuard.d.ts +52 -0
- package/dist/lib/utils/ssrfGuard.js +411 -0
- package/dist/lib/utils/videoProcessor.d.ts +60 -0
- package/dist/lib/utils/videoProcessor.js +201 -0
- package/dist/lib/voice/providers/FishAudioTTS.d.ts +27 -0
- package/dist/lib/voice/providers/FishAudioTTS.js +183 -0
- package/dist/lib/workflow/core/ensembleExecutor.js +26 -9
- package/dist/middleware/builtin/lifecycle.js +39 -9
- package/dist/music/index.d.ts +13 -0
- package/dist/music/index.js +13 -0
- package/dist/music/providers/BeatovenMusic.d.ts +31 -0
- package/dist/music/providers/BeatovenMusic.js +333 -0
- package/dist/music/providers/ElevenLabsMusic.d.ts +30 -0
- package/dist/music/providers/ElevenLabsMusic.js +168 -0
- package/dist/music/providers/LyriaMusic.d.ts +29 -0
- package/dist/music/providers/LyriaMusic.js +172 -0
- package/dist/music/providers/ReplicateMusic.d.ts +31 -0
- package/dist/music/providers/ReplicateMusic.js +261 -0
- package/dist/neurolink.d.ts +30 -0
- package/dist/neurolink.js +323 -77
- package/dist/providers/amazonBedrock.d.ts +10 -0
- package/dist/providers/amazonBedrock.js +94 -39
- package/dist/providers/anthropic.js +55 -7
- package/dist/providers/anthropicBaseProvider.js +1 -1
- package/dist/providers/azureOpenai.js +66 -17
- package/dist/providers/cloudflare.d.ts +35 -0
- package/dist/providers/cloudflare.js +173 -0
- package/dist/providers/cohere.d.ts +52 -0
- package/dist/providers/cohere.js +252 -0
- package/dist/providers/deepseek.js +72 -17
- package/dist/providers/fireworks.d.ts +33 -0
- package/dist/providers/fireworks.js +163 -0
- package/dist/providers/googleAiStudio.js +126 -10
- package/dist/providers/googleNativeGemini3.d.ts +26 -6
- package/dist/providers/googleNativeGemini3.js +276 -29
- package/dist/providers/googleVertex.js +639 -181
- package/dist/providers/groq.d.ts +33 -0
- package/dist/providers/groq.js +180 -0
- package/dist/providers/huggingFace.js +9 -8
- package/dist/providers/ideogram.d.ts +34 -0
- package/dist/providers/ideogram.js +183 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.js +13 -0
- package/dist/providers/jina.d.ts +59 -0
- package/dist/providers/jina.js +217 -0
- package/dist/providers/llamaCpp.js +14 -46
- package/dist/providers/lmStudio.js +14 -47
- package/dist/providers/mistral.js +7 -7
- package/dist/providers/nvidiaNim.js +160 -19
- package/dist/providers/ollama.js +7 -7
- package/dist/providers/openAI.d.ts +22 -1
- package/dist/providers/openAI.js +181 -0
- package/dist/providers/openRouter.js +35 -23
- package/dist/providers/openaiCompatible.js +9 -8
- package/dist/providers/perplexity.d.ts +33 -0
- package/dist/providers/perplexity.js +178 -0
- package/dist/providers/recraft.d.ts +34 -0
- package/dist/providers/recraft.js +196 -0
- package/dist/providers/replicate.d.ts +75 -0
- package/dist/providers/replicate.js +402 -0
- package/dist/providers/stability.d.ts +37 -0
- package/dist/providers/stability.js +190 -0
- package/dist/providers/togetherAi.d.ts +33 -0
- package/dist/providers/togetherAi.js +175 -0
- package/dist/providers/voyage.d.ts +47 -0
- package/dist/providers/voyage.js +176 -0
- package/dist/providers/xai.d.ts +33 -0
- package/dist/providers/xai.js +171 -0
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/tracers.d.ts +19 -0
- package/dist/telemetry/tracers.js +19 -0
- package/dist/telemetry/withSpan.d.ts +35 -0
- package/dist/telemetry/withSpan.js +103 -0
- package/dist/types/avatar.d.ts +143 -0
- package/dist/types/avatar.js +19 -0
- package/dist/types/cli.d.ts +6 -0
- package/dist/types/conversation.d.ts +16 -0
- package/dist/types/generate.d.ts +62 -5
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +7 -0
- package/dist/types/middleware.d.ts +27 -0
- package/dist/types/multimodal.d.ts +35 -2
- package/dist/types/music.d.ts +165 -0
- package/dist/types/music.js +20 -0
- package/dist/types/providers.d.ts +144 -1
- package/dist/types/replicate.d.ts +67 -0
- package/dist/types/replicate.js +9 -0
- package/dist/types/safeFetch.d.ts +15 -0
- package/dist/types/safeFetch.js +6 -0
- package/dist/types/stream.d.ts +2 -1
- package/dist/types/tools.d.ts +13 -0
- package/dist/types/video.d.ts +89 -0
- package/dist/types/video.js +14 -0
- package/dist/utils/avatarProcessor.d.ts +68 -0
- package/dist/utils/avatarProcessor.js +171 -0
- package/dist/utils/cloneOptions.d.ts +36 -0
- package/dist/utils/cloneOptions.js +61 -0
- package/dist/utils/lifecycleCallbacks.d.ts +51 -8
- package/dist/utils/lifecycleCallbacks.js +82 -26
- package/dist/utils/lifecycleTimeout.d.ts +25 -0
- package/dist/utils/lifecycleTimeout.js +38 -0
- package/dist/utils/logSanitize.d.ts +49 -0
- package/dist/utils/logSanitize.js +169 -0
- package/dist/utils/loggingFetch.d.ts +29 -0
- package/dist/utils/loggingFetch.js +59 -0
- package/dist/utils/messageBuilder.js +43 -25
- package/dist/utils/modelChoices.js +236 -3
- package/dist/utils/musicProcessor.d.ts +67 -0
- package/dist/utils/musicProcessor.js +188 -0
- package/dist/utils/optionsConversion.js +3 -2
- package/dist/utils/parameterValidation.js +14 -4
- package/dist/utils/pricing.js +193 -0
- package/dist/utils/providerConfig.d.ts +55 -0
- package/dist/utils/providerConfig.js +224 -0
- package/dist/utils/safeFetch.d.ts +26 -0
- package/dist/utils/safeFetch.js +82 -0
- package/dist/utils/sizeGuard.d.ts +34 -0
- package/dist/utils/sizeGuard.js +44 -0
- package/dist/utils/ssrfGuard.d.ts +52 -0
- package/dist/utils/ssrfGuard.js +410 -0
- package/dist/utils/videoProcessor.d.ts +60 -0
- package/dist/utils/videoProcessor.js +200 -0
- package/dist/voice/providers/FishAudioTTS.d.ts +27 -0
- package/dist/voice/providers/FishAudioTTS.js +182 -0
- package/dist/workflow/core/ensembleExecutor.js +26 -9
- package/package.json +32 -5
package/dist/cli/commands/mcp.js
CHANGED
|
@@ -2286,7 +2286,36 @@ ${tools.length > 0 ? tools.map((t) => `- **${t}**: TODO: Add description`).join(
|
|
|
2286
2286
|
logger.error(chalk.red("Tool name is required. Use --tool <name> or --list to see all tools."));
|
|
2287
2287
|
process.exit(1);
|
|
2288
2288
|
}
|
|
2289
|
+
// `--infer` standalone path: when the user passes `--tool <name> --infer`
|
|
2290
|
+
// and no server scope, emit the heuristic annotations inferred purely
|
|
2291
|
+
// from the tool name/description. This makes `--infer` useful in any
|
|
2292
|
+
// environment (no MCP servers required) and matches user intent —
|
|
2293
|
+
// "show me what NeuroLink would infer for a tool with this name".
|
|
2289
2294
|
const serverId = argv.server;
|
|
2295
|
+
if (argv.infer &&
|
|
2296
|
+
!serverId &&
|
|
2297
|
+
servers.filter((s) => s.status === "connected").length === 0) {
|
|
2298
|
+
const inferred = inferAnnotations({
|
|
2299
|
+
name: toolName,
|
|
2300
|
+
description: "",
|
|
2301
|
+
});
|
|
2302
|
+
const errors = validateAnnotations(inferred);
|
|
2303
|
+
if (errors.length > 0) {
|
|
2304
|
+
logger.error(chalk.red("Inferred annotations validation errors:"));
|
|
2305
|
+
for (const error of errors) {
|
|
2306
|
+
logger.error(chalk.red(` - ${error}`));
|
|
2307
|
+
}
|
|
2308
|
+
process.exit(1);
|
|
2309
|
+
}
|
|
2310
|
+
if (argv.format === "json") {
|
|
2311
|
+
logger.always(JSON.stringify({ tool: toolName, inferred: true, annotations: inferred }, null, 2));
|
|
2312
|
+
}
|
|
2313
|
+
else {
|
|
2314
|
+
logger.always(chalk.bold(`\nInferred annotations for ${chalk.cyan(toolName)}:`));
|
|
2315
|
+
logger.always(JSON.stringify(inferred, null, 2));
|
|
2316
|
+
}
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2290
2319
|
const foundTool = this.findToolForAnnotation(servers, toolName, serverId);
|
|
2291
2320
|
if (foundTool === "ambiguous") {
|
|
2292
2321
|
logger.error(chalk.red(`Tool '${toolName}' exists on multiple servers. Use --server <id> to specify which server to annotate.`));
|
|
@@ -565,20 +565,39 @@ export function mapClaudeErrorTypeToStatus(errorType) {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
async function ensureProxyStartAllowed(spinner) {
|
|
568
|
+
const ignoreLaunchd = process.env.NEUROLINK_PROXY_IGNORE_LAUNCHD === "1" ||
|
|
569
|
+
process.env.NEUROLINK_PROXY_IGNORE_LAUNCHD === "true";
|
|
568
570
|
const existingState = loadProxyState();
|
|
569
571
|
if (existingState) {
|
|
570
572
|
if (isProcessRunning(existingState.pid)) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
+
// Test / dev escape hatch: when NEUROLINK_PROXY_IGNORE_LAUNCHD is set,
|
|
574
|
+
// allow starting a second proxy on the test's requested port even if
|
|
575
|
+
// a launchd-managed instance is using a different port (its state
|
|
576
|
+
// file is what we hit here). The shared port-conflict surface remains
|
|
577
|
+
// — node will fail to bind if the requested port is actually busy.
|
|
578
|
+
if (!ignoreLaunchd) {
|
|
579
|
+
if (spinner) {
|
|
580
|
+
spinner.fail(chalk.red(`Proxy already running on port ${existingState.port} (PID: ${existingState.pid})`));
|
|
581
|
+
}
|
|
582
|
+
logger.always(chalk.yellow("Stop it first or use 'neurolink proxy status' to inspect"));
|
|
583
|
+
process.exit(process.ppid === 1 ? 0 : 1);
|
|
573
584
|
}
|
|
574
|
-
logger.always(chalk.yellow("Stop it first or use 'neurolink proxy status' to inspect"));
|
|
575
|
-
process.exit(process.ppid === 1 ? 0 : 1);
|
|
576
585
|
}
|
|
577
|
-
|
|
586
|
+
else {
|
|
587
|
+
clearProxyState();
|
|
588
|
+
}
|
|
578
589
|
}
|
|
579
590
|
if (process.ppid === 1 || !(await isLaunchdManaging())) {
|
|
580
591
|
return;
|
|
581
592
|
}
|
|
593
|
+
// Test / dev escape hatch: when starting on an explicit non-default port,
|
|
594
|
+
// the launchd-managed proxy (typically on its own port) cannot conflict.
|
|
595
|
+
// Setting `NEUROLINK_PROXY_IGNORE_LAUNCHD=1` lets the test suite start a
|
|
596
|
+
// standalone proxy alongside the launchd one without removing the daemon.
|
|
597
|
+
if (process.env.NEUROLINK_PROXY_IGNORE_LAUNCHD === "1" ||
|
|
598
|
+
process.env.NEUROLINK_PROXY_IGNORE_LAUNCHD === "true") {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
582
601
|
if (spinner) {
|
|
583
602
|
spinner.fail(chalk.red("Proxy is managed by launchd. Manual start would cause port conflicts."));
|
|
584
603
|
}
|
|
@@ -54,6 +54,16 @@ export declare class CLICommandFactory {
|
|
|
54
54
|
* Saves generated video to file when --videoOutput flag is provided
|
|
55
55
|
*/
|
|
56
56
|
private static handleVideoOutput;
|
|
57
|
+
/**
|
|
58
|
+
* Helper method to handle avatar video file output.
|
|
59
|
+
* Saves the generated avatar buffer to --avatarOutput path when provided.
|
|
60
|
+
*/
|
|
61
|
+
private static handleAvatarOutput;
|
|
62
|
+
/**
|
|
63
|
+
* Helper method to handle music audio file output.
|
|
64
|
+
* Saves the generated music buffer to --musicOutput path when provided.
|
|
65
|
+
*/
|
|
66
|
+
private static handleMusicOutput;
|
|
57
67
|
/**
|
|
58
68
|
* Helper method to handle PPT file output
|
|
59
69
|
* Displays PPT generation result info
|
|
@@ -142,7 +152,7 @@ export declare class CLICommandFactory {
|
|
|
142
152
|
*/
|
|
143
153
|
private static handleGenerateStdinInput;
|
|
144
154
|
/**
|
|
145
|
-
* Detect output mode (video, ppt, or text) based on CLI arguments
|
|
155
|
+
* Detect output mode (video, ppt, avatar, music, or text) based on CLI arguments
|
|
146
156
|
*/
|
|
147
157
|
private static detectGenerateOutputMode;
|
|
148
158
|
/**
|
|
@@ -90,6 +90,28 @@ export class CLICommandFactory {
|
|
|
90
90
|
"lms",
|
|
91
91
|
"llamacpp",
|
|
92
92
|
"llama.cpp",
|
|
93
|
+
"xai",
|
|
94
|
+
"grok",
|
|
95
|
+
"groq",
|
|
96
|
+
"cohere",
|
|
97
|
+
"together-ai",
|
|
98
|
+
"together",
|
|
99
|
+
"fireworks",
|
|
100
|
+
"perplexity",
|
|
101
|
+
"pplx",
|
|
102
|
+
"cloudflare",
|
|
103
|
+
"workers-ai",
|
|
104
|
+
"cf-ai",
|
|
105
|
+
"replicate",
|
|
106
|
+
"voyage",
|
|
107
|
+
"voyage-ai",
|
|
108
|
+
"jina",
|
|
109
|
+
"jina-ai",
|
|
110
|
+
"stability",
|
|
111
|
+
"stability-ai",
|
|
112
|
+
"sd",
|
|
113
|
+
"ideogram",
|
|
114
|
+
"recraft",
|
|
93
115
|
],
|
|
94
116
|
default: "auto",
|
|
95
117
|
description: "AI provider to use (auto-selects best available). Use 'anthropic-subscription' for Claude subscription plans.",
|
|
@@ -366,12 +388,16 @@ export class CLICommandFactory {
|
|
|
366
388
|
type: "string",
|
|
367
389
|
description: "Path to audio file for STT transcription",
|
|
368
390
|
},
|
|
369
|
-
// Video Generation options (Veo 3.1)
|
|
391
|
+
// Video Generation options (Veo 3.1, Kling, Runway, Replicate)
|
|
370
392
|
outputMode: {
|
|
371
393
|
type: "string",
|
|
372
|
-
choices: ["text", "video", "ppt"],
|
|
394
|
+
choices: ["text", "video", "ppt", "avatar", "music"],
|
|
373
395
|
default: "text",
|
|
374
|
-
description: "Output mode: 'text'
|
|
396
|
+
description: "Output mode: 'text' (default), 'video' (Veo/Kling/Runway/Replicate), 'ppt' (presentation), 'avatar' (D-ID/HeyGen/MuseTalk talking-head), 'music' (Beatoven/ElevenLabs/Lyria/MusicGen)",
|
|
397
|
+
},
|
|
398
|
+
videoProvider: {
|
|
399
|
+
type: "string",
|
|
400
|
+
description: "Video provider override (e.g., 'vertex' (default), 'kling', 'runway', 'replicate')",
|
|
375
401
|
},
|
|
376
402
|
videoOutput: {
|
|
377
403
|
type: "string",
|
|
@@ -381,25 +407,86 @@ export class CLICommandFactory {
|
|
|
381
407
|
videoResolution: {
|
|
382
408
|
type: "string",
|
|
383
409
|
choices: ["720p", "1080p"],
|
|
384
|
-
|
|
385
|
-
description: "Video output resolution (720p or 1080p)",
|
|
410
|
+
description: "Video output resolution (720p or 1080p; provider default applied if omitted)",
|
|
386
411
|
},
|
|
387
412
|
videoLength: {
|
|
388
413
|
type: "number",
|
|
389
414
|
choices: [4, 6, 8],
|
|
390
|
-
|
|
391
|
-
description: "Video duration in seconds (4, 6, or 8)",
|
|
415
|
+
description: "Video duration in seconds (4, 6, or 8; provider default applied if omitted)",
|
|
392
416
|
},
|
|
393
417
|
videoAspectRatio: {
|
|
394
418
|
type: "string",
|
|
395
419
|
choices: ["9:16", "16:9"],
|
|
396
|
-
|
|
397
|
-
description: "Video aspect ratio (9:16 for portrait, 16:9 for landscape)",
|
|
420
|
+
description: "Video aspect ratio (9:16 for portrait, 16:9 for landscape; provider default applied if omitted)",
|
|
398
421
|
},
|
|
399
422
|
videoAudio: {
|
|
400
423
|
type: "boolean",
|
|
401
|
-
|
|
402
|
-
|
|
424
|
+
description: "Enable/disable audio generation in video (provider default applied if omitted)",
|
|
425
|
+
},
|
|
426
|
+
// Avatar Generation options (D-ID, HeyGen, MuseTalk via Replicate)
|
|
427
|
+
avatarProvider: {
|
|
428
|
+
type: "string",
|
|
429
|
+
description: "Avatar provider (e.g., 'd-id' (default), 'heygen', 'replicate', 'musetalk')",
|
|
430
|
+
},
|
|
431
|
+
avatarImage: {
|
|
432
|
+
type: "string",
|
|
433
|
+
description: "Path to source portrait image (or HeyGen avatar id when --avatarProvider heygen)",
|
|
434
|
+
},
|
|
435
|
+
avatarAudio: {
|
|
436
|
+
type: "string",
|
|
437
|
+
description: "Path to narration audio (alternative to --avatarText)",
|
|
438
|
+
},
|
|
439
|
+
avatarText: {
|
|
440
|
+
type: "string",
|
|
441
|
+
description: "Text the avatar should speak (the provider runs TTS internally)",
|
|
442
|
+
},
|
|
443
|
+
avatarVoice: {
|
|
444
|
+
type: "string",
|
|
445
|
+
description: "Voice id for TTS-driven avatars (provider-specific catalog id)",
|
|
446
|
+
},
|
|
447
|
+
avatarQuality: {
|
|
448
|
+
type: "string",
|
|
449
|
+
choices: ["standard", "hd"],
|
|
450
|
+
description: "Avatar output quality preset (provider default applied if omitted)",
|
|
451
|
+
},
|
|
452
|
+
avatarFormat: {
|
|
453
|
+
type: "string",
|
|
454
|
+
choices: ["mp4", "webm", "mov"],
|
|
455
|
+
description: "Avatar video output format (provider default applied if omitted)",
|
|
456
|
+
},
|
|
457
|
+
avatarOutput: {
|
|
458
|
+
type: "string",
|
|
459
|
+
description: "Path to save generated avatar video (e.g., ./avatar.mp4)",
|
|
460
|
+
},
|
|
461
|
+
// Music Generation options (Beatoven, ElevenLabs, Lyria, MusicGen via Replicate)
|
|
462
|
+
musicProvider: {
|
|
463
|
+
type: "string",
|
|
464
|
+
description: "Music provider (e.g., 'beatoven' (default), 'elevenlabs-music', 'lyria', 'replicate', 'musicgen')",
|
|
465
|
+
},
|
|
466
|
+
musicDuration: {
|
|
467
|
+
type: "number",
|
|
468
|
+
description: "Music duration in seconds (provider-clamped)",
|
|
469
|
+
},
|
|
470
|
+
musicFormat: {
|
|
471
|
+
type: "string",
|
|
472
|
+
choices: ["mp3", "wav", "flac", "ogg"],
|
|
473
|
+
description: "Music output format",
|
|
474
|
+
},
|
|
475
|
+
musicGenre: {
|
|
476
|
+
type: "string",
|
|
477
|
+
description: "Music genre hint (e.g., 'ambient', 'cinematic', 'electronic')",
|
|
478
|
+
},
|
|
479
|
+
musicMood: {
|
|
480
|
+
type: "string",
|
|
481
|
+
description: "Music mood hint (e.g., 'uplifting', 'tense', 'melancholic')",
|
|
482
|
+
},
|
|
483
|
+
musicTempo: {
|
|
484
|
+
type: "number",
|
|
485
|
+
description: "Music tempo in BPM",
|
|
486
|
+
},
|
|
487
|
+
musicOutput: {
|
|
488
|
+
type: "string",
|
|
489
|
+
description: "Path to save generated music (e.g., ./track.mp3)",
|
|
403
490
|
},
|
|
404
491
|
// PPT Generation options
|
|
405
492
|
pptPages: {
|
|
@@ -693,11 +780,29 @@ export class CLICommandFactory {
|
|
|
693
780
|
inputAudio: argv.inputAudio,
|
|
694
781
|
// Video generation options (Veo 3.1)
|
|
695
782
|
outputMode: argv.outputMode,
|
|
783
|
+
videoProvider: argv.videoProvider,
|
|
696
784
|
videoOutput: argv.videoOutput,
|
|
697
785
|
videoResolution: argv.videoResolution,
|
|
698
786
|
videoLength: argv.videoLength,
|
|
699
787
|
videoAspectRatio: argv.videoAspectRatio,
|
|
700
788
|
videoAudio: argv.videoAudio,
|
|
789
|
+
// Avatar generation options
|
|
790
|
+
avatarProvider: argv.avatarProvider,
|
|
791
|
+
avatarImage: argv.avatarImage,
|
|
792
|
+
avatarAudio: argv.avatarAudio,
|
|
793
|
+
avatarText: argv.avatarText,
|
|
794
|
+
avatarVoice: argv.avatarVoice,
|
|
795
|
+
avatarQuality: argv.avatarQuality,
|
|
796
|
+
avatarFormat: argv.avatarFormat,
|
|
797
|
+
avatarOutput: argv.avatarOutput,
|
|
798
|
+
// Music generation options
|
|
799
|
+
musicProvider: argv.musicProvider,
|
|
800
|
+
musicDuration: argv.musicDuration,
|
|
801
|
+
musicFormat: argv.musicFormat,
|
|
802
|
+
musicGenre: argv.musicGenre,
|
|
803
|
+
musicMood: argv.musicMood,
|
|
804
|
+
musicTempo: argv.musicTempo,
|
|
805
|
+
musicOutput: argv.musicOutput,
|
|
701
806
|
// PPT generation options
|
|
702
807
|
pptPages: argv.pptPages,
|
|
703
808
|
pptTheme: argv.pptTheme,
|
|
@@ -886,19 +991,13 @@ export class CLICommandFactory {
|
|
|
886
991
|
static configureVideoMode(enhancedOptions, argv, options) {
|
|
887
992
|
const userEnabledTools = !argv.disableTools; // Tools are enabled by default
|
|
888
993
|
enhancedOptions.disableTools = true;
|
|
889
|
-
//
|
|
890
|
-
if (!enhancedOptions.
|
|
891
|
-
enhancedOptions.
|
|
994
|
+
// Resolve video provider from explicit --videoProvider first, then top-level --provider, then default to vertex.
|
|
995
|
+
if (!enhancedOptions.videoProvider) {
|
|
996
|
+
enhancedOptions.videoProvider =
|
|
997
|
+
enhancedOptions.provider ?? "vertex";
|
|
892
998
|
if (options.debug) {
|
|
893
|
-
logger.debug(
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
else if (enhancedOptions.provider !== "vertex") {
|
|
897
|
-
// Warn if user specified a non-vertex provider
|
|
898
|
-
if (!options.quiet) {
|
|
899
|
-
logger.always(chalk.yellow(`⚠️ Warning: Video generation only supports Vertex AI. Overriding provider '${enhancedOptions.provider}' to 'vertex'.`));
|
|
999
|
+
logger.debug(`Auto-setting video provider to '${enhancedOptions.videoProvider}' for video generation mode`);
|
|
900
1000
|
}
|
|
901
|
-
enhancedOptions.provider = "vertex";
|
|
902
1001
|
}
|
|
903
1002
|
// Auto-set model to veo-3.1 if not explicitly specified
|
|
904
1003
|
if (!enhancedOptions.model) {
|
|
@@ -1012,6 +1111,68 @@ export class CLICommandFactory {
|
|
|
1012
1111
|
handleError(error, "Video Output");
|
|
1013
1112
|
}
|
|
1014
1113
|
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Helper method to handle avatar video file output.
|
|
1116
|
+
* Saves the generated avatar buffer to --avatarOutput path when provided.
|
|
1117
|
+
*/
|
|
1118
|
+
static async handleAvatarOutput(result, options) {
|
|
1119
|
+
const avatarOutputPath = options.avatarOutput;
|
|
1120
|
+
if (!avatarOutputPath) {
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
if (!result || typeof result !== "object") {
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
const generateResult = result;
|
|
1127
|
+
const avatar = generateResult.avatar;
|
|
1128
|
+
if (!avatar) {
|
|
1129
|
+
if (!options.quiet) {
|
|
1130
|
+
logger.always(chalk.yellow("⚠️ No avatar video available in result. Avatar generation may not be enabled or the request failed."));
|
|
1131
|
+
}
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
try {
|
|
1135
|
+
fs.writeFileSync(avatarOutputPath, avatar.buffer);
|
|
1136
|
+
if (!options.quiet) {
|
|
1137
|
+
const sizeStr = formatFileSize(avatar.size);
|
|
1138
|
+
logger.always(chalk.green(`👤 Avatar video saved to: ${avatarOutputPath} (${sizeStr})`));
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
catch (error) {
|
|
1142
|
+
handleError(error, "Avatar Output");
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Helper method to handle music audio file output.
|
|
1147
|
+
* Saves the generated music buffer to --musicOutput path when provided.
|
|
1148
|
+
*/
|
|
1149
|
+
static async handleMusicOutput(result, options) {
|
|
1150
|
+
const musicOutputPath = options.musicOutput;
|
|
1151
|
+
if (!musicOutputPath) {
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
if (!result || typeof result !== "object") {
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
const generateResult = result;
|
|
1158
|
+
const music = generateResult.music;
|
|
1159
|
+
if (!music) {
|
|
1160
|
+
if (!options.quiet) {
|
|
1161
|
+
logger.always(chalk.yellow("⚠️ No music available in result. Music generation may not be enabled or the request failed."));
|
|
1162
|
+
}
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
try {
|
|
1166
|
+
fs.writeFileSync(musicOutputPath, music.buffer);
|
|
1167
|
+
if (!options.quiet) {
|
|
1168
|
+
const sizeStr = formatFileSize(music.size);
|
|
1169
|
+
logger.always(chalk.green(`🎵 Music saved to: ${musicOutputPath} (${sizeStr})`));
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
catch (error) {
|
|
1173
|
+
handleError(error, "Music Output");
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1015
1176
|
/**
|
|
1016
1177
|
* Helper method to handle PPT file output
|
|
1017
1178
|
* Displays PPT generation result info
|
|
@@ -1419,6 +1580,19 @@ export class CLICommandFactory {
|
|
|
1419
1580
|
"nvidia-nim",
|
|
1420
1581
|
"lm-studio",
|
|
1421
1582
|
"llamacpp",
|
|
1583
|
+
"xai",
|
|
1584
|
+
"groq",
|
|
1585
|
+
"cohere",
|
|
1586
|
+
"together-ai",
|
|
1587
|
+
"fireworks",
|
|
1588
|
+
"perplexity",
|
|
1589
|
+
"cloudflare",
|
|
1590
|
+
"replicate",
|
|
1591
|
+
"voyage",
|
|
1592
|
+
"jina",
|
|
1593
|
+
"stability",
|
|
1594
|
+
"ideogram",
|
|
1595
|
+
"recraft",
|
|
1422
1596
|
],
|
|
1423
1597
|
})
|
|
1424
1598
|
.option("list", {
|
|
@@ -1755,11 +1929,10 @@ export class CLICommandFactory {
|
|
|
1755
1929
|
return argv.input;
|
|
1756
1930
|
}
|
|
1757
1931
|
/**
|
|
1758
|
-
* Detect output mode (video, ppt, or text) based on CLI arguments
|
|
1932
|
+
* Detect output mode (video, ppt, avatar, music, or text) based on CLI arguments
|
|
1759
1933
|
*/
|
|
1760
1934
|
static detectGenerateOutputMode(argv, options) {
|
|
1761
1935
|
const outputMode = options.outputMode;
|
|
1762
|
-
const isVideoMode = outputMode === "video";
|
|
1763
1936
|
const hasPPTFlags = argv.pptPages !== undefined ||
|
|
1764
1937
|
argv.pptTheme !== undefined ||
|
|
1765
1938
|
argv.pptAudience !== undefined ||
|
|
@@ -1767,18 +1940,58 @@ export class CLICommandFactory {
|
|
|
1767
1940
|
argv.pptOutput !== undefined ||
|
|
1768
1941
|
argv.pptAspectRatio !== undefined ||
|
|
1769
1942
|
argv.pptNoImages === true;
|
|
1770
|
-
const hasVideoSignals = outputMode === "video" ||
|
|
1943
|
+
const hasVideoSignals = outputMode === "video" ||
|
|
1944
|
+
argv.videoOutput !== undefined ||
|
|
1945
|
+
argv.videoProvider !== undefined ||
|
|
1946
|
+
argv.videoLength !== undefined ||
|
|
1947
|
+
argv.videoResolution !== undefined ||
|
|
1948
|
+
argv.videoAspectRatio !== undefined;
|
|
1771
1949
|
const hasPPTSignals = outputMode === "ppt" || hasPPTFlags;
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1950
|
+
const hasAvatarSignals = outputMode === "avatar" ||
|
|
1951
|
+
argv.avatarProvider !== undefined ||
|
|
1952
|
+
argv.avatarImage !== undefined ||
|
|
1953
|
+
argv.avatarText !== undefined ||
|
|
1954
|
+
argv.avatarAudio !== undefined ||
|
|
1955
|
+
argv.avatarVoice !== undefined ||
|
|
1956
|
+
argv.avatarOutput !== undefined;
|
|
1957
|
+
const hasMusicSignals = outputMode === "music" ||
|
|
1958
|
+
argv.musicProvider !== undefined ||
|
|
1959
|
+
argv.musicGenre !== undefined ||
|
|
1960
|
+
argv.musicMood !== undefined ||
|
|
1961
|
+
argv.musicDuration !== undefined ||
|
|
1962
|
+
argv.musicTempo !== undefined ||
|
|
1963
|
+
argv.musicOutput !== undefined;
|
|
1964
|
+
const activeModes = [
|
|
1965
|
+
hasVideoSignals,
|
|
1966
|
+
hasPPTSignals,
|
|
1967
|
+
hasAvatarSignals,
|
|
1968
|
+
hasMusicSignals,
|
|
1969
|
+
].filter(Boolean).length;
|
|
1970
|
+
if (activeModes > 1) {
|
|
1971
|
+
throw new Error("Conflicting output mode signals detected. Use exactly one of video / ppt / avatar / music modes (or text).");
|
|
1972
|
+
}
|
|
1973
|
+
// Derive mode flags from the full signal set so that flag-only invocations
|
|
1974
|
+
// (e.g. --videoOutput without --output-mode video) are handled correctly.
|
|
1975
|
+
const isVideoMode = hasVideoSignals;
|
|
1976
|
+
const isAvatarMode = hasAvatarSignals;
|
|
1977
|
+
const isMusicMode = hasMusicSignals;
|
|
1978
|
+
const isPPTMode = hasPPTSignals;
|
|
1776
1979
|
const spinnerMessage = isVideoMode
|
|
1777
1980
|
? "🎬 Generating video... (this may take 1-2 minutes)"
|
|
1778
1981
|
: isPPTMode
|
|
1779
1982
|
? "📊 Generating presentation... (this may take 2-5 minutes)"
|
|
1780
|
-
:
|
|
1781
|
-
|
|
1983
|
+
: isAvatarMode
|
|
1984
|
+
? "👤 Generating avatar video... (this may take 1-3 minutes)"
|
|
1985
|
+
: isMusicMode
|
|
1986
|
+
? "🎵 Generating music... (this may take 30s-2 minutes)"
|
|
1987
|
+
: "🤖 Generating text...";
|
|
1988
|
+
return {
|
|
1989
|
+
isVideoMode,
|
|
1990
|
+
isPPTMode,
|
|
1991
|
+
isAvatarMode,
|
|
1992
|
+
isMusicMode,
|
|
1993
|
+
spinnerMessage,
|
|
1994
|
+
};
|
|
1782
1995
|
}
|
|
1783
1996
|
/**
|
|
1784
1997
|
* Process context for generation command
|
|
@@ -1828,11 +2041,12 @@ export class CLICommandFactory {
|
|
|
1828
2041
|
/**
|
|
1829
2042
|
* Build output configuration for generate request
|
|
1830
2043
|
*/
|
|
1831
|
-
static buildGenerateOutputConfig(isVideoMode, isPPTMode, enhancedOptions) {
|
|
2044
|
+
static buildGenerateOutputConfig(isVideoMode, isPPTMode, enhancedOptions, isAvatarMode = false, isMusicMode = false) {
|
|
1832
2045
|
if (isVideoMode) {
|
|
1833
2046
|
return {
|
|
1834
2047
|
mode: "video",
|
|
1835
2048
|
video: {
|
|
2049
|
+
provider: enhancedOptions.videoProvider,
|
|
1836
2050
|
resolution: enhancedOptions.videoResolution,
|
|
1837
2051
|
length: enhancedOptions.videoLength,
|
|
1838
2052
|
aspectRatio: enhancedOptions.videoAspectRatio,
|
|
@@ -1840,6 +2054,36 @@ export class CLICommandFactory {
|
|
|
1840
2054
|
},
|
|
1841
2055
|
};
|
|
1842
2056
|
}
|
|
2057
|
+
if (isAvatarMode) {
|
|
2058
|
+
return {
|
|
2059
|
+
mode: "avatar",
|
|
2060
|
+
avatar: {
|
|
2061
|
+
provider: enhancedOptions.avatarProvider,
|
|
2062
|
+
image: enhancedOptions.avatarImage,
|
|
2063
|
+
audio: enhancedOptions.avatarAudio,
|
|
2064
|
+
text: enhancedOptions.avatarText,
|
|
2065
|
+
voice: enhancedOptions.avatarVoice,
|
|
2066
|
+
quality: enhancedOptions.avatarQuality,
|
|
2067
|
+
format: enhancedOptions.avatarFormat,
|
|
2068
|
+
output: enhancedOptions.avatarOutput,
|
|
2069
|
+
},
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
if (isMusicMode) {
|
|
2073
|
+
return {
|
|
2074
|
+
mode: "music",
|
|
2075
|
+
music: {
|
|
2076
|
+
prompt: "", // Filled in from input.text/prompt by baseProvider
|
|
2077
|
+
provider: enhancedOptions.musicProvider,
|
|
2078
|
+
duration: enhancedOptions.musicDuration,
|
|
2079
|
+
format: enhancedOptions.musicFormat,
|
|
2080
|
+
genre: enhancedOptions.musicGenre,
|
|
2081
|
+
mood: enhancedOptions.musicMood,
|
|
2082
|
+
tempo: enhancedOptions.musicTempo,
|
|
2083
|
+
output: enhancedOptions.musicOutput,
|
|
2084
|
+
},
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
1843
2087
|
if (isPPTMode) {
|
|
1844
2088
|
return {
|
|
1845
2089
|
mode: "ppt",
|
|
@@ -1859,7 +2103,8 @@ export class CLICommandFactory {
|
|
|
1859
2103
|
/**
|
|
1860
2104
|
* Handle successful generation result
|
|
1861
2105
|
*/
|
|
1862
|
-
static async handleGenerateSuccess(result, options,
|
|
2106
|
+
static async handleGenerateSuccess(result, options, modes, spinner) {
|
|
2107
|
+
const { isVideoMode, isPPTMode, isAvatarMode, isMusicMode } = modes;
|
|
1863
2108
|
const genResult = result;
|
|
1864
2109
|
if (spinner) {
|
|
1865
2110
|
if (isVideoMode) {
|
|
@@ -1868,6 +2113,12 @@ export class CLICommandFactory {
|
|
|
1868
2113
|
else if (isPPTMode) {
|
|
1869
2114
|
spinner.succeed(chalk.green("✅ Presentation generated successfully!"));
|
|
1870
2115
|
}
|
|
2116
|
+
else if (isAvatarMode) {
|
|
2117
|
+
spinner.succeed(chalk.green("✅ Avatar video generated successfully!"));
|
|
2118
|
+
}
|
|
2119
|
+
else if (isMusicMode) {
|
|
2120
|
+
spinner.succeed(chalk.green("✅ Music generated successfully!"));
|
|
2121
|
+
}
|
|
1871
2122
|
else {
|
|
1872
2123
|
spinner.succeed(chalk.green("✅ Text generated successfully!"));
|
|
1873
2124
|
}
|
|
@@ -1877,11 +2128,13 @@ export class CLICommandFactory {
|
|
|
1877
2128
|
const modelInfo = genResult.model || "default";
|
|
1878
2129
|
logger.always(chalk.gray(`🔧 Provider: ${providerInfo} | Model: ${modelInfo}`));
|
|
1879
2130
|
}
|
|
1880
|
-
if (!isVideoMode && !isPPTMode) {
|
|
2131
|
+
if (!isVideoMode && !isPPTMode && !isAvatarMode && !isMusicMode) {
|
|
1881
2132
|
CLICommandFactory.handleOutput(genResult, options);
|
|
1882
2133
|
}
|
|
1883
2134
|
await CLICommandFactory.handleTTSOutput(genResult, options);
|
|
1884
2135
|
await CLICommandFactory.handleVideoOutput(genResult, options);
|
|
2136
|
+
await CLICommandFactory.handleAvatarOutput(genResult, options);
|
|
2137
|
+
await CLICommandFactory.handleMusicOutput(genResult, options);
|
|
1885
2138
|
await CLICommandFactory.handlePPTOutput(genResult, options);
|
|
1886
2139
|
if (options.debug) {
|
|
1887
2140
|
logger.debug("\n" + chalk.yellow("Debug Information:"));
|
|
@@ -1908,7 +2161,7 @@ export class CLICommandFactory {
|
|
|
1908
2161
|
argv.input = rawInput;
|
|
1909
2162
|
const options = CLICommandFactory.processOptions(argv);
|
|
1910
2163
|
// Detect output mode
|
|
1911
|
-
const { isVideoMode, isPPTMode, spinnerMessage } = CLICommandFactory.detectGenerateOutputMode(argv, options);
|
|
2164
|
+
const { isVideoMode, isPPTMode, isAvatarMode, isMusicMode, spinnerMessage, } = CLICommandFactory.detectGenerateOutputMode(argv, options);
|
|
1912
2165
|
const spinner = argv.quiet ? null : ora(spinnerMessage).start();
|
|
1913
2166
|
try {
|
|
1914
2167
|
// Add delay if specified
|
|
@@ -1987,7 +2240,7 @@ export class CLICommandFactory {
|
|
|
1987
2240
|
}
|
|
1988
2241
|
// Build multimodal input and output configuration
|
|
1989
2242
|
const generateInput = CLICommandFactory.buildGenerateMultimodalInput(inputText, argv);
|
|
1990
|
-
const outputConfig = CLICommandFactory.buildGenerateOutputConfig(isVideoMode, isPPTMode, enhancedOptions);
|
|
2243
|
+
const outputConfig = CLICommandFactory.buildGenerateOutputConfig(isVideoMode, isPPTMode, enhancedOptions, isAvatarMode, isMusicMode);
|
|
1991
2244
|
// Read audio file for STT if --input-audio is provided.
|
|
1992
2245
|
// NEW10: existsSync guard mirrors the stream handler so a missing file
|
|
1993
2246
|
// produces a friendly error here too instead of a raw ENOENT crash.
|
|
@@ -2079,7 +2332,7 @@ export class CLICommandFactory {
|
|
|
2079
2332
|
});
|
|
2080
2333
|
const result = await runGenerate();
|
|
2081
2334
|
// Handle successful result
|
|
2082
|
-
await CLICommandFactory.handleGenerateSuccess(result, options, isVideoMode, isPPTMode, spinner);
|
|
2335
|
+
await CLICommandFactory.handleGenerateSuccess(result, options, { isVideoMode, isPPTMode, isAvatarMode, isMusicMode }, spinner);
|
|
2083
2336
|
}
|
|
2084
2337
|
catch (error) {
|
|
2085
2338
|
if (spinner) {
|
|
@@ -3041,7 +3294,7 @@ export class CLICommandFactory {
|
|
|
3041
3294
|
" generate|gen)\n" +
|
|
3042
3295
|
' case "${prev}" in\n' +
|
|
3043
3296
|
" --provider|-p)\n" +
|
|
3044
|
-
' COMPREPLY=( $(compgen -W "auto openai openai-compatible openrouter or bedrock vertex googleVertex anthropic anthropic-subscription azure google-ai google-ai-studio huggingface ollama mistral litellm sagemaker deepseek ds nvidia-nim nim lm-studio lmstudio llamacpp llama.cpp" -- ${cur}) )\n' +
|
|
3297
|
+
' COMPREPLY=( $(compgen -W "auto openai openai-compatible openrouter or bedrock vertex googleVertex anthropic anthropic-subscription azure google-ai google-ai-studio huggingface ollama mistral litellm sagemaker deepseek ds nvidia-nim nim lm-studio lmstudio llamacpp llama.cpp xai grok groq cohere together-ai together fireworks perplexity pplx cloudflare workers-ai cf-ai replicate voyage voyage-ai jina jina-ai stability stability-ai sd ideogram recraft" -- ${cur}) )\n' +
|
|
3045
3298
|
" return 0\n" +
|
|
3046
3299
|
" ;;\n" +
|
|
3047
3300
|
" --format|-f|--output-format)\n" +
|