import type { ArtifactStore } from '../../artifacts/index.js';
import type { KnowledgeStore } from '../store.js';
import type { KnowledgeEdgeRecord, KnowledgeIssueRecord, KnowledgeNodeRecord, KnowledgeSourceRecord } from '../types.js';
import { type HomeGraphReviewResult } from './review.js';
import type { KnowledgeSemanticService } from '../semantic/index.js';
import type { HomeGraphAskInput, HomeGraphAskResult, HomeGraphDevicePassportResult, HomeGraphExport, HomeGraphIngestArtifactInput, HomeGraphIngestNoteInput, HomeGraphIngestResult, HomeGraphIngestUrlInput, HomeGraphLinkInput, HomeGraphLinkResult, HomeGraphMapInput, HomeGraphMapResult, HomeGraphProjectionInput, HomeGraphProjectionResult, HomeGraphPageListResult, HomeGraphReindexInput, HomeGraphReindexResult, HomeGraphResetInput, HomeGraphResetResult, HomeGraphReviewInput, HomeGraphSpaceInput, HomeGraphSnapshotInput, HomeGraphStatus, HomeGraphSyncResult } from './types.js';
export declare class HomeGraphService {
    private readonly store;
    private readonly artifactStore;
    private readonly options;
    private activeReindex;
    private pendingSyncSelfImprove;
    private syncSelfImproveControllers;
    constructor(store: KnowledgeStore, artifactStore: ArtifactStore, options?: {
        readonly semanticService?: KnowledgeSemanticService;
    });
    dispose(): void;
    status(input?: {
        readonly installationId?: string;
        readonly knowledgeSpaceId?: string;
    }): Promise<HomeGraphStatus>;
    syncSnapshot(input: HomeGraphSnapshotInput): Promise<HomeGraphSyncResult>;
    ingestUrl(input: HomeGraphIngestUrlInput): Promise<HomeGraphIngestResult>;
    ingestNote(input: HomeGraphIngestNoteInput): Promise<HomeGraphIngestResult>;
    ingestArtifact(input: HomeGraphIngestArtifactInput): Promise<HomeGraphIngestResult>;
    linkKnowledge(input: HomeGraphLinkInput): Promise<HomeGraphLinkResult>;
    unlinkKnowledge(input: HomeGraphLinkInput): Promise<HomeGraphLinkResult>;
    ask(input: HomeGraphAskInput): Promise<HomeGraphAskResult>;
    reindex(input?: HomeGraphReindexInput): Promise<HomeGraphReindexResult>;
    private repairStaleExtractionsForAsk;
    refreshDevicePassport(input: HomeGraphProjectionInput): Promise<HomeGraphDevicePassportResult>;
    generateRoomPage(input: HomeGraphProjectionInput): Promise<HomeGraphProjectionResult>;
    generatePacket(input: HomeGraphProjectionInput): Promise<HomeGraphProjectionResult>;
    listIssues(input: HomeGraphSpaceInput & {
        readonly status?: string | undefined;
        readonly severity?: string | undefined;
        readonly code?: string | undefined;
        readonly limit?: number | undefined;
    }): Promise<{
        readonly ok: true;
        readonly spaceId: string;
        readonly issues: readonly KnowledgeIssueRecord[];
    }>;
    reviewFact(input: HomeGraphReviewInput): Promise<HomeGraphReviewResult>;
    listSources(input?: HomeGraphSpaceInput & {
        readonly limit?: number;
    }): Promise<{
        readonly ok: true;
        readonly spaceId: string;
        readonly sources: readonly KnowledgeSourceRecord[];
    }>;
    listPages(input?: HomeGraphSpaceInput & {
        readonly limit?: number;
        readonly includeMarkdown?: boolean;
    }): Promise<HomeGraphPageListResult>;
    listRefinementTasks(input?: HomeGraphSpaceInput & {
        readonly limit?: number | undefined;
        readonly state?: string | undefined;
        readonly subjectId?: string | undefined;
        readonly gapId?: string | undefined;
    }): Promise<{
        readonly ok: true;
        readonly spaceId: string;
        readonly tasks: readonly import("../types.js").KnowledgeRefinementTaskRecord[];
    }>;
    getRefinementTask(input: HomeGraphSpaceInput & {
        readonly taskId: string;
    }): Promise<{
        readonly ok: true;
        readonly spaceId: string;
        readonly task: import("../types.js").KnowledgeRefinementTaskRecord | null;
    }>;
    runRefinement(input?: HomeGraphSpaceInput & {
        readonly gapIds?: readonly string[] | undefined;
        readonly sourceIds?: readonly string[] | undefined;
        readonly limit?: number | undefined;
        readonly maxRunMs?: number | undefined;
        readonly force?: boolean | undefined;
    }): Promise<{
        ok: boolean;
        spaceId: string;
        error: string;
        result?: never;
    } | {
        ok: boolean;
        spaceId: string;
        result: import("../semantic/types.js").KnowledgeSemanticSelfImproveResult;
        error?: never;
    }>;
    cancelRefinementTask(input: HomeGraphSpaceInput & {
        readonly taskId: string;
    }): Promise<{
        ok: boolean;
        spaceId: string;
        error: string;
        task?: never;
    } | {
        ok: boolean;
        spaceId: string;
        task: import("../types.js").KnowledgeRefinementTaskRecord;
        error?: never;
    }>;
    browse(input?: HomeGraphSpaceInput & {
        readonly limit?: number;
    }): Promise<{
        readonly ok: true;
        readonly spaceId: string;
        readonly nodes: readonly KnowledgeNodeRecord[];
        readonly edges: readonly KnowledgeEdgeRecord[];
        readonly sources: readonly KnowledgeSourceRecord[];
        readonly issues: readonly KnowledgeIssueRecord[];
    }>;
    map(input?: HomeGraphMapInput): Promise<HomeGraphMapResult>;
    exportSpace(input?: HomeGraphSpaceInput): Promise<HomeGraphExport>;
    importSpace(input: HomeGraphSpaceInput & {
        readonly data: HomeGraphExport;
    }): Promise<{
        readonly ok: true;
        readonly spaceId: string;
        readonly imported: {
            readonly sources: number;
            readonly nodes: number;
            readonly edges: number;
            readonly issues: number;
            readonly extractions: number;
        };
    }>;
    resetSpace(input: HomeGraphResetInput): Promise<HomeGraphResetResult>;
    private ingestCreatedArtifact;
    private extractArtifact;
    private autoLinkExistingSources;
    private refreshQualityIssues;
    /**
     * Start the post-sync self-improvement pump for a Home Graph space.
     * The pump is intentionally delayed so the foreground sync response can
     * return before source search, semantic repair, and page refresh work begins.
     */
    private scheduleSyncSelfImprovement;
    /** Cancel pending or active post-sync improvement work for one space or all spaces. */
    private cancelSyncSelfImprovement;
    /**
     * Relentlessly repairs gaps discovered during sync until the run budget,
     * task budget, or cooperative abort signal says to stop.
     */
    private runSyncSelfImprovementPump;
    private enrichSpaceSources;
    private enrichAndImproveSource;
    private requireSelfImprovementRuntime;
    private reportBackgroundError;
}
//# sourceMappingURL=service.d.ts.map