storyforge 0.13.0 → 0.14.0
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.
|
@@ -5510,25 +5510,40 @@ var renderGeminiManimRemotion = async (shot, ctx) => {
|
|
|
5510
5510
|
const totalFrames = Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
5511
5511
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
5512
5512
|
ctx.progress.emit({ phase: "compositing", shotId: shot.id });
|
|
5513
|
+
const remotion = requireRemotionRoot();
|
|
5514
|
+
const publicRel = path3.posix.join("clip-render-cache", ctx.chunkId, `${shot.id}-manim.mp4`);
|
|
5515
|
+
const publicAbs = path3.join(remotion.cwd, "public", publicRel);
|
|
5516
|
+
fs3.mkdirSync(path3.dirname(publicAbs), { recursive: true });
|
|
5517
|
+
fs3.copyFileSync(manimSceneOut, publicAbs);
|
|
5518
|
+
const overlayText = (shot.overlayText ?? "").trim();
|
|
5519
|
+
const dims = ctx.aspect === "9:16" ? { width: 1080, height: 1920 } : { width: 1920, height: 1080 };
|
|
5520
|
+
const overlays = overlayText ? [
|
|
5521
|
+
{
|
|
5522
|
+
text: overlayText,
|
|
5523
|
+
x: dims.width / 2,
|
|
5524
|
+
y: ctx.aspect === "9:16" ? 280 : 150,
|
|
5525
|
+
fontSize: ctx.aspect === "9:16" ? 88 : 72,
|
|
5526
|
+
color: "#FFFFFF",
|
|
5527
|
+
fontWeight: 800,
|
|
5528
|
+
startFrame: 6,
|
|
5529
|
+
fadeDuration: 8,
|
|
5530
|
+
textAlign: "center"
|
|
5531
|
+
}
|
|
5532
|
+
] : [];
|
|
5513
5533
|
const propsPath = path3.join(ctx.tmpDir, "remotion", `${shot.id}_gmr_props.json`);
|
|
5514
5534
|
fs3.mkdirSync(path3.dirname(propsPath), { recursive: true });
|
|
5515
5535
|
fs3.writeFileSync(
|
|
5516
5536
|
propsPath,
|
|
5517
5537
|
JSON.stringify(
|
|
5518
5538
|
{
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
manimDurationFrames,
|
|
5522
|
-
durationInFrames: totalFrames,
|
|
5523
|
-
overlayText: shot.overlayText ?? "",
|
|
5524
|
-
intent: shot.intent ?? ""
|
|
5539
|
+
videoSrc: publicRel,
|
|
5540
|
+
overlays
|
|
5525
5541
|
},
|
|
5526
5542
|
null,
|
|
5527
5543
|
2
|
|
5528
5544
|
)
|
|
5529
5545
|
);
|
|
5530
|
-
const
|
|
5531
|
-
const compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
5546
|
+
const compId = ctx.aspect === "9:16" ? "ManimOverlayVertical" : "ManimOverlay";
|
|
5532
5547
|
const r = await runCmd(
|
|
5533
5548
|
"npx",
|
|
5534
5549
|
[
|
|
@@ -5616,7 +5631,9 @@ var renderGeminiRemotion = async (shot, ctx) => {
|
|
|
5616
5631
|
width: dims.width,
|
|
5617
5632
|
height: dims.height,
|
|
5618
5633
|
fps: ctx.fps,
|
|
5619
|
-
intent: shot.intent ?? ""
|
|
5634
|
+
intent: shot.intent ?? "",
|
|
5635
|
+
...shot.citationUrl ? { citationUrl: shot.citationUrl } : {},
|
|
5636
|
+
...shot.quotedPhrase ? { quotedPhrase: shot.quotedPhrase } : {}
|
|
5620
5637
|
},
|
|
5621
5638
|
null,
|
|
5622
5639
|
2
|
|
@@ -5835,6 +5852,28 @@ var renderHyperframes = async (shot, ctx) => {
|
|
|
5835
5852
|
// ../pipeline/src/clip-render/engines/manim-remotion.ts
|
|
5836
5853
|
import * as fs5 from "fs";
|
|
5837
5854
|
import * as path6 from "path";
|
|
5855
|
+
var ASPECT_DIMS2 = {
|
|
5856
|
+
"16:9": { width: 1920, height: 1080 },
|
|
5857
|
+
"9:16": { width: 1080, height: 1920 }
|
|
5858
|
+
};
|
|
5859
|
+
function buildOverlays(overlayText, ctx) {
|
|
5860
|
+
const t = (overlayText ?? "").trim();
|
|
5861
|
+
if (!t) return [];
|
|
5862
|
+
const dims = ASPECT_DIMS2[ctx.aspect];
|
|
5863
|
+
return [
|
|
5864
|
+
{
|
|
5865
|
+
text: t,
|
|
5866
|
+
x: dims.width / 2,
|
|
5867
|
+
y: ctx.aspect === "9:16" ? 280 : 150,
|
|
5868
|
+
fontSize: ctx.aspect === "9:16" ? 88 : 72,
|
|
5869
|
+
color: "#FFFFFF",
|
|
5870
|
+
fontWeight: 800,
|
|
5871
|
+
startFrame: 6,
|
|
5872
|
+
fadeDuration: 8,
|
|
5873
|
+
textAlign: "center"
|
|
5874
|
+
}
|
|
5875
|
+
];
|
|
5876
|
+
}
|
|
5838
5877
|
var renderManimRemotion = async (shot, ctx) => {
|
|
5839
5878
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
5840
5879
|
const manimSceneOut = path6.join(ctx.tmpDir, "manim", `${shot.id}_manim.mp4`);
|
|
@@ -5843,28 +5882,28 @@ var renderManimRemotion = async (shot, ctx) => {
|
|
|
5843
5882
|
ctx.progress.emit({ phase: "rendering", shotId: shot.id });
|
|
5844
5883
|
await renderManim(shot, manimCtx);
|
|
5845
5884
|
const manimDurationSec = await probeDuration(manimSceneOut) ?? 7;
|
|
5846
|
-
const manimDurationFrames = Math.max(1, Math.round(manimDurationSec * ctx.fps));
|
|
5847
5885
|
const totalFrames = Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
5848
5886
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
5849
5887
|
ctx.progress.emit({ phase: "compositing", shotId: shot.id });
|
|
5888
|
+
const remotion = requireRemotionRoot();
|
|
5889
|
+
const publicRel = path6.posix.join("clip-render-cache", ctx.chunkId, `${shot.id}-manim.mp4`);
|
|
5890
|
+
const publicAbs = path6.join(remotion.cwd, "public", publicRel);
|
|
5891
|
+
fs5.mkdirSync(path6.dirname(publicAbs), { recursive: true });
|
|
5892
|
+
fs5.copyFileSync(manimSceneOut, publicAbs);
|
|
5850
5893
|
const propsPath = path6.join(ctx.tmpDir, "remotion", `${shot.id}_mr_props.json`);
|
|
5851
5894
|
fs5.mkdirSync(path6.dirname(propsPath), { recursive: true });
|
|
5852
5895
|
fs5.writeFileSync(
|
|
5853
5896
|
propsPath,
|
|
5854
5897
|
JSON.stringify(
|
|
5855
5898
|
{
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
durationInFrames: totalFrames,
|
|
5859
|
-
overlayText: shot.overlayText ?? "",
|
|
5860
|
-
intent: shot.intent ?? ""
|
|
5899
|
+
videoSrc: publicRel,
|
|
5900
|
+
overlays: buildOverlays(shot.overlayText ?? "", ctx)
|
|
5861
5901
|
},
|
|
5862
5902
|
null,
|
|
5863
5903
|
2
|
|
5864
5904
|
)
|
|
5865
5905
|
);
|
|
5866
|
-
const
|
|
5867
|
-
const compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
5906
|
+
const compId = ctx.aspect === "9:16" ? "ManimOverlayVertical" : "ManimOverlay";
|
|
5868
5907
|
const r = await runCmd(
|
|
5869
5908
|
"npx",
|
|
5870
5909
|
[
|
|
@@ -5911,21 +5950,22 @@ var renderManimRemotion = async (shot, ctx) => {
|
|
|
5911
5950
|
ctx.progress.emit({
|
|
5912
5951
|
phase: "compositing",
|
|
5913
5952
|
shotId: shot.id,
|
|
5914
|
-
warnings: [`
|
|
5953
|
+
warnings: [`ManimOverlay render failed, used raw manim clamped to ${shot.durationSec}s: ${tail}`]
|
|
5915
5954
|
});
|
|
5916
5955
|
return;
|
|
5917
5956
|
}
|
|
5957
|
+
void manimDurationSec;
|
|
5918
5958
|
};
|
|
5919
5959
|
|
|
5920
5960
|
// ../pipeline/src/clip-render/engines/remotion.ts
|
|
5921
5961
|
import * as fs6 from "fs";
|
|
5922
5962
|
import * as path7 from "path";
|
|
5923
|
-
var
|
|
5963
|
+
var ASPECT_DIMS3 = {
|
|
5924
5964
|
"16:9": { width: 1920, height: 1080 },
|
|
5925
5965
|
"9:16": { width: 1080, height: 1920 }
|
|
5926
5966
|
};
|
|
5927
5967
|
function writeEntryForInlineTsx(ctx, shotId, durationFrames) {
|
|
5928
|
-
const dims =
|
|
5968
|
+
const dims = ASPECT_DIMS3[ctx.aspect];
|
|
5929
5969
|
const dir = path7.join(ctx.tmpDir, "remotion", shotId);
|
|
5930
5970
|
fs6.mkdirSync(dir, { recursive: true });
|
|
5931
5971
|
const componentPath = path7.join(dir, `${shotId}.tsx`);
|
|
@@ -6076,23 +6116,37 @@ var renderStockRemotion = async (shot, ctx) => {
|
|
|
6076
6116
|
await searchAndDownloadPexels(query, shot.durationSec, stockPath, ctx.signal);
|
|
6077
6117
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
6078
6118
|
ctx.progress.emit({ phase: "compositing", shotId: shot.id });
|
|
6079
|
-
const
|
|
6119
|
+
const remotion = requireRemotionRoot();
|
|
6120
|
+
const stockPublicRel = path8.posix.join("clip-render-cache", ctx.chunkId, `${shot.id}-stock.mp4`);
|
|
6121
|
+
const stockPublicAbs = path8.join(remotion.cwd, "public", stockPublicRel);
|
|
6122
|
+
fs7.mkdirSync(path8.dirname(stockPublicAbs), { recursive: true });
|
|
6123
|
+
fs7.copyFileSync(stockPath, stockPublicAbs);
|
|
6124
|
+
const overlayText = (shot.overlayText ?? "").trim();
|
|
6125
|
+
const dims = ctx.aspect === "9:16" ? { width: 1080, height: 1920 } : { width: 1920, height: 1080 };
|
|
6126
|
+
const overlays = overlayText ? [
|
|
6127
|
+
{
|
|
6128
|
+
text: overlayText,
|
|
6129
|
+
x: dims.width / 2,
|
|
6130
|
+
y: ctx.aspect === "9:16" ? 280 : 150,
|
|
6131
|
+
fontSize: ctx.aspect === "9:16" ? 88 : 72,
|
|
6132
|
+
color: "#FFFFFF",
|
|
6133
|
+
fontWeight: 800,
|
|
6134
|
+
startFrame: 6,
|
|
6135
|
+
fadeDuration: 8,
|
|
6136
|
+
textAlign: "center"
|
|
6137
|
+
}
|
|
6138
|
+
] : [];
|
|
6080
6139
|
const propsPath = path8.join(ctx.tmpDir, "remotion", `${shot.id}_stock_props.json`);
|
|
6140
|
+
fs7.mkdirSync(path8.dirname(propsPath), { recursive: true });
|
|
6081
6141
|
fs7.writeFileSync(
|
|
6082
6142
|
propsPath,
|
|
6083
6143
|
JSON.stringify(
|
|
6084
|
-
{
|
|
6085
|
-
stockSrc: stockPath,
|
|
6086
|
-
durationInFrames: totalFrames,
|
|
6087
|
-
overlayText: shot.overlayText ?? "",
|
|
6088
|
-
intent: shot.intent ?? ""
|
|
6089
|
-
},
|
|
6144
|
+
{ videoSrc: stockPublicRel, overlays },
|
|
6090
6145
|
null,
|
|
6091
6146
|
2
|
|
6092
6147
|
)
|
|
6093
6148
|
);
|
|
6094
|
-
const
|
|
6095
|
-
const compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
6149
|
+
const compId = ctx.aspect === "9:16" ? "ManimOverlayVertical" : "ManimOverlay";
|
|
6096
6150
|
const r = await runCmd(
|
|
6097
6151
|
"npx",
|
|
6098
6152
|
[
|
|
@@ -6200,7 +6254,7 @@ import * as fs9 from "fs";
|
|
|
6200
6254
|
import * as path10 from "path";
|
|
6201
6255
|
import { JSDOM } from "jsdom";
|
|
6202
6256
|
import { Readability } from "@mozilla/readability";
|
|
6203
|
-
var
|
|
6257
|
+
var ASPECT_DIMS4 = {
|
|
6204
6258
|
"16:9": { width: 1920, height: 1080 },
|
|
6205
6259
|
"9:16": { width: 1080, height: 1920 }
|
|
6206
6260
|
};
|
|
@@ -6293,7 +6347,7 @@ var renderWebArticleRemotion = async (shot, ctx) => {
|
|
|
6293
6347
|
`web-article+remotion: readability returned no title for ${shot.sourceUrl}`
|
|
6294
6348
|
);
|
|
6295
6349
|
}
|
|
6296
|
-
const dims =
|
|
6350
|
+
const dims = ASPECT_DIMS4[ctx.aspect];
|
|
6297
6351
|
const durationFrames = Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
6298
6352
|
const leadImageUrl = resolveLeadImage(article.leadImage, shot.sourceUrl);
|
|
6299
6353
|
const propsPayload = {
|
|
@@ -6363,7 +6417,7 @@ var activeDeps = DEFAULT_DEPS;
|
|
|
6363
6417
|
import * as fs10 from "fs";
|
|
6364
6418
|
import * as path11 from "path";
|
|
6365
6419
|
import { getTweet } from "react-tweet/api";
|
|
6366
|
-
var
|
|
6420
|
+
var ASPECT_DIMS5 = {
|
|
6367
6421
|
"16:9": { width: 1920, height: 1080 },
|
|
6368
6422
|
"9:16": { width: 1080, height: 1920 }
|
|
6369
6423
|
};
|
|
@@ -6419,7 +6473,7 @@ var renderXPostRemotion = async (shot, ctx) => {
|
|
|
6419
6473
|
const tweet = await loadTweet(tweetId, cacheDir);
|
|
6420
6474
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
6421
6475
|
const durationFrames = Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
6422
|
-
const dims =
|
|
6476
|
+
const dims = ASPECT_DIMS5[ctx.aspect];
|
|
6423
6477
|
const remotion = requireRemotionRoot();
|
|
6424
6478
|
const entry = path11.join(
|
|
6425
6479
|
remotion.cwd,
|
|
@@ -6492,7 +6546,7 @@ var renderXPostRemotion = async (shot, ctx) => {
|
|
|
6492
6546
|
import { createHash } from "crypto";
|
|
6493
6547
|
import * as fs11 from "fs";
|
|
6494
6548
|
import * as path12 from "path";
|
|
6495
|
-
var
|
|
6549
|
+
var ASPECT_DIMS6 = {
|
|
6496
6550
|
"16:9": { width: 1920, height: 1080 },
|
|
6497
6551
|
"9:16": { width: 1080, height: 1920 }
|
|
6498
6552
|
};
|
|
@@ -6774,7 +6828,7 @@ var renderYouTubeClipRemotion = async (shot, ctx) => {
|
|
|
6774
6828
|
await cutSegment(fullPath, segmentPath, startSec, endSec, ctx.signal);
|
|
6775
6829
|
await verifySegment(segmentPath, startSec, endSec, ctx.signal);
|
|
6776
6830
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
6777
|
-
const dims =
|
|
6831
|
+
const dims = ASPECT_DIMS6[ctx.aspect];
|
|
6778
6832
|
fs11.mkdirSync(path12.dirname(ctx.sceneOutPath), { recursive: true });
|
|
6779
6833
|
await composeFinal({
|
|
6780
6834
|
segmentPath,
|
package/dist/index.js
CHANGED
|
@@ -1689,7 +1689,7 @@ Return ONLY the complete updated TSX. No markdown fences, no explanation.`;
|
|
|
1689
1689
|
return "0.0.0";
|
|
1690
1690
|
})();
|
|
1691
1691
|
void (async () => {
|
|
1692
|
-
const { BridgePoller } = await import("./bridge-poller-
|
|
1692
|
+
const { BridgePoller } = await import("./bridge-poller-SQU4GUHF.js");
|
|
1693
1693
|
const poller = new BridgePoller({ baseUrl: bridgeUrl, token: bridgeToken2, clientVersion: `storyforge ${pkgVersion}` });
|
|
1694
1694
|
poller.start();
|
|
1695
1695
|
})();
|
|
@@ -2512,7 +2512,7 @@ function resolveBridgeToken2(explicit) {
|
|
|
2512
2512
|
// package.json
|
|
2513
2513
|
var package_default = {
|
|
2514
2514
|
name: "storyforge",
|
|
2515
|
-
version: "0.
|
|
2515
|
+
version: "0.14.0",
|
|
2516
2516
|
description: "StoryForge \u2014 local bridge for the Forge video production web app. Parallel clip-render orchestrator (Remotion 4 + Manim + HyperFrames + ffmpeg) + final video stitcher + dependency doctor.",
|
|
2517
2517
|
type: "module",
|
|
2518
2518
|
bin: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storyforge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "StoryForge — local bridge for the Forge video production web app. Parallel clip-render orchestrator (Remotion 4 + Manim + HyperFrames + ffmpeg) + final video stitcher + dependency doctor.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|