← Catalog

@mzwing/pi-session-hub

Lists, reads, messages and starts independent Pi sessions

Extension

Install

Install with PiG

pig install npm:@mzwing/pi-session-hub

Install with Pi

pi install npm:@mzwing/pi-session-hub
Review before installing

Packages 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

npm

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:

ToolWhat it does
session_listLists the running sessions on this machine and the recent sessions of this project
session_readShows another session's conversation as its model sees it
session_sendMessages a running session, starting a turn there unless wake is false
session_spawnStarts 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.

License

MIT