/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import { CreateWorkflow, IExecuteContext, Task } from "@workglow/task-graph"; import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { DataPortSchema } from "@workglow/util/schema"; import type { Capability } from "../capability/Capabilities"; export declare const QueryExpansionMethod: { readonly MULTI_QUERY: "multi-query"; readonly SYNONYMS: "synonyms"; }; export type QueryExpansionMethod = (typeof QueryExpansionMethod)[keyof typeof QueryExpansionMethod]; export type QueryExpanderTaskInput = { method?: "multi-query" | "synonyms" | undefined; numVariations?: number | undefined; query: string; }; export type QueryExpanderTaskOutput = { count: number; query: string[]; method: string; originalQuery: string; }; export type QueryExpanderTaskConfig = TaskConfig; /** * Rule-based query expansion for improved retrieval recall. * Supports `multi-query` (question-word variations) and `synonyms` (keyword swaps). * Note: LLM-driven methods (HyDE, paraphrase) were removed until a real * implementation lands — use a TextGenerationTask upstream for those. */ export declare class QueryExpanderTask extends Task { static type: string; /** * Informational: capability this task uses. NOT enforced by the dispatcher — * QueryExpanderTask extends `Task` (not `AiTask`) and implements its own * `execute()`, so `gateOrThrow` is never called against this value. The audit * test in `task/index.test.ts` validates the value is a known {@link 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: QueryExpanderTaskInput, context: IExecuteContext): Promise; private multiQueryExpansion; private synonymExpansion; private preserveCapitalization; } export declare const queryExpander: (input: QueryExpanderTaskInput, config?: QueryExpanderTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { queryExpander: CreateWorkflow; } } //# sourceMappingURL=QueryExpanderTask.d.ts.map