/** * @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 SegmentationMethod: { readonly HEURISTIC: "heuristic"; readonly EMBEDDING_SIMILARITY: "embedding-similarity"; readonly HYBRID: "hybrid"; }; export type SegmentationMethod = (typeof SegmentationMethod)[keyof typeof SegmentationMethod]; export type TopicSegmenterTaskInput = { method?: "hybrid" | "heuristic" | "embedding-similarity" | undefined; minSegmentSize?: number | undefined; maxSegmentSize?: number | undefined; similarityThreshold?: number | undefined; text: string; }; export type TopicSegmenterTaskOutput = { count: number; segments: { text: string; startOffset: number; endOffset: number; }[]; }; export type TopicSegmenterTaskConfig = TaskConfig; /** * Task for segmenting text into topic-based sections * Uses hybrid approach: heuristics + optional embedding similarity */ export declare class TopicSegmenterTask extends Task { static type: string; /** Pure-compute segmentation task — no provider capability required. */ static readonly requires: readonly Capability[]; static category: string; static title: string; static description: string; static cacheable: boolean; private static readonly EMBEDDING_DIMENSIONS; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; execute(input: TopicSegmenterTaskInput, context: IExecuteContext): Promise; private embeddingSegmentation; private heuristicSegmentation; /** * Hashed token embedding for fast similarity checks. */ private embedParagraph; private cosineSimilarityWithNorms; private splitIntoParagraphs; private hasTransitionMarker; private createSegment; private mergeSmallSegments; } export declare const topicSegmenter: (input: TopicSegmenterTaskInput, config?: TopicSegmenterTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { topicSegmenter: CreateWorkflow; } } //# sourceMappingURL=TopicSegmenterTask.d.ts.map