commit a00dc12846e9260afdc774fec6acbf55740688c7
parent f875b35af9441733201886bc6a92e4a50c0b0f49
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 5 Nov 2026 04:01:48 -0500
umtool: Reads and voices sets the cut's narration mix (posts narrate --cut <knob>=<value>: rate, wet, lead, tail, ramp, linger, pace, duck, engine, voice, follow…), what it is now shown, a wrong knob refused in the CLI's words
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/umtool/app/api/report/pronunciation/route.ts b/umtool/app/api/report/pronunciation/route.ts
@@ -2,6 +2,7 @@ import { projectRef } from "@/lib/projects";
import { refuseCaller } from "@/lib/report/caller";
import { sayCommand, voicesCommand } from "@/lib/report/postSay.mjs";
import { postsCommand } from "@/lib/report/postsCli.mjs";
+import { readManifest } from "@/lib/projects/report.mjs";
import { addStep } from "@/lib/queue/store.mjs";
import { kickQueue, queueDir } from "@/lib/queue/runner";
@@ -18,6 +19,7 @@ export const dynamic = "force-dynamic";
// { project, op: "say-try", text, item? } posts say <p> try "<text>"
// { project, op: "voices-set", handle, voice } posts voices <p> set <handle|*> <voice>
// { project, op: "voices-remove", handle } posts voices <p> remove <handle|*>
+// { project, op: "mix-cut", key, value } posts narrate <p> --cut <key>=<value> (render.postNarration)
// { project, op: "redact-add", term, substring?, note? } posts redact <p> add "<term>" [--substring] [--note]
// { project, op: "redact-remove", n } posts redact <p> remove <n>
// { project, op: "slurs", verb: on|off|level|visual|voice|add|except|remove, value? } posts slurs <p> <verb> [value]
@@ -50,6 +52,7 @@ const voices = (project: NonNullable<Awaited<ReturnType<typeof projectRef>>>, re
export async function GET(request: Request) {
const project = await projectRef(new URL(request.url).searchParams.get("project") ?? "");
if (!project) return Response.json({ error: "no such project" }, { status: 404 });
+ const manifest = (await readManifest(project.dir).catch(() => null)) as { render?: { postNarration?: unknown } } | null;
const [lexicon, voiceMap, stale, redact, slurs] = await Promise.all([
say(project, ["ls"]),
voices(project, ["ls"]),
@@ -57,7 +60,7 @@ export async function GET(request: Request) {
posts(["redact", project.id, "ls"]),
posts(["slurs", project.id, "ls"]),
]);
- return Response.json({ lexicon, voices: voiceMap, stale, redact, slurs }, { headers: { "cache-control": "no-store" } });
+ return Response.json({ lexicon, voices: voiceMap, stale, redact, slurs, mix: manifest?.render?.postNarration ?? {} }, { headers: { "cache-control": "no-store" } });
}
export async function POST(request: Request) {
@@ -79,6 +82,8 @@ export async function POST(request: Request) {
else if (b.op === "say-try") r = await say(project, ["try", s("text")], flags);
else if (b.op === "voices-set") r = await voices(project, ["set", s("handle"), s("voice")]);
else if (b.op === "voices-remove") r = await voices(project, ["remove", s("handle")]);
+ // The cut's narration mix (posts narrate <p> --cut k=v): one knob a press; the CLI's own words refuse a wrong one.
+ else if (b.op === "mix-cut") r = await posts(["narrate", project.id, "--cut", `${s("key")}=${s("value")}`]);
else if (b.op === "redact-add") r = await posts(["redact", project.id, "add", s("term"), ...(b.substring === true ? ["--substring"] : []), ...(s("note") ? ["--note", s("note")] : [])]);
else if (b.op === "redact-remove") r = await posts(["redact", project.id, "remove", String(Number(b.n))]);
else if (b.op === "slurs") {
diff --git a/umtool/components/projects/PronunciationPanel.tsx b/umtool/components/projects/PronunciationPanel.tsx
@@ -20,6 +20,7 @@ type View = {
voices: { json: { voices?: Record<string, string>; narrator?: string; engine?: string; authors?: Author[] } | null; error?: string };
stale: { json: { reads?: { id: string; take: string; entries: { word: string; say: string }[]; fix: string }[] } | null };
redact?: { json: { redact?: (string | { term: string; substring?: boolean; note?: string })[]; corpusTerms?: number; markedPosts?: number } | null; error?: string };
+ mix?: Record<string, unknown>;
slurs?: { json: { on?: boolean; level?: string; visual?: string; voice?: string; listed?: number; add?: number; except?: number; total?: number } | null; error?: string };
};
@@ -36,6 +37,8 @@ export default function PronunciationPanel({ project }: { project: string }) {
const [queued, setQueued] = useState<string | null>(null);
const [term, setTerm] = useState("");
const [slurWord, setSlurWord] = useState("");
+ const [mixKey, setMixKey] = useState("rate");
+ const [mixValue, setMixValue] = useState("");
const load = useCallback(async () => {
const r = await fetch(`/api/report/pronunciation?project=${encodeURIComponent(project)}`, { cache: "no-store" });
const j = await r.json().catch(() => null);
@@ -237,6 +240,26 @@ export default function PronunciationPanel({ project }: { project: string }) {
</span>
</div>
</section>
+ {/* The cut's narration mix (posts narrate --cut): what every post reads with unless it says otherwise. */}
+ <section className="lg:col-span-2" data-mix-cut="">
+ <h3 className="micro mb-1">The cut's narration mix</h3>
+ <p className="m-0 font-mono text-[11px] text-text-2" data-mix-cut-now="">
+ {Object.keys(view?.mix ?? {}).length ? JSON.stringify(view?.mix) : "the defaults"}
+ </p>
+ <div className="mt-1 flex flex-wrap items-center gap-1.5">
+ <select data-mix-cut-key="" value={mixKey} onChange={(e) => setMixKey(e.target.value)} className={input}>
+ {["rate", "wet", "lead", "tail", "ramp", "linger", "pace", "duck", "engine", "voice", "follow", "follow.dim", "follow.ease", "lufs"].map((k) => (
+ <option key={k} value={k}>
+ {k}
+ </option>
+ ))}
+ </select>
+ <input data-mix-cut-value="" value={mixValue} onChange={(e) => setMixValue(e.target.value)} placeholder="value (or default)" className={cn(input, "w-36 font-mono")} />
+ <button type="button" data-mix-cut-set="" disabled={busy || !mixValue.trim()} onClick={() => void post({ op: "mix-cut", key: mixKey, value: mixValue.trim() }).then((ok) => ok && setMixValue(""))} className={buttonVariants({ variant: "outline", size: "sm" })}>
+ Set for the cut
+ </button>
+ </div>
+ </section>
{/* The whole cut's reads, long: steps of the queue (/jobs: their state, Retry, Cancel). */}
<section className="flex flex-wrap items-center gap-1.5 lg:col-span-2" data-narrate-all="">
<span className="micro">every post</span>