dpth 0.1.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.
@@ -0,0 +1,107 @@
1
+ /**
2
+ * dpth.io Storage Adapter System
3
+ *
4
+ * Pluggable storage backends. dpth works in-memory by default,
5
+ * add SQLite for persistence, add vectors for semantic search.
6
+ *
7
+ * Usage:
8
+ * import { configure, MemoryAdapter } from 'dpth/storage';
9
+ * configure({ adapter: new MemoryAdapter() }); // default
10
+ *
11
+ * import { SQLiteAdapter } from 'dpth/storage';
12
+ * configure({ adapter: new SQLiteAdapter('./data.db') });
13
+ */
14
+ export interface QueryFilter {
15
+ /** Collection/table to query */
16
+ collection: string;
17
+ /** Field equality filters */
18
+ where?: Record<string, unknown>;
19
+ /** Field comparison filters */
20
+ compare?: Array<{
21
+ field: string;
22
+ op: 'gt' | 'gte' | 'lt' | 'lte' | 'ne' | 'in' | 'contains';
23
+ value: unknown;
24
+ }>;
25
+ /** Sort by field */
26
+ orderBy?: {
27
+ field: string;
28
+ direction: 'asc' | 'desc';
29
+ };
30
+ /** Limit results */
31
+ limit?: number;
32
+ /** Offset for pagination */
33
+ offset?: number;
34
+ }
35
+ export interface StorageAdapter {
36
+ /** Get a value by collection and key */
37
+ get(collection: string, key: string): Promise<unknown | undefined>;
38
+ /** Store a value by collection and key */
39
+ put(collection: string, key: string, value: unknown): Promise<void>;
40
+ /** Delete a value by collection and key */
41
+ delete(collection: string, key: string): Promise<boolean>;
42
+ /** Check if a key exists in a collection */
43
+ has(collection: string, key: string): Promise<boolean>;
44
+ /** Query a collection with filters */
45
+ query(filter: QueryFilter): Promise<unknown[]>;
46
+ /** Get all keys in a collection */
47
+ keys(collection: string): Promise<string[]>;
48
+ /** Get count of items in a collection */
49
+ count(collection: string): Promise<number>;
50
+ /** Clear a collection (or all collections if no name given) */
51
+ clear(collection?: string): Promise<void>;
52
+ /** Close the adapter (cleanup connections, flush writes) */
53
+ close(): Promise<void>;
54
+ }
55
+ /** Vector search capabilities (extends base adapter) */
56
+ export interface VectorAdapter extends StorageAdapter {
57
+ /** Store a vector with metadata */
58
+ putVector(collection: string, key: string, vector: number[], metadata?: Record<string, unknown>): Promise<void>;
59
+ /** Search by vector similarity */
60
+ searchVector(collection: string, vector: number[], topK: number, minScore?: number): Promise<VectorResult[]>;
61
+ /** Get vector dimensions for a collection */
62
+ dimensions(collection: string): Promise<number | undefined>;
63
+ }
64
+ export interface VectorResult {
65
+ key: string;
66
+ score: number;
67
+ metadata?: Record<string, unknown>;
68
+ }
69
+ export declare class MemoryAdapter implements StorageAdapter {
70
+ private store;
71
+ private getCollection;
72
+ get(collection: string, key: string): Promise<unknown | undefined>;
73
+ put(collection: string, key: string, value: unknown): Promise<void>;
74
+ delete(collection: string, key: string): Promise<boolean>;
75
+ has(collection: string, key: string): Promise<boolean>;
76
+ query(filter: QueryFilter): Promise<unknown[]>;
77
+ keys(collection: string): Promise<string[]>;
78
+ count(collection: string): Promise<number>;
79
+ clear(collection?: string): Promise<void>;
80
+ close(): Promise<void>;
81
+ }
82
+ /**
83
+ * Configure dpth with a storage adapter.
84
+ * Call before using any dpth modules.
85
+ *
86
+ * @example
87
+ * import { configure, MemoryAdapter } from 'dpth/storage';
88
+ * configure({ adapter: new MemoryAdapter() }); // default
89
+ *
90
+ * @example
91
+ * import { configure } from 'dpth/storage';
92
+ * import { SQLiteAdapter } from 'dpth/adapter-sqlite';
93
+ * configure({ adapter: new SQLiteAdapter('./data.db') });
94
+ */
95
+ export declare function configure(options: {
96
+ adapter: StorageAdapter;
97
+ }): void;
98
+ /**
99
+ * Get the current storage adapter.
100
+ * Used internally by dpth modules.
101
+ */
102
+ export declare function getAdapter(): StorageAdapter;
103
+ /**
104
+ * Reset to default memory adapter (mainly for testing)
105
+ */
106
+ export declare function resetAdapter(): void;
107
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage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C,OAAO,GAAG,SAAS,CAAC;IAIlE,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzD,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAqD9C,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI3C,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1C,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG,IAAI,CAEpE;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,cAAc,CAE3C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * dpth.io Storage Adapter System
3
+ *
4
+ * Pluggable storage backends. dpth works in-memory by default,
5
+ * add SQLite for persistence, add vectors for semantic search.
6
+ *
7
+ * Usage:
8
+ * import { configure, MemoryAdapter } from 'dpth/storage';
9
+ * configure({ adapter: new MemoryAdapter() }); // default
10
+ *
11
+ * import { SQLiteAdapter } from 'dpth/storage';
12
+ * configure({ adapter: new SQLiteAdapter('./data.db') });
13
+ */
14
+ // ─── Memory Adapter (default) ────────────────────────
15
+ export class MemoryAdapter {
16
+ store = new Map();
17
+ getCollection(name) {
18
+ let col = this.store.get(name);
19
+ if (!col) {
20
+ col = new Map();
21
+ this.store.set(name, col);
22
+ }
23
+ return col;
24
+ }
25
+ async get(collection, key) {
26
+ return this.getCollection(collection).get(key);
27
+ }
28
+ async put(collection, key, value) {
29
+ this.getCollection(collection).set(key, value);
30
+ }
31
+ async delete(collection, key) {
32
+ return this.getCollection(collection).delete(key);
33
+ }
34
+ async has(collection, key) {
35
+ return this.getCollection(collection).has(key);
36
+ }
37
+ async query(filter) {
38
+ const col = this.getCollection(filter.collection);
39
+ let results = Array.from(col.values());
40
+ // Apply where filters
41
+ if (filter.where) {
42
+ for (const [field, value] of Object.entries(filter.where)) {
43
+ results = results.filter(item => {
44
+ const obj = item;
45
+ return obj[field] === value;
46
+ });
47
+ }
48
+ }
49
+ // Apply comparison filters
50
+ if (filter.compare) {
51
+ for (const cmp of filter.compare) {
52
+ results = results.filter(item => {
53
+ const obj = item;
54
+ const fieldVal = obj[cmp.field];
55
+ switch (cmp.op) {
56
+ case 'gt': return fieldVal > cmp.value;
57
+ case 'gte': return fieldVal >= cmp.value;
58
+ case 'lt': return fieldVal < cmp.value;
59
+ case 'lte': return fieldVal <= cmp.value;
60
+ case 'ne': return fieldVal !== cmp.value;
61
+ case 'in': return cmp.value.includes(fieldVal);
62
+ case 'contains': return typeof fieldVal === 'string' && fieldVal.includes(cmp.value);
63
+ default: return true;
64
+ }
65
+ });
66
+ }
67
+ }
68
+ // Apply ordering
69
+ if (filter.orderBy) {
70
+ const { field, direction } = filter.orderBy;
71
+ results.sort((a, b) => {
72
+ const aVal = a[field];
73
+ const bVal = b[field];
74
+ if (aVal === bVal)
75
+ return 0;
76
+ const cmp = aVal < bVal ? -1 : 1;
77
+ return direction === 'asc' ? cmp : -cmp;
78
+ });
79
+ }
80
+ // Apply pagination
81
+ if (filter.offset)
82
+ results = results.slice(filter.offset);
83
+ if (filter.limit)
84
+ results = results.slice(0, filter.limit);
85
+ return results;
86
+ }
87
+ async keys(collection) {
88
+ return Array.from(this.getCollection(collection).keys());
89
+ }
90
+ async count(collection) {
91
+ return this.getCollection(collection).size;
92
+ }
93
+ async clear(collection) {
94
+ if (collection) {
95
+ this.store.delete(collection);
96
+ }
97
+ else {
98
+ this.store.clear();
99
+ }
100
+ }
101
+ async close() {
102
+ // No-op for memory adapter
103
+ }
104
+ }
105
+ // ─── Global Configuration ────────────────────────────
106
+ let globalAdapter = new MemoryAdapter();
107
+ /**
108
+ * Configure dpth with a storage adapter.
109
+ * Call before using any dpth modules.
110
+ *
111
+ * @example
112
+ * import { configure, MemoryAdapter } from 'dpth/storage';
113
+ * configure({ adapter: new MemoryAdapter() }); // default
114
+ *
115
+ * @example
116
+ * import { configure } from 'dpth/storage';
117
+ * import { SQLiteAdapter } from 'dpth/adapter-sqlite';
118
+ * configure({ adapter: new SQLiteAdapter('./data.db') });
119
+ */
120
+ export function configure(options) {
121
+ globalAdapter = options.adapter;
122
+ }
123
+ /**
124
+ * Get the current storage adapter.
125
+ * Used internally by dpth modules.
126
+ */
127
+ export function getAdapter() {
128
+ return globalAdapter;
129
+ }
130
+ /**
131
+ * Reset to default memory adapter (mainly for testing)
132
+ */
133
+ export function resetAdapter() {
134
+ globalAdapter = new MemoryAdapter();
135
+ }
136
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAsEH,wDAAwD;AAExD,MAAM,OAAO,aAAa;IAChB,KAAK,GAAG,IAAI,GAAG,EAAgC,CAAC;IAEhD,aAAa,CAAC,IAAY;QAChC,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI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ACF;AAED,wDAAwD;AAExD,IAAI,aAAa,GAAmB,IAAI,aAAa,EAAE,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,OAAoC;IAC5D,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dpth",
3
- "version": "0.1.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",
@@ -41,6 +41,22 @@
41
41
  "./federation": {
42
42
  "import": "./dist/federation.js",
43
43
  "types": "./dist/federation.d.ts"
44
+ },
45
+ "./storage": {
46
+ "import": "./dist/storage.js",
47
+ "types": "./dist/storage.d.ts"
48
+ },
49
+ "./adapter-sqlite": {
50
+ "import": "./dist/adapter-sqlite.js",
51
+ "types": "./dist/adapter-sqlite.d.ts"
52
+ },
53
+ "./adapter-vector": {
54
+ "import": "./dist/adapter-vector.js",
55
+ "types": "./dist/adapter-vector.d.ts"
56
+ },
57
+ "./dpth": {
58
+ "import": "./dist/dpth.js",
59
+ "types": "./dist/dpth.d.ts"
44
60
  }
45
61
  },
46
62
  "files": [
@@ -52,7 +68,7 @@
52
68
  "build": "tsc",
53
69
  "dev": "tsc --watch",
54
70
  "lint": "eslint src/",
55
- "test": "tsx test/smoke.ts && tsx test/integration.ts",
71
+ "test": "tsx test/smoke.ts && tsx test/integration.ts && tsx test/api.ts && tsx test/adapters.ts && tsx test/dpth.ts",
56
72
  "prepublishOnly": "npm run build && npm test"
57
73
  },
58
74
  "keywords": [
@@ -80,6 +96,14 @@
80
96
  "engines": {
81
97
  "node": ">=18"
82
98
  },
99
+ "peerDependencies": {
100
+ "better-sqlite3": ">=11.0.0"
101
+ },
102
+ "peerDependenciesMeta": {
103
+ "better-sqlite3": {
104
+ "optional": true
105
+ }
106
+ },
83
107
  "sideEffects": false,
84
108
  "devDependencies": {
85
109
  "@types/node": "^25.2.0",