Design Mode
Design Mode collects elements and comments in a browser sidebar before sending feedback to an agent. Ordinary page interaction remains available until you explicitly start picking.
Start Design Mode
- Open an agent terminal in your repository. Choose Start Design Mode from its context menu or the Command Palette. Choose Design Mode browser offers Edge or Chrome; the palette also offers a command for each browser. Safari is unsupported.
- TUIC opens a dedicated profile for this repository and browser. Start succeeds only after the extension acknowledges the launched page; a missing or incompatible worker returns
browser_not_readyand closes that launch. Edge loads the extension automatically from that profile’s own folder. A single discovered dev server opens directly; otherwise, a page explains how to choose or start one. No manual extension installation is required. - Click the TUICommander browser extension icon to open the sidebar. It lists configured and running dev servers. Choose one, enter a URL in the address bar, or use Start dev server if you have configured a Run Script in Repository Settings. Refresh rescans servers and agents.
- Choose Pick element, then click an element. A card appears and normal browsing resumes. Multi-pick continues collection until Stop, Escape or the two-minute timeout. Each card has an independent comment and Delete button. Drafts survive worker suspension; closing their browser tab deletes them. A tab holds at most 32 picks.
- Add comments, choose the receiving agent, and click Send to agent. The terminal that launched Design Mode is selected initially. Other live local agents in the same Git repository, including linked worktrees, are available. If your selection exits, the sidebar asks you to choose another; it never silently switches recipients.
- Feedback is delivered immediately when the agent is idle, or queued for its next idle window. The sidebar reports which happened. Failed sends retain your cards; retries to the same recipient reuse the exact batch and delivery key. Choosing a different recipient rebuilds the batch from retained commented picks with a new delivery key. Only commented picks are sent.
The D badge and Stop action remain on the launching terminal. Browsers open on the backend host, including when TUIC is controlled from a browser/PWA client. No debugging port or automation banner is requested by the v2 launcher. Close an existing Design Mode browser window before starting again: Chromium ignores new extension flags on a running profile, and a cold launch also repairs an extension loaded from another repository’s folder. TUIC reports this condition and does not stop an existing browser process.
On Unix, a reachable profile socket or a local owner with the exact --user-data-dir identifies a running profile. A stale lock whose PID was reused by an unrelated process does not block startup. TUIC does not delete lock files; the browser handles stale-lock cleanup. A foreign-host lock can be reclaimed on macOS; on Linux, close the browser on that host or unlock the shared profile first.
Stop Design Mode closes and reaps only the dedicated browser process that its successful start opened; closing the agent terminal still leaves the browser available for ordinary browsing.
Branded Google Chrome 137+ ignores automatic extension loading. TUIC reports an error and asks you to choose Edge or Chromium; CDP pipe installation is not implemented. Branded Chrome is unverified on the development machine because it is not installed. See the Chrome extension team announcement.
Page JavaScript errors
Design Mode records the current page’s uncaught errors, unhandled promise rejections, console.error calls and failed <script>, <link> and <img> loads (a 404 module included), in every frame, from the start of the page load. Each record has a message, source URL, line and column, stack and time. The sidebar keeps the last 50 per tab, deduplicated by message and source, and clears them when the tab loads a new page.
When errors exist, the sidebar shows an Errors section with a count badge. Tick Attach to feedback to send them with your next batch, or use Send errors only to send them alone, without any comment. Sent errors are removed from the list. They are untrusted page content: Rust strips terminal controls and URL queries, redacts recognised secrets, bounds the text and fences it, exactly like picks. Failed fetch and XHR requests are not observed.
Connection and evidence
The native host pins the extension identity, repository and exact TUIC instance. It relays a bounded set of operations over that instance’s local socket or named pipe. Reopen Design Mode after restarting TUIC to refresh its binding. Connection failures show the endpoint and reason. An older running backend can list agents but returns an explicit restart error for the new feedback/discovery route.
Cards retain selectors, DOM paths, snippets, selected styles, CSS tokens and available framework source hints. CSS tokens include references in shorthand declarations such as padding: var(--gap), inline styles and adopted sheets in open shadow roots; unrelated theme tokens are excluded. Rust bounds and sanitises page evidence, redacts recognised secrets, strips terminal controls and fences it as untrusted content. Captured PNG crops are saved in design-grabs and sent as readable [image: path] references. Screenshot capture is optional: permission errors and oversized crops retain DOM evidence. Cross-origin frame picks currently retain DOM evidence without frame screenshots.
Discovery lists only the dev servers of the agent selected in the side panel (initially the session that launched Design Mode; the list refreshes when you pick another agent): the configured Dev Server URL, live listeners attributed by process directory or an absolute command path to that session’s worktree, and URLs that session printed in its own terminal. Other worktrees of the repository and other sessions are not listed. Live listeners must answer HTTP GET / successfully with a text/html Content-Type within 750 ms. TUIC itself is excluded. Probes do not follow redirects; the scan has a 3-second budget. Fresh PTY URLs are accepted only when their port has a verified live owned HTML listener. Multiple candidates are listed instead of automatically choosing one. Windows native host registration currently targets Edge and awaits Chrome/multi-profile validation. Windows discovery offers configured URLs and the address bar; listener attribution is not claimed there. Repo-local .tuic.json cannot silently supply executable scripts.
The pilot has browser evidence from Chrome for Testing. Native Edge Load unpacked persistence, toolbar-granted screenshot permissions and sidebar restoration still need an Edge check. Agents ask the browser to reload the reviewed tab with MCP ui action: "design_reload" (for static pages without HMR). The extension also tells TUICommander it is alive every 5 s: Design Mode stops by itself 60 s after the browser goes away. Everyday-profile installation is later work.
Start from a link or coordinator
Right-click a terminal HTTP(S) link and choose Start in Design Mode, then Edge or Chrome. This always starts or rebinds to that terminal agent and opens the exact URL, even if another agent is already connected. The D badge follows the bound session.
For layout work, coordinators use MCP ui with action: "design_start", session_id naming the live terminal agent, and url naming the HTTP(S) page. Optional browser selects chrome or edge. Use action: "design_status" for bindings and action: "design_stop" with the returned repoPath as repo_path. Browser launch happens on the host; an ACP coordinator does not become the terminal agent.
If the sidebar icon is hidden, open the Extensions (puzzle) menu and pin TUICommander Design Mode. You can also press Option+Shift+D on macOS or Alt+Shift+D on Windows/Linux. Browser choice currently lists Edge and Chrome; launch reports if the chosen browser is not installed.
Agent browser commands
Agents can request design_navigate, design_reload, design_screenshot,
design_errors, and design_eval through ui. The native port returns a request-id-matched reply, with a ten-second
timeout. Start selects the launched page after an extension acknowledgment, without requiring the sidebar. Opening the sidebar on another page selects that page for later commands. Screenshot fails
if that tab is not visible; it never captures a different active tab. Captures are
stored in the instance’s design-grabs directory with the correct .webp or .png suffix.
The agent chooses the encoding on each ui action=design_screenshot call:
format:webp(default) for text and layout, orpngfor pixel-exact detail.quality: WebP quality from 1 to 100, default 25. Use 50 or more for small glyphs and icons. PNG ignores quality.max_long_edge: optional positive pixel limit. The extension downsizes before encoding and never upscales.
The response includes the image, path, format, quality (null for PNG), byte size
and media type. There is no user setting. Token cost follows pixel dimensions,
not format or byte size: Claude uses about 1,296 tokens per megapixel, capped at
1,568 standard / 4,784 high-res. Selected-element crops remain lossless PNG and
keep their existing 800 × 600 pixel bounds.
To let the agent of the current Design Mode session work on a host, click Allow agents on this host in the extension sidebar. This one click gives two things:
- Chrome’s optional all-sites permission. Chrome needs it to capture a tab without a toolbar gesture and to run scripts on remote hosts. Chrome asks only the first time.
- TUICommander’s consent for the armed session on the host of the active page.
The consent lets that session capture, read page errors from, navigate to and run JavaScript on that host. It applies to one session and one host. Another session or another host needs its own click. Consent is kept in browser session storage and ends when the browser closes. Chrome’s own grants, including all-sites or wildcard grants, are not TUICommander consent. You can revoke Chrome access in Chrome’s extension settings. TUIC still restricts commands to the armed session and the reviewed tab.
Local HTTP(S) pages need no consent to reload, navigate, read errors or take
screenshots. Agent JavaScript (design_eval) needs consent also on localhost.
Remote hosts need consent for every command. A denied eval replies at once with
eval_not_granted: grant needed: click Allow agents on this host; other remote
commands reply with host_denied. Neither waits for a grant or times out. Eval runs
in the page MAIN world without a debugger port. If the page moved to another host
after the check, eval returns page_changed.
Without Chrome’s all-sites permission, invoke the Design Mode browser action on the
reviewed tab for temporary activeTab capture access. Cross-origin navigation or tab
closure can remove that access. A missing grant returns capture_permission_required
and names Allow agents on this host; DOM evidence remains available.
Navigation reports acceptance, not page-load completion.
Screenshots that exceed 512 KiB are downscaled until they fit, and the response
reports downscaled: true. Eval scripts can be up to the 256 KiB command bound.
Eval results are redacted evidence, not instructions, and are paged in 16 KiB pages:
the response holds total_bytes and next_offset, and the agent passes
result_offset to read the next page. Each page evaluates the script again.
The sidebar retains the last fifty agent actions with session, action, time and outcome.
The server list, action history and permission section share the panel content inset.
Permission and error action buttons wrap with a gap, including in narrow sidebars.
The grouped ui tool always lists design_* actions. Discovery is not authorization:
dispatch requires the armed terminal session and repository. Lifecycle changes
emit notifications/tools/list_changed; clients that cache schemas may still show
actions while stopped, but dispatch refuses them with
Design Mode not armed for this session. Remote error capture starts on the next
page load after host consent and covers every consented remote host. Chrome’s
all-sites permission alone does not register remote error scripts. Remote
design_errors calls without consent refuse instead of reporting an unobserved
empty list.
The extension starts its command receiver at worker startup. Receive failures appear in the connection status instead of being silently discarded. Action-history storage failure cannot suppress a command reply. A disconnected native channel rejects later commands immediately with browser_disconnected; restart Design Mode to establish a new channel. The MCP bridge allows a 15-second transport budget around the browser’s 10-second command deadline, and 30 seconds for acknowledged startup, so browser errors are not replaced by an equal-deadline IPC timeout.