Stream Facility

Development Log

A running record of what's been built, what's underway, and what's on the horizon. Updated as the platform grows.

Last updated 2026-07-12

74

Features built

0

In progress

2

Planned

StudioBuilt
2026-07

Studio: Scene Version Control

Authors can snapshot any scene, chapter, or entire manuscript with a single click. Revisions are stored per-scene and can be browsed and restored without leaving the Write view. Beta readers see badges showing which scenes are new or have been revised since their last read. Sidebar version buttons keep controls in view while scrolling through long manuscripts.

  • ·scene_revisions collection stores per-scene snapshots: content, wordCount, optional label, createdAt — bulk saves share the same timestamp for easy grouping
  • ·Per-scene ⎘ (Save Version) and ⎇ (Version History) in the scene header; history panel rendered above the editor so it is immediately visible without scrolling past prose
  • ·Word count and version buttons styled in gold (text-sf-accent / text-sf-accent/60) to match chapter and scene headings
  • ·Manuscript-level bulk checkpoint: '⎘ Save Manuscript Version' toolbar button; saves all scenes in a single insertMany; inline label input + '✓ N scenes saved' confirmation
  • ·Chapter-level checkpoint via POST /api/studio/[draftId]/checkpoint with optional chapterId — same route, scoped to one chapter
  • ·Left sidebar widened from w-64 to w-80; ⎘ per chapter, ⎇ + ⎘ per scene, always visible while scrolling; ⎇ scrolls to the scene and opens its history panel
  • ·Sidebar history opener uses useRef<Map<string, () => void>> registration via an always-updating ref pattern to avoid stale closures across multiple concurrent TipTap instances
  • ·Beta reader badges: scene_revision_reads collection tracks when each reader opens a scene; green Revised badge if revised since last read, purple New if never opened
  • ·Plan view amber dot on scenes with beta comments newer than the latest revision
StudioBuilt
2026-07

Studio Write: Codex Entity Highlighting

Entity names from the codex are now highlighted in amber in the Write view as you type. Hovering any highlighted name shows a popup with the entity's current world-state — era-aware bio, role, status, and portrait. Persona aliases map to their parent character's card.

  • ·ProseMirror decoration plugin — no changes to doc structure, pure visual overlay
  • ·GET /api/studio/[draftId]/codex-entities fetches all entities for the draft's linked world
  • ·Longer names matched first so 'Amelia Williams' takes precedence over 'Amelia'
  • ·Persona aliases highlighted but popup shows the canonical parent character's codex card
  • ·Hover popup fetches /api/world-state with the scene's era context for era-accurate state
  • ·Popup shows portrait/image, type badge, role (accent), bio (3-line clamp), and link to codex
  • ·160ms hover delay prevents flicker; popup hover cancels the close timer
StudioBuilt
2026-07

Studio: Write Tab, Scene Persistence & Navigation Fixes

A Write tab now appears in the Studio toolbar alongside Plan, Review, Chat, and Export. The last scene visited in the Write view is persisted to localStorage so clicking Write returns you to exactly where you left off. Two bugs fixed: the Review page crashed with a MongoDB projection error, and the /write fallback redirect returned 404.

  • ·Write tab added to StudioShell toolbar; links directly to the last-visited scene
  • ·Last scene stored in localStorage under studio-last-scene-{draftId}
  • ·Fallback /write route (server component) redirects to the first scene when no stored scene exists
  • ·Scroll-to-scene on Write load deferred 300ms so TipTap editors render at full height first
  • ·Review fix: invalid MongoDB mixed inclusion/exclusion projection replaced with conditional pure-inclusion
  • ·Redirect fix: scene ownership verified via the draft document (scenes don't store authorId)
StudioBuilt
2026-07

Studio: In-World Date Anchoring

Acts and chapters in the Studio Plan view can now be anchored to an in-world era and date range. A clock icon on each row opens an inline date panel with an era selector and begins/ends text fields. The write page sidebar shows the active chapter's era and date below the chapter name.

  • ·Click the ◷ icon on any act or chapter row to set its in-world period
  • ·Era dropdown pulls from the world linked to the draft's book
  • ·Begins and ends date labels stored on story_acts and story_chapters documents
  • ·Date badge appears on the row when set; accent-colored ◷ icon stays visible as an indicator
  • ·Write page sidebar shows era · begins date below each chapter name
  • ·Creates a unified coordinate system: every scene position maps to both a narrative coordinate and a world date
StudioBuilt
2026-07

Continuous Scroll Write View

All scenes render simultaneously in one scrollable canvas, each with its own editor. No more clicking to load the next scene — scroll through the entire draft, click any scene in the sidebar to jump directly to it.

  • ·Every scene has an independent TipTap editor instance
  • ·Toolbar applies to whichever scene is focused
  • ·Sidebar scene links scroll and auto-focus the target scene
  • ·Scene Break and Chapter Break work on the active scene at cursor position
StudioBuilt
2026-07

Plan View: Expand/Collapse All & Inline Scene Preview

Expand or collapse the entire draft outline in one click. Reveal any scene's prose directly in the Plan view without navigating to Write — useful for reviewing structure and content together.

  • ·Expand All / Collapse All buttons in the Plan view header
  • ·Per-scene toggle reveals inline prose preview below the scene row
  • ·Content lazy-fetched on first expand and cached for repeated toggles
  • ·Individual node toggles continue to work independently
StudioBuilt
2026-07

Draft Access Mode & Status

Authors control who can read their manuscript via an access mode toggle on the draft. A status badge marks drafts as in-progress or finished.

  • ·Private: manuscript hidden on the public book page (default)
  • ·Free: full prose visible to any visitor
  • ·Paid: chapter/scene structure visible; scene content gated
  • ·Status badge (Draft / Finished) shown in Plan view
StudioBuilt
2026-07

ReadingTree on Public Book Page

The public book detail page embeds the manuscript as an expandable act → chapter → scene tree. Approved beta readers get full prose access regardless of the draft's public access mode.

  • ·TipTap JSON rendered inline — no editor overhead
  • ·Reading progress checkboxes per scene, stored per user
  • ·Expand All / Collapse All for the full tree
  • ·Beta reader access granted via approved application with active deadline
  • ·Multi-campaign support: access granted if approved under any campaign for the book
StudioBuilt
2026-06

Studio — Story Creator (Phases 1–4)

Full writing suite at /dashboard/studio. Four views per draft: Plan (structural outline), Write (TipTap editor), Review (word counts + codex heatmap), Chat (AI conversation). Available to Indie and Pro tiers.

  • ·Acts → Chapters → Scenes hierarchy with drag-and-drop reorder
  • ·Inline Scene Break and Chapter Break in the Write view
  • ·Codex entity heatmap in Review (mentions per scene across all 14 entity types)
  • ·AI Chat with +Context picker (Pro only)
  • ·DOCX / Markdown / Plain Text export with scope selector
StudioBuilt
2026-06

Studio — AI Write Assist & Prompt Library

A '✨ Write' panel in the Write view. Choose a prompt template, fill in variables, and the AI streams prose into a preview. Insert at cursor, regenerate, or fork the prompt into a personal library.

  • ·6 built-in prompts: Draft from Beat, Continue Scene, First Draft, Expand, Dialogue, Rewrite
  • ·Auto-injected context: draft title, chapter label, current scene content
  • ·User prompt library with fork-from-system support
  • ·Pro only; requires ANTHROPIC_API_KEY
StudioBuilt
2026-06

Studio — Manuscript Import (DOCX / PDF)

Upload a DOCX or PDF to the Studio draft list and have it land as a fully structured draft — acts, chapters, and scenes auto-detected from the heading hierarchy.

  • ·DOCX headings (H1/H2/H3) map to acts, chapters, and scenes
  • ·Inline marks preserved: bold, italic, underline, strikethrough
  • ·PDF imported as a single scene; author splits manually with Break tools
  • ·Drag-and-drop import dialog with success screen and stats
StudioBuilt
2026-07

Studio AI — User API Keys & Multi-Provider

Authors supply their own API key from Anthropic, OpenAI, or OpenRouter. Stream Facility does not provide AI access — authors pay their own provider directly. Keys are AES-256-GCM encrypted at rest and never returned to the client.

  • ·Three providers: Anthropic, OpenAI, OpenRouter (200+ models via one key)
  • ·Keys encrypted with AES-256-GCM — only the model and active provider are ever returned
  • ·Per-provider model selector with curated list (Sonnet, Opus, Haiku, GPT-4o, Gemini, Llama, Mistral…)
  • ·Managed in Dashboard → Profile → AI Keys
  • ·Chat and Write Assist automatically use whichever provider and model is active
StudioBuilt
2026-07

Studio: Scene-Level Date Anchoring & Structured WorldDates

In-World Date Anchoring extended to scene level. Acts, chapters, and scenes now store full structured WorldDate objects (not just label strings), enabling sort-key-based range queries for Write Assist and entity-level chat.

  • ·◷ icon on scene rows in Plan view opens inline date panel — same era selector and begins/ends fields as act/chapter rows
  • ·story_scenes gains eraId, eraName, inWorldBeginsDate/Label, inWorldEndsDate/Label
  • ·story_acts and story_chapters gain inWorldBeginsDate/inWorldEndsDate WorldDate objects alongside existing label strings
  • ·PATCH handlers compute inWorldBeginsSortKey / inWorldEndsSortKey via worldDateToSortKey() and store them for range queries
  • ·resolveEntityState() utility in src/lib/studio/resolveEntityState.ts: merges entity_pages snapshot onto base entity at a given sortKey + optional eraId
StudioBuilt
2026-07

Studio Write Assist: World State Integration

Write Assist now delivers era-accurate codex context to the AI. Entity descriptions in the prompt reflect the entity's state at the scene's exact position in the world timeline — resolved via the active entity_pages snapshot, not the base profile.

  • ·generate route extracts sceneSortKey and sceneEraId from the scene document
  • ·Each context ref resolved via resolveEntityState(db, entityId, collection, authorId, sceneSortKey, sceneEraId)
  • ·resolveEntityState finds the entity_pages snapshot covering the sort key and merges snapshot fields onto the base entity
  • ·If a character is a 'village guard' in Year 847 and a 'hero' in Year 850, the AI receives the Year 847 description when the scene is anchored there
StudioBuilt
2026-07

Entity-Level AI Chat — World, Book, Series

World, book, and series detail pages now have a Chat tab for AI conversations anchored to that entity's full context — codex, draft structure, or series scope.

  • ·Shared EntityChatView component with ContextGroup, ContextRef, MessageBubble types
  • ·World chat: pulls from any of the 21 codex entity collections via ALLOWED_ENTITY_COLLECTIONS allowlist + CODEX_CATEGORIES grouping
  • ·Book chat: scoped to the book's linked world and draft structure
  • ·Series chat: scoped to the series and its associated books
  • ·All three routes use the author's configured AI provider via getAiConfig() and createChatStream() — same path as Studio Chat
  • ·Chat history persisted per author per entity
StudioBuilt
2026-07

Write Assist — Alias Reveal Gating

The AI generate route now filters aliases from entity context based on the author's current chapter position, preventing spoiler aliases from leaking into the prompt before they're narratively revealed.

  • ·formatEntity(doc, opts?) accepts { bookId, chapterNum } and filters aliases where revealedIn === bookId AND revealChapter > chapterNum
  • ·chapter.order fetched from story_chapters and converted to 1-indexed chapterNum; draft.bookId passed as bookId
  • ·Aliases without revealedIn, or gated to a different book, are always shown

This log tracks platform features, not individual content. For questions or feedback, get in touch.