import type { DaemonRuntimeConfig, ExtractionMode } from "./config.js"; import type { DaemonLogger } from "./logger.js"; import type { EpisodeTriageMemoryType } from "./local-ai/schemas.js"; import { type Store } from "./types.js"; import type { DaemonScope } from "./scope.js"; export type ExtractionRoute = "gateway" | "byok" | "local"; export type ExtractionComputeOwner = "coppermind" | "user" | "local-device"; export type ExtractionKeyOwner = "coppermind" | "user" | "none"; export type ExtractionJobStatus = "pending" | "running" | "succeeded" | "failed" | "dead-lettered"; export interface ExtractionExecutionPlan { jobId: string; mode: ExtractionMode; route: ExtractionRoute; computeOwner: ExtractionComputeOwner; keyOwner: ExtractionKeyOwner; providerUrl: string; model: string; available: boolean; unavailableReason?: string; } export interface LocalExtractionResult { summary: string; facts: string[]; quality: "local-heuristic"; tokensEstimated: number; tags?: string[]; memoryTypeHint?: EpisodeTriageMemoryType | null; orchestrator?: { task: "candidate_compression"; mode: "model" | "fallback"; reason: string | null; }; } export interface ExtractionJobRecord { jobId: string; createdAt: number; updatedAt: number; status: ExtractionJobStatus; plan: ExtractionExecutionPlan; inputPreview: string; extracted?: LocalExtractionResult | Record | null; error?: string; } export interface ExtractionUsageState { totalJobs: number; pendingJobs: number; runningJobs: number; succeededJobs: number; failedJobs: number; deadLetteredJobs: number; byMode: Record; byRoute: Record; updatedAt: number | null; } export interface ExtractionStatusState { jobsById: Record; lastJobId: string | null; updatedAt: number | null; } export interface ExtractionJobExecutionInput { content: string; scope: DaemonScope; config: DaemonRuntimeConfig; store: Store; logger?: DaemonLogger; jobId?: string; fetchImpl?: typeof fetch; } export interface ExtractionStatusSnapshot { mode: ExtractionMode; route: ExtractionRoute; computeOwner: ExtractionComputeOwner; keyOwner: ExtractionKeyOwner; providerUrl: string; model: string; available: boolean; unavailableReason: string | null; usage: ExtractionUsageState; latestJob: ExtractionJobRecord | null; } declare const EXTRACTION_STATUS_CONFIG_KEY: "last_extraction_status"; export declare const EXTRACTION_PENDING_PAYLOADS_CONFIG_KEY: typeof EXTRACTION_STATUS_CONFIG_KEY; export declare function getDefaultExtractionStatusState(): ExtractionStatusState; export declare function getExtractionStatusState(store: Store): ExtractionStatusState; export declare function setExtractionStatusState(store: Store, state: ExtractionStatusState): void; export declare function recoverPendingExtractionJobs(store: Store, options?: { startWorkers?: boolean; }): string[]; export declare function buildExtractionExecutionPlan(scope: DaemonScope, config: DaemonRuntimeConfig, overrides?: Partial>): ExtractionExecutionPlan; export declare function runLocalExtraction(content: string, _options?: { model?: string; }): LocalExtractionResult; export declare function enqueueExtractionJob(input: ExtractionJobExecutionInput): ExtractionJobRecord; export declare function getExtractionJobStatus(store: Store, jobId: string): ExtractionJobRecord | null; export declare function buildExtractionStatusSnapshot(config: DaemonRuntimeConfig, store: Store, scope?: DaemonScope): ExtractionStatusSnapshot; export {}; //# sourceMappingURL=extraction.d.ts.map