import type { ArtifactStore } from '../artifacts/index.js';
import type { KnowledgeEdgeRecord, KnowledgeNodeRecord, KnowledgeSourceRecord } from './types.js';
export interface GeneratedKnowledgePageGraphNode {
    readonly id: string;
    readonly kind: string;
    readonly title: string;
    readonly [key: string]: unknown;
}
export type GeneratedKnowledgePageGraphNeighbor<TNode extends GeneratedKnowledgePageGraphNode = GeneratedKnowledgePageGraphNode> = TNode & {
    readonly relation: string;
    readonly direction: 'incoming' | 'outgoing';
};
export interface GeneratedKnowledgeRelatedPage<TNode extends GeneratedKnowledgePageGraphNode = GeneratedKnowledgePageGraphNode> {
    readonly sourceId: string;
    readonly title: string;
    readonly projectionKind?: string | undefined;
    readonly subject?: TNode | undefined;
}
export interface GeneratedKnowledgePageEntry<TNode extends GeneratedKnowledgePageGraphNode = GeneratedKnowledgePageGraphNode> {
    readonly source: KnowledgeSourceRecord;
    readonly artifact?: {
        readonly id: string;
        readonly mimeType: string;
        readonly filename?: string | undefined;
        readonly createdAt: number;
        readonly metadata: Record<string, unknown>;
    };
    readonly markdown?: string | undefined;
    readonly target?: TNode | undefined;
    readonly subject?: TNode | undefined;
    readonly neighbors?: readonly GeneratedKnowledgePageGraphNeighbor<TNode>[] | undefined;
    readonly relatedPages?: readonly GeneratedKnowledgeRelatedPage<TNode>[] | undefined;
}
export interface GeneratedKnowledgePageListResult<TNode extends GeneratedKnowledgePageGraphNode = GeneratedKnowledgePageGraphNode> {
    readonly ok: true;
    readonly spaceId: string;
    readonly pages: readonly GeneratedKnowledgePageEntry<TNode>[];
}
export interface GeneratedKnowledgePageListOptions<TNode extends GeneratedKnowledgePageGraphNode = GeneratedKnowledgePageGraphNode> {
    readonly artifactStore: ArtifactStore;
    readonly spaceId: string;
    readonly sources: readonly KnowledgeSourceRecord[];
    readonly nodes: readonly KnowledgeNodeRecord[];
    readonly edges: readonly KnowledgeEdgeRecord[];
    readonly limit: number;
    readonly includeMarkdown: boolean;
    readonly isGeneratedSource?: ((source: KnowledgeSourceRecord) => boolean) | undefined;
    readonly isPageSubjectNode?: ((node: KnowledgeNodeRecord) => boolean) | undefined;
    readonly resolvePageSubject?: ((target: KnowledgeNodeRecord, graph: GeneratedKnowledgePageGraph) => KnowledgeNodeRecord | undefined) | undefined;
    readonly projectNode?: ((node: KnowledgeNodeRecord) => TNode) | undefined;
    readonly compareGeneratedPages?: (left: KnowledgeSourceRecord, right: KnowledgeSourceRecord, graph: GeneratedKnowledgePageGraph) => number;
    readonly relatedPageLimit?: number | undefined;
}
export interface GeneratedKnowledgePageGraph {
    readonly nodesById: ReadonlyMap<string, KnowledgeNodeRecord>;
    readonly edges: readonly KnowledgeEdgeRecord[];
    readonly generatedSources: readonly KnowledgeSourceRecord[];
    readonly targetBySourceId: ReadonlyMap<string, KnowledgeNodeRecord>;
}
export declare function listGeneratedKnowledgePages<TNode extends GeneratedKnowledgePageGraphNode = GeneratedKnowledgePageGraphNode>(input: GeneratedKnowledgePageListOptions<TNode>): Promise<GeneratedKnowledgePageListResult<TNode>>;
export declare function buildGeneratedKnowledgePageGraph(sources: readonly KnowledgeSourceRecord[], nodes: readonly KnowledgeNodeRecord[], edges: readonly KnowledgeEdgeRecord[], isGeneratedSource?: (source: KnowledgeSourceRecord) => boolean): GeneratedKnowledgePageGraph;
//# sourceMappingURL=generated-pages.d.ts.map