Visitar URL original
GitHub - yorzi/openui-rails: Unofficial Rails integration for Thesys OpenUI Lang, with streaming interfaces and server-owned actions. · GitHub
Skip to content

About

Unofficial Rails integration for Thesys OpenUI Lang, with streaming interfaces and server-owned actions.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

78 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openui-rails

CI

Render streaming, interactive OpenUI Lang interfaces inside an existing Rails application. Use Rails views and Stimulus to mount the official browser runtime; keep authentication, authorization, and persistence in Rails.

Unofficial integration: this project is not affiliated with or maintained by Thesys. It uses the OpenUI JavaScript runtime and does not implement a Ruby parser or renderer.

Documentation · RubyGems · Roadmap

What you get

  • A view helper and Stimulus bridge for rendering server-owned surfaces.
  • A shared library fingerprint for the prompt, browser runtime, and stored UI.
  • Ordered stream envelopes with gap detection over Turbo Streams or Action Cable.
  • One allowlisted action endpoint with authorization, validation, and replay protection.
  • An optional RubyLLM streaming adapter.

Your app supplies scoped record lookup, stream subscriptions, and snapshot recovery. Multi-process apps can opt into the SQLite shared idempotency store.

Get started

Requires Ruby 3.2+ and Rails 8.0 or 8.1. On Rails 8.0, use json < 3. The runtime-fetch task also needs npm. RubyLLM is optional.

# Gemfile
gem "openui-rails", "~> 0.9.1"
bundle install
bin/rails generate openui:install
bin/rails openui:runtime:fetch
bin/rails openui:library:prepare
bin/rails openui:doctor

Follow Getting Started to register the Stimulus controllers and include the stylesheet. After setup, render a surface from an ERB view:

<%= openui_surface(
  surface: { id: "support-42", response: 'root = TextContent("How can I help?")' },
  label: "Support"
) %>

Actions are denied until you configure authorization.

Documentation and development

The documentation site contains the full guides and API reference:

Version 0.9.1 improves the demo, CSP, keyboard checks, and host qualification without changing the public gem API or pinned runtime. See What's New for the upgrade and Supported API for the compatibility boundary. The API may change during 0.x; see the changelog and the proposed path to 1.0. The site's stable channel follows the latest release; /next/ follows main.

For repository work, use Contributing, Releasing, and the 0.9.1 release record. Run the disposable demo with bin/demo --runtime tmp/real-runtime after the runtime setup in Development. Report vulnerabilities through the security policy.

License

MIT. See third-party notices before redistributing the OpenUI browser bundle.

About

Unofficial Rails integration for Thesys OpenUI Lang, with streaming interfaces and server-owned actions.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages