import type { TraceEnvelope } from './types.ts'; export interface TraceQuery { member?: string; correlationId?: string; since?: string; until?: string; limit?: number; } /** * Resolves the trace store path from `observability.tracePath` (relative paths * are resolved against the project root), defaulting to the conventional * `.agenthood/traces/traces.ndjson`. */ export declare function resolveTraceStorePath(projectPath: string, config?: Record): string; /** Reads the project config, or an empty object when missing/corrupt. */ export declare function loadObservabilityConfig(projectPath: string): Record; export interface TraceStore { store(envelope: TraceEnvelope): Promise; query(filters?: TraceQuery): Promise; } export interface TraceRetentionPolicy { /** Traces older than this are pruned; 0 or negative disables TTL pruning */ ttlMs: number; /** Maximum entries kept, oldest pruned first; undefined keeps all */ maxEntries?: number; exportEnabled?: boolean; /** NDJSON destination for pruned traces */ exportPath?: string; } export interface PruneResult { pruned: number; exported: number; exportPath?: string; remaining: number; } /** * File-based trace persistence (NDJSON, one envelope per line). * Loads existing traces on construction and appends on store. */ export declare class JSONFileTraceStore implements TraceStore { private filePath; private cached; constructor(filePath: string); private load; store(envelope: TraceEnvelope): Promise; query(filters?: TraceQuery): Promise; /** * Removes traces older than the policy TTL and beyond the entry cap, * exporting the pruned envelopes to NDJSON before they are deleted. */ prune(policy: TraceRetentionPolicy): Promise; } /** Schedules retention pruning on a fixed cadence; the timer never keeps the process alive. */ export declare class RetentionManager { private readonly store; private readonly policy; private readonly intervalMs; private timer; constructor(store: JSONFileTraceStore, policy: TraceRetentionPolicy, intervalMs?: number); prune(): Promise; start(): void; stop(): void; } /** Builds a retention policy from a parsed `observability.retention` config block. */ export declare function createRetentionPolicyFromConfig(raw: unknown): TraceRetentionPolicy | undefined; //# sourceMappingURL=TraceStore.d.ts.map