/** * @license * Copyright 2026 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { ChunkSearchResult } from "@workglow/knowledge-base"; import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow, IExecuteContext, Task } from "@workglow/task-graph"; import type { DataPortSchema } from "@workglow/util/schema"; import type { Capability } from "../capability/Capabilities"; export type KbSearchTaskInput = { filter?: { [x: string]: unknown; } | undefined; topK?: number | undefined; scoreThreshold?: number | undefined; query: string; knowledgeBase: unknown; }; export type KbSearchTaskOutput = { readonly results: ChunkSearchResult[]; readonly chunks: string[]; readonly chunk_ids: string[]; readonly scores: number[]; readonly count: number; }; export type KbSearchTaskConfig = TaskConfig; /** * High-level KB search task. Delegates to `kb.search(query, options)`; the * KB and its installed strategy decide everything else (embedding model, * retrieval mode, rerank). No model or kind input here — that's the * point of moving the config onto the KB itself. */ export declare class KbSearchTask extends Task { static type: string; /** * Pure-compute task (vector similarity query against an in-process * KnowledgeBase) — no AI provider dispatch. `requires: []` opts out of * capability gating; the audit test in `index.test.ts` only inspects the * field shape. */ 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: KbSearchTaskInput, context: IExecuteContext): Promise; } export declare const kbSearch: (input: KbSearchTaskInput, config?: KbSearchTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { kbSearch: CreateWorkflow; } } //# sourceMappingURL=KbSearchTask.d.ts.map