@utaba/deep-memory 0.1.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.
@@ -0,0 +1,121 @@
1
+ import { v as ProvenanceContext, C as CreateEntityInput, x as Entity, U as UpdateEntityInput, r as CreateRelationshipInput, H as Relationship, V as VocabularyChangeRecord } from '../portability-DdlNYXGX.js';
2
+ export { B as BulkImportResult, W as ConceptSearchOptions, D as DetailLevel, a7 as EnrichedRelationship, z as EntityBrief, a8 as EntityMap, y as EntitySummary, s as EntityTypeDefinition, a9 as EntityTypeInput, N as ExploreOptions, a0 as ExportArchive, E as ExportChunk, aa as ExportManifest, a3 as ExportStreamItem, F as FindEntitiesQuery, ab as GetEntitiesOptions, ac as GetEntityOptions, G as GovernanceConfig, ad as GovernanceMode, L as GraphResult, I as ImportChunk, a1 as ImportOptions, a2 as ImportResult, a4 as ImportStreamHeader, ae as ImportWarning, M as MemoryVocabulary, O as Neighbourhood, af as NeighbourhoodCentre, ag as NeighbourhoodGroup, ah as NeighbourhoodLayer, P as PaginatedResult, e as PaginationOptions, ai as Path, Q as PathOptions, T as PathResult, J as PropertyFilter, aj as PropertySchema, ak as PropertyType, w as Provenance, al as ProvenanceFilter, A as ReembedResult, am as RelationshipDirection, j as RelationshipQueryOptions, K as RelationshipSummary, an as RelationshipTypeDefinition, ao as RelationshipTypeInput, _ as RepositoryConfig, R as RepositoryFilter, ap as RepositoryMetadata, d as RepositoryStats, $ as RepositorySummary, c as RepositoryUpdate, q as ResolvedVocabulary, X as ScoredEntity, a6 as SearchHit, a5 as SearchOptions, k as StorageExploreOptions, h as StorageFindQuery, l as StorageNeighbourhood, aq as StorageNeighbourhoodGroup, ar as StorageNeighbourhoodLayer, as as StoragePath, m as StoragePathOptions, n as StoragePathResult, S as StorageRepositoryConfig, at as StorageTimelineEvent, o as StorageTimelineOptions, p as StorageTimelineResult, f as StoredEntity, g as StoredEntityUpdate, i as StoredRelationship, a as StoredRepository, b as StoredRepositorySummary, au as TimelineEntityRef, av as TimelineEvent, Y as TimelineOptions, aw as TimelineRelationshipDetail, Z as TimelineResult, ax as VocabularyInput, t as VocabularyProposal, u as VocabularyProposalResult } from '../portability-DdlNYXGX.js';
3
+
4
+ /** All event types emitted by the Deep Memory engine */
5
+ 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:completed' | 'reembed:failed' | 'export:started' | 'export:progress' | 'export:completed' | 'import:started' | 'import:progress' | 'import:completed' | 'import:failed';
6
+ /** Type-safe event payload mapping */
7
+ type EventPayload<T extends DeepMemoryEventType> = T extends 'repository:created' ? {
8
+ repositoryId: string;
9
+ label: string;
10
+ } : T extends 'repository:opened' ? {
11
+ repositoryId: string;
12
+ } : T extends 'repository:updated' ? {
13
+ repositoryId: string;
14
+ } : T extends 'repository:deleted' ? {
15
+ repositoryId: string;
16
+ } : T extends 'entity:creating' ? {
17
+ input: CreateEntityInput;
18
+ } : T extends 'entity:created' ? {
19
+ entity: Entity;
20
+ } : T extends 'entity:updating' ? {
21
+ id: string;
22
+ updates: UpdateEntityInput;
23
+ } : T extends 'entity:updated' ? {
24
+ entity: Entity;
25
+ } : T extends 'entity:deleting' ? {
26
+ id: string;
27
+ } : T extends 'entity:deleted' ? {
28
+ id: string;
29
+ } : T extends 'relationship:creating' ? {
30
+ input: CreateRelationshipInput;
31
+ } : T extends 'relationship:created' ? {
32
+ relationship: Relationship;
33
+ } : T extends 'relationship:removing' ? {
34
+ id: string;
35
+ } : T extends 'relationship:removed' ? {
36
+ id: string;
37
+ } : T extends 'vocabulary:proposal' ? {
38
+ proposal: VocabularyChangeRecord;
39
+ } : T extends 'vocabulary:approved' ? {
40
+ change: VocabularyChangeRecord;
41
+ } : T extends 'vocabulary:rejected' ? {
42
+ reason: string;
43
+ duplicates?: Array<{
44
+ type: string;
45
+ similarity: number;
46
+ }>;
47
+ } : T extends 'vocabulary:pending' ? {
48
+ proposalId: string;
49
+ } : T extends 'vocabulary:changed' ? {
50
+ previousVersion: string;
51
+ newVersion: string;
52
+ change: VocabularyChangeRecord;
53
+ } : T extends 'validation:failed' ? {
54
+ operation: string;
55
+ error: string;
56
+ suggestions?: string[];
57
+ } : T extends 'search:executed' ? {
58
+ query: string;
59
+ resultCount: number;
60
+ } : T extends 'reembed:started' ? {
61
+ repositoryId: string;
62
+ totalEntities: number;
63
+ } : T extends 'reembed:progress' ? {
64
+ repositoryId: string;
65
+ processed: number;
66
+ totalEntities: number;
67
+ failed: number;
68
+ } : T extends 'reembed:completed' ? {
69
+ repositoryId: string;
70
+ processed: number;
71
+ failed: number;
72
+ modelId: string;
73
+ } : T extends 'reembed:failed' ? {
74
+ repositoryId: string;
75
+ error: string;
76
+ } : T extends 'export:started' ? {
77
+ repositoryId: string;
78
+ } : T extends 'export:progress' ? {
79
+ repositoryId: string;
80
+ entitiesExported: number;
81
+ totalEntities: number;
82
+ } : T extends 'export:completed' ? {
83
+ repositoryId: string;
84
+ entityCount: number;
85
+ relationshipCount: number;
86
+ } : T extends 'import:started' ? {
87
+ repositoryId: string;
88
+ } : T extends 'import:progress' ? {
89
+ repositoryId: string;
90
+ entitiesImported: number;
91
+ totalEntities: number;
92
+ } : T extends 'import:completed' ? {
93
+ repositoryId: string;
94
+ entitiesImported: number;
95
+ relationshipsImported: number;
96
+ } : T extends 'import:failed' ? {
97
+ repositoryId: string;
98
+ error: string;
99
+ } : Record<string, unknown>;
100
+ /** A typed event emitted by the engine */
101
+ interface DeepMemoryEvent<T extends DeepMemoryEventType> {
102
+ type: T;
103
+ timestamp: string;
104
+ repositoryId?: string;
105
+ provenance: ProvenanceContext;
106
+ payload: EventPayload<T>;
107
+ }
108
+ /** Event handler function */
109
+ type EventHandler<T extends DeepMemoryEventType> = (event: DeepMemoryEvent<T>) => void | Promise<void>;
110
+ /** Unsubscribe function returned by on() */
111
+ type Unsubscribe = () => void;
112
+ /**
113
+ * Result from a pre-mutation hook handler.
114
+ * Return `{ cancel: true, reason }` to abort the operation.
115
+ */
116
+ interface HookResult {
117
+ cancel?: boolean;
118
+ reason?: string;
119
+ }
120
+
121
+ export { CreateEntityInput, CreateRelationshipInput, type DeepMemoryEvent, type DeepMemoryEventType, Entity, type EventHandler, type EventPayload, type HookResult, ProvenanceContext, Relationship, type Unsubscribe, UpdateEntityInput, VocabularyChangeRecord };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@utaba/deep-memory",
3
+ "version": "0.1.0",
4
+ "description": "Vocabulary-driven graph memory for AI agents",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "./providers": {
21
+ "import": {
22
+ "types": "./dist/providers/index.d.ts",
23
+ "default": "./dist/providers/index.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/providers/index.d.cts",
27
+ "default": "./dist/providers/index.cjs"
28
+ }
29
+ },
30
+ "./types": {
31
+ "import": {
32
+ "types": "./dist/types/index.d.ts",
33
+ "default": "./dist/types/index.js"
34
+ },
35
+ "require": {
36
+ "types": "./dist/types/index.d.cts",
37
+ "default": "./dist/types/index.cjs"
38
+ }
39
+ },
40
+ "./testing": {
41
+ "import": {
42
+ "types": "./dist/testing/conformance.d.ts",
43
+ "default": "./dist/testing/conformance.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/testing/conformance.d.cts",
47
+ "default": "./dist/testing/conformance.cjs"
48
+ }
49
+ }
50
+ },
51
+ "files": [
52
+ "dist",
53
+ "LICENSE",
54
+ "README.md"
55
+ ],
56
+ "engines": {
57
+ "node": ">=18"
58
+ },
59
+ "license": "Apache-2.0",
60
+ "homepage": "https://utaba.ai",
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "https://github.com/TjWheeler/deep-memory.git",
64
+ "directory": "packages/core"
65
+ },
66
+ "bugs": {
67
+ "url": "https://github.com/TjWheeler/deep-memory/issues"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public",
71
+ "registry": "https://registry.npmjs.org/"
72
+ },
73
+ "keywords": [
74
+ "ai",
75
+ "memory",
76
+ "graph",
77
+ "knowledge-graph",
78
+ "mcp",
79
+ "agents",
80
+ "vocabulary"
81
+ ],
82
+ "devDependencies": {
83
+ "@types/node": "^25.5.0",
84
+ "tsup": "^8.5.1",
85
+ "typescript": "^6.0.2",
86
+ "vitest": "^4.1.2"
87
+ },
88
+ "scripts": {
89
+ "build": "tsup",
90
+ "dev": "tsup --watch",
91
+ "test": "vitest run",
92
+ "test:watch": "vitest",
93
+ "test:coverage": "vitest run --coverage",
94
+ "typecheck": "tsc --noEmit"
95
+ }
96
+ }