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/modules/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 color256_theme;
17pub mod color_policy;
18pub mod colors;
19pub mod diff;
20pub mod diff_paths;
21pub mod diff_theme;
22pub mod error_category;
23pub mod errors;
24pub mod formatting;
25pub mod fs;
26pub mod http;
27pub mod image;
28pub mod llm;
29pub mod lr_map;
30pub mod paths;
31pub mod project;
32pub mod reference;
33pub mod sanitizer;
34pub mod serde_helpers;
35pub mod slug;
36pub mod styling;
37pub mod telemetry;
38pub mod tokens;
39pub mod unicode;
40pub mod utils;
41pub mod validation;
42pub mod vtcodegitignore;
43
44pub use colors::{blend_colors, color_from_hex, contrasting_color, is_light_color, style};
45pub use error_category::{
46    BackoffStrategy, ErrorCategory, Retryability, classify_anyhow_error, classify_error_message,
47    is_retryable_llm_error_message,
48};
49pub use errors::{DisplayErrorFormatter, ErrorFormatter, ErrorReporter, NoopErrorReporter};
50pub use paths::{
51    PathResolver, PathScope, WorkspacePaths, file_name_from_path, is_safe_relative_path,
52    normalize_ascii_identifier, resolve_workspace_path,
53};
54pub use project::{ProjectOverview, build_project_overview};
55pub use reference::{MemoryErrorReporter, MemoryTelemetry, StaticWorkspacePaths};
56pub use styling::{ColorPalette, DiffColorPalette, render_styled};
57pub use telemetry::{NoopTelemetry, TelemetrySink};
58pub use tokens::{estimate_tokens, truncate_to_tokens};
59pub use unicode::{UNICODE_MONITOR, UnicodeMonitor, UnicodeValidationContext};