@sundownreel/mcp 0.0.0-stage → 0.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/README.md +65 -2
- package/brand.json +29 -0
- package/chunks/chunk-ONI7QK5B.mjs +63 -0
- package/chunks/chunk-YUE6XWVB.mjs +2 -0
- package/dsl/index.mjs +2 -0
- package/dsl/semantic.mjs +5 -0
- package/dsl/types.ts +240 -0
- package/engine/fonts/ArchivoBlack.ttf +0 -0
- package/engine/fonts/Caveat-Bold.ttf +0 -0
- package/engine-geo/data-manifest.json +460 -0
- package/engine-remotion/public/music/README.md +6 -0
- package/engine-remotion/public/music/bed-curious.mp3 +0 -0
- package/engine-remotion/public/music/bed-explainer.mp3 +0 -0
- package/engine-remotion/public/music/bed-reflective.mp3 +0 -0
- package/engine-remotion/public/music/bed-tense.mp3 +0 -0
- package/engine-remotion/public/music/bed-upbeat.mp3 +0 -0
- package/engine-remotion/public/music/music-index.json +52 -0
- package/engine-remotion/public/sfx/README.md +6 -0
- package/engine-remotion/public/sfx/alarm-buzz.mp3 +0 -0
- package/engine-remotion/public/sfx/beep-happy.mp3 +0 -0
- package/engine-remotion/public/sfx/boing-small.mp3 +0 -0
- package/engine-remotion/public/sfx/cash-register.mp3 +0 -0
- package/engine-remotion/public/sfx/chart-draw.mp3 +0 -0
- package/engine-remotion/public/sfx/click-key.mp3 +0 -0
- package/engine-remotion/public/sfx/click-sharp.mp3 +0 -0
- package/engine-remotion/public/sfx/click-switch.mp3 +0 -0
- package/engine-remotion/public/sfx/cloth-swish.mp3 +0 -0
- package/engine-remotion/public/sfx/counter-tick.mp3 +0 -0
- package/engine-remotion/public/sfx/ding.mp3 +0 -0
- package/engine-remotion/public/sfx/error-beep.mp3 +0 -0
- package/engine-remotion/public/sfx/glass-ping.mp3 +0 -0
- package/engine-remotion/public/sfx/glass-tick.mp3 +0 -0
- package/engine-remotion/public/sfx/impact-light.mp3 +0 -0
- package/engine-remotion/public/sfx/impact-punch.mp3 +0 -0
- package/engine-remotion/public/sfx/impact-soft.mp3 +0 -0
- package/engine-remotion/public/sfx/impact-thud.mp3 +0 -0
- package/engine-remotion/public/sfx/impact-tin.mp3 +0 -0
- package/engine-remotion/public/sfx/impact-wood.mp3 +0 -0
- package/engine-remotion/public/sfx/office-ambience-1.mp3 +0 -0
- package/engine-remotion/public/sfx/paper-feed.mp3 +0 -0
- package/engine-remotion/public/sfx/paper-rustle.mp3 +0 -0
- package/engine-remotion/public/sfx/paper-slide.mp3 +0 -0
- package/engine-remotion/public/sfx/paper-tear.mp3 +0 -0
- package/engine-remotion/public/sfx/pencil-scratch.mp3 +0 -0
- package/engine-remotion/public/sfx/pop-drop.mp3 +0 -0
- package/engine-remotion/public/sfx/pop-pluck.mp3 +0 -0
- package/engine-remotion/public/sfx/pop.mp3 +0 -0
- package/engine-remotion/public/sfx/printer-chatter.mp3 +0 -0
- package/engine-remotion/public/sfx/receipt-tick.mp3 +0 -0
- package/engine-remotion/public/sfx/room-tone.mp3 +0 -0
- package/engine-remotion/public/sfx/sfx-index.json +322 -0
- package/engine-remotion/public/sfx/slide-whoosh.mp3 +0 -0
- package/engine-remotion/public/sfx/stamp-thud.mp3 +0 -0
- package/engine-remotion/public/sfx/stinger-8bit.mp3 +0 -0
- package/engine-remotion/public/sfx/stinger-hit.mp3 +0 -0
- package/engine-remotion/public/sfx/stinger-pizzi.mp3 +0 -0
- package/engine-remotion/public/sfx/stinger-sax.mp3 +0 -0
- package/engine-remotion/public/sfx/stinger-steel.mp3 +0 -0
- package/engine-remotion/public/sfx/sweat-drop.mp3 +0 -0
- package/engine-remotion/public/sfx/swipe.mp3 +0 -0
- package/engine-remotion/public/sfx/tick-crisp.mp3 +0 -0
- package/engine-remotion/public/sfx/tick-soft.mp3 +0 -0
- package/engine-remotion/public/sfx/type-click.mp3 +0 -0
- package/engine-remotion/public/sfx/typewriter-soft.mp3 +0 -0
- package/engine-remotion/public/sfx/ui-confirm.mp3 +0 -0
- package/engine-remotion/public/sfx/wheel-roll.mp3 +0 -0
- package/engine-remotion/public/sfx/whoosh-rise.mp3 +0 -0
- package/engine-remotion/public/sfx/whoosh-ui-rise.mp3 +0 -0
- package/engine-remotion/public/sfx/whoosh.mp3 +0 -0
- package/library/music/bed.wav +0 -0
- package/library/sfx/thud.wav +0 -0
- package/library/sfx/tick.wav +0 -0
- package/library/sfx/whoosh.wav +0 -0
- package/package.json +38 -4
- package/pipeline/scripts/master_audio.sh +12 -0
- package/prompts/engine-engineer.md +26 -0
- package/prompts/fact-checker.md +22 -0
- package/prompts/idea-scout.md +21 -0
- package/prompts/library-artist.md +15 -0
- package/prompts/qa.md +20 -0
- package/prompts/researcher.md +22 -0
- package/prompts/shot-dsl-writer.md +63 -0
- package/prompts/style-shot-writer.md +46 -0
- package/registry/styles.mjs +89 -0
- package/render/fonts/Anton-Regular.ttf +0 -0
- package/render/fonts/ArchivoBlack.ttf +0 -0
- package/render/fonts/Caveat-Bold.ttf +0 -0
- package/render/fonts/Caveat.ttf +0 -0
- package/render/fonts/Cinzel-Black.ttf +0 -0
- package/render/fonts/Cinzel-SemiBold.ttf +0 -0
- package/render/fonts/CormorantGaramond-MediumItalic.ttf +0 -0
- package/render/fonts/CourierPrime-Regular.ttf +0 -0
- package/render/fonts/IBMPlexMono-SemiBold.ttf +0 -0
- package/render/fonts/IBMPlexSerif-SemiBold.ttf +0 -0
- package/render/fonts/Kalam-Bold.ttf +0 -0
- package/render/fonts/KaushanScript-Regular.ttf +0 -0
- package/render/fonts/LibreBaskerville-Bold.ttf +0 -0
- package/render/fonts/LibreBaskerville-Italic.ttf +0 -0
- package/render/fonts/PlayfairDisplay-Bold.ttf +0 -0
- package/render/fonts/PlayfairDisplay-Regular.ttf +0 -0
- package/render/fonts/README.md +15 -0
- package/render/fonts/ZillaSlab-Bold-Lining.ttf +0 -0
- package/render/fonts/licenses/Anton-OFL.txt +93 -0
- package/render/fonts/licenses/ArchivoBlack-OFL.txt +93 -0
- package/render/fonts/licenses/Caveat-OFL.txt +93 -0
- package/render/fonts/licenses/Cinzel-OFL.txt +93 -0
- package/render/fonts/licenses/CormorantGaramond-OFL.txt +93 -0
- package/render/fonts/licenses/CourierPrime-OFL.txt +93 -0
- package/render/fonts/licenses/IBMPlexMono-OFL.txt +93 -0
- package/render/fonts/licenses/IBMPlexSerif-OFL.txt +93 -0
- package/render/fonts/licenses/Kalam-OFL.txt +93 -0
- package/render/fonts/licenses/KaushanScript-OFL.txt +95 -0
- package/render/fonts/licenses/LibreBaskerville-OFL.txt +93 -0
- package/render/fonts/licenses/PlayfairDisplay-OFL.txt +93 -0
- package/render/fonts/licenses/ZillaSlab-OFL.txt +93 -0
- package/render/render.mjs +59539 -0
- package/render3d/data/footprints/README.md +27 -0
- package/render3d/data/footprints/test-district.geojson +1 -0
- package/render3d/fonts/ArchivoBlack.ttf +0 -0
- package/render3d/fonts/IBMPlexMono-400.ttf +0 -0
- package/render3d/fonts/IBMPlexMono-600.ttf +0 -0
- package/render3d/fonts/Inter-400.ttf +0 -0
- package/render3d/fonts/Inter-600.ttf +0 -0
- package/render3d/fonts/Inter-800.ttf +0 -0
- package/render3d/fonts/licenses/ArchivoBlack-OFL.txt +93 -0
- package/render3d/fonts/licenses/BlockfolkCaps-OFL.txt +96 -0
- package/render3d/fonts/licenses/IBMPlexMono-OFL.txt +93 -0
- package/render3d/fonts/licenses/Inter-OFL.txt +93 -0
- package/render3d/render.mjs +41191 -0
- package/render3d/runtime.js +4532 -0
- package/rendergeo/fonts/Anton-Regular.ttf +0 -0
- package/rendergeo/fonts/ArchivoBlack.ttf +0 -0
- package/rendergeo/fonts/BarlowCondensed-Bold.ttf +0 -0
- package/rendergeo/fonts/BarlowCondensed-SemiBold.ttf +0 -0
- package/rendergeo/fonts/Caveat-Bold.ttf +0 -0
- package/rendergeo/fonts/Caveat.ttf +0 -0
- package/rendergeo/fonts/Cinzel-Black.ttf +0 -0
- package/rendergeo/fonts/Cinzel-SemiBold.ttf +0 -0
- package/rendergeo/fonts/CormorantGaramond-Medium.ttf +0 -0
- package/rendergeo/fonts/CormorantGaramond-MediumItalic.ttf +0 -0
- package/rendergeo/fonts/CormorantGaramond-SemiBold.ttf +0 -0
- package/rendergeo/fonts/CourierPrime-Regular.ttf +0 -0
- package/rendergeo/fonts/IBMPlexMono-Medium.ttf +0 -0
- package/rendergeo/fonts/IBMPlexMono-Regular.ttf +0 -0
- package/rendergeo/fonts/IBMPlexMono-SemiBold.ttf +0 -0
- package/rendergeo/fonts/IBMPlexSansCondensed-Medium.ttf +0 -0
- package/rendergeo/fonts/IBMPlexSansCondensed-SemiBold.ttf +0 -0
- package/rendergeo/fonts/IBMPlexSerif-SemiBold.ttf +0 -0
- package/rendergeo/fonts/Kalam-Bold.ttf +0 -0
- package/rendergeo/fonts/KaushanScript-Regular.ttf +0 -0
- package/rendergeo/fonts/LibreBaskerville-Bold.ttf +0 -0
- package/rendergeo/fonts/LibreBaskerville-Italic.ttf +0 -0
- package/rendergeo/fonts/OldStandard-Bold.ttf +0 -0
- package/rendergeo/fonts/OldStandard-Italic.ttf +0 -0
- package/rendergeo/fonts/OldStandard-Regular.ttf +0 -0
- package/rendergeo/fonts/PlayfairDisplay-Bold.ttf +0 -0
- package/rendergeo/fonts/PlayfairDisplay-Regular.ttf +0 -0
- package/rendergeo/fonts/ZillaSlab-Bold-Lining.ttf +0 -0
- package/rendergeo/render-geo.mjs +45063 -0
- package/server.js +293 -0
- package/studio-cli/bin/sundownreel-gate.mjs +205 -0
- package/studio-cli/src/gate.mjs +704 -0
- package/styles/README.md +32 -0
- package/styles/broadsheet/STYLE.md +5 -0
- package/styles/broadsheet/style.json +11 -0
- package/styles/cartoon/STYLE.md +37 -0
- package/styles/cartoon/style.json +12 -0
- package/styles/chalkline/STYLE.md +30 -0
- package/styles/chalkline/style.json +11 -0
- package/thumbnails/dist/make.mjs +62995 -0
- package/vendor/gsap.min.js +11 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// sundownreel-gate: the human's approval CLI. Signs gate decisions with this machine's Ed25519 key.
|
|
3
|
+
// sundownreel-gate approve|send-back|reject <videoDir> --gate N [--note "..."] [--skip-earlier]
|
|
4
|
+
// sundownreel-gate status <videoDir>
|
|
5
|
+
// sundownreel-gate key
|
|
6
|
+
// Decisions need a real terminal (stdin and stdout are TTYs) and a typed confirmation (the episode id).
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { createInterface } from "node:readline/promises";
|
|
9
|
+
import {
|
|
10
|
+
assertKeyDirSafe,
|
|
11
|
+
commitDecision,
|
|
12
|
+
gateStatus,
|
|
13
|
+
keyPaths,
|
|
14
|
+
loadOrCreateSigningKey,
|
|
15
|
+
loadPublicKey,
|
|
16
|
+
prepareDecision,
|
|
17
|
+
VERBS,
|
|
18
|
+
} from "../src/gate.mjs";
|
|
19
|
+
|
|
20
|
+
const USAGE = `Usage:
|
|
21
|
+
sundownreel-gate approve <videoDir> --gate N [--note "..."] [--skip-earlier]
|
|
22
|
+
sundownreel-gate send-back <videoDir> --gate N --note "what to change"
|
|
23
|
+
sundownreel-gate reject <videoDir> --gate N [--note "..."]
|
|
24
|
+
sundownreel-gate status <videoDir>
|
|
25
|
+
sundownreel-gate key show (or create) this machine's approval key
|
|
26
|
+
|
|
27
|
+
Run decisions in your own terminal. They refuse to run without a TTY or from an agent's shell.`;
|
|
28
|
+
|
|
29
|
+
const DECISION_OF = { approve: "approved", "send-back": "sent_back", reject: "rejected" };
|
|
30
|
+
|
|
31
|
+
function fail(msg, code = 1) {
|
|
32
|
+
process.stderr.write(`${msg}\n`);
|
|
33
|
+
process.exit(code);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function parseArgs(argv) {
|
|
37
|
+
const [cmd, ...rest] = argv;
|
|
38
|
+
const out = { cmd, positional: [], gate: undefined, note: undefined, skipEarlier: false };
|
|
39
|
+
for (let i = 0; i < rest.length; i++) {
|
|
40
|
+
const a = rest[i];
|
|
41
|
+
if (a === "--gate" || a === "-g") out.gate = Number(rest[++i]);
|
|
42
|
+
else if (a.startsWith("--gate=")) out.gate = Number(a.slice(7));
|
|
43
|
+
else if (a === "--note" || a === "-n") out.note = rest[++i];
|
|
44
|
+
else if (a.startsWith("--note=")) out.note = a.slice(7);
|
|
45
|
+
else if (a === "--skip-earlier") out.skipEarlier = true;
|
|
46
|
+
else if (a === "-h" || a === "--help") out.cmd = "help";
|
|
47
|
+
else if (a.startsWith("-")) fail(`Unknown option ${a}\n\n${USAGE}`, 2);
|
|
48
|
+
else out.positional.push(a);
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Agents (Claude Code, other coding agents) mark their shells; a human's terminal does not. */
|
|
54
|
+
function agentShell() {
|
|
55
|
+
const markers = ["CLAUDECODE", "CLAUDE_CODE_ENTRYPOINT", "AI_AGENT"];
|
|
56
|
+
return markers.filter((k) => process.env[k]);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function requireHumanTerminal(what) {
|
|
60
|
+
const marks = agentShell();
|
|
61
|
+
if (marks.length) {
|
|
62
|
+
fail(
|
|
63
|
+
`Refused: ${what} must be typed by you in your own terminal, not run from an agent's shell (${marks.join(", ")} is set). ` +
|
|
64
|
+
"Open Terminal and run the same command there.",
|
|
65
|
+
3,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
69
|
+
fail(`Refused: ${what} needs an interactive terminal (stdin and stdout must be a TTY). Agents and scripts can't approve gates.`, 3);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function printStatus(dir) {
|
|
74
|
+
const { key, gates } = gateStatus(dir);
|
|
75
|
+
console.log(`Episode ${path.basename(dir)} (${dir})`);
|
|
76
|
+
console.log(key ? `Approval key: ${key.keyId}` : `Approval key: none on this machine (${keyPaths().publicKey})`);
|
|
77
|
+
for (const g of gates) {
|
|
78
|
+
let line = ` Gate ${g.gate} ${g.name}: ${g.state}`;
|
|
79
|
+
if (g.decidedBy) line += ` — ${g.decidedBy} at ${g.at}`;
|
|
80
|
+
if (g.detail) line += ` — ${g.detail}`;
|
|
81
|
+
console.log(line);
|
|
82
|
+
if (g.changedPins?.length) console.log(` changed since approval: ${g.changedPins.join(", ")}`);
|
|
83
|
+
if (g.staleReason) console.log(` ${g.staleReason}`);
|
|
84
|
+
if (g.skippedGates?.length) console.log(` skipped by you: Gate ${g.skippedGates.join(", ")}`);
|
|
85
|
+
if (g.note) console.log(` note: ${g.note}`);
|
|
86
|
+
for (const m of g.ignored) console.log(` ${m}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function printPlan(plan) {
|
|
91
|
+
const verb = VERBS[plan.decision];
|
|
92
|
+
console.log("");
|
|
93
|
+
console.log(`You are about to ${verb.toUpperCase()} Gate ${plan.gate} (${plan.name})`);
|
|
94
|
+
console.log(`Episode: ${plan.episode}`);
|
|
95
|
+
console.log(`Folder: ${plan.dir}`);
|
|
96
|
+
console.log("");
|
|
97
|
+
const pins = Object.entries(plan.pins);
|
|
98
|
+
if (plan.delta && plan.decision === "approved") {
|
|
99
|
+
const { changed, added, removed, unchanged, since } = plan.delta;
|
|
100
|
+
console.log(`Delta since your approval at ${since} (only what changed):`);
|
|
101
|
+
if (!changed.length && !added.length && !removed.length) console.log(" (no pinned file changed)");
|
|
102
|
+
for (const p of changed) console.log(` CHANGED ${p} sha256 ${plan.pins[p]}`);
|
|
103
|
+
for (const p of added) console.log(` NEW ${p} sha256 ${plan.pins[p]}`);
|
|
104
|
+
for (const p of removed) console.log(` REMOVED ${p}`);
|
|
105
|
+
console.log(` ${unchanged.length} other pinned file(s) unchanged.`);
|
|
106
|
+
} else {
|
|
107
|
+
console.log(`Pinned files (${pins.length}):`);
|
|
108
|
+
for (const [rel, sha] of pins) console.log(` ${rel} sha256 ${sha}`);
|
|
109
|
+
}
|
|
110
|
+
if (plan.gate === 2 && plan.facts) {
|
|
111
|
+
const f = plan.facts;
|
|
112
|
+
console.log("");
|
|
113
|
+
console.log(`Facts (${f.file ?? "none"}): ${f.total} rows; episode ${f.hypothetical ? "IS" : "is not"} flagged hypothetical`);
|
|
114
|
+
console.log(`Signed from episode.json: hypothetical=${plan.gate2Flags.hypothetical}, gateProfile=${plan.gate2Flags.gateProfile}, style=${plan.gate2Flags.style} (editing these later makes Gate 2 stale)`);
|
|
115
|
+
for (const [st, ids] of Object.entries(f.byStatus)) console.log(` ${st.padEnd(11)} ${ids.length}: ${ids.join(", ")}`);
|
|
116
|
+
console.log(` may appear on screen: ${f.eligible.join(", ") || "(none)"}`);
|
|
117
|
+
console.log(` never on screen: ${f.notEligible.join(", ") || "(none)"}`);
|
|
118
|
+
}
|
|
119
|
+
if (plan.gate === 3) {
|
|
120
|
+
console.log("");
|
|
121
|
+
console.log(`Animatic to watch: ${plan.extras.animatic ? path.join(plan.dir, plan.extras.animatic) : "(none found)"}`);
|
|
122
|
+
}
|
|
123
|
+
if (plan.gate === 4) {
|
|
124
|
+
console.log("");
|
|
125
|
+
console.log(`Final render: ${plan.extras.final ?? "(none found)"} QA: ${plan.extras.qa ?? "(none found)"}`);
|
|
126
|
+
}
|
|
127
|
+
if (plan.skipped.length) console.log(`\nYou are recording Gate ${plan.skipped.join(", ")} as SKIPPED by you.`);
|
|
128
|
+
if (plan.note) console.log(`\nNote: ${plan.note}`);
|
|
129
|
+
for (const w of plan.warnings) console.log(`Warning: ${w}`);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function decide(args) {
|
|
133
|
+
const decision = DECISION_OF[args.cmd];
|
|
134
|
+
const [videoDir] = args.positional;
|
|
135
|
+
if (!videoDir || !args.gate) fail(USAGE, 2);
|
|
136
|
+
requireHumanTerminal(`${VERBS[decision]} Gate ${args.gate}`);
|
|
137
|
+
let plan;
|
|
138
|
+
try {
|
|
139
|
+
plan = prepareDecision(videoDir, args.gate, decision, { note: args.note, skipEarlier: args.skipEarlier });
|
|
140
|
+
assertKeyDirSafe(plan.dir);
|
|
141
|
+
} catch (e) {
|
|
142
|
+
fail(e.message);
|
|
143
|
+
}
|
|
144
|
+
printPlan(plan);
|
|
145
|
+
if (decision === "approved" && plan.blockers.length) {
|
|
146
|
+
fail(`\nCan't approve:\n${plan.blockers.map((b) => ` - ${b}`).join("\n")}`);
|
|
147
|
+
}
|
|
148
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
149
|
+
try {
|
|
150
|
+
if ((decision === "sent_back" || decision === "rejected") && !plan.note) {
|
|
151
|
+
plan.note = (await rl.question("\nNote for the agent (what to change), or Enter for none: ")).trim();
|
|
152
|
+
}
|
|
153
|
+
const typed = (await rl.question(`\nType the episode id (${plan.episode}) to ${VERBS[decision]} Gate ${plan.gate}: `)).trim();
|
|
154
|
+
if (typed !== plan.episode) fail("Not confirmed. Nothing was written.");
|
|
155
|
+
} catch (e) {
|
|
156
|
+
if (e?.code === "ABORT_ERR") fail("\nInput closed before confirmation. Nothing was written.");
|
|
157
|
+
throw e;
|
|
158
|
+
} finally {
|
|
159
|
+
rl.close();
|
|
160
|
+
}
|
|
161
|
+
let key;
|
|
162
|
+
try {
|
|
163
|
+
key = loadOrCreateSigningKey({ create: true });
|
|
164
|
+
if (key.created) console.log(`Created this machine's approval key ${key.keyId} in ${keyPaths().dir} (private key 0600; it never leaves this machine).`);
|
|
165
|
+
const { file, record } = commitDecision(plan, key);
|
|
166
|
+
const shown = path.relative(process.cwd(), file);
|
|
167
|
+
console.log(`Signed (${record.key_id}) and appended to ${shown && !shown.startsWith("..") ? shown : file}: Gate ${plan.gate} ${record.decision} by ${record.decided_by} at ${record.at}.`);
|
|
168
|
+
} catch (e) {
|
|
169
|
+
fail(e.message);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function main() {
|
|
174
|
+
const args = parseArgs(process.argv.slice(2));
|
|
175
|
+
switch (args.cmd) {
|
|
176
|
+
case "approve":
|
|
177
|
+
case "send-back":
|
|
178
|
+
case "reject":
|
|
179
|
+
return decide(args);
|
|
180
|
+
case "status": {
|
|
181
|
+
const [videoDir] = args.positional;
|
|
182
|
+
if (!videoDir) fail(USAGE, 2);
|
|
183
|
+
return printStatus(path.resolve(videoDir));
|
|
184
|
+
}
|
|
185
|
+
case "key": {
|
|
186
|
+
const installed = loadPublicKey();
|
|
187
|
+
if (installed) {
|
|
188
|
+
console.log(`Approval key ${installed.keyId}\n public: ${keyPaths().publicKey}\n private: ${keyPaths().privateKey}`);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
requireHumanTerminal("creating the approval key");
|
|
192
|
+
const key = loadOrCreateSigningKey({ create: true });
|
|
193
|
+
console.log(`${key.created ? "Created" : "Restored"} approval key ${key.keyId} in ${keyPaths().dir}.`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
case "help":
|
|
197
|
+
case undefined:
|
|
198
|
+
console.log(USAGE);
|
|
199
|
+
return;
|
|
200
|
+
default:
|
|
201
|
+
fail(`Unknown command ${args.cmd}\n\n${USAGE}`, 2);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
main();
|