* feat(web-shell): add opt-in interactive browser terminal Adds a browser terminal to the web-shell right panel, backed by shared node-pty sessions exposed through an authenticated /terminal WebSocket route on the serve daemon. The feature is opt-in (QWEN_WEB_TERMINAL=1 plus bearer auth) and gated behind a web_terminal capability so default deployments never expose the entry point. Terminals are workspace-scoped: the daemon resolves the client workspace selector against the live registry, binds each PTY to that runtime's cwd and effective environment, and releases sessions when the workspace drains. Reconnects claim the same session id and replay bounded scrollback (including exit state) without duplicating output; controls resize/release ride text frames while PTY data stays binary. A session with no listeners is reclaimed after 15 minutes. Co-authored-by: Qwen-Coder <[email protected]> * chore(vscode): update third-party notices * test(cli): include web terminal capability * test(integration): include web terminal capability * fix(web-shell): harden terminal lifecycle * docs(serve): document web terminal capability * fix(web-shell): address terminal review findings * fix(web-shell): preserve terminal sessions and key events * fix(web-shell): harden terminal session cleanup * fix(web-shell): make terminal limits recoverable * fix(web-shell): isolate terminal sessions --------- Co-authored-by: 钉萁 <[email protected]> Co-authored-by: Qwen-Coder <[email protected]> Co-authored-by: Shaojin Wen <[email protected]>
1.2 KiB
Web terminal lifecycle
The browser terminal is a manually opened Web Shell surface. The host must add
the terminal right-panel action and the daemon must advertise the
web_terminal capability before the UI exposes the entry. WebSocket requests
use the daemon's shared Host, Origin, authentication and workspace trust gates.
Each terminal is owned by one active, trusted workspace runtime. The daemon resolves the client workspace selector against the live registry and supplies that runtime's cwd and effective environment to the PTY. A terminal id cannot be reclaimed through another workspace.
Closing a terminal tab sends an explicit release control frame and kills the PTY. Hiding the panel, switching tabs or losing the WebSocket only detaches the client, so reconnect can replay the same session. A detached session is killed after the idle timeout even if its command is still running. Exited sessions replay both scrollback and exit state. Binary WebSocket frames contain UTF-8 terminal input and output; NUL-prefixed text frames contain control messages. Reloading the page loses the in-memory terminal id, so the detached session is reclaimed after the idle timeout rather than restored into the new page.