dpth 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.
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * dpth.io — The Distributed Intelligence Layer
3
+ *
4
+ * Decentralized AI inference, data intelligence, and agent coordination.
5
+ *
6
+ * Core modules:
7
+ * - Entity: Unified identity across sources with temporal history
8
+ * - Correlation: Cross-source pattern detection and causality discovery
9
+ * - Temporal: Time-native storage where every value has history
10
+ * - Embed: Semantic search and similarity across all data
11
+ * - Ingest: Data ingestion pipeline from connectors
12
+ * - Agent SDK: Client for agents to participate in the network
13
+ * - Fallback: Centralized inference when no agents available
14
+ */
15
+ export * from './types.js';
16
+ export * from './entity.js';
17
+ export * from './correlation.js';
18
+ export * from './temporal.js';
19
+ export * from './embed.js';
20
+ export * from './agent-sdk.js';
21
+ export * from './fallback.js';
22
+ export * from './economics.js';
23
+ export * from './federation.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * dpth.io Temporal Storage
3
+ *
4
+ * Time-native storage where every value has history.
5
+ * Query any point in time, track changes, detect patterns.
6
+ *
7
+ * This is the foundation for "what was X at time T?" queries
8
+ * and automatic change detection.
9
+ */
10
+ import { TemporalValue, SourceId } from './types.js';
11
+ /**
12
+ * Create a new temporal value
13
+ */
14
+ export declare function createTemporalValue<T>(value: T, source: SourceId): TemporalValue<T>;
15
+ /**
16
+ * Update a temporal value (closes current entry, adds new)
17
+ */
18
+ export declare function updateTemporalValue<T>(temporal: TemporalValue<T>, newValue: T, source: SourceId): TemporalValue<T>;
19
+ /**
20
+ * Get value at a specific point in time
21
+ */
22
+ export declare function getValueAt<T>(temporal: TemporalValue<T>, at: Date): T | undefined;
23
+ /**
24
+ * Get all changes in a time range
25
+ */
26
+ export declare function getChangesInRange<T>(temporal: TemporalValue<T>, start: Date, end: Date): Array<{
27
+ value: T;
28
+ changedAt: Date;
29
+ source: SourceId;
30
+ }>;
31
+ /**
32
+ * Calculate how many times a value has changed
33
+ */
34
+ export declare function getChangeCount<T>(temporal: TemporalValue<T>): number;
35
+ /**
36
+ * Get the most recent change
37
+ */
38
+ export declare function getLastChange<T>(temporal: TemporalValue<T>): {
39
+ from: T;
40
+ to: T;
41
+ changedAt: Date;
42
+ source: SourceId;
43
+ } | undefined;
44
+ export type TimeGranularity = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
45
+ export interface TimeRange {
46
+ start: Date;
47
+ end: Date;
48
+ granularity?: TimeGranularity;
49
+ }
50
+ /**
51
+ * Create a time range for "last N periods"
52
+ */
53
+ export declare function lastN(n: number, granularity: TimeGranularity): TimeRange;
54
+ /**
55
+ * Get period boundaries for a time range
56
+ */
57
+ export declare function getPeriodBoundaries(range: TimeRange): Date[];
58
+ interface Snapshot<T> {
59
+ id: string;
60
+ timestamp: Date;
61
+ data: T;
62
+ source: SourceId;
63
+ metadata?: Record<string, unknown>;
64
+ }
65
+ /**
66
+ * Take a snapshot of data
67
+ */
68
+ export declare function takeSnapshot<T>(key: string, data: T, source: SourceId, metadata?: Record<string, unknown>): Snapshot<T>;
69
+ /**
70
+ * Get snapshots for a key
71
+ */
72
+ export declare function getSnapshots<T>(key: string): Snapshot<T>[];
73
+ /**
74
+ * Get snapshot closest to a specific time
75
+ */
76
+ export declare function getSnapshotAt<T>(key: string, at: Date): Snapshot<T> | undefined;
77
+ /**
78
+ * Compare two snapshots and return differences
79
+ */
80
+ export declare function diffSnapshots<T extends Record<string, unknown>>(older: Snapshot<T>, newer: Snapshot<T>): {
81
+ added: string[];
82
+ removed: string[];
83
+ changed: string[];
84
+ };
85
+ /**
86
+ * Clean up old snapshots (retention policy)
87
+ */
88
+ export declare function cleanupSnapshots(key: string, maxAge: number, // in milliseconds
89
+ maxCount?: number): number;
90
+ /**
91
+ * Clear all snapshots (for testing)
92
+ */
93
+ export declare function clearSnapshots(): void;
94
+ export {};
95
+ //# sourceMappingURL=temporal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal.d.ts","sourceRoot":"","sources":["../src/temporal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAIrD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,QAAQ,GACf,aAAa,CAAC,CAAC,CAAC,CAWlB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,QAAQ,GACf,aAAa,CAAC,CAAC,CAAC,CAmBlB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,EAAE,EAAE,IAAI,GACP,CAAC,GAAG,SAAS,CAaf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,IAAI,EACX,GAAG,EAAE,IAAI,GACR,KAAK,CAAC;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC,CAcx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C,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAE1D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAiB/E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GACjB;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAuB3D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EAAE,kBAAkB;AAClC,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAyBR;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
@@ -0,0 +1,257 @@
1
+ /**
2
+ * dpth.io Temporal Storage
3
+ *
4
+ * Time-native storage where every value has history.
5
+ * Query any point in time, track changes, detect patterns.
6
+ *
7
+ * This is the foundation for "what was X at time T?" queries
8
+ * and automatic change detection.
9
+ */
10
+ // ─── Temporal Value Helpers ──────────────────────────
11
+ /**
12
+ * Create a new temporal value
13
+ */
14
+ export function createTemporalValue(value, source) {
15
+ const now = new Date();
16
+ return {
17
+ current: value,
18
+ history: [{
19
+ value,
20
+ validFrom: now,
21
+ validTo: null,
22
+ source,
23
+ }],
24
+ };
25
+ }
26
+ /**
27
+ * Update a temporal value (closes current entry, adds new)
28
+ */
29
+ export function updateTemporalValue(temporal, newValue, source) {
30
+ const now = new Date();
31
+ // Close current entry
32
+ const currentEntry = temporal.history.find(h => h.validTo === null);
33
+ if (currentEntry) {
34
+ currentEntry.validTo = now;
35
+ }
36
+ // Add new entry
37
+ temporal.history.push({
38
+ value: newValue,
39
+ validFrom: now,
40
+ validTo: null,
41
+ source,
42
+ });
43
+ temporal.current = newValue;
44
+ return temporal;
45
+ }
46
+ /**
47
+ * Get value at a specific point in time
48
+ */
49
+ export function getValueAt(temporal, at) {
50
+ const timestamp = at.getTime();
51
+ for (const entry of temporal.history) {
52
+ const from = new Date(entry.validFrom).getTime();
53
+ const to = entry.validTo ? new Date(entry.validTo).getTime() : Date.now();
54
+ if (timestamp >= from && timestamp <= to) {
55
+ return entry.value;
56
+ }
57
+ }
58
+ return undefined;
59
+ }
60
+ /**
61
+ * Get all changes in a time range
62
+ */
63
+ export function getChangesInRange(temporal, start, end) {
64
+ const startMs = start.getTime();
65
+ const endMs = end.getTime();
66
+ return temporal.history
67
+ .filter(entry => {
68
+ const fromMs = new Date(entry.validFrom).getTime();
69
+ return fromMs >= startMs && fromMs <= endMs;
70
+ })
71
+ .map(entry => ({
72
+ value: entry.value,
73
+ changedAt: new Date(entry.validFrom),
74
+ source: entry.source,
75
+ }));
76
+ }
77
+ /**
78
+ * Calculate how many times a value has changed
79
+ */
80
+ export function getChangeCount(temporal) {
81
+ return temporal.history.length - 1; // First entry is creation, not a change
82
+ }
83
+ /**
84
+ * Get the most recent change
85
+ */
86
+ export function getLastChange(temporal) {
87
+ if (temporal.history.length < 2)
88
+ return undefined;
89
+ const current = temporal.history[temporal.history.length - 1];
90
+ const previous = temporal.history[temporal.history.length - 2];
91
+ return {
92
+ from: previous.value,
93
+ to: current.value,
94
+ changedAt: new Date(current.validFrom),
95
+ source: current.source,
96
+ };
97
+ }
98
+ /**
99
+ * Create a time range for "last N periods"
100
+ */
101
+ export function lastN(n, granularity) {
102
+ const end = new Date();
103
+ const start = new Date();
104
+ switch (granularity) {
105
+ case 'hour':
106
+ start.setHours(start.getHours() - n);
107
+ break;
108
+ case 'day':
109
+ start.setDate(start.getDate() - n);
110
+ break;
111
+ case 'week':
112
+ start.setDate(start.getDate() - n * 7);
113
+ break;
114
+ case 'month':
115
+ start.setMonth(start.getMonth() - n);
116
+ break;
117
+ case 'quarter':
118
+ start.setMonth(start.getMonth() - n * 3);
119
+ break;
120
+ case 'year':
121
+ start.setFullYear(start.getFullYear() - n);
122
+ break;
123
+ }
124
+ return { start, end, granularity };
125
+ }
126
+ /**
127
+ * Get period boundaries for a time range
128
+ */
129
+ export function getPeriodBoundaries(range) {
130
+ const { start, end, granularity = 'day' } = range;
131
+ const boundaries = [];
132
+ const current = new Date(start);
133
+ while (current <= end) {
134
+ boundaries.push(new Date(current));
135
+ switch (granularity) {
136
+ case 'hour':
137
+ current.setHours(current.getHours() + 1);
138
+ break;
139
+ case 'day':
140
+ current.setDate(current.getDate() + 1);
141
+ break;
142
+ case 'week':
143
+ current.setDate(current.getDate() + 7);
144
+ break;
145
+ case 'month':
146
+ current.setMonth(current.getMonth() + 1);
147
+ break;
148
+ case 'quarter':
149
+ current.setMonth(current.getMonth() + 3);
150
+ break;
151
+ case 'year':
152
+ current.setFullYear(current.getFullYear() + 1);
153
+ break;
154
+ }
155
+ }
156
+ return boundaries;
157
+ }
158
+ const snapshots = new Map();
159
+ /**
160
+ * Take a snapshot of data
161
+ */
162
+ export function takeSnapshot(key, data, source, metadata) {
163
+ const snapshot = {
164
+ id: `snap_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
165
+ timestamp: new Date(),
166
+ data,
167
+ source,
168
+ metadata,
169
+ };
170
+ const existing = snapshots.get(key) || [];
171
+ existing.push(snapshot);
172
+ snapshots.set(key, existing);
173
+ return snapshot;
174
+ }
175
+ /**
176
+ * Get snapshots for a key
177
+ */
178
+ export function getSnapshots(key) {
179
+ return (snapshots.get(key) || []);
180
+ }
181
+ /**
182
+ * Get snapshot closest to a specific time
183
+ */
184
+ export function getSnapshotAt(key, at) {
185
+ const snaps = getSnapshots(key);
186
+ if (snaps.length === 0)
187
+ return undefined;
188
+ const targetMs = at.getTime();
189
+ let closest;
190
+ let minDiff = Infinity;
191
+ for (const snap of snaps) {
192
+ const diff = Math.abs(snap.timestamp.getTime() - targetMs);
193
+ if (diff < minDiff) {
194
+ minDiff = diff;
195
+ closest = snap;
196
+ }
197
+ }
198
+ return closest;
199
+ }
200
+ /**
201
+ * Compare two snapshots and return differences
202
+ */
203
+ export function diffSnapshots(older, newer) {
204
+ const olderKeys = new Set(Object.keys(older.data));
205
+ const newerKeys = new Set(Object.keys(newer.data));
206
+ const added = [];
207
+ const removed = [];
208
+ const changed = [];
209
+ for (const key of newerKeys) {
210
+ if (!olderKeys.has(key)) {
211
+ added.push(key);
212
+ }
213
+ else if (JSON.stringify(older.data[key]) !== JSON.stringify(newer.data[key])) {
214
+ changed.push(key);
215
+ }
216
+ }
217
+ for (const key of olderKeys) {
218
+ if (!newerKeys.has(key)) {
219
+ removed.push(key);
220
+ }
221
+ }
222
+ return { added, removed, changed };
223
+ }
224
+ /**
225
+ * Clean up old snapshots (retention policy)
226
+ */
227
+ export function cleanupSnapshots(key, maxAge, // in milliseconds
228
+ maxCount) {
229
+ const snaps = snapshots.get(key);
230
+ if (!snaps)
231
+ return 0;
232
+ const cutoff = Date.now() - maxAge;
233
+ let removed = 0;
234
+ // Remove by age
235
+ const filtered = snaps.filter(s => {
236
+ if (s.timestamp.getTime() < cutoff) {
237
+ removed++;
238
+ return false;
239
+ }
240
+ return true;
241
+ });
242
+ // Remove by count (keep most recent)
243
+ if (maxCount && filtered.length > maxCount) {
244
+ const toRemove = filtered.length - maxCount;
245
+ filtered.splice(0, toRemove);
246
+ removed += toRemove;
247
+ }
248
+ snapshots.set(key, filtered);
249
+ return removed;
250
+ }
251
+ /**
252
+ * Clear all snapshots (for testing)
253
+ */
254
+ export function clearSnapshots() {
255
+ snapshots.clear();
256
+ }
257
+ //# sourceMappingURL=temporal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal.js","sourceRoot":"","sources":["../src/temporal.ts"],"names":[],"mappings":"AAAA;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,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC;IAErB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;IACnC,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,gBAAgB;IAChB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QAChC,IAAI,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;YACnC,OAAO,EAAE,CAAC;YACV,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,qCAAqC;IACrC,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC;QAC5C,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC7B,OAAO,IAAI,QAAQ,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,SAAS,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,157 @@
1
+ /**
2
+ * dpth.io Core Types
3
+ *
4
+ * Everything in dpth.io is built on these primitives:
5
+ * - Entity: A thing with identity that persists across sources
6
+ * - Metric: A measurable value with temporal history
7
+ * - Relationship: A typed connection between entities
8
+ * - Pattern: A discovered correlation or anomaly
9
+ */
10
+ /** Unique identifier for an entity across the entire dpth.io instance */
11
+ export type EntityId = string;
12
+ /** Source system identifier (e.g., 'stripe', 'github', 'salesforce') */
13
+ export type SourceId = string;
14
+ /** A reference to an entity in a specific source system */
15
+ export interface SourceRef {
16
+ sourceId: SourceId;
17
+ externalId: string;
18
+ confidence: number;
19
+ lastSeen: Date;
20
+ }
21
+ /** Entity types we understand */
22
+ export type EntityType = 'person' | 'company' | 'product' | 'project' | 'team' | 'location' | 'event' | 'metric' | 'custom';
23
+ /** Core entity — a unified identity across sources */
24
+ export interface Entity {
25
+ id: EntityId;
26
+ type: EntityType;
27
+ name: string;
28
+ aliases: string[];
29
+ sources: SourceRef[];
30
+ attributes: Record<string, TemporalValue<unknown>>;
31
+ createdAt: Date;
32
+ updatedAt: Date;
33
+ }
34
+ /** A value that changes over time */
35
+ export interface TemporalValue<T> {
36
+ current: T;
37
+ history: Array<{
38
+ value: T;
39
+ validFrom: Date;
40
+ validTo: Date | null;
41
+ source: SourceId;
42
+ }>;
43
+ }
44
+ /** A metric data point */
45
+ export interface MetricPoint {
46
+ timestamp: Date;
47
+ value: number;
48
+ source: SourceId;
49
+ confidence: number;
50
+ }
51
+ /** A time-series metric */
52
+ export interface Metric {
53
+ id: string;
54
+ entityId: EntityId;
55
+ name: string;
56
+ unit?: string;
57
+ points: MetricPoint[];
58
+ aggregation: 'sum' | 'avg' | 'min' | 'max' | 'last';
59
+ }
60
+ /** Typed relationship between entities */
61
+ export type RelationshipType = 'manages' | 'works_on' | 'belongs_to' | 'owns' | 'sells' | 'buys_from' | 'located_at' | 'related_to' | 'causes' | 'correlates';
62
+ /** A relationship with temporal validity */
63
+ export interface Relationship {
64
+ id: string;
65
+ type: RelationshipType;
66
+ fromEntity: EntityId;
67
+ toEntity: EntityId;
68
+ strength: number;
69
+ validFrom: Date;
70
+ validTo: Date | null;
71
+ source: SourceId | 'dpth:inferred';
72
+ metadata?: Record<string, unknown>;
73
+ }
74
+ /** Types of patterns dpth.io can discover */
75
+ export type PatternType = 'correlation' | 'causation' | 'anomaly' | 'trend' | 'seasonality' | 'cluster' | 'outlier';
76
+ /** A discovered pattern */
77
+ export interface Pattern {
78
+ id: string;
79
+ type: PatternType;
80
+ confidence: number;
81
+ significance: number;
82
+ entities: EntityId[];
83
+ metrics: string[];
84
+ data: CorrelationData | AnomalyData | TrendData | ClusterData;
85
+ discoveredAt: Date;
86
+ lastValidated: Date;
87
+ validationCount: number;
88
+ summary: string;
89
+ explanation?: string;
90
+ }
91
+ export interface CorrelationData {
92
+ type: 'correlation' | 'causation';
93
+ metricA: string;
94
+ metricB: string;
95
+ coefficient: number;
96
+ lagDays: number;
97
+ sampleSize: number;
98
+ }
99
+ export interface AnomalyData {
100
+ type: 'anomaly';
101
+ metric: string;
102
+ value: number;
103
+ expected: number;
104
+ stdDeviations: number;
105
+ timestamp: Date;
106
+ }
107
+ export interface TrendData {
108
+ type: 'trend';
109
+ metric: string;
110
+ direction: 'up' | 'down';
111
+ slope: number;
112
+ startDate: Date;
113
+ endDate: Date;
114
+ }
115
+ export interface ClusterData {
116
+ type: 'cluster' | 'outlier';
117
+ entityType: EntityType;
118
+ clusterLabel: string;
119
+ memberCount: number;
120
+ centroid?: number[];
121
+ }
122
+ /** Query for finding correlated metrics */
123
+ export interface CorrelationQuery {
124
+ /** Metric to find correlations for */
125
+ metricId: string;
126
+ /** Minimum correlation coefficient (absolute value) */
127
+ minCorrelation?: number;
128
+ /** Maximum lag in days to check for causation */
129
+ maxLagDays?: number;
130
+ /** Time range to analyze */
131
+ timeRange?: {
132
+ start: Date;
133
+ end: Date;
134
+ };
135
+ /** Limit results */
136
+ limit?: number;
137
+ }
138
+ /** Query for semantic similarity */
139
+ export interface SimilarityQuery {
140
+ /** Entity or metric to find similar items for */
141
+ id: string;
142
+ /** Type of thing to search for */
143
+ type: 'entity' | 'metric' | 'pattern';
144
+ /** Minimum similarity score */
145
+ minScore?: number;
146
+ /** Limit results */
147
+ limit?: number;
148
+ }
149
+ /** Embedding vector for semantic search */
150
+ export interface Embedding {
151
+ id: string;
152
+ type: 'entity' | 'metric' | 'pattern';
153
+ vector: number[];
154
+ text: string;
155
+ updatedAt: Date;
156
+ }
157
+ //# sourceM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,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,CAAC;IACvC,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,2CAA2C;AAC3C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;CACjB"}
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * dpth.io Core Types
3
+ *
4
+ * Everything in dpth.io is built on these primitives:
5
+ * - Entity: A thing with identity that persists across sources
6
+ * - Metric: A measurable value with temporal history
7
+ * - Relationship: A typed connection between entities
8
+ * - Pattern: A discovered correlation or anomaly
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "dpth",
3
+ "version": "0.1.0",
4
+ "description": "The distributed intelligence layer — decentralized AI inference, data intelligence, and agent coordination.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./entity": {
14
+ "import": "./dist/entity.js",
15
+ "types": "./dist/entity.d.ts"
16
+ },
17
+ "./correlation": {
18
+ "import": "./dist/correlation.js",
19
+ "types": "./dist/correlation.d.ts"
20
+ },
21
+ "./temporal": {
22
+ "import": "./dist/temporal.js",
23
+ "types": "./dist/temporal.d.ts"
24
+ },
25
+ "./embed": {
26
+ "import": "./dist/embed.js",
27
+ "types": "./dist/embed.d.ts"
28
+ },
29
+ "./agent-sdk": {
30
+ "import": "./dist/agent-sdk.js",
31
+ "types": "./dist/agent-sdk.d.ts"
32
+ },
33
+ "./fallback": {
34
+ "import": "./dist/fallback.js",
35
+ "types": "./dist/fallback.d.ts"
36
+ },
37
+ "./economics": {
38
+ "import": "./dist/economics.js",
39
+ "types": "./dist/economics.d.ts"
40
+ },
41
+ "./federation": {
42
+ "import": "./dist/federation.js",
43
+ "types": "./dist/federation.d.ts"
44
+ }
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "README.md",
49
+ "LICENSE"
50
+ ],
51
+ "scripts": {
52
+ "build": "tsc",
53
+ "dev": "tsc --watch",
54
+ "lint": "eslint src/",
55
+ "test": "tsx test/smoke.ts && tsx test/integration.ts",
56
+ "prepublishOnly": "npm run build && npm test"
57
+ },
58
+ "keywords": [
59
+ "decentralized",
60
+ "ai",
61
+ "inference",
62
+ "intelligence",
63
+ "agents",
64
+ "distributed",
65
+ "p2p",
66
+ "entity-resolution",
67
+ "correlation",
68
+ "temporal-data"
69
+ ],
70
+ "author": "dpth.io contributors",
71
+ "license": "MIT",
72
+ "homepage": "https://github.com/rightclickable420/dpth#readme",
73
+ "bugs": {
74
+ "url": "https://github.com/rightclickable420/dpth/issues"
75
+ },
76
+ "repository": {
77
+ "type": "git",
78
+ "url": "https://github.com/rightclickable420/dpth.git"
79
+ },
80
+ "engines": {
81
+ "node": ">=18"
82
+ },
83
+ "sideEffects": false,
84
+ "devDependencies": {
85
+ "@types/node": "^25.2.0",
86
+ "next": "^16.1.6",
87
+ "react": "^19.2.4",
88
+ "react-dom": "^19.2.4",
89
+ "tsx": "^4.21.0",
90
+ "typescript": "^5.7.0"
91
+ }
92
+ }