/** * Predict the user's likely next prompt after an agent turn using a smol, * fast model. Native GJC port of the ghost-text prompt-suggestion behavior * from Claude Code: the prediction renders as dim ghost text in the empty * composer and Tab accepts it. */ import type { AgentMessage } from "@gajae-code/agent-core"; import { type Api, type Model } from "@gajae-code/ai/core"; import type { ModelRegistry } from "../config/model-registry"; import type { Settings } from "../config/settings"; export declare const PROMPT_SUGGESTION_MAX_WORDS = 12; export declare const PROMPT_SUGGESTION_MAX_CHARS = 100; /** * Strip wrapper tags and label prefixes a model sometimes adds despite being * told to reply with only the suggestion. */ export declare function sanitizePromptSuggestion(raw: string): string; /** * Heuristic gate rejecting model output that would make a bad ghost-text * suggestion. Returns the rejection reason, or null when the text is usable. */ export declare function suppressPromptSuggestionReason(text: string): string | null; /** * Build a compact recent-conversation transcript for the prediction request. * Returns null when there is no user message to predict from. */ export declare function buildPromptSuggestionContext(messages: AgentMessage[]): string | null; /** * Generate a predicted next user prompt from the recent conversation. * Returns null when no usable suggestion is produced (silence is the * expected steady state). */ export declare function generatePromptSuggestion(messages: AgentMessage[], registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model, metadataResolver?: (provider: string) => Record | undefined): Promise;