Skip to content

ScriptFlow v1.0.0 — Initial Release: Auteur Script Editor & Scene Blueprint

Latest

Choose a tag to compare

@taruma taruma released this 23 Nov 05:59

Welcome to ScriptFlow

ScriptFlow is a local-first, Plain-Text-as-Truth editor and Scene Blueprint studio for authoring, visualizing, auditing, and exporting Auteur Script (v0.4.0)—a 100% platform- and model-agnostic canonical inline screenplay grammar designed for spatial, optical, temporal, and acoustic precision.

Rather than maintaining a parallel rich-text model that can drift out of sync with your script, every ScriptFlow view—Live Mode, Graph View, Source Mode, deterministic Script Supervisor diagnostics, clipboard/file exports, and programmatic JSON IR—derives synchronously from a single canonical plain-text buffer.


What's New in v1.0.0

✍️ Asymmetric 40/60 Live Mode & Source Mode

  • Two-Column Live Workspace (Resizable): Independently scrollable Phase 1 — Staging (S0) on the left (40%) and Phase 2 — Execution (S1 → SN) on the right (60%) with a draggable center divider (25%–60%, double-click or Settings → Column layout → Reset to restore 40/60), collapsible Staging cards & Execution Macro-States (Collapse all / Expand all), hover + insertion seams, and @dnd-kit drag-and-drop reordering.
  • Structured [AESTHETIC] Lookbook (AestheticBlockEditor): Pluggable 2-column live-highlighted Key: Value editor with hanging-indent token highlighting and collapsed key counts.
  • Always-Formatted ↳ Waterfall Sub-State Editing: Live -> / → / Enter Sub-State splitting, Backspace-at-start merging, ArrowUp/ArrowDown boundary navigation, Alt+↑/Alt+↓ keyboard reordering with caret preservation, toggleable 1-based S#.# Sub-State ID badges, and camera continuity rails vs. cut / cut · recall dividers.
  • Source Mode (~820px, JetBrains Mono): Collapsible Find & Replace (case-sensitive Aa, whole-word W, JavaScript Regex .* with $1/$2/$& backreferences, and All/Staging/Execution scope), Safe Symbol Rename (characters, @refs, [AESTHETIC] tokens, and [CAM ##] slots with collision blocking), direct .txt/.md/.json file drop, and non-destructive Format Script.
  • Global Paste-and-Hydrate, Undo/Redo & Timestamped Exports: Automatic multi-block paste hydration guarded against modals and AI inputs, coalesced/checkpoint plain-text Undo/Redo (Cmd/Ctrl+Z, Cmd/Ctrl+Shift+Z / Ctrl+Y), and standardized YYYYMMDD-HHMMSS-<hash8> filenames for Canonical .txt, Tagless .txt, JSON Envelope, Library Backup, and Agent Context Pack exports.
  • Narrow-Viewport Read-Only Mode (< 640px): Shifts phones and narrow split windows into a clean read-only Live Mode reader with the compact clapboard mark, 1-tap Canonical Copy, compact section headers, and browse-only Script Library.

🗺️ Read-Only Spatial Graph View ([ Live | Graph | Source ])

  • Zero-Initial-Bundle Blueprint Canvas: Lazy-loaded @xyflow/react pan-anywhere canvas (>= 640px, strictly locked cards for smooth desktop scroll-zoom/pan and 1-finger touch pan + 2-finger pinch).
  • Orientation-Aware 3-Tier Stratified Layout: L → R horizontal overview starts folded; T ↓ B 90° 3-column vertical deep-dive starts unfolded into sculpted Sub-State cards (Dialogue micro-blocks, Foley waveforms, Score cues, framed serif Title Cards) and [AESTHETIC] Key–Value lookbook swatch cards with Keys/Fold and opposite-side Source (</>) branches.
  • Cascading Continuity Pipes, Shot Chambers & RECALL Lanes: Enforces strict tier boundaries (zero Tier 1 → Tier 3 bypasses), wraps consecutive HOLD runs in Shot Chambers, keeps recalls quiet on the spine (RECALL CAM ##) at rest, and reveals stepped cascading RECALL subway lanes on demand.
  • 3-Anchor Canvas HUD & Isolation: Top-left Scene Topology & counts pill, bottom-center Two-Tier Studio Dock (L → R | T ↓ B, Split/Fold, Source, Threads, always-ready Reset, and dot-badged dimension isolator chips with Ghost / Compact + gliding SVG pulse-dot animation), bottom-right Zoom / Fit / Map / ? Help popover, and top-right read-only Object Inspector with Call Site fitView focus.

📐 Canonical v0.4.0 Grammar, Script Supervisor Linter & 6 Worked Examples

  • Lossless Core Engine (src/core/): Pure TypeScript v0.4.0 parser (parseDialogueModifiers()), character-for-character lossless lexical & clause-underline tokenizer (src/core/highlighter.ts), and metadata/topology extractor (src/core/extractor.ts).
  • 5 Declarative Live Linter Rules (LINT_RULE_REGISTRY): Covers Lens 1, Lens 4, and Lens 5 (viewport-coordinate-purity, camera-redefinition-guard, macro-state-resolution, multimodal-reference-isolation, frozen-first-frame-purity) with persisted 'off' | 'warning' | 'error' per-rule overrides in Settings → Supervisor rules and zero-shift DiagnosticDot popovers.
  • 6 Verbatim JSON Bundled Example Families (10 Scripts): The Grand Continental (default), Simit and River Pebbles, Cappadocia Balloon Panic, Robert's Machu Picchu Trail Dispatch, and multi-part branched @video1 continuation series Three Years Late and Frequency Over Force—all read-only with one-click Fork to Edit.

📚 Local-First Script Library, Import Pre-Flight, Branching & Version History

  • IndexedDB v2 Persistence & Recovery: Stores scripts and snapshots locally with stale-connection retry, localStorage fallback & mid-session reconciliation, crash-recovery mirror, and debounced + immediate structural/unload flushes.
  • Two-Pane Editorial Script Library (ScriptLibraryModal): Full-text search (auto-surfacing matching child branches), All / My Scripts / Examples tabs, Recent ▾ sorting, compact Filter ▾ popover (tab-scoped folders & frequency-sorted #tags with counts, inline search, and clickable preview pills), collapsible root-family rows, live [ Preview | Source | Lineage ] pane with theme-aware LibraryFolderCombobox, opt-in bulk Select (export/delete with lineage repair), and Clear Library confirmation with inline backup download.
  • Unified Pre-Flight Import Modal (ScriptImportModal): Whole-modal drag-and-drop inspector for .txt, .md, .markdown, and .json (AuteurEnvelope, AuteurScriptIR, AuteurScriptDraft, auteur-script-library-backup) evaluating v0.4.0 fit, lint diagnostics, and #snapshotHash duplicates before saving, supporting Import as New Script and undoable Replace Current Script.
  • Project, Lineage & Version History (VersionHistoryModal): Clickable Scene Title pill (with <GitFork /> N family badge) opens Snapshots (automatic before/after AI & Pre-Restore checkpoints + permanent manual Milestones, diff viewer, undoable restore, snapshot branching) and Lineage Map (ScriptLineageTree with branchNote tracking, Switch to Script, and Branch from Here).

✨ Optional Browser-Local BYOK AI Assistant & Quick Scan

  • Streaming Interactions API Canvas (AiAssistantSidebar): Lazy-loaded resizable right-side panel using browser-direct @google/genai streaming (previous_interaction_id, 8-round tool loop, AbortSignal) across Gemini 4 (gemini-4-hydrogen, gemini-4-neon, gemini-4-carbon), gemini-3.8-flash, and gemini-3.5-flash-lite with Low/Medium/High reasoning and localStorage / sessionStorage BYOK API key management.
  • Unified Focus Bar (Auto / Draft / Refine / Audit) & 10 Local Tools: Editor-state-aware tool pruning, recent-edit diff injection, 10 strictly read-only/staging tools (get_script_overview, get_script_source, inspect_lens_slice, propose_script_patch, propose_text_replace, propose_script_title, propose_script_draft, report_audit_review, load_auteur_skill, opt-in ask_question via Ask First), and suggestions-first review cards (including smart sibling Audit Fix rebasing and transactional Apply All).
  • Layer 2.5 Decisions API Quick Scan: Optional fast semantic pre-check (gemini-decision-1 on v1beta) with Strict/Balanced/Lenient sensitivity across 15 AST-filtered atomic rules (QUICK_SCAN_RULES_VERSION = "0.4.0-qs2"), QuickScanCard, and 1-click Deep Audit escalation.
  • Multimodal Scene Brief, 5-Tab Context Inspector & Live Indicators: AiBriefModal (local images/text, Gemini Files API batch upload & 48h cloud browser, YouTube URLs with Static/Agentic toggle), 5-tab AiContextInspectorModal (Live Prompt Preview, Foundational Craft, Skills & Extensions, Function Tools, Quick Scan Rules, plus unified JSON Export & selective Merge/Replace Import), Live Mode hover-to-diff margin indicators (AiPatchIndicator, AiQuickScanIndicator), USD cost tracking, and opt-in sanitized AiTraceModal.

🧩 Programmatic JSON IR, Debug Inspector & 4-Mode Themes

  • Zod JSON Engine: AuteurScriptIR, AuteurEnvelope, toAuteurIR() / fromAuteurIR(), compileAuteurDraft(), transactional applyAuteurPatch(), projectAuteurPatchPreview(), Composable Lens Slicer (AUDIT_LENS_PRESETS), validateAuteurReview(), getAuteurJsonSchemas(), and lazy-loaded 5-tab JsonIrDebugDrawer.
  • Themes, Accessibility & Safeguards: Light (default), Warm, Dark, and Pure Black (OLED) themes, script text-size presets (13px–16px), toggleable clause underlines and S#.# IDs, ConfirmDialog, ErrorBoundary crash recovery, and aria-modal="true" / data-native-undo="true" isolation.

Editor Shortcuts

Shortcut Action Description
⌘Z / Ctrl+Z Undo Undo document edit across Live & Source modes
⇧⌘Z / Ctrl+Y Redo Redo document edit across Live & Source modes
-> / Enter Chain Sub-State Split/chain next ↳ Sub-State in Live Execution
Alt + ↑ / ↓ Move Sub-State Reorder focused Sub-State inside its Macro-State
Backspace Merge Sub-State Merge indented ↳ Sub-State back at column 0
Esc Close / Blur Close active modal/popover, clear Graph trace, or blur Sub-State

Getting Started

# 1. Clone the repository
git clone https://github.com/taruma/ScriptFlow.git
cd ScriptFlow

# 2. Install dependencies
npm install

# 3. Start local development studio (http://localhost:3000)
npm run dev

Quality & Verification

  • Unit Test Suite: 347 deterministic tests passing across 30 Vitest files (npm test).
  • Type Check & Production Build: Strict tsc --noEmit (npm run lint) and Vite production bundling (npm run build) exit 0.

Documentation & Sister Suite