import { type SafeReadResult } from "./safe-read.js"; import { type FileOutlineResult } from "./file-outline.js"; import { type ReadRangeResult } from "./read-range.js"; import { ObservationCache } from "./observation-cache.js"; import { GovernorTracker } from "../session/tracker.js"; import { type OutlineDiff } from "../parser/diff.js"; import type { JumpEntry, OutlineEntry } from "../parser/types.js"; import type { FileSystem } from "../ports/filesystem.js"; import type { JsonCodec } from "../ports/codec.js"; import type { ProseProjectionProvider } from "./colorful-prose-projection.js"; export interface RepoWorkspaceRefusedResult { readonly path: string; readonly projection: "refused"; readonly reason: string; readonly reasonDetail: string; readonly next: string[]; readonly actual: { readonly lines: number; readonly bytes: number; }; } export interface RepoWorkspaceSafeReadCacheHitResult { readonly path: string; readonly projection: "cache_hit"; readonly reason: "REREAD_UNCHANGED"; readonly outline: readonly OutlineEntry[]; readonly jumpTable: readonly JumpEntry[]; readonly actual: Readonly<{ lines: number; bytes: number; }>; readonly readCount: number; readonly estimatedBytesAvoided: number; readonly lastReadAt: string; } export interface RepoWorkspaceSafeReadDiffResult { readonly path: string; readonly projection: "diff"; readonly reason: "CHANGED_SINCE_LAST_READ"; readonly diff: OutlineDiff; readonly outline: readonly OutlineEntry[]; readonly jumpTable: readonly JumpEntry[]; readonly actual: Readonly<{ lines: number; bytes: number; }>; readonly readCount: number; readonly lastReadAt: string; } export type RepoWorkspaceSafeReadResult = SafeReadResult | RepoWorkspaceSafeReadCacheHitResult | RepoWorkspaceSafeReadDiffResult; export type RepoWorkspaceFileOutlineResult = FileOutlineResult | RepoWorkspaceRefusedResult; export type RepoWorkspaceReadRangeResult = ReadRangeResult | RepoWorkspaceRefusedResult; export type RepoWorkspaceChangedSinceResult = { readonly status: "file_not_found"; } | { readonly status: "refused"; readonly reason: string; } | { readonly status: "unsupported"; readonly reason: "UNSUPPORTED_LANGUAGE"; } | { readonly status: "unchanged"; } | { readonly status: "no_previous_observation"; } | { readonly diff: OutlineDiff; readonly consumed: boolean; }; export interface RepoWorkspaceOptions { readonly projectRoot: string; readonly fs: FileSystem; readonly codec: JsonCodec; readonly graftignorePatterns?: readonly string[] | undefined; readonly resolvePath?: ((input: string) => string) | undefined; readonly toPolicyPath?: ((resolvedPath: string) => string) | undefined; readonly governor?: GovernorTracker | undefined; readonly cache?: ObservationCache | undefined; readonly proseProjector?: ProseProjectionProvider | undefined; } export declare class RepoWorkspace { private readonly resolveWorkspacePath; private readonly policyPathForWorkspaceFile; readonly projectRoot: string; readonly fs: FileSystem; readonly codec: JsonCodec; readonly graftignorePatterns: readonly string[]; readonly governor: GovernorTracker; readonly cache: ObservationCache; readonly proseProjector: ProseProjectionProvider | undefined; constructor(options: RepoWorkspaceOptions); static loadGraftignorePatterns(fs: Pick, projectRoot: string): Promise; setBudget(bytes: number): void; getBudget(): { total: number; consumed: number; remaining: number; fraction: number; } | null; private evaluateRefusal; private outlineForSnapshot; safeRead(args: { readonly path: string; readonly intent?: string | undefined; }): Promise; fileOutline(args: { readonly path: string; }): Promise; readRange(args: { readonly path: string; readonly start: number; readonly end: number; }): Promise; changedSince(args: { readonly path: string; readonly consume?: boolean | undefined; }): Promise; } //# sourceMappingURL=repo-workspace.d.ts.map