@utaba/deep-memory 0.15.0 → 0.17.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/LICENSE +1 -1
- package/dist/{StorageProvider-BGtKZZt4.d.cts → StorageProvider-DDTLUcuj.d.ts} +32 -8
- package/dist/{StorageProvider-D_o2Hksf.d.ts → StorageProvider-DGH7bVuK.d.cts} +32 -8
- package/dist/index.cjs +380 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -13
- package/dist/index.d.ts +71 -13
- package/dist/index.js +375 -99
- package/dist/index.js.map +1 -1
- package/dist/{portability-P1hL-bOa.d.cts → portability-Dbm6vCdD.d.cts} +15 -3
- package/dist/{portability-P1hL-bOa.d.ts → portability-Dbm6vCdD.d.ts} +15 -3
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +3 -3
- package/dist/providers/index.d.ts +3 -3
- package/dist/testing/conformance.cjs +10 -0
- package/dist/testing/conformance.cjs.map +1 -1
- package/dist/testing/conformance.d.cts +2 -2
- package/dist/testing/conformance.d.ts +2 -2
- package/dist/testing/conformance.js +10 -0
- package/dist/testing/conformance.js.map +1 -1
- package/dist/{traversal-CBE5h5ob.d.cts → traversal-1f35drOx.d.cts} +24 -3
- package/dist/{traversal-B_84kGaO.d.ts → traversal-OkXViSTI.d.ts} +24 -3
- package/dist/types/index.d.cts +13 -4
- package/dist/types/index.d.ts +13 -4
- package/package.json +2 -3
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { au as StorageRepositoryConfig, aB as StoredRepository, ad as RepositoryFilter, T as PaginatedResult, aC as StoredRepositorySummary, ah as RepositoryUpdate, g as DeleteProgressCallback, af as RepositoryStats, O as MemoryVocabulary, U as PaginationOptions, aM as VocabularyChangeRecord, ay as StoredEntity, az as StoredEntityUpdate, an as StorageFindQuery, aA as StoredRelationship, a5 as RelationshipQueryOptions, am as StorageExploreOptions, ao as StorageNeighborhood, as as StoragePathOptions, at as StoragePathResult, aw as StorageTimelineOptions, ax as StorageTimelineResult, s as ExportChunk, J as ImportChunk, B as BulkImportOptions, d as BulkImportResult } from './portability-Dbm6vCdD.js';
|
|
2
2
|
|
|
3
3
|
/** Result returned by ensureSchema describing what actions were taken. */
|
|
4
4
|
interface EnsureSchemaResult {
|
|
@@ -11,6 +11,22 @@ interface EnsureSchemaResult {
|
|
|
11
11
|
/** Schema version after the operation */
|
|
12
12
|
schemaVersion: number;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Internal entity-read options shared by `getEntity`, `getEntityBySlug`,
|
|
16
|
+
* `getEntities`, and `findEntities`.
|
|
17
|
+
*
|
|
18
|
+
* `loadEmbeddings` defaults to `false`. When `false`, providers must not ship
|
|
19
|
+
* the stored embedding over the wire — this is the AI-agent hot-path
|
|
20
|
+
* contract. When `true`, providers populate `StoredEntity.embedding` from the
|
|
21
|
+
* underlying store. The only legitimate caller is the vector-search path in
|
|
22
|
+
* `SearchOrchestrator.searchByConcept`.
|
|
23
|
+
*
|
|
24
|
+
* Providers that do not separate light/full reads (e.g. the in-memory
|
|
25
|
+
* provider, which always carries the full entity) may ignore this option.
|
|
26
|
+
*/
|
|
27
|
+
interface EntityReadOptions {
|
|
28
|
+
loadEmbeddings?: boolean;
|
|
29
|
+
}
|
|
14
30
|
/**
|
|
15
31
|
* StorageProvider — the primary persistence interface.
|
|
16
32
|
*
|
|
@@ -43,9 +59,9 @@ interface StorageProvider {
|
|
|
43
59
|
saveVocabulary(repositoryId: string, vocabulary: MemoryVocabulary): Promise<void>;
|
|
44
60
|
getVocabularyChangeLog(repositoryId: string, options?: PaginationOptions): Promise<PaginatedResult<VocabularyChangeRecord>>;
|
|
45
61
|
createEntity(repositoryId: string, entity: StoredEntity): Promise<StoredEntity>;
|
|
46
|
-
getEntity(repositoryId: string, entityId: string): Promise<StoredEntity | null>;
|
|
47
|
-
getEntityBySlug(repositoryId: string, slug: string): Promise<StoredEntity | null>;
|
|
48
|
-
getEntities(repositoryId: string, entityIds: string[]): Promise<Map<string, StoredEntity>>;
|
|
62
|
+
getEntity(repositoryId: string, entityId: string, options?: EntityReadOptions): Promise<StoredEntity | null>;
|
|
63
|
+
getEntityBySlug(repositoryId: string, slug: string, options?: EntityReadOptions): Promise<StoredEntity | null>;
|
|
64
|
+
getEntities(repositoryId: string, entityIds: string[], options?: EntityReadOptions): Promise<Map<string, StoredEntity>>;
|
|
49
65
|
updateEntity(repositoryId: string, entityId: string, updates: StoredEntityUpdate): Promise<StoredEntity>;
|
|
50
66
|
deleteEntity(repositoryId: string, entityId: string): Promise<void>;
|
|
51
67
|
/** Delete multiple entities and their associated relationships in a single batch operation */
|
|
@@ -53,12 +69,20 @@ interface StorageProvider {
|
|
|
53
69
|
deleted: string[];
|
|
54
70
|
notFound: string[];
|
|
55
71
|
}>;
|
|
56
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Delete all entities of a given type and their associated relationships.
|
|
74
|
+
*
|
|
75
|
+
* `deletedRelationships` may be `undefined` when the provider does not count
|
|
76
|
+
* cascaded edges. The CosmosDB provider skips the edge-count fan-out
|
|
77
|
+
* (a `bothE()` walk across every partition the type touches) because the
|
|
78
|
+
* count itself is rarely consumed — vocabulary cascade-delete discards it.
|
|
79
|
+
* SQL Server and in-memory providers continue to return the exact number.
|
|
80
|
+
*/
|
|
57
81
|
deleteEntitiesByType(repositoryId: string, entityType: string): Promise<{
|
|
58
82
|
deletedEntities: number;
|
|
59
|
-
deletedRelationships: number;
|
|
83
|
+
deletedRelationships: number | undefined;
|
|
60
84
|
}>;
|
|
61
|
-
findEntities(repositoryId: string, query: StorageFindQuery): Promise<PaginatedResult<StoredEntity>>;
|
|
85
|
+
findEntities(repositoryId: string, query: StorageFindQuery, options?: EntityReadOptions): Promise<PaginatedResult<StoredEntity>>;
|
|
62
86
|
createRelationship(repositoryId: string, relationship: StoredRelationship): Promise<StoredRelationship>;
|
|
63
87
|
getRelationship(repositoryId: string, relationshipId: string): Promise<StoredRelationship | null>;
|
|
64
88
|
getEntityRelationships(repositoryId: string, entityId: string, options?: RelationshipQueryOptions): Promise<PaginatedResult<StoredRelationship>>;
|
|
@@ -79,4 +103,4 @@ interface StorageProvider {
|
|
|
79
103
|
importBulk(repositoryId: string, data: ImportChunk[], options?: BulkImportOptions): Promise<BulkImportResult>;
|
|
80
104
|
}
|
|
81
105
|
|
|
82
|
-
export type { EnsureSchemaResult as E, StorageProvider as S };
|
|
106
|
+
export type { EnsureSchemaResult as E, StorageProvider as S, EntityReadOptions as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { au as StorageRepositoryConfig, aB as StoredRepository, ad as RepositoryFilter, T as PaginatedResult, aC as StoredRepositorySummary, ah as RepositoryUpdate, g as DeleteProgressCallback, af as RepositoryStats, O as MemoryVocabulary, U as PaginationOptions, aM as VocabularyChangeRecord, ay as StoredEntity, az as StoredEntityUpdate, an as StorageFindQuery, aA as StoredRelationship, a5 as RelationshipQueryOptions, am as StorageExploreOptions, ao as StorageNeighborhood, as as StoragePathOptions, at as StoragePathResult, aw as StorageTimelineOptions, ax as StorageTimelineResult, s as ExportChunk, J as ImportChunk, B as BulkImportOptions, d as BulkImportResult } from './portability-Dbm6vCdD.cjs';
|
|
2
2
|
|
|
3
3
|
/** Result returned by ensureSchema describing what actions were taken. */
|
|
4
4
|
interface EnsureSchemaResult {
|
|
@@ -11,6 +11,22 @@ interface EnsureSchemaResult {
|
|
|
11
11
|
/** Schema version after the operation */
|
|
12
12
|
schemaVersion: number;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Internal entity-read options shared by `getEntity`, `getEntityBySlug`,
|
|
16
|
+
* `getEntities`, and `findEntities`.
|
|
17
|
+
*
|
|
18
|
+
* `loadEmbeddings` defaults to `false`. When `false`, providers must not ship
|
|
19
|
+
* the stored embedding over the wire — this is the AI-agent hot-path
|
|
20
|
+
* contract. When `true`, providers populate `StoredEntity.embedding` from the
|
|
21
|
+
* underlying store. The only legitimate caller is the vector-search path in
|
|
22
|
+
* `SearchOrchestrator.searchByConcept`.
|
|
23
|
+
*
|
|
24
|
+
* Providers that do not separate light/full reads (e.g. the in-memory
|
|
25
|
+
* provider, which always carries the full entity) may ignore this option.
|
|
26
|
+
*/
|
|
27
|
+
interface EntityReadOptions {
|
|
28
|
+
loadEmbeddings?: boolean;
|
|
29
|
+
}
|
|
14
30
|
/**
|
|
15
31
|
* StorageProvider — the primary persistence interface.
|
|
16
32
|
*
|
|
@@ -43,9 +59,9 @@ interface StorageProvider {
|
|
|
43
59
|
saveVocabulary(repositoryId: string, vocabulary: MemoryVocabulary): Promise<void>;
|
|
44
60
|
getVocabularyChangeLog(repositoryId: string, options?: PaginationOptions): Promise<PaginatedResult<VocabularyChangeRecord>>;
|
|
45
61
|
createEntity(repositoryId: string, entity: StoredEntity): Promise<StoredEntity>;
|
|
46
|
-
getEntity(repositoryId: string, entityId: string): Promise<StoredEntity | null>;
|
|
47
|
-
getEntityBySlug(repositoryId: string, slug: string): Promise<StoredEntity | null>;
|
|
48
|
-
getEntities(repositoryId: string, entityIds: string[]): Promise<Map<string, StoredEntity>>;
|
|
62
|
+
getEntity(repositoryId: string, entityId: string, options?: EntityReadOptions): Promise<StoredEntity | null>;
|
|
63
|
+
getEntityBySlug(repositoryId: string, slug: string, options?: EntityReadOptions): Promise<StoredEntity | null>;
|
|
64
|
+
getEntities(repositoryId: string, entityIds: string[], options?: EntityReadOptions): Promise<Map<string, StoredEntity>>;
|
|
49
65
|
updateEntity(repositoryId: string, entityId: string, updates: StoredEntityUpdate): Promise<StoredEntity>;
|
|
50
66
|
deleteEntity(repositoryId: string, entityId: string): Promise<void>;
|
|
51
67
|
/** Delete multiple entities and their associated relationships in a single batch operation */
|
|
@@ -53,12 +69,20 @@ interface StorageProvider {
|
|
|
53
69
|
deleted: string[];
|
|
54
70
|
notFound: string[];
|
|
55
71
|
}>;
|
|
56
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Delete all entities of a given type and their associated relationships.
|
|
74
|
+
*
|
|
75
|
+
* `deletedRelationships` may be `undefined` when the provider does not count
|
|
76
|
+
* cascaded edges. The CosmosDB provider skips the edge-count fan-out
|
|
77
|
+
* (a `bothE()` walk across every partition the type touches) because the
|
|
78
|
+
* count itself is rarely consumed — vocabulary cascade-delete discards it.
|
|
79
|
+
* SQL Server and in-memory providers continue to return the exact number.
|
|
80
|
+
*/
|
|
57
81
|
deleteEntitiesByType(repositoryId: string, entityType: string): Promise<{
|
|
58
82
|
deletedEntities: number;
|
|
59
|
-
deletedRelationships: number;
|
|
83
|
+
deletedRelationships: number | undefined;
|
|
60
84
|
}>;
|
|
61
|
-
findEntities(repositoryId: string, query: StorageFindQuery): Promise<PaginatedResult<StoredEntity>>;
|
|
85
|
+
findEntities(repositoryId: string, query: StorageFindQuery, options?: EntityReadOptions): Promise<PaginatedResult<StoredEntity>>;
|
|
62
86
|
createRelationship(repositoryId: string, relationship: StoredRelationship): Promise<StoredRelationship>;
|
|
63
87
|
getRelationship(repositoryId: string, relationshipId: string): Promise<StoredRelationship | null>;
|
|
64
88
|
getEntityRelationships(repositoryId: string, entityId: string, options?: RelationshipQueryOptions): Promise<PaginatedResult<StoredRelationship>>;
|
|
@@ -79,4 +103,4 @@ interface StorageProvider {
|
|
|
79
103
|
importBulk(repositoryId: string, data: ImportChunk[], options?: BulkImportOptions): Promise<BulkImportResult>;
|
|
80
104
|
}
|
|
81
105
|
|
|
82
|
-
export type { EnsureSchemaResult as E, StorageProvider as S };
|
|
106
|
+
export type { EnsureSchemaResult as E, StorageProvider as S, EntityReadOptions as a };
|