diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1aaf9c8..368a857 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,13 +56,13 @@ jobs: - uses: taiki-e/install-action@cross - name: Build binary (cross) if: matrix.use_cross - run: cross build --release --target ${{ matrix.target }} + run: cross build --release --features full --target ${{ matrix.target }} env: RUSTC_WRAPPER: sccache SCCACHE_GHA_ENABLED: "true" - name: Build binary (native) if: "!matrix.use_cross" - run: cargo build --release --target ${{ matrix.target }} + run: cargo build --release --features full --target ${{ matrix.target }} env: RUSTC_WRAPPER: sccache SCCACHE_GHA_ENABLED: "true" diff --git a/Cargo.lock b/Cargo.lock index b26a05d..56e3380 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8896,6 +8896,7 @@ dependencies = [ "opentelemetry-otlp", "opentelemetry_sdk", "reqwest 0.13.2", + "serde_json", "serial_test", "sqlx", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index abf77c1..9278886 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,7 +116,7 @@ repository.workspace = true [features] default = [] -full = ["a2a", "discord", "gateway", "index", "mock", "slack", "tui"] +full = ["a2a", "daemon", "discord", "gateway", "index", "mock", "otel", "pdf", "scheduler", "slack", "stt", "tui"] a2a = ["dep:zeph-a2a", "zeph-a2a?/server"] candle = ["zeph-llm/candle", "zeph-core/candle"] metal = ["zeph-llm/metal", "zeph-core/metal"] @@ -127,7 +127,7 @@ slack = ["zeph-channels/slack"] index = ["dep:zeph-index", "zeph-core/index"] gateway = ["dep:zeph-gateway"] daemon = ["zeph-core/daemon"] -scheduler = ["dep:zeph-scheduler"] +scheduler = ["dep:zeph-scheduler", "dep:serde_json"] otel = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp", "dep:tracing-opentelemetry"] pdf = ["zeph-memory/pdf"] mock = ["zeph-llm/mock", "zeph-memory/mock"] @@ -159,6 +159,7 @@ zeph-gateway = { workspace = true, optional = true } zeph-scheduler = { workspace = true, optional = true } zeph-tui = { workspace = true, optional = true } reqwest = { workspace = true, optional = true, features = ["rustls"] } +serde_json = { workspace = true, optional = true } sqlx = { workspace = true, features = ["runtime-tokio", "sqlite"] } [dev-dependencies] diff --git a/crates/zeph-core/src/daemon.rs b/crates/zeph-core/src/daemon.rs index cc3cf1e..aa369b8 100644 --- a/crates/zeph-core/src/daemon.rs +++ b/crates/zeph-core/src/daemon.rs @@ -150,7 +150,7 @@ pub fn remove_pid_file(path: &str) -> std::io::Result<()> { fn expand_tilde(path: &str) -> String { if let Some(rest) = path.strip_prefix("~/") - && let Some(home) = std::env::var_os("HOME") + && let Some(home) = std::env::var_os("HOME").or_else(|| std::env::var_os("USERPROFILE")) { return format!("{}/{rest}", home.to_string_lossy()); } diff --git a/crates/zeph-llm/src/whisper.rs b/crates/zeph-llm/src/whisper.rs index bf3afbc..5436f1d 100644 --- a/crates/zeph-llm/src/whisper.rs +++ b/crates/zeph-llm/src/whisper.rs @@ -33,7 +33,7 @@ impl std::fmt::Debug for WhisperProvider { f.debug_struct("WhisperProvider") .field("base_url", &self.base_url) .field("model", &self.model) - .finish() + .finish_non_exhaustive() } } diff --git a/crates/zeph-memory/src/document/loader/pdf.rs b/crates/zeph-memory/src/document/loader/pdf.rs index efcfedb..a23c6ad 100644 --- a/crates/zeph-memory/src/document/loader/pdf.rs +++ b/crates/zeph-memory/src/document/loader/pdf.rs @@ -35,12 +35,12 @@ impl DocumentLoader for PdfLoader { } let source = path.display().to_string(); - let path_buf = path.to_path_buf(); + let path_buf = path.clone(); let content = tokio::task::spawn_blocking(move || { pdf_extract::extract_text(&path_buf).map_err(|e| DocumentError::Pdf(e.to_string())) }) .await - .map_err(|e| DocumentError::Io(std::io::Error::new(std::io::ErrorKind::Other, e)))??; + .map_err(|e| DocumentError::Io(std::io::Error::other(e)))??; Ok(vec![Document { content, diff --git a/src/main.rs b/src/main.rs index 0c7b52a..655d7d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,7 +36,9 @@ use zeph_llm::any::AnyProvider; #[cfg(feature = "index")] use zeph_llm::provider::LlmProvider; #[cfg(feature = "scheduler")] -use zeph_scheduler::{JobStore, ScheduledTask, Scheduler, TaskKind, UpdateCheckHandler}; +use zeph_scheduler::{ + JobStore, ScheduledTask, Scheduler, TaskHandler, TaskKind, UpdateCheckHandler, +}; #[cfg(feature = "tui")] use zeph_tui::{App, EventReader, TuiChannel}; @@ -402,7 +404,7 @@ async fn main() -> anyhow::Result<()> { config.memory.compaction_preserve_tail, config.memory.prune_protect_tokens, ) - .with_shutdown(shutdown_rx) + .with_shutdown(shutdown_rx.clone()) .with_security(config.security, config.timeouts) .with_tool_summarization(config.tools.summarize_output) .with_permission_policy(permission_policy.clone()) @@ -1182,7 +1184,7 @@ fn init_subscriber(config_path: &std::path::Path) { .init(); } -#[cfg(feature = "otel")] +#[cfg(all(feature = "otel", not(feature = "tui")))] fn setup_otel_tracer(endpoint: &str) -> anyhow::Result { use opentelemetry::trace::TracerProvider; use opentelemetry_otlp::WithExportConfig;