mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-28 11:40:47 +00:00
Added a builtin plugin that you can open from the chat input plus button menu, which shows you a list of skills that you can directly activate in the current context/project. Default configs allow users to start over with skills already active, instead of losing time and tokens asking Agent Zero to do it. Update prompt for manual skill selector add thumbnail for _skills builtin plugin
24 lines
721 B
Python
24 lines
721 B
Python
from __future__ import annotations
|
|
|
|
from helpers.api import ApiHandler, Request, Response
|
|
|
|
from plugins._skills.helpers.runtime import (
|
|
get_max_active_skills,
|
|
list_catalog,
|
|
)
|
|
|
|
|
|
class SkillsCatalog(ApiHandler):
|
|
async def process(self, input: dict, request: Request) -> dict | Response:
|
|
action = str(input.get("action", "list") or "list").strip().lower()
|
|
|
|
if action != "list":
|
|
return {"ok": False, "error": f"Unknown action: {action}"}
|
|
|
|
project_name = str(input.get("project_name", "") or "").strip()
|
|
|
|
return {
|
|
"ok": True,
|
|
"skills": list_catalog(project_name=project_name),
|
|
"max_active_skills": get_max_active_skills(),
|
|
}
|