@soulcraft/brainy 2.10.0 → 2.11.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.
Files changed (38) hide show
  1. package/README.md +10 -10
  2. package/dist/augmentations/apiServerAugmentation.js +2 -2
  3. package/dist/augmentations/display/fieldPatterns.d.ts +1 -1
  4. package/dist/augmentations/display/fieldPatterns.js +1 -1
  5. package/dist/augmentations/display/intelligentComputation.d.ts +2 -2
  6. package/dist/augmentations/display/intelligentComputation.js +4 -4
  7. package/dist/augmentations/display/types.d.ts +1 -1
  8. package/dist/augmentations/neuralImport.js +4 -4
  9. package/dist/augmentations/synapseAugmentation.js +3 -3
  10. package/dist/augmentations/typeMatching/brainyTypes.d.ts +83 -0
  11. package/dist/augmentations/typeMatching/brainyTypes.js +425 -0
  12. package/dist/augmentations/universalDisplayAugmentation.d.ts +1 -1
  13. package/dist/augmentations/universalDisplayAugmentation.js +1 -1
  14. package/dist/brainyData.d.ts +15 -33
  15. package/dist/brainyData.js +1210 -1203
  16. package/dist/chat/BrainyChat.js +11 -11
  17. package/dist/examples/basicUsage.js +4 -1
  18. package/dist/importManager.js +2 -2
  19. package/dist/index.d.ts +3 -1
  20. package/dist/index.js +5 -1
  21. package/dist/neural/embeddedPatterns.d.ts +1 -1
  22. package/dist/neural/embeddedPatterns.js +2 -2
  23. package/dist/storage/adapters/fileSystemStorage.d.ts +2 -2
  24. package/dist/storage/adapters/fileSystemStorage.js +2 -2
  25. package/dist/storage/adapters/memoryStorage.d.ts +4 -4
  26. package/dist/storage/adapters/memoryStorage.js +4 -4
  27. package/dist/storage/adapters/opfsStorage.d.ts +2 -2
  28. package/dist/storage/adapters/opfsStorage.js +2 -2
  29. package/dist/storage/adapters/s3CompatibleStorage.d.ts +2 -2
  30. package/dist/storage/adapters/s3CompatibleStorage.js +2 -2
  31. package/dist/storage/baseStorage.d.ts +12 -2
  32. package/dist/storage/baseStorage.js +32 -0
  33. package/dist/types/brainyDataInterface.d.ts +2 -5
  34. package/dist/utils/brainyTypes.d.ts +217 -0
  35. package/dist/utils/brainyTypes.js +261 -0
  36. package/dist/utils/typeValidation.d.ts +25 -0
  37. package/dist/utils/typeValidation.js +127 -0
  38. package/package.json +1 -1
@@ -67,17 +67,17 @@ export class BrainyChat {
67
67
  tags: ['active']
68
68
  }
69
69
  };
70
- // Store session using BrainyData add() method
71
- await this.brainy.add({
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 add() method
106
- await this.brainy.add({
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.add({
261
+ await this.brainy.addNoun({
262
262
  archivedSessionId: sessionId,
263
263
  archivedAt: new Date().toISOString(),
264
264
  action: 'archive'
265
- }, {
266
- nounType: NounType.State,
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
- ids[word] = await db.addNoun(vector, metadata[word]);
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());
@@ -43,8 +43,8 @@ export class ImportManager {
43
43
  };
44
44
  await this.neuralImport.initialize(context);
45
45
  // Get type matcher
46
- const { getTypeMatcher } = await import('./augmentations/typeMatching/intelligentTypeMatcher.js');
47
- this.typeMatcher = await getTypeMatcher();
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
- export { NounType, VerbType, getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap };
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
- export { NounType, VerbType, getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap };
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';
@@ -2,7 +2,7 @@
2
2
  * 🧠 BRAINY EMBEDDED PATTERNS
3
3
  *
4
4
  * AUTO-GENERATED - DO NOT EDIT
5
- * Generated: 2025-08-27T16:58:35.801Z
5
+ * Generated: 2025-09-01T16:21:15.650Z
6
6
  * Patterns: 220
7
7
  * Coverage: 94-98% of all queries
8
8
  *