refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files, ~15,000 lines) and the semantic type matching system. These were unused middleware layers adding complexity without value. What was removed: - src/augmentations/ directory (all augmentation implementations) - src/augmentationManager.ts (pipeline orchestrator) - src/types/augmentations.ts, src/types/pipelineTypes.ts - src/shared/default-augmentations.ts - Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb) - src/utils/typeMatching/ (embedding-based type matcher) What was preserved by relocating: - Import handlers (CSV, PDF, Excel) -> src/importers/handlers/ - NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts - Type matching utilities -> heuristic inference in consumers What was simplified: - brainy.ts: operations call storage directly (no execute() wrapper) - IntegrationBase: standalone class (no BaseAugmentation parent) - BrainyTypes: validation-only (nouns, verbs, isValid*, get*) - Pipeline: direct execution (no augmentation interception) - index.ts: removed TypeSuggestion, suggestType exports - package.json: removed stale types/augmentations export Build passes, 1176 tests pass, 0 failures.
This commit is contained in:
parent
ac7a1f772c
commit
d1db3510be
97 changed files with 349 additions and 19705 deletions
|
|
@ -5,11 +5,6 @@
|
|||
* for event subscriptions, tabular export, and lifecycle management.
|
||||
*/
|
||||
|
||||
import {
|
||||
BaseAugmentation,
|
||||
AugmentationContext
|
||||
} from '../../augmentations/brainyAugmentation.js'
|
||||
import { AugmentationManifest } from '../../augmentations/manifest.js'
|
||||
import { EventBus } from './EventBus.js'
|
||||
import { TabularExporter } from './TabularExporter.js'
|
||||
import {
|
||||
|
|
@ -48,17 +43,12 @@ import { Entity, Relation, FindParams } from '../../types/brainy.types.js'
|
|||
* }
|
||||
* ```
|
||||
*/
|
||||
export abstract class IntegrationBase extends BaseAugmentation {
|
||||
// Augmentation interface implementation
|
||||
readonly timing = 'after' as const
|
||||
readonly metadata = 'readonly' as const
|
||||
readonly operations: ('all')[] = ['all']
|
||||
readonly priority = 5 // Low priority - runs after main operations
|
||||
category: 'internal' | 'core' | 'premium' | 'community' | 'external' = 'core'
|
||||
|
||||
export abstract class IntegrationBase {
|
||||
// Shared infrastructure
|
||||
protected eventBus: EventBus
|
||||
protected exporter: TabularExporter
|
||||
protected config: IntegrationConfig
|
||||
protected context?: { brain: any; storage: any; config: any; log: (message: string, level?: string) => void }
|
||||
|
||||
// Integration state
|
||||
protected isRunning = false
|
||||
|
|
@ -80,11 +70,35 @@ export abstract class IntegrationBase extends BaseAugmentation {
|
|||
config?: IntegrationConfig,
|
||||
exporterConfig?: TabularExporterConfig
|
||||
) {
|
||||
super(config)
|
||||
this.config = config || {}
|
||||
this.eventBus = new EventBus()
|
||||
this.exporter = new TabularExporter(exporterConfig)
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a message
|
||||
*/
|
||||
protected log(message: string, level: string = 'info'): void {
|
||||
if (this.context?.log) {
|
||||
this.context.log(message, level)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the integration with context
|
||||
*/
|
||||
async initialize(ctx: { brain: any; storage: any; config: any; log: (message: string, level?: string) => void }): Promise<void> {
|
||||
this.context = ctx
|
||||
await this.onInitialize()
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown the integration
|
||||
*/
|
||||
async shutdown(): Promise<void> {
|
||||
await this.onShutdown()
|
||||
}
|
||||
|
||||
/**
|
||||
* Integration name (must be unique)
|
||||
*/
|
||||
|
|
@ -311,7 +325,7 @@ export abstract class IntegrationBase extends BaseAugmentation {
|
|||
* Get manifest for this integration
|
||||
* Subclasses should override this
|
||||
*/
|
||||
getManifest(): AugmentationManifest {
|
||||
getManifest(): Record<string, any> {
|
||||
return {
|
||||
id: this.name,
|
||||
name: this.name,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {
|
|||
HTTPIntegration
|
||||
} from '../core/IntegrationBase.js'
|
||||
import { IntegrationConfig, ODataQueryOptions } from '../core/types.js'
|
||||
import { AugmentationManifest } from '../../augmentations/manifest.js'
|
||||
import { Entity, Relation, FindParams } from '../../types/brainy.types.js'
|
||||
import { NounType } from '../../types/graphTypes.js'
|
||||
import {
|
||||
|
|
@ -94,11 +93,11 @@ interface ODataResponse {
|
|||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Register with Brainy
|
||||
* brain.augmentations.register(new ODataIntegration({
|
||||
* const odata = new ODataIntegration({
|
||||
* basePath: '/odata',
|
||||
* maxPageSize: 1000
|
||||
* }))
|
||||
* })
|
||||
* await odata.initialize()
|
||||
*
|
||||
* // Connect from Excel Power Query:
|
||||
* // Data → Get Data → From OData Feed → http://localhost:3000/odata
|
||||
|
|
@ -249,7 +248,7 @@ export class ODataIntegration extends IntegrationBase implements HTTPIntegration
|
|||
/**
|
||||
* Get augmentation manifest
|
||||
*/
|
||||
getManifest(): AugmentationManifest {
|
||||
getManifest(): Record<string, any> {
|
||||
return {
|
||||
id: 'odata',
|
||||
name: 'OData Integration',
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
import { IntegrationBase, HTTPIntegration } from '../core/IntegrationBase.js'
|
||||
import { IntegrationConfig } from '../core/types.js'
|
||||
import { AugmentationManifest } from '../../augmentations/manifest.js'
|
||||
import { Entity, FindParams } from '../../types/brainy.types.js'
|
||||
import { NounType, VerbType } from '../../types/graphTypes.js'
|
||||
|
||||
|
|
@ -92,10 +91,11 @@ interface SheetsResponse {
|
|||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* brain.augmentations.register(new GoogleSheetsIntegration({
|
||||
* const sheets = new GoogleSheetsIntegration({
|
||||
* basePath: '/sheets',
|
||||
* maxResults: 1000
|
||||
* }))
|
||||
* })
|
||||
* await sheets.initialize()
|
||||
* ```
|
||||
*/
|
||||
export class GoogleSheetsIntegration
|
||||
|
|
@ -283,7 +283,7 @@ export class GoogleSheetsIntegration
|
|||
/**
|
||||
* Get manifest
|
||||
*/
|
||||
getManifest(): AugmentationManifest {
|
||||
getManifest(): Record<string, any> {
|
||||
return {
|
||||
id: 'sheets',
|
||||
name: 'Google Sheets Integration',
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {
|
|||
EventFilter,
|
||||
BrainyEvent
|
||||
} from '../core/types.js'
|
||||
import { AugmentationManifest } from '../../augmentations/manifest.js'
|
||||
|
||||
/**
|
||||
* SSE integration configuration
|
||||
|
|
@ -63,10 +62,11 @@ interface SSEClient {
|
|||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* brain.augmentations.register(new SSEIntegration({
|
||||
* const sse = new SSEIntegration({
|
||||
* basePath: '/events',
|
||||
* heartbeatInterval: 30000
|
||||
* }))
|
||||
* })
|
||||
* await sse.initialize()
|
||||
*
|
||||
* // Client-side:
|
||||
* const source = new EventSource('/events?types=noun&operations=create,update')
|
||||
|
|
@ -292,7 +292,7 @@ export class SSEIntegration
|
|||
/**
|
||||
* Get manifest
|
||||
*/
|
||||
getManifest(): AugmentationManifest {
|
||||
getManifest(): Record<string, any> {
|
||||
return {
|
||||
id: 'sse',
|
||||
name: 'SSE Streaming',
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import {
|
|||
WebhookDeliveryResult,
|
||||
BrainyEvent
|
||||
} from '../core/types.js'
|
||||
import { AugmentationManifest } from '../../augmentations/manifest.js'
|
||||
|
||||
/**
|
||||
* Webhook integration configuration
|
||||
|
|
@ -69,7 +68,7 @@ interface PendingDelivery {
|
|||
* @example
|
||||
* ```typescript
|
||||
* const webhooks = new WebhookIntegration()
|
||||
* brain.augmentations.register(webhooks)
|
||||
* await webhooks.initialize()
|
||||
*
|
||||
* // Register a webhook
|
||||
* await webhooks.register({
|
||||
|
|
@ -263,7 +262,7 @@ export class WebhookIntegration extends IntegrationBase {
|
|||
/**
|
||||
* Get manifest
|
||||
*/
|
||||
getManifest(): AugmentationManifest {
|
||||
getManifest(): Record<string, any> {
|
||||
return {
|
||||
id: 'webhooks',
|
||||
name: 'Webhooks',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue