@vibeframe/mcp-server 0.48.3 → 0.48.5
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/dist/index.js +87 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -426900,9 +426900,11 @@ var init_GeminiProvider = __esm({
|
|
|
426900
426900
|
"9:16": "9:16",
|
|
426901
426901
|
"1:1": "1:1"
|
|
426902
426902
|
};
|
|
426903
|
+
const requestedDuration = typeof veoOpts.duration === "number" ? veoOpts.duration : 8;
|
|
426904
|
+
const veoDuration = requestedDuration <= 5 ? 4 : requestedDuration <= 7 ? 6 : 8;
|
|
426903
426905
|
const parameters = {
|
|
426904
426906
|
aspectRatio: aspectRatioMap[veoOpts.aspectRatio || "16:9"] || "16:9",
|
|
426905
|
-
durationSeconds:
|
|
426907
|
+
durationSeconds: veoDuration
|
|
426906
426908
|
};
|
|
426907
426909
|
if (veoOpts.negativePrompt) {
|
|
426908
426910
|
parameters.negativePrompt = veoOpts.negativePrompt;
|
|
@@ -431686,7 +431688,7 @@ var init_GrokProvider = __esm({
|
|
|
431686
431688
|
};
|
|
431687
431689
|
}
|
|
431688
431690
|
try {
|
|
431689
|
-
const duration = Math.min(15, Math.max(1, options?.duration || 5));
|
|
431691
|
+
const duration = Math.round(Math.min(15, Math.max(1, options?.duration || 5)));
|
|
431690
431692
|
const body = {
|
|
431691
431693
|
model: DEFAULT_MODEL4,
|
|
431692
431694
|
prompt: prompt3,
|
|
@@ -444564,7 +444566,89 @@ async function executeRegenerateScene(options) {
|
|
|
444564
444566
|
const imageBuffer = await readFile9(imagePath);
|
|
444565
444567
|
const videoDuration = segment.duration > 5 ? 10 : 5;
|
|
444566
444568
|
const maxRetries = options.retries ?? DEFAULT_VIDEO_RETRIES;
|
|
444567
|
-
if (options.generator === "
|
|
444569
|
+
if (options.generator === "grok") {
|
|
444570
|
+
const grok = new GrokProvider();
|
|
444571
|
+
await grok.initialize({ apiKey: videoApiKey });
|
|
444572
|
+
const ext = extname7(imagePath).toLowerCase().slice(1);
|
|
444573
|
+
const mimeType = ext === "jpg" || ext === "jpeg" ? "image/jpeg" : "image/png";
|
|
444574
|
+
const referenceImage = `data:${mimeType};base64,${imageBuffer.toString("base64")}`;
|
|
444575
|
+
const grokDuration = Math.min(15, Math.max(1, segment.duration));
|
|
444576
|
+
const taskResult = await generateVideoWithRetryGrok(
|
|
444577
|
+
grok,
|
|
444578
|
+
segment,
|
|
444579
|
+
{
|
|
444580
|
+
duration: grokDuration,
|
|
444581
|
+
aspectRatio: options.aspectRatio || "16:9",
|
|
444582
|
+
referenceImage
|
|
444583
|
+
},
|
|
444584
|
+
maxRetries
|
|
444585
|
+
);
|
|
444586
|
+
if (taskResult) {
|
|
444587
|
+
try {
|
|
444588
|
+
const waitResult = await grok.waitForCompletion(taskResult.requestId, void 0, 3e5);
|
|
444589
|
+
if (waitResult.status === "completed" && waitResult.videoUrl) {
|
|
444590
|
+
const buffer = await downloadVideo(waitResult.videoUrl, videoApiKey);
|
|
444591
|
+
await writeFile10(videoPath, buffer);
|
|
444592
|
+
const targetDuration = segment.duration;
|
|
444593
|
+
const actualVideoDuration = await getVideoDuration(videoPath);
|
|
444594
|
+
if (actualVideoDuration < targetDuration - 0.1) {
|
|
444595
|
+
const extendedPath = resolve20(outputDir, `scene-${sceneNum}-extended.mp4`);
|
|
444596
|
+
await extendVideoNaturally(videoPath, targetDuration, extendedPath);
|
|
444597
|
+
await unlink4(videoPath);
|
|
444598
|
+
await rename4(extendedPath, videoPath);
|
|
444599
|
+
}
|
|
444600
|
+
result.regeneratedScenes.push(sceneNum);
|
|
444601
|
+
} else {
|
|
444602
|
+
result.failedScenes.push(sceneNum);
|
|
444603
|
+
}
|
|
444604
|
+
} catch {
|
|
444605
|
+
result.failedScenes.push(sceneNum);
|
|
444606
|
+
}
|
|
444607
|
+
} else {
|
|
444608
|
+
result.failedScenes.push(sceneNum);
|
|
444609
|
+
}
|
|
444610
|
+
} else if (options.generator === "veo") {
|
|
444611
|
+
const veo = new GeminiProvider();
|
|
444612
|
+
await veo.initialize({ apiKey: videoApiKey });
|
|
444613
|
+
const ext = extname7(imagePath).toLowerCase().slice(1);
|
|
444614
|
+
const mimeType = ext === "jpg" || ext === "jpeg" ? "image/jpeg" : "image/png";
|
|
444615
|
+
const referenceImage = `data:${mimeType};base64,${imageBuffer.toString("base64")}`;
|
|
444616
|
+
const veoDuration = segment.duration > 6 ? 8 : segment.duration > 4 ? 6 : 4;
|
|
444617
|
+
const taskResult = await generateVideoWithRetryVeo(
|
|
444618
|
+
veo,
|
|
444619
|
+
segment,
|
|
444620
|
+
{
|
|
444621
|
+
duration: veoDuration,
|
|
444622
|
+
aspectRatio: options.aspectRatio || "16:9",
|
|
444623
|
+
referenceImage
|
|
444624
|
+
},
|
|
444625
|
+
maxRetries
|
|
444626
|
+
);
|
|
444627
|
+
if (taskResult) {
|
|
444628
|
+
try {
|
|
444629
|
+
const waitResult = await veo.waitForVideoCompletion(taskResult.operationName, void 0, 3e5);
|
|
444630
|
+
if (waitResult.status === "completed" && waitResult.videoUrl) {
|
|
444631
|
+
const buffer = await downloadVideo(waitResult.videoUrl, videoApiKey);
|
|
444632
|
+
await writeFile10(videoPath, buffer);
|
|
444633
|
+
const targetDuration = segment.duration;
|
|
444634
|
+
const actualVideoDuration = await getVideoDuration(videoPath);
|
|
444635
|
+
if (actualVideoDuration < targetDuration - 0.1) {
|
|
444636
|
+
const extendedPath = resolve20(outputDir, `scene-${sceneNum}-extended.mp4`);
|
|
444637
|
+
await extendVideoNaturally(videoPath, targetDuration, extendedPath);
|
|
444638
|
+
await unlink4(videoPath);
|
|
444639
|
+
await rename4(extendedPath, videoPath);
|
|
444640
|
+
}
|
|
444641
|
+
result.regeneratedScenes.push(sceneNum);
|
|
444642
|
+
} else {
|
|
444643
|
+
result.failedScenes.push(sceneNum);
|
|
444644
|
+
}
|
|
444645
|
+
} catch {
|
|
444646
|
+
result.failedScenes.push(sceneNum);
|
|
444647
|
+
}
|
|
444648
|
+
} else {
|
|
444649
|
+
result.failedScenes.push(sceneNum);
|
|
444650
|
+
}
|
|
444651
|
+
} else if (options.generator === "kling" || !options.generator) {
|
|
444568
444652
|
const kling = new KlingProvider();
|
|
444569
444653
|
await kling.initialize({ apiKey: videoApiKey });
|
|
444570
444654
|
if (!kling.isConfigured()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeframe/mcp-server",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.5",
|
|
4
4
|
"description": "VibeFrame MCP Server - AI-native video editing via Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"tsx": "^4.21.0",
|
|
58
58
|
"typescript": "^5.3.3",
|
|
59
59
|
"vitest": "^1.2.2",
|
|
60
|
-
"@vibeframe/cli": "0.48.
|
|
61
|
-
"@vibeframe/core": "0.48.
|
|
60
|
+
"@vibeframe/cli": "0.48.5",
|
|
61
|
+
"@vibeframe/core": "0.48.5"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=20"
|