Build a plugin

A Task Proxy plugin is a small WebAssembly program with a manifest. It describes its screens as data, which Task Proxy draws with its own components, and it reaches nothing outside its sandbox except through Task Proxy, which checks every request against what the manifest declared.

The plugins Stoic Dreams publishes, and the Rust kit for writing them, are open source in TaskProxyPlugins. Its spec folder holds the same spec as this page.

Overview

How a plugin runs

What you write

PieceWhat it is
plugin.jsonThe manifest: the plugin's id, name, version, the spec versions it supports, its permissions, and its pages.
renderDraws one of the plugin's pages.
actionAnswers a button, link, or form the plugin drew, and returns what happens next.
branch_infoOptional. A card for the Git Controller about the current branch.
notificationsOptional. Notifications for Task Proxy's Alerts panel.

Your First Plugin

Set up

You need Rust with the WebAssembly target, and PowerShell for the build script.

rustup target add wasm32-unknown-unknown git clone https://github.com/StoicDreams/TaskProxyPlugins

Write it

  1. Copy plugins/jira as a starting point: a cdylib crate that depends on taskproxy-plugin-sdk, with a plugin.json.
  2. Give it a new id and name, and list only the permissions it needs.
  3. List the spec versions it supports as "spec": ["0.1.0"], naming the lowest patch it needs, and keep "apiVersion": 1 beside it for older Task Proxy releases.
  4. Implement the SDK's Plugin trait, with render and action, and export it with export_plugin!(MyPlugin).

A minimal manifest:

{ "id": "hello", "name": "Hello", "version": "0.1.0", "spec": ["0.1.0"], "apiVersion": 1, "description": "Says hello from a plugin.", "icon": "code", "pages": [{ "id": "home", "name": "Hello", "icon": "code" }] }

Try it

  1. Build every plugin into dist/<id> with pwsh ./scripts/build.ps1.
  2. In Task Proxy, open Tools, choose its Plugins tab, then Install from folder, and pick dist/<id>. A plugin from a folder is marked unsigned.
  3. Turn it on for the open project, or enter its settings, and its pages appear in the menu.

Spec Versions

How the spec is versioned

The plugin spec is versioned on its own, apart from Task Proxy and from each plugin, so each can update without waiting on the others. A version is major.minor.patch, and each major.minor, such as 0.1, is a line.

How Task Proxy and a plugin match

Task Proxy releases

Task ProxySpec versions
0.1.123 and later0.1.3
0.1.1220.1.2
0.1.118 to 0.1.1210.1.0, as apiVersion: 1. spec is not read.
0.1.115 to 0.1.117An early form of 0.1.0, as apiVersion: 1

Plugins

PluginVersionsSpec versions
Jira0.1.3 and later0.1.0, with drag and drop in its column editor where Task Proxy supports 0.1.2, and description images, editable View fields, and editable branch names where it supports 0.1.3
Jira0.1.0 to 0.1.20.1.0, as apiVersion: 1

Guidelines

Permissions and settings

Screens

Speed and compatibility

Security

Testing and Publishing

Testing

Publishing

Plugin spec

Each tab is one version of the spec, complete, newest first. Rules marked MUST are enforced: Task Proxy refuses a plugin that breaks one. JSON names are camelCase, and both sides ignore fields they don't know.

0.1.4 (Draft)

Spec 0.1.4 (Draft)

A draft for the Task Manager plugin, which lists running processes, including stuck background ones, and closes them. No Task Proxy release supports it yet, and it may change before it is released. It is everything in 0.1.3, plus the following.

The processes permission

"processes": ["list"], or ["list", "stop"].

ValueAllows
listThe processes host call.
stopThe process.stop and process.kill host actions. Needs list too.

A manifest that asks for processes MUST NOT also ask for hosts. Command lines and folders can hold secrets and private paths, so a plugin that reads them can't send anything off the machine.

The processes host call

{"op": "processes"} answers with {"processes": [...], "ownPid": number}, where ownPid is Task Proxy's own process. It lists only the user's own processes. Each is:

FieldTypeMeaning
pidnumber
parentPidnumber or null
namestring
commandstring[]The program and its arguments.
cwdstring or nullIts working folder, when the platform reports it.
startednumberWhen it started, in milliseconds since the Unix epoch. With pid, it names one process, since pids are reused.
cpunumberPercent of one core since the last call.
memorynumberResident memory in bytes.
portsobject[]Each {"port", "protocol", "address"} it listens on or has bound.
orphanedbooleanIts parent exited, so it now belongs to init, systemd --user, or launchd.
inProjectbooleanIts working folder is inside the open project.

Stopping a process

The host actions process.stop and process.kill take {"pid", "started", "tree"}.

Task Proxy refuses:

It always asks the user to confirm, naming the process, its pid, and its command.

Still to decide

Processes belong to the whole machine, but a plugin shows only in projects set up for it. This draft either keeps that rule, with the Task Manager turned on for each project and filtered to that project by default, or adds a kind of plugin that shows in every project once turned on.

0.1.3

Spec 0.1.3

Supported by Task Proxy 0.1.123 and later.

New in 0.1.3:

Everything else is as in 0.1.2.

Package

Manifest

FieldTypeRules
idstringRequired. Lowercase letters, digits, and dashes, starting with a letter, at most 64 characters. Never changes.
namestringRequired. Not blank.
versionstringRequired. The plugin's own version, three numbers.
specstring[]Required. The spec versions it supports, one per line, each the lowest patch it needs, such as ["0.1.0"].
apiVersionnumber1 while it supports line 0.1, for Task Proxy 0.1.121 and earlier. Without spec, it means spec 0.1.0.
descriptionstringA sentence or two, shown before installing.
categorystringA slug, such as issue-tracking.
iconstringAn icon name from the icon list.
permissionsobjecthosts, variables, and git, below.
pagesobject[]Each {"id", "name", "icon", "hidden"}, at /plugin/<id>/<page>. A hidden page is left out of the menu.
contributesstring[]gitBranchInfo for a Git Controller card, and notifications for the Alerts panel. Unknown values are ignored.

Permissions

PermissionRules
hostsDomains for HTTPS requests: api.example.com exactly, or *.example.com for its subdomains only. A pattern needs at least two labels, so * and *.com are refused.
variablesEach {"key", "label", "secret", "help"}. Keys are letters, digits, _, and -, and MUST NOT start with app- or session-. Users enter them per project, and secret ones are masked and never shown again.
gitcurrentBranch to read the current branch, and createBranch for the branch host action.

Exports

Each takes one JSON value and returns {"ok": ...} or {"error": "..."}. Errors are shown to the user.

ExportInputResult
render{"page", "params"}A node: the page's content. params is the address's query.
action{"page", "pageParams", "action", "params", "form"}An action result.
branch_info{"branch"}A node, or null. With gitBranchInfo.
notifications{}A list of {"id", "title", "text", "theme", "time", "links"}. With notifications. Polled every two minutes.
notification_read{"id"}Ignored. Called when the user closes a notification.

Host calls

A request names its op. A request Task Proxy does not understand is answered with an error.

opRequestAnswer
var{"key"}A declared variable from the project's own variables, then its settings, or null.
storeGet{"key"}The plugin's saved value, or null.
storeSet{"key", "value"}Saves it, encrypted. null removes it.
projectFileRead{"path"}Text under .taskproxy/plugins/<id>/ in the open project, or null.
projectFileWrite{"path", "text"}Writes there, at most 1 MB. Paths can't leave that folder.
currentBranch{}The branch's name, or null. Needs git: currentBranch.
now{}Milliseconds since the Unix epoch.
http{"request": {"method", "url", "headers", "body", "encoding"}}{"status", "body"}. HTTPS to declared hosts only, no redirects, at most 10 MB back, and no credentials in the URL. With encoding: "base64", the body is the bytes as base64, for images and other files. New in 0.1.3.
hostInfo{}{"app", "spec", "platform"}: Task Proxy's version, the spec version it runs the plugin with, and linux, macos, or windows.

Action results

Every field is optional, and {} changes nothing.

FieldEffect
message{"text", "theme"}: a short alert.
closeDialogCloses the dialog the action came from.
navigate{"page", "params"}: opens one of the plugin's pages.
dialog{"title", "ui"}: opens a dialog.
uiReplaces the page's content, or the dialog's.
refreshDraws the page again.
options[{"value", "label"}]: choices for a select node or a field's suggest.

Nodes

Every node has a type. An unknown type is drawn as a placeholder. Themes are primary, secondary, tertiary, info, success, warning, and danger.

typeFields
stack, row, toolbarchildren
headingtext, level (1 to 4, default 2)
texttext, muted, strong
markdowntext, sanitized, images (names used as ![alt](name), each a data:image/...;base64, URI, and the only images shown), and toggle (a switch to the raw text). The last two are new in 0.1.3.
badgetext, theme
linktext, action
buttonaction, theme
propertiesitems, each {"label", "value", "edit"} with nodes as the value and editor. Clicking the label switches to edit, new in 0.1.3.
tablecolumns, titles or {"label", "action", "sort"}, and rows, each {"cells", "action"}
selecttext, theme, options (an action that returns the choices when clicked), action (run with the choice as form.value)
cliptext, max (30), tip (100), action, always, muted
sectionkey, title, subtitle, open, children. Remembered open or closed by key.
panelkey, open, children. Shown and hidden by the toggle host action.
formfields, submit, cancel, buttons, children, inline (new in 0.1.2: fields and buttons in one row)
inputsfields, more of a form's fields among its children
noticetext, theme
emptytext
reorderitems, each {"id", "children"}, and action. New in 0.1.2.

An action is {"id", "label", "params", "confirm", "icon", "host"}. With confirm, the user is asked first. As a form's submit, a host action takes its fields of the same name from the form, new in 0.1.3.

A reorder list shows each item with a drag handle. The user drags items, or moves them with Alt+Up and Alt+Down, and Task Proxy then runs action with form.order, the ids in their new order. Older hosts show a placeholder, so check hostInfo and draw something else for them.

A field is {"name", "label", "kind", "value", "options", "required", "placeholder", "help", "suggest"}:

Host actions

Run by Task Proxy only when the user clicks the button that names them.

typeFieldsDoes
git.createBranchnameCreates a branch and switches to it. Needs git: createBranch.
openUrlurlOpens an HTTPS address in the browser.
copytextCopies to the clipboard.
openSettingsOpens the plugin's settings.
togglekeyShows or hides a panel.

Catalog

0.1.2

Spec 0.1.2

Supported by Task Proxy 0.1.122 and later.

New in 0.1.2:

Everything else is as in 0.1.1.

Package

Manifest

FieldTypeRules
idstringRequired. Lowercase letters, digits, and dashes, starting with a letter, at most 64 characters. Never changes.
namestringRequired. Not blank.
versionstringRequired. The plugin's own version, three numbers.
specstring[]Required. The spec versions it supports, one per line, each the lowest patch it needs, such as ["0.1.0"].
apiVersionnumber1 while it supports line 0.1, for Task Proxy 0.1.121 and earlier. Without spec, it means spec 0.1.0.
descriptionstringA sentence or two, shown before installing.
categorystringA slug, such as issue-tracking.
iconstringAn icon name from the icon list.
permissionsobjecthosts, variables, and git, below.
pagesobject[]Each {"id", "name", "icon", "hidden"}, at /plugin/<id>/<page>. A hidden page is left out of the menu.
contributesstring[]gitBranchInfo for a Git Controller card, and notifications for the Alerts panel. Unknown values are ignored.

Permissions

PermissionRules
hostsDomains for HTTPS requests: api.example.com exactly, or *.example.com for its subdomains only. A pattern needs at least two labels, so * and *.com are refused.
variablesEach {"key", "label", "secret", "help"}. Keys are letters, digits, _, and -, and MUST NOT start with app- or session-. Users enter them per project, and secret ones are masked and never shown again.
gitcurrentBranch to read the current branch, and createBranch for the branch host action.

Exports

Each takes one JSON value and returns {"ok": ...} or {"error": "..."}. Errors are shown to the user.

ExportInputResult
render{"page", "params"}A node: the page's content. params is the address's query.
action{"page", "pageParams", "action", "params", "form"}An action result.
branch_info{"branch"}A node, or null. With gitBranchInfo.
notifications{}A list of {"id", "title", "text", "theme", "time", "links"}. With notifications. Polled every two minutes.
notification_read{"id"}Ignored. Called when the user closes a notification.

Host calls

A request names its op. A request Task Proxy does not understand is answered with an error.

opRequestAnswer
var{"key"}A declared variable from the project's own variables, then its settings, or null.
storeGet{"key"}The plugin's saved value, or null.
storeSet{"key", "value"}Saves it, encrypted. null removes it.
projectFileRead{"path"}Text under .taskproxy/plugins/<id>/ in the open project, or null.
projectFileWrite{"path", "text"}Writes there, at most 1 MB. Paths can't leave that folder.
currentBranch{}The branch's name, or null. Needs git: currentBranch.
now{}Milliseconds since the Unix epoch.
http{"request": {"method", "url", "headers", "body"}}{"status", "body"}. HTTPS to declared hosts only, no redirects, at most 10 MB back, and no credentials in the URL.
hostInfo{}{"app", "spec", "platform"}: Task Proxy's version, the spec version it runs the plugin with, and linux, macos, or windows.

Action results

Every field is optional, and {} changes nothing.

FieldEffect
message{"text", "theme"}: a short alert.
closeDialogCloses the dialog the action came from.
navigate{"page", "params"}: opens one of the plugin's pages.
dialog{"title", "ui"}: opens a dialog.
uiReplaces the page's content, or the dialog's.
refreshDraws the page again.
options[{"value", "label"}]: choices for a select node or a field's suggest.

Nodes

Every node has a type. An unknown type is drawn as a placeholder. Themes are primary, secondary, tertiary, info, success, warning, and danger.

typeFields
stack, row, toolbarchildren
headingtext, level (1 to 4, default 2)
texttext, muted, strong
markdowntext, sanitized
badgetext, theme
linktext, action
buttonaction, theme
propertiesitems, each {"label", "value"} with a node as the value
tablecolumns, titles or {"label", "action", "sort"}, and rows, each {"cells", "action"}
selecttext, theme, options (an action that returns the choices when clicked), action (run with the choice as form.value)
cliptext, max (30), tip (100), action, always, muted
sectionkey, title, subtitle, open, children. Remembered open or closed by key.
panelkey, open, children. Shown and hidden by the toggle host action.
formfields, submit, cancel, buttons, children, inline (new in 0.1.2: fields and buttons in one row)
inputsfields, more of a form's fields among its children
noticetext, theme
emptytext
reorderitems, each {"id", "children"}, and action. New in 0.1.2.

An action is {"id", "label", "params", "confirm", "icon", "host"}. With confirm, the user is asked first.

A reorder list shows each item with a drag handle. The user drags items, or moves them with Alt+Up and Alt+Down, and Task Proxy then runs action with form.order, the ids in their new order. Older hosts show a placeholder, so check hostInfo and draw something else for them.

A field is {"name", "label", "kind", "value", "options", "required", "placeholder", "help", "suggest"}:

Host actions

Run by Task Proxy only when the user clicks the button that names them.

typeFieldsDoes
git.createBranchnameCreates a branch and switches to it. Needs git: createBranch.
openUrlurlOpens an HTTPS address in the browser.
copytextCopies to the clipboard.
openSettingsOpens the plugin's settings.
togglekeyShows or hides a panel.

Catalog

0.1.1

Spec 0.1.1

Supported by Task Proxy 0.1.122 and later.

New in 0.1.1:

Everything else is as in 0.1.0.

Package

Manifest

FieldTypeRules
idstringRequired. Lowercase letters, digits, and dashes, starting with a letter, at most 64 characters. Never changes.
namestringRequired. Not blank.
versionstringRequired. The plugin's own version, three numbers.
specstring[]Required. The spec versions it supports, one per line, each the lowest patch it needs, such as ["0.1.0"].
apiVersionnumber1 while it supports line 0.1, for Task Proxy 0.1.121 and earlier. Without spec, it means spec 0.1.0.
descriptionstringA sentence or two, shown before installing.
categorystringA slug, such as issue-tracking.
iconstringAn icon name from the icon list.
permissionsobjecthosts, variables, and git, below.
pagesobject[]Each {"id", "name", "icon", "hidden"}, at /plugin/<id>/<page>. A hidden page is left out of the menu.
contributesstring[]gitBranchInfo for a Git Controller card, and notifications for the Alerts panel. Unknown values are ignored.

Permissions

PermissionRules
hostsDomains for HTTPS requests: api.example.com exactly, or *.example.com for its subdomains only. A pattern needs at least two labels, so * and *.com are refused.
variablesEach {"key", "label", "secret", "help"}. Keys are letters, digits, _, and -, and MUST NOT start with app- or session-. Users enter them per project, and secret ones are masked and never shown again.
gitcurrentBranch to read the current branch, and createBranch for the branch host action.

Exports

Each takes one JSON value and returns {"ok": ...} or {"error": "..."}. Errors are shown to the user.

ExportInputResult
render{"page", "params"}A node: the page's content. params is the address's query.
action{"page", "pageParams", "action", "params", "form"}An action result.
branch_info{"branch"}A node, or null. With gitBranchInfo.
notifications{}A list of {"id", "title", "text", "theme", "time", "links"}. With notifications. Polled every two minutes.
notification_read{"id"}Ignored. Called when the user closes a notification.

Host calls

A request names its op. A request Task Proxy does not understand is answered with an error.

opRequestAnswer
var{"key"}A declared variable from the project's own variables, then its settings, or null.
storeGet{"key"}The plugin's saved value, or null.
storeSet{"key", "value"}Saves it, encrypted. null removes it.
projectFileRead{"path"}Text under .taskproxy/plugins/<id>/ in the open project, or null.
projectFileWrite{"path", "text"}Writes there, at most 1 MB. Paths can't leave that folder.
currentBranch{}The branch's name, or null. Needs git: currentBranch.
now{}Milliseconds since the Unix epoch.
http{"request": {"method", "url", "headers", "body"}}{"status", "body"}. HTTPS to declared hosts only, no redirects, at most 10 MB back, and no credentials in the URL.
hostInfo{}{"app", "spec", "platform"}: Task Proxy's version, the spec version it runs the plugin with, and linux, macos, or windows. New in 0.1.1.

Action results

Every field is optional, and {} changes nothing.

FieldEffect
message{"text", "theme"}: a short alert.
closeDialogCloses the dialog the action came from.
navigate{"page", "params"}: opens one of the plugin's pages.
dialog{"title", "ui"}: opens a dialog.
uiReplaces the page's content, or the dialog's.
refreshDraws the page again.
options[{"value", "label"}]: choices for a select node or a field's suggest.

Nodes

Every node has a type. An unknown type is drawn as a placeholder. Themes are primary, secondary, tertiary, info, success, warning, and danger.

typeFields
stack, row, toolbarchildren
headingtext, level (1 to 4, default 2)
texttext, muted, strong
markdowntext, sanitized
badgetext, theme
linktext, action
buttonaction, theme
propertiesitems, each {"label", "value"} with a node as the value
tablecolumns, titles or {"label", "action", "sort"}, and rows, each {"cells", "action"}
selecttext, theme, options (an action that returns the choices when clicked), action (run with the choice as form.value)
cliptext, max (30), tip (100), action, always, muted
sectionkey, title, subtitle, open, children. Remembered open or closed by key.
panelkey, open, children. Shown and hidden by the toggle host action.
formfields, submit, cancel, buttons, children
inputsfields, more of a form's fields among its children
noticetext, theme
emptytext

An action is {"id", "label", "params", "confirm", "icon", "host"}. With confirm, the user is asked first.

A field is {"name", "label", "kind", "value", "options", "required", "placeholder", "help", "suggest"}:

Host actions

Run by Task Proxy only when the user clicks the button that names them.

typeFieldsDoes
git.createBranchnameCreates a branch and switches to it. Needs git: createBranch.
openUrlurlOpens an HTTPS address in the browser.
copytextCopies to the clipboard.
openSettingsOpens the plugin's settings.
togglekeyShows or hides a panel.

Catalog

0.1.0

Spec 0.1.0

The first spec, run by Task Proxy 0.1.118 to 0.1.121 as apiVersion: 1, and by later releases.

Package

Manifest

FieldTypeRules
idstringRequired. Lowercase letters, digits, and dashes, starting with a letter, at most 64 characters. Never changes.
namestringRequired. Not blank.
versionstringRequired. The plugin's own version, three numbers.
apiVersionnumberRequired, and 1.
descriptionstringA sentence or two, shown before installing.
categorystringA slug, such as issue-tracking.
iconstringAn icon name from the icon list.
permissionsobjecthosts, variables, and git, below.
pagesobject[]Each {"id", "name", "icon", "hidden"}, at /plugin/<id>/<page>. A hidden page is left out of the menu.
contributesstring[]gitBranchInfo for a Git Controller card, and notifications for the Alerts panel. Unknown values are ignored.

Permissions

PermissionRules
hostsDomains for HTTPS requests: api.example.com exactly, or *.example.com for its subdomains only. A pattern needs at least two labels, so * and *.com are refused.
variablesEach {"key", "label", "secret", "help"}. Keys are letters, digits, _, and -, and MUST NOT start with app- or session-. Users enter them per project, and secret ones are masked and never shown again.
gitcurrentBranch to read the current branch, and createBranch for the branch host action.

Exports

Each takes one JSON value and returns {"ok": ...} or {"error": "..."}. Errors are shown to the user.

ExportInputResult
render{"page", "params"}A node: the page's content. params is the address's query.
action{"page", "pageParams", "action", "params", "form"}An action result.
branch_info{"branch"}A node, or null. With gitBranchInfo.
notifications{}A list of {"id", "title", "text", "theme", "time", "links"}. With notifications. Polled every two minutes.
notification_read{"id"}Ignored. Called when the user closes a notification.

Host calls

A request names its op. A request Task Proxy does not understand is answered with an error.

opRequestAnswer
var{"key"}A declared variable from the project's own variables, then its settings, or null.
storeGet{"key"}The plugin's saved value, or null.
storeSet{"key", "value"}Saves it, encrypted. null removes it.
projectFileRead{"path"}Text under .taskproxy/plugins/<id>/ in the open project, or null.
projectFileWrite{"path", "text"}Writes there, at most 1 MB. Paths can't leave that folder.
currentBranch{}The branch's name, or null. Needs git: currentBranch.
now{}Milliseconds since the Unix epoch.
http{"request": {"method", "url", "headers", "body"}}{"status", "body"}. HTTPS to declared hosts only, no redirects, at most 10 MB back, and no credentials in the URL.

Action results

Every field is optional, and {} changes nothing.

FieldEffect
message{"text", "theme"}: a short alert.
closeDialogCloses the dialog the action came from.
navigate{"page", "params"}: opens one of the plugin's pages.
dialog{"title", "ui"}: opens a dialog.
uiReplaces the page's content, or the dialog's.
refreshDraws the page again.
options[{"value", "label"}]: choices for a select node or a field's suggest.

Nodes

Every node has a type. An unknown type is drawn as a placeholder. Themes are primary, secondary, tertiary, info, success, warning, and danger.

typeFields
stack, row, toolbarchildren
headingtext, level (1 to 4, default 2)
texttext, muted, strong
markdowntext, sanitized
badgetext, theme
linktext, action
buttonaction, theme
propertiesitems, each {"label", "value"} with a node as the value
tablecolumns, titles or {"label", "action", "sort"}, and rows, each {"cells", "action"}
selecttext, theme, options (an action that returns the choices when clicked), action (run with the choice as form.value)
cliptext, max (30), tip (100), action, always, muted
sectionkey, title, subtitle, open, children. Remembered open or closed by key.
panelkey, open, children. Shown and hidden by the toggle host action.
formfields, submit, cancel, buttons, children
inputsfields, more of a form's fields among its children
noticetext, theme
emptytext

An action is {"id", "label", "params", "confirm", "icon", "host"}. With confirm, the user is asked first.

A field is {"name", "label", "kind", "value", "options", "required", "placeholder", "help", "suggest"}:

Host actions

Run by Task Proxy only when the user clicks the button that names them.

typeFieldsDoes
git.createBranchnameCreates a branch and switches to it. Needs git: createBranch.
openUrlurlOpens an HTTPS address in the browser.
copytextCopies to the clipboard.
openSettingsOpens the plugin's settings.
togglekeyShows or hides a panel.

Catalog

Plugin Development

Build plugins for Task Proxy, and the spec they follow

You can also come chat with us on the Stoic Dreams discord server.

About Task Proxy Contact Stoic Dreams Privacy Terms & Conditions