export interface SocketManifest { projectPath: string; parentSessionId: string; createdAt: string; /** tmux SERVER pid (best-effort; -1 when unknown). */ pid: number; /** * Pid of the PARENT pi process that bootstrapped the server (the spawner * runs in-process, so `process.pid` at bootstrap IS the parent). This is * the owning-parent liveness signal for the reconciler's adopt policy — * the server pid can't serve: a live subagent window keeps the server up * even after its parent dies. Absent on manifests written before this * field existed (owner liveness then reads "unknown"). */ parentPid?: number; } export interface SocketManifestEntry { socketPath: string; manifestPath: string; manifest: SocketManifest; } /** * The dedicated directory holding every tmux-pilot socket and manifest. * Resolved from the environment at call time so tests can redirect it. */ export declare function socketBaseDir(): string; /** * Create the socket base dir (mode 0700) if needed and return it. The mode * is enforced even when the dir already exists — sockets grant control of * the tmux servers behind them, so the dir must never be group/world * accessible. */ export declare function ensureSocketBaseDir(): string; /** * Normalize a project path for hashing: resolve symlinks when the path * exists (falling back to plain resolution when it does not), then strip * trailing slashes so `/a/b` and `/a/b/` derive identically. */ export declare function normalizeProjectPath(projectPath: string): string; /** * Derive the parent's socket path. Deterministic: the same normalized * project path and parent session id always produce byte-identical output. * Ensures the base dir exists (0700). The 12-char hash is never truncated; * only the readable slug/parent-short shrink to honor the ~108-byte cap. */ export declare function deriveSocketPath(projectPath: string, parentSessionId: string): string; /** The sidecar manifest path for a socket: `.json`. */ export declare function manifestPathFor(socketPath: string): string; /** Write the sidecar manifest next to the socket. */ export declare function writeSocketManifest(socketPath: string, manifest: SocketManifest): void; /** * Read and validate a sidecar manifest. Returns `undefined` for a missing, * unparseable, or structurally invalid file — callers (GC) treat those as * stale remnants, not errors. */ export declare function readSocketManifest(socketPath: string): SocketManifest | undefined; /** * Owning-parent liveness for a manifest (reconciler adopt policy, design * D5): "live" / "gone" when the recorded parent pid verifiably is/isn't * running; "unknown" when the manifest predates `parentPid` or the signal * is ambiguous. Callers treat "unknown" conservatively (never adopt what * might still be another live parent's agent — adoption brings destructive * teardown with it). */ export declare function owningParentLiveness(manifest: SocketManifest | undefined): "live" | "gone" | "unknown"; /** * Enumerate every readable sidecar manifest in the socket base dir. Invalid * or unreadable manifests are skipped (GC handles bare socket files — stale * remnants without a manifest — separately). Returns an empty list when the * base dir does not exist. */ export declare function listSocketManifests(): SocketManifestEntry[]; //# sourceMappingURL=tmux-socket.d.ts.map