/** * `orca:session-self` helpers. * Spec: §3.1.2(a), §5.2.0 — every persisted session writes one entry per * session_start carrying { pid, sessionPath, startedAt }. Descendants resolve * any ancestor's PID by reading the latest such entry from the ancestor's * session JSONL. */ export interface SessionSelfData { pid: number; sessionPath: string; startedAt: string; } /** * Find the latest `orca:session-self` entry in an entries list. * Returns null if none found. * * @param entries - Session entries (from getEntries()) * @returns Latest entry data or null */ export declare function findLatestSessionSelf(entries: any[]): SessionSelfData | null; /** * Resolve the absolute session-file path from a relative session path. * Spec: §2.6.1 path-shape contract — JSONL entries carry the relative form; * `SessionManager.open` requires the absolute form. * * @param sessionsRoot - Absolute path to sessions directory (e.g., ~/.pi/agent/sessions/) * @param relativePath - Relative session path from a JSONL entry * @returns Absolute session file path */ export declare function resolveAbsoluteSessionPath(sessionsRoot: string, relativePath: string): string; /** * Default sessions root: `/.pi/agent/sessions/`. * * @returns Absolute path to default sessions directory */ export declare function getDefaultSessionsRoot(): string; /** * Resolve the effective absolute path for a parent's session file, given * both candidate inputs we may have recorded. * * Why two inputs: sessions can be synced across machines whose `.pi` * directory lives in different absolute locations. We capture both forms * at spawn time: * * - `sessionFile` — the absolute path on the machine that wrote the * status. Authoritative when it still exists locally (no migration). * - `sessionPath` — the canonical session-relative form, joined under * the LOCAL sessions root. Survives a machine boundary because it * doesn't bake in the host's HOME. * * Preference order, per spec §2.6.1: * 1. If `sessionFile` is non-empty AND exists on disk, use it. * 2. Otherwise, fall back to `join(sessionsRoot, sessionPath)`. * 3. If both are empty (in-memory SDK sessions), return `""` — the * caller is responsible for treating that as "no on-disk file." * * The "exists" check is what makes the fallback safe across machines: * absent the check, a stale absolute path written by another host would * silently bypass the local-root resolution. * * @param sessionsRoot - Absolute path to the local sessions directory * @param sessionFile - Absolute file path captured at write time, or "" when unknown * @param sessionPath - Relative session path, or "" when in-memory * @returns Effective absolute file path, or "" when there is no on-disk file */ export declare function resolveParentSessionFilePath(sessionsRoot: string, sessionFile: string, sessionPath: string): string; /** * Build the `orca:session-self` entry payload for the current process. * Called by parent-mode and child-mode session_start handlers. * * @param sessionPath - This session's path (relative form) * @returns Entry data */ export declare function buildSessionSelfData(sessionPath: string): SessionSelfData; //# sourceMappingURL=session-self.d.ts.map