@soulcraft/brainy 2.10.1 → 2.12.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 +10 -10
- package/dist/augmentations/apiServerAugmentation.js +2 -2
- package/dist/augmentations/display/fieldPatterns.d.ts +1 -1
- package/dist/augmentations/display/fieldPatterns.js +1 -1
- package/dist/augmentations/display/intelligentComputation.d.ts +2 -2
- package/dist/augmentations/display/intelligentComputation.js +4 -4
- package/dist/augmentations/display/types.d.ts +1 -1
- package/dist/augmentations/neuralImport.js +4 -4
- package/dist/augmentations/synapseAugmentation.js +3 -3
- package/dist/augmentations/typeMatching/brainyTypes.d.ts +83 -0
- package/dist/augmentations/typeMatching/brainyTypes.js +425 -0
- package/dist/augmentations/universalDisplayAugmentation.d.ts +1 -1
- package/dist/augmentations/universalDisplayAugmentation.js +1 -1
- package/dist/brainyData.d.ts +20 -41
- package/dist/brainyData.js +1467 -1430
- package/dist/chat/BrainyChat.js +11 -11
- package/dist/examples/basicUsage.js +4 -1
- package/dist/importManager.js +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/neural/embeddedPatterns.d.ts +1 -1
- package/dist/neural/embeddedPatterns.js +2 -2
- package/dist/neural/improvedNeuralAPI.d.ts +346 -0
- package/dist/neural/improvedNeuralAPI.js +2439 -0
- package/dist/neural/types.d.ts +267 -0
- package/dist/neural/types.js +24 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts +2 -2
- package/dist/storage/adapters/fileSystemStorage.js +2 -2
- package/dist/storage/adapters/memoryStorage.d.ts +4 -4
- package/dist/storage/adapters/memoryStorage.js +4 -4
- package/dist/storage/adapters/opfsStorage.d.ts +2 -2
- package/dist/storage/adapters/opfsStorage.js +2 -2
- package/dist/storage/adapters/s3CompatibleStorage.d.ts +2 -2
- package/dist/storage/adapters/s3CompatibleStorage.js +2 -2
- package/dist/storage/baseStorage.d.ts +12 -2
- package/dist/storage/baseStorage.js +32 -0
- package/dist/types/brainyDataInterface.d.ts +2 -5
- package/dist/utils/brainyTypes.d.ts +217 -0
- package/dist/utils/brainyTypes.js +261 -0
- package/dist/utils/typeValidation.d.ts +25 -0
- package/dist/utils/typeValidation.js +127 -0
- package/package.json +1 -1
package/dist/chat/BrainyChat.js
CHANGED
|
@@ -67,17 +67,17 @@ export class BrainyChat {
|
|
|
67
67
|
tags: ['active']
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
// Store session using BrainyData
|
|
71
|
-
await this.brainy.
|
|
70
|
+
// Store session using BrainyData addNoun() method
|
|
71
|
+
await this.brainy.addNoun({
|
|
72
72
|
sessionType: 'chat',
|
|
73
73
|
title: title || `Chat Session ${new Date().toLocaleDateString()}`,
|
|
74
74
|
createdAt: session.createdAt.toISOString(),
|
|
75
75
|
lastMessageAt: session.lastMessageAt.toISOString(),
|
|
76
76
|
messageCount: session.messageCount,
|
|
77
77
|
participants: session.participants
|
|
78
|
-
},
|
|
78
|
+
}, NounType.Concept, // Chat sessions are concepts
|
|
79
|
+
{
|
|
79
80
|
id: sessionId,
|
|
80
|
-
nounType: NounType.Concept,
|
|
81
81
|
sessionType: 'chat'
|
|
82
82
|
});
|
|
83
83
|
this.currentSessionId = sessionId;
|
|
@@ -102,17 +102,17 @@ export class BrainyChat {
|
|
|
102
102
|
timestamp,
|
|
103
103
|
metadata
|
|
104
104
|
};
|
|
105
|
-
// Store message using BrainyData
|
|
106
|
-
await this.brainy.
|
|
105
|
+
// Store message using BrainyData addNoun() method
|
|
106
|
+
await this.brainy.addNoun({
|
|
107
107
|
messageType: 'chat',
|
|
108
108
|
content,
|
|
109
109
|
speaker,
|
|
110
110
|
sessionId: this.currentSessionId,
|
|
111
111
|
timestamp: timestamp.toISOString(),
|
|
112
112
|
...metadata
|
|
113
|
-
},
|
|
113
|
+
}, NounType.Message, // Chat messages are Message type
|
|
114
|
+
{
|
|
114
115
|
id: messageId,
|
|
115
|
-
nounType: NounType.Message,
|
|
116
116
|
messageType: 'chat',
|
|
117
117
|
sessionId: this.currentSessionId,
|
|
118
118
|
speaker
|
|
@@ -258,12 +258,12 @@ export class BrainyChat {
|
|
|
258
258
|
async archiveSession(sessionId) {
|
|
259
259
|
try {
|
|
260
260
|
// Since BrainyData doesn't have update, add an archive marker
|
|
261
|
-
await this.brainy.
|
|
261
|
+
await this.brainy.addNoun({
|
|
262
262
|
archivedSessionId: sessionId,
|
|
263
263
|
archivedAt: new Date().toISOString(),
|
|
264
264
|
action: 'archive'
|
|
265
|
-
},
|
|
266
|
-
|
|
265
|
+
}, NounType.State, // Archive markers are State
|
|
266
|
+
{
|
|
267
267
|
sessionId,
|
|
268
268
|
archived: true
|
|
269
269
|
});
|
|
@@ -36,7 +36,10 @@ async function runExample() {
|
|
|
36
36
|
// Add vectors to the database
|
|
37
37
|
const ids = {};
|
|
38
38
|
for (const [word, vector] of Object.entries(wordEmbeddings)) {
|
|
39
|
-
|
|
39
|
+
// Determine noun type based on the metadata
|
|
40
|
+
const meta = metadata[word];
|
|
41
|
+
const nounType = meta.type === 'mammal' || meta.type === 'bird' || meta.type === 'fish' ? 'Thing' : 'Content';
|
|
42
|
+
ids[word] = await db.addNoun(vector, nounType, meta);
|
|
40
43
|
console.log(`Added "${word}" with ID: ${ids[word]}`);
|
|
41
44
|
}
|
|
42
45
|
console.log('\nDatabase size:', db.size());
|
package/dist/importManager.js
CHANGED
|
@@ -43,8 +43,8 @@ export class ImportManager {
|
|
|
43
43
|
};
|
|
44
44
|
await this.neuralImport.initialize(context);
|
|
45
45
|
// Get type matcher
|
|
46
|
-
const {
|
|
47
|
-
this.typeMatcher = await
|
|
46
|
+
const { getBrainyTypes } = await import('./augmentations/typeMatching/brainyTypes.js');
|
|
47
|
+
this.typeMatcher = await getBrainyTypes();
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Main import method - handles all sources
|
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,9 @@ import type { GraphNoun, GraphVerb, EmbeddedGraphVerb, Person, Location, Thing,
|
|
|
58
58
|
import { NounType, VerbType } from './types/graphTypes.js';
|
|
59
59
|
export type { GraphNoun, GraphVerb, EmbeddedGraphVerb, Person, Location, Thing, Event, Concept, Content, Collection, Organization, Document, Media, File, Message, Dataset, Product, Service, User, Task, Project, Process, State, Role, Topic, Language, Currency, Measurement };
|
|
60
60
|
import { getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap } from './utils/typeUtils.js';
|
|
61
|
-
|
|
61
|
+
import { BrainyTypes, TypeSuggestion, suggestType } from './utils/brainyTypes.js';
|
|
62
|
+
export { NounType, VerbType, getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap, BrainyTypes, suggestType };
|
|
63
|
+
export type { TypeSuggestion };
|
|
62
64
|
import { BrainyMCPAdapter, MCPAugmentationToolset, BrainyMCPService } from './mcp/index.js';
|
|
63
65
|
import { MCPRequest, MCPResponse, MCPDataAccessRequest, MCPToolExecutionRequest, MCPSystemInfoRequest, MCPAuthenticationRequest, MCPRequestType, MCPServiceOptions, MCPTool, MCP_VERSION } from './types/mcpTypes.js';
|
|
64
66
|
export { BrainyMCPAdapter, MCPAugmentationToolset, BrainyMCPService, MCPRequestType, MCP_VERSION };
|
package/dist/index.js
CHANGED
|
@@ -113,7 +113,11 @@ export { AugmentationManager } from './augmentationManager.js';
|
|
|
113
113
|
import { NounType, VerbType } from './types/graphTypes.js';
|
|
114
114
|
// Export type utility functions
|
|
115
115
|
import { getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap } from './utils/typeUtils.js';
|
|
116
|
-
|
|
116
|
+
// Export BrainyTypes for complete type management
|
|
117
|
+
import { BrainyTypes, suggestType } from './utils/brainyTypes.js';
|
|
118
|
+
export { NounType, VerbType, getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap,
|
|
119
|
+
// BrainyTypes - complete type management
|
|
120
|
+
BrainyTypes, suggestType };
|
|
117
121
|
// Export MCP (Model Control Protocol) components
|
|
118
122
|
import { BrainyMCPAdapter, MCPAugmentationToolset, BrainyMCPService } from './mcp/index.js'; // Import from mcp/index.js
|
|
119
123
|
import { MCPRequestType, MCP_VERSION } from './types/mcpTypes.js';
|