Transform the single binary crate into a 9-crate workspace monorepo: - Root Cargo.toml as [workspace] manager with resolver = "2" - zesdex-entities: Domain entity types (session, settings, store, message, etc.) - zesdex-utils: Pure utility functions (error, logger, pagination, slug, clipboard) - zesdex-dto: Data Transfer Objects for LLM provider API communication - zesdex-ipc: Unix-socket IPC layer (client/server/framing/protocol) - zesdex-iam: Identity & Access Management (Clean Architecture: domain/application/infrastructure) - zesdex-cms: Content Management (Clean Architecture: domain/application/infrastructure) - zesdex-middleware: HTTP middleware (Auth, CORS, Rate Limiting) - zesdex-libs: Composition root (AppContext, DB init, JWT, Argon2) - zesdex-backend: Main binary entry point + seed/migrate binaries - DevOps: Dockerfile, docker-compose, Nix (flake/shell/default), CI/CD updates - Remove dead root src/ and src-misc/ directories All crate re-exports maintain backward compatibility with original crate::model::*, crate::dto::*, crate::ipc::* module paths. Feature crates enforce strict layer separation: domain -> application -> infrastructure with generic trait-based dependency injection.
17 lines
735 B
Rust
17 lines
735 B
Rust
//! Context management: token counting, cross-call tool-result dedup,
|
|
//! per-result compression, budget-based shaping, and shared
|
|
//! context-window resolution — replaces `runtime::shortsend`.
|
|
//!
|
|
//! No facade function here: `dedup`, `shaping`, and `tokens` are called
|
|
//! directly from each call site (the per-turn auto-compaction loop in
|
|
//! `actions::run_agent_turn`, and `Action::Compact`), matching this
|
|
//! codebase's "no DI, call modules directly" convention. An orchestration
|
|
//! layer would only serve one of the two callers generically — the
|
|
//! auto-loop already needs per-stage control to decide when to emit
|
|
//! `TurnEvent::Compacted`.
|
|
pub mod dedup;
|
|
pub mod shaping;
|
|
pub mod squash;
|
|
pub mod tokens;
|
|
pub mod window;
|