import { VaultCloudClient } from './cloud.js'; import { generateContextWithFallback, type ContextResult } from './context-engines.js'; import { type TelegramObservation } from './telegram.js'; import { privateStore } from './private-store.js'; import { type CrystalMirrorRecord } from './crystal-memory-mirror.js'; export interface GenerationJob { id: string; projectId: string; sessionId?: string; agentId?: string; text: string; title?: string; kind: 'observation' | 'summary' | 'prompt'; maxChars?: number; generate?: boolean; filesRead?: string[]; filesModified?: string[]; owner?: string; attempts?: number; nextAttemptAt?: number; lastError?: string; result?: Pick; } export declare function ownerKey(home: string): string; export interface PendingCrystalMirror extends CrystalMirrorRecord { owner: string; queuedAt: number; } export type CrystalMirrorStore = Pick, 'keyStorage' | 'read' | 'write' | 'remove' | 'close'>; export type CrystalMirrorStoreFactory = (home: string) => CrystalMirrorStore; export declare const MAX_PENDING_CRYSTAL_MIRRORS = 500; export declare function pendingCrystalMirrors(home?: string, openStore?: CrystalMirrorStoreFactory): Promise; export declare function queuePendingCrystalMirror(home: string, owner: string, record: CrystalMirrorRecord, openStore?: CrystalMirrorStoreFactory): Promise; /** Retries locked Crystal copies for this account, stopping at the first sign the Crystal is still locked or closed. */ export declare function flushPendingCrystalMirrors(home?: string, owner?: string, options?: { limit?: number; openStore?: CrystalMirrorStoreFactory; }): Promise; export declare function enqueueGeneration(home: string, job: GenerationJob): Promise; export declare function generationQueueStatus(home?: string): { pending: number; failed: number; legacyAwaitingOwnership: number; heldForOtherAccount: number; }; export declare function processGenerationQueue(home?: string, cloud?: VaultCloudClient, generate?: typeof generateContextWithFallback, options?: { notifyObservation?: (observation: TelegramObservation) => Promise; crystalMirrorStore?: CrystalMirrorStoreFactory; }): Promise;