Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1m34s
The module now uses the #[fai_module] macro from
fai-module-sdk v0.1.2. The behavior is unchanged from v0.2.1 —
deterministic stub when llm_endpoint is empty, real Ollama-shaped
HTTP otherwise. The migration drops:
- The hand-written wit_bindgen::generate! invocation
- The exports::fai::platform::invoke::Guest impl boilerplate
- The unsafe_op_in_unsafe_fn allow workaround
- The manual export!() macro call
- The text_input helper that matched Payload variants by hand
- The wit/ directory mirror of the platform's frozen WIT
In their place, the module body is one annotated function:
#[fai_module]
pub fn invoke(_ctx: Context, inputs: Inputs)
-> Result<Outputs, ModuleError>
{ ... }
Compared with v0.2.1, lib.rs lost ~70 lines of WASM plumbing.
The SDK macro emits the WIT glue only on target_arch = wasm32
so the host build now compiles cleanly without a manual gate.
That removed two #[cfg(target_arch = wasm32)] blocks in the
process.
The Cargo.toml dep on wit-bindgen is replaced by a single git
dep on fai-module-sdk (branch=main, transitively pinning v0.1.2).
The macros crate comes through transitively. waki stays as a
target-gated dep — the SDK does not (yet) abstract HTTP.
Output payload extends the v0.2.1 schema additively: alongside
the existing 'plan' (JSON Plan), the module now emits
'model_endpoint' and 'model_name' so consumers (and audit logs)
can identify which LLM produced which plan. Existing flows that
only consume 'plan' are unaffected.
Wasm artifact verified to build with v1.0 imports. Platform-side
integration tests in fai/platform :: orchestrator_llm_path.rs
and orchestrator_module.rs pass against the migrated wasm with
no platform-side changes. Total platform suite: 151 green.
The wit/ directory is removed because the SDK ships the WIT
inline via include_str! at proc-macro compile time. Module repos
no longer maintain their own mirror copy.
Bumps the module to 0.3.0 (minor — output schema additively
extended).
Signed-off-by: flemming-it <sf@flemming.it>
39 lines
1 KiB
TOML
39 lines
1 KiB
TOML
# Standalone Cargo.toml — targets wasm32-wasip2, NOT a workspace member.
|
|
#
|
|
# Build with:
|
|
# cargo build --release --target wasm32-wasip2
|
|
|
|
[package]
|
|
name = "orchestrator_llm"
|
|
version = "0.3.0"
|
|
edition = "2024"
|
|
authors = ["Dr. Stefan Flemming <platform@flemming.ai>"]
|
|
license = "Apache-2.0"
|
|
publish = false
|
|
description = "F∆I orchestrator module — turns natural-language goals into structured execution plans"
|
|
repository = "https://git.flemming.ws/fai-modules/orchestrator-llm"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[dependencies]
|
|
fai-module-sdk = { git = "https://git.flemming.ws/fai/module-sdk.git", branch = "main" }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
thiserror = "2"
|
|
|
|
# WASI-0.2 HTTP client. Only compiled into the wasm32-wasip2 build.
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
waki = "0.5"
|
|
|
|
[dev-dependencies]
|
|
serde_yaml = "0.9"
|
|
|
|
[profile.release]
|
|
opt-level = "s"
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = "symbols"
|
|
|
|
[workspace]
|
|
# Empty workspace table so this package is NOT picked up by a parent.
|