import { type SessionMeta } from './types.js';
import type { ActiveSession } from './active.js';
/**
 * Reshape one live `ActiveSession` into a `SessionMeta` candidate for the id
 * resolver. Returns `null` for a row that cannot back a durable session — no
 * `sessionId`, or a `kind` that is not a session-tracked harness (cloud/team
 * rows without a real agent transcript). Pure: the caller supplies `self` (the
 * local machine id) and `nowMs` so the row is deterministic and testable.
 */
export declare function activeSessionToSessionMeta(active: ActiveSession, self: string, nowMs: number): SessionMeta | null;
/**
 * Map every eligible live session to a `SessionMeta` candidate. Ineligible rows
 * (no id, non-agent kind) are dropped. Order follows the input.
 */
export declare function liveSessionMetas(active: ActiveSession[], self: string, nowMs: number): SessionMeta[];
/**
 * Which box the AGENT of each live session executes on, keyed by lowercased id,
 * as recovered from the fleet-active snapshot (`agents sessions --active`'s
 * cross-machine merge). A dispatcher that launched a session running on a peer
 * has a live shim row locally whose `machine` self-defaulted to itself — the
 * launch process IS here, the agent is not (PHNX-3890). The fleet snapshot
 * already reconciled that against the peer's own self-report, so it is the one
 * place that knows the true execution host without a synced index row (which is
 * why `foldExecutionMachine` can't recover it: there is no local index row to
 * join). Only rows the fleet attributes to a real machine are included.
 */
export declare function fleetExecutionMachineById(fleet: ActiveSession[]): Map<string, string>;
/**
 * Correct a live `SessionMeta` candidate's machine to its true EXECUTION host
 * using the fleet-active attribution (PHNX-3890). Only a **self-attributed,
 * transcript-less** row is a candidate for correction — the launcher-shim shape
 * a dispatcher holds for a session whose agent runs on a peer, which is
 * indistinguishable from a genuinely-local just-started session by its local
 * fields alone. A row already attributed to another box, or one carrying a
 * transcript path, is left untouched. A corrected row is stamped `_remote` so
 * the read-vs-resume router (`transcriptOnPeerOf`) sends the preview to the
 * owning peer instead of dead-ending on the local "not indexed here" stub.
 */
export declare function reconcileLiveMetaMachine(metas: SessionMeta[], fleetExecutionMachine: Map<string, string>, self: string): SessionMeta[];
