@av-pi-studio/server 0.0.31 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -318,6 +318,10 @@ surface the rest of the daemon depends on is `src/agent/provider-contract.ts`:
318
318
  - Discovers models/modes via top-level `get_modes`/`get_models` RPCs (no scratch session).
319
319
  - **Prompt images:** `startTurn` converts the wire shape `{ mimeType, data }` into Pi's
320
320
  `ImageContent` shape `{ type: "image", data, mimeType }` before the `prompt` RPC.
321
+ - **Resuming a session** (`resumeSession`, used by the lazy resume-on-send path and by
322
+ `importSession`) spawns a fresh `pi --mode rpc` process, then issues `switch_session` to load
323
+ the persisted JSONL file into it — RPC mode has no CLI flag to preload a session at spawn, only
324
+ this RPC command.
321
325
  - A literal `~` in `cwd` is expanded to the home directory before spawning.
322
326
  - A missing/unresolvable `pi` surfaces as a clean `rpc_error` ("Pi provider unavailable…") rather
323
327
  than crashing the daemon.
@@ -392,9 +396,13 @@ src/
392
396
  ### Lifecycle FSM
393
397
 
394
398
  `AgentManager` enforces `initializing → idle ↔ running → error → closed`. Every transition persists
395
- the record **and** broadcasts `agent_update` to subscribers. Archiving soft-deletes (sets
396
- `archivedAt`). On startup, `running` agents are recovered (crash recovery), and `running` loops are
397
- recovered as `stopped` with an interruption log entry.
399
+ the record **and** broadcasts `agent_update` to subscribers; any other field (title, labels,
400
+ config) goes through `updateRecord(id, patch)`, which persists but leaves broadcasting to the RPC
401
+ call site. Archiving soft-deletes (sets `archivedAt`). On startup, persisted records are
402
+ rehydrated with no live session re-attached; any record still stuck at `running`/`initializing`
403
+ (daemon killed mid-turn) is reconciled back to `idle` since neither status is valid without a
404
+ session — `interrupt_agent` applies the same reconciliation as a second line of defense. `running`
405
+ loops are recovered as `stopped` with an interruption log entry.
398
406
 
399
407
  For a deeper subsystem reference, see [`AGENTS.md`](AGENTS.md) in this package and the specs under
400
408
  [`clean-room-scope/`](../../clean-room-scope/).