/** * Shorten verbose Swift / SwiftUI class names so MCP tool responses fit in * an LLM context budget. * * Real SwiftUI demangled types nest 8+ generic levels deep and run 1000+ chars. * Example input (one node, one chain): * * SwiftUI.ModifiedContent>>, ...>>, ...>> * * Three layers of shortening, in order: * 1. Drop standard module prefixes (Swift., SwiftUI., Foundation., Combine.) * 2. Collapse nested ModifiedContent chains into "BaseType +N modifiers" * 3. Truncate any remaining generic depth past `maxDepth` with a hash * placeholder, e.g. `…<#1a2b3c>` (so equal generics still hash equal). * * Output for the example above might be: * `ModifiedContent<…<#a3f1>> +12 modifiers` * * The full original is preserved on the caller side; this function never * mutates the underlying CycleNode — it only returns a shortened display string. */ interface ShortenOptions { /** Hard cap on the final string length (default 200). */ maxLength?: number; /** Truncate generic angle-bracket depth past this (default 3). */ maxDepth?: number; /** Drop module prefixes like `Swift.`, `SwiftUI.` (default true). */ dropModules?: boolean; /** Collapse nested `ModifiedContent<…>` chains (default true). */ collapseModifiers?: boolean; } /** Public API: produce a shortened display string for a class name. */ export declare function shortenClassName(className: string, opts?: ShortenOptions): string; /** * Verbosity levels accepted by tools that surface class names. * * - `compact`: aggressive shortening (default for high-signal/low-token output). * - `normal`: drop modules, collapse modifiers, but keep depth. * - `full`: return the original Swift demangled name verbatim. */ export type Verbosity = "compact" | "normal" | "full"; export declare function shortenForVerbosity(className: string, verbosity: Verbosity): string; export {};