mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
Merge 66223e5bbf into a5129c72ef
This commit is contained in:
commit
b49d00a8fb
2 changed files with 33 additions and 2 deletions
|
|
@ -839,6 +839,7 @@ def skill_view(name: str, file_path: str = None, task_id: str = None) -> str:
|
|||
JSON string with skill content or error message
|
||||
"""
|
||||
try:
|
||||
local_category_name: str | None = None
|
||||
# ── Qualified name dispatch (plugin skills) ──────────────────
|
||||
# Names containing ':' are routed to the plugin skill registry.
|
||||
# Bare names fall through to the existing flat-tree scan below.
|
||||
|
|
@ -893,8 +894,12 @@ def skill_view(name: str, file_path: str = None, task_id: str = None) -> str:
|
|||
},
|
||||
ensure_ascii=False,
|
||||
)
|
||||
# Plugin itself not found — fall through to flat-tree scan
|
||||
# which will return a normal "not found" with suggestions.
|
||||
# Plugin itself not found — fall through to flat-tree scan.
|
||||
# Categorized local skills also use `category:skill` in config and
|
||||
# gateway prompts, so preserve that form and translate it to the
|
||||
# on-disk `category/skill` path during the local scan below.
|
||||
if bare:
|
||||
local_category_name = f"{namespace}/{bare}"
|
||||
|
||||
from agent.skill_utils import get_external_skills_dirs
|
||||
|
||||
|
|
@ -927,6 +932,15 @@ def skill_view(name: str, file_path: str = None, task_id: str = None) -> str:
|
|||
elif direct_path.with_suffix(".md").exists():
|
||||
skill_md = direct_path.with_suffix(".md")
|
||||
break
|
||||
if local_category_name:
|
||||
categorized_path = search_dir / local_category_name
|
||||
if categorized_path.is_dir() and (categorized_path / "SKILL.md").exists():
|
||||
skill_dir = categorized_path
|
||||
skill_md = categorized_path / "SKILL.md"
|
||||
break
|
||||
elif categorized_path.with_suffix(".md").exists():
|
||||
skill_md = categorized_path.with_suffix(".md")
|
||||
break
|
||||
|
||||
# Search by directory name across all dirs
|
||||
if not skill_md:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue