@utaba/deep-memory 0.6.1 → 0.8.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.
@@ -34,6 +34,8 @@ interface PropertySchema {
34
34
  /** Valid values when type === "enum" */
35
35
  enumValues?: string[];
36
36
  defaultValue?: unknown;
37
+ /** When true, this property's value is appended to the entity's embedding text. Only valid for string properties. Omitted when false or not applicable — never serialized as false. */
38
+ embeddable?: true;
37
39
  }
38
40
  /** Definition of an entity type within a vocabulary */
39
41
  interface EntityTypeDefinition {
@@ -255,12 +257,24 @@ interface CreateEntityInput {
255
257
  }
256
258
  /** Input for updating an existing entity */
257
259
  interface UpdateEntityInput {
260
+ /**
261
+ * Change the entity's type. Must exist in the vocabulary. The slug is
262
+ * regenerated with the new type prefix, and any provided `properties` are
263
+ * validated against the new type's schema.
264
+ */
265
+ entityType?: string;
258
266
  label?: string;
259
- summary?: string;
260
- /** Merged with existing properties */
267
+ /** `undefined` preserves the existing value; `null` clears it. */
268
+ summary?: string | null;
269
+ /**
270
+ * Merged with existing properties. A property value of `null` deletes that
271
+ * key from the entity's properties (RFC 7396 JSON Merge Patch semantics).
272
+ */
261
273
  properties?: Record<string, unknown>;
262
- data?: string;
263
- dataFormat?: string;
274
+ /** `undefined` preserves the existing value; `null` clears it. */
275
+ data?: string | null;
276
+ /** `undefined` preserves the existing value; `null` clears it. */
277
+ dataFormat?: string | null;
264
278
  /** Force regeneration of the embedding vector (e.g. after switching embedding models) */
265
279
  reembed?: boolean;
266
280
  }
@@ -275,17 +289,26 @@ interface StoredEntity {
275
289
  data?: string;
276
290
  dataFormat?: string;
277
291
  provenance: Provenance;
278
- /** Vector embedding of the entity (label + summary + properties) */
292
+ /** Vector embedding of the entity (label + summary + embeddable string properties) */
279
293
  embedding?: number[];
280
294
  }
281
- /** Internal update representation for the storage provider */
295
+ /**
296
+ * Internal update representation for the storage provider.
297
+ *
298
+ * For optional string fields (`summary`, `data`, `dataFormat`), the tri-state
299
+ * applies: `undefined` preserves the existing value, `null` clears it, and a
300
+ * string sets the new value. For `properties`, storage receives the fully
301
+ * merged map that the caller wants persisted — key deletions are already
302
+ * applied upstream, so storage can replace the stored map wholesale.
303
+ */
282
304
  interface StoredEntityUpdate {
305
+ entityType?: string;
283
306
  label?: string;
284
307
  slug?: string;
285
- summary?: string;
308
+ summary?: string | null;
286
309
  properties?: Record<string, unknown>;
287
- data?: string;
288
- dataFormat?: string;
310
+ data?: string | null;
311
+ dataFormat?: string | null;
289
312
  provenance: Provenance;
290
313
  embedding?: number[];
291
314
  }
@@ -298,6 +321,14 @@ interface GetEntitiesOptions {
298
321
  /** Only "brief" or "summary" for batch retrieval */
299
322
  detailLevel?: 'brief' | 'summary';
300
323
  }
324
+ /** Result of a bulk entity deletion */
325
+ interface DeleteEntitiesResult {
326
+ deleted: string[];
327
+ failed: Array<{
328
+ id: string;
329
+ error: string;
330
+ }>;
331
+ }
301
332
 
302
333
  /** Pagination options used across all paginated queries */
303
334
  interface PaginationOptions {
@@ -496,6 +527,14 @@ interface RelationshipSummary {
496
527
  outbound: Record<string, number>;
497
528
  inbound: Record<string, number>;
498
529
  }
530
+ /** Result of a bulk relationship removal */
531
+ interface RemoveRelationshipsResult {
532
+ removed: string[];
533
+ failed: Array<{
534
+ id: string;
535
+ error: string;
536
+ }>;
537
+ }
499
538
  /** Options for querying relationships of an entity */
500
539
  interface RelationshipQueryOptions {
501
540
  /** Filter by relationship type(s) */
@@ -617,6 +656,18 @@ interface StorageRepositoryConfig {
617
656
  createdBy: string;
618
657
  }
619
658
 
659
+ /** A single validation error with optional suggestion */
660
+ interface ValidationError {
661
+ field: string;
662
+ message: string;
663
+ suggestion?: string;
664
+ }
665
+ /** Result of a validation check */
666
+ interface ValidationResult {
667
+ valid: boolean;
668
+ errors: ValidationError[];
669
+ }
670
+
620
671
  /** Paginated result wrapper */
621
672
  interface PaginatedResult<T> {
622
673
  items: T[];
@@ -782,6 +833,68 @@ interface ReembedResult {
782
833
  modelId: string;
783
834
  dimensions: number;
784
835
  }
836
+ /** A single entity that failed vocabulary validation */
837
+ interface EntityValidationIssue {
838
+ entityId: string;
839
+ slug: string;
840
+ entityType: string;
841
+ label: string;
842
+ errors: ValidationError[];
843
+ }
844
+ /** A single relationship that failed vocabulary validation */
845
+ interface RelationshipValidationIssue {
846
+ relationshipId: string;
847
+ relationshipType: string;
848
+ sourceEntityId: string;
849
+ targetEntityId: string;
850
+ /** Label of the source entity if it exists (aids human/AI diagnosis) */
851
+ sourceLabel?: string;
852
+ /** Label of the target entity if it exists */
853
+ targetLabel?: string;
854
+ /** Type of the source entity if it exists (for context on type-mismatch errors) */
855
+ sourceEntityType?: string;
856
+ /** Type of the target entity if it exists */
857
+ targetEntityType?: string;
858
+ errors: ValidationError[];
859
+ }
860
+ /** One page of entity validation results from RepositoryValidator.validateEntities() */
861
+ interface EntityValidationPage {
862
+ issues: EntityValidationIssue[];
863
+ /** Number of entities inspected in this call (for diagnostics; not bounded by take) */
864
+ scanned: number;
865
+ /** Issue-offset to pass on the next call; equal to the input offset + issues.length */
866
+ nextOffset: number;
867
+ /** True when the export stream ended before take was hit (no further issues beyond this page) */
868
+ done: boolean;
869
+ }
870
+ /** One page of relationship validation results from RepositoryValidator.validateRelationships() */
871
+ interface RelationshipValidationPage {
872
+ issues: RelationshipValidationIssue[];
873
+ /** Number of relationships inspected in this call (for diagnostics; not bounded by take) */
874
+ scanned: number;
875
+ /** Issue-offset to pass on the next call; equal to the input offset + issues.length */
876
+ nextOffset: number;
877
+ /** True when the export stream ended before take was hit (no further issues beyond this page) */
878
+ done: boolean;
879
+ /** Number of entities loaded into the resolution map (for diagnostics) */
880
+ entitiesInMap: number;
881
+ }
882
+ interface ValidateEntitiesOptions {
883
+ /** Number of issues to skip before returning (not entities); default 0 */
884
+ offset?: number;
885
+ /** Maximum number of issues to return in this call; default 200 */
886
+ take?: number;
887
+ /** Milliseconds to pause between export chunks (for manual rate limiting); default 0 */
888
+ delayBetweenChunksMs?: number;
889
+ }
890
+ interface ValidateRelationshipsOptions {
891
+ /** Number of issues to skip before returning (not relationships); default 0 */
892
+ offset?: number;
893
+ /** Maximum number of issues to return in this call; default 200 */
894
+ take?: number;
895
+ /** Milliseconds to pause between export chunks (for manual rate limiting); default 0 */
896
+ delayBetweenChunksMs?: number;
897
+ }
785
898
 
786
899
  /** Manifest describing an exported repository archive */
787
900
  interface ExportManifest {
@@ -955,4 +1068,4 @@ interface ImportResult {
955
1068
  warnings: ImportWarning[];
956
1069
  }
957
1070
 
958
- export type { TimelineResult as $, VocabularyProposal as A, BulkImportOptions as B, CreateEntityInput as C, DetailLevel as D, Entity as E, VocabularyProposalResult as F, GovernanceConfig as G, ProvenanceContext as H, ImportChunk as I, Provenance as J, FindEntitiesQuery as K, ReembedResult as L, MemoryVocabulary as M, Relationship as N, GraphResult as O, PropertyFilter as P, ExploreOptions as Q, RelationshipSummary as R, StorageRepositoryConfig as S, Neighborhood as T, UpdateEntityInput as U, VocabularyChangeRecord as V, PathOptions as W, PathResult as X, ConceptSearchOptions as Y, ScoredEntity as Z, TimelineOptions as _, EntitySummary as a, RepositoryConfig as a0, RepositorySummary as a1, ExportOptions as a2, ExportArchive as a3, ImportOptions as a4, ImportResult as a5, ExportStreamItem as a6, ImportStreamHeader as a7, SearchOptions as a8, SearchHit as a9, TimelineEvent as aA, TimelineRelationshipDetail as aB, VocabularyInput as aC, EnrichedRelationship as aa, EntityMap as ab, EntityTypeInput as ac, ExportLegalMetadata as ad, ExportManifest as ae, ExportPipelineMetadata as af, GetEntitiesOptions as ag, GetEntityOptions as ah, GovernanceMode as ai, ImportWarning as aj, NeighborhoodCenter as ak, NeighborhoodGroup as al, NeighborhoodLayer as am, Path as an, PropertySchema as ao, PropertyType as ap, ProvenanceFilter as aq, RelationshipDirection as ar, RelationshipTypeDefinition as as, RelationshipTypeInput as at, RepositoryMetadata as au, StorageNeighborhoodGroup as av, StorageNeighborhoodLayer as aw, StoragePath as ax, StorageTimelineEvent as ay, TimelineEntityRef as az, EntityBrief as b, StoredRepository as c, RepositoryFilter as d, PaginatedResult as e, StoredRepositorySummary as f, RepositoryUpdate as g, DeleteProgressCallback as h, RepositoryStats as i, PaginationOptions as j, StoredEntity as k, StoredEntityUpdate as l, StorageFindQuery as m, StoredRelationship as n, RelationshipQueryOptions as o, StorageExploreOptions as p, StorageNeighborhood as q, StoragePathOptions as r, StoragePathResult as s, StorageTimelineOptions as t, StorageTimelineResult as u, ExportChunk as v, BulkImportResult as w, ResolvedVocabulary as x, CreateRelationshipInput as y, EntityTypeDefinition as z };
1071
+ export type { ConceptSearchOptions as $, EntityTypeDefinition as A, BulkImportOptions as B, CreateEntityInput as C, DetailLevel as D, Entity as E, VocabularyProposal as F, GovernanceConfig as G, VocabularyProposalResult as H, ImportChunk as I, ProvenanceContext as J, Provenance as K, FindEntitiesQuery as L, MemoryVocabulary as M, DeleteEntitiesResult as N, ReembedResult as O, PropertyFilter as P, Relationship as Q, RelationshipSummary as R, StorageRepositoryConfig as S, RemoveRelationshipsResult as T, UpdateEntityInput as U, VocabularyChangeRecord as V, GraphResult as W, ExploreOptions as X, Neighborhood as Y, PathOptions as Z, PathResult as _, EntitySummary as a, ScoredEntity as a0, TimelineOptions as a1, TimelineResult as a2, ValidateEntitiesOptions as a3, EntityValidationPage as a4, ValidateRelationshipsOptions as a5, RelationshipValidationPage as a6, RepositoryConfig as a7, RepositorySummary as a8, ExportOptions as a9, RelationshipTypeDefinition as aA, RelationshipTypeInput as aB, RelationshipValidationIssue as aC, RepositoryMetadata as aD, StorageNeighborhoodGroup as aE, StorageNeighborhoodLayer as aF, StoragePath as aG, StorageTimelineEvent as aH, TimelineEntityRef as aI, TimelineEvent as aJ, TimelineRelationshipDetail as aK, VocabularyInput as aL, ExportArchive as aa, ImportOptions as ab, ImportResult as ac, ExportStreamItem as ad, ImportStreamHeader as ae, SearchOptions as af, SearchHit as ag, EnrichedRelationship as ah, EntityMap as ai, EntityTypeInput as aj, EntityValidationIssue as ak, ExportLegalMetadata as al, ExportManifest as am, ExportPipelineMetadata as an, GetEntitiesOptions as ao, GetEntityOptions as ap, GovernanceMode as aq, ImportWarning as ar, NeighborhoodCenter as as, NeighborhoodGroup as at, NeighborhoodLayer as au, Path as av, PropertySchema as aw, PropertyType as ax, ProvenanceFilter as ay, RelationshipDirection as az, EntityBrief as b, StoredRepository as c, RepositoryFilter as d, PaginatedResult as e, StoredRepositorySummary as f, RepositoryUpdate as g, DeleteProgressCallback as h, RepositoryStats as i, PaginationOptions as j, StoredEntity as k, StoredEntityUpdate as l, StorageFindQuery as m, StoredRelationship as n, RelationshipQueryOptions as o, StorageExploreOptions as p, StorageNeighborhood as q, StoragePathOptions as r, StoragePathResult as s, StorageTimelineOptions as t, StorageTimelineResult as u, ExportChunk as v, BulkImportResult as w, ResolvedVocabulary as x, ValidationResult as y, CreateRelationshipInput as z };
@@ -34,6 +34,8 @@ interface PropertySchema {
34
34
  /** Valid values when type === "enum" */
35
35
  enumValues?: string[];
36
36
  defaultValue?: unknown;
37
+ /** When true, this property's value is appended to the entity's embedding text. Only valid for string properties. Omitted when false or not applicable — never serialized as false. */
38
+ embeddable?: true;
37
39
  }
38
40
  /** Definition of an entity type within a vocabulary */
39
41
  interface EntityTypeDefinition {
@@ -255,12 +257,24 @@ interface CreateEntityInput {
255
257
  }
256
258
  /** Input for updating an existing entity */
257
259
  interface UpdateEntityInput {
260
+ /**
261
+ * Change the entity's type. Must exist in the vocabulary. The slug is
262
+ * regenerated with the new type prefix, and any provided `properties` are
263
+ * validated against the new type's schema.
264
+ */
265
+ entityType?: string;
258
266
  label?: string;
259
- summary?: string;
260
- /** Merged with existing properties */
267
+ /** `undefined` preserves the existing value; `null` clears it. */
268
+ summary?: string | null;
269
+ /**
270
+ * Merged with existing properties. A property value of `null` deletes that
271
+ * key from the entity's properties (RFC 7396 JSON Merge Patch semantics).
272
+ */
261
273
  properties?: Record<string, unknown>;
262
- data?: string;
263
- dataFormat?: string;
274
+ /** `undefined` preserves the existing value; `null` clears it. */
275
+ data?: string | null;
276
+ /** `undefined` preserves the existing value; `null` clears it. */
277
+ dataFormat?: string | null;
264
278
  /** Force regeneration of the embedding vector (e.g. after switching embedding models) */
265
279
  reembed?: boolean;
266
280
  }
@@ -275,17 +289,26 @@ interface StoredEntity {
275
289
  data?: string;
276
290
  dataFormat?: string;
277
291
  provenance: Provenance;
278
- /** Vector embedding of the entity (label + summary + properties) */
292
+ /** Vector embedding of the entity (label + summary + embeddable string properties) */
279
293
  embedding?: number[];
280
294
  }
281
- /** Internal update representation for the storage provider */
295
+ /**
296
+ * Internal update representation for the storage provider.
297
+ *
298
+ * For optional string fields (`summary`, `data`, `dataFormat`), the tri-state
299
+ * applies: `undefined` preserves the existing value, `null` clears it, and a
300
+ * string sets the new value. For `properties`, storage receives the fully
301
+ * merged map that the caller wants persisted — key deletions are already
302
+ * applied upstream, so storage can replace the stored map wholesale.
303
+ */
282
304
  interface StoredEntityUpdate {
305
+ entityType?: string;
283
306
  label?: string;
284
307
  slug?: string;
285
- summary?: string;
308
+ summary?: string | null;
286
309
  properties?: Record<string, unknown>;
287
- data?: string;
288
- dataFormat?: string;
310
+ data?: string | null;
311
+ dataFormat?: string | null;
289
312
  provenance: Provenance;
290
313
  embedding?: number[];
291
314
  }
@@ -298,6 +321,14 @@ interface GetEntitiesOptions {
298
321
  /** Only "brief" or "summary" for batch retrieval */
299
322
  detailLevel?: 'brief' | 'summary';
300
323
  }
324
+ /** Result of a bulk entity deletion */
325
+ interface DeleteEntitiesResult {
326
+ deleted: string[];
327
+ failed: Array<{
328
+ id: string;
329
+ error: string;
330
+ }>;
331
+ }
301
332
 
302
333
  /** Pagination options used across all paginated queries */
303
334
  interface PaginationOptions {
@@ -496,6 +527,14 @@ interface RelationshipSummary {
496
527
  outbound: Record<string, number>;
497
528
  inbound: Record<string, number>;
498
529
  }
530
+ /** Result of a bulk relationship removal */
531
+ interface RemoveRelationshipsResult {
532
+ removed: string[];
533
+ failed: Array<{
534
+ id: string;
535
+ error: string;
536
+ }>;
537
+ }
499
538
  /** Options for querying relationships of an entity */
500
539
  interface RelationshipQueryOptions {
501
540
  /** Filter by relationship type(s) */
@@ -617,6 +656,18 @@ interface StorageRepositoryConfig {
617
656
  createdBy: string;
618
657
  }
619
658
 
659
+ /** A single validation error with optional suggestion */
660
+ interface ValidationError {
661
+ field: string;
662
+ message: string;
663
+ suggestion?: string;
664
+ }
665
+ /** Result of a validation check */
666
+ interface ValidationResult {
667
+ valid: boolean;
668
+ errors: ValidationError[];
669
+ }
670
+
620
671
  /** Paginated result wrapper */
621
672
  interface PaginatedResult<T> {
622
673
  items: T[];
@@ -782,6 +833,68 @@ interface ReembedResult {
782
833
  modelId: string;
783
834
  dimensions: number;
784
835
  }
836
+ /** A single entity that failed vocabulary validation */
837
+ interface EntityValidationIssue {
838
+ entityId: string;
839
+ slug: string;
840
+ entityType: string;
841
+ label: string;
842
+ errors: ValidationError[];
843
+ }
844
+ /** A single relationship that failed vocabulary validation */
845
+ interface RelationshipValidationIssue {
846
+ relationshipId: string;
847
+ relationshipType: string;
848
+ sourceEntityId: string;
849
+ targetEntityId: string;
850
+ /** Label of the source entity if it exists (aids human/AI diagnosis) */
851
+ sourceLabel?: string;
852
+ /** Label of the target entity if it exists */
853
+ targetLabel?: string;
854
+ /** Type of the source entity if it exists (for context on type-mismatch errors) */
855
+ sourceEntityType?: string;
856
+ /** Type of the target entity if it exists */
857
+ targetEntityType?: string;
858
+ errors: ValidationError[];
859
+ }
860
+ /** One page of entity validation results from RepositoryValidator.validateEntities() */
861
+ interface EntityValidationPage {
862
+ issues: EntityValidationIssue[];
863
+ /** Number of entities inspected in this call (for diagnostics; not bounded by take) */
864
+ scanned: number;
865
+ /** Issue-offset to pass on the next call; equal to the input offset + issues.length */
866
+ nextOffset: number;
867
+ /** True when the export stream ended before take was hit (no further issues beyond this page) */
868
+ done: boolean;
869
+ }
870
+ /** One page of relationship validation results from RepositoryValidator.validateRelationships() */
871
+ interface RelationshipValidationPage {
872
+ issues: RelationshipValidationIssue[];
873
+ /** Number of relationships inspected in this call (for diagnostics; not bounded by take) */
874
+ scanned: number;
875
+ /** Issue-offset to pass on the next call; equal to the input offset + issues.length */
876
+ nextOffset: number;
877
+ /** True when the export stream ended before take was hit (no further issues beyond this page) */
878
+ done: boolean;
879
+ /** Number of entities loaded into the resolution map (for diagnostics) */
880
+ entitiesInMap: number;
881
+ }
882
+ interface ValidateEntitiesOptions {
883
+ /** Number of issues to skip before returning (not entities); default 0 */
884
+ offset?: number;
885
+ /** Maximum number of issues to return in this call; default 200 */
886
+ take?: number;
887
+ /** Milliseconds to pause between export chunks (for manual rate limiting); default 0 */
888
+ delayBetweenChunksMs?: number;
889
+ }
890
+ interface ValidateRelationshipsOptions {
891
+ /** Number of issues to skip before returning (not relationships); default 0 */
892
+ offset?: number;
893
+ /** Maximum number of issues to return in this call; default 200 */
894
+ take?: number;
895
+ /** Milliseconds to pause between export chunks (for manual rate limiting); default 0 */
896
+ delayBetweenChunksMs?: number;
897
+ }
785
898
 
786
899
  /** Manifest describing an exported repository archive */
787
900
  interface ExportManifest {
@@ -955,4 +1068,4 @@ interface ImportResult {
955
1068
  warnings: ImportWarning[];
956
1069
  }
957
1070
 
958
- export type { TimelineResult as $, VocabularyProposal as A, BulkImportOptions as B, CreateEntityInput as C, DetailLevel as D, Entity as E, VocabularyProposalResult as F, GovernanceConfig as G, ProvenanceContext as H, ImportChunk as I, Provenance as J, FindEntitiesQuery as K, ReembedResult as L, MemoryVocabulary as M, Relationship as N, GraphResult as O, PropertyFilter as P, ExploreOptions as Q, RelationshipSummary as R, StorageRepositoryConfig as S, Neighborhood as T, UpdateEntityInput as U, VocabularyChangeRecord as V, PathOptions as W, PathResult as X, ConceptSearchOptions as Y, ScoredEntity as Z, TimelineOptions as _, EntitySummary as a, RepositoryConfig as a0, RepositorySummary as a1, ExportOptions as a2, ExportArchive as a3, ImportOptions as a4, ImportResult as a5, ExportStreamItem as a6, ImportStreamHeader as a7, SearchOptions as a8, SearchHit as a9, TimelineEvent as aA, TimelineRelationshipDetail as aB, VocabularyInput as aC, EnrichedRelationship as aa, EntityMap as ab, EntityTypeInput as ac, ExportLegalMetadata as ad, ExportManifest as ae, ExportPipelineMetadata as af, GetEntitiesOptions as ag, GetEntityOptions as ah, GovernanceMode as ai, ImportWarning as aj, NeighborhoodCenter as ak, NeighborhoodGroup as al, NeighborhoodLayer as am, Path as an, PropertySchema as ao, PropertyType as ap, ProvenanceFilter as aq, RelationshipDirection as ar, RelationshipTypeDefinition as as, RelationshipTypeInput as at, RepositoryMetadata as au, StorageNeighborhoodGroup as av, StorageNeighborhoodLayer as aw, StoragePath as ax, StorageTimelineEvent as ay, TimelineEntityRef as az, EntityBrief as b, StoredRepository as c, RepositoryFilter as d, PaginatedResult as e, StoredRepositorySummary as f, RepositoryUpdate as g, DeleteProgressCallback as h, RepositoryStats as i, PaginationOptions as j, StoredEntity as k, StoredEntityUpdate as l, StorageFindQuery as m, StoredRelationship as n, RelationshipQueryOptions as o, StorageExploreOptions as p, StorageNeighborhood as q, StoragePathOptions as r, StoragePathResult as s, StorageTimelineOptions as t, StorageTimelineResult as u, ExportChunk as v, BulkImportResult as w, ResolvedVocabulary as x, CreateRelationshipInput as y, EntityTypeDefinition as z };
1071
+ export type { ConceptSearchOptions as $, EntityTypeDefinition as A, BulkImportOptions as B, CreateEntityInput as C, DetailLevel as D, Entity as E, VocabularyProposal as F, GovernanceConfig as G, VocabularyProposalResult as H, ImportChunk as I, ProvenanceContext as J, Provenance as K, FindEntitiesQuery as L, MemoryVocabulary as M, DeleteEntitiesResult as N, ReembedResult as O, PropertyFilter as P, Relationship as Q, RelationshipSummary as R, StorageRepositoryConfig as S, RemoveRelationshipsResult as T, UpdateEntityInput as U, VocabularyChangeRecord as V, GraphResult as W, ExploreOptions as X, Neighborhood as Y, PathOptions as Z, PathResult as _, EntitySummary as a, ScoredEntity as a0, TimelineOptions as a1, TimelineResult as a2, ValidateEntitiesOptions as a3, EntityValidationPage as a4, ValidateRelationshipsOptions as a5, RelationshipValidationPage as a6, RepositoryConfig as a7, RepositorySummary as a8, ExportOptions as a9, RelationshipTypeDefinition as aA, RelationshipTypeInput as aB, RelationshipValidationIssue as aC, RepositoryMetadata as aD, StorageNeighborhoodGroup as aE, StorageNeighborhoodLayer as aF, StoragePath as aG, StorageTimelineEvent as aH, TimelineEntityRef as aI, TimelineEvent as aJ, TimelineRelationshipDetail as aK, VocabularyInput as aL, ExportArchive as aa, ImportOptions as ab, ImportResult as ac, ExportStreamItem as ad, ImportStreamHeader as ae, SearchOptions as af, SearchHit as ag, EnrichedRelationship as ah, EntityMap as ai, EntityTypeInput as aj, EntityValidationIssue as ak, ExportLegalMetadata as al, ExportManifest as am, ExportPipelineMetadata as an, GetEntitiesOptions as ao, GetEntityOptions as ap, GovernanceMode as aq, ImportWarning as ar, NeighborhoodCenter as as, NeighborhoodGroup as at, NeighborhoodLayer as au, Path as av, PropertySchema as aw, PropertyType as ax, ProvenanceFilter as ay, RelationshipDirection as az, EntityBrief as b, StoredRepository as c, RepositoryFilter as d, PaginatedResult as e, StoredRepositorySummary as f, RepositoryUpdate as g, DeleteProgressCallback as h, RepositoryStats as i, PaginationOptions as j, StoredEntity as k, StoredEntityUpdate as l, StorageFindQuery as m, StoredRelationship as n, RelationshipQueryOptions as o, StorageExploreOptions as p, StorageNeighborhood as q, StoragePathOptions as r, StoragePathResult as s, StorageTimelineOptions as t, StorageTimelineResult as u, ExportChunk as v, BulkImportResult as w, ResolvedVocabulary as x, ValidationResult as y, CreateRelationshipInput as z };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/providers/index.ts"],"sourcesContent":["// Provider interface re-exports — @utaba/deep-memory/providers\n\nexport type { StorageProvider, EnsureSchemaResult } from './StorageProvider.js';\nexport type { EmbeddingProvider } from './EmbeddingProvider.js';\nexport type {\n SearchProvider,\n SearchableEntity,\n} from './SearchProvider.js';\nexport type {\n LockProvider,\n LockOptions,\n LockHandle,\n} from './LockProvider.js';\nexport type {\n GraphTraversalProvider,\n GraphTraversalCapabilities,\n} from './GraphTraversalProvider.js';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/providers/index.ts"],"sourcesContent":["// Provider interface re-exports — @utaba/deep-memory/providers\n\nexport type { StorageProvider, EnsureSchemaResult } from './StorageProvider.js';\nexport type { EmbeddingProvider, EmbeddingProviderFactory } from './EmbeddingProvider.js';\nexport type {\n SearchProvider,\n SearchableEntity,\n} from './SearchProvider.js';\nexport type {\n LockProvider,\n LockOptions,\n LockHandle,\n} from './LockProvider.js';\nexport type {\n GraphTraversalProvider,\n GraphTraversalCapabilities,\n} from './GraphTraversalProvider.js';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,6 +1,6 @@
1
- export { E as EnsureSchemaResult, S as StorageProvider } from '../StorageProvider-CBhwqavV.cjs';
2
- import { a8 as SearchOptions, e as PaginatedResult, a9 as SearchHit } from '../portability-B-8J4nQQ.cjs';
3
- import { T as TraversalSpec, a as TraversalResult } from '../traversal-Llalk03r.cjs';
1
+ export { E as EnsureSchemaResult, S as StorageProvider } from '../StorageProvider-DmKddrEg.cjs';
2
+ import { af as SearchOptions, e as PaginatedResult, ag as SearchHit } from '../portability-dhIuWJbJ.cjs';
3
+ import { T as TraversalSpec, a as TraversalResult } from '../traversal-Bmv4we_g.cjs';
4
4
 
5
5
  /**
6
6
  * EmbeddingProvider — enables semantic search and vocabulary deduplication.
@@ -25,6 +25,19 @@ interface EmbeddingProvider {
25
25
  */
26
26
  similarity?(a: number[], b: number[]): number;
27
27
  }
28
+ /**
29
+ * Factory that produces an EmbeddingProvider configured for a specific model + dimensionality.
30
+ *
31
+ * DeepMemory calls this once per repository when the repo is opened or created,
32
+ * using the repo's stored embedding metadata. Infrastructure concerns (base URL,
33
+ * API key) are captured in the factory closure; model + dimensions come from the
34
+ * repository itself, so different repositories can use different embedding
35
+ * configurations without any global state.
36
+ */
37
+ type EmbeddingProviderFactory = (config: {
38
+ model: string;
39
+ dimensions: number;
40
+ }) => EmbeddingProvider;
28
41
 
29
42
  /** Entity data indexed for full-text search */
30
43
  interface SearchableEntity {
@@ -139,4 +152,4 @@ interface GraphTraversalCapabilities {
139
152
  supportsRelationshipSummary: boolean;
140
153
  }
141
154
 
142
- export type { EmbeddingProvider, GraphTraversalCapabilities, GraphTraversalProvider, LockHandle, LockOptions, LockProvider, SearchProvider, SearchableEntity };
155
+ export type { EmbeddingProvider, EmbeddingProviderFactory, GraphTraversalCapabilities, GraphTraversalProvider, LockHandle, LockOptions, LockProvider, SearchProvider, SearchableEntity };
@@ -1,6 +1,6 @@
1
- export { E as EnsureSchemaResult, S as StorageProvider } from '../StorageProvider-ynfpc5wz.js';
2
- import { a8 as SearchOptions, e as PaginatedResult, a9 as SearchHit } from '../portability-B-8J4nQQ.js';
3
- import { T as TraversalSpec, a as TraversalResult } from '../traversal-BdmDLMxV.js';
1
+ export { E as EnsureSchemaResult, S as StorageProvider } from '../StorageProvider-CRenWERy.js';
2
+ import { af as SearchOptions, e as PaginatedResult, ag as SearchHit } from '../portability-dhIuWJbJ.js';
3
+ import { T as TraversalSpec, a as TraversalResult } from '../traversal-D8SGKq0z.js';
4
4
 
5
5
  /**
6
6
  * EmbeddingProvider — enables semantic search and vocabulary deduplication.
@@ -25,6 +25,19 @@ interface EmbeddingProvider {
25
25
  */
26
26
  similarity?(a: number[], b: number[]): number;
27
27
  }
28
+ /**
29
+ * Factory that produces an EmbeddingProvider configured for a specific model + dimensionality.
30
+ *
31
+ * DeepMemory calls this once per repository when the repo is opened or created,
32
+ * using the repo's stored embedding metadata. Infrastructure concerns (base URL,
33
+ * API key) are captured in the factory closure; model + dimensions come from the
34
+ * repository itself, so different repositories can use different embedding
35
+ * configurations without any global state.
36
+ */
37
+ type EmbeddingProviderFactory = (config: {
38
+ model: string;
39
+ dimensions: number;
40
+ }) => EmbeddingProvider;
28
41
 
29
42
  /** Entity data indexed for full-text search */
30
43
  interface SearchableEntity {
@@ -139,4 +152,4 @@ interface GraphTraversalCapabilities {
139
152
  supportsRelationshipSummary: boolean;
140
153
  }
141
154
 
142
- export type { EmbeddingProvider, GraphTraversalCapabilities, GraphTraversalProvider, LockHandle, LockOptions, LockProvider, SearchProvider, SearchableEntity };
155
+ export type { EmbeddingProvider, EmbeddingProviderFactory, GraphTraversalCapabilities, GraphTraversalProvider, LockHandle, LockOptions, LockProvider, SearchProvider, SearchableEntity };
@@ -174,6 +174,42 @@ function runStorageProviderConformanceTests(factory) {
174
174
  const fetched = await provider.getEntity(repoId, "e1");
175
175
  (0, import_vitest.expect)(fetched.label).toBe("Updated Label");
176
176
  });
177
+ (0, import_vitest.it)("clears summary/data/dataFormat when null is passed", async () => {
178
+ const entity = {
179
+ ...makeEntity("e1"),
180
+ summary: "starting summary",
181
+ data: "raw content",
182
+ dataFormat: "text/plain"
183
+ };
184
+ await provider.createEntity(repoId, entity);
185
+ await provider.updateEntity(repoId, "e1", {
186
+ summary: null,
187
+ data: null,
188
+ dataFormat: null,
189
+ provenance: makeProvenance()
190
+ });
191
+ const fetched = await provider.getEntity(repoId, "e1");
192
+ (0, import_vitest.expect)(fetched.summary).toBeUndefined();
193
+ (0, import_vitest.expect)(fetched.data).toBeUndefined();
194
+ (0, import_vitest.expect)(fetched.dataFormat).toBeUndefined();
195
+ });
196
+ (0, import_vitest.it)("preserves summary/data/dataFormat when undefined is passed", async () => {
197
+ const entity = {
198
+ ...makeEntity("e1"),
199
+ summary: "keep me",
200
+ data: "keep me too",
201
+ dataFormat: "text/plain"
202
+ };
203
+ await provider.createEntity(repoId, entity);
204
+ await provider.updateEntity(repoId, "e1", {
205
+ label: "Renamed",
206
+ provenance: makeProvenance()
207
+ });
208
+ const fetched = await provider.getEntity(repoId, "e1");
209
+ (0, import_vitest.expect)(fetched.summary).toBe("keep me");
210
+ (0, import_vitest.expect)(fetched.data).toBe("keep me too");
211
+ (0, import_vitest.expect)(fetched.dataFormat).toBe("text/plain");
212
+ });
177
213
  (0, import_vitest.it)("deletes an entity", async () => {
178
214
  await provider.createEntity(repoId, makeEntity("e1"));
179
215
  await provider.deleteEntity(repoId, "e1");