Skip to content

Add wmux-client-terminal: TUI client for wmux#25

Merged
shmuelhizmi merged 6 commits intomasterfrom
inky-pair
Mar 25, 2026
Merged

Add wmux-client-terminal: TUI client for wmux#25
shmuelhizmi merged 6 commits intomasterfrom
inky-pair

Conversation

@shmuelhizmi
Copy link
Copy Markdown
Collaborator

Summary

  • New @playfast/wmux-client-terminal package — renders wmux in the terminal using OpenTUI's React reconciler, connecting via echoform WebSocket transport
  • Exposes token and wsUrl on WmuxHandle so consumers can pass credentials to renderWmuxTUI()
  • Adds TUI demo entry point (bun run tui in demo/dev-server)

Features

  • Sidebar with categories, tabs, and colored status dots
  • VT100 terminal buffer (cursor movement, ANSI colors, erase commands, carriage returns)
  • File viewer with line numbers
  • Tmux-style Ctrl+B prefix for TUI commands — all other keys pass directly to the active PTY
  • Auto-scroll to bottom on terminal output (stickyScroll)
  • Web client link in top bar header
  • Proper lifecycle cleanup via onDestroy callback and uncaught error handlers

Usage

import { wmux } from "@playfast/wmux";
import { renderWmuxTUI } from "@playfast/wmux-client-terminal";

const handle = await wmux({ /* config */ });
await renderWmuxTUI({
  token: handle.token,
  wsUrl: handle.wsUrl,
  webUrl: handle.url,
});

Test plan

  • Run bun run tui in demo/dev-server/ — verify sidebar, terminal output, keyboard input
  • Test Ctrl+B prefix: j/k to navigate, 1-9 for categories, r restart, s stop, q quit
  • Verify shell prompt renders correctly (no stray characters)
  • Verify auto-scroll follows new output
  • Verify web link appears in top bar

🤖 Generated with Claude Code

shmuel hizmi and others added 6 commits March 25, 2026 12:59
New `@playfast/wmux-client-terminal` package that renders wmux in the
terminal via OpenTUI's React reconciler, connecting to the same wmux
server as the browser client through echoform's WebSocket transport.

Features:
- Sidebar with categories, tabs, and status indicators
- VT100 terminal buffer with ANSI color/cursor/erase support
- File viewer with line numbers
- Tmux-style Ctrl+B prefix for TUI commands, all other keys pass to PTY
- Auto-scroll to bottom on terminal output
- Web client link in header bar
- Proper lifecycle cleanup via onDestroy and error handlers

Also exposes `token` and `wsUrl` on WmuxHandle so consumers can pass
credentials to `renderWmuxTUI()`, and adds a TUI demo entry point.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `done` promise resolves when the TUI is closed (user quit via
Ctrl+B q, or programmatic destroy()). This lets consumers await it
and shut down the dev server cleanly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move jsxImportSource from tsconfig.json to per-file `@jsxImportSource`
pragmas so tsgo doesn't apply it to echoform's tsx files resolved
through workspace dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New export `@playfast/wmux/preset/tui` that starts the wmux server,
prints the web URL, opens the TUI client, and returns a handle with
`url`, `stop()`, and `done` promise. Server auto-stops when TUI closes.

Uses dynamic import for @playfast/wmux-client-terminal (devDependency
for types only) — no circular deps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
It's used at runtime via dynamic import in the preset, not just for types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shmuelhizmi shmuelhizmi merged commit 096d631 into master Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant