mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
More major refactor/tech debt removal!
This commit is contained in:
parent
6134939882
commit
08ff1c1aa8
22 changed files with 1394 additions and 2315 deletions
|
|
@ -637,3 +637,58 @@ if __name__ == "__main__":
|
|||
print(f"Preview: {result['content'][:150]}...")
|
||||
else:
|
||||
print(f"Error: {result['error']}")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Registry
|
||||
# ---------------------------------------------------------------------------
|
||||
from tools.registry import registry
|
||||
|
||||
SKILLS_LIST_SCHEMA = {
|
||||
"name": "skills_list",
|
||||
"description": "List available skills (name + description). Use skill_view(name) to load full content.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string",
|
||||
"description": "Optional category filter to narrow results"
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
|
||||
SKILL_VIEW_SCHEMA = {
|
||||
"name": "skill_view",
|
||||
"description": "Skills allow for loading information about specific tasks and workflows, as well as scripts and templates. Load a skill's full content or access its linked files (references, templates, scripts). First call returns SKILL.md content plus a 'linked_files' dict showing available references/templates/scripts. To access those, call again with file_path parameter.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The skill name (use skills_list to see available skills)"
|
||||
},
|
||||
"file_path": {
|
||||
"type": "string",
|
||||
"description": "OPTIONAL: Path to a linked file within the skill (e.g., 'references/api.md', 'templates/config.yaml', 'scripts/validate.py'). Omit to get the main SKILL.md content."
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
}
|
||||
}
|
||||
|
||||
registry.register(
|
||||
name="skills_list",
|
||||
toolset="skills",
|
||||
schema=SKILLS_LIST_SCHEMA,
|
||||
handler=lambda args, **kw: skills_list(category=args.get("category")),
|
||||
check_fn=check_skills_requirements,
|
||||
)
|
||||
registry.register(
|
||||
name="skill_view",
|
||||
toolset="skills",
|
||||
schema=SKILL_VIEW_SCHEMA,
|
||||
handler=lambda args, **kw: skill_view(args.get("name", ""), file_path=args.get("file_path")),
|
||||
check_fn=check_skills_requirements,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue