import { type SessionRunMode } from './types.js';
export interface SessionActorRecord {
    sessionId: string;
    /** Resolved actor id (`resolveActor().id`) — the responsible human/agent. */
    actor?: string;
    /** Actor kind (`resolveActor().kind`). */
    initiatedBy?: 'human' | 'agent';
    /**
     * Phoenix id of the responsible actor (`resolveActor().phoenixId`) — the
     * tailnet human's stable Phoenix identity, resolved from the `actors:` map at
     * spawn (PHNX-3798). Pairs with {@link actor}: joined onto the session index at
     * scan time so a durable listing can surface the Phoenix id, not just the email.
     */
    phoenixId?: string;
    /** Effective permissions mode used by the launcher. */
    mode?: SessionRunMode;
    /**
     * The agents-cli version-home id this session launched under (e.g. `2.1.207`,
     * codex `0.146.0`) — the same namespace `listInstalledVersions` /
     * `collectRunCandidates` use, so a native resume can pin the exact origin
     * version. Recorded at launch by the SessionStart hook (from `AGENTS_RUN_VERSION`),
     * because a harness coins its real session id only AFTER spawn — the same reason
     * `mode` rides the hook rather than a spawn-time `writeSessionActorRecord`. Joined
     * onto the session index at scan time so a session whose transcript carries no
     * embedded/derivable version (codex's `.codex-homes/<version>/` layout) no longer
     * degrades native resume to `/continue` for lack of a recorded origin (PHNX-3626).
     */
    version?: string;
    /**
     * Custom harness / profile name when launched via `agents run <profile>`
     * (e.g. `deepseek`). Joined onto the session index at scan time so a
     * durable listing can distinguish the profile from its host agent
     * (PHNX-2935).
     */
    harness?: string;
    /** Stable wrapper names that resolve to this native session id. */
    aliases?: string[];
    startedAtMs: number;
}
/**
 * Record the actor a session was launched under. Never throws — the sidecar is
 * an attribution optimization; a session with no record simply scans unattributed.
 * No-ops without a concrete session id (nothing to key on).
 */
export declare function writeSessionActorRecord(record: SessionActorRecord): void;
export declare function writeSessionAliasRecord(sessionId: string, alias: string): void;
export type SessionAliasResolution = {
    kind: 'resolved';
    sessionId: string;
} | {
    kind: 'ambiguous';
    sessionIds: string[];
} | {
    kind: 'not-found';
};
/** Resolve an exact alias, or a unique prefix/suffix of at least six chars. */
export declare function resolveSessionAlias(selector: string): SessionAliasResolution;
/** Read one session's actor record. Returns undefined if absent/corrupt. */
export declare function readSessionActorRecord(sessionId: string): SessionActorRecord | undefined;
/**
 * Load every session actor record into a `sessionId -> record` map, for the scan
 * path to join a whole batch of sessions in one directory read instead of a
 * stat-per-row. Best-effort: unreadable/corrupt files are skipped, a missing dir
 * yields an empty map.
 */
export declare function loadSessionActorIndex(): Map<string, SessionActorRecord>;
