Skip to main content

The manifest​

plugin.json declares what the host can say about the plugin without running its script:

{
"name": "Uptime helpers",
"commands": [
{ "id": "paste-uptime", "description": "Paste system uptime into the pane" }
],
"settings": [
{ "key": "uptime-format", "type": "enum", "label": "Format",
"default": "pretty", "enum": ["pretty", "seconds"],
"description": "How the uptime renders" },
{ "key": "prefix", "type": "string", "label": "Prefix", "default": "" }
],
"activation": []
}

Keys are kebab-case, and the vocabulary is closed. A key outside the vocabulary costs one log line and is ignored. Malformed JSON skips the plugin with one line. Duplicate command ids or setting keys inside one manifest keep the first and log once. A default of the wrong type for its row falls to that type's builtin default (false, "", 0, the first enum value, [], {}) with one line.

Commands​

commands[].id is a command slug, under the same rules the runtime port enforces: lowercase letters, digits, hyphens, 64 max. description is required and shown in rows. A declared command's row renders bindable (script/<id> on the Keybindings page) and palette-searchable from launch - with no interpreter alive, if the plugin's activation has not fired. Declared and runtime registrations merge one seat per slug: the manifest wins the row when both stand, and the runtime handler is what dispatch runs.

menu[] puts a plugin's declared commands on the terminal's context menu - where the pointer is and the selection stands. Each row names one of the plugin's own commands:

{
"name": "Case helpers",
"commands": [
{ "id": "upper", "description": "Paste the selection in upper case" }
],
"menu": [
{ "label": "Upper case", "command": "upper", "when": "selection" }
]
}

The rows stand above "Settings…" behind a divider of their own, and they are always enabled. A pick runs its command as a palette pick does - a lazy plugin loads for it the same way. Which of them show, and in what order, is the user's say, through context_menu_rows on the configuration page.

KeyRequiredMeaning
labelyesthe text the row shows; blank is refused
commandyesthe id of a command this manifest's commands declares; two rows may not share one
whennoselection shows the row only with a selection, word only with a word under the click. Absent or null is always

when is judged each time the menu opens. A menu run's handler receives the keys a chord run gives it and three more beside them, each a string or nil:

local dropterm = require('dropterm')

-- a menu run: p.selection, p.word, and p.cwd stand beside p.tab
dropterm.command('upper', 'Paste the selection in upper case', function(p)
dropterm.send_text((p.selection or ''):upper())
end)

selection is the selected text. word is the run of non-blank characters around the clicked cell, on its row alone: punctuation stays inside a word, and each wide character is its own. cwd is the pane's working directory.

The scan checks shape. A wrong-shaped row costs one log line and the row - never a sibling row, never the plugin - in the dropterm: plugins: namespace, after <plugin-id>: . Each of these is a whole menu array, each scanned against a manifest that declares the commands upper and lower, and each costs exactly the line beside it:

A row like thisThe log line saysThe row
[{ "command": "upper" }]a menu row is missing its 'label'; skipping the rowis skipped
[{ "label": 5, "command": "upper" }]a menu row has a 'label' that is not a string; skipping the rowis skipped
[{ "label": " ", "command": "upper" }]a menu row has a blank 'label'; skipping the rowis skipped
[{ "label": "Upper" }]menu row 'Upper' is missing its 'command'; skipping the rowis skipped
[{ "label": "Upper", "command": 7 }]menu row 'Upper' has a 'command' that is not a string; skipping the rowis skipped
[{ "label": "Upper", "command": "nope" }]menu row 'Upper' names command 'nope' the manifest does not declare; skipping the rowis skipped
[{ "label": "Upper", "command": "upper" }, { "label": "Again", "command": "upper" }]menu row 'Again' repeats command 'upper'; skipping the rowthe first stands
[{ "label": "Upper", "command": "upper", "when": "selction" }]menu row 'Upper' has a 'when' that is not 'selection' or 'word'; skipping the rowis skipped
[{ "label": "Upper", "command": "upper", "when": 1 }]menu row 'Upper' has a 'when' that is not 'selection' or 'word'; skipping the rowis skipped
[{ "label": "Upper", "command": "upper", "icon": "x" }]ignoring unknown menu-row key 'icon'stands

A row carrying several faults costs the first line only, in the order of the table. A plugin with no menu key is untouched: it scans as before, at no line. A menu that is not an array, or an entry that is not an object, fails the manifest's parse: the plugin is skipped with one line, as any structural fault of a key does.

Tab menu rows​

tab-menu[] puts a plugin's declared commands on a tab's own right-click menu - the menu the tab strip opens on a tab. Each row names one of the plugin's own commands, and no row carries a condition: every row shows on every tab.

{
"name": "Tab helpers",
"commands": [
{ "id": "pin-this", "description": "Pin or unpin the tab the menu opened on" }
],
"tab-menu": [
{ "label": "Pin or unpin", "command": "pin-this" }
]
}

The key is the terminal menu's menu in shape, with one difference: a tab-menu row has no when. The two keys are two menus, and one command may stand on a row of each.

KeyRequiredMeaning
labelyesthe text the row shows; blank is refused
commandyesthe id of a command this manifest's commands declares; two tab-menu rows may not share one

The scan checks shape. A wrong-shaped row costs one log line and the row - never a sibling row, never the plugin - in the dropterm: plugins: namespace, after <plugin-id>: . Each of these is a whole tab-menu array, each scanned against a manifest that declares the command pin-this, and each costs exactly the line beside it:

A row like thisThe log line saysThe row
[{ "command": "pin-this" }]a tab-menu row is missing its 'label'; skipping the rowis skipped
[{ "label": 5, "command": "pin-this" }]a tab-menu row has a 'label' that is not a string; skipping the rowis skipped
[{ "label": " ", "command": "pin-this" }]a tab-menu row has a blank 'label'; skipping the rowis skipped
[{ "label": "Pin" }]tab-menu row 'Pin' is missing its 'command'; skipping the rowis skipped
[{ "label": "Pin", "command": 7 }]tab-menu row 'Pin' has a 'command' that is not a string; skipping the rowis skipped
[{ "label": "Pin", "command": "nope" }]tab-menu row 'Pin' names command 'nope' the manifest does not declare; skipping the rowis skipped
[{ "label": "Pin", "command": "pin-this" }, { "label": "Again", "command": "pin-this" }]tab-menu row 'Again' repeats command 'pin-this'; skipping the rowthe first stands
[{ "label": "Pin", "command": "pin-this", "when": "selection" }]tab-menu row 'Pin' has a 'when'; tab-menu rows always show; skipping the rowis skipped
[{ "label": "Pin", "command": "pin-this", "icon": "x" }]ignoring unknown tab-menu-row key 'icon'stands

A row carrying several faults costs the first line only, in the order of the table. A plugin with no tab-menu key is untouched: it scans as before, at no line. A tab-menu that is not an array, or an entry that is not an object, fails the manifest's parse: the plugin is skipped with one line, as any structural fault of a key does.

What a pick does. The rows stand on every tab's menu under one Plugins entry, a submenu in scan order. A tab's profile filters them (profiles): a tab whose profile leaves every declaring plugin out shows no Plugins entry. A pick runs its command on the tab the menu opened on - the clicked tab, active or not - and nothing activates the tab. The run is a chord's, not the terminal menu's: the handler receives { tab, settings }, tab the clicked tab's id, so dropterm.send_text writes to that tab. The host's scope gate stands behind the row filter: a command whose plugin the tab's profile leaves out is dropped with one log line. A command a lazy plugin declares loads that plugin first.

Settings rows​

Each entry in settings[] declares one row: key (unique per plugin

  • the field name in the store and in ctx.settings), label, type, and default. type is one of the six:
TypeDefaultEditor on the Plugins page
booleanfalsea toggle
string""a text field
number0a number field
enumthe first enum valuea choice strip - the enum list is required
array[]a JSON text area
object{}a JSON text area

Rows render on Settings' Plugins page, grouped by plugin, with no interpreter alive. A save writes the store and pushes the values to the host. An invalid JSON edit or a wrong-typed value keeps the prior value and shows the row's inline error. An enum default outside its value list, or an enum row without the list, is a row error - logged once, and the row is skipped.

Profiles​

profiles[] declares shell profiles the plugin offers - nothing more. The host lists each one on Settings' Plugins page with the command it would run, and nothing runs until you add it:

{
"name": "Ops helpers",
"profiles": [
{
"id": "web-prod",
"name": "web-prod",
"command": "ssh web-prod",
"env": { "TERM": "xterm-256color" }
}
]
}

Keys are kebab-case. Each row carries the profile form's own fields:

KeyRequiredMeaning
idyesthe declaration's slug (lowercase letters, digits, hyphens, 64 at most), unique in the plugin - it names the offer on the page and is never written to a profile
nameyesthe profile's name, which is its id everywhere: the tab's + folder, Switch Profile, the palette. Matched against your profiles exactly, case-sensitive
commandyesthe command line to run, split on whitespace with no quoting - the profile form's own rule, shown on the card in full
cwdnothe working directory, verbatim - never checked to exist
envnoan object whose values are all strings: extra environment variables for the profile's tabs, each a KEY=VALUE line on the card
color-schemenoa scheme the registry knows - a built-in, or one of your loaded schemes
font-sizenoa whole number; the form's band applies, 6 to 32
scrollback-linesnoa whole number: the scrollback capacity the profile's terminals start with

There is no input-mode key - the profile form has no row for it either - so an added profile follows the global pick.

The scan checks shape. A wrong-shaped row costs one log line and the row - never a sibling row, never the plugin - in the dropterm: plugins: namespace, after <plugin-id>: . Each of these is a whole profiles array, and each costs exactly the line beside it:

A row like thisThe log line saysThe row
[{ "name": "a", "command": "true" }]a declared profile is missing its 'id'; skipping the profileis skipped
[{ "id": 7, "name": "a", "command": "true" }]a declared profile has an 'id' that is not a string; skipping the profileis skipped
[{ "id": "Web Prod", "name": "a", "command": "true" }]profile 'Web Prod' has an id that would not register: names are lowercase slugs (letters, digits, hyphens) up to 64 characters; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true" }, { "id": "web-prod", "name": "b", "command": "true" }]profile 'web-prod' declared twice; keeping the firstthe first stands
[{ "id": "web-prod", "command": "true" }]profile 'web-prod' has a blank 'name'; skipping the profileis skipped
[{ "id": "web-prod", "name": 5, "command": "true" }]profile 'web-prod' has a 'name' that is not a string; skipping the profileis skipped
[{ "id": "web-prod", "name": "a" }]profile 'web-prod' has a 'command' with no program to run; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": ["ssh", "web"] }]profile 'web-prod' has a 'command' that is not a string; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true", "cwd": 5 }]profile 'web-prod' has a 'cwd' that is not a string; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true", "env": [] }]profile 'web-prod' has an 'env' that is not an object of strings; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true", "color-scheme": 5 }]profile 'web-prod' has a 'color-scheme' that is not a string; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true", "font-size": "12" }]profile 'web-prod' has a 'font-size' that is not a whole number from 0 to 65535; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true", "scrollback-lines": 1.5 }]profile 'web-prod' has a 'scrollback-lines' that is not a whole number from 0 to 4294967295; skipping the profileis skipped
[{ "id": "web-prod", "name": "a", "command": "true", "shell": "zsh" }]ignoring unknown profile key 'shell'stands

A row carrying several faults costs the first line only, in the order of the table. An absent key, null, an empty env, and a blank cwd all read as unset.

The page checks everything else. Whether the name is free, whether the scheme is in your registry, whether the font size sits in its band, and whether each env key is well-formed are judged by the profile form's own planner when the Plugins page lists the offer - one rulebook, the form's. A declaration the form would reject is listed with the form's reason and no button. A cwd that is right on the author's machine and wrong on yours passes both checks: it is on the card before you add it.

Each offer's card stands in one of four states:

The profileThe card shows
no profile of yours carries the nameAdd to profiles
a profile of that name equals the declarationAdded
a profile of that name differs from the declarationUpdate, with the hint replaces your '<name>'
the profile form would reject itthe form's reason, and no button

Adding is a snapshot. Add to profiles copies the declared values into your profiles through the same write the form's Save makes. From then on the profile is yours: edit it, make it the default, remove the plugin - it stays, and the plugin's later changes do not touch it. Nothing records which declaration a profile came from beyond its name. So a profile of that name you never added from this plugin reads as Added or Update: the page cannot tell the plugin's change from your own edit to the same name. Update replaces whatever profile carries the name, on the click only - rename a profile you want to keep before accepting an update over it. An update changes the declared fields alone.

A declared profile is an offer: the host lists it and runs nothing until you add it. Read the command - it runs as you.

Activation​

activation lists the extra events that load the script. Each declared command implicitly derives on_command:<id> - pressing the command loads the plugin first, then runs it (the first press pays the load). Beyond that:

TokenLoad timing
(none)lazy - nothing loads until a declared command's first press
on_startupat host start, eagerly
on_startup_finishedat the first painted frame plus 50 ms - and if boot took longer than 50 ms to get there, at the first idle moment after (VS Code's measured rule)

Unknown tokens log once and are ignored. A manifest resolving both tokens takes the stronger (on_startup). Once a lazy plugin has activated, it stays active for the session - teardowns and reloads recreate the interpreter with the current active set. A directory without a manifest loads eagerly (the activation story predates it), and the log nudges toward declaring one.

Permissions​

permissions[] declares what a plugin asks to be told. It is a list of slugs from a closed vocabulary. The vocabulary holds two slugs:

PermissionWhat it grants
clipboard-watchthe clipboard-change event, once per text copy
link-watchthe link-hover event: each link the pointer comes onto, and the leave
{
"name": "Clipboard echo",
"permissions": ["clipboard-watch"],
"activation": ["on_startup"]
}

A permission is a declaration the user sees, not a boundary. The Settings' Plugins page shows Can watch the clipboard or Can watch the links you point at on the plugin's card, and a plugin that declares only a permission still gets a card. It gates nothing a script can do: the trust model is the same with or without one, and only the event is delivered by it.

A watcher declares on_startup. An event never activates a lazy plugin - only a command press does - so a plugin that watches the clipboard or the hovered links loads at host start, or its handler is not there to hear.

The scan checks shape. A wrong entry costs one log line and the entry - never the plugin - in the dropterm: plugins: namespace, after <plugin-id>: . Each of these is a whole permissions value, and each costs exactly the line beside it:

A permissions like thisThe log line saysThe permission
["read-terminal"]ignoring unknown permission 'read-terminal'is not granted
[7]ignoring a permission that is not a stringis not granted
["clipboard-watch", "clipboard-watch"]permission 'clipboard-watch' declared twice; keeping the firstthe first stands
["clipboard-watch", "read-terminal"]ignoring unknown permission 'read-terminal'clipboard-watch stands

A permissions that is not an array fails the manifest's parse, and the plugin is skipped with one line, as any structural fault of a key does. A manifest without the key declares no permission, at no line.

Panels​

panels[] declares the Panels a plugin groups its sections into - the unit a user summons, one palette row each (Panels). A Panel is a titled set of the plugin's panel views and output channels. Each row has three keys:

{
"name": "Review kit",
"panels": [
{ "id": "review", "title": "Review", "on_summon": "float" }
]
}
KeyRequiredMeaning
idyesthe Panel's id, a slug - lowercase letters, digits, hyphens, up to 64 characters; its palette row binds under panel/<id>
titleyesthe text the floating window's header and the palette row show; blank is refused
on_summonnofloat pops the Panel out when its row is picked. reveal flashes its sections where they stand (the default; absent or null reads reveal)

The id space is flat and shared: two plugins that declare one id declare one Panel, and the lowest plugin id's title and on_summon stand, at no line. A plugin may declare a Panel under its own id. A view of the plugin's that names no Panel then joins that one. Declaring needs no interpreter, so a Panel stands from the moment its plugin is installed, and its palette row with it.

The scan checks shape. A wrong row costs one log line and the row

  • never the plugin - in the dropterm: plugins: namespace, after <plugin-id>: . Each of these is a whole panels value, and each costs exactly the line beside it:
A panels like thisThe log line saysThe row
[{ "title": "Review" }]a declared panel is missing its 'id'; skipping the panelis skipped
[{ "id": 7, "title": "Review" }]a declared panel has an 'id' that is not a string; skipping the panelis skipped
[{ "id": "Web Prod", "title": "Review" }]panel 'Web Prod' has an id that would not register: names are lowercase slugs (letters, digits, hyphens) up to 64 characters; skipping the panelis skipped
[{ "id": "review" }]panel 'review' is missing its 'title'; skipping the panelis skipped
[{ "id": "review", "title": "" }]panel 'review' has an empty 'title'; skipping the panelis skipped
[{ "id": "review", "title": "Review", "on_summon": "hide" }]panel 'review' has an 'on_summon' that is not 'reveal' or 'float'; skipping the panelis skipped
["review", { "id": "inbox", "title": "Inbox" }]a declared panel is not an object; skipping the panelthe others stand
[{ "id": "review", "title": "Review", "window": true }]ignoring unknown panel key 'window'stands
[{ "id": "review", "title": "Review" }, { "id": "review", "title": "Again" }]panel 'review' declared twice; keeping the firstthe first stands

An unknown key in a row is one line and ignored, so a later host may add a field without breaking this one. A panels that is not an array is one line - ignoring the 'panels' key: it is not an array - and the plugin's other keys stand. A manifest without the key declares no Panel, at no line.