/** * Collapse doubled ".a5c/runs" segments in a path. * * When a relative path containing `.a5c/runs/...` is resolved from a working * directory that is itself inside `.a5c/runs/`, the result can contain the * segment twice (or more). This function collapses all consecutive duplications * into a single occurrence. * * Handles both forward-slash (Unix) and back-slash (Windows) separators as * well as mixed-separator paths. * * @example * collapseDoubledA5cRuns("/project/.a5c/runs/.a5c/runs/01RUN") * // => "/project/.a5c/runs/01RUN" * * @example * collapseDoubledA5cRuns("C:\\project\\.a5c\\runs\\.a5c\\runs\\01RUN") * // => "C:\\project\\.a5c\\runs\\01RUN" */ export declare function collapseDoubledA5cRuns(p: string): string; /** * Resolve an input file path robustly, accounting for the CLI being invoked * from inside a task directory (or any subdirectory of `.a5c/runs/`). * * The standard `path.resolve(inputPath)` resolves relative to * `process.cwd()`. When the working directory is a task directory such as * `/project/.a5c/runs/RUN/tasks/TASK/`, resolving a relative path like * `.a5c/runs/RUN/tasks/EFFECT/file.json` produces a doubled path: * `/project/.a5c/runs/RUN/tasks/TASK/.a5c/runs/RUN/tasks/EFFECT/file.json` * * This function detects that situation and resolves relative to the project * root instead. * * **Resolution rules (in order):** * 1. `"-"` (stdin sentinel) — returned as-is. * 2. Absolute paths (including Windows drive letters like `C:\`) — normalized * and returned. * 3. If `inputPath` contains a `.a5c/runs` segment **and** the current * working directory is itself inside a `.a5c/runs` subtree — resolve * relative to the detected project root. * 4. Otherwise — standard `path.resolve(inputPath)`. * 5. `collapseDoubledA5cRuns` is always applied as a final safety net. * * @param inputPath The raw path argument supplied by the user or script. * @returns A fully resolved, absolute path (or `"-"` for stdin). * * @example * // CWD = /project/.a5c/runs/RUN/tasks/TASK * resolveInputPath(".a5c/runs/RUN/tasks/EFFECT/input.json") * // => "/project/.a5c/runs/RUN/tasks/EFFECT/input.json" * * @example * resolveInputPath("/absolute/path/to/file.json") * // => "/absolute/path/to/file.json" * * @example * resolveInputPath("-") * // => "-" */ export declare function resolveInputPath(inputPath: string): string; //# sourceMappingURL=resolveInputPath.d.ts.map