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;
13#[cfg(feature = "tui")]
14pub mod anstyle_utils;
15pub mod async_utils;
16pub mod at_pattern;
17pub mod color256_theme;
18pub mod color_policy;
19pub mod colors;
20pub mod diff;
21pub mod diff_paths;
22pub mod diff_preview;
23pub mod diff_theme;
24pub mod editor;
25pub mod env_lock;
26pub mod error_category;
27pub mod errors;
28pub mod formatting;
29pub mod fs;
30pub mod http;
31pub mod image;
32pub mod llm;
33pub mod lr_map;
34pub mod paths;
35pub mod preview;
36pub mod project;
37pub mod reference;
38pub mod sanitizer;
39pub mod serde_helpers;
40pub mod slug;
41pub mod stop_hints;
42pub mod styling;
43pub mod telemetry;
44pub mod thread_safety;
45pub mod tokens;
46pub mod trace_flush;
47pub mod ui_protocol;
48pub mod unicode;
49pub mod utils;
50pub mod validation;
51pub mod vtcodegitignore;
52pub use colors::{blend_colors, color_from_hex, contrasting_color, is_light_color, style};
53pub use editor::{
54    EditorPoint, EditorTarget, normalize_editor_hash_fragment, parse_editor_target,
55    resolve_editor_path, resolve_editor_target,
56};
57pub use error_category::{
58    BackoffStrategy, ErrorCategory, Retryability, classify_anyhow_error, classify_error_message,
59    is_retryable_llm_error_message,
60};
61pub use errors::{DisplayErrorFormatter, ErrorFormatter, ErrorReporter, NoopErrorReporter};
62pub use paths::{
63    PathResolver, PathScope, WorkspacePaths, file_name_from_path, is_safe_relative_path,
64    normalize_ascii_identifier, resolve_workspace_path,
65};
66pub use project::{ProjectOverview, build_project_overview};
67pub use reference::{MemoryErrorReporter, MemoryTelemetry, StaticWorkspacePaths};
68pub use stop_hints::{STOP_HINT_COMPACT, STOP_HINT_INLINE, with_stop_hint};
69pub use styling::{ColorPalette, DiffColorPalette, render_styled};
70pub use telemetry::{NoopTelemetry, TelemetrySink};
71pub use tokens::{estimate_tokens, truncate_to_tokens};
72pub use unicode::{UNICODE_MONITOR, UnicodeMonitor, UnicodeValidationContext};