mirror of
https://github.com/pydantic/pydantic-ai-harness.git
synced 2026-07-21 02:45:34 +00:00
* refactor: graduate capabilities out of `experimental` (ACP excepted) The `experimental` label suppressed the try->fail->report->improve loop we want from real usage, so drop it from the harness. Ten capabilities move to top-level submodules; ACP stays experimental (it may still be reshaped or moved to core, and can't be generic across agents). - Old `pydantic_ai_harness.experimental.<name>` paths keep working as DeprecationWarning shims (via `warn_moved`), so existing imports don't break. - Renames to match capability names: authoring -> runtime_authoring, overflow -> overflowing_tool_output. - Capabilities stay in individual submodules with no top-level re-export, so importing the root package never pulls in a capability's optional deps. - Docs drop the experimental framing and the "may be removed in any release" language in favor of "API subject to change". * docs: tell capability authors to ask the user when unsure about a name Per PR review: a name is a public commitment once shipped, so ask rather than guess.
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
"""Toolset exposing the asset-inventory tool."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from collections.abc import Sequence
|
|
from pathlib import Path
|
|
|
|
from pydantic_ai.tools import AgentDepsT
|
|
from pydantic_ai.toolsets import FunctionToolset
|
|
|
|
from pydantic_ai_harness.context._inventory import AgentContextInventory, scan_assets
|
|
|
|
|
|
class RepoContextToolset(FunctionToolset[AgentDepsT]):
|
|
"""Exposes a single tool that reports where the repo's CE assets live."""
|
|
|
|
def __init__(self, workspace_dir: Path, asset_roots: Sequence[str], tool_name: str) -> None:
|
|
super().__init__()
|
|
self._workspace_dir = workspace_dir
|
|
self._asset_roots = asset_roots
|
|
self.add_function(self.inventory_agent_context, name=tool_name)
|
|
|
|
async def inventory_agent_context(self) -> AgentContextInventory:
|
|
"""Report where this repo's coding-assistant setup lives.
|
|
|
|
Returns the locations of instruction dirs (`.claude`, `.agents`,
|
|
`.codex`, `.grok`) and, within each, the `skills/`, `agents/`, and
|
|
`settings.json` (hooks) it contains. This locates assets so you can read
|
|
and translate them; it does not parse their contents.
|
|
"""
|
|
return scan_assets(self._workspace_dir, self._asset_roots)
|