PGAP

The wire protocol between a plugin and the host, message by message.

Generated Tracks the alpha branch, so it can be ahead of the release you have installed.

On this page

PGAP (Plexi Generic API Protocol) describes messages between plugins and the Plexi host. The Python adapter bridges these JSON messages into host services. Rust WASM components use the typed contract in wit/plexi.wit.

How It Works

Opening a view starts its plugin runtime. The plugin returns a UI tree; the host paints it and delivers input events for the containing pane.

Host ──render request──► Plugin
Host ◄──UI tree───────── Plugin
Host ──input event──────► Plugin

The host owns the render loop. When a view needs rendering, the host asks its runtime for a fresh set of draw commands and composites them into the UI.

Every message is a JSON object with a type discriminant field. The schema version is 3 — see sdk/protocol/pgap.schema.json for the full machine-readable definition.

Capabilities

Every plugin declares its capabilities in manifest.toml. The host enforces these at runtime:

[plugin.capabilities]
capabilities = ["secrets.get", "net.http"]

Capabilities gate host APIs. Python uses the CPython WASI adapter; Rust components use typed WIT imports. These are distinct runtime paths with their own admission and permission checks. The Cap column shows the declared capability associated with each request; other scope and broker checks can still apply. See the runtime contract.

The Python SDK

The Python SDK uses module-level init, update, and view functions. view() returns a component tree; PluginHarness exercises the lifecycle. See the SDK reference for the full API.

App → Host Requests

App-to-host requests — go to route_command.

Messages the app sends to request host services.

spawn_receipt

Hold this connection open for the reply to a queued spawn. The queue entry names the same token; the host answers her…

FieldTypeRequired
response_filestringyes

show_host

Reveal and focus the running host window for a second app launch.

FieldTypeRequired
response_filestringyes

context_rename

Rename a context through the same commit handler as the desktop editor.

FieldTypeRequired
context_idintegeryes
namestringyes
response_filestringyes

context_close

Close a context, honoring the desktop confirmation policy.

FieldTypeRequired
context_idintegeryes
response_filestringyes

context_park

Set a context’s parked state.

FieldTypeRequired
context_idintegeryes
parkedbooleanyes
response_filestringyes

pane_zoom

Focus a pane and toggle its zoom, including portal navigation.

FieldTypeRequired
pane_idintegeryes
response_filestringyes

pane_swap

Focus a pane and swap it with its directional neighbor.

FieldTypeRequired
directionstringyes
pane_idintegeryes
response_filestringyes

workspace_snapshot

Read the active workspace layout without pane content.

FieldTypeRequired
response_filestringyes

reload_config

Reload the running host configuration from disk.

FieldTypeRequired
response_filestringyes

focus_history

Step through the host’s pane focus history.

FieldTypeRequired
forwardbooleanyes
response_filestringyes

resource_lease

Process-lifetime resource admission. The holder must be in the kernel-witnessed lineage of the caller.

FieldTypeRequired
holder_pidintegeryes
maxinteger?no
namestring?no
opstringyes
response_filestringyes

submit_assistant_turn

Submit one text turn to the Assistant. With pane_id omitted the host reuses an Assistant in the context or creates …

FieldTypeRequired
clientstring?no
context_idinteger?no
conversation_idstring?no
join_desktopbooleanno
kindstring?no
pane_idinteger?no
request_idstringyes
response_filestringyes
status_forstring?no
textstringyes

agents_dashboard

Read or steer the command view. op is list, open, or cancel. Cancel finishes that run before the next tool.

FieldTypeRequired
opstringyes
payloadanyno
response_filestringyes

assistant_host_tool

Run one Assistant host tool (host.files.edit, host.editors.list, …) through the same permission gate the desktop …

FieldTypeRequired
input_jsonstringyes
namestringyes
response_filestringyes

capability_request

Request a runtime capability prompt. Host shows modal; responds with CapabilityDecision.

FieldTypeRequired
capabilitystringyes
request_idstringyes

plugin_secret_get

Request a workspace-scoped secret. Scoped to Init.workspace_root automatically.

FieldTypeRequired
keystringyes

file_read

Read a file through the native WASM plugin runtime host. Requires fs.read and the resolved path must stay inside th…

Capability: fs.read

FieldTypeRequired
pathstringyes

file_list

List a directory through the native WASM plugin runtime host. Requires fs.read and the resolved path must stay insi…

Capability: fs.read

FieldTypeRequired
extensionsstring[]no
pathstringyes

save_plugin_state

Save plugin state. Host writes to workspace or global JSON file.

FieldTypeRequired
payloadanyyes

run_get

Request to start a run. Host surfaces in Run palette (Cmd+R).

FieldTypeRequired
intentstringyes
payloadanyyes

run_complete

Signal that a run the plugin owns has finished.

FieldTypeRequired
resultanyyes
run_idstringyes

notify

Post a PGAP notification. PGAP is the rich producer contract: it supports Message, Choice, and Input, plus options, s…

FieldTypeRequired
actionsNotificationAction[]no
bodystringyes
image_inlinevariantno
image_pipe_idstring?no
input_promptstring?no
kindNotifyKindno
notify_idstring?no
on_dismissstring?no
optionsNotifyOption[]no
requiredbooleanno
response_filestring?no
scopevariantno
timeout_secsinteger?no
titlestringyes

dismiss_notification

Remove a notification posted by the caller. The host verifies the caller identity against the notification’s stamped …

FieldTypeRequired
notify_idstringyes
response_filestringyes

set_agent_state

Report agent state for a pane. Called by hook scripts via plexi agent report.

FieldTypeRequired
agentstringyes
blocked_reasonvariantno
detailstring?no
eventstring?no
pane_idintegeryes
session_idstring?no
stateAgentStateyes

set_pip_status

Report a plugin’s own pip status (red/yellow/green) for its activity dot. Fire-and-forget; set by the plugin process …

FieldTypeRequired
pane_idintegerno
statusPipStatusyes

get_agent_states

Get all tracked pane agent states. Writes JSON array to response_file.

FieldTypeRequired
response_filestringyes

pipe_open

Open a typed pipe. mode: “json” | “binary” direction: “in” | “out” | “duplex”

FieldTypeRequired
directionstringyes
modestringyes
pipe_idstringyes

pipe_open_directed

Open a directed JSON pipe to a specific target pane (#286).

FieldTypeRequired
pipe_idstringyes
request_idstringyes
target_pane_idintegeryes

pipe_send

Send a JSON message on directed pipe connection generation. A send naming a pipe instead of a generation is rejecte…

FieldTypeRequired
generationintegeryes
payloadanyyes

status_summary

Status text for the pane. The host accepts and discards it today; nothing shows it.

FieldTypeRequired
textstringyes

log_marker

Write one info-level marker line into the running host’s channel log (~/.plexi-<channel>/plexi.log). Sent by `plexi…

FieldTypeRequired
messagestringyes
response_filestring?no
sourcestringyes

spawn_view

Request the host to spawn a new view pane. Requires spawn.plugin capability. layout: “split_h” (new pane right), …

Capability: spawn.plugin

FieldTypeRequired
argsstring[]no
layoutstring?no
type_idstringyes

spawn_pane

Unified pane spawn primitive (#592). Supersedes SpawnView for new plugins. Requires panes.spawn capability. `layout…

Capability: panes.spawn

FieldTypeRequired
agent_cmdstring?no
argsstring[]no
boot_timeout_secsnumber?no
context_namestring?no
cwdstring?no
ephemeralbooleanno
from_pane_idinteger?no
layoutstring?no
namestring?no
no_focusbooleanno
pathstring?no
request_idstring?no
response_filestring?no
result_schemaanyno
target_contextinteger?no
type_idstringyes
workspace_rootstring?no
worktreestring?no

set_pane_title

Set the title displayed on a terminal pane’s tab. Sent by plexi pane set-title over PLEXI_SOCKET.

FieldTypeRequired
namestringyes
pane_idintegeryes

get_build_info

Return the running executable’s immutable build identity.

FieldTypeRequired
response_filestringyes

list_panes

List all open panes. Host writes a JSON array to response_file. Sent by plexi pane list.

FieldTypeRequired
context_idinteger?no
response_filestringyes

list_contexts

List all open contexts. Host writes a JSON array to response_file. Sent by plexi context list.

FieldTypeRequired
response_filestringyes

get_pane_info

Query info for a specific pane by ID. Host writes JSON object to response_file. Sent by plexi pane info.

FieldTypeRequired
pane_idintegeryes
response_filestringyes

get_previous_pane_info

Query info for the previously focused pane. Host walks pane_focus_history from the end, finds the Nth live entry, a…

FieldTypeRequired
response_filestringyes
stepsintegerno

list_permissions

List permission state across plugins (stint 0017). No gate: any socket caller can send it, and nothing checks `permis…

FieldTypeRequired
response_filestringyes

slot_write

Write bytes to a named host-managed pane file slot.

FieldTypeRequired
appendbooleanyes
contentinteger[]yes
pane_idintegeryes
replacebooleanyes
response_filestringyes
slot_namestringyes

slot_read

Read raw bytes from a named host-managed pane file slot.

FieldTypeRequired
pane_idintegeryes
response_filestringyes
slot_namestringyes

slot_wait

Block until a named pane file slot’s value matches pattern.

FieldTypeRequired
pane_idintegeryes
patternstringyes
response_filestringyes
slot_namestringyes
timeout_secsnumberyes

slot_list

List named host-managed pane file slots.

FieldTypeRequired
pane_idintegeryes
response_filestringyes

slot_delete

Delete a named host-managed pane file slot.

FieldTypeRequired
pane_idintegeryes
response_filestringyes
slot_namestringyes

workspace_clean_slots

Remove slot files for pane ids that are no longer live in any window.

FieldTypeRequired
dry_runbooleanyes
response_filestringyes

pane_message_send

Append a structured message to a pane’s host-managed FIFO inbox.

FieldTypeRequired
pane_idintegeryes
payloadstringyes
response_filestringyes
submitbooleanno

pane_message_recv

Drain all queued messages from a pane’s host-managed FIFO inbox.

FieldTypeRequired
pane_idintegeryes
response_filestringyes
timeout_secsnumberno
waitbooleanno

pane_result_schema_set

Declare or update the JSON Schema for a pane’s structured return value before a result is committed (`plexi pane resu…

FieldTypeRequired
pane_idintegeryes
response_filestringyes
schemaanyyes

pane_result_write

Validate and commit a pane’s structured JSON result once (plexi pane result write, stint 0666). Malformed JSON or p…

FieldTypeRequired
pane_idintegeryes
payloadstringyes
response_filestringyes

pane_result_read

Read a pane’s validated structured result (plexi pane result <id>, stint 0666). When wait is false, returns the c…

FieldTypeRequired
pane_idintegeryes
response_filestringyes
timeout_secsnumberno
waitbooleanno

agent_call

Invoke an agent role as a tool, waiting for its completion or question.

FieldTypeRequired
asynchronousbooleanno
call_credentialstring?no
cwdstring?no
handoffbooleanno
response_filestringyes
rolestringyes
taskstringyes
worktreestring?no

agent_message

Deliver a structured reply to a child agent, optionally waiting for its next outcome.

FieldTypeRequired
call_credentialstring?no
pane_idintegeryes
response_filestringyes
textstringyes
waitbooleanno

agent_spawn

Spawn a configured agent worker pane, optionally into a created or reused child sub-context with a parent `PortalPane…

FieldTypeRequired
anchor_paneinteger?no
commandstringyes
cwdstring?no
ephemeralbooleanno
focusbooleanno
harnessstringyes
initial_slotsany[][]no
namestring?no
response_filestringyes
result_schemaanyno
rolestringno
subcontextstring?no
taskstring?no
worktreestring?no

agent_wait

Blocking pull wait for one or more child agent panes to finish via plexi agent done (`plexi agent wait <pane-id…>…

FieldTypeRequired
pane_idsinteger[]yes
response_filestringyes
timeout_secsnumberno

agent_done

Complete a worker agent’s task, validating --result against result_schema (stint 0666), writing completed and `…

FieldTypeRequired
pane_idintegeryes
response_filestringyes
resultstring?no
summarystring?no

agent_next

Tier 1 escalation (Worker -> Master): ask the parent master agent a question and transition the worker pane to `Age…

FieldTypeRequired
response_filestringyes

agent_fleet

FieldTypeRequired
filterFleetFilterno
response_filestringyes

agent_fleet_dismiss

FieldTypeRequired
all_failedbooleanno
response_filestringyes
targetinteger?no

agent_ask

FieldTypeRequired
pane_idintegeryes
questionstringyes
response_filestringyes

agent_open

Reopen a closed agent session or run from ~/.plexi-<channel>/agent_history.jsonl (`plexi agent reopen <run-id|sessi…

FieldTypeRequired
cwdstringyes
namestringyes
response_filestringyes

agent_new_chat

New chat for a named agent (plexi agent new-chat <name>, stint 1397): archive the chat agent open would return to…

FieldTypeRequired
cwdstringyes
namestringyes
response_filestringyes

agent_reopen

FieldTypeRequired
querystringyes
response_filestringyes
subcontextstring?no

focus_pane

Move UI focus to a pane by PaneId. Sent by plexi pane focus. Fire-and-forget.

FieldTypeRequired
pane_idintegeryes

close_pane

Close a pane by PaneId. Sent by plexi pane close. When response_file is set, the host writes `{“ok”: true, “pane_…

FieldTypeRequired
pane_idintegeryes
response_filestring?no

send_to_pane

Write text to a terminal PTY or a plugin’s input path (plexi pane send). \n in text (literal backslash-n) is inte…

FieldTypeRequired
generated_operation_idbooleanno
operation_idstring?no
pane_idintegeryes
pastebooleanno
response_filestring?no
submitbooleanno
textstringyes

pane_heartbeat

Configure or disable a host-owned recurring terminal prompt.

FieldTypeRequired
every_msinteger?no
offbooleanno
pane_idintegeryes
response_filestring?no
textstring?no
while_idle_onlyboolean?no

key_pane

Deliver a synthetic key event to any pane. Sent by plexi pane key. For terminal panes, the key is translated to PTY…

FieldTypeRequired
keystringyes
pane_idintegeryes
response_filestring?no

drop_file

Deliver a local path or image URL to the pane through the same production drop handler used by native host drops.

FieldTypeRequired
pane_idintegeryes
path_or_urlstringyes
response_filestringyes

click_pane

Deliver a synthetic pointer click to a view pane, in pane-pixel coordinates (origin at the pane’s top-left). Sent by …

FieldTypeRequired
buttonstring?no
pane_idintegeryes
response_filestring?no
xnumberyes
ynumberyes

click_pane_node

Activate one node of a plugin pane by the ref plexi pane state reports for it (<id>.<16 hex>, stint 1600). Sent b…

FieldTypeRequired
node_refstringyes
pane_idintegeryes
response_filestring?no

drag_pane

Deliver a sanctioned pointer drag to a view pane: press at from, steps intermediate PointerMoved positions, rel…

FieldTypeRequired
buttonstring?no
fromarray?no
from_nodestring?no
pane_idintegeryes
response_filestring?no
stepsinteger?no
toarray?no
to_nodestring?no

capture_pane

Read the last N lines from a terminal pane’s PTY scrollback buffer. Sent by plexi pane capture. Host writes a JSON …

FieldTypeRequired
from_cursorinteger?no
full_outputbooleanno
linesintegeryes
pane_idintegeryes
response_filestringyes

pane_status

Derive one auditable working/idle/blocked verdict from the pane’s agent detector, TUI status bar, and trailing termin…

FieldTypeRequired
pane_idintegeryes
response_filestringyes

get_pane_state

Query the last-rendered UI state of a pane. Sent by plexi pane state. For view panes: host writes a versioned `sema…

FieldTypeRequired
pane_idintegeryes
response_filestringyes
stale_after_secsinteger?no

screenshot

Capture the live host window as a PNG through the real render pipeline (egui::ViewportCommand::Screenshot — actual …

FieldTypeRequired
output_pathstringyes
pane_idinteger?no
response_filestringyes

host_key

Inject a synthetic key into the host-level input path. Sent by plexi host key for validating host shortcuts without…

FieldTypeRequired
keystringyes
response_filestringyes

send_pane_action

Dispatch a semantic action to a view pane. Sent by plexi pane action <pane_id> <action> [args...]. Host delivers `P…

FieldTypeRequired
actionstringyes
argsstring[]no
pane_idintegeryes
response_filestring?no

list_permission_requests

List pending permission requests. Observation seam for the desktop gate.

FieldTypeRequired
response_filestringyes

show_permission_request

Show one pending permission request.

FieldTypeRequired
pending_request_idstringyes
response_filestringyes

resolve_permission_request

Resolve one pending permission request from the desktop observation seam.

FieldTypeRequired
choicestringyes
pending_request_idstringyes
response_filestringyes

permissions

Read or change the permission monitor. op is list, reset, revoke, or allow. No socket caller is human: `res…

FieldTypeRequired
durationstring?no
idstring?no
opstringyes
response_filestringyes

caller_context

Ask the host which pane (if any) the socket peer lives in and that pane’s live context authority root. The CLI uses t…

FieldTypeRequired
response_filestringyes
workspace_cwdstring?no

file_open

Open one file or directory in the Plexi surface that handles it (plexi file open, plexi open). The host resolves …

FieldTypeRequired
cwdstring?no
from_pane_idinteger?no
no_focusbooleanno
pathstringyes
placementvariantno
response_filestringyes

list_needs_you

List items waiting on the human. The host expires due items first.

FieldTypeRequired
response_filestringyes

resolve_needs_you

Resolve one needs-you item. Approving a click approval is refused: the row stays open and only the desktop Allow once…

FieldTypeRequired
approvebooleanyes
idstringyes
response_filestringyes

needs_you_api

Rich Needs-you + continuation API: op is ask, show, answer, reconcile, or complete. The caller is the hos…

FieldTypeRequired
opstringyes
payloadanyyes
response_filestringyes

pane_secret_list

Names-only explicit-context inventory, admitted for the host-stamped peer.

FieldTypeRequired
contextstringyes
response_filestringyes

secret_get

Read a workspace or global secret for the host-classified socket caller.

FieldTypeRequired
globalbooleanno
namestringyes
response_filestringyes
workspace_rootstring?no

secret_set

Store a secret after admission for its exact name and scope.

FieldTypeRequired
globalbooleanno
namestringyes
response_filestringyes
route_namestring?no
valueSecretInputyes
workspace_rootstring?no

secret_delete

Delete a secret after admission for its exact name and scope.

FieldTypeRequired
globalbooleanno
namestringyes
response_filestringyes
workspace_rootstring?no

folder_secret_exec

Release the environment for this folder on the requesting connection.

FieldTypeRequired
cwdstringyes
response_filestringyes

run_secrets

Release the approved command definition and its required environment.

FieldTypeRequired
commandstringyes
cwdstringyes
response_filestringyes
workspace_rootstring?no

folder_secret_read

Read one folder account on the original connection after host admission.

FieldTypeRequired
cwdstringyes
folderstring?no
namestringyes
response_filestringyes

folder_secret_set

Set a folder account after admission for the host-stamped caller.

FieldTypeRequired
folderstringyes
namestringyes
response_filestringyes
valueSecretInputyes

folder_secret_rm

Remove a folder account after admission for the host-stamped caller.

FieldTypeRequired
folderstringyes
namestringyes
response_filestringyes

agents_api

Agents API: agent registry, runs, delegation, and gated tool calls. op is create_agent, list_agents, `list_gran…

FieldTypeRequired
opstringyes
payloadanyyes
response_filestringyes

call_plugin_tool

Call a plugin-exposed tool through the host tool dispatcher. Sent by plexi plugin call. The host resolves the viewe…

FieldTypeRequired
call_credentialstring?no
input_jsonstringyes
plugin_idstringyes
response_filestring?no
target_pane_idinteger?no
toolstringyes
wait_approvedbooleanno

list_plugin_tools

Snapshot the live tool registry exposed by running view panes in the resolved context. Sent by plexi plugin tools a…

FieldTypeRequired
context_idinteger?no
plugin_idstring?no
response_filestringyes

create_context

Create a new context. Sent by plexi context new over PLEXI_SOCKET.

FieldTypeRequired
anchor_paneinteger?no
focusbooleanno
namestring?no
parent_context_idinteger?no
parent_namestring?no
portal_directionstring?no
response_filestring?no
rootstring?no
windowsstring[]no

create_sub_context

Create a sub-context under the caller’s context, pre-populated with a squad of terminal panes in a single window. Sen…

FieldTypeRequired
anchor_paneinteger?no
focusbooleanno
layoutvariantno
namestringyes
panesstring?[]yes
parent_context_idinteger?no
parent_namestring?no
response_filestring?no
rootstringyes

focus_context

Focus existing context by root, or create one. Sent by plexi context open.

FieldTypeRequired
response_filestring?no
rootstringyes

set_context_root

Set/update the root of a context. Sent by plexi context set-root. context_id targets the caller’s context (PLEXI_…

FieldTypeRequired
context_idinteger?no
response_filestring?no
rootstringyes

set_context_description

Set/update the description of a context. Sent by plexi context describe. context_id targets the caller’s context …

FieldTypeRequired
context_idinteger?no
descriptionstringyes
response_filestring?no

zoom_into_context

Zoom into a sub-context. Pushes depth stack. Sent by plexi context zoom.

FieldTypeRequired
context_idintegeryes
response_filestring?no

zoom_out_of_context

Zoom out of a sub-context. Pops depth stack. Sent by plexi context zoom-out.

No additional fields.

push_pane_to_subcontext

Push a pane into a new sub-context. Sent by plexi context push. pane_id targets the caller’s pane (PLEXI_PANE_ID)…

FieldTypeRequired
namestring?no
pane_idinteger?no

query_context_state

Query the rolled-up ContextState for a context (#1518). The requesting plugin must be in an ancestor (or the same) …

FieldTypeRequired
context_idintegeryes

http_request

Host-brokered HTTP request. Requires net.http capability. Host replies with `PlexiEvent::HttpResponse { request_id,…

Capability: net.http

FieldTypeRequired
bodystring?no
headersobjectno
methodstringno
request_idstringyes
urlstringyes

open_url

Open an HTTP(S) URL in the user’s default browser.

FieldTypeRequired
urlstringyes

ai_query

v3.3 brokered AI call. Requires ai.query capability.

Capability: ai.query

FieldTypeRequired
messagesAiMessage[]yes
model_tierModelTieryes
request_idstringyes
systemstringyes
toolsAiTool[]yes

expose_tools

v3.7 tool protocol (#398). App declares its callable tools to the host. The host registers these in the global tool r…

FieldTypeRequired
toolsAiTool[]yes

tool_result

v3.7 tool protocol (#399). App returns the result of a PlexiEvent::ToolCall invocation. call_id must match the `c…

FieldTypeRequired
call_idstringyes
errorstring?no
error_codestring?no
output_jsonstring?no

audio_play

Host-owned audio playback via rodio.

FieldTypeRequired
pipe_idstring?no
sourcestring?no
statestringyes
volumenumberno

audio_capture

Host-owned audio capture: mic PCM delivered on a binary pipe. device_id selects which input device (from `ListAudio…

FieldTypeRequired
buffer_sizeintegeryes
device_idstring?no
pipe_idstringyes
sample_rateintegeryes

list_audio_devices

Request enumeration of audio devices (#277). Host responds with `PlexiEvent::AudioDevicesListed { request_id, inputs,…

FieldTypeRequired
request_idstringyes

list_midi_devices

Request enumeration of MIDI ports (#320). Host responds with `PlexiEvent::MidiDevicesListed { request_id, inputs, out…

FieldTypeRequired
request_idstringyes

open_midi_input

Open a MIDI input port and forward every incoming message as a binary pipe frame on pipe_id. Each frame is a single…

Capability: midi.in

FieldTypeRequired
pipe_idstringyes
port_idstringyes

close_midi_input

Close the MIDI input previously opened on port_id. The host disconnects from the port and closes the associated bin…

FieldTypeRequired
port_idstringyes

send_midi

Send one MIDI 1.0 byte stream to port_id. Fire-and-forget — the host only emits PlexiEvent::MidiSendError if the …

Capability: midi.out

FieldTypeRequired
bytesinteger[]yes
port_idstringyes

open_video

Open a video decoder (#345). The host responds with `PlexiEvent::VideoOpenAck { request_id, handle_id, width, height,…

Capability: video.playback

FieldTypeRequired
pipe_idstringyes
request_idstringyes
sourcestringyes

set_video_state

Drive playback state for a previously-opened video handle (#345). handle_id is the value returned in VideoOpenAck…

FieldTypeRequired
handle_idintegeryes
stateVideoStateyes

close_video

Close a previously-opened video handle (#345). Tears down the decoder thread and the associated binary pipe drains. N…

FieldTypeRequired
handle_idintegeryes

cd_request

Request the host to cd all terminals in the same pane group to cwd. Terminals receive cd <cwd>\n written to their…

FieldTypeRequired
cwdstringyes

set_timer

Request a one-shot timer. Requires timer capability. Host fires PlexiEvent::Timer { timer_id } after after_ms m…

Capability: timer

FieldTypeRequired
after_msintegeryes
timer_idstringyes

cancel_timer

Cancel a pending timer. No-op if the timer has already fired or doesn’t exist.

FieldTypeRequired
timer_idstringyes

load_image

Async image fetch brokered through the host. Requires net.http capability. Host fetches src, caches under `handle…

Capability: net.http

FieldTypeRequired
handlestringyes
srcstringyes

request_linked_terminal

Ask the host to open a fresh terminal pane next to this Canvas plugin and link it. Host responds with `PlexiEvent::Li…

FieldTypeRequired
cwdstring?no
labelstring?no
request_idstringyes

run_in_linked_terminal

Execute command in a linked terminal pane.

FieldTypeRequired
commandstringyes
echobooleanyes
terminal_pane_idintegeryes

insert_path_token

Insert path into the linked terminal at the cursor position.

FieldTypeRequired
modePathTokenModeyes
pathstringyes
terminal_pane_idintegeryes

request_command_preview

Ask the host to compute the command that would run for a given command string in the linked terminal. Doesn’t execu…

FieldTypeRequired
commandstringyes
request_idstringyes
terminal_pane_idintegeryes

open_artifact

Open a workspace artifact (file or directory) via the host.

FieldTypeRequired
modeArtifactOpenModeyes
pathstringyes

push_nav

App signals it has pushed a navigation level. The host appends the entry to its per-pane nav stack. While the stack h…

FieldTypeRequired
titlestringyes
view_idstringyes

pop_nav

App signals it has popped a navigation level. The host removes the top entry from the per-pane nav stack (saturating …

No additional fields.

set_mouse_tracking

Enable or disable PlexiEvent::MouseMove delivery for this pane.

FieldTypeRequired
enabledbooleanyes

stream_process

Spawn command via sh -c and stream its output back to the plugin.

FieldTypeRequired
channelStreamChannelyes
commandstringyes
correlation_idstringyes
terminal_pane_idintegeryes

cancel_process

Cancel an in-flight StreamProcess. The host sends SIGTERM to the child, waits up to 1s, then SIGKILL. A `PlexiEvent…

FieldTypeRequired
correlation_idstringyes

open_file_picker

Show a native file picker dialog. Requires fs.pick capability.

Capability: fs.pick

FieldTypeRequired
filterstring[]yes
modeFilePickerModeno
multiplebooleanyes
request_idstringyes

declare_event_streams

Declare the named event streams this plugin may emit on. Event names are plugin-defined but MUST be declared (with a …

FieldTypeRequired
streamsEventStreamDecl[]yes

emit_event

Emit a semantic plugin event into the host timeline.

FieldTypeRequired
actorPluginEventActoryes
actor_idstring?no
caused_bystring?no
changed_resourcesstring[]no
eventstringyes
payloadanyno
resource_idstringyes
resource_scopestring?no
revision_afterstringyes
revision_beforestring?no
rollback_tokenstring?no
state_refstring?no
suggested_triggervariantno
summarystringyes

rollback_verify_result

App’s answer to PlexiEvent::RollbackVerify: the current revision of the queried resource. The host compares it agai…

FieldTypeRequired
checkpoint_idstringyes
current_revisionstringyes

subscribe_plugin_events

Subscribe this pane to another plugin’s declared event streams. Gated through the unified broker (`TargetType::Plugin…

FieldTypeRequired
event_namesstring[]no
payload_modePayloadModeyes
plugin_idstringyes
request_idstringyes
resource_idstring?no
trigger_modeTriggerModeyes

unsubscribe_plugin_events

Remove a subscription previously created by SubscribePluginEvents. Only the subscriber that owns it may remove it.

FieldTypeRequired
request_idstringyes
subscription_idstringyes

list_undo_checkpoints

List undo checkpoints from the host undo timeline, newest first. plugin_id filters to one plugin; None = this plu…

FieldTypeRequired
plugin_idstring?no
request_idstringyes

request_rollback

Request rollback of an undo checkpoint. Gated through the unified broker (TargetType::UndoCheckpoint). On allow, th…

FieldTypeRequired
checkpoint_idstringyes

wake

No-op wake. Nudges the (zero-frame-idle) UI thread to run a frame so queued work — spawn-queue files, pane-IPC channe…

No additional fields.

shutdown

Request a clean host shutdown. Sent by plexi host stop over a direct notify.sock connection (never over `PLEXI_SO…

FieldTypeRequired
response_filestring?no

Host → App Events

Messages the host sends to the app.

init

Sent exactly once on startup. App must reply with DrawCommand::Ready.

FieldTypeRequired
argsstring[]no
capabilitiesstring[]yes
compact_thresholdnumberno
feature_flagsstring[]yes
heightnumberno
plugin_idstringyes
protocolstringyes
regular_thresholdnumberno
stateanyno
themeobjectno
widthnumberno
workspace_rootstringyes

render

Request a new frame. App replies with DrawCommands terminated by FrameDone.

FieldTypeRequired
canvas_heightnumberno
canvas_widthnumberno
frame_idintegeryes
rectRectyes

resize

Surface was resized. App should re-layout and request a new frame.

FieldTypeRequired
heightnumberyes
widthnumberyes

key

User input event.

FieldTypeRequired
keystringyes
modifiersModifiersyes
pressedbooleanyes

click

Mouse click at logical coordinates within the plugin surface.

FieldTypeRequired
buttonMouseButtonyes
regionstring?no
xnumberyes
ynumberyes

mouse_down

Pointer button pressed (fires on the frame the button goes down).

FieldTypeRequired
buttonMouseButtonyes
modifiersModifiersyes
xnumberyes
ynumberyes

mouse_up

Pointer button released (fires on the frame the button goes up).

FieldTypeRequired
buttonMouseButtonyes
modifiersModifiersyes
xnumberyes
ynumberyes

mouse_move

Pointer moved over the plugin surface. Only fires when the plugin has opted in via `DrawCommand::SetMouseTracking { e…

FieldTypeRequired
buttonsMouseButton[]yes
modifiersModifiersyes
xnumberyes
ynumberyes

command

User submitted a command via the command bar.

FieldTypeRequired
textstringyes

action

Semantic action dispatched by plexi pane action <pane_id> <action> [args...]. Plugins receive this in on_event an…

FieldTypeRequired
actionstringyes
argsstring[]no

capability_decision

Response to a runtime CapabilityRequest.

FieldTypeRequired
capabilitystringyes
grantedbooleanyes
request_idstringyes

secret_value

Secret broker response. value is None when denied.

FieldTypeRequired
keystringyes
valuestring?no

file_read_result

Native WASM plugin runtime file read result.

FieldTypeRequired
contentarray?no
errorstring?no

file_list_result

Native WASM plugin runtime directory listing result.

FieldTypeRequired
entriesarray?no
errorstring?no

run_update

Run lifecycle update from the host.

FieldTypeRequired
payloadanyyes
run_idstringyes
statusstringyes

pipe_message

A message on directed pipe connection generation (JSON mode only; binary mode travels on the side channel).

FieldTypeRequired
generationintegeryes
payloadanyyes
pipe_idstringyes

path_changed

Pane group CWD broadcast. Declared, never constructed — no host path emits this today; sync_plugin_cwd reassign…

FieldTypeRequired
cwdstringyes

suspend

App is being backgrounded (host window losing focus, plugin no longer visible).

No additional fields.

resume

App is being foregrounded again.

No additional fields.

shutdown

App is being closed. Process must exit within a short timeout.

No additional fields.

theme

Host theme changed through Plexi configuration. App should update its color state; the next render will pick up the n…

FieldTypeRequired
colorsobjectyes

view_opened

Confirmation that a SpawnView request succeeded.

FieldTypeRequired
pane_idintegeryes
type_idstringyes

pane_spawned

Confirmation that a SpawnPane request succeeded (#592).

FieldTypeRequired
pane_idintegeryes
request_idstring?no

pane_spawn_error

SpawnPane could not be fulfilled (#592). reason is a human-readable error.

FieldTypeRequired
reasonstringyes
request_idstring?no

context_state_response

Response to HostRequest::QueryContextState (#1518).

FieldTypeRequired
stateContextStateyes

pipe_opened

Binary pipe opened — plugin connects to socket_path as a unix socket client.

FieldTypeRequired
pipe_idstringyes
socket_pathstringyes

directed_pipe_opened

This app’s PipeOpenDirected request_id was accepted: sends name connection generation.

FieldTypeRequired
generationintegeryes
pipe_idstringyes
request_idstringyes

directed_pipe_open_refused

This app’s PipeOpenDirected request_id was refused; nothing opened.

FieldTypeRequired
pipe_idstringyes
reasonPipeOpenRefusalyes
request_idstringyes

directed_pipe_incoming

Another view opened directed pipe pipe_id to this app as connection generation. Sent before the connection’s firs…

FieldTypeRequired
generationintegeryes
peer_pane_idintegeryes
pipe_idstringyes

pipe_closed

Directed pipe connection generation ended. Sends naming it are dropped; a reopen is a new connection with a new gen…

FieldTypeRequired
generationintegeryes
pipe_idstringyes
reasonPipeCloseReasonyes

pipe_overrun

Binary pipe backpressure — host dropped dropped_frames frames from the ring.

FieldTypeRequired
dropped_framesintegeryes
pipe_idstringyes

inject_state

Drop a JSON payload into the plugin’s on_inject hook. Sent at startup with persisted plugin state (workspace if ava…

FieldTypeRequired
payloadanyyes

state_changed

A state scope’s backing file changed outside the plugin’s own persist flow — an external edit, or a persist the plugi…

FieldTypeRequired
errorstring?no
payloadanyyes
scopestringyes
sourcestringyes

render_seed

DEPRECATED: superseded by the state field on Init. Kept for backwards compatibility with older SDK versions. The he…

FieldTypeRequired
payloadanyyes

http_response

Host broker response to a DrawCommand::HttpRequest. error is present when the request failed; body may still ca…

FieldTypeRequired
bodystringyes
errorstring?no
request_idstringyes
statusintegeryes

notify_action

Sent when the user responds to a notification that included a notify_id.

FieldTypeRequired
action_labelstringyes
notify_idstringyes
valuestring?no

timer

Fired when a SetTimer timer expires.

FieldTypeRequired
timer_idstringyes

image_loaded

Fired when a load_image request completes (success or failure). status is “ok” or “error”. message carries the …

FieldTypeRequired
handlestringyes
messagestring?no
statusstringyes

text_measured

Response to a DrawCommand::MeasureText request. width and height are in logical pixels at the requested font size.

FieldTypeRequired
heightnumberyes
request_idstringyes
widthnumberyes

text_wrapped_measured

Response to a ControlCommand::MeasureTextWrapped request. height is the pixel height of the text when wrapped at …

FieldTypeRequired
heightnumberyes
request_idstringyes

paste

Clipboard paste forwarded into the focused view pane.

FieldTypeRequired
textstringyes

ai_response

Response to a DrawCommand::AiQuery. Either content is Some (success) or error is Some (failure) — the two a…

FieldTypeRequired
contentstring?no
errorstring?no
request_idstringyes
tokens_inintegeryes
tokens_outintegeryes

ai_stream_chunk

Incremental token chunk from a streaming ai_query response. Sent live while the turn runs, before the final `AiRespon…

FieldTypeRequired
deltastringyes
donebooleanno
reasoningstring?no
request_idstringyes

tool_call

Host-to-plugin tool invocation (#399). The broker calls a tool exposed via DrawCommand::ExposeTools by sending this…

FieldTypeRequired
authorizationstring?no
call_idstringyes
caller_idstringyes
input_jsonstringyes
namestringyes

audio_devices_listed

Response to a DrawCommand::ListAudioDevices request (#277). Both vectors are always present — empty when enumeratio…

FieldTypeRequired
errorstring?no
inputsAudioDeviceWire[]yes
outputsAudioDeviceWire[]yes
request_idstringyes

audio_capture_started

Sent when a DrawCommand::AudioCapture successfully opened the device and started delivering PCM frames on pipe_id…

FieldTypeRequired
buffer_sizeintegeryes
channelsintegeryes
device_namestringyes
pipe_idstringyes
sample_rateintegeryes

audio_capture_error

Sent when a DrawCommand::AudioCapture could not be honoured — permission denied, bad device id, no devices, cpal fa…

FieldTypeRequired
errorstringyes
pipe_idstringyes

midi_devices_listed

Response to a DrawCommand::ListMidiDevices request (#320). Both vectors are always present — empty when CoreMIDI fi…

FieldTypeRequired
errorstring?no
inputsMidiPortWire[]yes
outputsMidiPortWire[]yes
request_idstringyes

midi_input_opened

Sent when a DrawCommand::OpenMidiInput successfully opened the port and started forwarding incoming MIDI byte strea…

FieldTypeRequired
pipe_idstringyes
port_idstringyes
port_namestringyes

midi_input_error

Sent when DrawCommand::OpenMidiInput could not be honoured — permission denied, port not found, CoreMIDI failure.

FieldTypeRequired
errorstringyes
pipe_idstringyes

midi_send_error

Sent when DrawCommand::SendMidi could not be honoured. Successful sends produce no event (fire-and-forget); only fa…

FieldTypeRequired
errorstringyes
port_idstringyes

video_open_ack

Sent when a DrawCommand::OpenVideo succeeded (#345). The host has allocated the binary pipe (look for the preceding…

FieldTypeRequired
duration_msintegeryes
fpsnumberyes
handle_idintegeryes
heightintegeryes
request_idstringyes
widthintegeryes

video_open_error

Sent when DrawCommand::OpenVideo could not be honoured (#345) — capability denied, source not found, decoder error,…

FieldTypeRequired
errorstringyes
request_idstringyes

linked_terminal_ready

Response to DrawCommand::RequestLinkedTerminal (#78). Carries the pane id of the freshly-opened terminal so subsequ…

FieldTypeRequired
request_idstringyes
terminal_pane_idintegeryes

command_preview

Response to DrawCommand::RequestCommandPreview (#78). Returns the command verbatim plus the linked terminal’s curre…

FieldTypeRequired
commandstringyes
request_idstringyes
would_run_in_cwdstringyes

Emitted by host to plugin when Escape is pressed and the plugin’s nav stack depth is > 0. The plugin handles this by …

FieldTypeRequired
view_idstringyes

file_picked

Response to DrawCommand::OpenFilePicker. At least one file was selected. paths contains the absolute, canonicaliz…

FieldTypeRequired
pathsstring[]yes
request_idstringyes

file_pick_cancelled

Response to DrawCommand::OpenFilePicker when the user cancelled the dialog without selecting a file, or the plugin …

FieldTypeRequired
request_idstringyes

stream_chunk

Chunk of stdout/stderr bytes from an active DrawCommand::StreamProcess child. bytes is a raw byte array (values 0…

FieldTypeRequired
bytesinteger[]yes
channelStreamChannelyes
correlation_idstringyes

stream_end

Terminal event for a DrawCommand::StreamProcess child. Sent when the child exits, on CancelProcess, or on capabil…

FieldTypeRequired
correlation_idstringyes
exit_codeintegeryes

scroll_offset

Emitted by the host when the scroll offset for a BeginScroll region changes (mouse wheel, drag). The plugin should …

FieldTypeRequired
idstringyes
offset_ynumberyes

scroll

Emitted when the mouse wheel moves over a view pane that has no host-managed scroll region or list_view under the cur…

FieldTypeRequired
delta_ynumberyes

list_select

Emitted when j/k/up/down changes the list selection. id matches the list_view id field; index is the new select…

FieldTypeRequired
idstringyes
indexintegeryes

list_activate

Emitted when Enter is pressed on the selected item. id matches the list_view id field; index is the activated i…

FieldTypeRequired
idstringyes
indexintegeryes

component_event

Fired when a user interacts with a node that has Interactive wrapping or when a Button/Input node is activated.

FieldTypeRequired
event_typestringyes
node_idstringyes
payloadanyno

rollback_verify

Host asks the plugin whether resource_id is still at expected_revision before rolling back a checkpoint. The plug…

FieldTypeRequired
checkpoint_idstringyes
expected_revisionstringyes
resource_idstringyes

rollback_apply

Host instructs the plugin to roll resource_id back using the rollback_token the plugin supplied when it emitted t…

FieldTypeRequired
checkpoint_idstringyes
resource_idstringyes
rollback_tokenstringyes

plugin_events_subscribed

Response to HostRequest::SubscribePluginEvents. Exactly one of subscription_id / error is set.

FieldTypeRequired
errorstring?no
request_idstringyes
subscription_idstring?no

declare_event_streams_result

Response to HostRequest::DeclareEventStreams.

FieldTypeRequired
errorstring?no
streamsarray?no

emit_event_result

Response to HostRequest::EmitEvent.

FieldTypeRequired
errorstring?no
sequenceinteger?no

plugin_events_unsubscribed

Response to HostRequest::UnsubscribePluginEvents.

FieldTypeRequired
errorstring?no
removedbooleanyes
request_idstringyes

plugin_event

One subscribed plugin event, delivered to the subscriber pane. Content beyond the event identity is shaped by the sub…

FieldTypeRequired
created_atstringyes
eventstringyes
event_idintegeryes
payloadanyno
plugin_idstringyes
resource_idstringyes
state_refstring?no
subscription_idstringyes
summarystring?no
trigger_modeTriggerModeyes

undo_checkpoints

Response to HostRequest::ListUndoCheckpoints: undo checkpoints, newest first, serialized with the spec’s checkpoint…

FieldTypeRequired
checkpointsany[]yes
request_idstringyes