Skip to main content

Module extensions

Module extensions 

Source
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 hookson_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.
ExtensionContext
Context provided to extension lifecycle hooks and event handlers.
ExtensionContextBuilder
Builder for ExtensionContext.
ExtensionErrorRecord
Recorded extension error for diagnostics and logging.
ExtensionManifest
Metadata describing an extension.
ExtensionRegistry
Manages a collection of loaded extensions.
NoopExtension
A minimal extension that does nothing — useful as a template and for tests.

Enums§

ExtensionError
Errors that can occur during extension operations.
ExtensionPermission
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.