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 stop_hints;
37pub mod styling;
38pub mod telemetry;
39pub mod tokens;
40pub mod unicode;
41pub mod utils;
42pub mod validation;
43pub mod vtcodegitignore;
44
45pub use colors::{blend_colors, color_from_hex, contrasting_color, is_light_color, style};
46pub use error_category::{
47    BackoffStrategy, ErrorCategory, Retryability, classify_anyhow_error, classify_error_message,
48    is_retryable_llm_error_message,
49};
50pub use errors::{DisplayErrorFormatter, ErrorFormatter, ErrorReporter, NoopErrorReporter};
51pub use paths::{
52    PathResolver, PathScope, WorkspacePaths, file_name_from_path, is_safe_relative_path,
53    normalize_ascii_identifier, resolve_workspace_path,
54};
55pub use project::{ProjectOverview, build_project_overview};
56pub use reference::{MemoryErrorReporter, MemoryTelemetry, StaticWorkspacePaths};
57pub use stop_hints::{STOP_HINT_COMPACT, STOP_HINT_INLINE, with_stop_hint};
58pub use styling::{ColorPalette, DiffColorPalette, render_styled};
59pub use telemetry::{NoopTelemetry, TelemetrySink};
60pub use tokens::{estimate_tokens, truncate_to_tokens};
61pub use unicode::{UNICODE_MONITOR, UnicodeMonitor, UnicodeValidationContext};