@jademind/pi-bridge
Minimal secure inbox bridge for Pi: reliable queued/steering message delivery to running sessions.
Package details
Install @jademind/pi-bridge from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@jademind/pi-bridge- Package
@jademind/pi-bridge- Version
0.1.6- Published
- Feb 25, 2026
- Downloads
- 54/mo · 26/wk
- Author
- jomis
- License
- MIT
- Types
- extension
- Size
- 21.5 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/pi-bridge.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@jademind/pi-bridge
Package scope: use
@jademind/pi-bridge(scoped). Older unscoped naming should be considered deprecated.
Minimal secure inbox bridge for Pi sessions.
@jademind/pi-bridge is designed for status bar and mobile clients that must send messages reliably to running Pi agents, including plain terminal sessions where tty injection is unreliable.
It is primarily consumed by the free open-source macOS app pi-statusbar, and complements @jademind/pi-telemetry for runtime observability.
Related projects
pi-statusbar: macOS menu bar app for Pi (daemon + UI)@jademind/pi-telemetry: per-process telemetry heartbeat + snapshot CLI
What it does
- Watches a per-PID inbox directory
- Validates signed/structured message envelopes
- Delivers to Pi using user-message semantics
- queued mode ->
followUpwhen busy - interrupt mode ->
steerwhen busy
- queued mode ->
- Writes delivery acknowledgements per message
- Publishes lightweight per-session registry heartbeat
- Enforces size limits, TTL, path safety, idempotency, and rate limits
Install
pi install npm:@jademind/pi-bridge
Restart active Pi sessions after install so the extension loads.
If you use pi-statusbar, install/start everything with:
brew install jademind/tap/pi-statusbar
statusbar-setup enable
Filesystem layout
Default base directory:
~/.pi/agent/statusbridge/
registry/<pid>.json
inbox/<pid>/<message-id>.json
processing/<pid>/*.processing
acks/<pid>/<message-id>.json
Override base with:
PI_BRIDGE_DIR
Envelope (send-v1)
{
"v": 1,
"id": "4a4c5295-d3e4-4f91-b562-8f0f4cc6f413",
"pid": 12345,
"text": "Please summarize current progress and blockers.",
"source": "statusbar",
"createdAt": "2026-02-24T15:50:00Z",
"expiresAt": "2026-02-24T15:51:00Z",
"delivery": {
"mode": "queued"
},
"meta": {
"requestId": "ios-123"
}
}
delivery.mode values:
queued(default): queue politely if busyinterrupt: steering interrupt if busy
Ack (ack-v1)
{
"v": 1,
"id": "4a4c5295-d3e4-4f91-b562-8f0f4cc6f413",
"pid": 12345,
"status": "delivered",
"at": 1771948234000,
"resolvedMode": "queued"
}
Possible statuses:
deliveredfailedduplicate
Security defaults
- file size cap: 32 KB
- message length cap: 4000 chars
- strict PID matching
- TTL expiry enforcement
- symlink and path traversal rejection
- bounded queue depth
- separate normal/interrupt rate limiters
Runtime config
PI_BRIDGE_MAX_TEXT(default4000, minimum256)PI_BRIDGE_MAX_SKEW_MS(default120000)PI_BRIDGE_HEARTBEAT_MS(default2000)PI_BRIDGE_SCAN_MS(default750)PI_BRIDGE_QUEUE_DEPTH(default64, minimum8)PI_BRIDGE_RATE_PER_MIN(default20, minimum20)PI_BRIDGE_RATE_BURST(default6, minimum4)PI_BRIDGE_INTERRUPT_RATE_PER_MIN(default20, minimum20)PI_BRIDGE_INTERRUPT_RATE_BURST(default4, minimum4)
Command
/pi-bridge-status
Development
npm test
npm pack --dry-run
Suggested release checklist:
- Update version in
package.json - Run tests (
npm test) - Validate package tarball (
npm pack --dry-run) - Tag and push release commit
- Publish to npm (
npm publish --access public)
OSS best practices
- Keep package references scoped in docs/examples (
@jademind/pi-bridge,@jademind/pi-telemetry). - Keep bridge inbox/ack directories user-local (
~/.pi/agent/statusbridge) and avoid world-writable permissions. - Treat all inbox payloads as untrusted: validate PID, TTL, size, and path constraints before delivery.
- Keep rate limits enabled (normal + interrupt) to protect active sessions from spam and accidental loops.
- When changing envelope/ack schema, bump docs with explicit compatibility notes.
- Keep release notes aligned across npm package, Git tag, and dependent clients (status bar / mobile).
License
MIT