greentic-interfaces
Shared WebAssembly Interface Types (WIT) and Rust bindings for the Greentic stack. All packages are MIT licensed and designed to evolve additively: new fields and functions land in minor releases, breaking changes require a new major package or crate version.
Package overview
greentic:types-core@0.2.0– shared records and enums (flow metadata, tenant context, run results, error codes).greentic:host-import@0.2.0– host services that components import (secrets, telemetry, tool invocation, outbound HTTP).greentic:pack-export@0.2.0– pack services that components export (discover flows, execute flows, A2A search).greentic:component@0.4.0– component runtime contract with lifecycle hooks, invoke/invoke-stream, and structured errors.greentic:secrets@0.1.0– legacy secrets host interface (still published for compatibility).
Each WIT package lives under wit/<package>@<version>.wit. CI validates every file with wit-bindgen markdown and wasm-tools component wit so the schemas stay well-formed.
Rust bindings
Add the crate to your Wasmtime host:
[]
= "0.2"
= { = "38", = ["component-model"] }
Then wire in the bindings you need. Example for greentic:component@0.4.0 control imports:
use ;
use ;
use ;
use ;
;
type HostFuture<'a, T> = ;
let mut config = new;
config.wasm_component_model;
let engine = new?;
let mut linker = new;
add_control_to_linker?;
let component = from_file?;
let mut store = new;
let = instantiate_async.await?;
let node = bindings.exports.greentic_component_node?;
Host integrations can use the helper modules:
types_core_v0_2exposes the canonical structs/enums (duplication ofgreentic:types-core@0.2.0).host_import_v0_2provides theHostImportstrait plusadd_to_linkerfor wiring the host services.pack_export_v0_2re-exports the generated exports when hosting pack components.
Versioning
- Minor bumps add optional fields or functions; existing behaviour remains.
- Breaking changes require a new package (e.g.,
greentic:host-import@0.3.0) and crate minor bump. - The crate is published to crates.io (
0.2.xfor the current set) and taggedv0.2.xin git.
Validation and tooling
bash scripts/validate-wit.sh– runwit-bindgen markdownandwasm-tools component wit --wasmover every.witfile.bash scripts/package-wit.sh <out-dir>– emit wasm-encoded packages for publishing.bash scripts/publish_wit.sh– package + push all WIT packages to GHCR (ghcr.io/<user>/wit/...).- CI (
.github/workflows/ci.yml) installswit-bindgen, validates WIT, and runscargo build.
CHANGELOG
See CHANGELOG.md for release notes.
License
MIT