actionmcp 0.204.0 → 0.204.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/lib/action_mcp/apps/view_manifest.rb +1 -0
- data/lib/action_mcp/configuration.rb +11 -4
- data/lib/action_mcp/engine.rb +4 -18
- data/lib/action_mcp/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: e87098ac26a00a8998c10e8c11b51cb82a832e08a6566bba6a1ddc4a8075236a
|
|
4
|
+
data.tar.gz: 3a0d8e7c32add4999b52c854851581b3db20bc579ca909cecfe8f1a4e1681b46
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e242930cdfc8e155c386190faaa01acf0abcb1f03639ab41511d9349454de5f0d74a790bd0f96325cd16bb8d1f32df0cb8ec48d8d680e6fdcd0d9d1bbb7d7f6
|
|
7
|
+
data.tar.gz: 26f2cafb16cb69f115b8038fb10eda0e0fd904c41d1d2c2f302401f99b730636f46a1a9b4af1abc85dfa6f3e40297aacaa7eb2fb788544a39054210640c62a7a
|
|
@@ -52,6 +52,7 @@ module ActionMCP
|
|
|
52
52
|
# Resolves the stable URI declared by a tool to the content-addressed
|
|
53
53
|
# resource URI currently registered from the compiled views manifest.
|
|
54
54
|
def resolve_resource_uri(uri)
|
|
55
|
+
ActionMCP.configuration.load_deferred_mcp_components
|
|
55
56
|
(@resource_uri_aliases || {}).fetch(uri, uri)
|
|
56
57
|
end
|
|
57
58
|
|
|
@@ -348,13 +348,14 @@ module ActionMCP
|
|
|
348
348
|
ensure_mcp_components_loaded if mcp_components_load_needed?
|
|
349
349
|
end
|
|
350
350
|
|
|
351
|
-
# Loading app/mcp inside initialize! drags
|
|
351
|
+
# Loading app/mcp or the views inside initialize! drags ActiveModel and every
|
|
352
|
+
# model the tools reference into boot.
|
|
352
353
|
def prepare_mcp_components
|
|
353
354
|
if defer_mcp_components_load?
|
|
354
|
-
@mcp_components_state = (:deferred if mcp_components_load_needed?)
|
|
355
|
+
@mcp_components_state = (:deferred if mcp_components_load_needed? || mcp_apps_enabled)
|
|
355
356
|
else
|
|
356
357
|
@mcp_components_state = nil
|
|
357
|
-
|
|
358
|
+
load_mcp_components
|
|
358
359
|
end
|
|
359
360
|
end
|
|
360
361
|
|
|
@@ -371,7 +372,7 @@ module ActionMCP
|
|
|
371
372
|
|
|
372
373
|
@mcp_components_state = :loading
|
|
373
374
|
begin
|
|
374
|
-
|
|
375
|
+
load_mcp_components
|
|
375
376
|
@mcp_components_state = nil
|
|
376
377
|
ensure
|
|
377
378
|
@mcp_components_state = :deferred if @mcp_components_state == :loading
|
|
@@ -381,6 +382,12 @@ module ActionMCP
|
|
|
381
382
|
|
|
382
383
|
private
|
|
383
384
|
|
|
385
|
+
# Views register after app/mcp so rebuilt manifests replace stale templates on dev reloads.
|
|
386
|
+
def load_mcp_components
|
|
387
|
+
eager_load_if_needed
|
|
388
|
+
Apps::ViewManifest.load! if mcp_apps_enabled
|
|
389
|
+
end
|
|
390
|
+
|
|
384
391
|
def defer_mcp_components_load?
|
|
385
392
|
!Rails.configuration.eager_load && !Rails.application.initialized?
|
|
386
393
|
end
|
data/lib/action_mcp/engine.rb
CHANGED
|
@@ -43,22 +43,16 @@ module ActionMCP
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
config.to_prepare do
|
|
46
|
-
#
|
|
47
|
-
if Rails.env.development?
|
|
46
|
+
# Clear registries on development reloads; the boot-time prepare has nothing to clear
|
|
47
|
+
if Rails.env.development? && Rails.application.initialized?
|
|
48
48
|
ActionMCP::ResourceTemplate.registered_templates.clear
|
|
49
49
|
ActionMCP::ToolsRegistry.clear!
|
|
50
50
|
ActionMCP::PromptsRegistry.clear!
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
#
|
|
54
|
-
# eager loading defers
|
|
53
|
+
# Loads app/mcp (profile "all") and then the compiled MCP Apps views.
|
|
54
|
+
# Booting without eager loading defers both to the first registry read.
|
|
55
55
|
ActionMCP.configuration.prepare_mcp_components
|
|
56
|
-
|
|
57
|
-
# Register compiled MCP Apps views after registries
|
|
58
|
-
# are (re)built. Runs on each dev reload so rebuilt view bundles/hashes
|
|
59
|
-
# are picked up without restarting the server; runs once at boot in
|
|
60
|
-
# production.
|
|
61
|
-
ActionMCP::Apps::ViewManifest.load! if ActionMCP.configuration.mcp_apps_enabled
|
|
62
56
|
end
|
|
63
57
|
|
|
64
58
|
initializer "action_mcp.insert_middleware" do |app|
|
|
@@ -87,14 +81,6 @@ module ActionMCP
|
|
|
87
81
|
|
|
88
82
|
# Configure autoloading for the mcp/tools directory and identifiers
|
|
89
83
|
initializer "action_mcp.autoloading", before: :set_autoload_paths do |app|
|
|
90
|
-
# Ensure ActionMCP base constants exist before Zeitwerk indexes app/mcp
|
|
91
|
-
# This prevents NameError when dependent gems have app/mcp
|
|
92
|
-
# directories with classes inheriting from ActionMCP::Tool, etc.
|
|
93
|
-
require "action_mcp/tool"
|
|
94
|
-
require "action_mcp/prompt"
|
|
95
|
-
require "action_mcp/resource_template"
|
|
96
|
-
require "action_mcp/gateway"
|
|
97
|
-
|
|
98
84
|
mcp_path = app.root.join("app/mcp")
|
|
99
85
|
identifiers_path = app.root.join("app/identifiers")
|
|
100
86
|
|
data/lib/action_mcp/version.rb
CHANGED