export type ArtifactStatus = 'created' | 'finalized' | 'partial' | 'failed'; export interface ArtifactMeta { readonly path: string; readonly size: number; readonly sha256: string; readonly status: ArtifactStatus; /** Mandatory literal `false`. The type system rejects `true`. */ readonly contentInlined: false; /** 1-2 sentence description, ≤ 200 chars. Allowed in main context. */ readonly summary: string | null; /** ISO8601. */ readonly writtenAt: string; /** Request id this artifact belongs to. */ readonly rid: string; /** Sub-agent role string. */ readonly role: string; /** Sequence number when same role is dispatched multiple times. */ readonly idx: number; } export interface ContextImpact { readonly promptSize: number; readonly artifactSizes: readonly number[]; readonly batchTotalSize: number; /** `high` if `batchTotalSize > 4MB` OR any `artifactSize > 1MB`. */ readonly contextWarning: 'normal' | 'high' | 'critical'; } /** * Compute the sha256 hex digest of a file. Throws if the file does not * exist or is not readable. Caller is expected to handle ENOENT as * `code: 'ARTIFACT_NOT_FOUND'` and treat 0-byte files as `status: 'failed'`. */ export declare function computeSha256(filePath: string): string; /** * Build an `ArtifactMeta` from on-disk file. Computes size + sha256. * * `status` semantics: * - `'created'` — file exists, non-empty, sha256 succeeded * - `'failed'` — file is 0 bytes (R-2 / G7.4.e: do not silently succeed) * - `'partial'` — caller-provided (e.g. sub-agent reports unfinished work) * - `'finalized'` — caller-provided (e.g. sub-agent reports complete) */ export declare function buildArtifactMeta(opts: { path: string; rid: string; role: string; idx: number; summary: string | null; status?: ArtifactStatus; /** Override sha256 / size (e.g. when caller already computed them). */ precomputed?: { size: number; sha256: string; }; /** Override the writtenAt timestamp. */ writtenAt?: string; }): ArtifactMeta; /** * Build a `ContextImpact` from a prompt size + artifact sizes. * Computes `contextWarning` per the G7.3 rule: * - `'critical'` if any artifact > ARTIFACT_MAX_SIZE_BYTES * - `'high'` if total > BATCH_TOTAL_HIGH_BYTES (4MB) * - `'normal'` otherwise */ export declare function buildContextImpact(opts: { promptSize: number; artifactSizes: readonly number[]; }): ContextImpact; export declare const ARTIFACT_LIMITS: { readonly ARTIFACT_MAX_SIZE_BYTES: number; readonly BATCH_TOTAL_HIGH_BYTES: number; readonly ARTIFACT_SUMMARY_MAX_CHARS: 200; };