export declare function getUserConfigPath(): string; export declare function isInsidePath(childPath: string, parentPath: string): boolean; export declare function findProjectRoot(startPath: string): string | null; export declare function resolveProjectRootForConfig(startPath: string): string; /** * Canonicalise a user-supplied project root path against git's view of the * repository root. This is the fix for the nested-directory regression * where peaks-cli would write `.peaks/` under a nested sub-folder * (e.g. `prompt-project/prompt-project/.peaks/`) because the LLM passed * `$(pwd)` from inside a sub-directory of a real git repo. Without * canonicalisation, peaks accepted the cwd as-is, built the .peaks/ * tree there, and left the team with two parallel state stores. * * Strategy: * 1. If `startPath` (or any ancestor) is inside a git repo, return * `git rev-parse --show-toplevel` from `startPath`. The git root * is the *only* correct answer for "where does the .peaks/ tree * belong?" — sub-folders of a git repo are not their own projects. * 2. If `startPath` is not inside a git repo, fall back to * `findProjectRoot` (the existing heuristic) so the CLI still * works for non-git projects. * 3. If both fail, return `startPath` unchanged — better to write * to the cwd than to refuse the command. * * This is intentionally fail-open: it only *promotes* a path towards * the git root, it never demotes one. A non-git user is unaffected. * The function does NOT throw on a missing git binary or a non-zero * `git rev-parse` exit; both fall through to the heuristic. */ export declare function resolveCanonicalProjectRoot(startPath: string): string; export declare function getProjectConfigPath(projectRoot: string | null): string | null; export declare function getProjectBootstrapConfigPath(projectRoot: string): string; export declare function validateProjectBootstrapConfigPathForWrite(projectRoot: string, configPath: string): void; export declare function validateUserConfigPathForWrite(configPath: string): void; export declare function validateArtifactWorkspaceRoot(artifactRoot: string, _workspaceRoot: string): void; export declare function validateArtifactWorkspaceMarkerPath(artifactRoot: string, peaksPath: string, markerPath: string): void; export declare function readConfigFileSafely(configPath: string, errorMessage: string): string; export declare function writeConfigFileSafely(configPath: string, content: string, validateBeforeWrite: () => void, errorMessage: string): void; export declare function writeProjectConfigFile(projectRoot: string, configPath: string, content: string): void; export declare function writeUserConfigFile(configPath: string, content: string): void;