rails_ai_admin 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +33 -274
- data/lib/rails_ai_admin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15bed102b020bd05b0ab814de4ac00db0c798dc7cc6c13c901bcda7bab5fa550
|
|
4
|
+
data.tar.gz: ea4a6406be08078e1055ae73af8b7ec59a54bd674dbbab154a3fb6fee8f5f752
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eceb969a1c601d8d6a7886ad5fb72ccdf42ed4ef49c657cc078b772207bfcec31d4e64e2ae03fd1f9cd7716d8fcb8dad6bfe0c2c0da15770008405c2a6147802
|
|
7
|
+
data.tar.gz: 3d8a381a50b1228e823c3a288bc6b7a8ecba17b5bcd8128c23555c40b4c56b574b735c2cb68dd92701d7528318f92ee23b44b485490262b0d4bdfb2349fcd28b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 (2026-11-13)
|
|
4
|
+
|
|
5
|
+
- Clarify the documentation homepage and introductory guide.
|
|
6
|
+
- Add direct navigation to AI Chat, the demo, and GitHub.
|
|
7
|
+
- Use Inter for guide text and IBM Plex Mono for code examples.
|
|
8
|
+
|
|
3
9
|
## 0.1.0 (2026-11-13)
|
|
4
10
|
|
|
5
11
|
First Public Preview. Requires Ruby 3.3 or newer, Rails 8.0.5.2 or newer
|
data/README.md
CHANGED
|
@@ -1,292 +1,51 @@
|
|
|
1
1
|
# Rails AI Admin
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Rails AI Admin is a self-hosted admin engine for Rails. Give your team an admin
|
|
4
|
+
for the models you choose, then add a RubyLLM-powered assistant that can answer
|
|
5
|
+
questions about records and prepare changes for review.
|
|
5
6
|
|
|
6
|
-
**0.1.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
many-to-many `references` lists, readonly `has_many`/`has_one` panels, registered
|
|
10
|
-
field types and partials, CSV export and import, record history, the audit log,
|
|
11
|
-
dashboard metrics and trends, bulk delete, a search across resources, synchronous member operations, fixed Selection previews, bounded
|
|
12
|
-
asynchronous collection operations, opt-in admin review Surfaces and a durable
|
|
13
|
-
outbox for one declared post-commit effect. Opt-in admin Chat streams replies and
|
|
14
|
-
turns proposals into review Surfaces. An optional MCP endpoint exposes the same
|
|
15
|
-
grant-filtered tools. Native-provider verification, token and cost budgets,
|
|
16
|
-
nested and polymorphic association writes and broader job-center workflows
|
|
17
|
-
remain open. The
|
|
18
|
-
[development plan](docs/development-plan.md) describes the target product, not the
|
|
19
|
-
supported feature set.
|
|
7
|
+
**0.1.1 Public Preview** · [Documentation](https://rails-ai-admin.wangyaodi.com/) ·
|
|
8
|
+
[Quickstart](https://rails-ai-admin.wangyaodi.com/quickstart/) ·
|
|
9
|
+
[RubyGems](https://rubygems.org/gems/rails_ai_admin)
|
|
20
10
|
|
|
21
|
-
|
|
22
|
-
explicit policy mappings per resource. The host owns authentication, tenants,
|
|
23
|
-
policies and domain data. Missing context or policy grants deny access. Generic writes require a record version
|
|
24
|
-
(`lock_version`, or else `updated_at`) and the same Active Record connection pool for domain records,
|
|
25
|
-
operation receipts, audit and Work items. Resources with irreversible callback
|
|
26
|
-
effects should remain readonly until their host boundary is redesigned and tested.
|
|
11
|
+
## What you can do
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
- **Manage records.** Configure forms, associations, searchable lists, dashboards,
|
|
14
|
+
and CSV import and export for explicitly registered resources.
|
|
15
|
+
- **Keep access in your app.** Use the host's authentication, tenant scoping, and
|
|
16
|
+
policies to decide who can see records, fields, and actions. Track changes
|
|
17
|
+
with record history and an audit log.
|
|
18
|
+
- **Ask questions and review changes in chat.** The optional assistant searches
|
|
19
|
+
records using the signed-in admin's permissions. When it proposes a change,
|
|
20
|
+
a review card shows the details before a person confirms it. An optional MCP
|
|
21
|
+
endpoint exposes the same permission-checked tools.
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
public presentation template and review source/context drift with doctor. Host
|
|
36
|
-
overrides remain trusted Rails code and must preserve the execution boundary.
|
|
23
|
+
## Install in a Rails app
|
|
37
24
|
|
|
38
|
-
|
|
39
|
-
[Custom Controller and Status API](docs/site/_advanced/custom-controllers.md).
|
|
40
|
-
Scoped Access and the shared Runner preserve the execution boundary; host routes,
|
|
41
|
-
layouts and partials remain ordinary Rails. The native-session packaged consumer
|
|
42
|
-
includes an Order review workbench that shares its operation with native pages.
|
|
43
|
-
|
|
44
|
-
Link records with [Associations](docs/site/_core_features/associations.md):
|
|
45
|
-
references and child lists resolve through each target resource's own grants,
|
|
46
|
-
so an association never shows or attaches a record its policy hides.
|
|
47
|
-
|
|
48
|
-
Group, label, order or hide sidebar and Overview entries with
|
|
49
|
-
[Resource Navigation](docs/site/_core_features/resource-navigation.md). The menu
|
|
50
|
-
follows current index grants; hiding an entry changes no direct authorization.
|
|
51
|
-
|
|
52
|
-
## Develop
|
|
53
|
-
|
|
54
|
-
To see the admin before installing it anywhere, run the demo. It copies the
|
|
55
|
-
packaged session/SQLite host to `tmp/demo`, seeds sample data and serves it on
|
|
56
|
-
127.0.0.1 only; Ctrl-C stops it:
|
|
57
|
-
|
|
58
|
-
```sh
|
|
59
|
-
bin/demo --assistant # everything, incl. admin Chat and MCP against an offline fake model (no key)
|
|
60
|
-
bin/demo # everything except admin Chat and MCP
|
|
61
|
-
# then open http://127.0.0.1:3917/login and click "Sign in as Admin"
|
|
62
|
-
# Open Assistant → New conversation and send: search articles for upgrading
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Follow the [demo walkthrough](docs/site/_getting_started/demo.md#ai-chat-and-mcp)
|
|
66
|
-
to try streamed replies, record links and a change that you review in Chat.
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
bundle install
|
|
70
|
-
bundle exec rake test
|
|
71
|
-
bundle exec rake build
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
The build creates `pkg/rails_ai_admin-<version>.gem` (currently `0.1.0`); it
|
|
75
|
-
does not publish. `bundle exec rake release:check` reports release readiness, and
|
|
76
|
-
[RELEASING.md](RELEASING.md) lists the next release's open gates and procedure. The
|
|
77
|
-
[ten-minute quickstart](docs/site/_getting_started/quickstart.md) goes from an app
|
|
78
|
-
with Rails 8 sign-in to a working, policy-checked Users admin. The
|
|
79
|
-
[installation guide](docs/site/_getting_started/getting-started.md) covers other
|
|
80
|
-
hosts and adding a local build or development checkout. Then run:
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
bin/rails generate rails_ai_admin:install
|
|
84
|
-
bin/rails db:migrate
|
|
85
|
-
bin/rails generate rails_ai_admin:resource Customer
|
|
86
|
-
bin/rails rails_ai_admin:doctor
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Installation stays closed: the generated `AdminContext` returns nil and the
|
|
90
|
-
`AdminPolicyAdapter` stub denies all actions/fields. The install generator also
|
|
91
|
-
provides an unregistered `ExampleAdmin` and an anonymous HTTP test at
|
|
92
|
-
`test/rails_ai_admin/access_test.rb`. These are starting points, not a working
|
|
93
|
-
authentication integration.
|
|
94
|
-
|
|
95
|
-
The resource generator keeps only a readonly ID enabled and leaves the resource
|
|
96
|
-
unregistered. When model schema is available, it adds commented scalar field
|
|
97
|
-
suggestions for review. It does not sample records; sensitive/encrypted fields,
|
|
98
|
-
foreign keys and polymorphic type columns, STI inheritance columns,
|
|
99
|
-
`lock_version`, authority-like names such as role/permission/security_version,
|
|
100
|
-
and unsupported types are excluded from suggestions. A declared non-polymorphic
|
|
101
|
-
`belongs_to` is suggested as a commented `belongs_to` field.
|
|
102
|
-
Missing models or unavailable table metadata still leave the safe readonly scaffold.
|
|
103
|
-
Implement host authentication and explicit policies, then review fields and
|
|
104
|
-
register class-name strings in the initializer.
|
|
25
|
+
Add the gem to your Gemfile and run `bundle install`:
|
|
105
26
|
|
|
106
27
|
```ruby
|
|
107
|
-
|
|
108
|
-
config.context_adapter = "AdminContext"
|
|
109
|
-
config.authorization_adapter = "AdminPolicyAdapter"
|
|
110
|
-
config.resources = ["CustomerAdmin"]
|
|
111
|
-
end
|
|
28
|
+
gem "rails_ai_admin", "~> 0.1.1"
|
|
112
29
|
```
|
|
113
30
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
title :name
|
|
31
|
+
Requires Ruby 3.3+ and Rails 8. See the [installation guide](https://rails-ai-admin.wangyaodi.com/getting-started/)
|
|
32
|
+
for supported Rails patch versions. The [quickstart](https://rails-ai-admin.wangyaodi.com/quickstart/)
|
|
33
|
+
walks through connecting sign-in and policies, then registering your first
|
|
34
|
+
resource. Conventional admin pages work without a model provider or API key.
|
|
119
35
|
|
|
120
|
-
|
|
121
|
-
id :id
|
|
122
|
-
text :name, required: true, nullable: false,
|
|
123
|
-
searchable: :prefix, sortable: true
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
```
|
|
36
|
+
## Try the local demo
|
|
127
37
|
|
|
128
|
-
|
|
38
|
+
From a clone of this repository:
|
|
129
39
|
|
|
130
40
|
```sh
|
|
131
|
-
|
|
41
|
+
bundle install
|
|
42
|
+
bin/demo --assistant
|
|
132
43
|
```
|
|
133
44
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
report. See the [host verification guide](docs/site/_advanced/host-verification.md).
|
|
140
|
-
|
|
141
|
-
Resources can also declare named index tabs with `scopes`. Each tab needs its own
|
|
142
|
-
default-deny `named_scopes` grant and can only narrow the policy relation; see
|
|
143
|
-
the [Named Scopes guide](docs/site/_core_features/named-scopes.md). Fields can opt
|
|
144
|
-
into typed exact/range filters with `filterable:`, behind a separate default-deny
|
|
145
|
-
`:filter` field grant; see the [Typed Filters guide](docs/site/_core_features/typed-filters.md).
|
|
146
|
-
An `index` block chooses columns, a default sort, page size and an optional
|
|
147
|
-
bounded count; see the [Index Tables guide](docs/site/_core_features/index-tables.md).
|
|
148
|
-
|
|
149
|
-
The resource declaration grants no permission. See the runnable host contract
|
|
150
|
-
examples in the [configuration guide](docs/site/_getting_started/configuration.md).
|
|
151
|
-
Use one static-path engine mount whose final helper name is `rails_ai_admin`,
|
|
152
|
-
with no HTTP-verb restriction. Run installation inside the target Rails app; its
|
|
153
|
-
loaded routes are checked before writing, including drawn files and namespace
|
|
154
|
-
prefixes. Other helper names, dynamic path parameters and multiple mounts are
|
|
155
|
-
rejected. Admin CSS/ESM are
|
|
156
|
-
prebuilt in the gem, so a host does not need Node to compile them. No provider key,
|
|
157
|
-
AI table or provider call is required for conventional mode.
|
|
158
|
-
|
|
159
|
-
## Custom Operations and Follow-Up Delivery
|
|
160
|
-
|
|
161
|
-
Register a `RailsAiAdmin::Operation` on a resource for a synchronous member command.
|
|
162
|
-
Its native input form leads to input-bound preflight and a separate human
|
|
163
|
-
confirmation, using the same Runner/receipt/audit transaction as CRUD. Operation
|
|
164
|
-
inputs, committed-receipt reads and follow-up delivery have independent grants;
|
|
165
|
-
ordinary editable-field permissions do not grant them. Successful custom receipt
|
|
166
|
-
replay compares its already bound schema/input digest, not current input grants;
|
|
167
|
-
failed or changed replay input returns a generic conflict without field errors.
|
|
168
|
-
See the
|
|
169
|
-
[Operation guide](docs/site/_core_features/operations.md).
|
|
170
|
-
|
|
171
|
-
`RailsAiAdmin::Work` reuses the input DSL for post-commit delivery. Registered
|
|
172
|
-
`config.work_handlers` persist bounded payload/digest intent through
|
|
173
|
-
`context.outbox.enqueue`. Work performs one declared `context.effect(request:)`
|
|
174
|
-
using a stable downstream delivery key and a dedicated digest of its plain JSON
|
|
175
|
-
wire request. Typed values must be serialized first; normalized key collisions,
|
|
176
|
-
nonfinite floats and unsupported objects are rejected. Ordinary Active Record
|
|
177
|
-
writes in Work/effect execution are guarded, while trusted Ruby remains outside
|
|
178
|
-
a sandbox. A successful business result does not
|
|
179
|
-
mean the effect finished. Outbox auto-dispatch defaults to false; the host must
|
|
180
|
-
schedule `rails_ai_admin:work:scan` or bounded `work:drain` recovery. Optional
|
|
181
|
-
after-commit enqueue is only an accelerator.
|
|
182
|
-
|
|
183
|
-
The default exact record-version policy stops delivery after later record edits.
|
|
184
|
-
Unknown non-idempotent effects require reconciliation rather than automatic
|
|
185
|
-
retry. Leases/fencing and persistent payloads do not establish downstream
|
|
186
|
-
exactly-once execution. Read the [Durable Outbox guide](docs/site/_advanced/durable-outbox.md)
|
|
187
|
-
before enabling a real transport. Preflight's Active Record write guard is not a
|
|
188
|
-
trusted-Ruby sandbox, and operation duration checks do not hard-interrupt Ruby/SQL.
|
|
189
|
-
Global operations, CRUD handler replacement and AI/Surface dispatch remain
|
|
190
|
-
unavailable; complete release Gates remain open.
|
|
191
|
-
|
|
192
|
-
## Review Surfaces
|
|
193
|
-
|
|
194
|
-
Hosts that already use rails_tool_views can set `config.surfaces = true` and mark
|
|
195
|
-
member operations `surface: true`. A native review can then be saved as a
|
|
196
|
-
persistent Surface that confirms the same intent once, through admin-owned
|
|
197
|
-
endpoints that leave the host's rails_tool_views settings untouched. Operations
|
|
198
|
-
marked `assistant: true` can also be proposed by an assistant through the
|
|
199
|
-
on-demand `raa_propose_operation` RubyLLM tool; only the user's Surface
|
|
200
|
-
confirmation executes them. See the
|
|
201
|
-
[Review Surfaces guide](docs/site/_advanced/review-surfaces.md).
|
|
202
|
-
|
|
203
|
-
## Admin Assistant
|
|
204
|
-
|
|
205
|
-
Hosts that load ruby_llm can run `bin/rails generate rails_ai_admin:assistant`
|
|
206
|
-
and set `config.assistant = true`. The assistant reads records through each
|
|
207
|
-
admin's current grants plus a default-deny `assistant?` grant, reads audited
|
|
208
|
-
record history, and answers questions asked from a record or list page. It
|
|
209
|
-
cannot change data: a suggested create, update, delete (for resources that
|
|
210
|
-
declare `assistant_changes`) or business operation opens a review Surface with
|
|
211
|
-
before → after values, and only the person's confirmation writes it, once, as
|
|
212
|
-
that person, with a version check and an audit event. Creates are reviewed too.
|
|
213
|
-
Replies stream as they are written. With `config.mcp = true`, outside agents
|
|
214
|
-
(Claude Code, Cursor) use the same tools through an MCP endpoint under personal
|
|
215
|
-
access tokens, and their proposals wait for confirmation in the admin. Turns run in jobs through a leased inbox that
|
|
216
|
-
recovers after crashes without repeating messages. Provider settings come from
|
|
217
|
-
your own adapter, never from global RubyLLM configuration. See the
|
|
218
|
-
[Admin Assistant guide](docs/site/_advanced/admin-assistant.md).
|
|
219
|
-
|
|
220
|
-
## Fixed Selection Previews
|
|
221
|
-
|
|
222
|
-
A default-deny `export_records?` grant adds an Export CSV button for the current list
|
|
223
|
-
(same rows, columns and values as the pages; audited and bounded by `export_limit`).
|
|
224
|
-
A default-deny `view_history?` grant adds a record History page listing its audited
|
|
225
|
-
changes (fields named only when currently readable or writable).
|
|
226
|
-
|
|
227
|
-
A separate default-deny `select_records?` grant enables native index checkboxes
|
|
228
|
-
and a no-JavaScript preview of up to 100 explicit targets. `Selections::Builder`
|
|
229
|
-
captures exact canonical IDs/versions and revalidates ownership, security version,
|
|
230
|
-
expiry, resource contract and current record/field grants. Newly matching records
|
|
231
|
-
or same-count replacements cannot expand a captured manifest. Labels are freshly
|
|
232
|
-
projected; only IDs/versions/positions and parent binding metadata are persisted.
|
|
233
|
-
|
|
234
|
-
Capture is not operation approval and creates no OperationRun, business audit,
|
|
235
|
-
Work item or job. See [Fixed Selections](docs/site/_core_features/selections.md).
|
|
236
|
-
|
|
237
|
-
## Asynchronous Collection Operations
|
|
238
|
-
|
|
239
|
-
Register an `Operation` with `scope: :collection` to apply its per-record handler
|
|
240
|
-
to a fixed Selection of at most 100 targets. Native input, pure review and explicit
|
|
241
|
-
**Confirm and queue** create one approved parent with durable child intents/items;
|
|
242
|
-
admission performs no domain mutation. Each worker attempt rebuilds current host
|
|
243
|
-
authority and commits a target change, audit, receipt, optional outbox and item
|
|
244
|
-
completion in one transaction. Public member execution cannot execute child intents.
|
|
245
|
-
|
|
246
|
-
Items commit independently. Cancellation stops remaining uncommitted items and
|
|
247
|
-
preserves committed changes and their Work. Approval expiry controls admission;
|
|
248
|
-
a separate execution deadline bounds the admitted run. Job receipts use separate
|
|
249
|
-
current receipt grants; cancellation needs its own `cancel_operation?` grant.
|
|
250
|
-
The parent stores bounded typed input once, so exclude credentials and secrets.
|
|
251
|
-
|
|
252
|
-
`collection_auto_dispatch` defaults to false. The host supplies `resolve_job`, a
|
|
253
|
-
persistent queue and recurring `rails_ai_admin:collections:scan` (or bounded
|
|
254
|
-
`collections:drain`); after-commit enqueue only accelerates recovery. Read
|
|
255
|
-
[Collection Operations](docs/site/_core_features/collection-operations.md) before
|
|
256
|
-
enabling workers. All-filtered/10,000-target manifests, global operations, a full
|
|
257
|
-
job center and retention remain planned; this bounded slice does not close the
|
|
258
|
-
full roadmap or release Gates.
|
|
259
|
-
|
|
260
|
-
## Read the Contracts
|
|
261
|
-
|
|
262
|
-
- [Architecture](ARCHITECTURE.md), [public contract](docs/reference/public-contract.md)
|
|
263
|
-
and [operation semantics](docs/reference/operations.md).
|
|
264
|
-
- [Resources and fields](docs/site/_core_features/resources-and-fields.md),
|
|
265
|
-
[host verification](docs/site/_advanced/host-verification.md) and
|
|
266
|
-
[data/security boundaries](docs/site/_advanced/data-and-security.md).
|
|
267
|
-
- [Compatibility evidence](COMPATIBILITY.md), [roadmap](ROADMAP.md) and
|
|
268
|
-
[dependency integration constraints](docs/reference/dependency-contracts.md).
|
|
269
|
-
|
|
270
|
-
An independent [Devise/Pundit/PostgreSQL consumer](spec_hosts/devise_postgres)
|
|
271
|
-
exercises UUID tickets, verified tenant memberships, development reload and
|
|
272
|
-
fresh-process crash/replay using the built gem. Its Propshaft/jsbundling and
|
|
273
|
-
Sprockets/jsbundling modes are asset variants of one consumer. See the
|
|
274
|
-
[Pundit/Devise guide](docs/site/_advanced/pundit-and-devise.md) and
|
|
275
|
-
[host verification guide](docs/site/_advanced/host-verification.md). The engine
|
|
276
|
-
does not provide accounts or login routes. The fixture's separate product Chat
|
|
277
|
-
and Surface remain host-owned, beside its opt-in admin Chat.
|
|
278
|
-
|
|
279
|
-
Changing a resource's policy mapping changes its operation fingerprint. Reopen
|
|
280
|
-
existing development forms if their old intents are invalidated.
|
|
281
|
-
|
|
282
|
-
The Jekyll/RDoc site lives under `docs/site/`. Install its separate bundle, then
|
|
283
|
-
run `docs/site/bin/build.sh`. See [Releasing](RELEASING.md) for the Pages setup
|
|
284
|
-
and versioned builds.
|
|
285
|
-
|
|
286
|
-
Local automated checks and internal review do not establish production readiness,
|
|
287
|
-
independent security review, real-provider behavior or user acceptance. Release
|
|
288
|
-
gates remain in the plan; publishing requires explicit maintainer approval.
|
|
45
|
+
Open `http://127.0.0.1:3917/login`, choose **Sign in as Admin**, then select
|
|
46
|
+
**Assistant → New conversation**. Try `search articles for upgrading`, followed
|
|
47
|
+
by `set articles 1 title to Hello` to see a change review. The demo uses seeded
|
|
48
|
+
data and an offline model. Follow the [demo walkthrough](https://rails-ai-admin.wangyaodi.com/demo/)
|
|
49
|
+
for more examples.
|
|
289
50
|
|
|
290
|
-
|
|
291
|
-
[third-party notices](THIRD_PARTY_NOTICES.md). Read [SECURITY.md](SECURITY.md) before
|
|
292
|
-
reporting a vulnerability and [CONTRIBUTING.md](CONTRIBUTING.md) before contributing.
|
|
51
|
+
[MIT License](LICENSE) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
|