@utaba/deep-memory 0.16.0 → 0.18.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-B2p_XThQ.d.ts} +32 -8
- package/dist/{StorageProvider-D_o2Hksf.d.ts → StorageProvider-CadKZ85j.d.cts} +32 -8
- package/dist/index.cjs +381 -120
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -14
- package/dist/index.d.ts +63 -14
- package/dist/index.js +376 -120
- package/dist/index.js.map +1 -1
- package/dist/{portability-P1hL-bOa.d.cts → portability-CAeyzSCx.d.cts} +30 -8
- package/dist/{portability-P1hL-bOa.d.ts → portability-CAeyzSCx.d.ts} +30 -8
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +4 -4
- package/dist/providers/index.d.ts +4 -4
- package/dist/testing/conformance.cjs +12 -2
- 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 +12 -2
- package/dist/testing/conformance.js.map +1 -1
- package/dist/{traversal-B_84kGaO.d.ts → traversal-Dql81Wh4.d.ts} +32 -6
- package/dist/{traversal-CBE5h5ob.d.cts → traversal-WLcdLN-Z.d.cts} +32 -6
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/package.json +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/providers-builtin/conformance.ts"],"sourcesContent":["// Provider Conformance Test Suite\n// Any StorageProvider implementer can import and run these tests to verify conformance.\n//\n// Usage:\n// import { runStorageProviderConformanceTests } from '@utaba/deep-memory';\n// runStorageProviderConformanceTests(() => new MyStorageProvider());\n\nimport { describe, it, expect, beforeEach } from 'vitest';\nimport type { StorageProvider } from '../providers/StorageProvider.js';\nimport type { StoredEntity } from '../types/entities.js';\nimport type { StoredRelationship } from '../types/relationships.js';\nimport type { Provenance } from '../types/provenance.js';\n\nfunction makeProvenance(): Provenance {\n const now = new Date().toISOString();\n return {\n createdBy: 'conformance-test',\n createdByType: 'agent',\n createdAt: now,\n modifiedBy: 'conformance-test',\n modifiedByType: 'agent',\n modifiedAt: now,\n };\n}\n\nfunction makeEntity(id: string, type = 'test-type', label?: string): StoredEntity {\n return {\n id,\n slug: `${type}:${(label ?? id).toLowerCase().replace(/[^a-z0-9]+/g, '-')}`,\n entityType: type,\n label: label ?? id,\n summary: `Summary for ${id}`,\n properties: { key: 'value' },\n provenance: makeProvenance(),\n };\n}\n\nfunction makeRelationship(\n id: string,\n type: string,\n sourceId: string,\n targetId: string,\n bidirectional = false,\n): StoredRelationship {\n return {\n id,\n relationshipType: type,\n sourceEntityId: sourceId,\n targetEntityId: targetId,\n properties: {},\n bidirectional,\n provenance: makeProvenance(),\n };\n}\n\n/**\n * Run the full StorageProvider conformance test suite.\n *\n * @param factory - A function that creates a fresh, empty StorageProvider instance.\n * Called before each test to ensure isolation.\n */\nexport function runStorageProviderConformanceTests(\n factory: () => StorageProvider | Promise<StorageProvider>,\n): void {\n // Use a stable GUID so external cleanup scripts can target it\n const repoId = '40000000-0000-4000-a000-000000000001';\n\n let provider: StorageProvider;\n\n async function setup(): Promise<void> {\n provider = await factory();\n if (provider.initialize) await provider.initialize();\n\n await provider.createRepository({\n repositoryId: repoId,\n label: 'Conformance Test',\n governanceConfig: { mode: 'open' },\n createdAt: new Date().toISOString(),\n createdBy: 'conformance-test',\n });\n }\n\n describe('StorageProvider Conformance Tests', () => {\n beforeEach(async () => {\n await setup();\n });\n\n // ─── Repository ─────────────────────────────────────────\n\n describe('repository operations', () => {\n it('creates a repository', async () => {\n const repo = await provider.getRepository(repoId);\n expect(repo).not.toBeNull();\n expect(repo!.repositoryId).toBe(repoId);\n expect(repo!.label).toBe('Conformance Test');\n });\n\n it('returns null for non-existent repository', async () => {\n const repo = await provider.getRepository('ffffffff-ffff-4fff-afff-ffffffffffff');\n expect(repo).toBeNull();\n });\n\n it('lists repositories', async () => {\n const list = await provider.listRepositories();\n expect(list.items.length).toBeGreaterThanOrEqual(1);\n expect(list.items.some((r) => r.repositoryId === repoId)).toBe(true);\n });\n\n it('updates a repository', async () => {\n const updated = await provider.updateRepository(repoId, {\n label: 'Updated Label',\n description: 'Updated description',\n governanceConfig: { mode: 'open', defaultSimilarityThreshold: 0.4 },\n });\n expect(updated.label).toBe('Updated Label');\n expect(updated.description).toBe('Updated description');\n expect(updated.governanceConfig.defaultSimilarityThreshold).toBe(0.4);\n\n // Verify persistence\n const fetched = await provider.getRepository(repoId);\n expect(fetched!.label).toBe('Updated Label');\n expect(fetched!.governanceConfig.defaultSimilarityThreshold).toBe(0.4);\n });\n\n it('deletes a repository', async () => {\n await provider.deleteRepository(repoId);\n expect(await provider.getRepository(repoId)).toBeNull();\n });\n\n it('returns repository stats', async () => {\n const stats = await provider.getRepositoryStats(repoId);\n expect(stats.entityCount).toBe(0);\n expect(stats.relationshipCount).toBe(0);\n expect(typeof stats.vocabularyVersion).toBe('string');\n });\n });\n\n // ─── Vocabulary ─────────────────────────────────────────\n\n describe('vocabulary operations', () => {\n it('gets and saves vocabulary', async () => {\n const vocab = await provider.getVocabulary(repoId);\n expect(vocab).toBeDefined();\n expect(typeof vocab.version).toBe('string');\n\n const updated = { ...vocab, version: '1.0.0' };\n await provider.saveVocabulary(repoId, updated);\n\n const fetched = await provider.getVocabulary(repoId);\n expect(fetched.version).toBe('1.0.0');\n });\n\n it('returns vocabulary change log', async () => {\n const log = await provider.getVocabularyChangeLog(repoId);\n expect(Array.isArray(log.items)).toBe(true);\n });\n });\n\n // ─── Entities ───────────────────────────────────────────\n\n describe('entity operations', () => {\n it('creates and retrieves an entity', async () => {\n const entity = makeEntity('e1');\n await provider.createEntity(repoId, entity);\n\n const retrieved = await provider.getEntity(repoId, 'e1');\n expect(retrieved).not.toBeNull();\n expect(retrieved!.id).toBe('e1');\n expect(retrieved!.label).toBe('e1');\n });\n\n it('retrieves an entity by slug', async () => {\n const entity = makeEntity('e1', 'test-type', 'Alpha');\n await provider.createEntity(repoId, entity);\n\n const retrieved = await provider.getEntityBySlug(repoId, entity.slug);\n expect(retrieved).not.toBeNull();\n expect(retrieved!.id).toBe('e1');\n expect(retrieved!.slug).toBe(entity.slug);\n });\n\n it('returns null for non-existent entity', async () => {\n const result = await provider.getEntity(repoId, 'nonexistent');\n expect(result).toBeNull();\n });\n\n it('returns null for non-existent slug', async () => {\n const result = await provider.getEntityBySlug(repoId, 'nonexistent:slug');\n expect(result).toBeNull();\n });\n\n it('batch retrieves entities', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n await provider.createEntity(repoId, makeEntity('e2'));\n\n const map = await provider.getEntities(repoId, ['e1', 'e2', 'missing']);\n expect(map.size).toBe(2);\n expect(map.has('e1')).toBe(true);\n expect(map.has('e2')).toBe(true);\n expect(map.has('missing')).toBe(false);\n });\n\n it('updates an entity', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n const updated = await provider.updateEntity(repoId, 'e1', {\n label: 'Updated Label',\n provenance: makeProvenance(),\n });\n expect(updated.label).toBe('Updated Label');\n\n const fetched = await provider.getEntity(repoId, 'e1');\n expect(fetched!.label).toBe('Updated Label');\n });\n\n it('clears summary/data/dataFormat when null is passed', async () => {\n const entity: StoredEntity = {\n ...makeEntity('e1'),\n summary: 'starting summary',\n data: 'raw content',\n dataFormat: 'text/plain',\n };\n await provider.createEntity(repoId, entity);\n\n await provider.updateEntity(repoId, 'e1', {\n summary: null,\n data: null,\n dataFormat: null,\n provenance: makeProvenance(),\n });\n\n const fetched = await provider.getEntity(repoId, 'e1');\n expect(fetched!.summary).toBeUndefined();\n expect(fetched!.data).toBeUndefined();\n expect(fetched!.dataFormat).toBeUndefined();\n });\n\n it('preserves summary/data/dataFormat when undefined is passed', async () => {\n const entity: StoredEntity = {\n ...makeEntity('e1'),\n summary: 'keep me',\n data: 'keep me too',\n dataFormat: 'text/plain',\n };\n await provider.createEntity(repoId, entity);\n\n await provider.updateEntity(repoId, 'e1', {\n label: 'Renamed',\n provenance: makeProvenance(),\n });\n\n const fetched = await provider.getEntity(repoId, 'e1');\n expect(fetched!.summary).toBe('keep me');\n expect(fetched!.data).toBe('keep me too');\n expect(fetched!.dataFormat).toBe('text/plain');\n });\n\n it('deletes an entity', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n await provider.deleteEntity(repoId, 'e1');\n expect(await provider.getEntity(repoId, 'e1')).toBeNull();\n });\n\n it('finds entities by search term', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'test-type', 'Alpha'));\n await provider.createEntity(repoId, makeEntity('e2', 'test-type', 'Beta'));\n\n const result = await provider.findEntities(repoId, {\n searchTerm: 'alpha',\n limit: 10,\n offset: 0,\n });\n expect(result.items).toHaveLength(1);\n expect(result.items[0]!.label).toBe('Alpha');\n });\n\n it('finds entities by type filter', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'type-a', 'A'));\n await provider.createEntity(repoId, makeEntity('e2', 'type-b', 'B'));\n\n const result = await provider.findEntities(repoId, {\n entityTypes: ['type-a'],\n limit: 10,\n offset: 0,\n });\n expect(result.items).toHaveLength(1);\n expect(result.items[0]!.entityType).toBe('type-a');\n });\n\n it('paginates find results', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n await provider.createEntity(repoId, makeEntity('e2'));\n await provider.createEntity(repoId, makeEntity('e3'));\n\n const page1 = await provider.findEntities(repoId, { limit: 2, offset: 0 });\n expect(page1.items).toHaveLength(2);\n expect(page1.hasMore).toBe(true);\n\n const page2 = await provider.findEntities(repoId, { limit: 2, offset: 2 });\n expect(page2.items).toHaveLength(1);\n expect(page2.hasMore).toBe(false);\n });\n });\n\n // ─── Relationships ──────────────────────────────────────\n\n describe('relationship operations', () => {\n beforeEach(async () => {\n await provider.createEntity(repoId, makeEntity('a'));\n await provider.createEntity(repoId, makeEntity('b'));\n await provider.createEntity(repoId, makeEntity('c'));\n });\n\n it('creates and retrieves a relationship', async () => {\n const rel = makeRelationship('r1', 'connects', 'a', 'b');\n await provider.createRelationship(repoId, rel);\n\n const retrieved = await provider.getRelationship(repoId, 'r1');\n expect(retrieved).not.toBeNull();\n expect(retrieved!.sourceEntityId).toBe('a');\n expect(retrieved!.targetEntityId).toBe('b');\n });\n\n it('returns null for non-existent relationship', async () => {\n expect(await provider.getRelationship(repoId, 'nonexistent')).toBeNull();\n });\n\n it('gets entity relationships', async () => {\n await provider.createRelationship(repoId, makeRelationship('r1', 'connects', 'a', 'b'));\n await provider.createRelationship(repoId, makeRelationship('r2', 'connects', 'c', 'a'));\n\n const result = await provider.getEntityRelationships(repoId, 'a');\n expect(result.items).toHaveLength(2);\n });\n\n it('filters relationships by direction', async () => {\n await provider.createRelationship(repoId, makeRelationship('r1', 'connects', 'a', 'b'));\n await provider.createRelationship(repoId, makeRelationship('r2', 'connects', 'c', 'a'));\n\n const outbound = await provider.getEntityRelationships(repoId, 'a', { direction: 'outbound' });\n expect(outbound.items).toHaveLength(1);\n expect(outbound.items[0]!.targetEntityId).toBe('b');\n\n const inbound = await provider.getEntityRelationships(repoId, 'a', { direction: 'inbound' });\n expect(inbound.items).toHaveLength(1);\n expect(inbound.items[0]!.sourceEntityId).toBe('c');\n });\n\n it('deletes a relationship', async () => {\n await provider.createRelationship(repoId, makeRelationship('r1', 'connects', 'a', 'b'));\n await provider.deleteRelationship(repoId, 'r1');\n expect(await provider.getRelationship(repoId, 'r1')).toBeNull();\n });\n });\n\n // ─── Graph Traversal ────────────────────────────────────\n\n describe('graph traversal', () => {\n beforeEach(async () => {\n await provider.createEntity(repoId, makeEntity('a', 'node', 'A'));\n await provider.createEntity(repoId, makeEntity('b', 'node', 'B'));\n await provider.createEntity(repoId, makeEntity('c', 'node', 'C'));\n await provider.createRelationship(repoId, makeRelationship('r1', 'links', 'a', 'b'));\n await provider.createRelationship(repoId, makeRelationship('r2', 'links', 'b', 'c'));\n });\n\n it('explores neighborhood at depth 1', async () => {\n const result = await provider.exploreNeighborhood(repoId, 'a', {\n depth: 1,\n direction: 'both',\n limitPerType: 10,\n offsetPerType: 0,\n });\n expect(result.centerId).toBe('a');\n expect(result.layers).toHaveLength(1);\n });\n\n it('finds paths between connected entities', async () => {\n const result = await provider.findPaths(repoId, 'a', 'c', {\n maxDepth: 3,\n limit: 5,\n offset: 0,\n });\n expect(result.paths.length).toBeGreaterThanOrEqual(1);\n const firstPath = result.paths[0]!;\n expect(firstPath.entityIds[0]).toBe('a');\n expect(firstPath.entityIds[firstPath.entityIds.length - 1]).toBe('c');\n });\n\n it('returns empty paths when no connection', async () => {\n await provider.createEntity(repoId, makeEntity('isolated', 'node', 'Isolated'));\n const result = await provider.findPaths(repoId, 'a', 'isolated', {\n maxDepth: 3,\n limit: 5,\n offset: 0,\n });\n expect(result.paths).toHaveLength(0);\n });\n\n it('finds paths through non-bidirectional inbound edges', async () => {\n // Graph: a → b ← d (both edges are non-bidirectional)\n // Path from a to d should traverse: a →(outbound) b ←(inbound) d\n await provider.createEntity(repoId, makeEntity('d', 'node', 'D'));\n await provider.createRelationship(repoId, makeRelationship('r3', 'links', 'd', 'b'));\n const result = await provider.findPaths(repoId, 'a', 'd', {\n maxDepth: 3,\n limit: 5,\n offset: 0,\n });\n expect(result.paths.length).toBeGreaterThanOrEqual(1);\n const firstPath = result.paths[0]!;\n expect(firstPath.entityIds[0]).toBe('a');\n expect(firstPath.entityIds[firstPath.entityIds.length - 1]).toBe('d');\n });\n });\n\n // ─── Timeline ───────────────────────────────────────────\n\n describe('timeline', () => {\n it('returns timeline events', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n const result = await provider.getTimeline(repoId, 'e1', {\n limit: 10,\n offset: 0,\n });\n expect(result.events.length).toBeGreaterThanOrEqual(1);\n });\n });\n\n // ─── Bulk Operations ────────────────────────────────────\n\n describe('bulk operations', () => {\n it('exports data', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n\n const chunks = [];\n for await (const chunk of provider.exportAll(repoId)) {\n chunks.push(chunk);\n }\n expect(chunks.length).toBeGreaterThanOrEqual(1);\n });\n\n it('imports data', async () => {\n const result = await provider.importBulk(repoId, [\n { entities: [makeEntity('imported-1'), makeEntity('imported-2')] },\n { relationships: [makeRelationship('ir1', 'links', 'imported-1', 'imported-2')] },\n ]);\n expect(result.entitiesImported).toBe(2);\n expect(result.relationshipsImported).toBe(1);\n\n // Verify imported data is accessible\n const e = await provider.getEntity(repoId, 'imported-1');\n expect(e).not.toBeNull();\n });\n });\n\n // ─── Delete All Contents ───────────────────────────────\n\n describe('deleteAllContents', () => {\n it('deletes all entities and relationships but preserves the repository', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'alpha'));\n await provider.createEntity(repoId, makeEntity('e2', 'beta'));\n await provider.createRelationship(repoId, makeRelationship('r1', 'links', 'e1', 'e2'));\n\n const result = await provider.deleteAllContents(repoId);\n expect(result.deletedEntities).toBe(2);\n expect(result.deletedRelationships).toBe(1);\n\n // Repository still exists\n const repo = await provider.getRepository(repoId);\n expect(repo).not.toBeNull();\n\n // Vocabulary still exists\n const vocab = await provider.getVocabulary(repoId);\n expect(vocab).toBeDefined();\n\n // Contents are gone\n const stats = await provider.getRepositoryStats(repoId);\n expect(stats.entityCount).toBe(0);\n expect(stats.relationshipCount).toBe(0);\n });\n\n it('returns zero counts on an empty repository', async () => {\n const result = await provider.deleteAllContents(repoId);\n expect(result.deletedEntities).toBe(0);\n expect(result.deletedRelationships).toBe(0);\n });\n });\n\n // ─── Stats after data ───────────────────────────────────\n\n describe('stats reflect data', () => {\n it('counts entities and relationships', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'alpha'));\n await provider.createEntity(repoId, makeEntity('e2', 'alpha'));\n await provider.createEntity(repoId, makeEntity('e3', 'beta'));\n await provider.createRelationship(repoId, makeRelationship('r1', 'links', 'e1', 'e2'));\n\n const stats = await provider.getRepositoryStats(repoId);\n expect(stats.entityCount).toBe(3);\n expect(stats.relationshipCount).toBe(1);\n expect(stats.entityTypeBreakdown['alpha']).toBe(2);\n expect(stats.entityTypeBreakdown['beta']).toBe(1);\n expect(stats.relationshipTypeBreakdown['links']).toBe(1);\n });\n });\n });\n}\n"],"mappings":";AAOA,SAAS,UAAU,IAAI,QAAQ,kBAAkB;AAMjD,SAAS,iBAA6B;AACpC,QAAM,OAAM,oBAAI,KAAK,GAAE,YAAY;AACnC,SAAO;AAAA,IACL,WAAW;AAAA,IACX,eAAe;AAAA,IACf,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AACF;AAEA,SAAS,WAAW,IAAY,OAAO,aAAa,OAA8B;AAChF,SAAO;AAAA,IACL;AAAA,IACA,MAAM,GAAG,IAAI,KAAK,SAAS,IAAI,YAAY,EAAE,QAAQ,eAAe,GAAG,CAAC;AAAA,IACxE,YAAY;AAAA,IACZ,OAAO,SAAS;AAAA,IAChB,SAAS,eAAe,EAAE;AAAA,IAC1B,YAAY,EAAE,KAAK,QAAQ;AAAA,IAC3B,YAAY,eAAe;AAAA,EAC7B;AACF;AAEA,SAAS,iBACP,IACA,MACA,UACA,UACA,gBAAgB,OACI;AACpB,SAAO;AAAA,IACL;AAAA,IACA,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,YAAY,CAAC;AAAA,IACb;AAAA,IACA,YAAY,eAAe;AAAA,EAC7B;AACF;AAQO,SAAS,mCACd,SACM;AAEN,QAAM,SAAS;AAEf,MAAI;AAEJ,iBAAe,QAAuB;AACpC,eAAW,MAAM,QAAQ;AACzB,QAAI,SAAS,WAAY,OAAM,SAAS,WAAW;AAEnD,UAAM,SAAS,iBAAiB;AAAA,MAC9B,cAAc;AAAA,MACd,OAAO;AAAA,MACP,kBAAkB,EAAE,MAAM,OAAO;AAAA,MACjC,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MAClC,WAAW;AAAA,IACb,CAAC;AAAA,EACH;AAEA,WAAS,qCAA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S,cAAc,MAAM;AAChD,eAAO,IAAI,EAAE,IAAI,SAAS;AAG1B,cAAM,QAAQ,MAAM,SAAS,cAAc,MAAM;AACjD,eAAO,KAAK,EAAE,YAAY;AAG1B,cAAM,QAAQ,MAAM,SAAS,mBAAmB,MAAM;AACtD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC;AAChC,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC;AAAA,MACxC,CAAC;AAED,SAAG,8CAA8C,YAAY;AAC3D,cAAM,SAAS,MAAM,SAAS,kBAAkB,MAAM;AACtD,eAAO,OAAO,eAAe,EAAE,KAAK,CAAC;AACrC,eAAO,OAAO,oBAAoB,EAAE,KAAK,CAAC;AAAA,MAC5C,CAAC;AAAA,IACH,CAAC;AAID,aAAS,sBAAsB,MAAM;AACnC,SAAG,qCAAqC,YAAY;AAClD,cAAM,SAAS,aAAa,QAAQ,WAAW,MAAM,OAAO,CAAC;AAC7D,cAAM,SAAS,aAAa,QAAQ,WAAW,MAAM,OAAO,CAAC;AAC7D,cAAM,SAAS,aAAa,QAAQ,WAAW,MAAM,MAAM,CAAC;AAC5D,cAAM,SAAS,mBAAmB,QAAQ,iBAAiB,MAAM,SAAS,MAAM,IAAI,CAAC;AAErF,cAAM,QAAQ,MAAM,SAAS,mBAAmB,MAAM;AACtD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC;AAChC,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC;AACtC,eAAO,MAAM,oBAAoB,OAAO,CAAC,EAAE,KAAK,CAAC;AACjD,eAAO,MAAM,oBAAoB,MAAM,CAAC,EAAE,KAAK,CAAC;AAChD,eAAO,MAAM,0BAA0B,OAAO,CAAC,EAAE,KAAK,CAAC;AAAA,MACzD,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/providers-builtin/conformance.ts"],"sourcesContent":["// Provider Conformance Test Suite\n// Any StorageProvider implementer can import and run these tests to verify conformance.\n//\n// Usage:\n// import { runStorageProviderConformanceTests } from '@utaba/deep-memory';\n// runStorageProviderConformanceTests(() => new MyStorageProvider());\n\nimport { describe, it, expect, beforeEach } from 'vitest';\nimport type { StorageProvider } from '../providers/StorageProvider.js';\nimport type { StoredEntity } from '../types/entities.js';\nimport type { StoredRelationship } from '../types/relationships.js';\nimport type { Provenance } from '../types/provenance.js';\n\nfunction makeProvenance(): Provenance {\n const now = new Date().toISOString();\n return {\n createdBy: 'conformance-test',\n createdByType: 'agent',\n createdAt: now,\n modifiedBy: 'conformance-test',\n modifiedByType: 'agent',\n modifiedAt: now,\n };\n}\n\nfunction makeEntity(id: string, type = 'test-type', label?: string): StoredEntity {\n return {\n id,\n slug: `${type}:${(label ?? id).toLowerCase().replace(/[^a-z0-9]+/g, '-')}`,\n entityType: type,\n label: label ?? id,\n summary: `Summary for ${id}`,\n properties: { key: 'value' },\n provenance: makeProvenance(),\n };\n}\n\nfunction makeRelationship(\n id: string,\n type: string,\n sourceId: string,\n targetId: string,\n bidirectional = false,\n): StoredRelationship {\n return {\n id,\n relationshipType: type,\n sourceEntityId: sourceId,\n targetEntityId: targetId,\n properties: {},\n bidirectional,\n provenance: makeProvenance(),\n };\n}\n\n/**\n * Run the full StorageProvider conformance test suite.\n *\n * @param factory - A function that creates a fresh, empty StorageProvider instance.\n * Called before each test to ensure isolation.\n */\nexport function runStorageProviderConformanceTests(\n factory: () => StorageProvider | Promise<StorageProvider>,\n): void {\n // Use a stable GUID so external cleanup scripts can target it\n const repoId = '40000000-0000-4000-a000-000000000001';\n\n let provider: StorageProvider;\n\n async function setup(): Promise<void> {\n provider = await factory();\n if (provider.initialize) await provider.initialize();\n\n await provider.createRepository({\n repositoryId: repoId,\n label: 'Conformance Test',\n governanceConfig: { mode: 'open' },\n createdAt: new Date().toISOString(),\n createdBy: 'conformance-test',\n });\n }\n\n describe('StorageProvider Conformance Tests', () => {\n beforeEach(async () => {\n await setup();\n });\n\n // ─── Repository ─────────────────────────────────────────\n\n describe('repository operations', () => {\n it('creates a repository', async () => {\n const repo = await provider.getRepository(repoId);\n expect(repo).not.toBeNull();\n expect(repo!.repositoryId).toBe(repoId);\n expect(repo!.label).toBe('Conformance Test');\n });\n\n it('returns null for non-existent repository', async () => {\n const repo = await provider.getRepository('ffffffff-ffff-4fff-afff-ffffffffffff');\n expect(repo).toBeNull();\n });\n\n it('lists repositories', async () => {\n const list = await provider.listRepositories();\n expect(list.items.length).toBeGreaterThanOrEqual(1);\n expect(list.items.some((r) => r.repositoryId === repoId)).toBe(true);\n });\n\n it('updates a repository', async () => {\n const updated = await provider.updateRepository(repoId, {\n label: 'Updated Label',\n description: 'Updated description',\n governanceConfig: { mode: 'open', defaultSimilarityThreshold: 0.4 },\n });\n expect(updated.label).toBe('Updated Label');\n expect(updated.description).toBe('Updated description');\n expect(updated.governanceConfig.defaultSimilarityThreshold).toBe(0.4);\n\n // Verify persistence\n const fetched = await provider.getRepository(repoId);\n expect(fetched!.label).toBe('Updated Label');\n expect(fetched!.governanceConfig.defaultSimilarityThreshold).toBe(0.4);\n });\n\n it('deletes a repository', async () => {\n await provider.deleteRepository(repoId);\n expect(await provider.getRepository(repoId)).toBeNull();\n });\n\n it('returns repository stats', async () => {\n const stats = await provider.getRepositoryStats(repoId);\n expect(stats.entityCount).toBe(0);\n expect(stats.relationshipCount).toBe(0);\n expect(typeof stats.vocabularyVersion).toBe('string');\n });\n });\n\n // ─── Vocabulary ─────────────────────────────────────────\n\n describe('vocabulary operations', () => {\n it('gets and saves vocabulary', async () => {\n const vocab = await provider.getVocabulary(repoId);\n expect(vocab).toBeDefined();\n expect(typeof vocab.version).toBe('string');\n\n const updated = { ...vocab, version: '1.0.0' };\n await provider.saveVocabulary(repoId, updated);\n\n const fetched = await provider.getVocabulary(repoId);\n expect(fetched.version).toBe('1.0.0');\n });\n\n it('returns vocabulary change log', async () => {\n const log = await provider.getVocabularyChangeLog(repoId);\n expect(Array.isArray(log.items)).toBe(true);\n });\n });\n\n // ─── Entities ───────────────────────────────────────────\n\n describe('entity operations', () => {\n it('creates and retrieves an entity', async () => {\n const entity = makeEntity('e1');\n await provider.createEntity(repoId, entity);\n\n const retrieved = await provider.getEntity(repoId, 'e1');\n expect(retrieved).not.toBeNull();\n expect(retrieved!.id).toBe('e1');\n expect(retrieved!.label).toBe('e1');\n });\n\n it('retrieves an entity by slug', async () => {\n const entity = makeEntity('e1', 'test-type', 'Alpha');\n await provider.createEntity(repoId, entity);\n\n const retrieved = await provider.getEntityBySlug(repoId, entity.slug);\n expect(retrieved).not.toBeNull();\n expect(retrieved!.id).toBe('e1');\n expect(retrieved!.slug).toBe(entity.slug);\n });\n\n it('returns null for non-existent entity', async () => {\n const result = await provider.getEntity(repoId, 'nonexistent');\n expect(result).toBeNull();\n });\n\n it('returns null for non-existent slug', async () => {\n const result = await provider.getEntityBySlug(repoId, 'nonexistent:slug');\n expect(result).toBeNull();\n });\n\n it('batch retrieves entities', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n await provider.createEntity(repoId, makeEntity('e2'));\n\n const map = await provider.getEntities(repoId, ['e1', 'e2', 'missing']);\n expect(map.size).toBe(2);\n expect(map.has('e1')).toBe(true);\n expect(map.has('e2')).toBe(true);\n expect(map.has('missing')).toBe(false);\n });\n\n it('updates an entity', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n const updated = await provider.updateEntity(repoId, 'e1', {\n label: 'Updated Label',\n provenance: makeProvenance(),\n });\n expect(updated.label).toBe('Updated Label');\n\n const fetched = await provider.getEntity(repoId, 'e1');\n expect(fetched!.label).toBe('Updated Label');\n });\n\n it('clears summary/data/dataFormat when null is passed', async () => {\n const entity: StoredEntity = {\n ...makeEntity('e1'),\n summary: 'starting summary',\n data: 'raw content',\n dataFormat: 'text/plain',\n };\n await provider.createEntity(repoId, entity);\n\n await provider.updateEntity(repoId, 'e1', {\n summary: null,\n data: null,\n dataFormat: null,\n provenance: makeProvenance(),\n });\n\n const fetched = await provider.getEntity(repoId, 'e1');\n expect(fetched!.summary).toBeUndefined();\n expect(fetched!.data).toBeUndefined();\n expect(fetched!.dataFormat).toBeUndefined();\n });\n\n it('preserves summary/data/dataFormat when undefined is passed', async () => {\n const entity: StoredEntity = {\n ...makeEntity('e1'),\n summary: 'keep me',\n data: 'keep me too',\n dataFormat: 'text/plain',\n };\n await provider.createEntity(repoId, entity);\n\n await provider.updateEntity(repoId, 'e1', {\n label: 'Renamed',\n provenance: makeProvenance(),\n });\n\n const fetched = await provider.getEntity(repoId, 'e1');\n expect(fetched!.summary).toBe('keep me');\n expect(fetched!.data).toBe('keep me too');\n expect(fetched!.dataFormat).toBe('text/plain');\n });\n\n it('deletes an entity', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n await provider.deleteEntity(repoId, 'e1');\n expect(await provider.getEntity(repoId, 'e1')).toBeNull();\n });\n\n it('finds entities by search term', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'test-type', 'Alpha'));\n await provider.createEntity(repoId, makeEntity('e2', 'test-type', 'Beta'));\n\n const result = await provider.findEntities(repoId, {\n searchTerm: 'alpha',\n limit: 10,\n offset: 0,\n });\n expect(result.items).toHaveLength(1);\n expect(result.items[0]!.label).toBe('Alpha');\n });\n\n it('finds entities by search term case-insensitively', async () => {\n // Locks the invariant that searchTerm matching is case-insensitive on\n // every provider. In-memory lowercases both sides; SQL Server's LIKE\n // is case-insensitive under the default *_CI_AS collation; Cosmos\n // routes through CONTAINS(..., @term, true) on the Document endpoint.\n await provider.createEntity(repoId, makeEntity('e1', 'test-type', 'Alpha'));\n\n const result = await provider.findEntities(repoId, {\n searchTerm: 'ALPHA',\n limit: 10,\n offset: 0,\n });\n expect(result.items).toHaveLength(1);\n expect(result.items[0]!.label).toBe('Alpha');\n });\n\n it('finds entities by type filter', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'type-a', 'A'));\n await provider.createEntity(repoId, makeEntity('e2', 'type-b', 'B'));\n\n const result = await provider.findEntities(repoId, {\n entityTypes: ['type-a'],\n limit: 10,\n offset: 0,\n });\n expect(result.items).toHaveLength(1);\n expect(result.items[0]!.entityType).toBe('type-a');\n });\n\n it('paginates find results', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n await provider.createEntity(repoId, makeEntity('e2'));\n await provider.createEntity(repoId, makeEntity('e3'));\n\n const page1 = await provider.findEntities(repoId, { limit: 2, offset: 0 });\n expect(page1.items).toHaveLength(2);\n expect(page1.hasMore).toBe(true);\n\n const page2 = await provider.findEntities(repoId, { limit: 2, offset: 2 });\n expect(page2.items).toHaveLength(1);\n expect(page2.hasMore).toBe(false);\n });\n });\n\n // ─── Relationships ──────────────────────────────────────\n\n describe('relationship operations', () => {\n beforeEach(async () => {\n await provider.createEntity(repoId, makeEntity('a'));\n await provider.createEntity(repoId, makeEntity('b'));\n await provider.createEntity(repoId, makeEntity('c'));\n });\n\n it('creates and retrieves a relationship', async () => {\n const rel = makeRelationship('r1', 'connects', 'a', 'b');\n await provider.createRelationship(repoId, rel);\n\n const retrieved = await provider.getRelationship(repoId, 'r1');\n expect(retrieved).not.toBeNull();\n expect(retrieved!.sourceEntityId).toBe('a');\n expect(retrieved!.targetEntityId).toBe('b');\n });\n\n it('returns null for non-existent relationship', async () => {\n expect(await provider.getRelationship(repoId, 'nonexistent')).toBeNull();\n });\n\n it('gets entity relationships', async () => {\n await provider.createRelationship(repoId, makeRelationship('r1', 'connects', 'a', 'b'));\n await provider.createRelationship(repoId, makeRelationship('r2', 'connects', 'c', 'a'));\n\n const result = await provider.getEntityRelationships(repoId, 'a');\n expect(result.items).toHaveLength(2);\n });\n\n it('filters relationships by direction', async () => {\n await provider.createRelationship(repoId, makeRelationship('r1', 'connects', 'a', 'b'));\n await provider.createRelationship(repoId, makeRelationship('r2', 'connects', 'c', 'a'));\n\n const outbound = await provider.getEntityRelationships(repoId, 'a', { direction: 'out' });\n expect(outbound.items).toHaveLength(1);\n expect(outbound.items[0]!.targetEntityId).toBe('b');\n\n const inbound = await provider.getEntityRelationships(repoId, 'a', { direction: 'in' });\n expect(inbound.items).toHaveLength(1);\n expect(inbound.items[0]!.sourceEntityId).toBe('c');\n });\n\n it('deletes a relationship', async () => {\n await provider.createRelationship(repoId, makeRelationship('r1', 'connects', 'a', 'b'));\n await provider.deleteRelationship(repoId, 'r1');\n expect(await provider.getRelationship(repoId, 'r1')).toBeNull();\n });\n });\n\n // ─── Graph Traversal ────────────────────────────────────\n\n describe('graph traversal', () => {\n beforeEach(async () => {\n await provider.createEntity(repoId, makeEntity('a', 'node', 'A'));\n await provider.createEntity(repoId, makeEntity('b', 'node', 'B'));\n await provider.createEntity(repoId, makeEntity('c', 'node', 'C'));\n await provider.createRelationship(repoId, makeRelationship('r1', 'links', 'a', 'b'));\n await provider.createRelationship(repoId, makeRelationship('r2', 'links', 'b', 'c'));\n });\n\n it('explores neighborhood at depth 1', async () => {\n const result = await provider.exploreNeighborhood(repoId, 'a', {\n depth: 1,\n direction: 'both',\n limitPerType: 10,\n offsetPerType: 0,\n });\n expect(result.centerId).toBe('a');\n expect(result.layers).toHaveLength(1);\n });\n\n it('finds paths between connected entities', async () => {\n const result = await provider.findPaths(repoId, 'a', 'c', {\n maxDepth: 3,\n limit: 5,\n offset: 0,\n });\n expect(result.paths.length).toBeGreaterThanOrEqual(1);\n const firstPath = result.paths[0]!;\n expect(firstPath.entityIds[0]).toBe('a');\n expect(firstPath.entityIds[firstPath.entityIds.length - 1]).toBe('c');\n });\n\n it('returns empty paths when no connection', async () => {\n await provider.createEntity(repoId, makeEntity('isolated', 'node', 'Isolated'));\n const result = await provider.findPaths(repoId, 'a', 'isolated', {\n maxDepth: 3,\n limit: 5,\n offset: 0,\n });\n expect(result.paths).toHaveLength(0);\n });\n\n it('finds paths through non-bidirectional inbound edges', async () => {\n // Graph: a → b ← d (both edges are non-bidirectional)\n // Path from a to d should traverse: a →(outbound) b ←(inbound) d\n await provider.createEntity(repoId, makeEntity('d', 'node', 'D'));\n await provider.createRelationship(repoId, makeRelationship('r3', 'links', 'd', 'b'));\n const result = await provider.findPaths(repoId, 'a', 'd', {\n maxDepth: 3,\n limit: 5,\n offset: 0,\n });\n expect(result.paths.length).toBeGreaterThanOrEqual(1);\n const firstPath = result.paths[0]!;\n expect(firstPath.entityIds[0]).toBe('a');\n expect(firstPath.entityIds[firstPath.entityIds.length - 1]).toBe('d');\n });\n });\n\n // ─── Timeline ───────────────────────────────────────────\n\n describe('timeline', () => {\n it('returns timeline events', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n const result = await provider.getTimeline(repoId, 'e1', {\n limit: 10,\n offset: 0,\n });\n expect(result.events.length).toBeGreaterThanOrEqual(1);\n });\n });\n\n // ─── Bulk Operations ────────────────────────────────────\n\n describe('bulk operations', () => {\n it('exports data', async () => {\n await provider.createEntity(repoId, makeEntity('e1'));\n\n const chunks = [];\n for await (const chunk of provider.exportAll(repoId)) {\n chunks.push(chunk);\n }\n expect(chunks.length).toBeGreaterThanOrEqual(1);\n });\n\n it('imports data', async () => {\n const result = await provider.importBulk(repoId, [\n { entities: [makeEntity('imported-1'), makeEntity('imported-2')] },\n { relationships: [makeRelationship('ir1', 'links', 'imported-1', 'imported-2')] },\n ]);\n expect(result.entitiesImported).toBe(2);\n expect(result.relationshipsImported).toBe(1);\n\n // Verify imported data is accessible\n const e = await provider.getEntity(repoId, 'imported-1');\n expect(e).not.toBeNull();\n });\n });\n\n // ─── Delete All Contents ───────────────────────────────\n\n describe('deleteAllContents', () => {\n it('deletes all entities and relationships but preserves the repository', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'alpha'));\n await provider.createEntity(repoId, makeEntity('e2', 'beta'));\n await provider.createRelationship(repoId, makeRelationship('r1', 'links', 'e1', 'e2'));\n\n const result = await provider.deleteAllContents(repoId);\n expect(result.deletedEntities).toBe(2);\n expect(result.deletedRelationships).toBe(1);\n\n // Repository still exists\n const repo = await provider.getRepository(repoId);\n expect(repo).not.toBeNull();\n\n // Vocabulary still exists\n const vocab = await provider.getVocabulary(repoId);\n expect(vocab).toBeDefined();\n\n // Contents are gone\n const stats = await provider.getRepositoryStats(repoId);\n expect(stats.entityCount).toBe(0);\n expect(stats.relationshipCount).toBe(0);\n });\n\n it('returns zero counts on an empty repository', async () => {\n const result = await provider.deleteAllContents(repoId);\n expect(result.deletedEntities).toBe(0);\n expect(result.deletedRelationships).toBe(0);\n });\n });\n\n // ─── Stats after data ───────────────────────────────────\n\n describe('stats reflect data', () => {\n it('counts entities and relationships', async () => {\n await provider.createEntity(repoId, makeEntity('e1', 'alpha'));\n await provider.createEntity(repoId, makeEntity('e2', 'alpha'));\n await provider.createEntity(repoId, makeEntity('e3', 'beta'));\n await provider.createRelationship(repoId, makeRelationship('r1', 'links', 'e1', 'e2'));\n\n const stats = await provider.getRepositoryStats(repoId);\n expect(stats.entityCount).toBe(3);\n expect(stats.relationshipCount).toBe(1);\n expect(stats.entityTypeBreakdown['alpha']).toBe(2);\n expect(stats.entityTypeBreakdown['beta']).toBe(1);\n expect(stats.relationshipTypeBreakdown['links']).toBe(1);\n });\n });\n });\n}\n"],"mappings":";AAOA,SAAS,UAAU,IAAI,QAAQ,kBAAkB;AAMjD,SAAS,iBAA6B;AACpC,QAAM,OAAM,oBAAI,KAAK,GAAE,YAAY;AACnC,SAAO;AAAA,IACL,WAAW;AAAA,IACX,eAAe;AAAA,IACf,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AACF;AAEA,SAAS,WAAW,IAAY,OAAO,aAAa,OAA8B;AAChF,SAAO;AAAA,IACL;AAAA,IACA,MAAM,GAAG,IAAI,KAAK,SAAS,IAAI,YAAY,EAAE,QAAQ,eAAe,GAAG,CAAC;AAAA,IACxE,YAAY;AAAA,IACZ,OAAO,SAAS;AAAA,IAChB,SAAS,eAAe,EAAE;AAAA,IAC1B,YAAY,EAAE,KAAK,QAAQ;AAAA,IAC3B,YAAY,eAAe;AAAA,EAC7B;AACF;AAEA,SAAS,iBACP,IACA,MACA,UACA,UACA,g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ACrC,eAAO,OAAO,oBAAoB,EAAE,KAAK,CAAC;AAAA,MAC5C,CAAC;AAAA,IACH,CAAC;AAID,aAAS,sBAAsB,MAAM;AACnC,SAAG,qCAAqC,YAAY;AAClD,cAAM,SAAS,aAAa,QAAQ,WAAW,MAAM,OAAO,CAAC;AAC7D,cAAM,SAAS,aAAa,QAAQ,WAAW,MAAM,OAAO,CAAC;AAC7D,cAAM,SAAS,aAAa,QAAQ,WAAW,MAAM,MAAM,CAAC;AAC5D,cAAM,SAAS,mBAAmB,QAAQ,iBAAiB,MAAM,SAAS,MAAM,IAAI,CAAC;AAErF,cAAM,QAAQ,MAAM,SAAS,mBAAmB,MAAM;AACtD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC;AAChC,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC;AACtC,eAAO,MAAM,oBAAoB,OAAO,CAAC,EAAE,KAAK,CAAC;AACjD,eAAO,MAAM,oBAAoB,MAAM,CAAC,EAAE,KAAK,CAAC;AAChD,eAAO,MAAM,0BAA0B,OAAO,CAAC,EAAE,KAAK,CAAC;AAAA,MACzD,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as PropertyFilter, h as DetailLevel, i as Entity, l as EntitySummary, j as EntityBrief, a6 as RelationshipSummary } from './portability-CAeyzSCx.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* An entity as returned inside a TraversalResult — the projected entity plus
|
|
@@ -57,7 +57,7 @@ interface TraversalSpec {
|
|
|
57
57
|
/** Whether to deduplicate entities in the result set. Default: true. */
|
|
58
58
|
dedup?: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* Whether to include a relationship summary (
|
|
60
|
+
* Whether to include a relationship summary (out/in counts by type)
|
|
61
61
|
* on each entity in the result. Default: false.
|
|
62
62
|
*
|
|
63
63
|
* Native GraphTraversalProviders (Gremlin, Cypher) can return this in a single
|
|
@@ -118,7 +118,12 @@ interface TraversalStart {
|
|
|
118
118
|
* A single step in the traversal — one hop along a relationship edge.
|
|
119
119
|
*/
|
|
120
120
|
interface TraversalStep {
|
|
121
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Direction to traverse, relative to the entity at the start of the hop:
|
|
123
|
+
* - `'out'` — follow edges where the current entity is the source
|
|
124
|
+
* - `'in'` — follow edges where the current entity is the target
|
|
125
|
+
* - `'both'` — follow edges in either direction
|
|
126
|
+
*/
|
|
122
127
|
direction: 'out' | 'in' | 'both';
|
|
123
128
|
/**
|
|
124
129
|
* Relationship types to follow in this step.
|
|
@@ -190,7 +195,14 @@ interface TraversalResult {
|
|
|
190
195
|
* Each entry is a distinct value combination with an optional count.
|
|
191
196
|
*/
|
|
192
197
|
aggregations?: TraversalAggregation[];
|
|
193
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* Total number of results matching the traversal (before limit/offset).
|
|
200
|
+
*
|
|
201
|
+
* For `'all'` mode, the response is an interleaved union of entities AND
|
|
202
|
+
* relationships, and `total` counts both arrays' page-size combined
|
|
203
|
+
* (`entities.length + relationships.length`). Use `hasMore` to determine
|
|
204
|
+
* whether further pages exist.
|
|
205
|
+
*/
|
|
194
206
|
total: number;
|
|
195
207
|
/** Number of results returned in this response. */
|
|
196
208
|
returned: number;
|
|
@@ -211,7 +223,21 @@ interface TraversalRelationship {
|
|
|
211
223
|
type: string;
|
|
212
224
|
sourceEntityId: string;
|
|
213
225
|
targetEntityId: string;
|
|
214
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Walk direction at the last hop, with mode-specific semantics:
|
|
228
|
+
*
|
|
229
|
+
* - **`'path'` mode** — `'out'` when the walk crossed the edge from
|
|
230
|
+
* `sourceEntityId` to `targetEntityId`, `'in'` when it crossed in
|
|
231
|
+
* the opposite direction. Computed relative to the entity at the
|
|
232
|
+
* start of the hop within each `TraversalPath`.
|
|
233
|
+
* - **`'all'` mode** — always `'out'`. Reflects the stored edge
|
|
234
|
+
* topology (`sourceEntityId` → `targetEntityId`), not any particular
|
|
235
|
+
* walk; the deduped union has no walk context. Callers can derive
|
|
236
|
+
* walk-direction relative to any anchor using `sourceEntityId` /
|
|
237
|
+
* `targetEntityId`.
|
|
238
|
+
* - **`'terminal'` mode** — relationships are not returned.
|
|
239
|
+
*/
|
|
240
|
+
direction: 'out' | 'in';
|
|
215
241
|
properties: Record<string, unknown>;
|
|
216
242
|
}
|
|
217
243
|
interface TraversalPath {
|
|
@@ -261,4 +287,4 @@ interface QueryMetadata {
|
|
|
261
287
|
truncationReason?: 'result_limit' | 'timeout' | 'cost_limit' | 'depth_limit';
|
|
262
288
|
}
|
|
263
289
|
|
|
264
|
-
export type { QueryMetadata as Q,
|
|
290
|
+
export type { QueryMetadata as Q, TraversalAggregation as T, TraversalPath as a, TraversalProjection as b, TraversalRelationship as c, TraversalResult as d, TraversalReturnMode as e, TraversalSpec as f, TraversalStart as g, TraversalStep as h };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as PropertyFilter, h as DetailLevel, i as Entity, l as EntitySummary, j as EntityBrief, a6 as RelationshipSummary } from './portability-CAeyzSCx.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* An entity as returned inside a TraversalResult — the projected entity plus
|
|
@@ -57,7 +57,7 @@ interface TraversalSpec {
|
|
|
57
57
|
/** Whether to deduplicate entities in the result set. Default: true. */
|
|
58
58
|
dedup?: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* Whether to include a relationship summary (
|
|
60
|
+
* Whether to include a relationship summary (out/in counts by type)
|
|
61
61
|
* on each entity in the result. Default: false.
|
|
62
62
|
*
|
|
63
63
|
* Native GraphTraversalProviders (Gremlin, Cypher) can return this in a single
|
|
@@ -118,7 +118,12 @@ interface TraversalStart {
|
|
|
118
118
|
* A single step in the traversal — one hop along a relationship edge.
|
|
119
119
|
*/
|
|
120
120
|
interface TraversalStep {
|
|
121
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Direction to traverse, relative to the entity at the start of the hop:
|
|
123
|
+
* - `'out'` — follow edges where the current entity is the source
|
|
124
|
+
* - `'in'` — follow edges where the current entity is the target
|
|
125
|
+
* - `'both'` — follow edges in either direction
|
|
126
|
+
*/
|
|
122
127
|
direction: 'out' | 'in' | 'both';
|
|
123
128
|
/**
|
|
124
129
|
* Relationship types to follow in this step.
|
|
@@ -190,7 +195,14 @@ interface TraversalResult {
|
|
|
190
195
|
* Each entry is a distinct value combination with an optional count.
|
|
191
196
|
*/
|
|
192
197
|
aggregations?: TraversalAggregation[];
|
|
193
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* Total number of results matching the traversal (before limit/offset).
|
|
200
|
+
*
|
|
201
|
+
* For `'all'` mode, the response is an interleaved union of entities AND
|
|
202
|
+
* relationships, and `total` counts both arrays' page-size combined
|
|
203
|
+
* (`entities.length + relationships.length`). Use `hasMore` to determine
|
|
204
|
+
* whether further pages exist.
|
|
205
|
+
*/
|
|
194
206
|
total: number;
|
|
195
207
|
/** Number of results returned in this response. */
|
|
196
208
|
returned: number;
|
|
@@ -211,7 +223,21 @@ interface TraversalRelationship {
|
|
|
211
223
|
type: string;
|
|
212
224
|
sourceEntityId: string;
|
|
213
225
|
targetEntityId: string;
|
|
214
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Walk direction at the last hop, with mode-specific semantics:
|
|
228
|
+
*
|
|
229
|
+
* - **`'path'` mode** — `'out'` when the walk crossed the edge from
|
|
230
|
+
* `sourceEntityId` to `targetEntityId`, `'in'` when it crossed in
|
|
231
|
+
* the opposite direction. Computed relative to the entity at the
|
|
232
|
+
* start of the hop within each `TraversalPath`.
|
|
233
|
+
* - **`'all'` mode** — always `'out'`. Reflects the stored edge
|
|
234
|
+
* topology (`sourceEntityId` → `targetEntityId`), not any particular
|
|
235
|
+
* walk; the deduped union has no walk context. Callers can derive
|
|
236
|
+
* walk-direction relative to any anchor using `sourceEntityId` /
|
|
237
|
+
* `targetEntityId`.
|
|
238
|
+
* - **`'terminal'` mode** — relationships are not returned.
|
|
239
|
+
*/
|
|
240
|
+
direction: 'out' | 'in';
|
|
215
241
|
properties: Record<string, unknown>;
|
|
216
242
|
}
|
|
217
243
|
interface TraversalPath {
|
|
@@ -261,4 +287,4 @@ interface QueryMetadata {
|
|
|
261
287
|
truncationReason?: 'result_limit' | 'timeout' | 'cost_limit' | 'depth_limit';
|
|
262
288
|
}
|
|
263
289
|
|
|
264
|
-
export type { QueryMetadata as Q,
|
|
290
|
+
export type { QueryMetadata as Q, TraversalAggregation as T, TraversalPath as a, TraversalProjection as b, TraversalRelationship as c, TraversalResult as d, TraversalReturnMode as e, TraversalSpec as f, TraversalStart as g, TraversalStep as h };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { Q as QueryMetadata,
|
|
1
|
+
import { a0 as ProvenanceContext, e as CreateEntityInput, i as Entity, aI as UpdateEntityInput, f as CreateRelationshipInput, a3 as Relationship, aM as VocabularyChangeRecord } from '../portability-CAeyzSCx.cjs';
|
|
2
|
+
export { A as AdaptiveConcurrencyAdjustEvent, a as AdaptiveConcurrencyAdjustReason, b as AdaptiveConcurrencyHandle, c as AdaptiveConcurrencyOptions, B as BulkImportOptions, d as BulkImportResult, C as ConceptSearchOptions, D as DeleteEntitiesResult, g as DeleteProgressCallback, h as DetailLevel, E as EnrichedRelationship, j as EntityBrief, k as EntityMap, l as EntitySummary, m as EntityTypeDefinition, n as EntityTypeInput, o as EntityValidationIssue, p as EntityValidationPage, q as ExploreOptions, r as ExportArchive, s as ExportChunk, t as ExportLegalMetadata, u as ExportManifest, v as ExportOptions, w as ExportPipelineMetadata, x as ExportStreamItem, F as FindEntitiesQuery, G as GetEntitiesOptions, y as GetEntityOptions, z as GovernanceConfig, H as GovernanceMode, I as GraphResult, J as ImportChunk, K as ImportOptions, L as ImportResult, M as ImportStreamHeader, N as ImportWarning, O as MemoryVocabulary, P as Neighborhood, Q as NeighborhoodCenter, R as NeighborhoodGroup, S as NeighborhoodLayer, T as PaginatedResult, U as PaginationOptions, V as Path, W as PathOptions, X as PathResult, Y as PropertyFilter, Z as PropertySchema, _ as PropertyType, $ as Provenance, a1 as ProvenanceFilter, a2 as ReembedResult, a4 as RelationshipDirection, a5 as RelationshipQueryOptions, a6 as RelationshipSummary, a7 as RelationshipTypeDefinition, a8 as RelationshipTypeInput, a9 as RelationshipValidationIssue, aa as RelationshipValidationPage, ab as RemoveRelationshipsResult, ac as RepositoryConfig, ad as RepositoryFilter, ae as RepositoryMetadata, af as RepositoryStats, ag as RepositorySummary, ah as RepositoryUpdate, ai as ResolvedVocabulary, aj as ScoredEntity, ak as SearchHit, al as SearchOptions, am as StorageExploreOptions, an as StorageFindQuery, ao as StorageNeighborhood, ap as StorageNeighborhoodGroup, aq as StorageNeighborhoodLayer, ar as StoragePath, as as StoragePathOptions, at as StoragePathResult, au as StorageRepositoryConfig, av as StorageTimelineEvent, aw as StorageTimelineOptions, ax as StorageTimelineResult, ay as StoredEntity, az as StoredEntityUpdate, aA as StoredRelationship, aB as StoredRepository, aC as StoredRepositorySummary, aD as TimelineEntityRef, aE as TimelineEvent, aF as TimelineOptions, aG as TimelineRelationshipDetail, aH as TimelineResult, aJ as ValidateEntitiesOptions, aK as ValidateRelationshipsOptions, aN as VocabularyInput, aO as VocabularyProposal, aP as VocabularyProposalResult } from '../portability-CAeyzSCx.cjs';
|
|
3
|
+
export { Q as QueryMetadata, T as TraversalAggregation, a as TraversalPath, b as TraversalProjection, c as TraversalRelationship, d as TraversalResult, e as TraversalReturnMode, f as TraversalSpec, g as TraversalStart, h as TraversalStep } from '../traversal-WLcdLN-Z.cjs';
|
|
4
4
|
|
|
5
5
|
/** All event types emitted by the Deep Memory engine */
|
|
6
6
|
type DeepMemoryEventType = 'repository:created' | 'repository:opened' | 'repository:updated' | 'repository:deleted' | 'entity:creating' | 'entity:created' | 'entity:updating' | 'entity:updated' | 'entity:deleting' | 'entity:deleted' | 'relationship:creating' | 'relationship:created' | 'relationship:removing' | 'relationship:removed' | 'vocabulary:proposal' | 'vocabulary:approved' | 'vocabulary:rejected' | 'vocabulary:pending' | 'vocabulary:changed' | 'validation:failed' | 'search:executed' | 'reembed:started' | 'reembed:progress' | 'reembed:item-failed' | 'reembed:completed' | 'reembed:failed' | 'export:started' | 'export:progress' | 'export:completed' | 'import:started' | 'import:progress' | 'import:item-failed' | 'import:completed' | 'import:failed' | 'delete:started' | 'delete:progress' | 'delete:completed';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { Q as QueryMetadata,
|
|
1
|
+
import { a0 as ProvenanceContext, e as CreateEntityInput, i as Entity, aI as UpdateEntityInput, f as CreateRelationshipInput, a3 as Relationship, aM as VocabularyChangeRecord } from '../portability-CAeyzSCx.js';
|
|
2
|
+
export { A as AdaptiveConcurrencyAdjustEvent, a as AdaptiveConcurrencyAdjustReason, b as AdaptiveConcurrencyHandle, c as AdaptiveConcurrencyOptions, B as BulkImportOptions, d as BulkImportResult, C as ConceptSearchOptions, D as DeleteEntitiesResult, g as DeleteProgressCallback, h as DetailLevel, E as EnrichedRelationship, j as EntityBrief, k as EntityMap, l as EntitySummary, m as EntityTypeDefinition, n as EntityTypeInput, o as EntityValidationIssue, p as EntityValidationPage, q as ExploreOptions, r as ExportArchive, s as ExportChunk, t as ExportLegalMetadata, u as ExportManifest, v as ExportOptions, w as ExportPipelineMetadata, x as ExportStreamItem, F as FindEntitiesQuery, G as GetEntitiesOptions, y as GetEntityOptions, z as GovernanceConfig, H as GovernanceMode, I as GraphResult, J as ImportChunk, K as ImportOptions, L as ImportResult, M as ImportStreamHeader, N as ImportWarning, O as MemoryVocabulary, P as Neighborhood, Q as NeighborhoodCenter, R as NeighborhoodGroup, S as NeighborhoodLayer, T as PaginatedResult, U as PaginationOptions, V as Path, W as PathOptions, X as PathResult, Y as PropertyFilter, Z as PropertySchema, _ as PropertyType, $ as Provenance, a1 as ProvenanceFilter, a2 as ReembedResult, a4 as RelationshipDirection, a5 as RelationshipQueryOptions, a6 as RelationshipSummary, a7 as RelationshipTypeDefinition, a8 as RelationshipTypeInput, a9 as RelationshipValidationIssue, aa as RelationshipValidationPage, ab as RemoveRelationshipsResult, ac as RepositoryConfig, ad as RepositoryFilter, ae as RepositoryMetadata, af as RepositoryStats, ag as RepositorySummary, ah as RepositoryUpdate, ai as ResolvedVocabulary, aj as ScoredEntity, ak as SearchHit, al as SearchOptions, am as StorageExploreOptions, an as StorageFindQuery, ao as StorageNeighborhood, ap as StorageNeighborhoodGroup, aq as StorageNeighborhoodLayer, ar as StoragePath, as as StoragePathOptions, at as StoragePathResult, au as StorageRepositoryConfig, av as StorageTimelineEvent, aw as StorageTimelineOptions, ax as StorageTimelineResult, ay as StoredEntity, az as StoredEntityUpdate, aA as StoredRelationship, aB as StoredRepository, aC as StoredRepositorySummary, aD as TimelineEntityRef, aE as TimelineEvent, aF as TimelineOptions, aG as TimelineRelationshipDetail, aH as TimelineResult, aJ as ValidateEntitiesOptions, aK as ValidateRelationshipsOptions, aN as VocabularyInput, aO as VocabularyProposal, aP as VocabularyProposalResult } from '../portability-CAeyzSCx.js';
|
|
3
|
+
export { Q as QueryMetadata, T as TraversalAggregation, a as TraversalPath, b as TraversalProjection, c as TraversalRelationship, d as TraversalResult, e as TraversalReturnMode, f as TraversalSpec, g as TraversalStart, h as TraversalStep } from '../traversal-Dql81Wh4.js';
|
|
4
4
|
|
|
5
5
|
/** All event types emitted by the Deep Memory engine */
|
|
6
6
|
type DeepMemoryEventType = 'repository:created' | 'repository:opened' | 'repository:updated' | 'repository:deleted' | 'entity:creating' | 'entity:created' | 'entity:updating' | 'entity:updated' | 'entity:deleting' | 'entity:deleted' | 'relationship:creating' | 'relationship:created' | 'relationship:removing' | 'relationship:removed' | 'vocabulary:proposal' | 'vocabulary:approved' | 'vocabulary:rejected' | 'vocabulary:pending' | 'vocabulary:changed' | 'validation:failed' | 'search:executed' | 'reembed:started' | 'reembed:progress' | 'reembed:item-failed' | 'reembed:completed' | 'reembed:failed' | 'export:started' | 'export:progress' | 'export:completed' | 'import:started' | 'import:progress' | 'import:item-failed' | 'import:completed' | 'import:failed' | 'delete:started' | 'delete:progress' | 'delete:completed';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utaba/deep-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Vocabulary-driven graph memory for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -54,10 +54,9 @@
|
|
|
54
54
|
"README.md"
|
|
55
55
|
],
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": ">=
|
|
57
|
+
"node": ">=22"
|
|
58
58
|
},
|
|
59
59
|
"license": "Apache-2.0",
|
|
60
|
-
"homepage": "https://utaba.ai",
|
|
61
60
|
"repository": {
|
|
62
61
|
"type": "git",
|
|
63
62
|
"url": "https://github.com/TjWheeler/deep-memory.git",
|
|
@@ -80,7 +79,7 @@
|
|
|
80
79
|
"vocabulary"
|
|
81
80
|
],
|
|
82
81
|
"devDependencies": {
|
|
83
|
-
"@types/node": "^
|
|
82
|
+
"@types/node": "^22.0.0",
|
|
84
83
|
"tsup": "^8.5.1",
|
|
85
84
|
"typescript": "^6.0.2",
|
|
86
85
|
"vitest": "^4.1.2"
|