refactor: remove deprecated Cortex class (replaced by brain.augmentations API)
This commit is contained in:
parent
7f9d2a70a5
commit
490a14af5f
6 changed files with 68 additions and 139 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IAugmentation, AugmentationType } from './types/augmentations.js'
|
import { IAugmentation, AugmentationType } from './types/augmentations.js'
|
||||||
import { augmentationPipeline } from './augmentationPipeline.js'
|
import { augmentationPipeline } from './pipeline.js'
|
||||||
|
|
||||||
export interface AugmentationInfo {
|
export interface AugmentationInfo {
|
||||||
name: string
|
name: string
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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'
|
|
||||||
19
src/index.ts
19
src/index.ts
|
|
@ -54,11 +54,20 @@ export {
|
||||||
getPresetDescription
|
getPresetDescription
|
||||||
} from './config/index.js'
|
} from './config/index.js'
|
||||||
|
|
||||||
// Export Cortex (the orchestrator)
|
// Export augmentation types
|
||||||
export {
|
export type {
|
||||||
Cortex,
|
BrainyAugmentations,
|
||||||
cortex
|
IAugmentation,
|
||||||
} from './cortex.js'
|
ISenseAugmentation,
|
||||||
|
IConduitAugmentation,
|
||||||
|
ICognitionAugmentation,
|
||||||
|
IMemoryAugmentation,
|
||||||
|
IPerceptionAugmentation,
|
||||||
|
IDialogAugmentation,
|
||||||
|
IActivationAugmentation,
|
||||||
|
IWebSocketSupport,
|
||||||
|
AugmentationType
|
||||||
|
} from './types/augmentations.js'
|
||||||
|
|
||||||
// Export Neural Import (AI data understanding)
|
// Export Neural Import (AI data understanding)
|
||||||
export { NeuralImport } from './cortex/neuralImport.js'
|
export { NeuralImport } from './cortex/neuralImport.js'
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
import { AugmentationType } from '../types/augmentations.js'
|
import { AugmentationType } from '../types/augmentations.js'
|
||||||
|
|
||||||
// Import the augmentation pipeline
|
// Import the augmentation pipeline
|
||||||
import { augmentationPipeline } from '../augmentationPipeline.js'
|
import { augmentationPipeline } from '../pipeline.js'
|
||||||
|
|
||||||
export class MCPAugmentationToolset {
|
export class MCPAugmentationToolset {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,59 @@
|
||||||
/**
|
/**
|
||||||
* Pipeline - Clean Re-export of Cortex
|
* Pipeline - Augmentation execution pipeline
|
||||||
*
|
*
|
||||||
* After the Great Cleanup: Pipeline IS Cortex. No delegation, no complexity.
|
* Provides Pipeline class, execution modes, and factory functions.
|
||||||
* ONE way to do everything.
|
* All augmentation management should use brain.augmentations API.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Export the ONE consolidated Cortex class as Pipeline for those who prefer the name
|
/**
|
||||||
export {
|
* Execution mode for pipeline operations
|
||||||
Cortex as Pipeline,
|
*/
|
||||||
cortex as pipeline,
|
export enum ExecutionMode {
|
||||||
ExecutionMode,
|
SEQUENTIAL = 'sequential',
|
||||||
PipelineOptions
|
PARALLEL = 'parallel',
|
||||||
} from './augmentationPipeline.js'
|
FIRST_SUCCESS = 'firstSuccess',
|
||||||
|
FIRST_RESULT = 'firstResult',
|
||||||
// Re-export for backward compatibility in imports
|
THREADED = 'threaded'
|
||||||
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()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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<T> = { success: boolean; data: T; error?: string }
|
export type PipelineResult<T> = { success: boolean; data: T; error?: string }
|
||||||
export type StreamlinedPipelineResult<T> = PipelineResult<T>
|
export type StreamlinedPipelineResult<T> = PipelineResult<T>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue