storyforge 0.11.3 → 0.11.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.
|
@@ -5527,14 +5527,14 @@ var renderGeminiManimRemotion = async (shot, ctx) => {
|
|
|
5527
5527
|
2
|
|
5528
5528
|
)
|
|
5529
5529
|
);
|
|
5530
|
-
const
|
|
5530
|
+
const remotion = requireRemotionRoot();
|
|
5531
5531
|
const compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
5532
5532
|
const r = await runCmd(
|
|
5533
5533
|
"npx",
|
|
5534
5534
|
[
|
|
5535
5535
|
"remotion",
|
|
5536
5536
|
"render",
|
|
5537
|
-
|
|
5537
|
+
remotion.entry,
|
|
5538
5538
|
compId,
|
|
5539
5539
|
"--props",
|
|
5540
5540
|
propsPath,
|
|
@@ -5543,7 +5543,7 @@ var renderGeminiManimRemotion = async (shot, ctx) => {
|
|
|
5543
5543
|
"--concurrency",
|
|
5544
5544
|
"4"
|
|
5545
5545
|
],
|
|
5546
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
5546
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
5547
5547
|
);
|
|
5548
5548
|
if (r.code !== 0) {
|
|
5549
5549
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 300);
|
|
@@ -5595,13 +5595,13 @@ var renderGeminiRemotion = async (shot, ctx) => {
|
|
|
5595
5595
|
);
|
|
5596
5596
|
const durationFrames = Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
5597
5597
|
const dims = ASPECT_DIMS[ctx.aspect];
|
|
5598
|
-
const
|
|
5598
|
+
const remotion = requireRemotionRoot();
|
|
5599
5599
|
const publicRel = path4.posix.join(
|
|
5600
5600
|
"clip-render-cache",
|
|
5601
5601
|
ctx.chunkId,
|
|
5602
5602
|
`${shot.id}${path4.extname(localImage) || ".png"}`
|
|
5603
5603
|
);
|
|
5604
|
-
const publicAbs = path4.join(
|
|
5604
|
+
const publicAbs = path4.join(remotion.cwd, "public", publicRel);
|
|
5605
5605
|
fs4.mkdirSync(path4.dirname(publicAbs), { recursive: true });
|
|
5606
5606
|
fs4.copyFileSync(localImage, publicAbs);
|
|
5607
5607
|
const propsPath = path4.join(ctx.tmpDir, "remotion", `${shot.id}_gr_props.json`);
|
|
@@ -5634,7 +5634,7 @@ var renderGeminiRemotion = async (shot, ctx) => {
|
|
|
5634
5634
|
[
|
|
5635
5635
|
"remotion",
|
|
5636
5636
|
"render",
|
|
5637
|
-
|
|
5637
|
+
remotion.entry,
|
|
5638
5638
|
compId,
|
|
5639
5639
|
"--props",
|
|
5640
5640
|
propsPath,
|
|
@@ -5645,7 +5645,7 @@ var renderGeminiRemotion = async (shot, ctx) => {
|
|
|
5645
5645
|
"--concurrency",
|
|
5646
5646
|
"4"
|
|
5647
5647
|
],
|
|
5648
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
5648
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
5649
5649
|
);
|
|
5650
5650
|
if (r.code !== 0) {
|
|
5651
5651
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 300);
|
|
@@ -5863,14 +5863,14 @@ var renderManimRemotion = async (shot, ctx) => {
|
|
|
5863
5863
|
2
|
|
5864
5864
|
)
|
|
5865
5865
|
);
|
|
5866
|
-
const
|
|
5866
|
+
const remotion = requireRemotionRoot();
|
|
5867
5867
|
const compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
5868
5868
|
const r = await runCmd(
|
|
5869
5869
|
"npx",
|
|
5870
5870
|
[
|
|
5871
5871
|
"remotion",
|
|
5872
5872
|
"render",
|
|
5873
|
-
|
|
5873
|
+
remotion.entry,
|
|
5874
5874
|
compId,
|
|
5875
5875
|
"--props",
|
|
5876
5876
|
propsPath,
|
|
@@ -5879,7 +5879,7 @@ var renderManimRemotion = async (shot, ctx) => {
|
|
|
5879
5879
|
"--concurrency",
|
|
5880
5880
|
"4"
|
|
5881
5881
|
],
|
|
5882
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
5882
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
5883
5883
|
);
|
|
5884
5884
|
if (r.code !== 0) {
|
|
5885
5885
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 300);
|
|
@@ -5946,10 +5946,10 @@ var renderRemotion = async (shot, ctx) => {
|
|
|
5946
5946
|
compId = id;
|
|
5947
5947
|
remotionCwd = requireRemotionRoot().cwd;
|
|
5948
5948
|
} else {
|
|
5949
|
-
const
|
|
5950
|
-
entryArg =
|
|
5949
|
+
const remotion = requireRemotionRoot();
|
|
5950
|
+
entryArg = remotion.entry;
|
|
5951
5951
|
compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
5952
|
-
remotionCwd =
|
|
5952
|
+
remotionCwd = remotion.cwd;
|
|
5953
5953
|
}
|
|
5954
5954
|
const propsPath = path7.join(ctx.tmpDir, "remotion", `${shot.id}_props.json`);
|
|
5955
5955
|
fs6.mkdirSync(path7.dirname(propsPath), { recursive: true });
|
|
@@ -5976,7 +5976,7 @@ var renderRemotion = async (shot, ctx) => {
|
|
|
5976
5976
|
[
|
|
5977
5977
|
"remotion",
|
|
5978
5978
|
"render",
|
|
5979
|
-
|
|
5979
|
+
entryArg,
|
|
5980
5980
|
compId,
|
|
5981
5981
|
"--props",
|
|
5982
5982
|
propsPath,
|
|
@@ -5987,7 +5987,7 @@ var renderRemotion = async (shot, ctx) => {
|
|
|
5987
5987
|
"--concurrency",
|
|
5988
5988
|
"4"
|
|
5989
5989
|
],
|
|
5990
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
5990
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotionCwd }
|
|
5991
5991
|
);
|
|
5992
5992
|
if (r.code !== 0) {
|
|
5993
5993
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 300);
|
|
@@ -6065,14 +6065,14 @@ var renderStockRemotion = async (shot, ctx) => {
|
|
|
6065
6065
|
2
|
|
6066
6066
|
)
|
|
6067
6067
|
);
|
|
6068
|
-
const
|
|
6068
|
+
const remotion = requireRemotionRoot();
|
|
6069
6069
|
const compId = ctx.aspect === "9:16" ? "ForgeVideoVertical" : "ForgeVideo";
|
|
6070
6070
|
const r = await runCmd(
|
|
6071
6071
|
"npx",
|
|
6072
6072
|
[
|
|
6073
6073
|
"remotion",
|
|
6074
6074
|
"render",
|
|
6075
|
-
|
|
6075
|
+
remotion.entry,
|
|
6076
6076
|
compId,
|
|
6077
6077
|
"--props",
|
|
6078
6078
|
propsPath,
|
|
@@ -6081,7 +6081,7 @@ var renderStockRemotion = async (shot, ctx) => {
|
|
|
6081
6081
|
"--concurrency",
|
|
6082
6082
|
"4"
|
|
6083
6083
|
],
|
|
6084
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
6084
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
6085
6085
|
);
|
|
6086
6086
|
if (r.code !== 0) {
|
|
6087
6087
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 300);
|
|
@@ -6115,9 +6115,9 @@ var renderDocumentaryV2 = async (shot, ctx) => {
|
|
|
6115
6115
|
data = JSON.parse(fs8.readFileSync(shot.prompt, "utf8"));
|
|
6116
6116
|
}
|
|
6117
6117
|
const durationFrames = data.totalDurationFrames > 0 ? data.totalDurationFrames : Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
6118
|
-
const
|
|
6118
|
+
const remotion = requireRemotionRoot();
|
|
6119
6119
|
const cacheRel = path9.posix.join("clip-render-cache", ctx.chunkId);
|
|
6120
|
-
const cacheAbs = path9.join(
|
|
6120
|
+
const cacheAbs = path9.join(remotion.cwd, "public", cacheRel);
|
|
6121
6121
|
fs8.mkdirSync(cacheAbs, { recursive: true });
|
|
6122
6122
|
for (const scene of data.scenes) {
|
|
6123
6123
|
for (const layer of scene.layers) {
|
|
@@ -6146,7 +6146,7 @@ var renderDocumentaryV2 = async (shot, ctx) => {
|
|
|
6146
6146
|
[
|
|
6147
6147
|
"remotion",
|
|
6148
6148
|
"render",
|
|
6149
|
-
|
|
6149
|
+
remotion.entry,
|
|
6150
6150
|
"DocumentaryV2",
|
|
6151
6151
|
"--props",
|
|
6152
6152
|
propsPath,
|
|
@@ -6155,7 +6155,7 @@ var renderDocumentaryV2 = async (shot, ctx) => {
|
|
|
6155
6155
|
"--concurrency",
|
|
6156
6156
|
"4"
|
|
6157
6157
|
],
|
|
6158
|
-
{ timeoutMs: 6e5, signal: ctx.signal, cwd:
|
|
6158
|
+
{ timeoutMs: 6e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
6159
6159
|
);
|
|
6160
6160
|
if (r.code !== 0) {
|
|
6161
6161
|
const tail = r.stderr.split("\n").slice(-8).join(" ").slice(0, 400);
|
|
@@ -6300,14 +6300,14 @@ var renderWebArticleRemotion = async (shot, ctx) => {
|
|
|
6300
6300
|
framesRendered: 0,
|
|
6301
6301
|
totalFrames: durationFrames
|
|
6302
6302
|
});
|
|
6303
|
-
const
|
|
6303
|
+
const remotion = requireRemotionRoot();
|
|
6304
6304
|
const compId = ctx.aspect === "9:16" ? "ArticleCardVertical" : "ArticleCard";
|
|
6305
6305
|
const r = await runCmd(
|
|
6306
6306
|
"npx",
|
|
6307
6307
|
[
|
|
6308
6308
|
"remotion",
|
|
6309
6309
|
"render",
|
|
6310
|
-
|
|
6310
|
+
remotion.entry,
|
|
6311
6311
|
compId,
|
|
6312
6312
|
"--props",
|
|
6313
6313
|
propsPath,
|
|
@@ -6318,7 +6318,7 @@ var renderWebArticleRemotion = async (shot, ctx) => {
|
|
|
6318
6318
|
"--concurrency",
|
|
6319
6319
|
"4"
|
|
6320
6320
|
],
|
|
6321
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
6321
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
6322
6322
|
);
|
|
6323
6323
|
if (r.code !== 0) {
|
|
6324
6324
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 300);
|
|
@@ -6394,9 +6394,9 @@ var renderXPostRemotion = async (shot, ctx) => {
|
|
|
6394
6394
|
if (ctx.signal?.aborted) throw new Error("aborted");
|
|
6395
6395
|
const durationFrames = Math.max(1, Math.round(shot.durationSec * ctx.fps));
|
|
6396
6396
|
const dims = ASPECT_DIMS4[ctx.aspect];
|
|
6397
|
-
const
|
|
6397
|
+
const remotion = requireRemotionRoot();
|
|
6398
6398
|
const entry = path11.join(
|
|
6399
|
-
|
|
6399
|
+
remotion.cwd,
|
|
6400
6400
|
"src",
|
|
6401
6401
|
"compositions",
|
|
6402
6402
|
"XPostCard.tsx"
|
|
@@ -6446,7 +6446,7 @@ var renderXPostRemotion = async (shot, ctx) => {
|
|
|
6446
6446
|
"--concurrency",
|
|
6447
6447
|
"4"
|
|
6448
6448
|
],
|
|
6449
|
-
{ timeoutMs: 3e5, signal: ctx.signal, cwd:
|
|
6449
|
+
{ timeoutMs: 3e5, signal: ctx.signal, cwd: remotion.cwd }
|
|
6450
6450
|
);
|
|
6451
6451
|
if (r.code !== 0) {
|
|
6452
6452
|
const tail = r.stderr.split("\n").slice(-5).join(" ").slice(0, 400);
|
|
@@ -6790,6 +6790,17 @@ var renderDocumentaryV2Lambda = async (shot, ctx) => {
|
|
|
6790
6790
|
`lambda: shot.prompt must be CompositionV2Data JSON or a path (shot ${shot.id})`
|
|
6791
6791
|
);
|
|
6792
6792
|
}
|
|
6793
|
+
let cfg;
|
|
6794
|
+
try {
|
|
6795
|
+
cfg = readLambdaCfg();
|
|
6796
|
+
} catch (err) {
|
|
6797
|
+
ctx.progress.emit({
|
|
6798
|
+
phase: "preparing",
|
|
6799
|
+
shotId: shot.id,
|
|
6800
|
+
warnings: [`lambda: ${err.message.split(".")[0]} \u2014 falling back to local documentary-v2 adapter`]
|
|
6801
|
+
});
|
|
6802
|
+
return renderDocumentaryV2(shot, ctx);
|
|
6803
|
+
}
|
|
6793
6804
|
ctx.progress.emit({ phase: "preparing", shotId: shot.id });
|
|
6794
6805
|
let data;
|
|
6795
6806
|
if (shot.prompt.trimStart().startsWith("{")) {
|
|
@@ -6800,7 +6811,6 @@ var renderDocumentaryV2Lambda = async (shot, ctx) => {
|
|
|
6800
6811
|
}
|
|
6801
6812
|
data = JSON.parse(fs12.readFileSync(shot.prompt, "utf8"));
|
|
6802
6813
|
}
|
|
6803
|
-
const cfg = readLambdaCfg();
|
|
6804
6814
|
let renderMediaOnLambda;
|
|
6805
6815
|
let getRenderProgress;
|
|
6806
6816
|
try {
|
|
@@ -6992,10 +7002,16 @@ var renderManimRunPod = async (shot, ctx) => {
|
|
|
6992
7002
|
throw new Error(`runpod-manim: shot.manimCode required for shot ${shot.id}`);
|
|
6993
7003
|
}
|
|
6994
7004
|
const endpointId = process.env.RUNPOD_MANIM_ENDPOINT_ID;
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
7005
|
+
const apiKey2 = process.env.RUNPOD_API_KEY;
|
|
7006
|
+
if (!endpointId || !apiKey2) {
|
|
7007
|
+
const missing = !apiKey2 ? "RUNPOD_API_KEY" : "RUNPOD_MANIM_ENDPOINT_ID";
|
|
7008
|
+
ctx.progress.emit({
|
|
7009
|
+
phase: "preparing",
|
|
7010
|
+
shotId: shot.id,
|
|
7011
|
+
warnings: [`runpod-manim: ${missing} not set \u2014 falling back to local manim adapter for ${ctx.resolvedEngine}`]
|
|
7012
|
+
});
|
|
7013
|
+
const localAdapter = ctx.resolvedEngine === "manim+remotion" ? renderManimRemotion : ctx.resolvedEngine === "gemini+manim+remotion" ? renderGeminiManimRemotion : renderManim;
|
|
7014
|
+
return localAdapter(shot, ctx);
|
|
6999
7015
|
}
|
|
7000
7016
|
ctx.progress.emit({ phase: "preparing", shotId: shot.id });
|
|
7001
7017
|
const status = await runJob(
|
|
@@ -7051,10 +7067,15 @@ var renderHyperframesRunPod = async (shot, ctx) => {
|
|
|
7051
7067
|
throw new Error(`runpod-hyperframes: shot.hyperframesHtml required for shot ${shot.id}`);
|
|
7052
7068
|
}
|
|
7053
7069
|
const endpointId = process.env.RUNPOD_HYPERFRAMES_ENDPOINT_ID;
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7070
|
+
const apiKey2 = process.env.RUNPOD_API_KEY;
|
|
7071
|
+
if (!endpointId || !apiKey2) {
|
|
7072
|
+
const missing = !apiKey2 ? "RUNPOD_API_KEY" : "RUNPOD_HYPERFRAMES_ENDPOINT_ID";
|
|
7073
|
+
ctx.progress.emit({
|
|
7074
|
+
phase: "preparing",
|
|
7075
|
+
shotId: shot.id,
|
|
7076
|
+
warnings: [`runpod-hyperframes: ${missing} not set \u2014 falling back to local hyperframes adapter`]
|
|
7077
|
+
});
|
|
7078
|
+
return renderHyperframes(shot, ctx);
|
|
7058
7079
|
}
|
|
7059
7080
|
ctx.progress.emit({ phase: "preparing", shotId: shot.id });
|
|
7060
7081
|
const dims = ctx.aspect === "9:16" ? { width: 1080, height: 1920 } : { width: 1920, height: 1080 };
|
package/dist/index.js
CHANGED
|
@@ -39,10 +39,26 @@ function loadCredentials() {
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
function findEnvFilesWalkingUp(startDir) {
|
|
43
|
+
const found = [];
|
|
44
|
+
const home = os.homedir();
|
|
45
|
+
let dir = startDir;
|
|
46
|
+
for (let i = 0; i < 10; i++) {
|
|
47
|
+
const env = path.join(dir, ".env");
|
|
48
|
+
if (fs.existsSync(env)) found.push(env);
|
|
49
|
+
const nextEnv = path.join(dir, "apps", "web", ".env.local");
|
|
50
|
+
if (fs.existsSync(nextEnv)) found.push(nextEnv);
|
|
51
|
+
const parent = path.dirname(dir);
|
|
52
|
+
if (parent === dir || dir === home) break;
|
|
53
|
+
dir = parent;
|
|
54
|
+
}
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
42
57
|
function loadDotEnv() {
|
|
43
58
|
const loaded = [];
|
|
44
59
|
const sources = [];
|
|
45
|
-
const
|
|
60
|
+
const walkedUp = findEnvFilesWalkingUp(path.resolve(process.cwd()));
|
|
61
|
+
const candidates = [...walkedUp, ...FORGE_ENV_PATHS];
|
|
46
62
|
for (const file of candidates) {
|
|
47
63
|
let content;
|
|
48
64
|
try {
|
|
@@ -1615,7 +1631,7 @@ Return ONLY the complete updated TSX. No markdown fences, no explanation.`;
|
|
|
1615
1631
|
return "0.0.0";
|
|
1616
1632
|
})();
|
|
1617
1633
|
void (async () => {
|
|
1618
|
-
const { BridgePoller } = await import("./bridge-poller-
|
|
1634
|
+
const { BridgePoller } = await import("./bridge-poller-6AWMIF3V.js");
|
|
1619
1635
|
const poller = new BridgePoller({ baseUrl: bridgeUrl, token: bridgeToken, clientVersion: `storyforge ${pkgVersion}` });
|
|
1620
1636
|
poller.start();
|
|
1621
1637
|
})();
|
|
@@ -2438,7 +2454,7 @@ function resolveBridgeToken2(explicit) {
|
|
|
2438
2454
|
// package.json
|
|
2439
2455
|
var package_default = {
|
|
2440
2456
|
name: "storyforge",
|
|
2441
|
-
version: "0.11.
|
|
2457
|
+
version: "0.11.5",
|
|
2442
2458
|
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.",
|
|
2443
2459
|
type: "module",
|
|
2444
2460
|
bin: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storyforge",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
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": {
|