/** Spec §3.4.2: cwd → trusted root, nearest first, never `$HOME` or above it. */ export declare function projectWalk(cwd: string, trustedProjectRoot: string | null, userHome: string): string[]; /** `path` is `root` or inside it — lexical, on already-resolved paths. */ export declare function isWithin(path: string, root: string): boolean; /** * FIX ROUND 1, M2: `path` is `$HOME` or one of its ancestors — by spelling or by real path. A project * tier rooted there would read `$HOME//…`, which is the DAEMON's own home (its * `settings.json` still holds Winter-grammar keys kept for downgrade), never a project's. The walk stops * at `$HOME` for the items; the settings and MCP tiers stop there too. */ export declare function isHomeOrAbove(path: string, userHome: string): boolean; /** * WS-24: a REPOSITORY file's text, read only while it is still exactly the file its in-root check * admitted — so what reaches the run folder is what discovery approved, whatever happened to the path * in between. * * `real` is the file's real path (from `realpath`, already checked to lie inside `realRoot`). The read: * * 1. opens `real` with `O_NOFOLLOW` (a link in its last component is refused) and `O_NONBLOCK` (a * special file opens without waiting on it, then fails the regular-file check); * 2. checks the OPEN file is a regular file (`fstat`); * 3. re-resolves `real` and requires the same real path, still inside `realRoot` — `O_NOFOLLOW` covers * only the last component, so a directory above it is re-checked here; * 4. requires the file now at `real` to be the one that was opened (device and inode), so a path that * changed and changed back between steps 1 and 3 is refused too; * * and only then reads from the open descriptor. A refusal is `outside-root` (the path no longer names the * admitted in-root file — a link where a file was counts as that) or `missing` (gone, not a regular * file, unreadable). */ export declare function readAdmittedFile(real: string, realRoot: string): { text: string; } | { refused: "outside-root" | "missing"; };