2b77e15b36
Add pending-switch coordination to internal/activity (RequestSwitch/PendingSwitch/AckSwitch/CancelSwitch); AckSwitch atomically sets the active project and records switch-completed with Claude's summary. New MCP tools get_pending_switch and ack_switch (request is user-only via HTTP). HTTP GET/POST/DELETE /api/switch. New <handoff-bar> component (ask/waiting/cancel/completed) over SSE; activity-feed reflects switch-completed. Test covers request->ack->clear. Verified live: request/waiting/cancel over SSE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
handoff-bar
Intent
The user-facing control for the graceful project handoff (AGENT.md §8.3). It
lets the user ask Claude to switch to the active project, shows the "waiting for a
good stopping point" state while the request is pending, and announces completion
(with Claude's summary of where it left off) when Claude calls ack_switch. The
switch is Claude-completed at a checkpoint, never app-forced (§1.4-class rule).
Public surface
- Tag:
<handoff-bar> - Attributes/properties: none.
- Fetches (initial):
GET /api/switch(pending request),GET /api/active-project. - Writes:
POST /api/switch {target}to request a handoff to the active project (actor=user);DELETE /api/switchto cancel. - Subscribes:
EventSource('/events')— reacts toswitch-requested,switch-completed(shows Claude's summary),switch-cancelled, andactive-project-changed. Closed on disconnect.
History
- 2026-09-20: created — slice 4; request/pending/completed UI over the
/api/switchendpoints and SSE.
Notes / gotchas
- All server-derived text is escaped before insertion (targets, summaries).
- The request targets the current active project; select a repo first (that
sets the active project via
<repo-list>). - The completion message persists until the next request; it is informational.