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 timestamp;
29pub mod trust_level;
30pub mod types;
31
32/// Prefix embedded in tool output bodies when the full output was stored externally.
33///
34/// Format: `[full output stored — ID: {uuid} — {bytes} bytes, use read_overflow tool to retrieve]`
35pub const OVERFLOW_NOTICE_PREFIX: &str = "[full output stored \u{2014} ID: ";
36
37pub use math::{EmbeddingVector, Normalized, Unnormalized};
38pub use policy::{PolicyLlmClient, PolicyMessage, PolicyRole};
39pub use security_event::SecurityEventCategory;
40pub use spawner::BlockingSpawner;
41pub use task_supervisor::{
42    BlockingError, BlockingHandle, MAX_RESTART_DELAY, RestartPolicy, TaskDescriptor, TaskHandle,
43    TaskSnapshot, TaskStatus, TaskSupervisor,
44};
45pub use text::format_tokens;
46pub use trust_level::SkillTrustLevel;
47pub use types::{ProviderName, SessionId, SkillName, ToolDefinition, ToolName};
48
49#[cfg(feature = "treesitter")]
50pub mod treesitter;