Install
Install with PiG
pig install npm:@phux/piInstall with Pi
pi install npm:@phux/piPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"skills": [
"./skills"
],
"extensions": [
"./extensions/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.11.1 (README.md). PiG does not review it.
@phux/pi
A pi extension that gives the agent tools over phux terminals, and tells phux what the agent is doing.
pi install npm:@phux/pi
For a trusted source checkout, build the shared runtime and install the local
dependencies first (see Development). Then
pi install ./integrations/pi loads that checkout outside the repo;
.pi/settings.json loads it inside the repo.
phux must be on PATH with a running local server. The extension reads
PHUX_SOCKET to find a non-default socket and PHUX_TERMINAL_ID, which
phux sets inside each pane, to know its own pane.
What it adds
Tools: list, create, spawn, launch, snapshot, send keys, paste, run, wait,
agent prompt and wait, resource wait, insert/move/swap pane, kill, signal,
tag, ask, collect events, rendered snapshot, status, runtime info, and
branch-local aliases. phux_list shows every resource kind, not only
terminals, and the document reads match phux mcp: phux_documents,
phux_tree_snapshot, phux_tree_wait, and phux_surface_snapshot, whose
frame arrives as an image. Snapshot, wait, send keys and paste act on a
terminal only: pointed at a tree, surface, or document they fail with
wrong_resource_kind, naming the tool that reads it. Commands for the person at the keyboard: /phux to
pick a target pane, /phux-status to check it, /phux-attach to print the
phux attach invocation to run in a real terminal.
At each user turn it appends a short fleet context (which panes exist and
what their agents are doing) unless PHUX_CONTEXT_AWARENESS=0. It reports
pi's own lifecycle to phux as an agent session stream, so the pane shows up
as working, blocked, or done in the sidebar and to phux agent wait.
PHUX_AGENT_TRANSCRIPT=0 turns the transcript records off; =full adds
tool output.
Inside a phux pane it waits for the pane's mail (phux mail wait) and puts
each message in the conversation with pi.sendMessage as a phux.mail
follow-up that starts a turn when pi is idle. Nothing is typed into the pane.
With this integration installed, phux chat run NAME -- pi also receives
mail outside a pane. The CLI validates PHUX_CHAT_RECORD and selects its
inbox without changing the generic address or claim holder.
Safety
Input and destructive actions resolve the target first and refuse pi's own
pane and any selector broader than one exact pane. Kill and destructive
signals require confirm: true and check every member of a group before
destroying any. Nothing here emulates a verb the installed phux lacks; an
old binary fails the call rather than approximating it.
Input leases (phux take) are not exposed: a one-shot CLI call's lease ends
when the call does, so there is no durable form a tool could offer.
Development
From the repository root:
npm --prefix integrations/runtime ci
npm --prefix integrations/runtime run build
cd integrations/pi
npm ci
npm run gates # typecheck, tests, pack and load checks
PHUX_PI_REAL_SMOKE=1 npm run smoke:real # against a real phux, opt in
Releases publish to npm as @phux/pi with provenance, tagged
pi-extension-vX.Y.Z. CI and the release pack with npm 12.2.1, where
npm pack --json prints an object keyed by package name instead of npm 11's
array; the pack and load checks read either through scripts/pack-report.mjs.