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 candidateContexts; private readonly activity; constructor(options: WorkDiscoveryServiceOptions); 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): Promise<{ profileCandidates: any[]; workThreads: any[]; knowledgeCandidates: any[]; sourceStatuses: { sourceId: string; status: "completed"; }[]; } | { profileCandidates: { status: "pending" | "rejected"; assertionId: string; id: string; category: "role" | "responsibility" | "preference" | "routine"; factKey: string; statement: string; confidence: "high" | "medium" | "low"; evidence: string[]; evidenceRefs?: string[]; }[]; workThreads: import("./types.js").WorkUnderstandingThread[]; knowledgeCandidates: import("../knowledge-memory/domain.js").KnowledgeItem[]; sourceStatuses: import("./analyzer.js").UnderstandingSourceAnalysisStatus[]; }>; 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; updateProfileCandidates(input: { runId: string; decisions: Array<{ id: string; status: 'accepted' | 'edited' | 'rejected'; statement?: string; }>; }): WorkDiscoveryRun | null; cancelRun(id: string): WorkDiscoveryRun | null; retryRun(id: string): WorkDiscoveryRun | null; submitRecognitionFeedback(input: { runId: string; decision: WorkDiscoveryRecognitionDecision; correctedIntent?: string; }): Promise; selectSuggestion(runId: string, suggestionId: string): WorkDiscoveryRun | null; }