rails-ai-context 0.13.0 → 0.13.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/demo_script.sh +1 -1
- data/docs/GUIDE.md +4 -2
- data/lib/rails_ai_context/tools/get_model_details.rb +32 -2
- data/lib/rails_ai_context/tools/get_view.rb +3 -1
- data/lib/rails_ai_context/version.rb +1 -1
- data/server.json +2 -2
- metadata +1 -3
- data/demo.gif +0 -0
- data/docs/mcp-benchmark.mp4 +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9eb210617bf9e0de267dc49a092f8a06c26383bd3dc6ad82ecb52ed61ce08aa6
|
|
4
|
+
data.tar.gz: '08929a12848a79b58a7e5e896a8a75c1d7068f8c1fe4910d8fc6f7eb8371aeec'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0280fc9dff2714ddda17e7cc9f714e3147641bbbbe4a08f01c03515b4a847ac60acf7e68e55d0181ae768f6c8cb7fc1ac0d518b90af5ea390fd2af211d65a34b'
|
|
7
|
+
data.tar.gz: 5b5e52eacd2efac4320b633e027af67c5d72aa506c217dd7ddf64d4e969fd471122daeb2d9a0ed5fb4f2b256b65b52509a8785f783e0befb70c15fbea2bcb1c3
|
data/demo_script.sh
CHANGED
data/docs/GUIDE.md
CHANGED
|
@@ -688,6 +688,9 @@ These run by default. Fast and cover core Rails structure.
|
|
|
688
688
|
| `controllers` | Actions, filters (before/after/around with only/except), strong params methods, parent class, API controller detection, concerns. |
|
|
689
689
|
| `tests` | Test framework (rspec/minitest), factories/fixtures with locations and counts, system tests, CI config files, coverage tool, test helpers, VCR cassettes. |
|
|
690
690
|
| `migrations` | Total count, schema version, pending migrations, recent migration history with detected actions (create_table, add_column, etc.), migration statistics. |
|
|
691
|
+
| `stimulus` | Stimulus controllers with targets, values (with types), actions, outlets, classes. Extracted from JS/TS files. |
|
|
692
|
+
| `view_templates` | View file contents, partial references, Stimulus data attributes, UI pattern extraction, model field usage in partials. |
|
|
693
|
+
| `design_tokens` | Auto-detects CSS framework (Tailwind v3/v4, Bootstrap, Sass, plain CSS) and extracts design tokens from config files and built CSS. |
|
|
691
694
|
|
|
692
695
|
### Full preset (28 introspectors)
|
|
693
696
|
|
|
@@ -695,7 +698,6 @@ Includes all standard introspectors plus:
|
|
|
695
698
|
|
|
696
699
|
| Introspector | What it discovers |
|
|
697
700
|
|-------------|-------------------|
|
|
698
|
-
| `stimulus` | Stimulus controllers with targets, values (with types), actions, outlets, classes. Extracted from JS/TS files. |
|
|
699
701
|
| `views` | Layouts, templates grouped by controller, partials (per-controller and shared), helpers with methods, template engines (erb, haml, slim), view components. |
|
|
700
702
|
| `turbo` | Turbo Frames (IDs and files), Turbo Stream templates, model broadcasts (`broadcasts_to`, `broadcasts`). |
|
|
701
703
|
| `i18n` | Default locale, available locales, locale files with key counts, backend class, parse errors. |
|
|
@@ -712,7 +714,7 @@ Includes all standard introspectors plus:
|
|
|
712
714
|
| `middleware` | Custom Rack middleware in app/middleware/ with detected patterns (auth, rate limiting, tenant isolation, logging). Full middleware stack. |
|
|
713
715
|
| `engines` | Mounted Rails engines from routes.rb with paths and descriptions for 23+ known engines (Sidekiq::Web, Flipper::UI, PgHero, ActiveAdmin, etc.). |
|
|
714
716
|
| `multi_database` | Multiple databases, replicas, sharding config, model-specific `connects_to` declarations. database.yml parsing fallback. |
|
|
715
|
-
| `database_stats` | PostgreSQL approximate row counts via `pg_stat_user_tables`. Opt-in,
|
|
717
|
+
| `database_stats` | PostgreSQL approximate row counts via `pg_stat_user_tables`. **Opt-in only** — not in any preset, add manually: `config.introspectors += [:database_stats]`. |
|
|
716
718
|
|
|
717
719
|
### Enabling the full preset
|
|
718
720
|
|
|
@@ -141,15 +141,45 @@ module RailsAiContext
|
|
|
141
141
|
lines << data[:concerns].map { |c| "- #{c}" }.join("\n")
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
-
# Key instance methods
|
|
144
|
+
# Key instance methods — include signatures from source if available
|
|
145
145
|
if data[:instance_methods]&.any?
|
|
146
146
|
lines << "" << "## Key instance methods"
|
|
147
|
-
|
|
147
|
+
signatures = extract_method_signatures(name)
|
|
148
|
+
if signatures&.any?
|
|
149
|
+
signatures.first(15).each { |s| lines << "- `#{s}`" }
|
|
150
|
+
else
|
|
151
|
+
lines << data[:instance_methods].first(15).map { |m| "- `#{m}`" }.join("\n")
|
|
152
|
+
end
|
|
148
153
|
end
|
|
149
154
|
|
|
150
155
|
lines.join("\n")
|
|
151
156
|
end
|
|
152
157
|
|
|
158
|
+
# Extract public method signatures (name + params) from model source
|
|
159
|
+
private_class_method def self.extract_method_signatures(model_name)
|
|
160
|
+
path = Rails.root.join("app", "models", "#{model_name.underscore}.rb")
|
|
161
|
+
return nil unless File.exist?(path)
|
|
162
|
+
return nil if File.size(path) > MAX_MODEL_SIZE
|
|
163
|
+
|
|
164
|
+
source = File.read(path, encoding: "UTF-8", invalid: :replace, undef: :replace)
|
|
165
|
+
signatures = []
|
|
166
|
+
in_private = false
|
|
167
|
+
|
|
168
|
+
source.each_line do |line|
|
|
169
|
+
in_private = true if line.match?(/\A\s*private\s*$/)
|
|
170
|
+
next if in_private
|
|
171
|
+
|
|
172
|
+
if (match = line.match(/\A\s*def\s+((?!self\.)[\w?!]+(?:\(([^)]*)\))?)/))
|
|
173
|
+
name = match[1]
|
|
174
|
+
signatures << name unless name.start_with?("initialize")
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
signatures
|
|
179
|
+
rescue
|
|
180
|
+
nil
|
|
181
|
+
end
|
|
182
|
+
|
|
153
183
|
MAX_MODEL_SIZE = 2_000_000 # 2MB safety limit
|
|
154
184
|
|
|
155
185
|
private_class_method def self.extract_model_structure(model_name)
|
|
@@ -56,7 +56,9 @@ module RailsAiContext
|
|
|
56
56
|
ctrl_templates = templates.select { |k, _| k.start_with?("#{ctrl}/") }
|
|
57
57
|
lines << "## #{ctrl}/ (#{ctrl_templates.size} files)"
|
|
58
58
|
ctrl_templates.sort.each do |name, meta|
|
|
59
|
-
|
|
59
|
+
parts = meta[:partials]&.any? ? " renders: #{meta[:partials].join(', ')}" : ""
|
|
60
|
+
stim = meta[:stimulus]&.any? ? " stimulus: #{meta[:stimulus].join(', ')}" : ""
|
|
61
|
+
lines << "- #{File.basename(name)} (#{meta[:lines]} lines)#{parts}#{stim}"
|
|
60
62
|
end
|
|
61
63
|
lines << ""
|
|
62
64
|
end
|
data/server.json
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"url": "https://github.com/crisnahine/rails-ai-context",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.13.
|
|
10
|
+
"version": "0.13.1",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "mcpb",
|
|
14
|
-
"identifier": "https://github.com/crisnahine/rails-ai-context/releases/download/v0.13.
|
|
14
|
+
"identifier": "https://github.com/crisnahine/rails-ai-context/releases/download/v0.13.1/rails-ai-context-mcp.mcpb",
|
|
15
15
|
"fileSha256": "dd711a0ad6c4de943ae4da94eaf59a6dc9494b9d57f726e24649ed4e2f156990",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-ai-context
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- crisnahine
|
|
@@ -185,11 +185,9 @@ files:
|
|
|
185
185
|
- README.md
|
|
186
186
|
- Rakefile
|
|
187
187
|
- SECURITY.md
|
|
188
|
-
- demo.gif
|
|
189
188
|
- demo.tape
|
|
190
189
|
- demo_script.sh
|
|
191
190
|
- docs/GUIDE.md
|
|
192
|
-
- docs/mcp-benchmark.mp4
|
|
193
191
|
- docs/token-comparison.jpeg
|
|
194
192
|
- exe/rails-ai-context
|
|
195
193
|
- lib/generators/rails_ai_context/install/install_generator.rb
|
data/demo.gif
DELETED
|
Binary file
|
data/docs/mcp-benchmark.mp4
DELETED
|
Binary file
|