/** * Evolution Store — evolution task primitives for SDK use. * * Extracts listEvolutionTasks and getEvolutionTask from TrajectoryDatabase * as pure functions that can be used without openclaw-plugin dependency. * * Reads the canonical workspace trajectory database * (`{workspaceDir}/.state/trajectory.db`) written by openclaw-plugin * TrajectoryDatabase — see trajectory-db.ts for the shared path contract. * * @example * import { listEvolutionTasks, getEvolutionTask } from '@principles/core/evolution-store'; */ export { TrajectoryDbUnavailableError } from './trajectory-store.js'; import type { TaskKind, TaskPriority } from './trajectory-types.js'; export type { TaskKind, TaskPriority }; export interface EvolutionTaskRecord { id: number; taskId: string; traceId: string; source: string; reason: string | null; score: number; status: string; enqueuedAt: string | null; startedAt: string | null; completedAt: string | null; resolution: string | null; createdAt: string; updatedAt: string; taskKind: TaskKind | null; priority: TaskPriority | null; retryCount: number | null; maxRetries: number | null; lastError: string | null; resultRef: string | null; } export interface EvolutionTaskFilters { status?: string; dateFrom?: string; dateTo?: string; limit?: number; offset?: number; } /** * List evolution tasks with optional filtering. * * @param workspaceDir - The workspace directory (DB path: {workspaceDir}/.state/trajectory.db) * @param filters - Optional filters (status, dateFrom, dateTo, limit, offset) * @returns Array of EvolutionTaskRecord; empty array means the database * exists and has no matching rows, OR the evolution tables are * absent (fresh workspace created after PRI-770) * @throws TrajectoryDbUnavailableError if the database does not exist or * cannot be opened — never silently treated as "no tasks" */ export declare function listEvolutionTasks(workspaceDir: string, filters?: EvolutionTaskFilters): EvolutionTaskRecord[]; /** * Get a single evolution task by numeric id or string taskId. * * @param workspaceDir - The workspace directory (DB path: {workspaceDir}/.state/trajectory.db) * @param idOrTaskId - Numeric id or string taskId * @returns EvolutionTaskRecord, or null when the database exists and the task * is not found, or when the evolution tables are absent (fresh * workspace created after PRI-770) * @throws TrajectoryDbUnavailableError if the database does not exist or * cannot be opened — never silently treated as "not found" */ export declare function getEvolutionTask(workspaceDir: string, idOrTaskId: string | number): EvolutionTaskRecord | null; //# sourceMappingURL=evolution-store.d.ts.map