pub struct WorkspaceToolsConfig { /* private fields */ }Expand description
Configuration for workspace tools.
Implementations§
Source§impl WorkspaceToolsConfig
impl WorkspaceToolsConfig
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Creates a config with one workspace root.
A workspace has exactly one root, so a relative path never has to be guessed between candidates. Anything outside that root is named by its own absolute path, where the configured access policy decides reachability.
Sourcepub fn with_live_access_policy(self, policy: LivePolicyHandle) -> Self
pub fn with_live_access_policy(self, policy: LivePolicyHandle) -> Self
Attaches the live unified LivePolicyHandle shared with the process
sandbox and runtime permission review.
Sourcepub fn with_external_tree_policy(
self,
policy: Arc<dyn ExternalTreePolicy>,
) -> Self
pub fn with_external_tree_policy( self, policy: Arc<dyn ExternalTreePolicy>, ) -> Self
Attaches an external writable-tree policy enforced by read and patch tools.
Sourcepub fn readonly_resource_roots(&self) -> &[PathBuf]
pub fn readonly_resource_roots(&self) -> &[PathBuf]
Returns independent read-only resource roots, such as skill directories. Resources are addressable by the same relative read APIs but are never patch targets.
Sourcepub fn with_readonly_resource_roots(self, roots: Vec<PathBuf>) -> Self
pub fn with_readonly_resource_roots(self, roots: Vec<PathBuf>) -> Self
Adds read-only resource roots without treating them as a workspace root.
Sourcepub fn limits(&self) -> &WorkspaceToolLimits
pub fn limits(&self) -> &WorkspaceToolLimits
Returns the configured tool limits.
Sourcepub fn read_scope(&self) -> Option<&[PathBuf]>
pub fn read_scope(&self) -> Option<&[PathBuf]>
Returns the optional workspace-relative read scope for read_file.
Sourcepub fn patch_write_scope(&self) -> Option<&[PathBuf]>
pub fn patch_write_scope(&self) -> Option<&[PathBuf]>
Returns the optional workspace-relative write scope for apply_patch.
Sourcepub fn forbidden_paths(&self) -> &[PathBuf]
pub fn forbidden_paths(&self) -> &[PathBuf]
Returns workspace-relative paths forbidden to apply_patch and read_file.
Sourcepub fn with_limits(self, limits: WorkspaceToolLimits) -> Self
pub fn with_limits(self, limits: WorkspaceToolLimits) -> Self
Sets workspace tool limits.
Sourcepub fn with_read_scope(self, paths: Option<Vec<PathBuf>>) -> Self
pub fn with_read_scope(self, paths: Option<Vec<PathBuf>>) -> Self
Sets the optional root-relative read scope for read_file.
None preserves existing unrestricted workspace read behavior.
Some([]) denies all workspace file reads (read-only resource roots
such as skills remain readable).
Sourcepub fn with_patch_write_scope(self, paths: Option<Vec<PathBuf>>) -> Self
pub fn with_patch_write_scope(self, paths: Option<Vec<PathBuf>>) -> Self
Sets the optional root-relative write scope for apply_patch.
None preserves existing unrestricted patch behavior. Some([]) makes
the patch tool read-only by denying all writes.
Sourcepub fn with_forbidden_paths(self, paths: Vec<PathBuf>) -> Self
pub fn with_forbidden_paths(self, paths: Vec<PathBuf>) -> Self
Sets root-relative paths forbidden to read_file and apply_patch.
Sourcepub fn with_write_forbidden_paths(self, paths: Vec<PathBuf>) -> Self
pub fn with_write_forbidden_paths(self, paths: Vec<PathBuf>) -> Self
Sets root-relative paths forbidden to apply_patch while remaining readable.
Sourcepub fn with_host_path_policy(self, policy: HostPathPolicy) -> Self
pub fn with_host_path_policy(self, policy: HostPathPolicy) -> Self
Sets the shared host path policy for read_file and apply_patch.