/**
 * Splice an in-flight `message_update` payload into a snapshot messages
 * array returned by `session.rpcClient.getMessages()`. Pure helper, no
 * dependencies on the rest of the session-manager module graph so that
 * unit tests can import it without dragging in flexsearch / pi-coding-agent.
 *
 * Behaviour:
 *  - If `latest` is undefined or its `message` has empty content, returns
 *    the input array unchanged (same reference).
 *  - If `messages` already contains a row whose id matches `latest.id`,
 *    that row is replaced in place in a new array.
 *  - Otherwise the in-flight message is appended at the end of a new array.
 *
 * Used by every site that returns the snapshot to a client (WS
 * `get_messages`, `refreshAfterCompaction`, role-switch refresh,
 * `generateTitleForAnySession` live branch, `autoGenerateTitle`). See the
 * H3 design doc on the goal — the agent flushes to `.jsonl` only on
 * `message_end`, so without this splice a snapshot taken mid-stream drops
 * the in-flight assistant row entirely (the H3-D convergent-loss case).
 */
export declare function spliceInFlightMessage(messages: any[], latest?: {
    id?: string;
    message: any;
}): any[];
/**
 * Splice synthetic user-role messages for every entry in the steer shadow
 * ledger (`session.inFlightSteerTexts`) that is NOT already represented as
 * a user message in the snapshot.
 *
 * Companion to `spliceInFlightMessage` (which handles in-flight assistant
 * `message_update`). Solves a steer-specific continuity race:
 *
 *   `_dispatchSteer()` removes the queue row and broadcasts the empty
 *   queue *before* awaiting `rpcClient.steer()`. The SDK only echoes the
 *   text back as `message_end(role:user)` after a roundtrip, and the
 *   agent only flushes that echo to `.jsonl` at that point. Between
 *   queue-removal and echo, a client `get_messages` (visibility resync,
 *   WS reconnect resume-fallback, second tab) sees a snapshot with
 *   neither the pill nor the transcript row — the steer text appears
 *   to vanish, only to reappear seconds later when the echo lands.
 *
 * The ledger is the in-process record of "steer texts the SDK has but
 * `.jsonl` doesn't yet". Splicing them into snapshot responses closes
 * the gap. Synthetic rows carry a stable id prefix `inflight-steer:` so
 * the client reducer can route them through the normal server-snapshot
 * dedup paths (multiset plain-text match against the real echo when a
 * later snapshot arrives, plus the `_origin: "server" && _order <= 0`
 * prior-snapshot drop for any leftover).
 *
 * Bounded by construction: the ledger only ever contains entries that
 * are paired with a future echo (which clears them) or an abort-drain
 * (which moves them back into `promptQueue`). It cannot grow without
 * bound.
 */
export declare function spliceInFlightSteers(messages: any[], inFlightSteerTexts?: string[]): any[];
//# sourceMappingURL=splice-inflight-message.d.ts.map