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