export declare function normalizeFuzzyText(value: string): string; /** * Check if query is a subsequence of target (fuzzy match). * "wig" matches "skill:wig" because w-i-g appear in order. * A bare Hangul consonant also matches a syllable's initial (초성 검색), * so "ㅎㄱ" matches "한글". */ declare function fuzzyMatch(query: string, target: string): boolean; /** * Score a fuzzy match. Higher = better match. * Prioritizes: exact match > starts-with > contains > subsequence */ declare function fuzzyScore(query: string, target: string): number; export { fuzzyMatch as autocompleteFuzzyMatch, fuzzyScore as autocompleteFuzzyScore }; export declare function getSlashCommandMatchRank(query: string, commandName: string): number; export declare function isInsideInlineCodeSpan(text: string): boolean; export declare function extractSlashCommandTokenPrefix(text: string): string | null; export declare function isSlashCommandPromptStart(lines: string[], cursorLine: number, textBeforeCursor: string): boolean; export interface AutocompleteItem { value: string; label: string; description?: string; /** Dim hint text shown inline after cursor when this item is selected */ hint?: string; } export type AutocompleteSuggestionKind = "slash-command" | "default"; export interface AutocompleteSuggestions { items: AutocompleteItem[]; prefix: string; kind?: AutocompleteSuggestionKind; } type Awaitable = T | Promise; export interface SlashCommand { name: string; description?: string; argumentHint?: string; /** * Higher values surface first in autocomplete, ahead of fuzzy-score ordering. * Use this to pin first-class commands (e.g. bundled Vibrato skills) to the top. */ priority?: number; getArgumentCompletions?(argumentPrefix: string): Awaitable; /** Return inline hint text for the current argument state (shown as dim ghost text after cursor) */ getInlineHint?(argumentText: string): string | null; } export interface AutocompleteProvider { /** Get autocomplete suggestions for current text/cursor position */ getSuggestions(lines: string[], cursorLine: number, cursorCol: number): Promise; /** Apply the selected item and return new text + cursor position */ applyCompletion(lines: string[], cursorLine: number, cursorCol: number, item: AutocompleteItem, prefix: string): { lines: string[]; cursorLine: number; cursorCol: number; onApplied?: () => void; }; /** Get inline hint text to show as dim ghost text after the cursor */ getInlineHint?(lines: string[], cursorLine: number, cursorCol: number): string | null; /** Synchronously try to complete a slash command at the start of a line (no async I/O). */ /** Returns matched items and the full prefix, or null if not applicable. */ trySyncSlashCompletion?(textBeforeCursor: string): { items: AutocompleteItem[]; prefix: string; } | null; /** * Synchronously try to expand text immediately before the cursor (no async I/O). * Called after every single-character insert. Implementations MUST cheaply * early-return when the trailing context cannot trigger them. * Returns the number of characters to delete immediately before the cursor * and the literal string to insert in their place, or null to leave the * buffer untouched. */ trySyncInlineReplace?(textBeforeCursor: string): { replaceLen: number; insert: string; } | null; } export declare class CombinedAutocompleteProvider implements AutocompleteProvider { #private; constructor(commands?: (SlashCommand | AutocompleteItem)[], basePath?: string); getSuggestions(lines: string[], cursorLine: number, cursorCol: number): Promise; applyCompletion(lines: string[], cursorLine: number, cursorCol: number, item: AutocompleteItem, prefix: string): { lines: string[]; cursorLine: number; cursorCol: number; }; invalidateDirCache(dir?: string): void; getForceFileSuggestions(lines: string[], cursorLine: number, cursorCol: number): Promise<{ items: AutocompleteItem[]; prefix: string; } | null>; shouldTriggerFileCompletion(lines: string[], cursorLine: number, cursorCol: number): boolean; /** Get inline hint text for slash commands with subcommand hints */ getInlineHint(lines: string[], cursorLine: number, cursorCol: number): string | null; trySyncSlashCompletion(textBeforeCursor: string): { items: AutocompleteItem[]; prefix: string; } | null; }