omp packages

pi-actio0.2.0

pi extension: makes a pi coding agent a member of an Actio team (actio tool, /actio Explorer, prompt service)

ldiaz Published 2 days ago BSD-3-Clause ~598 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Actio

pi-actio

A pi extension that makes a pi coding agent a member of an Actio team: it sees the team, calls other agents' capabilities, and can let the team send prompts into the session.

What it adds

one tool actio, with three commands: list-team, info, call
one command /actio, the Actio Explorer overlay
optional the prompt service: the capabilities prompt, cancel, retrieve, compact
optional the team may command this agent: enable, ping, restart, stop (acceptCommands)
automatic the agent reports its work: busy while pi runs or compacts, and the prompt counts
optional activity notifications (reportActivity)
configuration one JSON file, actio.json, read on load and on /reload

Out of scope, on purpose: sending commands to other agents, attachments, a per-call timeout parameter, history that survives /reload, settings UIs.

Install

pi install npm:pi-actio@0.2.0

From a source checkout, install the folder instead — pi install <absolute path>/pi-actio — and install the checkout's dependencies first (internals.md §11).

  • Node ≥ 22.
  • Remove it with pi uninstall <source>. For a folder, pi matches an installed extension by its resolved path, so use the same path you installed from.
  • Personal installs are recorded in ~/.pi/agent/settings.json. An install is loaded at the next pi start or /reload.

Configuration (actio.json)

Location: the pi agent directory — $PI_CODING_AGENT_DIR/actio.json, by default ~/.pi/agent/actio.json.

Every key is optional, and those eleven keys are the whole language: a file that is not valid JSON, has an unknown key, has a wrong type, or has a bad agent id (agentId, an acceptPrompt item, or an acceptCommands item) registers nothing and shows one notification naming the file and the first error. Fix it and /reload.

A complete file, every key spelled out:

{
  "agentId": "planner-4f2a",
  "namespaces": ["planning"],
  "actioDir": "~/.actio",
  "exposePrompt": true,
  "acceptPrompt": ["oracle-9c1e", "scribe-7b3d"],
  "acceptCommands": ["oracle-9c1e"],
  "disabled": false,
  "json": false,
  "reportActivity": true,
  "cleanContext": false,
  "compactThinking": "low"
}

What people usually write, leaving the id to the extension and the root to the environment:

{
  "exposePrompt": true,
  "acceptPrompt": ["oracle-9c1e", "scribe-7b3d"],
  "acceptCommands": ["oracle-9c1e"],
  "reportActivity": true
}

and the shortest file there is, which means the same as no file at all:

{}
Key Type Default Meaning
agentId ^[a-zA-Z0-9_-]{1,32}$ see below the id this agent joins the team with
namespaces string[] unset (actio-ts's default) the namespaces this agent belongs to; "*" means all of them
actioDir string unset → $ACTIO_DIR or ~/.actio the actio root folder; a leading ~ is expanded
exposePrompt boolean false offer the prompt service (§The prompt service)
acceptPrompt string[] of agent ids [] who may call the prompt service; [] means every agent on the team — unlike acceptCommands
acceptCommands string[] of agent ids [] who may send this agent the protocol commands enable, ping, restart, stop; [] means nobody, and a listed agent gets all four (§Commands the team may send)
disabled boolean false true: the extension is fully off — no agent, no tool, no command
json boolean false true: tool results are JSON instead of Markdown
reportActivity boolean false notify the pi user about received requests and finished calls
cleanContext boolean false what a prompt without clean_context means: true starts the run with no earlier conversation (§The prompt service)
compactThinking off minimal low medium high xhigh max unset the thinking level of every compaction summary of the session; unset leaves compaction exactly pi's

The default agentId is the current folder's name, with characters outside [a-zA-Z0-9_-] replaced by _, cut to 27 characters, plus - and four random hex characters. It stays the same across /reload, /new and /fork in one process, and two pi sessions in the same folder get different ids.

A configuration change takes effect on /reload.

Commands the team may send

acceptCommands decides who may send this agent the four protocol commands. They are built into actio-ts, and the extension cannot narrow them: an id listed there gets all four.

  • enable sets or clears the disabled flag of this agent's spec.json. A disabled agent offers its capabilities to nobody — a peer's call to it is refused — and still takes commands, so the team can enable it again.
  • ping re-announces the agent: a fresh datetime in its spec.json and status.json, and a new announce in the team's nuntium folder. Nothing else changes.
  • restart stops the agent and starts it again in the same pi process, after a delay in seconds (clamped to 60). The capabilities survive it; a disabled flag set by enable does not. A pi session that shuts down during that delay cancels the restart, and the agent stays down.
  • stop takes the agent off the team: its status.json becomes inactive, and after that it writes nothing more. The actio tool answers the actio agent is not running from then on. Only a new pi session, or /reload, starts it again.

The pi user is notified of each of them, whatever reportActivity says: actio: disabled by the team, actio: enabled by the team, actio: stopped by the team, actio: restarted by the team. A restart arrives as stopped and then restarted — actio-ts performs it as a stop followed by a start, and nothing tells the two apart until the agent is back.

The actio tool

The model uses it; parameters in italics are optional.

Command Does
actio {command: "list-team"} a fresh scan of the team, one bullet per agent: id, description, capability names. No visible agents. when the team is empty
actio {command: "info", id: "<agent>", capability: *"name"*} that agent's status, health and namespaces, and its capabilities with their parameters and result schemas. Without capability, all of them. An unknown name is an error that lists the real ones. It also shows what that agent reported about its own work (§The prompt service)
actio {command: "call", target: "<id>/<capability>", params: *{…}*} calls a peer and waits for the answer. Press Escape to cancel it

Before a call is sent, the target is checked against the team and the parameters against the published schema, and the error says what to do next (use info <id>). A peer's error answer is a normal result — it is the peer's answer — and is shown as → error <code>: <msg>. Only a local failure (unknown agent, unknown capability, bad parameters, no answer) is an error from the tool.

With json: true every result is JSON instead of Markdown.

The prompt service

Set exposePrompt: true. The agent then publishes four capabilities. A peer calls prompt, gets a prompt_id immediately, and polls it with retrieve.

Capability Parameters Answers
prompt { msg_prompt, asap?, clean_context? } { prompt_id } — 8 lower-case hex characters
retrieve { prompt_id } { status: "queued" | "running" | "done", response } — response is the run's final text
cancel { prompt_id } null
compact {} null, always

Behavior worth knowing:

  • When the session is busy, a new prompt is queued and sent when the run settles. asap: true instead steers the running one, and a steered prompt shares that run's answer.
  • Clean and keep. clean_context: true starts the run with no earlier conversation: the model sees the system prompt and that prompt, and the session is cut at that point — everything before it is replaced by the one-line summary The earlier conversation was cleared for a new prompt. clean_context: false continues the context as it is: everything since the last cut. An absent clean_context means cleanContext from actio.json (default false), and the prompt schema publishes that default, so a peer learns it from info. The cut is a real session boundary, not a filter: the context stays small enough that pi's own threshold compaction never fires for messages the model was never sent, and a later compaction summarizes only what came after the last cut — never an unrelated task.
  • asap: true with clean_context: true is refused with ActioError 1001: a steered prompt joins a run that is already going, so it cannot start clean. Nothing is queued and no id is drawn. asap: true with clean_context absent is accepted and continues the context — the default applies only to a prompt that can honour it.
  • What the team sees while pi works. The agent reports itself busy from the start of a run to its settle — whoever started it, the local user included — and while a compaction runs. With the prompt service on, its capability_status says how many prompts are running and how many are queued, and msg names the oldest running one as prompt <id> from <peer> — the sender, never the content. A peer reads all of it from the info call it already makes: JSON gains capability_status, contention and msg; Markdown gains one Work: line, e.g. Work: prompt 1 running, 2 queued · msg: prompt 4f2a9c31 from oracle-9c1e. A run the local user typed reports busy and nothing else about it. A flip of busy is published at once; the counts are published at most once a second, so a peer's numbers can lag by up to that.
  • The compaction level. With compactThinking set, every summary pi writes for this session — /compact, the threshold, overflow recovery, and the compact capability — is produced at that level instead of the session's, and the session's own level is untouched. It changes nothing for a model registered with reasoning: false: pi sends a thinking level only to a reasoning model, and the switch for the others is model configuration (samplingParams, thinkingLevelMap), not a key of this extension.
  • Two prompts sent back to back while the session is idle: the second is queued.
  • retrieve of a done prompt returns the answer and forgets the id; a second retrieve of the same id is ActioError 1000. cancel forgets it in any state. An unknown id is the same error 1000.
  • Cancelling a running prompt aborts the whole run, so another prompt riding the same run ends with the partial answer.
  • A prompt may be answered by a run the local user started, and prompt cannot select a model or a mode.
  • The pi agent takes no protocol commands unless acceptCommands lists the sender: with the default [] the prompt service is the only thing it offers (§Commands the team may send).
  • acceptPrompt lists the agent ids allowed to call these capabilities. The default [] means every agent on the team — and the pi agent publishes no capability at all unless exposePrompt is on.

With reportActivity: true the pi user sees, as notifications: actio: <src> → <capability> [<prompt_id>] for each received request, and actio: <target> → confirmed | error <code> | cancelled | … when a call the agent made finishes. Polling retrieve while a prompt is queued or running makes no noise.

/actio — the Actio Explorer

Opens an overlay with three tabs. It needs the interactive terminal; in another mode it reports that. The window never collapses below twelve rows, and it follows pi's theme colours.

╭──────────────────────────────────────────────────────────────────────────────────────────╮
│ Actio Explorer — <agentId> · <actio root> · prompt service: on|off                      │
│ [Team]  Calls  Prompts                                                                 │
├──────────────────────────────────────────────────────────────────────────────────────────┤
│ Team:    the agents (id, status/health, description); the selected agent's capabilities below
│ Calls:   this agent's outgoing calls, newest first: <id>/<capability>  in-flight | confirmed <ms> ms | error <code> | cancelled | abandoned | failed: <msg>
│ Prompts: received prompt-service requests, newest first: <time> <src> <capability> [<prompt_id>] <outcome>
│ tab switch · ↑↓ select · r refresh · esc close                                         │
╰──────────────────────────────────────────────────────────────────────────────────────────╯

The list updates by itself when a call or a request arrives or finishes; r re-scans the team. The history is in memory, per session: /reload, /new or /fork starts it empty again, which is what "live sessions" means.

Limits

  • One tool, three commands, one command, four capabilities: nothing else, on purpose.
  • No per-call timeout parameter; a call waits for the peer and Escape cancels it.
  • History is not persisted, and there is no way to ask about a session that is not running.
  • The prompt service answers with the run's final text: no streaming, no mid-run output, no model choice.
  • The Explorer cannot show the resolved actio root when actioDir is unset; set actioDir to see the path in the header.
  • A compaction started by the pi user (/compact) is outside the prompt service's queue: a prompt queued during it waits for the next run, and an asap prompt sent during it never reaches the model and is later reported done with the next run's answer. The team does at least see the agent busy while it runs. Every compaction requested through the prompt service is waited for and then run.
  • compactThinking does nothing for a model registered with reasoning: false, and pi keeps the last session_before_compact result it is given: with another compaction extension loaded, the extension order decides which one wins.
  • A clean prompt's cut is a session boundary, not a filter: nothing a peer can undo, and a cut that had not reached its turn_end when the session reloaded is lost with the rest of the prompt service's state.
  • It sends no protocol commands of its own, and there are no attachments and no retries.
  • acceptPrompt and acceptCommands check the src a peer writes in its own envelope: the protocol has no authentication yet, and write access to the shared actio root is peer authority. acceptPrompt is a guard, not a wall — and acceptCommands is stronger still, since a listed agent can stop or disable this session. List in it only agents you trust with that.

Where the details are

  • internals.md — how it works, the decisions behind each behaviour, tests, packaging.
  • The Actio protocol — the wire format, which this extension implements through actio-ts. The protocol is public but still a draft: its security layer is unspecified, and write access to the shared actio folder is peer authority. Do not point two teams' folders at each other.