What a mod can do
A mod's script runs in a sandbox in Solanum's backend, not in the window. This page lists what it may read, show and run there, and what it may not.
Where a mod runs
A mod is a folder with two files, and sometimes a third.
| File | What it is |
|---|---|
mod.json | Its name, its place (panel, page or composer), and what it may do, under allow. |
mod.js | The script that draws it. |
mod.html | Optional: a page of its own with scripts, for a tab or a page. |
mod.js runs in a sandbox with no imports, no network, no files and no access to the computer. It is handed three things: parts to draw with, a place to keep small values, and the few things of Solanum's it's allowed to read. It returns what to draw, and the window draws it.
Each call of the script gets 50 ms of processor time and 16 MiB of memory. A mod that runs too long or fills its memory is stopped, and says so where it would have shown. A mod runs only while it shows.
What it may show
- Solanum's own parts: headings, text, Markdown, code, tables, stats, badges, notices, progress bars, buttons, selects, inputs and switches, laid out in columns, rows and grids. They follow your theme.
- HTML and CSS of its own, for a design of its own. No scripts, no forms, and no links or pictures from elsewhere. Your theme's colors, radius and fonts reach its CSS as variables.
- SVG of its own, such as a pixel-art pet, with CSS animations. Solanum steps the animations a few times a second, pauses them out of sight, and holds them still when the system asks for reduced motion. No scripts.
- A page with scripts, in a tab or a page only, for what HTML and SVG can't draw, such as a three.js scene. It runs in a sandboxed frame apart from the window. It loads scripts only from
cdn.jsdelivr.net,unpkg.com,cdnjs.cloudflare.comandesm.sh, reaches nothing else, and is handed the data the mod gives it.
What it may keep
A mod keeps small values by name, such as which filter is picked. They survive a reload and are deleted with the mod.
What it may read
Nothing of Solanum's, unless its mod.json allows threads. With that, it reads the workspace's threads: each one's title, project, branch, agent, model, whether it's running or waiting on you, how its last run ended, and when it last changed. A tab or companion also knows which thread it's beside. The mod is drawn again as threads change.
It does not read a thread's messages, your files, your settings or your keys.
What it may do when you click
These need no permission, and happen only as you use one of the mod's controls:
- open one of your threads, or a page mod
- open an
httporhttpslink in Solanum's browser - copy text
- show a short message
None of them changes a thread.
What it may run, once you allow it
Four things change your threads. Each must be named in the mod's allow, and Solanum asks you before the first of each kind.
In allow | Lets the mod |
|---|---|
start-threads | Start a thread in one of the workspace's projects, with a prompt. |
send | Send a message to a thread. |
stop | Stop a thread's running turn. |
archive | Archive a thread that isn't running. |
The dialog names the mod and says what it wants to do, with the prompt or message it would send. Allow permits that kind of thing whenever you use the mod. Settings › Mods shows each as "allowed" or "asks first", and Take back withdraws what you allowed. A mod can do these only from a control you use, never on its own, and Solanum checks its mod.json again each time.
Threads a mod starts run on an agent of the machine the mod is on.
What it may not do
- Read or write files, or run commands. Only a thread it starts can, under that thread's own access.
- Reach the network from its script.
- Read conversations.
- Approve what a thread asks leave for. Only you do.
- Change settings or other mods.
Sizes
| File | At most |
|---|---|
mod.json | 16 KB |
mod.js | 256 KB |
mod.html | 1 MB |
| What it draws | 1 MB |