About
What it does
Ask about the world you are building in Scrivener, and seal what you have written. Open the folder that holds your .scriv in Craft and say $scrivener. It reads the project as Scrivener saved it: the binder, every character, setting and language sheet, the realms with the places and people filed under them, and the template sheets new pages start from. When you ask, it seals your writing. Each page is drawn as a picture and sealed by $veil, and a cover carries one digest over every page, so you can prove later what you had written and when. It never changes your project.
What you can ask
$scrivener who lives in the harbor town, and what do their sheets still leave blank?
$scrivener read my conlang page with its notes, and list the words it has so far
$scrivener what template sheets does this project have, and what does a new character sheet ask for?
$scrivener map the realms: places, the characters in each, which places are on the site
$scrivener seal the manuscript
$scrivener seal the two newest character sheets
$scrivener has anything changed since the last seal?
$scrivener whose page is shared/page.png?Craft writes the call from your request and shows it on its agent map as scrivener-1. A seal shows each page's veil call under it.
What you get
- The binder. Every folder and page, with its path (
Characters/Saltmere/Harbor/Mira Coil), its kind, its word count, the template sheet it was made from, and your custom metadata ("On the site"). The trash, research and the template sheets are marked. - Sheets as fields. A character, setting or language page is read by its template's own headings: the name, the line under it split into its parts (Age, Location; Real World Origin, Region), and what is written under each heading. A heading left empty is listed as still to fill. With no page named, you get the template sheets themselves, which are the presets a new page starts from.
- The world. Realms are the folders under Places. Each realm lists its places and the characters filed in a folder of the same name under Characters, with the place below that. You also get languages, world-building pages, and characters filed elsewhere, kept with their folder ("Wanderers").
- Pages read. A page's text and synopsis, and its document notes when you ask, which is often where a lexicon lives.
- A seal. It is written to
seals/<project>/<time>/, beside the.scriv: pages/: each page's text drawn at US Letter, 200 dpi. A long page goes on to as many sheets as it needs.veil/: veil's seal of every picture.cover.png: the project, the day, and the digest over every page's text, sealed too.seal.json(scrivener-seal/1): each page's binder path, the SHA-256 of its text, and the pictures and seal ids.- Craft opens the cover and the first pages in Canvas.
- A verify.
- holds: every page reads as it was sealed.
- changed: it names the pages whose text differs and the ones that are gone (deleted, or moved to the trash).
- tampered:
seal.jsonwas edited after the seal. - With
detect, veil also finds each page's seal in its picture. Given a picture found elsewhere, veil names the seal it holds, and the seals beside the project name the page.
How it works
- It reads, it never writes. Nothing inside the
.scrivis ever written. Scrivener owns its package, and a write while it has the project open is lost or corrupts it. If Scrivener has the project open, the answer says it was read as last saved. - It finds the project itself. The folder you opened, if it is a
.scriv. Otherwise its only.scriv, one level down, then two. If there are several, it asks you to name one. - It names pages your way. By title, by binder path when titles repeat, or by UUID. A title is never matched in the trash.
- It hashes your words, not how they look. A seal hashes each page's text in one normal form: NFC,
\nline ends, trimmed. Scrivener saving the same words again is not a change. A new word is. - It draws the same page the same way, every time. The parchment's fibres and the burgundy band are drawn from the text's hash, which gives veil about a thousand anchors a page.
- It asks veil, and never seals by itself.
veilis declared inneeds, and the host runs it as its own call, with its own seal store on this Mac. A page veil refuses is listed under problems, and the rest are still sealed. A seal takes a few seconds a page. Asking veil to interlace each page takes over a minute a page.
Works well with
$veil does the sealing. ScrivenerAgent declares it as a need, so install both. Without veil, reading works and a seal is refused with the install to make. Saved sessions recall how $scrivener went before in a project.
Get it
In Craft, run craft agents add https://github.com/rao-craft/ScrivenerAgent.git, and craft agents add https://github.com/rao-craft/VeilAgent.git for the seals. Open the folder that holds your .scriv and say $scrivener.
Requirements
- A Mac on macOS 14 or later. veil, for seals, needs Apple silicon on macOS 26.
- Scrivener 3 projects (a
.scrivxinside the.scriv). - MIT. It links Granite alone and calls veil through the host, so no GPL code is linked into it.
For developers
What a call takes and answers is in Schema/, and how it is tested is in TESTING.md. ScrivenerAgent.perform finds the project (ScrivenerProject) and dispatches the action. The readings are in Sheets/; the seal and verify are in Seal/.
An agent that needs another
ScrivenerAgent is the first agent in rao-craft that calls another one. Here is the pattern:
- Declare it.
static let needs = [AgentNeed(word: "veil", why: "…", source: "https://github.com/rao-craft/VeilAgent")]. The host shows the need beside the agent and tells the model the agent callsveilitself. - Ask the host for it.
let agents = try context.host.agents(for: Self.word, needing: "veil"). With no veil served, this throws the host's refusal, which names the install. - Call it with JSON.
try await agents.call("veil", input: call, as: Answer.self). Over the wire, this is anagentmessage, and the reply is acalledmessage. In Craft, it runs as veil's own call, under this one on the agent map. - Say whose refusal it was. A refusal from the needed agent arrives as
AgentHostError.agent(word:refusal:message:), with its kind kept. Report a per-item refusal as a problem, and rethrow one that no item would escape. - Never call a word you did not declare. That is a fault in the agent, and the host never sends it.
License
MIT. See LICENSE.
How you ask
Say it in your own words
Type $scrivener and what you want. Craft fills these in for Scrivener.
1 required · 8 optional
Required 1
- Action
actionOutline: the binder; read: pages' text; sheet: pages as their sheets' fields (no pages: the template sheets); world: realms, places, characters, languages, lore; seal: seal pages with veil; verify: check a seal against the project now
One ofoutlinereadsheetworldsealverify
Optional 8
- Project
projectThe .scriv to read when the folder holds several: its name or path; leave it out when there is one
Text
- Pages
pagesPages by title, binder path (Characters/Saltmere/Harbor/Mira Coil) or UUID; for read and sheet, or the pages a seal covers
Distribution
The package
- Repository
- Hosted privately by Rao
- Product
- ScrivenerAgent in ScrivenerAgent
- Pinned to
- 814feae
- Granite
- de78183
Creator
@rao · rao.nyc · 0 followers · More by @rao
Ambient, Craft and Veil. New York.
Scrivener
Free

