brainy/src/types/brainyInterface.ts
David Snelling 791fac54cd refactor: remove deprecated BrainyData class completely
Removes all traces of BrainyData to prevent user confusion:
- Renamed brainyDataInterface.ts to brainyInterface.ts for clarity
- Updated all imports and type references across 5 files
- Removed BrainyData compiled artifacts (handled by clean build)
- Added deprecation notice to CHANGELOG with migration guide

BrainyData was never part of official Brainy 3.0 API but existed as
legacy compiled artifacts. Users mistakenly imported it thinking neural
API was missing, when it exists in modern Brainy class.

All users should migrate to: new Brainy() with await brain.init()
Neural API available via: brain.neural().visualize() etc.

Resolves confusion reported by Brain Studio team.
2025-09-30 16:04:00 -07:00

60 lines
No EOL
1.7 KiB
TypeScript

/**
* BrainyInterface - Modern API Only
*
* This interface defines the MODERN methods from Brainy 3.0.
* Used to break circular dependencies while enforcing modern API usage.
*
* NO DEPRECATED METHODS - Only clean, modern API patterns.
*/
import { Vector } from '../coreTypes.js'
import { AddParams, RelateParams, Result, Entity, FindParams, SimilarParams } from './brainy.types.js'
export interface BrainyInterface<T = unknown> {
/**
* Initialize the database
*/
init(): Promise<void>
/**
* Modern add method - unified entity creation
* @param params Parameters for adding entities
* @returns The ID of the created entity
*/
add(params: AddParams<T>): Promise<string>
/**
* Modern relate method - unified relationship creation
* @param params Parameters for creating relationships
* @returns The ID of the created relationship
*/
relate(params: RelateParams<T>): Promise<string>
/**
* Modern find method - unified search and discovery
* @param query Search query or parameters object
* @returns Array of search results
*/
find(query: string | FindParams<T>): Promise<Result<T>[]>
/**
* Modern get method - retrieve entities by ID
* @param id The entity ID to retrieve
* @returns Entity or null if not found
*/
get(id: string): Promise<Entity<T> | null>
/**
* Modern similar method - find similar entities
* @param params Parameters for similarity search
* @returns Array of similar entities with scores
*/
similar(params: SimilarParams<T>): Promise<Result<T>[]>
/**
* Generate embedding vector from text
* @param text The text to embed
* @returns Vector representation of the text
*/
embed(text: string): Promise<Vector>
}