import { type ServerRuleSpec, type RedactorFinding } from '@chat-recall/engine/core/secret-redactor.js'; /** One file of a session transcript. Mirrors RawContainer.files. */ export interface ScanFile { name: string; text: string; } /** * Derive a session's compute rows — diff, outcome, commits, markers. * * The heaviest per-session work in the walk and, until now, entirely on the main * thread: `replaySessionAny`, `computeOutcome` and `extractTurnsAny` each read * the whole transcript and shell out to git. Measured on the maintainer's tail * of sessions needing a rebuild: ~5 seconds each, against 78ms for the scan. * * It takes only an id — the worker reads the transcript itself, so nothing large * crosses the boundary on the way in, and `withSessionReadCache` inside means it * reads once rather than four times. */ export interface DerivedTask { id: number; task: 'derived'; prefixedId: string; toolId: string; mtime: number; maxRowBytes: number; pack?: { version: string; rules: ServerRuleSpec[]; }; packVersion: string; } export interface DerivedResult { id: number; rows: { session_id: string; mtime: number; compute: Array<{ kind: string; mtime: number; data: unknown; }>; outcome_row: unknown | null; } | null; redactions: number; error?: string; } export interface ScanTask { id: number; task?: 'scan'; files: ScanFile[]; /** Container fields needed to rebuild it for gzip, minus the file text. */ container: { v: 1; tool: string; mtime: number; srcHash?: string; }; /** Produce the gzipped archive too, or scan and redact only. */ includeRaw: boolean; /** Skip the archive when it would exceed this many gzipped bytes. */ maxRawBytes: number; /** Server rule pack, sent only when `packVersion` differs from the worker's. */ pack?: { version: string; rules: ServerRuleSpec[]; }; packVersion: string; } export interface ScanResult { id: number; findings: RedactorFinding[]; redactions: number; /** Present only when includeRaw and the archive fit inside maxRawBytes. */ rawB64?: string; rawSize?: number; error?: string; } //# sourceMappingURL=scan-worker.d.ts.map