Class: ClaudeAgentSDK::ClaudeAgentOptions

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

Overview

Claude Agent Options for configuring queries

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

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

Constructor Details

#initialize(attributes = {}) ⇒ ClaudeAgentOptions

Returns a new instance of ClaudeAgentOptions.



1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
# File 'lib/claude_agent_sdk/types.rb', line 1485

def initialize(attributes = {})
  self.fork_session = false
  self.continue_conversation = false
  self.include_partial_messages = false
  self.enable_file_checkpointing = false
  self.include_hook_events = false
  self.strict_mcp_config = false

  super(merge_with_defaults(attributes || {}))

  # Non-nil defaults for options that need them.
  self.env              ||= {}
  self.extra_args       ||= {}
  self.mcp_servers      ||= {}
  self.add_dirs         ||= []
  self.observers        ||= []
  self.allowed_tools    ||= []
  self.disallowed_tools ||= []
end

Dynamic Method Handling

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

Instance Attribute Details

#add_dirsObject

Returns the value of attribute add_dirs.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def add_dirs
  @add_dirs
end

#agentsObject

Returns the value of attribute agents.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def agents
  @agents
end

#allowed_toolsObject

Returns the value of attribute allowed_tools.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def allowed_tools
  @allowed_tools
end

#append_allowed_toolsObject

Returns the value of attribute append_allowed_tools.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def append_allowed_tools
  @append_allowed_tools
end

#bareObject

Returns the value of attribute bare.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def bare
  @bare
end

#betasObject

Returns the value of attribute betas.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def betas
  @betas
end

#can_use_toolObject

Returns the value of attribute can_use_tool.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def can_use_tool
  @can_use_tool
end

#cli_pathObject

Returns the value of attribute cli_path.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def cli_path
  @cli_path
end

#continue_conversationObject

Returns the value of attribute continue_conversation.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def continue_conversation
  @continue_conversation
end

#cwdObject

Returns the value of attribute cwd.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def cwd
  @cwd
end

#debug_stderrObject

Returns the value of attribute debug_stderr.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def debug_stderr
  @debug_stderr
end

#disallowed_toolsObject

Returns the value of attribute disallowed_tools.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def disallowed_tools
  @disallowed_tools
end

#effortObject

Returns the value of attribute effort.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def effort
  @effort
end

#enable_file_checkpointingObject

Returns the value of attribute enable_file_checkpointing.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def enable_file_checkpointing
  @enable_file_checkpointing
end

#envObject

Returns the value of attribute env.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def env
  @env
end

#extra_argsObject

Returns the value of attribute extra_args.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def extra_args
  @extra_args
end

#fallback_modelObject

Returns the value of attribute fallback_model.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def fallback_model
  @fallback_model
end

#fork_sessionObject

Returns the value of attribute fork_session.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def fork_session
  @fork_session
end

#hooksObject

Returns the value of attribute hooks.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def hooks
  @hooks
end

#include_hook_eventsObject

Returns the value of attribute include_hook_events.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def include_hook_events
  @include_hook_events
end

#include_partial_messagesObject

Returns the value of attribute include_partial_messages.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def include_partial_messages
  @include_partial_messages
end

#max_budget_usdObject

Returns the value of attribute max_budget_usd.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def max_budget_usd
  @max_budget_usd
end

#max_buffer_sizeObject

Returns the value of attribute max_buffer_size.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def max_buffer_size
  @max_buffer_size
end

#max_thinking_tokensObject

Returns the value of attribute max_thinking_tokens.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def max_thinking_tokens
  @max_thinking_tokens
end

#max_turnsObject

Returns the value of attribute max_turns.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def max_turns
  @max_turns
end

#mcp_serversObject

Returns the value of attribute mcp_servers.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def mcp_servers
  @mcp_servers
end

#modelObject

Returns the value of attribute model.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def model
  @model
end

#observersObject

Returns the value of attribute observers.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def observers
  @observers
end

#output_formatObject

Returns the value of attribute output_format.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def output_format
  @output_format
end

#permission_modeObject

Returns the value of attribute permission_mode.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def permission_mode
  @permission_mode
end

#permission_prompt_tool_nameObject

Returns the value of attribute permission_prompt_tool_name.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def permission_prompt_tool_name
  @permission_prompt_tool_name
end

#pluginsObject

Returns the value of attribute plugins.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def plugins
  @plugins
end

#resumeObject

Returns the value of attribute resume.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def resume
  @resume
end

#resume_session_atObject

Returns the value of attribute resume_session_at.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def resume_session_at
  @resume_session_at
end

#sandboxObject

Returns the value of attribute sandbox.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def sandbox
  @sandbox
end

#session_idObject

Returns the value of attribute session_id.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def session_id
  @session_id
end

#setting_sourcesObject

Returns the value of attribute setting_sources.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def setting_sources
  @setting_sources
end

#settingsObject

Returns the value of attribute settings.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def settings
  @settings
end

#stderrObject

Returns the value of attribute stderr.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def stderr
  @stderr
end

#strict_mcp_configObject

Returns the value of attribute strict_mcp_config.



1481
1482
1483
# File 'lib/claude_agent_sdk/types.rb', line 1481

def strict_mcp_config
  @strict_mcp_config
end

#system_promptObject

Returns the value of attribute system_prompt.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def system_prompt
  @system_prompt
end

#task_budgetObject

Returns the value of attribute task_budget.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def task_budget
  @task_budget
end

#thinkingObject

Returns the value of attribute thinking.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def thinking
  @thinking
end

#toolsObject

Returns the value of attribute tools.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def tools
  @tools
end

#userObject

Returns the value of attribute user.



1471
1472
1473
# File 'lib/claude_agent_sdk/types.rb', line 1471

def user
  @user
end

Instance Method Details

#bare?Boolean

Returns:

  • (Boolean)


1511
1512
1513
# File 'lib/claude_agent_sdk/types.rb', line 1511

def bare?
  !!bare
end

#continue_conversation?Boolean

Returns:

  • (Boolean)


1543
1544
1545
# File 'lib/claude_agent_sdk/types.rb', line 1543

def continue_conversation?
  !!continue_conversation
end

#dup_with(**changes) ⇒ Object



1505
1506
1507
1508
1509
# File 'lib/claude_agent_sdk/types.rb', line 1505

def dup_with(**changes)
  new_options = self.dup
  changes.each { |key, value| new_options[key] = value }
  new_options
end

#enable_file_checkpointing?Boolean

Returns:

  • (Boolean)


1527
1528
1529
# File 'lib/claude_agent_sdk/types.rb', line 1527

def enable_file_checkpointing?
  !!enable_file_checkpointing
end

#fork_session?Boolean

Returns:

  • (Boolean)


1519
1520
1521
# File 'lib/claude_agent_sdk/types.rb', line 1519

def fork_session?
  !!fork_session
end

#include_hook_events?Boolean

Returns:

  • (Boolean)


1551
1552
1553
# File 'lib/claude_agent_sdk/types.rb', line 1551

def include_hook_events?
  !!include_hook_events
end

#include_partial_messages?Boolean

Returns:

  • (Boolean)


1535
1536
1537
# File 'lib/claude_agent_sdk/types.rb', line 1535

def include_partial_messages?
  !!include_partial_messages
end

#strict_mcp_config?Boolean

Returns:

  • (Boolean)


1559
1560
1561
# File 'lib/claude_agent_sdk/types.rb', line 1559

def strict_mcp_config?
  !!strict_mcp_config
end