import type { SqliteDatabase } from '../db/adapter.js'; export { enqueueAllCurrentEntryEmbeddingsInTransaction, enqueueCurrentEntryEmbeddingInTransaction } from './store.js'; export type { CurrentEntryEmbeddingJobInput } from './store.js'; export declare const EMBEDDING_JOB_LEASE_MS = 60000; export declare const EMBEDDING_JOB_MAX_ATTEMPTS = 6; export type EmbeddingJobState = 'pending' | 'leased' | 'failed' | 'blocked'; export type EmbeddingJobErrorCode = 'timeout' | 'rate_limited' | 'provider_unavailable' | 'invalid_response' | 'dimension_mismatch' | 'secret_blocked' | 'profile_changed' | 'entry_changed'; export interface EmbeddingJob { readonly entryId: string; readonly profileId: string; readonly revision: number; readonly contentHash: string; readonly state: EmbeddingJobState; readonly attempts: number; readonly availableAt: string; readonly leaseId: string | null; readonly leaseExpiresAt: string | null; readonly errorCode: EmbeddingJobErrorCode | null; readonly createdAt: string; readonly updatedAt: string; readonly workspace: string; } export interface ClaimedEmbeddingJob extends EmbeddingJob { readonly state: 'leased'; readonly generation: number; readonly leaseId: string; readonly leaseExpiresAt: string; } export interface ClaimEmbeddingJobsOptions { readonly maxJobs: number; readonly workspace?: string; readonly now?: string; readonly leaseMs?: number; readonly leaseIdFactory?: () => string; } export interface FinalizeEmbeddingJobInput { readonly entryId: string; readonly profileId: string; readonly generation: number; readonly leaseId: string; readonly revision: number; readonly contentHash: string; readonly documentHash: string; readonly vector: Float32Array | readonly number[]; readonly now: string; } export interface FailEmbeddingJobInput { readonly entryId: string; readonly profileId: string; readonly generation: number; readonly leaseId: string; readonly errorCode: EmbeddingJobErrorCode; readonly availableAt: string; readonly now: string; readonly permanent?: boolean; } export declare function claimEmbeddingJobs(database: SqliteDatabase, options: ClaimEmbeddingJobsOptions): ClaimedEmbeddingJob[]; export declare function finalizeEmbeddingJobInTransaction(database: SqliteDatabase, input: FinalizeEmbeddingJobInput): void; export declare function finalizeEmbeddingJob(database: SqliteDatabase, input: FinalizeEmbeddingJobInput): void; export declare function failEmbeddingJobInTransaction(database: SqliteDatabase, input: FailEmbeddingJobInput): boolean; export declare function failEmbeddingJob(database: SqliteDatabase, input: FailEmbeddingJobInput): boolean; export declare function listEmbeddingJobs(database: SqliteDatabase, options?: { profileId?: string; workspace?: string; state?: EmbeddingJobState; }): EmbeddingJob[]; //# sourceMappingURL=jobs.d.ts.map