Skip to main content

Module constants

Module constants 

Source
Expand description

Shared constants for tool operations to eliminate duplication

This module provides common constants used across multiple tool implementations to reduce code duplication and ensure consistency.

Core constants are defined in vtcode-commons::tool_types and re-exported here for backward compatibility. Additional vtcode-specific constants are defined below.

Constants§

COMMAND_ERROR_PATTERNS
Command execution error patterns
DEFAULT_HASHMAP_CAPACITY
DEFAULT_STRING_CAPACITY
DEFAULT_VEC_CAPACITY
Default capacity hints for common collections
ERROR_DETECTION_PATTERNS
Standard error patterns used for error detection across tools
FILESYSTEM_ERROR_PATTERNS
File system error patterns
GIT_ERROR_PATTERNS
Git-specific error patterns
MAX_CONTEXT_LINES
MAX_FILE_SIZE_FOR_PROCESSING
Common tool operation limits
MAX_LIST_ITEMS_SUMMARY
MAX_OUTPUT_TOKENS
MAX_SEARCH_RESULTS
Context optimization constants following AGENTS.md guidelines
NETWORK_ERROR_PATTERNS
Network-related error patterns for more specific error detection
OVERFLOW_INDICATOR_PREFIX
OVERFLOW_INDICATOR_SUFFIX
RESOURCE_ERROR_PATTERNS
Memory and resource error patterns

Functions§

empty_object_schema
Reusable empty JSON object schema {"type": "object"} for tool parameter definitions. Used by tools that accept no parameters or only optional parameters.