Expand description
Shared validation helpers for extension capability identifiers.
Centralizes the rules for capability IDs (tool names, provider IDs, model IDs, plugin IDs) so tools, providers, and hooks share consistent validation behavior. New capability authors should reuse these helpers rather than re-deriving the rules inline.
Enums§
Constants§
- MAX_
ID_ LENGTH - Maximum length for any capability identifier segment.
- RESERVED_
CHARS - Reserved characters that must not appear in capability IDs.
Currently
:(used as namespace separator).
Functions§
- sanitize_
display_ string - Strip control characters from a display string (tool descriptions, help text, etc.). Preserves newlines and tabs but removes ESC, BEL, and other C0/C1 control codes that could inject ANSI escape sequences into the TUI.
- validate_
id_ segment - Validate a capability ID segment. Used for tool names, provider IDs, model IDs.
- validation_
error - Build a context-prefixed error message for validation failures.