@soulcraft/brainy 5.4.0 → 5.5.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.
@@ -234,11 +234,11 @@ export class NeuralEntityExtractor {
234
234
  }
235
235
  // Hashtag
236
236
  if (text.startsWith('#')) {
237
- return { type: NounType.Topic, confidence: 0.8 };
237
+ return { type: NounType.Concept, confidence: 0.8 };
238
238
  }
239
239
  // Mention
240
240
  if (text.startsWith('@')) {
241
- return { type: NounType.User, confidence: 0.8 };
241
+ return { type: NounType.Person, confidence: 0.8 };
242
242
  }
243
243
  // Capitalized words (likely proper nouns)
244
244
  if (/^[A-Z]/.test(text)) {
@@ -106,7 +106,7 @@ export class RelationshipConfidenceScorer {
106
106
  [VerbType.Contains]: ['contains', 'includes', 'has', 'holds'],
107
107
  [VerbType.Requires]: ['requires', 'needs', 'depends on', 'relies on'],
108
108
  [VerbType.Uses]: ['uses', 'utilizes', 'employs', 'applies'],
109
- [VerbType.Supervises]: ['manages', 'oversees', 'supervises', 'controls'],
109
+ [VerbType.ReportsTo]: ['manages', 'oversees', 'supervises', 'controls'],
110
110
  [VerbType.Causes]: ['influences', 'affects', 'impacts', 'shapes', 'causes'],
111
111
  [VerbType.DependsOn]: ['depends on', 'relies on', 'based on'],
112
112
  [VerbType.Modifies]: ['modifies', 'changes', 'alters', 'updates'],
@@ -105,7 +105,7 @@ export class VerbContextSignal {
105
105
  {
106
106
  subjectType: NounType.Document,
107
107
  objectType: NounType.Person,
108
- verbType: VerbType.CreatedBy,
108
+ verbType: VerbType.Creates,
109
109
  confidence: 0.80,
110
110
  description: 'Document created by Person'
111
111
  },
@@ -173,7 +173,7 @@ export class VerbContextSignal {
173
173
  {
174
174
  subjectType: NounType.Product,
175
175
  objectType: NounType.Organization,
176
- verbType: VerbType.CreatedBy,
176
+ verbType: VerbType.Creates,
177
177
  confidence: 0.75,
178
178
  description: 'Product created by Organization'
179
179
  },
@@ -188,7 +188,7 @@ export class VerbContextSignal {
188
188
  {
189
189
  subjectType: NounType.Product,
190
190
  objectType: NounType.Person,
191
- verbType: VerbType.CreatedBy,
191
+ verbType: VerbType.Creates,
192
192
  confidence: 0.75,
193
193
  description: 'Product created by Person'
194
194
  },
@@ -196,7 +196,7 @@ export class VerbContextSignal {
196
196
  {
197
197
  subjectType: NounType.Event,
198
198
  objectType: NounType.Person,
199
- verbType: VerbType.CreatedBy,
199
+ verbType: VerbType.Creates,
200
200
  confidence: 0.70,
201
201
  description: 'Event created by Person'
202
202
  },
@@ -220,7 +220,7 @@ export class VerbContextSignal {
220
220
  {
221
221
  subjectType: NounType.Project,
222
222
  objectType: NounType.Organization,
223
- verbType: VerbType.BelongsTo,
223
+ verbType: VerbType.Owns,
224
224
  confidence: 0.75,
225
225
  description: 'Project belongs to Organization'
226
226
  },
@@ -228,7 +228,7 @@ export class VerbContextSignal {
228
228
  {
229
229
  subjectType: NounType.Project,
230
230
  objectType: NounType.Person,
231
- verbType: VerbType.CreatedBy,
231
+ verbType: VerbType.Creates,
232
232
  confidence: 0.70,
233
233
  description: 'Project created by Person'
234
234
  },
@@ -190,14 +190,14 @@ export class VerbExactMatchSignal {
190
190
  // Common relationship phrases with their VerbTypes
191
191
  const phrases = [
192
192
  // Creation relationships
193
- { pattern: /created?\s+by/i, type: VerbType.CreatedBy, confidence: 0.95 },
194
- { pattern: /authored?\s+by/i, type: VerbType.CreatedBy, confidence: 0.95 },
195
- { pattern: /written\s+by/i, type: VerbType.CreatedBy, confidence: 0.95 },
196
- { pattern: /developed\s+by/i, type: VerbType.CreatedBy, confidence: 0.90 },
193
+ { pattern: /created?\s+by/i, type: VerbType.Creates, confidence: 0.95 },
194
+ { pattern: /authored?\s+by/i, type: VerbType.Creates, confidence: 0.95 },
195
+ { pattern: /written\s+by/i, type: VerbType.Creates, confidence: 0.95 },
196
+ { pattern: /developed\s+by/i, type: VerbType.Creates, confidence: 0.90 },
197
197
  { pattern: /built\s+by/i, type: VerbType.Creates, confidence: 0.85 },
198
198
  // Ownership relationships
199
199
  { pattern: /owned\s+by/i, type: VerbType.Owns, confidence: 0.95 },
200
- { pattern: /belongs\s+to/i, type: VerbType.BelongsTo, confidence: 0.95 },
200
+ { pattern: /belongs\s+to/i, type: VerbType.Owns, confidence: 0.95 },
201
201
  { pattern: /attributed\s+to/i, type: VerbType.AttributedTo, confidence: 0.95 },
202
202
  // Part/Whole relationships
203
203
  { pattern: /part\s+of/i, type: VerbType.PartOf, confidence: 0.95 },
@@ -213,17 +213,17 @@ export class VerbExactMatchSignal {
213
213
  { pattern: /employed\s+by/i, type: VerbType.WorksWith, confidence: 0.90 },
214
214
  // Reporting relationships
215
215
  { pattern: /reports?\s+to/i, type: VerbType.ReportsTo, confidence: 0.95 },
216
- { pattern: /manages/i, type: VerbType.Supervises, confidence: 0.85 },
217
- { pattern: /supervises/i, type: VerbType.Supervises, confidence: 0.95 },
216
+ { pattern: /manages/i, type: VerbType.ReportsTo, confidence: 0.85 },
217
+ { pattern: /supervises/i, type: VerbType.ReportsTo, confidence: 0.95 },
218
218
  // Reference relationships
219
219
  { pattern: /references/i, type: VerbType.References, confidence: 0.90 },
220
220
  { pattern: /cites/i, type: VerbType.References, confidence: 0.90 },
221
221
  { pattern: /mentions/i, type: VerbType.References, confidence: 0.85 },
222
222
  // Temporal relationships
223
223
  { pattern: /precedes/i, type: VerbType.Precedes, confidence: 0.90 },
224
- { pattern: /follows/i, type: VerbType.Succeeds, confidence: 0.90 },
224
+ { pattern: /follows/i, type: VerbType.Precedes, confidence: 0.90 },
225
225
  { pattern: /before/i, type: VerbType.Precedes, confidence: 0.75 },
226
- { pattern: /after/i, type: VerbType.Succeeds, confidence: 0.75 },
226
+ { pattern: /after/i, type: VerbType.Precedes, confidence: 0.75 },
227
227
  // Causal relationships
228
228
  { pattern: /causes/i, type: VerbType.Causes, confidence: 0.90 },
229
229
  { pattern: /requires/i, type: VerbType.Requires, confidence: 0.90 },
@@ -53,7 +53,7 @@ export class VerbPatternSignal {
53
53
  // ========== Creation & Authorship ==========
54
54
  {
55
55
  regex: /\b(?:created?|made|built|developed|designed|wrote|authored|composed)\s+(?:by|from)\b/i,
56
- type: VerbType.CreatedBy,
56
+ type: VerbType.Creates,
57
57
  confidence: 0.90,
58
58
  description: 'Creation with agent (passive)'
59
59
  },
@@ -84,7 +84,7 @@ export class VerbPatternSignal {
84
84
  },
85
85
  {
86
86
  regex: /\bbelongs?\s+to\b/i,
87
- type: VerbType.BelongsTo,
87
+ type: VerbType.Owns,
88
88
  confidence: 0.95,
89
89
  description: 'Belonging relationship'
90
90
  },
@@ -141,7 +141,7 @@ export class VerbPatternSignal {
141
141
  },
142
142
  {
143
143
  regex: /\b(?:manages?|supervises?|oversees?)\b/i,
144
- type: VerbType.Supervises,
144
+ type: VerbType.ReportsTo,
145
145
  confidence: 0.85,
146
146
  description: 'Management relationship'
147
147
  },
@@ -198,7 +198,7 @@ export class VerbPatternSignal {
198
198
  },
199
199
  {
200
200
  regex: /\b(?:succeeds?|follows?|comes?\s+after|happens?\s+after)\b/i,
201
- type: VerbType.Succeeds,
201
+ type: VerbType.Precedes,
202
202
  confidence: 0.85,
203
203
  description: 'Temporal succession'
204
204
  },
@@ -210,7 +210,7 @@ export class VerbPatternSignal {
210
210
  },
211
211
  {
212
212
  regex: /\bafter\b/i,
213
- type: VerbType.Succeeds,
213
+ type: VerbType.Precedes,
214
214
  confidence: 0.70,
215
215
  description: 'After (temporal)'
216
216
  },
@@ -145,18 +145,17 @@ export class TypeAwareQueryPlanner {
145
145
  NounType.Media,
146
146
  NounType.File,
147
147
  NounType.Message,
148
- NounType.Content,
149
148
  NounType.Collection,
150
149
  NounType.Dataset,
151
150
  NounType.Product,
152
151
  NounType.Service,
153
- NounType.User,
152
+ NounType.Person,
154
153
  NounType.Task,
155
154
  NounType.Project,
156
155
  NounType.Process,
157
156
  NounType.State,
158
157
  NounType.Role,
159
- NounType.Topic,
158
+ NounType.Concept,
160
159
  NounType.Language,
161
160
  NounType.Currency,
162
161
  NounType.Measurement,