- Introduced a new cron job system allowing users to schedule automated tasks via the CLI, supporting one-time reminders and recurring jobs.
- Added commands for managing cron jobs: `/cron` to list jobs, `/cron add` to create new jobs, and `/cron remove` to delete jobs.
- Implemented job storage in `~/.hermes/cron/jobs.json` with output saved to `~/.hermes/cron/output/{job_id}/{timestamp}.md`.
- Enhanced the CLI and README documentation to include detailed usage instructions and examples for cron job management.
- Integrated cron job tools into the hermes-cli toolset, ensuring they are only available in interactive CLI mode.
- Added support for cron expression parsing with the `croniter` package, enabling flexible scheduling options.
157 lines
4.0 KiB
Python
157 lines
4.0 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Tools Package
|
|
|
|
This package contains all the specific tool implementations for the Hermes Agent.
|
|
Each module provides specialized functionality for different capabilities:
|
|
|
|
- web_tools: Web search, content extraction, and crawling
|
|
- terminal_tool: Command execution using mini-swe-agent (local/docker/modal backends)
|
|
- terminal_hecate: Command execution on MorphCloud/Hecate cloud VMs (alternative backend)
|
|
- vision_tools: Image analysis and understanding
|
|
- mixture_of_agents_tool: Multi-model collaborative reasoning
|
|
- image_generation_tool: Text-to-image generation with upscaling
|
|
|
|
The tools are imported into model_tools.py which provides a unified interface
|
|
for the AI agent to access all capabilities.
|
|
"""
|
|
|
|
# Export all tools for easy importing
|
|
from .web_tools import (
|
|
web_search_tool,
|
|
web_extract_tool,
|
|
web_crawl_tool,
|
|
check_firecrawl_api_key
|
|
)
|
|
|
|
# Primary terminal tool (mini-swe-agent backend: local/docker/singularity/modal)
|
|
from .terminal_tool import (
|
|
terminal_tool,
|
|
check_terminal_requirements,
|
|
cleanup_vm,
|
|
cleanup_all_environments,
|
|
get_active_environments_info,
|
|
TERMINAL_TOOL_DESCRIPTION
|
|
)
|
|
|
|
# Alternative terminal tool (Hecate/MorphCloud cloud VMs)
|
|
from .terminal_hecate import (
|
|
terminal_hecate_tool,
|
|
check_hecate_requirements,
|
|
TERMINAL_HECATE_DESCRIPTION
|
|
)
|
|
|
|
from .vision_tools import (
|
|
vision_analyze_tool,
|
|
check_vision_requirements
|
|
)
|
|
|
|
from .mixture_of_agents_tool import (
|
|
mixture_of_agents_tool,
|
|
check_moa_requirements
|
|
)
|
|
|
|
from .image_generation_tool import (
|
|
image_generate_tool,
|
|
check_image_generation_requirements
|
|
)
|
|
|
|
from .skills_tool import (
|
|
skills_categories,
|
|
skills_list,
|
|
skill_view,
|
|
check_skills_requirements,
|
|
SKILLS_TOOL_DESCRIPTION
|
|
)
|
|
|
|
# Browser automation tools (agent-browser + Browserbase)
|
|
from .browser_tool import (
|
|
browser_navigate,
|
|
browser_snapshot,
|
|
browser_click,
|
|
browser_type,
|
|
browser_scroll,
|
|
browser_back,
|
|
browser_press,
|
|
browser_close,
|
|
browser_get_images,
|
|
browser_vision,
|
|
cleanup_browser,
|
|
cleanup_all_browsers,
|
|
get_active_browser_sessions,
|
|
check_browser_requirements,
|
|
BROWSER_TOOL_SCHEMAS
|
|
)
|
|
|
|
# Cronjob management tools (CLI-only, hermes-cli toolset)
|
|
from .cronjob_tools import (
|
|
schedule_cronjob,
|
|
list_cronjobs,
|
|
remove_cronjob,
|
|
check_cronjob_requirements,
|
|
get_cronjob_tool_definitions,
|
|
SCHEDULE_CRONJOB_SCHEMA,
|
|
LIST_CRONJOBS_SCHEMA,
|
|
REMOVE_CRONJOB_SCHEMA
|
|
)
|
|
|
|
__all__ = [
|
|
# Web tools
|
|
'web_search_tool',
|
|
'web_extract_tool',
|
|
'web_crawl_tool',
|
|
'check_firecrawl_api_key',
|
|
# Terminal tools (mini-swe-agent backend)
|
|
'terminal_tool',
|
|
'check_terminal_requirements',
|
|
'cleanup_vm',
|
|
'cleanup_all_environments',
|
|
'get_active_environments_info',
|
|
'TERMINAL_TOOL_DESCRIPTION',
|
|
# Terminal tools (Hecate/MorphCloud backend)
|
|
'terminal_hecate_tool',
|
|
'check_hecate_requirements',
|
|
'TERMINAL_HECATE_DESCRIPTION',
|
|
# Vision tools
|
|
'vision_analyze_tool',
|
|
'check_vision_requirements',
|
|
# MoA tools
|
|
'mixture_of_agents_tool',
|
|
'check_moa_requirements',
|
|
# Image generation tools
|
|
'image_generate_tool',
|
|
'check_image_generation_requirements',
|
|
# Skills tools
|
|
'skills_categories',
|
|
'skills_list',
|
|
'skill_view',
|
|
'check_skills_requirements',
|
|
'SKILLS_TOOL_DESCRIPTION',
|
|
# Browser automation tools
|
|
'browser_navigate',
|
|
'browser_snapshot',
|
|
'browser_click',
|
|
'browser_type',
|
|
'browser_scroll',
|
|
'browser_back',
|
|
'browser_press',
|
|
'browser_close',
|
|
'browser_get_images',
|
|
'browser_vision',
|
|
'cleanup_browser',
|
|
'cleanup_all_browsers',
|
|
'get_active_browser_sessions',
|
|
'check_browser_requirements',
|
|
'BROWSER_TOOL_SCHEMAS',
|
|
# Cronjob management tools (CLI-only)
|
|
'schedule_cronjob',
|
|
'list_cronjobs',
|
|
'remove_cronjob',
|
|
'check_cronjob_requirements',
|
|
'get_cronjob_tool_definitions',
|
|
'SCHEDULE_CRONJOB_SCHEMA',
|
|
'LIST_CRONJOBS_SCHEMA',
|
|
'REMOVE_CRONJOB_SCHEMA',
|
|
]
|
|
|