/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { CachePolicy, 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"; export type DocumentUpsertTaskInput = { title?: string | undefined; metadata?: { [x: string]: unknown; title?: string | undefined; sourceUri?: string | undefined; createdAt?: string | undefined; } | undefined; doc_id: string; documentTree: unknown; knowledgeBase: unknown; }; export type DocumentUpsertTaskOutput = { doc_id: string; }; export type DocumentUpsertTaskConfig = TaskConfig; /** * Persists a parsed document tree to a knowledge base. Sits between * `StructuralParserTask` and `HierarchicalChunkerTask` in a typical RAG * ingest pipeline so that the document row exists in tabular storage * before any chunk-vector row references its `doc_id`. * * Pure side-effect task: input `doc_id` is preserved on the output so * downstream tasks can chain on the upsert completing successfully. */ export declare class DocumentUpsertTask extends Task { static type: string; /** Storage task — no provider capability required. */ static readonly requires: readonly Capability[]; static category: string; static title: string; static description: string; static cachePolicy: CachePolicy; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; execute(input: DocumentUpsertTaskInput, context: IExecuteContext): Promise; } export declare const documentUpsert: (input: DocumentUpsertTaskInput, config?: DocumentUpsertTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { documentUpsert: CreateWorkflow; } } //# sourceMappingURL=DocumentUpsertTask.d.ts.map