export declare const REASONING_TAIL_MODEL_RE: RegExp; /** * Tail char budget: default 480, `CURSOR_OPENCODE_REASONING_TAIL` overrides; * `0` (or any non-positive/invalid value) disables the fallback. */ export declare function reasoningTailBudget(env?: Record): number; /** Kill switch view of the budget. */ export declare function reasoningTailEnabled(env?: Record): boolean; /** * True when `text` carries at least `min` letter/digit code points (\p{L}|\p{N}). * Used as the semantic floor before stashing a [reasoning tail] frame. */ export declare function hasMinSemanticContent(text: string, min?: number): boolean; /** * Trim `text` to at most `budget` chars from the END, snapping the start to the * LAST sentence boundary in the window that still leaves a non-fragment tail * (≥20 chars after the boundary). Hard cuts are surrogate-pair-safe; CJK * 。!? count as boundaries. */ export declare function tailAtBudget(text: string, budget: number): string; /** Model gate: same population as the continuity/interstitial frames. */ export declare function reasoningTailEligible(modelId: string): boolean; /** * Per-conversation reasoning-tail state. Lives in the proxy's conversation * map (TTL-swept with it) instead of a transponder session object. */ export interface ReasoningTailState { /** Rolling thinking buffer for the CURRENT streaming turn (2× budget cap). */ thinkingTail: string; /** True when the current turn emitted non-whitespace visible text. */ sawVisibleText: boolean; /** Latched per-turn eligibility so the hot path pays the regex once. */ tailEligible?: boolean; /** Stashed single-shot tail awaiting injection on the next outbound Run. */ pendingReasoningTail: string | null; } export declare function newReasoningTailState(): ReasoningTailState; /** * Streaming capture: fold one thinkingDelta into the turn's rolling tail * buffer, capped at 2× budget. Eligibility is latched per turn. */ export declare function noteThinkingDelta(st: ReasoningTailState | null | undefined, modelId: string, text: string): void; /** Streaming capture: note that visible (non-whitespace) text was emitted. */ export declare function noteVisibleText(st: ReasoningTailState | null | undefined, text: string): void; /** * Turn-settle hook: a turn WITH visible text clears any pending tail; a * silent tool turn with captured thinking compresses + trims the tail and * stashes it single-shot for the next turn's frame. Resets the per-turn * buffer either way. */ export declare function settleReasoningTail(st: ReasoningTailState | null | undefined, modelId: string, hadToolCalls: boolean): void; /** The [reasoning tail] harness note text for a stashed tail. */ export declare function reasoningTailNote(tail: string): string; /** * Single-shot consume: build the note text from the stashed tail (clearing * it), or null when nothing is pending / the gate fails. Gate runs BEFORE * clear so an ineligible model / kill-switch flip does not black-hole the * stash — the next eligible turn can still emit it. */ export declare function consumeReasoningTailNote(st: ReasoningTailState | null | undefined, modelId: string): string | null;