commit b9d87144c7f08f5ba9bf630d04544c10ec2cab4e
parent 2a7883cf8aad9d26ad06e4330de2940b57eca989
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 11 Nov 2026 20:10:24 -0500
umtool: a convert derive is its character's -- posts narrate --derive <n> --op convert (and the take panel's derive) asks with the recorded preset's engine, stock voice, pitch and semitones of the character the read is made as (--as, the item's own, this video's, the cast's, the narrator), each unless a flag says otherwise; with no character and no voice it is refused instead of asking the editor for its default voice
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
7 files changed, 160 insertions(+), 18 deletions(-)
diff --git a/umtool/app/api/report/post-narration/route.ts b/umtool/app/api/report/post-narration/route.ts
@@ -23,7 +23,7 @@ import { projectRedaction } from "@/lib/report/postRedaction.mjs";
import { spokenRead } from "umtool-report-to-video/post-redact";
import { recordedPresetOf, shownNameOf } from "umtool-report-to-video/cast";
import { readLayers, recordedTrimFor } from "@/lib/report/characterLayers.mjs";
-import { derivePitchOf, deriveRefusalOf, stepPitchOf } from "@/lib/report/derivePitch.mjs";
+import { convertAskOf, derivePitchOf, deriveRefusalOf, stepPitchOf } from "@/lib/report/derivePitch.mjs";
export const dynamic = "force-dynamic";
@@ -47,8 +47,11 @@ const benchVoice = (red: { slurs?: { voice?: string } | null } | null) => (red?.
// GET ?project&id&convert=1 what a convert of this post defaults to: its author's character in
// the cast (else the narrator) and that character's convert
// target -- {character, convert: {engine, voice, pitch?, semitones?}}
-// POST {project, op: "derive", id, from, op2: enhance|convert, engine?, voice?, pitch?, semitones?}
-// a NEW take made from take `from` by the editor's voice op
+// POST {project, op: "derive", id, from, op2: enhance|convert, engine?, voice?, pitch?, semitones?, as?}
+// a NEW take made from take `from` by the editor's voice op; a
+// convert's engine, voice, pitch and semitones default to the
+// CHARACTER's recorded preset (`as`, else the post's), and with
+// none and no voice it is refused -- the answer names what was asked
// (a job; kept by GET ?job&derive=<from>[&pitch&semitones]);
// `installed: false` when the editor has no engine for it. A
// convert's `pitch` (target | source | contour) and `semitones`
@@ -274,11 +277,24 @@ async function postHere(request: Request) {
if (!t) return Response.json({ error: `${id} has no take ${from + 1}` }, { status: 404 });
const op = String(body.op2 ?? "");
if (!(POST_DERIVE_OPS as readonly string[]).includes(op)) return Response.json({ error: `op2 is one of ${POST_DERIVE_OPS.join(", ")}` }, { status: 400 });
- const engine = body.engine ? String(body.engine) : null;
- const voice = body.voice ? String(body.voice) : null;
+ let engine = body.engine ? String(body.engine) : null;
+ let voice = body.voice ? String(body.voice) : null;
// A convert's pitch (target | source | contour) and semitones, checked here; the editor refuses what its engine cannot do.
- const pitched = derivePitchOf({ pitch: body.pitch, semitones: body.semitones }, op);
- if (!pitched.ok) return Response.json({ error: pitched.error }, { status: 400 });
+ const checked = derivePitchOf({ pitch: body.pitch, semitones: body.semitones }, op);
+ if (!checked.ok) return Response.json({ error: checked.error }, { status: 400 });
+ let pitch: { pitch?: string; semitones?: number } = checked.value ?? {};
+ if (op === "convert") {
+ // A convert is the CHARACTER's (the CLI's rule, derivePitch.mjs convertAskOf): what the body does not name is
+ // its recorded preset's -- engine, stock voice, pitch, semitones -- and with no character and no voice it is
+ // refused: the editor's default voice is never asked for.
+ const who = (await readLayers(r.project.dir)).characterForRead(e, typeof body.as === "string" && body.as ? body.as : null);
+ if (typeof body.as === "string" && body.as && !who?.character) return Response.json({ error: `no such character: ${body.as}` }, { status: 400 });
+ const d = convertAskOf({ engine, voice, ...pitch }, who?.character ? recordedPresetOf(who.character).convert : null, who?.character?.id ?? null);
+ if (!d.ok) return Response.json({ error: `${d.error}: name a stock voice here, or give the character one on the Voices page` }, { status: 400 });
+ engine = d.value.engine ?? null;
+ voice = d.value.voice;
+ pitch = { ...(d.value.pitch !== undefined ? { pitch: d.value.pitch } : {}), ...(d.value.semitones !== undefined ? { semitones: d.value.semitones } : {}) };
+ }
const pid = postIdOf(e);
const dir = path.join(r.project.dir, ...takesDirOf(pid).split("/"));
await mkdir(dir, { recursive: true });
@@ -290,8 +306,8 @@ async function postHere(request: Request) {
: null;
try {
// `voice` is the convert op's stock target; enhance takes none.
- const jobId = await startJob(POST_DERIVE_ROUTES[op as keyof typeof POST_DERIVE_ROUTES], { file: abs(t.file), out: abs(rel), ...(engine ? { engine } : {}), ...(voice && op === "convert" ? { voice } : {}), ...pitched.value, ...(parts ? { parts } : {}) });
- return Response.json({ ok: true, jobId, file: rel, from, op: op, engine, voice, ...pitched.value }, { headers: noStore });
+ const jobId = await startJob(POST_DERIVE_ROUTES[op as keyof typeof POST_DERIVE_ROUTES], { file: abs(t.file), out: abs(rel), ...(engine ? { engine } : {}), ...(voice && op === "convert" ? { voice } : {}), ...pitch, ...(parts ? { parts } : {}) });
+ return Response.json({ ok: true, jobId, file: rel, from, op: op, engine, voice, ...pitch }, { headers: noStore });
} catch (err) {
const status = (err as { status?: number }).status ?? 502;
const msg = err instanceof Error ? err.message : String(err);
diff --git a/umtool/components/projects/PostNarrationPanel.tsx b/umtool/components/projects/PostNarrationPanel.tsx
@@ -234,7 +234,9 @@ export default function PostNarrationPanel({
setChain([]);
return;
}
- if (j?.jobId && j.file) setJob({ id: j.jobId, file: j.file, note: "", script, state: "running", derive: { from, op: step.op, engine: step.engine ?? null, voice: step.voice ?? null, pitch: step.pitch ?? null, semitones: step.semitones ?? null } });
+ // What the server asked the editor with (a convert's defaults are its character's): the keeper records those.
+ const asked = (k: string) => (typeof j?.[k] === "string" && j[k] ? (j[k] as string) : null);
+ if (j?.jobId && j.file) setJob({ id: j.jobId, file: j.file, note: "", script, state: "running", derive: { from, op: step.op, engine: asked("engine") ?? step.engine ?? null, voice: asked("voice") ?? step.voice ?? null, pitch: asked("pitch") ?? step.pitch ?? null, semitones: typeof j.semitones === "number" ? j.semitones : step.semitones ?? null } });
};
const retake = async () => {
const j = await post({ op: "take", note: dir.note || undefined, voice: dir.voice || undefined, speed: dir.speed ? Number(dir.speed) : undefined, script });
diff --git a/umtool/lib/report/characters.test.mjs b/umtool/lib/report/characters.test.mjs
@@ -427,3 +427,38 @@ test("a recording made a read with its character's recorded preset: clean off, t
assert.deepEqual(r.takes.map((t) => t.step), ["recorded", "cleaned", "converted to kokoro:bm_george (pitch: contour +2 st)"]);
await posts(["character", "chars", "p-3", "--clear"]);
});
+
+test("posts narrate --derive --op convert: the character's recorded preset unless a flag says otherwise; no character and no voice is refused", async () => {
+ // p-3 is @guest's (anon-a: kokoro:am_puck); the cast's narrator `me` converts by seed-vc, contour +2.
+ const rec = path.join(ROOT, "derive-read.wav");
+ await wavOf(rec, VOICE_B, 1.5, 0.3);
+ const asked = [];
+ const ask = async (route, body) => {
+ asked.push({ op: route.split("/").at(-1), ...body });
+ await wavOf(body.out, VOICE_A, 1.5);
+ return { jobId: `d-${asked.length}`, result: { engine: body.engine ?? "openvoice", voice: body.voice ?? "zac" } };
+ };
+ const r0 = await importRecording(project, await item("p-3"), rec, { convert: false, clean: false, ask });
+ const n = (await item("p-3")).narration.takes.findIndex((t) => t.file === r0.takes[0].file) + 1;
+ // No flags: anon-a's stock voice -- never the editor's default (the stub's "zac").
+ let r = await posts(["narrate", "chars", "p-3", "--derive", String(n), "--op", "convert", "--json"], { ask });
+ assert.equal(r.code, 0, r.text());
+ assert.deepEqual([asked.at(-1).op, asked.at(-1).voice, asked.at(-1).engine, asked.at(-1).pitch], ["voice-convert", "kokoro:am_puck", undefined, undefined]);
+ assert.equal(r.json().take.steps[0].voice, "kokoro:am_puck");
+ // --as: another character's whole convert entry; a flag over one key of it.
+ r = await posts(["narrate", "chars", "p-3", "--derive", String(n), "--op", "convert", "--as", "me"], { ask });
+ assert.equal(r.code, 0, r.text());
+ assert.deepEqual([asked.at(-1).engine, asked.at(-1).voice, asked.at(-1).pitch, asked.at(-1).semitones], ["seed-vc", "kokoro:bm_george", "contour", 2]);
+ assert.match(r.text(), /as me: seed-vc -> kokoro:bm_george \(pitch: contour \+2 st\)/);
+ r = await posts(["narrate", "chars", "p-3", "--derive", String(n), "--op", "convert", "--as", "me", "--semitones", "-1", "--voice", "kokoro:am_onyx"], { ask });
+ assert.deepEqual([asked.at(-1).engine, asked.at(-1).voice, asked.at(-1).pitch, asked.at(-1).semitones], ["seed-vc", "kokoro:am_onyx", "contour", -1]);
+ r = await posts(["narrate", "chars", "p-3", "--derive", String(n), "--op", "convert", "--as", "ghost"], { ask });
+ assert.equal(r.code, 2);
+ assert.match(r.text(), /--as ghost: no such character/);
+ // An enhance asks no character.
+ const before = asked.length;
+ r = await posts(["narrate", "chars", "p-3", "--derive", String(n), "--op", "enhance"], { ask });
+ assert.equal(r.code, 0, r.text());
+ assert.equal(asked.length, before + 1);
+ assert.equal("voice" in asked.at(-1), false);
+});
diff --git a/umtool/lib/report/derivePitch.mjs b/umtool/lib/report/derivePitch.mjs
@@ -4,6 +4,8 @@
// refuse alike:
//
// derivePitchOf what a derive is asked with (`pitch`, `semitones`), checked before any job
+// convertAskOf what a CONVERT derive is asked with: what the ask named, the rest from the character's recorded
+// preset -- never the editor's default voice
// stepPitchOf what the new take's step keeps: the pitch as the editor RAN it, never the target's own
// deriveRefusalOf an editor refusal read as "no engine for it" -- or passed through as it is, when it already
// names the command that fixes it
@@ -34,6 +36,49 @@ export function derivePitchOf({ pitch, semitones } = {}, op = "convert") {
}
/**
+ * WHAT A CONVERT DERIVE IS ASKED WITH (operator, 11 Nov: a derive with no flags asked the editor for ITS defaults and
+ * made a take in the wrong voice). `asked` is what the command or the body named (`engine`, `voice`, `pitch`,
+ * `semitones`: only those given); `convert` the recorded preset's convert entry of the character the read is made
+ * as (cast.mjs recordedPresetOf(character).convert -- `{engine, voice, pitch?, semitones?}`, null: no character);
+ * `who` its id, for the sentences. What was asked wins, each key by itself; the rest is the character's:
+ *
+ * engine, voice the character's convert engine and stock voice
+ * pitch the character's -- unless the ask names ANOTHER engine than the character's (a followed pitch is
+ * one engine's: the editor refuses it of another)
+ * semitones the character's, with a followed pitch; dropped with `pitch: "target"` asked for this read
+ *
+ * With no stock voice from either, `{ ok: false, error, fix }`: one sentence (and the flags that answer it), and the
+ * editor is never asked for its default voice. Else `{ ok: true, value: {engine, voice, pitch?, semitones?}, from: "asked" | "character" }` --
+ * `from` says whose voice it is.
+ *
+ * @param {{ engine?: string | null, voice?: string | null, pitch?: string | null, semitones?: number | null }} [asked]
+ * @param {{ engine?: string | null, voice?: string | null, pitch?: string, semitones?: number } | null} [convert]
+ * @param {string | null} [who]
+ * @returns {{ ok: true, value: { engine: string | null, voice: string, pitch?: string, semitones?: number }, from: "asked" | "character" } | { ok: false, error: string, fix: string }}
+ */
+export function convertAskOf(asked = {}, convert = null, who = null) {
+ const given = (v) => v !== undefined && v !== null && v !== "";
+ const cv = convert ?? {};
+ const voice = given(asked.voice) ? asked.voice : given(cv.voice) ? cv.voice : null;
+ if (!voice) {
+ // `error`: the sentence, for any surface; `fix`: the commands that answer it, for a terminal.
+ return who
+ ? { ok: false, error: `a convert needs a stock voice to convert to, and ${who} has none`, fix: `--voice <engine:voice>, or umtool cast set ${who} --convert-voice <engine:voice>` }
+ : { ok: false, error: "a convert needs a stock voice to convert to, and this post has no character with one", fix: "--voice <engine:voice>, --as <character>, or umtool cast add … for its author" };
+ }
+ const engine = given(asked.engine) ? asked.engine : given(cv.engine) ? cv.engine : null;
+ // The character's pitch is its engine's: another engine asked for this read is asked for none.
+ const own = !given(asked.engine) || !given(cv.engine) || asked.engine === cv.engine;
+ const pitch = given(asked.pitch) ? asked.pitch : own && given(cv.pitch) ? cv.pitch : undefined;
+ const semitones = given(asked.semitones) ? asked.semitones : own && pitch !== undefined && pitch !== "target" && given(cv.semitones) ? cv.semitones : undefined;
+ return {
+ ok: true,
+ value: { engine: engine ?? null, voice, ...(pitch !== undefined && pitch !== null ? { pitch } : {}), ...(semitones !== undefined && semitones !== null ? { semitones } : {}) },
+ from: given(asked.voice) ? "asked" : "character",
+ };
+}
+
+/**
* The pitch a derived take's step keeps: what the editor says it ran (its `@@voice-result`: its default when none was
* asked), else what was asked. The stock voice's own pitch is not a step's news (`{}`), and 0 semitones is none.
*/
diff --git a/umtool/lib/report/derivePitch.test.mjs b/umtool/lib/report/derivePitch.test.mjs
@@ -5,7 +5,7 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { validatePostNarration } from "umtool-report-to-video/post-narration";
-import { derivePitchOf, deriveRefusalOf, stepPitchOf } from "./derivePitch.mjs";
+import { convertAskOf, derivePitchOf, deriveRefusalOf, stepPitchOf } from "./derivePitch.mjs";
test("a derive's pitch as asked: only what was given, a body's number or a query's string, a convert's alone", () => {
assert.deepEqual(derivePitchOf({}), { ok: true, value: {} });
@@ -31,6 +31,33 @@ test("a derive's pitch as asked: only what was given, a body's number or a query
assert.deepEqual(derivePitchOf({}, "enhance"), { ok: true, value: {} });
});
+test("a convert derive is the character's: what the ask names wins, the rest is its recorded preset's, and no voice is refused", () => {
+ const savvy = { engine: "seed-vc", voice: "orpheus:mia", pitch: "contour", semitones: 2 };
+ // No flags: the character's, whole (the 11 Nov bug: the editor's default voice was asked instead).
+ assert.deepEqual(convertAskOf({}, savvy, "madam-savvy"), { ok: true, value: savvy, from: "character" });
+ assert.deepEqual(convertAskOf({ engine: null, voice: null }, savvy, "madam-savvy").value, savvy, "a flag not given is null");
+ // Each key by itself.
+ assert.deepEqual(convertAskOf({ semitones: 0 }, savvy).value, { ...savvy, semitones: 0 }, "0 is asked, not absent");
+ assert.deepEqual(convertAskOf({ pitch: "source" }, savvy).value, { ...savvy, pitch: "source" }, "the nudge goes with another followed pitch");
+ assert.deepEqual(convertAskOf({ pitch: "target" }, savvy).value, { engine: "seed-vc", voice: "orpheus:mia", pitch: "target" }, "the target's own pitch takes no semitones");
+ assert.deepEqual(convertAskOf({ voice: "orpheus:tara" }, savvy), { ok: true, value: { ...savvy, voice: "orpheus:tara" }, from: "asked" });
+ // Another engine than the character's: its pitch is not that engine's to follow.
+ assert.deepEqual(convertAskOf({ engine: "openvoice" }, savvy).value, { engine: "openvoice", voice: "orpheus:mia" });
+ assert.deepEqual(convertAskOf({ engine: "openvoice", pitch: "target" }, savvy).value, { engine: "openvoice", voice: "orpheus:mia", pitch: "target" });
+ assert.deepEqual(convertAskOf({ engine: "seed-vc" }, savvy).value, savvy, "the same engine, named");
+ // A character with only a voice (its synthetic one): the editor's engine and pitch.
+ assert.deepEqual(convertAskOf({}, { engine: null, voice: "kokoro:am_puck" }, "anon-a").value, { engine: null, voice: "kokoro:am_puck" });
+ // No character: the flags alone; none: refused in one sentence, with what answers it.
+ assert.deepEqual(convertAskOf({ voice: "zac" }, null), { ok: true, value: { engine: null, voice: "zac" }, from: "asked" });
+ const none = convertAskOf({ engine: "seed-vc", pitch: "contour" }, null);
+ assert.equal(none.ok, false);
+ assert.equal(none.error, "a convert needs a stock voice to convert to, and this post has no character with one");
+ assert.match(none.fix, /--voice <engine:voice>, --as <character>/);
+ const mute = convertAskOf({}, { engine: null, voice: null }, "ghost");
+ assert.equal(mute.error, "a convert needs a stock voice to convert to, and ghost has none");
+ assert.match(mute.fix, /umtool cast set ghost --convert-voice/);
+});
+
test("the step keeps the pitch the editor ran, else the one asked; never the target's own, never 0 semitones", () => {
assert.deepEqual(stepPitchOf({}, {}), {});
assert.deepEqual(stepPitchOf({ pitch: "target" }, {}), {});
diff --git a/umtool/lib/report/postNarrationCli.mjs b/umtool/lib/report/postNarrationCli.mjs
@@ -26,8 +26,8 @@ import { promisify } from "node:util";
import {
NARRATION_INDEX, POST_DERIVE_OPS, POST_NARRATION_LIMITS, POST_DERIVE_ROUTES, derivedFileOf, draftScript, takeIdOf, isNarrated, nextTakeNumber, pickedTake, postIdOf, postNarrationKnobs, takeFileOf, takesDirOf,
} from "umtool-report-to-video/post-narration";
-import { CAST_CONVERT_PITCH, CAST_SEMITONES_MAX } from "umtool-report-to-video/cast";
-import { stepPitchOf } from "./derivePitch.mjs";
+import { CAST_CONVERT_PITCH, CAST_SEMITONES_MAX, convertPitchLabel } from "umtool-report-to-video/cast";
+import { convertAskOf, stepPitchOf } from "./derivePitch.mjs";
import { excerptSpansOf, postItemPlan, postReadText } from "umtool-report-to-video/post-item";
import { partRoles } from "umtool-report-to-video/post-thread";
import { spokenRead } from "umtool-report-to-video/post-redact";
@@ -48,7 +48,7 @@ export const NARRATE_USAGE = [
" wet=… lowpass=… duck=on|off short=hold|loop attach=under|after lufs=… rate=… pace=fast|normal] [--json]",
" umtool posts narrate <project> <item> --recording <file> [--as <character>] [--no-clean|--clean] [--no-trim|--trim] [--no-convert]",
" [--pitch target|source|contour] [--semitones <n>]",
- " umtool posts narrate <project> <item> --derive <n> --op enhance|convert [--engine e] [--voice v]",
+ " umtool posts narrate <project> <item> --derive <n> --op enhance|convert [--engine e] [--voice v] [--as <character>]",
" [--pitch target|source|contour] [--semitones <n>]",
" umtool posts narrate <project> <item> --take --thread [--parents 0|all|none|<n>] [--skip-parent <id>]… [--no-quoted]",
" [--no-linked] [--read-seen] [--voice-for <handle>=<voice>]… [--voice v] [--speed s] [--force] [--dry-run]",
@@ -81,6 +81,9 @@ export const NARRATE_USAGE = [
" item's own, else its character's (the synthetic preset's: umtool cast set <id> --speed). A thread read: every part.",
" --derive <n> --op enhance|convert [--engine e] [--voice v]: a NEW take made from take n by the editor's op",
" (enhance: denoise, level; convert: the performance kept, the timbre a STOCK synthetic voice) -- the original kept.",
+ " A convert is the CHARACTER's (--as, else the item's own, this video's for the author, the cast's, the narrator):",
+ " its recorded preset's engine, stock voice, pitch and semitones, each unless its flag says otherwise. With no",
+ " character and no --voice it is refused: the editor's default voice is never asked for.",
" --pitch target|source|contour [--semitones <n>] (a convert, by --derive or --recording): the PITCH the converted",
" read lands on -- target: the stock voice's own (the read's intonation is flattened to it); source: the pitch it",
" was read at (raise your voice and it rises); contour: the read's rises and falls, moved as a whole to the stock",
@@ -428,7 +431,7 @@ async function timeTakeWords(project, rel, script, { askOp = null, emit = () =>
}
/** `umtool posts narrate …` (postsCli.mjs routes it here). */
-export async function narrateCommand(project, words, flags, { json = false, dryRun = false, out = (s) => console.log(s), str, multi = () => [] }) {
+export async function narrateCommand(project, words, flags, { json = false, dryRun = false, out = (s) => console.log(s), str, multi = () => [], ask = null }) {
const manifest = await readManifest(project.dir);
if (!manifest) throw new NarrateError(`${project.id} has no manifest`);
const render = manifest.render ?? {};
@@ -562,7 +565,21 @@ export async function narrateCommand(project, words, flags, { json = false, dryR
try {
const pitched = pitchFlags(str);
if (op !== "convert" && (pitched.pitch !== undefined || pitched.semitones !== undefined)) throw new NarrateError("--pitch and --semitones are a convert's (--op convert): an enhance keeps the read's own pitch");
- const r = await deriveTake(project, e, { from: k - 1, op, engine: str("--engine"), voice: str("--voice"), ...pitched, emit: (_ev, f) => !json && f?.message && out(f.message) });
+ let asked = { engine: str("--engine"), voice: str("--voice"), ...pitched };
+ if (op === "convert") {
+ // A convert is the CHARACTER's (cast.mjs characterForRead: --as, the item's own, this video's for the author,
+ // the cast's, the narrator): its recorded preset's engine, stock voice, pitch and semitones, each unless a flag
+ // says otherwise -- and with no character and no --voice it is refused, never the editor's default voice.
+ const { readLayers } = await import("./characterLayers.mjs");
+ const { recordedPresetOf } = await import("umtool-report-to-video/cast");
+ const who = (await readLayers(project.dir)).characterForRead(e, str("--as"));
+ if (str("--as") && !who?.character) throw new NarrateError(`--as ${str("--as")}: no such character in this video's characters or the cast (umtool cast project ${project.id}, umtool cast ls)`);
+ const d = convertAskOf(asked, who?.character ? recordedPresetOf(who.character).convert : null, who?.character?.id ?? null);
+ if (!d.ok) throw new NarrateError(`${d.error} (${d.fix})`);
+ asked = d.value;
+ if (!json && d.from === "character") out(` as ${who.character.id}: ${asked.engine ?? "the editor's engine"} -> ${asked.voice}${convertPitchLabel(asked) ? ` (pitch: ${convertPitchLabel(asked)})` : ""}`);
+ }
+ const r = await deriveTake(project, e, { from: k - 1, op, ...asked, ask, emit: (_ev, f) => !json && f?.message && out(f.message) });
if (json) out(JSON.stringify({ ok: true, id: e.id, take: r.take, token: r.result.token }, null, 2));
else out(`${e.id}: take ${r.take.file} (${r.take.seconds} s), from take ${k} by ${op}, picked`);
return 0;
diff --git a/umtool/lib/report/postsCli.mjs b/umtool/lib/report/postsCli.mjs
@@ -450,7 +450,7 @@ export async function addPostFromArchive(project, { slug, postId, attach = null,
* @param {{ root?: string, out?: (s: string) => void, err?: (s: string) => void }} [opts]
* @returns {Promise<number>} the exit code
*/
-export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => console.log(s), err = (s) => console.error(s) } = {}) {
+export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => console.log(s), err = (s) => console.error(s), ask = null } = {}) {
// A TAKE-SCOPED EDIT (`--in-take <take>`, takeScope.mjs): the same command over the take's manifest, written into its patch.
let scoped;
try {
@@ -549,7 +549,7 @@ export async function postsCommand(args, { root = REPORTS_ROOT, out = (s) => con
const named = words.slice(3).find((w) => takes.has(w));
if (named) throw new CliError(`posts narrate: --take makes a NEW READ (TTS); "${named}" is a take of ${project.id} -- to edit take ${named}, say --in-take ${named}`);
}
- return await narrateCommand(project, words.slice(2), flags, { json, dryRun, out, str, multi });
+ return await narrateCommand(project, words.slice(2), flags, { json, dryRun, out, str, multi, ask });
}
if (verb === "fx") {
const { FX_USAGE, fxCommand } = await import("./postFxCli.mjs");