import type { ComputedRef, Ref } from "vue"; import type { FsEntryKind } from "../../../../core/path-provider-types.js"; import type { PathPickMode, PathSuggestion } from "../../../../core/path-suggest.js"; import type { Terminal } from "../../../../core/types.js"; import type { Rect } from "../../../../events/manager/types.js"; export type PromptSuggestion = Readonly<{ value: string; insert?: string; label?: string; detail?: string; keywords?: readonly string[]; mentionValue?: string; mentionBehavior?: "collect" | "inline"; onSelect?: (info: Readonly<{ value: string; query: string; }>) => void | boolean; }>; export type MentionSuggestionProvider = (info: Readonly<{ query: string; tokenText: string; trigger: string; workspace: string; maxItems: number; }>) => readonly PromptSuggestion[] | Promise; export type MentionPathProvider = Readonly<{ stat?: (absPath: string) => FsEntryKind | null | undefined | Promise; suggest?: (info: Readonly<{ workspaceAbs: string; input: string; mode: PathPickMode; max: number; showHidden: boolean; maxDepth: number; }>) => readonly PathSuggestion[] | Promise; }>; export type PromptContext = Readonly<{ tokenStart: number; tokenEnd: number; tokenText: string; query: string; key: string; trigger: string; }>; type PromptMatch = Readonly<{ item: PromptSuggestion; score: number; order: number; }>; export declare function fuzzyScore(query: string, candidate: string): number | null; export type UsePromptMentionStateOptions = Readonly<{ props: Readonly<{ promptSuggestions: readonly PromptSuggestion[]; promptTrigger: string; promptTriggers?: readonly string[]; promptMaxItems: number; promptAlign: "input" | "center"; mentionTrigger: string; mentionWorkspace: string; mentionMode: PathPickMode; mentionShowHidden: boolean; mentionSuggestions: readonly PromptSuggestion[]; mentionMaxItems: number; mentions: readonly string[]; skillTrigger?: string; skillSuggestions?: readonly PromptSuggestion[]; }>; mentionSuggestionProviders?: readonly MentionSuggestionProvider[]; mentionPathProvider?: MentionPathProvider; focused: Ref; cursor: Ref; getValue: () => string; rawAbsRect: ComputedRef; terminal: Terminal; scheduler: Readonly<{ invalidate: () => void; }>; multilineToken: string; mentionToken: string; }>; export declare function usePromptMentionState(options: UsePromptMentionStateOptions): Readonly<{ promptActive: Ref; promptSuppressedKey: Ref; mentionKindByPath: Map; mentionKindVersion: Ref; promptContext: ComputedRef; mentionContext: ComputedRef; activeContext: ComputedRef; /** Full match list (not windowed). */ promptMatches: ComputedRef; /** Windowed list used for rendering and click mapping. */ promptMatchesVisible: ComputedRef; promptWindowStart: ComputedRef; promptActiveVisible: ComputedRef; promptVisible: ComputedRef; promptRect: ComputedRef; }>; export {};