Pi Daemon
Pi Daemon multiplexes many independent, on-demand Pi SDK sessions in
one long-lived Node process. It shares authentication and model metadata
while each logical session keeps its own session manager, settings,
event sequence, queue, and durable idempotency state.
The authenticated Session API is the full configured-session surface.
Its typed SessionSpec selects an absolute cwd;
default, none, no-builtin, and
allowlist tool modes (plus exclusions); Pi built-ins
including cwd-bound bash; and explicit trusted extensions,
skills, prompt templates, themes, settings, and approved project
resources. A durable logical session keeps one in-process
AgentSessionRuntime and conversation across turns and
attachments. Each logical session admits one active model turn at a
time, while the global maxConcurrentTurns bound permits
multiple independent sessions to run in parallel.
That capability is intentionally honest rather than shell-shaped:
each built-in bash use is a child invocation from the
session cwd, not a persistent shell or PTY, and Pi Daemon does not
promise parallel command execution inside one logical session. Trusted
extension JavaScript and isolation: "unisolated" share the
daemon process trust domain; mutually untrusted workloads still need
separate daemon processes, containers, or VMs.
Legacy owner-only Unix NDJSON v1 remains intentionally no-tools for
compatibility: it does not load extensions, skills, prompt templates,
themes, context files, or built-in filesystem/process tools. The
additive protocol-v2 host-adapter profile is a narrower alternative that
binds one host/session/generation to six fixed filesystem operations
over an owner-private Unix adapter, with no shell or arbitrary extension
authority. Durable CRUD, authenticated JSON control, Pi RPC attachment,
the remote stdio bridge, and ACP translation remain neutral service
surfaces—not Cacophony components.
Documentation
- Operator quickstart — run
collision-free Home Manager instances, create/delete sessions, wait on
tickets, and attach RPC or ACP clients
- Protocol — NDJSON operations, event flow,
generations, and retry semantics
- Host tool-adapter protocol —
protocol-v2 descriptor, fixed filesystem operations,
bind/invoke/abort/revoke frames, and capability secrecy
- Session API — additive CRUD, multi-reader
Pi RPC attach, and
/apc ACP contract
- Neutral blob and file transfer —
SHA-256-addressed streaming uploads, exact generation authority,
quarantine, daemon-owned inbox references, and cleanup
- Dash browser/backend protocol —
preview-first resources, normalized transcripts, multiplexed Rich/TUI
channels, replay, limits, and performance budgets
- Dashboard transport
security — native HTTPS/WSS, loopback reverse-proxy authority,
SNI/HSTS, rotation, secret paths, and health
- Dashboard identity and
authorization — multi-user threat model, provider/principal
contract, central roles/policy/audit, migration, and enforcement
map
- Dash transcript projection —
bounded no-hydration JSONL branch rendering, cache, paging, and
fingerprints
- Dash session-tree navigation —
virtual branch graph, active-leaf truth,
compare/edit/fork/clone/navigate/summarize semantics, and framed
compatibility
- Dash session inventory —
owner-safe persisted 10k-session index, keyed search, opaque paging, and
measured bootstrap
- Dash shadow TUI — bounded in-process
virtual terminal, control stripping, performance proof, and the minimal
Pi view seam
- Declarative extension
views — versioned code-free Rich views, server validation, action
correlation, TUI fallback, and upstream Pi seam
- Dash session ownership — explicit
direct/fork leases, conflict guards, atomic export/append-back, and
indeterminate recovery
- Dash lazy session drafts —
no-runtime create/cancel persistence and exact-once first-send crash
checkpoints
- Neutral Dash service API —
service-bearer inventory, preview, activation/export/lease routes and
TUI negotiation for remote backends
- Dash v1 acceptance — live
embedded/dedicated receipts, browser/security/performance gates, and
wall-clock soak status
- Dash browser acceptance — the Nix shell that
supplies audited Playwright browsers, the bounded
@smoke
subset CI runs, version-drift preflight, and opt-in wall-clock
budgets
- Pi Droid Android client plan —
independent multi-host client, reusable SDK views, canonical freshness,
tabs/splits, pairing, Android OS integration, file-sharing gaps,
signing, Play internal distribution, and staged delivery
- Session configuration — Pi CLI
mapping, environment handling, resources, tools, and honest isolation
limits
- Schedule contract — versioned
cron/timezone/prompt resources, durable bounded timers, recovery, clock
and DST semantics
- Scheduler acceptance — measured
all-IANA DST, restart, overlap, secrecy, and accelerated-soak release
gate
- Operations — install, serve, probe, status,
drain, and recovery
- Session management CLI — JSON CRUD,
tickets, prompts/controls, and endpoint discovery
- Security — shared-process trust boundary and
root policy
- Integration — client and Nix consumer
examples
- Acceptance — credential-free matrix and
live zero-child-process proof
- Pi SDK compatibility — exact
acquisition, public API gates, upgrades, and rollback
- Pi RPC runtime host — full in-process
command/event/UI semantics and policy gates
- Remote RPC stdio bridge — authentication,
stock JSONL translation, reconnect, gap, and terminal semantics
- ACP adapter — bounded in-process Agent
Client Protocol at the
/apc route
- Release — tag, artifact, and rollback
checklist
- NDJSON v1 JSON Schema, v2 JSON Schema, and tool-adapter JSON Schema
- Session API JSON Schema and OpenAPI
- Schedule JSON Schema
- Dash API JSON Schema, declarative extension-view schema,
and OpenAPI
- Source
repository
Status
The 2026-07-14 completion audit and every dependent implementation
slice are landed. Full credential-free npm and Nix acceptance passes
across installed artifacts, configured CRUD, Pi RPC, ACP, stdio bridge,
restart/replay, security, and bounded shutdown. The repository is a
release candidate; cutting a tag remains an explicit operator action
under the release checklist.