provide-terminal 2026-02-28
Repository initialized with complete terminal package, WebSocket proxy, hijack widgets, and 9 rounds of code review fixes
77 files · 18,351+

Initial Package

14 files changed
  • __init__.py Public API surface for the terminal package
  • emulator.py Terminal emulator core
  • io.py Terminal I/O layer
  • screen.py Screen buffer and rendering
  • ansi.py ANSI escape code processing and color upgrade pipeline
  • file_io.py File import/export helpers
  • protocols.py Protocol definitions
  • defaults.py Package-wide default constants
  • __init__.py Replay package init
  • raw.py Raw session replay
  • viewer.py Replay viewer
  • session_logger.py Session recording and logging
  • pyproject.toml Package metadata and dependencies
  • uv.lock Locked dependency graph
  • Core terminal package instantiated: emulator, I/O, screen buffer, ANSI processing, file importers, color upgrade pipeline, session logger, replay module, and coverage configuration. instantiate architectural
    7 files
    • __init__.py
    • emulator.py
    • io.py
    • screen.py
    • ansi.py
    • session_logger.py
    • raw.py

WebSocket and Proxy

10 files changed
  • fastapi.py FastAPI WS router factory and bidirectional proxy
  • gateway.py Reverse-direction gateway: telnet/SSH to WebSocket
  • cli.py provideterm CLI proxy command
  • __init__.py Transport package init
  • base.py Base transport abstraction
  • ssh.py SSH transport
  • telnet.py Telnet transport
  • telnet_server.py Telnet server transport
  • websocket.py WebSocket transport
  • chaos.py Chaos/fault-injection transport
  • FastAPI WS router factory and bidirectional proxy added, enabling browser terminals over WebSocket. instantiate behavioral
    1 file
    • fastapi.py
  • Reverse-direction gateway (telnet/SSH to WS) and provideterm CLI proxy command added. CLI later renamed to undefterm then back. instantiate behavioral
    2 files
    • gateway.py
    • cli.py
  • SSH gateway host-key path validated before calling asyncssh. Browser WebSocket input encoded as UTF-8 instead of latin-1. remediate internal
    2 files
    • gateway.py
    • websocket.py

Frontend Widgets

10 files changed
  • hijack.html ProvideHijack embeddable hijack control widget HTML
  • hijack.js ProvideHijack widget JS with WS heartbeat, backoff reconnect, mobile toolbar
  • hijack.css Hijack widget styles
  • terminal.html ProvideTerminal widget HTML
  • terminal.js ProvideTerminal widget JS
  • terminal.css Terminal widget styles
  • terminal-panel.js Terminal panel component
  • demo_server.py Demo server for manual and Playwright testing
  • terminal.html Standalone frontend terminal HTML
  • terminal.js Standalone frontend terminal JS
  • Embeddable ProvideTerminal widget and mount_terminal_ui() added for drop-in browser terminal embedding. instantiate behavioral
    2 files
    • terminal.html
    • terminal.js
  • Embeddable ProvideHijack hijack control widget added. instantiate behavioral
    2 files
    • hijack.html
    • hijack.js
  • WS heartbeat, exponential backoff reconnect, and mobile key toolbar added to frontend. margin internal
    1 file
    • hijack.js
  • Demo server script added for manual and Playwright-based testing. qualify internal
    1 file
    • demo_server.py

Hijack Control Plane (9 Rounds of Review)

8 files changed
  • __init__.py Hijack package init
  • base.py HijackableMixin base class (renamed from HijackBase)
  • bridge.py Hijack bridge: swallowed exception logging, reconnect state
  • hub.py TermHub: atomic lock patterns, idle bot state pruning
  • models.py Hijack data models
  • routes.py Hijack routes (combined)
  • routes_rest.py REST hijack routes
  • routes_ws.py WebSocket hijack routes
  • Nine rounds of code review corrections applied: security, correctness, and concurrency issues in the hijack control plane. Fixes cover: acquire cancellation safety, reconnect state reset, stale lease handling, was_owner init, spurious callback guards, onopen guard, close executor, and atomic lock patterns across hub, routes, and logger. remediate architectural
    4 files
    • hub.py
    • bridge.py
    • routes_rest.py
    • routes_ws.py
  • HijackBase renamed to HijackableMixin; swallowed exceptions now logged in bridge. All files exceeding 500 LOC split. decouple behavioral
    2 files
    • base.py
    • bridge.py
  • Idle bot state pruned from TermHub to prevent unbounded _bots growth. deprecate internal
    1 file
    • hub.py
29 files changed
  • __init__.py Test package init
  • conftest.py Test fixtures and configuration
  • __init__.py Test helpers package
  • mock_server.py Mock server for integration tests
  • test_fastapi_ws.py WebSocket integration tests
  • test_hijack_acquire_atomic.py Atomic acquire regression tests
  • test_hijack_base.py HijackableMixin base tests
  • test_hijack_bridge.py Bridge tests
  • test_hijack_hub.py Hub tests
  • test_hijack_routes.py Route handler tests
  • test_hijack_ws.py WebSocket hijack tests
  • test_playwright_hijack.py Playwright smoke test for hijack widget
  • test_session_logger.py Session logger tests
  • test_ssh_transport.py SSH transport tests
  • test_telnet_transport.py Telnet transport tests
  • test_telnet_transport_full.py Full telnet transport test suite
  • test_websocket_transport.py WebSocket transport tests
  • test_ansi.py ANSI processing tests
  • test_ansi_upgrade.py Color upgrade pipeline tests
  • test_bridge_reconnect.py Bridge reconnect tests
  • test_chaos_transport.py Chaos transport tests
  • test_cli.py CLI tests
  • test_emulator.py Emulator tests
  • test_file_io.py File I/O tests
  • test_gateway.py Gateway tests
  • test_io.py I/O layer tests
  • test_replay.py Replay tests
  • test_screen.py Screen buffer tests
  • test_screen_extras.py Additional screen tests
  • WebSocket integration tests and Telnet test flakiness fixes added. pytest-playwright dev dependency added. JSDoc, ping guard test, Playwright smoke test, and README added. qualify internal
    3 files
    • test_fastapi_ws.py
    • test_playwright_hijack.py
    • test_telnet_transport_full.py