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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3a08c2cb30deefe712f0083b473838a1ec6b578c1b7decbcc53ac14aca4cffb
4
- data.tar.gz: ea88b13e4a5998164c4dfaa1b71d448e5d498b694b8de312449a8c82d4daf555
3
+ metadata.gz: c26778c726d9e0e83c8573f84f3972778b6b95cbc837ead0b2c889344955aa4c
4
+ data.tar.gz: 87ad9ad6ead32c2a538205bfd2f99176b1a0aeb1163ef2e2609ca41cbb8bcf53
5
5
  SHA512:
6
- metadata.gz: 70c40acb181dcc382395c454e769e26fede6798a32dc2dab7797ffaf66b1936dd0e89cf767f2f9f16a5e668ad1ceff9dfd3d2a22d03db34bcb146ab1eef78ba6
7
- data.tar.gz: 3c2cf29896ae08b63876e60e8807ccb7ea85118fdb5d422aaf9b94e4ef3aa76345786b42bb0406f1c8df1b938d3755cf78a84fd3bf9728f5ecc4fd54a6c7b737
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 that wraps tool results from both MCP and
392
- # JSONRPC transports: {"content" => [{"type" => "text", "text" => "<json>"}]}
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 raw unless first.is_a?(Hash) && first["text"].is_a?(String)
408
+ return first unless first.is_a?(Hash) && first["text"].is_a?(String)
401
409
 
402
410
  begin
403
411
  JSON.parse(first["text"])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatagroutConduit
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
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.5.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-10 00:00:00.000000000 Z
11
+ date: 2026-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday