Context should be an operation, not a slogan
An AI screenplay assistant needs context, but “largest context window” is a weak product design. The relevant question is: Can the system locate the right dramatic material, show what it read, and return an edit to the real screenplay?
Laper answers with browser-side tools. The agent does not receive an invisible permanent copy of every project. It asks the active editor for structured data in an explicit scope, using identifiers from the current Loro document.
This is both more honest and more useful than claiming that every AI request always carries an entire screenplay.
Six ways to read the draft
The read_script tool supports six modes:
| Mode | What it returns | Appropriate use |
|---|---|---|
cursor | Context around an explicit cursor position | Continue or revise the passage the writer is working on |
outline | A compact scene map | Find structure before opening individual scenes |
scene | The screenplay nodes inside one real scene ID | Dialogue, pacing, scene function, or storyboard preparation |
range | A bounded line range | Compare adjacent passages or inspect a sequence |
node | A stable node plus configurable context before and after | Patch or discuss one known block without guessing |
full | Up to 800 screenplay nodes | Whole-draft work on scripts within the bound, or a first pass before targeted reads |
When full mode reaches the 800-node boundary, it reports that the result was truncated and recommends outline plus scene reads. That warning is part of the product contract. It prevents a model from pretending it saw an ending that never reached the tool response.
The default editing guidance is even narrower: if the user says “rewrite this” or “continue here,” the agent should first call read_current_script_focus, which returns the last valid cursor area and surrounding scene context. It should not fetch a full draft for a local change.
Episodes and nodes are explicit
Multi-episode projects make implicit context dangerous. Every script read that targets an episode requires a real episode_id obtained from the project. Stable scene_id and node_id values must come from previous reads; the agent is instructed not to invent them.
That discipline creates a verifiable sequence:
- list or resolve the actual episode;
- read the outline or current focus;
- locate a real scene or node;
- diagnose or propose the change;
- apply an explicit edit to those identifiers;
- read again when necessary to verify the result.
It is slower than a hallucinated one-shot answer and much faster than repairing edits written into the wrong episode.
Writing returns through the live editor
Laper's script-editing tools do not mutate a detached database row. They execute against the active Plate editor. Inserts and patches use screenplay node operations, then pass through the same operation bridge that handles human input and into the Loro document.
This preserves three essential properties:
- the writer can see the change in the real page;
- screenplay element types survive the operation;
- collaborators receive the edit through the document's normal sync path.
If the editor is not writable, the context is stale, or an identifier no longer exists, the tools fail closed and instruct the agent to re-read. The model is not allowed to “best guess” a target.
Different tasks deserve different context plans
A good AI workflow is compositional:
- Line revision: current focus, scene goal, then a small patch.
- Character consistency: character entity data, outline, and the scenes where the character appears.
- Second-act diagnosis: outline first, then midpoint and pressure sequences.
- Storyboard planning: current scene's typed screenplay nodes plus known characters and adjacent shot references.
- Series work: episode list and outline summaries before selecting a specific episode.
The official AI Script Doctor turns that tool access into a diagnosis-first method. AI storyboarding uses a different context plan because a shot list needs scene action, characters, and visual continuity rather than a whole-project literary analysis.
The writer can inspect the boundary
The strongest trust feature is not a bigger number. It is a boundary the product can explain. Laper can say which scope was read, when a result was truncated, which node will be changed, and how the edit returns to the document.
That makes AI assistance accountable to the screenplay. For the complete product model, see AI screenwriting software built around the script.