Class: ClaudeAgentSDK::SandboxFilesystemConfig

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

Overview

Sandbox filesystem configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allow_write: nil, deny_write: nil, deny_read: nil, allow_read: nil, allow_managed_read_paths_only: nil) ⇒ SandboxFilesystemConfig

Returns a new instance of SandboxFilesystemConfig.



1655
1656
1657
1658
1659
1660
1661
1662
# File 'lib/claude_agent_sdk/types.rb', line 1655

def initialize(allow_write: nil, deny_write: nil, deny_read: nil, allow_read: nil,
               allow_managed_read_paths_only: nil)
  @allow_write = allow_write # Array of paths to allow writing
  @deny_write = deny_write   # Array of paths to deny writing
  @deny_read = deny_read     # Array of paths to deny reading
  @allow_read = allow_read   # Array of paths to re-allow reading within denyRead
  @allow_managed_read_paths_only = allow_managed_read_paths_only
end

Instance Attribute Details

#allow_managed_read_paths_onlyObject

Returns the value of attribute allow_managed_read_paths_only.



1653
1654
1655
# File 'lib/claude_agent_sdk/types.rb', line 1653

def allow_managed_read_paths_only
  @allow_managed_read_paths_only
end

#allow_readObject

Returns the value of attribute allow_read.



1653
1654
1655
# File 'lib/claude_agent_sdk/types.rb', line 1653

def allow_read
  @allow_read
end

#allow_writeObject

Returns the value of attribute allow_write.



1653
1654
1655
# File 'lib/claude_agent_sdk/types.rb', line 1653

def allow_write
  @allow_write
end

#deny_readObject

Returns the value of attribute deny_read.



1653
1654
1655
# File 'lib/claude_agent_sdk/types.rb', line 1653

def deny_read
  @deny_read
end

#deny_writeObject

Returns the value of attribute deny_write.



1653
1654
1655
# File 'lib/claude_agent_sdk/types.rb', line 1653

def deny_write
  @deny_write
end

Instance Method Details

#to_hObject



1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/claude_agent_sdk/types.rb', line 1664

def to_h
  result = {}
  result[:allowWrite] = @allow_write if @allow_write
  result[:denyWrite] = @deny_write if @deny_write
  result[:denyRead] = @deny_read if @deny_read
  result[:allowRead] = @allow_read if @allow_read
  result[:allowManagedReadPathsOnly] = @allow_managed_read_paths_only unless @allow_managed_read_paths_only.nil?
  result
end