Skip to main content

Crate vtcode_commons

Crate vtcode_commons 

Source
Expand description

Shared traits and helper types reused across the component extraction crates. The goal is to keep thin prototypes like vtcode-llm and vtcode-tools decoupled from VT Code’s internal configuration and telemetry wiring while still sharing common contracts.

See docs/vtcode_commons_reference.md for ready-to-use adapters that demonstrate how downstream consumers can wire these traits into their own applications or tests.

Re-exports§

pub use colors::blend_colors;
pub use colors::color_from_hex;
pub use colors::contrasting_color;
pub use colors::is_light_color;
pub use colors::style;
pub use errors::DisplayErrorFormatter;
pub use errors::ErrorFormatter;
pub use errors::ErrorReporter;
pub use errors::NoopErrorReporter;
pub use paths::PathResolver;
pub use paths::PathScope;
pub use paths::WorkspacePaths;
pub use paths::file_name_from_path;
pub use paths::is_safe_relative_path;
pub use project::ProjectOverview;
pub use project::build_project_overview;
pub use reference::MemoryErrorReporter;
pub use reference::MemoryTelemetry;
pub use reference::StaticWorkspacePaths;
pub use styling::ColorPalette;
pub use styling::DiffColorPalette;
pub use styling::render_styled;
pub use telemetry::NoopTelemetry;
pub use telemetry::TelemetrySink;
pub use tokens::estimate_tokens;
pub use tokens::truncate_to_tokens;
pub use unicode::UNICODE_MONITOR;
pub use unicode::UnicodeMonitor;
pub use unicode::UnicodeValidationContext;

Modules§

ansi
ANSI escape sequence parser and utilities
ansi_capabilities
ANSI terminal capabilities detection and feature support
ansi_codes
ANSI escape sequence constants and utilities
anstyle_utils
Utilities for working with anstyle types and bridging to ratatui
async_utils
Async utility functions
at_pattern
Utilities for parsing @ symbol patterns in user input
colors
Color utilities for VT Code
diff
Diff utilities for generating structured diffs.
errors
formatting
Unified formatting utilities for UI and logging
fs
File utility functions for common operations
http
HTTP client utilities
image
Image processing utilities
llm
Core LLM types shared across the project
paths
project
Project-related utilities and structures
reference
serde_helpers
Serde helper utilities
slug
Human-readable slug generator for plan file names
styling
Unified message styles and their logical mappings
telemetry
tokens
Token estimation utilities
unicode
Unicode monitoring and validation utilities
utils
Generic utility functions
validation
Validation utilities for common operations
vtcodegitignore
.vtcodegitignore file pattern matching utilities

Macros§

ctx_err
Helper macro for context errors Usage: ctx_err!(operation, context) -> “operation context”
file_err
Helper macro for file operation errors with context Usage: file_err!(“path”, “read”) -> “failed to read path”