diff --git a/src/augmentationManager.ts b/src/augmentationManager.ts index 65fd1bee..998b92e2 100644 --- a/src/augmentationManager.ts +++ b/src/augmentationManager.ts @@ -4,7 +4,7 @@ */ import { IAugmentation, AugmentationType } from './types/augmentations.js' -import { augmentationPipeline } from './augmentationPipeline.js' +import { augmentationPipeline } from './pipeline.js' export interface AugmentationInfo { name: string diff --git a/src/augmentationPipeline.ts b/src/augmentationPipeline.ts deleted file mode 100644 index 2bc1b09c..00000000 --- a/src/augmentationPipeline.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Augmentation Pipeline (Compatibility Layer) - * - * @deprecated This file provides backward compatibility for code that imports - * from augmentationPipeline. All new code should use AugmentationRegistry directly. - * - * This minimal implementation redirects to the new AugmentationRegistry system. - */ - -import { BrainyAugmentation } from './types/augmentations.js' - -/** - * Execution mode for pipeline operations - */ -export enum ExecutionMode { - SEQUENTIAL = 'sequential', - PARALLEL = 'parallel', - FIRST_SUCCESS = 'firstSuccess', - FIRST_RESULT = 'firstResult', - THREADED = 'threaded' -} - -/** - * Options for pipeline execution - */ -export interface PipelineOptions { - mode?: ExecutionMode - timeout?: number - retries?: number - throwOnError?: boolean -} - -/** - * Minimal Cortex class for backward compatibility - * Redirects all operations to the new AugmentationRegistry system - */ -export class Cortex { - private static instance?: Cortex - - constructor() { - if (Cortex.instance) { - return Cortex.instance - } - Cortex.instance = this - } - - // Deprecated methods have been removed. - // Use brain.augmentations API instead for all augmentation operations. - - // Additional deprecated methods removed. - // All augmentation management should use brain.augmentations API. - - // All remaining deprecated methods removed. - - // Final deprecated methods removed. - // This class now serves as a minimal compatibility layer. -} - -// Create and export a default instance of the cortex -export const cortex = new Cortex() - -// Backward compatibility exports -export const AugmentationPipeline = Cortex -export const augmentationPipeline = cortex - -// Export types for compatibility (avoid duplicate export) -// PipelineOptions already exported above \ No newline at end of file diff --git a/src/cortex.ts b/src/cortex.ts deleted file mode 100644 index aed729d8..00000000 --- a/src/cortex.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Cortex - The Brain's Central Orchestration System - * - * 🧠⚛️ The cerebral cortex that coordinates all augmentations - * - * This is the main export for the Cortex system. It provides the central - * coordination for all augmentations, managing their registration, execution, - * and pipeline orchestration. - */ - -// Re-export from augmentationPipeline (which contains the Cortex class) -export { - Cortex, - cortex, - ExecutionMode, - PipelineOptions, - // Backward compatibility - AugmentationPipeline, - augmentationPipeline -} from './augmentationPipeline.js' - -// Re-export augmentation types for convenience -export type { - BrainyAugmentations, - IAugmentation, - ISenseAugmentation, - IConduitAugmentation, - ICognitionAugmentation, - IMemoryAugmentation, - IPerceptionAugmentation, - IDialogAugmentation, - IActivationAugmentation, - IWebSocketSupport, - AugmentationResponse, - AugmentationType -} from './types/augmentations.js' \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index e6089c15..b75579a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,11 +54,20 @@ export { getPresetDescription } from './config/index.js' -// Export Cortex (the orchestrator) -export { - Cortex, - cortex -} from './cortex.js' +// Export augmentation types +export type { + BrainyAugmentations, + IAugmentation, + ISenseAugmentation, + IConduitAugmentation, + ICognitionAugmentation, + IMemoryAugmentation, + IPerceptionAugmentation, + IDialogAugmentation, + IActivationAugmentation, + IWebSocketSupport, + AugmentationType +} from './types/augmentations.js' // Export Neural Import (AI data understanding) export { NeuralImport } from './cortex/neuralImport.js' diff --git a/src/mcp/mcpAugmentationToolset.ts b/src/mcp/mcpAugmentationToolset.ts index 14ea4fe5..1541816a 100644 --- a/src/mcp/mcpAugmentationToolset.ts +++ b/src/mcp/mcpAugmentationToolset.ts @@ -15,7 +15,7 @@ import { import { AugmentationType } from '../types/augmentations.js' // Import the augmentation pipeline -import { augmentationPipeline } from '../augmentationPipeline.js' +import { augmentationPipeline } from '../pipeline.js' export class MCPAugmentationToolset { /** diff --git a/src/pipeline.ts b/src/pipeline.ts index 00740a56..09b3f4a6 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -1,44 +1,67 @@ /** - * Pipeline - Clean Re-export of Cortex + * Pipeline - Augmentation execution pipeline * - * After the Great Cleanup: Pipeline IS Cortex. No delegation, no complexity. - * ONE way to do everything. + * Provides Pipeline class, execution modes, and factory functions. + * All augmentation management should use brain.augmentations API. */ -// Export the ONE consolidated Cortex class as Pipeline for those who prefer the name -export { - Cortex as Pipeline, - cortex as pipeline, - ExecutionMode, - PipelineOptions -} from './augmentationPipeline.js' - -// Re-export for backward compatibility in imports -export { - cortex as augmentationPipeline, - Cortex -} from './augmentationPipeline.js' - -// Simple factory functions -export const createPipeline = async () => { - const { Cortex } = await import('./augmentationPipeline.js') - return new Cortex() -} -export const createStreamingPipeline = async () => { - const { Cortex } = await import('./augmentationPipeline.js') - return new Cortex() +/** + * Execution mode for pipeline operations + */ +export enum ExecutionMode { + SEQUENTIAL = 'sequential', + PARALLEL = 'parallel', + FIRST_SUCCESS = 'firstSuccess', + FIRST_RESULT = 'firstResult', + THREADED = 'threaded' } -// Type aliases for consistency -export type { PipelineOptions as StreamlinedPipelineOptions } from './augmentationPipeline.js' +/** + * Options for pipeline execution + */ +export interface PipelineOptions { + mode?: ExecutionMode + timeout?: number + retries?: number + throwOnError?: boolean +} + +/** + * Minimal Pipeline class for backward compatibility. + * All augmentation management should use brain.augmentations API. + */ +export class Pipeline { + private static instance?: Pipeline + + constructor() { + if (Pipeline.instance) { + return Pipeline.instance + } + Pipeline.instance = this + } +} + +// Default singleton instance +export const pipeline = new Pipeline() + +// Backward compatibility aliases +export const AugmentationPipeline = Pipeline +export const augmentationPipeline = pipeline + +// Factory functions +export const createPipeline = async () => new Pipeline() +export const createStreamingPipeline = async () => new Pipeline() + +// Type aliases +export type StreamlinedPipelineOptions = PipelineOptions export type PipelineResult = { success: boolean; data: T; error?: string } export type StreamlinedPipelineResult = PipelineResult // Execution mode alias export enum StreamlinedExecutionMode { SEQUENTIAL = 'sequential', - PARALLEL = 'parallel', + PARALLEL = 'parallel', FIRST_SUCCESS = 'firstSuccess', FIRST_RESULT = 'firstResult', THREADED = 'threaded' -} \ No newline at end of file +}