Commit graph

28 commits

Author SHA1 Message Date
0366e459f5
Integrate terminal emulator in server.ts (Phase 1) 2026-01-31 09:45:38 -05:00
c9908c87c3
Add terminal.ts module for headless terminal emulation
Creates new module providing terminal session management using @xterm/headless:
- createTerminal(): spawn headless terminal emulator instances
- serializeAsHTML(): export terminal state as HTML
- disposeTerminal(): clean up resources

This replaces stateless ANSI processing with proper VT emulation that tracks
cursor position, screen buffer, and terminal attributes across output chunks.
2026-01-31 09:43:46 -05:00
3e5afbd5a8
Clean up ansiCarryovers on WebSocket close 2026-01-31 09:12:05 -05:00
42ba893ea5
Add tests for splitAnsiCarryover function 2026-01-31 09:11:49 -05:00
0a3bfa6092
Add debug logging for ANSI carryover events 2026-01-31 09:10:19 -05:00
c09654c6c7
Add JSDoc to splitAnsiCarryover function 2026-01-31 09:10:07 -05:00
a8eea4e694
Add SSE cleanup 2026-01-31 09:06:16 -05:00
423fa8375d
End all sessions on server startup 2026-01-30 09:12:40 -05:00
5948dcaed1
Add viewport-based PTY resize from dashboard 2026-01-30 08:19:09 -05:00
aa50c550b7
Auto-seed device from CLAUDE_REMOTE_SECRET env var 2026-01-28 17:21:12 -05:00
1a7e93d74d
Disable idle timeout 2026-01-28 15:38:29 -05:00
43f7574e4e
Change default port from 3000 to 7200 2026-01-28 15:37:25 -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
11e72b1025
Parse ANSI codes in output before SSE broadcast 2026-01-28 14:17:13 -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
a93475f3ab
Handle state and stats WebSocket messages in server 2026-01-28 13:50:35 -05:00
1827baaf39
Fix answer endpoint to avoid duplicate DB updates 2026-01-28 13:20:47 -05:00
dcc6a89b4d
Format string literals to use double quotes 2026-01-28 13:14:52 -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
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
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
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
02be345946
Fix biome config formatting (self-heal) 2026-01-28 11:03:31 -05:00
726190eaa6
Restructure project files into src and public directories
Moved index.ts to src/server.ts and created stub files for types, db, auth,
and cli modules. Added minimal placeholder for dashboard. Removed generated
README.md in favor of CLAUDE.md and docs/plan.md.
2026-01-28 11:00:19 -05:00