8 Commits

Author SHA1 Message Date
Pierre Martin
0e4ced5b1f feat: add vmux setup and vmux hook for Claude Code integration
- vmux setup: idempotently adds hooks to ~/.claude/settings.json
- vmux hook: receives Claude Code hook events via env vars and forwards to daemon
- Daemon handles "hook" action on Unix socket (no HTTP server needed)
- Hooks provide instant state detection (permission/question/idle)
2026-03-23 23:11:47 +01:00
Pierre Martin
efbe31928e feat(04-01): integrate notifications and focus mode into daemon
- Notifier + FocusTimer fields in Daemon, initialized in NewDaemon
- processHookEvent notifies on Working -> Needs Input only (D-01)
- Focus mode suppresses notifications when active (D-05)
- FocusArgs in protocol, "focus" handler in daemon
- CLI "vmux focus <minutes>" command
- Tests for all notification transitions and focus handler
2026-03-23 21:26:02 +01:00
Pierre Martin
c921124bcc feat: sort sessions by workspace number in list output
Also restart daemon on make watch so new binary is used.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:42:10 +01:00
Pierre Martin
79ad8fb16a feat(03-02): integrate hook server into daemon with graceful degradation and dynamic poll
- Add hookPort, httpServer, lastHookTime, mu to Daemon struct
- startHookServer binds HTTP on hookPort, degrades if port busy
- Stop() closes httpServer before unix listener
- pollLoop uses time.After(currentPollInterval()) instead of fixed ticker
- currentPollInterval returns 20s when hooks active (<60s), 5s otherwise
- processHookEvent records lastHookTime on each hook event

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:45:48 +01:00
Pierre Martin
8594c48f84 fix: detect permission prompts as NeedsInput when tool_use is stale (>10s)
When Claude requests a tool permission approval, the last JSONL entry is
type=assistant with stop_reason=tool_use. Previously this was always
classified as Working. Now, if the tool_use entry is older than 10s with
no new activity, it's classified as NeedsInput.

Also fix vmux label to accept fuzzy match queries (not just session UUIDs).
2026-03-23 18:29:32 +01:00
Pierre Martin
a79a0e154c feat(02-03): client socket, autostart daemon, switch handler, workspace wiring
- Client struct sends JSON requests to daemon over Unix socket
- EnsureDaemon auto-starts the daemon if not running (retry 50ms x 20)
- Switch handler uses FuzzyMatch + SwitchToWorkspace via i3 IPC
- InitWorkspaceResolver wires BuildTerminalWorkspaceMap + ResolveWorkspace
- sysattr_linux.go for Setsid detach on daemon spawn
2026-03-23 17:51:31 +01:00
Pierre Martin
4b142a79b5 feat(02-01): add Unix socket server, poll loop, and stop handler
- Daemon struct with Start/Stop/Wait lifecycle
- Unix socket server handling list/label/stop actions
- Poll loop scanning /proc every 5s
- Stale socket cleanup before listen
- Connection dispatch with JSON encoding
- Tests with -race: StartStop, ListOverSocket, LabelOverSocket, UnknownAction
2026-03-23 17:45:57 +01:00
Pierre Martin
5315e88494 feat(02-01): implement protocol types, SessionRegistry, and LabelStore
- Enrich Session with Workspace, Label, WaitingSince fields
- Protocol types: Request, Response, SessionInfo, SwitchArgs, LabelArgs
- SessionRegistry with WaitingSince transition tracking
- LabelStore with JSON file persistence
2026-03-23 17:43:12 +01:00