Skip to main content

Crate oino_wasm_host

Crate oino_wasm_host 

Source
Expand description

oino-wasm-host: the wasmtime component host for oino:extension@2.0.0 (extension-api §5).

§Boundary

Implements oino_extension_api::ExtensionRuntime. Host imports that touch sessions, UI, models or agents delegate to oino_extension_api::HostServices; process, http, fs, timers, kv, log, host-info and provider-host are served here, each import checking the manifest grant first (§5.3). LocalServices serves bus, services, secrets and tasks until core takes them over. With feature core, core_bridge plugs the runtime into oino-core’s extension runner.

§Unsafe

The crate denies unsafe_code; the only exception is the bindings module generated by wasmtime::component::bindgen!, whose typed export accessors use TypedFunc::new_unchecked (the types are checked against the component at instantiation).

§API map

ItemContents
WasmRuntime, WasmRuntimeOptions, EngineRegistry, EngineSharedprocess-shared engine (async component model, epoch ticker, compile/InstancePre caches), linker, loading
WasmInstanceone instance per extension; actor-driven concurrent calls, trap restart
HostConfigagent dir, cwd, proxy, versions
LocalServicesbus, services, secrets, background tasks, host event delivery (one per agent dir per process)
packagespackage discovery (extension.json + component)
core_bridge (feature core)adapters to oino_core::extensions and services::ExtensionLoader
testing (feature)fixture builder + harness

Modules§

core_bridge
Bridge to oino-core’s extension runner (feature core).
packages
Package discovery: <dir>/<package>/extension.json + component (extension-api §7.1).

Structs§

EngineRegistry
Process-wide engine and hub registry (E-ENGINE): one wasmtime engine (with one epoch ticker thread and the in-memory component/InstancePre caches) per engine configuration, and one LocalServices hub per agent dir, shared by every WasmRuntime of the process — so every CliLoader, the ACP factory and a multi-cwd host share one engine instead of multiplying them per service.
EngineShared
The wasmtime engine, linker, epoch ticker and compile caches shared by every WasmRuntime of one engine configuration (E-ENGINE). Obtain one through EngineRegistry (or WasmRuntime::engine); the registry keeps it alive for the process so services created later reuse it instead of paying engine setup, a ticker thread and recompilation again.
HostConfig
Host-wide configuration shared by every instance.
LocalServices
Process-wide local services shared by all instances of one crate::WasmRuntime (one hub per agent dir per process, crate::EngineRegistry).
SecretStore
The secrets file.
TaskInfo
TaskInfo.
TaskService
Tasks of every session in this process.
TaskSpec
TaskSpec (the host’s background tasks).
WasmInstance
A loaded extension component.
WasmRuntime
The wasmtime component runtime.
WasmRuntimeOptions
Options of WasmRuntime.

Enums§

TaskState
Task state.
WasmHostError
Engine-level failure.

Constants§

EPOCH_TICK
Epoch tick (deadline granularity).
KV_MAX_BYTES
Maximum size of one kv.json.
TASK_NOTIFICATION_TYPE
Custom message type of task completion notifications.

Functions§

topic_matches
pattern matches topic: exact, or prefix:* / *.
workspace_id
D10 workspace id: first 16 hex chars of sha256(canonical project root).