All checks were successful
CI / Linux x86_64 (Forgejo) (push) Successful in 2m42s
The platform repo froze its WIT contract at v1.0 and a matching update is required here so the orchestrator-llm component links against the same package version the hub provides at runtime. The wit/world.wit copy in this repo is a byte-for-byte mirror of fai/platform :: wit/world.wit. Once the planned fai-module-sdk crate ships, the mirror disappears — modules will pull WIT bindings transitively through the SDK. Bumps the module patch version 0.2.0 -> 0.2.1. Signed-off-by: flemming-it <sf@flemming.it>
80 lines
2.1 KiB
Text
80 lines
2.1 KiB
Text
// Mirror of the platform's frozen WIT contract.
|
|
//
|
|
// Source of truth: fai/platform :: wit/world.wit (frozen at v1.0).
|
|
// This file will be replaced by a transitive include of the
|
|
// fai-module-sdk crate once it ships. Until then: keep in sync
|
|
// byte-for-byte with the platform copy.
|
|
|
|
package fai:platform@1.0.0;
|
|
|
|
/// Types that flow between the host (hub) and modules.
|
|
interface types {
|
|
/// A typed value passed between the host and a module.
|
|
variant payload {
|
|
/// Plain UTF-8 text.
|
|
text(string),
|
|
/// Arbitrary JSON encoded as a string.
|
|
json(string),
|
|
/// Raw bytes with a MIME type.
|
|
bytes(bytes-value),
|
|
/// A reference to a file, by URI.
|
|
file-ref(file-ref),
|
|
}
|
|
|
|
/// Inline byte content.
|
|
record bytes-value {
|
|
mime-type: string,
|
|
data: list<u8>,
|
|
}
|
|
|
|
/// File reference by URI.
|
|
record file-ref {
|
|
uri: string,
|
|
mime-type: string,
|
|
size-bytes: u64,
|
|
sha256: string,
|
|
}
|
|
|
|
/// Context passed with every invocation.
|
|
record invocation-context {
|
|
invocation-id: string,
|
|
capability-namespace: string,
|
|
capability-name: string,
|
|
deadline-ms: u64,
|
|
}
|
|
|
|
/// Structured error type returned by modules.
|
|
variant invocation-error {
|
|
invalid-input(string),
|
|
permission-denied(string),
|
|
resource-exhausted(string),
|
|
deadline-exceeded,
|
|
internal(string),
|
|
}
|
|
}
|
|
|
|
/// The host-provided interface that modules can import to talk back.
|
|
interface host {
|
|
/// Log a structured message. Level is "trace", "debug", "info", "warn", "error".
|
|
log: func(level: string, message: string);
|
|
}
|
|
|
|
/// The core interface every module exports.
|
|
interface invoke {
|
|
use types.{payload, invocation-context, invocation-error};
|
|
|
|
/// Invoke the module with inputs, receive outputs or an error.
|
|
invoke: func(
|
|
ctx: invocation-context,
|
|
inputs: list<tuple<string, payload>>,
|
|
) -> result<list<tuple<string, payload>>, invocation-error>;
|
|
}
|
|
|
|
/// The world a module component targets.
|
|
///
|
|
/// Modules `export` the invoke interface to be callable by the hub.
|
|
/// Modules `import` the host interface to emit logs.
|
|
world module {
|
|
import host;
|
|
export invoke;
|
|
}
|