Class: ClaudeAgentSDK::ToolPermissionContext

Inherits:
Type
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Tool permission context delivered to can_use_tool callbacks. CLI 2.1.110+ began populating the four pre-formatted display fields (title, display_name, description, blocked_path, decision_reason) so the SDK consumer can render the same prompt UI the CLI would have shown. Older fields (signal, suggestions, tool_use_id, agent_id) remain unchanged.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#[], #[]=, from_hash, #to_h, wrap

Constructor Details

#initialize(attributes = {}) ⇒ ToolPermissionContext

Returns a new instance of ToolPermissionContext.



621
622
623
624
# File 'lib/claude_agent_sdk/types.rb', line 621

def initialize(attributes = {})
  super
  @suggestions ||= []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type

Instance Attribute Details

#agent_idObject

Returns the value of attribute agent_id.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def agent_id
  @agent_id
end

#blocked_pathObject

Returns the value of attribute blocked_path.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def blocked_path
  @blocked_path
end

#decision_reasonObject

Returns the value of attribute decision_reason.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def decision_reason
  @decision_reason
end

#descriptionObject

Returns the value of attribute description.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def display_name
  @display_name
end

#signalObject

Returns the value of attribute signal.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def signal
  @signal
end

#suggestionsObject

Returns the value of attribute suggestions.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def suggestions
  @suggestions
end

#titleObject

Returns the value of attribute title.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def title
  @title
end

#tool_use_idObject

Returns the value of attribute tool_use_id.



617
618
619
# File 'lib/claude_agent_sdk/types.rb', line 617

def tool_use_id
  @tool_use_id
end