Skip to content

[alpha] Non-interactive REPL front-end changes#1822

Merged
KCarretto merged 9 commits intomainfrom
feat/shellv2
Feb 17, 2026
Merged

[alpha] Non-interactive REPL front-end changes#1822
KCarretto merged 9 commits intomainfrom
feat/shellv2

Conversation

@KCarretto
Copy link
Collaborator

Adds a new page that isn't linked to yet, configures x term and uses the WASM interpreter for smart client-side REPL features, removing reliance on running REPL features on the agent and enabling a better non-interactive (no gRPC stream) shell experience.

KCarretto and others added 6 commits February 16, 2026 11:18
* 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>
…ndling (#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>
- 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>
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>
@KCarretto KCarretto requested review from Cictrone and hulto February 17, 2026 00:31
@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2604    ±0 2604    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#999 2604 2604 0 0 0 0 23.1s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2604 0 0 5.2s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
eldritch-libsys: std::dll_inject_impl::tests::test_dll_inject_simple 1 5.2s 5.2s
TestDockerExecutor_Build_ContextCancellation 1 5.1s 5.1s
imix::bin/imix: install::tests::test_install_execution 3 1.2s 3.4s
imix::bin/imix: install::tests::test_install_execution 3 1.2s 3.4s
imix::bin/imix: install::tests::test_install_execution 3 1.2s 3.4s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_output 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_error 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_streaming_error 3 3.0s 3.0s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

Cictrone
Cictrone previously approved these changes Feb 17, 2026
@KCarretto KCarretto marked this pull request as ready for review February 17, 2026 00:40
@KCarretto KCarretto enabled auto-merge February 17, 2026 00:41
@KCarretto KCarretto added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit fc1182b Feb 17, 2026
8 checks passed
@KCarretto KCarretto deleted the feat/shellv2 branch February 17, 2026 01:00
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.

2 participants