/** * Pure user-message transformation functions, extracted from history.ts. * * No I/O, no side effects — these operate on raw text from JSONL files and * produce displayable history entries. Unit-testable in isolation. */ export interface HistoryMessage { role: 'user' | 'assistant' | 'tool' | 'skill-context'; content: string; toolName?: string; toolInput?: string; toolId?: string; toolOutput?: string; skillName?: string; skillBaseDir?: string; lineCount?: number; timestamp?: string; isCommandOutput?: boolean; providerId?: string; vpId?: string; threadId?: string; } export interface ProcessedUserMessage { /** Synthetic entries to insert before the user message (e.g. plan mode dividers) */ prefixEntries: HistoryMessage[]; /** The cleaned user message, or null if it should be skipped entirely */ userEntry: HistoryMessage | null; } export declare const PLAN_MODE_NOTICE_RE: RegExp; /** Convert a workdir path to its Claude CLI project-folder name. */ export declare function pathToProjectFolder(workDir: string): string; /** * Messages that are pure CLI commands — always hidden. * * Only matches tags that define the message TYPE (the entire message IS a * command). Uses startsWith to avoid false positives when users quote or * reference these tags in their own messages. * * Claude CLI versions emit different tag orders: * - v2.1.177+ (cli): first * - v2.1.119 (sdk-cli): first * Both forms must be recognized as hidden commands. * * Context-injection tags (, , * , ) are NOT checked here — * they are stripped by stripSystemTags() instead, preserving any real user * text that accompanies them. */ export declare function isHiddenCommand(text: string): boolean; /** * Extract the command name (e.g. "/goal") from a CLI command message. * Handles both tag orders: first or first. */ export declare function extractCommandName(text: string): string | null; /** * Extract the value from a Claude CLI slash command message. * Returns null if no tag is found or args are empty. */ export declare function extractCommandArgs(text: string): string | null; /** Strip system-injected tags from user/assistant text */ export declare function stripSystemTags(text: string): string; export interface ParsedSkillContext { skillName: string; content: string; before: string; after: string; lineCount: number; skillBaseDir?: string; } export declare function parseSkillContext(text: string): ParsedSkillContext | null; export declare function removeSkillContext(text: string): string; /** Extract displayable output from local command stdout/stderr tags */ export declare function extractCommandOutput(text: string): string | null; /** * Process a raw user message text through the full cleanup pipeline. * Each step can filter, transform, or emit synthetic prefix entries. * * Steps (in order): * 1. Skip hidden CLI commands * 2. Extract command output (e.g. /cost results) * 3. Strip system-injected XML tags * 4. Extract plan mode notices → synthetic EnterPlanMode/ExitPlanMode dividers */ export declare function processUserMessage(text: string, ts?: string): ProcessedUserMessage; /** * Clean user message text for display (title, preview, context). * Strips all system artifacts without emitting synthetic entries. */ export declare function cleanUserText(text: string): string;