π v1.2.0 Release Notes β’ π Grammar Contract β’ πΊοΈ Graph View β’ π¬ Audit Rules β’ π§© JSON IR Spec β’ β¨ AI Walkthrough
ScriptFlow (v1.2.0) 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.
Live Mode, Graph View, Source Mode, deterministic Script Supervisor diagnostics, exports, and programmatic JSON IR all derive synchronously from a single canonical plain-text bufferβnever from a parallel mutable UI document tree.
Version Separation Note
- ScriptFlow Application (
v1.2.0): Tracks the editor UI, Scene Blueprint Graph View, multi-script library & lineage, version history, and optional browser-local BYOK AI Assistant inpackage.json,CHANGELOG.md, anddocs/release/v1.2.0.md.- Auteur Script Specification (
v0.4.0β Locked): Tracks the canonical inline syntax, deterministic Script Supervisor linter, and programmatic JSON IR schema (AUTEUR_IR_SCHEMA_VERSION = "0.4.0") separately indocs/SPEC_CHANGELOG.md.
-
Asymmetric
40/60Live Mode & Source Mode- Independently scrollable Phase 1 β Staging (
S0) and Phase 2 β Execution (S1βSN) columns on desktop (lg:) with a draggable split divider (25%β60%), collapsible cards/Macro-States, and a structured 2-column[AESTHETIC]Lookbook editor. - Always-formatted
β³Waterfall Sub-State editing with toggleable 1-basedS#.#badges, live->/Entersplitting,Backspacemerging,ArrowUp/ArrowDownnavigation,Alt+β/Alt+βkeyboard Sub-State reordering, hover+seams,@dnd-kitdrag-and-drop reordering, global Paste-and-Hydrate, and active-draft document Undo/Redo (Cmd/Ctrl+Z,Cmd/Ctrl+Shift+Z/Ctrl+Y). - Centered single-document Source Mode (
~820pxinJetBrains Mono) with Find & Replace (case, whole-word, Regex with$1/$2backreferences, phase scope), Safe Symbol Rename (characters,@refs, tokens,[CAM ##]slots), direct.txt/.md/.jsonfile drop, non-destructive Format Script, timestamped/content-hashed exports (Canonical .txt,Tagless .txt,JSON Envelope), and automatic read-only reader mode on narrow< 640pxviewports.
- Independently scrollable Phase 1 β Staging (
-
Read-Only Spatial Graph View (
[ Live | Graph | Source ])- Lazy-loaded
@xyflow/reactpan-anywhere blueprint canvas (>= 640px, locked cards for smooth desktop & touch panning) visualizing Phase 1 β Staging (MB#), an intermediate Inferred Objects rail (Characters,[AESTHETIC]Tokens +@ref, Staging-only Visual Refs, Camera Setups), and Phase 2 β Execution (S1 β SN) wrapped in Shot Chambers with curvedRECALLarcs. - Dual-axis
L β R/T β Bauto-layout (L β Rstarts folded;T β Bstarts unfolded),[AESTHETIC]Lookbook key-value expansion (Keys/Fold), perpendicular Sub-State splitting (Split/Fold), opposite-sideSourceprovenance branches, cascadingThreadsorthogonal blueprint pipes, a scene-aware Sub-State Isolator Dock (Ghostvs.Compactwith gliding pulse-dot animation), a read-only Object Inspector with Call SitefitViewfocus, always-readyReset, and 4-theme parity. Seedocs/GRAPH_VIEW.md.
- Lazy-loaded
-
Deterministic Script Supervisor Linter & 6 Worked Example Families
- 4 pure, synchronous linter rules spanning
Lens 1,Lens 4, andLens 5(viewport-coordinate-purity,camera-redefinition-guard,macro-state-resolution,multimodal-reference-isolationwith Declare-Once-in-Staging) with persisted per-rule'off' | 'warning' | 'error'overrides in Settings and zero-shiftDiagnosticDotpopovers. - 6 bundled read-only verbatim JSON example families (10 scripts total, defaulting to The Grand Continental alongside Simit and River Pebbles, Cappadocia Balloon Panic, Robert's Machu Picchu Trail Dispatch, and branched
@video1continuation series Three Years Late and Frequency Over Force) covering all scene topologies with one-click Fork to Edit.
- 4 pure, synchronous linter rules spanning
-
Local-First Script & Asset Libraries, URL Deep-Linking, Import Pre-Flight, Branching & Version History
- Browser-local IndexedDB
v4persistence (scripts,snapshots, detachedaiSessions, and SHA-256 deduplicatedreferenceAssetsAsset Library stores) withlocalStoragefallback & automatic mid-session reconciliation, crash-recovery mirror, debounced + immediate unload flushes, and mutually exclusive URL deep-linking (/?example=,/?url=,/?agents=). - Three-pane editorial Script Library (
ScriptLibraryModal) with a slim Navigation Rail (All Active,Pinned,Unfiled, dynamicFolderswith inline rename/merge,Archived,Examples), Compact/Comfortable row density, multi-tag AND filtering, natural numeric sorting,Shift+Clickbulk organization (LibraryBulkBar), tag autocomplete, Archive lifecycle (Unarchivein Top Bar / Version History), full-library JSON backup, and globalCmd/Ctrl+KQuick Switcher (QuickSwitcherModal). - Unified pre-flight Import / Restore modal (
ScriptImportModal) evaluatingv0.4.0structural fit, lint diagnostics, and#snapshotHashduplicates before saving, alongside Project & Version History (VersionHistoryModal) with automatic pre/post-AI andPre-Restorecheckpoints, permanent manual Milestones,branchNotetracking, and interactiveLineage Map(ScriptLineageTree).
- Browser-local IndexedDB
-
Optional Browser-Local BYOK AI Assistant, Session History & Layer 2.5 Quick Scan
- Lazy-loaded right-side AI Canvas Sidebar (
@google/genaiInteractions API streaming across Gemini 4Hydrogen/Neon/Carbon,Gemini 3.8 Flash, andGemini 3.5 Flash-Lite, withLow/Medium/Highreasoning, cache-stable 3-Zone prompt prefixing, andlocalStorageorsessionStorageBYOK key storage). - Action-oriented
Plan/Write/Auditfocus bar keeping all 7 strictly read-only/staging text-first browser tools cache-frozen in Zone 1 (Planread-only brainstorming with 1-clickProceed to Write β,Writedrafting/editing + phase-level Scope selector,AuditScript Supervisor reviews), delta-only turn context & recent-edit diff tracking (Pacing ledger+ round-boundaryreadGuard), 8 extension skills (0.4.0-k7, includingdraft_craft,execution_craft, and default-pinnedproduction_guardrails), default-on stepped1 / Npause-and-resume clarifying interviews (ask_questionwith batch-independence), compact collapsible Layer 2.5 Quick Scan inAudit(gemini-decision-1onv1beta,0.4.0-qs3, 16 atomic rules), detached AI Session History (AiSessionHistoryModalwith session forking,<prior_session_recap>expired-chain bridging, scoped backup/preflight import/cleanup modals, and.md/ evaluation-ready Full Conversation.json/ Full Payload.jsonexports), multimodal Scene Brief & References modal (withAsset Librarypicker & opt-in Save), per-turn composer+attachments (Files API,Gemini Cloud Files (48h)β¦,YouTube URLβ¦, XML<tag>text sections), collapsible turn thinking/activity timeline, Markdown-driven AI Assistant Guide (?), 5-tab Context Inspector with unified JSON pack Export/Import, Live Mode hover-to-diff margin indicators, prompt cache hit/miss telemetry & USD cost tracking, and opt-in sanitized Trace Inspector.
- Lazy-loaded right-side AI Canvas Sidebar (
-
Programmatic JSON IR, Debug Inspector & 4-Mode Themes
- Pure TypeScript + Zod
AuteurScriptIR,AuteurEnvelope, transactionalapplyAuteurPatch(),projectAuteurPatchPreview(), Composable Lens Slicer (AUDIT_LENS_PRESETS),getAuteurJsonSchemas(), and zero-cost-when-closed 5-tabJsonIrDebugDrawer. - 4-mode semantic theme system (Light default, Warm, Dark, Pure Black OLED), text-size presets (
13pxβ16px), toggleable clause underlines andS#.#IDs,ConfirmDialog, andErrorBoundarycrash recovery.
- Pure TypeScript + Zod
Every script is plain text partitioned into a strict three-level hierarchy:
- Macro-Block (
MB#) β Document-level sections separated by blank lines across Phase 1 β Staging (S0) ([INTENT],[LOGIC],[AESTHETIC],[OPENING],[CONTINUITY PROTOCOL], custom Staging blocks) and Phase 2 β Execution ([EXECUTION]). - Macro-State (
S#) β A single non-empty line inside[EXECUTION](S1,S2, β¦) representing one atomic stretch of screen time. - Sub-State (
S#.#) β Each->-chained, single-dimension unit inside a Macro-State line, led by a Sub-State Tag ([CAM 01],[ACT],[BLOCK],[LIGHT],[STATE IN],[STATE OUT], Tier-2 tags) or inline syntax (Speaker says (delivery) {line},<foley>,(score),γon-screen textγ).
[INTENT]
Create a tense quiet handoff in a dim diner featuring @image1 as Miller (voice: @audio1).
[LOGIC]
Keep the counter as the 180-degree axis with Miller frame-left facing screen-right. No subtitles appear on screen.
[AESTHETIC]
Medium: 35mm film, natural tungsten practicals
Location: late-night chrome diner -> LOC01
Audio: soft refrigerator hum, distant rain on glass
[OPENING]
MS at eye level across the laminate counter in LOC01. Frame-left, Miller sits facing screen-right with a brass key resting flat under his right palm.
[EXECUTION]
[CAM 01] MS across counter -> [ACT] Miller slides the brass key forward with his right hand -> <metal scrape>
[CAM 01] -> Miller says (low, steady) {Check the locker before dawn.} -> [ACT] Miller folds his right hand back onto his lap
π For locked syntax regexes, Tagless export rules, and all 4 linter contracts, see the Grammar Contract and Glossary.
| Shortcut | Action | Context |
|---|---|---|
βK / Ctrl+K |
Quick Switch | Open Spotlight script switcher across active, archived, and example scripts |
βZ / Ctrl+Z |
Undo | Document edits (Live & Source modes) |
β§βZ / Ctrl+Y |
Redo | Document edits (Live & Source modes) |
-> / Enter |
Chain Sub-State | Focused Sub-State in Live Execution |
Alt + β / β |
Move Sub-State | Reorder focused Sub-State inside its Macro-State |
Backspace |
Merge Sub-State | At column 0 of an indented β³ Sub-State |
β / β |
Navigate | Sub-State boundaries in Live Mode, or rows in Library / History |
Esc |
Dismiss / Blur | Close active modal/popover, clear Graph trace, or blur Sub-State |
- Node.js (v18+ recommended) and npm
# 1. Clone the repository
git clone https://github.com/taruma/ScriptFlow.git
cd ScriptFlow
# 2. Install dependencies
npm install
# 3. Start local development server
npm run devOpen http://localhost:3000 in your browser.
ScriptFlow runs 100% client-side in your browserβno backend server or proxy is required. All scripts, version snapshots, display preferences, and custom skills stay strictly local in browser IndexedDB and localStorage. The AI Assistant is completely optional: if enabled, your BYOK Gemini API key is stored locally in localStorage (or tab-scoped sessionStorage when Session only is enabled) and sent directly from your browser to the Gemini API only when you submit a prompt, run a Quick Scan, or manage Brief Files API attachments.
| Command | Task | Description |
|---|---|---|
npm run dev |
Local Studio | Starts Vite development server at http://localhost:3000 |
npm test |
Unit Test Suite | Runs 431 deterministic tests across 37 files via Vitest |
npm run lint |
Type Check | Runs strict TypeScript type-checking (tsc --noEmit) |
npm run build |
Typecheck & Bundle | Runs tsc --noEmit && vite build to emit dist/ |
npm run preview |
Preview Build | Serves the production Vite build locally |
ScriptFlow enforces a strict pure-core boundary: src/core/ contains zero React, zero DOM, and zero localStorage dependencies, deriving AST, extracted metadata, diagnostics, highlights, and JSON envelopes synchronously from rawText.
graph TD
L1["Pure Core Engine (src/core/: AST, Parser, Highlighter, Extractor, Linter, History, JSON IR/Patch/Slicer)"] --> L2["Services & UI State (src/services/: AI Knowledge, Tools, Gemini Β· src/ui/: Library, Graph Layout, Labels, Settings)"]
L2 --> L3["Presentational React Shell (src/components/: Live 40/60, Graph View, Source, Library, History, AI Canvas, Debug)"]
| Document | Purpose |
|---|---|
docs/release/v1.2.0.md |
ScriptFlow v1.2.0 release notes (3-Pane Library & Archive, IndexedDB v4 Asset Library, Plan Β· Write Β· Audit, 7-Tool Harness, Composer Attachments & Cache Telemetry). |
docs/release/v1.1.0.md |
ScriptFlow v1.1.0 release notes (AI Session History, Cache-Stable 3-Zone Prompts, Stepped ask_question, URL Deep-Linking). |
docs/release/v1.0.0.md |
ScriptFlow v1.0.0 initial release notes, feature overview, and verification summary. |
CHANGELOG.md |
Keep-a-Changelog application release history (v1.2.0). |
AGENTS.md |
Operational engineering contract, architectural invariants, extension recipes, and Definition of Done. |
docs/SPEC_CHANGELOG.md |
Version history for the Auteur Script v0.4.0 grammar, linter, and JSON IR specification. |
docs/GLOSSARY.md |
Authoritative Auteur Script vocabulary (Macro-Block, Macro-State, Sub-State, Sub-State Tag, inline [BLOCK]) mapped to src/core/types.ts. |
docs/GRAMMAR_CONTRACT.md |
Locked v0.4.0 syntax regexes, parser edge cases, Tagless export rules, and deterministic linter contracts. |
docs/SCRIPT_SUPERVISOR_AUDIT_RULES.md |
Human-readable checklist of all 4 Scene Topologies, all 4 live linter rules, and all 5 Script Supervisor Audit Lenses (Lens 1βLens 5). |
docs/JSON_IR_SPEC.md |
Programmatic AuteurScriptIR, AuteurEnvelope, transactional AuteurPatch, Composable Lens Slicer, and Zod JSON Schema contracts. |
docs/ARCHITECTURE.md |
Plain-Text-as-Truth data flow, full module map, pure serializer contracts, and global Paste/Undo guards. |
docs/UI_PHILOSOPHY.md |
Asymmetric 40/60 Live, Source & Graph View layout principles, Waterfall editing, Library/History UX, AI Canvas UX, and 4-mode theme palette. |
docs/GRAPH_VIEW.md |
Technical architecture & plain-text extraction reference for the read-only Graph View (src/ui/canvas/ + src/components/canvas/). |
docs/UI_LABELING.md |
Single Source of Truth UI copy contract (APP_META, MACRO_BLOCK_META, UI_LABELS), Auteur Script UI vocabulary, and theme labels. |
docs/AI_ASSISTANT_WALKTHROUGH.md |
End-to-end guide to BYOK setup, Plan/Write/Audit focus, Proceed to Write, all 7 local AI tools, Quick Scan, Brief modal, Context Inspector, and Trace Inspector. |
docs/AI_SKILLS_GUIDE.md |
User & developer SSOT for authoring, evaluating, and cataloging Markdown AI skills (plus when to build a custom Function Tool). |
- Pure Core & Schema Engine: TypeScript (
7.0), Zod (v4) - UI & Styling: React 19, Tailwind CSS v4, Lucide React, Vite 8
- Graph View & Drag-and-Drop: React Flow (
@xyflow/react) (v13),@dnd-kit - Optional AI Runtime (BYOK):
@google/genai(Interactions API,v1betaDecisions API, Files API) - Local Persistence & Testing: Browser IndexedDB +
localStorage, Vitest (431tests across37files)
- Created by: Taruma Sakti (@taruma)
- Sister Suite Projects:
- Attribution: If ScriptFlow inspires your writing, toolmaking, or cinema study, a shout-out or link back to github.com/taruma/ScriptFlow is always appreciated!
Warning
Vibe-Coded Disclaimer: This software was built through exploratory AI-assisted pair programming and rapid iterations. While backed by 431 unit tests and strict TypeScript checks, always back up important scripts (via File βΎ β Backup All Scripts).
This project is licensed under the MIT License.

