fix: update all imports and references from BrainyData to Brainy
- Fixed imports in examples/tests/ to use correct Brainy import - Fixed imports in tests/benchmarks/ to use correct paths - Updated bin/brainy-interactive.js to use Brainy instead of BrainyData - Corrected documentation references throughout codebase - Removed duplicate imports in benchmark files - All files now consistently use 'Brainy' class from dist/index.js
This commit is contained in:
parent
791fac54cd
commit
196690863d
77 changed files with 328 additions and 331 deletions
|
|
@ -5,9 +5,9 @@
|
|||
## Quick Start
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
// Augmentations auto-configure based on environment
|
||||
storage: 'auto', // Storage augmentation
|
||||
cache: true, // Cache augmentation
|
||||
|
|
@ -40,7 +40,7 @@ Augmentations are modular extensions that add functionality to Brainy without cl
|
|||
**Auto-enabled**: When `storage: 'memory'` or in test environments
|
||||
**Purpose**: In-memory storage for testing and temporary data
|
||||
```typescript
|
||||
const brain = new BrainyData({ storage: 'memory' })
|
||||
const brain = new Brainy({ storage: 'memory' })
|
||||
```
|
||||
|
||||
### FileSystemStorageAugmentation
|
||||
|
|
@ -48,7 +48,7 @@ const brain = new BrainyData({ storage: 'memory' })
|
|||
**Auto-enabled**: When `storage: 'filesystem'` or Node.js detected
|
||||
**Purpose**: Persistent file-based storage for Node.js applications
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: { type: 'filesystem', path: './data' }
|
||||
})
|
||||
```
|
||||
|
|
@ -58,7 +58,7 @@ const brain = new BrainyData({
|
|||
**Auto-enabled**: When `storage: 'opfs'` or browser with OPFS support
|
||||
**Purpose**: Browser-based persistent storage using Origin Private File System
|
||||
```typescript
|
||||
const brain = new BrainyData({ storage: 'opfs' })
|
||||
const brain = new Brainy({ storage: 'opfs' })
|
||||
```
|
||||
|
||||
### S3StorageAugmentation
|
||||
|
|
@ -66,7 +66,7 @@ const brain = new BrainyData({ storage: 'opfs' })
|
|||
**Manual**: Requires AWS credentials
|
||||
**Purpose**: AWS S3-compatible cloud storage
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 's3',
|
||||
bucket: 'my-bucket',
|
||||
|
|
@ -81,7 +81,7 @@ const brain = new BrainyData({
|
|||
**Manual**: Requires Cloudflare credentials
|
||||
**Purpose**: Cloudflare R2 storage (S3-compatible)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'r2',
|
||||
accountId: 'xxx',
|
||||
|
|
@ -96,7 +96,7 @@ const brain = new BrainyData({
|
|||
**Manual**: Requires Google Cloud credentials
|
||||
**Purpose**: Google Cloud Storage
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'gcs',
|
||||
bucket: 'my-bucket',
|
||||
|
|
@ -174,7 +174,7 @@ brain.addNouns([...]) // Automatically batched
|
|||
**Auto-enabled**: When `wal: true`
|
||||
**Purpose**: Write-ahead logging for crash recovery
|
||||
```typescript
|
||||
const brain = new BrainyData({ wal: true })
|
||||
const brain = new Brainy({ wal: true })
|
||||
// Automatic recovery on restart after crash
|
||||
```
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ class NotionSynapse extends SynapseAugmentation {
|
|||
|
||||
### Auto-Configuration
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
// These auto-register augmentations:
|
||||
storage: 'auto', // Storage augmentation
|
||||
cache: true, // Cache augmentation
|
||||
|
|
@ -286,7 +286,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Manual Registration
|
||||
```typescript
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// Register before init()
|
||||
const customAug = new MyCustomAugmentation()
|
||||
|
|
@ -347,7 +347,7 @@ class MyAugmentation extends BaseAugmentation {
|
|||
|
||||
### Where Augmentations Hook In
|
||||
|
||||
**BrainyData Constructor**:
|
||||
**Brainy Constructor**:
|
||||
- Storage augmentations register based on config
|
||||
- Cache/Index augmentations auto-register if enabled
|
||||
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ The Brainy Augmentation Configuration System provides a VSCode-style extension a
|
|||
### Using an Augmentation with Configuration
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
// Zero-config (uses defaults)
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// With custom configuration
|
||||
immediateWrites: true,
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ export class MyFirstAugmentation extends BaseAugmentation {
|
|||
## Using Your Augmentation
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { MyFirstAugmentation } from './my-first-augmentation'
|
||||
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// Register before init()
|
||||
brain.augmentations.register(new MyFirstAugmentation())
|
||||
|
|
@ -301,12 +301,12 @@ class EncryptionAugmentation extends BaseAugmentation {
|
|||
|
||||
```typescript
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
import { MyAugmentation } from './my-augmentation'
|
||||
|
||||
describe('MyAugmentation', () => {
|
||||
it('should hook into addNoun', async () => {
|
||||
const brain = new BrainyData({ storage: 'memory' })
|
||||
const brain = new Brainy({ storage: 'memory' })
|
||||
const aug = new MyAugmentation()
|
||||
|
||||
// Spy on the execute method
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ Visual representations of data.
|
|||
### Zero-Config Approach
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// Just register augmentations - they work automatically!
|
||||
brain.augmentations.register(new EntityRegistryAugmentation())
|
||||
|
|
@ -128,7 +128,7 @@ await brain.init()
|
|||
### With Configuration
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
brain.augmentations.register(
|
||||
new APIServerAugmentation({
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ npm install express cors ws
|
|||
## Zero-Config Usage
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from 'brainy'
|
||||
import { Brainy } from 'brainy'
|
||||
import { APIServerAugmentation } from 'brainy/augmentations'
|
||||
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// Register the API server augmentation
|
||||
brain.augmentations.register(new APIServerAugmentation())
|
||||
|
|
@ -281,7 +281,7 @@ The APIServerAugmentation hooks into Brainy's augmentation pipeline:
|
|||
|
||||
```typescript
|
||||
// Server
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
brain.augmentations.register(new APIServerAugmentation())
|
||||
await brain.init()
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ class FilteredAPIServer extends APIServerAugmentation {
|
|||
### Integration with Other Augmentations
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// Stack augmentations for complete system
|
||||
brain.augmentations.register(new EntityRegistryAugmentation()) // Dedup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue