rails-informant 0.6.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 905f71f9e86e6c982710d2c1dbd8471218798e1cfa80b8baca78124180a1fef3
4
- data.tar.gz: 9cc699035012351e2bfe4b0423c2b7fe0bffd7880f05250d2d54f758bf2d50ea
3
+ metadata.gz: 69a62b35d2fcbee6378fff16208c4f1091f87c44ffd41baa638f59a42d4caefd
4
+ data.tar.gz: 97ecbe4eb82e39be5b42c42b6bb50d257d157eb507201bde373bca8e477222d2
5
5
  SHA512:
6
- metadata.gz: b103c2f10d32404883a51e7d9ef82daf0dda368bd7ec50165d32f88b9b9d53924aeb6264af9c4e7f10468d6abe891228a62e7e09c2584a74a0d469a619cf9dd5
7
- data.tar.gz: fad95e73c07500480d703c2018e5eeeef77656f0cd16aced9b8e778d90c700a450b1f2963c54f093b76fc2b501a013148b2afb18bef81b8eeed399db1bd5d96c
6
+ metadata.gz: fe94a07f7029f360b1517c2ce8f3b0b2a27872ce08ba5d6a5c9a631030e53865ad58fd1a289b67d61db66ad650c22c21b5863b8628103c568c92a5f5a0730a4e
7
+ data.tar.gz: f5356e08df971271b046a8f5a7387a3219b53fe64b3090ab63a9a89f3f1c7b1c2246f5dcd1b62ff107a25c3ca4b47fbf09a3feb4c4964e56b25a9994f17af0d4
data/README.md CHANGED
@@ -199,6 +199,12 @@ The bundled `informant-mcp` executable connects Claude Code to your error data v
199
199
 
200
200
  The `rails_informant:skill` generator creates `.mcp.json` automatically. Set `INFORMANT_PRODUCTION_URL` and `INFORMANT_PRODUCTION_TOKEN` as environment variables (e.g., via `.envrc` + direnv).
201
201
 
202
+ `informant-mcp` reads these variables when it starts, so a Claude Code session started without them loaded crashes the server on boot. To load `.envrc` on every start, launch the server through direnv. The generator and `informant:doctor` both accept this entry:
203
+
204
+ ```json
205
+ "informant": { "command": "direnv", "args": ["exec", ".", "informant-mcp"] }
206
+ ```
207
+
202
208
  For multi-environment setups, add env vars for each environment:
203
209
 
204
210
  ```bash
@@ -25,7 +25,9 @@ module RailsInformant
25
25
  if File.exist?(mcp_path)
26
26
  existing = JSON.parse(File.read(mcp_path))
27
27
  existing["mcpServers"] ||= {}
28
- existing["mcpServers"]["informant"] = Content.mcp_entry
28
+ unless Content.accepted_mcp_entries.include?(existing["mcpServers"]["informant"])
29
+ existing["mcpServers"]["informant"] = Content.mcp_entry
30
+ end
29
31
  create_file ".mcp.json", JSON.pretty_generate(existing) + "\n", force: true
30
32
  else
31
33
  create_file ".mcp.json", JSON.pretty_generate(
@@ -65,6 +65,13 @@ module RailsInformant
65
65
  { "command" => "informant-mcp" }
66
66
  end
67
67
 
68
+ # Entries an app may keep in place of mcp_entry. The direnv form loads the
69
+ # app's .envrc first: informant-mcp reads its URL and token at startup, so a
70
+ # session started without the .envrc loaded crashes it on boot.
71
+ def accepted_mcp_entries
72
+ [ mcp_entry, { "command" => "direnv", "args" => [ "exec", ".", "informant-mcp" ] } ]
73
+ end
74
+
68
75
  # A single UserPromptSubmit hook registration for settings.json.
69
76
  def hook_registration
70
77
  {
@@ -126,7 +126,7 @@ module RailsInformant
126
126
  "hook" => normalize_text(read_or_empty(hook_path)),
127
127
  "skill" => @hyperdrive_managed ? "" : normalize_text(read_or_empty(skill_path)),
128
128
  "settings" => canonical_json(live_settings_registrations || {}),
129
- "mcp" => canonical_json(live_mcp_entry || {})
129
+ "mcp" => canonical_json(Content.accepted_mcp_entries.include?(live_mcp_entry) ? Content.mcp_entry : live_mcp_entry || {})
130
130
  )
131
131
  end
132
132
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-informant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel López Prat