Skip to main content

kaizen/sync/
mod.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2//! Sync daemon: redacted outbox → `POST /v1/events`.
3
4pub mod canonical;
5pub mod client;
6pub mod context;
7pub mod engine;
8pub mod export_batch;
9pub mod outbound;
10pub mod redact;
11pub mod smart;
12pub mod telemetry_replay;
13
14pub use canonical::{
15    CanonicalEnvelope, CanonicalEventName, CanonicalItem, EventItem, KAIZEN_SCHEMA_VERSION,
16    RepoSnapshotChunkItem, ToolSpanItem, WorkspaceFactSnapshotItem, expand_ingest_batch,
17};
18pub use context::SyncIngestContext;
19pub use engine::{FlushExporters, FlushStats, flush_outbox_once};
20pub use export_batch::IngestExportBatch;
21pub use outbound::{EventsBatchBody, OutboundEvent, hash_with_salt, workspace_hash};
22pub use telemetry_replay::chunk_events_into_ingest_batches;
23
24use crate::core::config::Config;
25use std::path::PathBuf;
26
27/// When sync endpoint is configured, pass this into `append_event_with_sync`.
28pub fn ingest_ctx(cfg: &Config, workspace_root: PathBuf) -> Option<SyncIngestContext> {
29    if cfg.sync.endpoint.is_empty() {
30        return None;
31    }
32    Some(SyncIngestContext::new(cfg.sync.clone(), workspace_root))
33}