Skip to content

Add HTTY transport support and refactor environment layer#5

Merged
ioquatix merged 6 commits into
mainfrom
feature/htty-support
May 19, 2026
Merged

Add HTTY transport support and refactor environment layer#5
ioquatix merged 6 commits into
mainfrom
feature/htty-support

Conversation

@samuel-williams-shopify
Copy link
Copy Markdown
Contributor

Summary

  • Adds Async::HTTY transport support — when ENV["HTTY"] == "1", bin/lively serves over a terminal side-channel (stdin/stdout) instead of a TCP socket, enabling tools like htty.dev to host Lively apps in the terminal.
  • Refactors the environment layer into focused modules (Middleware, HTTP, HTTY, Application) and uses the new make_service hook from async-service ~> 0.23 to multiplex transports via explicit, overridable evaluator keys rather than Module#included hooks.
  • Forces Async::Container::Threaded in bin/lively — no process forking needed for a single-user dev tool.
  • Fixes Live.js WebSocket URL scheme handling to support htty:ws: alongside the existing http:ws: mapping.
  • Fixes Lively::Assets missing require "uri" (was previously implicit via Falcon).

Test plan

  • HTTY=1 lively examples/hello-world/application.rb — verify app serves over HTTY
  • lively examples/hello-world/application.rb — verify normal Falcon path still works
  • Override transport per-service: def htty = false forces HTTP even with HTTY=1 set

Made with Cursor

samuel-williams-shopify and others added 3 commits May 19, 2026 19:29
- Add `Async::HTTY` transport support: when `ENV["HTTY"] == "1"`, the
  server runs over a terminal side-channel instead of a TCP socket.

- Refactor environment modules into focused layers:
  - `Lively::Environment::Middleware` — shared application/asset stack
  - `Lively::Environment::HTTP` — Falcon TCP transport + Middleware
  - `Lively::Environment::HTTY` — HTTY transport + Middleware
  - `Lively::Environment::Application` — multiplexes via `make_service`,
    using the new `Async::Service::Generic#make_service` hook (requires
    async-service ~> 0.23)

- Force `Async::Container::Threaded` in `bin/lively` — no forking needed
  for a single-user dev tool.

- Fix `Live.js` WebSocket URL construction to handle `htty:` scheme,
  mapping it to `ws:` alongside the existing `http:` → `ws:` mapping.

- Fix `Lively::Assets` missing `require "uri"` (was implicit via Falcon).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
samuel-williams-shopify and others added 3 commits May 19, 2026 22:00
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ioquatix ioquatix merged commit 058e01a into main May 19, 2026
22 of 28 checks passed
@ioquatix ioquatix deleted the feature/htty-support branch May 19, 2026 13:09
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