import { type NativeProjectReadIdentity, type NativeProjectReadCommandResult, type NativeProjectReadTreeEntry } from "./native-project-read-protocol.js"; export type { NativeProjectReadCommandResult, NativeProjectReadIdentity, NativeProjectReadTreeEntry, } from "./native-project-read-protocol.js"; export declare class NativeProjectReadRuntimeError extends Error { readonly name = "NativeProjectReadRuntimeError"; constructor(); } export type NativeProjectReadGuardMode = "no-follow-open" | "lstat-verified"; /** * How this module keeps a symlink from being opened in place of the path it was * asked for. * * `O_DIRECTORY` and `O_NOFOLLOW` do not exist on Windows, so opening with them * throws there and every project read fails — which surfaced as * `source-read-runtime-unavailable` and made `workflow finish` unusable on * Windows from 0.8.0-beta onward. `workflow-lifecycle-state.ts` already * degrades the same way for the same reason. * * `lstat-verified` inspects the path before opening and rejects a symlink, then * confirms the descriptor really is a directory. That is weaker than an atomic * `O_NOFOLLOW` open — a swap between the two calls is not excluded — but it is * strictly more than the last release that worked on Windows performed, since * 0.7.0 had no project read boundary at all. */ export declare function nativeProjectReadGuardMode(): NativeProjectReadGuardMode; /** * Whether this platform and architecture are built at all. * * "no artifact exists for win32" and "the artifact for this platform failed to * load or did not match its digest" both raised * `NativeProjectReadRuntimeError`, so callers could not tell an unsupported * platform apart from a tampered or broken install. They are not the same * thing: the first is a fixed property of the release, the second is a signal * that must never be degraded around. * * This answers only the first question, and deliberately does not read, verify, * or load anything. */ export declare function nativeProjectReadPlatformSupported(): boolean; export declare class NativeProjectReadLimitError extends Error { readonly name = "NativeProjectReadLimitError"; constructor(); } export declare class NativeProjectReadUnsafeError extends Error { readonly name = "NativeProjectReadUnsafeError"; constructor(); } export type NativeProjectReadFileResult = { readonly kind: "absent"; } | { readonly kind: "ready"; readonly value: { readonly bytes: Buffer; readonly identity: NativeProjectReadIdentity; }; }; export type NativeProjectReadExpectedPath = { readonly identity: NativeProjectReadIdentity; readonly kind: "directory" | "file"; readonly path: string; }; export type NativeProjectReadRootContext = { readonly anchor: "current" | "direct-child"; readonly parent: NativeProjectReadIdentity; readonly projectPath: string; readonly root: NativeProjectReadIdentity; readonly rootName: string; }; export type NativeProjectGitCommand = "head" | "index" | "prefix" | "status"; export type NativeProjectGradleCommand = "build" | "test"; export declare function inspectNativeProjectReadRuntime(): { readonly architecture: string; readonly artifactSha256: string; readonly availability: "ready"; readonly platform: string; }; export declare function captureNativeProjectReadRootContext(projectDir: string, expectedRoot: NativeProjectReadIdentity, expectedParent?: NativeProjectReadIdentity): NativeProjectReadRootContext; export declare function captureNativeProjectReadDirectChildIdentity(projectDir: string): NativeProjectReadIdentity; export declare function readNativeProjectFile(relativePath: string, maxBytes: number, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): Buffer; export declare function readNativeProjectFileWithIdentity(relativePath: string, maxBytes: number, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): { readonly bytes: Buffer; readonly identity: NativeProjectReadIdentity; }; export declare function readNativeProjectFileWithIdentityResult(relativePath: string, maxBytes: number, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): NativeProjectReadFileResult; export declare function readNativeProjectDirectoryIdentity(relativePath: string, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): NativeProjectReadIdentity | undefined; export declare function readNativeProjectTree(options: { readonly excludedRoots: readonly string[]; readonly maxEntries: number; readonly maxFileBytes: number; readonly maxTotalBytes: number; }, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): readonly NativeProjectReadTreeEntry[]; export declare function readNativeProjectTreeAt(relativeRoot: string, options: { readonly excludedRoots: readonly string[]; readonly maxEntries: number; readonly maxFileBytes: number; readonly maxTotalBytes: number; }, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): readonly NativeProjectReadTreeEntry[]; export declare function captureNativeGeneratedProjectTreeManifest(relativeRoot: "build/test-results/test" | "target/surefire-reports", projectDir: string, expectations: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): readonly NativeProjectReadTreeEntry[] | undefined; export declare function readNativeGeneratedProjectTree(relativeRoot: "build/test-results/test" | "target/surefire-reports", options: { readonly maxEntries: number; readonly maxFileBytes: number; readonly maxTotalBytes: number; }, projectDir: string, expectations: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): readonly NativeProjectReadTreeEntry[] | undefined; export declare function runNativeProjectGit(command: NativeProjectGitCommand, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): Buffer; export declare function runNativeProjectGradle(command: NativeProjectGradleCommand, timeoutMs: number, projectDir?: string, expectations?: readonly NativeProjectReadExpectedPath[], rootContext?: NativeProjectReadRootContext): NativeProjectReadCommandResult;