feat(shellv2): add ssh meta function and tabbed interface#2047
feat(shellv2): add ssh meta function and tabbed interface#2047KCarretto wants to merge 1 commit intowasm-ssh-pivotfrom
Conversation
- Add `ssh` meta function support in `eldritch-wasm` browser repl - Refactor `ShellV2` UI to use Chakra UI `Tabs` for managing multiple terminal sessions - Create `SshTerminal` component for interactive SSH sessions over portals via `wss://.../portals/ssh/ws` - Implement WebSocket connection, sequence ID tracking, and reconnection logic for the SSH terminal - Ensure `xterm.js` instances resize correctly when switching tabs - Update `BrowserWasmAdapter` and `useShellTerminal` to handle and expose meta function execution results Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR introduces a new "meta functions" feature to the ShellV2 interface, starting with the
ssh("user:password@host")command.Changes include:
eldritch-wasm'sBrowserReplto intercept thesshcommand and return a special JSON payload ({"status": "meta", ...}) instead of sending the command to the agent.ShellV2component to use Chakra UI'sTabs, allowing the main shell and newly spawned SSH sessions to exist side-by-side.SshTerminalcomponent that usesxterm.jsand connects to the backend via the/portals/ssh/wsWebSocket endpoint. It handles session UUID generation, sequence ID tracking (incrementing only on sends), and automatic reconnections.useRefforportalIdwithinuseShellTerminalto ensure thehandleMetaSshcallback always has access to the current portal state.xterm.js'sFitAddoncorrectly calculates dimensions for terminals that were previously hidden.The SSH functionality requires an active portal connection to function; if invoked without one, an error message is printed directly to the shell terminal.
Testing performed:
go test ./tavern/internal/portals/ws/... -v).cargo checkandcargo test).PR created automatically by Jules for task 4121754529262080486 started by @KCarretto