Initialize base tools (independent of workspace) These tools are loaded from package configuration and don't depend on workspace. Note: File tools are now workspace-dependent and initialized in add_workspace_tools() Args: config: Configuration object Returns: Tuple
(config: Config)
| 336 | |
| 337 | |
| 338 | async def initialize_base_tools(config: Config): |
| 339 | """Initialize base tools (independent of workspace) |
| 340 | |
| 341 | These tools are loaded from package configuration and don't depend on workspace. |
| 342 | Note: File tools are now workspace-dependent and initialized in add_workspace_tools() |
| 343 | |
| 344 | Args: |
| 345 | config: Configuration object |
| 346 | |
| 347 | Returns: |
| 348 | Tuple of (list of tools, skill loader if skills enabled) |
| 349 | """ |
| 350 | |
| 351 | tools = [] |
| 352 | skill_loader = None |
| 353 | |
| 354 | # 1. Bash auxiliary tools (output monitoring and kill) |
| 355 | # Note: BashTool itself is created in add_workspace_tools() with workspace_dir as cwd |
| 356 | if config.tools.enable_bash: |
| 357 | bash_output_tool = BashOutputTool() |
| 358 | tools.append(bash_output_tool) |
| 359 | print(f"{Colors.GREEN}✅ Loaded Bash Output tool{Colors.RESET}") |
| 360 | |
| 361 | bash_kill_tool = BashKillTool() |
| 362 | tools.append(bash_kill_tool) |
| 363 | print(f"{Colors.GREEN}✅ Loaded Bash Kill tool{Colors.RESET}") |
| 364 | |
| 365 | # 3. Claude Skills (loaded from package directory) |
| 366 | if config.tools.enable_skills: |
| 367 | print(f"{Colors.BRIGHT_CYAN}Loading Claude Skills...{Colors.RESET}") |
| 368 | try: |
| 369 | # Resolve skills directory with priority search |
| 370 | # Expand ~ to user home directory for portability |
| 371 | skills_path = Path(config.tools.skills_dir).expanduser() |
| 372 | if skills_path.is_absolute(): |
| 373 | skills_dir = str(skills_path) |
| 374 | else: |
| 375 | # Search in priority order: |
| 376 | # 1. Current directory (dev mode: ./skills or ./mini_agent/skills) |
| 377 | # 2. Package directory (installed: site-packages/mini_agent/skills) |
| 378 | search_paths = [ |
| 379 | skills_path, # ./skills for backward compatibility |
| 380 | Path("mini_agent") / skills_path, # ./mini_agent/skills |
| 381 | Config.get_package_dir() / skills_path, # site-packages/mini_agent/skills |
| 382 | ] |
| 383 | |
| 384 | # Find first existing path |
| 385 | skills_dir = str(skills_path) # default |
| 386 | for path in search_paths: |
| 387 | if path.exists(): |
| 388 | skills_dir = str(path.resolve()) |
| 389 | break |
| 390 | |
| 391 | skill_tools, skill_loader = create_skill_tools(skills_dir) |
| 392 | if skill_tools: |
| 393 | tools.extend(skill_tools) |
| 394 | print(f"{Colors.GREEN}✅ Loaded Skill tool (get_skill){Colors.RESET}") |
| 395 | else: |
no test coverage detected