import type { AgencyConfig } from "../../config/config.js"; import type { GradersIdentity } from "../../runDirectory/annotations.js"; import type { BaseGrader } from "./baseGrader.js"; /** A grading module bundled into one self-contained file: everything it * imports inlined, except `agency-lang` itself. The hash names the revision. */ export type GradingBundle = { source: string; code: string; sha256: string; }; /** * Load a user-authored TypeScript grading module and return its graders. * Bundles with esbuild (leaving `agency-lang` external so the user's * `import { grader } from "agency-lang/eval"` resolves to the installed * package), imports the default export, and normalizes it to BaseGrader[]. */ export declare function loadGradingModule(filePath: string, _config: AgencyConfig): Promise; /** Bundle a grading module without loading it. */ export declare function bundleGradingModule(filePath: string): Promise; /** * The files a run directory keeps so the run can be graded later, anywhere, * by the graders it was run with: the bundle of a `graders.ts` under * `bundleFile`, or the `graders.json` itself under `jsonFile`, plus any * file a grader reads by path (a custom judge prompt). Names are content * hashes. `judgeFiles` maps each path as the grader declared it to its * stored name. Exactly one of `bundleFile` and `jsonFile` is set. */ export type GradersSnapshot = { source: string; bundleFile?: string; jsonFile?: string; judgeFiles: Record; files: { name: string; content: string; }[]; }; /** Bundle a grading module and collect its external files. Loads the module * once, so a broken module fails here, before any agent runs. */ export declare function snapshotGradingModule(filePath: string): Promise; /** The run row's record of a test's graders: the source, the one stored * file, the judge files, and the origin. */ export declare function gradersIdentityOf(snapshot: GradersSnapshot & { origin: GradersIdentity["origin"]; }): GradersIdentity; /** What a run row records about its graders' snapshot: where the graders * came from, and the stored names under the run directory's `graders/`. * Exactly one of `bundleFile` and `jsonFile` is set. */ export type RecordedGraders = { source: string; bundleFile?: string; jsonFile?: string; judgeFiles: Record; }; /** Load graders from a run directory's snapshot. The revision is the stored * bundle's hash under the original source path, so a row graded from the * snapshot and one graded live from the unchanged module agree. */ export declare function loadGradingSnapshot(gradersDir: string, recorded: RecordedGraders): Promise;