feat(tui-harness): add SVG screenshots and HTTP transport#571
Merged
jesseturner21 merged 6 commits intomainfrom Mar 19, 2026
Merged
feat(tui-harness): add SVG screenshots and HTTP transport#571jesseturner21 merged 6 commits intomainfrom
jesseturner21 merged 6 commits intomainfrom
Conversation
Contributor
Coverage Report
|
f09fe37 to
fd6b483
Compare
Zero-dependency SVG renderer that walks the xterm buffer cell-by-cell, resolves ANSI 256-color palette and RGB colors, groups consecutive cells with identical styles into spans, and emits a self-contained SVG with optional macOS-style window chrome. Includes dark and light themes, cursor rendering, and XML escaping.
Add screenshot() method to TuiSession, export renderer types from barrel, and extend tui_screenshot MCP tool with format (text/svg), theme (dark/light), and savePath parameters.
Document MCP tool usage for SVG screenshots, library API, theme options, and markdown embedding instructions.
Add StreamableHTTPServerTransport support so the MCP server can run as an independent HTTP process outside Claude Code's sandbox. This fixes the posix_spawnp failure that prevented node-pty from spawning PTY child processes when the server ran as a sandboxed stdio subprocess. Supports --http and --port flags, with stdio mode preserved as default for backward compatibility.
Switch .mcp.json from stdio to HTTP transport (http://127.0.0.1:24100/mcp) and add scripts/start-tui-harness.sh for one-command server startup.
Document the sandbox limitation with stdio transport and how HTTP mode solves it. Include quick start, Claude Code configuration, custom port options, and backward compatibility notes.
fd6b483 to
2808262
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds two major capabilities to the TUI agent harness:
SVG Terminal Screenshots — A zero-dependency renderer that walks the xterm buffer cell-by-cell, resolves ANSI 256-color palette and RGB colors, groups consecutive cells with identical styles into spans, and emits a self-contained SVG with optional macOS-style window chrome. Supports dark/light themes, cursor rendering, and XML escaping. Integrated into
TuiSession.screenshot()and thetui_screenshotMCP tool withformat: 'svg',theme, andsavePathparameters.HTTP Transport — Adds
StreamableHTTPServerTransportsupport so the MCP server can run as an independent HTTP process outside Claude Code's sandbox. This fixes theposix_spawnpfailure that preventednode-ptyfrom spawning PTY child processes when the server ran as a sandboxed stdio subprocess. Supports--httpand--portCLI flags, with stdio mode preserved as default for backward compatibility.Related Issue
Closes #
Documentation PR
N/A — documentation is included in this PR (
docs/tui-harness.md).Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsAdditional testing:
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.