rails-agent-stack 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83dde44cc5a68ee22c237736bd5992f64baf5b474e1ef7e3615244277988060f
4
- data.tar.gz: 407a7cc7dc2fdde847babc4e948f38f7028d8121bb3142a9804058c366fcb58d
3
+ metadata.gz: 0f5d7de33618df03c5ebbe49d571eee86e3b50da10077791ae70538ff617bcd0
4
+ data.tar.gz: b9763bf309ff5aba6d98db8e59325d4520521f26f4ea46eb0d2fcb0a9e560581
5
5
  SHA512:
6
- metadata.gz: 520d19cb9bee5584270474f80b77518b99f81f4cec77c8d03603716dae2ef988007cf5b5474fb0150369aba473f6a00cfd1301259238fb8e267412bad36ff8e4
7
- data.tar.gz: ccfacfe644d0facb1b2730b90c5877cecdde11c06b5d471a6ae5aa7d24cf48464a0aacae36e5ea5d362df8b1051e95702048d0a8bf42e2ed83c253968d833d71
6
+ metadata.gz: 0f5cfb786c36d73e5462922f62c3df17b01e350d5a0bc4ac434d4e7e47565c2fe6291ec55880e5efe479961329735bee8802867dd49e1399462abe7c0a05806b
7
+ data.tar.gz: 5ba805a6d684e768df713012bc573c2a54c014925dc3ceec9eb6d340b94ebf44fce0e3a71379dcc1faec40629839db57cf906ecf3da78d696ae7b27029701785
@@ -4,10 +4,10 @@
4
4
  |----------|---------|---------|
5
5
  | `ci.yml` | push/PR to `main` | RSpec + gem build |
6
6
 
7
- This repo is the **Ruby gem** (`rails-agent-stack`). It has **no Hetzner deploy** — customers install from GitHub:
7
+ This repo is the **Ruby gem** (`rails-agent-stack`). It has **no Hetzner deploy** — customers install from [RubyGems](https://rubygems.org/gems/rails-agent-stack):
8
8
 
9
9
  ```ruby
10
- gem "rails-agent-stack", github: "Tiny-Bubble-Company/rails-agents"
10
+ gem "rails-agent-stack", "~> 0.1"
11
11
  ```
12
12
 
13
13
  Production sites deploy from sibling repos:
data/.gitignore CHANGED
@@ -6,3 +6,15 @@
6
6
  /.rspec_status
7
7
  *.gem
8
8
  .DS_Store
9
+
10
+ # Secrets & local credentials (never commit)
11
+ .env
12
+ .env.*
13
+ !.env.example
14
+ config/master.key
15
+ config/credentials.yml
16
+ config/credentials/*.key
17
+ config/rails_agents_credentials.yml
18
+ *.pem
19
+ id_rsa*
20
+ secrets.json
data/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to `rails-agent-stack` will be documented in this file.
4
4
 
5
- ## [0.2.0] - Unreleased
5
+ ## [0.2.0] - 2026-08-03
6
6
 
7
7
  ### Changed
8
8
 
@@ -12,11 +12,16 @@ All notable changes to `rails-agent-stack` will be documented in this file.
12
12
  - Generator `--type` and `--database` for database-connected Knowledge agents.
13
13
  - Company subscription + pass-through usage + 1% service fee pricing model.
14
14
  - Deprecated cloud pull bridge in embed UI; `rails-agents pull` retained for compatibility.
15
+ - **Rails support widened to 6.1+** (was 7.0+). Compatibility shims for redirects, CSRF,
16
+ Zeitwerk ignore, `module_parent_name`, and database configs.
17
+ - Gem authors attributed to Tiny Bubble Company (`support@rails-agent.com`).
15
18
 
16
19
  ### Added
17
20
 
18
21
  - `KnowledgeAgent`, `OperationsAgent`, and `MonitoringAgent` classes; the legacy output-focused class remains loadable for compatibility.
19
22
  - `docs/AGENTS.md` canonical guide for external coding agents.
23
+ - `docs/RAILS_SUPPORT.md` — supported versions and upgrade/sidecar guidance for Rails 3–5 apps.
24
+ - `RailsAgents::Compat` helpers for cross-version engine behavior.
20
25
 
21
26
  ## [0.1.1] - 2026-08-02
22
27
 
data/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  <a href="https://rails-agent.com"><img src="https://img.shields.io/badge/rails--agent.com-docs-C2410C?style=flat-square" alt="Docs" /></a>
16
16
  <a href="https://github.com/Tiny-Bubble-Company/rails-agents"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT" /></a>
17
17
  <a href="https://rails-agent.com/docs/getting-started"><img src="https://img.shields.io/badge/Ruby-3.2%2B-CC342D?style=flat-square&logo=ruby&logoColor=white" alt="Ruby 3.2+" /></a>
18
- <a href="https://rails-agent.com/docs/getting-started"><img src="https://img.shields.io/badge/Rails-7%2B-D30001?style=flat-square&logo=rubyonrails&logoColor=white" alt="Rails 7+" /></a>
18
+ <a href="docs/RAILS_SUPPORT.md"><img src="https://img.shields.io/badge/Rails-6.1%2B-D30001?style=flat-square&logo=rubyonrails&logoColor=white" alt="Rails 6.1+" /></a>
19
19
  </p>
20
20
 
21
21
  <p align="center">
@@ -95,7 +95,7 @@ Positioning in one line: **most advanced agentic platform for Ruby on Rails**
95
95
 
96
96
  ```ruby
97
97
  # Gemfile
98
- gem "rails-agent-stack", github: "Tiny-Bubble-Company/rails-agents"
98
+ gem "rails-agent-stack", "~> 0.2"
99
99
  ```
100
100
 
101
101
  ```bash
@@ -19,7 +19,7 @@ module RailsAgents
19
19
  end
20
20
 
21
21
  def cloud_redirect(path)
22
- redirect_to dashboard_url(path), allow_other_host: true
22
+ redirect_to dashboard_url(path), **RailsAgents::Compat.redirect_options
23
23
  end
24
24
  end
25
25
  end
@@ -16,7 +16,7 @@ module RailsAgents
16
16
 
17
17
  email = params.require(:email).to_s.strip
18
18
  password = params.require(:password).to_s
19
- workspace = params[:workspace].presence || (defined?(Rails) ? Rails.application.class.module_parent_name : "App")
19
+ workspace = params[:workspace].presence || (defined?(Rails) ? RailsAgents::Compat.application_name : "App")
20
20
 
21
21
  response = Client.new.handshake(
22
22
  email: email,
@@ -12,7 +12,7 @@ module RailsAgents
12
12
  # Resolves agent via:
13
13
  # ?agent=order_notification OR JSON meta / installation mapping in channels/*.yml
14
14
  class OpenWireInboundController < ApplicationController
15
- skip_forgery_protection
15
+ RailsAgents::Compat.skip_csrf!(self)
16
16
 
17
17
  def create
18
18
  slug = resolve_agent_slug
@@ -90,7 +90,9 @@ module RailsAgents
90
90
  private
91
91
 
92
92
  def default_workspace
93
- (Rails.application.class.module_parent_name rescue "MyApp")
93
+ RailsAgents::Compat.application_name
94
+ rescue StandardError
95
+ "MyApp"
94
96
  end
95
97
  end
96
98
  end
@@ -25,14 +25,7 @@ module RailsAgents
25
25
  def configured_databases
26
26
  configs = []
27
27
  if defined?(ActiveRecord::Base)
28
- ActiveRecord::Base.configurations.configs_for(env_name: Rails.env).each do |db|
29
- configs << {
30
- name: db.name.to_s,
31
- adapter: normalize_adapter(db.adapter),
32
- raw_adapter: db.adapter.to_s,
33
- source: "config/database.yml"
34
- }
35
- end
28
+ configs.concat(active_record_database_configs)
36
29
  end
37
30
  if Rails.root.join("config/mongoid.yml").exist?
38
31
  configs << {
@@ -47,6 +40,33 @@ module RailsAgents
47
40
  []
48
41
  end
49
42
 
43
+ def active_record_database_configs
44
+ configurations = ActiveRecord::Base.configurations
45
+ if configurations.respond_to?(:configs_for)
46
+ configurations.configs_for(env_name: Rails.env).map do |db|
47
+ {
48
+ name: (db.respond_to?(:name) ? db.name : "primary").to_s,
49
+ adapter: normalize_adapter(db.adapter),
50
+ raw_adapter: db.adapter.to_s,
51
+ source: "config/database.yml"
52
+ }
53
+ end
54
+ else
55
+ # Rails < 6.0 Hash-style configurations fallback
56
+ entry = configurations[Rails.env]
57
+ entry = entry["primary"] || entry.values.first if entry.is_a?(Hash) && entry.values.first.is_a?(Hash)
58
+ adapter = entry.is_a?(Hash) ? (entry["adapter"] || entry[:adapter]) : nil
59
+ [{
60
+ name: "primary",
61
+ adapter: normalize_adapter(adapter),
62
+ raw_adapter: adapter.to_s,
63
+ source: "config/database.yml"
64
+ }]
65
+ end
66
+ rescue StandardError
67
+ []
68
+ end
69
+
50
70
  def active_record_tables
51
71
  return [] unless defined?(ActiveRecord::Base)
52
72
 
@@ -70,7 +70,7 @@ module RailsAgents
70
70
  def destroy
71
71
  cloud = RailsAgents.config.dashboard_base.to_s.chomp("/")
72
72
  cloud = "https://cloud.rails-agent.com" if cloud.blank?
73
- redirect_to "#{cloud}/signin", allow_other_host: true
73
+ redirect_to "#{cloud}/signin", **RailsAgents::Compat.redirect_options
74
74
  end
75
75
  end
76
76
  end
@@ -7,7 +7,7 @@ require "uri"
7
7
 
8
8
  module RailsAgents
9
9
  class ToolBridgeController < ApplicationController
10
- skip_forgery_protection
10
+ RailsAgents::Compat.skip_csrf!(self)
11
11
 
12
12
  def create
13
13
  return render json: { error: "Unauthorized" }, status: :unauthorized unless authorized_runtime?
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  @step ||= :email
3
- @workspace ||= (Rails.application.class.module_parent_name rescue "MyApp")
3
+ @workspace ||= RailsAgents::Compat.application_name
4
4
  @github_url ||= "#"
5
5
  %>
6
6
  <div class="rails-agents-connect">
@@ -0,0 +1,55 @@
1
+ # Rails version support
2
+
3
+ ## Supported
4
+
5
+ | Rails | Status |
6
+ |-------|--------|
7
+ | **8.x** | Fully supported |
8
+ | **7.x** | Fully supported |
9
+ | **6.1** | Supported (compatibility shims) |
10
+ | 6.0 | Best-effort (upgrade to 6.1+ recommended) |
11
+ | 5.x and older | **Not supported** — see below |
12
+
13
+ | Ruby | Status |
14
+ |------|--------|
15
+ | **3.2+** | Required |
16
+ | 3.1 and older | Not supported (open-wire and modern MRI tooling require 3.2+) |
17
+
18
+ `rails-agent-stack` is a mountable Rails engine with Zeitwerk-aware installers,
19
+ cloud sync, and channel webhooks. Those APIs exist from Rails 6.1 onward.
20
+
21
+ ## Why not Rails 3–5?
22
+
23
+ Apps from ~2009 often run Rails 3–5 on Ruby 1.8–2.7. This gem targets **Ruby 3.2+**,
24
+ which those stacks never ran. Supporting Rails 3 would mean a separate legacy
25
+ product (different gem, different Ruby), not a shim inside this engine.
26
+
27
+ ## Older apps (Rails 3–5): two practical paths
28
+
29
+ ### 1. Upgrade the host app (recommended)
30
+
31
+ Bring the app to **Rails 6.1+ / Ruby 3.2+** (or Rails 7/8), then:
32
+
33
+ ```ruby
34
+ gem "rails-agent-stack", "~> 0.2"
35
+ ```
36
+
37
+ ```bash
38
+ bundle install
39
+ bin/rails generate rails_agents:install
40
+ ```
41
+
42
+ ### 2. Sidecar modern Rails app
43
+
44
+ Keep the legacy app as-is. Create a small Rails 7/8 app (same database, or
45
+ API/DB views into the legacy data), install `rails-agent-stack` there, and expose
46
+ agents via channels/API. The legacy app stays on its old Rails; the agent
47
+ runtime stays modern.
48
+
49
+ ## Checking your version
50
+
51
+ ```bash
52
+ bin/rails runner 'puts "Rails #{Rails.version} / Ruby #{RUBY_VERSION}"'
53
+ ```
54
+
55
+ Need help choosing a path? Email [support@rails-agent.com](mailto:support@rails-agent.com).
Binary file
@@ -1,4 +1,4 @@
1
- # AGENTS.md — <%= Rails.application.class.module_parent_name rescue "YourApp" %>
1
+ # AGENTS.md — <%= (RailsAgents::Compat.application_name rescue "YourApp") %>
2
2
 
3
3
  Project guide for external coding agents. Platform docs: [rails-agents/docs/AGENTS.md](https://github.com/Tiny-Bubble-Company/rails-agents/blob/main/docs/AGENTS.md)
4
4
 
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Prevents Zeitwerk from treating agent definitions and shared assets as normal
3
+ # Prevent Zeitwerk from treating agent definitions and shared assets as normal
4
4
  # application namespaces. Agents load through the Rails Agent runtime.
5
+ # Rails 6.0+ / Zeitwerk only — skipped safely on classic autoloaders.
5
6
  Rails.application.configure do
6
7
  config.before_configuration do
7
- Rails.autoloaders.main.ignore(Rails.root.join("app/agents"))
8
- Rails.autoloaders.main.ignore(Rails.root.join("app/agents_library"))
8
+ if defined?(Rails.autoloaders) && Rails.autoloaders.respond_to?(:main) && Rails.autoloaders.main
9
+ Rails.autoloaders.main.ignore(Rails.root.join("app/agents"))
10
+ Rails.autoloaders.main.ignore(Rails.root.join("app/agents_library"))
11
+ end
9
12
  end
10
13
  end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAgents
4
+ # Compatibility helpers so the engine can run on Rails 6.1+ (and 7/8).
5
+ # Rails 3–5 are not supported: they cannot run on Ruby 3.2+, which this gem requires.
6
+ module Compat
7
+ module_function
8
+
9
+ def rails_major
10
+ ::Rails::VERSION::MAJOR
11
+ rescue StandardError
12
+ 0
13
+ end
14
+
15
+ def rails_minor
16
+ ::Rails::VERSION::MINOR
17
+ rescue StandardError
18
+ 0
19
+ end
20
+
21
+ def at_least?(major, minor = 0)
22
+ rails_major > major || (rails_major == major && rails_minor >= minor)
23
+ end
24
+
25
+ def zeitwerk?
26
+ defined?(::Rails) &&
27
+ ::Rails.respond_to?(:autoloaders) &&
28
+ ::Rails.autoloaders.respond_to?(:main) &&
29
+ ::Rails.autoloaders.main
30
+ end
31
+
32
+ def application_name
33
+ return "App" unless defined?(::Rails)
34
+
35
+ klass = ::Rails.application.class
36
+ if klass.respond_to?(:module_parent_name)
37
+ klass.module_parent_name
38
+ elsif klass.respond_to?(:parent_name)
39
+ klass.parent_name
40
+ else
41
+ klass.name.to_s.split("::").first
42
+ end
43
+ rescue StandardError
44
+ "App"
45
+ end
46
+
47
+ # Rails 7+ open-redirect protection requires allow_other_host: true.
48
+ def redirect_options
49
+ at_least?(7, 0) ? { allow_other_host: true } : {}
50
+ end
51
+
52
+ def skip_csrf!(controller_class)
53
+ if controller_class.respond_to?(:skip_forgery_protection)
54
+ controller_class.skip_forgery_protection
55
+ elsif controller_class.respond_to?(:skip_before_action)
56
+ controller_class.skip_before_action :verify_authenticity_token, raise: false
57
+ end
58
+ end
59
+ end
60
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAgents
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/rails_agents.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rails_agents/version"
4
+ require "rails_agents/compat"
4
5
  require "rails_agents/configuration"
5
6
  require "rails_agents/client"
6
7
  require "rails_agents/credentials_writer"
@@ -5,8 +5,8 @@ require_relative "lib/rails_agents/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rails-agent-stack"
7
7
  spec.version = RailsAgents::VERSION
8
- spec.authors = ["Rails Agent Team"]
9
- spec.email = ["hello@railsagents.dev"]
8
+ spec.authors = ["Tiny Bubble Company"]
9
+ spec.email = ["support@rails-agent.com"]
10
10
 
11
11
  spec.summary = "Rails AI agents framework — fullstack Ruby on Rails agents " \
12
12
  "(ActiveAgent / RubyLLM alternative)."
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.executables = ["rails-agents"]
40
40
  spec.require_paths = ["lib"]
41
41
 
42
- spec.add_dependency "railties", ">= 7.0"
42
+ spec.add_dependency "railties", ">= 6.1"
43
43
  spec.add_dependency "thor", "~> 1.3"
44
44
  spec.add_dependency "open-wire", "~> 0.1"
45
45
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+ require "rails_agents/compat"
5
+
6
+ RSpec.describe RailsAgents::Compat do
7
+ describe ".redirect_options" do
8
+ it "includes allow_other_host on Rails 7+" do
9
+ allow(described_class).to receive(:at_least?).with(7, 0).and_return(true)
10
+ expect(described_class.redirect_options).to eq(allow_other_host: true)
11
+ end
12
+
13
+ it "is empty on Rails 6.1" do
14
+ allow(described_class).to receive(:at_least?).with(7, 0).and_return(false)
15
+ expect(described_class.redirect_options).to eq({})
16
+ end
17
+ end
18
+
19
+ describe ".application_name" do
20
+ it "returns a string" do
21
+ expect(described_class.application_name).to be_a(String)
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-agent-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Rails Agent Team
7
+ - Tiny Bubble Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-02 00:00:00.000000000 Z
11
+ date: 2026-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '7.0'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +101,7 @@ description: Rails Agent is the most advanced agentic platform for Ruby on Rails
101
101
  Rails agent framework and better alternative to RubyLLM and ActiveAgent for fullstack
102
102
  Rails AI agents.
103
103
  email:
104
- - hello@railsagents.dev
104
+ - support@rails-agent.com
105
105
  executables:
106
106
  - rails-agents
107
107
  extensions: []
@@ -138,6 +138,8 @@ files:
138
138
  - config/routes.rb
139
139
  - docs/AGENTS.md
140
140
  - docs/PRD.md
141
+ - docs/RAILS_SUPPORT.md
142
+ - docs/assets/azure-bot-logo.png
141
143
  - docs/assets/hero-banner.png
142
144
  - examples/support/agent.rb
143
145
  - examples/support/channels/.keep
@@ -171,6 +173,7 @@ files:
171
173
  - lib/rails_agents/chat_agent.rb
172
174
  - lib/rails_agents/cli.rb
173
175
  - lib/rails_agents/client.rb
176
+ - lib/rails_agents/compat.rb
174
177
  - lib/rails_agents/configuration.rb
175
178
  - lib/rails_agents/creation_agent.rb
176
179
  - lib/rails_agents/credentials_writer.rb
@@ -191,6 +194,7 @@ files:
191
194
  - spec/generators/agent_generator_spec.rb
192
195
  - spec/rails_agents/base_spec.rb
193
196
  - spec/rails_agents/client_spec.rb
197
+ - spec/rails_agents/compat_spec.rb
194
198
  - spec/rails_agents/configuration_spec.rb
195
199
  - spec/rails_agents/library_imports_spec.rb
196
200
  - spec/rails_agents/local_sync_spec.rb