← Otto Developer Guideotto-preview

Specs: Preview, Peek

otto-preview is the app people know as Studio, in components/otto-preview/. It shows one file in a window of its own, drawn exactly as Peek draws it over the file list, because it wraps the same Peek session. Beside the document it can host an agent chat, and it fills and marks up PDFs, saving into the file. The program, its app id and its bus name are otto-preview; the desktop entry, the top bar and the dock call it Studio. It sits in the app layer of architecture.toml. It runs as one process per session that serves every Studio window, plus a short-lived otto-preview --mcp process for each agent that uses its document tools.

Later starts and the agent’s MCP server reach the running instance over org.otto.Preview1; the window draws a Peek session, PDF edits go through the edit queue to otto-pdf, and the chat talks to otto-agents

Modules

ModuleWhat it does
main.rsArguments (--chat, --session URI, a path), the --mcp branch, and the hand-off to a running instance
instance.rsorg.otto.Preview1: opening files, and the document tools an agent reaches through --mcp
app.rsThe window, its input, and the work it sends off the UI thread: decodes, pages, the text layer, recognition
viewer.rs, content.rsWhat the window shows around and under the Peek Session, drawn with otto_peek::draw
chrome.rs, sidebar.rs, cursors.rsThe titlebar and toolbar, the pages sidebar, the pen and bin cursors
commands.rs, shortcuts.rsThe one list of commands the menus, keys and shortcuts sheet all read, and the sheet itself
marks.rsMarks the person draws to point at something and the agent draws to point back, in the document’s own coordinates
editing.rs, edit_queue.rs, signature.rsFilling a PDF’s form and marking it up through otto-pdf; the queue every edit, undo, redo and save waits in; the person’s kept signature
chat.rsThe chat panel beside the document, around otto-agents-kit’s conversation and log
mcp.rs, pdf_tools.rsotto-preview --mcp, the MCP server an agent starts, and the JSON form of the PDF’s fields and annotations
versions.rsCopies of the file kept while an agent works on it
confirm.rs, file_dialog.rs, picking.rsThe unsaved-changes questions, the portal’s open and save dialogs, and the empty window shown when Studio starts with no file

How it runs

What it depends on

otto-kit for the window and drawing, otto-peek for the session and the decoder, otto-media-kit without default features for playback, otto-pdf for editing, and otto-agents-kit (with dictation) and otto-agents-client for the chat. Nothing links Studio. It is launched from its desktop entry, by xdg-open, and by the agent UIs when a session is about a file.

Going deeper