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.



559
560
561
562
# File 'lib/claude_agent_sdk/types.rb', line 559

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.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def agent_id
  @agent_id
end

#blocked_pathObject

Returns the value of attribute blocked_path.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def blocked_path
  @blocked_path
end

#decision_reasonObject

Returns the value of attribute decision_reason.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def decision_reason
  @decision_reason
end

#descriptionObject

Returns the value of attribute description.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def display_name
  @display_name
end

#signalObject

Returns the value of attribute signal.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def signal
  @signal
end

#suggestionsObject

Returns the value of attribute suggestions.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def suggestions
  @suggestions
end

#titleObject

Returns the value of attribute title.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def title
  @title
end

#tool_use_idObject

Returns the value of attribute tool_use_id.



555
556
557
# File 'lib/claude_agent_sdk/types.rb', line 555

def tool_use_id
  @tool_use_id
end