/** * Canonical root-discovery primitives for VAT. * * These are CLI-BOUNDARY functions: inner libraries take a root as a parameter * rather than discovering one. All return `string | null` with no internal * fallbacks — a caller with no root must decide one rather than silently * falling back to an absolute path. */ /** * Find the nearest vibe-agent-toolkit.config.yaml by walking up from startDir. * * Returns the path to the config file itself (not its directory). Returns null * if no config exists in any ancestor. * * @param startDir - Directory to start the walk from * @returns Path to the config file, or null if not found */ export declare function findConfigFile(startDir: string): string | null; /** * Find the nearest package.json with a "workspaces" key by walking up. * * Used for Node-monorepo binary discovery and Node-specific tooling only. * NOT a substitute for findProjectRoot — VAT projects are not required to be * npm workspaces. Returns null when no workspaces-bearing package.json is found. * * @param startDir - Directory to start the walk from * @returns Path to the workspace root directory, or null if not found */ export declare function findNodeWorkspaceRoot(startDir: string): string | null; /** * Reset {@link findProjectRoot}'s module-level cache. * * Call at the start of each independent CLI invocation so in-process callers * (and integration tests sharing a vitest worker) don't observe stale results. */ export declare function resetProjectRootCaches(): void; /** * Find the VAT project root. * * Discovery ladder (checks startDir itself first, then each ancestor): * 1. Directory containing vibe-agent-toolkit.config.yaml → that directory * 2. Directory containing .git/ → that directory * 3. null * * The config-anchored ladder runs to completion first; only if no config is * found anywhere up the tree do we walk a second time looking for .git/. * This implements the "config wins over git, regardless of relative depth" * semantic from spec §4 (config-file placement is a stronger declaration of * intent than the git boundary). * * Cached at the module level via {@link walkUpCache}. The cache is keyed by * each walked directory; entries are written for every dir touched on the * walk so subsequent calls from siblings/descendants become Layer-1 hits. * * @param startDir - Directory to start the walk from * @returns Project root directory, or null if neither config nor git root found */ export declare function findProjectRoot(startDir: string): string | null; //# sourceMappingURL=project-utils.d.ts.map