|
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>
|
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE | ||
| module.yaml | ||
| README.md | ||
| rust-toolchain.toml | ||
orchestrator-llm
F∆I orchestrator module — turns natural-language goals into
structured execution plans (fai_hub::plan::Plan JSON).
Status
v0.1.0 — deterministic stub. Always returns a structurally
valid plan that creates a single debug.echo flow regardless of
the goal. Useful as a smoke test for the full module → plan →
fai plan apply path.
v0.2.0 (next) — replaces the stub with an actual LLM call to a
configured endpoint (Ollama or OpenAI-compatible) once the F∆I
platform exposes outbound HTTP to permitted modules via wasi-http.
Capability
orchestrator.plan@0.1.0
Inputs
| Name | Type | Description |
|---|---|---|
goal |
text | Natural-language goal |
available_capabilities |
text (JSON list) | Optional. Capabilities currently installed in the hub. |
store_capabilities |
text (JSON list) | Optional. All capabilities the hub knows about. |
Outputs
| Name | Type | Description |
|---|---|---|
plan |
json | Plan JSON deserializable by fai_hub::plan::Plan |
Permissions
None. The deterministic stub does not call out. v0.2.0 will
declare net: <llm-endpoint> once the platform supports it.
Build
cargo build --release --target wasm32-wasip2
The built WASM lands at
target/wasm32-wasip2/release/orchestrator_llm.wasm.
Test
Host-side unit and integration tests exercise the pure plan-building logic (no WASM build required for tests):
cargo test
Use from a flow
schema_version: 1
name: plan-from-goal
inputs:
goal: text
steps:
- id: orchestrate
use: orchestrator.plan@^0
with:
goal: $inputs.goal
outputs:
plan: $orchestrate.plan
The plan output is JSON — pipe it through fai plan apply -
to execute it.
License
Apache-2.0. See LICENSE.