Adds a SQLite DB for session-specific metadata. Stores edits in there.
It can _almost_ restore edits, but I still need to make undoStops be
similarly persisted. That is a project for later this evening.
* agentHost: initial queuing/steering data flows
* agentHost: ui side for queued messages
Steering messages still don't quite work yet, I need to hook up some more stuff in the CLI for that I believe.
* comments
* rm dead code
* Fix loading sessions that were created by a previous instance of the server
Co-authored-by: Copilot <copilot@github.com>
* Add handleRestoreSession to agentHostMain side effects
Wire up the handleRestoreSession method in the utility process
agent host entry point, delegating to AgentService which forwards
to AgentSideEffects. This was missing after the interface was
updated to require session restore support.
* Address Copilot review: wrap backend errors, use Cancelled for interrupted turns
- Wrap agent.listSessions() and agent.getSessionMessages() calls in
try/catch so raw backend errors become ProtocolErrors instead of
leaking stack traces to clients.
- Use TurnState.Cancelled instead of TurnState.Complete for
interrupted/dangling turns during session restoration.
- Update test assertions to match new interrupted turn state.
(Written by Copilot)
---------
Co-authored-by: Copilot <copilot@github.com>
- Migrates to use AHP types that are synced via `npx tsx scripts/sync-agent-host-protocol.ts`
- One big churn was migrating out of URIs as rich objects in the protocol.
We can't really shove our own `$mid`-type objects in there. I also explored doing a
generated translation layer but I had trouble getting one I was happy with.
- This tightens up some type safety in general and fixes some areas where vscode had
silently/sloppily diverged from the protocol types.