pub struct CustomToolManager { /* private fields */ }Expand description
Custom-tool manager — loads the global custom-tools config.
Deliberately global-only: a custom tool is a shell command template, and a
project-level .tinyharness/custom_tools.json travels with the repository,
so honouring it would let any cloned repo register commands that run on the
user’s machine (contained by the process sandbox only when that is on).
Implementations§
Source§impl CustomToolManager
impl CustomToolManager
Sourcepub fn load() -> Self
pub fn load() -> Self
Load the global custom-tools config.
Resolved from the ambient environment — use CustomToolManager::load_from
when the caller has a Paths.
Sourcepub fn load_from(paths: &Paths) -> Self
pub fn load_from(paths: &Paths) -> Self
Load the global config from paths.custom_tools_file().
There is deliberately no project config: a
.tinyharness/custom_tools.json inside a cloned repository would
register shell commands on the user’s machine, so project-level custom
tools are not discovered at all.
Sourcepub fn from_config(config: CustomToolConfig) -> Self
pub fn from_config(config: CustomToolConfig) -> Self
Load from an explicit config (for testing).
Sourcepub fn custom_tools(&self) -> &[CustomToolDefinition]
pub fn custom_tools(&self) -> &[CustomToolDefinition]
Return the list of custom tool definitions.