Module: ClaudeAgentSDK::Type::OptionValue Private
- Included in:
- AgentDefinition, HookMatcher, McpHttpServerConfig, McpSSEServerConfig, McpSdkServerConfig, McpStdioServerConfig, SandboxFilesystemConfig, SandboxNetworkConfig, SandboxSettings, SdkPluginConfig, SystemPromptCustom, SystemPromptFile, SystemPromptPreset, ClaudeAgentSDK::TaskBudget, ClaudeAgentSDK::ThinkingConfigAdaptive, ClaudeAgentSDK::ThinkingConfigDisabled, ClaudeAgentSDK::ThinkingConfigEnabled, ClaudeAgentSDK::ToolsPreset
- Defined in:
- lib/claude_agent_sdk/types/base.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Mixed into the mutable value types that ClaudeAgentOptions holds (SandboxSettings, SystemPromptPreset, AgentDefinition, ...). The copy recurses into the value's own state with Type.deep_dup_for_options, so nested containers and nested value types (SandboxSettings#network) are copied too while identity leaves (McpSdkServerConfig#instance, the callables in HookMatcher#hooks) stay shared. #dup never copies frozen state, so a copy of a frozen value (the configured-defaults snapshot) is mutable.
Instance Method Summary collapse
- #dup_for_options ⇒ Object private
Instance Method Details
#dup_for_options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
63 64 65 66 67 68 69 |
# File 'lib/claude_agent_sdk/types/base.rb', line 63 def copy = dup copy.instance_variables.each do |ivar| copy.instance_variable_set(ivar, Type.(copy.instance_variable_get(ivar))) end copy end |