actionmcp 0.19.0 → 0.20.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/action_mcp/base_response.rb +86 -0
 - data/lib/action_mcp/prompt.rb +4 -3
 - data/lib/action_mcp/prompt_response.rb +14 -50
 - data/lib/action_mcp/tool_response.rb +14 -59
 - data/lib/action_mcp/version.rb +1 -1
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 86bd5d34d17ae66d5fcae2cf75c8231f78d6c08f88199f4835e42faed93e9589
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 239b2fc880942da6f7b4c1b6bf1b498ab12a7866d1bfb34e719bb7f46e206985
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ded4b3ae254173fa102465c03e665606ebd1f8acea443e117a2190c1d1115ee53b30401e94c9b9842d469493002213b32a21e58612f74f46a4e0956885f8f4b6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 730190f2a425916ea1c719cbdbdcd427ff606a0539b66e88226225f638d242f61c2663c9dcd0b38201ebe0856a4aa44ed3527f26399885e9658ee4319407c22d
         
     | 
| 
         @@ -0,0 +1,86 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module ActionMCP
         
     | 
| 
      
 4 
     | 
    
         
            +
              class BaseResponse
         
     | 
| 
      
 5 
     | 
    
         
            +
                include Enumerable
         
     | 
| 
      
 6 
     | 
    
         
            +
                attr_reader :is_error
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                def initialize
         
     | 
| 
      
 9 
     | 
    
         
            +
                  @is_error = false
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                # Mark response as error
         
     | 
| 
      
 13 
     | 
    
         
            +
                def mark_as_error!(symbol = :invalid_request, message: nil, data: nil)
         
     | 
| 
      
 14 
     | 
    
         
            +
                  @is_error = true
         
     | 
| 
      
 15 
     | 
    
         
            +
                  @symbol = symbol
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @error_message = message
         
     | 
| 
      
 17 
     | 
    
         
            +
                  @error_data = data
         
     | 
| 
      
 18 
     | 
    
         
            +
                  self
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                # Convert to hash format expected by MCP protocol
         
     | 
| 
      
 22 
     | 
    
         
            +
                def to_h
         
     | 
| 
      
 23 
     | 
    
         
            +
                  if @is_error
         
     | 
| 
      
 24 
     | 
    
         
            +
                    JsonRpc::JsonRpcError.new(@symbol, message: @error_message, data: @error_data).to_h
         
     | 
| 
      
 25 
     | 
    
         
            +
                  else
         
     | 
| 
      
 26 
     | 
    
         
            +
                    build_success_hash
         
     | 
| 
      
 27 
     | 
    
         
            +
                  end
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                # Method to be implemented by subclasses
         
     | 
| 
      
 31 
     | 
    
         
            +
                def build_success_hash
         
     | 
| 
      
 32 
     | 
    
         
            +
                  raise NotImplementedError, "Subclasses must implement #build_success_hash"
         
     | 
| 
      
 33 
     | 
    
         
            +
                end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                # Alias as_json to to_h for consistency
         
     | 
| 
      
 36 
     | 
    
         
            +
                alias as_json to_h
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                # Handle to_json directly
         
     | 
| 
      
 39 
     | 
    
         
            +
                def to_json(options = nil)
         
     | 
| 
      
 40 
     | 
    
         
            +
                  to_h.to_json(options)
         
     | 
| 
      
 41 
     | 
    
         
            +
                end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                # Compare with hash for easier testing
         
     | 
| 
      
 44 
     | 
    
         
            +
                def ==(other)
         
     | 
| 
      
 45 
     | 
    
         
            +
                  case other
         
     | 
| 
      
 46 
     | 
    
         
            +
                  when Hash
         
     | 
| 
      
 47 
     | 
    
         
            +
                    # Convert both to normalized format for comparison
         
     | 
| 
      
 48 
     | 
    
         
            +
                    hash_self = to_h.deep_transform_keys { |key| key.to_s.underscore }
         
     | 
| 
      
 49 
     | 
    
         
            +
                    hash_other = other.deep_transform_keys { |key| key.to_s.underscore }
         
     | 
| 
      
 50 
     | 
    
         
            +
                    hash_self == hash_other
         
     | 
| 
      
 51 
     | 
    
         
            +
                  when self.class
         
     | 
| 
      
 52 
     | 
    
         
            +
                    compare_with_same_class(other)
         
     | 
| 
      
 53 
     | 
    
         
            +
                  else
         
     | 
| 
      
 54 
     | 
    
         
            +
                    super
         
     | 
| 
      
 55 
     | 
    
         
            +
                  end
         
     | 
| 
      
 56 
     | 
    
         
            +
                end
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
                # Method to be implemented by subclasses for comparison
         
     | 
| 
      
 59 
     | 
    
         
            +
                def compare_with_same_class(other)
         
     | 
| 
      
 60 
     | 
    
         
            +
                  raise NotImplementedError, "Subclasses must implement #compare_with_same_class"
         
     | 
| 
      
 61 
     | 
    
         
            +
                end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                # Implement eql? for hash key comparison
         
     | 
| 
      
 64 
     | 
    
         
            +
                def eql?(other)
         
     | 
| 
      
 65 
     | 
    
         
            +
                  self == other
         
     | 
| 
      
 66 
     | 
    
         
            +
                end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                # Method to be implemented by subclasses for hash generation
         
     | 
| 
      
 69 
     | 
    
         
            +
                def hash_components
         
     | 
| 
      
 70 
     | 
    
         
            +
                  raise NotImplementedError, "Subclasses must implement #hash_components"
         
     | 
| 
      
 71 
     | 
    
         
            +
                end
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                # Implement hash method for hash key usage
         
     | 
| 
      
 74 
     | 
    
         
            +
                def hash
         
     | 
| 
      
 75 
     | 
    
         
            +
                  hash_components.hash
         
     | 
| 
      
 76 
     | 
    
         
            +
                end
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
                def success?
         
     | 
| 
      
 79 
     | 
    
         
            +
                  !is_error
         
     | 
| 
      
 80 
     | 
    
         
            +
                end
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                def error?
         
     | 
| 
      
 83 
     | 
    
         
            +
                  is_error
         
     | 
| 
      
 84 
     | 
    
         
            +
                end
         
     | 
| 
      
 85 
     | 
    
         
            +
              end
         
     | 
| 
      
 86 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/action_mcp/prompt.rb
    CHANGED
    
    | 
         @@ -46,8 +46,9 @@ module ActionMCP 
     | 
|
| 
       46 
46 
     | 
    
         
             
                # @param required [Boolean] Whether the argument is required.
         
     | 
| 
       47 
47 
     | 
    
         
             
                # @param default [Object] The default value of the argument.
         
     | 
| 
       48 
48 
     | 
    
         
             
                # @param enum [Array<String>] The list of allowed values for the argument.
         
     | 
| 
      
 49 
     | 
    
         
            +
                # @param type [Symbol] The type of the argument (e.g., :string, :integer, :boolean). Defaults to :string.
         
     | 
| 
       49 
50 
     | 
    
         
             
                # @return [void]
         
     | 
| 
       50 
     | 
    
         
            -
                def self.argument(arg_name, description: "", required: false, default: nil, enum: nil)
         
     | 
| 
      
 51 
     | 
    
         
            +
                def self.argument(arg_name, description: "", required: false, default: nil, enum: nil, type: :string)
         
     | 
| 
       51 
52 
     | 
    
         
             
                  arg_def = {
         
     | 
| 
       52 
53 
     | 
    
         
             
                    name: arg_name.to_s,
         
     | 
| 
       53 
54 
     | 
    
         
             
                    description: description,
         
     | 
| 
         @@ -58,7 +59,7 @@ module ActionMCP 
     | 
|
| 
       58 
59 
     | 
    
         
             
                  self._argument_definitions += [ arg_def ]
         
     | 
| 
       59 
60 
     | 
    
         | 
| 
       60 
61 
     | 
    
         
             
                  # Register the attribute so it's recognized by ActiveModel
         
     | 
| 
       61 
     | 
    
         
            -
                  attribute arg_name,  
     | 
| 
      
 62 
     | 
    
         
            +
                  attribute arg_name, type, default: default
         
     | 
| 
       62 
63 
     | 
    
         
             
                  validates arg_name, presence: true if required
         
     | 
| 
       63 
64 
     | 
    
         | 
| 
       64 
65 
     | 
    
         
             
                  return unless enum.present?
         
     | 
| 
         @@ -81,7 +82,7 @@ module ActionMCP 
     | 
|
| 
       81 
82 
     | 
    
         
             
                  {
         
     | 
| 
       82 
83 
     | 
    
         
             
                    name: prompt_name,
         
     | 
| 
       83 
84 
     | 
    
         
             
                    description: description.presence,
         
     | 
| 
       84 
     | 
    
         
            -
                    arguments: arguments.map { |arg| arg.slice(:name, :description, :required) }
         
     | 
| 
      
 85 
     | 
    
         
            +
                    arguments: arguments.map { |arg| arg.slice(:name, :description, :required, :type) }
         
     | 
| 
       85 
86 
     | 
    
         
             
                  }.compact
         
     | 
| 
       86 
87 
     | 
    
         
             
                end
         
     | 
| 
       87 
88 
     | 
    
         | 
| 
         @@ -1,16 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module ActionMCP
         
     | 
| 
       4 
     | 
    
         
            -
              class PromptResponse
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
       6 
     | 
    
         
            -
                attr_reader :messages, :is_error
         
     | 
| 
      
 4 
     | 
    
         
            +
              class PromptResponse < BaseResponse
         
     | 
| 
      
 5 
     | 
    
         
            +
                attr_reader :messages
         
     | 
| 
       7 
6 
     | 
    
         | 
| 
       8 
7 
     | 
    
         
             
                # Delegate methods to the underlying messages array
         
     | 
| 
       9 
8 
     | 
    
         
             
                delegate :empty?, :size, :each, :find, :map, to: :messages
         
     | 
| 
       10 
9 
     | 
    
         | 
| 
       11 
10 
     | 
    
         
             
                def initialize
         
     | 
| 
      
 11 
     | 
    
         
            +
                  super
         
     | 
| 
       12 
12 
     | 
    
         
             
                  @messages = []
         
     | 
| 
       13 
     | 
    
         
            -
                  @is_error = false
         
     | 
| 
       14 
13 
     | 
    
         
             
                end
         
     | 
| 
       15 
14 
     | 
    
         | 
| 
       16 
15 
     | 
    
         
             
                # Add a message to the response
         
     | 
| 
         @@ -25,56 +24,21 @@ module ActionMCP 
     | 
|
| 
       25 
24 
     | 
    
         
             
                  self
         
     | 
| 
       26 
25 
     | 
    
         
             
                end
         
     | 
| 
       27 
26 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
                 
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                   
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
                   
     | 
| 
       33 
     | 
    
         
            -
                  self
         
     | 
| 
       34 
     | 
    
         
            -
                end
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                # Convert to hash format expected by MCP protocol
         
     | 
| 
       37 
     | 
    
         
            -
                def to_h
         
     | 
| 
       38 
     | 
    
         
            -
                  if @is_error
         
     | 
| 
       39 
     | 
    
         
            -
                    JsonRpc::JsonRpcError.new(@symbol, message: @error_message, data: @error_data).to_h
         
     | 
| 
       40 
     | 
    
         
            -
                  else
         
     | 
| 
       41 
     | 
    
         
            -
                    {
         
     | 
| 
       42 
     | 
    
         
            -
                      messages: @messages
         
     | 
| 
       43 
     | 
    
         
            -
                    }
         
     | 
| 
       44 
     | 
    
         
            -
                  end
         
     | 
| 
       45 
     | 
    
         
            -
                end
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
                # Alias as_json to to_h for consistency
         
     | 
| 
       48 
     | 
    
         
            -
                alias as_json to_h
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                # Handle to_json directly
         
     | 
| 
       51 
     | 
    
         
            -
                def to_json(options = nil)
         
     | 
| 
       52 
     | 
    
         
            -
                  to_h.to_json(options)
         
     | 
| 
       53 
     | 
    
         
            -
                end
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
                # Compare with hash for easier testing
         
     | 
| 
       56 
     | 
    
         
            -
                def ==(other)
         
     | 
| 
       57 
     | 
    
         
            -
                  case other
         
     | 
| 
       58 
     | 
    
         
            -
                  when Hash
         
     | 
| 
       59 
     | 
    
         
            -
                    # Convert both to normalized format for comparison
         
     | 
| 
       60 
     | 
    
         
            -
                    hash_self = to_h.deep_transform_keys { |key| key.to_s.underscore }
         
     | 
| 
       61 
     | 
    
         
            -
                    hash_other = other.deep_transform_keys { |key| key.to_s.underscore }
         
     | 
| 
       62 
     | 
    
         
            -
                    hash_self == hash_other
         
     | 
| 
       63 
     | 
    
         
            -
                  when PromptResponse
         
     | 
| 
       64 
     | 
    
         
            -
                    messages == other.messages
         
     | 
| 
       65 
     | 
    
         
            -
                  else
         
     | 
| 
       66 
     | 
    
         
            -
                    super
         
     | 
| 
       67 
     | 
    
         
            -
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                # Implementation of build_success_hash for PromptResponse
         
     | 
| 
      
 28 
     | 
    
         
            +
                def build_success_hash
         
     | 
| 
      
 29 
     | 
    
         
            +
                  {
         
     | 
| 
      
 30 
     | 
    
         
            +
                    messages: @messages
         
     | 
| 
      
 31 
     | 
    
         
            +
                  }
         
     | 
| 
       68 
32 
     | 
    
         
             
                end
         
     | 
| 
       69 
33 
     | 
    
         | 
| 
       70 
     | 
    
         
            -
                #  
     | 
| 
       71 
     | 
    
         
            -
                def  
     | 
| 
       72 
     | 
    
         
            -
                   
     | 
| 
      
 34 
     | 
    
         
            +
                # Implementation of compare_with_same_class for PromptResponse
         
     | 
| 
      
 35 
     | 
    
         
            +
                def compare_with_same_class(other)
         
     | 
| 
      
 36 
     | 
    
         
            +
                  messages == other.messages
         
     | 
| 
       73 
37 
     | 
    
         
             
                end
         
     | 
| 
       74 
38 
     | 
    
         | 
| 
       75 
     | 
    
         
            -
                #  
     | 
| 
       76 
     | 
    
         
            -
                def  
     | 
| 
       77 
     | 
    
         
            -
                  [ messages ] 
     | 
| 
      
 39 
     | 
    
         
            +
                # Implementation of hash_components for PromptResponse
         
     | 
| 
      
 40 
     | 
    
         
            +
                def hash_components
         
     | 
| 
      
 41 
     | 
    
         
            +
                  [ messages ]
         
     | 
| 
       78 
42 
     | 
    
         
             
                end
         
     | 
| 
       79 
43 
     | 
    
         | 
| 
       80 
44 
     | 
    
         
             
                # Pretty print for better debugging
         
     | 
| 
         @@ -2,15 +2,14 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module ActionMCP
         
     | 
| 
       4 
4 
     | 
    
         
             
              # Manages the collection of content objects for tool results
         
     | 
| 
       5 
     | 
    
         
            -
              class ToolResponse
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
       7 
     | 
    
         
            -
                attr_reader :contents, :is_error
         
     | 
| 
      
 5 
     | 
    
         
            +
              class ToolResponse < BaseResponse
         
     | 
| 
      
 6 
     | 
    
         
            +
                attr_reader :contents
         
     | 
| 
       8 
7 
     | 
    
         | 
| 
       9 
8 
     | 
    
         
             
                delegate :empty?, :size, :each, :find, :map, to: :contents
         
     | 
| 
       10 
9 
     | 
    
         | 
| 
       11 
10 
     | 
    
         
             
                def initialize
         
     | 
| 
      
 11 
     | 
    
         
            +
                  super
         
     | 
| 
       12 
12 
     | 
    
         
             
                  @contents = []
         
     | 
| 
       13 
     | 
    
         
            -
                  @is_error = false
         
     | 
| 
       14 
13 
     | 
    
         
             
                end
         
     | 
| 
       15 
14 
     | 
    
         | 
| 
       16 
15 
     | 
    
         
             
                # Add content to the response
         
     | 
| 
         @@ -19,65 +18,21 @@ module ActionMCP 
     | 
|
| 
       19 
18 
     | 
    
         
             
                  content # Return the content for chaining
         
     | 
| 
       20 
19 
     | 
    
         
             
                end
         
     | 
| 
       21 
20 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                #  
     | 
| 
       23 
     | 
    
         
            -
                def  
     | 
| 
       24 
     | 
    
         
            -
                   
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                   
     | 
| 
       27 
     | 
    
         
            -
                  @error_data = data
         
     | 
| 
       28 
     | 
    
         
            -
                  self
         
     | 
| 
      
 21 
     | 
    
         
            +
                # Implementation of build_success_hash for ToolResponse
         
     | 
| 
      
 22 
     | 
    
         
            +
                def build_success_hash
         
     | 
| 
      
 23 
     | 
    
         
            +
                  {
         
     | 
| 
      
 24 
     | 
    
         
            +
                    content: @contents.map(&:to_h)
         
     | 
| 
      
 25 
     | 
    
         
            +
                  }
         
     | 
| 
       29 
26 
     | 
    
         
             
                end
         
     | 
| 
       30 
27 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
                #  
     | 
| 
       32 
     | 
    
         
            -
                def  
     | 
| 
       33 
     | 
    
         
            -
                   
     | 
| 
       34 
     | 
    
         
            -
                    JsonRpc::JsonRpcError.new(@symbol, message: @error_message, data: @error_data).to_h
         
     | 
| 
       35 
     | 
    
         
            -
                  else
         
     | 
| 
       36 
     | 
    
         
            -
                    {
         
     | 
| 
       37 
     | 
    
         
            -
                      content: @contents.map(&:to_h)
         
     | 
| 
       38 
     | 
    
         
            -
                    }
         
     | 
| 
       39 
     | 
    
         
            -
                  end
         
     | 
| 
      
 28 
     | 
    
         
            +
                # Implementation of compare_with_same_class for ToolResponse
         
     | 
| 
      
 29 
     | 
    
         
            +
                def compare_with_same_class(other)
         
     | 
| 
      
 30 
     | 
    
         
            +
                  contents == other.contents && is_error == other.is_error
         
     | 
| 
       40 
31 
     | 
    
         
             
                end
         
     | 
| 
       41 
32 
     | 
    
         | 
| 
       42 
     | 
    
         
            -
                #  
     | 
| 
       43 
     | 
    
         
            -
                 
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                # Handle to_json directly
         
     | 
| 
       46 
     | 
    
         
            -
                def to_json(options = nil)
         
     | 
| 
       47 
     | 
    
         
            -
                  to_h.to_json(options)
         
     | 
| 
       48 
     | 
    
         
            -
                end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                # Compare with hash for easier testing.
         
     | 
| 
       51 
     | 
    
         
            -
                def ==(other)
         
     | 
| 
       52 
     | 
    
         
            -
                  case other
         
     | 
| 
       53 
     | 
    
         
            -
                  when Hash
         
     | 
| 
       54 
     | 
    
         
            -
                    # Convert both to normalized format for comparison
         
     | 
| 
       55 
     | 
    
         
            -
                    hash_self = to_h.deep_transform_keys { |key| key.to_s.underscore }
         
     | 
| 
       56 
     | 
    
         
            -
                    hash_other = other.deep_transform_keys { |key| key.to_s.underscore }
         
     | 
| 
       57 
     | 
    
         
            -
                    hash_self == hash_other
         
     | 
| 
       58 
     | 
    
         
            -
                  when ToolResponse
         
     | 
| 
       59 
     | 
    
         
            -
                    contents == other.contents && is_error == other.is_error
         
     | 
| 
       60 
     | 
    
         
            -
                  else
         
     | 
| 
       61 
     | 
    
         
            -
                    super
         
     | 
| 
       62 
     | 
    
         
            -
                  end
         
     | 
| 
       63 
     | 
    
         
            -
                end
         
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
                # Implement eql? for hash key comparison
         
     | 
| 
       66 
     | 
    
         
            -
                def eql?(other)
         
     | 
| 
       67 
     | 
    
         
            -
                  self == other
         
     | 
| 
       68 
     | 
    
         
            -
                end
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                # Implement hash method for hash key usage
         
     | 
| 
       71 
     | 
    
         
            -
                def hash
         
     | 
| 
       72 
     | 
    
         
            -
                  [ contents, is_error ].hash
         
     | 
| 
       73 
     | 
    
         
            -
                end
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
                def success?
         
     | 
| 
       76 
     | 
    
         
            -
                  !is_error
         
     | 
| 
       77 
     | 
    
         
            -
                end
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
                def error?
         
     | 
| 
       80 
     | 
    
         
            -
                  is_error
         
     | 
| 
      
 33 
     | 
    
         
            +
                # Implementation of hash_components for ToolResponse
         
     | 
| 
      
 34 
     | 
    
         
            +
                def hash_components
         
     | 
| 
      
 35 
     | 
    
         
            +
                  [ contents, is_error ]
         
     | 
| 
       81 
36 
     | 
    
         
             
                end
         
     | 
| 
       82 
37 
     | 
    
         | 
| 
       83 
38 
     | 
    
         
             
                # Pretty print for better debugging
         
     | 
    
        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.20.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Abdelkader Boudih
         
     | 
| 
         @@ -123,6 +123,7 @@ files: 
     | 
|
| 
       123 
123 
     | 
    
         
             
            - exe/actionmcp_cli
         
     | 
| 
       124 
124 
     | 
    
         
             
            - lib/action_mcp.rb
         
     | 
| 
       125 
125 
     | 
    
         
             
            - lib/action_mcp/base_json_rpc_handler.rb
         
     | 
| 
      
 126 
     | 
    
         
            +
            - lib/action_mcp/base_response.rb
         
     | 
| 
       126 
127 
     | 
    
         
             
            - lib/action_mcp/callbacks.rb
         
     | 
| 
       127 
128 
     | 
    
         
             
            - lib/action_mcp/capability.rb
         
     | 
| 
       128 
129 
     | 
    
         
             
            - lib/action_mcp/client.rb
         
     |