# wirer
Minimal CLI that inspects component imports, resolves providers from a catalog,
composes a single component, and runs job components via `sdk/rust/host` (crate: `frost-host-sdk`).
## wirer.toml (minimal)
```toml
[app]
name = "job-hello"
composed = "dist/job-hello.composed.component.wasm"
[compose]
catalog = "components/reference/catalog.json"
output = "dist/job-hello.composed.component.wasm"
lock = ".wirer/wirer.lock.json"
allow_frost_imports = ["frost:core/context", "frost:core/types"]
[dev]
build_cmd = ["make", "build-job-hello"]
watch = ["apps/job-hello/guest/src", "apps/job-hello/guest/wit"]
debounce_ms = 400
```
## catalog.json (minimal)
```json
{
"providers": [
{
"name": "kernel-core-diagnostics-stdout",
"path": "components/reference/providers/kernel-core-diagnostics-stdout/dist/kernel-core-diagnostics-stdout.component.wasm",
"exports": ["frost:core/diagnostics"]
}
]
}
```
## Commands
```sh
cargo run --manifest-path tools/wirer/Cargo.toml -- inspect --component dist/app.component.wasm
cargo run --manifest-path tools/wirer/Cargo.toml -- resolve --catalog components/reference/catalog.json
cargo run --manifest-path tools/wirer/Cargo.toml -- compose --catalog components/reference/catalog.json
cargo run --manifest-path tools/wirer/Cargo.toml -- run --component dist/app.composed.component.wasm
cargo run --manifest-path tools/wirer/Cargo.toml -- dev --once --catalog components/reference/catalog.json --build-cmd make,build-job-hello
cargo run --manifest-path tools/wirer/Cargo.toml -- deps --wit-dir wit --lock wit/wkg.lock --output wit
cargo run --manifest-path tools/wirer/Cargo.toml -- componentize --core dist/app.core.wasm --wit-dir wit --world runtime --output dist/app.component.wasm
cargo run --manifest-path tools/wirer/Cargo.toml -- wit --component dist/app.component.wasm --output dist/app.wit
```
Notes:
- `compose` validates that no unexpected `frost:*` imports remain (only `frost:core/context` and `frost:core/types` are allowed by default).
- `run` currently supports `kind = "job"` only.
- `deps` reads `wkg.toml` from `--wit-dir` unless `--wkg-config` is provided.
- `dev` watches configured paths, optionally runs `build_cmd`, then composes and runs on changes.
## cargo-generate templates
```sh
cargo generate --path tools/wirer/templates/guest-job --name job-hello --destination apps
cargo generate --path tools/wirer/templates/guest-service --name svc-hello --destination apps
```
This creates `apps/<name>/guest` with `wirer.toml`, WIT files, and a minimal Makefile.