/** * Problem: * When upstream Antigravity executes tool calls and halts with an empty completion (stopReason=16, * no text and no tool call), upstream completes the prompt turn with a successful result without * emitting any `agent_message_chunk`. Editor clients (Paseo, Zed) transition the session to idle, * leaving the user with zero explanation and an apparent hang, forcing the user to manually ask * "You stopped, status report and next steps?". * * Solution: * In addition to baseline system prompt steering, intercepts empty `endTurn` completions following * tool execution at runtime. Automatically dispatches an automated continuation prompt upstream * directing the model to summarize its progress and continue executing the task to completion, * without synthesizing artificial assistant prose in the proxy. */ import { type AcpFix } from "../../core/types.js"; export interface PrematureTurnStopOptions { maxContinuations?: number; } export declare function extractContentText(content: unknown): string; export declare class PrematureTurnStopTracker { private readonly sessions; private readonly promptIdToSessionId; private getOrCreate; startTurn(sessionId: string, promptId?: string | number | null): void; getSessionIdForPrompt(promptId: string | number): string | undefined; recordToolCall(sessionId: string): void; recordAssistantText(sessionId: string, length: number): void; isPrematureStop(sessionId: string, promptId: string | number | null | undefined, maxContinuations: number): boolean; getToolCallCount(sessionId: string): number; getContinuationCount(sessionId: string): number; incrementContinuationCount(sessionId: string): void; getContinuationPromptId(sessionId: string): string | number | undefined; setContinuationPromptId(sessionId: string, promptId: string | number): void; clearContinuationPrompt(sessionId: string): void; getActivePromptId(sessionId: string): string | number | null | undefined; clearSession(sessionId: string): void; clear(): void; } export declare function buildContinuationText(toolCallCount: number): string; export declare function createPrematureTurnStopFix(options?: PrematureTurnStopOptions): AcpFix; export declare const prematureTurnStopFix: AcpFix; //# sourceMappingURL=index.d.ts.map