ReadonlymkdirCreate a directory and every missing parent. A no-op if it already exists.
ReadonlyreaddirList a directory's entries with their file-type info.
ReadonlyreadRead a UTF-8 text file. Rejects if the path doesn't exist or isn't readable.
ReadonlyrealpathResolve a path to its canonical, symlink-free absolute form.
ReadonlystatStat a path (following symlinks). Rejects if the path doesn't exist.
ReadonlywriteWrite a UTF-8 text file, creating or truncating it. The parent directory must already exist.
The filesystem capability
data-cap/buildrequires from its caller../buildis a library surface: it must not acquire filesystem access implicitly (nonode:fsimport anywhere undersrc/outsidesrc/cli/). Every public options object inbuild/index.tscarries a requiredfsfield of this type, and the caller supplies a concrete adapter -- thedata-capCLI builds one overnode:fs/promises(src/cli/filesystem.ts); a test builds either that same real adapter or an in-memory fake. See ADR 0058."Ambient-fs-free" means specifically:
./buildnever reaches fornode:fsitself. It still performs real filesystem operations -- the capability is always handed in.The shape is modeled on
node:fs/promises's own signatures so a thin adapter is a drop-in value, but uses minimal structural types (BuildDirent/BuildStats) rather than Node'sDirent/Stats-- the capability boundary shouldn't leak Node's type surface just because the concrete adapter happens to be Node-backed. Only the operationssrc/build/**actually calls are here.Not shared with
@maverickcer/env-cap. The two packages are independent products with no runtime coupling; a shared types package to dedupe six signatures would add real cross-package coupling for negligible benefit. env-cap has its own, structurally-identical interface.