import type { Database as DatabaseType } from 'better-sqlite3'; export declare const MAX_ARTIFACT_OPS_PER_ROUND = 5; export declare const MAX_ARTIFACT_OP_ROUNDS = 3; export type ArtifactVersionRef = number | 'current'; export type ArtifactDiffFormat = 'summary' | 'unified'; export interface ReadCurrentOperation { op_id: string; op: 'read-current'; artifact_id: number; } export interface ReadVersionOperation { op_id: string; op: 'read-version'; artifact_id: number; version: ArtifactVersionRef; } export interface ReadDiffOperation { op_id: string; op: 'read-diff'; artifact_id: number; from_version: ArtifactVersionRef; to_version: ArtifactVersionRef; format?: ArtifactDiffFormat; } export type ArtifactReadOperation = ReadCurrentOperation | ReadVersionOperation | ReadDiffOperation; export interface ArtifactOpsFile { operations: ArtifactReadOperation[]; } export interface ArtifactOpValidationError { message: string; entry?: number; } export interface ArtifactReadAccessState { currentVersionsRead: Record; versionsRead: Record; } interface ArtifactOpSuccessBase { op_id: string; ok: true; artifact_id: number; } interface ArtifactOpFailure { op_id: string; ok: false; op: ArtifactReadOperation['op']; artifact_id?: number; error: string; } export interface ReadCurrentResult extends ArtifactOpSuccessBase { op: 'read-current'; version: number; content_type: string; truncated: false; body: string; } export interface ReadVersionResult extends ArtifactOpSuccessBase { op: 'read-version'; version: number; content_type: string; truncated: false; body: string; } export interface ReadDiffResult extends ArtifactOpSuccessBase { op: 'read-diff'; from_version: number; to_version: number; format: ArtifactDiffFormat; summary: string; diff?: string; stats: { added_lines: number; removed_lines: number; }; truncated: false; } export type ArtifactOpResult = ArtifactOpFailure | ReadCurrentResult | ReadVersionResult | ReadDiffResult; export interface ExecuteArtifactOpsResult { results: ArtifactOpResult[]; accessState: ArtifactReadAccessState; } export declare function readArtifactOpsFile(outputDir: string): { raw: unknown; error?: string; }; export declare function validateArtifactOps(raw: unknown): { ops: ArtifactReadOperation[]; errors: ArtifactOpValidationError[]; } | { ops: null; errors: ArtifactOpValidationError[]; }; export declare function executeArtifactOps(db: DatabaseType, topicScope: number | number[], ops: ArtifactReadOperation[], previousState?: ArtifactReadAccessState): ExecuteArtifactOpsResult; export declare function formatArtifactOpResults(results: ArtifactOpResult[]): string; export {}; //# sourceMappingURL=ops.d.ts.map