feat(02-02): tool registry, executor, and 4 built-in tools

- ToolDefinition Pydantic model with JSON Schema parameters + handler
- BUILTIN_TOOLS: web_search, kb_search, http_request, calendar_lookup
- http_request requires_confirmation=True (outbound side effects)
- get_tools_for_agent filters by agent.tool_assignments
- to_litellm_format converts to OpenAI function-calling schema
- execute_tool: jsonschema validation before handler call
- execute_tool: confirmation gate for requires_confirmation=True
- execute_tool: audit logging on every invocation (success + failure)
- web_search: Brave Search API with BRAVE_API_KEY env var
- kb_search: pgvector cosine similarity with HNSW index
- http_request: 30s timeout, 1MB cap, GET/POST/PUT/DELETE only
- calendar_lookup: Google Calendar events.list read-only
- jsonschema dependency added to orchestrator pyproject.toml
- [Rule 1 - Bug] Added missing execute_tool import in test
This commit is contained in:
2026-03-23 14:54:14 -06:00
parent a025cadc44
commit f49927888e
10 changed files with 790 additions and 0 deletions

View File

@@ -243,6 +243,7 @@ class TestExecuteToolConfirmation:
async def test_confirmation_required_does_not_call_handler(self):
"""Handler must NOT be called when requires_confirmation=True."""
from orchestrator.tools.executor import execute_tool
from orchestrator.tools.registry import ToolDefinition
handler_called = False