import { type RaceSafeHashResult, type RaceSafeReadOptions, type RaceSafeReadResult } from '../../platform/fs/race-safe-read.js'; export type ProtectedProjectPathKind = 'missing' | 'file' | 'directory'; export interface ProtectedProjectPathInspection { projectRoot: string; target: string; relative: string; exists: boolean; kind: ProtectedProjectPathKind; } /** 单次只读请求共用父目录观察,全部读取完成后再核对一次目录。 */ export declare function withProtectedProjectReadScope(work: () => Promise): Promise; /** 请求内启动的后台任务不继承请求的读取会话;请求结束时会 finish 这些会话,后台读取随之失败。 */ export declare function withoutProtectedProjectReadScope(work: () => T): T; /** 单次文件观察共用目录身份;叶子仍新鲜读取,返回结果前必须 finish。 */ export declare function createProtectedProjectReadSession(projectRoot: string, label: string, options?: { deferDirectoryChecks?: boolean; ignoredDirectoryEntries?: (directoryRef: string) => ((entry: import('node:fs').Dirent) => boolean) | undefined; }): Promise<{ observePath: (relativePath: string) => Promise; observeDirectory(relativePath: string): Promise; stat(relativePath: string): Promise<{ target: string; stat: import("node:fs").BigIntStats; }>; hash(relativePath: string): Promise; read(relativePath: string, maxBytes: number, readOptions?: Omit): Promise; finish(finishOptions?: { allowDirectoryContentChanges?: boolean; }): Promise<{ changedDirectories: string[]; }>; }>; export declare function hashProtectedProjectFile(projectRoot: string, relativePath: string, options: Omit & { label: string; }): Promise; export interface ProtectedProjectPathOptions { label: string; expected?: 'file' | 'directory' | 'any'; } export interface ProtectedProjectInstructionPath { projectRoot: string; target: string; relative: string; exists: boolean; } export declare function inspectProtectedProjectPath(projectRoot: string, relativePath: string, options: ProtectedProjectPathOptions): Promise; /** * Resolve one of the two project instruction files without following an * arbitrary link. Some repositories keep a single instruction file and link * AGENTS.md to CLAUDE.md (or the reverse); that alias is safe only when the * target is the other instruction file in this same project root. */ export declare function resolveProtectedProjectInstructionPath(projectRoot: string, relativePath: string): Promise; /** * Create a project-relative directory one segment at a time. Every existing or * newly-created segment is checked with lstat and realpath before the next * segment is touched, so a symlink, junction, special object, or physical root * escape fails closed. */ export declare function ensureProtectedProjectDirectory(projectRoot: string, relativePath: string, options: { label: string; }): Promise; export declare function protectedProjectFileExists(projectRoot: string, relativePath: string, options: { label: string; }): Promise; export declare function readProtectedProjectFile(projectRoot: string, relativePath: string, maxBytes: number, options: Omit & { label: string; }): Promise; //# sourceMappingURL=protected-project-path.d.ts.map