Commit graph

61 commits

Author SHA1 Message Date
43f7574e4e
Change default port from 3000 to 7200 2026-01-28 15:37:25 -05:00
766ee9b67c
Fix code review issues for phase 2.6 UI polish
Issue 1: Move focusSessionId out of settings to prevent localStorage persistence
- Moved focusSessionId to top-level state property (not in settings)
- Updated all references from state.settings.focusSessionId to state.focusSessionId
- Removed saveSettings() calls from session filter functions

Issue 2: Add active state to wrap toggle button
- Added .active class to wrap-toggle button when wrapText is enabled
- Updated updateSettingsUI() to toggle .active class based on wrapText state

Issue 3: Document auto-scroll ephemeral behavior
- Added comment explaining why auto-scroll is per-session and not persisted
- Clarifies this is intentional design decision

Issue 4: Replace inline styles with CSS class for session filter button
- Added .header-text-btn CSS class with styling
- Removed inline style attribute from sessions-filter-btn
2026-01-28 15:18:55 -05:00
737948c820
Add auto-scroll control (pin/unpin) to session output 2026-01-28 15:14:09 -05:00
68dce06e47
Add session filtering (focus mode) to dashboard 2026-01-28 15:13:05 -05:00
057966469d
Add style popover with column layout and display controls 2026-01-28 15:11:22 -05:00
66b4989226
Add CSS variables and settings infrastructure for UI polish 2026-01-28 15:10:21 -05:00
acdceaf083
Handle all git status codes in file class mapping 2026-01-28 15:03:16 -05:00
c0387ff0d3
Add unit tests for git persistence 2026-01-28 15:02:40 -05:00
ae0251b6d3
Add git widget to session cards in dashboard 2026-01-28 14:58:35 -05:00
599f911964
Handle git WebSocket messages and persist to database 2026-01-28 14:56:53 -05:00
3b5e636730
Add git event types to ClientMessage and SSEEvent 2026-01-28 14:55:47 -05:00
0489864652
Refactor trimLineEndPreserveAnsi to simpler regex approach 2026-01-28 14:26:22 -05:00
a90da23cbc
Add unit tests for ANSI-to-HTML converter 2026-01-28 14:23:49 -05:00
5bc2d4fe1b
Update frontend to render HTML output from ANSI converter 2026-01-28 14:18:19 -05:00
11e72b1025
Parse ANSI codes in output before SSE broadcast 2026-01-28 14:17:13 -05:00
3f226996e7
Add ANSI-to-HTML converter module 2026-01-28 14:15:55 -05:00
7f3ce24099
Format code with biome 2026-01-28 13:59:55 -05:00
d30a092df5
Validate state values in WebSocket message handler 2026-01-28 13:59:38 -05:00
5df3392ad9
Use union types for state and mode in Session interface 2026-01-28 13:59:17 -05:00
7bf04ed184
Add prompt_json column to migration for upgrade path 2026-01-28 13:59:02 -05:00
348b56183e
Add stats widget to session cards 2026-01-28 13:55:57 -05:00
298faecf72
Add state badges to session card headers 2026-01-28 13:52:01 -05:00
a93475f3ab
Handle state and stats WebSocket messages in server 2026-01-28 13:50:35 -05:00
f31d33f992
Parse state and stats events from Claude Code hooks
Add parsing of structured JSON events from Claude Code hooks in PTY
output. State events track session lifecycle (ready/thinking/permission/
question/complete/interrupted). Stats events provide session metrics
(prompts, completions, tools, thinking time, etc).

Events are detected by parsing each line of PTY output, extracting valid
JSON objects with a type field, and forwarding state/stats events to the
server via WebSocket while preserving all output passthrough.
2026-01-28 13:48:56 -05:00
1827baaf39
Fix answer endpoint to avoid duplicate DB updates 2026-01-28 13:20:47 -05:00
091979390a
Add error handling and loading state to instructions modal 2026-01-28 13:20:10 -05:00
dcc6a89b4d
Format string literals to use double quotes 2026-01-28 13:14:52 -05:00
af8fc5ca88
Add tab instructions modal for permission prompts 2026-01-28 13:14:48 -05:00
acd75b0303
Implement key sequence execution for tab instructions
Execute the tab instruction flow:
- Navigate to target option using arrow keys
- Send Tab to enter instruction mode
- Type the instruction text
- Send Enter to submit

The sequence runs asynchronously with proper delays between steps
(50ms between arrows, 100ms before Tab, 100ms before instruction).
2026-01-28 13:13:51 -05:00
727f3e0e18
Format ternary operators in server.ts 2026-01-28 13:05:41 -05:00
ef3c66f887
Fix exit plan to send option response type
Exit plan responses should use type 'option' not 'text' since they're
selecting from a predefined set of options.
2026-01-28 13:03:07 -05:00
17ba44182b
Fix option value extraction in prompt rendering
Options are objects with value and label fields. Updated exit_plan
rendering to use opt.value and opt.label instead of treating opt as
a string.
2026-01-28 13:02:57 -05:00
419034255a
Fix QuestionPrompt to iterate questions array
QuestionPrompt has a questions array, not flat fields. Updated rendering
to iterate over each question item with its own header, question text,
and options.
2026-01-28 13:02:45 -05:00
caef206d51
Include prompt_json in SSE broadcasts
Both prompt broadcast paths now serialize and send prompt_json so the
dashboard can render rich prompts.
2026-01-28 13:02:25 -05:00
a9e6392649
Fix SSE event type to include prompt_json field
The prompt SSE event now includes prompt_json to transmit structured
prompt data to the dashboard for rich prompt rendering.
2026-01-28 13:02:05 -05:00
d3fac77f6f
Update dashboard to render rich multi-option prompts 2026-01-28 12:59:23 -05:00
5404598a5e
Add /answer endpoint for rich prompt responses
Adds new POST /api/prompts/:id/answer endpoint that handles AnswerResponse types:
- option: sends value + newline to PTY
- text: sends user input + newline to PTY
- tab_instructions: placeholder implementation sends selected_option (TODO: needs key sequences)

Updated /approve and /reject endpoints to use "1\n" and "3\n" instead of "y\n" and "n\n"
for consistency with option-based responses. Marked as legacy endpoints for backward compatibility.
2026-01-28 12:56:53 -05:00
cd7d1c0ea8
Add prompt_json column to store rich prompt data 2026-01-28 12:55:47 -05:00
2aeec48627
Add TypeScript interfaces for rich prompt system 2026-01-28 12:54:51 -05:00
8992b0cc7b
Add phase 2 design document 2026-01-28 12:38:58 -05:00
c1c2a9e802
Add a todo 2026-01-28 12:34:08 -05:00
0417d167a0
Add gitignore for node_modules and SQLite files 2026-01-28 12:28:40 -05:00
5ff684824a
Fix dashboard ID handling and output rendering performance 2026-01-28 12:26:17 -05:00
48a01641c4
Add mobile dashboard with SSE streaming
Replaced placeholder index.html with a fully functional mobile-first dashboard that connects to the server via SSE and provides real-time session monitoring and prompt approval.

Features:
- Mobile-first design with large touch targets (44px min) and readable fonts
- SSE connection to /events with automatic reconnection on disconnect
- Live display of active sessions with collapsible output views
- Pending prompts section with approve/reject buttons
- Real-time updates for session start/end, streaming output, and prompts
- Dark mode by default with light mode support via prefers-color-scheme
- Plain text terminal output (monospace, scrolls to bottom)
- Connection status indicator in header

Implementation is a single HTML file (~300 lines) with inline CSS and vanilla JS, no frameworks or dependencies.
2026-01-28 12:23:46 -05:00
fe3887393d
Add code review workflow to CLAUDE.md 2026-01-28 12:19:07 -05:00
508a1c9837
Fix CLI resource cleanup and auth flow 2026-01-28 11:50:51 -05:00
54bc458b7d
Add PTY CLI wrapper
Wraps claude CLI in PTY and bridges to WebSocket server. Handles:
- Argument parsing (--server, --secret)
- PTY spawn with terminal size detection
- Bidirectional I/O: local stdin/stdout + WebSocket
- Terminal resize events (SIGWINCH)
- Graceful cleanup on exit
- Basic WebSocket reconnection
- Auth and session messages to server
2026-01-28 11:46:47 -05:00
65b8acf5f8
Fix SSE cleanup and add prompt creation endpoint
- Fix SSE cancel handler to properly capture controller in closure
- Remove error JSON messages before WebSocket close (close reason is sufficient)
- Add POST /api/sessions/:sessionId/prompts endpoint for prompt creation
- Add SSE client cleanup on broadcast errors
- Add createPrompt and getSession imports
- Add prompt message type to ClientMessage for CLI prompt reporting
- Add prompt message handler in WebSocket to create and broadcast prompts
2026-01-28 11:41:50 -05:00
b4ac7beead
Add HTTP/WebSocket/SSE server 2026-01-28 11:37:59 -05:00
76a81666a2
Fix prepared statements to prepare once at init 2026-01-28 11:18:44 -05:00