// `umtool posts add` (2026-10-25): a post card for a report video, made from // the corpus's posts archive rather than typed -- the post's own words, date, // link and handle as the archive holds them, and its screenshot. // // umtool posts add / [--attach ] [--flag F] // [--author A] [--id ID] [--thread] [--dry-run] [--json] // umtool posts set thread=on|off [hide=on|off] [attach=|auto] [--json] // // `--thread` / `thread=on` draws a reply with the post it answers above it: // the capture's `shot-thread.png` beside its `shot.png` (capture-posts // `"thread": true` takes it), the post's own shot while there is none. `set` // is updatePosts -- the writer the Posts table's Save runs. // // The row is `channels//posts/YYYY-MM.jsonl`'s (common/lib/posts-server.ts // owns that layout; an X id names its month, so its shard is read first). The // screenshot is the capture's `channels//posts-media//shot.png` // (common/social/postCapture.ts), COPIED into the project as // `posts-media///shot.png` with its capture.json and the post's // pictures (copyCapture) -- a post's `shot` is relative to the // manifest and inside its folder (deck.mjs shotError), as every post the // Huck cut carries is. A post with no shot is refused, naming the capture to // run: a card drawn from text alone is a different card, and it should be a // choice, not what happens when nobody captured it. // // The entry goes in through upsertPost -- the writer POST /api/report/timeline // `{op: "post"}` runs -- with the token read just before it and the // generated-manifest guard around it: a post with that id already there is // replaced (its attachTo kept unless --attach says otherwise). // // Plain ESM: the CLI runs under bare node. import { isTrendingLibrary } from "./xTrendingMarker.mjs"; import { readFileSync } from "node:fs"; import { copyFile, mkdir, readFile, readdir, realpath, stat } from "node:fs/promises"; import path from "node:path"; import { REPORTS_ROOT, resolveProject } from "../projects/core.mjs"; import { channelsDirFor, readManifest } from "../projects/report.mjs"; import { withEditNotes } from "./edit-guard.mjs"; import { PostsRefused, StaleToken, StructureRefused, addArchiveAvatars, manifestToken, setPostAvatar, updatePostItem, updatePostPictureReplyRender, updatePostRedact, updatePosts, upsertPost } from "./manifest.mjs"; import { pictureReplyKnobs } from "umtool-report-to-video/post-picture"; import { postWarnings } from "./postCards.mjs"; import { censorSpecOf } from "umtool-report-to-video/post-censor"; // `umtool posts roles` (postThreadCli.mjs ROLES_USAGE): its lines, kept here so the usage is one block. const ROLES_LINES = [ " umtool posts roles [ …] [--write] [--set =,…] [--json]", " a READ's PIECES: the text each part of a narrated item's read reads (the post it answers, the quoted post, his", " words, an attachment's), stored or inferred, what the card shows for each, and the guard (umtool posts roles --help).", ]; // `umtool posts reread` (postReread.mjs REREAD_USAGE): its lines, kept here so the usage is one block. const REREAD_LINES = [ " umtool posts reread [--without parent:0|parent:1|quoted[,…]] [--drop-parts 3,4] [--drop-urls] [--dry-run] [--json]", " a READ RE-JOINED without a piece (no TTS): the picked take's kept parts cut from its own file and joined again, a new", " take that is picked (one undo point) -- the post it answers or quotes left unread, a part by number, a part that is", " only a link. set-item thread.parent.|quoted=context|hidden on a piece the take reads runs it first (--no-reread: refused).", " umtool posts reread --tempo-for \"4-16=1.35,21-25=1.3\" [--stretch atempo|rubberband] PER-PART TEMPO (no", " TTS): the parts named read faster (1-1.6, pitch kept), the rest as they were, the words scaled with them; a new take", " picked. set-item narration.tempo=\"4-16=1.35\" runs it. --yell-caps [--yell-gain 5.5] [--yell-style raise|shout|loud]:", " the words he wrote in ALL CAPS raised (acronyms and slurs left), timings kept. umtool posts yell

--all|: the cut's.", " --pause \"20=0.45\": silence after words (no TTS). --revoice \"20 10 4 0\" --say \"20... 10... 4... 0...\": ONE PHRASE re-voiced", " (TTS for that phrase only), spliced in at quiet cuts with crossfades, the rest of the read untouched (posts reread --help).", ]; // `umtool posts slurs` (postSlursCli.mjs SLURS_USAGE): its lines, kept here so the usage is one block. const SLURS_USAGE_LINES = [ " umtool posts slurs [ls] | on | off | level strong|all | visual blackout|placeholder", " | voice skip|beep|placeholder | add | except | remove ", " | edges [--off] [--json]", " THE SLUR FILTER (render.posts.slurs, on by default): the list's slurs masked in what the cut publishes (a bar or", " a placeholder pill on the card; left out, beeped or a stand-in in the read); `ls` counts what it masks (masks", " only), off or `umtool take … --uncensored` is the uncensored cut; edges : that slur first+last letter", " (\"n***a\"). umtool posts slurs --help: the whole story.", ]; // `umtool posts say` / `posts voices` (postSay.mjs SAY_USAGE, VOICES_USAGE): its lines, kept here so the usage is one block. const SAY_LINES = [ " umtool posts say [ls] | add \"\" [--case] [--item ] [--note \"…\"] | remove ", " | try \"\" [--item ] | stale [--json]", " THE PRONUNCIATION LEXICON (narration/lexicon.json): \"tbh\" said \"T-B-H\" in every synthesized read (a take, a thread", " read's pieces, the bench's re-take) -- whole words, without case unless --case, --item for one item's reads; a", " masked slur and a redacted word are never replaced. stale: the picked reads that still say one the old way.", " umtool posts voices [ls] | set | remove [--json]", " THE VOICE MAP (narration/voices.json): the voice a thread read gives each author (* everyone else; default leo).", " umtool posts character [ | --clear] [--json]", " THE CHARACTER ONE ITEM's OWN READ IS MADE WITH: one of this video's own (umtool cast project

) or the cast's;", " its presets answer before its author's handle does. --clear: by its handle again (posts character --help).", ]; export const POSTS_USAGE = [ "usage: umtool posts add / [--attach ] [--flag F] [--author A] [--id ID]", " [--thread] [--crop ] [--dry-run] [--json]", " umtool posts set thread=on|off [hide=on|off] [attach=|auto] [crop=|off] [--json]", " a post card from the corpus's posts archive (channels//posts/*.jsonl): its words, date, link and handle,", " and its screenshot (channels//posts-media//shot.png) copied into the project's posts-media/.", " The id is x- (bsky-, post-) unless --id; --attach pins it to a clip; --author overrides the name", " (default: the name an earlier post by the same handle carries in this cut, else the archive's).", " A post with no screenshot is refused: `pnpm ops capture-posts --json '{\"slug\":…,\"ids\":[…]}'` first.", " --thread (or `set … thread=on`): a reply drawn with the post it answers above it -- the capture's", " shot-thread.png beside shot.png (capture-posts with \"thread\": true takes it); its own shot while there is none.", " set: is the manifest's post id (x-) or the bare ; the Posts table's writer.", " --crop / crop=: the post's own crop of its screenshot (shotMaxHeight, 120-1080): its top that tall, never panned.", " A post that quotes another or carries media is added with a WARNING: its screenshot shows them (the post's own data says so).", " umtool posts reel --channel [--channel …] [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--own]", " [--with-media] [--replies include|only|exclude] [--order chrono|reverse] [--limit N] [--after ]", " [--dry-run] [--json]", " POST ITEMS: each archived post as an entry of the cut, its card and its attachments (report-video.md, \"Post items\"):", " the channels merged in time order, de-duplicated by post id; a post already in the cut is skipped, so a re-run", " adds only what is new -- in ONE write (one undo point), at the end unless --after.", " umtool posts screen list | add | set | rm | check | read … its text screenshots (posts screen --help)", " umtool posts set-item [hold=|off] [layout=sequence|grid] [redact=on|off|auto] [scene=off|join|auto] [follow=on|off|auto] [follow.dim=<0.2-1>] [follow.ease=]", " [excerpt='[\"\", …]'|off] read only these verbatim spans (in the post's order, joined \" … \"); the card shows the whole post, the rest dimmed", " [thread.parent[.]=auto|full|excerpt|context|carry|hidden] [thread.quoted=auto|full|excerpt|context|hidden]", " [thread.carry=auto|on|off] [thread.reveal=on|off] [thread.shrink=<0.3-1>] [thread.dim=<0.15-1>]", " [thread.seconds=<0-3>] [thread.pan=<0.1-3>] [thread=auto]", " [media..start=] [media..end=] [media..mute=on|off] [media..crop=x,y,w,h|off]", " [media..push=on|off] [media..trim=off] [media..enter=post|item] [quoted.paraphrase=\"…\"|off]", " [media..blur=on|off] [media..blur.strength=1–10] [media..blur.label=\"…\"|off]", " [media..shown=off] [media-off..shown=on] an attachment switched off, kept whole (mediaOff), and on again", " [media..blur.boxes=x,y,w,h;…|off] [media..blur.band=below:|above:|between:,[:left:|:right:]|off]", " [media..blur.style=blur|black|pixelate|off] [media..censor=:[: