Expand description
Extension system for oxi
Extensions allow custom tools, commands, and event hooks to be loaded
dynamically at runtime. Extensions can be loaded from shared libraries
(.so/.dll/.dylib) via the -e/--extension CLI flag.
§Architecture
The extension system is modeled after pi-mono’s extension API and provides:
- Extension manifest — metadata, permissions, configuration schema
- Extension lifecycle hooks —
on_load,on_unload, message/tool/session events - Extension context — access to settings, session state, tool registration, messaging
- Extension error handling — graceful degradation with logging
- Extension registry — name-based lookup, enable/disable, hot-reload
Structs§
- Command
- A simple command definition for the CLI.
- Extension
Context - Context provided to extension lifecycle hooks and event handlers.
- Extension
Context Builder - Builder for
ExtensionContext. - Extension
Error Record - Recorded extension error for diagnostics and logging.
- Extension
Manifest - Metadata describing an extension.
- Extension
Registry - Manages a collection of loaded extensions.
- Noop
Extension - A minimal extension that does nothing — useful as a template and for tests.
Enums§
- Extension
Error - Errors that can occur during extension operations.
- Extension
Permission - Permissions that an extension may request.
Traits§
- Extension
- Core trait that every oxi extension must implement.
Functions§
- load_
extension - Load an extension from a shared library (.so / .dll / .dylib).
- load_
extensions - Load multiple extensions from file paths, collecting errors.