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