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.



637
638
639
640
# File 'lib/claude_agent_sdk/types.rb', line 637

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.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def agent_id
  @agent_id
end

#blocked_pathObject

Returns the value of attribute blocked_path.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def blocked_path
  @blocked_path
end

#decision_reasonObject

Returns the value of attribute decision_reason.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def decision_reason
  @decision_reason
end

#descriptionObject

Returns the value of attribute description.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def display_name
  @display_name
end

#signalObject

Returns the value of attribute signal.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def signal
  @signal
end

#suggestionsObject

Returns the value of attribute suggestions.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def suggestions
  @suggestions
end

#titleObject

Returns the value of attribute title.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def title
  @title
end

#tool_use_idObject

Returns the value of attribute tool_use_id.



633
634
635
# File 'lib/claude_agent_sdk/types.rb', line 633

def tool_use_id
  @tool_use_id
end