@gentbajko/slopify 0.1.0 → 0.2.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.
- package/README.md +2 -2
- package/dist/adapter-registry.js +11 -12
- package/dist/adapters/image/bytes.js +1 -1
- package/dist/adapters/image/fal.js +28 -41
- package/dist/adapters/image/openai.js +19 -24
- package/dist/adapters/image/replicate.js +33 -43
- package/dist/adapters/llm/claude-code.js +16 -19
- package/dist/adapters/llm/codex.js +14 -15
- package/dist/adapters/llm/openrouter.js +13 -16
- package/dist/adapters/llm/run-cli.js +9 -11
- package/dist/adapters/llm/sse-lines.js +1 -2
- package/dist/adapters/retry-after.js +6 -6
- package/dist/adapters/tts/cartesia.js +5 -5
- package/dist/adapters/tts/elevenlabs.js +14 -19
- package/dist/adapters/tts/openai.js +9 -10
- package/dist/edge/cli.js +0 -0
- package/dist/edge/http/actions.js +8 -9
- package/dist/edge/http/app.js +3 -3
- package/dist/edge/http/entries.js +1 -1
- package/dist/edge/http/projects.js +7 -7
- package/dist/edge/http/prompts.js +6 -6
- package/dist/edge/http/providers.js +4 -4
- package/dist/edge/http/settings.js +2 -2
- package/dist/edge/http/staging.js +1 -1
- package/dist/edge/http/telemetry.js +6 -7
- package/dist/edge/http/usage.js +5 -5
- package/dist/kernel/config/index.js +1 -1
- package/dist/kernel/db/tx.js +9 -12
- package/dist/kernel/log.js +5 -5
- package/dist/kernel/pipeline.js +7 -9
- package/dist/kernel/ports/model.js +3 -4
- package/dist/kernel/runner/attempt-repo.js +5 -6
- package/dist/kernel/runner/attempt.js +16 -23
- package/dist/kernel/runner/graph.js +18 -29
- package/dist/kernel/runner/index.js +27 -33
- package/dist/kernel/runner/piece-repo.js +9 -11
- package/dist/kernel/runner/providers.js +5 -7
- package/dist/kernel/version.js +3 -3
- package/dist/main.js +10 -11
- package/dist/slices/admission/model.js +2 -2
- package/dist/slices/admission/repo.js +6 -7
- package/dist/slices/admission/rules.js +12 -15
- package/dist/slices/admission/start.js +7 -8
- package/dist/slices/admission/substitute.js +11 -11
- package/dist/slices/article/continuation.js +9 -9
- package/dist/slices/article/plain.js +5 -5
- package/dist/slices/article/run.js +25 -25
- package/dist/slices/article/split.js +1 -1
- package/dist/slices/article/store.js +5 -5
- package/dist/slices/cancel/index.js +8 -8
- package/dist/slices/images/run.js +32 -34
- package/dist/slices/library/lint.js +3 -3
- package/dist/slices/library/model.js +7 -7
- package/dist/slices/library/repo.js +3 -3
- package/dist/slices/library/save.js +7 -7
- package/dist/slices/library/slots.js +5 -5
- package/dist/slices/narration/chunk.js +12 -12
- package/dist/slices/narration/concat.js +12 -13
- package/dist/slices/narration/run.js +46 -49
- package/dist/slices/reruns/cascade.js +10 -11
- package/dist/slices/reruns/index.js +36 -37
- package/dist/slices/research/planner.js +4 -5
- package/dist/slices/research/run.js +22 -23
- package/dist/slices/research/synthesis.js +5 -5
- package/dist/slices/settings/cli-status.js +9 -10
- package/dist/slices/settings/keys.js +8 -9
- package/dist/slices/settings/model.js +5 -5
- package/dist/slices/settings/readiness.js +3 -4
- package/dist/slices/settings/repo.js +1 -1
- package/dist/slices/settings/voices.js +3 -4
- package/dist/slices/storage/asset-name.js +2 -2
- package/dist/slices/storage/delete-project.js +3 -5
- package/dist/slices/storage/downloads.js +4 -4
- package/dist/slices/storage/layout.js +5 -6
- package/dist/slices/storage/model.js +1 -1
- package/dist/slices/storage/reconcile.js +6 -7
- package/dist/slices/storage/repo.js +1 -1
- package/dist/slices/storage/staging.js +12 -15
- package/dist/slices/telemetry/collector-client.js +2 -2
- package/dist/slices/telemetry/flush.js +8 -8
- package/dist/slices/telemetry/machine.js +6 -7
- package/dist/slices/telemetry/model.js +11 -13
- package/dist/slices/telemetry/record.js +7 -7
- package/dist/slices/telemetry/repo.js +4 -4
- package/dist/slices/telemetry/usage.js +5 -5
- package/dist/slices/thumbnail/by-llm.js +2 -2
- package/dist/slices/thumbnail/run.js +30 -32
- package/dist/slices/video/ffmpeg.js +6 -6
- package/dist/slices/video/plan.js +9 -9
- package/dist/slices/video/run.js +19 -20
- package/dist/web/assets/index-77hb2Mr0.js +81 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-D_sWbKQi.js +0 -81
package/dist/slices/video/run.js
CHANGED
|
@@ -8,17 +8,16 @@ import { probeDurationMs, renderArgs, runFfmpeg } from "./ffmpeg.js";
|
|
|
8
8
|
import { planRender } from "./plan.js";
|
|
9
9
|
// ceiling: progress is coalesced to one event per 500 ms, and the stage's progress
|
|
10
10
|
// columns are written on the same tick so a page that reconnects mid-render sees a bar
|
|
11
|
-
// rather than nothing
|
|
11
|
+
// rather than nothing.
|
|
12
12
|
const progressIntervalMs = 500;
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// (`slices/storage/reconcile.ts`).
|
|
13
|
+
// The previous video stays downloadable until the new render finishes. ffmpeg therefore writes
|
|
14
|
+
// beside the finished file rather than over it, and the swap below is what replaces it. The
|
|
15
|
+
// name keeps the `.mp4` extension because that is what ffmpeg picks its muxer from, and no row
|
|
16
|
+
// ever names it: a download resolves an outputs row, and the boot reconcile collects a part
|
|
17
|
+
// file left by a killed process as an orphan (`slices/storage/reconcile.ts`).
|
|
19
18
|
const partName = "video.part.mp4";
|
|
20
19
|
// The two outputs one render produces. Both are replaced together, so a project never
|
|
21
|
-
// carries the video of one render beside the parameters of another
|
|
20
|
+
// carries the video of one render beside the parameters of another.
|
|
22
21
|
const renderRoles = ["video", "render_params"];
|
|
23
22
|
export async function renderVideo(deps, context) {
|
|
24
23
|
const { projectId } = context.stage;
|
|
@@ -52,7 +51,7 @@ export async function renderVideo(deps, context) {
|
|
|
52
51
|
const totalMs = Math.round(plan.totalSeconds * 1000);
|
|
53
52
|
let announced = 0;
|
|
54
53
|
try {
|
|
55
|
-
//
|
|
54
|
+
// No retry and no timeout. A render that fails is terminal.
|
|
56
55
|
await runFfmpeg({
|
|
57
56
|
bin: deps.ffmpeg,
|
|
58
57
|
args: renderArgs({ ...plan, output: part }),
|
|
@@ -75,14 +74,14 @@ export async function renderVideo(deps, context) {
|
|
|
75
74
|
});
|
|
76
75
|
},
|
|
77
76
|
});
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
77
|
+
// A cancel protects an output that was already stored, not one about to be. One
|
|
78
|
+
// landing between ffmpeg exiting and the rows below discards the render rather than
|
|
79
|
+
// reporting done to a page that pressed Cancel.
|
|
81
80
|
context.signal.throwIfAborted();
|
|
82
81
|
}
|
|
83
82
|
catch (error) {
|
|
84
|
-
//
|
|
85
|
-
//
|
|
83
|
+
// A partial render file is discarded, never kept or served. Only the part file: the
|
|
84
|
+
// previous video is a finished output and stays downloadable.
|
|
86
85
|
rmSync(part, { force: true });
|
|
87
86
|
throw error;
|
|
88
87
|
}
|
|
@@ -90,7 +89,7 @@ export async function renderVideo(deps, context) {
|
|
|
90
89
|
renameSync(part, target);
|
|
91
90
|
const params = outputPath(deps.paths, projectId, "render.json");
|
|
92
91
|
writeFileSync(params, `${JSON.stringify(recorded(plan, dir), null, 2)}\n`, { mode: 0o600 });
|
|
93
|
-
//
|
|
92
|
+
// No version history. The files were written under the names the previous render
|
|
94
93
|
// already used, so replacing the rows that named them is all that is left to do. In one
|
|
95
94
|
// transaction, or a crash between the delete and the insert would leave the finished
|
|
96
95
|
// video with no row and the boot reconcile would collect it. Read back rather than
|
|
@@ -114,13 +113,13 @@ export async function renderVideo(deps, context) {
|
|
|
114
113
|
current: totalMs,
|
|
115
114
|
total: totalMs,
|
|
116
115
|
});
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
116
|
+
// Videos rendered (completed renders). One event per swap, so a render that failed or was
|
|
117
|
+
// canceled counts nothing and a re-render counts again No provider: ffmpeg is the machine's
|
|
118
|
+
// own, not a service.
|
|
120
119
|
deps.count("stage.completed", { stage: "video" });
|
|
121
120
|
}
|
|
122
121
|
// Written with project-relative paths, so the record of what was rendered can be read
|
|
123
|
-
// beside the files it names and carries no absolute path off the machine
|
|
122
|
+
// beside the files it names and carries no absolute path off the machine.
|
|
124
123
|
function recorded(plan, dir) {
|
|
125
124
|
return {
|
|
126
125
|
...plan,
|
|
@@ -132,7 +131,7 @@ function recorded(plan, dir) {
|
|
|
132
131
|
output: relative(dir, plan.output),
|
|
133
132
|
};
|
|
134
133
|
}
|
|
135
|
-
//
|
|
134
|
+
// Every slideshow image appears exactly once, in slideshow order.
|
|
136
135
|
// The thumbnail is a different role, so it is never in this list.
|
|
137
136
|
function slideshow(outputs) {
|
|
138
137
|
return outputs
|