import type { EventEnvelope, ReceiptFamily, SessionState } from "./types"; interface HarnessRootRegistryEntry { root: string; updatedAt: string; } export interface HarnessRootRegistryForGc { sessionId: string; roots: HarnessRootRegistryEntry[]; } export interface HarnessRootRegistryListingForGc { sessionId: string; file: string; roots: HarnessRootRegistryEntry[]; error?: string; } interface ResolveHarnessSessionRootOptions { expectedWorkspace?: string; } export declare function canonicalWorkspacePath(workspace: string): string; /** @internal */ export declare function listHarnessRootRegistriesForGc(env?: NodeJS.ProcessEnv): Promise; /** @internal */ export declare function rewriteHarnessRootRegistryForGc(file: string, registry: HarnessRootRegistryForGc): Promise; /** @internal */ export declare function removeHarnessRootRegistryFileForGc(file: string): Promise; export declare const MAX_UNIX_SOCKET_PATH_BYTES = 100; export declare function controlSocketPath(root: string, sessionId: string, env?: NodeJS.ProcessEnv): string; export declare class StorageError extends Error { readonly code: string; constructor(message: string, code: string); } /** Resolve the harness state root from explicit value, env, or cwd/session default. */ export declare function resolveHarnessRoot(opts?: { root?: string; cwd?: string; env?: NodeJS.ProcessEnv; gjcSessionId?: string; }): string; export declare function assertSafeSessionId(id: string): void; export declare function generateSessionId(prefix?: string): string; export interface SessionPaths { dir: string; state: string; lease: string; events: string; receiptsIndex: string; receiptsDir: string; artifactsDir: string; controlSock: string; controlFifo: string; gjcSessionDir: string; } export declare function sessionPaths(root: string, sessionId: string): SessionPaths; export declare function readSessionState(root: string, sessionId: string): Promise; export declare function rememberHarnessSessionRoot(root: string, sessionId: string, env?: NodeJS.ProcessEnv): Promise; export declare function resolveHarnessSessionRoot(root: string, sessionId: string, env?: NodeJS.ProcessEnv, options?: ResolveHarnessSessionRootOptions): Promise; export declare function writeSessionState(root: string, state: SessionState): Promise; export declare function sessionExists(root: string, sessionId: string): Promise; /** Append a single severity envelope to events.jsonl. Single-writer discipline is the owner's job (M3). */ export declare function appendEvent(root: string, sessionId: string, envelope: EventEnvelope): Promise; /** Read events from cursor (exclusive). Tail-only: never mutates the log. */ export declare function readEvents(root: string, sessionId: string, fromCursor?: number): Promise; export interface ReceiptIndexEntry { receiptId: string; family: ReceiptFamily; valid: boolean; createdAt: string; path: string; } /** * Persist a receipt immutably. Fails closed if the receipt id already exists, * then appends an index entry to receipts.jsonl. */ export declare function writeReceiptImmutable(root: string, sessionId: string, family: ReceiptFamily, receiptId: string, value: { receiptId: string; family: ReceiptFamily; valid: boolean; createdAt: string; }): Promise; export declare function readReceiptIndex(root: string, sessionId: string, family?: ReceiptFamily): Promise; export {};