Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.
Python ai-toolsauto-captionscaptionscliffmpegmcpmcp-serveropusclip-alternativepodcast-clipspodcastsshortform-videovertical-videowhisper
Studio demo mode and docs drift sync (#53)
Nika Siradze8e0ada4fe7fa
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex a09078b..e7babb6 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -21,6 +21,19 @@ jobs:- run: npm test- run: npm run build+ docs-drift:+ name: Docs drift check+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ with:+ fetch-depth: 0+ - uses: actions/setup-node@v4+ with:+ node-version: "20"+ - run: node scripts/gen-docs-manifest.mjs+ - run: node scripts/check-docs-drift.mjs+python:name: Python testsruns-on: ubuntu-latestdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 914970a..c8bdf91 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -142,6 +142,8 @@ jobs:runs-on: ubuntu-latestpermissions:contents: write+ env:+ LANDING_DISPATCH_TOKEN: ${{ secrets.LANDING_DISPATCH_TOKEN }}steps:- uses: actions/download-artifact@v4with:@@ -156,3 +158,11 @@ jobs:with:files: dist/*generate_release_notes: true+ - name: Rebuild the landing site so the changelog picks up this release+ if: ${{ env.LANDING_DISPATCH_TOKEN != '' }}+ run: |+ curl -sf -X POST \+ -H "Authorization: Bearer $LANDING_DISPATCH_TOKEN" \+ -H "Accept: application/vnd.github+json" \+ https://api.github.com/repos/nmbrthirteen/podcli-landing/dispatches \+ -d '{"event_type":"release"}'diff --git a/.gitignore b/.gitignoreindex 30bc139..6312001 100644--- a/.gitignore+++ b/.gitignore@@ -58,3 +58,6 @@ cli/internal/backend/files/cli/internal/podstack/commands/cli/podclipodcli-clips/++# generated by scripts/gen-docs-manifest.mjs+docs-manifest.jsondiff --git a/README.md b/README.mdindex f9d7b3b..95549b0 100644--- a/README.md+++ b/README.md@@ -9,6 +9,7 @@<p align="center"><a href="https://podcli.com"><strong>podcli.com</strong></a> ·+ <a href="https://podcli.com/docs">Docs</a> ·<a href="#quick-start">Quick start</a> ·<a href="#mcp-server-claude-integration">MCP</a> ·<a href="#features">Features</a>@@ -32,6 +33,8 @@ podcli process episode.mp4One command transcribes, picks the best moments, crops to the face, and burns captions in. Nothing leaves your machine.+Full documentation lives at [podcli.com/docs](https://podcli.com/docs). The docs are open source, edit them at [nmbrthirteen/podcli-docs](https://github.com/nmbrthirteen/podcli-docs).+---## What It Does@@ -148,8 +151,8 @@ Both halves share the same **knowledge base** (`.podcli/knowledge/`) — your sh- **Clip history** — tracks everything to avoid duplicates- **Preset system** — save named configurations per show- **Content studio** — generate titles, descriptions, tags, and hashtags in the web UI; regenerate any section with your own guidance, or ask for anything custom-- **MCP server** — 17 tools for Claude Desktop / Claude Code integration-- **Web UI** — single-page flow at `localhost:3847`+- **MCP server** — 22 tools for Claude Desktop / Claude Code integration+- **Web UI** — multi-page studio at `localhost:3847`- **CLI** — one-command processing: `podcli process episode.mp4`---diff --git a/scripts/check-docs-drift.mjs b/scripts/check-docs-drift.mjsnew file mode 100644index 0000000..29fdab2--- /dev/null+++ b/scripts/check-docs-drift.mjs@@ -0,0 +1,43 @@+import { readFileSync } from "fs";+import { join, dirname } from "path";+import { fileURLToPath } from "url";++const root = join(dirname(fileURLToPath(import.meta.url)), "..");+const read = (p) => readFileSync(join(root, p), "utf8");++let manifest;+try {+ manifest = JSON.parse(read("docs-manifest.json"));+} catch {+ console.error("docs-manifest.json not found. Run: node scripts/gen-docs-manifest.mjs");+ process.exit(1);+}++const readme = read("README.md");+const errors = [];+const warnings = [];++if (/single-page/i.test(readme) && manifest.studioRouteCount > 1) {+ errors.push(`README calls the studio "single-page" but it has ${manifest.studioRouteCount} routes.`);+}++const toolClaims = [...new Set([...readme.matchAll(/(\d+)\s+(?:MCP\s+)?tools/gi)].map((m) => Number(m[1])))];+for (const claim of toolClaims) {+ if (claim !== manifest.mcpToolCount) {+ warnings.push(`README mentions "${claim} tools" but src registers ${manifest.mcpToolCount} (server.tool calls).`);+ }+}++if (manifest.packageVersion && manifest.version && !manifest.version.endsWith(manifest.packageVersion)) {+ warnings.push(`package.json version ${manifest.packageVersion} lags the latest tag ${manifest.version}.`);+}++for (const w of warnings) console.warn("warning:", w);++if (errors.length) {+ console.error("Docs drift detected:");+ for (const e of errors) console.error(" -", e);+ process.exit(1);+}++console.log(`Docs in sync: ${manifest.mcpToolCount} tools, ${manifest.studioRouteCount} studio routes, ${manifest.version}.`);diff --git a/scripts/gen-docs-manifest.mjs b/scripts/gen-docs-manifest.mjsnew file mode 100644index 0000000..71017b0--- /dev/null+++ b/scripts/gen-docs-manifest.mjs@@ -0,0 +1,40 @@+import { readFileSync, writeFileSync, readdirSync } from "fs";+import { execSync } from "child_process";+import { join, dirname } from "path";+import { fileURLToPath } from "url";++const root = join(dirname(fileURLToPath(import.meta.url)), "..");+const read = (p) => readFileSync(join(root, p), "utf8");++function countTools(dir) {+ let n = 0;+ for (const entry of readdirSync(join(root, dir), { withFileTypes: true })) {+ const rel = join(dir, entry.name);+ if (entry.isDirectory()) n += countTools(rel);+ else if (entry.name.endsWith(".ts")) n += (read(rel).match(/server\.tool\(/g) || []).length;+ }+ return n;+}++const mainTsx = read("src/ui/client/main.tsx");+const studioRoutes = [...mainTsx.matchAll(/<Route\s+path="([^"]+)"\s+element=\{<(\w+)/g)]+ .filter((m) => !/Navigate/.test(m[0]))+ .map((m) => ({ path: m[1], component: m[2] }));++let version = "";+try {+ version = execSync("git describe --tags --abbrev=0", { cwd: root }).toString().trim();+} catch {+ version = JSON.parse(read("package.json")).version || "";+}++const manifest = {+ version,+ packageVersion: JSON.parse(read("package.json")).version || "",+ mcpToolCount: countTools("src"),+ studioRouteCount: studioRoutes.length,+ studioRoutes,+};++writeFileSync(join(root, "docs-manifest.json"), JSON.stringify(manifest, null, 2) + "\n");+console.log("wrote docs-manifest.json:", JSON.stringify(manifest));diff --git a/src/services/clips-history.ts b/src/services/clips-history.tsindex d110706..c673573 100644--- a/src/services/clips-history.ts+++ b/src/services/clips-history.ts@@ -4,6 +4,7 @@ import { basename, join } from "path";import { v4 as uuidv4 } from "uuid";import { paths } from "../config/paths.js";import { sliceTranscript } from "../utils/transcript.js";+import { isDemoMode, demoClips } from "../ui/demo-fixtures.js";import type { BatchClipsResult, ClipHistoryEntry, Format, WordTimestamp } from "../models/index.js";type BatchResultRow = BatchClipsResult["results"][number];@@ -31,6 +32,7 @@ export class ClipsHistory {}async load(): Promise<ClipHistoryEntry[]> {+ if (isDemoMode()) return demoClips();try {if (!existsSync(this.historyPath)) return [];const raw = await readFile(this.historyPath, "utf-8");@@ -41,6 +43,7 @@ export class ClipsHistory {}private async save(entries: ClipHistoryEntry[]): Promise<void> {+ if (isDemoMode()) return; // demo fixtures are read-only; never persist to clips.jsonawait this.ensureDir();// Write to a temp file and atomically rename so a crash or a concurrent// reader never sees a half-written clips.json.@@ -181,6 +184,8 @@ export class ClipsHistory {async remove(idOrPrefix: string): Promise<ClipHistoryEntry | null> {const id = await this.resolveId(idOrPrefix);if (!id) return null;+ // Demo entries are read-only fixtures — never delete their (shipped) artifacts.+ if (isDemoMode()) return (await this.findById(id)) ?? null;const entry = await this.mutate((entries) => {const idx = entries.findIndex((e) => e.id === id);if (idx < 0) return null;diff --git a/src/ui/client/ClipDetail.tsx b/src/ui/client/ClipDetail.tsxindex ee52fbb..c6cf0c7 100644--- a/src/ui/client/ClipDetail.tsx+++ b/src/ui/client/ClipDetail.tsx@@ -90,6 +90,7 @@ export default function ClipDetail() {const tc = clip.thumbnail_config || {};const dirty = title !== clip.title || captionStyle !== clip.caption_style;const previewUrl = `/api/clips/${clip.id}/preview?t=${bust}`;+ const posterUrl = tc.preview_path ? img(tc.preview_path, bust) : undefined;const patch = (body: any) => api(`/clips/${clip.id}`, { method: "PATCH", body: JSON.stringify(body) });@@ -231,7 +232,7 @@ export default function ClipDetail() {<div className="clip-detail"><div className="clip-detail-player">- {clip.output_path ? <ClipPlayer key={previewUrl} src={previewUrl} onTime={(t) => (playerTime.current = t)} /> : <div className="phone-empty">No rendered output</div>}+ {clip.output_path ? <ClipPlayer key={previewUrl} src={previewUrl} poster={posterUrl} onTime={(t) => (playerTime.current = t)} /> : <div className="phone-empty">No rendered output</div>}<button className="btn btn-ghost btn-sm" style={{ width: "100%", marginTop: 10 }} onClick={() => setReframing(true)}>Reframe (fix camera)</button><div className="clip-meta"><span>{fmt(clip.start_second)}-{fmt(clip.end_second)} · {clip.duration}s</span>diff --git a/src/ui/client/ClipPlayer.tsx b/src/ui/client/ClipPlayer.tsxindex 12304f7..8f312ed 100644--- a/src/ui/client/ClipPlayer.tsx+++ b/src/ui/client/ClipPlayer.tsx@@ -4,7 +4,7 @@ import { PlayIcon, PauseIcon } from "./icons";const fmt = (s: number) => (Number.isFinite(s) ? fmtTime(s) : "0:00");-export default function ClipPlayer({ src, onTime }: { src: string; onTime?: (t: number) => void }) {+export default function ClipPlayer({ src, poster, onTime }: { src: string; poster?: string; onTime?: (t: number) => void }) {const ref = useRef<HTMLVideoElement>(null);const [playing, setPlaying] = useState(false);const [t, setT] = useState(0);@@ -36,6 +36,7 @@ export default function ClipPlayer({ src, onTime }: { src: string; onTime?: (t:<videoref={ref}src={src}+ poster={poster}playsInlineonClick={toggle}onPlay={() => setPlaying(true)}diff --git a/src/ui/demo-assets/demo-deep-dive-1.png b/src/ui/demo-assets/demo-deep-dive-1.pngnew file mode 100644index 0000000..7f8193cBinary files /dev/null and b/src/ui/demo-assets/demo-deep-dive-1.png differdiff --git a/src/ui/demo-assets/demo-deep-dive-2.png b/src/ui/demo-assets/demo-deep-dive-2.pngnew file mode 100644index 0000000..fac544fBinary files /dev/null and b/src/ui/demo-assets/demo-deep-dive-2.png differdiff --git a/src/ui/demo-assets/demo-long-story-1.png b/src/ui/demo-assets/demo-long-story-1.pngnew file mode 100644index 0000000..e1cc32aBinary files /dev/null and b/src/ui/demo-assets/demo-long-story-1.png differdiff --git a/src/ui/demo-assets/demo-long-story-2.png b/src/ui/demo-assets/demo-long-story-2.pngnew file mode 100644index 0000000..ca7a88fBinary files /dev/null and b/src/ui/demo-assets/demo-long-story-2.png differdiff --git a/src/ui/demo-assets/demo-tech-daily-1.png b/src/ui/demo-assets/demo-tech-daily-1.pngnew file mode 100644index 0000000..72f1949Binary files /dev/null and b/src/ui/demo-assets/demo-tech-daily-1.png differdiff --git a/src/ui/demo-assets/demo-tech-daily-2.png b/src/ui/demo-assets/demo-tech-daily-2.pngnew file mode 100644index 0000000..1488678Binary files /dev/null and b/src/ui/demo-assets/demo-tech-daily-2.png differdiff --git a/src/ui/demo-assets/demo-the-founder-1.png b/src/ui/demo-assets/demo-the-founder-1.pngnew file mode 100644index 0000000..b21e9bbBinary files /dev/null and b/src/ui/demo-assets/demo-the-founder-1.png differdiff --git a/src/ui/demo-assets/demo-the-founder-2.png b/src/ui/demo-assets/demo-the-founder-2.pngnew file mode 100644index 0000000..dace723Binary files /dev/null and b/src/ui/demo-assets/demo-the-founder-2.png differdiff --git a/src/ui/demo-fixtures.test.ts b/src/ui/demo-fixtures.test.tsnew file mode 100644index 0000000..fc4727c--- /dev/null+++ b/src/ui/demo-fixtures.test.ts@@ -0,0 +1,51 @@+import { describe, it, expect, afterEach } from "vitest";+import { existsSync } from "fs";+import { demoClips, DEMO_ASSETS_DIR } from "./demo-fixtures.js";++describe("demo fixtures", () => {+ it("exposes clips that light up the library and analytics", () => {+ const clips = demoClips();+ expect(clips.length).toBeGreaterThanOrEqual(6);+ for (const c of clips) {+ expect(c.id).toBeTruthy();+ expect(c.title).toBeTruthy();+ expect(c.thumbnail_config?.preview_path).toContain("demo-assets");+ // Analytics counts "published" only from clips with view/retention metrics.+ expect(c.metrics?.views).toBeGreaterThan(0);+ expect(c.metrics?.retention).toBeGreaterThan(0);+ }+ });++ it("groups into more than one episode", () => {+ const sources = new Set(demoClips().map((c) => c.source_video));+ expect(sources.size).toBeGreaterThan(1);+ });++ it("ships a thumbnail png for every clip", () => {+ for (const c of demoClips()) {+ expect(existsSync(c.thumbnail_config!.preview_path!)).toBe(true);+ }+ expect(existsSync(DEMO_ASSETS_DIR)).toBe(true);+ });+});++describe("ClipsHistory in demo mode", () => {+ afterEach(() => { delete process.env.PODCLI_DEMO; });++ it("serves fixtures and never persists writes", async () => {+ const { ClipsHistory } = await import("../services/clips-history.js");+ process.env.PODCLI_DEMO = "1";+ const history = new ClipsHistory();++ const listed = await history.list(500);+ expect(listed.length).toBe(demoClips().length);++ const first = listed[0];+ // A remove must not throw or delete shipped artifacts; it just echoes the entry.+ const removed = await history.remove(first.id);+ expect(removed?.id).toBe(first.id);+ expect(existsSync(first.thumbnail_config!.preview_path!)).toBe(true);+ // Still all there — the delete was a no-op against read-only fixtures.+ expect((await history.list(500)).length).toBe(demoClips().length);+ });+});diff --git a/src/ui/demo-fixtures.ts b/src/ui/demo-fixtures.tsnew file mode 100644index 0000000..a6f1445--- /dev/null+++ b/src/ui/demo-fixtures.ts@@ -0,0 +1,128 @@+// Demo mode: seed the studio with clean, on-brand sample clips so every page is+// screenshot-ready for the docs without rendering a real video. Enabled with+// PODCLI_DEMO=1. The clip identities and captions mirror the podcli.com showcase+// so the studio reads as the same product. See ClipsHistory.load()/save() and the+// web-server /api/image + /api/youtube/status demo branches for the wiring.++import { dirname, join, resolve } from "path";+import { existsSync } from "fs";+import { fileURLToPath } from "url";+import type { ClipHistoryEntry } from "../models/index.js";++// PNGs are shipped in src/ui/demo-assets and not copied into dist by tsc, so the+// compiled build falls back to the source dir (mirrors web-server's publicDir).+const here = dirname(fileURLToPath(import.meta.url));+const assetCandidates = [join(here, "demo-assets"), resolve(here, "..", "..", "src", "ui", "demo-assets")];+export const DEMO_ASSETS_DIR = assetCandidates.find(existsSync) ?? assetCandidates[0];++export function isDemoMode(): boolean {+ return process.env.PODCLI_DEMO === "1";+}++const preview = (id: string) => join(DEMO_ASSETS_DIR, `${id}.png`);++// Four "shows" mirror the landing showcase (Tech Daily / The Founder / Deep Dive /+// Long Story). Each source_video basename becomes one episode row in the Library.+const CLIPS: ReadonlyArray<Omit<ClipHistoryEntry, "output_path" | "thumbnail_config">> = [+ {+ id: "demo-tech-daily-1",+ source_video: "tech-daily-e148.mp4",+ start_second: 612.4, end_second: 640.9,+ caption_style: "branded", crop_strategy: "speaker", format: "vertical",+ title: "The one feature that doubled our retention",+ file_size_mb: 24.8, duration: 28.5, content_type: "technical_insight",+ created_at: "2026-07-05T14:20:00.000Z",+ youtube_video_id: "dq1Uq0tq1aA",+ metrics: { views: 42100, retention: 61.4, ctr: 7.2, impressions: 585000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+ {+ id: "demo-tech-daily-2",+ source_video: "tech-daily-e148.mp4",+ start_second: 1188.0, end_second: 1222.6,+ caption_style: "hormozi", crop_strategy: "speaker", format: "vertical",+ title: "Why we killed our best-selling product",+ file_size_mb: 30.1, duration: 34.6, content_type: "contrarian_take",+ created_at: "2026-07-05T14:22:00.000Z",+ youtube_video_id: "0Rt3zq9kf1o",+ metrics: { views: 18400, retention: 54.9, ctr: 6.1, impressions: 301000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+ {+ id: "demo-the-founder-1",+ source_video: "the-founder-e12.mp4",+ start_second: 402.1, end_second: 443.0,+ caption_style: "karaoke", crop_strategy: "speaker", format: "vertical",+ title: "How we scaled to 10k users with no ads",+ file_size_mb: 35.7, duration: 40.9, content_type: "story",+ created_at: "2026-07-04T18:05:00.000Z",+ youtube_video_id: "9bZkp7q19f0",+ metrics: { views: 96300, retention: 68.2, ctr: 9.1, impressions: 1058000, fetched_at: "2026-07-06T09:00:00.000Z" },+ generated_titles: [+ "How we scaled to 10k users with no ads",+ "10,000 users, $0 on ads. Here's how.",+ "The zero-budget growth loop that actually worked",+ ],+ description: "The founder breaks down the referral loop that took them from 0 to 10k users without spending a dollar on ads.",+ tags: "startup, growth, founder, saas",+ hashtags: "#startup #founder #growth",+ },+ {+ id: "demo-the-founder-2",+ source_video: "the-founder-e12.mp4",+ start_second: 2010.5, end_second: 2062.8,+ caption_style: "branded", crop_strategy: "face", format: "horizontal",+ title: "The hire that almost sank the company",+ file_size_mb: 58.3, duration: 52.3, content_type: "story",+ created_at: "2026-07-04T18:08:00.000Z",+ metrics: { views: 27700, retention: 58.6, ctr: 5.4, impressions: 512000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+ {+ id: "demo-deep-dive-1",+ source_video: "deep-dive-e07.mp4",+ start_second: 930.8, end_second: 954.7,+ caption_style: "subtle", crop_strategy: "speaker", format: "vertical",+ title: "That one call that changed everything",+ file_size_mb: 20.9, duration: 23.9, content_type: "emotional_peak",+ created_at: "2026-07-03T11:40:00.000Z",+ youtube_video_id: "kJQP7kiw5Fk",+ metrics: { views: 61200, retention: 64.7, ctr: 8.3, impressions: 738000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+ {+ id: "demo-deep-dive-2",+ source_video: "deep-dive-e07.mp4",+ start_second: 1502.2, end_second: 1532.5,+ caption_style: "branded", crop_strategy: "center", format: "square",+ title: "The research nobody wanted to fund",+ file_size_mb: 26.4, duration: 30.3, content_type: "technical_insight",+ created_at: "2026-07-03T11:44:00.000Z",+ metrics: { views: 14900, retention: 52.1, ctr: 5.9, impressions: 253000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+ {+ id: "demo-long-story-1",+ source_video: "long-story-e33.mp4",+ start_second: 744.0, end_second: 781.4,+ caption_style: "hormozi", crop_strategy: "speaker", format: "vertical",+ title: "It gets wild after the third year",+ file_size_mb: 32.6, duration: 37.4, content_type: "story",+ created_at: "2026-07-02T20:15:00.000Z",+ youtube_video_id: "L_jWHffIx5E",+ metrics: { views: 88700, retention: 66.9, ctr: 8.8, impressions: 964000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+ {+ id: "demo-long-story-2",+ source_video: "long-story-e33.mp4",+ start_second: 1890.7, end_second: 1912.9,+ caption_style: "karaoke", crop_strategy: "speaker", format: "vertical",+ title: "The moment we knew it would work",+ file_size_mb: 19.4, duration: 22.2, content_type: "emotional_peak",+ created_at: "2026-07-02T20:18:00.000Z",+ metrics: { views: 33500, retention: 62.3, ctr: 7.6, impressions: 441000, fetched_at: "2026-07-06T09:00:00.000Z" },+ },+];++export function demoClips(): ClipHistoryEntry[] {+ return CLIPS.map((c) => ({+ ...c,+ output_path: `demo/${c.id}.mp4`,+ thumbnail_config: { preview_path: preview(c.id), card_seconds: 1.5 },+ }));+}diff --git a/src/ui/web-server.ts b/src/ui/web-server.tsindex e97fd7d..a0a9e65 100644--- a/src/ui/web-server.ts+++ b/src/ui/web-server.ts@@ -37,6 +37,7 @@ import { AssetManager } from "../services/asset-manager.js";import { ClipsHistory } from "../services/clips-history.js";import { KnowledgeBase } from "../services/knowledge-base.js";import { paths } from "../config/paths.js";+import { DEMO_ASSETS_DIR } from "./demo-fixtures.js";import { registerConfigIntegrationRoutes } from "../handlers/integrations.routes.js";import { childLogger } from "../utils/logger.js";import { sliceTranscript, sliceWords, findContentType } from "../utils/transcript.js";@@ -62,6 +63,7 @@ const publicDir = existsSync(join(__dirname, "public", "index.html"))const app = express();const PORT = parseInt(process.env.PORT || "3847");+const DEMO = process.env.PODCLI_DEMO === "1";// --- Services ---const executor = new PythonExecutor();@@ -1473,6 +1475,7 @@ app.get("/api/image", (req, res) => {return;}const allowedRoots = [paths.output, paths.working, paths.assets].map((p) => path.resolve(p));+ if (DEMO) allowedRoots.push(path.resolve(DEMO_ASSETS_DIR));if (!allowedRoots.some((root) => resolved === root || resolved.startsWith(root + path.sep))) {res.status(403).json({ error: "access denied" });return;@@ -1611,6 +1614,7 @@ app.get("/api/encoder-info", async (_req, res) => {// --- Speaker Detection Status ---app.get("/api/speaker-status", (_req, res) => {+ if (DEMO) { res.json({ configured: true, setup_url: "", token_url: "" }); return; }const envPath = join(process.cwd(), ".env");let token = process.env.HF_TOKEN || "";if (!token && existsSync(envPath)) {@@ -1719,6 +1723,7 @@ async function bakeThumbnailCard(clipPath: string, image: string, stripStart = 0}app.patch("/api/clips/:id", async (req, res) => {+ if (DEMO) { res.json({ ok: true }); return; } // fixtures are read-onlyconst { title, caption_style, thumbnail_config } = req.body || {};const args = ["clips", "edit", req.params.id];if (title != null) args.push("--title", String(title));@@ -1737,6 +1742,7 @@ app.patch("/api/clips/:id", async (req, res) => {});app.delete("/api/clips/:id", async (req, res) => {+ if (DEMO) { res.json({ ok: true }); return; } // fixtures are read-onlyconst r = await runCli(["clips", "delete", req.params.id, "--yes"]);if (r.code !== 0) {res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "delete failed" });@@ -2017,7 +2023,7 @@ app.get("/api/youtube/status", async (_req, res) => {try {const clips = await clipsHistory.load();res.json({- authorized: existsSync(join(paths.home, "youtube-token.json")),+ authorized: DEMO || existsSync(join(paths.home, "youtube-token.json")),linked: clips.filter((c) => c.youtube_video_id).length,with_metrics: clips.filter((c) => c.metrics && (c.metrics.views != null || c.metrics.retention != null)).length,total: clips.length,