Skip to main content

vtcode_commons/
lib.rs

1//! Shared traits and helper types reused across the component extraction
2//! crates. The goal is to keep thin prototypes like `vtcode-llm` and
3//! `vtcode-tools` decoupled from VT Code's internal configuration and
4//! telemetry wiring while still sharing common contracts.
5//!
6//! See `docs/vtcode_commons_reference.md` for ready-to-use adapters that
7//! demonstrate how downstream consumers can wire these traits into their own
8//! applications or tests.
9
10pub mod ansi;
11pub mod ansi_capabilities;
12pub mod ansi_codes;
13pub mod anstyle_utils;
14pub mod async_utils;
15pub mod at_pattern;
16pub mod colors;
17pub mod diff;
18pub mod errors;
19pub mod formatting;
20pub mod fs;
21pub mod http;
22pub mod image;
23pub mod llm;
24pub mod paths;
25pub mod project;
26pub mod reference;
27pub mod sanitizer;
28pub mod serde_helpers;
29pub mod slug;
30pub mod styling;
31pub mod telemetry;
32pub mod tokens;
33pub mod unicode;
34pub mod utils;
35pub mod validation;
36pub mod vtcodegitignore;
37
38pub use colors::{blend_colors, color_from_hex, contrasting_color, is_light_color, style};
39pub use errors::{DisplayErrorFormatter, ErrorFormatter, ErrorReporter, NoopErrorReporter};
40pub use paths::{
41    PathResolver, PathScope, WorkspacePaths, file_name_from_path, is_safe_relative_path,
42    normalize_ascii_identifier, resolve_workspace_path,
43};
44pub use project::{ProjectOverview, build_project_overview};
45pub use reference::{MemoryErrorReporter, MemoryTelemetry, StaticWorkspacePaths};
46pub use styling::{ColorPalette, DiffColorPalette, render_styled};
47pub use telemetry::{NoopTelemetry, TelemetrySink};
48pub use tokens::{estimate_tokens, truncate_to_tokens};
49pub use unicode::{UNICODE_MONITOR, UnicodeMonitor, UnicodeValidationContext};