| 1234567891011121314151617181920212223242526272829303132 |
- """
- Chatto plugin tools, registered without the Chatto adapter.
- Hermes defers platform plugins: a CLI or TUI session never materializes a
- platform, so ``register()`` — where the adapter is registered — does not run
- there, and tools declared only inside it are simply absent from those sessions.
- The ``provides_tools`` declaration in plugin.yaml asks Hermes to import this
- module instead and call ``register_tools(ctx)``; without it, Hermes only logs
- that the declared tools will be missing.
- The tool list itself lives in the adapter module, because that is where the
- handlers live. Both entry points call the same registration, so the two doors
- into the list cannot drift apart.
- """
- try:
- from .adapter import register_plugin_tools
- except ImportError: # pragma: no cover - loaded outside a package (tests)
- from adapter import register_plugin_tools
- __all__ = ["register_tools"]
- def register_tools(ctx) -> None:
- """Register the ``chatto-platform`` toolset with the plugin context.
- Entry point for Hermes' deferred-platform loader, which calls this in a
- session that never loads the adapter. Importing the adapter module here is
- deliberate: the handlers need it, and the deferred loader already imported
- it as this package's ``__init__`` did, so no second copy is loaded.
- """
- register_plugin_tools(ctx)
|