datagrout-conduit 0.5.0 → 0.6.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/lib/datagrout_conduit/client.rb +11 -3
- data/lib/datagrout_conduit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c26778c726d9e0e83c8573f84f3972778b6b95cbc837ead0b2c889344955aa4c
|
|
4
|
+
data.tar.gz: 87ad9ad6ead32c2a538205bfd2f99176b1a0aeb1163ef2e2609ca41cbb8bcf53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 327ddcec7d5910ea28d060e8e48cef5863aa8f6c4023108924e497a8f2d3ed818e29b87599d12f3be5203f5a20491a864b0e60d80f1c24b335cf868424338829
|
|
7
|
+
data.tar.gz: 1d976c43dc5346f5afa9fb01b84a6bb6e04cd275bca7563a75815bfd156f115bfdb5d8aada4b3b45201704d696ad17ea80a1f2f06debc8b61ff570b05d34fcab
|
|
@@ -388,16 +388,24 @@ module DatagroutConduit
|
|
|
388
388
|
unwrap_content(raw)
|
|
389
389
|
end
|
|
390
390
|
|
|
391
|
-
# Unwrap the MCP content envelope
|
|
392
|
-
#
|
|
391
|
+
# Unwrap the MCP content envelope from tool call results.
|
|
392
|
+
#
|
|
393
|
+
# Priority order (MCP 2025):
|
|
394
|
+
# 1. +structuredContent+ — pure JSON Hash, no decoding needed.
|
|
395
|
+
# 2. +content[0]["text"]+ parsed as JSON — legacy text-encoded path.
|
|
396
|
+
# 3. +content[0]+ as-is — plain-text or non-JSON content item.
|
|
397
|
+
# 4. +raw+ unchanged — no content envelope present.
|
|
393
398
|
def unwrap_content(raw)
|
|
394
399
|
return raw unless raw.is_a?(Hash)
|
|
395
400
|
|
|
401
|
+
# 1. Prefer structuredContent (MCP 2025).
|
|
402
|
+
return raw["structuredContent"] if raw.key?("structuredContent")
|
|
403
|
+
|
|
396
404
|
content = raw["content"]
|
|
397
405
|
return raw unless content.is_a?(Array) && !content.empty?
|
|
398
406
|
|
|
399
407
|
first = content.first
|
|
400
|
-
return
|
|
408
|
+
return first unless first.is_a?(Hash) && first["text"].is_a?(String)
|
|
401
409
|
|
|
402
410
|
begin
|
|
403
411
|
JSON.parse(first["text"])
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: datagrout-conduit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DataGrout
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|