**feat: introduce unified augmentation pipeline system**

### Changes:
- Added `Pipeline` class in `src/pipeline.ts` to unify primary and streamlined augmentation pipelines:
  - Supports multiple execution modes: sequential, parallel, threaded, first success, and first result.
  - Provides methods for registering, unregistering, and managing augmentations by type.
  - Implements flexible execution options, including error handling, timeouts, and threading control.
- Introduced comprehensive augmentation registry for managing sense, dialog, memory, cognition, and WebSocket-based augmentations.
- Added global pipeline instance with legacy method support for backward compatibility.
- Enhanced augmentation execution capabilities:
  - Support for static and streaming data processing.
  - Pipeline creation for reusable augmentation workflows.
  - Threaded execution for improved performance when supported.
- Added default pipeline integration with augmentation registry to resolve circular dependencies.

### Purpose:
Implemented a unified augmentation pipeline to streamline augmentation workflows, enhance flexibility, and simplify execution management. The changes improve performance, reduce complexity, and provide robust support for legacy methods.
This commit is contained in:
David Snelling 2025-06-20 12:03:39 -07:00
parent 3860140c91
commit e980d33a34
5 changed files with 1605 additions and 5 deletions

View file

@ -111,10 +111,10 @@ export namespace BrainyAugmentations {
* @param rawData The raw, unstructured data (e.g., text, image buffer, audio stream)
* @param dataType The type of raw data (e.g., 'text', 'image', 'audio')
*/
processRawData(rawData: Buffer | string, dataType: string): AugmentationResponse<{
processRawData(rawData: Buffer | string, dataType: string): Promise<AugmentationResponse<{
nouns: string[]
verbs: string[]
}>
}>>
/**
* Registers a listener for real-time data feeds.

View file

@ -0,0 +1,33 @@
/**
* Pipeline Types
*
* This module provides shared types for the pipeline system to avoid circular dependencies.
*/
import {
BrainyAugmentations,
IWebSocketSupport,
IAugmentation
} from './augmentations.js'
/**
* Type definitions for the augmentation registry
*/
export type AugmentationRegistry = {
sense: BrainyAugmentations.ISenseAugmentation[];
conduit: BrainyAugmentations.IConduitAugmentation[];
cognition: BrainyAugmentations.ICognitionAugmentation[];
memory: BrainyAugmentations.IMemoryAugmentation[];
perception: BrainyAugmentations.IPerceptionAugmentation[];
dialog: BrainyAugmentations.IDialogAugmentation[];
activation: BrainyAugmentations.IActivationAugmentation[];
webSocket: IWebSocketSupport[];
}
/**
* Interface for the Pipeline class
* This is used to break circular dependencies between pipeline.ts and augmentationRegistry.ts
*/
export interface IPipeline {
register<T extends IAugmentation>(augmentation: T): IPipeline;
}