Install
Install with PiG
pig install npm:@mzwing/pi-session-hubInstall with Pi
pi install npm:@mzwing/pi-session-hubPackages 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.
{
"extensions": [
"./dist/index.js"
]
}README
Written by the package's publisher, shown as published in version 0.4.2 (README.md). PiG does not review it.
@mzwing/pi-session-hub
A Pi extension that lets the Pi sessions on one machine find, read and message each other, and start independent headless sessions.
Install
pi install npm:@mzwing/pi-session-hub
Requires Pi 1.5.0 or later.
Usage
The model gets four tools:
| Tool | What it does |
|---|---|
session_list | Lists the running sessions on this machine and the recent sessions of this project |
session_read | Shows another session's conversation as its model sees it |
session_send | Messages a running session, starting a turn there unless wake is false |
session_spawn | Starts a headless pi --print session that outlives this one, or continues a stopped one with resume |
/sessions shows the same list as session_list, and /sessions <id> a session's transcript.
Messages wait in a queue under ~/.pi/agent/pi-session-hub/, so one that reaches a headless session after its run has ended is read when that session next starts. A spawned session writes its output to ~/.pi/agent/pi-session-hub/logs/<id>.log.
A spawned session runs headless, so @gotgenes/pi-permission-system denies whatever would ask. Give it rules without asks, or add @mzwing/pi-permission-auto-review to the authorizer chain.
Programmatic use
Other extensions message and start sessions through @mzwing/pi-session-hub/api, whose exports are listed in src/api.ts.
Credits
Spawned sessions re-invoke Pi the way getPiInvocation does in Pi's subagent example.