@soulcraft/brainy 3.23.0 → 3.23.1
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/dist/coreTypes.d.ts
CHANGED
|
@@ -419,6 +419,12 @@ export interface StorageAdapter {
|
|
|
419
419
|
* @returns Promise that resolves to a Map of id -> metadata
|
|
420
420
|
*/
|
|
421
421
|
getMetadataBatch?(ids: string[]): Promise<Map<string, any>>;
|
|
422
|
+
/**
|
|
423
|
+
* Get noun metadata from storage
|
|
424
|
+
* @param id The ID of the noun
|
|
425
|
+
* @returns Promise that resolves to the metadata or null if not found
|
|
426
|
+
*/
|
|
427
|
+
getNounMetadata(id: string): Promise<any | null>;
|
|
422
428
|
/**
|
|
423
429
|
* Save verb metadata to storage
|
|
424
430
|
* @param id The ID of the verb
|
|
@@ -20,6 +20,7 @@ export declare abstract class BaseStorageAdapter implements StorageAdapter {
|
|
|
20
20
|
abstract deleteVerb(id: string): Promise<void>;
|
|
21
21
|
abstract saveMetadata(id: string, metadata: any): Promise<void>;
|
|
22
22
|
abstract getMetadata(id: string): Promise<any | null>;
|
|
23
|
+
abstract getNounMetadata(id: string): Promise<any | null>;
|
|
23
24
|
abstract saveVerbMetadata(id: string, metadata: any): Promise<void>;
|
|
24
25
|
abstract getVerbMetadata(id: string): Promise<any | null>;
|
|
25
26
|
abstract clear(): Promise<void>;
|
|
@@ -464,7 +464,7 @@ export class FileSystemStorage extends BaseStorage {
|
|
|
464
464
|
const batch = ids.slice(i, i + batchSize);
|
|
465
465
|
const batchPromises = batch.map(async (id) => {
|
|
466
466
|
try {
|
|
467
|
-
const metadata = await this.
|
|
467
|
+
const metadata = await this.getNounMetadata(id);
|
|
468
468
|
return { id, metadata };
|
|
469
469
|
}
|
|
470
470
|
catch (error) {
|
|
@@ -518,7 +518,7 @@ export class OPFSStorage extends BaseStorage {
|
|
|
518
518
|
const batch = ids.slice(i, i + batchSize);
|
|
519
519
|
const batchPromises = batch.map(async (id) => {
|
|
520
520
|
try {
|
|
521
|
-
const metadata = await this.
|
|
521
|
+
const metadata = await this.getNounMetadata(id);
|
|
522
522
|
return { id, metadata };
|
|
523
523
|
}
|
|
524
524
|
catch (error) {
|
|
@@ -1356,7 +1356,7 @@ export class MetadataIndexManager {
|
|
|
1356
1356
|
const batch = nounIds.slice(i, i + CONCURRENCY_LIMIT);
|
|
1357
1357
|
const batchPromises = batch.map(async (id) => {
|
|
1358
1358
|
try {
|
|
1359
|
-
const metadata = await this.storage.
|
|
1359
|
+
const metadata = await this.storage.getNounMetadata(id);
|
|
1360
1360
|
return { id, metadata };
|
|
1361
1361
|
}
|
|
1362
1362
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.1",
|
|
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",
|