@soulcraft/brainy 0.13.0 → 0.15.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 +67 -1
- package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
- package/dist/brainy.js +87325 -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/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](CONTRIBUTING.md)
|
|
9
|
-
[](https://www.npmjs.com/package/@soulcraft/brainy)
|
|
10
10
|
|
|
11
11
|
[//]: # ([](https://github.com/sodal-project/cartographer))
|
|
12
12
|
|
|
@@ -146,6 +146,7 @@ Brainy combines four key technologies to create its adaptive intelligence:
|
|
|
146
146
|
- Serverless: In-memory storage with optional cloud persistence
|
|
147
147
|
- Fallback: In-memory storage
|
|
148
148
|
- Automatically migrates between storage types as needed
|
|
149
|
+
- Uses a simplified, consolidated storage structure for all noun types
|
|
149
150
|
|
|
150
151
|
## 🚀 The Brainy Pipeline
|
|
151
152
|
|
|
@@ -906,6 +907,71 @@ The simplified augmentation system provides:
|
|
|
906
907
|
4. **Dynamic Loading** - Load augmentations at runtime when needed
|
|
907
908
|
5. **Static & Streaming Data** - Handle both static and streaming data with the same API
|
|
908
909
|
|
|
910
|
+
#### WebSocket Augmentation Types
|
|
911
|
+
|
|
912
|
+
Brainy exports several WebSocket augmentation types that can be used by augmentation creators to add WebSocket capabilities to their augmentations:
|
|
913
|
+
|
|
914
|
+
```typescript
|
|
915
|
+
import {
|
|
916
|
+
// Base WebSocket support interface
|
|
917
|
+
IWebSocketSupport,
|
|
918
|
+
|
|
919
|
+
// Combined WebSocket augmentation types
|
|
920
|
+
IWebSocketSenseAugmentation,
|
|
921
|
+
IWebSocketConduitAugmentation,
|
|
922
|
+
IWebSocketCognitionAugmentation,
|
|
923
|
+
IWebSocketMemoryAugmentation,
|
|
924
|
+
IWebSocketPerceptionAugmentation,
|
|
925
|
+
IWebSocketDialogAugmentation,
|
|
926
|
+
IWebSocketActivationAugmentation,
|
|
927
|
+
|
|
928
|
+
// Function to add WebSocket support to any augmentation
|
|
929
|
+
addWebSocketSupport
|
|
930
|
+
} from '@soulcraft/brainy'
|
|
931
|
+
|
|
932
|
+
// Example: Creating a typed WebSocket-enabled sense augmentation
|
|
933
|
+
const mySenseAug = createSenseAugmentation({
|
|
934
|
+
name: 'my-sense',
|
|
935
|
+
processRawData: async (data, dataType) => {
|
|
936
|
+
// Implementation
|
|
937
|
+
return {
|
|
938
|
+
success: true,
|
|
939
|
+
data: { nouns: [], verbs: [] }
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}) as IWebSocketSenseAugmentation
|
|
943
|
+
|
|
944
|
+
// Add WebSocket support
|
|
945
|
+
addWebSocketSupport(mySenseAug, {
|
|
946
|
+
connectWebSocket: async (url) => {
|
|
947
|
+
// WebSocket implementation
|
|
948
|
+
return {
|
|
949
|
+
connectionId: 'ws-1',
|
|
950
|
+
url,
|
|
951
|
+
status: 'connected'
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
sendWebSocketMessage: async (connectionId, data) => {
|
|
955
|
+
// Send message implementation
|
|
956
|
+
},
|
|
957
|
+
onWebSocketMessage: async (connectionId, callback) => {
|
|
958
|
+
// Register callback implementation
|
|
959
|
+
},
|
|
960
|
+
offWebSocketMessage: async (connectionId, callback) => {
|
|
961
|
+
// Remove callback implementation
|
|
962
|
+
},
|
|
963
|
+
closeWebSocket: async (connectionId, code, reason) => {
|
|
964
|
+
// Close connection implementation
|
|
965
|
+
}
|
|
966
|
+
})
|
|
967
|
+
|
|
968
|
+
// Now mySenseAug has both sense augmentation methods and WebSocket methods
|
|
969
|
+
await mySenseAug.processRawData('data', 'text')
|
|
970
|
+
await mySenseAug.connectWebSocket('wss://example.com')
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
These WebSocket augmentation types combine the base augmentation interfaces with the `IWebSocketSupport` interface, providing type safety and autocompletion for augmentations with WebSocket capabilities.
|
|
974
|
+
|
|
909
975
|
### Model Control Protocol (MCP)
|
|
910
976
|
|
|
911
977
|
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,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