@soulcraft/brainy 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -2
- package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
- package/dist/brainy.js +87814 -0
- package/dist/brainy.min.js +12511 -0
- package/dist/index.d.ts +1 -3
- package/dist/storage/adapters/fileSystemStorage.d.ts +104 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -0
- package/dist/storage/adapters/memoryStorage.d.ts +101 -0
- package/dist/storage/adapters/memoryStorage.d.ts.map +1 -0
- package/dist/storage/adapters/opfsStorage.d.ts +114 -0
- package/dist/storage/adapters/opfsStorage.d.ts.map +1 -0
- package/dist/storage/adapters/s3CompatibleStorage.d.ts +136 -0
- package/dist/storage/adapters/s3CompatibleStorage.d.ts.map +1 -0
- package/dist/storage/baseStorage.d.ts +164 -0
- package/dist/storage/baseStorage.d.ts.map +1 -0
- package/dist/storage/fileSystemStorage.d.ts +0 -7
- package/dist/storage/fileSystemStorage.d.ts.map +1 -1
- package/dist/storage/opfsStorage.d.ts +3 -10
- package/dist/storage/opfsStorage.d.ts.map +1 -1
- package/dist/storage/s3CompatibleStorage.d.ts +1 -1
- package/dist/storage/s3CompatibleStorage.d.ts.map +1 -1
- package/dist/storage/storageFactory.d.ts +151 -0
- package/dist/storage/storageFactory.d.ts.map +1 -0
- package/dist/types/fileSystemTypes.d.ts +1 -0
- package/dist/types/fileSystemTypes.d.ts.map +1 -1
- package/dist/unified.js +5066 -5641
- package/dist/unified.min.js +747 -747
- package/dist/utils/logger.d.ts +99 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/version.d.ts +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](CONTRIBUTING.md)
|
|
9
|
-
[](https://www.npmjs.com/package/@soulcraft/brainy)
|
|
10
9
|
|
|
11
10
|
[//]: # ([](https://github.com/sodal-project/cartographer))
|
|
12
11
|
|
|
@@ -36,7 +35,7 @@ it gets - learning from your data to provide increasingly relevant results and c
|
|
|
36
35
|
- **Adaptive Intelligence** - Automatically optimizes for your environment and usage patterns
|
|
37
36
|
- **Persistent Storage** - Data persists across sessions and scales to any size
|
|
38
37
|
- **TypeScript Support** - Fully typed API with generics
|
|
39
|
-
- **CLI Tools** -
|
|
38
|
+
- **CLI Tools & Web Service** - Command-line interface and REST API web service for data management
|
|
40
39
|
- **Model Control Protocol (MCP)** - Allow external AI models to access Brainy data and use augmentation pipeline as
|
|
41
40
|
tools
|
|
42
41
|
|
|
@@ -64,6 +63,22 @@ npm install @soulcraft/brainy
|
|
|
64
63
|
|
|
65
64
|
TensorFlow.js packages are included as bundled dependencies and will be automatically installed without any additional configuration.
|
|
66
65
|
|
|
66
|
+
### Additional Packages
|
|
67
|
+
|
|
68
|
+
Brainy offers specialized packages for different use cases:
|
|
69
|
+
|
|
70
|
+
#### CLI Package
|
|
71
|
+
```bash
|
|
72
|
+
npm install -g @soulcraft/brainy-cli
|
|
73
|
+
```
|
|
74
|
+
Command-line interface for data management, bulk operations, and database administration.
|
|
75
|
+
|
|
76
|
+
#### Web Service Package
|
|
77
|
+
```bash
|
|
78
|
+
npm install @soulcraft/brainy-web-service
|
|
79
|
+
```
|
|
80
|
+
REST API web service wrapper that provides HTTP endpoints for search operations and database queries.
|
|
81
|
+
|
|
67
82
|
## 🏁 Quick Start
|
|
68
83
|
|
|
69
84
|
Brainy uses a unified build that automatically adapts to your environment (Node.js, browser, or serverless):
|
|
@@ -146,6 +161,7 @@ Brainy combines four key technologies to create its adaptive intelligence:
|
|
|
146
161
|
- Serverless: In-memory storage with optional cloud persistence
|
|
147
162
|
- Fallback: In-memory storage
|
|
148
163
|
- Automatically migrates between storage types as needed
|
|
164
|
+
- Uses a simplified, consolidated storage structure for all noun types
|
|
149
165
|
|
|
150
166
|
## 🚀 The Brainy Pipeline
|
|
151
167
|
|
|
@@ -906,6 +922,71 @@ The simplified augmentation system provides:
|
|
|
906
922
|
4. **Dynamic Loading** - Load augmentations at runtime when needed
|
|
907
923
|
5. **Static & Streaming Data** - Handle both static and streaming data with the same API
|
|
908
924
|
|
|
925
|
+
#### WebSocket Augmentation Types
|
|
926
|
+
|
|
927
|
+
Brainy exports several WebSocket augmentation types that can be used by augmentation creators to add WebSocket capabilities to their augmentations:
|
|
928
|
+
|
|
929
|
+
```typescript
|
|
930
|
+
import {
|
|
931
|
+
// Base WebSocket support interface
|
|
932
|
+
IWebSocketSupport,
|
|
933
|
+
|
|
934
|
+
// Combined WebSocket augmentation types
|
|
935
|
+
IWebSocketSenseAugmentation,
|
|
936
|
+
IWebSocketConduitAugmentation,
|
|
937
|
+
IWebSocketCognitionAugmentation,
|
|
938
|
+
IWebSocketMemoryAugmentation,
|
|
939
|
+
IWebSocketPerceptionAugmentation,
|
|
940
|
+
IWebSocketDialogAugmentation,
|
|
941
|
+
IWebSocketActivationAugmentation,
|
|
942
|
+
|
|
943
|
+
// Function to add WebSocket support to any augmentation
|
|
944
|
+
addWebSocketSupport
|
|
945
|
+
} from '@soulcraft/brainy'
|
|
946
|
+
|
|
947
|
+
// Example: Creating a typed WebSocket-enabled sense augmentation
|
|
948
|
+
const mySenseAug = createSenseAugmentation({
|
|
949
|
+
name: 'my-sense',
|
|
950
|
+
processRawData: async (data, dataType) => {
|
|
951
|
+
// Implementation
|
|
952
|
+
return {
|
|
953
|
+
success: true,
|
|
954
|
+
data: { nouns: [], verbs: [] }
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}) as IWebSocketSenseAugmentation
|
|
958
|
+
|
|
959
|
+
// Add WebSocket support
|
|
960
|
+
addWebSocketSupport(mySenseAug, {
|
|
961
|
+
connectWebSocket: async (url) => {
|
|
962
|
+
// WebSocket implementation
|
|
963
|
+
return {
|
|
964
|
+
connectionId: 'ws-1',
|
|
965
|
+
url,
|
|
966
|
+
status: 'connected'
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
sendWebSocketMessage: async (connectionId, data) => {
|
|
970
|
+
// Send message implementation
|
|
971
|
+
},
|
|
972
|
+
onWebSocketMessage: async (connectionId, callback) => {
|
|
973
|
+
// Register callback implementation
|
|
974
|
+
},
|
|
975
|
+
offWebSocketMessage: async (connectionId, callback) => {
|
|
976
|
+
// Remove callback implementation
|
|
977
|
+
},
|
|
978
|
+
closeWebSocket: async (connectionId, code, reason) => {
|
|
979
|
+
// Close connection implementation
|
|
980
|
+
}
|
|
981
|
+
})
|
|
982
|
+
|
|
983
|
+
// Now mySenseAug has both sense augmentation methods and WebSocket methods
|
|
984
|
+
await mySenseAug.processRawData('data', 'text')
|
|
985
|
+
await mySenseAug.connectWebSocket('wss://example.com')
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
These WebSocket augmentation types combine the base augmentation interfaces with the `IWebSocketSupport` interface, providing type safety and autocompletion for augmentations with WebSocket capabilities.
|
|
989
|
+
|
|
909
990
|
### Model Control Protocol (MCP)
|
|
910
991
|
|
|
911
992
|
Brainy includes a Model Control Protocol (MCP) implementation that allows external models to access Brainy data and use
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryAugmentations.d.ts","sourceRoot":"","sources":["../../src/augmentations/memoryAugmentations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"memoryAugmentations.d.ts","sourceRoot":"","sources":["../../src/augmentations/memoryAugmentations.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAC,cAAc,EAAS,MAAM,iBAAiB,CAAA;AAItD;;GAEG;AACH,uBAAe,sBAAuB,YAAW,mBAAmB;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE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