@feltdb/core 0.2.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.
Files changed (65) hide show
  1. package/README.md +184 -0
  2. package/dist/agent-decision.d.ts +81 -0
  3. package/dist/agent-decision.d.ts.map +1 -0
  4. package/dist/agent-decision.js +18 -0
  5. package/dist/agent-memory.d.ts +91 -0
  6. package/dist/agent-memory.d.ts.map +1 -0
  7. package/dist/agent-memory.js +21 -0
  8. package/dist/agent-observation.d.ts +61 -0
  9. package/dist/agent-observation.d.ts.map +1 -0
  10. package/dist/agent-observation.js +12 -0
  11. package/dist/agent-registry.d.ts +92 -0
  12. package/dist/agent-registry.d.ts.map +1 -0
  13. package/dist/agent-registry.js +134 -0
  14. package/dist/agent-runtime.d.ts +147 -0
  15. package/dist/agent-runtime.d.ts.map +1 -0
  16. package/dist/agent-runtime.js +240 -0
  17. package/dist/agent.d.ts +132 -0
  18. package/dist/agent.d.ts.map +1 -0
  19. package/dist/agent.js +58 -0
  20. package/dist/capability.d.ts +21 -0
  21. package/dist/capability.d.ts.map +1 -0
  22. package/dist/capability.js +23 -0
  23. package/dist/collection.d.ts +95 -0
  24. package/dist/collection.d.ts.map +1 -0
  25. package/dist/collection.js +289 -0
  26. package/dist/db.d.ts +504 -0
  27. package/dist/db.d.ts.map +1 -0
  28. package/dist/db.js +700 -0
  29. package/dist/execution.d.ts +148 -0
  30. package/dist/execution.d.ts.map +1 -0
  31. package/dist/execution.js +18 -0
  32. package/dist/feltdb.d.ts +82 -0
  33. package/dist/feltdb.d.ts.map +1 -0
  34. package/dist/feltdb.js +6 -0
  35. package/dist/flowspec.d.ts +64 -0
  36. package/dist/flowspec.d.ts.map +1 -0
  37. package/dist/flowspec.js +272 -0
  38. package/dist/http-db.d.ts +50 -0
  39. package/dist/http-db.d.ts.map +1 -0
  40. package/dist/http-db.js +205 -0
  41. package/dist/index.d.ts +32 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +27 -0
  44. package/dist/indexeddb-db.d.ts +54 -0
  45. package/dist/indexeddb-db.d.ts.map +1 -0
  46. package/dist/indexeddb-db.js +175 -0
  47. package/dist/memory-db.d.ts +49 -0
  48. package/dist/memory-db.d.ts.map +1 -0
  49. package/dist/memory-db.js +97 -0
  50. package/dist/operation.d.ts +25 -0
  51. package/dist/operation.d.ts.map +1 -0
  52. package/dist/operation.js +16 -0
  53. package/dist/reactive-graph.d.ts +67 -0
  54. package/dist/reactive-graph.d.ts.map +1 -0
  55. package/dist/reactive-graph.js +118 -0
  56. package/dist/recovery.d.ts +68 -0
  57. package/dist/recovery.d.ts.map +1 -0
  58. package/dist/recovery.js +104 -0
  59. package/dist/storage.d.ts +48 -0
  60. package/dist/storage.d.ts.map +1 -0
  61. package/dist/storage.js +6 -0
  62. package/dist/workflow.d.ts +20 -0
  63. package/dist/workflow.d.ts.map +1 -0
  64. package/dist/workflow.js +12 -0
  65. package/package.json +43 -0
package/dist/db.d.ts ADDED
@@ -0,0 +1,504 @@
1
+ /**
2
+ * FeltDB State-First Database API
3
+ *
4
+ * High-level, application-facing API that treats FeltDB as application state.
5
+ * Persistence, indexing, and reactivity are completely transparent.
6
+ */
7
+ import type { JsDb } from './feltdb.js';
8
+ import { Collection, Relationship } from './collection.js';
9
+ import type { AgentRef, AgentDefinition, AgentExecution } from './agent.js';
10
+ import { AgentRegistry } from './agent-registry.js';
11
+ import { AgentRuntime } from './agent-runtime.js';
12
+ import type { FlowSpec } from './flowspec.js';
13
+ interface FeltDBBaseOptions {
14
+ namespace: string;
15
+ }
16
+ export type FeltDBOptions = FeltDBBaseOptions & ({
17
+ server: {
18
+ url: string;
19
+ token: string;
20
+ };
21
+ memory?: never;
22
+ } | {
23
+ memory: true;
24
+ server?: never;
25
+ } | {
26
+ browser: true;
27
+ memory?: never;
28
+ server?: never;
29
+ });
30
+ export declare function createFeltDB(options: FeltDBOptions): StateFirstDB;
31
+ /**
32
+ * Runtime information about the FeltDB instance
33
+ */
34
+ export interface RuntimeInfo {
35
+ /** The runtime environment (e.g., 'wasm', 'node', 'browser') */
36
+ runtime: 'wasm' | 'node' | 'browser' | 'remote';
37
+ /** The storage backend being used (e.g., 'memory', 'file', 'opfs', 'indexeddb') */
38
+ storage: string;
39
+ /** Whether the database is persistent (durable across restarts) */
40
+ persistent: boolean;
41
+ /** Whether mutations are reactive (subscribers notified automatically) */
42
+ reactive: boolean;
43
+ /** Whether mutations are durable (persisted before returning) */
44
+ durable: boolean;
45
+ /** FeltDB version */
46
+ version: string;
47
+ /** Whether checkpointing/compaction is supported */
48
+ supportsCheckpointing: boolean;
49
+ /** Whether lifecycle events are supported (open/close/reload) */
50
+ supportsLifecycle: boolean;
51
+ }
52
+ /**
53
+ * Sync state information
54
+ */
55
+ export interface SyncInfo {
56
+ /** This instance's ID */
57
+ instance_id: string;
58
+ /** Current sequence number for this instance */
59
+ sequence: number;
60
+ /** Connected peers */
61
+ connected_peers: string[];
62
+ /** Pending operations waiting to be synced */
63
+ pending_operations: number;
64
+ /** Operations sent to peers */
65
+ operations_sent: number;
66
+ /** Operations received from peers */
67
+ operations_received: number;
68
+ /** Conflicts detected */
69
+ conflicts_detected: number;
70
+ /** Last sync timestamp */
71
+ last_sync_ms: number;
72
+ /** Is currently connected to network */
73
+ is_connected: boolean;
74
+ }
75
+ /**
76
+ * A durable operation for synchronization
77
+ */
78
+ export interface Operation {
79
+ /** Unique operation ID (monotonically increasing) */
80
+ op_id: number;
81
+ /** Instance ID - unique identifier for the FeltDB instance that created this operation */
82
+ instance_id: string;
83
+ /** Sequence number - monotonically increasing sequence per instance */
84
+ sequence: number;
85
+ /** Type of operation (Insert, Update, Delete) */
86
+ op_type: 'Insert' | 'Update' | 'Delete';
87
+ /** The key being operated on (e.g., "users:123") */
88
+ key: string;
89
+ /** The value (for insert/update operations) */
90
+ value?: any;
91
+ /** Timestamp in milliseconds since UNIX epoch */
92
+ timestamp_ms: number;
93
+ /** The data type being operated on */
94
+ rust_type: string;
95
+ /** Capability/namespace */
96
+ capability: string;
97
+ }
98
+ export interface AuditEvent {
99
+ sequence: number;
100
+ collection: string;
101
+ key: string;
102
+ type: 'put' | 'delete';
103
+ timestamp: number;
104
+ }
105
+ export interface EmbeddedOperation {
106
+ id: string;
107
+ origin: string;
108
+ sequence: number;
109
+ collection: string;
110
+ key: string;
111
+ type: 'put' | 'delete';
112
+ value?: unknown;
113
+ timestamp: number;
114
+ }
115
+ /**
116
+ * Provenance edge types describing relationships in the causal graph
117
+ */
118
+ export type ProvenanceEdgeType = 'CreatedBy' | 'InputTo' | 'ProducedBy' | 'ExecutedBy' | 'DerivedFrom' | 'TriggeredBy' | 'ResolvedFrom' | 'AcquiredFrom';
119
+ /**
120
+ * A node in the provenance graph
121
+ */
122
+ export interface ProvenanceNode {
123
+ /** Unique identifier for this node */
124
+ id: string;
125
+ /** Type of node (Record, Workflow, Execution, Capability, Agent, etc.) */
126
+ type: string;
127
+ /** Human-readable label */
128
+ label: string;
129
+ /** Additional metadata about this node */
130
+ metadata?: Record<string, any>;
131
+ /** Timestamp when this node was created */
132
+ created_ms: number;
133
+ }
134
+ /**
135
+ * An edge in the provenance graph connecting two nodes
136
+ */
137
+ export interface ProvenanceEdge {
138
+ /** Source node ID */
139
+ from: string;
140
+ /** Target node ID */
141
+ to: string;
142
+ /** Type of relationship */
143
+ edgeType: ProvenanceEdgeType;
144
+ /** Additional metadata about the edge */
145
+ metadata?: Record<string, any>;
146
+ }
147
+ /**
148
+ * A causal graph representing the provenance of a record/flow
149
+ */
150
+ export interface ProvenanceGraph {
151
+ /** The root node (the record/flow being inspected) */
152
+ root: ProvenanceNode;
153
+ /** All nodes in the graph */
154
+ nodes: ProvenanceNode[];
155
+ /** All edges in the graph */
156
+ edges: ProvenanceEdge[];
157
+ }
158
+ /**
159
+ * Runtime diagnostics and health status
160
+ */
161
+ export interface RuntimeDiagnostics {
162
+ /** Runtime component status */
163
+ runtime: {
164
+ status: 'healthy' | 'degraded' | 'unhealthy';
165
+ wasm: boolean;
166
+ reactive: boolean;
167
+ };
168
+ /** Storage component status */
169
+ storage: {
170
+ status: 'healthy' | 'degraded' | 'unhealthy';
171
+ backend: string;
172
+ persistent: boolean;
173
+ durable: boolean;
174
+ };
175
+ /** Synchronization status */
176
+ sync: {
177
+ status: 'healthy' | 'degraded' | 'unhealthy';
178
+ connected: boolean;
179
+ peers: number;
180
+ pendingOperations: number;
181
+ };
182
+ /** Distributed fabric status */
183
+ fabric: {
184
+ status: 'healthy' | 'degraded' | 'unhealthy';
185
+ references: number;
186
+ peers: number;
187
+ };
188
+ /** Capability router status */
189
+ capabilities: {
190
+ status: 'healthy' | 'degraded' | 'unhealthy';
191
+ count: number;
192
+ available: number;
193
+ };
194
+ /** Execution runtime status */
195
+ execution: {
196
+ status: 'healthy' | 'degraded' | 'unhealthy';
197
+ pending: number;
198
+ running: number;
199
+ failed: number;
200
+ };
201
+ /** Workflow status */
202
+ workflow: {
203
+ status: 'healthy' | 'degraded' | 'unhealthy';
204
+ total: number;
205
+ active: number;
206
+ };
207
+ /** Overall system health status */
208
+ status: 'healthy' | 'degraded' | 'unhealthy';
209
+ /** Issues detected (warnings or errors) */
210
+ issues: Array<{
211
+ severity: 'info' | 'warning' | 'error';
212
+ component: string;
213
+ message: string;
214
+ }>;
215
+ }
216
+ /**
217
+ * State-first database interface.
218
+ * Applications use this to treat FeltDB collections as live application state.
219
+ */
220
+ export declare class StateFirstDB {
221
+ private jsDb;
222
+ private collections;
223
+ private runtimeInfo;
224
+ private agentRegistry;
225
+ private agentRuntime;
226
+ private capabilityWorkers;
227
+ constructor(jsDb: JsDb);
228
+ /**
229
+ * Detect runtime environment and storage characteristics
230
+ */
231
+ private detectRuntime;
232
+ /**
233
+ * Get runtime information about this FeltDB instance.
234
+ *
235
+ * Useful for testing and debugging without contaminating the normal API.
236
+ *
237
+ * @example
238
+ * const runtime = db.runtime();
239
+ * console.log(`Using ${runtime.storage} storage in ${runtime.runtime}`);
240
+ */
241
+ runtime(): RuntimeInfo;
242
+ /**
243
+ * Get or create a collection.
244
+ *
245
+ * Collections are live application state - they automatically update
246
+ * whenever underlying data changes. No manual refresh() or invalidate() needed.
247
+ *
248
+ * @example
249
+ * const tasks = db.collection("tasks");
250
+ * const task = await tasks.get(123);
251
+ * const allActive = await tasks.where(t => t.status === "active").all();
252
+ */
253
+ collection<T>(name: string): Collection<T>;
254
+ /** Resolve local state, causally acquiring it from configured peers when absent. */
255
+ acquire<T>(collection: string, id: string): Promise<T | null>;
256
+ /** Search canonical collection state locally or through the remote capability surface. */
257
+ search<T>(collection: string, query: string, limit?: number): Promise<T[]>;
258
+ /** Install a resource-bounded declarative capability program. */
259
+ defineCapability(name: string, steps: Array<Record<string, unknown>>): Promise<any>;
260
+ /** Attach executable behavior to a capability in an embedded runtime. */
261
+ registerCapabilityWorker<I = unknown, O = unknown>(name: string, handler: (input: I) => Promise<O>): () => void;
262
+ executeCapability<T = unknown>(name: string, input: unknown): Promise<T>;
263
+ /** Joint-consensus membership change. `members` contains every voting node, including this node. */
264
+ changeClusterMembership(expectedEpoch: number, members: string[]): Promise<any>;
265
+ /** Version and deploy one canonical application model into FeltDB primitives. */
266
+ deployFlowSpec(spec: FlowSpec, expectedVersion?: number, allowDestructive?: boolean): Promise<{
267
+ app: string;
268
+ version: number;
269
+ status: 'active';
270
+ }>;
271
+ /** Read the runtime's durable local mutation log for inspection and audit. */
272
+ auditEvents(): Promise<AuditEvent[]>;
273
+ /** Export durable embedded operations for transport over any application channel. */
274
+ exportOperations(sinceSequence?: number): Promise<EmbeddedOperation[]>;
275
+ /** Merge operations from another embedded replica and notify live collections. */
276
+ applyOperations(operations: EmbeddedOperation[]): Promise<{
277
+ applied: number;
278
+ ignored: number;
279
+ }>;
280
+ /** Exchange durable operations with another embedded replica in both directions. */
281
+ synchronizeWith(peer: StateFirstDB): Promise<{
282
+ sent: number;
283
+ received: number;
284
+ applied: number;
285
+ ignored: number;
286
+ }>;
287
+ /** Route a capability to the first available embedded provider and audit failover attempts. */
288
+ executeCapabilityWithFailover<T = unknown>(name: string, input: unknown, providers?: StateFirstDB[]): Promise<{
289
+ output: T;
290
+ provider: string;
291
+ attempts: number;
292
+ }>;
293
+ /** Inspect the causal operation that currently materializes a remote record. */
294
+ recordProvenance(collection: string, id: string): Promise<any>;
295
+ /** Persist immutable content by hash; repeated bytes deduplicate automatically. */
296
+ storeContent(content: Uint8Array): Promise<{
297
+ hash: string;
298
+ bytes: number;
299
+ ref: string;
300
+ }>;
301
+ /** Resolve verified immutable content locally or from configured peers. */
302
+ acquireContent(hash: string): Promise<Uint8Array | null>;
303
+ /** Define a durable workflow whose lifecycle is ordinary replicated state. */
304
+ defineWorkflow(name: string, steps: string[]): Promise<any>;
305
+ startWorkflow(name: string, input?: unknown): Promise<any>;
306
+ claimWorkflowStep(runId: string, step: string, worker: string, leaseMs?: number): Promise<any>;
307
+ completeWorkflowStep(runId: string, step: string, claimId: string, result?: unknown): Promise<any>;
308
+ /** Define and start state-first agents; workers observe and advance these records externally. */
309
+ defineStateAgent(name: string, capabilities?: string[], constraints?: unknown): Promise<any>;
310
+ startStateAgent(name: string, goal: string, input?: unknown): Promise<any>;
311
+ /**
312
+ * Define an agent with declarative configuration.
313
+ *
314
+ * Agents are durable, addressable participants in the FeltDB fabric.
315
+ *
316
+ * @example
317
+ * const researcher = db.defineAgent({
318
+ * name: "researcher",
319
+ * version: 1,
320
+ * capabilities: ["vector-search", "document-read", "report-write"],
321
+ * constraints: { maxLatency: 5000 }
322
+ * });
323
+ */
324
+ defineAgent(definition: AgentDefinition): AgentRef;
325
+ /**
326
+ * Get an agent by name.
327
+ *
328
+ * Returns the latest version of the agent if it exists.
329
+ *
330
+ * @example
331
+ * const researcher = db.agent("researcher");
332
+ */
333
+ agent(name: string): AgentRef | undefined;
334
+ /**
335
+ * Get the agent registry
336
+ */
337
+ getAgentRegistry(): AgentRegistry;
338
+ /**
339
+ * Get the agent runtime
340
+ */
341
+ getAgentRuntime(): AgentRuntime;
342
+ /**
343
+ * Create an agent execution
344
+ */
345
+ createAgentExecution(agentRef: AgentRef, goal: string, inputs: string[]): Promise<AgentExecution>;
346
+ private agentExecutionRecord;
347
+ /** Claim and durably materialize an embedded agent execution. */
348
+ startAgentExecution(execution: AgentExecution, peerId?: string): Promise<void>;
349
+ /** Advance an agent lifecycle and expose the transition as ordinary state. */
350
+ transitionAgentExecution(execution: AgentExecution, status: import('./agent.js').AgentExecutionStatus): Promise<void>;
351
+ completeAgentExecution(execution: AgentExecution, resultRef: string): Promise<void>;
352
+ failAgentExecution(execution: AgentExecution, error: string): Promise<void>;
353
+ /**
354
+ * Close the database and clean up resources.
355
+ */
356
+ close(): Promise<void>;
357
+ /**
358
+ * Get current sync state information.
359
+ *
360
+ * @example
361
+ * const syncState = db.sync();
362
+ * console.log(`Connected to ${syncState.connected_peers.length} peers`);
363
+ */
364
+ sync(): SyncInfo;
365
+ /**
366
+ * Add a peer for synchronization.
367
+ *
368
+ * @example
369
+ * await db.addSyncPeer('peer-123');
370
+ */
371
+ addSyncPeer(peerId: string): Promise<void>;
372
+ /**
373
+ * Remove a peer from synchronization.
374
+ *
375
+ * @example
376
+ * await db.removeSyncPeer('peer-123');
377
+ */
378
+ removeSyncPeer(peerId: string): Promise<void>;
379
+ /**
380
+ * Get pending operations for a peer.
381
+ *
382
+ * @example
383
+ * const ops = await db.getPendingForPeer('peer-123', 5);
384
+ */
385
+ getPendingForPeer(peerId: string, sinceSequence: number): Promise<Operation[]>;
386
+ /**
387
+ * Acknowledge receipt of operations from a peer.
388
+ *
389
+ * @example
390
+ * await db.acknowledgePeerOperations('peer-123', 10);
391
+ */
392
+ acknowledgePeerOperations(peerId: string, sequence: number): Promise<void>;
393
+ /**
394
+ * Get the instance ID for this FeltDB instance.
395
+ *
396
+ * @example
397
+ * const id = db.instanceId();
398
+ */
399
+ instanceId(): string;
400
+ /**
401
+ * Get the current sequence number for this instance.
402
+ *
403
+ * @example
404
+ * const seq = db.getSequence();
405
+ */
406
+ getSequence(): number;
407
+ /**
408
+ * Register a trigger that maps operations to executions
409
+ *
410
+ * @example
411
+ * await db.registerTrigger({
412
+ * triggerId: "order-created",
413
+ * capability: "process_order",
414
+ * eventType: "OrderCreated",
415
+ * collection: "orders"
416
+ * });
417
+ */
418
+ registerTrigger(trigger: any): Promise<void>;
419
+ /**
420
+ * Register a cron schedule
421
+ *
422
+ * @example
423
+ * await db.scheduleCron({
424
+ * cronId: "daily-reports",
425
+ * name: "Daily Reports",
426
+ * cronExpr: "0 0 * * *",
427
+ * capability: "generate_reports"
428
+ * });
429
+ */
430
+ scheduleCron(schedule: any): Promise<void>;
431
+ /**
432
+ * Get pending executions
433
+ *
434
+ * @example
435
+ * const pending = await db.getPendingExecutions();
436
+ */
437
+ getPendingExecutions(): Promise<any[]>;
438
+ /**
439
+ * Mark an execution as complete
440
+ *
441
+ * @example
442
+ * await db.completeExecution("exec-1", { success: true });
443
+ */
444
+ completeExecution(executionId: string, result: any): Promise<void>;
445
+ /**
446
+ * Get the causal graph (provenance) for a given flow reference.
447
+ *
448
+ * Shows how a record was created, what operations it depended on,
449
+ * which workflows/capabilities produced it, etc.
450
+ *
451
+ * @example
452
+ * const graph = db.provenance('flow://documents/report-123');
453
+ * console.log(graph.root); // The record being inspected
454
+ * console.log(graph.edges); // Relationships showing causality
455
+ */
456
+ provenance(flowRef: string): ProvenanceGraph;
457
+ /**
458
+ * Get runtime health and diagnostics information.
459
+ *
460
+ * Provides a comprehensive view of system health across all components.
461
+ * Useful for debugging distributed issues and monitoring system status.
462
+ *
463
+ * @example
464
+ * const health = db.health();
465
+ * if (health.status === 'unhealthy') {
466
+ * for (const issue of health.issues) {
467
+ * console.warn(`${issue.component}: ${issue.message}`);
468
+ * }
469
+ * }
470
+ */
471
+ health(): RuntimeDiagnostics;
472
+ }
473
+ /**
474
+ * Open a state-first database instance.
475
+ *
476
+ * The database automatically handles:
477
+ * - Persistence (transparent to application)
478
+ * - Reactive updates (live queries by default)
479
+ * - Relationship loading
480
+ * - Differential updates (single record mutations don't re-emit entire collection)
481
+ *
482
+ * @example
483
+ * const db = await open(jsDbInstance);
484
+ * const users = db.collection("users");
485
+ * users.subscribe((users) => render(users));
486
+ *
487
+ * @param jsDb The underlying JsDb WASM instance
488
+ * @returns A new StateFirstDB instance
489
+ */
490
+ export declare function open(jsDb: JsDb): Promise<StateFirstDB>;
491
+ /**
492
+ * Helper to create a relationship between two collections.
493
+ *
494
+ * @example
495
+ * const projectTasks = new Relationship(
496
+ * db.collection("tasks"),
497
+ * (task) => task.projectId
498
+ * );
499
+ *
500
+ * const tasks = await projectTasks.load(projectId);
501
+ */
502
+ export declare function createRelationship<Parent, Child>(childCollection: Collection<Child>, foreignKey: (child: Child) => string | number): Relationship<Parent, Child>;
503
+ export {};
504
+ //# sourceMappingURL=db.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAA2B,MAAM,oBAAoB,CAAC;AAI3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,CAC5C;IAAE,MAAM,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GACjB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,M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