Skip to main content

Crate oino_extension_api

Crate oino_extension_api 

Source
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

ModuleWITContents
jsontypes.jsonRawJson
typestypesExtensionId, CallContext, Mode, CallKind, HostError, ExtensionError
registryregistryEventKind (wire names), tool/command/shortcut/flag/renderer specs, Registration
guestguestInitInput, ToolInvocation, CompletionItem
opssession, control, models, ui, tasks, secrets, provider-hostone enum variant per WIT function
runtime—ExtensionRuntime, ExtensionInstance, ProviderInstance, HostServices, AgentHandle
manifest—extension.json, manifest::Permissions, package validation
host_servicehost-servicehost_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.wit records: 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::HostServices serves (same names in UpperCamelCase, same parameters).
registry
registry.wit: event kinds and registration records.
runtime
Runtime traits: ExtensionRuntime loads packages into ExtensionInstances, which call back into HostServices (implemented by oino-core).
types
Shared vocabulary of types.wit: ids, modes, call contexts, errors.

Structs§

CancellationToken
A token which can be used to signal a cancellation request to one or more tasks.