diff --git a/approval-gate/Cargo.lock b/approval-gate/Cargo.lock index 40034fe61..effdfce82 100644 --- a/approval-gate/Cargo.lock +++ b/approval-gate/Cargo.lock @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "harness" -version = "1.6.7" +version = "1.7.0" dependencies = [ "anyhow", "async-trait", diff --git a/llm-router/Cargo.toml b/llm-router/Cargo.toml index 31151a969..f05fa5b1f 100644 --- a/llm-router/Cargo.toml +++ b/llm-router/Cargo.toml @@ -19,7 +19,7 @@ path = "src/lib.rs" [dependencies] iii-sdk = "=0.21.6" -iii-console-ui = { path = "../crates/console-ui" } +iii-console-ui = { path = "../crates/console-ui", optional = true } # Re-exports the same `opentelemetry` the SDK uses, so we can carry the active # OTel context across `tokio::spawn` boundaries (shared `Context` global). # 0.21.5 adds the live span-start push, so `router::chat` renders in the @@ -43,3 +43,10 @@ tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] } [dev-dependencies] tokio = { version = "1", features = ["test-util"] } + +[features] +# The injectable console UI (ui.rs + the pnpm bundle in build.rs). Path +# dependents that only consume the library types disable default features to +# drop the Node toolchain from their build graph. +default = ["console-ui"] +console-ui = ["dep:iii-console-ui"] diff --git a/llm-router/build.rs b/llm-router/build.rs index eb030b5f4..cf090b655 100644 --- a/llm-router/build.rs +++ b/llm-router/build.rs @@ -18,6 +18,13 @@ fn main() { std::env::var("TARGET").expect("TARGET must be set by Cargo build scripts") ); + // Everything below builds/validates the injectable console UI bundle. + // Skip it when the `console-ui` feature is off (lib-only path dependents) + // so their builds never need a Node toolchain. + if std::env::var_os("CARGO_FEATURE_CONSOLE_UI").is_none() { + return; + } + // `dist/` itself is not listed: include_str! reads it directly, and // listing it would rebuild-loop on our own output. println!("cargo:rerun-if-changed=ui/page.tsx"); diff --git a/llm-router/src/lib.rs b/llm-router/src/lib.rs index 4b6823445..e1695dc6c 100644 --- a/llm-router/src/lib.rs +++ b/llm-router/src/lib.rs @@ -18,4 +18,5 @@ pub mod system_prompt; pub mod testkit; pub mod triggers; pub mod types; +#[cfg(feature = "console-ui")] pub mod ui; diff --git a/llm-router/src/main.rs b/llm-router/src/main.rs index bdb3a81de..82d37f360 100644 --- a/llm-router/src/main.rs +++ b/llm-router/src/main.rs @@ -86,6 +86,7 @@ async fn main() -> Result<(), Box> { ); register_router(iii.clone()).await?; + #[cfg(feature = "console-ui")] llm_router::ui::register(&iii); tracing::info!(url = %cli.url, "llm-router registered"); diff --git a/provider-anthropic/Cargo.lock b/provider-anthropic/Cargo.lock index e56b65bb1..685c58e30 100644 --- a/provider-anthropic/Cargo.lock +++ b/provider-anthropic/Cargo.lock @@ -776,7 +776,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-anthropic/Cargo.toml b/provider-anthropic/Cargo.toml index a35feeabb..ccd753eb2 100644 --- a/provider-anthropic/Cargo.toml +++ b/provider-anthropic/Cargo.toml @@ -19,7 +19,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::anthropic::stream` renders while streaming. iii-sdk = "=0.21.6" diff --git a/provider-claude-code/Cargo.lock b/provider-claude-code/Cargo.lock index 67a7f2761..9f188732d 100644 --- a/provider-claude-code/Cargo.lock +++ b/provider-claude-code/Cargo.lock @@ -738,7 +738,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-claude-code/Cargo.toml b/provider-claude-code/Cargo.toml index 0ae2c1e12..272cfa307 100644 --- a/provider-claude-code/Cargo.toml +++ b/provider-claude-code/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::claude-code::stream` renders while streaming. iii-sdk = "=0.21.6" diff --git a/provider-deepseek/Cargo.lock b/provider-deepseek/Cargo.lock index b11e2b1c7..4ce900d0e 100644 --- a/provider-deepseek/Cargo.lock +++ b/provider-deepseek/Cargo.lock @@ -738,7 +738,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-deepseek/Cargo.toml b/provider-deepseek/Cargo.toml index 78041718a..72fb6cf0a 100644 --- a/provider-deepseek/Cargo.toml +++ b/provider-deepseek/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). iii-sdk = "=0.21.6" serde = { version = "1", features = ["derive"] } diff --git a/provider-kimi/Cargo.lock b/provider-kimi/Cargo.lock index cef9e090a..773cc3704 100644 --- a/provider-kimi/Cargo.lock +++ b/provider-kimi/Cargo.lock @@ -717,7 +717,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-kimi/Cargo.toml b/provider-kimi/Cargo.toml index 88bf05b70..5bec29b79 100644 --- a/provider-kimi/Cargo.toml +++ b/provider-kimi/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin so the provider and router share one IIIClient type. iii-sdk = "=0.21.6" serde = { version = "1", features = ["derive"] } diff --git a/provider-llamacpp/Cargo.lock b/provider-llamacpp/Cargo.lock index b9e2683af..ba32e7047 100644 --- a/provider-llamacpp/Cargo.lock +++ b/provider-llamacpp/Cargo.lock @@ -738,7 +738,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.3.2" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-llamacpp/Cargo.toml b/provider-llamacpp/Cargo.toml index 618333e1b..c6295de0e 100644 --- a/provider-llamacpp/Cargo.toml +++ b/provider-llamacpp/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::llamacpp::stream` renders while streaming. iii-sdk = "=0.21.6" diff --git a/provider-openai-codex/Cargo.lock b/provider-openai-codex/Cargo.lock index 80e96068b..ecfec16c6 100644 --- a/provider-openai-codex/Cargo.lock +++ b/provider-openai-codex/Cargo.lock @@ -776,7 +776,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-openai-codex/Cargo.toml b/provider-openai-codex/Cargo.toml index abbf5f93d..7d84d7a9b 100644 --- a/provider-openai-codex/Cargo.toml +++ b/provider-openai-codex/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::openai-codex::stream` renders while streaming. iii-sdk = "=0.21.6" diff --git a/provider-openai/Cargo.lock b/provider-openai/Cargo.lock index a5927e01f..e6f48778b 100644 --- a/provider-openai/Cargo.lock +++ b/provider-openai/Cargo.lock @@ -776,7 +776,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-openai/Cargo.toml b/provider-openai/Cargo.toml index 376231434..5521a5f6c 100644 --- a/provider-openai/Cargo.toml +++ b/provider-openai/Cargo.toml @@ -19,7 +19,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::openai::stream` renders while streaming. iii-sdk = "=0.21.6" diff --git a/provider-xai/Cargo.lock b/provider-xai/Cargo.lock index a836bf22e..ae52a6815 100644 --- a/provider-xai/Cargo.lock +++ b/provider-xai/Cargo.lock @@ -776,7 +776,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.3.2" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-xai/Cargo.toml b/provider-xai/Cargo.toml index f684a071d..b3d1473c7 100644 --- a/provider-xai/Cargo.toml +++ b/provider-xai/Cargo.toml @@ -19,7 +19,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::xai::stream` renders while streaming. iii-sdk = "=0.21.6" diff --git a/provider-zai/Cargo.lock b/provider-zai/Cargo.lock index 813f5cfce..6d363440f 100644 --- a/provider-zai/Cargo.lock +++ b/provider-zai/Cargo.lock @@ -776,7 +776,7 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "llm-router" -version = "1.4.0" +version = "1.4.1" dependencies = [ "async-trait", "clap", diff --git a/provider-zai/Cargo.toml b/provider-zai/Cargo.toml index a2ea054e2..e196e55ef 100644 --- a/provider-zai/Cargo.toml +++ b/provider-zai/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" path = "src/lib.rs" [dependencies] -llm-router = { path = "../llm-router" } +llm-router = { path = "../llm-router", default-features = false } # Must match llm-router's pin (one iii-sdk per graph). 0.21.5 brings the # live span-start push: `provider::zai::stream` renders while streaming. iii-sdk = "=0.21.6"