declare function resolveMaxFileBytes(): number; declare function resolveMaxJobBytes(): number; declare function resolveMaxFiles(): number; export interface JobArtifactDirs { jobDir: string; inputDir: string; outputDir: string; } export type InputSource = { name: string; fromCallerOutput: string; } | { name: string; fromAbsolutePath: string; } | { name: string; content: string; }; export interface OutputFile { name: string; bytes: number; mtime: string; } /** Resolve the on-disk dirs for a job. Does NOT create them. Pure path math. */ export declare function getArtifactsDir(jobId: number): JobArtifactDirs; /** Make sure all three dirs exist; idempotent. * * Security: dir mode 0o700 so other users on the host can't traverse * into a job's artifacts (which may contain operator code copies, * A2A intermediate files, etc). Files inside get mode 0o600 on write. * Note: mkdir's `mode` is masked by the process umask on most systems, * but with default umask 0022 this still produces 0o700 → 0o700 ∩ 0o755 = 0o700, * so the explicit mode dominates the OS default. */ export declare function ensureArtifactsDir(jobId: number): Promise; /** Copy the caller-supplied inputs into the callee's _agim-input/. * Resolution rules: * - `fromAbsolutePath` — copyFile from disk; absolute paths only (reject * anything with a relative segment to avoid CWD-dependent surprises). * - `fromCallerOutput` — pull from //_agim-output/. * - `content` — write the string verbatim (UTF-8). * All three honor the per-file size cap. After every write the running * per-job byte+count totals are re-checked; on overflow we throw + leave * the partial state for the caller to inspect on failure. * Uses hard links when source/destination share a device — near-zero * cost for read-only inputs. Falls back to copy on EXDEV. */ export declare function copyInputs(jobId: number, inputs: InputSource[], callerJobId?: number): Promise>; /** List everything the callee left under _agim-output/. */ export declare function listOutputs(jobId: number): Promise; /** Read a single output file (for /a2a tree or future Web UI download). */ export declare function readOutput(jobId: number, name: string): Promise; /** Write a single output file into /_agim-output/ (used to spill an * over-long A2A result so the caller can read the full text on demand). */ export declare function writeOutput(jobId: number, name: string, data: string | Buffer): Promise; /** Drop the whole / tree. Safe on missing dirs. */ export declare function pruneArtifacts(jobId: number): Promise; /** Drop dirs for every jobId in the given list. Called by job-board's * retention sweep with rows it just deleted. */ export declare function pruneArtifactsBatch(jobIds: number[]): Promise; /** Compute per-job totals (used by tests + future /a2a stats extension). */ export declare function statJob(jobId: number): Promise<{ files: number; bytes: number; outputs: OutputFile[]; inputs: Array<{ name: string; bytes: number; }>; }>; export interface EnvelopeOpts { jobId: number; inputs: Array<{ name: string; bytes: number; }>; expectOutputs?: string[]; } /** Build the [A2A workspace] preamble the callee sees prefixed to its * prompt. We use a clearly-tagged block so the model treats it as * agim metadata and doesn't blur it with the user's intent. */ export declare function buildEnvelope(opts: EnvelopeOpts): string; declare function formatBytes(n: number): string; /** Test hook: wipe ALL artifacts. Production code must never call this. */ export declare function _wipeAllForTests(): Promise; /** Internal exports for tests. */ export declare const _internal: { ROOT: string; formatBytes: typeof formatBytes; resolveMaxFileBytes: typeof resolveMaxFileBytes; resolveMaxJobBytes: typeof resolveMaxJobBytes; resolveMaxFiles: typeof resolveMaxFiles; }; export {}; //# sourceMappingURL=artifacts.d.ts.map