/**
 * LLM-generated session titles (webchat and any path using SessionStore).
 */
import type { AgentMessage } from '@earendil-works/pi-agent-core';
import type { SessionStore } from './store.js';
export declare function isWebchatSessionKey(sessionKey: string): boolean;
/** Whether to run LLM/fallback session naming for this key (excludes cron, heartbeat). */
export declare function shouldAutoTitleSessionKey(sessionKey: string): boolean;
export declare function sanitizeSessionTitle(raw: string): string;
/** Non-LLM title: first line of first user text, else first assistant line. */
export declare function fallbackTitleFromMessages(messages: AgentMessage[]): string | null;
/**
 * Returns a title string, or null if generation should be skipped or failed.
 */
export declare function generateSessionTitleFromMessages(modelRef: string, messages: AgentMessage[], signal?: AbortSignal): Promise<string | null>;
/**
 * If the session is still unnamed, set `name` (LLM when possible, else first-line fallback).
 * Skips cron/heartbeat keys. Ensures index row exists by re-saving when metadata is missing (fixes index lag).
 */
export declare function maybeAutoTitleSessionStore(sessionStore: SessionStore, sessionKey: string, modelRef: string | undefined): Promise<void>;
