Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

Studio dashboard: history, per-clip re-iteration, analytics learning loop (#5)

Nika Siradze9fd995301e7f
diff --git a/backend/cli.py b/backend/cli.py
index 6625cea..be1304f 100644
--- a/backend/cli.py
+++ b/backend/cli.py
@@ -15,6 +15,7 @@ import json
import os
import shutil
import sys
+import textwrap
import time
_env_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".env")
@@ -356,15 +357,10 @@ def cmd_process(args):
print(f" Warning: Outro '{args.outro}' not found (checked assets and filesystem)", file=sys.stderr)
config["outro_path"] = args.outro
elif not config.get("outro_path"):
- # Auto-detect outro from registered assets
- try:
- from services.asset_store import list_assets as _list_assets_auto
- for a in _list_assets_auto():
- if a["type"] == "video" and os.path.exists(a["path"]):
- config["outro_path"] = a["path"]
- break
- except Exception:
- pass
+ from services.asset_store import default_outro
+ auto_outro = default_outro()
+ if auto_outro:
+ config["outro_path"] = auto_outro
if args.time_adjust is not None:
config["time_adjust"] = args.time_adjust
if args.no_energy:
@@ -994,8 +990,16 @@ class _Spinner:
print(f"\r{self._indent}{'':60}\r", end="")
+def _wrap_text(text: str, indent: str) -> str:
+ width = min(shutil.get_terminal_size((100, 24)).columns, 100)
+ return textwrap.fill(text, width=width, initial_indent=indent, subsequent_indent=indent)
+
+
def _print_clips(clips: list):
"""Print clip list in the standard format."""
+ width = min(shutil.get_terminal_size((100, 24)).columns, 100)
+ title_indent = " " * 14
+ why_indent = " " * 14
for i, c in enumerate(clips):
m_s = int(c["start_second"]) // 60
s_s = int(c["start_second"]) % 60
@@ -1007,9 +1011,10 @@ def _print_clips(clips: list):
cuts_tag = f" ({n_segs} cuts)" if n_segs > 1 else ""
selected = c.get("_selected", True)
marker = " ✓" if selected else " ✗"
- print(f" {marker} {i+1}. [{m_s}:{s_s:02d} → +{c['duration']}s] {score_str}{type_tag}{cuts_tag} {c['title'][:50]}")
+ header = f" {marker} {i+1}. [{m_s}:{s_s:02d} → +{c['duration']}s] {score_str}{type_tag}{cuts_tag} "
+ print(textwrap.fill(c.get("title", ""), width=width, initial_indent=header, subsequent_indent=title_indent))
if c.get("why"):
- print(f" {c['why'][:70]}")
+ print(textwrap.fill(c["why"], width=width, initial_indent=why_indent, subsequent_indent=why_indent))
def _find_moment_with_claude(description: str, segments: list, existing_clips: list) -> list:
@@ -1259,9 +1264,9 @@ def _review_clips(clips: list, segments: list, energy_scores: list | None, confi
s_s = int(f_clip["start_second"]) % 60
print(f" [{m_s}:{s_s:02d} → +{f_clip['duration']}s]")
if f_clip.get("quote"):
- print(f" {dim}\"{f_clip['quote'][:80]}\"{reset}")
+ print(f"{dim}{_wrap_text(chr(34) + f_clip['quote'] + chr(34), ' ')}{reset}")
if f_clip.get("why"):
- print(f" {dim}{f_clip['why'][:80]}{reset}")
+ print(f"{dim}{_wrap_text(f_clip['why'], ' ')}{reset}")
add = questionary.confirm(
f"Add {len(found)} found clip{'s' if len(found) > 1 else ''} to the list?",
@@ -1390,7 +1395,7 @@ def _post_render_loop(
for idx, r in enumerate(rendered):
clip = r["clip"]
- print(f"\n {accent}Clip {idx+1}/{len(rendered)}:{reset} {clip['title'][:50]}")
+ print(f"\n {accent}Clip {idx+1}/{len(rendered)}:{reset} {clip['title']}")
_open_clip(r)
while True:
@@ -1534,7 +1539,7 @@ def _post_render_loop(
s_s = int(f_clip["start_second"]) % 60
print(f" [{m_s}:{s_s:02d} → +{f_clip['duration']}s]")
if f_clip.get("quote"):
- print(f" {dim}\"{f_clip['quote'][:80]}\"{reset}")
+ print(f"{dim}{_wrap_text(chr(34) + f_clip['quote'] + chr(34), ' ')}{reset}")
render_it = questionary.confirm(
f"Render {len(found)} clip{'s' if len(found) > 1 else ''}?",
@@ -2118,57 +2123,115 @@ def cmd_init_thumbnail(args):
def cmd_thumbnails(args):
"""Generate thumbnail variations for a title."""
from services.thumbnail_ai import generate_variations
- from services.asset_store import resolve as resolve_asset
+ from services.asset_store import resolve as resolve_asset, resolve_logo
accent = "\033[38;2;212;135;74m"
green = "\033[38;2;74;222;128m"
gray = "\033[38;5;245m"
+ red = "\033[38;2;248;113;113m"
bold = "\033[1m"
reset = "\033[0m"
- logo = None
- if args.logo:
- logo = resolve_asset(args.logo)
- else:
- # Auto-use first logo asset
- try:
- from services.asset_store import list_assets
- logos = [a for a in list_assets() if a["type"] == "logo" and os.path.exists(a["path"])]
- if logos:
- logo = logos[0]["path"]
- except Exception:
- pass
+ logo = resolve_logo(args.logo)
photo = None
if args.photo:
photo = resolve_asset(args.photo)
- print(f"\n {bold}Generating {args.variations} thumbnail variations...{reset}")
- print(f" Title: {accent}{args.title}{reset}")
-
video = getattr(args, "video", None)
+ as_json = getattr(args, "json", False)
+
+ # An exact timestamp wins: extract that frame from the video and use it as the photo.
+ timestamp = getattr(args, "timestamp", None)
+ if photo is None and video and timestamp is not None:
+ if not os.path.exists(video):
+ print(f" {red}✗{reset} Video not found: {video}", file=sys.stderr)
+ sys.exit(1)
+ import cv2
+ os.makedirs(args.output, exist_ok=True)
+ cap = cv2.VideoCapture(video)
+ cap.set(cv2.CAP_PROP_POS_MSEC, timestamp * 1000)
+ ok, frame = cap.read()
+ cap.release()
+ if ok:
+ photo = os.path.join(args.output, "_picked_frame.png")
+ cv2.imwrite(photo, frame)
+
+ if not as_json:
+ print(f"\n {bold}Generating {args.variations} thumbnail variations...{reset}")
+ print(f" Title: {accent}{args.title}{reset}")
paths = generate_variations(
title=args.title,
output_dir=args.output,
photo_path=photo,
video_path=video,
+ start_second=getattr(args, "start", None),
+ end_second=getattr(args, "end", None),
logo_path=logo,
config={"variations": args.variations},
+ line1=getattr(args, "line1", None),
+ line2=getattr(args, "line2", None),
)
+ if as_json:
+ print(json.dumps({"paths": paths}))
+ return
+
for p in paths:
print(f" {green}✓{reset} {p}")
+ print(f"\n {gray}Open the folder to preview and pick the best one.{reset}\n")
+
+
+def cmd_bake_thumbnail(args):
+ """Composite a thumbnail PNG into a clip as an opening (or closing) card, in place."""
+ import tempfile, shutil
+ from services.thumbnail_ai import thumbnail_to_video_frame
+ from services.video_processor import concat_outro, _get_media_duration_seconds
+
+ green = "\033[38;2;74;222;128m"
+ red = "\033[38;2;248;113;113m"
+ gray = "\033[38;5;245m"
+ reset = "\033[0m"
+ if not os.path.exists(args.clip):
+ print(f" {red}✗{reset} Clip not found: {args.clip}", file=sys.stderr); sys.exit(1)
+ if not os.path.exists(args.image):
+ print(f" {red}✗{reset} Image not found: {args.image}", file=sys.stderr); sys.exit(1)
- print(f"\n {gray}Open the folder to preview and pick the best one.{reset}")
- print(f" {gray}Edit .podcli/thumbnail-config.json to customize colors, fonts, layout.{reset}\n")
+ work = tempfile.mkdtemp(prefix="bake_thumb_")
+ try:
+ clip = args.clip
+ # Strip a prior card off the start, if asked (avoids stacking on re-bake).
+ if args.strip_start and args.strip_start > 0.05:
+ total = _get_media_duration_seconds(clip, default=0.0)
+ if total > args.strip_start + 0.2:
+ from utils.proc import run as proc_run
+ trimmed = os.path.join(work, "trimmed.mp4")
+ proc_run(["ffmpeg", "-y", "-ss", str(args.strip_start), "-i", clip, "-c", "copy",
+ "-movflags", "+faststart", trimmed], timeout=120, check=False)
+ if os.path.exists(trimmed):
+ clip = trimmed
+
+ card = os.path.join(work, "card.mp4")
+ thumbnail_to_video_frame(args.image, card, duration=args.duration)
+ out = os.path.join(work, "baked.mp4")
+ if args.position == "start":
+ concat_outro(card, clip, out, crossfade_duration=0.0, transition="fade")
+ else:
+ concat_outro(clip, card, out, crossfade_duration=0.0, transition="fade")
+ if not os.path.exists(out):
+ print(f" {red}✗{reset} Bake failed", file=sys.stderr); sys.exit(1)
+ shutil.move(out, args.clip)
+ print(f" {green}✓{reset} Baked thumbnail card ({args.position}) into {os.path.basename(args.clip)}")
+ finally:
+ shutil.rmtree(work, ignore_errors=True)
def cmd_swap_thumbnail(args):
"""Regenerate and swap the thumbnail on an existing rendered clip."""
from services.thumbnail_ai import generate_variations, thumbnail_to_video_frame
from services.video_processor import concat_outro, _get_media_duration_seconds
- from services.asset_store import resolve as resolve_asset
+ from services.asset_store import resolve_logo
accent = "\033[38;2;212;135;74m"
green = "\033[38;2;74;222;128m"
@@ -2195,17 +2258,7 @@ def cmd_swap_thumbnail(args):
print(f" ✗ Source video not found: {source_video}", file=sys.stderr)
sys.exit(1)
- logo = None
- if getattr(args, "logo", None):
- logo = resolve_asset(args.logo)
- else:
- try:
- from services.asset_store import list_assets
- logos = [a for a in list_assets() if a["type"] == "logo" and os.path.exists(a["path"])]
- if logos:
- logo = logos[0]["path"]
- except Exception:
- pass
+ logo = resolve_logo(getattr(args, "logo", None))
# Step 1: Trim the old thumbnail from the clip
clip_duration = _get_media_duration_seconds(clip_path, default=0.0)
@@ -2242,9 +2295,16 @@ def cmd_swap_thumbnail(args):
start_sec = getattr(args, "start", None)
end_sec = getattr(args, "end", None)
- # If exact timestamp given, extract that specific frame
+ # A user-supplied image wins over any frame extraction.
frame_path = None
- if timestamp is not None:
+ custom_image = getattr(args, "image", None)
+ if custom_image:
+ if not os.path.exists(custom_image):
+ print(f" ✗ Image not found: {custom_image}", file=sys.stderr)
+ sys.exit(1)
+ frame_path = custom_image
+ print(f" {green}✓{reset} Using uploaded image")
+ if frame_path is None and timestamp is not None:
import cv2
cap = cv2.VideoCapture(source_video)
cap.set(cv2.CAP_PROP_POS_MSEC, timestamp * 1000)
@@ -2513,6 +2573,240 @@ def _print_config_result(action: str, data: dict) -> None:
print(f" {gray}{data.get('home')}{reset}\n")
+def cmd_clips(args):
+ """Browse and edit saved clips (.podcli/history/clips.json)."""
+ from services.clips_history import (
+ list_clips,
+ get_clips_by_source,
+ find_clip,
+ update_clip,
+ delete_clip,
+ )
+
+ accent = "\033[38;2;212;135;74m"
+ gray = "\033[38;5;245m"
+ green = "\033[38;2;74;222;128m"
+ red = "\033[38;2;248;113;113m"
+ bold = "\033[1m"
+ dim = "\033[2m"
+ reset = "\033[0m"
+
+ action = getattr(args, "clips_action", None) or "list"
+
+ if action == "list":
+ source = getattr(args, "source", None)
+ limit = getattr(args, "limit", 50)
+ clips = get_clips_by_source(source)[:limit] if source else list_clips(limit)
+ if not clips:
+ print(f"\n {gray}No clips yet — render one with{reset} {accent}podcli process{reset}\n")
+ return
+ print(f"\n {bold}Recent clips ({len(clips)}){reset}\n")
+ for c in clips:
+ cid = str(c.get("id", "?"))[:8]
+ ctype = c.get("content_type")
+ tag = f" {dim}{ctype}{reset}" if ctype else ""
+ dur = c.get("duration", 0)
+ print(f" {accent}{cid}{reset} {bold}{c.get('title', 'untitled')}{reset}{tag}")
+ print(
+ f" {gray}{os.path.basename(c.get('source_video', '?'))}"
+ f" · {dur:.0f}s · {c.get('caption_style', '?')}"
+ f" · {c.get('created_at', '?')[:10]}{reset}"
+ )
+ print(f"\n {gray}Edit:{reset} {accent}podcli clips edit <id> --title \"…\"{reset}"
+ f" {gray}Reopen:{reset} {accent}podcli clips reopen <id>{reset}\n")
+ return
+
+ if action == "edit":
+ clip = find_clip(args.clip_id)
+ if not clip:
+ print(f"\n {red}✗{reset} Clip not found: {args.clip_id}\n", file=sys.stderr)
+ sys.exit(1)
+ title = getattr(args, "title", None)
+ caption_style = getattr(args, "caption_style", None)
+ thumb_cfg_raw = getattr(args, "thumbnail_config", None)
+ thumbnail_config = None
+ if thumb_cfg_raw:
+ try:
+ thumbnail_config = json.loads(thumb_cfg_raw)
+ except json.JSONDecodeError as e:
+ print(f"\n {red}✗{reset} Invalid --thumbnail-config JSON: {e}\n", file=sys.stderr)
+ sys.exit(1)
+ if title is None and caption_style is None and thumbnail_config is None:
+ print(f"\n {red}✗{reset} Nothing to change\n", file=sys.stderr)
+ sys.exit(1)
+ updated = update_clip(args.clip_id, title=title, caption_style=caption_style, thumbnail_config=thumbnail_config)
+ print(f"\n {green}✓{reset} Updated {accent}{str(updated['id'])[:8]}{reset} {bold}{updated.get('title')}{reset}")
+ print(f" {gray}caption: {updated.get('caption_style')}{reset}\n")
+ return
+
+ if action == "delete":
+ clip = find_clip(args.clip_id)
+ if not clip:
+ print(f"\n {red}✗{reset} Clip not found: {args.clip_id}\n", file=sys.stderr)
+ sys.exit(1)
+ if not getattr(args, "yes", False):
+ title = clip.get("title", "untitled")
+ try:
+ confirm = input(f"\n Delete {bold}{title}{reset} and its rendered file? [y/N] ")
+ except EOFError:
+ confirm = ""
+ if confirm.strip().lower() not in ("y", "yes"):
+ print(f" {gray}Cancelled.{reset}\n")
+ return
+ removed = delete_clip(args.clip_id)
+ print(f"\n {green}✓{reset} Deleted {accent}{str(removed['id'])[:8]}{reset} {bold}{removed.get('title')}{reset}\n")
+ return
+
+ if action == "reopen":
+ clip = find_clip(args.clip_id)
+ if not clip:
+ print(f"\n {red}✗{reset} Clip not found: {args.clip_id}\n", file=sys.stderr)
+ sys.exit(1)
+ source_video = clip.get("source_video", "")
+ ui_state_path = paths["uiState"]
+ existing = {}
+ try:
+ if os.path.exists(ui_state_path):
+ with open(ui_state_path) as f:
+ existing = json.load(f) or {}
+ except Exception:
+ existing = {}
+
+ # Preserve the loaded transcript only if it belongs to the same source video.
+ same_source = os.path.basename(existing.get("videoPath", "")) == os.path.basename(source_video)
+ transcript = existing.get("transcript") if same_source else None
+
+ suggestion = {
+ "clip_id": clip.get("id"),
+ "title": clip.get("title", "clip"),
+ "start_second": clip.get("start_second", 0),
+ "end_second": clip.get("end_second", 0),
+ "duration": clip.get("duration", 0),
+ "reasoning": "",
+ "preview_text": clip.get("transcript_slice", ""),
+ "suggested_caption_style": clip.get("caption_style"),
+ "content_type": clip.get("content_type"),
+ }
+ state = {
+ "videoPath": source_video,
+ "filePath": source_video,
+ "transcript": transcript,
+ "suggestions": [suggestion],
+ "deselectedIndices": [],
+ "settings": {"captionStyle": clip.get("caption_style"), "cropStrategy": clip.get("crop_strategy")},
+ "phase": "reviewing",
+ }
+ os.makedirs(os.path.dirname(ui_state_path), exist_ok=True)
+ with open(ui_state_path, "w") as f:
+ json.dump(state, f, indent=2, ensure_ascii=False)
+
+ print(f"\n {green}✓{reset} Reopened {accent}{str(clip.get('id'))[:8]}{reset} {bold}{clip.get('title')}{reset}")
+ if not transcript:
+ print(f" {gray}Transcript not loaded — re-transcribe in the studio to edit captions.{reset}")
+ print(f" {gray}Open the studio:{reset} {accent}http://localhost:3847/clip/{clip.get('id')}{reset}\n")
+ return
+
+
+def cmd_youtube(args):
+ """Link clips to YouTube videos and sync performance metrics."""
+ accent = "\033[38;2;212;135;74m"
+ gray = "\033[38;5;245m"
+ green = "\033[38;2;74;222;128m"
+ red = "\033[38;2;248;113;113m"
+ bold = "\033[1m"
+ reset = "\033[0m"
+
+ action = getattr(args, "youtube_action", None) or "status"
+
+ def fail(e):
+ print(f"\n {red}✗{reset} {e}\n", file=sys.stderr)
+ sys.exit(1)
+
+ if action == "auth":
+ from services.integrations.youtube import client
+ try:
+ client.authorize()
+ print(f"\n {green}✓{reset} Authorized — token cached.\n")
+ except Exception as e:
+ fail(e)
+ return
+
+ if action == "status":
+ from services.integrations.youtube import client
+ from services.clips_history import load_clips_history
+ clips = load_clips_history()
+ linked = [c for c in clips if c.get("youtube_video_id")]
+ synced = [c for c in clips if c.get("metrics")]
+ print(f"\n {bold}YouTube{reset}")
+ print(f" {gray}Authorized:{reset} {'yes' if client.is_authorized() else 'no'}")
+ print(f" {gray}Clips linked:{reset} {len(linked)}")
+ print(f" {gray}Clips with metrics:{reset} {len(synced)}\n")
+ return
+
+ if action == "link":
+ from services.integrations.youtube import sync
+ as_json = getattr(args, "json", False)
+ clip_id = getattr(args, "clip_id", None)
+ video_id = getattr(args, "video_id", None)
+ if clip_id and video_id:
+ ok = sync.set_link(clip_id, video_id)
+ if as_json:
+ print(json.dumps({"ok": ok, "clip_id": clip_id, "video_id": video_id}))
+ elif ok:
+ print(f"\n {green}✓{reset} Linked {accent}{clip_id[:8]}{reset} → {video_id}\n")
+ else:
+ fail(f"clip not found: {clip_id}")
+ return
+ try:
+ proposals = sync.propose_links()
+ except Exception as e:
+ if as_json:
+ print(json.dumps({"error": str(e)}))
+ sys.exit(1)
+ fail(e)
+ if as_json:
+ print(json.dumps({"proposals": proposals}))
+ return
+ if not proposals:
+ print(f"\n {gray}No link proposals (all clips linked, or no uploads matched).{reset}\n")
+ return
+ print(f"\n {bold}Proposed links ({len(proposals)}){reset} {gray}— confirm with: youtube link <clip_id> <video_id>{reset}\n")
+ for p in proposals:
+ print(f" {accent}{p['clip_id'][:8]}{reset} {p['clip_title']}")
+ print(f" {gray}→ {p['video_id']} {p['video_title']} (score {p['score']}){reset}")
+ print()
+ return
+
+ if action == "sync":
+ from services.integrations.youtube import sync
+ csv_path = getattr(args, "csv", None)
+ try:
+ if csv_path:
+ res = sync.sync_from_csv(csv_path)
+ print(f"\n {green}✓{reset} Matched {res['matched']} clip(s) from {res['rows']} CSV row(s).")
+ for link in res.get("links", []):
+ tone = gray if link["score"] >= 0.8 else red
+ print(f" {tone}{link['score']}{reset} \"{link['clip_title']}\" ← \"{link['row_title']}\"")
+ if res["unmatched"]:
+ print(f" {gray}Unmatched: {len(res['unmatched'])}{reset}")
+ print(f" {gray}Low scores are fuzzy title matches — verify them.{reset}\n")
+ else:
+ n = sync.sync_metrics()
+ print(f"\n {green}✓{reset} Synced metrics onto {n} linked clip(s).\n")
+ except Exception as e:
+ fail(e)
+ return
+
+ if action == "learn":
+ from services.integrations.youtube import learnings
+ path = learnings.write_semantic_learnings()
+ if path:
+ print(f"\n {green}✓{reset} Wrote performance analysis to {accent}{path}{reset}\n")
+ else:
+ print(f"\n {gray}Not enough mature clips with metrics, or no AI CLI available.{reset}\n")
+ return
+
+
def cmd_config(args):
"""Export, import, and activate config profiles."""
from config_bundle import run_config_action
@@ -2928,11 +3222,18 @@ def main():
thumb.add_argument("--video", help="Video to extract face frame from")
thumb.add_argument("--logo", help="Logo (asset name or path)")
thumb.add_argument("-n", "--variations", type=int, default=3, help="Number of variations")
+ thumb.add_argument("--timestamp", type=float, help="Exact second in --video to use as the frame")
+ thumb.add_argument("--start", type=float, help="Frame search window start (seconds)")
+ thumb.add_argument("--end", type=float, help="Frame search window end (seconds)")
+ thumb.add_argument("--line1", help="Explicit first thumbnail line (skips AI rewrite)")
+ thumb.add_argument("--line2", help="Explicit second thumbnail line")
+ thumb.add_argument("--json", action="store_true", help="Emit JSON {paths:[...]} to stdout")
# ── swap-thumbnail ──
st = sub.add_parser("swap-thumbnail", help="Regenerate thumbnail on an existing clip")
st.add_argument("clip", help="Path to rendered clip (.mp4)")
st.add_argument("--title", help="Title text (defaults to filename)")
+ st.add_argument("--image", help="Use this image as the thumbnail background instead of a video frame")
st.add_argument("--source-video", required=True, help="Original source video (required — rendered clips have captions burned in)")
st.add_argument("--start", type=float, help="Clip start time in source video (seconds)")
st.add_argument("--end", type=float, help="Clip end time in source video (seconds)")
@@ -2964,6 +3265,48 @@ def main():
kb_del = kb_sub.add_parser("delete", help="Delete a knowledge file")
kb_del.add_argument("filename", help="File name to delete")
+ # ── clips ──
+ clips_p = sub.add_parser("clips", help="Browse and edit saved clips")
+ clips_sub = clips_p.add_subparsers(dest="clips_action")
+ clips_list = clips_sub.add_parser("list", help="List recent clips")
+ clips_list.add_argument("-n", "--limit", type=int, default=50, help="Max clips to show")
+ clips_list.add_argument("--source", help="Only clips from this source video (basename match)")
+ clips_edit = clips_sub.add_parser("edit", help="Edit a clip's metadata (title, caption style)")
+ clips_edit.add_argument("clip_id", help="Clip id (full or 8-char prefix)")
+ clips_edit.add_argument("--title", help="New title")
+ clips_edit.add_argument(
+ "--caption-style", choices=["branded", "hormozi", "karaoke", "subtle"], help="New caption style"
+ )
+ clips_edit.add_argument("--thumbnail-config", help="Per-clip thumbnail config as a JSON string")
+ clips_reopen = clips_sub.add_parser(
+ "reopen", help="Load a clip back into the studio editor for re-iteration"
+ )
+ clips_reopen.add_argument("clip_id", help="Clip id (full or 8-char prefix)")
+ clips_delete = clips_sub.add_parser("delete", help="Delete a clip and its rendered output")
+ clips_delete.add_argument("clip_id", help="Clip id (full or 8-char prefix)")
+ clips_delete.add_argument("--yes", "-y", action="store_true", help="Skip confirmation prompt")
+
+ # ── bake-thumbnail ──
+ bt = sub.add_parser("bake-thumbnail", help="Composite a thumbnail PNG into a clip as an opening card")
+ bt.add_argument("clip", help="Rendered clip (.mp4) to modify in place")
+ bt.add_argument("image", help="Thumbnail PNG to bake in")
+ bt.add_argument("--duration", type=float, default=1.5, help="Card duration seconds (default 1.5)")
+ bt.add_argument("--position", choices=["start", "end"], default="start", help="Card position")
+ bt.add_argument("--strip-start", type=float, default=0.0, help="Trim this many seconds off the start first (removes a prior card)")
+
+ # ── youtube ──
+ yt = sub.add_parser("youtube", help="Link clips to YouTube videos and sync performance")
+ yt_sub = yt.add_subparsers(dest="youtube_action")
+ yt_sub.add_parser("auth", help="Authorize via Google OAuth (loopback)")
+ yt_sub.add_parser("status", help="Show auth state + linked/synced counts")
+ yt_link = yt_sub.add_parser("link", help="Propose clip↔video links, or set one explicitly")
+ yt_link.add_argument("clip_id", nargs="?", help="Clip id (omit to list proposals)")
+ yt_link.add_argument("video_id", nargs="?", help="YouTube video id to link")
+ yt_link.add_argument("--json", action="store_true", help="Emit proposals/result as JSON (for the web UI)")
+ yt_sync = yt_sub.add_parser("sync", help="Sync performance onto linked clips")
+ yt_sync.add_argument("--csv", help="Import from a YouTube Studio analytics CSV (no auth)")
+ yt_sub.add_parser("learn", help="AI pass: analyze winners vs losers into the knowledge base")
+
# ── config ──
cfg = sub.add_parser("config", help="Export, import, and activate config profiles")
cfg_sub = cfg.add_subparsers(dest="config_action")
@@ -3015,6 +3358,8 @@ def main():
cmd_thumbnails(args)
elif args.command == "swap-thumbnail":
cmd_swap_thumbnail(args)
+ elif args.command == "bake-thumbnail":
+ cmd_bake_thumbnail(args)
elif args.command == "presets":
cmd_presets(args)
elif args.command == "assets":
@@ -3023,6 +3368,10 @@ def main():
cmd_corrections(args)
elif args.command == "knowledge":
cmd_knowledge(args)
+ elif args.command == "clips":
+ cmd_clips(args)
+ elif args.command == "youtube":
+ cmd_youtube(args)
elif args.command == "config":
cmd_config(args)
elif args.command == "cache":
@@ -3100,9 +3449,19 @@ def interactive_menu():
_interactive_process()
return
elif choice == "webui":
- print(f"\n {gray}Starting Web UI...{reset}\n")
import subprocess as sp
- sp.run(["npm", "run", "ui"], cwd=os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
+ repo = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
+ spa = os.path.join(repo, "dist", "ui", "public", "index.html")
+ port = os.environ.get("PORT", "3847")
+ ok = True
+ if not os.path.exists(spa):
+ print(f"\n {gray}Building the studio (first run)…{reset}\n")
+ ok = sp.run(["npm", "run", "build"], cwd=repo).returncode == 0
+ if not ok:
+ print(f"\n {yellow}Build failed — run 'npm install' then try again.{reset}\n")
+ if ok:
+ print(f"\n {gray}Studio:{reset} {accent}http://localhost:{port}{reset} {dim}(Ctrl+C to stop){reset}\n")
+ sp.run(["npm", "run", "ui:prod"], cwd=repo)
elif choice == "assets":
_interactive_assets()
elif choice == "presets":
@@ -3612,9 +3971,9 @@ def _interactive_config():
import webbrowser
port = os.environ.get("PORT", "3847")
- url = f"http://localhost:{port}/config.html"
+ url = f"http://localhost:{port}/config"
print(f"\n {gray}Config UI:{reset} {url}")
- print(f" {dim}Start the UI first if needed: npm run ui{reset}\n")
+ print(f" {dim}Serve the UI first if needed: npm run build && npm run ui:prod{reset}\n")
webbrowser.open(url)
questionary.press_any_key_to_continue(style=qstyle).ask()
continue
diff --git a/backend/main.py b/backend/main.py
index aa9d2e8..3500810 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -18,7 +18,7 @@ except ImportError:
pass
import traceback
-def emit_progress(task_id: str, stage: str, percent: int, message: str):
+def emit_progress(task_id: str, stage: str, percent: int, message: str, **extra):
"""Write a progress event to stderr (picked up by TypeScript executor)."""
event = {
"task_id": task_id,
@@ -26,6 +26,7 @@ def emit_progress(task_id: str, stage: str, percent: int, message: str):
"percent": percent,
"message": message,
}
+ event.update(extra)
print(json.dumps(event), file=sys.stderr, flush=True)
@@ -104,6 +105,7 @@ def handle_create_clip(task_id: str, params: dict):
end_second=params["end_second"],
caption_style=params.get("caption_style", "hormozi"),
crop_strategy=params.get("crop_strategy", "face"),
+ crop_keyframes=params.get("crop_keyframes"),
transcript_words=params.get("transcript_words", []),
title=params.get("title", "clip"),
output_dir=params.get("output_dir"),
@@ -159,13 +161,21 @@ def handle_batch_clips(task_id: str, params: dict):
task_id, "batch", int((_i / total) * 100 + pct / total), msg
),
)
- results.append({
+ row = {
"clip_index": i,
"status": "success",
"start_second": clip["start_second"],
"end_second": clip["end_second"],
**result,
- })
+ }
+ results.append(row)
+ emit_progress(
+ task_id,
+ "clip_complete",
+ int(((i + 1) / total) * 100),
+ f"Clip {i + 1}/{total} complete",
+ clip_result=row,
+ )
except Exception as e:
results.append({"clip_index": i, "status": "error", "error": str(e)})
diff --git a/backend/requirements.txt b/backend/requirements.txt
index 5b6744b..ca445ef 100644
--- a/backend/requirements.txt
+++ b/backend/requirements.txt
@@ -20,3 +20,7 @@ questionary>=2.0.0
# Utilities
python-dotenv>=1.0.0
+
+# YouTube analytics (optional — only needed for live OAuth sync; CSV import works without these)
+google-api-python-client>=2.0.0
+google-auth-oauthlib>=1.0.0
diff --git a/backend/services/asset_store.py b/backend/services/asset_store.py
index 9e2ced1..b0c0672 100644
--- a/backend/services/asset_store.py
+++ b/backend/services/asset_store.py
@@ -106,6 +106,36 @@ def list_assets(asset_type: Optional[str] = None) -> list[dict]:
return assets
+def default_logo() -> Optional[str]:
+ """First registered logo whose file still exists, else None."""
+ for a in list_assets("logo"):
+ if os.path.exists(a["path"]):
+ return a["path"]
+ return None
+
+
+def default_outro() -> Optional[str]:
+ """First registered video asset whose file still exists, else None."""
+ for a in list_assets("video"):
+ if os.path.exists(a["path"]):
+ return a["path"]
+ return None
+
+
+def resolve_logo(explicit: Optional[str]) -> Optional[str]:
+ """Resolve an explicit logo name/path, falling back to the default logo."""
+ if explicit:
+ return resolve(explicit)
+ return default_logo()
+
+
+def resolve_outro(explicit: Optional[str]) -> Optional[str]:
+ """Resolve an explicit outro name/path, falling back to the default outro."""
+ if explicit:
+ return resolve(explicit)
+ return default_outro()
+
+
def resolve(name_or_path: str) -> Optional[str]:
"""
Resolve a name or path to an absolute file path.
diff --git a/backend/services/clip_generator.py b/backend/services/clip_generator.py
index a6e4c0c..ec6220e 100644
--- a/backend/services/clip_generator.py
+++ b/backend/services/clip_generator.py
@@ -569,6 +569,7 @@ def generate_clip(
end_second: float,
caption_style: str = "hormozi",
crop_strategy: str = "face",
+ crop_keyframes: list[dict] = None,
transcript_words: list[dict] = None,
title: str = "clip",
output_dir: Optional[str] = None,
@@ -772,6 +773,7 @@ def generate_clip(
transcript_words=crop_words,
clip_start=crop_clip_start,
face_map=face_map,
+ crop_keyframes=crop_keyframes,
)
# Step 3: Render captions (Remotion-first; ASS fallback optional)
diff --git a/backend/services/clips_history.py b/backend/services/clips_history.py
new file mode 100644
index 0000000..171aa2d
--- /dev/null
+++ b/backend/services/clips_history.py
@@ -0,0 +1,144 @@
+"""
+Clip history — read/write .podcli/history/clips.json.
+
+Shared on-disk contract with the TypeScript ClipsHistory service
+(src/services/clips-history.ts). Both languages read and write the same
+file; this module is the Python writer used by the CLI.
+
+Entry shape (all fields beyond the core render record are optional):
+ id, source_video, start_second, end_second, caption_style, crop_strategy,
+ logo_path?, title, output_path, file_size_mb, duration, created_at,
+ content_type?, transcript_slice?, youtube_video_id?, metrics?
+
+metrics? = {views?, retention?, ctr?, impressions?, fetched_at?} (Phase 2)
+
+Rule: writes are read-modify-write and MUST preserve unknown keys, so fields
+written by the other language (e.g. Phase 2 metrics) are never clobbered.
+"""
+
+import json
+import os
+import shutil
+from typing import Optional
+
+from config.paths import paths
+
+_CLIPS_HISTORY_PATH = paths["clipsHistory"]
+
+
+def load_clips_history() -> list[dict]:
+ """Load all clip entries. Returns [] if the file is missing or unreadable."""
+ if not os.path.exists(_CLIPS_HISTORY_PATH):
+ return []
+ try:
+ with open(_CLIPS_HISTORY_PATH) as f:
+ data = json.load(f)
+ return data if isinstance(data, list) else []
+ except Exception:
+ return []
+
+
+def save_clips_history(entries: list[dict]) -> str:
+ """Persist the full entry list atomically. Returns the file path.
+
+ Writes a temp file then os.replace()s it into place so a crash or a
+ concurrent reader (the TS web server) never sees a half-written file.
+ """
+ os.makedirs(os.path.dirname(_CLIPS_HISTORY_PATH), exist_ok=True)
+ tmp = f"{_CLIPS_HISTORY_PATH}.{os.getpid()}.tmp"
+ with open(tmp, "w") as f:
+ json.dump(entries, f, indent=2, ensure_ascii=False)
+ os.replace(tmp, _CLIPS_HISTORY_PATH)
+ return _CLIPS_HISTORY_PATH
+
+
+def list_clips(limit: int = 50) -> list[dict]:
+ """Most recent clips first."""
+ entries = load_clips_history()
+ return entries[-limit:][::-1]
+
+
+def get_clips_by_source(video_path: str) -> list[dict]:
+ """All clips from a source video (basename match), newest first."""
+ target = os.path.basename(video_path)
+ entries = load_clips_history()
+ return [e for e in entries if os.path.basename(e.get("source_video", "")) == target][::-1]
+
+
+def find_clip(clip_id: str) -> Optional[dict]:
+ """Find by exact id, falling back to an unambiguous 8-char prefix match."""
+ if not clip_id:
+ return None
+ entries = load_clips_history()
+ for e in entries:
+ if e.get("id") == clip_id:
+ return e
+ prefix_matches = [e for e in entries if str(e.get("id", "")).startswith(clip_id)]
+ return prefix_matches[0] if len(prefix_matches) == 1 else None
+
+
+def _clip_sidecar_paths(clip_id: str) -> list[str]:
+ """Per-clip sidecar files (words/recipe/reframe) and the thumbnail dir."""
+ history_dir = os.path.dirname(_CLIPS_HISTORY_PATH)
+ return [
+ os.path.join(history_dir, "words", f"{clip_id}.json"),
+ os.path.join(history_dir, "recipes", f"{clip_id}.json"),
+ os.path.join(history_dir, "reframe", f"{clip_id}.json"),
+ ]
+
+
+def delete_clip(clip_id: str) -> Optional[dict]:
+ """Remove a clip from history along with its rendered output and sidecars.
+
+ Returns the removed entry, or None if no clip matched. The source video is
+ never touched — only artifacts podcli rendered for this clip.
+ """
+ target = find_clip(clip_id)
+ if target is None:
+ return None
+ full_id = str(target.get("id"))
+ entries = load_clips_history()
+ save_clips_history([e for e in entries if str(e.get("id")) != full_id])
+
+ artifacts = list(_clip_sidecar_paths(full_id))
+ output_path = target.get("output_path")
+ if output_path:
+ artifacts.append(output_path)
+ for path in artifacts:
+ try:
+ if path and os.path.isfile(path):
+ os.remove(path)
+ except OSError:
+ pass
+
+ thumb_dir = os.path.join(paths["output"], "thumbnails", full_id)
+ try:
+ if os.path.isdir(thumb_dir):
+ shutil.rmtree(thumb_dir)
+ except OSError:
+ pass
+ return target
+
+
+def update_clip(clip_id: str, **fields) -> Optional[dict]:
+ """Update a clip in place, preserving all unknown keys. Returns the updated entry or None.
+
+ Only keys with non-None values are applied, so callers can pass optional
+ edits without overwriting existing data with None.
+ """
+ target = find_clip(clip_id)
+ if target is None:
+ return None
+ entries = load_clips_history()
+ updated = None
+ for e in entries:
+ if e.get("id") == target.get("id"):
+ for key, value in fields.items():
+ if value is not None:
+ e[key] = value
+ updated = e
+ break
+ if updated is None:
+ return None
+ save_clips_history(entries)
+ return updated
diff --git a/backend/services/integrations/__init__.py b/backend/services/integrations/__init__.py
index 867e9b1..60bc79d 100644
--- a/backend/services/integrations/__init__.py
+++ b/backend/services/integrations/__init__.py
@@ -2,5 +2,6 @@
from .base import IntegrationBase, IntegrationRegistry, ToolSpec
from .manager import IntegrationsManager
from . import davinci_resolve as _davinci_resolve # noqa: F401
+from . import youtube as _youtube # noqa: F401
__all__ = ["IntegrationBase", "IntegrationRegistry", "ToolSpec", "IntegrationsManager"]
diff --git a/backend/services/integrations/youtube/__init__.py b/backend/services/integrations/youtube/__init__.py
new file mode 100644
index 0000000..768bb44
--- /dev/null
+++ b/backend/services/integrations/youtube/__init__.py
@@ -0,0 +1,2 @@
+"""YouTube analytics integration."""
+from . import integration # noqa: F401 (registers on import)
diff --git a/backend/services/integrations/youtube/client.py b/backend/services/integrations/youtube/client.py
new file mode 100644
index 0000000..2181ea1
--- /dev/null
+++ b/backend/services/integrations/youtube/client.py
@@ -0,0 +1,206 @@
+"""YouTube Data + Analytics client and CSV importer.
+
+Two ways to get per-video performance into podcli:
+ 1. OAuth (bring-your-own Google Cloud creds) — full, live metrics.
+ 2. CSV export from YouTube Studio — no auth, works offline.
+
+The google-api libraries are imported lazily so the rest of podcli runs
+without them; OAuth paths raise a clear, actionable error when they're absent.
+"""
+from __future__ import annotations
+
+import csv
+import json
+import os
+from typing import Any, Optional
+
+from config.paths import paths
+
+SCOPES = [
+ "https://www.googleapis.com/auth/youtube.readonly",
+ "https://www.googleapis.com/auth/yt-analytics.readonly",
+]
+_TOKEN_PATH = os.path.join(os.path.dirname(paths["integrations"]), "youtube-token.json")
+
+
+def _yt_config() -> dict[str, Any]:
+ """The 'youtube' block of integrations.json (client_id/client_secret/...)."""
+ try:
+ with open(paths["integrations"]) as f:
+ return (json.load(f).get("youtube") or {})
+ except Exception:
+ return {}
+
+
+def is_authorized() -> bool:
+ """True only if a cached token actually carries a refresh token (not just present)."""
+ try:
+ with open(_TOKEN_PATH) as f:
+ return bool((json.load(f) or {}).get("refresh_token"))
+ except (OSError, ValueError):
+ return False
+
+
+def _write_token(creds) -> None:
+ # 0o600: the file holds a long-lived refresh token — keep it owner-only.
+ fd = os.open(_TOKEN_PATH, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
+ with os.fdopen(fd, "w") as f:
+ f.write(creds.to_json())
+
+
+def _require_libs():
+ try:
+ from googleapiclient.discovery import build # noqa: F401
+ from google_auth_oauthlib.flow import InstalledAppFlow # noqa: F401
+ from google.oauth2.credentials import Credentials # noqa: F401
+ from google.auth.transport.requests import Request # noqa: F401
+ except ImportError as e:
+ raise RuntimeError(
+ "YouTube API libraries are not installed. Run:\n"
+ " pip install google-api-python-client google-auth-oauthlib\n"
+ "Or import a YouTube Studio analytics CSV instead (no auth needed)."
+ ) from e
+
+
+def _credentials():
+ """Load cached creds, refreshing or running the loopback flow as needed."""
+ _require_libs()
+ from google.oauth2.credentials import Credentials
+ from google.auth.transport.requests import Request
+ from google_auth_oauthlib.flow import InstalledAppFlow
+
+ creds = None
+ if os.path.exists(_TOKEN_PATH):
+ creds = Credentials.from_authorized_user_file(_TOKEN_PATH, SCOPES)
+ if creds and creds.valid:
+ return creds
+ if creds and creds.expired and creds.refresh_token:
+ creds.refresh(Request())
+ else:
+ cfg = _yt_config()
+ client_id, client_secret = cfg.get("client_id"), cfg.get("client_secret")
+ if not (client_id and client_secret):
+ raise RuntimeError(
+ "Missing YouTube OAuth client. Add client_id + client_secret to the "
+ "'youtube' block of .podcli/integrations.json (from a Google Cloud "
+ "OAuth desktop client), then run: podcli youtube auth"
+ )
+ flow = InstalledAppFlow.from_client_config(
+ {"installed": {
+ "client_id": client_id, "client_secret": client_secret,
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+ "token_uri": "https://oauth2.googleapis.com/token",
+ "redirect_uris": ["http://localhost"],
+ }},
+ SCOPES,
+ )
+ creds = flow.run_local_server(port=0)
+ _write_token(creds)
+ return creds
+
+
+def authorize() -> bool:
+ """Run the loopback OAuth flow and cache the token. Returns True on success."""
+ _credentials()
+ return True
+
+
+def _iso8601_to_seconds(d: str) -> float:
+ """PT#M#S → seconds."""
+ import re
+ m = re.match(r"PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?", d or "")
+ if not m:
+ return 0.0
+ h, mi, s = (int(x) if x else 0 for x in m.groups())
+ return h * 3600 + mi * 60 + s
+
+
+def list_uploads(limit: int = 50) -> list[dict[str, Any]]:
+ """Recent uploads on the authorized channel: id, title, published_at, duration."""
+ from googleapiclient.discovery import build
+ yt = build("youtube", "v3", credentials=_credentials())
+ ch = yt.channels().list(part="contentDetails", mine=True).execute()
+ uploads = ch["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
+ items = yt.playlistItems().list(part="contentDetails", playlistId=uploads, maxResults=min(limit, 50)).execute()
+ ids = [i["contentDetails"]["videoId"] for i in items.get("items", [])]
+ if not ids:
+ return []
+ vids = yt.videos().list(part="snippet,contentDetails", id=",".join(ids)).execute()
+ out = []
+ for v in vids.get("items", []):
+ out.append({
+ "video_id": v["id"],
+ "title": v["snippet"]["title"],
+ "published_at": v["snippet"]["publishedAt"],
+ "duration": _iso8601_to_seconds(v["contentDetails"]["duration"]),
+ "thumbnail": (v["snippet"].get("thumbnails", {}).get("high") or {}).get("url"),
+ })
+ return out
+
+
+def fetch_metrics(video_id: str) -> dict[str, Any]:
+ """Lifetime metrics for one video via the Analytics API + Data API stats."""
+ from googleapiclient.discovery import build
+ creds = _credentials()
+ analytics = build("youtubeAnalytics", "v2", credentials=creds)
+ res = analytics.reports().query(
+ ids="channel==MINE", startDate="2005-01-01", endDate="2099-01-01",
+ metrics="views,averageViewPercentage,estimatedMinutesWatched", filters=f"video=={video_id}",
+ ).execute()
+ rows = res.get("rows") or [[0, 0, 0]]
+ views, retention, _watch = rows[0]
+ metrics = {"views": int(views), "retention": round(float(retention), 1)}
+ try:
+ imp = analytics.reports().query(
+ ids="channel==MINE", startDate="2005-01-01", endDate="2099-01-01",
+ metrics="impressions,impressionsClickThroughRate", filters=f"video=={video_id}",
+ ).execute()
+ irows = imp.get("rows") or [[0, 0]]
+ metrics["impressions"] = int(irows[0][0])
+ metrics["ctr"] = round(float(irows[0][1]), 1)
+ except Exception:
+ pass
+ return metrics
+
+
+# ── CSV import (no auth) ──────────────────────────────────────────────
+
+_CSV_ALIASES = {
+ "title": ["video title", "title", "content"],
+ "views": ["views"],
+ "retention": ["average percentage viewed (%)", "average percentage viewed", "average view percentage"],
+ "ctr": ["impressions click-through rate (%)", "impressions click-through rate"],
+ "impressions": ["impressions"],
+}
+
+
+def parse_analytics_csv(path: str) -> list[dict[str, Any]]:
+ """Parse a YouTube Studio analytics CSV into rows of {title, views, retention, ctr, impressions}."""
+ with open(path, newline="", encoding="utf-8-sig") as f:
+ reader = csv.DictReader(f)
+ headers = {h.lower().strip(): h for h in (reader.fieldnames or [])}
+
+ def col(field: str) -> Optional[str]:
+ for alias in _CSV_ALIASES[field]:
+ if alias in headers:
+ return headers[alias]
+ return None
+
+ title_c = col("title")
+ if not title_c:
+ raise ValueError("CSV has no recognizable video-title column")
+ out = []
+ for row in reader:
+ title = (row.get(title_c) or "").strip()
+ if not title or title.lower() in ("total", "totals"):
+ continue
+ rec: dict[str, Any] = {"title": title}
+ for field in ("views", "retention", "ctr", "impressions"):
+ c = col(field)
+ if c and row.get(c) not in (None, ""):
+ try:
+ rec[field] = float(str(row[c]).replace(",", "").replace("%", ""))
+ except ValueError:
+ pass
+ out.append(rec)
+ return out
diff --git a/backend/services/integrations/youtube/integration.py b/backend/services/integrations/youtube/integration.py
new file mode 100644
index 0000000..6e33c90
--- /dev/null
+++ b/backend/services/integrations/youtube/integration.py
@@ -0,0 +1,43 @@
+"""YouTube analytics integration — links rendered clips to uploads and pulls
+per-video performance (views, retention, CTR) for the learning loop."""
+from __future__ import annotations
+
+from typing import Any
+
+from ..base import IntegrationBase, IntegrationRegistry, ToolSpec
+
+
+class YouTubeIntegration(IntegrationBase):
+ name = "youtube"
+ category = "ai_helper"
+ description = (
+ "Performance feedback, not publishing. Links rendered clips to your published "
+ "videos and pulls views, retention, and CTR so podcli learns what works and "
+ "Claude picks better shorts. Read-only — podcli never uploads. Bring your own "
+ "Google OAuth client, or import a YouTube Studio analytics CSV."
+ )
+ default_enabled = False
+
+ def _sync(self, params: dict[str, Any]) -> dict[str, Any]:
+ from . import sync
+ csv_path = params.get("csv_path")
+ if csv_path:
+ return sync.sync_from_csv(csv_path)
+ return {"updated": sync.sync_metrics()}
+
+ def tools(self) -> list[ToolSpec]:
+ return [
+ ToolSpec(
+ name="youtube_sync",
+ description="Sync YouTube performance onto linked clips (live API, or csv_path for a Studio export).",
+ handler=self._sync,
+ input_schema={
+ "type": "object",
+ "properties": {"csv_path": {"type": "string"}},
+ },
+ tags=["analytics", "youtube"],
+ ),
+ ]
+
+
+IntegrationRegistry.register(YouTubeIntegration())
diff --git a/backend/services/integrations/youtube/learnings.py b/backend/services/integrations/youtube/learnings.py
new file mode 100644
index 0000000..0058a7c
--- /dev/null
+++ b/backend/services/integrations/youtube/learnings.py
@@ -0,0 +1,167 @@
+"""Compile clip performance into a knowledge-base file Claude reads when
+picking shorts. Structured (no LLM): regenerated whenever metrics sync.
+
+The clip-picking skills glob .podcli/knowledge/*.md, so writing the digest
+here is what closes the loop — the next suggest_clips run is informed by what
+actually performed.
+"""
+from __future__ import annotations
+
+import os
+from collections import defaultdict
+from datetime import datetime, timezone
+from typing import Any, Callable, Optional
+
+from config.paths import paths
+from services.clips_history import load_clips_history
+
+LEARNINGS_FILE = "13-performance-learnings.md"
+AI_START = "<!-- AI-ANALYSIS-START -->"
+AI_END = "<!-- AI-ANALYSIS-END -->"
+
+
+def _existing_ai_block(path: str) -> str:
+ if not os.path.exists(path):
+ return ""
+ txt = open(path).read()
+ i, j = txt.find(AI_START), txt.find(AI_END)
+ return txt[i:j + len(AI_END)] if (i != -1 and j != -1) else ""
+
+
+def _has_perf(c: dict) -> bool:
+ m = c.get("metrics") or {}
+ return m.get("views") is not None or m.get("retention") is not None
+
+
+def _agg(clips: list[dict], key: Callable[[dict], Any]) -> list[dict]:
+ groups: dict[str, list[dict]] = defaultdict(list)
+ for c in clips:
+ groups[key(c) or "—"].append(c)
+ out = []
+ for k, cs in groups.items():
+ vals = lambda f: [c["metrics"][f] for c in cs if (c.get("metrics") or {}).get(f) is not None]
+ ret, ctr, views = vals("retention"), vals("ctr"), vals("views")
+ out.append({
+ "key": k, "n": len(cs),
+ "ret": round(sum(ret) / len(ret), 1) if ret else None,
+ "ctr": round(sum(ctr) / len(ctr), 1) if ctr else None,
+ "views": int(sum(views) / len(views)) if views else None,
+ })
+ return out
+
+
+def _length_bucket(c: dict) -> str:
+ d = c.get("duration") or 0
+ return "<25s" if d < 25 else "25-35s" if d < 35 else "35-45s" if d < 45 else "45s+"
+
+
+def write_learnings(min_clips: int = 3, ai_block: Optional[str] = None) -> Optional[str]:
+ """Regenerate the performance-learnings knowledge file. None if too little data.
+
+ The structured 'what's working' section is rebuilt every call; any AI-analysis
+ block is preserved (or replaced when ai_block is passed)."""
+ clips = [c for c in load_clips_history() if _has_perf(c)]
+ if len(clips) < min_clips:
+ return None
+
+ by_type = sorted(_agg(clips, lambda c: c.get("content_type")), key=lambda r: r["ret"] or 0, reverse=True)
+ by_caption = sorted(_agg(clips, lambda c: c.get("caption_style")), key=lambda r: r["ctr"] or 0, reverse=True)
+ by_length = sorted(_agg(clips, _length_bucket), key=lambda r: r["ret"] or 0, reverse=True)
+ top = sorted(clips, key=lambda c: (c.get("metrics") or {}).get("views") or 0, reverse=True)[:5]
+ now = datetime.now(timezone.utc).strftime("%Y-%m-%d")
+
+ L: list[str] = [
+ "# Performance learnings",
+ "",
+ "<!-- AUTO-GENERATED by `podcli youtube sync`. The 'What's working now' section is",
+ " regenerated each sync — edits there are overwritten. -->",
+ "",
+ f"## What's working now (updated {now} · {len(clips)} published clips)",
+ "",
+ "Retention = content quality (did it hold viewers). CTR = packaging (title/thumbnail). Views = reach.",
+ "",
+ "**By moment type — retention:**",
+ ]
+ L += [f"- {r['key']}: {r['ret']}% retention · {r['ctr']}% CTR · ~{r['views']} views (n={r['n']})" for r in by_type]
+ L += ["", "**By caption style — CTR:**"]
+ L += [f"- {r['key']}: {r['ctr']}% CTR · {r['ret']}% retention (n={r['n']})" for r in by_caption]
+ L += ["", "**By length — retention:**"]
+ L += [f"- {r['key']}: {r['ret']}% retention (n={r['n']})" for r in by_length]
+ L += ["", "**Top performers:**"]
+ L += [f"- \"{c['title']}\" — {(c.get('metrics') or {}).get('views')} views, {(c.get('metrics') or {}).get('retention')}% retention [{c.get('content_type', '?')}]" for c in top]
+ L += ["", "## Guidance for picking shorts", ""]
+ if by_type:
+ L.append(f"- Prioritize **{by_type[0]['key']}** moments — highest retention ({by_type[0]['ret']}%).")
+ best_ctr = next((r for r in by_caption if r["ctr"]), None)
+ if best_ctr:
+ L.append(f"- **{best_ctr['key']}** captions earn the most clicks ({best_ctr['ctr']}% CTR).")
+ if by_length:
+ L.append(f"- Target **{by_length[0]['key']}** clips for retention.")
+ L.append("")
+
+ os.makedirs(paths["knowledge"], exist_ok=True)
+ path = os.path.join(paths["knowledge"], LEARNINGS_FILE)
+ block = ai_block if ai_block is not None else _existing_ai_block(path)
+ content = "\n".join(L)
+ if block:
+ content += "\n\n" + block + "\n"
+ with open(path, "w") as f:
+ f.write(content)
+ return path
+
+
+def _clip_line(c: dict) -> str:
+ m = c.get("metrics") or {}
+ return (f"- [{c.get('content_type', '?')} · {c.get('caption_style', '?')} · {round(c.get('duration', 0))}s · "
+ f"{m.get('retention')}% retention · {m.get('ctr')}% CTR] \"{c.get('title')}\"\n"
+ f" transcript: {c.get('transcript_slice', '')[:400]}")
+
+
+def write_semantic_learnings(top_n: int = 4, min_total: int = 6) -> Optional[str]:
+ """Token-frugal LLM pass: contrast top vs bottom clips by retention and write
+ a qualitative 'why winners win' block. Returns the file path, or None if there
+ isn't enough data or no AI CLI is available."""
+ clips = [c for c in load_clips_history()
+ if _has_perf(c) and c.get("transcript_slice") and (c.get("metrics") or {}).get("retention") is not None]
+ if len(clips) < min_total:
+ return None
+ ranked = sorted(clips, key=lambda c: c["metrics"]["retention"], reverse=True)
+ top_performers, underperformers = ranked[:top_n], ranked[-top_n:]
+
+ try:
+ from services.claude_suggest import _find_ai_cli_candidates, _run_ai_command
+ except Exception:
+ return None
+ candidates = _find_ai_cli_candidates()
+ if not candidates:
+ return None
+ cli_path, engine = candidates[0]
+
+ prompt = (
+ "You analyze short-form video performance to guide future clip selection.\n"
+ "Below are the highest- and lowest-retention clips from one podcast channel.\n\n"
+ "TOP PERFORMERS:\n" + "\n".join(_clip_line(c) for c in top_performers) +
+ "\n\nUNDERPERFORMERS:\n" + "\n".join(_clip_line(c) for c in underperformers) +
+ "\n\nIn 4-6 concise markdown bullets, state the concrete content patterns that distinguish "
+ "the top performers from the underperformers (hooks, topic, emotional beat, structure) and give "
+ "actionable guidance for picking future shorts. No preamble, just the bullets."
+ )
+ os.makedirs(paths["working"], exist_ok=True)
+ prompt_file = os.path.join(paths["working"], "_perf_analysis_prompt.txt")
+ with open(prompt_file, "w") as f:
+ f.write(prompt)
+ try:
+ res = _run_ai_command(cli_path, engine, prompt, prompt_file, paths["project_root"], timeout=180)
+ except Exception:
+ return None
+ finally:
+ try:
+ os.unlink(prompt_file)
+ except Exception:
+ pass
+ text = (res.stdout or "").strip()
+ if not text:
+ return None
+ now = datetime.now(timezone.utc).strftime("%Y-%m-%d")
+ block = f"{AI_START}\n## What separates top performers (AI analysis · {now})\n\n{text}\n{AI_END}"
+ return write_learnings(ai_block=block)
diff --git a/backend/services/integrations/youtube/sync.py b/backend/services/integrations/youtube/sync.py
new file mode 100644
index 0000000..d8baff7
--- /dev/null
+++ b/backend/services/integrations/youtube/sync.py
@@ -0,0 +1,120 @@
+"""Attribution (clip ↔ uploaded video) and metric sync.
+
+podcli renders but never publishes, so performance is reconstructed after the
+fact: match each rendered clip to its uploaded video, then pull metrics onto
+the clip. Matching is proposed, never silent — a wrong link poisons the signal.
+"""
+from __future__ import annotations
+
+from datetime import datetime, timezone
+from difflib import SequenceMatcher
+from typing import Any
+
+import sys
+
+from services.clips_history import load_clips_history, save_clips_history, update_clip
+from . import client
+
+
+def _ratio(a: str, b: str) -> float:
+ return SequenceMatcher(None, (a or "").lower(), (b or "").lower()).ratio()
+
+
+def _now() -> str:
+ return datetime.now(timezone.utc).isoformat()
+
+
+def propose_links(limit: int = 50) -> list[dict[str, Any]]:
+ """Best upload match per unlinked clip: duration proximity + title + recency."""
+ uploads = client.list_uploads(limit=limit)
+ proposals = []
+ for clip in load_clips_history():
+ if clip.get("youtube_video_id"):
+ continue
+ best, best_score = None, 0.0
+ for up in uploads:
+ dur_gap = abs((up.get("duration") or 0) - (clip.get("duration") or 0))
+ dur_score = max(0.0, 1.0 - dur_gap / 5.0) # within ~5s
+ score = 0.6 * _ratio(clip.get("title", ""), up["title"]) + 0.4 * dur_score
+ if score > best_score:
+ best, best_score = up, score
+ if best and best_score >= 0.4:
+ proposals.append({
+ "clip_id": clip["id"], "clip_title": clip.get("title"),
+ "video_id": best["video_id"], "video_title": best["title"],
+ "score": round(best_score, 2),
+ })
+ return proposals
+
+
+def set_link(clip_id: str, video_id: str) -> bool:
+ return update_clip(clip_id, youtube_video_id=video_id) is not None
+
+
+def sync_metrics() -> int:
+ """Pull live metrics onto every linked clip. Returns the number updated.
+
+ Mutates the loaded list and saves once (not once-per-clip) to shrink the
+ window where a concurrent writer could clobber the file. A single clip's
+ fetch failure is isolated so it can't abort the whole sync.
+ """
+ entries = load_clips_history()
+ count, failed = 0, 0
+ for clip in entries:
+ vid = clip.get("youtube_video_id")
+ if not vid:
+ continue
+ try:
+ metrics = client.fetch_metrics(vid)
+ except Exception as e:
+ failed += 1
+ print(f" ! metrics fetch failed for {vid}: {e}", file=sys.stderr)
+ continue
+ metrics["fetched_at"] = _now()
+ clip["metrics"] = metrics
+ count += 1
+ if count:
+ save_clips_history(entries)
+ if failed:
+ print(f" ! {failed} clip(s) skipped due to fetch errors", file=sys.stderr)
+ _refresh_learnings()
+ return count
+
+
+def _refresh_learnings() -> None:
+ """Regenerate the learnings digest; isolated so its failure can't discard saved metrics."""
+ try:
+ from . import learnings
+ learnings.write_learnings()
+ except Exception as e:
+ print(f" ! learnings refresh skipped: {e}", file=sys.stderr)
+
+
+def sync_from_csv(path: str, threshold: float = 0.6) -> dict[str, Any]:
+ """Match a YouTube Studio CSV to clips by title and write metrics. No auth."""
+ rows = client.parse_analytics_csv(path)
+ entries = load_clips_history()
+ links: list[dict[str, Any]] = []
+ unmatched = []
+ for clip in entries:
+ best, best_score = None, 0.0
+ for row in rows:
+ r = _ratio(clip.get("title", ""), row["title"])
+ if r > best_score:
+ best, best_score = row, r
+ if best and best_score >= threshold:
+ metrics = {k: best[k] for k in ("views", "retention", "ctr", "impressions") if k in best}
+ metrics["fetched_at"] = _now()
+ clip["metrics"] = metrics
+ # Title-only attribution is fuzzy; surface every pairing + score so a
+ # wrong match is visible rather than silently poisoning the signal.
+ links.append({
+ "clip_title": clip.get("title"), "row_title": best["title"],
+ "score": round(best_score, 2),
+ })
+ else:
+ unmatched.append(clip.get("title"))
+ if links:
+ save_clips_history(entries)
+ _refresh_learnings()
+ return {"matched": len(links), "links": links, "unmatched": unmatched, "rows": len(rows)}
diff --git a/backend/services/thumbnail_ai.py b/backend/services/thumbnail_ai.py
index 5ca37bc..9258a15 100644
--- a/backend/services/thumbnail_ai.py
+++ b/backend/services/thumbnail_ai.py
@@ -13,6 +13,7 @@ import json
import os
import subprocess
from utils.proc import run as proc_run
+from utils.log import log_event
import sys
import tempfile
import base64
@@ -415,12 +416,66 @@ def extract_candidate_frames(
return results
+def _extract_json(text: str):
+ """Pull the first JSON value (object or array) out of a model's raw output."""
+ text = (text or "").strip()
+ spans = sorted(
+ (text.find(o), o, c) for o, c in (("[", "]"), ("{", "}")) if text.find(o) >= 0
+ )
+ for start, _open, close in spans:
+ end = text.rfind(close) + 1
+ if end > start:
+ try:
+ return json.loads(text[start:end])
+ except json.JSONDecodeError:
+ continue
+ return None
+
+
+def _ask_ai_for_json(prompt: str, timeout: int = 30):
+ """Run the first available AI CLI on `prompt`, returning the first JSON value
+ it emits, or None if no CLI is available or none returns parseable JSON."""
+ from services.claude_suggest import _find_ai_cli_candidates, _run_ai_command
+
+ candidates = _find_ai_cli_candidates()
+ if not candidates:
+ return None
+
+ prompt_file = None
+ try:
+ from utils.prompt_files import write_prompt_file
+ prompt_file = write_prompt_file(prompt)
+ project_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")
+ for cli_path, engine in candidates:
+ try:
+ result = _run_ai_command(
+ cli_path=cli_path, engine=engine, prompt=prompt,
+ prompt_file=prompt_file, project_dir=project_dir, timeout=timeout,
+ )
+ except Exception as e:
+ log_event("thumbnail-ai", "ai cli failed", level="warn", engine=engine, err=e)
+ continue
+ if result.returncode != 0 or not result.stdout.strip():
+ continue
+ parsed = _extract_json(result.stdout)
+ if parsed is not None:
+ return parsed
+ finally:
+ if prompt_file:
+ try:
+ os.unlink(prompt_file)
+ except Exception:
+ pass
+ return None
+
+
def ask_claude_for_layout(
title: str,
frame_path: str,
frame_info: Optional[dict] = None,
logo_path: Optional[str] = None,
config: Optional[dict] = None,
+ variation: int = 0,
) -> Optional[dict]:
"""
Ask an available AI CLI to generate layout values for the thumbnail.
@@ -428,12 +483,6 @@ def ask_claude_for_layout(
Returns dict with line1, line2, box_y, photo_object_position, etc.
"""
- from services.claude_suggest import _find_ai_cli_candidates, _run_ai_command
-
- candidates = _find_ai_cli_candidates()
- if not candidates:
- return None
-
cfg = config or _load_brand_config()
face_ctx = "No face detected."
@@ -470,48 +519,42 @@ RULES:
- box_y: position the text box so it does NOT overlap the face. If face is high (y<40%), use 80-85%. If face is centered (y~50%), use 75-78%. If face is low, use 68-72%.
- photo_object_position: CSS value to show the face well. The photo is already 1080x1920 with face centered, so "center top" usually works. Adjust if face_y is unusual.
- Font sizes: for short text (1-2 words per line) use 96-110px. For medium (3-4 words) use 80-96px. For long (5+ words) use 64-80px. Line 2 should be 85-95% of Line 1.
-- No slashes in the text lines."""
+- No slashes in the text lines.
+- This is thumbnail variation #{variation + 1}. Give a DISTINCT headline angle and wording from the most obvious phrasing — vary the hook, the emphasis, or which idea you lead with so each variation reads differently."""
- project_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")
+ layout = _ask_ai_for_json(prompt, timeout=30)
+ return layout if isinstance(layout, dict) else None
- prompt_file = None
- try:
- from utils.prompt_files import write_prompt_file
- prompt_file = write_prompt_file(prompt)
- for cli_path, engine in candidates:
- try:
- result = _run_ai_command(
- cli_path=cli_path,
- engine=engine,
- prompt=prompt,
- prompt_file=prompt_file,
- project_dir=project_dir,
- timeout=30,
- )
- except Exception:
- continue
+def generate_headline_variations(title: str, n: int, config: Optional[dict] = None) -> list[tuple[str, str]]:
+ """Write n DISTINCT 2-line thumbnail headlines in a single AI call.
- if result.returncode != 0 or not result.stdout.strip():
- continue
+ One call (rather than n independent layout calls) is both cheaper and the
+ only way to guarantee the variations actually differ — the model has to see
+ all n at once to make them distinct. Returns [] if no AI CLI answers, letting
+ the caller fall back to per-variation layout.
+ """
+ prompt = f"""You are a thumbnail copywriter. Write {n} DISTINCT headline options for a YouTube Shorts thumbnail.
- text = result.stdout.strip()
- start = text.find("{")
- end = text.rfind("}") + 1
- if start >= 0 and end > start:
- try:
- return json.loads(text[start:end])
- except json.JSONDecodeError:
- continue
- except Exception:
- pass
- finally:
- if prompt_file:
- try:
- os.unlink(prompt_file)
- except Exception:
- pass
- return None
+TITLE: "{title}"
+
+Return ONLY a JSON array of exactly {n} objects, each with "line1" and "line2":
+[{{"line1": "FIRST LINE", "line2": "SECOND LINE"}}, ...]
+
+RULES:
+- Rewrite the title into punchy thumbnail copy, not a literal transcript sentence.
+- Line 1 = setup, Line 2 = payoff. 4-8 words total. Hard max 24 characters per line.
+- Drop filler words; keep numbers, nouns, and the strongest claim. No slashes.
+- Every option must read DIFFERENTLY — vary the hook, the emphasis, or which idea leads. Do not repeat the same phrasing across options."""
+
+ items = _ask_ai_for_json(prompt, timeout=45)
+ if not isinstance(items, list):
+ return []
+ return [
+ (str(it.get("line1", "")).strip(), str(it.get("line2", "")).strip())
+ for it in items
+ if isinstance(it, dict) and it.get("line1")
+ ]
def generate_thumbnail_with_template(
@@ -522,10 +565,15 @@ def generate_thumbnail_with_template(
frame_info: Optional[dict] = None,
config: Optional[dict] = None,
variation: int = 0,
+ line1_override: Optional[str] = None,
+ line2_override: Optional[str] = None,
) -> Optional[str]:
"""
Template + AI layout. Claude decides all dynamic values per frame.
Template provides consistent visual structure.
+
+ When line1_override is given, the two lines are used verbatim and the
+ Claude rewrite is skipped — the caller controls the exact split.
"""
from services.thumbnail_html import generate_thumbnail, _load_config, _prepare_thumbnail_lines
@@ -533,10 +581,13 @@ def generate_thumbnail_with_template(
if config:
cfg.update(config)
- # Ask Claude for ALL layout decisions
- layout = ask_claude_for_layout(title, frame_path, frame_info, logo_path, cfg)
+ layout = None if line1_override is not None else ask_claude_for_layout(title, frame_path, frame_info, logo_path, cfg, variation=variation)
- if layout:
+ if line1_override is not None:
+ line1, line2 = _prepare_thumbnail_lines(
+ title=title, line1=line1_override, line2=line2_override or "",
+ )
+ elif layout:
line1, line2 = _prepare_thumbnail_lines(
title=title,
line1=layout.get("line1", title),
@@ -574,6 +625,8 @@ def generate_variations(
end_second: Optional[float] = None,
logo_path: Optional[str] = None,
config: Optional[dict] = None,
+ line1: Optional[str] = None,
+ line2: Optional[str] = None,
) -> list[str]:
"""
Generate thumbnail variations using AI.
@@ -624,12 +677,22 @@ def generate_variations(
if not frames:
frames = [{"path": None}]
+ # When the caller didn't pin exact copy, get n distinct headlines up front so
+ # the variations differ in wording — not just in frame/styling.
+ headlines: list[tuple[str, str]] = []
+ if line1 is None:
+ headlines = generate_headline_variations(title, n, config=cfg)
+
paths = []
for i in range(n):
frame = frames[i] if i < len(frames) else frames[i % len(frames)]
frame_path = frame.get("path") or ""
out_path = os.path.join(output_dir, f"thumb_v{i+1}.png")
+ v_line1, v_line2 = (line1, line2)
+ if headlines:
+ v_line1, v_line2 = headlines[i % len(headlines)]
+
result = generate_thumbnail_with_template(
title=title,
frame_path=frame_path,
@@ -638,6 +701,8 @@ def generate_variations(
frame_info=frame if frame_path else None,
config=cfg,
variation=i,
+ line1_override=v_line1,
+ line2_override=v_line2,
)
if result:
diff --git a/backend/services/video_processor.py b/backend/services/video_processor.py
index 9780576..7d828da 100644
--- a/backend/services/video_processor.py
+++ b/backend/services/video_processor.py
@@ -13,6 +13,7 @@ from typing import Optional
from services.encoder import get_video_encode_flags
from utils.proc import run as proc_run, ProcError
+from utils.log import log_event
from services import media_probe
from services.media_probe import (
CPU_FLAGS,
@@ -52,6 +53,28 @@ from services.local_reframe import (
import sys
+def _manual_crop_x_expr(keyframes: list, crop_w: int, width: int) -> str:
+ """Build an FFmpeg x-expression that HOLDS each manual keyframe's position
+ until the next keyframe, then snaps (step function — no glide).
+
+ keyframes: [(t_seconds, center_x_pct 0-100), ...] in clip-relative time.
+ Returns crop x (top-left) as a function of t, clamped to the frame.
+ """
+ def cx(pct: float) -> int:
+ center = (max(0.0, min(100.0, pct)) / 100.0) * width
+ return int(max(0, min(width - crop_w, round(center - crop_w / 2))))
+
+ kf = sorted(((float(k["t"]), cx(float(k["x_pct"]))) for k in keyframes), key=lambda p: p[0])
+ if not kf:
+ return str(max(0, (width - crop_w) // 2))
+ # Hold the first position before t0; each later keyframe overrides from its time on.
+ # Built ascending so the latest-matching keyframe is the outermost test.
+ expr = str(kf[0][1])
+ for t_i, x_i in kf:
+ expr = f"if(gte(t\\,{t_i:.3f})\\,{x_i}\\,{expr})"
+ return expr
+
+
def crop_to_vertical(
input_path: str,
output_path: str,
@@ -59,6 +82,7 @@ def crop_to_vertical(
transcript_words: list = None,
clip_start: float = 0,
face_map: dict = None,
+ crop_keyframes: list = None,
) -> str:
"""
Crop/scale video to 1080x1920 (9:16 vertical).
@@ -81,6 +105,20 @@ def crop_to_vertical(
source_ratio = width / height
+ if strategy == "manual" and crop_keyframes:
+ log_event("crop", "chose=manual", keyframes=len(crop_keyframes), source=f"{width}x{height}")
+ crop_h = height
+ crop_w = min(int(crop_h * target_ratio), width)
+ crop_y = max(0, (height - crop_h) // 2)
+ x_expr = _manual_crop_x_expr(crop_keyframes, crop_w, width)
+ vf = f"crop={crop_w}:{crop_h}:x='{x_expr}':y={crop_y},scale={target_w}:{target_h}"
+ return _run_ffmpeg_with_fallback(
+ cmd_parts_before_enc=["ffmpeg", "-y", "-i", input_path, "-vf", vf],
+ cmd_parts_after_enc=["-c:a", "aac", "-b:a", "192k", "-ar", "44100", "-movflags", "+faststart"],
+ output_path=output_path,
+ label="crop_manual",
+ )
+
if strategy == "speaker-hardcut" and face_map:
crop_h = height
crop_y = max(0, (height - crop_h) // 2)
@@ -95,6 +133,7 @@ def crop_to_vertical(
hard_cut=True,
)
if x_expr:
+ log_event("crop", "chose=speaker-hardcut", source=f"{width}x{height}")
crop_w = int(crop_h * target_ratio)
crop_w = min(crop_w, width)
vf = f"crop={crop_w}:{crop_h}:{x_expr}:{crop_y},scale={target_w}:{target_h}"
@@ -113,6 +152,7 @@ def crop_to_vertical(
output_path=output_path,
label="crop_speaker_hardcut",
)
+ log_event("crop", "fallback", reason="hardcut_face_map_empty", to="speaker")
strategy = "speaker"
if strategy in ("face", "speaker", "speaker-hardcut"):
@@ -135,10 +175,9 @@ def crop_to_vertical(
f":x='{plan['x_expression']}':y={crop_y},"
f"scale={target_w}:{target_h}"
)
- print(
- f" Reframe: local mouth-motion, {len(plan['timeline'])} segs, "
- f"{plan['scene_cuts']} cuts",
- flush=True,
+ log_event(
+ "crop", "chose=local-mouth-motion",
+ segs=len(plan["timeline"]), cuts=plan["scene_cuts"],
)
result = _run_ffmpeg_with_fallback(
cmd_parts_before_enc=[
@@ -157,6 +196,7 @@ def crop_to_vertical(
)
if result:
return result
+ log_event("crop", "fallback", reason="local_reframe_ffmpeg_failed")
# Any clip with speaker labels should prefer clip-local tracking over the
# episode-wide face_map. Global speaker→side mappings are too coarse for
@@ -170,7 +210,9 @@ def crop_to_vertical(
face_map=face_map,
)
if result:
+ log_event("crop", "chose=speaker-track", speakers=len(speakers_in_clip))
return result
+ log_event("crop", "fallback", reason="speaker_track_failed", speakers=len(speakers_in_clip))
if face_map:
crop_h = height
@@ -185,6 +227,7 @@ def crop_to_vertical(
crop_h=crop_h,
)
if x_expr:
+ log_event("crop", "chose=face-map", source=f"{width}x{height}")
crop_w = int(crop_h * target_ratio)
crop_w = min(crop_w, width)
vf = f"crop={crop_w}:{crop_h}:{x_expr}:{crop_y},scale={target_w}:{target_h}"
@@ -211,11 +254,14 @@ def crop_to_vertical(
face_map=face_map,
)
if result:
+ log_event("crop", "chose=face-track")
return result
+ log_event("crop", "fallback", reason="face_track_failed", to="center")
strategy = "center"
if strategy == "center":
if source_ratio > target_ratio:
+ log_event("crop", "chose=center-blur-bg", source=f"{width}x{height}")
# Wide source with no face detected: blurred background + sharp center.
# Scales source to fill 9:16 height → blur → overlay sharp fit-to-width.
vf_complex = (
@@ -242,6 +288,7 @@ def crop_to_vertical(
label="crop_blur_bg",
)
else:
+ log_event("crop", "chose=center", source=f"{width}x{height}")
crop_w = width
crop_h = int(crop_w / target_ratio)
if crop_h > height:
diff --git a/backend/utils/log.py b/backend/utils/log.py
new file mode 100644
index 0000000..7635f25
--- /dev/null
+++ b/backend/utils/log.py
@@ -0,0 +1,42 @@
+"""Single, greppable structured log line for backend events.
+
+The render pipeline previously scattered `print(..., file=sys.stderr)` calls
+with inconsistent prefixes, which made it hard to answer the most common
+question — "why was this clip framed/encoded this way?". Routing those through
+`log_event` gives every line a `[category]` prefix and `key=value` fields so the
+chosen path is always visible (and easy to grep) without a debugger.
+"""
+
+import os
+import sys
+
+_VERBOSE = os.environ.get("PODCLI_LOG_VERBOSE", "").lower() in ("1", "true", "yes")
+
+
+def log_event(category: str, message: str, *, level: str = "info", **fields) -> None:
+ """Emit one structured line: `[category] message k=v k=v`.
+
+ `level="debug"` lines are suppressed unless PODCLI_LOG_VERBOSE is set.
+ """
+ if level == "debug" and not _VERBOSE:
+ return
+ parts = [f"[{category}]"]
+ if level in ("warn", "error"):
+ parts.append(f"{level.upper()}:")
+ parts.append(message)
+ extras = " ".join(f"{k}={v}" for k, v in fields.items() if v is not None)
+ if extras:
+ parts.append(extras)
+ print(" ".join(parts), file=sys.stderr, flush=True)
+
+
+def info(category: str, message: str, **fields) -> None:
+ log_event(category, message, level="info", **fields)
+
+
+def warn(category: str, message: str, **fields) -> None:
+ log_event(category, message, level="warn", **fields)
+
+
+def debug(category: str, message: str, **fields) -> None:
+ log_event(category, message, level="debug", **fields)
diff --git a/docs/clips-schema.md b/docs/clips-schema.md
new file mode 100644
index 0000000..5c991a0
--- /dev/null
+++ b/docs/clips-schema.md
@@ -0,0 +1,40 @@
+# Clip history schema (`.podcli/history/clips.json`)
+
+`clips.json` is a flat JSON array of clip records, shared on disk by two writers:
+
+- **TypeScript** — `src/services/clips-history.ts` (`ClipsHistory`), writes one entry per render
+ from the web server and MCP server.
+- **Python** — `backend/services/clips_history.py`, the CLI writer (`clips edit`/`reopen`) and the
+ Phase 2 analytics writer.
+
+The TS type is `ClipHistoryEntry` in `src/models/index.ts`. Keep both languages in sync with this table.
+
+| Field | Type | Written by | Notes |
+|-------|------|-----------|-------|
+| `id` | string (uuid) | TS render | Stable identifier. CLI also accepts an unambiguous 8-char prefix. |
+| `source_video` | string | TS render | Absolute path; episodes are grouped by its **basename**. |
+| `start_second` | number | TS render | |
+| `end_second` | number | TS render | |
+| `caption_style` | string | TS render / edit | `hormozi` \| `karaoke` \| `subtle` \| `branded` |
+| `crop_strategy` | string | TS render / edit | `center` \| `face` \| `speaker` |
+| `logo_path` | string? | TS render | |
+| `outro_path` | string? | TS render | Outro video appended after the clip. |
+| `title` | string | TS render / edit | |
+| `output_path` | string | TS render | Rendered mp4. |
+| `file_size_mb` | number | TS render | |
+| `duration` | number | TS render | |
+| `created_at` | string (ISO) | TS render | |
+| `content_type` | string? | TS render | Carried from the suggestion (`guest_story`, `hot_take`, …). Undefined when no suggestion was used. |
+| `transcript_slice` | string? | TS render | Plain text the clip says. The session transcript is overwritten, so this is the **only durable** copy — never reconstruct it later. |
+| `thumbnail_config` | object? | TS render / edit | Per-clip thumbnail settings (`line1`, `line2`, `image_path`, `timestamp`, `preview_path`, `variations`). |
+| `youtube_video_id` | string? | Phase 2 | Set when a published video is linked. |
+| `metrics` | object? | Phase 2 | `{ views?, retention?, ctr?, impressions?, fetched_at? }`. retention/ctr are 0–100. |
+
+## Writer contract
+
+- **Additive, optional fields only.** Old entries without the newer fields stay valid; no migration.
+- **Read-modify-write, preserve unknown keys.** A writer in one language must never drop fields it
+ doesn't know about (e.g. the CLI editing a title must not clobber a Phase 2 `metrics` block).
+ `update_clip` applies only non-`None` fields onto the loaded entry.
+- **No file locking.** Single-user localhost tool; TS writes on render, Python writes on edit — not
+ concurrent in practice. Do not add locking.
diff --git a/episodes/content-package-i-was-very-happy-to-.md b/episodes/content-package-i-was-very-happy-to-.md
deleted file mode 100644
index 66a7d85..0000000
--- a/episodes/content-package-i-was-very-happy-to-.md
+++ /dev/null
@@ -1,29 +0,0 @@
-The full content package is ready. Here's the overview:
-
-### 5 Shorts — 40 Title Options
-
-| Short | Top Pick | Category | Score |
-|-------|----------|----------|-------|
-| 1 | **Silicon Valley Cheers You On Even When You're "Stupid"** | Guest Story | 17/20 |
-| 2 | **AI Is Not a Bubble — LLMs Are** | Hot Take | 19/20 |
-| 3 | **CUDA Is Not a Moat — Developers Will Leave** | Technical Insight | 18/20 |
-| 4 | **"I Want to Build a Future for the People I Love"** | Guest Story | 16/20 |
-| 5 | **Not Taking Risk Is a Risk — Why I Dropped Out** | Guest Story | 17/20 |
-
-### Posting Schedule (lead with hot takes)
-
-| Day | Short | Reason |
-|-----|-------|--------|
-| Mon Mar 17 | "AI Is Not a Bubble — LLMs Are" | Strongest hook, most polarizing. Drop with full episode. |
-| Wed Mar 19 | "CUDA Is Not a Moat" | Technical follow-up, same contrarian energy |
-| Fri Mar 21 | "Silicon Valley Cheers You On" | Personal story palette cleanser |
-| Mon Mar 24 | "Not Taking Risk Is a Risk" | Universal founder/student hook |
-| Wed Mar 26 | "Build a Future for People I Love" | Emotional closer, best for shares |
-
-### Blocking Issue
-
-Shorts 2 (74s), 3 (83s), and 4 (71s) are **over 60s** — they'll need trimming to qualify as YouTube Shorts, or upload as regular vertical videos.
-
----
-
-The file write to `episodes/ep01-elias-almqvist-zett-production-package.md` is pending your approval. It includes all 40 titles, ready-to-paste descriptions with hashtags, thumbnail briefs (16:9 + 9:16), the schedule, publish checklist, and quality review.
diff --git a/package-lock.json b/package-lock.json
index b4f0305..1930b9c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,13 +1,13 @@
{
"name": "podcli",
- "version": "1.0.0",
+ "version": "1.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "podcli",
- "version": "1.0.0",
- "license": "MIT",
+ "version": "1.1.0",
+ "license": "AGPL-3.0-only",
"dependencies": {
"@fontsource/dm-sans": "^5.2.8",
"@modelcontextprotocol/sdk": "^1.12.1",
@@ -17,6 +17,9 @@
"dotenv": "^16.4.7",
"express": "^4.21.0",
"multer": "^1.4.5-lts.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "react-router-dom": "^6.30.4",
"remotion": "^4.0.441",
"uuid": "^11.1.0",
"winston": "^3.17.0",
@@ -29,15 +32,293 @@
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^22.12.0",
+ "@types/react": "^18.3.30",
+ "@types/react-dom": "^18.3.7",
"@types/uuid": "^10.0.0",
+ "@vitejs/plugin-react": "^4.7.0",
"tsx": "^4.19.0",
"typescript": "^5.7.0",
+ "vite": "^5.4.21",
"vitest": "^2.1.9"
},
"engines": {
"node": ">=18.0.0"
}
},
+ "node_modules/@babel/code-frame": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
+ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "js-tokens": "^4.0.0",
+ "picocolors": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/compat-data": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
+ "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/core": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
+ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-compilation-targets": "^7.29.7",
+ "@babel/helper-module-transforms": "^7.29.7",
+ "@babel/helpers": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "@jridgewell/remapping": "^2.3.5",
+ "convert-source-map": "^2.0.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.3",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/@babel/core/node_modules/@babel/parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
+ "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/core/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@babel/core/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz",
+ "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/generator/node_modules/@babel/parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
+ "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
+ "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets/node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/@babel/helper-globals": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
+ "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
+ "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
+ "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "@babel/traverse": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz",
+ "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
+ "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
+ "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
+ "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
+ "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/parser": {
"version": "7.24.1",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz",
@@ -50,6 +331,136 @@
"node": ">=6.0.0"
}
},
+ "node_modules/@babel/plugin-transform-react-jsx-self": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz",
+ "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-source": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz",
+ "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/template": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
+ "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/template/node_modules/@babel/parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
+ "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz",
+ "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-globals": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "debug": "^4.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse/node_modules/@babel/parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
+ "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/traverse/node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz",
+ "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@colors/colors": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
@@ -71,20 +482,20 @@
}
},
"node_modules/@emnapi/core": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz",
- "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==",
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
+ "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==",
"license": "MIT",
"optional": true,
"dependencies": {
- "@emnapi/wasi-threads": "1.2.0",
+ "@emnapi/wasi-threads": "1.2.1",
"tslib": "^2.4.0"
}
},
"node_modules/@emnapi/runtime": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz",
- "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==",
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
+ "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -92,9 +503,9 @@
}
},
"node_modules/@emnapi/wasi-threads": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz",
- "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
+ "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -574,6 +985,17 @@
"@jridgewell/trace-mapping": "^0.3.24"
}
},
+ "node_modules/@jridgewell/remapping": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
"node_modules/@jridgewell/resolve-uri": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
@@ -610,9 +1032,9 @@
}
},
"node_modules/@mediabunny/aac-encoder": {
- "version": "1.39.2",
- "resolved": "https://registry.npmjs.org/@mediabunny/aac-encoder/-/aac-encoder-1.39.2.tgz",
- "integrity": "sha512-KD6KADVzAnW7tqhRFGBOX4uaiHbd0Yxvg0lfthj3wJLAEEgEBAvi43w+ZXWeEn54X/jpabrLe4bW/eYFFvlbUA==",
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/@mediabunny/aac-encoder/-/aac-encoder-1.45.0.tgz",
+ "integrity": "sha512-vLQw8cY7Me6pvTTMkMhOiH9UCuINzfTOETCeDxbGNeNfDqc/7QlxloUH1Ylp/Zz2ek0O8kc6YdygV2vWAPakrA==",
"license": "MPL-2.0",
"funding": {
"type": "individual",
@@ -623,9 +1045,9 @@
}
},
"node_modules/@mediabunny/flac-encoder": {
- "version": "1.39.2",
- "resolved": "https://registry.npmjs.org/@mediabunny/flac-encoder/-/flac-encoder-1.39.2.tgz",
- "integrity": "sha512-VwBr3AzZTPEEPvt4aladZiXwOf3W293eq213zDupGQi/taS8WWNqDd3eBdf8FfvlbXATfbRiycXDKyQ0HlOZaQ==",
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/@mediabunny/flac-encoder/-/flac-encoder-1.45.0.tgz",
+ "integrity": "sha512-LfKbAMZVkxRS7PpEIVnWOY/l0KcHv+rjO7pYY3O0TPCZvbHWfrnQjn8JPacPIfuq6Yv7r4f8lhcl7yHSynoRkQ==",
"license": "MPL-2.0",
"funding": {
"type": "individual",
@@ -636,9 +1058,9 @@
}
},
"node_modules/@mediabunny/mp3-encoder": {
- "version": "1.39.2",
- "resolved": "https://registry.npmjs.org/@mediabunny/mp3-encoder/-/mp3-encoder-1.39.2.tgz",
- "integrity": "sha512-3rrodrGnUpUP8F2d1aRUl8IvjqK3jegkupbOzvOokooSAO5rXk2Lr5jZe7TnPeiVGiXfmnoJ7s9uyUOHlCd8qw==",
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/@mediabunny/mp3-encoder/-/mp3-encoder-1.45.0.tgz",
+ "integrity": "sha512-Bobi6AaQYEc7TWmPJ8Q0/hcUtBN7pLUC2qjoC7oZR4FcGqGztby6k7A1SWlmswoMOEIhYsOrgDaemrSDAC0QVQ==",
"license": "MPL-2.0",
"funding": {
"type": "individual",
@@ -1016,24 +1438,31 @@
"@tybys/wasm-util": "^0.10.1"
}
},
+ "node_modules/@remix-run/router": {
+ "version": "1.23.3",
+ "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.3.tgz",
+ "integrity": "sha512-4An71tdz9X8+3sI4Qqqd2LWd9vS39J7sqd9EU4Scw7TJE/qB10Flv/UuqbPVgfQV9XoK8Np6jNquZitnZq5i+Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
"node_modules/@remotion/bundler": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/bundler/-/bundler-4.0.441.tgz",
- "integrity": "sha512-DLNPHeo4FH/nUyr34N6LcxQGzmBpfb1kx5DJz9XIMPYcE6scenV0DwxV2JTK0s1Ln3OFGvK5sQlm6NlPohvTkw==",
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/bundler/-/bundler-4.0.472.tgz",
+ "integrity": "sha512-aj5nZkQJfI45HlHZ9wsjG1pRXJ4QsCHT12LUF7k18pT+7ysoDipAFkGNq85pBbBdQ7pSdl6+uJuGzDVFw2Hacg==",
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
- "@remotion/media-parser": "4.0.441",
- "@remotion/studio": "4.0.441",
- "@remotion/studio-shared": "4.0.441",
+ "@remotion/media-parser": "4.0.472",
+ "@remotion/studio": "4.0.472",
+ "@remotion/studio-shared": "4.0.472",
+ "@remotion/timeline-utils": "4.0.472",
"@rspack/core": "1.7.6",
"@rspack/plugin-react-refresh": "1.6.1",
- "esbuild": "0.25.0",
- "loader-utils": "2.0.2",
- "postcss": "8.5.1",
- "postcss-value-parser": "4.2.0",
+ "css-loader": "7.1.4",
+ "esbuild": "0.28.0",
"react-refresh": "0.18.0",
- "remotion": "4.0.441",
- "source-map": "0.7.3",
+ "remotion": "4.0.472",
"style-loader": "4.0.0",
"webpack": "5.105.0"
},
@@ -1043,9 +1472,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/aix-ppc64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
- "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.0.tgz",
+ "integrity": "sha512-lhRUCeuOyJQURhTxl4WkpFTjIsbDayJHih5kZC1giwE+MhIzAb7mEsQMqMf18rHLsrb5qI1tafG20mLxEWcWlA==",
"cpu": [
"ppc64"
],
@@ -1059,9 +1488,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/android-arm": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz",
- "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.0.tgz",
+ "integrity": "sha512-wqh0ByljabXLKHeWXYLqoJ5jKC4XBaw6Hk08OfMrCRd2nP2ZQ5eleDZC41XHyCNgktBGYMbqnrJKq/K/lzPMSQ==",
"cpu": [
"arm"
],
@@ -1075,9 +1504,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/android-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz",
- "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.0.tgz",
+ "integrity": "sha512-+WzIXQOSaGs33tLEgYPYe/yQHf0WTU0X42Jca3y8NWMbUVhp7rUnw+vAsRC/QiDrdD31IszMrZy+qwPOPjd+rw==",
"cpu": [
"arm64"
],
@@ -1091,9 +1520,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/android-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz",
- "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.0.tgz",
+ "integrity": "sha512-+VJggoaKhk2VNNqVL7f6S189UzShHC/mR9EE8rDdSkdpN0KflSwWY/gWjDrNxxisg8Fp1ZCD9jLMo4m0OUfeUA==",
"cpu": [
"x64"
],
@@ -1107,9 +1536,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/darwin-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz",
- "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.0.tgz",
+ "integrity": "sha512-0T+A9WZm+bZ84nZBtk1ckYsOvyA3x7e2Acj1KdVfV4/2tdG4fzUp91YHx+GArWLtwqp77pBXVCPn2We7Letr0Q==",
"cpu": [
"arm64"
],
@@ -1123,9 +1552,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/darwin-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz",
- "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.0.tgz",
+ "integrity": "sha512-fyzLm/DLDl/84OCfp2f/XQ4flmORsjU7VKt8HLjvIXChJoFFOIL6pLJPH4Yhd1n1gGFF9mPwtlN5Wf82DZs+LQ==",
"cpu": [
"x64"
],
@@ -1139,9 +1568,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/freebsd-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz",
- "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-l9GeW5UZBT9k9brBYI+0WDffcRxgHQD8ShN2Ur4xWq/NFzUKm3k5lsH4PdaRgb2w7mI9u61nr2gI2mLI27Nh3Q==",
"cpu": [
"arm64"
],
@@ -1155,9 +1584,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/freebsd-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz",
- "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.0.tgz",
+ "integrity": "sha512-BXoQai/A0wPO6Es3yFJ7APCiKGc1tdAEOgeTNy3SsB491S3aHn4S4r3e976eUnPdU+NbdtmBuLncYir2tMU9Nw==",
"cpu": [
"x64"
],
@@ -1171,9 +1600,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-arm": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz",
- "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.0.tgz",
+ "integrity": "sha512-CjaaREJagqJp7iTaNQjjidaNbCKYcd4IDkzbwwxtSvjI7NZm79qiHc8HqciMddQ6CKvJT6aBd8lO9kN/ZudLlw==",
"cpu": [
"arm"
],
@@ -1187,9 +1616,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz",
- "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.0.tgz",
+ "integrity": "sha512-RVyzfb3FWsGA55n6WY0MEIEPURL1FcbhFE6BffZEMEekfCzCIMtB5yyDcFnVbTnwk+CLAgTujmV/Lgvih56W+A==",
"cpu": [
"arm64"
],
@@ -1203,9 +1632,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-ia32": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz",
- "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.0.tgz",
+ "integrity": "sha512-KBnSTt1kxl9x70q+ydterVdl+Cn0H18ngRMRCEQfrbqdUuntQQ0LoMZv47uB97NljZFzY6HcfqEZ2SAyIUTQBQ==",
"cpu": [
"ia32"
],
@@ -1219,9 +1648,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-loong64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz",
- "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.0.tgz",
+ "integrity": "sha512-zpSlUce1mnxzgBADvxKXX5sl8aYQHo2ezvMNI8I0lbblJtp8V4odlm3Yzlj7gPyt3T8ReksE6bK+pT3WD+aJRg==",
"cpu": [
"loong64"
],
@@ -1235,9 +1664,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-mips64el": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz",
- "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.0.tgz",
+ "integrity": "sha512-2jIfP6mmjkdmeTlsX/9vmdmhBmKADrWqN7zcdtHIeNSCH1SqIoNI63cYsjQR8J+wGa4Y5izRcSHSm8K3QWmk3w==",
"cpu": [
"mips64el"
],
@@ -1251,9 +1680,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-ppc64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz",
- "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.0.tgz",
+ "integrity": "sha512-bc0FE9wWeC0WBm49IQMPSPILRocGTQt3j5KPCA8os6VprfuJ7KD+5PzESSrJ6GmPIPJK965ZJHTUlSA6GNYEhg==",
"cpu": [
"ppc64"
],
@@ -1267,9 +1696,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-riscv64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz",
- "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.0.tgz",
+ "integrity": "sha512-SQPZOwoTTT/HXFXQJG/vBX8sOFagGqvZyXcgLA3NhIqcBv1BJU1d46c0rGcrij2B56Z2rNiSLaZOYW5cUk7yLQ==",
"cpu": [
"riscv64"
],
@@ -1283,9 +1712,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-s390x": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz",
- "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.0.tgz",
+ "integrity": "sha512-SCfR0HN8CEEjnYnySJTd2cw0k9OHB/YFzt5zgJEwa+wL/T/raGWYMBqwDNAC6dqFKmJYZoQBRfHjgwLHGSrn3Q==",
"cpu": [
"s390x"
],
@@ -1299,9 +1728,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/linux-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz",
- "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.0.tgz",
+ "integrity": "sha512-us0dSb9iFxIi8srnpl931Nvs65it/Jd2a2K3qs7fz2WfGPHqzfzZTfec7oxZJRNPXPnNYZtanmRc4AL/JwVzHQ==",
"cpu": [
"x64"
],
@@ -1315,9 +1744,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/netbsd-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz",
- "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-CR/RYotgtCKwtftMwJlUU7xCVNg3lMYZ0RzTmAHSfLCXw3NtZtNpswLEj/Kkf6kEL3Gw+BpOekRX0BYCtklhUw==",
"cpu": [
"arm64"
],
@@ -1331,9 +1760,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/netbsd-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz",
- "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.0.tgz",
+ "integrity": "sha512-nU1yhmYutL+fQ71Kxnhg8uEOdC0pwEW9entHykTgEbna2pw2dkbFSMeqjjyHZoCmt8SBkOSvV+yNmm94aUrrqw==",
"cpu": [
"x64"
],
@@ -1347,9 +1776,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/openbsd-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz",
- "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-cXb5vApOsRsxsEl4mcZ1XY3D4DzcoMxR/nnc4IyqYs0rTI8ZKmW6kyyg+11Z8yvgMfAEldKzP7AdP64HnSC/6g==",
"cpu": [
"arm64"
],
@@ -1363,9 +1792,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/openbsd-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz",
- "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.0.tgz",
+ "integrity": "sha512-8wZM2qqtv9UP3mzy7HiGYNH/zjTA355mpeuA+859TyR+e+Tc08IHYpLJuMsfpDJwoLo1ikIJI8jC3GFjnRClzA==",
"cpu": [
"x64"
],
@@ -1378,10 +1807,26 @@
"node": ">=18"
}
},
+ "node_modules/@remotion/bundler/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.0.tgz",
+ "integrity": "sha512-FLGfyizszcef5C3YtoyQDACyg95+dndv79i2EekILBofh5wpCa1KuBqOWKrEHZg3zrL3t5ouE5jgr94vA+Wb2w==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@remotion/bundler/node_modules/@esbuild/sunos-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz",
- "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.0.tgz",
+ "integrity": "sha512-1ZgjUoEdHZZl/YlV76TSCz9Hqj9h9YmMGAgAPYd+q4SicWNX3G5GCyx9uhQWSLcbvPW8Ni7lj4gDa1T40akdlw==",
"cpu": [
"x64"
],
@@ -1395,9 +1840,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/win32-arm64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz",
- "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.0.tgz",
+ "integrity": "sha512-Q9StnDmQ/enxnpxCCLSg0oo4+34B9TdXpuyPeTedN/6+iXBJ4J+zwfQI28u/Jl40nOYAxGoNi7mFP40RUtkmUA==",
"cpu": [
"arm64"
],
@@ -1411,9 +1856,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/win32-ia32": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz",
- "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.0.tgz",
+ "integrity": "sha512-zF3ag/gfiCe6U2iczcRzSYJKH1DCI+ByzSENHlM2FcDbEeo5Zd2C86Aq0tKUYAJJ1obRP84ymxIAksZUcdztHA==",
"cpu": [
"ia32"
],
@@ -1427,9 +1872,9 @@
}
},
"node_modules/@remotion/bundler/node_modules/@esbuild/win32-x64": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz",
- "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.0.tgz",
+ "integrity": "sha512-pEl1bO9mfAmIC+tW5btTmrKaujg3zGtUmWNdCw/xs70FBjwAL3o9OEKNHvNmnyylD6ubxUERiEhdsL0xBQ9efw==",
"cpu": [
"x64"
],
@@ -1442,10 +1887,19 @@
"node": ">=18"
}
},
+ "node_modules/@remotion/bundler/node_modules/@remotion/studio-shared": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/studio-shared/-/studio-shared-4.0.472.tgz",
+ "integrity": "sha512-JP5SDmfJ+WPbYTpXauZ7OF2Sk0ppKdKSk2NGLE6EASiLTVg9edt1wxat7aP5eHAnkpHbEicCQrYVvSN0lPQORg==",
+ "license": "MIT",
+ "dependencies": {
+ "remotion": "4.0.472"
+ }
+ },
"node_modules/@remotion/bundler/node_modules/esbuild": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz",
- "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==",
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.0.tgz",
+ "integrity": "sha512-sNR9MHpXSUV/XB4zmsFKN+QgVG82Cc7+/aaxJ8Adi8hyOac+EXptIp45QBPaVyX3N70664wRbTcLTOemCAnyqw==",
"hasInstallScript": true,
"license": "MIT",
"bin": {
@@ -1455,31 +1909,32 @@
"node": ">=18"
},
"optionalDependencies": {
- "@esbuild/aix-ppc64": "0.25.0",
- "@esbuild/android-arm": "0.25.0",
- "@esbuild/android-arm64": "0.25.0",
- "@esbuild/android-x64": "0.25.0",
- "@esbuild/darwin-arm64": "0.25.0",
- "@esbuild/darwin-x64": "0.25.0",
- "@esbuild/freebsd-arm64": "0.25.0",
- "@esbuild/freebsd-x64": "0.25.0",
- "@esbuild/linux-arm": "0.25.0",
- "@esbuild/linux-arm64": "0.25.0",
- "@esbuild/linux-ia32": "0.25.0",
- "@esbuild/linux-loong64": "0.25.0",
- "@esbuild/linux-mips64el": "0.25.0",
- "@esbuild/linux-ppc64": "0.25.0",
- "@esbuild/linux-riscv64": "0.25.0",
- "@esbuild/linux-s390x": "0.25.0",
- "@esbuild/linux-x64": "0.25.0",
- "@esbuild/netbsd-arm64": "0.25.0",
- "@esbuild/netbsd-x64": "0.25.0",
- "@esbuild/openbsd-arm64": "0.25.0",
- "@esbuild/openbsd-x64": "0.25.0",
- "@esbuild/sunos-x64": "0.25.0",
- "@esbuild/win32-arm64": "0.25.0",
- "@esbuild/win32-ia32": "0.25.0",
- "@esbuild/win32-x64": "0.25.0"
+ "@esbuild/aix-ppc64": "0.28.0",
+ "@esbuild/android-arm": "0.28.0",
+ "@esbuild/android-arm64": "0.28.0",
+ "@esbuild/android-x64": "0.28.0",
+ "@esbuild/darwin-arm64": "0.28.0",
+ "@esbuild/darwin-x64": "0.28.0",
+ "@esbuild/freebsd-arm64": "0.28.0",
+ "@esbuild/freebsd-x64": "0.28.0",
+ "@esbuild/linux-arm": "0.28.0",
+ "@esbuild/linux-arm64": "0.28.0",
+ "@esbuild/linux-ia32": "0.28.0",
+ "@esbuild/linux-loong64": "0.28.0",
+ "@esbuild/linux-mips64el": "0.28.0",
+ "@esbuild/linux-ppc64": "0.28.0",
+ "@esbuild/linux-riscv64": "0.28.0",
+ "@esbuild/linux-s390x": "0.28.0",
+ "@esbuild/linux-x64": "0.28.0",
+ "@esbuild/netbsd-arm64": "0.28.0",
+ "@esbuild/netbsd-x64": "0.28.0",
+ "@esbuild/openbsd-arm64": "0.28.0",
+ "@esbuild/openbsd-x64": "0.28.0",
+ "@esbuild/openharmony-arm64": "0.28.0",
+ "@esbuild/sunos-x64": "0.28.0",
+ "@esbuild/win32-arm64": "0.28.0",
+ "@esbuild/win32-ia32": "0.28.0",
+ "@esbuild/win32-x64": "0.28.0"
}
},
"node_modules/@remotion/cli": {
@@ -1510,97 +1965,1540 @@
"react-dom": ">=16.8.0"
}
},
- "node_modules/@remotion/cli/node_modules/dotenv": {
- "version": "17.3.1",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz",
- "integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==",
- "license": "BSD-2-Clause",
+ "node_modules/@remotion/cli/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
+ "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
"engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://dotenvx.com"
+ "node": ">=18"
}
},
- "node_modules/@remotion/cli/node_modules/minimist": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
- "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
- "license": "MIT"
+ "node_modules/@remotion/cli/node_modules/@esbuild/android-arm": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz",
+ "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/@remotion/compositor-darwin-arm64": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-arm64/-/compositor-darwin-arm64-4.0.441.tgz",
- "integrity": "sha512-ysfrwyQgH42n3lahMUgge6p8L+8U5bsbqTztBsD7uSBV9h0sIeyaFw1M0tMWRPcDzg6PzazFNvSTfZlCMOGJWA==",
+ "node_modules/@remotion/cli/node_modules/@esbuild/android-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz",
+ "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==",
"cpu": [
"arm64"
],
+ "license": "MIT",
"optional": true,
"os": [
- "darwin"
- ]
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/@remotion/compositor-darwin-x64": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-x64/-/compositor-darwin-x64-4.0.441.tgz",
- "integrity": "sha512-dilhxinftG9nVnS3Yx5nyM//xUe/+m4OjwRlvdN6/azpLBd2Y1ViBVgh/y+Baz3AZNtyoapbINMN1WAcD0/BUQ==",
+ "node_modules/@remotion/cli/node_modules/@esbuild/android-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz",
+ "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==",
"cpu": [
"x64"
],
+ "license": "MIT",
"optional": true,
"os": [
- "darwin"
- ]
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/@remotion/compositor-linux-arm64-gnu": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-gnu/-/compositor-linux-arm64-gnu-4.0.441.tgz",
- "integrity": "sha512-Qmc1SRPBmEdmsA6YYHDsdBG/bY0JNWocv2NSUMEiCB9j7qbpbv1phuxL5GvgyqG4/sYcqSrslWI5OOLBy4EUpg==",
+ "node_modules/@remotion/cli/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz",
+ "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==",
"cpu": [
"arm64"
],
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
- ]
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/@remotion/compositor-linux-arm64-musl": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-musl/-/compositor-linux-arm64-musl-4.0.441.tgz",
- "integrity": "sha512-I7XrINOAqLFK2xD4IMEKlzqXm+5JQRPBtx9p6LUy+B748wR3RodGrG4/REVoVOufgihmrxNix0iJajJLWxbZ4Q==",
+ "node_modules/@remotion/cli/node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz",
+ "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==",
"cpu": [
- "arm64"
+ "x64"
],
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
- ]
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/@remotion/compositor-linux-x64-gnu": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-gnu/-/compositor-linux-x64-gnu-4.0.441.tgz",
- "integrity": "sha512-CgN6TBkEmyvcH26dKKaT2qzkTYlMN9lSAM7JJiF8zi3e5OPVzdA+ceYiybFa60dj4jg4DnBfbunHMZUoR6AwhA==",
+ "node_modules/@remotion/cli/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==",
"cpu": [
- "x64"
+ "arm64"
],
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
- ]
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/@remotion/compositor-linux-x64-musl": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-musl/-/compositor-linux-x64-musl-4.0.441.tgz",
- "integrity": "sha512-xN2EeyI5q3KmWw1RtIZ+9uIupBPkheRptSu15mYOoRiNPuwT0XrCaGeCgvwAPNzzTk5p8flaqiqlEIfMzdubYA==",
+ "node_modules/@remotion/cli/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz",
+ "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==",
"cpu": [
"x64"
],
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
- ]
- },
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-arm": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz",
+ "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz",
+ "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz",
+ "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz",
+ "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz",
+ "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==",
+ "cpu": [
+ "mips64el"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz",
+ "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz",
+ "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz",
+ "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/linux-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz",
+ "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz",
+ "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz",
+ "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz",
+ "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@esbuild/win32-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz",
+ "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@mediabunny/aac-encoder": {
+ "version": "1.39.2",
+ "resolved": "https://registry.npmjs.org/@mediabunny/aac-encoder/-/aac-encoder-1.39.2.tgz",
+ "integrity": "sha512-KD6KADVzAnW7tqhRFGBOX4uaiHbd0Yxvg0lfthj3wJLAEEgEBAvi43w+ZXWeEn54X/jpabrLe4bW/eYFFvlbUA==",
+ "license": "MPL-2.0",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ },
+ "peerDependencies": {
+ "mediabunny": "^1.0.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@mediabunny/flac-encoder": {
+ "version": "1.39.2",
+ "resolved": "https://registry.npmjs.org/@mediabunny/flac-encoder/-/flac-encoder-1.39.2.tgz",
+ "integrity": "sha512-VwBr3AzZTPEEPvt4aladZiXwOf3W293eq213zDupGQi/taS8WWNqDd3eBdf8FfvlbXATfbRiycXDKyQ0HlOZaQ==",
+ "license": "MPL-2.0",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ },
+ "peerDependencies": {
+ "mediabunny": "^1.0.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@mediabunny/mp3-encoder": {
+ "version": "1.39.2",
+ "resolved": "https://registry.npmjs.org/@mediabunny/mp3-encoder/-/mp3-encoder-1.39.2.tgz",
+ "integrity": "sha512-3rrodrGnUpUP8F2d1aRUl8IvjqK3jegkupbOzvOokooSAO5rXk2Lr5jZe7TnPeiVGiXfmnoJ7s9uyUOHlCd8qw==",
+ "license": "MPL-2.0",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ },
+ "peerDependencies": {
+ "mediabunny": "^1.0.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/bundler": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/bundler/-/bundler-4.0.441.tgz",
+ "integrity": "sha512-DLNPHeo4FH/nUyr34N6LcxQGzmBpfb1kx5DJz9XIMPYcE6scenV0DwxV2JTK0s1Ln3OFGvK5sQlm6NlPohvTkw==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "dependencies": {
+ "@remotion/media-parser": "4.0.441",
+ "@remotion/studio": "4.0.441",
+ "@remotion/studio-shared": "4.0.441",
+ "@rspack/core": "1.7.6",
+ "@rspack/plugin-react-refresh": "1.6.1",
+ "esbuild": "0.25.0",
+ "loader-utils": "2.0.2",
+ "postcss": "8.5.1",
+ "postcss-value-parser": "4.2.0",
+ "react-refresh": "0.18.0",
+ "remotion": "4.0.441",
+ "source-map": "0.7.3",
+ "style-loader": "4.0.0",
+ "webpack": "5.105.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-darwin-arm64": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-arm64/-/compositor-darwin-arm64-4.0.441.tgz",
+ "integrity": "sha512-ysfrwyQgH42n3lahMUgge6p8L+8U5bsbqTztBsD7uSBV9h0sIeyaFw1M0tMWRPcDzg6PzazFNvSTfZlCMOGJWA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-darwin-x64": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-x64/-/compositor-darwin-x64-4.0.441.tgz",
+ "integrity": "sha512-dilhxinftG9nVnS3Yx5nyM//xUe/+m4OjwRlvdN6/azpLBd2Y1ViBVgh/y+Baz3AZNtyoapbINMN1WAcD0/BUQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-linux-arm64-gnu": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-gnu/-/compositor-linux-arm64-gnu-4.0.441.tgz",
+ "integrity": "sha512-Qmc1SRPBmEdmsA6YYHDsdBG/bY0JNWocv2NSUMEiCB9j7qbpbv1phuxL5GvgyqG4/sYcqSrslWI5OOLBy4EUpg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-linux-arm64-musl": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-musl/-/compositor-linux-arm64-musl-4.0.441.tgz",
+ "integrity": "sha512-I7XrINOAqLFK2xD4IMEKlzqXm+5JQRPBtx9p6LUy+B748wR3RodGrG4/REVoVOufgihmrxNix0iJajJLWxbZ4Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-linux-x64-gnu": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-gnu/-/compositor-linux-x64-gnu-4.0.441.tgz",
+ "integrity": "sha512-CgN6TBkEmyvcH26dKKaT2qzkTYlMN9lSAM7JJiF8zi3e5OPVzdA+ceYiybFa60dj4jg4DnBfbunHMZUoR6AwhA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-linux-x64-musl": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-musl/-/compositor-linux-x64-musl-4.0.441.tgz",
+ "integrity": "sha512-xN2EeyI5q3KmWw1RtIZ+9uIupBPkheRptSu15mYOoRiNPuwT0XrCaGeCgvwAPNzzTk5p8flaqiqlEIfMzdubYA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/compositor-win32-x64-msvc": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-win32-x64-msvc/-/compositor-win32-x64-msvc-4.0.441.tgz",
+ "integrity": "sha512-FbUVBFrNoAKxKKPEk9X0oriHQcOnxZqEUXpjhOFnH+Ndq8ro61LCK8RCC7g1hmrwKm66k46ROyHNz+CjaGXc3g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/media-parser": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/media-parser/-/media-parser-4.0.441.tgz",
+ "integrity": "sha512-yrx6S34y/NX724Lz9jX5RKT09FdJaI6S39bTq/aEUkBc0VzeGnQXkkFrKABTG+JNPoASdk6ILTGqOHWBM0W1qQ==",
+ "license": "Remotion License https://remotion.dev/license"
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/renderer": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/renderer/-/renderer-4.0.441.tgz",
+ "integrity": "sha512-NcauF41tDR294eDGC+NzAo8135F0rIpRVcrFkxKTn+Qoyd5qy3y2uBBC92lcL+tAj8ECjXTRlBE3VJ0E40klaQ==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "dependencies": {
+ "@remotion/licensing": "4.0.441",
+ "@remotion/streaming": "4.0.441",
+ "execa": "5.1.1",
+ "extract-zip": "2.0.1",
+ "remotion": "4.0.441",
+ "source-map": "^0.8.0-beta.0",
+ "ws": "8.17.1"
+ },
+ "optionalDependencies": {
+ "@remotion/compositor-darwin-arm64": "4.0.441",
+ "@remotion/compositor-darwin-x64": "4.0.441",
+ "@remotion/compositor-linux-arm64-gnu": "4.0.441",
+ "@remotion/compositor-linux-arm64-musl": "4.0.441",
+ "@remotion/compositor-linux-x64-gnu": "4.0.441",
+ "@remotion/compositor-linux-x64-musl": "4.0.441",
+ "@remotion/compositor-win32-x64-msvc": "4.0.441"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/renderer/node_modules/source-map": {
+ "version": "0.8.0-beta.0",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz",
+ "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==",
+ "deprecated": "The work that was done in this beta branch won't be included in future versions",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "whatwg-url": "^7.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/streaming": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/streaming/-/streaming-4.0.441.tgz",
+ "integrity": "sha512-vbYywXuVVmFJL06h+HTBgvjPkmCoWV0PgZ2/6MfGmFZ97zpUIM9M0FdVhAfMmcgGRzWpc7KXAt9C4fQwHmuwWQ==",
+ "license": "MIT"
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/studio": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/studio/-/studio-4.0.441.tgz",
+ "integrity": "sha512-E8a7PuIR5khuu2BnPz8M2gwMYz7ufBOKmQdSLXEXkD4EcsyImz+FENna/FIQSHyqL7P9DIQOFF3AgFVUbGUDkw==",
+ "license": "MIT",
+ "dependencies": {
+ "@remotion/media-utils": "4.0.441",
+ "@remotion/player": "4.0.441",
+ "@remotion/renderer": "4.0.441",
+ "@remotion/studio-shared": "4.0.441",
+ "@remotion/web-renderer": "4.0.441",
+ "@remotion/zod-types": "4.0.441",
+ "mediabunny": "1.39.2",
+ "memfs": "3.4.3",
+ "open": "^8.4.2",
+ "remotion": "4.0.441",
+ "semver": "7.5.3",
+ "source-map": "0.7.3",
+ "zod": "4.3.6"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/web-renderer": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/web-renderer/-/web-renderer-4.0.441.tgz",
+ "integrity": "sha512-nUD9gVvfb+GnRYw1WNh7WHZ953FHcj2+bcPp3fOWGT7foZLfSK9W2pwDzSk64pFOhowrAWE8lMJhrxWsE23Z0w==",
+ "license": "UNLICENSED",
+ "dependencies": {
+ "@mediabunny/aac-encoder": "1.39.2",
+ "@mediabunny/flac-encoder": "1.39.2",
+ "@mediabunny/mp3-encoder": "1.39.2",
+ "@remotion/licensing": "4.0.441",
+ "mediabunny": "1.39.2",
+ "remotion": "4.0.441"
+ },
+ "peerDependencies": {
+ "react": ">=18.0.0",
+ "react-dom": ">=18.0.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/@remotion/zod-types": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/zod-types/-/zod-types-4.0.441.tgz",
+ "integrity": "sha512-MjIhb0ykDuXjyTRXtGga0Qi9qmKZvt6xPS3RlvDaRxSZ9MzrRzXisN7g2Yb5RexNM1N+N1pwRZ9JDyakkerKOw==",
+ "license": "MIT",
+ "dependencies": {
+ "remotion": "4.0.441"
+ },
+ "peerDependencies": {
+ "zod": "4.3.6"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/dotenv": {
+ "version": "17.3.1",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz",
+ "integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/esbuild": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz",
+ "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.0",
+ "@esbuild/android-arm": "0.25.0",
+ "@esbuild/android-arm64": "0.25.0",
+ "@esbuild/android-x64": "0.25.0",
+ "@esbuild/darwin-arm64": "0.25.0",
+ "@esbuild/darwin-x64": "0.25.0",
+ "@esbuild/freebsd-arm64": "0.25.0",
+ "@esbuild/freebsd-x64": "0.25.0",
+ "@esbuild/linux-arm": "0.25.0",
+ "@esbuild/linux-arm64": "0.25.0",
+ "@esbuild/linux-ia32": "0.25.0",
+ "@esbuild/linux-loong64": "0.25.0",
+ "@esbuild/linux-mips64el": "0.25.0",
+ "@esbuild/linux-ppc64": "0.25.0",
+ "@esbuild/linux-riscv64": "0.25.0",
+ "@esbuild/linux-s390x": "0.25.0",
+ "@esbuild/linux-x64": "0.25.0",
+ "@esbuild/netbsd-arm64": "0.25.0",
+ "@esbuild/netbsd-x64": "0.25.0",
+ "@esbuild/openbsd-arm64": "0.25.0",
+ "@esbuild/openbsd-x64": "0.25.0",
+ "@esbuild/sunos-x64": "0.25.0",
+ "@esbuild/win32-arm64": "0.25.0",
+ "@esbuild/win32-ia32": "0.25.0",
+ "@esbuild/win32-x64": "0.25.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/minimist": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
+ "license": "MIT"
+ },
+ "node_modules/@remotion/cli/node_modules/remotion": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.441.tgz",
+ "integrity": "sha512-m0010sJn8KpW4mEB7aq0CKSNnw048w5cG/uvT9AqGNMfERjXyE+uLBaX769tP/lJ0pNfUWGii/iQMkd5pHZC3A==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/ws": {
+ "version": "8.17.1",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
+ "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@remotion/cli/node_modules/zod": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
+ "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
+ "license": "MIT",
+ "peer": true,
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/@remotion/compositor-darwin-arm64": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-arm64/-/compositor-darwin-arm64-4.0.472.tgz",
+ "integrity": "sha512-rx1CfDem1AutPYWGqXyV8dFQ+YsCE6pYrj0cLDAtx/5xPazTnMhx1X59SM21legGzBrcMVmXyV7TXoc0psGb+A==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@remotion/compositor-darwin-x64": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-x64/-/compositor-darwin-x64-4.0.472.tgz",
+ "integrity": "sha512-v8unDWuK52AGIEr9r9g+9G0Q3JNQdnjlKqSw9bBXPI2YkWms4Z5LSfSR5S0BEp7vXFRmhZm7i/3biI6p3P1LDw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@remotion/compositor-linux-arm64-gnu": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-gnu/-/compositor-linux-arm64-gnu-4.0.472.tgz",
+ "integrity": "sha512-Nv+4zePiAn5lYAy4qZKHBTeIoRjoXkatucv72OXC54Q3spkjOravOVGalxbGm021rMMGtJw0JoL0Sq4HyNjzbg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/compositor-linux-arm64-musl": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-musl/-/compositor-linux-arm64-musl-4.0.472.tgz",
+ "integrity": "sha512-Zal+fYYQQTaymg8IxaZKQzotSWfGYfucNyX0M+uRJZzZ0PIfSqSbk6NyfTqIq3Fvc9r1Lb95ZXvWOGPZxAWdJQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/compositor-linux-x64-gnu": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-gnu/-/compositor-linux-x64-gnu-4.0.472.tgz",
+ "integrity": "sha512-cxjPknG9xeqvHX3eDxcOwKjpF3Yghtpel7QIJkZGZ0pZn0CHA8Q90pHIfWbX5vZ2PuBY9VMd84KafdCi+iXofQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/compositor-linux-x64-musl": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-musl/-/compositor-linux-x64-musl-4.0.472.tgz",
+ "integrity": "sha512-b5005WFifrfxsViyReGBEn04I2B/rLe7RQQpNNhl+qr/X3l0ouWf9rqZxB5IU5Sut1iLRCHrPdlAW6M3HgaFCw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
"node_modules/@remotion/compositor-win32-x64-msvc": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-win32-x64-msvc/-/compositor-win32-x64-msvc-4.0.472.tgz",
+ "integrity": "sha512-hvWIh4qWujTBr8SxJhbzPMSLYoWqjQShWtc3zRfORtziLulc1lf61MdXGPaUYn5RGJMF1BgoVo0pctmJ5ZAdeA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@remotion/licensing": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/licensing/-/licensing-4.0.441.tgz",
+ "integrity": "sha512-wXeqlXVy9Cstv7m2DR5OPsVCj14nKTNx5/JO/pFoPRi4P5KVE2U9pb2P5Jk4WVKvKWbQTk2fbL+lkOM8vyXXNQ==",
+ "license": "MIT"
+ },
+ "node_modules/@remotion/media-parser": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/media-parser/-/media-parser-4.0.472.tgz",
+ "integrity": "sha512-tgk83JXQCkrZDToYR3uaSxmWcy1jFuy0B5zWYZB58ocskuR4ZxJwFjjyJT7cPlQd7gWZG9RTET2xtdsffycKYg==",
+ "license": "Remotion License https://remotion.dev/license"
+ },
+ "node_modules/@remotion/media-utils": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/media-utils/-/media-utils-4.0.441.tgz",
+ "integrity": "sha512-Cdtozo+6jM2gN3tvZufeIZUzG1A06g5IUqYjwTMa2o9JQk3BzP3INzGluMdrN70id2icEPkO4JjmBt1XB/mFfg==",
+ "license": "MIT",
+ "dependencies": {
+ "mediabunny": "1.39.2",
+ "remotion": "4.0.441"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/media-utils/node_modules/remotion": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.441.tgz",
+ "integrity": "sha512-m0010sJn8KpW4mEB7aq0CKSNnw048w5cG/uvT9AqGNMfERjXyE+uLBaX769tP/lJ0pNfUWGii/iQMkd5pHZC3A==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/player": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/player/-/player-4.0.441.tgz",
+ "integrity": "sha512-5u9rjMrC5Tkrjlii+5CvH98SIj5uiol3zrhJzjHdfcoF4ew3ejy0ieXKwaVE16Uj0iN0XQR/UF+Xe/Sps2mj5g==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "dependencies": {
+ "remotion": "4.0.441"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/player/node_modules/remotion": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.441.tgz",
+ "integrity": "sha512-m0010sJn8KpW4mEB7aq0CKSNnw048w5cG/uvT9AqGNMfERjXyE+uLBaX769tP/lJ0pNfUWGii/iQMkd5pHZC3A==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/renderer": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/renderer/-/renderer-4.0.472.tgz",
+ "integrity": "sha512-SdYGr2Qw2PYTN6OCdssU41fs8i8ql3mv9A7KISc7rVK43dKjl0QUmgKxnbqng8E0mTFOufUMHkH8O+7eRXaYgQ==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "dependencies": {
+ "@remotion/licensing": "4.0.472",
+ "@remotion/streaming": "4.0.472",
+ "execa": "5.1.1",
+ "remotion": "4.0.472",
+ "source-map": "0.8.0-beta.0",
+ "ws": "8.20.1"
+ },
+ "optionalDependencies": {
+ "@remotion/compositor-darwin-arm64": "4.0.472",
+ "@remotion/compositor-darwin-x64": "4.0.472",
+ "@remotion/compositor-linux-arm64-gnu": "4.0.472",
+ "@remotion/compositor-linux-arm64-musl": "4.0.472",
+ "@remotion/compositor-linux-x64-gnu": "4.0.472",
+ "@remotion/compositor-linux-x64-musl": "4.0.472",
+ "@remotion/compositor-win32-x64-msvc": "4.0.472"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/renderer/node_modules/@remotion/licensing": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/licensing/-/licensing-4.0.472.tgz",
+ "integrity": "sha512-U4HDRXZHA+Jm7n8SErFBIwfUvKm72DB5w9tuddRmPTBbvZGvl6XCmdndDcO6Wy/1QHAPbjIfhy912nWUVz5HGg==",
+ "license": "MIT"
+ },
+ "node_modules/@remotion/renderer/node_modules/source-map": {
+ "version": "0.8.0-beta.0",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz",
+ "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==",
+ "deprecated": "The work that was done in this beta branch won't be included in future versions",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "whatwg-url": "^7.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@remotion/streaming": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/streaming/-/streaming-4.0.472.tgz",
+ "integrity": "sha512-sx2fhVhPwYj6mVoqP4WZUbTC0Pl7xpuiftentSSPtQtmmZ3NP9kPlsBL850JooDHVOS2q5KZPfp+aGkZnIEQ0w==",
+ "license": "MIT"
+ },
+ "node_modules/@remotion/studio": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/studio/-/studio-4.0.472.tgz",
+ "integrity": "sha512-BJnZI1BG9v4D1x3MNY/3AvqtjuBWPt77+Y4zK4PTX4Ap2HSnT2H/bu7bxEv1mmBF/7fusFV+BmdQL18IMqGB/A==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.31",
+ "@remotion/media-utils": "4.0.472",
+ "@remotion/player": "4.0.472",
+ "@remotion/renderer": "4.0.472",
+ "@remotion/studio-shared": "4.0.472",
+ "@remotion/timeline-utils": "4.0.472",
+ "@remotion/web-renderer": "4.0.472",
+ "@remotion/zod-types": "4.0.472",
+ "mediabunny": "1.45.0",
+ "memfs": "3.4.3",
+ "open": "8.4.2",
+ "remotion": "4.0.472",
+ "semver": "7.5.3",
+ "zod": "4.3.6"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/studio-server": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/studio-server/-/studio-server-4.0.441.tgz",
+ "integrity": "sha512-wD66epr0PdMPtDi/y2yTOT6HZIVn7a3iTUp8PqKYKzhf9BTUQ21kwyn6IGNamIGjIU715E/LysXg57VK6rowyg==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "7.24.1",
+ "@remotion/bundler": "4.0.441",
+ "@remotion/renderer": "4.0.441",
+ "@remotion/studio-shared": "4.0.441",
+ "memfs": "3.4.3",
+ "open": "^8.4.2",
+ "prettier": "3.8.1",
+ "recast": "0.23.11",
+ "remotion": "4.0.441",
+ "semver": "7.5.3",
+ "source-map": "0.7.3"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
+ "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/android-arm": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz",
+ "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/android-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz",
+ "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/android-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz",
+ "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz",
+ "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz",
+ "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz",
+ "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-arm": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz",
+ "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz",
+ "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz",
+ "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz",
+ "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz",
+ "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==",
+ "cpu": [
+ "mips64el"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz",
+ "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz",
+ "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz",
+ "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/linux-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz",
+ "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz",
+ "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz",
+ "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz",
+ "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@esbuild/win32-x64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz",
+ "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@mediabunny/aac-encoder": {
+ "version": "1.39.2",
+ "resolved": "https://registry.npmjs.org/@mediabunny/aac-encoder/-/aac-encoder-1.39.2.tgz",
+ "integrity": "sha512-KD6KADVzAnW7tqhRFGBOX4uaiHbd0Yxvg0lfthj3wJLAEEgEBAvi43w+ZXWeEn54X/jpabrLe4bW/eYFFvlbUA==",
+ "license": "MPL-2.0",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ },
+ "peerDependencies": {
+ "mediabunny": "^1.0.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@mediabunny/flac-encoder": {
+ "version": "1.39.2",
+ "resolved": "https://registry.npmjs.org/@mediabunny/flac-encoder/-/flac-encoder-1.39.2.tgz",
+ "integrity": "sha512-VwBr3AzZTPEEPvt4aladZiXwOf3W293eq213zDupGQi/taS8WWNqDd3eBdf8FfvlbXATfbRiycXDKyQ0HlOZaQ==",
+ "license": "MPL-2.0",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ },
+ "peerDependencies": {
+ "mediabunny": "^1.0.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@mediabunny/mp3-encoder": {
+ "version": "1.39.2",
+ "resolved": "https://registry.npmjs.org/@mediabunny/mp3-encoder/-/mp3-encoder-1.39.2.tgz",
+ "integrity": "sha512-3rrodrGnUpUP8F2d1aRUl8IvjqK3jegkupbOzvOokooSAO5rXk2Lr5jZe7TnPeiVGiXfmnoJ7s9uyUOHlCd8qw==",
+ "license": "MPL-2.0",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ },
+ "peerDependencies": {
+ "mediabunny": "^1.0.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/bundler": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/bundler/-/bundler-4.0.441.tgz",
+ "integrity": "sha512-DLNPHeo4FH/nUyr34N6LcxQGzmBpfb1kx5DJz9XIMPYcE6scenV0DwxV2JTK0s1Ln3OFGvK5sQlm6NlPohvTkw==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "dependencies": {
+ "@remotion/media-parser": "4.0.441",
+ "@remotion/studio": "4.0.441",
+ "@remotion/studio-shared": "4.0.441",
+ "@rspack/core": "1.7.6",
+ "@rspack/plugin-react-refresh": "1.6.1",
+ "esbuild": "0.25.0",
+ "loader-utils": "2.0.2",
+ "postcss": "8.5.1",
+ "postcss-value-parser": "4.2.0",
+ "react-refresh": "0.18.0",
+ "remotion": "4.0.441",
+ "source-map": "0.7.3",
+ "style-loader": "4.0.0",
+ "webpack": "5.105.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-darwin-arm64": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-arm64/-/compositor-darwin-arm64-4.0.441.tgz",
+ "integrity": "sha512-ysfrwyQgH42n3lahMUgge6p8L+8U5bsbqTztBsD7uSBV9h0sIeyaFw1M0tMWRPcDzg6PzazFNvSTfZlCMOGJWA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-darwin-x64": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-darwin-x64/-/compositor-darwin-x64-4.0.441.tgz",
+ "integrity": "sha512-dilhxinftG9nVnS3Yx5nyM//xUe/+m4OjwRlvdN6/azpLBd2Y1ViBVgh/y+Baz3AZNtyoapbINMN1WAcD0/BUQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-linux-arm64-gnu": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-gnu/-/compositor-linux-arm64-gnu-4.0.441.tgz",
+ "integrity": "sha512-Qmc1SRPBmEdmsA6YYHDsdBG/bY0JNWocv2NSUMEiCB9j7qbpbv1phuxL5GvgyqG4/sYcqSrslWI5OOLBy4EUpg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-linux-arm64-musl": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-arm64-musl/-/compositor-linux-arm64-musl-4.0.441.tgz",
+ "integrity": "sha512-I7XrINOAqLFK2xD4IMEKlzqXm+5JQRPBtx9p6LUy+B748wR3RodGrG4/REVoVOufgihmrxNix0iJajJLWxbZ4Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-linux-x64-gnu": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-gnu/-/compositor-linux-x64-gnu-4.0.441.tgz",
+ "integrity": "sha512-CgN6TBkEmyvcH26dKKaT2qzkTYlMN9lSAM7JJiF8zi3e5OPVzdA+ceYiybFa60dj4jg4DnBfbunHMZUoR6AwhA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-linux-x64-musl": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/compositor-linux-x64-musl/-/compositor-linux-x64-musl-4.0.441.tgz",
+ "integrity": "sha512-xN2EeyI5q3KmWw1RtIZ+9uIupBPkheRptSu15mYOoRiNPuwT0XrCaGeCgvwAPNzzTk5p8flaqiqlEIfMzdubYA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/compositor-win32-x64-msvc": {
"version": "4.0.441",
"resolved": "https://registry.npmjs.org/@remotion/compositor-win32-x64-msvc/-/compositor-win32-x64-msvc-4.0.441.tgz",
"integrity": "sha512-FbUVBFrNoAKxKKPEk9X0oriHQcOnxZqEUXpjhOFnH+Ndq8ro61LCK8RCC7g1hmrwKm66k46ROyHNz+CjaGXc3g==",
@@ -1612,46 +3510,13 @@
"win32"
]
},
- "node_modules/@remotion/licensing": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/licensing/-/licensing-4.0.441.tgz",
- "integrity": "sha512-wXeqlXVy9Cstv7m2DR5OPsVCj14nKTNx5/JO/pFoPRi4P5KVE2U9pb2P5Jk4WVKvKWbQTk2fbL+lkOM8vyXXNQ==",
- "license": "MIT"
- },
- "node_modules/@remotion/media-parser": {
+ "node_modules/@remotion/studio-server/node_modules/@remotion/media-parser": {
"version": "4.0.441",
"resolved": "https://registry.npmjs.org/@remotion/media-parser/-/media-parser-4.0.441.tgz",
"integrity": "sha512-yrx6S34y/NX724Lz9jX5RKT09FdJaI6S39bTq/aEUkBc0VzeGnQXkkFrKABTG+JNPoASdk6ILTGqOHWBM0W1qQ==",
"license": "Remotion License https://remotion.dev/license"
},
- "node_modules/@remotion/media-utils": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/media-utils/-/media-utils-4.0.441.tgz",
- "integrity": "sha512-Cdtozo+6jM2gN3tvZufeIZUzG1A06g5IUqYjwTMa2o9JQk3BzP3INzGluMdrN70id2icEPkO4JjmBt1XB/mFfg==",
- "license": "MIT",
- "dependencies": {
- "mediabunny": "1.39.2",
- "remotion": "4.0.441"
- },
- "peerDependencies": {
- "react": ">=16.8.0",
- "react-dom": ">=16.8.0"
- }
- },
- "node_modules/@remotion/player": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/player/-/player-4.0.441.tgz",
- "integrity": "sha512-5u9rjMrC5Tkrjlii+5CvH98SIj5uiol3zrhJzjHdfcoF4ew3ejy0ieXKwaVE16Uj0iN0XQR/UF+Xe/Sps2mj5g==",
- "license": "SEE LICENSE IN LICENSE.md",
- "dependencies": {
- "remotion": "4.0.441"
- },
- "peerDependencies": {
- "react": ">=16.8.0",
- "react-dom": ">=16.8.0"
- }
- },
- "node_modules/@remotion/renderer": {
+ "node_modules/@remotion/studio-server/node_modules/@remotion/renderer": {
"version": "4.0.441",
"resolved": "https://registry.npmjs.org/@remotion/renderer/-/renderer-4.0.441.tgz",
"integrity": "sha512-NcauF41tDR294eDGC+NzAo8135F0rIpRVcrFkxKTn+Qoyd5qy3y2uBBC92lcL+tAj8ECjXTRlBE3VJ0E40klaQ==",
@@ -1679,7 +3544,7 @@
"react-dom": ">=16.8.0"
}
},
- "node_modules/@remotion/renderer/node_modules/source-map": {
+ "node_modules/@remotion/studio-server/node_modules/@remotion/renderer/node_modules/source-map": {
"version": "0.8.0-beta.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz",
"integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==",
@@ -1692,13 +3557,13 @@
"node": ">= 8"
}
},
- "node_modules/@remotion/streaming": {
+ "node_modules/@remotion/studio-server/node_modules/@remotion/streaming": {
"version": "4.0.441",
"resolved": "https://registry.npmjs.org/@remotion/streaming/-/streaming-4.0.441.tgz",
"integrity": "sha512-vbYywXuVVmFJL06h+HTBgvjPkmCoWV0PgZ2/6MfGmFZ97zpUIM9M0FdVhAfMmcgGRzWpc7KXAt9C4fQwHmuwWQ==",
"license": "MIT"
},
- "node_modules/@remotion/studio": {
+ "node_modules/@remotion/studio-server/node_modules/@remotion/studio": {
"version": "4.0.441",
"resolved": "https://registry.npmjs.org/@remotion/studio/-/studio-4.0.441.tgz",
"integrity": "sha512-E8a7PuIR5khuu2BnPz8M2gwMYz7ufBOKmQdSLXEXkD4EcsyImz+FENna/FIQSHyqL7P9DIQOFF3AgFVUbGUDkw==",
@@ -1723,23 +3588,115 @@
"react-dom": ">=16.8.0"
}
},
- "node_modules/@remotion/studio-server": {
+ "node_modules/@remotion/studio-server/node_modules/@remotion/web-renderer": {
"version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/studio-server/-/studio-server-4.0.441.tgz",
- "integrity": "sha512-wD66epr0PdMPtDi/y2yTOT6HZIVn7a3iTUp8PqKYKzhf9BTUQ21kwyn6IGNamIGjIU715E/LysXg57VK6rowyg==",
+ "resolved": "https://registry.npmjs.org/@remotion/web-renderer/-/web-renderer-4.0.441.tgz",
+ "integrity": "sha512-nUD9gVvfb+GnRYw1WNh7WHZ953FHcj2+bcPp3fOWGT7foZLfSK9W2pwDzSk64pFOhowrAWE8lMJhrxWsE23Z0w==",
+ "license": "UNLICENSED",
+ "dependencies": {
+ "@mediabunny/aac-encoder": "1.39.2",
+ "@mediabunny/flac-encoder": "1.39.2",
+ "@mediabunny/mp3-encoder": "1.39.2",
+ "@remotion/licensing": "4.0.441",
+ "mediabunny": "1.39.2",
+ "remotion": "4.0.441"
+ },
+ "peerDependencies": {
+ "react": ">=18.0.0",
+ "react-dom": ">=18.0.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/@remotion/zod-types": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/@remotion/zod-types/-/zod-types-4.0.441.tgz",
+ "integrity": "sha512-MjIhb0ykDuXjyTRXtGga0Qi9qmKZvt6xPS3RlvDaRxSZ9MzrRzXisN7g2Yb5RexNM1N+N1pwRZ9JDyakkerKOw==",
"license": "MIT",
"dependencies": {
- "@babel/parser": "7.24.1",
- "@remotion/bundler": "4.0.441",
- "@remotion/renderer": "4.0.441",
- "@remotion/studio-shared": "4.0.441",
- "memfs": "3.4.3",
- "open": "^8.4.2",
- "prettier": "3.8.1",
- "recast": "0.23.11",
- "remotion": "4.0.441",
- "semver": "7.5.3",
- "source-map": "0.7.3"
+ "remotion": "4.0.441"
+ },
+ "peerDependencies": {
+ "zod": "4.3.6"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/esbuild": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz",
+ "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.0",
+ "@esbuild/android-arm": "0.25.0",
+ "@esbuild/android-arm64": "0.25.0",
+ "@esbuild/android-x64": "0.25.0",
+ "@esbuild/darwin-arm64": "0.25.0",
+ "@esbuild/darwin-x64": "0.25.0",
+ "@esbuild/freebsd-arm64": "0.25.0",
+ "@esbuild/freebsd-x64": "0.25.0",
+ "@esbuild/linux-arm": "0.25.0",
+ "@esbuild/linux-arm64": "0.25.0",
+ "@esbuild/linux-ia32": "0.25.0",
+ "@esbuild/linux-loong64": "0.25.0",
+ "@esbuild/linux-mips64el": "0.25.0",
+ "@esbuild/linux-ppc64": "0.25.0",
+ "@esbuild/linux-riscv64": "0.25.0",
+ "@esbuild/linux-s390x": "0.25.0",
+ "@esbuild/linux-x64": "0.25.0",
+ "@esbuild/netbsd-arm64": "0.25.0",
+ "@esbuild/netbsd-x64": "0.25.0",
+ "@esbuild/openbsd-arm64": "0.25.0",
+ "@esbuild/openbsd-x64": "0.25.0",
+ "@esbuild/sunos-x64": "0.25.0",
+ "@esbuild/win32-arm64": "0.25.0",
+ "@esbuild/win32-ia32": "0.25.0",
+ "@esbuild/win32-x64": "0.25.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/remotion": {
+ "version": "4.0.441",
+ "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.441.tgz",
+ "integrity": "sha512-m0010sJn8KpW4mEB7aq0CKSNnw048w5cG/uvT9AqGNMfERjXyE+uLBaX769tP/lJ0pNfUWGii/iQMkd5pHZC3A==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/ws": {
+ "version": "8.17.1",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
+ "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@remotion/studio-server/node_modules/zod": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
+ "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
+ "license": "MIT",
+ "peer": true,
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
}
},
"node_modules/@remotion/studio-shared": {
@@ -1751,18 +3708,82 @@
"remotion": "4.0.441"
}
},
- "node_modules/@remotion/studio/node_modules/@remotion/zod-types": {
+ "node_modules/@remotion/studio-shared/node_modules/remotion": {
"version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/zod-types/-/zod-types-4.0.441.tgz",
- "integrity": "sha512-MjIhb0ykDuXjyTRXtGga0Qi9qmKZvt6xPS3RlvDaRxSZ9MzrRzXisN7g2Yb5RexNM1N+N1pwRZ9JDyakkerKOw==",
+ "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.441.tgz",
+ "integrity": "sha512-m0010sJn8KpW4mEB7aq0CKSNnw048w5cG/uvT9AqGNMfERjXyE+uLBaX769tP/lJ0pNfUWGii/iQMkd5pHZC3A==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/studio/node_modules/@remotion/media-utils": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/media-utils/-/media-utils-4.0.472.tgz",
+ "integrity": "sha512-Hz2Ght6qiNg95Uzw/FovybhExHnS0WZPT/rxt4z/y0HrunemyCrSE8XOXNdXxqnVwHGRdfxJ+wlJflXuZQpX1w==",
"license": "MIT",
"dependencies": {
- "remotion": "4.0.441"
+ "mediabunny": "1.45.0",
+ "remotion": "4.0.472"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/studio/node_modules/@remotion/player": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/player/-/player-4.0.472.tgz",
+ "integrity": "sha512-YVQDIKzIpLLgHoufoTn9FogLfwrOOvm2UWvFHVLVKNtXp6LFjWaRPoa7vv/a4kZdqyv14Y0r2/1N93CpzoHEZQ==",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "dependencies": {
+ "remotion": "4.0.472"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@remotion/studio/node_modules/@remotion/studio-shared": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/studio-shared/-/studio-shared-4.0.472.tgz",
+ "integrity": "sha512-JP5SDmfJ+WPbYTpXauZ7OF2Sk0ppKdKSk2NGLE6EASiLTVg9edt1wxat7aP5eHAnkpHbEicCQrYVvSN0lPQORg==",
+ "license": "MIT",
+ "dependencies": {
+ "remotion": "4.0.472"
+ }
+ },
+ "node_modules/@remotion/studio/node_modules/@remotion/zod-types": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/zod-types/-/zod-types-4.0.472.tgz",
+ "integrity": "sha512-5exoKjC+7gl2Xaht8uKnhUlwBpDBLvaX6NTzVzhUOvMbWd19JWKFDyjRxZiHKGmz5P2STaN/p4oCU3dNKFmi5w==",
+ "license": "MIT",
+ "dependencies": {
+ "remotion": "4.0.472"
},
"peerDependencies": {
"zod": "4.3.6"
}
},
+ "node_modules/@remotion/studio/node_modules/mediabunny": {
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/mediabunny/-/mediabunny-1.45.0.tgz",
+ "integrity": "sha512-oK3sMMYbucoF6LUX62L/2M9d+p9ve6KDQgL87kNfhsB0/XmTe9iRLUcgQgg9Gpgvi8Sb96zYfOUL6i17y0bdNg==",
+ "license": "MPL-2.0",
+ "workspaces": [
+ ".",
+ "packages/*"
+ ],
+ "dependencies": {
+ "@types/dom-mediacapture-transform": "^0.1.11",
+ "@types/dom-webcodecs": "0.1.13"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ }
+ },
"node_modules/@remotion/studio/node_modules/zod": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
@@ -1770,27 +3791,85 @@
"license": "MIT",
"peer": true,
"funding": {
- "url": "https://github.com/sponsors/colinhacks"
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/@remotion/timeline-utils": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/timeline-utils/-/timeline-utils-4.0.472.tgz",
+ "integrity": "sha512-MIJ5+45qvEHubFh5Lb5Jt15CagsEatLRXYhpV/re1DC2GkdnAkdbHqk50yUuw10zYKa8qZyDQrrVD0qM5HL5kQ==",
+ "license": "MIT",
+ "dependencies": {
+ "mediabunny": "1.45.0"
+ }
+ },
+ "node_modules/@remotion/timeline-utils/node_modules/mediabunny": {
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/mediabunny/-/mediabunny-1.45.0.tgz",
+ "integrity": "sha512-oK3sMMYbucoF6LUX62L/2M9d+p9ve6KDQgL87kNfhsB0/XmTe9iRLUcgQgg9Gpgvi8Sb96zYfOUL6i17y0bdNg==",
+ "license": "MPL-2.0",
+ "workspaces": [
+ ".",
+ "packages/*"
+ ],
+ "dependencies": {
+ "@types/dom-mediacapture-transform": "^0.1.11",
+ "@types/dom-webcodecs": "0.1.13"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
}
},
"node_modules/@remotion/web-renderer": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/@remotion/web-renderer/-/web-renderer-4.0.441.tgz",
- "integrity": "sha512-nUD9gVvfb+GnRYw1WNh7WHZ953FHcj2+bcPp3fOWGT7foZLfSK9W2pwDzSk64pFOhowrAWE8lMJhrxWsE23Z0w==",
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/web-renderer/-/web-renderer-4.0.472.tgz",
+ "integrity": "sha512-ufiFmgQ4dcF8MuKEIZ3WJHU8PyvAQgcPoyOsWUNXHEZoVz9cD0t6efDF67HEOb/sl6sd/1n2li+CRzvmBi+YUA==",
"license": "UNLICENSED",
"dependencies": {
- "@mediabunny/aac-encoder": "1.39.2",
- "@mediabunny/flac-encoder": "1.39.2",
- "@mediabunny/mp3-encoder": "1.39.2",
- "@remotion/licensing": "4.0.441",
- "mediabunny": "1.39.2",
- "remotion": "4.0.441"
+ "@mediabunny/aac-encoder": "1.45.0",
+ "@mediabunny/flac-encoder": "1.45.0",
+ "@mediabunny/mp3-encoder": "1.45.0",
+ "@remotion/licensing": "4.0.472",
+ "mediabunny": "1.45.0",
+ "remotion": "4.0.472"
},
"peerDependencies": {
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
},
+ "node_modules/@remotion/web-renderer/node_modules/@remotion/licensing": {
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/@remotion/licensing/-/licensing-4.0.472.tgz",
+ "integrity": "sha512-U4HDRXZHA+Jm7n8SErFBIwfUvKm72DB5w9tuddRmPTBbvZGvl6XCmdndDcO6Wy/1QHAPbjIfhy912nWUVz5HGg==",
+ "license": "MIT"
+ },
+ "node_modules/@remotion/web-renderer/node_modules/mediabunny": {
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/mediabunny/-/mediabunny-1.45.0.tgz",
+ "integrity": "sha512-oK3sMMYbucoF6LUX62L/2M9d+p9ve6KDQgL87kNfhsB0/XmTe9iRLUcgQgg9Gpgvi8Sb96zYfOUL6i17y0bdNg==",
+ "license": "MPL-2.0",
+ "workspaces": [
+ ".",
+ "packages/*"
+ ],
+ "dependencies": {
+ "@types/dom-mediacapture-transform": "^0.1.11",
+ "@types/dom-webcodecs": "0.1.13"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
+ }
+ },
+ "node_modules/@rolldown/pluginutils": {
+ "version": "1.0.0-beta.27",
+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
+ "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.60.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz",
@@ -2294,6 +4373,7 @@
"resolved": "https://registry.npmjs.org/@rspack/core/-/core-1.7.6.tgz",
"integrity": "sha512-Iax6UhrfZqJajA778c1d5DBFbSIqPOSrI34kpNIiNpWd8Jq7mFIa+Z60SQb5ZQDZuUxcCZikjz5BxinFjTkg7Q==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@module-federation/runtime-tools": "0.22.0",
"@rspack/binding": "1.7.6",
@@ -2347,15 +4427,60 @@
}
},
"node_modules/@tybys/wasm-util": {
- "version": "0.10.1",
- "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
- "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
+ "version": "0.10.2",
+ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz",
+ "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==",
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
+ "node_modules/@types/babel__core": {
+ "version": "7.20.5",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7",
+ "@types/babel__generator": "*",
+ "@types/babel__template": "*",
+ "@types/babel__traverse": "*"
+ }
+ },
+ "node_modules/@types/babel__generator": {
+ "version": "7.27.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",
+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__template": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",
+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__traverse": {
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",
+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.28.2"
+ }
+ },
"node_modules/@types/body-parser": {
"version": "1.19.6",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz",
@@ -2475,6 +4600,13 @@
"undici-types": "~6.21.0"
}
},
+ "node_modules/@types/prop-types": {
+ "version": "15.7.15",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz",
+ "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/qs": {
"version": "6.14.0",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz",
@@ -2489,6 +4621,28 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/react": {
+ "version": "18.3.30",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.30.tgz",
+ "integrity": "sha512-3ek6mwJL5/VBewBcY4S66cqlCtK3qi4WIq37Z0m/NHw1hjhI7274Mx1qz/+ggSzyBCOEf7eHjBN6INjPAWYfYw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@types/prop-types": "*",
+ "csstype": "^3.2.2"
+ }
+ },
+ "node_modules/@types/react-dom": {
+ "version": "18.3.7",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz",
+ "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "^18.0.0"
+ }
+ },
"node_modules/@types/send": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz",
@@ -2533,6 +4687,37 @@
"@types/node": "*"
}
},
+ "node_modules/@vitejs/plugin-react": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz",
+ "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.28.0",
+ "@babel/plugin-transform-react-jsx-self": "^7.27.1",
+ "@babel/plugin-transform-react-jsx-source": "^7.27.1",
+ "@rolldown/pluginutils": "1.0.0-beta.27",
+ "@types/babel__core": "^7.20.5",
+ "react-refresh": "^0.17.0"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
+ }
+ },
+ "node_modules/@vitejs/plugin-react/node_modules/react-refresh": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz",
+ "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/@vitest/expect": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz",
@@ -2929,9 +5114,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
- "version": "2.10.12",
- "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.12.tgz",
- "integrity": "sha512-qyq26DxfY4awP2gIRXhhLWfwzwI+N5Nxk6iQi8EFizIaWIjqicQTE4sLnZZVdeKPRcVNoJOkkpfzoIYuvCKaIQ==",
+ "version": "2.10.33",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.33.tgz",
+ "integrity": "sha512-bA6+tcSLpz2tIEdDXZPpPTIuxBcC4+w6SieaYyfigIa4h8GlFxbA17v22Vx3JUtuZQj9SgOsnbK+aTBzyDyEuw==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
@@ -3001,9 +5186,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.28.1",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
- "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
+ "version": "4.28.2",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
+ "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
"funding": [
{
"type": "opencollective",
@@ -3021,11 +5206,11 @@
"license": "MIT",
"peer": true,
"dependencies": {
- "baseline-browser-mapping": "^2.9.0",
- "caniuse-lite": "^1.0.30001759",
- "electron-to-chromium": "^1.5.263",
- "node-releases": "^2.0.27",
- "update-browserslist-db": "^1.2.0"
+ "baseline-browser-mapping": "^2.10.12",
+ "caniuse-lite": "^1.0.30001782",
+ "electron-to-chromium": "^1.5.328",
+ "node-releases": "^2.0.36",
+ "update-browserslist-db": "^1.2.3"
},
"bin": {
"browserslist": "cli.js"
@@ -3109,9 +5294,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001782",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001782.tgz",
- "integrity": "sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw==",
+ "version": "1.0.30001793",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz",
+ "integrity": "sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==",
"funding": [
{
"type": "opencollective",
@@ -3282,6 +5467,13 @@
"node": ">= 0.6"
}
},
+ "node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/cookie": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
@@ -3334,6 +5526,72 @@
"node": ">= 8"
}
},
+ "node_modules/css-loader": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.4.tgz",
+ "integrity": "sha512-vv3J9tlOl04WjiMvHQI/9tmIrCxVrj6PFbHemBB1iihpeRbi/I4h033eoFIhwxBBqLhI0KYFS7yvynBFhIZfTw==",
+ "license": "MIT",
+ "dependencies": {
+ "icss-utils": "^5.1.0",
+ "postcss": "^8.4.40",
+ "postcss-modules-extract-imports": "^3.1.0",
+ "postcss-modules-local-by-default": "^4.0.5",
+ "postcss-modules-scope": "^3.2.0",
+ "postcss-modules-values": "^4.0.0",
+ "postcss-value-parser": "^4.2.0",
+ "semver": "^7.6.3"
+ },
+ "engines": {
+ "node": ">= 18.12.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "@rspack/core": "0.x || ^1.0.0 || ^2.0.0-0",
+ "webpack": "^5.27.0"
+ },
+ "peerDependenciesMeta": {
+ "@rspack/core": {
+ "optional": true
+ },
+ "webpack": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/css-loader/node_modules/semver": {
+ "version": "7.8.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz",
+ "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==",
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/cssesc": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
+ "license": "MIT",
+ "bin": {
+ "cssesc": "bin/cssesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/csstype": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -3420,9 +5678,9 @@
"license": "MIT"
},
"node_modules/electron-to-chromium": {
- "version": "1.5.328",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.328.tgz",
- "integrity": "sha512-QNQ5l45DzYytThO21403XN3FvK0hOkWDG8viNf6jqS42msJ8I4tGDSpBCgvDRRPnkffafiwAym2X2eHeGD2V0w==",
+ "version": "1.5.367",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.367.tgz",
+ "integrity": "sha512-4Mk/mrynCNQ+atY40D3UpmhLWB6AHMbYMlIrPhHcMF6x0L7O0b052FCAsxw1LlaR++UFuNg3D/A6XCuGDa0guQ==",
"license": "ISC"
},
"node_modules/emojis-list": {
@@ -3459,13 +5717,13 @@
}
},
"node_modules/enhanced-resolve": {
- "version": "5.20.1",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz",
- "integrity": "sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==",
+ "version": "5.22.2",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.22.2.tgz",
+ "integrity": "sha512-0rxICaFZ7NQho/sHely2bvOPRP0Eu2B0NZ9zM54YvRvWMn7jfz3DmnOZDR9LlXDdDcqntAVc6Hfy4gr/tdH/Ag==",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.4",
- "tapable": "^2.3.0"
+ "tapable": "^2.3.3"
},
"engines": {
"node": ">=10.13.0"
@@ -3499,9 +5757,9 @@
}
},
"node_modules/es-module-lexer": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz",
- "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz",
+ "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==",
"license": "MIT"
},
"node_modules/es-object-atoms": {
@@ -3937,6 +6195,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -4127,6 +6395,18 @@
"url": "https://opencollective.com/express"
}
},
+ "node_modules/icss-utils": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
+ "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
+ "license": "ISC",
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@@ -4231,6 +6511,25 @@
"url": "https://github.com/sponsors/panva"
}
},
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "license": "MIT"
+ },
+ "node_modules/jsesc": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@@ -4277,9 +6576,9 @@
"license": "MIT"
},
"node_modules/loader-runner": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz",
- "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz",
+ "integrity": "sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==",
"license": "MIT",
"engines": {
"node": ">=6.11.5"
@@ -4326,6 +6625,18 @@
"node": ">= 12.0.0"
}
},
+ "node_modules/loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "license": "MIT",
+ "dependencies": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ },
+ "bin": {
+ "loose-envify": "cli.js"
+ }
+ },
"node_modules/loupe": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
@@ -4549,10 +6860,13 @@
"license": "MIT"
},
"node_modules/node-releases": {
- "version": "2.0.36",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz",
- "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==",
- "license": "MIT"
+ "version": "2.0.47",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz",
+ "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
},
"node_modules/npm-run-path": {
"version": "4.0.1",
@@ -4730,6 +7044,7 @@
}
],
"license": "MIT",
+ "peer": true,
"dependencies": {
"nanoid": "^3.3.8",
"picocolors": "^1.1.1",
@@ -4739,6 +7054,78 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/postcss-modules-extract-imports": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz",
+ "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==",
+ "license": "ISC",
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-local-by-default": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz",
+ "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==",
+ "license": "MIT",
+ "dependencies": {
+ "icss-utils": "^5.0.0",
+ "postcss-selector-parser": "^7.0.0",
+ "postcss-value-parser": "^4.1.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-scope": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz",
+ "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==",
+ "license": "ISC",
+ "dependencies": {
+ "postcss-selector-parser": "^7.0.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-values": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz",
+ "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==",
+ "license": "ISC",
+ "dependencies": {
+ "icss-utils": "^5.0.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-selector-parser": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz",
+ "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==",
+ "license": "MIT",
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/postcss-value-parser": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
@@ -4851,26 +7238,30 @@
}
},
"node_modules/react": {
- "version": "19.2.4",
- "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",
- "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",
+ "version": "18.3.1",
+ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
+ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
"license": "MIT",
"peer": true,
+ "dependencies": {
+ "loose-envify": "^1.1.0"
+ },
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-dom": {
- "version": "19.2.4",
- "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",
- "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",
+ "version": "18.3.1",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
+ "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
"license": "MIT",
"peer": true,
"dependencies": {
- "scheduler": "^0.27.0"
+ "loose-envify": "^1.1.0",
+ "scheduler": "^0.23.2"
},
"peerDependencies": {
- "react": "^19.2.4"
+ "react": "^18.3.1"
}
},
"node_modules/react-refresh": {
@@ -4883,6 +7274,38 @@
"node": ">=0.10.0"
}
},
+ "node_modules/react-router": {
+ "version": "6.30.4",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.4.tgz",
+ "integrity": "sha512-SVUsDe+DybHM/WmYKIVYhZh1o5Dcuf16yM6WjG02Q9XVFMZIJyHYhwrr6bFBXZkVP6z69kNkMyBCujt8FaFLJA==",
+ "license": "MIT",
+ "dependencies": {
+ "@remix-run/router": "1.23.3"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8"
+ }
+ },
+ "node_modules/react-router-dom": {
+ "version": "6.30.4",
+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.4.tgz",
+ "integrity": "sha512-q4HvNl+mmDdkS0g+MqiBZNteQJCuimWoOyHMy4T/RQLAn9Z29+E91QXRaxOujeMl2HTzRSS0KFPd7lxX3PjV0Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@remix-run/router": "1.23.3",
+ "react-router": "6.30.4"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8",
+ "react-dom": ">=16.8"
+ }
+ },
"node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
@@ -4923,9 +7346,9 @@
}
},
"node_modules/remotion": {
- "version": "4.0.441",
- "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.441.tgz",
- "integrity": "sha512-m0010sJn8KpW4mEB7aq0CKSNnw048w5cG/uvT9AqGNMfERjXyE+uLBaX769tP/lJ0pNfUWGii/iQMkd5pHZC3A==",
+ "version": "4.0.472",
+ "resolved": "https://registry.npmjs.org/remotion/-/remotion-4.0.472.tgz",
+ "integrity": "sha512-HxzK5lakpZZyb5Gc+0awg9GLPLsRJo+5uomHknZFbfBWHsFRmdGvEYCiYlvwVZpg/iJNgU1wbSZLuyjCJGxg5A==",
"license": "SEE LICENSE IN LICENSE.md",
"peerDependencies": {
"react": ">=16.8.0",
@@ -5075,10 +7498,13 @@
"license": "MIT"
},
"node_modules/scheduler": {
- "version": "0.27.0",
- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
- "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
- "license": "MIT"
+ "version": "0.23.2",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
+ "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
+ "license": "MIT",
+ "dependencies": {
+ "loose-envify": "^1.1.0"
+ }
},
"node_modules/schema-utils": {
"version": "4.3.3",
@@ -5421,9 +7847,9 @@
}
},
"node_modules/tapable": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.2.tgz",
- "integrity": "sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA==",
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz",
+ "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==",
"license": "MIT",
"engines": {
"node": ">=6"
@@ -5452,9 +7878,9 @@
}
},
"node_modules/terser-webpack-plugin": {
- "version": "5.4.0",
- "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.4.0.tgz",
- "integrity": "sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==",
+ "version": "5.6.1",
+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.6.1.tgz",
+ "integrity": "sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==",
"license": "MIT",
"dependencies": {
"@jridgewell/trace-mapping": "^0.3.25",
@@ -5473,12 +7899,39 @@
"webpack": "^5.1.0"
},
"peerDependenciesMeta": {
+ "@minify-html/node": {
+ "optional": true
+ },
"@swc/core": {
"optional": true
},
+ "@swc/css": {
+ "optional": true
+ },
+ "@swc/html": {
+ "optional": true
+ },
+ "clean-css": {
+ "optional": true
+ },
+ "cssnano": {
+ "optional": true
+ },
+ "csso": {
+ "optional": true
+ },
"esbuild": {
"optional": true
},
+ "html-minifier-terser": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
"uglify-js": {
"optional": true
}
@@ -5714,6 +8167,7 @@
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"esbuild": "^0.21.3",
"postcss": "^8.4.43",
@@ -6399,9 +8853,9 @@
}
},
"node_modules/webpack-sources": {
- "version": "3.3.4",
- "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.4.tgz",
- "integrity": "sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==",
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.5.0.tgz",
+ "integrity": "sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ==",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
@@ -6493,9 +8947,9 @@
"license": "ISC"
},
"node_modules/ws": {
- "version": "8.17.1",
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
- "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
+ "version": "8.20.1",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz",
+ "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
diff --git a/package.json b/package.json
index 1ed29a5..fde9871 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "podcli",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "AI-powered podcast clip generator for TikTok/YouTube Shorts. Transcribe, find viral moments, export vertical clips with burned captions.",
"type": "module",
"license": "AGPL-3.0-only",
@@ -25,10 +25,11 @@
"ffmpeg"
],
"scripts": {
- "build": "tsc && cp -r src/ui/public dist/ui/",
+ "build": "tsc && vite build --config src/ui/client/vite.config.ts",
"start": "node dist/index.js",
"dev": "tsx src/index.ts",
"ui": "tsx src/ui/web-server.ts",
+ "ui:dev": "vite --config src/ui/client/vite.config.ts",
"ui:prod": "node dist/ui/web-server.js",
"remotion:prebundle": "node remotion/render.mjs --prebundle",
"remotion:studio": "npx remotion studio remotion/src/index.ts",
@@ -44,6 +45,9 @@
"dotenv": "^16.4.7",
"express": "^4.21.0",
"multer": "^1.4.5-lts.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "react-router-dom": "^6.30.4",
"remotion": "^4.0.441",
"uuid": "^11.1.0",
"winston": "^3.17.0",
@@ -53,9 +57,13 @@
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^22.12.0",
+ "@types/react": "^18.3.30",
+ "@types/react-dom": "^18.3.7",
"@types/uuid": "^10.0.0",
+ "@vitejs/plugin-react": "^4.7.0",
"tsx": "^4.19.0",
"typescript": "^5.7.0",
+ "vite": "^5.4.21",
"vitest": "^2.1.9"
}
}
diff --git a/plans/studio-phase-1.md b/plans/studio-phase-1.md
new file mode 100644
index 0000000..f6446d7
--- /dev/null
+++ b/plans/studio-phase-1.md
@@ -0,0 +1,217 @@
+# podcli Studio — Phase 1 Implementation Plan
+
+> Major release groundwork. Full design (13 decisions) lives in the session memory file
+> `project_studio_dashboard_design.md`. This plan covers **Phase 1 only**: the studio
+> shell, library + per-clip edit pages, and CLI parity. **No YouTube/analytics (Phase 2),
+> no semantic learning (Phase 3).**
+
+**Guiding constraints:** open source; clean, correct, **minimal extra code**; `.podcli/` is the
+shared on-disk contract; Python is the engine + history writer, web/MCP are thin shells.
+
+**Stack decision:** Vite + React Router replaces the single-file CDN-React `src/ui/public/index.html`.
+
+---
+
+## Phase 0 — Discovery (DONE — facts to build on)
+
+**UI / build**
+- No bundler today. `src/ui/public/index.html` (~1880 lines) loads React 18.2 + ReactDOM + babel-standalone via CDN, all app code in one `<script type="text/babel">`. CSS: `public/css/styles.css`. Other pages: `config.html`, `integrations.html`, `knowledge.html`.
+- Express serves statics: `app.use(express.static(join(__dirname, "public")))` — `src/ui/web-server.ts:197`. Port **3847** (`web-server.ts:52`). **No SPA fallback route today.**
+- Build: `"build": "tsc && cp -r src/ui/public dist/ui/"` (`package.json`). `"type":"module"`, target ES2022, module ESNext, `rootDir ./src`, `outDir ./dist`, **no `jsx` configured** (public/ is not part of tsc build).
+- Stable API surface the new UI consumes: `/api/history`, `/api/outputs`, `/api/ui-state` (GET/POST — MCP↔UI bridge), `/api/events` (SSE), `/api/preview/:f`, `/api/stream-source`, plus the full upload→transcribe→suggest→create/batch flow.
+
+**Data layer**
+- `ClipHistoryEntry` (`src/models/index.ts:200-213`): `id, source_video, start_second, end_second, caption_style, crop_strategy, logo_path?, title, output_path, file_size_mb, duration, created_at`. **No** `content_type`, `score`, transcript, or youtube fields.
+- `src/services/clips-history.ts`: `load / save / record / findDuplicate / list / getBySource`. `record(entry: Omit<ClipHistoryEntry,"id"|"created_at">)`. Writes `paths.clipsHistory` = `${home}/history/clips.json`.
+- **5 `record()` call sites**: `web-server.ts:600` (create-clip), `:729` (batch-clips), `:1804` (davinci export); `server.ts:666` (MCP create_clip), `:908` (MCP batch_create_clips).
+- `content_type` originates in `suggest-clips.handler.ts:123`; the suggestion (with `content_type`) is resolved at `create-clip.handler.ts:128-137`; transcript words available at `create-clip.handler.ts:152` — but neither is threaded into `record()`.
+- **Python does NOT read/write clips.json today** — `backend/config/paths.py:59` knows the path; nothing uses it. No Python history module exists.
+- Paths agree across `src/config/paths.ts` and `backend/config/paths.py`.
+
+**CLI / Python**
+- `backend/cli.py`: argparse with `if/elif args.command` dispatch (`main()` ~line 2854+). Existing subcommands: `process, presets, assets, thumbnails, swap-thumbnail, corrections, knowledge, config`.
+- Copy templates: **read** = `cmd_assets` (~2026-2078), **write** = `cmd_knowledge` (~2361-2451). Both print ANSI text, import service modules locally, `sys.exit(1)` on error. `swap-thumbnail` (~2177-2318) finds a clip by **file path**, not clips.json.
+- Config loaded via `from config.paths import paths` (cli.py:43). Service modules live in `backend/services/` (pattern to mirror: `corrections.py`).
+- **CLI = human ANSI text, no `--json`.** The JSON task-runner is separate (`backend/main.py` `emit_result` + `TASK_HANDLERS`), used by `PythonExecutor`. The `clips` CLI commands use the ANSI/human contract.
+- `PythonExecutor.execute(taskType, params)` (`src/services/python-executor.ts`) spawns `backend/main.py`, JSON over stdin/stdout. (Relevant to Phase 2; Phase 1 CLI runs cli.py directly.)
+
+**Concurrency note (accepted constraint):** clips.json has no file locking. Single-user localhost tool; TS writes on render, Python writes on `clips edit` — not concurrent in practice. Do **not** add locking (over-engineering). Both writers must preserve unknown fields on rewrite (read-modify-write, never reconstruct).
+
+---
+
+## Phase 1A — Data foundation (schema + Python history writer)
+
+Lowest risk, no UI. Establishes the shared contract everything else builds on.
+
+### What to implement
+1. **Extend `ClipHistoryEntry`** in `src/models/index.ts:200-213` with **optional** fields (additive, no migration):
+ ```ts
+ content_type?: string; // carried from SuggestedClip at record time
+ transcript_slice?: string; // packed/plain text of the clip's words, captured at render time
+ youtube_video_id?: string; // Phase 2 — declared now so the schema is stable
+ metrics?: { // Phase 2 — declared now, never written in Phase 1
+ views?: number;
+ retention?: number; // averageViewPercentage 0-100
+ ctr?: number; // impressionsClickThroughRate 0-100
+ impressions?: number;
+ fetched_at?: string; // ISO
+ };
+ ```
+2. **Thread `content_type` + `transcript_slice` into the TS record calls** where they are in scope:
+ - In `create-clip.handler.ts`, the resolved `suggestion` (has `content_type`) and `transcriptWords` (line 152) are both available. Build a `transcript_slice` string (join the words whose timestamps fall in `[start_second, end_second]`) and surface both on the handler's return so the web/MCP record sites can pass them.
+ - Update the **5 record() sites** to pass `content_type` and `transcript_slice` when available (omit otherwise — they're optional). Batch/davinci sites: thread per-clip `content_type` if the batch spec carries it; otherwise leave undefined. **Do not invent data** — only pass what is genuinely in scope.
+3. **Create `backend/services/clips_history.py`** mirroring `corrections.py` structure. Functions:
+ ```python
+ load_clips_history() -> list[dict] # read paths["clipsHistory"], [] if missing/bad
+ save_clips_history(entries) -> str # mkdir -p, json.dump indent=2 ensure_ascii=False
+ list_clips(limit=50) -> list[dict] # entries[-limit:][::-1]
+ get_clips_by_source(video_path) -> list[dict] # basename match, reversed
+ find_clip(clip_id) -> dict | None # exact id, also accept 8-char prefix match
+ update_clip(clip_id, **fields) -> dict # read-modify-write, preserve unknown keys, return updated
+ ```
+ Use `from config.paths import paths` and `paths["clipsHistory"]`. **Preserve unknown fields** (read-modify-write) so a TS-written `metrics` block is never clobbered by a Python edit.
+4. **Document the schema** as the cross-language contract: add `docs/clips-schema.md` (or a header comment block in `clips_history.py`) listing every field, type, who writes it (TS-render / Python-edit / Phase-2), and the "preserve unknown fields" rule.
+
+### Documentation references
+- Extend interface: `src/models/index.ts:200-213`.
+- Record sites to update: `web-server.ts:600,729,1804`; `server.ts:666,908`.
+- Where content_type/transcript are in scope: `create-clip.handler.ts:128-137,152`.
+- Python service pattern to copy: `backend/services/corrections.py`; path: `backend/config/paths.py:59`.
+
+### Verification checklist
+- [ ] `npm run build` (tsc) passes with the extended interface.
+- [ ] Render a clip via the web UI → the new `clips.json` entry includes `content_type` and `transcript_slice` (when a suggestion was used).
+- [ ] `python -c "from backend.services.clips_history import list_clips; print(list_clips(3))"` reads the same file TS wrote.
+- [ ] Python `update_clip` then TS `load()` → unknown fields survive both round-trips (write a `metrics` stub by hand, edit title in Python, confirm `metrics` still present).
+
+### Anti-pattern guards
+- ❌ No new entities/tables, no migration script — fields are optional, old entries stay valid.
+- ❌ Do not rewrite clips.json by reconstructing objects field-by-field (drops unknown keys). Read-modify-write only.
+- ❌ Do not add file locking.
+- ❌ Do not fabricate `content_type`/`transcript_slice` where the source data isn't actually in scope — leave undefined.
+
+---
+
+## Phase 1B — CLI `clips` subcommands
+
+Delivers CLI parity for history + re-iteration entry point. Depends on 1A's Python service.
+
+### What to implement
+1. **Register the `clips` subparser** in `cli.py main()` (beside `knowledge`), following the existing `add_parser`/`add_subparsers` pattern:
+ - `clips list [-n/--limit N]`
+ - `clips edit <clip_id> [--title T] [--caption-style S] [--notes ...]` (metadata-only edits per design: edit → save → latest)
+ - `clips reopen <clip_id>` — hydrate `.podcli/ui-state.json` from the history entry so the web Workspace opens with that clip loaded (see below).
+ - Add `elif args.command == "clips": cmd_clips(args)` to dispatch.
+2. **Implement `cmd_clips(args)`** using the `cmd_assets`/`cmd_knowledge` ANSI template:
+ - `list`: print id (8-char), title, source basename, created_at, duration; show `content_type` if present.
+ - `edit`: `find_clip` → apply provided fields → `update_clip`. Error + `sys.exit(1)` if not found.
+ - `reopen`: read the entry; write a single-suggestion `ui-state.json` — `videoPath = source_video`, a one-item `suggestions` array reconstructed from the entry (`title, start_second, end_second, duration, content_type, preview_text = transcript_slice`), `phase = "reviewing"`. This is the CLI→UI bridge over the shared `.podcli/` contract. Print confirmation + the URL `http://localhost:3847/episode?...` (or instruct to open the studio).
+3. **`reopen` semantics are metadata-only in Phase 1** — it loads the clip back into the editing surface; it does not auto-re-render. (Re-render is a save action in the UI / a future flag.)
+
+### Documentation references
+- Subparser + dispatch: `cli.py main()` (~2862-3044).
+- Read handler template: `cmd_assets` (~2026-2078). Write handler template: `cmd_knowledge` (~2361-2451).
+- ui-state shape to write: `UIState` in `src/models/index.ts:106-121` (videoPath, suggestions, phase).
+
+### Verification checklist
+- [ ] `python backend/cli.py clips list` prints recent clips from the same clips.json the UI shows.
+- [ ] `clips edit <id> --title "X"` → `clips list` reflects it AND the web UI `/api/history` shows the new title.
+- [ ] `clips reopen <id>` writes ui-state.json; opening the studio loads that clip into the Workspace.
+- [ ] Editing a clip in Python preserves its `metrics`/unknown fields (re-run the 1A round-trip check).
+
+### Anti-pattern guards
+- ❌ Don't emit JSON from the CLI (human ANSI contract) — match existing subcommands.
+- ❌ Don't reach into TS to record; write clips.json via the Python service from 1A.
+- ❌ `reopen` must not trigger a render in Phase 1.
+
+---
+
+## Phase 1C — Vite + React Router scaffold (parity with current UI)
+
+Stand up the build app and **port the existing editor** into a route, preserving all working functionality before adding new pages.
+
+### What to implement
+1. **New client source dir** `src/ui/client/` (Vite root). Files: `index.html` (Vite entry, no CDN), `main.tsx` (mounts `<RouterProvider>`), `App.tsx` (layout shell + nav), `routes/` and `components/`.
+2. **Add deps** (devDeps): `vite`, `@vitejs/plugin-react`, `@types/react`, `@types/react-dom`. Deps: `react`, `react-dom`, `react-router-dom`. (React leaves the CDN.)
+3. **`src/ui/client/vite.config.ts`**: `root: src/ui/client`, `plugins:[react()]`, `build.outDir: ../../../dist/ui/public` + `emptyOutDir: true`, `server.proxy` mapping `/api` → `http://localhost:3847`.
+4. **Client tsconfig** `src/ui/client/tsconfig.json` with `jsx: "react-jsx"`, DOM libs. **Exclude `src/ui/client` from the root `tsconfig.json`** so the node `tsc` build (server) and the Vite build (client) don't fight. Root tsconfig `exclude` adds `"src/ui/client"`.
+5. **Router** (`react-router-dom`) with routes:
+ - `/` → `StudioHome` (Phase 1D)
+ - `/episode` (and `/episode/:source?`) → `EpisodeWorkspace` (the ported existing editor)
+ - `/clip/:id` → `ClipDetail` (Phase 1D)
+6. **Port the existing editor** from `public/index.html` into `routes/EpisodeWorkspace.tsx` + extracted components (`LivePhonePreview`, `TikTokWireframe`, `PhoneCaptionBody`, `SpecRecap`, `McpHints`). Mostly mechanical: move JSX out of the babel `<script>`, replace CDN globals (`const {useState}=React`) with real imports, keep the `api()` fetch helper and the `STYLE_CONFIGS` map. Reuse `public/css/styles.css` (import it).
+7. **Express: serve the built SPA + add a fallback route.** Keep `express.static` at `web-server.ts:197` (now serving Vite output in `dist/ui/public`). After all `/api` routes, add an SPA fallback: `app.get("*", (req,res)=> res.sendFile(join(__dirname,"public","index.html")))` — guard so it never shadows `/api/*` or static assets.
+8. **Update build/dev scripts** in `package.json`:
+ - `"build": "vite build --config src/ui/client/vite.config.ts && tsc && cp -r src/ui/public/css dist/ui/public/css && cp src/ui/public/*.png dist/ui/public/"` (Vite emits HTML/JS to `dist/ui/public`; still copy non-bundled css/images, or import CSS through Vite and drop the copy).
+ - `"ui:dev": "vite --config src/ui/client/vite.config.ts"` (client) alongside existing `"ui": "tsx src/ui/web-server.ts"` (server). Document running both in dev.
+9. **Legacy pages**: leave `config.html` / `integrations.html` / `knowledge.html` as-is for Phase 1 (link out to them), OR fold into routes later. Do not delete `public/index.html` until parity is confirmed; then remove.
+
+### Documentation references
+- Static serving to preserve/extend: `web-server.ts:197`; listen: `web-server.ts:~1862`.
+- Components + STYLE_CONFIGS + `api()` to port: `src/ui/public/index.html` (App ~554, LivePhonePreview ~358, TikTokWireframe ~175, PhoneCaptionBody ~275, SpecRecap ~471, McpHints ~499, api() ~58, STYLE_CONFIGS ~114).
+- Build script to replace: `package.json` `"build"`.
+
+### Verification checklist
+- [ ] `npm run ui:dev` + `npm run ui` → app loads on Vite dev server, `/api` proxied, full upload→transcribe→suggest→create flow works identically to the old UI.
+- [ ] `npm run build` → `dist/ui/public/index.html` is the Vite output; `npm run ui:prod` serves it on 3847; deep-linking `/episode` and refresh work (SPA fallback).
+- [ ] No CDN `<script>` for React/Babel remains in the served HTML.
+- [ ] `git grep babel-standalone` returns nothing in the new client.
+
+### Anti-pattern guards
+- ❌ Don't rewrite editor logic — **port** it (move + swap imports). Behavior parity first, cleanup later.
+- ❌ Don't let `tsc` try to compile the client (must be in root tsconfig `exclude`).
+- ❌ SPA fallback must be registered AFTER api routes and must not intercept `/api/*`.
+- ❌ Don't break the `/api/ui-state` MCP↔UI bridge — the Workspace must still read/write it (this is how `clips reopen` hands off).
+
+---
+
+## Phase 1D — Studio Home (library) + Clip Detail (edit page)
+
+The new surfaces. Depends on 1A (fields), 1B (edit path), 1C (router/shell).
+
+### What to implement
+1. **`StudioHome` (`/`)** — the library:
+ - Fetch `/api/history` (and `/api/outputs` for file existence). Group into **episodes by `source_video` basename** (mirror `getBySource` logic client-side, or add a thin `/api/episodes` endpoint that calls `clips-history.getBySource` grouping — prefer reusing existing `/api/history` to keep code minimal).
+ - Episode cards: source name, clip count, created range, status. Recent-clips rail. An **action rail** up top driven by clip state ("N clips rendered", "Episode X in review") — derive from existing data, no new backend.
+ - "+ New Episode" → `/episode` (fresh editor).
+2. **`ClipDetail` (`/clip/:id`)** — the per-clip edit page (design decision: edit → save → latest, no version stacks):
+ - Load the clip (from `/api/history` by id, or a small `/api/clip/:id` that calls `find_clip`). Show preview (`/api/preview/:filename` from `output_path`), transcript_slice, content_type, settings.
+ - Editable fields: **title, caption style, thumbnail, cut timing**. Save:
+ - Metadata-only edits (title) → POST to a thin endpoint that calls the **same Python `update_clip`** (via `PythonExecutor` or a small route) so TS and CLI share one writer. (Minimal: add `update_clip` task to `backend/main.py` TASK_HANDLERS reusing 1A's service, exposed as `/api/clip/:id` PATCH.)
+ - Caption/timing change → triggers a re-render through the existing create-clip flow, then updates the entry (save = latest).
+ - Thumbnail change → reuse existing `swap-thumbnail` capability (already in cli.py / thumbnail service).
+ - "Reopen in editor" → navigates to `/episode` with this clip hydrated (same handoff as CLI `reopen`).
+3. **Keep it data-minimal**: prefer reusing `/api/history`, `/api/preview`, `/api/outputs`, `/api/ui-state` over new endpoints. Add a backend route only where a write must go through the shared Python writer (the clip edit).
+
+### Documentation references
+- Grouping logic: `clips-history.ts getBySource` (basename match).
+- Existing endpoints to reuse: `/api/history`, `/api/outputs`, `/api/preview/:f`, `/api/ui-state`.
+- Edit writer: Phase 1A `backend/services/clips_history.py update_clip`; thumbnail: `cmd_swap_thumbnail` mechanics (cli.py ~2177-2318).
+
+### Verification checklist
+- [ ] Home lists episodes grouped by source with correct clip counts.
+- [ ] Clicking a clip opens `/clip/:id` with preview + metadata.
+- [ ] Editing a title in the UI persists via the **same Python writer** the CLI uses (verify with `python backend/cli.py clips list`).
+- [ ] Changing caption style re-renders and the entry reflects the latest output.
+- [ ] "Reopen in editor" loads the clip into the Workspace (same result as `clips reopen`).
+
+### Anti-pattern guards
+- ❌ No version stacks/trays — one current state per clip.
+- ❌ Don't add a second history writer in TS for edits — route edits through the Python `update_clip` so there is one source of truth.
+- ❌ No YouTube/metrics UI (Phase 2) — `metrics`/`youtube_video_id` exist in the schema but are not surfaced or written here.
+
+---
+
+## Final Phase — Verification
+
+1. **Build & run:** `npm run build` clean (tsc + vite); `npm run ui:prod` serves the SPA on 3847; deep links + refresh work.
+2. **Parity:** full upload→transcribe→suggest→create/batch flow works in the new UI identically to the removed `index.html`.
+3. **Cross-language contract:** create a clip in the UI → `python backend/cli.py clips list` shows it with `content_type`/`transcript_slice`; `clips edit` from CLI → UI reflects it; a hand-written `metrics` block survives a Python edit (preserve-unknown-fields).
+4. **CLI parity:** `clips list/edit/reopen` all function headless.
+5. **Anti-pattern grep:** no `babel-standalone`/CDN React in served HTML; client excluded from root tsconfig; SPA fallback after api routes; single history writer for edits.
+6. **Tests:** run existing suite (299 tests baseline); add focused tests for `clips_history.py` (round-trip, preserve-unknown-fields, find/update) and for the extended `ClipHistoryEntry` recording.
+
+---
+
+## Suggested execution order
+`1A → 1B → 1C → 1D → Final`. 1A/1B are independent of the UI and ship value (CLI history) immediately; 1C is the big migration; 1D adds the new surfaces on the shell. Each sub-phase is self-contained for a fresh context.
diff --git a/setup.sh b/setup.sh
index 5d4aedf..fd3b37f 100755
--- a/setup.sh
+++ b/setup.sh
@@ -141,13 +141,6 @@ install() {
# ---- Launch UI ----
launch_ui() {
- echo " Starting web UI..."
- echo ""
-
- # Ensure public files are in dist
- mkdir -p dist/ui/public
- cp -r src/ui/public/* dist/ui/public/ 2>/dev/null || true
-
# Always use venv python (absolute path, no spaces issue)
if [ -f "venv/bin/python3" ]; then
export PYTHON_PATH="$(cd "$(pwd)" && pwd)/venv/bin/python3"
@@ -165,7 +158,15 @@ launch_ui() {
done < .env
fi
- exec npx tsx src/ui/web-server.ts
+ # The studio is a Vite + React Router SPA; build it before serving.
+ if [ ! -f dist/ui/public/index.html ]; then
+ echo " Building the studio UI..."
+ npm run build || { echo " Build failed — run ./setup.sh --install first."; exit 1; }
+ fi
+
+ echo " Studio: http://localhost:${PORT:-3847}"
+ echo ""
+ exec node dist/ui/web-server.js
}
# ---- Show MCP config ----
diff --git a/src/handlers/create-clip.handler.ts b/src/handlers/create-clip.handler.ts
index 1ea3352..8920234 100644
--- a/src/handlers/create-clip.handler.ts
+++ b/src/handlers/create-clip.handler.ts
@@ -4,6 +4,7 @@ import { FileManager } from "../services/file-manager.js";
import { paths } from "../config/paths.js";
import type { ClipResult, CreateClipInput, SuggestedClip, UIState } from "../models/index.js";
import { childLogger } from "../utils/logger.js";
+import { sliceTranscript } from "../utils/transcript.js";
const log = childLogger("create-clip");
const executor = new PythonExecutor();
@@ -191,6 +192,8 @@ export async function handleCreateClip(input: CreateClipInput): Promise<string>
output_path: data.output_path,
duration: data.duration,
file_size_mb: data.file_size_mb,
+ content_type: suggestion?.content_type,
+ transcript_slice: sliceTranscript(transcriptWords, startSecond, endSecond),
message: `Clip created successfully! ${data.duration}s, ${data.file_size_mb}MB`,
});
}
diff --git a/src/models/index.ts b/src/models/index.ts
index bb578f2..5819c56 100644
--- a/src/models/index.ts
+++ b/src/models/index.ts
@@ -18,6 +18,7 @@ export interface ProgressEvent {
stage: string;
percent: number;
message: string;
+ clip_result?: BatchClipsResult["results"][number];
}
// === Transcript Models ===
@@ -106,6 +107,7 @@ export interface SuggestedClip {
export interface UIState {
videoPath?: string;
filePath?: string;
+ activeExportJobId?: string | null;
transcript?: TranscriptResult | null;
rawTranscriptText?: string;
suggestions?: SuggestedClip[];
@@ -169,6 +171,7 @@ export interface BatchClipsResult {
total_clips: number;
successful_clips: number;
results: Array<{
+ clip_index?: number;
status: "success" | "error";
output_path?: string;
start_second?: number;
@@ -197,6 +200,25 @@ export interface AssetRegistry {
// === Clip History Models ===
+export interface ClipPerformanceMetrics {
+ views?: number;
+ retention?: number; // averageViewPercentage, 0-100
+ ctr?: number; // impressionsClickThroughRate, 0-100
+ impressions?: number;
+ fetched_at?: string;
+}
+
+export interface ClipThumbnailConfig {
+ text?: string;
+ line1?: string; // explicit first line (overrides the AI split)
+ line2?: string; // explicit second line
+ image_path?: string; // user-supplied background image
+ timestamp?: number; // absolute second in the source video for the frame
+ preview_path?: string; // chosen thumbnail PNG
+ variations?: string[]; // all generated thumbnail PNGs to pick from
+ card_seconds?: number; // duration of the thumbnail card baked into the clip start
+}
+
export interface ClipHistoryEntry {
id: string;
source_video: string;
@@ -205,11 +227,17 @@ export interface ClipHistoryEntry {
caption_style: string;
crop_strategy: string;
logo_path?: string;
+ outro_path?: string;
title: string;
output_path: string;
file_size_mb: number;
duration: number;
created_at: string;
+ content_type?: string;
+ transcript_slice?: string;
+ thumbnail_config?: ClipThumbnailConfig;
+ youtube_video_id?: string;
+ metrics?: ClipPerformanceMetrics;
}
// === Knowledge Base Models ===
diff --git a/src/server.ts b/src/server.ts
index 14c3d67..b1e94f1 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -29,7 +29,8 @@ import { ClipsHistory } from "./services/clips-history.js";
import { TranscriptCache } from "./services/transcript-cache.js";
import { paths } from "./config/paths.js";
import { childLogger } from "./utils/logger.js";
-import type { BatchClipsResult, UIState } from "./models/index.js";
+import { mcpError } from "./utils/errors.js";
+import type { BatchClipsResult, UIState, WordTimestamp } from "./models/index.js";
const log = childLogger("server");
@@ -293,11 +294,7 @@ export function createServer(): McpServer {
);
return { content: [{ type: "text" as const, text }] };
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -323,11 +320,7 @@ export function createServer(): McpServer {
const text = await handleTranscribeStart(input);
return { content: [{ type: "text" as const, text }] };
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -347,11 +340,7 @@ export function createServer(): McpServer {
const text = await handleJobStatus(input);
return { content: [{ type: "text" as const, text }] };
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -425,11 +414,7 @@ export function createServer(): McpServer {
);
return { content: [{ type: "text" as const, text }] };
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -674,6 +659,8 @@ export function createServer(): McpServer {
output_path: parsed.output_path,
file_size_mb: parsed.file_size_mb,
duration: parsed.duration,
+ content_type: parsed.content_type,
+ transcript_slice: parsed.transcript_slice,
});
// Notify UI that export is done
@@ -689,11 +676,7 @@ export function createServer(): McpServer {
);
return { content: [{ type: "text" as const, text: clipText }] };
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -902,23 +885,10 @@ export function createServer(): McpServer {
const parsed = JSON.parse(finalResult) as BatchClipsResult;
// Record each successful clip
- if (parsed.results) {
- for (const r of parsed.results) {
- if (r.status === "success" && r.output_path) {
- await history.record({
- source_video: params.video_path || "",
- start_second: r.start_second || 0,
- end_second: r.end_second || 0,
- caption_style: r.caption_style || "hormozi",
- crop_strategy: r.crop_strategy || "speaker",
- title: r.title || "clip",
- output_path: r.output_path,
- file_size_mb: r.file_size_mb || 0,
- duration: r.duration || 0,
- });
- }
- }
- }
+ await history.recordBatchResults(parsed.results, {
+ sourceVideo: params.video_path || "",
+ transcriptWords: params.transcript_words as WordTimestamp[] | undefined,
+ });
await uiPing({ phase: "done" });
}
@@ -1033,11 +1003,7 @@ export function createServer(): McpServer {
],
};
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -1124,11 +1090,7 @@ export function createServer(): McpServer {
],
};
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
@@ -1141,8 +1103,12 @@ export function createServer(): McpServer {
"View previously created clips to avoid duplicates. Check before creating new clips.",
{
action: z
- .enum(["list", "check"])
- .describe("list = recent clips, check = find duplicate"),
+ .enum(["list", "check", "delete"])
+ .describe("list = recent clips, check = find duplicate, delete = remove a clip"),
+ clip_id: z
+ .string()
+ .optional()
+ .describe("Clip id, full or 8-char prefix (for delete)"),
source_video: z
.string()
.optional()
@@ -1161,6 +1127,7 @@ export function createServer(): McpServer {
},
async ({
action,
+ clip_id,
source_video,
start_second,
end_second,
@@ -1169,6 +1136,23 @@ export function createServer(): McpServer {
limit,
}) => {
try {
+ if (action === "delete") {
+ if (!clip_id)
+ return {
+ content: [{ type: "text" as const, text: "Provide clip_id to delete." }],
+ };
+ const removed = await history.remove(clip_id);
+ return {
+ content: [
+ {
+ type: "text" as const,
+ text: removed
+ ? `Deleted "${removed.title}" (${removed.id}).`
+ : `No clip matched "${clip_id}".`,
+ },
+ ],
+ };
+ }
if (action === "list") {
const entries = source_video
? await history.getBySource(source_video)
@@ -1228,11 +1212,7 @@ export function createServer(): McpServer {
],
};
} catch (err: unknown) {
- const msg = err instanceof Error ? err.message : String(err);
- return {
- content: [{ type: "text" as const, text: `Error: ${msg}` }],
- isError: true,
- };
+ return mcpError(err);
}
},
);
diff --git a/src/services/clips-history.test.ts b/src/services/clips-history.test.ts
index 252e7a9..93d6deb 100644
--- a/src/services/clips-history.test.ts
+++ b/src/services/clips-history.test.ts
@@ -79,6 +79,106 @@ describe("ClipsHistory", () => {
expect(dup).toBeNull();
});
+ it("recordBatchResults skips failed/output-less rows and applies defaults", async () => {
+ const ok = makeFakeOutput("batch-ok.mp4");
+ const recorded = await history.recordBatchResults(
+ [
+ { status: "success", output_path: ok, start_second: 5, end_second: 20, title: "kept" },
+ { status: "error", error: "boom" },
+ { status: "success", title: "no output" },
+ ] as any,
+ { sourceVideo: "/videos/show.mp4", defaultCaptionStyle: "hormozi", defaultCropStrategy: "speaker" },
+ );
+
+ expect(recorded).toHaveLength(1);
+ expect(recorded[0].title).toBe("kept");
+ expect(recorded[0].caption_style).toBe("hormozi");
+ expect(recorded[0].crop_strategy).toBe("speaker");
+
+ const list = await history.list();
+ expect(list).toHaveLength(1);
+ });
+
+ it("recordBatchResults resolves content_type and transcript_slice per row", async () => {
+ const ok = makeFakeOutput("batch-ct.mp4");
+ const recorded = await history.recordBatchResults(
+ [{ status: "success", output_path: ok, start_second: 0, end_second: 10, title: "ct" }] as any,
+ {
+ sourceVideo: "/videos/show.mp4",
+ transcriptWords: [
+ { word: "hello", start: 1, end: 2 },
+ { word: "world", start: 3, end: 4 },
+ { word: "later", start: 99, end: 100 },
+ ] as any,
+ contentTypeFor: (s, e) => (s === 0 && e === 10 ? "hook" : undefined),
+ },
+ );
+
+ expect(recorded[0].content_type).toBe("hook");
+ expect(recorded[0].transcript_slice).toBe("hello world");
+ });
+
+ it("recordBatchResults tolerates undefined results", async () => {
+ const recorded = await history.recordBatchResults(undefined, { sourceVideo: "/videos/show.mp4" });
+ expect(recorded).toEqual([]);
+ });
+
+ it("serializes concurrent records without losing entries", async () => {
+ await Promise.all(
+ Array.from({ length: 25 }, (_, i) =>
+ history.record({
+ source_video: "/videos/show.mp4",
+ output_path: makeFakeOutput(`c-${i}.mp4`),
+ start_second: i,
+ end_second: i + 5,
+ caption_style: "karaoke",
+ crop_strategy: "smart",
+ title: `clip ${i}`,
+ } as any),
+ ),
+ );
+ const list = await history.list(100);
+ expect(list).toHaveLength(25);
+ expect(new Set(list.map((c) => c.id)).size).toBe(25);
+ });
+
+ it("findById and update require an exact id (no prefix match)", async () => {
+ const rec = await history.record({
+ source_video: "/videos/show.mp4",
+ output_path: makeFakeOutput("exact.mp4"),
+ start_second: 0,
+ end_second: 10,
+ caption_style: "karaoke",
+ crop_strategy: "smart",
+ title: "exact",
+ } as any);
+
+ expect(await history.findById(rec.id)).toBeDefined();
+ expect(await history.findById(rec.id.slice(0, 8))).toBeUndefined();
+ expect(await history.findById("")).toBeUndefined();
+ expect(await history.update("", { title: "x" })).toBeNull();
+ expect(await history.update(rec.id.slice(0, 8), { title: "x" })).toBeNull();
+ const ok = await history.update(rec.id, { title: "renamed" });
+ expect(ok?.title).toBe("renamed");
+ });
+
+ it("resolveId accepts a full id or unambiguous ≥4-char prefix, rejects short/empty", async () => {
+ const rec = await history.record({
+ source_video: "/videos/show.mp4",
+ output_path: makeFakeOutput("resolve.mp4"),
+ start_second: 0,
+ end_second: 10,
+ caption_style: "karaoke",
+ crop_strategy: "smart",
+ title: "resolve",
+ } as any);
+
+ expect(await history.resolveId(rec.id)).toBe(rec.id);
+ expect(await history.resolveId(rec.id.slice(0, 8))).toBe(rec.id);
+ expect(await history.resolveId("")).toBeNull();
+ expect(await history.resolveId(rec.id.slice(0, 2))).toBeNull();
+ });
+
it("findDuplicate matches by basename, not full path", async () => {
const output = makeFakeOutput("d.mp4");
await history.record({
diff --git a/src/services/clips-history.ts b/src/services/clips-history.ts
index 2e972df..a4383ae 100644
--- a/src/services/clips-history.ts
+++ b/src/services/clips-history.ts
@@ -1,12 +1,27 @@
-import { readFile, writeFile, mkdir } from "fs/promises";
+import { readFile, writeFile, mkdir, rm, rename } from "fs/promises";
import { existsSync } from "fs";
-import { basename } from "path";
+import { basename, join } from "path";
import { v4 as uuidv4 } from "uuid";
import { paths } from "../config/paths.js";
-import type { ClipHistoryEntry } from "../models/index.js";
+import { sliceTranscript } from "../utils/transcript.js";
+import type { BatchClipsResult, ClipHistoryEntry, WordTimestamp } from "../models/index.js";
+
+type BatchResultRow = BatchClipsResult["results"][number];
+
+interface BatchRecordContext {
+ sourceVideo: string;
+ transcriptWords?: WordTimestamp[] | null;
+ defaultCaptionStyle?: string;
+ defaultCropStrategy?: string;
+ contentTypeFor?: (start: number, end: number) => string | undefined;
+}
export class ClipsHistory {
private historyPath = paths.clipsHistory;
+ // Serializes this process's own read-modify-write cycles so concurrent HTTP
+ // requests can't lose each other's edits. Cross-process safety (vs the Python
+ // CLI) rests on the atomic temp-file rename in save().
+ private writeChain: Promise<unknown> = Promise.resolve();
private async ensureDir() {
if (!existsSync(paths.history)) {
@@ -26,21 +41,70 @@ export class ClipsHistory {
private async save(entries: ClipHistoryEntry[]): Promise<void> {
await this.ensureDir();
- await writeFile(this.historyPath, JSON.stringify(entries, null, 2), "utf-8");
+ // Write to a temp file and atomically rename so a crash or a concurrent
+ // reader never sees a half-written clips.json.
+ const tmp = `${this.historyPath}.${process.pid}.${uuidv4().slice(0, 8)}.tmp`;
+ await writeFile(tmp, JSON.stringify(entries, null, 2), "utf-8");
+ await rename(tmp, this.historyPath);
+ }
+
+ // Run load → mutate → save as one critical section, queued behind any
+ // in-flight mutation. The callback returns the value the caller wants back.
+ private mutate<T>(fn: (entries: ClipHistoryEntry[]) => T | Promise<T>): Promise<T> {
+ const run = this.writeChain.then(async () => {
+ const entries = await this.load();
+ const result = await fn(entries);
+ await this.save(entries);
+ return result;
+ });
+ this.writeChain = run.then(() => undefined, () => undefined);
+ return run;
}
async record(entry: Omit<ClipHistoryEntry, "id" | "created_at">): Promise<ClipHistoryEntry> {
- const entries = await this.load();
const full: ClipHistoryEntry = {
...entry,
id: uuidv4(),
created_at: new Date().toISOString(),
};
- entries.push(full);
- await this.save(entries);
+ await this.mutate((entries) => {
+ entries.push(full);
+ });
return full;
}
+ // Persist every successful row of a batch render. Single source of truth for
+ // turning backend batch results into history entries — callers used to inline
+ // this loop, drifting on defaults and on which fields got recorded.
+ async recordBatchResults(
+ results: BatchResultRow[] | undefined,
+ ctx: BatchRecordContext,
+ ): Promise<ClipHistoryEntry[]> {
+ if (!results) return [];
+ const recorded: ClipHistoryEntry[] = [];
+ for (const r of results) {
+ if (r.status !== "success" || !r.output_path) continue;
+ const start = r.start_second || 0;
+ const end = r.end_second || 0;
+ recorded.push(
+ await this.record({
+ source_video: ctx.sourceVideo,
+ start_second: start,
+ end_second: end,
+ caption_style: r.caption_style || ctx.defaultCaptionStyle || "hormozi",
+ crop_strategy: r.crop_strategy || ctx.defaultCropStrategy || "speaker",
+ title: r.title || "clip",
+ output_path: r.output_path,
+ file_size_mb: r.file_size_mb || 0,
+ duration: r.duration || 0,
+ content_type: ctx.contentTypeFor?.(start, end),
+ transcript_slice: sliceTranscript(ctx.transcriptWords, start, end),
+ }),
+ );
+ }
+ return recorded;
+ }
+
/**
* Check if a clip with the same source, time range, and style already exists.
* Uses basename matching for source video and ±2s tolerance on time range.
@@ -73,9 +137,121 @@ export class ClipsHistory {
return entries.slice(-limit).reverse();
}
+ // Exact match only — REST routes feed req.params.id straight in, so a loose
+ // prefix could target the wrong clip (and an empty prefix the first one).
+ async findById(id: string): Promise<ClipHistoryEntry | undefined> {
+ if (!id) return undefined;
+ const entries = await this.load();
+ return entries.find((e) => e.id === id);
+ }
+
+ // Resolve a full id or an unambiguous ≥4-char prefix to a full id. For the
+ // human-facing MCP tool, where typing a short prefix is convenient.
+ async resolveId(idOrPrefix: string): Promise<string | null> {
+ if (!idOrPrefix) return null;
+ const entries = await this.load();
+ if (entries.some((e) => e.id === idOrPrefix)) return idOrPrefix;
+ if (idOrPrefix.length < 4) return null;
+ const matches = entries.filter((e) => e.id.startsWith(idOrPrefix));
+ return matches.length === 1 ? matches[0].id : null;
+ }
+
+ async update(id: string, patch: Partial<ClipHistoryEntry>): Promise<ClipHistoryEntry | null> {
+ if (!id) return null;
+ return this.mutate((entries) => {
+ const e = entries.find((x) => x.id === id);
+ if (!e) return null;
+ Object.assign(e, patch);
+ return e;
+ });
+ }
+
+ // Remove a clip and the artifacts podcli rendered for it (output video,
+ // word/recipe/reframe sidecars, thumbnail dir). The source video is never touched.
+ // Accepts a full id or an unambiguous prefix (MCP convenience).
+ async remove(idOrPrefix: string): Promise<ClipHistoryEntry | null> {
+ const id = await this.resolveId(idOrPrefix);
+ if (!id) return null;
+ const entry = await this.mutate((entries) => {
+ const idx = entries.findIndex((e) => e.id === id);
+ if (idx < 0) return null;
+ return entries.splice(idx, 1)[0];
+ });
+ if (!entry) return null;
+
+ const artifacts = [
+ this.wordsPath(entry.id),
+ this.recipePath(entry.id),
+ this.reframePath(entry.id),
+ entry.output_path,
+ ];
+ await Promise.all(
+ artifacts.map((p) => (p ? rm(p, { force: true }) : Promise.resolve())),
+ );
+ await rm(join(paths.output, "thumbnails", entry.id), { recursive: true, force: true });
+ return entry;
+ }
+
async getBySource(videoPath: string): Promise<ClipHistoryEntry[]> {
const entries = await this.load();
const srcName = basename(videoPath);
return entries.filter((e) => basename(e.source_video) === srcName).reverse();
}
+
+ // Word timings are kept in a sidecar (not in clips.json) so re-rendering a
+ // clip can re-burn captions without bloating the history file.
+ private wordsPath(id: string): string {
+ return join(paths.history, "words", `${id}.json`);
+ }
+
+ async saveWords(id: string, words: unknown[]): Promise<void> {
+ if (!words || words.length === 0) return;
+ await mkdir(join(paths.history, "words"), { recursive: true });
+ await writeFile(this.wordsPath(id), JSON.stringify(words), "utf-8");
+ }
+
+ async loadWords(id: string): Promise<unknown[]> {
+ try {
+ return JSON.parse(await readFile(this.wordsPath(id), "utf-8"));
+ } catch {
+ return [];
+ }
+ }
+
+ // Full render recipe (logo/outro/captions/fillers/segments/words) so a clip
+ // can be re-rendered faithfully — e.g. after a manual reframe.
+ private recipePath(id: string): string {
+ return join(paths.history, "recipes", `${id}.json`);
+ }
+
+ async saveRecipe(id: string, recipe: Record<string, unknown>): Promise<void> {
+ await mkdir(join(paths.history, "recipes"), { recursive: true });
+ await writeFile(this.recipePath(id), JSON.stringify(recipe), "utf-8");
+ }
+
+ async loadRecipe(id: string): Promise<Record<string, unknown> | null> {
+ try {
+ return JSON.parse(await readFile(this.recipePath(id), "utf-8"));
+ } catch {
+ return null;
+ }
+ }
+
+ // Reframe editor state (keyframes + trim) so reopening shows prior edits.
+ private reframePath(id: string): string {
+ return join(paths.history, "reframe", `${id}.json`);
+ }
+
+ async saveReframe(id: string, state: Record<string, unknown>): Promise<void> {
+ await mkdir(join(paths.history, "reframe"), { recursive: true });
+ await writeFile(this.reframePath(id), JSON.stringify(state), "utf-8");
+ }
+
+ async loadReframe(id: string): Promise<Record<string, unknown> | null> {
+ try {
+ return JSON.parse(await readFile(this.reframePath(id), "utf-8"));
+ } catch {
+ return null;
+ }
+ }
}
diff --git a/src/ui/client/AnalyticsPage.tsx b/src/ui/client/AnalyticsPage.tsx
new file mode 100644
index 0000000..4a6bcc6
--- /dev/null
+++ b/src/ui/client/AnalyticsPage.tsx
@@ -0,0 +1,219 @@
+import React, { useEffect, useRef, useState } from "react";
+import { Link } from "react-router-dom";
+import { api, upload, fmt, labelStyle } from "./lib";
+
+interface Row { key: string; count: number; avgViews: number; avgRetention: number; avgCtr: number }
+interface Data {
+ published: number; total: number;
+ byContentType: Row[]; byCaptionStyle: Row[]; byLength: Row[];
+ top: Array<{ id: string; title: string; content_type?: string; caption_style: string; duration: number; metrics: any }>;
+}
+
+const fmtViews = (n: number) => (n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n));
+
+function Group({ title, rows, metric }: { title: string; rows: Row[]; metric: "avgRetention" | "avgCtr" | "avgViews" }) {
+ const max = Math.max(1, ...rows.map((r) => r[metric]));
+ const unit = metric === "avgViews" ? "" : "%";
+ return (
+ <div className="section">
+ <div className="section-label">{title}</div>
+ {rows.length === 0 ? (
+ <div style={{ color: "var(--text3)", fontSize: 12 }}>No data yet</div>
+ ) : rows.map((r) => (
+ <div key={r.key} style={{ marginBottom: 10 }}>
+ <div style={{ display: "flex", justifyContent: "space-between", fontSize: 12, marginBottom: 4 }}>
+ <span style={{ color: "var(--text)" }}>{r.key} <span style={{ color: "var(--text3)" }}>· {r.count}</span></span>
+ <span style={{ color: "var(--text2)", fontVariantNumeric: "tabular-nums" }}>{metric === "avgViews" ? fmtViews(r[metric]) : r[metric] + unit}</span>
+ </div>
+ <div style={{ height: 6, borderRadius: 3, background: "var(--surface2)" }}>
+ <div style={{ width: `${(r[metric] / max) * 100}%`, height: "100%", borderRadius: 3, background: "var(--accent)" }} />
+ </div>
+ </div>
+ ))}
+ </div>
+ );
+}
+
+export default function AnalyticsPage() {
+ const [data, setData] = useState<Data | null>(null);
+ const [status, setStatus] = useState<any>(null);
+ const [busy, setBusy] = useState(false);
+ const [msg, setMsg] = useState<string | null>(null);
+ const [showConnect, setShowConnect] = useState(false);
+ const [clientId, setClientId] = useState("");
+ const [clientSecret, setClientSecret] = useState("");
+ const [hasSecret, setHasSecret] = useState(false);
+ const [proposals, setProposals] = useState<any[] | null>(null);
+ const [linkBusy, setLinkBusy] = useState<string | null>(null);
+ const fileRef = useRef<HTMLInputElement>(null);
+
+ const load = () => {
+ api("/analytics").then(setData).catch(() => setData(null));
+ api("/youtube/status").then(setStatus).catch(() => {});
+ api("/youtube/config").then((c) => { setClientId(c.client_id || ""); setHasSecret(!!c.has_secret); }).catch(() => {});
+ };
+ useEffect(load, []);
+
+ const saveConfig = async () => {
+ setBusy(true); setMsg(null);
+ try {
+ const r = await api("/youtube/config", { method: "PUT", body: JSON.stringify({ client_id: clientId, ...(clientSecret ? { client_secret: clientSecret } : {}) }) });
+ if (r.error) throw new Error(r.error);
+ setClientSecret(""); setHasSecret(true);
+ setMsg("Saved — now run podcli youtube auth in your terminal to authorize");
+ } catch (e: any) { setMsg(`Save failed: ${e.message}`); } finally { setBusy(false); }
+ };
+
+ const sync = async (csvPath?: string) => {
+ setBusy(true); setMsg(null);
+ try {
+ const r = await api("/youtube/sync", { method: "POST", body: JSON.stringify(csvPath ? { csv_path: csvPath } : {}) });
+ if (r.error) throw new Error(r.error);
+ setMsg("Synced"); load();
+ } catch (e: any) { setMsg(`Sync failed: ${e.message}`); } finally { setBusy(false); }
+ };
+
+ const loadProposals = async () => {
+ setBusy(true); setMsg(null); setProposals(null);
+ try {
+ const r = await api<any>("/youtube/links");
+ setProposals(r.proposals || []);
+ } catch (e: any) { setMsg(`Could not load links: ${e.message}`); } finally { setBusy(false); }
+ };
+
+ const linkClip = async (clipId: string, videoId: string) => {
+ setLinkBusy(clipId);
+ try {
+ await api("/youtube/link", { method: "POST", body: JSON.stringify({ clip_id: clipId, video_id: videoId }) });
+ setProposals((ps) => (ps || []).filter((p) => p.clip_id !== clipId));
+ load();
+ } catch (e: any) { setMsg(`Link failed: ${e.message}`); } finally { setLinkBusy(null); }
+ };
+
+ const analyze = async () => {
+ setBusy(true); setMsg("Analyzing top performers vs underperformers…");
+ try {
+ const r = await api("/youtube/learn", { method: "POST", body: "{}" });
+ if (r.error) throw new Error(r.error);
+ setMsg("Analysis written to the knowledge base — Claude will use it when picking shorts");
+ } catch (e: any) { setMsg(`Analysis failed: ${e.message}`); } finally { setBusy(false); }
+ };
+
+ const importCsv = async (f: File) => {
+ setBusy(true); setMsg(null);
+ try {
+ const fd = new FormData(); fd.append("file", f);
+ const up = await upload<any>("/upload", fd);
+ if (!up.file_path) throw new Error("upload failed");
+ await sync(up.file_path);
+ } catch (e: any) { setMsg(`Import failed: ${e.message}`); setBusy(false); }
+ };
+
+ return (
+ <div className="app">
+ <div className="header">
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
+ <h1 style={{ margin: 0 }}>Analytics</h1>
+ <div className="set-actions">
+ <input ref={fileRef} type="file" accept=".csv" style={{ display: "none" }} onChange={(e) => e.target.files?.[0] && importCsv(e.target.files[0])} />
+ <button className="btn btn-ghost btn-sm" onClick={() => setShowConnect((v) => !v)} disabled={busy}>Connect</button>
+ {status?.authorized && <button className="btn btn-ghost btn-sm" onClick={loadProposals} disabled={busy}>Link clips</button>}
+ <button className="btn btn-ghost btn-sm" onClick={() => fileRef.current?.click()} disabled={busy}>Import CSV</button>
+ <button className="btn btn-ghost btn-sm" onClick={analyze} disabled={busy}>Analyze patterns</button>
+ <button className="btn btn-primary btn-sm" onClick={() => sync()} disabled={busy}>{busy ? <div className="spinner sm" /> : "Sync YouTube"}</button>
+ </div>
+ </div>
+ {status && (
+ <div style={{ fontSize: 12, color: "var(--text3)", marginTop: 8 }}>
+ {status.authorized ? "YouTube connected" : "Not connected"} · {status.with_metrics}/{status.total} clips with metrics
+ </div>
+ )}
+ {msg && <div className="set-note ok" style={{ marginTop: 10, wordBreak: "break-all" }}>{msg}</div>}
+ </div>
+
+ {showConnect && (
+ <div className="section">
+ <div className="section-label">Connect YouTube (read-only)</div>
+ <ol style={{ fontSize: 12, color: "var(--text2)", lineHeight: 1.7, margin: "0 0 14px", paddingLeft: 18 }}>
+ <li>In Google Cloud Console, enable the <strong>YouTube Data API v3</strong> + <strong>YouTube Analytics API</strong>.</li>
+ <li>Create an <strong>OAuth client ID</strong> (type: Desktop app) and paste its ID + secret below.</li>
+ <li>Save, then run <code>podcli youtube auth</code> in your terminal to authorize.</li>
+ </ol>
+ <div className="thumb-fields">
+ <div>
+ <label style={labelStyle}>OAuth client ID</label>
+ <input type="text" value={clientId} onChange={(e) => setClientId(e.target.value)} style={{ width: "100%", fontSize: 13, padding: "8px 11px" }} />
+ </div>
+ <div>
+ <label style={labelStyle}>OAuth client secret {hasSecret ? "(saved)" : ""}</label>
+ <input type="password" value={clientSecret} onChange={(e) => setClientSecret(e.target.value)} placeholder={hasSecret ? "••••••••" : ""} style={{ width: "100%", fontSize: 13, padding: "8px 11px" }} />
+ </div>
+ </div>
+ <div style={{ marginTop: 12, display: "flex", gap: 10, alignItems: "center" }}>
+ <button className="btn btn-primary btn-sm" onClick={saveConfig} disabled={busy || !clientId}>Save credentials</button>
+ <span style={{ fontSize: 12, color: "var(--text3)" }}>then run <code>podcli youtube auth</code> to authorize · or use Import CSV (no auth)</span>
+ </div>
+ </div>
+ )}
+
+ {proposals !== null && (
+ <div className="section">
+ <div className="section-label">Link clips to uploads</div>
+ {proposals.length === 0 ? (
+ <div style={{ fontSize: 13, color: "var(--text2)" }}>No proposals — every clip is linked, or no upload matched.</div>
+ ) : (
+ proposals.map((p) => (
+ <div key={p.clip_id} style={{ display: "flex", alignItems: "center", gap: 12, padding: "9px 0", borderBottom: "1px solid var(--border)" }}>
+ <div style={{ flex: 1, minWidth: 0 }}>
+ <div style={{ fontSize: 13, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{p.clip_title}</div>
+ <div style={{ fontSize: 12, color: "var(--text3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
+ → {p.video_title} <span style={{ color: p.score >= 0.8 ? "var(--green)" : "var(--text3)" }}>(score {p.score})</span>
+ </div>
+ </div>
+ <button className="btn btn-ghost btn-sm" disabled={linkBusy !== null} onClick={() => linkClip(p.clip_id, p.video_id)}>
+ {linkBusy === p.clip_id ? <div className="spinner sm" /> : "Link"}
+ </button>
+ </div>
+ ))
+ )}
+ </div>
+ )}
+
+ {!data || data.published === 0 ? (
+ <div className="drop-zone" style={{ textAlign: "center", padding: "48px 20px", color: "var(--text2)" }}>
+ <div className="icon" style={{ fontSize: 26 }}>📊</div>
+ <div className="label" style={{ marginTop: 8 }}>No performance data yet.</div>
+ <div style={{ fontSize: 12, color: "var(--text3)", marginTop: 6 }}>
+ Connect YouTube and Sync, or Import a YouTube Studio analytics CSV.
+ </div>
+ </div>
+ ) : (
+ <>
+ <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))", gap: 16, marginBottom: 8 }}>
+ <Group title="Retention by content type — what holds viewers" rows={data.byContentType} metric="avgRetention" />
+ <Group title="CTR by caption style — packaging" rows={data.byCaptionStyle} metric="avgCtr" />
+ <Group title="Retention by length" rows={data.byLength} metric="avgRetention" />
+ <Group title="Views by content type — reach" rows={data.byContentType} metric="avgViews" />
+ </div>
+
+ <div className="section">
+ <div className="section-label">Top clips</div>
+ {data.top.map((c) => (
+ <Link key={c.id} to={`/clip/${c.id}`} style={{ display: "flex", alignItems: "center", gap: 12, padding: "9px 0", borderBottom: "1px solid var(--border)", textDecoration: "none", color: "inherit" }}>
+ <div style={{ flex: 1, minWidth: 0 }}>
+ <div style={{ fontSize: 13, fontWeight: 600, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{c.title}</div>
+ <div style={{ fontSize: 11, color: "var(--text3)", marginTop: 2 }}>{fmt(c.duration)} · {c.caption_style}{c.content_type ? ` · ${c.content_type}` : ""}</div>
+ </div>
+ <div style={{ display: "flex", gap: 16, fontSize: 12, fontVariantNumeric: "tabular-nums" }}>
+ <span title="Views (reach)">{fmtViews(c.metrics?.views || 0)} views</span>
+ {c.metrics?.retention != null && <span style={{ color: "var(--text2)" }} title="Retention (content)">{c.metrics.retention}% ret</span>}
+ {c.metrics?.ctr != null && <span style={{ color: "var(--text2)" }} title="CTR (packaging)">{c.metrics.ctr}% ctr</span>}
+ </div>
+ </Link>
+ ))}
+ </div>
+ </>
+ )}
+ </div>
+ );
+}
diff --git a/src/ui/client/ClipDetail.tsx b/src/ui/client/ClipDetail.tsx
new file mode 100644
index 0000000..f425a50
--- /dev/null
+++ b/src/ui/client/ClipDetail.tsx
@@ -0,0 +1,273 @@
+import React, { useEffect, useRef, useState } from "react";
+import { Link, useParams, useNavigate } from "react-router-dom";
+import { api, upload, fmt, basename, labelStyle } from "./lib";
+import ClipPlayer from "./ClipPlayer";
+import ReframeEditor from "./ReframeEditor";
+
+interface ThumbnailConfig {
+ text?: string;
+ line1?: string;
+ line2?: string;
+ image_path?: string;
+ timestamp?: number;
+ preview_path?: string;
+ variations?: string[];
+}
+
+interface Clip {
+ id: string;
+ source_video: string;
+ title: string;
+ caption_style: string;
+ crop_strategy: string;
+ start_second: number;
+ end_second: number;
+ duration: number;
+ file_size_mb?: number;
+ output_path: string;
+ created_at: string;
+ content_type?: string;
+ transcript_slice?: string;
+ thumbnail_config?: ThumbnailConfig;
+}
+
+const CAPTION_STYLES = ["branded", "hormozi", "karaoke", "subtle"];
+const img = (p: string, bust: number) => `/api/image?path=${encodeURIComponent(p)}&t=${bust}`;
+
+export default function ClipDetail() {
+ const { id } = useParams();
+ const navigate = useNavigate();
+ const fileRef = useRef<HTMLInputElement>(null);
+ const playerTime = useRef(0);
+
+ const [clip, setClip] = useState<Clip | null>(null);
+ const [loading, setLoading] = useState(true);
+ const [title, setTitle] = useState("");
+ const [captionStyle, setCaptionStyle] = useState("");
+ const [line1, setLine1] = useState("");
+ const [line2, setLine2] = useState("");
+ const [thumbImage, setThumbImage] = useState<string | null>(null);
+ const [thumbTimestamp, setThumbTimestamp] = useState<number | null>(null);
+ const [busy, setBusy] = useState<string | null>(null);
+ const [msg, setMsg] = useState<string | null>(null);
+ const [bust, setBust] = useState(1);
+ const [davinciOn, setDavinciOn] = useState(false);
+ const [reframing, setReframing] = useState(false);
+
+ const load = () => {
+ api("/history?limit=500")
+ .then((d: Clip[]) => {
+ const found = Array.isArray(d) ? d.find((c) => c.id === id || String(c.id).startsWith(id || "\0")) : null;
+ setClip(found || null);
+ if (found) {
+ setTitle(found.title);
+ setCaptionStyle(found.caption_style);
+ const tc = found.thumbnail_config || {};
+ setLine1(tc.line1 ?? "");
+ setLine2(tc.line2 ?? "");
+ setThumbImage(tc.image_path ?? null);
+ setThumbTimestamp(tc.image_path ? null : tc.timestamp ?? null);
+ }
+ })
+ .finally(() => setLoading(false));
+ };
+ useEffect(load, [id]);
+ useEffect(() => {
+ api("/integrations")
+ .then((d) => setDavinciOn(!!(d.integrations || []).find((i: any) => i.name === "davinci_resolve" && i.enabled)))
+ .catch(() => {});
+ }, []);
+
+ if (loading) return <div className="app"><div style={{ display: "flex", alignItems: "center", gap: 10, color: "var(--text2)", padding: 40 }}><div className="spinner sm" /> Loading…</div></div>;
+ if (!clip) return <div className="app"><div className="header"><h1>Clip not found</h1></div><Link to="/" style={{ color: "var(--accent)" }}>← Library</Link></div>;
+
+ const tc = clip.thumbnail_config || {};
+ const dirty = title !== clip.title || captionStyle !== clip.caption_style;
+ const file = basename(clip.output_path);
+ const previewUrl = `/api/preview/${file}?t=${bust}`;
+ const source = thumbImage ? `Image · ${basename(thumbImage)}` : thumbTimestamp != null ? `Frame @ ${fmt(thumbTimestamp)}` : "Auto";
+
+ const patch = (body: any) => api(`/clips/${clip.id}`, { method: "PATCH", body: JSON.stringify(body) });
+
+ const save = async () => {
+ setBusy("save"); setMsg(null);
+ try {
+ const r = await patch({ title, caption_style: captionStyle });
+ if (r.error) throw new Error(r.error);
+ load();
+ } catch (e: any) { setMsg(`Save failed: ${e.message}`); } finally { setBusy(null); }
+ };
+
+ const useCurrentFrame = () => { setThumbTimestamp(clip.start_second + playerTime.current); setThumbImage(null); setMsg(null); };
+
+ const uploadImage = async (f: File) => {
+ setBusy("upload"); setMsg(null);
+ try {
+ const fd = new FormData(); fd.append("file", f);
+ const r = await upload<any>("/upload", fd);
+ if (!r.file_path) throw new Error("upload failed");
+ setThumbImage(r.file_path); setThumbTimestamp(null);
+ } catch (e: any) { setMsg(`Upload failed: ${e.message}`); } finally { setBusy(null); }
+ };
+
+ const generate = async () => {
+ setBusy("thumb"); setMsg(null);
+ try {
+ const cfg: ThumbnailConfig = { line1: line1 || undefined, line2: line2 || undefined };
+ if (thumbImage) cfg.image_path = thumbImage;
+ else if (thumbTimestamp != null) cfg.timestamp = thumbTimestamp;
+ const p = await patch({ thumbnail_config: cfg });
+ if (p.error) throw new Error(p.error);
+ const r = await api(`/clips/${clip.id}/thumbnail`, { method: "POST", body: "{}" });
+ if (r.error) throw new Error(r.error);
+ setBust(Date.now()); load();
+ } catch (e: any) { setMsg(`Thumbnail failed: ${e.message}`); } finally { setBusy(null); }
+ };
+
+ const pickVariation = async (p: string) => {
+ setBusy("pick");
+ try {
+ const r = await api(`/clips/${clip.id}/thumbnail/select`, { method: "POST", body: JSON.stringify({ path: p }) });
+ if (r.error) throw new Error(r.error);
+ setBust(Date.now()); load();
+ } catch (e: any) { setMsg(`Pick failed: ${e.message}`); } finally { setBusy(null); }
+ };
+
+ const reopen = async () => {
+ setBusy("reopen"); setMsg(null);
+ try {
+ const r = await api(`/clips/${clip.id}/reopen`, { method: "POST", body: "{}" });
+ if (r.error) throw new Error(r.error);
+ navigate("/episode");
+ } catch (e: any) { setMsg(`Reopen failed: ${e.message}`); setBusy(null); }
+ };
+
+ const exportDavinci = async () => {
+ setBusy("davinci"); setMsg(null);
+ try {
+ const r = await api(`/clips/${clip.id}/davinci`, { method: "POST", body: "{}" });
+ if (r.error) throw new Error(r.error);
+ setMsg(r.path ? `DaVinci project: ${r.path}` : "Exported");
+ } catch (e: any) { setMsg(`DaVinci export failed: ${e.message}`); } finally { setBusy(null); }
+ };
+
+ const del = async () => {
+ if (!window.confirm(`Delete "${clip.title}"? This removes the rendered file too.`)) return;
+ setBusy("delete"); setMsg(null);
+ try {
+ await api(`/clips/${clip.id}`, { method: "DELETE" });
+ navigate("/");
+ } catch (e: any) { setMsg(`Delete failed: ${e.message}`); setBusy(null); }
+ };
+
+ return (
+ <div className="app">
+ <div className="header">
+ <Link to="/" style={{ fontSize: 12, color: "var(--text3)", textDecoration: "none" }}>← Library</Link>
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-end", gap: 16, marginTop: 8, flexWrap: "wrap" }}>
+ <h1 style={{ margin: 0 }}>{clip.title}</h1>
+ <div className="set-actions">
+ <a className="btn btn-ghost btn-sm" href={`/api/download/${file}`} download style={{ textDecoration: "none" }}>Download</a>
+ <button className="btn btn-ghost btn-sm" onClick={reopen} disabled={busy !== null}>{busy === "reopen" ? <div className="spinner sm" /> : "Reopen in editor"}</button>
+ {davinciOn && <button className="btn btn-ghost btn-sm" onClick={exportDavinci} disabled={busy !== null}>{busy === "davinci" ? <div className="spinner sm" /> : "Export for DaVinci"}</button>}
+ <button className="btn btn-danger btn-sm" onClick={del} disabled={busy !== null}>{busy === "delete" ? <div className="spinner sm" /> : "Delete"}</button>
+ </div>
+ </div>
+ </div>
+
+ <div className="clip-detail">
+ <div className="clip-detail-player">
+ {file ? <ClipPlayer key={previewUrl} src={previewUrl} 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>
+ <span>{clip.crop_strategy}</span>
+ {clip.content_type && <span>{clip.content_type}</span>}
+ {clip.file_size_mb != null && <span>{clip.file_size_mb.toFixed(1)}MB</span>}
+ </div>
+ <div style={{ fontSize: 11, color: "var(--text3)", marginTop: 8 }}>{basename(clip.source_video)}</div>
+ </div>
+
+ <div className="clip-detail-editor">
+ {msg && <div className="set-note ok" style={{ wordBreak: "break-all" }}>{msg}</div>}
+
+ <div className="section">
+ <label style={labelStyle}>Title & captions</label>
+ <input type="text" value={title} onChange={(e) => setTitle(e.target.value)} style={{ width: "100%", fontSize: 14, padding: "10px 13px" }} />
+ <div style={{ display: "flex", gap: 10, marginTop: 10, alignItems: "center" }}>
+ <select value={captionStyle} onChange={(e) => setCaptionStyle(e.target.value)} style={{ flex: 1 }}>
+ {CAPTION_STYLES.map((s) => <option key={s} value={s}>{s}</option>)}
+ </select>
+ <button className="btn btn-primary btn-sm" onClick={save} disabled={!dirty || busy !== null}>
+ {busy === "save" ? <div className="spinner sm" /> : "Save"}
+ </button>
+ </div>
+ </div>
+
+ <div className="section">
+ <label style={labelStyle}>Thumbnail</label>
+ <div className="thumb-edit">
+ <div className="thumb-edit-preview">
+ <div className="thumb-stage">
+ {tc.preview_path ? (
+ <img key={`gen-${bust}`} src={img(tc.preview_path, bust)} alt="thumbnail" />
+ ) : thumbImage ? (
+ <img src={img(thumbImage, bust)} alt="thumbnail source" />
+ ) : (
+ <div style={{ display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "var(--text3)", fontSize: 11, textAlign: "center", padding: 12 }}>
+ Generate to preview
+ </div>
+ )}
+ </div>
+ </div>
+ <div className="thumb-edit-controls">
+ <input type="text" value={line1} onChange={(e) => setLine1(e.target.value)} placeholder="Line 1" style={{ width: "100%", fontSize: 14, padding: "9px 12px" }} />
+ <input type="text" value={line2} onChange={(e) => setLine2(e.target.value)} placeholder="Line 2 (highlighted)" style={{ width: "100%", fontSize: 14, padding: "9px 12px", marginTop: 8 }} />
+ <div className="set-actions" style={{ marginTop: 10 }}>
+ <button className="btn btn-ghost btn-sm" onClick={useCurrentFrame} disabled={busy !== null}>Use current frame</button>
+ <button className="btn btn-ghost btn-sm" onClick={() => fileRef.current?.click()} disabled={busy !== null}>
+ {busy === "upload" ? <div className="spinner sm" /> : "Upload image"}
+ </button>
+ <input ref={fileRef} type="file" accept=".png,.jpg,.jpeg,.webp" style={{ display: "none" }} onChange={(e) => e.target.files?.[0] && uploadImage(e.target.files[0])} />
+ </div>
+ <div style={{ fontSize: 11, color: "var(--text3)", marginTop: 8 }}>Source · {source}</div>
+ <div style={{ marginTop: 12 }}>
+ <button className="btn btn-primary btn-sm" onClick={generate} disabled={busy !== null}>
+ {busy === "thumb" ? <div className="spinner sm" /> : (tc.variations?.length ? "Regenerate" : "Generate thumbnail")}
+ </button>
+ </div>
+ </div>
+ </div>
+ {(tc.variations?.length ?? 0) > 0 && (
+ <div className="thumb-variations" style={{ marginTop: 14 }}>
+ {tc.variations!.map((v) => (
+ <button key={v} className={`thumb-variation ${tc.preview_path === v ? "selected" : ""}`} onClick={() => pickVariation(v)} disabled={busy !== null}>
+ <img src={img(v, bust)} alt="" />
+ </button>
+ ))}
+ </div>
+ )}
+ </div>
+
+ {clip.transcript_slice && (
+ <div className="section">
+ <label style={labelStyle}>Transcript</label>
+ <div style={{ fontSize: 13, color: "var(--text2)", lineHeight: 1.7 }}>{clip.transcript_slice}</div>
+ </div>
+ )}
+ </div>
+ </div>
+
+ {reframing && (
+ <ReframeEditor
+ clipId={clip.id}
+ start={clip.start_second}
+ end={clip.end_second}
+ caption_style={clip.caption_style}
+ onClose={() => setReframing(false)}
+ onDone={() => { setReframing(false); setBust(Date.now()); setMsg("Reframed & re-rendered"); load(); }}
+ />
+ )}
+ </div>
+ );
+}
diff --git a/src/ui/client/ClipPlayer.tsx b/src/ui/client/ClipPlayer.tsx
new file mode 100644
index 0000000..12304f7
--- /dev/null
+++ b/src/ui/client/ClipPlayer.tsx
@@ -0,0 +1,61 @@
+import React, { useEffect, useRef, useState } from "react";
+import { fmt as fmtTime } from "./lib";
+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 }) {
+ const ref = useRef<HTMLVideoElement>(null);
+ const [playing, setPlaying] = useState(false);
+ const [t, setT] = useState(0);
+ const [dur, setDur] = useState(0);
+
+ useEffect(() => {
+ setPlaying(false);
+ setT(0);
+ }, [src]);
+
+ const toggle = () => {
+ const v = ref.current;
+ if (!v) return;
+ if (v.paused) v.play();
+ else v.pause();
+ };
+
+ const seekAt = (clientX: number, el: HTMLDivElement) => {
+ const v = ref.current;
+ if (!v || !dur) return;
+ const rect = el.getBoundingClientRect();
+ v.currentTime = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width)) * dur;
+ };
+
+ const pct = dur ? (t / dur) * 100 : 0;
+
+ return (
+ <div className={`clip-player ${playing ? "" : "paused"}`}>
+ <video
+ ref={ref}
+ src={src}
+ playsInline
+ onClick={toggle}
+ onPlay={() => setPlaying(true)}
+ onPause={() => setPlaying(false)}
+ onTimeUpdate={(e) => { setT(e.currentTarget.currentTime); onTime?.(e.currentTarget.currentTime); }}
+ onLoadedMetadata={(e) => setDur(e.currentTarget.duration)}
+ />
+ <div className="clip-player-bar">
+ <button className="clip-player-btn" onClick={toggle} aria-label={playing ? "Pause" : "Play"}>
+ {playing ? <PauseIcon /> : <PlayIcon />}
+ </button>
+ <div
+ className="clip-player-track"
+ onPointerDown={(e) => { e.currentTarget.setPointerCapture(e.pointerId); seekAt(e.clientX, e.currentTarget); }}
+ onPointerMove={(e) => { if (e.buttons) seekAt(e.clientX, e.currentTarget); }}
+ >
+ <div className="clip-player-fill" style={{ width: `${pct}%` }} />
+ </div>
+ <span className="clip-player-time">{fmt(t)} / {fmt(dur)}</span>
+ </div>
+ </div>
+ );
+}
diff --git a/src/ui/client/ConfigPage.tsx b/src/ui/client/ConfigPage.tsx
new file mode 100644
index 0000000..471ff68
--- /dev/null
+++ b/src/ui/client/ConfigPage.tsx
@@ -0,0 +1,117 @@
+import React, { useEffect, useRef, useState } from "react";
+import { api, upload } from "./lib";
+
+export default function ConfigPage() {
+ const [status, setStatus] = useState<any>(null);
+ const [statusError, setStatusError] = useState<string | null>(null);
+ const [hasFile, setHasFile] = useState(false);
+ const [activate, setActivate] = useState(false);
+ const [importing, setImporting] = useState(false);
+ const [msg, setMsg] = useState<{ text: string; ok: boolean } | null>(null);
+ const fileRef = useRef<HTMLInputElement>(null);
+
+ async function loadStatus() {
+ setStatus(await api("/config/status"));
+ setStatusError(null);
+ }
+
+ useEffect(() => {
+ loadStatus().catch((e) => setStatusError(e.message));
+ }, []);
+
+ async function onMigrate() {
+ setMsg({ text: "Migrating…", ok: true });
+ try {
+ const data = await api<any>("/config/migrate", { method: "POST" });
+ setMsg({ text: `Moved ${data.moved_json || 0} cache file(s).`, ok: true });
+ await loadStatus();
+ } catch (e: any) {
+ setMsg({ text: e.message, ok: false });
+ }
+ }
+
+ function onExport() {
+ window.location.href = "/api/config/export";
+ }
+
+ async function onImport() {
+ const file = fileRef.current?.files?.[0];
+ if (!file) return;
+ const fd = new FormData();
+ fd.append("bundle", file);
+ fd.append("activate", activate ? "1" : "0");
+ setMsg({ text: "Importing…", ok: true });
+ setImporting(true);
+ try {
+ const data = await upload<any>("/config/import", fd);
+ setMsg({ text: data.backup ? `Imported into ${data.home} · backup ${data.backup}` : `Imported into ${data.home}`, ok: true });
+ await loadStatus();
+ } catch (e: any) {
+ setMsg({ text: e.message, ok: false });
+ } finally {
+ setImporting(false);
+ }
+ }
+
+ const rows: Array<[string, string]> = status
+ ? [
+ ["Config home", status.home || ""],
+ ["Data / cache", status.cache || ""],
+ ["Profile marker", status.profile_marker || ""],
+ ["Migration", status.migration?.already_migrated ? "Up to date" : "Ran on load"],
+ ]
+ : [];
+
+ return (
+ <div className="app" style={{ maxWidth: 760 }}>
+ <div className="header"><h1>Config</h1></div>
+
+ <div className="section">
+ {statusError ? (
+ <div className="set-note err">{statusError}</div>
+ ) : !status ? (
+ <div style={{ display: "flex", alignItems: "center", gap: 10, color: "var(--text2)" }}>
+ <div className="spinner sm" /> Loading…
+ </div>
+ ) : (
+ rows.map(([k, v]) => (
+ <div className="set-kv" key={k}>
+ <span className="k">{k}</span>
+ <span className="v">{v}</span>
+ </div>
+ ))
+ )}
+ </div>
+
+ <div className="section">
+ <div className="section-label">Actions</div>
+ <div className="set-actions">
+ <button type="button" className="btn btn-ghost btn-sm" onClick={onMigrate}>Run path migration</button>
+ <button type="button" className="btn btn-primary btn-sm" onClick={onExport}>Download profile (.zip)</button>
+ </div>
+
+ <div style={{ marginTop: 18 }}>
+ <label className="field-label">Import profile bundle</label>
+ <div className="set-file">
+ <input
+ type="file"
+ ref={fileRef}
+ accept=".zip,application/zip"
+ style={{ fontSize: 13 }}
+ onChange={(e) => setHasFile(!!e.target.files?.length)}
+ />
+ <button type="button" className="btn btn-ghost btn-sm" onClick={onImport} disabled={!hasFile || importing}>
+ {importing ? "Importing…" : "Import"}
+ </button>
+ </div>
+ <label style={{ display: "flex", alignItems: "center", gap: 8, marginTop: 10, fontSize: 12, color: "var(--text2)" }}>
+ <input type="checkbox" checked={activate} onChange={(e) => setActivate(e.target.checked)} />
+ Set imported folder as active config home
+ </label>
+ </div>
+
+ {msg && <div className={`set-note ${msg.ok ? "ok" : "err"}`}>{msg.text}</div>}
+ </div>
+ </div>
+ );
+}
diff --git a/src/ui/public/index.html b/src/ui/client/EpisodeWorkspace.jsx
similarity index 95%
rename from src/ui/public/index.html
rename to src/ui/client/EpisodeWorkspace.jsx
index dababbd..e4ddf6a 100644
--- a/src/ui/public/index.html
+++ b/src/ui/client/EpisodeWorkspace.jsx
@@ -1,61 +1,13 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>Podcli - AI Podcast Clip Studio</title>
- <meta name="description" content="Transcribe podcast videos, find viral moments, and export branded vertical clips with burned captions. Open-source local-first studio for YouTube Shorts, TikTok, and Reels.">
- <meta name="author" content="Podcli">
- <meta name="application-name" content="Podcli">
- <meta name="generator" content="Podcli">
- <meta name="robots" content="noindex,nofollow">
- <meta name="referrer" content="strict-origin-when-cross-origin">
- <meta name="format-detection" content="telephone=no">
-
- <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
- <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
- <meta name="color-scheme" content="dark light">
-
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="Podcli">
- <meta property="og:title" content="Podcli - AI Podcast Clip Studio">
- <meta property="og:description" content="Transcribe podcast videos, find viral moments, and export branded vertical clips with burned captions.">
- <meta property="og:image" content="/podcli-logo-transparent.png">
- <meta name="twitter:card" content="summary_large_image">
- <meta name="twitter:title" content="Podcli - AI Podcast Clip Studio">
- <meta name="twitter:description" content="Transcribe podcast videos, find viral moments, and export branded vertical clips with burned captions.">
- <meta name="twitter:image" content="/podcli-logo-transparent.png">
-
- <link rel="icon" type="image/png" href="/podcli-icon.png">
- <link rel="apple-touch-icon" href="/podcli-icon.png">
- <link rel="mask-icon" href="/podcli-icon-transparent.png" color="#0d0d0d">
-
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-title" content="Podcli">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta name="mobile-web-app-capable" content="yes">
-
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700;800&display=swap"
- rel="stylesheet">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.23.9/babel.min.js"></script>
- <link rel="stylesheet" href="css/styles.css">
-</head>
-
-<body>
- <div id="root"></div>
-
- <script type="text/babel">
- const { useState, useEffect, useRef, useCallback, useMemo } = React;
-
- const fmt = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`;
- const api = async (path, opts = {}) => (await fetch(`/api${path}`, { headers: { 'Content-Type': 'application/json', ...opts.headers }, ...opts })).json();
+import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
+
+const fmt = (s) => `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, '0')}`;
+ const api = async (path, opts = {}) => {
+ const res = await fetch(`/api${path}`, { headers: { 'Content-Type': 'application/json', ...opts.headers }, ...opts });
+ let body = null;
+ try { body = await res.json(); } catch { /* empty / non-JSON body */ }
+ if (!res.ok) return { error: (body && body.error) || `HTTP ${res.status}` };
+ return body ?? {};
+ };
function uploadFile(file, onProgress) {
return new Promise((resolve, reject) => {
@@ -551,7 +503,7 @@
);
}
- function App() {
+ export default function App() {
const [videoPath, setVideoPath] = useState('');
const [transcriptMode, setTranscriptMode] = useState('whisper');
const [transcriptText, setTranscriptText] = useState('');
@@ -639,18 +591,38 @@
const loadPreset = async (name) => {
if (!name) { setActivePreset(''); return; }
try {
- const d = await api('/presets', { method: 'POST', body: JSON.stringify({ action: 'get', name }) });
- // Backend returns the preset config directly (not nested under .config)
+ const response = await api('/presets', { method: 'POST', body: JSON.stringify({ action: 'get', name }) });
+ const d = response.config || response;
if (d.caption_style) setCaptionStyle(d.caption_style);
if (d.crop_strategy) setCropStrategy(d.crop_strategy);
if (d.logo_path !== undefined) setLogoPath(d.logo_path || '');
if (d.outro_path !== undefined) setOutroPath(d.outro_path || '');
+ if (d.video_path !== undefined) {
+ const nextVideoPath = d.video_path || '';
+ const changedVideo = nextVideoPath.trim() !== videoPath.trim();
+ setVideoPath(nextVideoPath);
+ setFile(null);
+ if (changedVideo) {
+ setTranscript(null);
+ setCachedTranscript(false);
+ setTranscriptText('');
+ setTranscriptFileName('');
+ setSuggestions([]);
+ setDeselected(new Set());
+ setResults([]);
+ setEnergyData({});
+ autoTranscribeRef.current = '';
+ setPhase('idle');
+ }
+ }
if (d.clean_fillers !== undefined) setCleanFillers(d.clean_fillers);
if (d.quality) setQuality(d.quality);
if (d.top_clips) setTopClips(d.top_clips);
if (d.min_clip_duration) setMinDuration(d.min_clip_duration);
if (d.max_clip_duration) setMaxDuration(d.max_clip_duration);
if (d.energy_boost !== undefined) setEnergyBoost(d.energy_boost);
+ if (d.whisper_model) setWhisperModel(d.whisper_model);
+ if (d.time_adjust !== undefined) setTimeAdjust(d.time_adjust);
setActivePreset(name);
} catch {}
};
@@ -661,7 +633,7 @@
try {
await api('/presets', { method: 'POST', body: JSON.stringify({
action: 'save', name: presetName.trim(),
- config: { caption_style: captionStyle, crop_strategy: cropStrategy, logo_path: logoPath, outro_path: outroPath, clean_fillers: cleanFillers, quality, top_clips: topClips, min_clip_duration: minDuration, max_clip_duration: maxDuration, energy_boost: energyBoost }
+ config: { caption_style: captionStyle, crop_strategy: cropStrategy, logo_path: logoPath, outro_path: outroPath, video_path: videoPath.trim(), whisper_model: whisperModel, time_adjust: timeAdjust, clean_fillers: cleanFillers, quality, top_clips: topClips, min_clip_duration: minDuration, max_clip_duration: maxDuration, energy_boost: energyBoost }
})});
setActivePreset(presetName.trim());
setPresetName(''); setShowPresetSave(false);
@@ -839,6 +811,7 @@
if (d.deselectedIndices !== undefined) setDeselected(new Set(d.deselectedIndices));
else if (d.suggestions && !d.deselectedIndices) setDeselected(new Set());
if (d.phase) setPhase(d.phase);
+ if (d.activeExportJobId) setBatchJobId(d.activeExportJobId);
if (d.videoPath !== undefined) setVideoPath(d.videoPath);
if (d.transcript) { setTranscript(d.transcript); if (d.videoPath) autoTranscribeRef.current = d.videoPath; }
if (d.rawTranscriptText && !transcript) setTranscriptText(d.rawTranscriptText);
@@ -859,14 +832,18 @@
if (phase === 'exporting' || sseEvent.data.result?.results) {
setPhase('done');
setResults(sseEvent.data.result?.results || []);
+ setBatchJobId(null);
}
} else if (sseEvent.type === 'job-error') {
if (phase === 'exporting') {
setError('Export failed: ' + (sseEvent.data.error || 'Unknown error'));
setPhase('review');
+ setBatchJobId(null);
}
}
- }, [sseEvent]);
+ // phase/transcript are read above; the ts-guard makes re-runs on their
+ // change a no-op, so depending on them just keeps the reads fresh.
+ }, [sseEvent, phase, transcript]);
// Preview panel state
const videoRef = useRef();
@@ -940,8 +917,8 @@
};
useEffect(() => {
- if (batchStream?.status === 'done') { setPhase('done'); setResults(batchStream.result?.results || []); }
- if (batchStream?.status === 'error') { setError('Export failed: ' + batchStream.error); setPhase('review'); }
+ if (batchStream?.status === 'done') { setPhase('done'); setResults(batchStream.result?.results || []); setBatchJobId(null); }
+ if (batchStream?.status === 'error') { setError('Export failed: ' + batchStream.error); setPhase('review'); setBatchJobId(null); }
}, [batchStream?.status]);
const retryClip = async (idx) => {
@@ -1123,8 +1100,7 @@
return (
<div className="app">
<div className="header">
- <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
- <img src="/podcli-logo-transparent.png" alt="podcli" style={{ height: 22 }} />
+ <div style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
{mcpConnected && (
<span className="pill" style={{ fontSize: 10, letterSpacing: '0.5px', background: 'var(--green-subtle)', color: 'var(--green)', border: '1px solid var(--green-border)' }}>
@@ -1148,10 +1124,6 @@
Speakers ✓
</span>
)}
- <a href="/knowledge.html" style={{ fontSize: 12, fontWeight: 600, color: 'var(--text2)', textDecoration: 'none', padding: '5px 12px', border: '1px solid var(--border)', borderRadius: 'var(--radius-sm)', transition: 'all 0.15s' }}>Knowledge</a>
- <a href="/config.html" style={{ fontSize: 12, fontWeight: 600, color: 'var(--text2)', textDecoration: 'none', padding: '5px 12px', border: '1px solid var(--border)', borderRadius: 'var(--radius-sm)', transition: 'all 0.15s' }}>Config</a>
- <a href="/integrations.html" style={{ fontSize: 12, fontWeight: 600, color: 'var(--text2)', textDecoration: 'none', padding: '5px 12px', border: '1px solid var(--border)', borderRadius: 'var(--radius-sm)', transition: 'all 0.15s' }}>Integrations</a>
- <a href="/integration.html" style={{ fontSize: 12, fontWeight: 600, color: 'var(--text2)', textDecoration: 'none', padding: '5px 12px', border: '1px solid var(--border)', borderRadius: 'var(--radius-sm)', transition: 'all 0.15s' }}>MCP Setup</a>
</div>
</div>
<h1>Podcast content studio</h1>
@@ -1871,9 +1843,3 @@
</div>
);
}
-
- ReactDOM.createRoot(document.getElementById('root')).render(<App />);
- </script>
-</body>
-
-</html>
diff --git a/src/ui/client/IntegrationsPage.tsx b/src/ui/client/IntegrationsPage.tsx
new file mode 100644
index 0000000..de2635d
--- /dev/null
+++ b/src/ui/client/IntegrationsPage.tsx
@@ -0,0 +1,96 @@
+import React, { useEffect, useState } from "react";
+import { api } from "./lib";
+
+const CATEGORY: Record<string, string> = {
+ editor_export: "Editor export",
+ platform_upload: "Platform upload",
+ productivity: "Productivity",
+ ai_helper: "AI helper",
+};
+
+export default function IntegrationsPage() {
+ const [integrations, setIntegrations] = useState<any[] | null>(null);
+ const [error, setError] = useState<string | null>(null);
+ const [busy, setBusy] = useState<Record<string, boolean>>({});
+
+ async function load() {
+ try {
+ const data = await api<any>("/integrations");
+ setIntegrations(data.integrations || []);
+ setError(null);
+ } catch (err: any) {
+ setError(err.message);
+ }
+ }
+
+ useEffect(() => {
+ load();
+ }, []);
+
+ async function onToggle(int: any) {
+ const name = int.name;
+ const next = !int.enabled;
+ setBusy((b) => ({ ...b, [name]: true }));
+ try {
+ await api(`/integrations/${encodeURIComponent(name)}`, {
+ method: "POST",
+ body: JSON.stringify({ enabled: next }),
+ });
+ setIntegrations((list) => (list || []).map((i) => (i.name === name ? { ...i, enabled: next } : i)));
+ } catch (err: any) {
+ alert(`Failed to ${next ? "enable" : "disable"} ${name}: ${err.message}`);
+ } finally {
+ setBusy((b) => ({ ...b, [name]: false }));
+ }
+ }
+
+ return (
+ <div className="app" style={{ maxWidth: 820 }}>
+ <div className="header"><h1>Integrations</h1></div>
+
+ {error ? (
+ <div className="set-note err">{error}</div>
+ ) : integrations === null ? (
+ <div style={{ display: "flex", alignItems: "center", gap: 10, color: "var(--text2)" }}>
+ <div className="spinner sm" /> Loading…
+ </div>
+ ) : integrations.length === 0 ? (
+ <div className="drop-zone" style={{ textAlign: "center", padding: "40px 20px", color: "var(--text2)" }}>
+ No integrations installed.
+ </div>
+ ) : (
+ <div className="section">
+ {integrations.map((int) => (
+ <div key={int.name} className="int-row">
+ <div style={{ minWidth: 0 }}>
+ <div className="name">
+ {int.name}
+ <span className="pill pill-blue" style={{ marginLeft: 8, fontSize: 10 }}>
+ {CATEGORY[int.category] || int.category}
+ </span>
+ </div>
+ {int.description && <div className="desc">{int.description}</div>}
+ {(int.tools || []).length > 0 && (
+ <div style={{ marginTop: 6, display: "flex", flexWrap: "wrap", gap: 5 }}>
+ {int.tools.map((t: any) => (
+ <span key={t.name} className="pill" style={{ fontSize: 10, fontFamily: "var(--font-mono, monospace)" }}>{t.name}</span>
+ ))}
+ </div>
+ )}
+ </div>
+ <button
+ type="button"
+ className={`toggle ${int.enabled ? "on" : ""}`}
+ role="switch"
+ aria-checked={!!int.enabled}
+ aria-label={`Toggle ${int.name}`}
+ disabled={busy[int.name]}
+ onClick={() => onToggle(int)}
+ />
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/src/ui/client/KnowledgePage.jsx b/src/ui/client/KnowledgePage.jsx
new file mode 100644
index 0000000..7b3faab
--- /dev/null
+++ b/src/ui/client/KnowledgePage.jsx
@@ -0,0 +1,169 @@
+import React, { useState, useEffect, useCallback } from 'react';
+import { api, upload } from './lib';
+
+export default function KnowledgePage() {
+ const [files, setFiles] = useState([]);
+ const [activeFile, setActiveFile] = useState(null);
+ const [editorContent, setEditorContent] = useState('');
+ const [dirty, setDirty] = useState(false);
+ const [dragOver, setDragOver] = useState(false);
+ const [toast, setToast] = useState(null);
+ const [newName, setNewName] = useState('');
+ const [kbDir, setKbDir] = useState('');
+
+ const showToast = (msg) => { setToast(msg); setTimeout(() => setToast(null), 2000); };
+
+ const loadFiles = useCallback(async () => {
+ try { const r = await api('/knowledge'); setFiles(Array.isArray(r) ? r : []); }
+ catch (e) { showToast(`Load failed: ${e.message}`); }
+ }, []);
+
+ useEffect(() => {
+ loadFiles();
+ api('/knowledge/dir').then(d => setKbDir(d.path)).catch(() => { });
+ }, []);
+
+ const openFile = (f) => {
+ if (dirty && !confirm('Discard unsaved changes?')) return;
+ setActiveFile(f.filename);
+ setEditorContent(f.content);
+ setDirty(false);
+ };
+
+ const saveFile = async () => {
+ if (!activeFile) return;
+ try {
+ await api(`/knowledge/${encodeURIComponent(activeFile)}`, { method: 'POST', body: JSON.stringify({ content: editorContent }) });
+ setDirty(false);
+ showToast('Saved');
+ loadFiles();
+ } catch (e) { showToast(`Save failed: ${e.message}`); }
+ };
+
+ const deleteFile = async (filename, e) => {
+ e.stopPropagation();
+ if (!confirm(`Delete ${filename}?`)) return;
+ try {
+ await api(`/knowledge/${encodeURIComponent(filename)}`, { method: 'DELETE' });
+ if (activeFile === filename) { setActiveFile(null); setEditorContent(''); }
+ showToast('Deleted');
+ loadFiles();
+ } catch (e) { showToast(`Delete failed: ${e.message}`); }
+ };
+
+ const createFile = async () => {
+ let name = newName.trim();
+ if (!name) return;
+ if (!name.endsWith('.md')) name += '.md';
+ try {
+ await api(`/knowledge/${encodeURIComponent(name)}`, { method: 'POST', body: JSON.stringify({ content: `# ${name.replace('.md', '')}\n\n` }) });
+ setNewName('');
+ await loadFiles();
+ const created = (await api('/knowledge')).find(f => f.filename === name);
+ if (created) openFile(created);
+ showToast('Created');
+ } catch (e) { showToast(`Create failed: ${e.message}`); }
+ };
+
+ const uploadFiles = async (fileList, label) => {
+ const fd = new FormData();
+ for (const f of fileList) {
+ if (f.name.endsWith('.md') || f.name.endsWith('.txt')) fd.append('files', f);
+ }
+ if (!fd.has('files')) return;
+ try {
+ await upload('/knowledge/upload', fd);
+ showToast(`${label} added`);
+ loadFiles();
+ } catch (e) { showToast(`Upload failed: ${e.message}`); }
+ };
+
+ const handleDrop = async (e) => {
+ e.preventDefault();
+ setDragOver(false);
+ if (!e.dataTransfer.files.length) return;
+ await uploadFiles(e.dataTransfer.files, `${e.dataTransfer.files.length} file(s)`);
+ };
+
+ const handleFileInput = async (e) => {
+ if (!e.target.files.length) return;
+ await uploadFiles(e.target.files, `${e.target.files.length} file(s)`);
+ e.target.value = '';
+ };
+
+ const realFiles = files.filter(f => f.filename !== 'README.md');
+
+ return (
+ <div className="app">
+ <div className="header">
+ <h1>Knowledge Base</h1>
+ {kbDir && <div className="dir-path">{kbDir}</div>}
+ </div>
+
+ <div
+ className={`drop-zone ${dragOver ? 'drag-over' : ''}`}
+ onDragOver={(e) => { e.preventDefault(); setDragOver(true); }}
+ onDragLeave={() => setDragOver(false)}
+ onDrop={handleDrop}
+ >
+ <div className="dz-icon">{'\uD83D\uDCC4'}</div>
+ <div className="dz-text">
+ Drop <strong>.md files</strong> here or click to browse
+ </div>
+ <input type="file" accept=".md,.txt" multiple onChange={handleFileInput} />
+ </div>
+
+ {realFiles.length > 0 ? (
+ <div className="file-grid">
+ {realFiles.map(f => (
+ <div
+ key={f.filename}
+ className={`file-card ${activeFile === f.filename ? 'active' : ''}`}
+ onClick={() => openFile(f)}
+ >
+ <button className="file-delete" onClick={(e) => deleteFile(f.filename, e)}>{'\u00D7'}</button>
+ <div className="file-name">{f.filename}</div>
+ <div className="file-meta">{new Date(f.updatedAt).toLocaleDateString()}</div>
+ <div className="file-preview">{f.content.split('\n').filter(l => l.trim() && !l.startsWith('#')).slice(0, 2).join(' ')}</div>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <div className="empty-state">
+ No knowledge files yet. Drop .md files above or create one below.
+ </div>
+ )}
+
+ <div className="new-file-row">
+ <input
+ className="new-file-input"
+ placeholder="new-file-name.md"
+ value={newName}
+ onChange={e => setNewName(e.target.value)}
+ onKeyDown={e => e.key === 'Enter' && createFile()}
+ />
+ <button className="btn btn-primary" onClick={createFile}>Create</button>
+ </div>
+
+ {activeFile && (
+ <div className="editor-panel" style={{ animation: 'fadeIn 0.2s var(--ease)' }}>
+ <div className="editor-header">
+ <span className="editor-filename">{activeFile}</span>
+ <div className="editor-actions">
+ {dirty && <span style={{ fontSize: 11, color: 'var(--accent)', fontWeight: 600, padding: '4px 8px' }}>unsaved</span>}
+ <button className="btn btn-ghost" onClick={() => { setActiveFile(null); setEditorContent(''); setDirty(false); }}>Close</button>
+ <button className="btn btn-primary" onClick={saveFile}>Save</button>
+ </div>
+ </div>
+ <textarea
+ className="editor-textarea"
+ value={editorContent}
+ onChange={e => { setEditorContent(e.target.value); setDirty(true); }}
+ />
+ </div>
+ )}
+
+ {toast && <div className="toast">{toast}</div>}
+ </div>
+ );
+ }
diff --git a/src/ui/client/Layout.tsx b/src/ui/client/Layout.tsx
new file mode 100644
index 0000000..27c8252
--- /dev/null
+++ b/src/ui/client/Layout.tsx
@@ -0,0 +1,50 @@
+import React from "react";
+import { NavLink, Link, Outlet } from "react-router-dom";
+
+const icons: Record<string, React.ReactNode> = {
+ library: <path d="M3 5h7v14H3zM14 5h7v9h-7z" />,
+ episode: <path d="M5 3l14 9-14 9z" />,
+ thumbnail: <path d="M3 4h18v16H3z M3 15l5-4 4 3 4-4 5 4" />,
+ knowledge: <path d="M4 5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-2z M9 3v18" />,
+ config: <path d="M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z M19 12a7 7 0 0 0-.1-1l2-1.6-2-3.4-2.4 1a7 7 0 0 0-1.7-1L14.5 2h-5l-.3 2.9a7 7 0 0 0-1.7 1l-2.4-1-2 3.4L2.1 11a7 7 0 0 0 0 2l-2 1.6 2 3.4 2.4-1a7 7 0 0 0 1.7 1l.3 2.9h5l.3-2.9a7 7 0 0 0 1.7-1l2.4 1 2-3.4-2-1.6a7 7 0 0 0 .1-1z" />,
+ integrations: <path d="M10 3v6M14 3v6M7 9h10v3a5 5 0 0 1-10 0z M11 17v4" />,
+ analytics: <path d="M4 20V10M10 20V4M16 20v-7M22 20H2" />,
+};
+
+function Icon({ name }: { name: string }) {
+ return (
+ <svg className="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
+ {icons[name]}
+ </svg>
+ );
+}
+
+export default function Layout() {
+ return (
+ <div className="shell">
+ <aside className="sidebar">
+ <Link to="/" className="sidebar-logo">
+ <img src="/podcli-logo-transparent.png" alt="podcli" />
+ </Link>
+
+ <div className="sidebar-section">Studio</div>
+ <NavLink to="/" end className="sidebar-link"><Icon name="library" /> Library</NavLink>
+ <NavLink to="/episode" className="sidebar-link"><Icon name="episode" /> New episode</NavLink>
+ <NavLink to="/thumbnail" className="sidebar-link"><Icon name="thumbnail" /> Thumbnail</NavLink>
+
+ <div className="sidebar-section">Workspace</div>
+ <NavLink to="/knowledge" className="sidebar-link"><Icon name="knowledge" /> Knowledge</NavLink>
+ <NavLink to="/config" className="sidebar-link"><Icon name="config" /> Config</NavLink>
+ <NavLink to="/integrations" className="sidebar-link"><Icon name="integrations" /> Integrations</NavLink>
+ <NavLink to="/mcp" className="sidebar-link"><Icon name="config" /> MCP Setup</NavLink>
+
+ <div className="sidebar-section">Insights</div>
+ <NavLink to="/analytics" className="sidebar-link"><Icon name="analytics" /> Analytics</NavLink>
+ </aside>
+
+ <main className="shell-main">
+ <Outlet />
+ </main>
+ </div>
+ );
+}
diff --git a/src/ui/client/McpSetupPage.tsx b/src/ui/client/McpSetupPage.tsx
new file mode 100644
index 0000000..635e8f3
--- /dev/null
+++ b/src/ui/client/McpSetupPage.tsx
@@ -0,0 +1,92 @@
+import React, { useEffect, useRef, useState } from "react";
+import { api } from "./lib";
+
+type StatusKind = "warn" | "ok" | "err";
+
+const STATUS_STYLE: Record<StatusKind, React.CSSProperties> = {
+ ok: { background: "var(--green-subtle)", color: "var(--green)", border: "1px solid var(--green-border)" },
+ err: { background: "var(--red-subtle)", color: "var(--red)", border: "1px solid var(--red-border)" },
+ warn: { background: "rgba(250,204,21,0.08)", color: "#facc15", border: "1px solid rgba(250,204,21,0.2)" },
+};
+
+export default function McpSetupPage() {
+ const [distPath, setDistPath] = useState<string | null>(null);
+ const [statusKind, setStatusKind] = useState<StatusKind>("warn");
+ const [statusText, setStatusText] = useState("Checking connection…");
+ const desktopRef = useRef<HTMLPreElement>(null);
+ const codeRef = useRef<HTMLPreElement>(null);
+ const [copied, setCopied] = useState<Record<string, boolean>>({});
+
+ useEffect(() => {
+ api<any>("/integration-info")
+ .then((data) => {
+ setDistPath(data.dist_path);
+ if (data.server_ok) {
+ setStatusKind("ok");
+ setStatusText(`Server running · ${data.tools_count} tools available`);
+ } else {
+ setStatusKind("err");
+ setStatusText("Server not built — run: npm run build");
+ }
+ })
+ .catch(() => {
+ setStatusKind("err");
+ setStatusText("Could not reach server");
+ });
+ }, []);
+
+ function copyBlock(id: string, ref: React.RefObject<HTMLPreElement>) {
+ navigator.clipboard.writeText(ref.current?.innerText ?? "").then(() => {
+ setCopied((c) => ({ ...c, [id]: true }));
+ setTimeout(() => setCopied((c) => ({ ...c, [id]: false })), 1500);
+ });
+ }
+
+ const dist = distPath ?? "<path-to>/dist/index.js";
+ const desktopJson = `{
+ "mcpServers": {
+ "podcli": {
+ "command": "node",
+ "args": ["${dist}"]
+ }
+ }
+}`;
+
+ return (
+ <div className="app" style={{ maxWidth: 780 }}>
+ <div className="header"><h1>MCP Setup</h1></div>
+
+ <span className="pill" style={{ ...STATUS_STYLE[statusKind], fontSize: 11 }}>{statusText}</span>
+
+ <div className="section" style={{ marginTop: 18 }}>
+ <div className="section-label">Claude Desktop</div>
+ <div style={{ fontSize: 12.5, color: "var(--text2)", lineHeight: 1.6 }}>
+ Add to <code>~/Library/Application Support/Claude/claude_desktop_config.json</code> (macOS) or
+ <code> %APPDATA%\Claude\claude_desktop_config.json</code> (Windows), then restart Claude.
+ </div>
+ <div className="code-block">
+ <div className="code-block-head">
+ <span>claude_desktop_config.json</span>
+ <button className="btn btn-ghost btn-sm" style={{ padding: "3px 10px" }} onClick={() => copyBlock("desktop", desktopRef)}>
+ {copied.desktop ? "Copied" : "Copy"}
+ </button>
+ </div>
+ <pre ref={desktopRef}>{desktopJson}</pre>
+ </div>
+ </div>
+
+ <div className="section">
+ <div className="section-label">Claude Code</div>
+ <div className="code-block">
+ <div className="code-block-head">
+ <span>terminal</span>
+ <button className="btn btn-ghost btn-sm" style={{ padding: "3px 10px" }} onClick={() => copyBlock("code", codeRef)}>
+ {copied.code ? "Copied" : "Copy"}
+ </button>
+ </div>
+ <pre ref={codeRef}>{`claude mcp add podcli node ${dist}`}</pre>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/src/ui/client/ReframeEditor.tsx b/src/ui/client/ReframeEditor.tsx
new file mode 100644
index 0000000..260e5ea
--- /dev/null
+++ b/src/ui/client/ReframeEditor.tsx
@@ -0,0 +1,194 @@
+import React, { useEffect, useRef, useState } from "react";
+import { api, fmtMs } from "./lib";
+import { PlayIcon, PauseIcon, FrameBackIcon, FrameForwardIcon, CutBackIcon, CutForwardIcon, CloseIcon } from "./icons";
+
+interface Keyframe { tAbs: number; x_pct: number }
+
+const FRAME = 1 / 30;
+const BUFFER = 7; // seconds of padding shown around the clip for trimming
+
+export default function ReframeEditor({
+ clipId, start, end, caption_style, onClose, onDone,
+}: {
+ clipId: string; start: number; end: number; caption_style: string;
+ onClose: () => void; onDone: () => void;
+}) {
+ const videoRef = useRef<HTMLVideoElement>(null);
+ const stageRef = useRef<HTMLDivElement>(null);
+ const trackRef = useRef<HTMLDivElement>(null);
+ const dragMode = useRef<"in" | "out" | "scrub" | null>(null);
+
+ const [boxPct, setBoxPct] = useState(31.6);
+ const [centerPct, setCenterPct] = useState(50);
+ const [srcDur, setSrcDur] = useState(end + BUFFER);
+ const [tAbs, setTAbs] = useState(start);
+ const [inSec, setInSec] = useState(start);
+ const [outSec, setOutSec] = useState(end);
+ const [keyframes, setKeyframes] = useState<Keyframe[]>([]);
+ const [playing, setPlaying] = useState(false);
+ const [busy, setBusy] = useState(false);
+ const [err, setErr] = useState<string | null>(null);
+ const [cuts, setCuts] = useState<number[]>([]);
+ const [detectingCuts, setDetectingCuts] = useState(true);
+
+ const bufStart = Math.max(0, start - BUFFER);
+ const bufEnd = Math.min(srcDur, end + BUFFER);
+ const win = Math.max(0.1, bufEnd - bufStart);
+ const pos = (t: number) => ((t - bufStart) / win) * 100;
+ const half = boxPct / 2;
+ const clampCenter = (p: number) => Math.max(half, Math.min(100 - half, p));
+
+ useEffect(() => {
+ api(`/clips/${clipId}/reframe`).then((r) => {
+ if (Array.isArray(r?.keyframes)) setKeyframes(r.keyframes);
+ if (typeof r?.inSec === "number") setInSec(r.inSec);
+ if (typeof r?.outSec === "number") setOutSec(r.outSec);
+ }).catch(() => {});
+ api(`/clips/${clipId}/cuts`)
+ .then((r) => setCuts(Array.isArray(r?.cuts) ? r.cuts : []))
+ .catch(() => {})
+ .finally(() => setDetectingCuts(false));
+ }, [clipId]);
+
+ const onMeta = () => {
+ const v = videoRef.current;
+ if (!v) return;
+ if (v.videoWidth) setBoxPct(Math.min(100, ((v.videoHeight * 9) / 16 / v.videoWidth) * 100));
+ if (v.duration && Number.isFinite(v.duration)) setSrcDur(v.duration);
+ v.currentTime = start;
+ };
+
+ const reflectKeyframe = (absT: number) => {
+ const at = keyframes.slice().sort((a, b) => a.tAbs - b.tAbs).filter((k) => k.tAbs <= absT).pop();
+ if (at) setCenterPct(at.x_pct);
+ };
+
+ const seek = (absT: number) => {
+ const v = videoRef.current;
+ const clamped = Math.max(bufStart, Math.min(bufEnd, absT));
+ if (v) v.currentTime = clamped;
+ setTAbs(clamped);
+ reflectKeyframe(clamped);
+ };
+
+ const togglePlay = () => {
+ const v = videoRef.current;
+ if (!v) return;
+ if (v.paused) { if (v.currentTime >= bufEnd) v.currentTime = bufStart; v.play(); } else v.pause();
+ };
+
+ const onTimeUpdate = () => {
+ const v = videoRef.current;
+ if (!v) return;
+ if (v.currentTime >= bufEnd) { v.pause(); v.currentTime = bufEnd; }
+ setTAbs(v.currentTime);
+ reflectKeyframe(v.currentTime);
+ };
+
+ const pointer = (e: React.PointerEvent) => {
+ if (e.buttons === 0 && e.type !== "pointerdown") return;
+ const r = stageRef.current!.getBoundingClientRect();
+ setCenterPct(clampCenter(((e.clientX - r.left) / r.width) * 100));
+ };
+
+ const addKeyframe = () => {
+ const near = cuts.find((c) => Math.abs(c - tAbs) < 0.25);
+ const t = near ?? tAbs;
+ setKeyframes((kf) => [...kf.filter((k) => Math.abs(k.tAbs - t) > 0.02), { tAbs: +t.toFixed(3), x_pct: +centerPct.toFixed(1) }].sort((a, b) => a.tAbs - b.tAbs));
+ };
+
+ const jumpCut = (dir: 1 | -1) => {
+ const next = dir > 0 ? cuts.find((c) => c > tAbs + 0.05) : [...cuts].reverse().find((c) => c < tAbs - 0.05);
+ if (next != null) seek(next);
+ };
+
+ const xToTime = (clientX: number) => {
+ const r = trackRef.current!.getBoundingClientRect();
+ return bufStart + Math.max(0, Math.min(1, (clientX - r.left) / r.width)) * win;
+ };
+ const applyDrag = (clientX: number) => {
+ const tt = xToTime(clientX);
+ if (dragMode.current === "in") { setInSec(Math.min(tt, outSec - 0.2)); seek(tt); }
+ else if (dragMode.current === "out") { setOutSec(Math.max(tt, inSec + 0.2)); seek(tt); }
+ else seek(tt);
+ };
+ const onTrackDown = (e: React.PointerEvent<HTMLDivElement>) => {
+ e.currentTarget.setPointerCapture(e.pointerId);
+ const tt = xToTime(e.clientX);
+ const thr = win * 0.05;
+ dragMode.current = Math.abs(tt - inSec) < thr ? "in" : Math.abs(tt - outSec) < thr ? "out" : "scrub";
+ applyDrag(e.clientX);
+ };
+
+ const apply = async () => {
+ const kf = keyframes.length ? keyframes : [{ tAbs: inSec, x_pct: +centerPct.toFixed(1) }];
+ setBusy(true); setErr(null);
+ try {
+ const r = await api(`/clips/${clipId}/rerender`, {
+ method: "POST",
+ body: JSON.stringify({ caption_style, reframe: { keyframes: kf, inSec: +inSec.toFixed(3), outSec: +outSec.toFixed(3) } }),
+ });
+ if (r.error) throw new Error(r.error);
+ onDone();
+ } catch (e: any) { setErr(e.message); setBusy(false); }
+ };
+
+ return (
+ <div className="reframe-overlay" onClick={onClose}>
+ <div className="reframe-modal" onClick={(e) => e.stopPropagation()}>
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 12 }}>
+ <h3 style={{ margin: 0, fontSize: 16 }}>Reframe & trim</h3>
+ <button className="btn btn-ghost btn-sm" onClick={onClose} aria-label="Close"><CloseIcon /></button>
+ </div>
+
+ <div ref={stageRef} className="reframe-stage" onPointerDown={pointer} onPointerMove={pointer}>
+ <video ref={videoRef} src={`/api/clips/${clipId}/source`} playsInline preload="auto"
+ onLoadedMetadata={onMeta} onTimeUpdate={onTimeUpdate} onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} />
+ <div className="reframe-box" style={{ left: `${centerPct - half}%`, width: `${boxPct}%` }} />
+ </div>
+
+ <div ref={trackRef} className="rf-track" onPointerDown={onTrackDown} onPointerMove={(e) => { if (e.buttons) applyDrag(e.clientX); }} onPointerUp={() => (dragMode.current = null)}>
+ <div className="rf-region" style={{ left: `${pos(inSec)}%`, width: `${pos(outSec) - pos(inSec)}%` }} />
+ <div className="rf-handle rf-handle-in" style={{ left: `${pos(inSec)}%` }} />
+ <div className="rf-handle rf-handle-out" style={{ left: `${pos(outSec)}%` }} />
+ {cuts.map((c) => <div key={`cut-${c}`} className="rf-cut" style={{ left: `${pos(c)}%` }} title={`camera switch @ ${fmtMs(c)}`} />)}
+ {keyframes.map((k) => <div key={k.tAbs} className="rf-kf" style={{ left: `${pos(k.tAbs)}%` }} title={`${fmtMs(k.tAbs)} · ${Math.round(k.x_pct)}%`} />)}
+ <div className="rf-playhead" style={{ left: `${pos(tAbs)}%` }} />
+ </div>
+
+ <div style={{ fontSize: 11, color: "var(--text3)", marginTop: 6 }}>
+ {detectingCuts ? "Detecting camera switches…" : cuts.length ? `${cuts.length} camera switch${cuts.length > 1 ? "es" : ""} detected — a keyframe near one snaps to it` : "No camera switches detected"}
+ </div>
+
+ <div style={{ display: "flex", alignItems: "center", gap: 6, marginTop: 8 }}>
+ <button className="btn btn-ghost btn-sm" title="Play / pause" onClick={togglePlay}>{playing ? <PauseIcon /> : <PlayIcon />}</button>
+ <button className="btn btn-ghost btn-sm" title="Previous frame" onClick={() => seek(tAbs - FRAME)}><FrameBackIcon /></button>
+ <button className="btn btn-ghost btn-sm" title="Next frame" onClick={() => seek(tAbs + FRAME)}><FrameForwardIcon /></button>
+ <button className="btn btn-ghost btn-sm" title="Previous camera switch" onClick={() => jumpCut(-1)} disabled={!cuts.length}><CutBackIcon /></button>
+ <button className="btn btn-ghost btn-sm" title="Next camera switch" onClick={() => jumpCut(1)} disabled={!cuts.length}><CutForwardIcon /></button>
+ <span style={{ fontSize: 12, color: "var(--text)", fontVariantNumeric: "tabular-nums", marginLeft: 4 }}>{fmtMs(tAbs)}</span>
+ <span style={{ flex: 1 }} />
+ <button className="btn btn-primary btn-sm" onClick={addKeyframe}>+ Keyframe</button>
+ </div>
+
+ {keyframes.length > 0 && (
+ <div style={{ display: "flex", flexWrap: "wrap", gap: 6, marginTop: 12 }}>
+ {keyframes.map((k) => (
+ <span key={k.tAbs} className="pill" style={{ fontSize: 11, display: "inline-flex", gap: 6, alignItems: "center", cursor: "pointer" }} onClick={() => seek(k.tAbs)}>
+ {fmtMs(k.tAbs)} · {Math.round(k.x_pct)}%
+ <button onClick={(e) => { e.stopPropagation(); setKeyframes((kf) => kf.filter((x) => x.tAbs !== k.tAbs)); }} style={{ background: "none", border: "none", color: "var(--text3)", cursor: "pointer", padding: 0 }}>×</button>
+ </span>
+ ))}
+ </div>
+ )}
+
+ {err && <div className="set-note err" style={{ marginTop: 12 }}>{err}</div>}
+
+ <div style={{ display: "flex", gap: 10, marginTop: 16 }}>
+ <button className="btn btn-primary btn-sm" onClick={apply} disabled={busy}>{busy ? <div className="spinner sm" /> : "Apply & re-render"}</button>
+ <button className="btn btn-ghost btn-sm" onClick={onClose} disabled={busy}>Cancel</button>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/src/ui/client/StudioHome.tsx b/src/ui/client/StudioHome.tsx
new file mode 100644
index 0000000..7182ff0
--- /dev/null
+++ b/src/ui/client/StudioHome.tsx
@@ -0,0 +1,153 @@
+import React, { useEffect, useState } from "react";
+import { Link } from "react-router-dom";
+import { api, fmt, timeAgo, basename } from "./lib";
+import { TrashIcon } from "./icons";
+
+interface Clip {
+ id: string;
+ source_video: string;
+ title: string;
+ caption_style: string;
+ duration: number;
+ file_size_mb?: number;
+ output_path: string;
+ created_at: string;
+ content_type?: string;
+ thumbnail_config?: { image_path?: string; preview_path?: string };
+}
+
+interface Episode {
+ source: string;
+ clips: Clip[];
+ latest: string;
+}
+
+function groupEpisodes(clips: Clip[]): Episode[] {
+ const map = new Map<string, Clip[]>();
+ for (const c of clips) {
+ const key = basename(c.source_video) || "unknown";
+ (map.get(key) ?? map.set(key, []).get(key)!).push(c);
+ }
+ return Array.from(map.entries())
+ .map(([source, list]) => ({
+ source,
+ clips: list,
+ latest: list.reduce((a, c) => (c.created_at > a ? c.created_at : a), list[0]?.created_at || ""),
+ }))
+ .sort((a, b) => (a.latest < b.latest ? 1 : -1));
+}
+
+export default function StudioHome() {
+ const [clips, setClips] = useState<Clip[]>([]);
+ const [loading, setLoading] = useState(true);
+ const [exporting, setExporting] = useState(0);
+ const [deleting, setDeleting] = useState<string | null>(null);
+
+ useEffect(() => {
+ const loadHistory = () => {
+ api("/history?limit=500")
+ .then((d) => setClips(Array.isArray(d) ? d : []))
+ .catch(() => setClips([]))
+ .finally(() => setLoading(false));
+ };
+
+ loadHistory();
+ const events = new EventSource("/api/events");
+ events.addEventListener("history-updated", loadHistory);
+ const onStart = (e: MessageEvent) => { try { setExporting(JSON.parse(e.data).clipCount || 0); } catch { setExporting(1); } };
+ const onEnd = () => setExporting(0);
+ events.addEventListener("export-started", onStart as EventListener);
+ events.addEventListener("job-complete", onEnd as EventListener);
+ events.addEventListener("job-error", onEnd as EventListener);
+ return () => events.close();
+ }, []);
+
+ const remove = async (e: React.MouseEvent, c: Clip) => {
+ e.preventDefault();
+ e.stopPropagation();
+ if (deleting || !window.confirm(`Delete "${c.title}"? This removes the rendered file too.`)) return;
+ setDeleting(c.id);
+ try {
+ await api(`/clips/${c.id}`, { method: "DELETE" });
+ setClips((prev) => prev.filter((x) => x.id !== c.id));
+ } catch {
+ // Keep the card; the SSE refresh will reconcile if it was actually removed.
+ } finally {
+ setDeleting(null);
+ }
+ };
+
+ const episodes = groupEpisodes(clips);
+
+ return (
+ <div className="app">
+ <div className="header">
+ <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
+ <h1 style={{ margin: 0 }}>Library</h1>
+ <Link to="/episode" className="btn btn-primary btn-sm" style={{ textDecoration: "none" }}>+ New episode</Link>
+ </div>
+ </div>
+
+ {exporting > 0 && (
+ <div className="set-note ok" style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 16 }}>
+ <div className="spinner sm" /> Exporting {exporting} clip{exporting > 1 ? "s" : ""} — they appear here as each finishes.
+ </div>
+ )}
+
+ {loading ? (
+ <div style={{ display: "flex", alignItems: "center", gap: 10, color: "var(--text2)" }}>
+ <div className="spinner sm" /> Loading…
+ </div>
+ ) : episodes.length === 0 ? (
+ <div className="drop-zone" style={{ textAlign: "center", padding: "48px 20px" }}>
+ <div className="icon" style={{ fontSize: 28 }}>🎬</div>
+ <div className="label" style={{ marginTop: 8 }}>
+ <Link to="/episode" style={{ color: "var(--accent)" }}>Start a new episode</Link>
+ </div>
+ </div>
+ ) : (
+ <div>
+ {episodes.map((ep) => (
+ <div key={ep.source} className="episode-block fade-in">
+ <div className="episode-head">
+ <h2>{ep.source}</h2>
+ <span className="sub">{ep.clips.length} · {timeAgo(ep.latest)}</span>
+ </div>
+ <div className="clip-grid">
+ {ep.clips.map((c) => {
+ const file = basename(c.output_path);
+ const thumb = c.thumbnail_config?.preview_path;
+ return (
+ <Link key={c.id} to={`/clip/${c.id}`} className="clip-card">
+ <button
+ className="clip-card-del"
+ title="Delete clip"
+ onClick={(e) => remove(e, c)}
+ disabled={deleting === c.id}
+ >
+ {deleting === c.id ? <div className="spinner sm" /> : <TrashIcon />}
+ </button>
+ {thumb ? (
+ <img className="clip-card-media" src={`/api/image?path=${encodeURIComponent(thumb)}`} alt="" />
+ ) : file ? (
+ <video className="clip-card-media" src={`/api/preview/${file}#t=0.1`} muted preload="metadata" playsInline />
+ ) : (
+ <div className="clip-card-media empty">▶</div>
+ )}
+ <div className="clip-card-body">
+ <div className="clip-card-title">{c.title}</div>
+ <div className="clip-card-meta">
+ {fmt(c.duration)} · {c.caption_style}{c.content_type ? ` · ${c.content_type}` : ""}
+ </div>
+ </div>
+ </Link>
+ );
+ })}
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/src/ui/client/ThumbnailTemplate.tsx b/src/ui/client/ThumbnailTemplate.tsx
new file mode 100644
index 0000000..b043a91
--- /dev/null
+++ b/src/ui/client/ThumbnailTemplate.tsx
@@ -0,0 +1,161 @@
+import React, { useEffect, useState } from "react";
+import { api, labelStyle } from "./lib";
+
+type Cfg = Record<string, any>;
+type FieldType = "color" | "num" | "text" | "bool" | "select";
+interface Field { k: string; t: FieldType; opts?: string[]; wide?: boolean }
+
+const GROUPS: { group: string; items: Field[] }[] = [
+ { group: "Canvas", items: [
+ { k: "enabled", t: "bool" }, { k: "width", t: "num" }, { k: "height", t: "num" },
+ { k: "bg_color", t: "color" },
+ { k: "font_family", t: "text", wide: true }, { k: "font_import_url", t: "text", wide: true },
+ ]},
+ { group: "Frame & box", items: [
+ { k: "frame_border_width", t: "num" },
+ { k: "box_x", t: "text" }, { k: "box_y", t: "text" },
+ { k: "box_width", t: "text" }, { k: "box_min_height", t: "text" },
+ { k: "box_border_width", t: "num" }, { k: "box_fill_color", t: "color" }, { k: "box_padding", t: "text" },
+ ]},
+ { group: "Headline — line 1", items: [
+ { k: "text_color", t: "color" }, { k: "line1_color", t: "color" },
+ { k: "line1_font_size", t: "text" }, { k: "line1_font_weight", t: "num" },
+ { k: "line1_letter_spacing", t: "text" }, { k: "line1_line_height", t: "num" },
+ { k: "line1_margin_bottom", t: "text" }, { k: "line1_uppercase", t: "bool" }, { k: "line1_nowrap", t: "bool" },
+ ]},
+ { group: "Highlight — line 2", items: [
+ { k: "accent_color", t: "color" }, { k: "line2_text_color", t: "color" },
+ { k: "line2_font_size", t: "text" }, { k: "line2_font_weight", t: "num" },
+ { k: "line2_font_style", t: "select", opts: ["italic", "normal"] },
+ { k: "line2_letter_spacing", t: "text" }, { k: "line2_line_height", t: "num" },
+ { k: "line2_uppercase", t: "bool" }, { k: "line2_highlight_padding", t: "text" },
+ ]},
+ { group: "Photo & gradient", items: [
+ { k: "photo_brightness", t: "num" }, { k: "photo_object_position", t: "text" },
+ { k: "gradient_top_height", t: "text" }, { k: "gradient_top_start_color", t: "color" }, { k: "gradient_top_end_color", t: "color" },
+ { k: "gradient_bottom_start", t: "text" }, { k: "gradient_bottom_end_color", t: "color" }, { k: "gradient_bottom_fade_point", t: "text" },
+ ]},
+ { group: "Logo", items: [
+ { k: "logo_position", t: "select", opts: ["bottom-center", "bottom-left", "bottom-right", "top-center", "top-left", "top-right"] },
+ { k: "logo_height", t: "text" }, { k: "logo_margin", t: "text" }, { k: "logo_opacity", t: "num" },
+ ]},
+ { group: "Variations", items: [
+ { k: "variations", t: "num" }, { k: "variation_offset_up", t: "text" }, { k: "variation_offset_down", t: "text" },
+ ]},
+];
+
+const KNOWN = new Set(GROUPS.flatMap((g) => g.items.map((i) => i.k)));
+const titleCase = (k: string) => k.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
+const isHex = (v: any) => typeof v === "string" && /^#[0-9a-fA-F]{6}$/.test(v);
+const px = (v: any, s: number, f = 0) => { const n = parseFloat(String(v ?? "").replace(/[^0-9.]/g, "")); return (Number.isFinite(n) ? n : f) * s; };
+const isPct = (v: any) => typeof v === "string" && v.trim().endsWith("%");
+const SCALE = 300 / 1080;
+
+function padToPreview(pad: any): string {
+ const parts = String(pad ?? "30px 45px").trim().split(/\s+/).map((p) => `${px(p, SCALE)}px`);
+ return parts.join(" ") || "8px 12px";
+}
+
+export default function ThumbnailTemplate() {
+ const [cfg, setCfg] = useState<Cfg | null>(null);
+ const [busy, setBusy] = useState(false);
+ const [msg, setMsg] = useState<string | null>(null);
+
+ useEffect(() => {
+ api("/thumbnail-config").then((d) => setCfg(d && typeof d === "object" ? d : {})).catch(() => setCfg({}));
+ }, []);
+
+ if (!cfg) return <div className="app"><div style={{ display: "flex", gap: 10, alignItems: "center", color: "var(--text2)", padding: 40 }}><div className="spinner sm" /> Loading…</div></div>;
+
+ const set = (k: string, v: any) => setCfg({ ...cfg, [k]: v });
+ const save = async () => {
+ setBusy(true); setMsg(null);
+ try {
+ const r = await api("/thumbnail-config", { method: "PUT", body: JSON.stringify(cfg) });
+ if (r.error) throw new Error(r.error);
+ setMsg("Saved — new thumbnails use this template");
+ } catch (e: any) { setMsg(`Save failed: ${e.message}`); } finally { setBusy(false); }
+ };
+
+ const field = (f: Field) => {
+ const v = cfg[f.k];
+ if (f.t === "bool") return (
+ <label key={f.k} style={{ display: "flex", alignItems: "center", gap: 8, fontSize: 12, color: "var(--text2)", paddingTop: 18 }}>
+ <input type="checkbox" checked={v !== false && v !== undefined ? !!v : false} onChange={(e) => set(f.k, e.target.checked)} /> {titleCase(f.k)}
+ </label>
+ );
+ return (
+ <div key={f.k} className={f.wide ? "full" : ""}>
+ <label style={labelStyle}>{titleCase(f.k)}</label>
+ {f.t === "color" ? (
+ <div className="thumb-swatch-row">
+ {isHex(v) && <input type="color" value={v} onChange={(e) => set(f.k, e.target.value)} />}
+ {!isHex(v) && <span style={{ width: 28, height: 28, borderRadius: 6, border: "1px solid var(--border)", background: v || "transparent", flexShrink: 0 }} />}
+ <input type="text" value={v ?? ""} onChange={(e) => set(f.k, e.target.value)} style={{ fontSize: 12, padding: "7px 10px", flex: 1, minWidth: 0, fontFamily: "var(--font-mono, monospace)" }} />
+ </div>
+ ) : f.t === "select" ? (
+ <select value={v ?? ""} onChange={(e) => set(f.k, e.target.value)}>{f.opts!.map((o) => <option key={o} value={o}>{o}</option>)}</select>
+ ) : (
+ <input type={f.t === "num" ? "number" : "text"} value={v ?? ""} step="any"
+ onChange={(e) => set(f.k, f.t === "num" ? (e.target.value === "" ? "" : Number(e.target.value)) : e.target.value)}
+ style={{ width: "100%", fontSize: 13, padding: "8px 11px" }} />
+ )}
+ </div>
+ );
+ };
+
+ const others = Object.keys(cfg).filter((k) => !KNOWN.has(k) && !k.startsWith("_"));
+
+ // ── Live preview ──
+ const bg = cfg.bg_color || "#0D0D0D";
+ const accent = cfg.accent_color || "#35C7C6";
+ const headline = cfg.line1_color || cfg.text_color || "#FFFFFF";
+ const boxTop = isPct(cfg.box_y) ? cfg.box_y : "75%";
+
+ return (
+ <div className="app">
+ <div className="header"><h1>Thumbnail template</h1></div>
+
+ <div className="tmpl-layout">
+ <div className="tmpl-preview">
+ <label style={labelStyle}>Preview</label>
+ <div className="thumb-stage" style={{ background: bg, border: `${px(cfg.frame_border_width, SCALE, 3)}px solid ${accent}` }}>
+ <div style={{ position: "absolute", inset: 0, background: `linear-gradient(to top, ${cfg.gradient_bottom_end_color || bg} 0%, transparent 50%)` }} />
+ <div style={{
+ position: "absolute", left: `${px(cfg.box_x, SCALE, 55)}px`, right: `${px(cfg.box_x, SCALE, 55)}px`, top: boxTop,
+ background: cfg.box_fill_color || "rgba(13,13,13,0.85)",
+ border: `${px(cfg.box_border_width, SCALE, 3)}px solid ${accent}`, padding: padToPreview(cfg.box_padding),
+ textAlign: "center",
+ }}>
+ <div style={{ fontSize: px(cfg.line1_font_size, SCALE, 74), fontWeight: Number(cfg.line1_font_weight) || 700, color: headline, textTransform: cfg.line1_uppercase !== false ? "uppercase" : "none", lineHeight: Number(cfg.line1_line_height) || 1.15, letterSpacing: px(cfg.line1_letter_spacing, SCALE, 2), marginBottom: px(cfg.line1_margin_bottom, SCALE, 10) }}>
+ Intelligence is now
+ </div>
+ <span style={{ fontSize: px(cfg.line2_font_size, SCALE, 70), fontWeight: Number(cfg.line2_font_weight) || 600, fontStyle: (cfg.line2_font_style || "italic") === "italic" ? "italic" : "normal", background: accent, color: cfg.line2_text_color || "#0D0D0D", padding: padToPreview(cfg.line2_highlight_padding || "6px 20px"), textTransform: cfg.line2_uppercase !== false ? "uppercase" : "none", letterSpacing: px(cfg.line2_letter_spacing, SCALE, 1), display: "inline-block", lineHeight: Number(cfg.line2_line_height) || 1.15 }}>
+ a commodity
+ </span>
+ </div>
+ </div>
+ <div style={{ marginTop: 16 }}>
+ <button className="btn btn-primary btn-sm" onClick={save} disabled={busy}>{busy ? <div className="spinner sm" /> : "Save template"}</button>
+ </div>
+ {msg && <div className="set-note ok" style={{ marginTop: 12 }}>{msg}</div>}
+ </div>
+
+ <div className="tmpl-fields">
+ {GROUPS.map((g) => (
+ <div key={g.group} className="section">
+ <div className="section-label">{g.group}</div>
+ <div className="thumb-fields">{g.items.map(field)}</div>
+ </div>
+ ))}
+ {others.length > 0 && (
+ <div className="section">
+ <div className="section-label">Other</div>
+ <div className="thumb-fields">{others.map((k) => field({ k, t: typeof cfg[k] === "number" ? "num" : "text" }))}</div>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/src/ui/client/icons.tsx b/src/ui/client/icons.tsx
new file mode 100644
index 0000000..678ef12
--- /dev/null
+++ b/src/ui/client/icons.tsx
@@ -0,0 +1,19 @@
+import React from "react";
+
+function Svg({ children, size = 15 }: { children: React.ReactNode; size?: number }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
+ strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" style={{ display: "block" }}>
+ {children}
+ </svg>
+ );
+}
+
+export const PlayIcon = () => <Svg><path d="M7 4.5v15l12-7.5z" fill="currentColor" stroke="none" /></Svg>;
+export const PauseIcon = () => <Svg><path d="M8 4v16M16 4v16" /></Svg>;
+export const FrameBackIcon = () => <Svg><path d="M15 6l-6 6 6 6" /></Svg>;
+export const FrameForwardIcon = () => <Svg><path d="M9 6l6 6-6 6" /></Svg>;
+export const CutBackIcon = () => <Svg><path d="M18 5v14l-9-7z" fill="currentColor" stroke="none" /><path d="M6 5v14" /></Svg>;
+export const CutForwardIcon = () => <Svg><path d="M6 5v14l9-7z" fill="currentColor" stroke="none" /><path d="M18 5v14" /></Svg>;
+export const CloseIcon = () => <Svg><path d="M6 6l12 12M18 6L6 18" /></Svg>;
+export const TrashIcon = ({ size = 14 }: { size?: number }) => <Svg size={size}><path d="M4 7h16M10 11v6M14 11v6M5 7l1 13h12l1-13M9 7V4h6v3" /></Svg>;
diff --git a/src/ui/client/index.html b/src/ui/client/index.html
new file mode 100644
index 0000000..07b0455
--- /dev/null
+++ b/src/ui/client/index.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Podcli — AI Podcast Clip Studio</title>
+ <meta name="robots" content="noindex,nofollow">
+ <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
+ <meta name="color-scheme" content="dark light">
+ <link rel="icon" type="image/png" href="/podcli-icon.png">
+ <link rel="apple-touch-icon" href="/podcli-icon.png">
+ <link rel="preconnect" href="https://fonts.googleapis.com">
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link
+ href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700;800&display=swap"
+ rel="stylesheet">
+ <link rel="stylesheet" href="/css/styles.css">
+</head>
+
+<body>
+ <div id="root"></div>
+ <script type="module" src="/main.tsx"></script>
+</body>
+
+</html>
diff --git a/src/ui/client/lib.ts b/src/ui/client/lib.ts
new file mode 100644
index 0000000..2c0ab08
--- /dev/null
+++ b/src/ui/client/lib.ts
@@ -0,0 +1,75 @@
+import type { CSSProperties } from "react";
+
+export const fmt = (s: number) =>
+ `${Math.floor(s / 60)}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
+
+export const fmtMs = (s: number) =>
+ `${fmt(s)}.${String(Math.floor((s % 1) * 1000)).padStart(3, "0")}`;
+
+export const labelStyle: CSSProperties = {
+ fontSize: 11,
+ fontWeight: 700,
+ letterSpacing: "0.5px",
+ textTransform: "uppercase",
+ color: "var(--text2)",
+ marginBottom: 8,
+ display: "block",
+};
+
+export class ApiError extends Error {
+ constructor(
+ message: string,
+ readonly status: number,
+ ) {
+ super(message);
+ this.name = "ApiError";
+ }
+}
+
+async function request<T>(path: string, opts: RequestInit, jsonHeaders: boolean): Promise<T> {
+ const res = await fetch(`/api${path}`, {
+ ...opts,
+ headers: jsonHeaders
+ ? { "Content-Type": "application/json", ...(opts.headers || {}) }
+ : opts.headers,
+ });
+
+ const text = await res.text();
+ let body: any = undefined;
+ if (text) {
+ try {
+ body = JSON.parse(text);
+ } catch {
+ body = text;
+ }
+ }
+
+ if (!res.ok || (body && typeof body === "object" && body.error)) {
+ const msg =
+ (typeof body === "string" && body) ||
+ (body && (body.error || body.message)) ||
+ `HTTP ${res.status}`;
+ throw new ApiError(String(msg), res.status);
+ }
+ return body as T;
+}
+
+/** JSON request against /api. Throws ApiError on non-2xx or `{ error }` bodies. */
+export function api<T = any>(path: string, opts: RequestInit = {}): Promise<T> {
+ return request<T>(path, opts, true);
+}
+
+/** Multipart upload (FormData body); skips the JSON content-type header. */
+export function upload<T = any>(path: string, form: FormData): Promise<T> {
+ return request<T>(path, { method: "POST", body: form }, false);
+}
+
+export function timeAgo(iso: string): string {
+ const ms = Date.now() - new Date(iso).getTime();
+ const h = ms / 3_600_000;
+ if (h < 1) return `${Math.max(1, Math.round(h * 60))}m ago`;
+ if (h < 24) return `${Math.round(h)}h ago`;
+ return new Date(iso).toLocaleDateString();
+}
+
+export const basename = (p: string) => (p || "").split("/").pop() || "";
diff --git a/src/ui/client/main.tsx b/src/ui/client/main.tsx
new file mode 100644
index 0000000..77e2f62
--- /dev/null
+++ b/src/ui/client/main.tsx
@@ -0,0 +1,33 @@
+import React from "react";
+import { createRoot } from "react-dom/client";
+import { BrowserRouter, Routes, Route } from "react-router-dom";
+import Layout from "./Layout";
+import StudioHome from "./StudioHome";
+import ClipDetail from "./ClipDetail";
+import EpisodeWorkspace from "./EpisodeWorkspace";
+import ThumbnailTemplate from "./ThumbnailTemplate";
+import AnalyticsPage from "./AnalyticsPage";
+import KnowledgePage from "./KnowledgePage";
+import ConfigPage from "./ConfigPage";
+import IntegrationsPage from "./IntegrationsPage";
+import McpSetupPage from "./McpSetupPage";
+
+createRoot(document.getElementById("root")!).render(
+ <React.StrictMode>
+ <BrowserRouter>
+ <Routes>
+ <Route element={<Layout />}>
+ <Route path="/" element={<StudioHome />} />
+ <Route path="/episode" element={<EpisodeWorkspace />} />
+ <Route path="/thumbnail" element={<ThumbnailTemplate />} />
+ <Route path="/clip/:id" element={<ClipDetail />} />
+ <Route path="/knowledge" element={<KnowledgePage />} />
+ <Route path="/config" element={<ConfigPage />} />
+ <Route path="/integrations" element={<IntegrationsPage />} />
+ <Route path="/mcp" element={<McpSetupPage />} />
+ <Route path="/analytics" element={<AnalyticsPage />} />
+ </Route>
+ </Routes>
+ </BrowserRouter>
+ </React.StrictMode>,
+);
diff --git a/src/ui/client/tsconfig.json b/src/ui/client/tsconfig.json
new file mode 100644
index 0000000..551d05e
--- /dev/null
+++ b/src/ui/client/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "jsx": "react-jsx",
+ "allowJs": true,
+ "checkJs": false,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "resolveJsonModule": true,
+ "allowImportingTsExtensions": true
+ },
+ "include": ["."]
+}
diff --git a/src/ui/client/vite.config.ts b/src/ui/client/vite.config.ts
new file mode 100644
index 0000000..61b2de4
--- /dev/null
+++ b/src/ui/client/vite.config.ts
@@ -0,0 +1,22 @@
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+import { fileURLToPath } from "node:url";
+import { dirname, resolve } from "node:path";
+
+const here = dirname(fileURLToPath(import.meta.url));
+
+export default defineConfig({
+ root: here,
+ plugins: [react()],
+ publicDir: resolve(here, "../public"),
+ build: {
+ outDir: resolve(here, "../../../dist/ui/public"),
+ emptyOutDir: true,
+ },
+ server: {
+ port: 5173,
+ proxy: {
+ "/api": "http://localhost:3847",
+ },
+ },
+});
diff --git a/src/ui/public/config.html b/src/ui/public/config.html
deleted file mode 100644
index 12dc336..0000000
--- a/src/ui/public/config.html
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Podcli — Config profiles</title>
- <meta name="robots" content="noindex,nofollow" />
- <link rel="icon" type="image/png" href="/podcli-icon.png" />
- <link rel="preconnect" href="https://fonts.googleapis.com" />
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
- <link
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="css/styles.css" />
- <style>
- .app { max-width: 720px; }
- .header { margin-bottom: 28px; }
- .panel {
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 12px;
- padding: 20px 22px;
- background: rgba(255, 255, 255, 0.02);
- margin-bottom: 16px;
- }
- @media (prefers-color-scheme: light) {
- .panel { border-color: rgba(0,0,0,0.08); background: rgba(0,0,0,0.02); }
- }
- .row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
- .row label { font-size: 12px; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.04em; }
- .row code, .mono {
- font-family: "JetBrains Mono", monospace;
- font-size: 13px;
- word-break: break-all;
- }
- .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
- .btn {
- font: inherit;
- font-size: 14px;
- font-weight: 600;
- padding: 10px 16px;
- border-radius: 8px;
- border: 1px solid rgba(255,255,255,0.15);
- background: rgba(255,255,255,0.06);
- color: inherit;
- cursor: pointer;
- }
- .btn:hover { border-color: rgba(255,255,255,0.3); }
- .btn-primary { background: rgba(212, 135, 74, 0.25); border-color: rgba(212, 135, 74, 0.5); }
- .btn:disabled { opacity: 0.45; cursor: not-allowed; }
- .status { font-size: 14px; opacity: 0.8; line-height: 1.5; }
- .msg { margin-top: 12px; font-size: 13px; padding: 10px 12px; border-radius: 8px; }
- .msg.ok { background: rgba(74, 222, 128, 0.12); }
- .msg.err { background: rgba(255, 100, 100, 0.12); }
- input[type="file"] { font-size: 13px; }
- .footer-note { margin-top: 20px; font-size: 13px; opacity: 0.55; line-height: 1.5; }
- </style>
-</head>
-<body>
- <div class="app fade-in">
- <div class="nav">
- <a href="/"><img src="/podcli-logo-transparent.png" alt="podcli" style="height:22px"></a>
- <a href="/" class="nav-link">Back to app</a>
- <a href="/integrations.html" class="nav-link">Integrations</a>
- <a href="/integration.html" class="nav-link">MCP setup</a>
- </div>
-
- <div class="header">
- <h1>Config profiles</h1>
- <p>Export or import your show settings (knowledge, presets, assets, corrections). Cache and rendered clips stay on this machine.</p>
- </div>
-
- <div class="panel" id="status-panel">
- <div class="status">Loading…</div>
- </div>
-
- <div class="panel">
- <h2 style="margin:0 0 12px 0;font-size:16px;">Actions</h2>
- <div class="actions">
- <button type="button" class="btn" id="btn-migrate">Run path migration</button>
- <button type="button" class="btn btn-primary" id="btn-export">Download profile (.zip)</button>
- </div>
- <div class="row" style="margin-top:16px;">
- <label>Import profile bundle</label>
- <input type="file" id="import-file" accept=".zip,application/zip" />
- <label style="text-transform:none;letter-spacing:0;display:flex;align-items:center;gap:8px;margin-top:6px;">
- <input type="checkbox" id="import-activate" />
- Set imported folder as active config home
- </label>
- <button type="button" class="btn" id="btn-import" disabled>Import bundle</button>
- </div>
- <div id="msg"></div>
- </div>
-
- <p class="footer-note">
- CLI: <code>podcli config export ~/backup.zip</code> ·
- <code>podcli config import ~/backup.zip --activate</code> ·
- MCP: <code>manage_config</code>
- </p>
- </div>
-
- <script>
- const statusPanel = document.getElementById("status-panel");
- const msgEl = document.getElementById("msg");
- const importFile = document.getElementById("import-file");
- const btnImport = document.getElementById("btn-import");
-
- function escapeHtml(s) {
- return String(s).replace(/[&<>"']/g, c => ({
- "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;"
- }[c]));
- }
-
- function showMsg(text, ok) {
- msgEl.className = "msg " + (ok ? "ok" : "err");
- msgEl.textContent = text;
- }
-
- async function loadStatus() {
- const resp = await fetch("/api/config/status");
- if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
- const data = await resp.json();
- const m = data.migration || {};
- statusPanel.innerHTML = `
- <div class="row"><label>Config home</label><code>${escapeHtml(data.home || "")}</code></div>
- <div class="row"><label>Data / cache</label><code>${escapeHtml(data.cache || "")}</code></div>
- <div class="row"><label>Profile marker</label><code>${escapeHtml(data.profile_marker || "")}</code></div>
- <div class="row"><label>Migration</label><span class="mono">${m.already_migrated ? "Up to date" : "Ran on load"}</span></div>
- `;
- }
-
- document.getElementById("btn-migrate").addEventListener("click", async () => {
- showMsg("Migrating…", true);
- try {
- const resp = await fetch("/api/config/migrate", { method: "POST" });
- const data = await resp.json();
- if (!resp.ok) throw new Error(data.error || `HTTP ${resp.status}`);
- showMsg(`Done. Moved ${data.moved_json || 0} cache file(s).`, true);
- await loadStatus();
- } catch (e) {
- showMsg(e.message, false);
- }
- });
-
- document.getElementById("btn-export").addEventListener("click", () => {
- window.location.href = "/api/config/export";
- });
-
- importFile.addEventListener("change", () => {
- btnImport.disabled = !importFile.files?.length;
- });
-
- btnImport.addEventListener("click", async () => {
- const file = importFile.files?.[0];
- if (!file) return;
- const fd = new FormData();
- fd.append("bundle", file);
- fd.append("activate", document.getElementById("import-activate").checked ? "1" : "0");
- showMsg("Importing…", true);
- btnImport.disabled = true;
- try {
- const resp = await fetch("/api/config/import", { method: "POST", body: fd });
- const data = await resp.json();
- if (!resp.ok) throw new Error(data.error || `HTTP ${resp.status}`);
- let text = `Imported into ${data.home}`;
- if (data.backup) text += `. Backup: ${data.backup}`;
- showMsg(text, true);
- await loadStatus();
- } catch (e) {
- showMsg(e.message, false);
- } finally {
- btnImport.disabled = !importFile.files?.length;
- }
- });
-
- loadStatus().catch(e => {
- statusPanel.innerHTML = `<div class="msg err">${escapeHtml(e.message)}</div>`;
- });
- </script>
-</body>
-</html>
diff --git a/src/ui/public/css/styles.css b/src/ui/public/css/styles.css
index c55c59d..2fb3e66 100644
--- a/src/ui/public/css/styles.css
+++ b/src/ui/public/css/styles.css
@@ -25,6 +25,7 @@
--radius: 12px;
--radius-sm: 8px;
--ease: cubic-bezier(0.4, 0, 0.2, 1);
+ --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
@@ -381,7 +382,8 @@ select {
.btn {
padding: 10px 18px; border-radius: var(--radius); font-family: inherit;
font-size: 13px; font-weight: 600; cursor: pointer; border: none;
- transition: all 0.15s var(--ease); display: inline-flex;
+ transition: transform 0.12s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
+ display: inline-flex;
align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
@@ -390,6 +392,8 @@ select {
.btn-primary:disabled { opacity: 0.25; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
+.btn-danger { background: transparent; color: var(--text3); border: 1px solid var(--border); }
+.btn-danger:hover:not(:disabled) { border-color: var(--red-border); color: var(--red); background: var(--red-subtle); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-go {
width: 100%; padding: 14px; font-size: 15px; justify-content: center;
@@ -933,3 +937,189 @@ input[type="range"]::-webkit-slider-thumb {
.app { padding: 28px 16px 64px; }
.file-grid { grid-template-columns: 1fr; }
}
+
+/* ── Dashboard shell ── */
+.shell { display: flex; min-height: 100vh; }
+.sidebar {
+ width: 232px; flex-shrink: 0; box-sizing: border-box;
+ border-right: 1px solid var(--border); background: var(--surface);
+ padding: 22px 14px; position: sticky; top: 0; height: 100vh;
+ display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
+}
+.sidebar-logo { display: flex; align-items: center; padding: 4px 8px 18px; }
+.sidebar-logo img { height: 22px; }
+.sidebar-section { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); padding: 16px 12px 6px; }
+.sidebar-link {
+ display: flex; align-items: center; gap: 10px; padding: 9px 12px;
+ border-radius: var(--radius-sm); color: var(--text2);
+ text-decoration: none; font-size: 13px; font-weight: 600;
+ transition: background 0.12s, color 0.12s;
+}
+.sidebar-link:hover { background: var(--surface2); color: var(--text); }
+.sidebar-link.active { background: var(--accent-subtle); color: var(--accent); }
+.sidebar-link .ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
+.sidebar-link.disabled { opacity: 0.4; pointer-events: none; }
+.sidebar-link .soon { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
+.shell-main { flex: 1; min-width: 0; }
+.shell-main .app { margin: 0; max-width: 1080px; }
+@media (max-width: 820px) {
+ .shell { flex-direction: column; }
+ .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
+ .sidebar-logo { padding: 4px 8px; }
+ .sidebar-section { display: none; }
+}
+
+/* ── Custom clip player ── */
+.clip-player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; width: 100%; }
+.clip-player video { display: block; width: 100%; height: auto; cursor: pointer; }
+.clip-player-bar {
+ position: absolute; left: 0; right: 0; bottom: 0;
+ display: flex; align-items: center; gap: 10px; padding: 10px 12px;
+ background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
+ opacity: 0; transition: opacity 0.18s;
+}
+.clip-player:hover .clip-player-bar, .clip-player.paused .clip-player-bar { opacity: 1; }
+.clip-player-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; display: flex; }
+.clip-player-time { color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
+.clip-player-track { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.25); cursor: pointer; position: relative; }
+.clip-player-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }
+
+/* ── Thumbnail editor ── */
+.thumb-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; background: var(--bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
+.thumb-stage img { width: 100%; height: 100%; object-fit: cover; }
+.thumb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
+.thumb-fields .full { grid-column: 1 / -1; }
+.thumb-swatch-row { display: flex; align-items: center; gap: 8px; }
+.thumb-swatch-row input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
+
+/* ── Library card grid ── */
+.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
+.clip-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: border-color 0.12s, transform 0.12s; }
+.clip-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
+.clip-card-del { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.12s var(--ease), background 0.12s var(--ease); }
+.clip-card:hover .clip-card-del { opacity: 1; }
+.clip-card-del:hover:not(:disabled) { background: var(--red); }
+.clip-card-del:disabled { opacity: 0.4; cursor: default; }
+.clip-card-media { aspect-ratio: 9 / 16; width: 100%; display: block; object-fit: cover; background: #000; }
+.clip-card-media.empty { display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 22px; }
+.clip-card-body { padding: 10px 11px; }
+.clip-card-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
+.clip-card-meta { font-size: 10.5px; color: var(--text3); margin-top: 5px; }
+.episode-block + .episode-block { margin-top: 22px; }
+.episode-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
+.episode-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
+.episode-head .sub { font-size: 11px; color: var(--text3); }
+
+/* ── Settings pages (Config / Integrations / MCP) ── */
+.set-kv { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); }
+.set-kv:last-child { border-bottom: none; }
+.set-kv .k { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text2); }
+.set-kv .v { font-family: var(--font-mono, monospace); font-size: 13px; color: var(--text); word-break: break-all; }
+.set-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
+.set-note { margin-top: 14px; font-size: 12px; padding: 10px 12px; border-radius: var(--radius-sm); }
+.set-note.ok { background: var(--green-subtle); color: var(--green); }
+.set-note.err { background: var(--red-subtle); color: var(--red); }
+.set-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
+.int-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
+.int-row:last-child { border-bottom: none; }
+.int-row .name { font-size: 14px; font-weight: 600; }
+.int-row .desc { font-size: 12px; color: var(--text2); margin-top: 2px; }
+
+/* ── Code block (MCP setup) ── */
+.code-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 10px; }
+.code-block-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text2); font-family: var(--font-mono, monospace); }
+.code-block pre { margin: 0; padding: 13px 14px; font-family: var(--font-mono, monospace); font-size: 12.5px; line-height: 1.6; color: var(--text); overflow-x: auto; white-space: pre; }
+
+/* ── Thumbnail variations ── */
+.thumb-variations { display: flex; gap: 8px; margin-top: 12px; }
+.thumb-variation { flex: 1; aspect-ratio: 9 / 16; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; background: #000; cursor: pointer; padding: 0; }
+.thumb-variation.selected { border-color: var(--accent); }
+.thumb-variation img { width: 100%; height: 100%; object-fit: cover; display: block; }
+
+/* ── Clip detail layout ── */
+.clip-media { display: flex; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
+.clip-media-col { width: 300px; flex-shrink: 0; }
+.clip-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
+.clip-controls .section { margin: 0; }
+
+/* ── Thumbnail template editor ── */
+.tmpl-layout { display: flex; gap: 28px; align-items: flex-start; }
+.tmpl-preview { width: 300px; flex-shrink: 0; position: sticky; top: 24px; }
+.tmpl-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
+@media (max-width: 900px) { .tmpl-layout { flex-direction: column; } .tmpl-preview { position: static; } }
+
+/* ── Motion layer (respects reduced-motion) ── */
+@media (prefers-reduced-motion: no-preference) {
+ @keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
+ @keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
+ @keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
+
+ .shell-main > * { animation: pageIn 0.24s var(--ease-out) both; }
+
+ .reframe-overlay { animation: pageIn 0.16s var(--ease-out) both; }
+ .reframe-modal { animation: modalIn 0.2s var(--ease-out) both; }
+ @keyframes modalIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
+
+ .clip-grid .clip-card { animation: cardIn 0.28s var(--ease-out) both; }
+ .clip-grid .clip-card:nth-child(1) { animation-delay: 0.02s; }
+ .clip-grid .clip-card:nth-child(2) { animation-delay: 0.05s; }
+ .clip-grid .clip-card:nth-child(3) { animation-delay: 0.08s; }
+ .clip-grid .clip-card:nth-child(4) { animation-delay: 0.11s; }
+ .clip-grid .clip-card:nth-child(5) { animation-delay: 0.14s; }
+ .clip-grid .clip-card:nth-child(6) { animation-delay: 0.17s; }
+ .clip-grid .clip-card:nth-child(n+7) { animation-delay: 0.2s; }
+
+ .clip-controls .section, .tmpl-fields .section { animation: riseIn 0.26s var(--ease-out) both; }
+ .clip-controls .section:nth-child(2) { animation-delay: 0.05s; }
+ .clip-controls .section:nth-child(3) { animation-delay: 0.1s; }
+ .clip-controls .section:nth-child(4) { animation-delay: 0.15s; }
+
+ .thumb-variation { transition: border-color 0.15s var(--ease), transform 0.12s var(--ease); }
+ .thumb-variation:hover { transform: translateY(-2px); }
+ .thumb-stage img, .clip-card-media { transition: opacity 0.3s var(--ease); }
+ .sidebar-link { transition: background 0.14s var(--ease), color 0.14s var(--ease), padding-left 0.14s var(--ease); }
+ .sidebar-link:hover { padding-left: 15px; }
+ .set-note { animation: riseIn 0.25s var(--ease) both; }
+}
+
+/* ── Polish: balanced headings, image outlines, tabular figures ── */
+h1, h2, h3 { text-wrap: balance; }
+.clip-card-media, .thumb-stage img, .thumb-variation img { outline: 1px solid rgba(255, 255, 255, 0.1); outline-offset: -1px; }
+.clip-card-meta, .clip-meta span, .clip-card-title { font-variant-numeric: tabular-nums; }
+
+/* ── Clip detail (player hero + editor) ── */
+.clip-detail { display: flex; gap: 28px; align-items: flex-start; }
+.clip-detail-player { width: 330px; flex-shrink: 0; position: sticky; top: 24px; }
+.clip-detail-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
+.clip-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
+.clip-meta span { font-size: 11px; color: var(--text2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
+.thumb-edit { display: flex; gap: 14px; align-items: flex-start; }
+.thumb-edit-preview { width: 150px; flex-shrink: 0; }
+.thumb-edit-controls { flex: 1; min-width: 0; }
+@media (max-width: 820px) { .clip-detail { flex-direction: column; } .clip-detail-player { position: static; width: 100%; max-width: 330px; } }
+
+/* ── Reframe editor ── */
+.reframe-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
+.reframe-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; width: min(560px, 95vw); max-height: 92vh; overflow: auto; }
+.reframe-stage { position: relative; width: 100%; background: #000; border-radius: var(--radius-sm); overflow: hidden; user-select: none; touch-action: none; cursor: ew-resize; }
+.reframe-stage video { width: 100%; display: block; }
+.reframe-box { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); pointer-events: none; }
+
+/* ── Reframe timeline ── */
+.rf-track { position: relative; height: 30px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; margin-top: 12px; overflow: hidden; }
+.rf-kf { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--green); transform: translateX(-1px); pointer-events: none; }
+.rf-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; box-shadow: 0 0 6px var(--accent); }
+
+/* ── Reframe trim region/handles ── */
+.rf-region { position: absolute; top: 0; bottom: 0; background: var(--accent-subtle); pointer-events: none; }
+.rf-handle { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--accent); transform: translateX(-1px); pointer-events: none; }
+
+/* ── Reframe timeline polish (grabbable handles) ── */
+.rf-track { height: 44px; }
+.rf-handle { width: 10px; border-radius: 4px; top: -3px; bottom: -3px; transform: translateX(-5px); cursor: ew-resize; box-shadow: 0 0 0 1px rgba(0,0,0,0.45); z-index: 2; }
+.rf-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 2px; height: 16px; background: rgba(0,0,0,0.4); transform: translate(-50%,-50%); border-radius: 1px; }
+.rf-track:hover .rf-handle { box-shadow: 0 0 0 1px var(--accent-glow); }
+.rf-playhead { z-index: 3; }
+
+/* ── Reframe: camera-switch (cut) markers ── */
+.rf-cut { position: absolute; top: 0; bottom: 0; width: 2px; background: #facc15; opacity: 0.75; transform: translateX(-1px); pointer-events: none; }
diff --git a/src/ui/public/integration.html b/src/ui/public/integration.html
deleted file mode 100644
index c671ba5..0000000
--- a/src/ui/public/integration.html
+++ /dev/null
@@ -1,246 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>Podcli - MCP Integration</title>
- <meta name="description" content="Wire Podcli into Claude Code, Claude Desktop, Cursor, or any MCP-compatible client. Copy the config snippet for your tool of choice.">
- <meta name="author" content="Podcli">
- <meta name="application-name" content="Podcli">
- <meta name="robots" content="noindex,nofollow">
- <meta name="referrer" content="strict-origin-when-cross-origin">
- <meta name="format-detection" content="telephone=no">
-
- <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
- <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
- <meta name="color-scheme" content="dark light">
-
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="Podcli">
- <meta property="og:title" content="Podcli - MCP Integration">
- <meta property="og:description" content="Wire Podcli into Claude Code, Claude Desktop, Cursor, or any MCP-compatible client.">
- <meta property="og:image" content="/podcli-logo-transparent.png">
-
- <link rel="icon" type="image/png" href="/podcli-icon.png">
- <link rel="apple-touch-icon" href="/podcli-icon.png">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-title" content="Podcli">
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap"
- rel="stylesheet">
- <link rel="stylesheet" href="css/styles.css">
- <style>
- .app {
- max-width: 780px;
- }
-
- .header {
- margin-bottom: 40px;
- }
- </style>
-</head>
-
-<body>
- <div class="app fade-in">
-
- <!-- Nav -->
- <div class="nav">
- <a href="/"><img src="/podcli-logo-transparent.png" alt="podcli" style="height:22px"></a>
- <a href="/" class="nav-link">Back to app</a>
- <a href="/integrations.html" class="nav-link">Output integrations</a>
- <a href="/config.html" class="nav-link">Config profiles</a>
- </div>
-
- <!-- Header -->
- <div class="header">
- <h1>MCP Integration</h1>
- <p class="subtitle">Connect podcli to Claude Desktop, Claude Code, or any MCP-compatible client to generate clips
- through conversation.</p>
- </div>
-
- <!-- Connection Status -->
- <div id="status-bar" class="status-bar warn">
- <div class="status-dot"></div>
- <span id="status-text">Checking connection...</span>
- </div>
-
- <!-- Setup: Claude Desktop -->
- <div class="card">
- <div class="card-label">Setup</div>
- <div class="card-title">Claude Desktop</div>
- <div class="card-desc">
- Add podcli as an MCP server in your Claude Desktop configuration file. Claude will gain access to transcription,
- clip suggestion, and rendering tools.
- </div>
-
- <div class="steps">
- <div class="step">
- <div class="step-title">Open your config file</div>
- <div class="step-desc">
- macOS: <code>~/Library/Application Support/Claude/claude_desktop_config.json</code><br>
- Windows: <code>%APPDATA%\Claude\claude_desktop_config.json</code>
- </div>
- </div>
- <div class="step">
- <div class="step-title">Add the podcli server entry</div>
- <div class="step-desc">Paste this into the <code>mcpServers</code> object:</div>
- </div>
- </div>
-
- <div class="code-block" style="margin-bottom:16px">
- <div class="code-header">
- <span class="code-filename">claude_desktop_config.json</span>
- <button class="copy-btn" onclick="copyBlock(this, 'desktop-config')">Copy</button>
- </div>
- <pre id="desktop-config"><span class="punct">{</span>
- <span class="key">"mcpServers"</span><span class="punct">:</span> <span class="punct">{</span>
- <span class="key">"podcli"</span><span class="punct">:</span> <span class="punct">{</span>
- <span class="key">"command"</span><span class="punct">:</span> <span class="str">"node"</span><span class="punct">,</span>
- <span class="key">"args"</span><span class="punct">:</span> <span class="punct">[</span><span class="str" id="desktop-dist-path">"<span class="comment">loading...</span>"</span><span class="punct">]</span>
- <span class="punct">}</span>
- <span class="punct">}</span>
-<span class="punct">}</span></pre>
- </div>
-
- <div class="step" style="padding-left:40px; counter-increment: step;">
- <div class="step-title">Restart Claude Desktop</div>
- <div class="step-desc">After saving, restart the app. You should see podcli listed in the MCP tools panel.</div>
- </div>
- </div>
-
- <!-- Setup: Claude Code -->
- <div class="card">
- <div class="card-title">Claude Code (CLI)</div>
- <div class="card-desc">
- Add podcli as an MCP server in your Claude Code project or global settings.
- </div>
-
- <div class="steps">
- <div class="step">
- <div class="step-title">Run this command in your terminal</div>
- <div class="step-desc">This registers podcli as an MCP server for the current project scope:</div>
- </div>
- </div>
-
- <div class="code-block">
- <div class="code-header">
- <span class="code-filename">terminal</span>
- <button class="copy-btn" onclick="copyBlock(this, 'code-config')">Copy</button>
- </div>
- <pre id="code-config"><span id="code-cmd-text"><span class="comment"># loading path...</span></span></pre>
- </div>
- </div>
-
- <div class="divider"></div>
-
- <!-- Available Tools -->
- <div class="card">
- <div class="card-label">Reference</div>
- <div class="card-title">Available MCP Tools</div>
- <div class="card-desc">These tools become available to Claude after connecting.</div>
-
- <div class="tool-grid">
- <div class="tool-item">
- <span class="tool-name">transcribe_podcast</span>
- <span class="tool-desc">Transcribe audio/video with Whisper. Supports model size selection, language
- detection, and speaker diarization.</span>
- </div>
- <div class="tool-item">
- <span class="tool-name">suggest_clips</span>
- <span class="tool-desc">Submit an array of viral moment suggestions with title, time range, and reasoning.
- Used by Claude to pass clip ideas.</span>
- </div>
- <div class="tool-item">
- <span class="tool-name">create_clip</span>
- <span class="tool-desc">Render a single short-form clip with caption style, crop strategy, and optional logo
- overlay.</span>
- </div>
- <div class="tool-item">
- <span class="tool-name">batch_create_clips</span>
- <span class="tool-desc">Render multiple clips in one call. Each clip can have its own caption style and crop
- settings.</span>
- </div>
- </div>
- </div>
-
- <!-- Example Prompts -->
- <div class="card">
- <div class="card-title">Example Prompts</div>
- <div class="card-desc">Try these with Claude after connecting:</div>
-
- <div class="tool-grid">
- <div class="tool-item" style="cursor:default;">
- <span class="tool-desc" style="color:var(--text);"><em>"Transcribe /path/to/episode.mp4 and find the 5 most
- viral moments, then export them with hormozi captions"</em></span>
- </div>
- <div class="tool-item" style="cursor:default;">
- <span class="tool-desc" style="color:var(--text);"><em>"Create a 30-second clip from 12:45 to 13:15 with
- branded captions and face-tracking crop"</em></span>
- </div>
- <div class="tool-item" style="cursor:default;">
- <span class="tool-desc" style="color:var(--text);"><em>"Batch export all suggested clips with karaoke-style
- captions"</em></span>
- </div>
- </div>
- </div>
-
- </div>
-
- <script>
- // Resolve the dist path and populate config blocks
- async function init() {
- try {
- const resp = await fetch('/api/integration-info');
- const data = await resp.json();
-
- // Desktop config
- const distEl = document.getElementById('desktop-dist-path');
- if (distEl) distEl.textContent = `"${data.dist_path}"`;
-
- // Claude Code command
- const codeEl = document.getElementById('code-cmd-text');
- if (codeEl) {
- codeEl.innerHTML = `claude mcp add podcli node ${escapeHtml(data.dist_path)}`;
- }
-
- // Status
- const bar = document.getElementById('status-bar');
- const txt = document.getElementById('status-text');
- if (data.server_ok) {
- bar.className = 'status-bar ok';
- txt.textContent = `Server running - ${data.tools_count} tools available`;
- } else {
- bar.className = 'status-bar err';
- txt.textContent = 'Server not built. Run: npm run build';
- }
- } catch (e) {
- const bar = document.getElementById('status-bar');
- const txt = document.getElementById('status-text');
- bar.className = 'status-bar err';
- txt.textContent = 'Could not reach server';
- }
- }
-
- function escapeHtml(str) {
- return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
- }
-
- function copyBlock(btn, id) {
- const el = document.getElementById(id);
- const text = el.innerText;
- navigator.clipboard.writeText(text).then(() => {
- btn.textContent = 'Copied';
- btn.classList.add('copied');
- setTimeout(() => { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 1500);
- });
- }
-
- init();
- </script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/src/ui/public/integrations.html b/src/ui/public/integrations.html
deleted file mode 100644
index e39d08b..0000000
--- a/src/ui/public/integrations.html
+++ /dev/null
@@ -1,228 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Podcli — Integrations</title>
- <meta name="robots" content="noindex,nofollow" />
- <link rel="icon" type="image/png" href="/podcli-icon.png" />
- <link rel="preconnect" href="https://fonts.googleapis.com" />
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
- <link
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="css/styles.css" />
- <style>
- .app { max-width: 860px; }
- .header { margin-bottom: 32px; }
- .header h1 { margin: 0 0 8px 0; }
- .header p { margin: 0; opacity: 0.7; }
-
- .int-grid { display: flex; flex-direction: column; gap: 16px; }
-
- .int-card {
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 12px;
- padding: 20px 22px;
- background: rgba(255, 255, 255, 0.02);
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- @media (prefers-color-scheme: light) {
- .int-card { border-color: rgba(0,0,0,0.08); background: rgba(0,0,0,0.02); }
- }
-
- .int-card-head {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- gap: 16px;
- }
- .int-name { font-size: 18px; font-weight: 600; margin: 0; }
- .int-cat {
- display: inline-block;
- font-size: 11px;
- letter-spacing: 0.04em;
- text-transform: uppercase;
- padding: 3px 8px;
- border-radius: 999px;
- background: rgba(120, 180, 255, 0.15);
- color: #6aa3ff;
- margin-left: 8px;
- vertical-align: middle;
- }
- .int-desc { opacity: 0.75; font-size: 14px; line-height: 1.45; margin: 0; }
- .int-tools { font-family: "JetBrains Mono", monospace; font-size: 12px; opacity: 0.55; }
- .int-tool-pill {
- display: inline-block;
- padding: 2px 8px;
- border-radius: 4px;
- background: rgba(255, 255, 255, 0.05);
- margin-right: 6px;
- }
- @media (prefers-color-scheme: light) {
- .int-tool-pill { background: rgba(0,0,0,0.05); }
- }
-
- .toggle {
- position: relative;
- width: 48px;
- height: 28px;
- border-radius: 999px;
- border: none;
- padding: 0;
- appearance: none;
- background: rgba(255, 255, 255, 0.1);
- cursor: pointer;
- transition: background 120ms;
- flex-shrink: 0;
- }
- .toggle:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
- .toggle::after {
- content: "";
- position: absolute;
- top: 3px;
- left: 3px;
- width: 22px;
- height: 22px;
- border-radius: 50%;
- background: #fff;
- transition: transform 120ms;
- }
- .toggle.on { background: #4ade80; }
- .toggle.on::after { transform: translateX(20px); }
- .toggle.busy { opacity: 0.5; pointer-events: none; }
-
- .empty-state, .error-state {
- padding: 32px;
- text-align: center;
- border: 1px dashed rgba(255, 255, 255, 0.15);
- border-radius: 12px;
- opacity: 0.6;
- }
- .error-state { color: #ff8b8b; border-color: rgba(255, 0, 0, 0.3); }
-
- .footer-note {
- margin-top: 24px;
- font-size: 13px;
- opacity: 0.55;
- line-height: 1.5;
- }
- .footer-note code { font-family: "JetBrains Mono", monospace; font-size: 12px; }
- </style>
-</head>
-<body>
- <div class="app fade-in">
- <div class="nav">
- <a href="/"><img src="/podcli-logo-transparent.png" alt="podcli" style="height:22px"></a>
- <a href="/" class="nav-link">Back to app</a>
- <a href="/config.html" class="nav-link">Config profiles</a>
- <a href="/integration.html" class="nav-link">MCP client setup</a>
- </div>
-
- <div class="header">
- <h1>Output integrations</h1>
- <p>Enable the destinations you want podcli to push to. Disabled integrations error out with a hint when called from MCP.</p>
- </div>
-
- <div id="root" class="int-grid">
- <div class="empty-state">Loading…</div>
- </div>
-
- <p class="footer-note">
- State persists at the active config home (<code>integrations.json</code>, gitignored).
- Adding a new integration: drop a subpackage in
- <code>backend/services/integrations/</code> and it appears here automatically.
- </p>
- </div>
-
- <script>
- const root = document.getElementById("root");
-
- function escapeHtml(s) {
- return String(s).replace(/[&<>"']/g, c => ({
- "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;"
- }[c]));
- }
-
- function categoryLabel(cat) {
- return {
- editor_export: "Editor export",
- platform_upload: "Platform upload",
- productivity: "Productivity",
- ai_helper: "AI helper",
- }[cat] || cat;
- }
-
- function renderCard(int) {
- const tools = (int.tools || [])
- .map(t => `<span class="int-tool-pill">${escapeHtml(t.name)}</span>`)
- .join("");
- return `
- <div class="int-card" data-name="${escapeHtml(int.name)}">
- <div class="int-card-head">
- <div>
- <h2 class="int-name">
- ${escapeHtml(int.name)}
- <span class="int-cat">${escapeHtml(categoryLabel(int.category))}</span>
- </h2>
- <p class="int-desc">${escapeHtml(int.description || "")}</p>
- </div>
- <button type="button" class="toggle ${int.enabled ? "on" : ""}" role="switch"
- aria-checked="${int.enabled}" aria-label="Toggle ${escapeHtml(int.name)} integration"
- data-name="${escapeHtml(int.name)}"></button>
- </div>
- <div class="int-tools">${tools}</div>
- </div>
- `;
- }
-
- async function load() {
- try {
- const resp = await fetch("/api/integrations");
- if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
- const data = await resp.json();
- const list = data.integrations || [];
- if (!list.length) {
- root.innerHTML = '<div class="empty-state">No integrations installed.</div>';
- return;
- }
- root.innerHTML = list.map(renderCard).join("");
- document.querySelectorAll(".toggle").forEach(el => {
- el.addEventListener("click", onToggle);
- });
- } catch (err) {
- root.innerHTML = `<div class="error-state">Failed to load: ${escapeHtml(err.message)}</div>`;
- }
- }
-
- async function onToggle(e) {
- const el = e.currentTarget;
- const name = el.dataset.name;
- const next = !el.classList.contains("on");
- el.classList.add("busy");
- try {
- const resp = await fetch(`/api/integrations/${encodeURIComponent(name)}`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ enabled: next }),
- });
- if (!resp.ok) {
- const body = await resp.json().catch(() => ({}));
- throw new Error(body.error || `HTTP ${resp.status}`);
- }
- el.classList.toggle("on", next);
- el.setAttribute("aria-checked", String(next));
- } catch (err) {
- alert(`Failed to ${next ? "enable" : "disable"} ${name}: ${err.message}`);
- } finally {
- el.classList.remove("busy");
- }
- }
-
- load();
- </script>
-</body>
-</html>
diff --git a/src/ui/public/knowledge.html b/src/ui/public/knowledge.html
deleted file mode 100644
index 653f9de..0000000
--- a/src/ui/public/knowledge.html
+++ /dev/null
@@ -1,248 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>Podcli - Knowledge Base</title>
- <meta name="description" content="Edit the brand brain that drives Podcli's title formulas, voice and tone, descriptions, and thumbnail copy.">
- <meta name="author" content="Podcli">
- <meta name="application-name" content="Podcli">
- <meta name="robots" content="noindex,nofollow">
- <meta name="referrer" content="strict-origin-when-cross-origin">
- <meta name="format-detection" content="telephone=no">
-
- <meta name="theme-color" content="#0d0d0d" media="(prefers-color-scheme: dark)">
- <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
- <meta name="color-scheme" content="dark light">
-
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="Podcli">
- <meta property="og:title" content="Podcli - Knowledge Base">
- <meta property="og:description" content="Edit the brand brain that drives Podcli's title formulas, voice and tone, descriptions, and thumbnail copy.">
- <meta property="og:image" content="/podcli-logo-transparent.png">
-
- <link rel="icon" type="image/png" href="/podcli-icon.png">
- <link rel="apple-touch-icon" href="/podcli-icon.png">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-title" content="Podcli">
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link
- href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap"
- rel="stylesheet">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.23.9/babel.min.js"></script>
- <link rel="stylesheet" href="css/styles.css">
- <style>
- .app {
- max-width: 860px;
- }
-
- .header {
- margin-bottom: 32px;
- }
-
- .drop-zone {
- padding: 36px 24px;
- margin-bottom: 24px;
- }
- </style>
-</head>
-
-<body>
- <div id="root"></div>
- <script type="text/babel">
- const { useState, useEffect, useCallback } = React;
-
- function App() {
- const [files, setFiles] = useState([]);
- const [activeFile, setActiveFile] = useState(null);
- const [editorContent, setEditorContent] = useState('');
- const [dirty, setDirty] = useState(false);
- const [dragOver, setDragOver] = useState(false);
- const [toast, setToast] = useState(null);
- const [newName, setNewName] = useState('');
- const [kbDir, setKbDir] = useState('');
-
- const showToast = (msg) => { setToast(msg); setTimeout(() => setToast(null), 2000); };
-
- const loadFiles = useCallback(async () => {
- const data = await (await fetch('/api/knowledge')).json();
- setFiles(data);
- }, []);
-
- useEffect(() => {
- loadFiles();
- fetch('/api/knowledge/dir').then(r => r.json()).then(d => setKbDir(d.path)).catch(() => { });
- }, []);
-
- const openFile = (f) => {
- if (dirty && !confirm('Discard unsaved changes?')) return;
- setActiveFile(f.filename);
- setEditorContent(f.content);
- setDirty(false);
- };
-
- const saveFile = async () => {
- if (!activeFile) return;
- await fetch(`/api/knowledge/${encodeURIComponent(activeFile)}`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ content: editorContent }),
- });
- setDirty(false);
- showToast('Saved');
- loadFiles();
- };
-
- const deleteFile = async (filename, e) => {
- e.stopPropagation();
- if (!confirm(`Delete ${filename}?`)) return;
- await fetch(`/api/knowledge/${encodeURIComponent(filename)}`, { method: 'DELETE' });
- if (activeFile === filename) { setActiveFile(null); setEditorContent(''); }
- showToast('Deleted');
- loadFiles();
- };
-
- const createFile = async () => {
- let name = newName.trim();
- if (!name) return;
- if (!name.endsWith('.md')) name += '.md';
- await fetch(`/api/knowledge/${encodeURIComponent(name)}`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ content: `# ${name.replace('.md', '')}\n\n` }),
- });
- setNewName('');
- await loadFiles();
- // Open the new file
- const data = await (await fetch('/api/knowledge')).json();
- const created = data.find(f => f.filename === name);
- if (created) openFile(created);
- showToast('Created');
- };
-
- const handleDrop = async (e) => {
- e.preventDefault();
- setDragOver(false);
- const dt = e.dataTransfer;
- if (!dt.files.length) return;
- const fd = new FormData();
- for (const f of dt.files) {
- if (f.name.endsWith('.md') || f.name.endsWith('.txt')) fd.append('files', f);
- }
- if (!fd.has('files')) return;
- await fetch('/api/knowledge/upload', { method: 'POST', body: fd });
- showToast(`${dt.files.length} file(s) added`);
- loadFiles();
- };
-
- const handleFileInput = async (e) => {
- const inputFiles = e.target.files;
- if (!inputFiles.length) return;
- const fd = new FormData();
- for (const f of inputFiles) fd.append('files', f);
- await fetch('/api/knowledge/upload', { method: 'POST', body: fd });
- showToast(`${inputFiles.length} file(s) added`);
- loadFiles();
- e.target.value = '';
- };
-
- const realFiles = files.filter(f => f.filename !== 'README.md');
-
- return (
- <div className="app">
- <div className="nav">
- <a href="/"><img src="/podcli-logo-transparent.png" alt="podcli" style={{ height: 22 }} /></a>
- <a href="/" className="nav-link">Back to app</a>
- </div>
-
- <div className="header">
- <h1>Knowledge Base</h1>
- <p className="subtitle">
- Add .md files to give the AI context about your podcast - hosts, style preferences, audience, topics to avoid.
- The MCP server reads these before every request.
- </p>
- {kbDir && <div className="dir-path">{kbDir}</div>}
- </div>
-
- {/* Drop zone */}
- <div
- className={`drop-zone ${dragOver ? 'drag-over' : ''}`}
- onDragOver={(e) => { e.preventDefault(); setDragOver(true); }}
- onDragLeave={() => setDragOver(false)}
- onDrop={handleDrop}
- >
- <div className="dz-icon">{'\uD83D\uDCC4'}</div>
- <div className="dz-text">
- Drop <strong>.md files</strong> here or click to browse
- </div>
- <input type="file" accept=".md,.txt" multiple onChange={handleFileInput} />
- </div>
-
- {/* File grid */}
- {realFiles.length > 0 ? (
- <div className="file-grid">
- {realFiles.map(f => (
- <div
- key={f.filename}
- className={`file-card ${activeFile === f.filename ? 'active' : ''}`}
- onClick={() => openFile(f)}
- >
- <button className="file-delete" onClick={(e) => deleteFile(f.filename, e)}>{'\u00D7'}</button>
- <div className="file-name">{f.filename}</div>
- <div className="file-meta">{new Date(f.updatedAt).toLocaleDateString()}</div>
- <div className="file-preview">{f.content.split('\n').filter(l => l.trim() && !l.startsWith('#')).slice(0, 2).join(' ')}</div>
- </div>
- ))}
- </div>
- ) : (
- <div className="empty-state">
- No knowledge files yet. Drop .md files above or create one below.
- </div>
- )}
-
- {/* New file */}
- <div className="new-file-row">
- <input
- className="new-file-input"
- placeholder="new-file-name.md"
- value={newName}
- onChange={e => setNewName(e.target.value)}
- onKeyDown={e => e.key === 'Enter' && createFile()}
- />
- <button className="btn btn-primary" onClick={createFile}>Create</button>
- </div>
-
- {/* Editor */}
- {activeFile && (
- <div className="editor-panel" style={{ animation: 'fadeIn 0.2s var(--ease)' }}>
- <div className="editor-header">
- <span className="editor-filename">{activeFile}</span>
- <div className="editor-actions">
- {dirty && <span style={{ fontSize: 11, color: 'var(--accent)', fontWeight: 600, padding: '4px 8px' }}>unsaved</span>}
- <button className="btn btn-ghost" onClick={() => { setActiveFile(null); setEditorContent(''); setDirty(false); }}>Close</button>
- <button className="btn btn-primary" onClick={saveFile}>Save</button>
- </div>
- </div>
- <textarea
- className="editor-textarea"
- value={editorContent}
- onChange={e => { setEditorContent(e.target.value); setDirty(true); }}
- />
- </div>
- )}
-
- {toast && <div className="toast">{toast}</div>}
- </div>
- );
- }
-
- ReactDOM.createRoot(document.getElementById('root')).render(<App />);
- </script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/src/ui/web-server.ts b/src/ui/web-server.ts
index 3664dd8..d55bfbc 100644
--- a/src/ui/web-server.ts
+++ b/src/ui/web-server.ts
@@ -17,11 +17,13 @@ import {
statSync,
readFileSync,
writeFileSync,
+ chmodSync,
+ realpathSync,
} from "fs";
import { mkdir, readdir, unlink } from "fs/promises";
import path from "path";
import { join, dirname, basename, extname, resolve } from "path";
-import { execSync } from "child_process";
+import { execSync, spawn } from "child_process";
import { fileURLToPath } from "url";
import { v4 as uuidv4 } from "uuid";
@@ -34,19 +36,19 @@ import { KnowledgeBase } from "../services/knowledge-base.js";
import { paths } from "../config/paths.js";
import { registerConfigIntegrationRoutes } from "../handlers/integrations.routes.js";
import { childLogger } from "../utils/logger.js";
+import { sliceTranscript, sliceWords, findContentType } from "../utils/transcript.js";
+import { errMsg } from "../utils/errors.js";
import type {
BatchClipsResult,
ClipResult,
+ ProgressEvent,
SuggestedClip,
TranscriptResult,
+ WordTimestamp,
} from "../models/index.js";
const log = childLogger("web-server");
-function errMsg(err: unknown): string {
- return err instanceof Error ? err.message : String(err);
-}
-
const __dirname = dirname(fileURLToPath(import.meta.url));
const app = express();
const PORT = parseInt(process.env.PORT || "3847");
@@ -61,8 +63,10 @@ const knowledgeBase = new KnowledgeBase();
// --- Path Traversal Protection ---
function safePath(base: string, filename: string): string | null {
+ const root = path.resolve(base);
const resolved = path.resolve(base, filename);
- if (!resolved.startsWith(path.resolve(base))) return null;
+ // Compare on a path boundary so "/data/output-evil" isn't accepted as inside "/data/output".
+ if (resolved !== root && !resolved.startsWith(root + path.sep)) return null;
return resolved;
}
@@ -91,6 +95,7 @@ const sessionTranscripts = new Map<string, ServerTranscript>();
interface UIState {
videoPath: string;
filePath: string;
+ activeExportJobId: string | null;
transcript: ServerTranscript | null;
rawTranscriptText: string;
suggestions: SuggestedClip[];
@@ -120,6 +125,7 @@ function loadPersistedState(): UIState {
return {
videoPath: saved.videoPath || "",
filePath: saved.filePath || "",
+ activeExportJobId: null,
transcript: saved.transcript || null,
rawTranscriptText: saved.rawTranscriptText || "",
suggestions: saved.suggestions || [],
@@ -145,6 +151,7 @@ function loadPersistedState(): UIState {
return {
videoPath: "",
filePath: "",
+ activeExportJobId: null,
transcript: null,
rawTranscriptText: "",
suggestions: [],
@@ -176,9 +183,39 @@ function persistState() {
}
// SSE clients for the global event bus
-import type { Response } from "express";
+import type { Request, Response } from "express";
const sseClients: Response[] = [];
+function streamVideo(req: Request, res: Response, filePath: string, contentType = "video/mp4") {
+ const fileSize = statSync(filePath).size;
+ const range = req.headers.range;
+ const onErr = (stream: ReturnType<typeof createReadStream>) =>
+ stream.on("error", () => res.destroy());
+ if (range) {
+ const [s, e] = range.replace(/bytes=/, "").split("-");
+ const start = parseInt(s, 10);
+ const end = e ? parseInt(e, 10) : fileSize - 1;
+ if (Number.isNaN(start) || Number.isNaN(end) || start > end || start < 0 || end >= fileSize) {
+ res.writeHead(416, { "Content-Range": `bytes */${fileSize}` }).end();
+ return;
+ }
+ res.writeHead(206, {
+ "Content-Range": `bytes ${start}-${end}/${fileSize}`,
+ "Accept-Ranges": "bytes",
+ "Content-Length": end - start + 1,
+ "Content-Type": contentType,
+ });
+ const stream = createReadStream(filePath, { start, end });
+ onErr(stream);
+ stream.pipe(res);
+ } else {
+ res.writeHead(200, { "Content-Length": fileSize, "Content-Type": contentType });
+ const stream = createReadStream(filePath);
+ onErr(stream);
+ stream.pipe(res);
+ }
+}
+
function broadcastSSE(event: string, data: unknown) {
const payload = `event: ${event}\ndata: ${JSON.stringify(data)}\n\n`;
for (let i = sseClients.length - 1; i >= 0; i--) {
@@ -190,6 +227,74 @@ function broadcastSSE(event: string, data: unknown) {
}
}
+function broadcastHistoryUpdated(jobId: string | null, clips: unknown[]) {
+ if (clips.length === 0) return;
+ broadcastSSE("history-updated", { jobId, count: clips.length });
+}
+
+function setExportState(phase: string, activeExportJobId: string | null) {
+ uiState.phase = phase;
+ uiState.activeExportJobId = activeExportJobId;
+ uiState.lastUpdated = Date.now();
+ persistState();
+}
+
+function createBatchHistoryRecorder({
+ jobId,
+ sourceVideo,
+ transcriptWords,
+ defaultCaptionStyle,
+ defaultCropStrategy,
+ label,
+}: {
+ jobId: string;
+ sourceVideo: string;
+ transcriptWords: WordTimestamp[];
+ defaultCaptionStyle?: string;
+ defaultCropStrategy?: string;
+ label: string;
+}) {
+ const recordedClipIndexes = new Set<number>();
+ const pendingWrites: Promise<void>[] = [];
+
+ const recordRows = async (rows: BatchClipsResult["results"]) => {
+ const recorded = await clipsHistory.recordBatchResults(rows, {
+ sourceVideo,
+ transcriptWords,
+ defaultCaptionStyle,
+ defaultCropStrategy,
+ contentTypeFor: (s, e) => findContentType(uiState.suggestions, s, e),
+ });
+ for (const row of rows) {
+ if (row.status === "success" && row.output_path && typeof row.clip_index === "number") {
+ recordedClipIndexes.add(row.clip_index);
+ }
+ }
+ broadcastHistoryUpdated(jobId, recorded);
+ };
+
+ return {
+ recordProgress(event: ProgressEvent) {
+ if (event.stage !== "clip_complete" || !event.clip_result) return;
+ const write = recordRows([event.clip_result]).catch((err) => {
+ log.warn(`Failed to record completed ${label} clip to history`, {
+ err: errMsg(err),
+ });
+ });
+ pendingWrites.push(write);
+ },
+ async recordRemaining(results: BatchClipsResult["results"] | undefined) {
+ await Promise.allSettled(pendingWrites);
+ const remaining = results?.filter(
+ (row) =>
+ typeof row.clip_index !== "number" ||
+ !recordedClipIndexes.has(row.clip_index),
+ );
+ if (remaining?.length) await recordRows(remaining);
+ },
+ };
+}
+
// --- Middleware ---
app.use(express.json({ limit: "50mb" }));
@@ -501,6 +606,7 @@ app.post("/api/create-clip", async (req, res) => {
outro_path = null,
clean_fillers = false,
allow_ass_fallback = false,
+ content_type = null,
} = req.body;
if (!video_path || !existsSync(video_path)) {
@@ -593,28 +699,38 @@ app.post("/api/create-clip", async (req, res) => {
job.progress = 100;
job.message = "Clip created!";
job.result = result.data;
- broadcastSSE("job-complete", { jobId, result: result.data });
// Record to history
try {
const d = result.data;
- await clipsHistory.record({
+ const rec = await clipsHistory.record({
source_video: video_path,
start_second,
end_second,
caption_style,
crop_strategy,
logo_path: logo_path || undefined,
+ outro_path: outro_path || undefined,
title,
output_path: d?.output_path || "",
file_size_mb: d?.file_size_mb || 0,
duration: d?.duration || 0,
+ content_type: content_type || undefined,
+ transcript_slice: sliceTranscript(transcript_words, start_second, end_second),
+ });
+ const clipWords = sliceWords(transcript_words, start_second, end_second);
+ await clipsHistory.saveWords(rec.id, clipWords);
+ await clipsHistory.saveRecipe(rec.id, {
+ caption_style, crop_strategy, logo_path: logo_path || null, outro_path: outro_path || null,
+ clean_fillers, transcript_words: clipWords,
});
+ broadcastHistoryUpdated(jobId, [rec]);
} catch (err) {
log.warn("Failed to record clip to history", {
title,
err: errMsg(err),
});
}
+ broadcastSSE("job-complete", { jobId, result: result.data });
})
.catch((err) => {
job.status = "error";
@@ -683,10 +799,15 @@ app.post("/api/batch-clips", async (req, res) => {
};
jobs.set(jobId, job);
+ const historyRecorder = createBatchHistoryRecorder({
+ jobId,
+ sourceVideo: video_path,
+ transcriptWords: transcript_words,
+ label: "batch",
+ });
+
broadcastSSE("export-started", { jobId, clipCount: clips.length });
- uiState.phase = "exporting";
- uiState.lastUpdated = Date.now();
- persistState();
+ setExportState("exporting", jobId);
res.json({ job_id: jobId, status: "running" });
@@ -707,6 +828,7 @@ app.post("/api/batch-clips", async (req, res) => {
(event) => {
job.progress = event.percent;
job.message = event.message;
+ historyRecorder.recordProgress(event);
broadcastSSE("job-update", {
jobId,
progress: event.percent,
@@ -719,37 +841,22 @@ app.post("/api/batch-clips", async (req, res) => {
job.progress = 100;
job.message = "Batch complete!";
job.result = result.data;
- broadcastSSE("job-complete", { jobId, result: result.data });
// Record successful clips to history
try {
- const d = result.data;
- if (d?.results) {
- for (const r of d.results) {
- if (r.status === "success" && r.output_path) {
- await clipsHistory.record({
- source_video: video_path,
- start_second: r.start_second || 0,
- end_second: r.end_second || 0,
- caption_style: r.caption_style || "hormozi",
- crop_strategy: r.crop_strategy || "speaker",
- title: r.title || "clip",
- output_path: r.output_path,
- file_size_mb: r.file_size_mb || 0,
- duration: r.duration || 0,
- });
- }
- }
- }
+ await historyRecorder.recordRemaining(result.data?.results);
} catch (err) {
log.warn("Failed to record batch clips to history", {
err: errMsg(err),
});
}
+ setExportState("done", null);
+ broadcastSSE("job-complete", { jobId, result: result.data });
})
.catch((err) => {
job.status = "error";
job.error = err.message;
job.message = `Error: ${err.message}`;
+ setExportState("review", null);
broadcastSSE("job-error", { jobId, error: err.message });
});
});
@@ -867,32 +974,7 @@ app.get("/api/preview/:filename", (req, res) => {
res.status(404).json({ error: "File not found" });
return;
}
-
- const stat = statSync(filePath);
- const fileSize = stat.size;
- const range = req.headers.range;
-
- if (range) {
- const parts = range.replace(/bytes=/, "").split("-");
- const start = parseInt(parts[0], 10);
- const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1;
- const chunkSize = end - start + 1;
-
- const stream = createReadStream(filePath, { start, end });
- res.writeHead(206, {
- "Content-Range": `bytes ${start}-${end}/${fileSize}`,
- "Accept-Ranges": "bytes",
- "Content-Length": chunkSize,
- "Content-Type": "video/mp4",
- });
- stream.pipe(res);
- } else {
- res.writeHead(200, {
- "Content-Length": fileSize,
- "Content-Type": "video/mp4",
- });
- createReadStream(filePath).pipe(res);
- }
+ streamVideo(req, res, filePath);
});
/**
@@ -922,42 +1004,63 @@ app.get("/api/stream-source", (req, res) => {
return;
}
- const stat = statSync(filePath);
- const fileSize = stat.size;
- const range = req.headers.range;
- const ext = extname(filePath).toLowerCase();
const mimeTypes: Record<string, string> = {
- ".mp4": "video/mp4",
".webm": "video/webm",
".mov": "video/quicktime",
".avi": "video/x-msvideo",
".mkv": "video/x-matroska",
- ".m4v": "video/mp4",
};
- const contentType = mimeTypes[ext] || "video/mp4";
+ streamVideo(req, res, filePath, mimeTypes[extname(filePath).toLowerCase()] || "video/mp4");
+});
- if (range) {
- const parts = range.replace(/bytes=/, "").split("-");
- const start = parseInt(parts[0], 10);
- const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1;
- const chunkSize = end - start + 1;
- const stream = createReadStream(filePath, { start, end });
- res.writeHead(206, {
- "Content-Range": `bytes ${start}-${end}/${fileSize}`,
- "Accept-Ranges": "bytes",
- "Content-Length": chunkSize,
- "Content-Type": contentType,
- });
- stream.pipe(res);
- } else {
- res.writeHead(200, {
- "Content-Length": fileSize,
- "Content-Type": contentType,
- });
- createReadStream(filePath).pipe(res);
+app.get("/api/thumbnail-config", (_req, res) => {
+ try {
+ res.json(JSON.parse(readFileSync(paths.thumbnailConfig, "utf-8")));
+ } catch {
+ res.json({});
}
});
+app.put("/api/thumbnail-config", (req, res) => {
+ try {
+ let current: Record<string, unknown> = {};
+ try { current = JSON.parse(readFileSync(paths.thumbnailConfig, "utf-8")); } catch { /* new file */ }
+ const merged = { ...current, ...(req.body || {}) };
+ writeFileSync(paths.thumbnailConfig, JSON.stringify(merged, null, 2), "utf-8");
+ res.json({ ok: true });
+ } catch (e: any) {
+ res.status(500).json({ error: e.message });
+ }
+});
+
+app.get("/api/image", (req, res) => {
+ const raw = req.query.path as string;
+ const mimes: Record<string, string> = { ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp", ".gif": "image/gif" };
+ const mime = raw ? mimes[extname(raw).toLowerCase()] : undefined;
+ if (!mime) {
+ res.status(403).json({ error: "unsupported type" });
+ return;
+ }
+ // realpath defeats symlinks pointing outside the allowed roots; home is
+ // excluded so the integrations/token files under it are never servable.
+ let resolved: string;
+ try {
+ resolved = realpathSync(path.resolve(raw));
+ } catch {
+ res.status(404).json({ error: "not found" });
+ return;
+ }
+ const allowedRoots = [paths.output, paths.working, paths.assets].map((p) => path.resolve(p));
+ if (!allowedRoots.some((root) => resolved === root || resolved.startsWith(root + path.sep))) {
+ res.status(403).json({ error: "access denied" });
+ return;
+ }
+ res.writeHead(200, { "Content-Type": mime, "Cache-Control": "no-cache" });
+ const stream = createReadStream(resolved);
+ stream.on("error", () => res.destroy());
+ stream.pipe(res);
+});
+
registerConfigIntegrationRoutes(app, { executor, uploadDir });
// --- Transcript export (SRT/VTT) ---
@@ -1125,6 +1228,400 @@ app.get("/api/history", async (req, res) => {
}
});
+// Clip edits route through the Python CLI so the web UI and `podcli clips`
+// share one history writer (preserves unknown fields like Phase 2 metrics).
+const stripAnsi = (s: string) => s.replace(/\x1b\[[0-9;]*m/g, "").trim();
+
+function runPy(scriptAndArgs: string[]): Promise<{ code: number; stdout: string; stderr: string }> {
+ return new Promise((resolve) => {
+ const proc = spawn(paths.pythonPath, scriptAndArgs, {
+ env: { ...process.env, PYTHONUNBUFFERED: "1", PODCLI_HOME: paths.home, PODCLI_DATA: paths.dataDir },
+ });
+ let stdout = "", stderr = "";
+ proc.stdout.on("data", (d) => (stdout += d));
+ proc.stderr.on("data", (d) => (stderr += d));
+ proc.on("close", (code) => resolve({ code: code ?? 1, stdout, stderr }));
+ proc.on("error", (e) => resolve({ code: 1, stdout, stderr: String(e) }));
+ });
+}
+
+const runCli = (args: string[]) =>
+ runPy([join(paths.projectRoot, "backend", "cli.py"), "--no-banner", ...args]);
+
+// Composite a thumbnail PNG onto the start of a clip. stripStart > 0 removes a
+// prior card first (avoids stacking on re-bake). Returns the bake's success.
+async function bakeThumbnailCard(clipPath: string, image: string, stripStart = 0): Promise<{ ok: boolean; error?: string }> {
+ const r = await runCli([
+ "bake-thumbnail", clipPath, image, "--position", "start",
+ ...(stripStart ? ["--strip-start", String(stripStart)] : []),
+ ]);
+ return r.code === 0 ? { ok: true } : { ok: false, error: stripAnsi(r.stderr || r.stdout) };
+}
+
+app.patch("/api/clips/:id", async (req, res) => {
+ const { title, caption_style, thumbnail_config } = req.body || {};
+ const args = ["clips", "edit", req.params.id];
+ if (title != null) args.push("--title", String(title));
+ if (caption_style != null) args.push("--caption-style", String(caption_style));
+ if (thumbnail_config != null) args.push("--thumbnail-config", JSON.stringify(thumbnail_config));
+ if (args.length === 3) {
+ res.status(400).json({ error: "nothing to update" });
+ return;
+ }
+ const r = await runCli(args);
+ if (r.code !== 0) {
+ res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "edit failed" });
+ return;
+ }
+ res.json({ ok: true });
+});
+
+app.delete("/api/clips/:id", async (req, res) => {
+ const 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" });
+ return;
+ }
+ broadcastSSE("history-updated", { jobId: null, count: 1 });
+ res.json({ ok: true });
+});
+
+app.post("/api/clips/:id/reopen", async (req, res) => {
+ const r = await runCli(["clips", "reopen", req.params.id]);
+ if (r.code !== 0) {
+ res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "reopen failed" });
+ return;
+ }
+ res.json({ ok: true });
+});
+
+app.post("/api/clips/:id/thumbnail", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) {
+ res.status(404).json({ error: "clip not found" });
+ return;
+ }
+ const tc = clip.thumbnail_config || {};
+ // Standalone thumbnail generation — produces variation PNGs, never touches the clip video.
+ const outDir = join(paths.output, "thumbnails", String(clip.id));
+ const args = [
+ "thumbnails", tc.text || clip.title,
+ "--output", outDir,
+ "--variations", "3",
+ "--json",
+ "--video", clip.source_video,
+ "--start", String(clip.start_second),
+ "--end", String(clip.end_second),
+ ];
+ if (tc.image_path) args.push("--photo", String(tc.image_path));
+ else if (typeof tc.timestamp === "number") args.push("--timestamp", String(tc.timestamp));
+ if (tc.line1) args.push("--line1", String(tc.line1));
+ if (tc.line2) args.push("--line2", String(tc.line2));
+ const r = await runCli(args);
+ if (r.code !== 0) {
+ res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "thumbnail failed" });
+ return;
+ }
+ const jsonLine = r.stdout.trim().split("\n").reverse().find((l) => l.trim().startsWith("{"));
+ let variations: string[] = [];
+ try { variations = JSON.parse(jsonLine || "{}").paths || []; } catch { /* no paths */ }
+ if (variations.length === 0) {
+ res.status(500).json({ error: "no thumbnails generated" });
+ return;
+ }
+ // Bake the chosen thumbnail into the clip as the opening card (stripping any prior card).
+ if (existsSync(clip.output_path)) {
+ const bake = await bakeThumbnailCard(clip.output_path, variations[0], clip.thumbnail_config?.card_seconds || 0);
+ if (!bake.ok) {
+ res.status(500).json({ error: `thumbnail generated but bake into clip failed: ${bake.error}` });
+ return;
+ }
+ }
+ const merged = { ...tc, preview_path: variations[0], variations, card_seconds: 1.5 };
+ await runCli(["clips", "edit", String(clip.id), "--thumbnail-config", JSON.stringify(merged)]);
+ res.json({ ok: true, preview_path: variations[0], variations });
+});
+
+app.post("/api/clips/:id/thumbnail/select", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) { res.status(404).json({ error: "clip not found" }); return; }
+ const tc = clip.thumbnail_config || {};
+ const pick = String(req.body?.path || "");
+ if (!pick || !(tc.variations || []).includes(pick) || !existsSync(pick)) {
+ res.status(400).json({ error: "unknown variation" });
+ return;
+ }
+ if (existsSync(clip.output_path)) {
+ const bake = await bakeThumbnailCard(clip.output_path, pick, tc.card_seconds || 0);
+ if (!bake.ok) {
+ res.status(500).json({ error: `bake into clip failed: ${bake.error}` });
+ return;
+ }
+ }
+ await runCli(["clips", "edit", String(clip.id), "--thumbnail-config", JSON.stringify({ ...tc, preview_path: pick, card_seconds: 1.5 })]);
+ res.json({ ok: true, preview_path: pick });
+});
+
+app.get("/api/youtube/config", (_req, res) => {
+ try {
+ const all = JSON.parse(readFileSync(paths.integrations, "utf-8"));
+ const yt = all.youtube || {};
+ res.json({ client_id: yt.client_id || "", has_secret: !!yt.client_secret });
+ } catch {
+ res.json({ client_id: "", has_secret: false });
+ }
+});
+
+app.put("/api/youtube/config", (req, res) => {
+ try {
+ let all: Record<string, any> = {};
+ try { all = JSON.parse(readFileSync(paths.integrations, "utf-8")); } catch { /* new */ }
+ const yt = { ...(all.youtube || {}) };
+ const { client_id, client_secret } = req.body || {};
+ if (client_id !== undefined) yt.client_id = client_id;
+ if (client_secret) yt.client_secret = client_secret;
+ all.youtube = yt;
+ writeFileSync(paths.integrations, JSON.stringify(all, null, 2) + "\n", "utf-8");
+ // Holds the OAuth client secret — keep it owner-only (chmod covers the
+ // case where the file already existed with looser perms).
+ try { chmodSync(paths.integrations, 0o600); } catch { /* best effort */ }
+ res.json({ ok: true });
+ } catch (e: any) {
+ res.status(500).json({ error: e.message });
+ }
+});
+
+app.get("/api/youtube/status", async (_req, res) => {
+ try {
+ const clips = await clipsHistory.load();
+ res.json({
+ authorized: 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,
+ });
+ } catch {
+ res.json({ authorized: false, linked: 0, with_metrics: 0, total: 0 });
+ }
+});
+
+app.post("/api/youtube/sync", async (req, res) => {
+ const csvPath = req.body?.csv_path;
+ const r = await runCli(["youtube", "sync", ...(csvPath ? ["--csv", String(csvPath)] : [])]);
+ if (r.code !== 0) {
+ res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "sync failed" });
+ return;
+ }
+ res.json({ ok: true, message: stripAnsi(r.stdout) });
+});
+
+app.post("/api/youtube/learn", async (_req, res) => {
+ const r = await runCli(["youtube", "learn"]);
+ if (r.code !== 0) {
+ res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "analysis failed" });
+ return;
+ }
+ res.json({ ok: true, message: stripAnsi(r.stdout) });
+});
+
+// Proposed clip↔video links for the authorized channel (live OAuth path).
+app.get("/api/youtube/links", async (_req, res) => {
+ const r = await runCli(["youtube", "link", "--json"]);
+ let payload: any = {};
+ try { payload = JSON.parse(r.stdout.trim().split("\n").pop() || "{}"); } catch { /* non-JSON */ }
+ if (r.code !== 0 || payload.error) {
+ res.status(400).json({ error: payload.error || stripAnsi(r.stderr || r.stdout) || "could not load proposals" });
+ return;
+ }
+ res.json({ proposals: payload.proposals || [] });
+});
+
+app.post("/api/youtube/link", async (req, res) => {
+ const { clip_id, video_id } = req.body || {};
+ if (!clip_id || !video_id) {
+ res.status(400).json({ error: "clip_id and video_id are required" });
+ return;
+ }
+ const r = await runCli(["youtube", "link", String(clip_id), String(video_id), "--json"]);
+ let payload: any = {};
+ try { payload = JSON.parse(r.stdout.trim().split("\n").pop() || "{}"); } catch { /* non-JSON */ }
+ if (r.code !== 0 || !payload.ok) {
+ res.status(400).json({ error: payload.error || "link failed (clip not found?)" });
+ return;
+ }
+ res.json({ ok: true });
+});
+
+app.get("/api/analytics", async (_req, res) => {
+ const clips = await clipsHistory.load();
+ const withM = clips.filter((c) => c.metrics && (c.metrics.views != null || c.metrics.retention != null));
+ const avg = (arr: number[]) => (arr.length ? arr.reduce((a, b) => a + b, 0) / arr.length : 0);
+ const agg = (keyFn: (c: any) => string) => {
+ const groups = new Map<string, any[]>();
+ for (const c of withM) {
+ const k = keyFn(c) || "—";
+ (groups.get(k) ?? groups.set(k, []).get(k)!).push(c);
+ }
+ return Array.from(groups.entries()).map(([key, cs]) => ({
+ key,
+ count: cs.length,
+ avgViews: Math.round(avg(cs.map((c) => c.metrics?.views || 0))),
+ avgRetention: +avg(cs.map((c) => c.metrics?.retention || 0)).toFixed(1),
+ avgCtr: +avg(cs.map((c) => c.metrics?.ctr || 0)).toFixed(1),
+ })).sort((a, b) => b.avgViews - a.avgViews);
+ };
+ const lengthBucket = (d: number) => (d < 25 ? "<25s" : d < 35 ? "25–35s" : d < 45 ? "35–45s" : "45s+");
+ res.json({
+ published: withM.length,
+ total: clips.length,
+ byContentType: agg((c) => c.content_type),
+ byCaptionStyle: agg((c) => c.caption_style),
+ byLength: agg((c) => lengthBucket(c.duration || 0)),
+ top: withM
+ .slice()
+ .sort((a, b) => (b.metrics?.views || 0) - (a.metrics?.views || 0))
+ .slice(0, 12)
+ .map((c) => ({ id: c.id, title: c.title, content_type: c.content_type, caption_style: c.caption_style, duration: c.duration, metrics: c.metrics })),
+ });
+});
+
+app.get("/api/clips/:id/source", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip || !existsSync(clip.source_video)) {
+ res.status(404).json({ error: "source not found" });
+ return;
+ }
+ const srcMime: Record<string, string> = { ".mp4": "video/mp4", ".webm": "video/webm", ".mov": "video/quicktime", ".mkv": "video/x-matroska", ".m4v": "video/mp4" };
+ streamVideo(req, res, clip.source_video, srcMime[extname(clip.source_video).toLowerCase()] || "video/mp4");
+});
+
+app.get("/api/clips/:id/reframe", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) { res.status(404).json({ error: "clip not found" }); return; }
+ res.json((await clipsHistory.loadReframe(clip.id)) || {});
+});
+
+app.get("/api/clips/:id/cuts", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip || !existsSync(clip.source_video)) { res.status(404).json({ error: "source not found" }); return; }
+ const start = clip.start_second;
+ const dur = Math.max(0.1, clip.end_second - clip.start_second);
+ // pts_time from ffmpeg scene detection is relative to -ss, not the source.
+ const proc = spawn(paths.ffmpegPath, [
+ "-ss", String(start), "-i", clip.source_video, "-t", String(dur),
+ "-vf", "select='gt(scene,0.3)',showinfo", "-an", "-f", "null", "-",
+ ]);
+ let stderr = "";
+ proc.stderr.on("data", (d) => (stderr += d));
+ proc.on("close", () => {
+ const cuts = [...stderr.matchAll(/pts_time:([\d.]+)/g)]
+ .map((m) => +(start + parseFloat(m[1])).toFixed(3))
+ .filter((t) => t > start + 0.2 && t < start + dur - 0.2);
+ res.json({ cuts: Array.from(new Set(cuts)) });
+ });
+ proc.on("error", () => res.json({ cuts: [] }));
+});
+
+app.post("/api/clips/:id/rerender", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) {
+ res.status(404).json({ error: "clip not found" });
+ return;
+ }
+ // Editor sends source-absolute keyframes + trim; derive the render's clip-relative
+ // crop keyframes from it, and persist the editor state so reopening shows it.
+ const reframe = req.body?.reframe as { keyframes?: { tAbs: number; x_pct: number }[]; inSec?: number; outSec?: number } | undefined;
+ const startSecond = reframe && typeof reframe.inSec === "number" ? reframe.inSec
+ : typeof req.body?.start_second === "number" ? req.body.start_second : clip.start_second;
+ const endSecond = reframe && typeof reframe.outSec === "number" ? reframe.outSec
+ : typeof req.body?.end_second === "number" ? req.body.end_second : clip.end_second;
+ const keyframes = reframe?.keyframes
+ ? reframe.keyframes
+ .filter((k) => k.tAbs >= startSecond - 0.001 && k.tAbs <= endSecond + 0.001)
+ .map((k) => ({ t: +Math.max(0, k.tAbs - startSecond).toFixed(3), x_pct: k.x_pct }))
+ : req.body?.crop_keyframes;
+ if (!Array.isArray(keyframes) || keyframes.length === 0) {
+ res.status(400).json({ error: "keyframes required" });
+ return;
+ }
+ if (reframe) await clipsHistory.saveReframe(clip.id, reframe);
+ // Replay the original render recipe (logo/outro/captions/fillers) with the new
+ // manual crop, so brand elements survive the reframe.
+ const recipe = (await clipsHistory.loadRecipe(clip.id)) || {};
+ let allWords = (recipe.transcript_words as any[]) || (await clipsHistory.loadWords(clip.id)) || [];
+ if (!allWords.length) {
+ // Fallback for clips rendered before recipes existed: recover words from the cached source transcript.
+ try {
+ const t = await cache.get(clip.source_video);
+ if (t?.words?.length) allWords = t.words as any[];
+ } catch { /* no cached transcript */ }
+ }
+ // If trimmed wider/narrower, keep only words inside the new bounds.
+ const words = allWords.filter((w: any) => typeof w?.start !== "number" || (w.start >= startSecond && w.start < endSecond));
+ try {
+ const result = await executor.execute<ClipResult>("create_clip", {
+ video_path: clip.source_video,
+ start_second: startSecond,
+ end_second: endSecond,
+ caption_style: req.body?.caption_style || (recipe.caption_style as string) || clip.caption_style,
+ crop_strategy: "manual",
+ crop_keyframes: keyframes,
+ transcript_words: words,
+ logo_path: (recipe.logo_path as string) ?? clip.logo_path ?? null,
+ outro_path: (recipe.outro_path as string) ?? clip.outro_path ?? null,
+ clean_fillers: recipe.clean_fillers !== undefined ? recipe.clean_fillers : true,
+ ...(recipe.keep_segments ? { keep_segments: recipe.keep_segments } : {}),
+ title: clip.title,
+ output_dir: dirname(clip.output_path),
+ });
+ if (!result.data) throw new Error("no render output");
+ const outPath = result.data.output_path || clip.output_path;
+ // Re-bake the chosen thumbnail card onto the fresh clip (no strip needed —
+ // create_clip always renders a cardless clip).
+ const tnail = clip.thumbnail_config?.preview_path;
+ let thumbnailBaked = false;
+ if (tnail && existsSync(tnail) && existsSync(outPath)) {
+ const bake = await bakeThumbnailCard(outPath, tnail);
+ thumbnailBaked = bake.ok;
+ if (!bake.ok) {
+ res.status(500).json({ error: `reframe rendered but thumbnail bake failed: ${bake.error}` });
+ return;
+ }
+ }
+ await clipsHistory.update(clip.id, {
+ start_second: startSecond,
+ end_second: endSecond,
+ crop_strategy: "manual",
+ duration: result.data.duration ?? clip.duration,
+ file_size_mb: result.data.file_size_mb ?? clip.file_size_mb,
+ output_path: outPath,
+ });
+ res.json({ ok: true, output_path: outPath, file_size_mb: result.data.file_size_mb, thumbnail_baked: thumbnailBaked });
+ } catch (e: any) {
+ res.status(500).json({ error: e.message });
+ }
+});
+
+app.post("/api/clips/:id/davinci", async (req, res) => {
+ const clip = await clipsHistory.findById(req.params.id);
+ if (!clip) {
+ res.status(404).json({ error: "clip not found" });
+ return;
+ }
+ if (!existsSync(clip.output_path)) {
+ res.status(400).json({ error: "rendered file missing" });
+ return;
+ }
+ const cli = join(paths.projectRoot, "backend", "services", "integrations", "davinci_resolve", "cli.py");
+ const r = await runPy([cli, "--source", clip.output_path, "--title", clip.title]);
+ if (r.code !== 0) {
+ res.status(400).json({ error: stripAnsi(r.stderr || r.stdout) || "export failed" });
+ return;
+ }
+ const wrote = (r.stdout.match(/wrote:\s*(.+)/) || [])[1]?.trim();
+ res.json({ ok: true, path: wrote });
+});
+
app.get("/api/history/check", async (req, res) => {
try {
const {
@@ -1636,6 +2133,7 @@ app.get("/api/ui-state", (_req, res) => {
res.json({
videoPath: uiState.videoPath,
filePath: uiState.filePath,
+ activeExportJobId: uiState.activeExportJobId,
phase: uiState.phase,
settings: uiState.settings,
selectedClips: selected,
@@ -1760,11 +2258,18 @@ app.post("/api/mcp/export", async (req, res) => {
};
jobs.set(jobId, job);
+ const historyRecorder = createBatchHistoryRecorder({
+ jobId,
+ sourceVideo: videoPath,
+ transcriptWords,
+ defaultCaptionStyle: captionStyle,
+ defaultCropStrategy: cropStrategy,
+ label: "MCP export",
+ });
+
// Broadcast to UI so it can track progress
broadcastSSE("export-started", { jobId, clipCount: styledClips.length });
- uiState.phase = "exporting";
- uiState.lastUpdated = Date.now();
- persistState();
+ setExportState("exporting", jobId);
res.json({ job_id: jobId, status: "running", clipCount: styledClips.length });
@@ -1783,6 +2288,7 @@ app.post("/api/mcp/export", async (req, res) => {
(event) => {
job.progress = event.percent;
job.message = event.message;
+ historyRecorder.recordProgress(event);
broadcastSSE("job-update", {
jobId,
progress: event.percent,
@@ -1797,35 +2303,20 @@ app.post("/api/mcp/export", async (req, res) => {
job.result = result.data;
// Record clips to history
try {
- const d = result.data;
- if (d?.results) {
- for (const r of d.results) {
- if (r.status === "success" && r.output_path) {
- await clipsHistory.record({
- source_video: videoPath,
- start_second: r.start_second || 0,
- end_second: r.end_second || 0,
- caption_style: r.caption_style || captionStyle,
- crop_strategy: r.crop_strategy || cropStrategy,
- title: r.title || "clip",
- output_path: r.output_path,
- file_size_mb: r.file_size_mb || 0,
- duration: r.duration || 0,
- });
- }
- }
- }
+ await historyRecorder.recordRemaining(result.data?.results);
} catch (err) {
log.warn("Failed to record batch export clips to history", {
err: errMsg(err),
});
}
+ setExportState("done", null);
broadcastSSE("job-complete", { jobId, result: result.data });
})
.catch((err) => {
job.status = "error";
job.error = err.message;
job.message = `Error: ${err.message}`;
+ setExportState("review", null);
broadcastSSE("job-error", { jobId, error: err.message });
});
});
@@ -1859,6 +2350,12 @@ async function main() {
log.warn("Legacy cache migration skipped", { err: errMsg(err) });
}
+ // SPA fallback: client-side routes (/, /episode, /clip/:id) resolve to the
+ // built index.html. Registered last so it never shadows /api or static assets.
+ app.get(/^(?!\/api\/).*/, (_req, res) => {
+ res.sendFile(join(__dirname, "public", "index.html"));
+ });
+
app.listen(PORT, () => {
log.info(`podcli running at http://localhost:${PORT}`);
});
diff --git a/src/utils/errors.ts b/src/utils/errors.ts
new file mode 100644
index 0000000..06facef
--- /dev/null
+++ b/src/utils/errors.ts
@@ -0,0 +1,22 @@
+/** Extract a human-readable message from an unknown thrown value. */
+export function errMsg(err: unknown): string {
+ return err instanceof Error ? err.message : String(err);
+}
+
+type McpTextResult = {
+ content: Array<{ type: "text"; text: string }>;
+ isError?: boolean;
+};
+
+/** Standard MCP error result for a caught exception. */
+export function mcpError(err: unknown): McpTextResult {
+ return {
+ content: [{ type: "text", text: `Error: ${errMsg(err)}` }],
+ isError: true,
+ };
+}
+
+/** Standard MCP success result wrapping a single text payload. */
+export function mcpText(text: string): McpTextResult {
+ return { content: [{ type: "text", text }] };
+}
diff --git a/src/utils/transcript.ts b/src/utils/transcript.ts
new file mode 100644
index 0000000..165abba
--- /dev/null
+++ b/src/utils/transcript.ts
@@ -0,0 +1,44 @@
+import type { WordTimestamp } from "../models/index.js";
+
+/**
+ * Plain-text words spoken within [start, end], for persisting on a clip's
+ * history entry. The source transcript is overwritten each session, so this
+ * is the only durable record of what the clip actually said.
+ */
+export function sliceTranscript(
+ words: WordTimestamp[] | undefined | null,
+ start: number,
+ end: number,
+): string | undefined {
+ if (!words || words.length === 0) return undefined;
+ const text = words
+ .filter((w) => w.start >= start && w.start < end)
+ .map((w) => w.word)
+ .join(" ")
+ .replace(/\s+/g, " ")
+ .trim();
+ return text || undefined;
+}
+
+/** Word objects spoken within [start, end] — used to re-burn captions on re-render. */
+export function sliceWords(
+ words: WordTimestamp[] | undefined | null,
+ start: number,
+ end: number,
+): WordTimestamp[] {
+ if (!words) return [];
+ return words.filter((w) => w.start >= start && w.start < end);
+}
+
+/** content_type of the suggestion whose range best matches [start, end]. */
+export function findContentType(
+ suggestions: Array<{ start_second: number; end_second: number; content_type?: string }> | undefined | null,
+ start: number,
+ end: number,
+): string | undefined {
+ if (!suggestions || suggestions.length === 0) return undefined;
+ const match = suggestions.find(
+ (s) => Math.abs(s.start_second - start) <= 2 && Math.abs(s.end_second - end) <= 2,
+ );
+ return match?.content_type;
+}
diff --git a/tests/test_asset_store.py b/tests/test_asset_store.py
index b26cf7b..9f9c239 100644
--- a/tests/test_asset_store.py
+++ b/tests/test_asset_store.py
@@ -108,6 +108,37 @@ class AssetStoreTests(unittest.TestCase):
# registered name points to deleted file → returns None (not the dead path)
self.assertIsNone(asset_store.resolve("missing"))
+ def test_default_logo_returns_first_existing_logo(self):
+ self.assertIsNone(asset_store.default_logo())
+ asset_store.register("l1", self._make_file("l1.png"), "logo")
+ asset_store.register("l2", self._make_file("l2.png"), "logo")
+ self.assertTrue(asset_store.default_logo().endswith("l1.png"))
+
+ def test_default_logo_skips_deleted_files(self):
+ first = self._make_file("first.png")
+ asset_store.register("first", first, "logo")
+ second = self._make_file("second.png")
+ asset_store.register("second", second, "logo")
+ os.remove(first)
+ self.assertTrue(asset_store.default_logo().endswith("second.png"))
+
+ def test_resolve_logo_prefers_explicit_over_default(self):
+ asset_store.register("fallback", self._make_file("fb.png"), "logo")
+ chosen = self._make_file("chosen.png")
+ asset_store.register("chosen", chosen, "logo")
+ self.assertEqual(asset_store.resolve_logo("chosen"), chosen)
+
+ def test_resolve_logo_falls_back_when_no_explicit(self):
+ only = self._make_file("only.png")
+ asset_store.register("only", only, "logo")
+ self.assertEqual(asset_store.resolve_logo(None), only)
+
+ def test_resolve_outro_uses_default_video(self):
+ asset_store.register("logo", self._make_file("l.png"), "logo")
+ vid = self._make_file("outro.mp4")
+ asset_store.register("outro", vid, "video")
+ self.assertEqual(asset_store.resolve_outro(None), vid)
+
def test_load_tolerates_corrupt_registry(self):
with open(self.registry_file, "w") as f:
f.write("{not valid json")
diff --git a/tests/test_youtube_sync.py b/tests/test_youtube_sync.py
new file mode 100644
index 0000000..c6bbc93
--- /dev/null
+++ b/tests/test_youtube_sync.py
@@ -0,0 +1,104 @@
+"""Tests for the YouTube CSV sync attribution and token-state helpers."""
+
+import json
+import os
+import sys
+import tempfile
+import unittest
+from unittest import mock
+
+ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
+BACKEND_ROOT = os.path.join(ROOT, "backend")
+if BACKEND_ROOT not in sys.path:
+ sys.path.insert(0, BACKEND_ROOT)
+
+from services.integrations.youtube import sync as yt_sync
+from services.integrations.youtube import client as yt_client
+
+
+class CsvSyncTests(unittest.TestCase):
+ def setUp(self):
+ self.entries = [
+ {"id": "a", "title": "Sample clip alpha", "duration": 30},
+ {"id": "b", "title": "Sample clip beta", "duration": 42},
+ ]
+ self.saved = None
+
+ def fake_save(entries):
+ self.saved = entries
+ return "clips.json"
+
+ self._patches = [
+ mock.patch.object(yt_sync, "load_clips_history", return_value=self.entries),
+ mock.patch.object(yt_sync, "save_clips_history", side_effect=fake_save),
+ mock.patch.object(yt_sync, "_refresh_learnings"),
+ ]
+ for p in self._patches:
+ p.start()
+
+ def tearDown(self):
+ for p in self._patches:
+ p.stop()
+
+ def _csv_rows(self, rows):
+ return mock.patch.object(yt_client, "parse_analytics_csv", return_value=rows)
+
+ def test_csv_sync_reports_each_match_with_score(self):
+ rows = [
+ {"title": "Sample clip alpha", "views": 1000, "retention": 55.0},
+ {"title": "Sample clip beta", "views": 500, "retention": 40.0},
+ ]
+ with self._csv_rows(rows):
+ res = yt_sync.sync_from_csv("x.csv")
+ self.assertEqual(res["matched"], 2)
+ self.assertEqual(len(res["links"]), 2)
+ for link in res["links"]:
+ self.assertIn("clip_title", link)
+ self.assertIn("row_title", link)
+ self.assertEqual(link["score"], 1.0) # exact title match
+
+ def test_csv_sync_leaves_unmatched_below_threshold(self):
+ rows = [{"title": "totally unrelated topic about cooking", "views": 9}]
+ with self._csv_rows(rows):
+ res = yt_sync.sync_from_csv("x.csv", threshold=0.6)
+ self.assertEqual(res["matched"], 0)
+ self.assertEqual(len(res["unmatched"]), 2)
+ self.assertIsNone(self.saved) # nothing saved when nothing matched
+
+ def test_csv_sync_writes_metrics_onto_matched_clip(self):
+ rows = [{"title": "Sample clip beta", "views": 500, "retention": 40.0, "ctr": 5.0}]
+ with self._csv_rows(rows):
+ yt_sync.sync_from_csv("x.csv")
+ matched = next(c for c in self.saved if c["id"] == "b")
+ self.assertEqual(matched["metrics"]["views"], 500)
+ self.assertIn("fetched_at", matched["metrics"])
+
+
+class TokenStateTests(unittest.TestCase):
+ def test_is_authorized_false_when_missing(self):
+ with mock.patch.object(yt_client, "_TOKEN_PATH", "/no/such/token.json"):
+ self.assertFalse(yt_client.is_authorized())
+
+ def test_is_authorized_false_for_corrupt_token(self):
+ with tempfile.NamedTemporaryFile("w", suffix=".json", delete=False) as f:
+ f.write("{not valid json")
+ path = f.name
+ try:
+ with mock.patch.object(yt_client, "_TOKEN_PATH", path):
+ self.assertFalse(yt_client.is_authorized())
+ finally:
+ os.unlink(path)
+
+ def test_is_authorized_true_with_refresh_token(self):
+ with tempfile.NamedTemporaryFile("w", suffix=".json", delete=False) as f:
+ json.dump({"refresh_token": "1//abc", "token": "ya29"}, f)
+ path = f.name
+ try:
+ with mock.patch.object(yt_client, "_TOKEN_PATH", path):
+ self.assertTrue(yt_client.is_authorized())
+ finally:
+ os.unlink(path)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tsconfig.json b/tsconfig.json
index 9778a7c..6113ed0 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -15,5 +15,5 @@
"sourceMap": true
},
"include": ["src/**/*"],
- "exclude": ["node_modules", "dist"]
+ "exclude": ["node_modules", "dist", "src/ui/client"]
}