mirror of
https://github.com/usestrix/strix.git
synced 2026-08-21 02:45:31 +02:00
Cleanup pass after the migration: #1 Inline ``*_actions.py`` into wrapper ``tool[s].py`` for the non-sandbox tools (think, todo, notes, reporting, web_search, finish_scan). One file per tool family now. Helpers + public function bodies live alongside the ``@strix_tool``-decorated wrappers that call them. For notes, the sync helpers are renamed to ``_create_note_impl`` / ``_list_notes_impl`` / etc. so the public names ``create_note`` / ``list_notes`` / etc. can be the FunctionTool instances the agent factory imports. ``append_note_content`` (used by the agents-graph wiki-update hook) calls the impl helpers directly. #2 Delete ``strix/tools/_state_adapter.py``. The ``AgentStateAdapter`` shim only existed to feed legacy ``*_actions.py`` functions a ``state.agent_id`` they could read. With the actions inlined, the wrappers read ``ctx.context['agent_id']`` directly. #3 Strip ``strix/tools/registry.py`` from ~250 LOC to ~110. Deleted: XML schema loading, ``_parse_param_schema``, ``get_tools_prompt``, ``get_tool_param_schema``, ``needs_agent_state``, ``should_execute_in_sandbox``, ``validate_tool_availability`` — all for the host-side legacy dispatcher path. Kept the ``register_tool`` decorator (sandbox side), ``get_tool_by_name``, ``get_tool_names``, ``tools`` list, ``clear_registry``. The Jinja prompt template's ``{{ get_tools_prompt() }}`` injection is dropped — the SDK auto-generates tool descriptions from function signatures, so the legacy XML tool block was redundant and stale. #4 Delete every ``*_actions_schema.xml`` (12 files). They were read by the now-removed ``_load_xml_schema`` to build the legacy prompt's tool descriptions. No consumer remains. Side fixes: - ``reporting_renderer.py`` updated to import ``_parse_*_xml`` from the new location with leading underscore. - ``test_local_tools.py``, ``test_notes_jsonl_concurrency.py``, ``test_notes_wiki.py`` updated to point at the new module paths and call the ``_*_impl`` sync helpers. Tests: 279/279 passing. ~1500 LOC of action files moved into the tool wrappers; ~140 LOC of registry boilerplate removed; ~400 lines of dead XML deleted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""Tool package.
|
|
|
|
Importing every sub-package triggers the ``@register_tool``
|
|
decorations that populate ``strix.tools.registry.tools``. The
|
|
in-container FastAPI tool server (:mod:`strix.runtime.tool_server`)
|
|
dispatches against that registry.
|
|
|
|
Host-side SDK function tools live in ``<family>/tool[s].py`` and are
|
|
imported directly by :mod:`strix.agents.factory` — they don't flow
|
|
through this registry.
|
|
"""
|
|
|
|
from .agents_graph import * # noqa: F403
|
|
from .browser import * # noqa: F403
|
|
from .file_edit import * # noqa: F403
|
|
from .finish import * # noqa: F403
|
|
from .notes import * # noqa: F403
|
|
from .proxy import * # noqa: F403
|
|
from .python import * # noqa: F403
|
|
from .registry import (
|
|
ImplementedInClientSideOnlyError,
|
|
get_tool_by_name,
|
|
get_tool_names,
|
|
register_tool,
|
|
tools,
|
|
)
|
|
from .reporting import * # noqa: F403
|
|
from .terminal import * # noqa: F403
|
|
from .thinking import * # noqa: F403
|
|
from .todo import * # noqa: F403
|
|
from .web_search import * # noqa: F403
|
|
|
|
|
|
__all__ = [
|
|
"ImplementedInClientSideOnlyError",
|
|
"get_tool_by_name",
|
|
"get_tool_names",
|
|
"register_tool",
|
|
"tools",
|
|
]
|