/** Override the project root used by all path resolution functions. */
export declare function setProjectRoot(dir: string): void;
/** Return the effective project root (explicit override or process.cwd()). */
export declare function getProjectRoot(): string;
export declare function setAllowedExternalPaths(paths: string[]): void;
export declare function getAllowedExternalPaths(): string[];
/**
 * Resolve the uploads directory. Resolution order:
 *   1. `HARNESS_UPLOADS_DIR` (explicit override; absolute or project-relative)
 *   2. `HARNESS_GLOBAL_UPLOADS=1` → `~/.harness/uploads` (cycle 18)
 *      Useful when the daemon serves multiple workspaces and uploads
 *      should not get scattered into whichever cwd happened to start it.
 *   3. `<cwd>/.harness/uploads` (legacy default)
 *
 * The directory is not auto-created here; the upload route does that on demand.
 */
export declare function getUploadsDir(): string;
/**
 * Resolve the agent-outputs directory. Honors HARNESS_AGENT_OUTPUT_DIR
 * (absolute or project-relative) and falls back to <project>/agent-outputs.
 * Used by file_write to corral bare-filename writes (e.g. analysis.md,
 * run-all-analysis.js) into a single directory so the repo root does not
 * become a dumping ground for model-generated files.
 */
export declare function getAgentOutputDir(): string;
/**
 * Decide whether a file_write target should be redirected to the
 * agent-outputs directory. Returns the redirected absolute path, or null
 * when the original path should be used as-is. Redirects only when:
 *   - the path is a bare filename (no directory component), AND
 *   - no file already exists at that bare name in the project root.
 *
 * This preserves intentional edits to existing files (package.json,
 * tsconfig.json) and intentional writes to subdirectories
 * (src/foo.ts, scripts/bar.js), while corralling new scratch files.
 */
export declare function maybeRedirectAgentOutput(rawPath: string): string | null;
export interface FileWriteRedirectRule {
    match: string;
    redirect: string;
}
/**
 * Force a reload of the redirect rules on the next access. Call this from
 * the UI POST handler so changes take effect immediately without a restart.
 */
export declare function clearFileWriteRedirectCache(): void;
/**
 * Returns the active redirect rules and their source (env/file/none).
 * Cached so the per-write hot path avoids JSON.parse on every call.
 */
export declare function getFileWriteRedirects(): {
    rules: FileWriteRedirectRule[];
    source: 'env' | 'file' | 'none';
};
/**
 * If any redirect rule matches the supplied path, return the absolute
 * destination path (preserving the original basename). Otherwise null.
 *
 * Matching tries both the relative path and the bare basename so simple
 * patterns like `lottery-*` work without forcing the user to write
 * `**\/lottery-*` for every variant.
 */
export declare function applyFileWriteRedirect(rawPath: string): string | null;
/**
 * Pure (no env / no file IO) variant used by the UI preview endpoint.
 * Lets the user see which rule (if any) would match a typed path,
 * BEFORE saving the rules. Returns the matched rule + destination, or
 * null when no rule matches.
 */
export declare function previewFileWriteRedirect(rawPath: string, rules: FileWriteRedirectRule[]): {
    rule: FileWriteRedirectRule;
    destination: string;
} | null;
export interface UploadsFallbackRecord {
    requested: string;
    resolved: string;
    at: string;
}
/**
 * Return and clear the buffered uploads-fallback records. The web layer drains
 * this after each tool result so it can surface a trace event when a model
 * passed a bare filename and the resolver had to rewrite it to .harness/uploads.
 */
export declare function drainUploadsFallbacks(): UploadsFallbackRecord[];
/**
 * Resolve a tool path against the project root. Returns the absolute path
 * when it is inside the project directory, or null when it would escape.
 */
export declare function resolveProjectPath(value: unknown): string | null;
/**
 * Like {@link resolveProjectPath} but, when the caller passes a bare filename
 * that is missing at the cwd-resolved location, falls back to the matching
 * file in the uploads directory if one exists. Lets read tools accept
 * attached files by name even when the model omits the upload directory.
 * Also accepts absolute or relative paths that resolve inside the configured
 * uploads directory even when it lives outside the project root (set via
 * HARNESS_UPLOADS_DIR).
 */
export declare function resolveProjectReadPath(value: unknown): string | null;
//# sourceMappingURL=pathResolution.d.ts.map