@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.
Files changed (94) hide show
  1. package/README.md +2 -2
  2. package/dist/adapter-registry.js +11 -12
  3. package/dist/adapters/image/bytes.js +1 -1
  4. package/dist/adapters/image/fal.js +28 -41
  5. package/dist/adapters/image/openai.js +19 -24
  6. package/dist/adapters/image/replicate.js +33 -43
  7. package/dist/adapters/llm/claude-code.js +16 -19
  8. package/dist/adapters/llm/codex.js +14 -15
  9. package/dist/adapters/llm/openrouter.js +13 -16
  10. package/dist/adapters/llm/run-cli.js +9 -11
  11. package/dist/adapters/llm/sse-lines.js +1 -2
  12. package/dist/adapters/retry-after.js +6 -6
  13. package/dist/adapters/tts/cartesia.js +5 -5
  14. package/dist/adapters/tts/elevenlabs.js +14 -19
  15. package/dist/adapters/tts/openai.js +9 -10
  16. package/dist/edge/cli.js +0 -0
  17. package/dist/edge/http/actions.js +8 -9
  18. package/dist/edge/http/app.js +3 -3
  19. package/dist/edge/http/entries.js +1 -1
  20. package/dist/edge/http/projects.js +7 -7
  21. package/dist/edge/http/prompts.js +6 -6
  22. package/dist/edge/http/providers.js +4 -4
  23. package/dist/edge/http/settings.js +2 -2
  24. package/dist/edge/http/staging.js +1 -1
  25. package/dist/edge/http/telemetry.js +6 -7
  26. package/dist/edge/http/usage.js +5 -5
  27. package/dist/kernel/config/index.js +1 -1
  28. package/dist/kernel/db/tx.js +9 -12
  29. package/dist/kernel/log.js +5 -5
  30. package/dist/kernel/pipeline.js +7 -9
  31. package/dist/kernel/ports/model.js +3 -4
  32. package/dist/kernel/runner/attempt-repo.js +5 -6
  33. package/dist/kernel/runner/attempt.js +16 -23
  34. package/dist/kernel/runner/graph.js +18 -29
  35. package/dist/kernel/runner/index.js +27 -33
  36. package/dist/kernel/runner/piece-repo.js +9 -11
  37. package/dist/kernel/runner/providers.js +5 -7
  38. package/dist/kernel/version.js +3 -3
  39. package/dist/main.js +10 -11
  40. package/dist/slices/admission/model.js +2 -2
  41. package/dist/slices/admission/repo.js +6 -7
  42. package/dist/slices/admission/rules.js +12 -15
  43. package/dist/slices/admission/start.js +7 -8
  44. package/dist/slices/admission/substitute.js +11 -11
  45. package/dist/slices/article/continuation.js +9 -9
  46. package/dist/slices/article/plain.js +5 -5
  47. package/dist/slices/article/run.js +25 -25
  48. package/dist/slices/article/split.js +1 -1
  49. package/dist/slices/article/store.js +5 -5
  50. package/dist/slices/cancel/index.js +8 -8
  51. package/dist/slices/images/run.js +32 -34
  52. package/dist/slices/library/lint.js +3 -3
  53. package/dist/slices/library/model.js +7 -7
  54. package/dist/slices/library/repo.js +3 -3
  55. package/dist/slices/library/save.js +7 -7
  56. package/dist/slices/library/slots.js +5 -5
  57. package/dist/slices/narration/chunk.js +12 -12
  58. package/dist/slices/narration/concat.js +12 -13
  59. package/dist/slices/narration/run.js +46 -49
  60. package/dist/slices/reruns/cascade.js +10 -11
  61. package/dist/slices/reruns/index.js +36 -37
  62. package/dist/slices/research/planner.js +4 -5
  63. package/dist/slices/research/run.js +22 -23
  64. package/dist/slices/research/synthesis.js +5 -5
  65. package/dist/slices/settings/cli-status.js +9 -10
  66. package/dist/slices/settings/keys.js +8 -9
  67. package/dist/slices/settings/model.js +5 -5
  68. package/dist/slices/settings/readiness.js +3 -4
  69. package/dist/slices/settings/repo.js +1 -1
  70. package/dist/slices/settings/voices.js +3 -4
  71. package/dist/slices/storage/asset-name.js +2 -2
  72. package/dist/slices/storage/delete-project.js +3 -5
  73. package/dist/slices/storage/downloads.js +4 -4
  74. package/dist/slices/storage/layout.js +5 -6
  75. package/dist/slices/storage/model.js +1 -1
  76. package/dist/slices/storage/reconcile.js +6 -7
  77. package/dist/slices/storage/repo.js +1 -1
  78. package/dist/slices/storage/staging.js +12 -15
  79. package/dist/slices/telemetry/collector-client.js +2 -2
  80. package/dist/slices/telemetry/flush.js +8 -8
  81. package/dist/slices/telemetry/machine.js +6 -7
  82. package/dist/slices/telemetry/model.js +11 -13
  83. package/dist/slices/telemetry/record.js +7 -7
  84. package/dist/slices/telemetry/repo.js +4 -4
  85. package/dist/slices/telemetry/usage.js +5 -5
  86. package/dist/slices/thumbnail/by-llm.js +2 -2
  87. package/dist/slices/thumbnail/run.js +30 -32
  88. package/dist/slices/video/ffmpeg.js +6 -6
  89. package/dist/slices/video/plan.js +9 -9
  90. package/dist/slices/video/run.js +19 -20
  91. package/dist/web/assets/index-77hb2Mr0.js +81 -0
  92. package/dist/web/index.html +1 -1
  93. package/package.json +1 -1
  94. package/dist/web/assets/index-D_sWbKQi.js +0 -81
@@ -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 (04-data-flow, SSE disconnect).
11
+ // rather than nothing.
12
12
  const progressIntervalMs = 500;
13
- // logic/12 §Q106: "the previous video stays downloadable until the new render finishes".
14
- // ffmpeg therefore writes beside the finished file rather than over it, and the swap
15
- // below is what replaces it. The name keeps the `.mp4` extension because that is what
16
- // ffmpeg picks its muxer from, and no row ever names it: a download resolves an outputs
17
- // row, and the boot reconcile collects a part file left by a killed process as an orphan
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 (§Q106's invariant).
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
- // logic/11 §Q89: no retry and no timeout. A render that fails is terminal.
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
- // logic/13 §Q113 protects an output that was already stored, not one that is about to
79
- // be. A cancel landing between ffmpeg exiting and the rows below discards the render
80
- // rather than reporting done to a page that pressed Cancel.
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
- // logic/13 step 2: a partial render file is discarded, never kept or served. Only the
85
- // part file: the previous video is a finished output and §Q106 keeps it downloadable.
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
- // §Q106: no version history. The files were written under the names the previous render
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
- // logic/16 step 3: "videos rendered (completed renders)". One event per swap, so a
118
- // render that failed or was canceled counts nothing and a re-render counts again
119
- // (scenario 12). No provider: ffmpeg is the machine's own, not a service.
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 (logic/11 §Q100).
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
- // logic/11 invariant: every slideshow image appears exactly once, in slideshow order.
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