Agent Zero AI framework
skills + ui fixes
frdel5bb41360c255
diff --git a/conf/skill.default.gitignore b/conf/skill.default.gitignorenew file mode 100644index 000000000..e7c91367f--- /dev/null+++ b/conf/skill.default.gitignore@@ -0,0 +1,10 @@+# Python environments & cache+venv/+**/__pycache__/++# Node.js dependencies+**/node_modules/+**/.npm/++# Version control metadata+**/.git/diff --git a/prompts/agent.system.tool.skills.md b/prompts/agent.system.tool.skills.mdindex 1a0a3cef9..d88e98047 100644--- a/prompts/agent.system.tool.skills.md+++ b/prompts/agent.system.tool.skills.md@@ -116,40 +116,10 @@ Security:- Only files within skill directory accessible- Supports markdown, text, code files-### 4. search skills by query--Searches skills by text matching in name, description, and tags-Returns ranked results by relevance score-Use when: looking for skills without knowing exact name--~~~json-{- "thoughts": [- "User needs web scraping capability",- "Not sure of exact skill name",- "Searching for web-related skills"- ],- "headline": "Searching for web scraping skills",- "tool_name": "skills_tool",- "tool_args": {- "method": "search",- "query": "web scraping html parsing"- }-}-~~~--Required args:-- query: search text (searches name, description, tags)--Scoring:-- Name match: +3 points-- Description match: +2 points-- Tag match: +1 point per tag-- Results sorted by descending score## Running skill scripts-When a skill includes scripts (listed under its files), use code_execution_tool directly to run them.+When a skill includes scripts (listed under its files), use code_execution_tool with runtime terminal directly to run them.The skill's "load" output shows the skill directory path and lists available scripts.Use read_file to inspect a script before running it if needed.@@ -166,28 +136,13 @@ Example: running a Python script from a skill],"headline": "Converting PDF to images","tool_name": "code_execution_tool",- "tool_args": {- "runtime": "python",- "code": "import subprocess\nsubprocess.run(['python', '/path/to/skill/scripts/convert_pdf_to_images.py', '/path/to/document.pdf', '/tmp/images'], check=True)"- }-}-~~~--Example: running a shell script from a skill-~~~json-{- "thoughts": [- "Skill provides a shell script for data processing",- "Running it via terminal runtime"- ],- "headline": "Running data processing script",- "tool_name": "code_execution_tool","tool_args": {"runtime": "terminal",- "code": "cd /path/to/skill && bash scripts/process.sh /data/input.csv /tmp/output"+ "code": "python /path/to/skill/scripts/convert_pdf_to_images.py /path/to/document.pdf /tmp/images"}}~~~+## Best Practices### When to use skills vs other toolsdiff --git a/python/helpers/files.py b/python/helpers/files.pyindex fc93bbbcf..db565f3a1 100644--- a/python/helpers/files.py+++ b/python/helpers/files.py@@ -352,7 +352,7 @@ def find_file_in_dirs(_filename: str, _directories: list[str]):)-def get_unique_filenames_in_dirs(dir_paths: list[str], type: Literal["file", "dir", "any"] = "file", pattern: str = "*"):+def get_unique_filenames_in_dirs(dir_paths: list[str], pattern: str = "*", type: Literal["file", "dir", "any"] = "file"):# returns absolute paths for unique filenames, priority by order in dir_pathsseen = set()result = []diff --git a/python/tools/skills_tool.py b/python/tools/skills_tool.pyindex 4ae56bc14..c392c443b 100644--- a/python/tools/skills_tool.py+++ b/python/tools/skills_tool.py@@ -4,8 +4,7 @@ from pathlib import Pathfrom typing import Listfrom python.helpers.tool import Tool, Response-from python.helpers import files-from python.helpers import projects+from python.helpers import projects, files, file_treefrom python.helpers import skills as skills_helper@@ -32,9 +31,9 @@ class SkillsTool(Tool):try:if method == "list":return Response(message=self._list(), break_loop=False)- if method == "search":- query = str(kwargs.get("query") or "").strip()- return Response(message=self._search(query), break_loop=False)+ # if method == "search":+ # query = str(kwargs.get("query") or "").strip()+ # return Response(message=self._search(query), break_loop=False)if method == "load":skill_name = str(kwargs.get("skill_name") or "").strip()return Response(message=self._load(skill_name), break_loop=False)@@ -159,8 +158,7 @@ class SkillsTool(Tool):if referenced_files:lines.append("Files in skill directory (use skills_tool method=read_file to open):")- for p in referenced_files:- lines.append(f"- {p}")+ lines.append(referenced_files)else:lines.append("No additional files found in skill directory.")@@ -196,77 +194,21 @@ class SkillsTool(Tool):text = content.decode("utf-8", errors="replace")return f"File: {file_path}\n\n{text}"- def _list_skill_files(self, skill_dir: Path, *, max_files: int = 80) -> List[str]:+ def _list_skill_files(self, skill_dir: Path, *, max_files: int = 80) -> str:if not skill_dir.exists():return []- results: List[str] = []-- preferred_dirs = ["scripts", "references", "assets", "templates", "docs"]-- # 1) Root-level files (excluding SKILL.md)- try:- for p in sorted(skill_dir.iterdir(), key=lambda x: x.name):- if len(results) >= max_files:- return results- if p.name.startswith("."):- continue- if p.is_file():- if p.name == "SKILL.md":- continue- results.append(p.name)- except Exception:- pass-- # 2) Preferred optional directories (one level deep)- for dname in preferred_dirs:- dpath = skill_dir / dname- if not dpath.exists() or not dpath.is_dir():- continue- try:- for p in sorted(dpath.iterdir(), key=lambda x: x.name):- if len(results) >= max_files:- return results- if p.name.startswith("."):- continue- if p.is_file():- results.append(f"{dname}/{p.name}")- elif p.is_dir():- # Show one nested level (common in assets/templates/*)- nested_added = False- try:- for sub in sorted(p.iterdir(), key=lambda x: x.name):- if sub.name.startswith("."):- continue- if sub.is_file():- results.append(f"{dname}/{p.name}/{sub.name}")- nested_added = True- break- except Exception:- pass- if not nested_added:- results.append(f"{dname}/{p.name}/")- except Exception:- continue-- # 3) Other directories (one level deep)- try:- for p in sorted(skill_dir.iterdir(), key=lambda x: x.name):- if len(results) >= max_files:- return results- if p.name.startswith(".") or p.name in preferred_dirs:- continue- if p.is_dir():- for sub in sorted(p.iterdir(), key=lambda x: x.name):- if len(results) >= max_files:- return results- if sub.name.startswith("."):- continue- if sub.is_file():- results.append(f"{p.name}/{sub.name}")- except Exception:- pass-- return results+ tree = file_tree.file_tree(+ str(skill_dir),+ max_depth=10,+ folders_first=True,+ max_files=100,+ max_folders=100,+ output_mode="string",+ max_lines=300,+ ignore=files.read_file("conf/skill.default.gitignore")+ )+ return tree+diff --git a/webui/components/messages/process-group/process-group.css b/webui/components/messages/process-group/process-group.cssindex 2d58d0bce..bef0a4145 100644--- a/webui/components/messages/process-group/process-group.css+++ b/webui/components/messages/process-group/process-group.css@@ -463,11 +463,13 @@margin-top: 0;transition: grid-template-rows 0.2s ease-out, opacity 0.15s ease-out, margin-top 0.2s ease-out;overflow: hidden;- -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */- overscroll-behavior: contain; /* avoid scroll chaining */max-width: 100%;}+.process-step-detail-content{+ white-space: pre-wrap;+}+.process-step-detail,.process-step-detail-scroll {scrollbar-width: thin; /* Firefox */@@ -534,7 +536,7 @@font-size: var(--font-size-xs);line-height: 1.5;-webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */- overscroll-behavior-x: contain; /* avoid scroll chaining */+ overscroll-behavior-x: contain;}/* .process-step-detail-scroll pre {