actionmcp 0.200.1 → 0.201.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 +4 -4
- data/app/jobs/action_mcp/tool_execution_job.rb +2 -0
- data/app/models/action_mcp/session/message.rb +2 -2
- data/app/models/action_mcp/session.rb +1 -1
- data/lib/action_mcp/content.rb +1 -1
- data/lib/action_mcp/current.rb +5 -0
- data/lib/action_mcp/current_helpers.rb +5 -0
- data/lib/action_mcp/resource.rb +1 -1
- data/lib/action_mcp/server/tools.rb +2 -0
- data/lib/action_mcp/tagged_stream_logging.rb +2 -2
- data/lib/action_mcp/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f43c9c7b1a96891c28d29f5c3c9e292d6eed0404540f0bc5c32b502c5d617106
|
|
4
|
+
data.tar.gz: 806b9bec986aa74568aca0a9fc5959f1734638297f0c4318e2d4d324ffe0455b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a3bcc5e984b69d10826170410506ea996f26a145552fbc608b228e72b1c6787370bbe7d5c1a3d6967a6f1c2a72b0f520a1e9566067a207ab33a46caab4722e7
|
|
7
|
+
data.tar.gz: 7f15b59458d2fd70bcc86cd8ef545b12a0ad4467523a72a4461d664ae2610d10305c89355414e450adf5d479a97aa2d583bbc36085ba7a3696d872fc5d187ad7
|
|
@@ -117,10 +117,12 @@ module ActionMCP
|
|
|
117
117
|
# Preserve Current attributes across reloader boundary
|
|
118
118
|
current_user = ActionMCP::Current.user
|
|
119
119
|
current_gateway = ActionMCP::Current.gateway
|
|
120
|
+
current_session_data = ActionMCP::Current.session_data
|
|
120
121
|
|
|
121
122
|
Rails.application.reloader.wrap do
|
|
122
123
|
ActionMCP::Current.user = current_user
|
|
123
124
|
ActionMCP::Current.gateway = current_gateway
|
|
125
|
+
ActionMCP::Current.session_data = current_session_data
|
|
124
126
|
tool.call
|
|
125
127
|
end
|
|
126
128
|
else
|
|
@@ -69,8 +69,8 @@ module ActionMCP
|
|
|
69
69
|
# Convert string payloads to JSON
|
|
70
70
|
if payload.is_a?(String)
|
|
71
71
|
begin
|
|
72
|
-
@data =
|
|
73
|
-
rescue
|
|
72
|
+
@data = MultiJSON.parse(payload)
|
|
73
|
+
rescue MultiJSON::ParseError
|
|
74
74
|
# Handle invalid JSON by creating an error object
|
|
75
75
|
self.message_json = { "error" => "Invalid JSON", "raw" => payload }
|
|
76
76
|
self.message_type = "invalid_json"
|
|
@@ -84,7 +84,7 @@ module ActionMCP
|
|
|
84
84
|
if data.is_a?(JSON_RPC::Request) || data.is_a?(JSON_RPC::Response) || data.is_a?(JSON_RPC::Notification)
|
|
85
85
|
data = data.to_json
|
|
86
86
|
end
|
|
87
|
-
data =
|
|
87
|
+
data = MultiJSON.generate(data) if data.is_a?(Hash)
|
|
88
88
|
|
|
89
89
|
messages.create!(data: data, direction: writer_role)
|
|
90
90
|
end
|
data/lib/action_mcp/content.rb
CHANGED
data/lib/action_mcp/current.rb
CHANGED
data/lib/action_mcp/resource.rb
CHANGED
|
@@ -105,11 +105,13 @@ module ActionMCP
|
|
|
105
105
|
# Preserve Current attributes across reloader boundary
|
|
106
106
|
current_user = ActionMCP::Current.user
|
|
107
107
|
current_gateway = ActionMCP::Current.gateway
|
|
108
|
+
current_session_data = ActionMCP::Current.session_data
|
|
108
109
|
|
|
109
110
|
Rails.application.reloader.wrap do
|
|
110
111
|
# Restore Current attributes inside reloader
|
|
111
112
|
ActionMCP::Current.user = current_user
|
|
112
113
|
ActionMCP::Current.gateway = current_gateway
|
|
114
|
+
ActionMCP::Current.session_data = current_session_data
|
|
113
115
|
tool.call
|
|
114
116
|
end
|
|
115
117
|
else
|
|
@@ -24,7 +24,7 @@ module ActionMCP
|
|
|
24
24
|
pretty = json_normalise(line)
|
|
25
25
|
log_with_tags("MCP", "RX") { ActionMCP.logger.debug("#{GREEN_RX}#{pretty}#{CLR}") }
|
|
26
26
|
super
|
|
27
|
-
rescue
|
|
27
|
+
rescue MultiJSON::ParseError => e
|
|
28
28
|
log_with_tags("MCP", "RX") { ActionMCP.logger.warn("#{YELLOW_ERR}Bad JSON → #{e.message}#{CLR}") }
|
|
29
29
|
raise
|
|
30
30
|
rescue StandardError => e
|
|
@@ -57,7 +57,7 @@ module ActionMCP
|
|
|
57
57
|
|
|
58
58
|
# Accepts String, Hash, or any #to_json‑able object.
|
|
59
59
|
def json_normalise(obj)
|
|
60
|
-
str = obj.is_a?(String) ? obj.strip :
|
|
60
|
+
str = obj.is_a?(String) ? obj.strip : MultiJSON.generate(obj)
|
|
61
61
|
str.empty? ? "<empty frame>" : str
|
|
62
62
|
end
|
|
63
63
|
end
|
data/lib/action_mcp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: actionmcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.201.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abdelkader Boudih
|
|
@@ -99,14 +99,14 @@ dependencies:
|
|
|
99
99
|
requirements:
|
|
100
100
|
- - ">="
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
102
|
+
version: '1.21'
|
|
103
103
|
type: :runtime
|
|
104
104
|
prerelease: false
|
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
|
107
107
|
- - ">="
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '
|
|
109
|
+
version: '1.21'
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
111
|
name: railties
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|