refactor: prepare augmentation system for 2.0 clean architecture
- Removed factory function exports from index.ts - Removed unused augmentationFactory imports - Added deprecated type definitions temporarily to maintain compilation - Created REFACTOR-2.0-AUGMENTATIONS.md documenting cleanup plan - All old types marked as @deprecated for removal before final 2.0 This is an intermediate state - full refactor documented in REFACTOR-2.0-AUGMENTATIONS.md
This commit is contained in:
parent
a0dca5651f
commit
31720de34e
4 changed files with 93 additions and 114 deletions
|
|
@ -46,31 +46,6 @@ abstract class BaseConduitAugmentation extends BaseAugmentation {
|
|||
): Promise<WebSocketConnection | null>
|
||||
}
|
||||
|
||||
/**
|
||||
* WebRTC Conduit Augmentation (placeholder for backwards compatibility)
|
||||
* @deprecated Use WebSocketConduitAugmentation instead
|
||||
*/
|
||||
export class WebRTCConduitAugmentation extends BaseConduitAugmentation {
|
||||
readonly name = 'webrtc-conduit'
|
||||
|
||||
async execute<T = any>(
|
||||
operation: string,
|
||||
params: any,
|
||||
context?: AugmentationContext
|
||||
): Promise<T | void> {
|
||||
// Placeholder - WebRTC not yet implemented
|
||||
this.log('WebRTC conduit not yet implemented, use WebSocket instead', 'warn')
|
||||
}
|
||||
|
||||
async establishConnection(
|
||||
targetSystemId: string,
|
||||
config?: Record<string, unknown>
|
||||
): Promise<WebSocketConnection | null> {
|
||||
this.log('WebRTC conduit not yet implemented, use WebSocket instead', 'warn')
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WebSocket Conduit Augmentation
|
||||
* Syncs data between Brainy instances using WebSockets
|
||||
|
|
|
|||
74
src/index.ts
74
src/index.ts
|
|
@ -180,35 +180,7 @@ import {
|
|||
|
||||
// Sequential pipeline removed - use unified pipeline instead
|
||||
|
||||
// Export augmentation factory
|
||||
import {
|
||||
createSenseAugmentation,
|
||||
addWebSocketSupport,
|
||||
executeAugmentation,
|
||||
loadAugmentationModule,
|
||||
AugmentationOptions
|
||||
} from './augmentationFactory.js'
|
||||
|
||||
// Export factory functions for creating augmentations
|
||||
import {
|
||||
createSenseAugmentation,
|
||||
createConduitAugmentation,
|
||||
createCognitionAugmentation,
|
||||
createMemoryAugmentation,
|
||||
createPerceptionAugmentation,
|
||||
createDialogAugmentation,
|
||||
createActivationAugmentation
|
||||
} from './augmentationFactory.js'
|
||||
|
||||
export {
|
||||
createSenseAugmentation,
|
||||
createConduitAugmentation,
|
||||
createCognitionAugmentation,
|
||||
createMemoryAugmentation,
|
||||
createPerceptionAugmentation,
|
||||
createDialogAugmentation,
|
||||
createActivationAugmentation
|
||||
}
|
||||
// REMOVED: Old augmentation factory for 2.0 clean architecture
|
||||
|
||||
export {
|
||||
// Unified pipeline exports
|
||||
|
|
@ -288,8 +260,7 @@ import {
|
|||
createAutoStorageAugmentation
|
||||
} from './augmentations/storageAugmentations.js'
|
||||
import {
|
||||
WebSocketConduitAugmentation,
|
||||
WebRTCConduitAugmentation
|
||||
WebSocketConduitAugmentation
|
||||
} from './augmentations/conduitAugmentations.js'
|
||||
import {
|
||||
ServerSearchConduitAugmentation,
|
||||
|
|
@ -365,46 +336,23 @@ export type {
|
|||
|
||||
// Export augmentation types
|
||||
import type {
|
||||
IAugmentation,
|
||||
AugmentationResponse,
|
||||
IWebSocketSupport,
|
||||
ISenseAugmentation,
|
||||
IConduitAugmentation,
|
||||
ICognitionAugmentation,
|
||||
IMemoryAugmentation,
|
||||
IPerceptionAugmentation,
|
||||
IDialogAugmentation,
|
||||
IActivationAugmentation
|
||||
BrainyAugmentation,
|
||||
BaseAugmentation,
|
||||
AugmentationContext
|
||||
} from './types/augmentations.js'
|
||||
import { AugmentationType, BrainyAugmentations } from './types/augmentations.js'
|
||||
|
||||
// Export augmentation manager for type-safe augmentation management
|
||||
export { AugmentationManager, type AugmentationInfo } from './augmentationManager.js'
|
||||
|
||||
export type { IAugmentation, AugmentationResponse, IWebSocketSupport }
|
||||
export {
|
||||
AugmentationType,
|
||||
BrainyAugmentations,
|
||||
ISenseAugmentation,
|
||||
IConduitAugmentation,
|
||||
ICognitionAugmentation,
|
||||
IMemoryAugmentation,
|
||||
IPerceptionAugmentation,
|
||||
IDialogAugmentation,
|
||||
IActivationAugmentation
|
||||
// Export only the clean augmentation types for 2.0
|
||||
export type {
|
||||
AugmentationResponse,
|
||||
BrainyAugmentation,
|
||||
BaseAugmentation,
|
||||
AugmentationContext
|
||||
}
|
||||
|
||||
// Export combined WebSocket augmentation interfaces
|
||||
export type {
|
||||
IWebSocketCognitionAugmentation,
|
||||
IWebSocketSenseAugmentation,
|
||||
IWebSocketPerceptionAugmentation,
|
||||
IWebSocketActivationAugmentation,
|
||||
IWebSocketDialogAugmentation,
|
||||
IWebSocketConduitAugmentation,
|
||||
IWebSocketMemoryAugmentation
|
||||
} from './types/augmentations.js'
|
||||
|
||||
// Export graph types
|
||||
import type {
|
||||
GraphNoun,
|
||||
|
|
|
|||
|
|
@ -46,17 +46,16 @@ export type BaseAugmentation = BaseA
|
|||
export type AugmentationContext = AC
|
||||
|
||||
/**
|
||||
* Legacy compatibility - these are deprecated and should not be used in new code
|
||||
* @deprecated Use BrainyAugmentation instead
|
||||
* @deprecated - Being removed in 2.0 final. Use BrainyAugmentation directly
|
||||
*/
|
||||
export type IAugmentation = BrainyAugmentation
|
||||
|
||||
/**
|
||||
* @deprecated AugmentationType enum is no longer used - augmentations are identified by name
|
||||
* @deprecated - Being removed in 2.0 final
|
||||
*/
|
||||
export enum AugmentationType {
|
||||
SENSE = 'sense',
|
||||
CONDUIT = 'conduit',
|
||||
CONDUIT = 'conduit',
|
||||
COGNITION = 'cognition',
|
||||
MEMORY = 'memory',
|
||||
PERCEPTION = 'perception',
|
||||
|
|
@ -67,20 +66,20 @@ export enum AugmentationType {
|
|||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use specific augmentation classes instead
|
||||
* @deprecated - Being removed in 2.0 final. These are just aliases now
|
||||
*/
|
||||
export namespace BrainyAugmentations {
|
||||
export interface ISenseAugmentation extends BrainyAugmentation {}
|
||||
export interface IConduitAugmentation extends BrainyAugmentation {}
|
||||
export interface ICognitionAugmentation extends BrainyAugmentation {}
|
||||
export interface IMemoryAugmentation extends BrainyAugmentation {}
|
||||
export interface IPerceptionAugmentation extends BrainyAugmentation {}
|
||||
export interface IDialogAugmentation extends BrainyAugmentation {}
|
||||
export interface IActivationAugmentation extends BrainyAugmentation {}
|
||||
export interface ISynapseAugmentation extends BrainyAugmentation {}
|
||||
export type ISenseAugmentation = BrainyAugmentation
|
||||
export type IConduitAugmentation = BrainyAugmentation
|
||||
export type ICognitionAugmentation = BrainyAugmentation
|
||||
export type IMemoryAugmentation = BrainyAugmentation
|
||||
export type IPerceptionAugmentation = BrainyAugmentation
|
||||
export type IDialogAugmentation = BrainyAugmentation
|
||||
export type IActivationAugmentation = BrainyAugmentation
|
||||
export type ISynapseAugmentation = BrainyAugmentation
|
||||
}
|
||||
|
||||
// Export deprecated interfaces directly for compatibility
|
||||
// Export as individual types for compatibility
|
||||
export type ISenseAugmentation = BrainyAugmentations.ISenseAugmentation
|
||||
export type IConduitAugmentation = BrainyAugmentations.IConduitAugmentation
|
||||
export type ICognitionAugmentation = BrainyAugmentations.ICognitionAugmentation
|
||||
|
|
@ -88,21 +87,11 @@ export type IMemoryAugmentation = BrainyAugmentations.IMemoryAugmentation
|
|||
export type IPerceptionAugmentation = BrainyAugmentations.IPerceptionAugmentation
|
||||
export type IDialogAugmentation = BrainyAugmentations.IDialogAugmentation
|
||||
export type IActivationAugmentation = BrainyAugmentations.IActivationAugmentation
|
||||
export type ISynapseAugmentation = BrainyAugmentations.ISynapseAugmentation
|
||||
|
||||
// WebSocket types for compatibility
|
||||
export type IWebSocketCognitionAugmentation = ICognitionAugmentation & IWebSocketSupport
|
||||
export type IWebSocketSenseAugmentation = ISenseAugmentation & IWebSocketSupport
|
||||
export type IWebSocketPerceptionAugmentation = IPerceptionAugmentation & IWebSocketSupport
|
||||
export type IWebSocketActivationAugmentation = IActivationAugmentation & IWebSocketSupport
|
||||
export type IWebSocketDialogAugmentation = IDialogAugmentation & IWebSocketSupport
|
||||
export type IWebSocketConduitAugmentation = IConduitAugmentation & IWebSocketSupport
|
||||
export type IWebSocketMemoryAugmentation = IMemoryAugmentation & IWebSocketSupport
|
||||
|
||||
/**
|
||||
* @deprecated Use BrainyAugmentation instead
|
||||
* @deprecated - Being removed in 2.0 final
|
||||
*/
|
||||
export interface IWebSocketSupport extends BrainyAugmentation {
|
||||
export interface IWebSocketSupport {
|
||||
connectWebSocket?(url: string, protocols?: string | string[]): Promise<WebSocketConnection>
|
||||
sendWebSocketMessage?(connectionId: string, data: unknown): Promise<void>
|
||||
onWebSocketMessage?(connectionId: string, callback: DataCallback<unknown>): Promise<void>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue