import { Buffer } from 'node:buffer'; import { type FileHandle } from 'node:fs/promises'; /** * Neutral scan primitives shared by provider-owned Activity readers. This module * holds only mechanism — bounded positional reads, digests, path containment, * and a scan budget. It knows nothing about any native history layout, and it * owns no record shape: `AgentActivityRecord` is a public contract each provider * projects for itself. */ export declare const SCAN_DISCOVERY_MAX_ENTRIES = 20000; export declare const SCAN_DISCOVERY_MAX_ELAPSED_MS = 2000; export interface ScanBudget { inspect(entries?: number): void; } export interface PositionalReader { read(buffer: Buffer, offset: number, length: number, position: number): Promise<{ bytesRead: number; }>; } export declare function scanDigest(value: string | Uint8Array): string; export declare function isScanDigest(value: unknown): value is string; /** * Digest of the query shape a cursor was issued for, so a reader can reject a * cursor minted under a different query (e.g. a different `includeTools`) * instead of silently reinterpreting its position against the wrong records. */ export declare function activityQueryFingerprint(includeTools: boolean): string; export declare function createScanBudget(input: { maxEntries?: number; maxElapsedMs?: number; now?: () => number; limitError: () => Error; }): ScanBudget; export declare function readBytesAt(reader: PositionalReader, position: number, length: number, options?: { maxChunkBytes?: number; }): Promise; export declare function isPathWithin(root: string, candidate: string): boolean; interface ActivityFileMessages { notFound: string; outsideRoot: string; notRegularFile: string; changedWhileOpening: string; unreadable: string; } export interface OpenedActivityFile { handle: FileHandle; path: string; size: number; dev: number | bigint; ino: number | bigint; } export declare function openActivityFile(candidate: string, canonicalRoots: readonly string[], messages: ActivityFileMessages): Promise; export {}; //# sourceMappingURL=activity-scan.d.ts.map