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
|
|
@ -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<T> = { success: boolean; data: T; error?: string }
|
||||
export type StreamlinedPipelineResult<T> = PipelineResult<T>
|
||||
|
||||
// Execution mode alias
|
||||
export enum StreamlinedExecutionMode {
|
||||
SEQUENTIAL = 'sequential',
|
||||
PARALLEL = 'parallel',
|
||||
PARALLEL = 'parallel',
|
||||
FIRST_SUCCESS = 'firstSuccess',
|
||||
FIRST_RESULT = 'firstResult',
|
||||
THREADED = 'threaded'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue