Files
oai-web/server/tools/__init__.py
Rune Olsen 7b0a9ccc2b Settings: add dedicated DAV/Pushover tabs, fix CalDAV/CardDAV bugs
- Add admin DAV tab (rename from CalDAV/CardDAV) and Pushover tab
  - Add per-user Pushover tab (User Key only; App Token stays admin-managed)
  - Remove system-wide CalDAV/CardDAV fallback — per-user config only
  - Rewrite contacts_tool.py using httpx directly (caldav 2.x dropped AddressBook)
  - Fix CardDAV REPORT/PROPFIND using SOGo URL pattern
  - Fix CalDAV/CardDAV test endpoints (POST method, URL scheme normalization)
  - Fix Show Password button — API now returns actual credential values
  - Convert Credentials tab to generic key-value store; dedicated keys
    (CalDAV, Pushover, trusted_proxy) excluded via _DEDICATED_CRED_KEYS
2026-04-10 12:06:23 +02:00

57 lines
1.8 KiB
Python

"""
tools/__init__.py — Tool registry factory.
Call build_registry() to get a ToolRegistry populated with all
production tools. The agent loop calls this at startup.
"""
from __future__ import annotations
def build_registry(include_mock: bool = False, is_admin: bool = True):
"""
Build and return a ToolRegistry with all production tools registered.
Args:
include_mock: If True, also register EchoTool and ConfirmTool (for testing).
"""
from ..agent.tool_registry import ToolRegistry
registry = ToolRegistry()
# Production tools — each imported lazily to avoid errors if optional
# dependencies are missing during development
from .brain_tool import BrainTool
from .browser_tool import BrowserTool
from .caldav_tool import CalDAVTool
from .contacts_tool import ContactsTool
from .email_tool import EmailTool
from .filesystem_tool import FilesystemTool
from .image_gen_tool import ImageGenTool
from .pushover_tool import PushoverTool
from .telegram_tool import TelegramTool
from .web_tool import WebTool
from .webhook_tool import WebhookTool
from .whitelist_tool import WhitelistTool
if is_admin:
from .bash_tool import BashTool
registry.register(BashTool())
registry.register(BrainTool())
registry.register(BrowserTool())
registry.register(CalDAVTool())
registry.register(ContactsTool())
registry.register(EmailTool())
registry.register(FilesystemTool())
registry.register(ImageGenTool())
registry.register(WebTool())
registry.register(WebhookTool())
registry.register(PushoverTool())
registry.register(TelegramTool())
registry.register(WhitelistTool())
if include_mock:
from .mock import ConfirmTool, EchoTool
registry.register(EchoTool())
registry.register(ConfirmTool())
return registry