import type { Config } from '../config/schema.js'; import type { ProjectService } from '../projects/project-service.js'; import type { SessionIndex } from '../session/manager.js'; import type { UnderstandingSourceItem } from '../user-context/sources/types.js'; import type { WorkDiscoveryCandidate, WorkDiscoveryOnboardingState, WorkDiscoveryRecognitionDecision, WorkDiscoveryRun, WorkDiscoverySource } from './types.js'; export type ModelProcessingPolicy = 'local_only' | 'remote_allowed'; /** Sanitize and round-robin local sources so one verbose source cannot starve the rest. */ export declare function normalizeUnderstandingSourceItems(rawItems: unknown[]): UnderstandingSourceItem[]; export interface WorkDiscoveryServiceOptions { projects: ProjectService; sessions: SessionIndex; getConfig: () => Config; emit: (type: string, payload: unknown) => void; } export declare class WorkDiscoveryService { private readonly options; private readonly abortControllers; private readonly backgroundRunProjects; private readonly executions; private stopped; private readonly candidateContexts; private readonly activity; constructor(options: WorkDiscoveryServiceOptions); startProjectUnderstanding(projectId: string): WorkDiscoveryRun; private queueProjectUnderstanding; resumeProjectUnderstanding(): void; dispatchProjectUnderstanding(): void; stop(): Promise; private trackExecution; private scheduleProjectUnderstanding; private runProjectUnderstanding; isEnabled(): boolean; getOnboardingState(): WorkDiscoveryOnboardingState; dismissOnboarding(): WorkDiscoveryOnboardingState; getRun(id: string): WorkDiscoveryRun | null; getInvestigation(runId: string): { investigation: import("./types.js").WorkUnderstandingInvestigation; evidence: import("./types.js").WorkUnderstandingEvidenceItem[]; }; discoverCandidates(signal?: AbortSignal): Promise; listDirectorySources(): import("./types.js").WorkDiscoveryDirectorySource[]; getModelProcessingTarget(): { provider: string; remoteModel: boolean; }; grantDirectorySource(rootPath: string, processingPolicy: ModelProcessingPolicy): Promise; checkDirectorySources(): Promise; refreshDirectorySourceIfChanged(input: { id: string; idempotencyKey: string; }): Promise<{ changed: boolean; refresh: import("./types.js").WorkDiscoverySourceRefresh; reused?: undefined; run?: undefined; } | { changed: boolean; reused: boolean; refresh: import("./types.js").WorkDiscoverySourceRefresh; run: WorkDiscoveryRun; } | { changed: boolean; run: WorkDiscoveryRun; refresh: import("./types.js").WorkDiscoverySourceRefresh; reused?: undefined; }>; revokeDirectorySource(id: string): import("./types.js").WorkDiscoveryDirectorySource; importUnderstandingSources(rawItems: unknown[], processingPolicy: ModelProcessingPolicy, signal?: AbortSignal, runId?: string, rawCheckpoints?: Record, refresh?: { grantId: string; }): Promise<{ profileCandidates: any[]; workThreads: import("./types.js").WorkUnderstandingThread[]; knowledgeCandidates: import("../knowledge-memory/domain.js").KnowledgeItem[]; sourceStatuses: import("./analyzer.js").UnderstandingSourceAnalysisStatus[]; } | { profileCandidates: any[]; workThreads: any[]; knowledgeCandidates: any[]; sourceStatuses: { sourceId: string; status: "completed"; }[]; }>; rescanDirectorySource(input: { id: string; idempotencyKey: string; }): Promise; startQuickRun(input: { idempotencyKey: string; processingPolicy: ModelProcessingPolicy; }): Promise; startRun(input: { rootPath: string; source: WorkDiscoverySource; idempotencyKey: string; candidateContext?: WorkDiscoveryCandidate[]; }): Promise; private publish; private execute; private persistProfileCandidates; cancelRun(id: string): WorkDiscoveryRun | null; abortDeletedProjectRuns(projectId: string, runIds: readonly string[]): void; retryRun(id: string): WorkDiscoveryRun | null; submitRecognitionFeedback(input: { runId: string; decision: WorkDiscoveryRecognitionDecision; correctedIntent?: string; }): Promise; selectSuggestion(runId: string, suggestionId: string): WorkDiscoveryRun | null; }