Skip to content

1.30.0: embeddable interactive-shell controller + web-barrel shell helpers#78

Merged
gmpassos merged 2 commits into
masterfrom
web-barrel-shell-integration
Jun 28, 2026
Merged

1.30.0: embeddable interactive-shell controller + web-barrel shell helpers#78
gmpassos merged 2 commits into
masterfrom
web-barrel-shell-integration

Conversation

@gmpassos

@gmpassos gmpassos commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary (1.30.0)

Two related changes that let a browser client drive an interactive shell exactly like the CLI, and remove the duplicated orchestration:

1. InteractiveShellController — embeddable interactive shell

OmnyShell runs the remote shell as a pipe (no PTY): no prompt, no echo, no completion signal. The CLI's connect loop supplies that protocol layer, and the web client had to re-implement it. This extracts it into a reusable, terminal-agnostic, pure-Dart controller:

  • Runs over a narrow ShellSessionPort that RemoteSession implements directly.
  • Owns prompt priming, command wrapping via ShellDialect (CwdMarker tail, full vs ping by mayChangeCwdOrGit), marker-stripping + cwd/git tracking, send-window grants, raw passthrough, and resume-into-alt-screen.
  • Calls back to the host (onOutput/onStderr/onPrompt/onPassthrough/onExit) for line editing and prompt rendering — the parts that genuinely differ per embedder.
  • Exported from both omnyshell_client.dart and omnyshell_client_web.dart (browser-safe).

The CLI's _runInteractiveSession now delegates its protocol core to the controller, keeping only terminal/dart:io concerns (line editor, history, tab-completion, local : commands, raw-mode, SIGWINCH/SIGINT, welcome/closure). stderr stays on fd 2 via the separate onStderr callback; behaviour is unchanged. Unit-tested with an in-memory fake port.

2. Web-barrel shell-integration exports

omnyshell_client_web.dart also exports CwdMarker, ShellDialect, and the command classifiers — the primitives the controller builds on. Importing these from src/ directly forced the dev compiler (DDC) to pull the package's dart:io modules and skip the browser entrypoint; routing through the public web barrel keeps the browser build clean.

Verification

  • dart analyze --fatal-infos --fatal-warnings . + dart format — clean.
  • dart test — all 489 tests pass (incl. the new controller unit tests).
  • dart compile js of an entrypoint importing the controller via the web barrel — no dart:io.
  • Downstream: the OmnyShell web client adopts the controller; its webdev serve (DDC) compiles the entrypoint and the live terminal works against a real hub.

Additive (no breaking changes). Ships as 1.30.0.

🤖 Generated with Claude Code

gmpassos and others added 2 commits June 28, 2026 01:12
Add CwdMarker, ShellDialect, and the command classifiers
(mayChangeCwdOrGit, launchesForegroundProgram) to omnyshell_client_web.dart.

These pure-Dart helpers let a browser client drive a pipe-mode shell (prompt,
local echo, marker-based completion) reusing the exact logic the CLI uses.
Importing them from src/ directly forced the dev compiler (DDC) to pull the
package's dart:io modules, breaking `webdev serve`; routing through the public
web barrel keeps the browser build clean.

Bump to 1.30.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the interactive-shell orchestration into a reusable, terminal-agnostic
controller so the CLI and embedders (the web client) share one implementation
instead of duplicating it.

- Add ShellSessionPort (the narrow session surface RemoteSession implements) and
  InteractiveShellController: prompt priming, command wrapping via ShellDialect,
  CwdMarker completion/cwd tracking, send-window grants, raw passthrough, and
  resume-into-alt-screen — calling back to the host (onOutput/onStderr/onPrompt/
  onPassthrough) for line editing and prompt rendering. Pure Dart (browser-safe);
  exported from both omnyshell_client.dart and omnyshell_client_web.dart.
- Refactor the CLI's _runInteractiveSession to delegate this protocol core to the
  controller, keeping only terminal/dart:io concerns (line editor, history,
  tab-completion, local : commands, raw-mode, SIGWINCH/SIGINT, welcome). stderr
  stays on fd 2 via the separate onStderr callback; behaviour is unchanged.
- Unit-test the controller with an in-memory fake port.

Ships in 1.30.0 alongside the web-barrel shell-integration exports.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gmpassos gmpassos changed the title Export shell-integration helpers from the web barrel (1.30.0) 1.30.0: embeddable interactive-shell controller + web-barrel shell helpers Jun 28, 2026
@gmpassos gmpassos merged commit ad5e0dc into master Jun 28, 2026
5 checks passed
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