@mzwing/pi-session-hub
v0.2.2
Published
Lists, reads, messages and starts independent Pi sessions
Downloads
566
Maintainers
Readme
@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-hubRequires Pi 1.2.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.
