Skip to main content

zeph_common/
lib.rs

1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Shared utility functions and security primitives for Zeph crates.
5//!
6//! This crate provides pure utility functions (text manipulation, network helpers,
7//! sanitization primitives), security primitives (`Secret`, `VaultError`), and
8//! strongly-typed identifiers (`ToolName`, `SessionId`) that are needed by multiple crates.
9//! It has no `zeph-*` dependencies. The optional `treesitter` feature adds tree-sitter
10//! query constants and helpers.
11
12pub mod config;
13pub mod error_taxonomy;
14pub mod fs_secure;
15pub mod hash;
16pub mod math;
17pub mod memory;
18pub mod net;
19pub mod patterns;
20pub mod policy;
21pub mod quarantine;
22pub mod sanitize;
23pub mod secret;
24pub mod security_event;
25pub mod spawner;
26pub mod task_supervisor;
27pub mod text;
28pub mod trust_level;
29pub mod types;
30
31/// Prefix embedded in tool output bodies when the full output was stored externally.
32///
33/// Format: `[full output stored — ID: {uuid} — {bytes} bytes, use read_overflow tool to retrieve]`
34pub const OVERFLOW_NOTICE_PREFIX: &str = "[full output stored \u{2014} ID: ";
35
36pub use math::{EmbeddingVector, Normalized, Unnormalized};
37pub use policy::{PolicyLlmClient, PolicyMessage, PolicyRole};
38pub use security_event::SecurityEventCategory;
39pub use spawner::BlockingSpawner;
40pub use task_supervisor::{
41    BlockingError, BlockingHandle, MAX_RESTART_DELAY, RestartPolicy, TaskDescriptor, TaskHandle,
42    TaskSnapshot, TaskStatus, TaskSupervisor,
43};
44pub use trust_level::SkillTrustLevel;
45pub use types::{ProviderName, SessionId, SkillName, ToolDefinition, ToolName};
46
47#[cfg(feature = "treesitter")]
48pub mod treesitter;