/** * Approval Store implementations * * Features: * - In-memory store for development/testing * - File-based store for persistence * - Response callbacks for async notifications * - TTL-based cleanup */ import type { ApprovalStore, ApprovalRequest, ApprovalResponse } from '@cogitator-ai/types'; /** * In-memory approval store for development and testing */ export declare class InMemoryApprovalStore implements ApprovalStore { private requests; private responses; private callbacks; private ttl; private cleanupInterval?; constructor(options?: { ttl?: number; cleanupInterval?: number; }); createRequest(request: ApprovalRequest): Promise; getRequest(id: string): Promise; getPendingRequests(workflowId?: string): Promise; getPendingForAssignee(assignee: string): Promise; submitResponse(response: ApprovalResponse): Promise; getResponse(requestId: string): Promise; deleteRequest(id: string): Promise; onResponse(requestId: string, callback: (response: ApprovalResponse) => void): () => void; /** * Clean up expired requests */ private cleanup; /** * Stop cleanup interval */ dispose(): void; /** * Get all requests (for debugging) */ getAllRequests(): ApprovalRequest[]; /** * Get all responses (for debugging) */ getAllResponses(): ApprovalResponse[]; /** * Clear all data */ clear(): void; } /** * File-based approval store for persistence across restarts */ export declare class FileApprovalStore implements ApprovalStore { private readonly directory; private callbacks; private watchInterval?; private lastResponseCheck; private firedCallbacks; constructor(options: { directory: string; pollInterval?: number; }); private sanitizeId; private getRequestPath; private getResponsePath; createRequest(request: ApprovalRequest): Promise; getRequest(id: string): Promise; getPendingRequests(workflowId?: string): Promise; getPendingForAssignee(assignee: string): Promise; submitResponse(response: ApprovalResponse): Promise; getResponse(requestId: string): Promise; deleteRequest(id: string): Promise; onResponse(requestId: string, callback: (response: ApprovalResponse) => void): () => void; /** * Check for new responses (called by poll interval) */ private checkForResponses; /** * Stop polling */ dispose(): void; /** * Clean up expired requests */ cleanup(maxAge: number): Promise; } export declare function withDelegation(store: ApprovalStore, options?: { onDelegation?: (request: ApprovalRequest, from: string, to: string) => Promise; }): ApprovalStore; //# sourceMappingURL=approval-store.d.ts.map