mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[PR #636] feat(ssh): add @opentui/ssh package with stream-mode renderer migration #1459
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1459
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/636
Author: @msmps
Created: 2/6/2026
Status: 🔄 Open
Base:
main← Head:feat/ssh📝 Commits (4)
978af38feat(ssh/core): add SSH package and migrate renderer to NativeSpanFeed stream output88b4f61fix(ssh/core): address code review findings across SSH and renderer9c5234cfix(ssh/core): address reviewer findings in SSH and stream mode9639f9ffeat(ssh): add allowAll() middleware for production-ready open servers📊 Changes
29 files changed (+4282 additions, -239 deletions)
View changed files
📝
bun.lock(+77 -0)📝
packages/core/src/console.ts(+8 -0)📝
packages/core/src/renderer.ts(+333 -68)📝
packages/core/src/testing/test-renderer.ts(+15 -4)➕
packages/core/src/tests/renderer.stream-mode.test.ts(+269 -0)➕
packages/core/src/tests/renderer.stream-validation.test.ts(+48 -0)📝
packages/core/src/zig.ts(+16 -4)📝
packages/core/src/zig/lib.zig(+22 -2)📝
packages/core/src/zig/renderer.zig(+311 -137)📝
packages/core/src/zig/tests/buffer_test.zig(+2 -2)📝
packages/core/src/zig/tests/renderer_test.zig(+287 -22)➕
packages/ssh/README.md(+291 -0)➕
packages/ssh/examples/counter.ts(+109 -0)➕
packages/ssh/package.json(+40 -0)➕
packages/ssh/src/index.ts(+24 -0)➕
packages/ssh/src/middleware/index.ts(+172 -0)➕
packages/ssh/src/server.ts(+354 -0)➕
packages/ssh/src/session.ts(+207 -0)➕
packages/ssh/src/types.ts(+65 -0)➕
packages/ssh/src/utils/authorized-keys.ts(+36 -0)...and 9 more files
📄 Description
@opentui/ssh+ stream-mode renderer migrationSummary
@opentui/sshpackage for running OpenTUI apps over SSH with per-session renderer isolation.outputMode: "stream"backed byNativeSpanFeedin Zig.What This PR Includes
1) New package:
@opentui/sshcreateSSHServer()with lifecycle events (listening,session,error,close).SSHSessionwrapper with stream output wiring, input forwarding, resize handling, and idempotent close.logging()publicKey()(OpenSSHauthorized_keysparsing/matching)allowAll()(production-ready open server, no warnings)devMode()(development-only, prints security warning)2) Core renderer stream architecture
outputMode: "stream"in@opentui/corewith requiredonOutput,width, andheightvalidation.3) Reviewer follow-up fixes
maxSessionsagainst active + pending session creation to close async admission race.0x0) to safe defaults before renderer creation.authorized_keysoption-prefixed entries as unsupported and ignores them (with warning) to avoid silently weakening restrictions.process.stdin.pause()behavior so stream-only renderer teardown does not pause stdin.Documentation and Testing
packages/ssh/README.mdwith middleware phases/order, auth/session patterns, and compatibility notes.packages/ssh/tests/*(server, middleware, authorized-keys, session, integration, host-key)packages/core/src/tests/renderer.stream-mode.test.tspackages/core/src/tests/renderer.stream-validation.test.tsManual Verification (SSH Counter Example)
cd packages/sshbun run examplessh -p 2222 localhost+/-updates the counterqcleanly closes the sessionssh-keygen -R "[localhost]:2222"Pilotty-Based Verification
1) Install Pilotty
Verify with
pilotty --version.2) Install the Pilotty OpenCode skill
3) AI-assisted review prompt
Use this in OpenCode to run the flow autonomously:
Expected validation flow: start server, open concurrent SSH sessions, verify per-session counter isolation, test resize propagation, and quit sessions cleanly.
Notes
publicKey()currently supports key matching only; OpenSSH option prefixes (from=,command=,no-pty, etc.) are intentionally not enforced yet and are ignored.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.