Developer documentation

API Reference

All app-facing APIs currently exposed to plugins: transform helpers, command context, selector methods, actions, hooks, bus methods, and core commands.

api.ui in transformApp(app, api)

Use these while building the app definition. They mutate the JSON UI tree and return true when the target was found.

MethodUseExample
findById(root, id)Read a node from the app tree.api.ui.findById(app, "rightPanel")
append(root, parentId, child)Add a child at the end of a container.api.ui.append(app, "rightPanel", card)
prepend(root, parentId, child)Add a child at the start of a container.api.ui.prepend(app, "pluginList", item)
insertBefore(root, targetId, child)Place a node before another node.api.ui.insertBefore(app, "sendButton", button)
insertAfter(root, targetId, child)Place a node after another node.api.ui.insertAfter(app, "sendButton", button)
insertAtIndex(root, parentId, index, child)Insert at a specific child index.api.ui.insertAtIndex(app, "rightPanel", 0, card)
replace(root, id, replacement)Replace a node in the app tree.api.ui.replace(app, "rightPanel", panel)
replaceAtIndex(root, parentId, index, child)Replace a child by index.api.ui.replaceAtIndex(app, "tabs", 1, tab)
remove(root, id)Remove a node from the app tree.api.ui.remove(app, "oldPluginCard")
setProps(root, id, props)Merge properties onto a node.api.ui.setProps(app, "sendButton", { text: "RUN" })
wrap(root, targetId, wrapper)Wrap an existing node in a container.api.ui.wrap(app, "bodyEditor", { type: "card" })
unwrap(root, wrapperId)Remove a wrapper and keep its first child.api.ui.unwrap(app, "bodyEditorWrapper")

ctx in commands

Property or methodUse
ctx.requestThe active request object: name, method, url, headers, body.
ctx.responseBodyThe latest response body string when available.
ctx.response / ctx.responseJsonThe latest response object with statusCode, headers, and body.
ctx.payloadPayload passed by a button/action/recorded click.
ctx.fileFile object from pickTextFile: name and text.
ctx.pluginDataAll persisted plugin data.
ctx.getPluginData(key, fallback)Read a persisted value.
ctx.setPluginData(key, value)Write persisted plugin data and trigger refresh.
ctx.dollar(selector)Select visible app/plugin nodes and read, update, click, or mutate them.
ctx.busRead/write shared plugin bus values and channels.
ctx.mediaCreate media permission, camera preview, and audio recording actions.
ctx.bluetoothCreate Bluetooth/BLE actions for permissions, status, scan, connect, services, read, and write.
platform.run actionsCall app-managed platform APIs for system info, network, files, clipboard, secure storage, mail/SMS/phone launchers, calendar/contact files, Android snapshots, and Windows diagnostics.

Core commands

CommandWhat it does
core.request.send, request.send, requests.sendSend the active request.
core.request.sendButtonSend the active request via the same command path as the Send button.
core.request.newCreate a new request.
core.request.saveToCollectionSave the active request to the current collection.
core.collection.newCreate a new collection.
core.saveSave app state.
core.headers.addButtonAdd a header row. Accepts payload { key, value }.
core.body.addButtonAdd a JSON body field. Accepts payload { key, value }.
core.plugin.uploadOpen plugin upload.
core.plugin.scanDirectoryPickerPick and scan a plugin directory.
core.plugin.scanDirectoryScan a provided directory path.
core.plugin.installFromPathInstall a scanned plugin by path.
core.plugin.installSampleInstall bundled critical/sample plugins.
core.pluginBus.inspectStore a plugin bus snapshot in pluginBusInspector.
core.pluginBus.clearTraceClear bus trace history.
ui.remove, ui.hide, ui.show, ui.setText, ui.setValue, ui.setProps, ui.addClass, ui.removeClassRenderer UI commands. Pass the actual action fields in payload.