/** * Pid-map writer + liveness helpers. * * Per-adapter pid-map at `.harnery/pid-map/` containing * `\t\t`. `harn agents whoami` walks ppid up * 20 hops looking for a matching entry (preferring the adapter, falling back to * any platform). * * The start token pins each row to one *run* of that pid, because a pid on its * own is a number the OS re-issues — see `proc-start.ts` for how fast. Rows * written before tokens existed carry two fields and read as unverified, which * behaves exactly as they always did. * * Atomic temp+rename. Idempotent: re-writing the same row is a no-op. */ /** Split a row into its fields, tolerating the pre-token two-field shape. */ export declare function parsePidmapRow(row: string): { instanceId: string; platform: string; startToken: string | undefined; }; /** * Delete every pid-map row that no longer names its process — exited, or its * pid re-issued to something else. Returns the number removed. */ export declare function prunePidmapDeadRows(coordRoot: string): number; export declare function writePidmapRow(coordRoot: string, pid: number, instanceId: string, platform: string): void; /** * True when any pid-map row for `instanceId` still belongs to a live process. * * Callers spend this answer on consequential things — whether a commit guard * treats a heartbeat as a live peer, whether a name can be reclaimed from an * abandoned session — so a re-issued pid must not read as that agent still * running. */ export declare function instanceHasLivePid(coordRoot: string, instanceId: string): boolean; /** Drop every pid-map row owned by `instanceId`. Returns how many files were removed. */ export declare function removePidmapRowsForInstance(coordRoot: string, instanceId: string): number; //# sourceMappingURL=pidmap.d.ts.map