/** * Shared mid-turn follow-up policy for ACP adapters (Grok, Kimi, OpenCode). * * Compatible follow-ups land on the same ACP session. If a `session/prompt` is * already in flight, Anima cancels it first so the follow-up starts immediately * instead of waiting for a natural `end_turn`. Cancelled-prompt assistant chunks * are rolled back so they do not leak into the final Slack reply. * * Session methods, permissions, model selection, and activity mapping stay in * each adapter — this module only owns the interrupt + text-isolation contract. */ export interface AcpFollowupTurn { acceptingFollowups: boolean; followups: string[]; text: string[]; } export interface AcpFollowupTurnWithSignal extends AcpFollowupTurn { input: { signal?: AbortSignal; }; } /** Operator-facing acceptance text for appendToActiveRun. */ export declare function acpFollowupAppliedText(providerLabel: string): string; /** * Queue a follow-up and interrupt the in-flight prompt when needed. * Returns false when the turn is gone or no longer accepting follow-ups. */ export declare function appendAcpFollowupPrompt(input: { cancelSession: (sessionId: string) => void; prompt: string; promptInFlight: boolean; sessionId: string | undefined; turn: AcpFollowupTurn | undefined; }): boolean; /** * Drain the primary prompt then any mid-turn follow-ups serially. * Mid-turn cancel settles the in-flight RPC so the next prompt can start. */ export declare function drainAcpTurnQueue(input: { firstPrompt: string; runOnePrompt: (prompt: string) => Promise; turn: AcpFollowupTurnWithSignal; }): Promise; /** Run a session/prompt while marking the controller prompt-in-flight. */ export declare function withAcpPromptInFlight(setInFlight: (value: boolean) => void, run: () => Promise): Promise; /** * Drop assistant chunks produced by a cancelled mid-turn prompt. * Returns true when the checkpoint was applied. */ export declare function rollbackCancelledAcpPromptText(turn: { text: string[]; }, textCheckpoint: number, stopReason: string | undefined): boolean; /** Drop partial assistant text after a failed in-flight prompt. */ export declare function discardAcpPromptPartialText(turn: { text: string[]; }, textCheckpoint: number): void; //# sourceMappingURL=acp-midturn-followup.d.ts.map