Expand description
oino-extension-api: the contract between oino-core and any extension runtime
(extension-api.md §6). It knows nothing about wasmtime.
§Boundary
Core implements HostServices (what extensions may do to sessions, UI, models, agents);
a runtime (the WASM host) implements ExtensionRuntime / ExtensionInstance (what core
may ask an extension). Data-model values cross as RawJson with exact shapes (D5);
capability calls use the typed records of the WIT package oino:extension@2.0.0.
§API map
| Module | WIT | Contents |
|---|---|---|
json | types.json | RawJson |
types | types | ExtensionId, CallContext, Mode, CallKind, HostError, ExtensionError |
registry | registry | EventKind (wire names), tool/command/shortcut/flag/renderer specs, Registration |
guest | guest | InitInput, ToolInvocation, CompletionItem |
ops | session, control, models, ui, tasks, secrets, provider-host | one enum variant per WIT function |
runtime | — | ExtensionRuntime, ExtensionInstance, ProviderInstance, HostServices, AgentHandle |
manifest | — | extension.json, manifest::Permissions, package validation |
host_service | host-service | host_service::HostService (capabilities an embedding host registers) |
testing (feature) | — | RecordingHostServices, FakeExtensionRuntime |
Re-exports§
pub use guest::CompletionItem;pub use guest::InitInput;pub use guest::ToolInvocation;pub use host_service::HostService;pub use json::RawJson;pub use manifest::ExtensionKind;pub use manifest::Manifest;pub use registry::EventKind;pub use registry::Registration;pub use runtime::AgentHandle;pub use runtime::BoxFut;pub use runtime::ComponentSource;pub use runtime::DetachedBash;pub use runtime::ExtensionInstance;pub use runtime::ExtensionRuntime;pub use runtime::HostServices;pub use runtime::LoadedPackage;pub use runtime::ProviderEventStream;pub use runtime::ProviderInstance;pub use types::CallContext;pub use types::CallKind;pub use types::ExtensionError;pub use types::ExtensionId;pub use types::HostError;pub use types::LogLevel;pub use types::Mode;
Modules§
- guest
guest.witrecords: init input, tool invocations, completion items.- host_
service - Host-provided services (ext-abi §3): named capabilities an embedding host
registers with the runtime —
"browser","cron", … . Oino itself registers none: under a plain TUI every name is unavailable and extensions degrade (typically: tools report unavailable). - json
RawJson: canonical JSON text carried across the WIT boundary (type json = string).- manifest
- Package manifest
extension.json(extension-api §7) and permissions (§7.3). - ops
- Host operation enums: one variant per WIT function of the interfaces that
crate::HostServicesserves (same names inUpperCamelCase, same parameters). - registry
registry.wit: event kinds and registration records.- runtime
- Runtime traits:
ExtensionRuntimeloads packages intoExtensionInstances, which call back intoHostServices(implemented byoino-core). - types
- Shared vocabulary of
types.wit: ids, modes, call contexts, errors.
Structs§
- Cancellation
Token - A token which can be used to signal a cancellation request to one or more tasks.