/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import { DocumentRootNode } from "@workglow/knowledge-base"; import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow, IExecuteContext, Task } from "@workglow/task-graph"; import { DataPortSchema } from "@workglow/util/schema"; import type { Capability } from "../capability/Capabilities"; import { ModelConfig } from "../model/ModelSchema"; export type DocumentEnricherTaskInput = Omit<{ doc_id?: string | undefined; documentTree?: { [x: string]: unknown; } | undefined; generateSummaries?: boolean | undefined; extractEntities?: boolean | undefined; summaryModel?: string | ModelConfig | undefined; summaryThreshold?: number | undefined; nerModel?: string | ModelConfig | undefined; }, "documentTree"> & { documentTree: DocumentRootNode; }; export type DocumentEnricherTaskOutput = { doc_id: string; documentTree: unknown; summaryCount: number; entityCount: number; }; export type DocumentEnricherTaskConfig = TaskConfig; /** * Task for enriching document nodes with summaries and entities * Uses bottom-up propagation to roll up child information to parents */ export declare class DocumentEnricherTask extends Task { static type: string; /** Orchestration task — delegates to sub-tasks; no direct provider capability. */ static readonly requires: readonly Capability[]; static category: string; static title: string; static description: string; static cacheable: boolean; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; execute(input: DocumentEnricherTaskInput, context: IExecuteContext): Promise; /** * Enrich a node recursively (bottom-up) */ private enrichNode; /** * Private method to summarize text using the TextSummaryTask */ private summarize; /** * Generate summary for a node with children */ private generateSummary; /** * Generate summary for a leaf node */ private generateLeafSummary; /** * Extract and roll up entities from node and children */ private extractEntities; } export declare const documentEnricher: (input: DocumentEnricherTaskInput, config?: DocumentEnricherTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { documentEnricher: CreateWorkflow; } } //# sourceMappingURL=DocumentEnricherTask.d.ts.map