dpth 0.2.0 → 0.3.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/dist/dpth.d.ts +178 -0
- package/dist/dpth.d.ts.map +1 -0
- package/dist/dpth.js +557 -0
- package/dist/dpth.js.map +1 -0
- package/package.json +6 -2
package/dist/dpth.d.ts
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dpth.io — Unified Database API
|
|
3
|
+
*
|
|
4
|
+
* The main entry point. One line to get a persistent, intelligent database
|
|
5
|
+
* with entity resolution, temporal history, correlation detection, and
|
|
6
|
+
* optional vector search.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { dpth } from 'dpth/dpth';
|
|
10
|
+
* const db = await dpth('./myapp.db');
|
|
11
|
+
*
|
|
12
|
+
* // Entity resolution
|
|
13
|
+
* const john = db.entity.resolve('person', 'John Smith', 'stripe', 'cus_123');
|
|
14
|
+
* db.entity.resolve('person', 'jsmith', 'github', 'jsmith'); // auto-merged
|
|
15
|
+
*
|
|
16
|
+
* // Temporal history
|
|
17
|
+
* db.temporal.snapshot('dashboard', { revenue: 50000, users: 200 });
|
|
18
|
+
* db.temporal.history('dashboard'); // all snapshots over time
|
|
19
|
+
*
|
|
20
|
+
* // Correlation
|
|
21
|
+
* db.correlation.track('mrr', 50000);
|
|
22
|
+
* db.correlation.track('deploys', 12);
|
|
23
|
+
* db.correlation.find('mrr'); // what correlates with MRR?
|
|
24
|
+
*
|
|
25
|
+
* // Clean up
|
|
26
|
+
* await db.close();
|
|
27
|
+
*/
|
|
28
|
+
import type { StorageAdapter, VectorResult } from './storage.js';
|
|
29
|
+
import type { Entity, EntityId, EntityType, SourceId, Metric } from './types.js';
|
|
30
|
+
export interface DpthOptions {
|
|
31
|
+
/** Storage adapter (default: MemoryAdapter) */
|
|
32
|
+
adapter?: StorageAdapter;
|
|
33
|
+
/** Path to SQLite database (convenience — creates SQLiteAdapter) */
|
|
34
|
+
path?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ResolveResult {
|
|
37
|
+
entity: Entity;
|
|
38
|
+
isNew: boolean;
|
|
39
|
+
confidence: number;
|
|
40
|
+
}
|
|
41
|
+
export interface SnapshotRecord<T = Record<string, unknown>> {
|
|
42
|
+
id: string;
|
|
43
|
+
key: string;
|
|
44
|
+
timestamp: Date;
|
|
45
|
+
data: T;
|
|
46
|
+
source: string;
|
|
47
|
+
}
|
|
48
|
+
export interface DiffResult {
|
|
49
|
+
added: string[];
|
|
50
|
+
removed: string[];
|
|
51
|
+
changed: Array<{
|
|
52
|
+
key: string;
|
|
53
|
+
from: unknown;
|
|
54
|
+
to: unknown;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
export interface CorrelationHit {
|
|
58
|
+
metricId: string;
|
|
59
|
+
correlation: number;
|
|
60
|
+
lagDays: number;
|
|
61
|
+
direction: 'positive' | 'negative';
|
|
62
|
+
sampleSize: number;
|
|
63
|
+
}
|
|
64
|
+
export declare class Dpth {
|
|
65
|
+
private adapter;
|
|
66
|
+
private _ready;
|
|
67
|
+
/** Entity resolution and management */
|
|
68
|
+
entity: EntityAPI;
|
|
69
|
+
/** Temporal history and snapshots */
|
|
70
|
+
temporal: TemporalAPI;
|
|
71
|
+
/** Correlation detection across metrics */
|
|
72
|
+
correlation: CorrelationAPI;
|
|
73
|
+
/** Vector search (if adapter supports it) */
|
|
74
|
+
vector: VectorAPI;
|
|
75
|
+
constructor(options?: DpthOptions);
|
|
76
|
+
private init;
|
|
77
|
+
/** Wait for initialization to complete */
|
|
78
|
+
ready(): Promise<this>;
|
|
79
|
+
/** Close the database and flush any pending writes */
|
|
80
|
+
close(): Promise<void>;
|
|
81
|
+
/** Get database stats */
|
|
82
|
+
stats(): Promise<{
|
|
83
|
+
entities: number;
|
|
84
|
+
snapshots: number;
|
|
85
|
+
metrics: number;
|
|
86
|
+
vectors: number;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
89
|
+
declare class EntityAPI {
|
|
90
|
+
private adapter;
|
|
91
|
+
constructor(adapter: StorageAdapter);
|
|
92
|
+
/** Resolve an entity — find existing match or create new */
|
|
93
|
+
resolve(type: EntityType, name: string, sourceId: SourceId, externalId: string, options?: {
|
|
94
|
+
email?: string;
|
|
95
|
+
aliases?: string[];
|
|
96
|
+
attributes?: Record<string, unknown>;
|
|
97
|
+
minConfidence?: number;
|
|
98
|
+
}): Promise<ResolveResult>;
|
|
99
|
+
/** Get entity by ID */
|
|
100
|
+
get(id: EntityId): Promise<Entity | undefined>;
|
|
101
|
+
/** Find entity by source reference */
|
|
102
|
+
findBySource(sourceId: SourceId, externalId: string): Promise<Entity | undefined>;
|
|
103
|
+
/** Get all entities of a type */
|
|
104
|
+
list(type?: EntityType): Promise<Entity[]>;
|
|
105
|
+
/** Update an entity attribute (temporal) */
|
|
106
|
+
setAttribute(entityId: EntityId, key: string, value: unknown, sourceId: SourceId): Promise<Entity | undefined>;
|
|
107
|
+
/** Merge two entities */
|
|
108
|
+
merge(keepId: EntityId, mergeId: EntityId): Promise<Entity | undefined>;
|
|
109
|
+
/** Count entities */
|
|
110
|
+
count(type?: EntityType): Promise<number>;
|
|
111
|
+
private findBestMatch;
|
|
112
|
+
private fuzzyScore;
|
|
113
|
+
}
|
|
114
|
+
declare class TemporalAPI {
|
|
115
|
+
private adapter;
|
|
116
|
+
constructor(adapter: StorageAdapter);
|
|
117
|
+
/** Take a snapshot of any data */
|
|
118
|
+
snapshot<T = Record<string, unknown>>(key: string, data: T, source?: SourceId): Promise<SnapshotRecord<T>>;
|
|
119
|
+
/** Get all snapshots for a key (ordered by time) */
|
|
120
|
+
history<T = Record<string, unknown>>(key: string): Promise<SnapshotRecord<T>[]>;
|
|
121
|
+
/** Get the latest snapshot for a key */
|
|
122
|
+
latest<T = Record<string, unknown>>(key: string): Promise<SnapshotRecord<T> | undefined>;
|
|
123
|
+
/** Get snapshot closest to a specific time */
|
|
124
|
+
at<T = Record<string, unknown>>(key: string, time: Date): Promise<SnapshotRecord<T> | undefined>;
|
|
125
|
+
/** Diff two snapshots */
|
|
126
|
+
diff<T extends Record<string, unknown>>(older: SnapshotRecord<T>, newer: SnapshotRecord<T>): DiffResult;
|
|
127
|
+
}
|
|
128
|
+
declare class CorrelationAPI {
|
|
129
|
+
private adapter;
|
|
130
|
+
constructor(adapter: StorageAdapter);
|
|
131
|
+
/** Track a metric value */
|
|
132
|
+
track(metricId: string, value: number, options?: {
|
|
133
|
+
source?: SourceId;
|
|
134
|
+
entityId?: EntityId;
|
|
135
|
+
name?: string;
|
|
136
|
+
unit?: string;
|
|
137
|
+
}): Promise<void>;
|
|
138
|
+
/** Find correlations for a metric */
|
|
139
|
+
find(metricId: string, options?: {
|
|
140
|
+
minCorrelation?: number;
|
|
141
|
+
maxLagDays?: number;
|
|
142
|
+
}): Promise<CorrelationHit[]>;
|
|
143
|
+
/** Get a metric's history */
|
|
144
|
+
get(metricId: string): Promise<Metric | undefined>;
|
|
145
|
+
/** List all tracked metrics */
|
|
146
|
+
list(): Promise<Metric[]>;
|
|
147
|
+
private pearson;
|
|
148
|
+
}
|
|
149
|
+
declare class VectorAPI {
|
|
150
|
+
private adapter;
|
|
151
|
+
constructor(adapter: StorageAdapter);
|
|
152
|
+
private get vec();
|
|
153
|
+
/** Check if vector search is available */
|
|
154
|
+
get available(): boolean;
|
|
155
|
+
/** Store a vector */
|
|
156
|
+
store(collection: string, key: string, vector: number[], metadata?: Record<string, unknown>): Promise<void>;
|
|
157
|
+
/** Search by vector similarity */
|
|
158
|
+
search(collection: string, vector: number[], topK?: number, minScore?: number): Promise<VectorResult[]>;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Create a dpth database instance.
|
|
162
|
+
*
|
|
163
|
+
* @param pathOrOptions — SQLite path string, or options object
|
|
164
|
+
* @returns Initialized Dpth instance (call .ready() if you need to await init)
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* // In-memory (default)
|
|
168
|
+
* const db = dpth();
|
|
169
|
+
*
|
|
170
|
+
* // Persistent (SQLite)
|
|
171
|
+
* const db = await dpth('./myapp.db').ready();
|
|
172
|
+
*
|
|
173
|
+
* // Custom adapter
|
|
174
|
+
* const db = dpth({ adapter: new MemoryVectorAdapter() });
|
|
175
|
+
*/
|
|
176
|
+
export declare function dpth(pathOrOptions?: string | DpthOptions): Dpth;
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=dpth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpth.d.ts","sourceRoot":"","sources":["../src/dpth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAiB,YAAY,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,UAAU,EACV,QAAQ,EAER,MAAM,EAEP,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC;QA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AA+B;IACzB,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAM/B,OAAO,CAAC,OAAO;CAoChB;AAID,cAAM,SAAS;IACD,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAE3C,OAAO,KAAK,GAAG,GAEd;IAED,0CAA0C;IAC1C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,qBAAqB;IACf,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjH,kCAAkC;IAC5B,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,MAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAKlH;AAID;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAK/D"}
|
package/dist/dpth.js
ADDED
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dpth.io — Unified Database API
|
|
3
|
+
*
|
|
4
|
+
* The main entry point. One line to get a persistent, intelligent database
|
|
5
|
+
* with entity resolution, temporal history, correlation detection, and
|
|
6
|
+
* optional vector search.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { dpth } from 'dpth/dpth';
|
|
10
|
+
* const db = await dpth('./myapp.db');
|
|
11
|
+
*
|
|
12
|
+
* // Entity resolution
|
|
13
|
+
* const john = db.entity.resolve('person', 'John Smith', 'stripe', 'cus_123');
|
|
14
|
+
* db.entity.resolve('person', 'jsmith', 'github', 'jsmith'); // auto-merged
|
|
15
|
+
*
|
|
16
|
+
* // Temporal history
|
|
17
|
+
* db.temporal.snapshot('dashboard', { revenue: 50000, users: 200 });
|
|
18
|
+
* db.temporal.history('dashboard'); // all snapshots over time
|
|
19
|
+
*
|
|
20
|
+
* // Correlation
|
|
21
|
+
* db.correlation.track('mrr', 50000);
|
|
22
|
+
* db.correlation.track('deploys', 12);
|
|
23
|
+
* db.correlation.find('mrr'); // what correlates with MRR?
|
|
24
|
+
*
|
|
25
|
+
* // Clean up
|
|
26
|
+
* await db.close();
|
|
27
|
+
*/
|
|
28
|
+
import crypto from 'crypto';
|
|
29
|
+
import { MemoryAdapter } from './storage.js';
|
|
30
|
+
// ─── Dpth Class ──────────────────────────────────────
|
|
31
|
+
export class Dpth {
|
|
32
|
+
adapter;
|
|
33
|
+
_ready;
|
|
34
|
+
/** Entity resolution and management */
|
|
35
|
+
entity;
|
|
36
|
+
/** Temporal history and snapshots */
|
|
37
|
+
temporal;
|
|
38
|
+
/** Correlation detection across metrics */
|
|
39
|
+
correlation;
|
|
40
|
+
/** Vector search (if adapter supports it) */
|
|
41
|
+
vector;
|
|
42
|
+
constructor(options = {}) {
|
|
43
|
+
this.adapter = options.adapter || new MemoryAdapter();
|
|
44
|
+
this.entity = new EntityAPI(this.adapter);
|
|
45
|
+
this.temporal = new TemporalAPI(this.adapter);
|
|
46
|
+
this.correlation = new CorrelationAPI(this.adapter);
|
|
47
|
+
this.vector = new VectorAPI(this.adapter);
|
|
48
|
+
this._ready = this.init(options);
|
|
49
|
+
}
|
|
50
|
+
async init(options) {
|
|
51
|
+
// If path provided, dynamically load SQLite adapter
|
|
52
|
+
if (options.path) {
|
|
53
|
+
try {
|
|
54
|
+
const { SQLiteAdapter } = await import('./adapter-sqlite.js');
|
|
55
|
+
this.adapter = new SQLiteAdapter(options.path);
|
|
56
|
+
// Re-initialize APIs with the real adapter
|
|
57
|
+
this.entity = new EntityAPI(this.adapter);
|
|
58
|
+
this.temporal = new TemporalAPI(this.adapter);
|
|
59
|
+
this.correlation = new CorrelationAPI(this.adapter);
|
|
60
|
+
this.vector = new VectorAPI(this.adapter);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// SQLite not available, fall back to memory
|
|
64
|
+
console.warn('dpth: better-sqlite3 not installed, using in-memory storage');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Wait for initialization to complete */
|
|
69
|
+
async ready() {
|
|
70
|
+
await this._ready;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/** Close the database and flush any pending writes */
|
|
74
|
+
async close() {
|
|
75
|
+
await this._ready;
|
|
76
|
+
await this.adapter.close();
|
|
77
|
+
}
|
|
78
|
+
/** Get database stats */
|
|
79
|
+
async stats() {
|
|
80
|
+
await this._ready;
|
|
81
|
+
return {
|
|
82
|
+
entities: await this.adapter.count('entities'),
|
|
83
|
+
snapshots: await this.adapter.count('snapshots'),
|
|
84
|
+
metrics: await this.adapter.count('metrics'),
|
|
85
|
+
vectors: await this.adapter.count('vectors'),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// ─── Entity API ──────────────────────────────────────
|
|
90
|
+
class EntityAPI {
|
|
91
|
+
adapter;
|
|
92
|
+
constructor(adapter) {
|
|
93
|
+
this.adapter = adapter;
|
|
94
|
+
}
|
|
95
|
+
/** Resolve an entity — find existing match or create new */
|
|
96
|
+
async resolve(type, name, sourceId, externalId, options) {
|
|
97
|
+
const sKey = `${sourceId}:${externalId}`;
|
|
98
|
+
// Check source index first (exact source match)
|
|
99
|
+
const existingId = await this.adapter.get('source_index', sKey);
|
|
100
|
+
if (existingId) {
|
|
101
|
+
const entity = await this.adapter.get('entities', existingId);
|
|
102
|
+
if (entity) {
|
|
103
|
+
// Update last seen
|
|
104
|
+
const ref = entity.sources.find(s => s.sourceId === sourceId && s.externalId === externalId);
|
|
105
|
+
if (ref)
|
|
106
|
+
ref.lastSeen = new Date();
|
|
107
|
+
await this.adapter.put('entities', entity.id, entity);
|
|
108
|
+
return { entity, isNew: false, confidence: 1.0 };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Try fuzzy matching against existing entities
|
|
112
|
+
const minConfidence = options?.minConfidence ?? 0.7;
|
|
113
|
+
const match = await this.findBestMatch(type, name, options?.email, options?.aliases);
|
|
114
|
+
if (match && match.score >= minConfidence) {
|
|
115
|
+
const entity = match.entity;
|
|
116
|
+
// Merge: add source ref
|
|
117
|
+
entity.sources.push({
|
|
118
|
+
sourceId,
|
|
119
|
+
externalId,
|
|
120
|
+
confidence: match.score,
|
|
121
|
+
lastSeen: new Date(),
|
|
122
|
+
});
|
|
123
|
+
// Add alias
|
|
124
|
+
if (!entity.aliases.includes(name) && entity.name !== name) {
|
|
125
|
+
entity.aliases.push(name);
|
|
126
|
+
}
|
|
127
|
+
// Merge attributes
|
|
128
|
+
if (options?.attributes) {
|
|
129
|
+
const now = new Date();
|
|
130
|
+
for (const [key, value] of Object.entries(options.attributes)) {
|
|
131
|
+
const existing = entity.attributes[key];
|
|
132
|
+
if (existing) {
|
|
133
|
+
const current = existing.history.find(h => h.validTo === null);
|
|
134
|
+
if (current)
|
|
135
|
+
current.validTo = now;
|
|
136
|
+
existing.history.push({ value, validFrom: now, validTo: null, source: sourceId });
|
|
137
|
+
existing.current = value;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
entity.attributes[key] = {
|
|
141
|
+
current: value,
|
|
142
|
+
history: [{ value, validFrom: now, validTo: null, source: sourceId }],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
entity.updatedAt = new Date();
|
|
148
|
+
await this.adapter.put('entities', entity.id, entity);
|
|
149
|
+
await this.adapter.put('source_index', sKey, entity.id);
|
|
150
|
+
return { entity, isNew: false, confidence: match.score };
|
|
151
|
+
}
|
|
152
|
+
// Create new entity
|
|
153
|
+
const id = `ent_${crypto.randomBytes(12).toString('hex')}`;
|
|
154
|
+
const now = new Date();
|
|
155
|
+
const attributes = {};
|
|
156
|
+
if (options?.attributes) {
|
|
157
|
+
for (const [key, value] of Object.entries(options.attributes)) {
|
|
158
|
+
attributes[key] = {
|
|
159
|
+
current: value,
|
|
160
|
+
history: [{ value, validFrom: now, validTo: null, source: sourceId }],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (options?.email) {
|
|
165
|
+
attributes['email'] = {
|
|
166
|
+
current: options.email,
|
|
167
|
+
history: [{ value: options.email, validFrom: now, validTo: null, source: sourceId }],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const entity = {
|
|
171
|
+
id,
|
|
172
|
+
type,
|
|
173
|
+
name,
|
|
174
|
+
aliases: options?.aliases || [],
|
|
175
|
+
sources: [{ sourceId, externalId, confidence: 1.0, lastSeen: now }],
|
|
176
|
+
attributes,
|
|
177
|
+
createdAt: now,
|
|
178
|
+
updatedAt: now,
|
|
179
|
+
};
|
|
180
|
+
await this.adapter.put('entities', id, entity);
|
|
181
|
+
await this.adapter.put('source_index', sKey, id);
|
|
182
|
+
return { entity, isNew: true, confidence: 1.0 };
|
|
183
|
+
}
|
|
184
|
+
/** Get entity by ID */
|
|
185
|
+
async get(id) {
|
|
186
|
+
return await this.adapter.get('entities', id);
|
|
187
|
+
}
|
|
188
|
+
/** Find entity by source reference */
|
|
189
|
+
async findBySource(sourceId, externalId) {
|
|
190
|
+
const id = await this.adapter.get('source_index', `${sourceId}:${externalId}`);
|
|
191
|
+
return id ? await this.get(id) : undefined;
|
|
192
|
+
}
|
|
193
|
+
/** Get all entities of a type */
|
|
194
|
+
async list(type) {
|
|
195
|
+
const all = await this.adapter.query({
|
|
196
|
+
collection: 'entities',
|
|
197
|
+
...(type ? { where: { type } } : {}),
|
|
198
|
+
});
|
|
199
|
+
return all;
|
|
200
|
+
}
|
|
201
|
+
/** Update an entity attribute (temporal) */
|
|
202
|
+
async setAttribute(entityId, key, value, sourceId) {
|
|
203
|
+
const entity = await this.get(entityId);
|
|
204
|
+
if (!entity)
|
|
205
|
+
return undefined;
|
|
206
|
+
const now = new Date();
|
|
207
|
+
const existing = entity.attributes[key];
|
|
208
|
+
if (existing) {
|
|
209
|
+
const current = existing.history.find(h => h.validTo === null);
|
|
210
|
+
if (current)
|
|
211
|
+
current.validTo = now;
|
|
212
|
+
existing.history.push({ value, validFrom: now, validTo: null, source: sourceId });
|
|
213
|
+
existing.current = value;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
entity.attributes[key] = {
|
|
217
|
+
current: value,
|
|
218
|
+
history: [{ value, validFrom: now, validTo: null, source: sourceId }],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
entity.updatedAt = now;
|
|
222
|
+
await this.adapter.put('entities', entityId, entity);
|
|
223
|
+
return entity;
|
|
224
|
+
}
|
|
225
|
+
/** Merge two entities */
|
|
226
|
+
async merge(keepId, mergeId) {
|
|
227
|
+
const keep = await this.get(keepId);
|
|
228
|
+
const merge = await this.get(mergeId);
|
|
229
|
+
if (!keep || !merge)
|
|
230
|
+
return undefined;
|
|
231
|
+
// Merge sources
|
|
232
|
+
for (const source of merge.sources) {
|
|
233
|
+
if (!keep.sources.find(s => s.sourceId === source.sourceId && s.externalId === source.externalId)) {
|
|
234
|
+
keep.sources.push(source);
|
|
235
|
+
}
|
|
236
|
+
await this.adapter.put('source_index', `${source.sourceId}:${source.externalId}`, keepId);
|
|
237
|
+
}
|
|
238
|
+
// Merge aliases
|
|
239
|
+
for (const alias of [...merge.aliases, merge.name]) {
|
|
240
|
+
if (!keep.aliases.includes(alias) && keep.name !== alias) {
|
|
241
|
+
keep.aliases.push(alias);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// Merge attributes
|
|
245
|
+
for (const [key, value] of Object.entries(merge.attributes)) {
|
|
246
|
+
if (!keep.attributes[key]) {
|
|
247
|
+
keep.attributes[key] = value;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
keep.attributes[key].history.push(...value.history);
|
|
251
|
+
keep.attributes[key].history.sort((a, b) => new Date(a.validFrom).getTime() - new Date(b.validFrom).getTime());
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
keep.updatedAt = new Date();
|
|
255
|
+
await this.adapter.put('entities', keepId, keep);
|
|
256
|
+
await this.adapter.delete('entities', mergeId);
|
|
257
|
+
return keep;
|
|
258
|
+
}
|
|
259
|
+
/** Count entities */
|
|
260
|
+
async count(type) {
|
|
261
|
+
if (!type)
|
|
262
|
+
return this.adapter.count('entities');
|
|
263
|
+
const all = await this.list(type);
|
|
264
|
+
return all.length;
|
|
265
|
+
}
|
|
266
|
+
// ── Private matching ──
|
|
267
|
+
async findBestMatch(type, name, email, aliases) {
|
|
268
|
+
const candidates = await this.adapter.query({
|
|
269
|
+
collection: 'entities',
|
|
270
|
+
where: { type },
|
|
271
|
+
});
|
|
272
|
+
let best = null;
|
|
273
|
+
const searchTerms = [name.toLowerCase(), ...(aliases || []).map(a => a.toLowerCase())];
|
|
274
|
+
if (email)
|
|
275
|
+
searchTerms.push(email.toLowerCase());
|
|
276
|
+
for (const entity of candidates) {
|
|
277
|
+
let score = 0;
|
|
278
|
+
// Name matching
|
|
279
|
+
const entityName = entity.name.toLowerCase();
|
|
280
|
+
if (entityName === name.toLowerCase()) {
|
|
281
|
+
score += 0.8;
|
|
282
|
+
}
|
|
283
|
+
else if (this.fuzzyScore(entityName, name.toLowerCase()) > 0.85) {
|
|
284
|
+
score += 0.5;
|
|
285
|
+
}
|
|
286
|
+
else if (this.fuzzyScore(entityName, name.toLowerCase()) > 0.7) {
|
|
287
|
+
score += 0.3;
|
|
288
|
+
}
|
|
289
|
+
// Email matching
|
|
290
|
+
const entityEmail = entity.attributes['email']?.current;
|
|
291
|
+
if (email && entityEmail && entityEmail.toLowerCase() === email.toLowerCase()) {
|
|
292
|
+
score += 0.9;
|
|
293
|
+
}
|
|
294
|
+
// Alias matching
|
|
295
|
+
for (const alias of entity.aliases) {
|
|
296
|
+
if (searchTerms.includes(alias.toLowerCase())) {
|
|
297
|
+
score += 0.3;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
score = Math.min(1, score);
|
|
302
|
+
if (score > 0.3 && (!best || score > best.score)) {
|
|
303
|
+
best = { entity, score };
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return best;
|
|
307
|
+
}
|
|
308
|
+
fuzzyScore(a, b) {
|
|
309
|
+
if (a === b)
|
|
310
|
+
return 1;
|
|
311
|
+
if (!a.length || !b.length)
|
|
312
|
+
return 0;
|
|
313
|
+
const matrix = [];
|
|
314
|
+
for (let i = 0; i <= a.length; i++)
|
|
315
|
+
matrix[i] = [i];
|
|
316
|
+
for (let j = 0; j <= b.length; j++)
|
|
317
|
+
matrix[0][j] = j;
|
|
318
|
+
for (let i = 1; i <= a.length; i++) {
|
|
319
|
+
for (let j = 1; j <= b.length; j++) {
|
|
320
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
321
|
+
matrix[i][j] = Math.min(matrix[i - 1][j] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j - 1] + cost);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return 1 - matrix[a.length][b.length] / Math.max(a.length, b.length);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// ─── Temporal API ────────────────────────────────────
|
|
328
|
+
class TemporalAPI {
|
|
329
|
+
adapter;
|
|
330
|
+
constructor(adapter) {
|
|
331
|
+
this.adapter = adapter;
|
|
332
|
+
}
|
|
333
|
+
/** Take a snapshot of any data */
|
|
334
|
+
async snapshot(key, data, source = 'local') {
|
|
335
|
+
const record = {
|
|
336
|
+
id: `snap_${Date.now()}_${crypto.randomBytes(4).toString('hex')}`,
|
|
337
|
+
key,
|
|
338
|
+
timestamp: new Date(),
|
|
339
|
+
data,
|
|
340
|
+
source,
|
|
341
|
+
};
|
|
342
|
+
// Store snapshot
|
|
343
|
+
await this.adapter.put('snapshots', record.id, record);
|
|
344
|
+
// Maintain index: key → [snapshot_ids]
|
|
345
|
+
const index = await this.adapter.get('snapshot_index', key) || [];
|
|
346
|
+
index.push(record.id);
|
|
347
|
+
await this.adapter.put('snapshot_index', key, index);
|
|
348
|
+
return record;
|
|
349
|
+
}
|
|
350
|
+
/** Get all snapshots for a key (ordered by time) */
|
|
351
|
+
async history(key) {
|
|
352
|
+
const index = await this.adapter.get('snapshot_index', key) || [];
|
|
353
|
+
const records = [];
|
|
354
|
+
for (const id of index) {
|
|
355
|
+
const record = await this.adapter.get('snapshots', id);
|
|
356
|
+
if (record)
|
|
357
|
+
records.push(record);
|
|
358
|
+
}
|
|
359
|
+
return records.sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
360
|
+
}
|
|
361
|
+
/** Get the latest snapshot for a key */
|
|
362
|
+
async latest(key) {
|
|
363
|
+
const all = await this.history(key);
|
|
364
|
+
return all.length > 0 ? all[all.length - 1] : undefined;
|
|
365
|
+
}
|
|
366
|
+
/** Get snapshot closest to a specific time */
|
|
367
|
+
async at(key, time) {
|
|
368
|
+
const all = await this.history(key);
|
|
369
|
+
if (!all.length)
|
|
370
|
+
return undefined;
|
|
371
|
+
const targetMs = time.getTime();
|
|
372
|
+
let closest;
|
|
373
|
+
let minDiff = Infinity;
|
|
374
|
+
for (const snap of all) {
|
|
375
|
+
const diff = Math.abs(new Date(snap.timestamp).getTime() - targetMs);
|
|
376
|
+
if (diff < minDiff) {
|
|
377
|
+
minDiff = diff;
|
|
378
|
+
closest = snap;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return closest;
|
|
382
|
+
}
|
|
383
|
+
/** Diff two snapshots */
|
|
384
|
+
diff(older, newer) {
|
|
385
|
+
const olderKeys = new Set(Object.keys(older.data));
|
|
386
|
+
const newerKeys = new Set(Object.keys(newer.data));
|
|
387
|
+
const added = [];
|
|
388
|
+
const removed = [];
|
|
389
|
+
const changed = [];
|
|
390
|
+
for (const key of newerKeys) {
|
|
391
|
+
if (!olderKeys.has(key)) {
|
|
392
|
+
added.push(key);
|
|
393
|
+
}
|
|
394
|
+
else if (JSON.stringify(older.data[key]) !== JSON.stringify(newer.data[key])) {
|
|
395
|
+
changed.push({ key, from: older.data[key], to: newer.data[key] });
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
for (const key of olderKeys) {
|
|
399
|
+
if (!newerKeys.has(key))
|
|
400
|
+
removed.push(key);
|
|
401
|
+
}
|
|
402
|
+
return { added, removed, changed };
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
// ─── Correlation API ─────────────────────────────────
|
|
406
|
+
class CorrelationAPI {
|
|
407
|
+
adapter;
|
|
408
|
+
constructor(adapter) {
|
|
409
|
+
this.adapter = adapter;
|
|
410
|
+
}
|
|
411
|
+
/** Track a metric value */
|
|
412
|
+
async track(metricId, value, options) {
|
|
413
|
+
let metric = await this.adapter.get('metrics', metricId);
|
|
414
|
+
const point = {
|
|
415
|
+
timestamp: new Date(),
|
|
416
|
+
value,
|
|
417
|
+
source: options?.source || 'local',
|
|
418
|
+
confidence: 1.0,
|
|
419
|
+
};
|
|
420
|
+
if (!metric) {
|
|
421
|
+
metric = {
|
|
422
|
+
id: metricId,
|
|
423
|
+
entityId: options?.entityId || metricId,
|
|
424
|
+
name: options?.name || metricId,
|
|
425
|
+
unit: options?.unit,
|
|
426
|
+
points: [point],
|
|
427
|
+
aggregation: 'last',
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
metric.points.push(point);
|
|
432
|
+
metric.points.sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
433
|
+
}
|
|
434
|
+
await this.adapter.put('metrics', metricId, metric);
|
|
435
|
+
}
|
|
436
|
+
/** Find correlations for a metric */
|
|
437
|
+
async find(metricId, options) {
|
|
438
|
+
const target = await this.adapter.get('metrics', metricId);
|
|
439
|
+
if (!target || target.points.length < 10)
|
|
440
|
+
return [];
|
|
441
|
+
const allMetrics = await this.adapter.query({ collection: 'metrics' });
|
|
442
|
+
const minCorr = options?.minCorrelation ?? 0.5;
|
|
443
|
+
const maxLag = options?.maxLagDays ?? 14;
|
|
444
|
+
const results = [];
|
|
445
|
+
for (const other of allMetrics) {
|
|
446
|
+
if (other.id === metricId || other.points.length < 10)
|
|
447
|
+
continue;
|
|
448
|
+
for (let lag = 0; lag <= maxLag; lag++) {
|
|
449
|
+
const r = this.pearson(target, other, lag);
|
|
450
|
+
if (r !== null && Math.abs(r.correlation) >= minCorr) {
|
|
451
|
+
results.push({
|
|
452
|
+
metricId: other.id,
|
|
453
|
+
correlation: r.correlation,
|
|
454
|
+
lagDays: lag,
|
|
455
|
+
direction: r.correlation >= 0 ? 'positive' : 'negative',
|
|
456
|
+
sampleSize: r.n,
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return results.sort((a, b) => Math.abs(b.correlation) - Math.abs(a.correlation));
|
|
462
|
+
}
|
|
463
|
+
/** Get a metric's history */
|
|
464
|
+
async get(metricId) {
|
|
465
|
+
return await this.adapter.get('metrics', metricId);
|
|
466
|
+
}
|
|
467
|
+
/** List all tracked metrics */
|
|
468
|
+
async list() {
|
|
469
|
+
return await this.adapter.query({ collection: 'metrics' });
|
|
470
|
+
}
|
|
471
|
+
// ── Private ──
|
|
472
|
+
pearson(a, b, lagDays) {
|
|
473
|
+
// Align time series at daily granularity
|
|
474
|
+
const dayMs = 86400000;
|
|
475
|
+
const aMap = new Map();
|
|
476
|
+
for (const p of a.points) {
|
|
477
|
+
const day = Math.floor(new Date(p.timestamp).getTime() / dayMs);
|
|
478
|
+
aMap.set(day, p.value);
|
|
479
|
+
}
|
|
480
|
+
const pairs = [];
|
|
481
|
+
for (const p of b.points) {
|
|
482
|
+
const day = Math.floor(new Date(p.timestamp).getTime() / dayMs) + lagDays;
|
|
483
|
+
const aVal = aMap.get(day);
|
|
484
|
+
if (aVal !== undefined)
|
|
485
|
+
pairs.push([aVal, p.value]);
|
|
486
|
+
}
|
|
487
|
+
if (pairs.length < 5)
|
|
488
|
+
return null;
|
|
489
|
+
const n = pairs.length;
|
|
490
|
+
const meanA = pairs.reduce((s, p) => s + p[0], 0) / n;
|
|
491
|
+
const meanB = pairs.reduce((s, p) => s + p[1], 0) / n;
|
|
492
|
+
let num = 0, denA = 0, denB = 0;
|
|
493
|
+
for (const [a, b] of pairs) {
|
|
494
|
+
const da = a - meanA;
|
|
495
|
+
const db = b - meanB;
|
|
496
|
+
num += da * db;
|
|
497
|
+
denA += da * da;
|
|
498
|
+
denB += db * db;
|
|
499
|
+
}
|
|
500
|
+
const den = Math.sqrt(denA * denB);
|
|
501
|
+
if (den === 0)
|
|
502
|
+
return null;
|
|
503
|
+
return { correlation: num / den, n };
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// ─── Vector API ──────────────────────────────────────
|
|
507
|
+
class VectorAPI {
|
|
508
|
+
adapter;
|
|
509
|
+
constructor(adapter) {
|
|
510
|
+
this.adapter = adapter;
|
|
511
|
+
}
|
|
512
|
+
get vec() {
|
|
513
|
+
return 'putVector' in this.adapter ? this.adapter : null;
|
|
514
|
+
}
|
|
515
|
+
/** Check if vector search is available */
|
|
516
|
+
get available() {
|
|
517
|
+
return this.vec !== null;
|
|
518
|
+
}
|
|
519
|
+
/** Store a vector */
|
|
520
|
+
async store(collection, key, vector, metadata) {
|
|
521
|
+
const v = this.vec;
|
|
522
|
+
if (!v)
|
|
523
|
+
throw new Error('Vector search requires a VectorAdapter. Use MemoryVectorAdapter or VectorOverlay.');
|
|
524
|
+
await v.putVector(collection, key, vector, metadata);
|
|
525
|
+
}
|
|
526
|
+
/** Search by vector similarity */
|
|
527
|
+
async search(collection, vector, topK = 10, minScore) {
|
|
528
|
+
const v = this.vec;
|
|
529
|
+
if (!v)
|
|
530
|
+
throw new Error('Vector search requires a VectorAdapter.');
|
|
531
|
+
return v.searchVector(collection, vector, topK, minScore);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
// ─── Factory Function ────────────────────────────────
|
|
535
|
+
/**
|
|
536
|
+
* Create a dpth database instance.
|
|
537
|
+
*
|
|
538
|
+
* @param pathOrOptions — SQLite path string, or options object
|
|
539
|
+
* @returns Initialized Dpth instance (call .ready() if you need to await init)
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* // In-memory (default)
|
|
543
|
+
* const db = dpth();
|
|
544
|
+
*
|
|
545
|
+
* // Persistent (SQLite)
|
|
546
|
+
* const db = await dpth('./myapp.db').ready();
|
|
547
|
+
*
|
|
548
|
+
* // Custom adapter
|
|
549
|
+
* const db = dpth({ adapter: new MemoryVectorAdapter() });
|
|
550
|
+
*/
|
|
551
|
+
export function dpth(pathOrOptions) {
|
|
552
|
+
if (typeof pathOrOptions === 'string') {
|
|
553
|
+
return new Dpth({ path: pathOrOptions });
|
|
554
|
+
}
|
|
555
|
+
return new Dpth(pathOrOptions);
|
|
556
|
+
}
|
|
557
|
+
//# sourceMappingURL=dpth.js.map
|
package/dist/dpth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpth.js","sourceRoot":"","sources":["../src/dpth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAgD7C,wDAAwD;AAExD,MAAM,OAAO,IAAI;IACP,OAAO,CAAiB;IACxB,MAAM,CAAgB;IAE9B,uCAAuC;IAChC,MAAM,CAAY;IACzB,qCAAqC;IAC9B,QAAQ,CAAc;IAC7B,2CAA2C;IACpC,WAAW,CAAiB;IACnC,6CAA6C;IACtC,MAAM,CAAY;IAEzB,YAAY,UAAuB,EAAE;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,aAAa,EAAE,CAAC;QAEtD,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,IA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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dpth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The distributed intelligence layer — decentralized AI inference, data intelligence, and agent coordination.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,6 +53,10 @@
|
|
|
53
53
|
"./adapter-vector": {
|
|
54
54
|
"import": "./dist/adapter-vector.js",
|
|
55
55
|
"types": "./dist/adapter-vector.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./dpth": {
|
|
58
|
+
"import": "./dist/dpth.js",
|
|
59
|
+
"types": "./dist/dpth.d.ts"
|
|
56
60
|
}
|
|
57
61
|
},
|
|
58
62
|
"files": [
|
|
@@ -64,7 +68,7 @@
|
|
|
64
68
|
"build": "tsc",
|
|
65
69
|
"dev": "tsc --watch",
|
|
66
70
|
"lint": "eslint src/",
|
|
67
|
-
"test": "tsx test/smoke.ts && tsx test/integration.ts && tsx test/api.ts && tsx test/adapters.ts",
|
|
71
|
+
"test": "tsx test/smoke.ts && tsx test/integration.ts && tsx test/api.ts && tsx test/adapters.ts && tsx test/dpth.ts",
|
|
68
72
|
"prepublishOnly": "npm run build && npm test"
|
|
69
73
|
},
|
|
70
74
|
"keywords": [
|