tooluniverse.build_optimizer moduleΒΆ

Build optimization utilities for ToolUniverse tools.

tooluniverse.build_optimizer.calculate_tool_hash(tool_config, verbose=False)[source]ΒΆ

Calculate a hash for tool configuration to detect changes.

Parameters:
  • tool_config (Dict[str, Any]) – Tool configuration dictionary

  • verbose (bool) – If True, print excluded fields (for debugging)

Returns:

MD5 hash string of the normalized configuration

Return type:

str

tooluniverse.build_optimizer.load_metadata(metadata_file)[source]ΒΆ

Load tool metadata from file.

tooluniverse.build_optimizer.save_metadata(metadata, metadata_file)[source]ΒΆ

Save tool metadata to file.

tooluniverse.build_optimizer.cleanup_orphaned_files(tools_dir, current_tool_names)[source]ΒΆ

Remove files for tools that no longer exist.

tooluniverse.build_optimizer.get_changed_tools(current_tools, metadata_file, force_regenerate=False, verbose=False)[source]ΒΆ

Get lists of new, changed, and unchanged tools.

Parameters:
  • current_tools (Dict[str, Any]) – Dictionary of current tool configurations

  • metadata_file (Path) – Path to metadata file storing previous hashes

  • force_regenerate (bool) – If True, mark all tools as changed

  • verbose (bool) – If True, provide detailed change information

Returns:

Tuple of (new_tools, changed_tools, unchanged_tools, change_details) where change_details maps tool_name -> list of changed field names

Return type:

Tuple[list, list, list, Dict[str, list]]