Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# myworktree — HTTP API

> **Note**: This document covers the HTTP API. Terminal-related client-side settings (e.g., scrollback buffer size, font size, theme) are handled by the Web UI and are not part of the backend API.

Base URL: printed when starting `myworktree` or `mw`, e.g. `http://127.0.0.1:50053/`.
`mw` opens the browser automatically by default; `myworktree` prints the URL unless you pass `-open=true`.

Expand Down
1 change: 1 addition & 0 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ It does **not** analyze project code or prevent concurrent write conflicts insid
- **Handshake Protocol**: Server sends `{"type":"ready"}` on connect; client must wait for this before sending resize to start data flow.
- **Timeout Handling**: Client should implement 5s handshake timeout with SSE fallback.
- **Resize Support**: Client sends `{"type":"resize","cols":80,"rows":24}` to update PTY size, triggering TUI programs to redraw.
- **Client-side Config**: Terminal buffer size (scrollback) is configurable on the client side to control how much history is retained in memory for scrolling. This is a client-side setting and does not affect server-side log persistence.
- Fallback path remains available: HTTP input `POST /api/instances/input` + replay/SSE logs (`GET /api/instances/log`, `GET /api/instances/log/stream`).
- UI shows transport state (`websocket/sse/polling`) and supports manual WS reconnect.
- Backlog is stored on disk with a size cap (rolling truncate).
Expand Down
1 change: 1 addition & 0 deletions docs/PRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- WebSocket 握手协议:服务端发送 `{"type":"ready"}`,客户端等待后发送 resize 开始数据流。
- 窗口尺寸传递:前端监听窗口 resize 并通知后端 PTY,确保 TUI 程序正确重绘。
- 超时降级:5 秒握手超时后自动降级到 SSE 方案。
- 终端配置:Web TTY 的缓冲区(scrollback)、主题、字体等参数由前端灵活配置,以适应不同的调试和使用场景。
- 规划增强:无(PTY + Web TTY 已完成)。

## 8. 验收标准(MVP)
Expand Down
3 changes: 2 additions & 1 deletion internal/ui/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,8 @@ <h3>Start Instance</h3>
term = new Terminal({
convertEol: true, cursorBlink: true,
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
fontSize: 13, theme: { background: "#0b1020" }
fontSize: 13, theme: { background: "#0b1020" },
scrollback: 10000
});

if (window.FitAddon) {
Expand Down