sovkora 0.0.0-stage → 1.1.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/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +67 -2
- package/dist/commands/agent.command.js +267 -0
- package/dist/commands/chat.command.js +214 -0
- package/dist/commands/chat.handlers.js +150 -0
- package/dist/commands/chat.types.js +44 -0
- package/dist/commands/cinema.command.js +643 -0
- package/dist/commands/config.command.js +228 -0
- package/dist/commands/db.command.js +114 -0
- package/dist/commands/demo.command.js +55 -0
- package/dist/commands/dev.command.js +462 -0
- package/dist/commands/docs.command.js +135 -0
- package/dist/commands/doctor.command.js +119 -0
- package/dist/commands/forgot.command.js +57 -0
- package/dist/commands/generate.command.js +376 -0
- package/dist/commands/graph.command.js +54 -0
- package/dist/commands/init.command.js +380 -0
- package/dist/commands/init.steps.js +115 -0
- package/dist/commands/install.command.js +459 -0
- package/dist/commands/login.command.js +110 -0
- package/dist/commands/logs.command.js +215 -0
- package/dist/commands/logs.steps.js +130 -0
- package/dist/commands/mcp.command.js +104 -0
- package/dist/commands/models.command.js +164 -0
- package/dist/commands/onboard.command.js +236 -0
- package/dist/commands/pack.command.js +255 -0
- package/dist/commands/profile.command.js +51 -0
- package/dist/commands/recover.command.js +489 -0
- package/dist/commands/register.command.js +94 -0
- package/dist/commands/release.command.js +99 -0
- package/dist/commands/reset.command.js +79 -0
- package/dist/commands/runs.command.js +201 -0
- package/dist/commands/settings.command.js +85 -0
- package/dist/commands/start.command.js +590 -0
- package/dist/commands/status.command.js +167 -0
- package/dist/commands/stop.command.js +313 -0
- package/dist/commands/studio.command.js +266 -0
- package/dist/commands/test.command.js +134 -0
- package/dist/commands/verify.command.js +52 -0
- package/dist/commands/video.command.js +73 -0
- package/dist/commands/workspace-guard.js +72 -0
- package/dist/index.js +207 -0
- package/dist/renderers.js +250 -0
- package/dist/services/api-client.js +150 -0
- package/dist/services/auth.api.js +87 -0
- package/dist/services/chat.api.js +117 -0
- package/dist/services/cinema-estimate.json +42 -0
- package/dist/services/cinema.childsafe.js +52 -0
- package/dist/services/cinema.director.js +285 -0
- package/dist/services/cinema.production.js +417 -0
- package/dist/services/cinema.staging.js +323 -0
- package/dist/services/cinema.story.js +758 -0
- package/dist/services/cinema.treatment.js +393 -0
- package/dist/services/composer.run.js +94 -0
- package/dist/services/demo/demo.documents.js +108 -0
- package/dist/services/demo/demo.guard.js +49 -0
- package/dist/services/demo/demo.persona.js +114 -0
- package/dist/services/demo/demo.seed.js +281 -0
- package/dist/services/diagnostics.js +327 -0
- package/dist/services/image-model-recipes.json +93 -0
- package/dist/services/image-models.js +152 -0
- package/dist/services/local-store.js +145 -0
- package/dist/services/mcp.api.js +38 -0
- package/dist/services/model-catalog.js +70 -0
- package/dist/services/notify.js +55 -0
- package/dist/services/pack.api.js +23 -0
- package/dist/services/pack.bundle.js +241 -0
- package/dist/services/pack.sources.js +101 -0
- package/dist/services/release-manifest.js +266 -0
- package/dist/services/runs.view.js +80 -0
- package/dist/services/runs.wait.js +38 -0
- package/dist/services/semver.js +55 -0
- package/dist/services/settings.api.js +108 -0
- package/dist/services/string-utils.js +70 -0
- package/dist/services/studio.api.js +120 -0
- package/dist/services/templates.js +893 -0
- package/dist/services/tool-installer.js +353 -0
- package/dist/services/tool-path.js +72 -0
- package/dist/services/version-manager.js +253 -0
- package/dist/services/workspace-bootstrap.js +68 -0
- package/dist/threads.js +202 -0
- package/dist/types/api.types.js +6 -0
- package/dist/types/local.types.js +6 -0
- package/dist/ui/box.js +46 -0
- package/dist/ui/logger.js +28 -0
- package/dist/ui/platform.js +32 -0
- package/dist/ui/prompts.js +130 -0
- package/dist/ui/table.js +33 -0
- package/dist/utils/config.js +150 -0
- package/dist/utils/development-status.js +22 -0
- package/dist/utils/endpoints.js +41 -0
- package/dist/utils/health.js +94 -0
- package/dist/utils/pid.js +83 -0
- package/dist/utils/platform.js +358 -0
- package/dist/utils/process.js +139 -0
- package/dist/utils/state-dir.js +105 -0
- package/package.json +95 -4
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file cinema.command.ts
|
|
4
|
+
* @description `sovkora cinema` — a cinematic short (30–60 s, 9:16 or 16:9) from a brief (ADR-080).
|
|
5
|
+
*
|
|
6
|
+
* A production is a folder holding `production.json`: the brief, the script's shot list, and every Studio run made
|
|
7
|
+
* for it. Each step is an ordinary run — metered, policy-checked, in the run history — and the estimate is shown
|
|
8
|
+
* before anything runs. A stopped production resumes with the same command; a rejected shot is reshot alone.
|
|
9
|
+
*
|
|
10
|
+
* sovkora cinema new <dir> --brief "…" --format superhero-vfx --aspect 9:16 --duration 45 --shots 10
|
|
11
|
+
* sovkora cinema estimate <dir>
|
|
12
|
+
* sovkora cinema run <dir> [--yes] [--max-runs n]
|
|
13
|
+
* sovkora cinema fetch <dir> keyframes, shots and the film, to look at them
|
|
14
|
+
* sovkora cinema reshoot <dir> 3,7 [--new-keyframe]
|
|
15
|
+
* sovkora cinema status <dir>
|
|
16
|
+
*
|
|
17
|
+
* A directed film (orazaka#259) starts from a treatment instead of a brief, and its shots can be made on a GPU host:
|
|
18
|
+
*
|
|
19
|
+
* sovkora cinema plan <dir> --treatment treatment.json [--references renders/] [--language en]
|
|
20
|
+
* sovkora cinema sheet <dir> the reference sheet of each character that has a reference render
|
|
21
|
+
* sovkora cinema jobs <dir> [--out f] the pending shots, as jobs for a GPU host (the worker's own generator)
|
|
22
|
+
* sovkora cinema take <dir> 3 take.mp4 records a take made there (then: reshoot redoes it, and its chain)
|
|
23
|
+
* sovkora cinema review <dir> 3 take.mp4 a frame every 8 under the cast's reference sheet, to accept or reject it
|
|
24
|
+
*
|
|
25
|
+
* The treatment stage (orazaka#289) writes the story a short brief needs before any shot is planned, and judges it:
|
|
26
|
+
*
|
|
27
|
+
* sovkora cinema treat <dir> --brief "…" [--revisions 2] [--no-judge] story, arc, intentions, lines, cues, sound list
|
|
28
|
+
* sovkora cinema critique <treatment.json> [--judge] the rubric (and the LLM judge) over a treatment: pass or why not
|
|
29
|
+
* sovkora cinema timeline <treatment.json> [--voice report.json] every line, cue and sound placed on the cut
|
|
30
|
+
*
|
|
31
|
+
* The v3 gates (ADR-080 v3): staging, camera and cut, and the questions every keyframe and take must answer:
|
|
32
|
+
*
|
|
33
|
+
* sovkora cinema stage <treatment.json> [--out questions.json] the cut's findings, and the frame questions per shot
|
|
34
|
+
*/
|
|
35
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
38
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
39
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
40
|
+
}
|
|
41
|
+
Object.defineProperty(o, k2, desc);
|
|
42
|
+
}) : (function(o, m, k, k2) {
|
|
43
|
+
if (k2 === undefined) k2 = k;
|
|
44
|
+
o[k2] = m[k];
|
|
45
|
+
}));
|
|
46
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
47
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
48
|
+
}) : function(o, v) {
|
|
49
|
+
o["default"] = v;
|
|
50
|
+
});
|
|
51
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
52
|
+
var ownKeys = function(o) {
|
|
53
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
54
|
+
var ar = [];
|
|
55
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
56
|
+
return ar;
|
|
57
|
+
};
|
|
58
|
+
return ownKeys(o);
|
|
59
|
+
};
|
|
60
|
+
return function (mod) {
|
|
61
|
+
if (mod && mod.__esModule) return mod;
|
|
62
|
+
var result = {};
|
|
63
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
64
|
+
__setModuleDefault(result, mod);
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
})();
|
|
68
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
69
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
70
|
+
};
|
|
71
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.cinemaCommand = exports.isAssetId = exports.sheetFile = void 0;
|
|
73
|
+
exports.startWhenFree = startWhenFree;
|
|
74
|
+
const commander_1 = require("commander");
|
|
75
|
+
const node_child_process_1 = require("node:child_process");
|
|
76
|
+
const fs = __importStar(require("node:fs"));
|
|
77
|
+
const os = __importStar(require("node:os"));
|
|
78
|
+
const path = __importStar(require("node:path"));
|
|
79
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
80
|
+
const tool_path_1 = require("../services/tool-path");
|
|
81
|
+
const threads_1 = require("../threads");
|
|
82
|
+
const logger_1 = require("../ui/logger");
|
|
83
|
+
const api_client_1 = require("../services/api-client");
|
|
84
|
+
const studio_api_1 = require("../services/studio.api");
|
|
85
|
+
const cinema_director_1 = require("../services/cinema.director");
|
|
86
|
+
const cinema_staging_1 = require("../services/cinema.staging");
|
|
87
|
+
const cinema_story_1 = require("../services/cinema.story");
|
|
88
|
+
const cinema_production_1 = require("../services/cinema.production");
|
|
89
|
+
const cinema_estimate_json_1 = __importDefault(require("../services/cinema-estimate.json"));
|
|
90
|
+
const cinema_treatment_1 = require("../services/cinema.treatment");
|
|
91
|
+
const FILE = "production.json";
|
|
92
|
+
const TERMINAL = new Set(["SUCCEEDED", "FAILED", "CANCELLED", "REJECTED", "TIMED_OUT"]);
|
|
93
|
+
/** How often a run is asked for its state, and how long a single run is followed (the shot Studio's own timeout is 20 min). */
|
|
94
|
+
const POLL_MS = 10_000;
|
|
95
|
+
const RUN_LIMIT_MS = 45 * 60_000;
|
|
96
|
+
function load(dir) {
|
|
97
|
+
const file = path.join(dir, FILE);
|
|
98
|
+
if (!fs.existsSync(file)) {
|
|
99
|
+
throw new Error(`${file} does not exist — start with: sovkora cinema new ${dir} --brief "…"`);
|
|
100
|
+
}
|
|
101
|
+
return JSON.parse(fs.readFileSync(file, "utf-8"));
|
|
102
|
+
}
|
|
103
|
+
function save(dir, production) {
|
|
104
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
105
|
+
fs.writeFileSync(path.join(dir, FILE), `${JSON.stringify(production, null, 2)}\n`);
|
|
106
|
+
}
|
|
107
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
108
|
+
/** An uploaded asset's id (a UUID), as `POST /api/v1/media/upload` answers it — not a URL to download. */
|
|
109
|
+
/** A character id comes from the script (model-written): it names a file, never a path. */
|
|
110
|
+
const sheetFile = (dir, id) => {
|
|
111
|
+
if (!/^[A-Za-z0-9_-]+$/.test(id))
|
|
112
|
+
throw new cinema_treatment_1.TreatmentError(`character id "${id}" is not a safe file name`);
|
|
113
|
+
return path.join(dir, "sheets", `${id}.png`);
|
|
114
|
+
};
|
|
115
|
+
exports.sheetFile = sheetFile;
|
|
116
|
+
const isAssetId = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
117
|
+
exports.isAssetId = isAssetId;
|
|
118
|
+
/** How long a run waits for a free slot of the account's concurrent-run cap before the director gives up. */
|
|
119
|
+
const SLOT_WAIT_MS = 60 * 60_000;
|
|
120
|
+
/**
|
|
121
|
+
* Starts a run, waiting while the account is at its concurrent-run cap ("too many concurrent runs"): a refusal that only
|
|
122
|
+
* says "not now" is not a failed production. Any other refusal is thrown at once.
|
|
123
|
+
*/
|
|
124
|
+
async function startWhenFree(start, wait = sleep, limitMs = SLOT_WAIT_MS, pollMs = 30_000) {
|
|
125
|
+
const deadline = Date.now() + limitMs;
|
|
126
|
+
for (;;) {
|
|
127
|
+
try {
|
|
128
|
+
return await start();
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
// "Not now": the account is at its cap, or the platform is restarting (a 5xx while a deploy rolls out).
|
|
132
|
+
const busy = error instanceof Error &&
|
|
133
|
+
/too many concurrent runs|internal server error|status 50\d|bad gateway|service unavailable/i.test(error.message);
|
|
134
|
+
if (!busy || Date.now() + pollMs > deadline)
|
|
135
|
+
throw error;
|
|
136
|
+
await wait(pollMs);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/** The REST port: a run is started, then followed to its end; an output is re-uploaded as an asset a run can start from. */
|
|
141
|
+
const restPort = {
|
|
142
|
+
async run(studioKey, inputs) {
|
|
143
|
+
const started = await startWhenFree(() => studio_api_1.StudioApi.startStudioRun(studioKey, inputs));
|
|
144
|
+
const deadline = Date.now() + RUN_LIMIT_MS;
|
|
145
|
+
let run = started;
|
|
146
|
+
while (!TERMINAL.has(run.status) && Date.now() < deadline) {
|
|
147
|
+
await sleep(POLL_MS);
|
|
148
|
+
try {
|
|
149
|
+
run = await studio_api_1.StudioApi.runDetail(started.id);
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
// a network blip while following is not a failed run: ask again
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return run;
|
|
156
|
+
},
|
|
157
|
+
async reupload(output, lastFrame, at) {
|
|
158
|
+
// Already an uploaded asset (a keyframe re-uploaded from the production folder): nothing to move.
|
|
159
|
+
if (!lastFrame && (0, exports.isAssetId)(output))
|
|
160
|
+
return output;
|
|
161
|
+
const scratch = fs.mkdtempSync(path.join(os.tmpdir(), "orz-cinema-"));
|
|
162
|
+
try {
|
|
163
|
+
const downloaded = path.join(scratch, lastFrame ? "clip.mp4" : "keyframe.png");
|
|
164
|
+
await api_client_1.ApiClient.downloadTo(output, downloaded);
|
|
165
|
+
let file = downloaded;
|
|
166
|
+
if (lastFrame) {
|
|
167
|
+
file = path.join(scratch, "last-frame.png");
|
|
168
|
+
// The chained frame: a chosen second of the previous take (`chainAt`), else its last frame.
|
|
169
|
+
const seek = at !== undefined ? ["-ss", at.toFixed(3)] : ["-sseof", "-0.15"];
|
|
170
|
+
(0, node_child_process_1.execFileSync)((0, tool_path_1.toolPath)("ffmpeg"), [
|
|
171
|
+
"-v",
|
|
172
|
+
"error",
|
|
173
|
+
"-y",
|
|
174
|
+
...seek,
|
|
175
|
+
"-i",
|
|
176
|
+
downloaded,
|
|
177
|
+
"-update",
|
|
178
|
+
"1",
|
|
179
|
+
"-frames:v",
|
|
180
|
+
"1",
|
|
181
|
+
file,
|
|
182
|
+
]);
|
|
183
|
+
}
|
|
184
|
+
return (await api_client_1.ApiClient.uploadFile(file)).assetId;
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
fs.rmSync(scratch, { recursive: true, force: true });
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
async function creditsPerStudio() {
|
|
192
|
+
const keys = [...new Set(Object.values(cinema_estimate_json_1.default.steps).map((s) => s.studioKey))];
|
|
193
|
+
const credits = {};
|
|
194
|
+
for (const key of keys) {
|
|
195
|
+
try {
|
|
196
|
+
credits[key] = (await studio_api_1.StudioApi.detail(key)).estimatedCredits ?? 0;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
credits[key] = 0; // a Studio this deployment lacks is said by the run, not guessed here
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return credits;
|
|
203
|
+
}
|
|
204
|
+
async function printEstimate(production) {
|
|
205
|
+
const result = (0, cinema_production_1.estimate)(production, production.brief.shots, await creditsPerStudio(), cinema_estimate_json_1.default.steps);
|
|
206
|
+
const rows = result.lines
|
|
207
|
+
.filter((line) => line.count > 0)
|
|
208
|
+
.map((line) => ` ${line.step.padEnd(10)} ${String(line.count).padStart(3)} run(s) ${String(line.credits).padStart(7)} credits` +
|
|
209
|
+
` ~${String(line.seconds).padStart(5)} s` +
|
|
210
|
+
(line.gpuUsd > 0 ? ` ~$${line.gpuUsd.toFixed(2)} GPU` : ""));
|
|
211
|
+
console.log(chalk_1.default.bold(`Estimate — a ${result.filmSeconds} s film (${production.brief.aspect})`));
|
|
212
|
+
console.log(rows.join("\n"));
|
|
213
|
+
console.log(` ${"total".padEnd(10)} ${String(result.credits).padStart(7)} credits ~${Math.ceil(result.seconds / 60)} min` +
|
|
214
|
+
(result.gpuUsd > 0 ? ` ~$${result.gpuUsd.toFixed(2)} GPU` : ""));
|
|
215
|
+
console.log(chalk_1.default.gray(` times and GPU cost measured: ${cinema_estimate_json_1.default.measured} (${cinema_estimate_json_1.default.gpu}); credits: each Studio's own estimate`));
|
|
216
|
+
}
|
|
217
|
+
const newCommand = new commander_1.Command("new")
|
|
218
|
+
.description("Start a production from a brief")
|
|
219
|
+
.argument("<dir>", "The production's folder")
|
|
220
|
+
.requiredOption("-b, --brief <text>", "What the film is: story, place, mood (original characters only)")
|
|
221
|
+
.option("-f, --format <format>", `One of ${cinema_production_1.FORMATS.join(", ")}`, "custom")
|
|
222
|
+
.option("-a, --aspect <aspect>", "9:16 or 16:9", "9:16")
|
|
223
|
+
.option("-d, --duration <seconds>", "30 to 60", "45")
|
|
224
|
+
.option("-n, --shots <count>", "8 to 12", "10")
|
|
225
|
+
.option("-l, --language <lang>", "en or fr", "en")
|
|
226
|
+
.option("--seed <seed>", "The production's seed (every shot's seed derives from it)")
|
|
227
|
+
.option("--voice <voice>", "A voice of the speech catalogue for the voice-over")
|
|
228
|
+
.option("--voice-model <model>", "The speech model of the voice-over (e.g. kokoro-82m while a cinema GPU host runs)")
|
|
229
|
+
.option("--script-model <model>", "The language model that writes the script (default: the catalogue's)")
|
|
230
|
+
.action((dir, o) => {
|
|
231
|
+
if (fs.existsSync(path.join(dir, FILE))) {
|
|
232
|
+
logger_1.Logger.error(`${dir} already holds a production`);
|
|
233
|
+
process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
if (!cinema_production_1.FORMATS.includes(o.format) || !cinema_production_1.ASPECTS.includes(o.aspect)) {
|
|
236
|
+
logger_1.Logger.error(`format must be one of ${cinema_production_1.FORMATS.join(", ")} and aspect one of ${cinema_production_1.ASPECTS.join(", ")}`);
|
|
237
|
+
process.exit(1);
|
|
238
|
+
}
|
|
239
|
+
const brief = {
|
|
240
|
+
brief: o.brief,
|
|
241
|
+
format: o.format,
|
|
242
|
+
aspect: o.aspect,
|
|
243
|
+
durationSeconds: Math.min(60, Math.max(30, Number(o.duration) || 45)),
|
|
244
|
+
shots: Math.min(12, Math.max(8, Number(o.shots) || 10)),
|
|
245
|
+
language: o.language === "fr" ? "fr" : "en",
|
|
246
|
+
seed: Number(o.seed) || Math.floor(Math.random() * 2_000_000_000),
|
|
247
|
+
...(o.voice ? { voice: o.voice } : {}),
|
|
248
|
+
...(o.scriptModel ? { scriptModel: o.scriptModel } : {}),
|
|
249
|
+
...(o.voiceModel ? { voiceModel: o.voiceModel } : {}),
|
|
250
|
+
};
|
|
251
|
+
save(dir, (0, cinema_production_1.newProduction)(brief));
|
|
252
|
+
logger_1.Logger.success(`production created in ${dir} — next: sovkora cinema estimate ${dir}`);
|
|
253
|
+
});
|
|
254
|
+
const estimateCommand = new commander_1.Command("estimate")
|
|
255
|
+
.description("What the rest of the production will cost and take, before it runs")
|
|
256
|
+
.argument("<dir>", "The production's folder")
|
|
257
|
+
.action(async (dir) => {
|
|
258
|
+
(0, threads_1.requireAuth)();
|
|
259
|
+
await printEstimate(load(dir));
|
|
260
|
+
});
|
|
261
|
+
const runCommand = new commander_1.Command("run")
|
|
262
|
+
.description("Run (or resume) the production: script, references, keyframes, shots, cut, voice, sound")
|
|
263
|
+
.argument("<dir>", "The production's folder")
|
|
264
|
+
.option("-y, --yes", "Do not ask before spending")
|
|
265
|
+
.option("--max-runs <n>", "Stop after this many runs (review in between)")
|
|
266
|
+
.option("--model <name>", "The video model of the shots", "wan2.2-i2v-a14b")
|
|
267
|
+
.action(async (dir, o) => {
|
|
268
|
+
(0, threads_1.requireAuth)();
|
|
269
|
+
const production = load(dir);
|
|
270
|
+
await printEstimate(production);
|
|
271
|
+
if (!o.yes) {
|
|
272
|
+
const { confirm, isCancel } = await import("@clack/prompts");
|
|
273
|
+
const go = await confirm({ message: "Start these runs?" });
|
|
274
|
+
if (isCancel(go) || !go) {
|
|
275
|
+
logger_1.Logger.info("nothing was run");
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
try {
|
|
280
|
+
await (0, cinema_director_1.direct)(production, restPort, {
|
|
281
|
+
save: (p) => save(dir, p),
|
|
282
|
+
log: (line) => console.log(`${chalk_1.default.cyan("▸")} ${line}`),
|
|
283
|
+
maxRuns: o.maxRuns ? Number(o.maxRuns) : undefined,
|
|
284
|
+
videoModel: o.model,
|
|
285
|
+
// A character drawn by its brand (a reference render) gets its sheet uploaded as its reference, never redrawn.
|
|
286
|
+
reference: async (id) => {
|
|
287
|
+
const character = production.script?.parsed?.characters.find((c) => c.id === id);
|
|
288
|
+
if (!character?.reference)
|
|
289
|
+
throw new cinema_treatment_1.TreatmentError(`character ${id} has no reference render`);
|
|
290
|
+
const file = (0, exports.sheetFile)(dir, id);
|
|
291
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
292
|
+
(0, node_child_process_1.execFileSync)((0, tool_path_1.toolPath)("ffmpeg"), (0, cinema_treatment_1.sheetArgs)([character.reference], file));
|
|
293
|
+
const { assetId } = await api_client_1.ApiClient.uploadFile(file);
|
|
294
|
+
return { runId: `sheet:${id}`, studioKey: "reference-sheet", status: "SUCCEEDED", output: assetId, assetId };
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
logger_1.Logger.error(error instanceof Error ? error.message : String(error));
|
|
300
|
+
process.exit(1);
|
|
301
|
+
}
|
|
302
|
+
const next = (0, cinema_production_1.nextStep)(load(dir));
|
|
303
|
+
logger_1.Logger.info(next.kind === "done" ? `the film: ${load(dir).sound?.output}` : `next: ${next.kind}`);
|
|
304
|
+
});
|
|
305
|
+
const fetchCommand = new commander_1.Command("fetch")
|
|
306
|
+
.description("Download the references, keyframes, shots and the film into the production's folder")
|
|
307
|
+
.argument("<dir>", "The production's folder")
|
|
308
|
+
.action(async (dir) => {
|
|
309
|
+
(0, threads_1.requireAuth)();
|
|
310
|
+
const production = load(dir);
|
|
311
|
+
const wanted = [
|
|
312
|
+
...Object.entries(production.characters).map(([id, r]) => [
|
|
313
|
+
r.output,
|
|
314
|
+
`characters/${id}.png`,
|
|
315
|
+
]),
|
|
316
|
+
...production.shots.flatMap((s) => [
|
|
317
|
+
[s.keyframe?.output, `keyframes/shot-${String(s.id).padStart(2, "0")}.png`],
|
|
318
|
+
[s.video?.output, `shots/shot-${String(s.id).padStart(2, "0")}.mp4`],
|
|
319
|
+
]),
|
|
320
|
+
[production.cut?.output, "cut.mp4"],
|
|
321
|
+
[production.voice?.output, "voice.wav"],
|
|
322
|
+
[production.sound?.output, "film.mp4"],
|
|
323
|
+
];
|
|
324
|
+
for (const [output, name] of wanted) {
|
|
325
|
+
if (!output)
|
|
326
|
+
continue;
|
|
327
|
+
const bytes = await api_client_1.ApiClient.downloadTo(output, path.join(dir, name));
|
|
328
|
+
console.log(`${name.padEnd(28)} ${(bytes / 1024).toFixed(0)} kB`);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
const reshootCommand = new commander_1.Command("reshoot")
|
|
332
|
+
.description("Make shots again (a new seed): their video, then the cut and the sound")
|
|
333
|
+
.argument("<dir>", "The production's folder")
|
|
334
|
+
.argument("<shots>", "Shot numbers, comma-separated")
|
|
335
|
+
.option("--new-keyframe", "Make the keyframe again too")
|
|
336
|
+
.action((dir, shots, o) => {
|
|
337
|
+
const ids = shots
|
|
338
|
+
.split(",")
|
|
339
|
+
.map((s) => Number(s.trim()))
|
|
340
|
+
.filter(Number.isInteger);
|
|
341
|
+
save(dir, (0, cinema_production_1.markReshoot)(load(dir), ids, Boolean(o.newKeyframe)));
|
|
342
|
+
logger_1.Logger.success(`shots ${ids.join(", ")} will be made again — sovkora cinema run ${dir}`);
|
|
343
|
+
});
|
|
344
|
+
const statusCommand = new commander_1.Command("status")
|
|
345
|
+
.description("Where the production is")
|
|
346
|
+
.argument("<dir>", "The production's folder")
|
|
347
|
+
.action((dir) => {
|
|
348
|
+
const p = load(dir);
|
|
349
|
+
const mark = (status) => {
|
|
350
|
+
if (status === "SUCCEEDED")
|
|
351
|
+
return chalk_1.default.green("●");
|
|
352
|
+
return status ? chalk_1.default.red("●") : chalk_1.default.gray("○");
|
|
353
|
+
};
|
|
354
|
+
console.log(`${chalk_1.default.bold(p.script?.parsed?.title ?? "(no script yet)")} — ${p.brief.format}, ${p.brief.aspect}`);
|
|
355
|
+
console.log(`${mark(p.script?.status)} script`);
|
|
356
|
+
for (const [id, r] of Object.entries(p.characters))
|
|
357
|
+
console.log(`${mark(r.status)} character ${id}`);
|
|
358
|
+
for (const s of p.shots) {
|
|
359
|
+
console.log(`${mark(s.keyframe?.status)}${mark(s.video?.status)} shot ${s.id}${s.review === "reshoot" ? chalk_1.default.yellow(" (reshoot)") : ""}`);
|
|
360
|
+
}
|
|
361
|
+
console.log(`${mark(p.cut?.status)} cut ${mark(p.voice?.status)} voice ${mark(p.sound?.status)} sound`);
|
|
362
|
+
console.log(chalk_1.default.gray(`next: ${(0, cinema_production_1.nextStep)(p).kind} · ${p.history.length} run(s) so far`));
|
|
363
|
+
});
|
|
364
|
+
/** The render a character's `reference` names: a file as given, or `<name>-alpha.png` / `<name>.png` in the renders folder. */
|
|
365
|
+
function resolveReference(reference, renders) {
|
|
366
|
+
const candidates = [
|
|
367
|
+
reference,
|
|
368
|
+
...(renders ? [path.join(renders, `${reference}-alpha.png`), path.join(renders, `${reference}.png`)] : []),
|
|
369
|
+
];
|
|
370
|
+
const found = candidates.find((c) => fs.existsSync(c));
|
|
371
|
+
if (!found)
|
|
372
|
+
throw new cinema_treatment_1.TreatmentError(`no render for reference '${reference}' (looked for ${candidates.join(", ")})`);
|
|
373
|
+
return path.resolve(found);
|
|
374
|
+
}
|
|
375
|
+
const planCommand = new commander_1.Command("plan")
|
|
376
|
+
.description("Start a production from a treatment (a directed shot list): no language model, every shot as written")
|
|
377
|
+
.argument("<dir>", "The production's folder")
|
|
378
|
+
.requiredOption("-t, --treatment <file>", "The treatment (JSON): cast, shots, lens, camera, light, model per shot")
|
|
379
|
+
.option("-r, --references <dir>", "Where the characters' reference renders are (<name>-alpha.png)")
|
|
380
|
+
.option("-l, --language <lang>", "en or fr (the captions)", "en")
|
|
381
|
+
.option("--seed <seed>", "Overrides the treatment's seedBase")
|
|
382
|
+
.option("--update", "The treatment changed: keep every shot already made, add the new ones")
|
|
383
|
+
.action((dir, o) => {
|
|
384
|
+
const exists = fs.existsSync(path.join(dir, FILE));
|
|
385
|
+
if (exists !== Boolean(o.update)) {
|
|
386
|
+
logger_1.Logger.error(exists
|
|
387
|
+
? `${dir} already holds a production (--update to apply a changed treatment)`
|
|
388
|
+
: `${dir} holds no production to update`);
|
|
389
|
+
process.exit(1);
|
|
390
|
+
}
|
|
391
|
+
try {
|
|
392
|
+
const raw = JSON.parse(fs.readFileSync(o.treatment, "utf-8"));
|
|
393
|
+
const characters = Array.isArray(raw.characters) ? raw.characters : [];
|
|
394
|
+
raw.characters = characters.map((c) => typeof c.reference === "string" && c.reference
|
|
395
|
+
? { ...c, reference: resolveReference(c.reference, o.references) }
|
|
396
|
+
: c);
|
|
397
|
+
const options = {
|
|
398
|
+
language: (o.language === "fr" ? "fr" : "en"),
|
|
399
|
+
...(o.seed ? { seed: Number(o.seed) } : {}),
|
|
400
|
+
};
|
|
401
|
+
const production = o.update ? (0, cinema_treatment_1.replan)(load(dir), raw, options) : (0, cinema_treatment_1.planProduction)(raw, options);
|
|
402
|
+
save(dir, production);
|
|
403
|
+
const script = production.script?.parsed;
|
|
404
|
+
logger_1.Logger.success(`${script?.title}: ${script?.shots.length} shots planned in ${dir} — next: sovkora cinema sheet ${dir}`);
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
logger_1.Logger.error(error instanceof Error ? error.message : String(error));
|
|
408
|
+
process.exit(1);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
const sheetCommand = new commander_1.Command("sheet")
|
|
412
|
+
.description("Make the reference sheet of each character that has a reference render (kept as drawn, never redrawn)")
|
|
413
|
+
.argument("<dir>", "The production's folder")
|
|
414
|
+
.action((dir) => {
|
|
415
|
+
const production = load(dir);
|
|
416
|
+
const out = path.join(dir, "sheets");
|
|
417
|
+
fs.mkdirSync(out, { recursive: true });
|
|
418
|
+
for (const character of production.script?.parsed?.characters ?? []) {
|
|
419
|
+
if (!character.reference)
|
|
420
|
+
continue;
|
|
421
|
+
const file = (0, exports.sheetFile)(dir, character.id);
|
|
422
|
+
(0, node_child_process_1.execFileSync)((0, tool_path_1.toolPath)("ffmpeg"), (0, cinema_treatment_1.sheetArgs)([character.reference], file));
|
|
423
|
+
production.characters[character.id] = {
|
|
424
|
+
runId: `sheet:${character.id}`,
|
|
425
|
+
studioKey: "reference-sheet",
|
|
426
|
+
status: "SUCCEEDED",
|
|
427
|
+
output: file,
|
|
428
|
+
};
|
|
429
|
+
console.log(`${character.id.padEnd(12)} ${file}`);
|
|
430
|
+
}
|
|
431
|
+
save(dir, production);
|
|
432
|
+
});
|
|
433
|
+
const jobsCommand = new commander_1.Command("jobs")
|
|
434
|
+
.description("The pending shots as jobs for a GPU host that runs the worker's own generator")
|
|
435
|
+
.argument("<dir>", "The production's folder")
|
|
436
|
+
.option("-o, --out <file>", "Write them to a file instead of printing them")
|
|
437
|
+
.action((dir, o) => {
|
|
438
|
+
const jobs = (0, cinema_treatment_1.podJobs)(load(dir));
|
|
439
|
+
const body = `${JSON.stringify(jobs, null, 2)}\n`;
|
|
440
|
+
if (o.out) {
|
|
441
|
+
fs.writeFileSync(o.out, body);
|
|
442
|
+
logger_1.Logger.success(`${jobs.length} job(s) in ${o.out}`);
|
|
443
|
+
}
|
|
444
|
+
else
|
|
445
|
+
process.stdout.write(body);
|
|
446
|
+
});
|
|
447
|
+
const takeCommand = new commander_1.Command("take")
|
|
448
|
+
.description("Record a take a GPU host made for a shot")
|
|
449
|
+
.argument("<dir>", "The production's folder")
|
|
450
|
+
.argument("<shot>", "The shot's number")
|
|
451
|
+
.argument("<file>", "The take (mp4)")
|
|
452
|
+
.option("--seconds <s>", "How long the host took to make it")
|
|
453
|
+
.action((dir, shot, file, o) => {
|
|
454
|
+
save(dir, (0, cinema_treatment_1.recordTake)(load(dir), Number(shot), path.resolve(file), o.seconds ? Number(o.seconds) : undefined));
|
|
455
|
+
logger_1.Logger.success(`shot ${shot}: take recorded`);
|
|
456
|
+
});
|
|
457
|
+
const reviewCommand = new commander_1.Command("review")
|
|
458
|
+
.description("A take's review sheet: a frame every 8 under the cast's reference sheet")
|
|
459
|
+
.argument("<dir>", "The production's folder")
|
|
460
|
+
.argument("<shot>", "The shot's number")
|
|
461
|
+
.argument("<file>", "The take (mp4)")
|
|
462
|
+
.action((dir, shot, file) => {
|
|
463
|
+
const production = load(dir);
|
|
464
|
+
const script = production.script?.parsed;
|
|
465
|
+
const planned = script?.shots.find((s) => s.id === Number(shot));
|
|
466
|
+
if (!script || !planned) {
|
|
467
|
+
logger_1.Logger.error(`shot ${shot} is not in this production`);
|
|
468
|
+
process.exit(1);
|
|
469
|
+
}
|
|
470
|
+
const out = path.join(dir, "review");
|
|
471
|
+
fs.mkdirSync(out, { recursive: true });
|
|
472
|
+
const renders = planned.characters
|
|
473
|
+
.map((id) => script.characters.find((c) => c.id === id)?.reference)
|
|
474
|
+
.filter((r) => Boolean(r))
|
|
475
|
+
.slice(0, 5);
|
|
476
|
+
const cast = path.join(out, `${path.basename(file, path.extname(file))}-cast.png`);
|
|
477
|
+
// A shot without a cast (a landscape) is compared with its own first frame.
|
|
478
|
+
if (renders.length > 0)
|
|
479
|
+
(0, node_child_process_1.execFileSync)((0, tool_path_1.toolPath)("ffmpeg"), (0, cinema_treatment_1.sheetArgs)(renders, cast));
|
|
480
|
+
else
|
|
481
|
+
(0, node_child_process_1.execFileSync)((0, tool_path_1.toolPath)("ffmpeg"), (0, cinema_treatment_1.firstFrameArgs)(file, cast));
|
|
482
|
+
const sheet = path.join(out, `${path.basename(file, path.extname(file))}.jpg`);
|
|
483
|
+
(0, node_child_process_1.execFileSync)((0, tool_path_1.toolPath)("ffmpeg"), (0, cinema_treatment_1.reviewArgs)(file, cast, sheet));
|
|
484
|
+
logger_1.Logger.success(`review sheet: ${sheet}`);
|
|
485
|
+
});
|
|
486
|
+
const treatCommand = new commander_1.Command("treat")
|
|
487
|
+
.description("Write the story of a brief (arc, intentions, purposeful shots, directed lines, music cues, sound list) and judge it")
|
|
488
|
+
.argument("<dir>", "Where the treatment and its critique are written")
|
|
489
|
+
.requiredOption("-b, --brief <text>", "The short brief (a sentence or two is enough)")
|
|
490
|
+
.option("-l, --language <lang>", "en or fr", "en")
|
|
491
|
+
.option("-d, --duration <s>", "Seconds of film", "60")
|
|
492
|
+
.option("-a, --aspect <aspect>", "16:9 or 9:16", "16:9")
|
|
493
|
+
.option("--revisions <n>", "How many times a rejected draft goes back to the writer", "2")
|
|
494
|
+
.option("--no-judge", "The rubric alone decides (no language-model judge)")
|
|
495
|
+
.option("--model <name>", "The chat model of the writer and the judge")
|
|
496
|
+
.action(async (dir, o) => {
|
|
497
|
+
(0, threads_1.requireAuth)();
|
|
498
|
+
try {
|
|
499
|
+
const draft = await (0, cinema_director_1.writeTreatment)(restPort, {
|
|
500
|
+
brief: o.brief,
|
|
501
|
+
language: o.language === "fr" ? "fr" : "en",
|
|
502
|
+
durationSeconds: Number(o.duration),
|
|
503
|
+
aspect: o.aspect,
|
|
504
|
+
revisions: Number(o.revisions),
|
|
505
|
+
noJudge: !o.judge,
|
|
506
|
+
model: o.model,
|
|
507
|
+
log: (line) => console.log(`${chalk_1.default.cyan("▸")} ${line}`),
|
|
508
|
+
});
|
|
509
|
+
const written = (0, cinema_treatment_1.writeTreatmentFiles)(dir, draft);
|
|
510
|
+
if (draft.verdict.pass)
|
|
511
|
+
logger_1.Logger.success(`accepted: ${written.treatment} — next: sovkora cinema plan <prod> --treatment it`);
|
|
512
|
+
else {
|
|
513
|
+
logger_1.Logger.warn(`not accepted after the revisions — read ${written.critique}, edit the treatment, then: sovkora cinema critique`);
|
|
514
|
+
process.exitCode = 2;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
catch (error) {
|
|
518
|
+
logger_1.Logger.error(error instanceof Error ? error.message : String(error));
|
|
519
|
+
process.exit(1);
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
/** Print critique scores to console. */
|
|
523
|
+
async function critiqueTreatment(file, o) {
|
|
524
|
+
const story = (0, cinema_story_1.parseStory)(JSON.parse(fs.readFileSync(file, "utf-8")));
|
|
525
|
+
const rubric = (0, cinema_story_1.critiqueStory)(story, o.language);
|
|
526
|
+
let judge;
|
|
527
|
+
if (o.judge) {
|
|
528
|
+
(0, threads_1.requireAuth)();
|
|
529
|
+
const run = await restPort.run("cinematic-critique", {
|
|
530
|
+
treatment: (0, cinema_story_1.judgePrompt)(story, o.language),
|
|
531
|
+
...(o.model ? { model: o.model } : {}),
|
|
532
|
+
});
|
|
533
|
+
judge = (0, cinema_story_1.parseJudge)(run.outputs[0]?.value ?? "", story.shots.length);
|
|
534
|
+
}
|
|
535
|
+
const decided = (0, cinema_story_1.verdict)(rubric, judge);
|
|
536
|
+
for (const [k, v] of Object.entries(rubric.scores))
|
|
537
|
+
console.log(`${k.padEnd(11)} ${v >= 0.85 ? chalk_1.default.green(v.toFixed(2)) : chalk_1.default.red(v.toFixed(2))}`);
|
|
538
|
+
if (judge)
|
|
539
|
+
for (const [k, v] of Object.entries(judge.scores))
|
|
540
|
+
console.log(`judge ${k.padEnd(11)} ${v}/5`);
|
|
541
|
+
for (const r of decided.reasons)
|
|
542
|
+
console.log(chalk_1.default.yellow(` ${r}`));
|
|
543
|
+
if (o.out)
|
|
544
|
+
fs.writeFileSync(o.out, `${JSON.stringify({ rubric, judge, verdict: decided }, null, 1)}\n`);
|
|
545
|
+
if (decided.pass)
|
|
546
|
+
logger_1.Logger.success("the story passes");
|
|
547
|
+
else
|
|
548
|
+
process.exitCode = 2;
|
|
549
|
+
}
|
|
550
|
+
const critiqueCommand = new commander_1.Command("critique")
|
|
551
|
+
.description("Judge a treatment against the rubric (arc, purpose, alive, on-topic, continuity, voice, music, sound)")
|
|
552
|
+
.argument("<treatment>", "The treatment (JSON)")
|
|
553
|
+
.option("-l, --language <lang>", "en or fr", "en")
|
|
554
|
+
.option("--judge", "Also ask the language-model judge (a cinematic-critique run)")
|
|
555
|
+
.option("--model <name>", "The judge's chat model")
|
|
556
|
+
.option("-o, --out <file>", "Write the critique (JSON) there")
|
|
557
|
+
.action(async (file, o) => {
|
|
558
|
+
try {
|
|
559
|
+
await critiqueTreatment(file, o);
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
logger_1.Logger.error(error instanceof cinema_story_1.StoryError || error instanceof Error ? error.message : String(error));
|
|
563
|
+
process.exit(1);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
const timelineCommand = new commander_1.Command("timeline")
|
|
567
|
+
.description("Place every line, music cue and sound of a treatment on the cut, and say which lines do not fit their shots")
|
|
568
|
+
.argument("<treatment>", "The treatment (JSON)")
|
|
569
|
+
.option("-l, --language <lang>", "en or fr", "en")
|
|
570
|
+
.option("--voice <report>", "The voice step's report: [{id, seconds}] measured per line")
|
|
571
|
+
.option("--spans <file>", "The cut's own shot spans ([[start, end], …], e.g. the worker's cut.timeline) instead of back to back")
|
|
572
|
+
.action((file, o) => {
|
|
573
|
+
const story = (0, cinema_story_1.parseStory)(JSON.parse(fs.readFileSync(file, "utf-8")));
|
|
574
|
+
const measured = {};
|
|
575
|
+
if (o.voice)
|
|
576
|
+
for (const r of JSON.parse(fs.readFileSync(o.voice, "utf-8"))) {
|
|
577
|
+
if (!r.language || r.language === o.language)
|
|
578
|
+
measured[r.id] = r.seconds;
|
|
579
|
+
}
|
|
580
|
+
const spans = o.spans ? JSON.parse(fs.readFileSync(o.spans, "utf-8")) : undefined;
|
|
581
|
+
const placed = (0, cinema_story_1.timeline)(story, o.language, measured, spans);
|
|
582
|
+
process.stdout.write(`${JSON.stringify(placed, null, 1)}\n`);
|
|
583
|
+
if (placed.lines.some((l) => !l.fits))
|
|
584
|
+
process.exitCode = 2;
|
|
585
|
+
});
|
|
586
|
+
const stageCommand = new commander_1.Command("stage")
|
|
587
|
+
.description("Check a v3 treatment's staging, camera and cut, and write the questions every keyframe and take must answer")
|
|
588
|
+
.argument("<treatment>", "The treatment (JSON, with score.bpm, beats, camera, angle, light and staging per shot)")
|
|
589
|
+
.option("-o, --out <file>", "Write the frame questions (JSON: per shot, then the take questions) there")
|
|
590
|
+
.action((file, o) => {
|
|
591
|
+
try {
|
|
592
|
+
const raw = JSON.parse(fs.readFileSync(file, "utf-8"));
|
|
593
|
+
const film = (0, cinema_staging_1.parseStaging)(raw);
|
|
594
|
+
const cut = (0, cinema_staging_1.critiqueCut)(film);
|
|
595
|
+
for (const f of cut.findings)
|
|
596
|
+
console.log(chalk_1.default.yellow(` ${f.rule}${f.shot ? " (shot " + f.shot + ")" : ""}: ${f.message}`));
|
|
597
|
+
const described = Object.fromEntries((raw.characters ?? []).map((c) => [
|
|
598
|
+
c.id,
|
|
599
|
+
`the ${c.description.split(",")[0]}`,
|
|
600
|
+
]));
|
|
601
|
+
const questions = {
|
|
602
|
+
shots: film.shots.map((s) => ({
|
|
603
|
+
id: s.id,
|
|
604
|
+
slug: s.slug,
|
|
605
|
+
camera: s.camera,
|
|
606
|
+
staging: s.staging,
|
|
607
|
+
questions: (0, cinema_staging_1.questionsFor)(s, described),
|
|
608
|
+
})),
|
|
609
|
+
take: {
|
|
610
|
+
sliding: cinema_staging_1.FRAME_QUESTIONS.sliding,
|
|
611
|
+
onModel: cinema_staging_1.FRAME_QUESTIONS.onModel,
|
|
612
|
+
continuity: cinema_staging_1.FRAME_QUESTIONS.continuity,
|
|
613
|
+
},
|
|
614
|
+
};
|
|
615
|
+
if (o.out)
|
|
616
|
+
fs.writeFileSync(o.out, `${JSON.stringify(questions, null, 1)}\n`);
|
|
617
|
+
if (cut.pass)
|
|
618
|
+
logger_1.Logger.success(`the cut passes: ${film.shots.length} shots at ${film.bpm} BPM`);
|
|
619
|
+
else
|
|
620
|
+
process.exitCode = 2;
|
|
621
|
+
}
|
|
622
|
+
catch (error) {
|
|
623
|
+
logger_1.Logger.error(error instanceof cinema_staging_1.StagingError || error instanceof Error ? error.message : String(error));
|
|
624
|
+
process.exit(1);
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
exports.cinemaCommand = new commander_1.Command("cinema")
|
|
628
|
+
.description("A cinematic short (30–60 s) from a brief: script, keyframes, shots, cut, sound — each an ordinary Studio run")
|
|
629
|
+
.addCommand(newCommand)
|
|
630
|
+
.addCommand(estimateCommand)
|
|
631
|
+
.addCommand(runCommand)
|
|
632
|
+
.addCommand(fetchCommand)
|
|
633
|
+
.addCommand(reshootCommand)
|
|
634
|
+
.addCommand(statusCommand)
|
|
635
|
+
.addCommand(planCommand)
|
|
636
|
+
.addCommand(sheetCommand)
|
|
637
|
+
.addCommand(jobsCommand)
|
|
638
|
+
.addCommand(takeCommand)
|
|
639
|
+
.addCommand(reviewCommand)
|
|
640
|
+
.addCommand(treatCommand)
|
|
641
|
+
.addCommand(critiqueCommand)
|
|
642
|
+
.addCommand(timelineCommand)
|
|
643
|
+
.addCommand(stageCommand);
|