/** * .what = computes a unique temp directory name with timestamp prefix and slug * .why = timestamp prefix enables age-based cleanup without stat calls * slug helps debuggers identify which test created the directory * run stamp lets a run reclaim exactly the dirs it made, and no peer's * * .note = 🔴 the run slot is ALWAYS emitted — a run id, or `_` when no run minted * this. every name therefore has ONE arity, which is what lets the shared * grammar pin the slot and read the run out of a match group rather than a * positional probe. an optional slot would let a slug occupy the run's * position and read back AS a run, which this function would then have to * reject the consumer's own slug to prevent. one arity makes the collision * unreachable, so a slug may be any text at all — `_` included * * .note = the slot sits INSIDE the free-text segment the age gate's parse takes as * `.+`, so that parse holds by construction. this function asserts the * round trip on its own output, before any dir is made * * @example * computeTempDirName({ slug: 'my-test', run: null }) * // => '2026-01-19T12-34-56.789Z._.my-test.a1b2c3d4' * * @example * computeTempDirName({ slug: 'my-test', run: 'r7f3a91c2' }) * // => '2026-01-19T12-34-56.789Z.r7f3a91c2.my-test.a1b2c3d4' */ export declare const computeTempDirName: (input: { slug: string; /** * the run that mints this name, or null when no run is enhooked * * .note = REQUIRED, and `null` is how a caller says "unstamped". an OPTIONAL run * makes a forgotten stamp type-legal, so a new call site can omit it and * leave its dirs unreclaimable under a run whose count reads zero. * required forces every site to state which it means */ run: string | null; }) => string; /** * .what = reads the timestamp out of a temp directory name * .why = enables age calculation for prune decisions * * .note = `as*`, never `parse*` — a cast from one shape to another is a transformer, * and `as` is this repo's ONE sanctioned cast prefix. it groups with * `asTempDirRun` under one autocomplete stem besides */ export declare const asTempDirTimestamp: (input: { dirName: string; }) => Date | null; /** * .what = reads the run stamp out of a temp directory name * .why = the reclaim matches on it, so a run reaps its own dirs and no peer's * * @returns the run id, or null when no run minted the dir * * .note = 🔴 it reads the run out of the shared grammar's SECOND GROUP, never by * `split('.')` and an index. a positional form must shape-test what it * finds to decide whether it is a stamp or a slug, which makes a run-shaped * slug indistinguishable from a run. one match yields both the timestamp * and the run, so the two facts cannot disagree * * @example * asTempDirRun({ dirName: '2026-01-19T12-34-56.789Z.r7f3a91c2.my-test.a1b2c3d4' }); * // => 'r7f3a91c2' * * @example * // the run slot holds `_`, so no run minted it * asTempDirRun({ dirName: '2026-01-19T12-34-56.789Z._.my-test.a1b2c3d4' }); * // => null * * @example * // a legacy name, minted before the slot existed — no run either way * asTempDirRun({ dirName: '2026-01-19T12-34-56.789Z.my-test.a1b2c3d4' }); * // => null * * @example * // a SLUG shaped like a run id is no longer read as one — it cannot occupy the * // run's position, because the run's position is always filled * asTempDirRun({ dirName: '2026-01-19T12-34-56.789Z._.r7f3a91c2.a1b2c3d4' }); * // => null */ export declare const asTempDirRun: (input: { dirName: string; }) => string | null;