/** * JSONL append-only store for observability events. * * Slice A of v2.11.1 (slice topology observability). Pure file I/O — * no schema knowledge lives here. Schema/validation lives in * `observability-service.ts`. * * Layout: `.peaks/_runtime//metrics/slices.jsonl` — one file * per session, append-only. Mtime-based cross-session prune keeps at * most `MAX_METRICS_FILES` files in the repo (mirrors the * `peaks session checkpoint` contract). * * Write path is fire-and-forget: errors (disk full, permission * denied, ENOENT mid-write) are swallowed silently per PRD Q4 * (full-auto must never fail-loud on observability). */ export declare const METRICS_DIR = "metrics"; export declare const METRICS_FILENAME = "slices.jsonl"; export declare const MAX_METRICS_FILES = 10; /** Absolute path to a session's metrics JSONL file. */ export declare function metricsFilePath(projectRoot: string, sessionId: string): string; /** Absolute path to a session's metrics directory. */ export declare function metricsDirPath(projectRoot: string, sessionId: string): string; /** * Append one line to the session's metrics JSONL file. Creates the * directory tree on demand. Returns true on success, false on any * error (the caller MUST treat false as "drop silently" per Q4). */ export declare function appendMetricLine(projectRoot: string, sessionId: string, line: string): boolean; /** * Read all non-empty lines from a session's metrics JSONL file. * Returns [] when the file does not exist. Does NOT parse — callers * decide what counts as valid (see `observability-service.ts` * `readObservabilityEvents` for the schema-aware reader). */ export declare function readMetricLines(projectRoot: string, sessionId: string): string[]; export type SessionMetricsEntry = { sessionId: string; mtimeMs: number; path: string; }; /** * List every session that currently has a metrics JSONL on disk, * paired with its mtime. Ordered by sessionId for determinism; the * caller decides mtime ordering (see `pruneMetricsFiles`). */ export declare function listSessionDirsWithMetrics(projectRoot: string): SessionMetricsEntry[]; /** * Prune the metrics files across all sessions, retaining at most * `MAX_METRICS_FILES` by mtime (newest kept). Returns the list of * removed absolute paths. Best-effort: a failed removal is silently * skipped (matches Q4 fire-and-forget contract). */ export declare function pruneMetricsFiles(projectRoot: string): string[]; export declare const JSONL_STORE_CONSTANTS: { readonly METRICS_DIR: "metrics"; readonly METRICS_FILENAME: "slices.jsonl"; readonly MAX_METRICS_FILES: 10; };