Files
Teknium 95505c60e9 docs(tools): lead every tool description with its key capability
The deferred tool_search catalog shows each tool's first sentence clipped to
60 chars, so lines like 'image_generate: Generate high-quality images from
text prompts, or edit /…' hid that it edits with reference images on the
user's configured model. An agent skipped it and called FAL directly with a
hardcoded model.

- catalog line cap 60 -> 80 (CATALOG_SUMMARY_MAX_CHARS); every built-in
  tool's first sentence now fits and leads with what it does
- image_generate/video_generate say they use the configured model;
  image_generate says to use it rather than direct API calls/scripts
- web_search/web_extract/browser_exec name when to use each other
- drop a duplicated cronjob sentence and filler in skill_view/video_generate
- regenerate tests/fixtures/prompt_surface
2026-10-23 16:04:50 -07:00

48 lines
1.6 KiB
Python

#!/usr/bin/env python3
"""Reveal/focus a pane in the Hermes desktop GUI (``pane.reveal`` via ``desktop_ui``).
The renderer runs each pane's own reveal path and only acts on the active window, so
a background turn never moves the user's focus. URLs/files go through `desktop_preview`.
"""
from tools import desktop_ui
from tools.registry import registry, tool_error
PANES = ("chat", "files", "terminal", "review", "sessions")
def focus_pane_tool(pane: str) -> str:
"""Ask the desktop GUI to reveal and focus ``pane``."""
name = (pane or "").strip().lower()
if name not in PANES:
return tool_error(f"pane must be one of: {', '.join(PANES)}.")
return desktop_ui.emit_or_error(
"pane.reveal", {"pane": name}, f"Failed to focus the {name} pane: ",
"Pane focus is only available in the Hermes desktop app.", {"success": True, "pane": name})
registry.register(
name="focus_pane",
toolset="desktop_ui",
schema={
"name": "focus_pane",
"description": (
"Show a desktop pane: chat, files, terminal, review (git diff) or sessions. "
"Use when the user asks to see one; for URLs/files use desktop_preview."
),
"parameters": {
"type": "object",
"properties": {
"pane": {
"type": "string",
"enum": list(PANES),
"description": "Which pane to reveal.",
},
},
"required": ["pane"],
},
},
handler=lambda args, **kw: focus_pane_tool(pane=args.get("pane", "")),
emoji="🪟",
)