/** * The suggested session name is a small display protocol, not ordinary prose. * Keep its exact block and pending-state rules in one adapter-neutral module so * prompt context, PostToolUse injection, and PreToolUse enforcement cannot * drift apart. */ export interface SessionNameDisplayState { suggested_session_name?: string; session_name_seen_for?: string; session_name_display_requested_for?: string; } export declare const SESSION_NAME_DISPLAY_NOTE = "Next, before any prose or another tool call, send suggested_session_name verbatim by itself in a fenced code block."; export declare function sessionNameDisplayPending(row: SessionNameDisplayState | null | undefined): string | null; /** * Every title whose exact display satisfies the current latch. * * The pending title always counts. The title the agent was last instructed to * display also counts, because the harness — not the agent — is what changed * the target after asking. Accepting it costs nothing the operator can see: a * clean one-line block did open that reply. Refusing it left Cursor sessions * permanently latched, since no Cursor surface can re-open a missed window. */ export declare function sessionNameDisplayAcceptedNames(row: SessionNameDisplayState | null | undefined): string[]; /** * Match assistant text against any accepted title and report which one closed * the latch, so a drifted display can be stamped against the pending title and * logged as drift rather than silently discarded. */ export declare function matchSessionNameDisplay(row: SessionNameDisplayState | null | undefined, text: string | undefined, startsWithBlock?: (text: string, expectedName: string) => boolean): { pending: string; displayed: string; } | null; export declare function sessionNameDisplayBlock(name: string): string; export declare function sessionNameDisplayInstruction(name: string): string; export declare function sessionNameDisplayRecoveryInstruction(name: string, binName: string): string; /** * A PostToolUse result should announce the display protocol only when that * exact tool call minted or retried the current suggestion. The coordination row keeps * the suggestion pending until transcript evidence catches up, so checking * the row alone would re-announce the same name after every later tool. * * Adapter responses vary between a direct command envelope and wrapper * objects whose `output`/content field contains the JSON as one line. Walk * both shapes, but require the command's explicit mint flag as well as the * exact current name. Ordinary status output can carry the name without * activating the display ritual. */ export declare function toolResponseMintedSessionName(response: unknown, name: string): boolean; export declare function assistantTextStartsWithSessionNameBlock(text: string, name: string): boolean; /** * The display latch must not block the two coordination commands that can * repair a turn or close it cleanly. Keep this intentionally narrower than * "any harn command" and reject shell control syntax before matching. */ export declare function isSessionNameRemediationCommand(command: string | undefined, binName: string): boolean; //# sourceMappingURL=session-name-display.d.ts.map