Swiss Knife
What it is
A group of small useful things behind one switch: present shows you a file as a card in the thread,
the Viewer opens that file beside the conversation and lets you annotate it, and two stream rules stop
the agent mid-edit when it writes a code comment.
Replaces the separate Viewer and Ban Comments plugins; if you still have them installed the app removes them for you.
What it contains
- Tool
present, loaded eagerly. One parameter,path: a file path, or an array of up to 12 (a relative path is read from the session's working directory). The model gets one line per file (Presented report.pdf (PDF, 41 KB).) or a plain reason it was refused; the thumbnail goes to the card, never to the model. Its card is the built-inpresentationcard, declared inplugin.json. - The Viewer, an artifactory (an MCP App; server
viewer, started byai.insodimension.dimension/mcp.json) with host-clickview_file, app-only document reads, and recording open/close tools. It draws images, PDF, HTML, Markdown, Word, PowerPoint, Excel, text and code, audio and video, without external network access in a sandboxed frame, and annotates them with ONE annotation toolbar per file kind, always shown (no mode to switch on, no Done): pins, boxes, circles, arrows and freehand on a picture or on a video frame, comments on text, a pick of an element on a page, a moment or a stretch of a recording (on a waveform for audio, on a filmstrip for video). A file opens behind one continuous opening surface instead of a flash. The card's Open and Annotate buttons come from theopensrows inplugin.json. Depth:viewer/README.mdin this plugin's folder. - Tool
artifacts, loaded eagerly. The user's library of files shown or made here:searchfinds one to present again (by text, kind andtags: a file must carry every tag given, whole-tag, case-insensitive for A to Z),getreads one row with its links and comments, andstamp,update,discardandrestorekeep it tidy. The Library icon (assets/library.svg) is the face of its card, titled per op ("Library · search"), and of thepresentcard. The Library (the dock's launcher, a pinned tab in the Viewer) is the person's side of the same store: search as you type, filter by kind, tag and workspace (a tag chip on a card filters by it), a virtualized grid or list, posters for videos and PDFs, a page per file (the file large; View, Comments, Share and Details on top; shared comments drawn on the file; Details names the session that made the file and opens it), and a Share dialog with the choices of doc 103 (Dimension cloud, this computer, your own server). Depth:viewer/README.md, doc 103. - Two stream rules,
ban-comments(.ts .tsx .js .jsx .rs .go) andban-comments-python(.py). When the agent writes a code comment in aneditor awrite, the engine stops that output, tells the model to delete the comment and carry its meaning in names, types and structure, and the model writes the line again. Directive comments stay (@ts-,eslint-,# noqa,#!and the like). To turn them off alone, add both names to thettsr.disabledRulessetting; it belongs to thettsrplugin (on by default), so it works only whilettsris enabled, and withttsroff the rules still fire. A same-named file in.inso/rules/overrides their text instead.
No skills or prompts (a test keeps those out).
Who can use it
Anyone on either release ring, stable or canary.
It is on once installed, in every space: its audience is everywhere, so an agent that carries only its
space's packs still has it. It needs Dimension 0.10.24 or later, the first release whose engine honours the
rules' except: field. The Library's dock entry is a launcher, which Dimension shows from 0.11.13; on
an older release the agent's artifacts tool still works, but the Library tab has no way in.
No sign-in, CLI or key.
There is one switch. Turning Swiss Knife off turns off present, the Viewer, the Library, the artifacts
tool and the comment rule
together; none can be switched on its own. No agent is offered view_file: a person opens a file from
a present card or an Open button, and the Viewer is not a tool the model calls.
Limits and risks
presentwrites only a copy, into the engine's blob store. Its approval class isread. It refuses secrets (credential folders such as.ssh,.aws,.gitand any folder namedlocker,.envfiles, private keys, token and cookie stores, the engine's own state; on Windows also network, device and alternate-data-stream paths), on the path as written and on its real path, naming a category and never content. The Viewer uses the same table,viewer/src/fence.ts. Regular files only; paths past the first 12 are reported, not presented; a file is read for its first block, an image whole up to 25 MiB and 25 megapixels, and any file that gets a copy whole up to 25 MiB.- A card opens the file as it was presented. Each file of at most 25 MiB (100 MiB per call) is copied
into the session blob store (
<agent>/blobs/<sha256>.<ext>), so an agent that later overwrites the path does not change what an older card opens. The copy carries the file's own extension, and only one the Viewer will lend: a larger file, one with no extension or an odd one (a space, more than 32 characters), a database (.db,.sqlite,.sqlite3and their journals), and a durable copy (.bak,.corrupt-*) get no copy and are not read for one; they open as they are when clicked, like a file whose copy failed (the model's line says why). The Viewer lends a copy only as the exact file a click lent, never because a folder inVIEWER_ROOTScovers the engine home.omp gcremoves a copy once no session refers to it. - The Viewer reads only what it is lent: the vault, folders in
VIEWER_ROOTS, and the one file a person clicks Open on. Recordings play through fenced loopback HTTP ranges without a file-size cap or whole-file download before playback. An HTML page runs its own scripts in a sealed frame (no network, storage, nested frames or WebRTC), with Stop scripts to show it without them; Pick starts down and picks from a still of the page in a second frame under a CSP that admits one script. - A waveform exists for a WAV or a strict MP3, and nothing else. Drawing one decodes the whole recording, and a container's header can lie about its length (a 110 KB FLAC with a patched header decoded to 200 MB), so the decoder is only handed a file whose size the bytes themselves prove: a WAV judged on its own header, or an MP3 whose frames are counted from the bytes (the first frame at byte 0 or right after a verified ID3v2 tag, no other container's magic in the first 16 bytes, frames unbroken to the end, at most 545 s and 32 MiB, and the player's own length must agree). One decode at a time, 96 MiB of samples at most. Ogg, FLAC, MP4 and M4A, WebM, AIFF and AAC still play; they get a flat track, and notes work the same on it.
- Accepted residual risks, each needing an agent that can already write to the disk: a hard link to a secret under a harmless name is not seen; a link to a missing target and one to a protected target answer differently; a path swapped for a link between the check and the open is opened as the link says (its type is re-checked).
- The comment rule reads text, not code: a
//inside a string literal can trip it, and each hit costs the model one rewind and a rewrite. - Context cost.
presentis in context on every turn: a budget of 115 tokens, held bytest/context-cost.test.ts. The rules cost 0 until they fire (the engine files a stream rule as resident 0); the same test runs the engine's own bucketing to prove neither is a prompt rule. - The library's own cost.
artifactsis the second eager tool; its wire entry (name, description, parameters and the intent field) is held to 240 tokens by the same test. The Library tab, its thumbnails and its search cost nothing until it is opened: they run in the Viewer's server and the View, never in the model's context. - The library is local and bounded. One SQLite file with FTS5 trigram search,
<home>/artifacts/library.db(one row per file, never a copy of it). A 50 000-row library answers a search in under 2 ms, a first page in about 1 ms and the filter counts in about 15 ms the first time after a change, then from memory until the next write. A row is created bypresent, by the agent'sartifacts stamp, or by a person's Add file;artifacts discardand the Library's Discard revoke every live link, drop the thumbnail and, when asked, send the file to the OS recycle bin (never delete it outright); a discarded row can be restored for 30 days and is purged after.artifactsis read-class forsearch,getandcomments, write-class for the rest; secrets are refused when a file is stamped, on the path as written and on its real path. Nothing leaves the machine until a person presses Create link in the Share dialog; comments that come back are shown to the agent as input, labelled as input.
Build and test
bun run build # dist/index.mjs (present), then viewer/app/server.mjs and viewer/app/dist
bun run test # bun test test/ viewer/test/
bun run check:types # both tsconfigs
The host loads the committed bundles, not src/: test/bundle.test.ts and viewer/test/bundle.test.ts
fail when a committed file is not what its source builds to, so rebuild and commit with every change.