oc_chat
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# oc_chat/tools/__init__.py
4
5"""
6Tool modules — filesystem access, memory, planning, shell, and web.
7
8Purpose
9-------
10Each module exports ``TOOLS`` (a dict of callables) and ``SCHEMAS``
11(a list of OpenAI function definitions). Modules are registered from an
12**explicit allowlist** (:data:`~oc_chat.core.tool_registry._TOOL_MODULE_ALLOWLIST`),
13NOT auto-discovered by a directory glob (M8.0 WU-6 / G-2): an agent-written
14file dropped here is **not** picked up. To add a new first-party tool module,
15add its stem to that allowlist. Third-party tools use the
16``[project.entry-points."oc_chat.tools"]`` group and load only under the
17``permissive`` profile (G-3).
18
19Responsibilities
20----------------
21- Mark ``oc_chat/tools/`` as a Python package.
22- Hold sibling tool modules: ``filesystem``, ``shell``, ``web``,
23 ``memory``, ``planner``, ``oct_tools``, ``migrate_sessions``.
24
25Diagnostics
26-----------
27Domain: OC_CHAT.TOOLS
28Levels:
29 L2 — lifecycle events
30 L3 — semantic details
31 L4 — deep tracing
32
33Contracts
34---------
35- Module-level L4 ``_dbg`` is a diagnostics-coverage marker; it
36 emits nothing at default verbosity (domain default is L2).
37- Tool modules with names starting with ``_`` are skipped by the
38 auto-discovery loop in ``build_tool_registry``.
39
40Dependencies
41------------
42- oc_diagnostics (structured debug logging via _dbg)
43"""
44
45from oc_diagnostics import _dbg
46
47_dbg("OC_CHAT.TOOLS", "module", "loaded", 4)