Skip to content

Implement Headless REPL Architecture with WASM and Shell V2 UI#1811

Merged
KCarretto merged 2 commits intofeat/shellv2from
headless-repl-poc-10486277652285760486
Feb 16, 2026
Merged

Implement Headless REPL Architecture with WASM and Shell V2 UI#1811
KCarretto merged 2 commits intofeat/shellv2from
headless-repl-poc-10486277652285760486

Conversation

@KCarretto
Copy link
Collaborator

  • Updated eldritch-wasm to expose HeadlessRepl struct for managing input buffer and parsing without execution.
  • Added dependency fixes for eldritch-libassets and eldritch-libpivot to support wasm32-unknown-unknown compilation.
  • Implemented HeadlessWasmAdapter in frontend to interface with WASM and WebSocket.
  • Created Shell V2 Page (/shellv2) using xterm.js for a non-interactive REPL experience.
  • Added dummy backend route /shellv2/ws in tavern to echo commands.
  • Updated build scripts and configuration to deploy WASM artifacts to public directory.

PR created automatically by Jules for task 10486277652285760486 started by @KCarretto

- Add `HeadlessRepl` to `eldritch-wasm` for input buffering and parsing.
- Create `headless-adapter.ts` for frontend WASM/WebSocket integration.
- Implement `/shellv2` page with xterm.js.
- Add `/shellv2/ws` dummy backend route.
- Fix WASM build dependencies in `eldritch` libraries.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…completion

- Add `HeadlessRepl` struct to `eldritch-wasm` with input buffering and fake library bindings for completion.
- Create `HeadlessWasmAdapter` in frontend to bridge WASM and WebSocket.
- Implement `/shellv2` page using xterm.js with support for indentation (Tab key) and autocompletion display.
- Add dummy backend route `/shellv2/ws` in `tavern` for echo testing.
- Update build scripts to deploy WASM artifacts to public assets.
- Fix dependencies in `eldritch` libraries for WASM compatibility.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
@KCarretto KCarretto marked this pull request as ready for review February 16, 2026 16:18
@KCarretto KCarretto merged commit 641ff17 into feat/shellv2 Feb 16, 2026
@KCarretto KCarretto deleted the headless-repl-poc-10486277652285760486 branch February 16, 2026 16:18
github-merge-queue bot pushed a commit that referenced this pull request Feb 17, 2026
* Implement Headless REPL Architecture with WASM and Shell V2 UI (#1811)

* Implement Headless REPL Architecture with WASM and Shell V2 UI

- Add `HeadlessRepl` to `eldritch-wasm` for input buffering and parsing.
- Create `headless-adapter.ts` for frontend WASM/WebSocket integration.
- Implement `/shellv2` page with xterm.js.
- Add `/shellv2/ws` dummy backend route.
- Fix WASM build dependencies in `eldritch` libraries.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Implement Headless REPL with WASM, Shell V2 UI, Indentation, and Autocompletion

- Add `HeadlessRepl` struct to `eldritch-wasm` with input buffering and fake library bindings for completion.
- Create `HeadlessWasmAdapter` in frontend to bridge WASM and WebSocket.
- Implement `/shellv2` page using xterm.js with support for indentation (Tab key) and autocompletion display.
- Add dummy backend route `/shellv2/ws` in `tavern` for echo testing.
- Update build scripts to deploy WASM artifacts to public assets.
- Fix dependencies in `eldritch` libraries for WASM compatibility.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Enhance Shell V2 with completion, history search, and robust input handling (#1816)

* Implement enhanced Shell V2 features: completion dropdown, history search, and resizing

- Frontend:
    - Added `xterm-addon-fit` for responsive terminal resizing.
    - Implemented shell state management (input buffer, cursor, history).
    - Added key bindings: Ctrl+C (reset), Ctrl+L (clear), Ctrl+A/E (home/end), Ctrl+U/W (delete line/word).
    - Implemented Tab completion with a custom dropdown UI overlay.
    - Implemented Ctrl+R for basic reverse history search.
    - Updated `HeadlessWasmAdapter` to support `reset()` and structured completion results.

- Backend (`eldritch-wasm`):
    - Added `HeadlessRepl::reset()` to clear the internal buffer.
    - Updated `HeadlessRepl::complete()` to return `{ suggestions: [...], start: usize }` instead of a flat list, enabling correct inline replacement.
    - Added tests for reset and completion structure.
    - Rebuilt WASM artifacts with `fake_bindings` feature.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Fix Shell V2 cursor flicker, tab indent, and function termination

- **Cursor Flicker:** Optimized `redrawLine` to avoid clearing the entire line (including prompt) and rewrite only the input buffer using `\r` + content + `\x1b[K`. Added fast-path logic in `onData` for appending characters or backspacing at the end of the line, bypassing `redrawLine` entirely for the most common typing scenarios.
- **Tab Indenting:** Updated Tab handler to insert 4 spaces if the input buffer is empty or consists only of whitespace, enabling standard indentation behavior.
- **Function Termination:** Ensured `state.prompt` is reset to `>>> ` when a command returns `"complete"` status, fixing an issue where the prompt would remain `.. ` after finishing a multi-line function definition.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* feat(shellv2): improve REPL history, autocomplete and redraw (#1817)

- Fix duplicated prompt on Ctrl+L by using explicit ANSI clear+home sequence.
- Implement multi-line history support by accumulating input blocks until complete.
- Improve autocomplete: trigger on '.', allow typing while open, and fix looping index.
- Refactor redrawLine to support multi-line buffers.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* Fix ShellV2 REPL: reverse search, indentation, and scrolling (#1819)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>

* default font size and rebuild

* slight cleanup

* npm run build

* cargo fmt

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
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