OPSAVOR docs
Menu

Home › Plugins

Writing a plugin

For developers and AI models: what a plugin is made of, how to check one, and where the full interface lives.

Most plugins in these pages are one JSON file, a manifest, and no code. A plugin can also be an app: the same manifest plus one JavaScript file for work the manifest cannot describe. Either way the platform runs it inside each customer's own copy, through the same access rules as everything else, so a plugin only ever sees one business's records and only what its owner approved.

What a manifest holds

PartWhat it does
valuesPer-tenant values the owner or OPSAVOR fills in: plain configuration read as config.name, and secret tokens that can only be injected into an api_call. A secret is write-only and sealed.
grantsWhat it asks the owner for: which records it reads, whether it sees people, model use and its budget, notices, proposals, approvals, its views.
derivationsSteps over the records (sum, list, join, filter) that emit small results, each citing the documents it came from.
viewsCards on Start or its own page, built from tables, lists, charts and figures the app draws. A table or list can be a to-do list with Mark reviewed, or a decision with Approve and Reject.
triggersOn a schedule, when records change, or by a button: re-derive, write a brief (every figure checked), post a notice.
flowsAutomations: a trigger and steps (records, query, if, forEach, ai, propose, notify, message, webhook, app). Messages and web hooks wait for the owner unless they let a store plugin's flow send by itself. See the reference's Flows section.
codeAn app: one JavaScript file of handlers and screens. Its grants limit what it can read and do; it keeps its own storage, and every run is limited and logged.
tools, skillsGive Savy a plugin's results, or teach Savy a way of working. A skill can declare an agent with its own scope and tests.

Check one on your own machine

With opsavor/platform checked out beside the plugin, the kit needs nothing installed:

node ../platform/bin/plugin.mjs validate plugin.json --tier store
node ../platform/bin/plugin.mjs run plugin.json --sample
node ../platform/bin/plugin.mjs run plugin.json --plane /path/to/a/copy/of/plane.db

validate names every problem by its place in the file. --sample runs it on a small made-up business that has bills with lines, a statement and a supplier who has gone quiet.

What a manifest can do now

The reference is the exact list and moves with the engine; check it before using one of these.

Where to go next