@soulcraft/brainy 4.8.2 → 4.8.4
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.
|
@@ -1057,41 +1057,33 @@ export class FileSystemStorage extends BaseStorage {
|
|
|
1057
1057
|
* Get verbs by source
|
|
1058
1058
|
*/
|
|
1059
1059
|
async getVerbsBySource_internal(sourceId) {
|
|
1060
|
-
console.log(`[DEBUG] getVerbsBySource_internal called for sourceId: ${sourceId}`);
|
|
1061
|
-
console.log(`[DEBUG] verbsDir: ${this.verbsDir}`);
|
|
1062
1060
|
// Use the working pagination method with source filter
|
|
1063
1061
|
const result = await this.getVerbsWithPagination({
|
|
1064
1062
|
limit: 10000,
|
|
1065
1063
|
filter: { sourceId: [sourceId] }
|
|
1066
1064
|
});
|
|
1067
|
-
console.log(`[DEBUG] Found ${result.items.length} verbs for source ${sourceId}`);
|
|
1068
|
-
console.log(`[DEBUG] Total verb files found: ${result.totalCount}`);
|
|
1069
1065
|
return result.items;
|
|
1070
1066
|
}
|
|
1071
1067
|
/**
|
|
1072
1068
|
* Get verbs by target
|
|
1073
1069
|
*/
|
|
1074
1070
|
async getVerbsByTarget_internal(targetId) {
|
|
1075
|
-
console.log(`[DEBUG] getVerbsByTarget_internal called for targetId: ${targetId}`);
|
|
1076
1071
|
// Use the working pagination method with target filter
|
|
1077
1072
|
const result = await this.getVerbsWithPagination({
|
|
1078
1073
|
limit: 10000,
|
|
1079
1074
|
filter: { targetId: [targetId] }
|
|
1080
1075
|
});
|
|
1081
|
-
console.log(`[DEBUG] Found ${result.items.length} verbs for target ${targetId}`);
|
|
1082
1076
|
return result.items;
|
|
1083
1077
|
}
|
|
1084
1078
|
/**
|
|
1085
1079
|
* Get verbs by type
|
|
1086
1080
|
*/
|
|
1087
1081
|
async getVerbsByType_internal(type) {
|
|
1088
|
-
console.log(`[DEBUG] getVerbsByType_internal called for type: ${type}`);
|
|
1089
1082
|
// Use the working pagination method with type filter
|
|
1090
1083
|
const result = await this.getVerbsWithPagination({
|
|
1091
1084
|
limit: 10000,
|
|
1092
1085
|
filter: { verbType: [type] }
|
|
1093
1086
|
});
|
|
1094
|
-
console.log(`[DEBUG] Found ${result.items.length} verbs for type ${type}`);
|
|
1095
1087
|
return result.items;
|
|
1096
1088
|
}
|
|
1097
1089
|
/**
|
|
@@ -1105,12 +1097,10 @@ export class FileSystemStorage extends BaseStorage {
|
|
|
1105
1097
|
try {
|
|
1106
1098
|
// Get actual verb files first (critical for accuracy)
|
|
1107
1099
|
const verbFiles = await this.getAllShardedFiles(this.verbsDir);
|
|
1108
|
-
console.log(`[DEBUG] getAllShardedFiles returned ${verbFiles.length} files from ${this.verbsDir}`);
|
|
1109
1100
|
verbFiles.sort(); // Consistent ordering for pagination
|
|
1110
1101
|
// Use actual file count - don't trust cached totalVerbCount
|
|
1111
1102
|
// This prevents accessing undefined array elements
|
|
1112
1103
|
const actualFileCount = verbFiles.length;
|
|
1113
|
-
console.log(`[DEBUG] actualFileCount: ${actualFileCount}, startIndex: ${startIndex}, limit: ${limit}`);
|
|
1114
1104
|
// For large datasets, warn about performance
|
|
1115
1105
|
if (actualFileCount > 1000000) {
|
|
1116
1106
|
console.warn(`Very large verb dataset detected (${actualFileCount} verbs). Performance may be degraded. Consider database storage for optimal performance.`);
|
|
@@ -1182,12 +1172,8 @@ export class FileSystemStorage extends BaseStorage {
|
|
|
1182
1172
|
// Check sourceId filter
|
|
1183
1173
|
if (filter.sourceId) {
|
|
1184
1174
|
const sources = Array.isArray(filter.sourceId) ? filter.sourceId : [filter.sourceId];
|
|
1185
|
-
|
|
1186
|
-
if (!sources.includes(verbWithMetadata.sourceId)) {
|
|
1187
|
-
console.log(`[DEBUG] Verb ${verbWithMetadata.id} filtered out (sourceId mismatch)`);
|
|
1175
|
+
if (!sources.includes(verbWithMetadata.sourceId))
|
|
1188
1176
|
continue;
|
|
1189
|
-
}
|
|
1190
|
-
console.log(`[DEBUG] Verb ${verbWithMetadata.id} MATCHES source filter!`);
|
|
1191
1177
|
}
|
|
1192
1178
|
// Check targetId filter
|
|
1193
1179
|
if (filter.targetId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.4",
|
|
4
4
|
"description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|