The extension host is the part of a Kael application that owns the plugin lifecycle. It tracks which extensions are loaded, which are active, and what UI contributions are available at any given moment. You interact with it through two complementary types: the lower-levelDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Augani/kael/llms.txt
Use this file to discover all available pages before exploring further.
ExtensionHost struct and the higher-level ExtensionHostRuntime that adds process supervision, IPC transport management, and disk-based installation on top.
ExtensionHost vs ExtensionHostRuntime
ExtensionHost | ExtensionHostRuntime | |
|---|---|---|
| Defined in | plugin.rs | extension_host.rs |
| Manages manifests | Yes | Yes (delegates to ExtensionHost) |
| Spawns processes | No | Yes (via ProcessSupervisor) |
| Manages transports | No | Yes |
| Reads from disk | No | Yes |
| Dev-mode loading | No | Yes |
ExtensionHost directly in unit tests or embedded contexts where you control manifest loading manually. Use ExtensionHostRuntime in production application code.
ExtensionHostRuntime
Creating an instance
new creates the extensions directory if it does not already exist. The app_id string is used when generating per-extension IPC socket paths.
Loading extensions
You have three ways to bring an extension into the host:- Load from manifest struct
- Dev mode (from directory)
- Install from path
Pass a
PluginManifest you already have in memory. API compatibility is checked before the manifest is accepted.API compatibility checking
Before a manifest is accepted byExtensionHostRuntime::load, Kael checks whether the plugin’s declared api_version is compatible with the host:
load calls is_api_compatible and returns an error if the check fails:
2.x or 0.x API version is rejected. Only 1.x versions are accepted by the current host.
Extension lifecycle
Once loaded, an extension moves through a well-defined set of states.Activated
Call After
activate to mark the extension as live. For ExternalProcess extensions, the runtime also spawns the child process and sets up the IPC transport.attach_process, is_active is true and process_id holds the running process identifier.Deactivated
deactivate sets is_active to false and clears process_id. The host stops routing requests to the extension.ExtensionInfo
The host stores one ExtensionInfo value per loaded extension:
host.get(id):
Querying extensions
ExtensionHost provides several read methods:
Contribution aggregates only include contributions from active extensions. An extension that is loaded but not yet activated does not contribute to the command palette, menus, or panels.
Listing and uninstalling extensions on disk
uninstall errors if the extension is currently active. Deactivate it first.
ExtensionHost standalone usage
When you do not need process management, use ExtensionHost directly:
ExtensionHost implements Default, so ExtensionHost::default() is equivalent to ExtensionHost::new().