/** The per-machine crash ledger: `MONOMIND_ORGRT_STUBS_DIR`, else * ~/.monomind/orgrt-sandbox-stubs (next to orgrt-broker and orgrt-operator). */ export declare function defaultStubLedger(env?: NodeJS.ProcessEnv): string; export interface LedgerEntry { path: string; ino: number; dev: number; kind: 'file' | 'dir'; /** A file stub's ctime at creation: an inode number is reused as soon as a * file is deleted, so dev+ino alone cannot tell our stub from an empty file * someone recreated at the same path. Absent on older entries. */ ctimeMs?: number; pid: number; /** This pid's namespace and boot, so a later reclaim() can tell a dead pid * in our own namespace apart from a live one we simply cannot see from a * different namespace. Absent on an entry written before this field * existed (see isLegacy). */ pidNamespace?: string; bootId?: string; runId: string; createdAt: string; } export declare function readLedger(file: string): LedgerEntry[]; /** Atomic (tmp + rename). Only a write that adds entries makes the dir: a * removal has nothing to record where there is no ledger. */ export declare function writeLedger(file: string, entries: LedgerEntry[], create: boolean): void; export declare const alive: (pid: number) => boolean; /** Reads what identifies THIS process's pid namespace and boot, so a ledger * entry can later tell a dead pid in our own namespace (safe to reclaim) * apart from a live daemon's pid that we simply cannot see (the Claude SDK * sandbox runs every role with `bwrap --unshare-pid`: `process.kill(pid, 0)` * on a pid outside our namespace always throws ESRCH, alive or not). */ export interface IdentitySource { /** `/proc/self/ns/pid`'s target, e.g. `pid:[4026531836]`; undefined if it * cannot be read (older kernel, no /proc). */ pidNamespace(): string | undefined; /** `/proc/sys/kernel/random/boot_id`, stable for one boot and never reused * across a reboot — unlike a pid, which is. */ bootId(): string | undefined; /** Is any process still in pid namespace `ns`? `false` only when that is * provable — we are in the initial pid namespace, which sees every * process, and none of our own readable processes is in `ns` (a namespace * our roles' bwrap created holds only this user's processes). `undefined` * when we cannot tell: inside a sandbox's own namespace, or no /proc. */ namespaceLive?(ns: string): boolean | undefined; } export declare const defaultIdentity: IdentitySource; /** An entry recorded before pid-namespace awareness (no `pidNamespace`/ * `bootId`), or one whose reader could not read them: falls back to the * bare pid check (today's behavior, and correct outside any sandbox). */ export declare function isLegacy(e: LedgerEntry): boolean; //# sourceMappingURL=sandbox-stubs-ledger.d.ts.map