import type { AgencyProgram } from "../types.js"; /** One file of an agent's .agency import closure, parsed exactly once. * Two consumers: seeding reads only `absoluteFile`; the optimizer's target * discovery reads `source` (content hashes for safe writeback) and * `program` (finding optimize-marked declarations). */ export type ParsedSourceFile = { absoluteFile: string; source: string; program: AgencyProgram; }; /** Walk the local .agency import closure of `absoluteEntryFile`, parsing each * file once. The single parse pass target discovery and seeding both share. */ export declare function walkAgencyClosure(absoluteEntryFile: string): ParsedSourceFile[]; /** Absolute base directory a closure's relative paths hang off: the files' * common ancestor, unless that lies inside the current working directory, in * which case cwd wins. */ export declare function closureBaseDir(absoluteFiles: string[]): string; export declare function commonAncestor(paths: string[]): string; /** The entry file's full local closure: every .agency file the walk reaches, * plus the transitive local TS/JS files their interop imports need. baseDir * is computed from the .agency files only, so adding TS deps can never * shift it. */ export declare function agentClosure(entryFile: string): { baseDir: string; files: string[]; }; export declare function agentClosureBaseDir(entryFile: string): string;