swarm-mail 0.1.4 → 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.
- package/bin/daemon-cli.ts +304 -0
- package/dist/daemon.d.ts +139 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1915 -32
- package/dist/pglite.d.ts +69 -4
- package/dist/pglite.d.ts.map +1 -1
- package/dist/socket-adapter.d.ts +78 -0
- package/dist/socket-adapter.d.ts.map +1 -0
- package/dist/streams/effect/ask.integration-test.d.ts +8 -0
- package/dist/streams/effect/ask.integration-test.d.ts.map +1 -0
- package/dist/streams/effect/cursor.integration-test.d.ts +2 -0
- package/dist/streams/effect/cursor.integration-test.d.ts.map +1 -0
- package/dist/streams/index.d.ts.map +1 -1
- package/dist/streams/leader-election.d.ts +44 -0
- package/dist/streams/leader-election.d.ts.map +1 -0
- package/dist/streams/store.integration-test.d.ts +2 -0
- package/dist/streams/store.integration-test.d.ts.map +1 -0
- package/package.json +15 -5
package/dist/pglite.d.ts
CHANGED
|
@@ -33,10 +33,35 @@ import type { DatabaseAdapter, SwarmMailAdapter } from "./types";
|
|
|
33
33
|
*/
|
|
34
34
|
export declare function wrapPGlite(pglite: PGlite): DatabaseAdapter;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Generate a short hash for a project path
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Uses SHA256 and takes first 8 characters for uniqueness.
|
|
39
|
+
*
|
|
40
|
+
* @param projectPath - Project root path
|
|
41
|
+
* @returns 8-character hash string
|
|
42
|
+
*/
|
|
43
|
+
export declare function hashProjectPath(projectPath: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get a human-readable project identifier with hash suffix
|
|
46
|
+
*
|
|
47
|
+
* Format: `opencode-<project-name>-<hash>`
|
|
48
|
+
* Example: `opencode-my-project-a1b2c3d4`
|
|
49
|
+
*
|
|
50
|
+
* @param projectPath - Project root path
|
|
51
|
+
* @returns Directory name for the project's temp storage
|
|
52
|
+
*/
|
|
53
|
+
export declare function getProjectTempDirName(projectPath: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get database path in $TMPDIR (ephemeral storage)
|
|
56
|
+
*
|
|
57
|
+
* Streams data is ephemeral coordination state - messages, reservations,
|
|
58
|
+
* agent registrations. It's safe to lose on reboot since:
|
|
59
|
+
* - Beads are git-synced separately in .beads/
|
|
60
|
+
* - Semantic memory is in ~/.opencode/memory/
|
|
61
|
+
* - Agents re-register on session start
|
|
62
|
+
*
|
|
63
|
+
* Path format: `$TMPDIR/opencode-<project-name>-<hash>/streams`
|
|
64
|
+
* Falls back to global `$TMPDIR/opencode-global/streams` if no project path.
|
|
40
65
|
*
|
|
41
66
|
* @param projectPath - Optional project root path
|
|
42
67
|
* @returns Absolute path to database directory
|
|
@@ -48,19 +73,59 @@ export declare function getDatabasePath(projectPath?: string): string;
|
|
|
48
73
|
* Uses singleton pattern - one instance per database path.
|
|
49
74
|
* Safe to call multiple times for the same project.
|
|
50
75
|
*
|
|
76
|
+
* **Socket Mode (SWARM_MAIL_SOCKET=true):**
|
|
77
|
+
* - Checks if daemon is running, starts if needed
|
|
78
|
+
* - Validates health before connecting
|
|
79
|
+
* - Falls back to embedded PGLite on any failure
|
|
80
|
+
*
|
|
81
|
+
* **Embedded Mode (default):**
|
|
82
|
+
* - Uses embedded PGLite database
|
|
83
|
+
* - No daemon required
|
|
84
|
+
*
|
|
51
85
|
* @param projectPath - Optional project root path (defaults to global)
|
|
52
86
|
* @returns SwarmMailAdapter instance
|
|
53
87
|
*
|
|
54
88
|
* @example
|
|
55
89
|
* ```typescript
|
|
56
|
-
* // Project-local database
|
|
90
|
+
* // Project-local database (embedded or socket based on env)
|
|
57
91
|
* const swarmMail = await getSwarmMail('/path/to/project');
|
|
58
92
|
*
|
|
59
93
|
* // Global database (shared across all projects)
|
|
60
94
|
* const swarmMail = await getSwarmMail();
|
|
95
|
+
*
|
|
96
|
+
* // Explicit socket mode
|
|
97
|
+
* process.env.SWARM_MAIL_SOCKET = 'true';
|
|
98
|
+
* const swarmMail = await getSwarmMail('/path/to/project');
|
|
61
99
|
* ```
|
|
62
100
|
*/
|
|
63
101
|
export declare function getSwarmMail(projectPath?: string): Promise<SwarmMailAdapter>;
|
|
102
|
+
/**
|
|
103
|
+
* Get SwarmMail instance using socket adapter (explicit socket mode)
|
|
104
|
+
*
|
|
105
|
+
* Always uses socket connection to pglite-server daemon.
|
|
106
|
+
* Auto-starts daemon if not running, validates health before connecting.
|
|
107
|
+
*
|
|
108
|
+
* **Port/Path Resolution:**
|
|
109
|
+
* - Checks SWARM_MAIL_SOCKET_PATH env var for Unix socket
|
|
110
|
+
* - Falls back to TCP on SWARM_MAIL_SOCKET_PORT (default: 5433)
|
|
111
|
+
* - Host defaults to 127.0.0.1
|
|
112
|
+
*
|
|
113
|
+
* @param projectPath - Optional project root path
|
|
114
|
+
* @returns SwarmMailAdapter instance using socket connection
|
|
115
|
+
* @throws Error if daemon fails to start or health check fails
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* // Unix socket (preferred)
|
|
120
|
+
* process.env.SWARM_MAIL_SOCKET_PATH = '/tmp/swarm-mail.sock';
|
|
121
|
+
* const swarmMail = await getSwarmMailSocket('/path/to/project');
|
|
122
|
+
*
|
|
123
|
+
* // TCP socket
|
|
124
|
+
* process.env.SWARM_MAIL_SOCKET_PORT = '5433';
|
|
125
|
+
* const swarmMail = await getSwarmMailSocket('/path/to/project');
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare function getSwarmMailSocket(projectPath?: string): Promise<SwarmMailAdapter>;
|
|
64
129
|
/**
|
|
65
130
|
* Create in-memory SwarmMail instance (for testing)
|
|
66
131
|
*
|
package/dist/pglite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pglite.d.ts","sourceRoot":"","sources":["../src/pglite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"pglite.d.ts","sourceRoot":"","sources":["../src/pglite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQjE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAQ1D;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQjE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB5D;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,YAAY,CAChC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA+B3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAS3B;AA0DD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,SAAS,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAUvD;AAGD,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Socket Adapter - postgres.js wrapper for DatabaseAdapter interface
|
|
3
|
+
*
|
|
4
|
+
* Wraps postgres.js client to match DatabaseAdapter interface, supporting both
|
|
5
|
+
* TCP (host/port) and Unix socket (path) connections.
|
|
6
|
+
*
|
|
7
|
+
* ## Usage
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // TCP connection
|
|
10
|
+
* const sql = postgres({ host: '127.0.0.1', port: 5432 });
|
|
11
|
+
* const db = wrapPostgres(sql);
|
|
12
|
+
*
|
|
13
|
+
* // Unix socket connection
|
|
14
|
+
* const sql = postgres({ path: '/tmp/pglite.sock' });
|
|
15
|
+
* const db = wrapPostgres(sql);
|
|
16
|
+
*
|
|
17
|
+
* // Factory function
|
|
18
|
+
* const db = await createSocketAdapter({ path: '/tmp/pglite.sock' });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import postgres from "postgres";
|
|
22
|
+
import type { DatabaseAdapter } from "./types";
|
|
23
|
+
/**
|
|
24
|
+
* Options for socket adapter creation
|
|
25
|
+
*/
|
|
26
|
+
export interface SocketAdapterOptions {
|
|
27
|
+
/** Unix socket path */
|
|
28
|
+
path?: string;
|
|
29
|
+
/** TCP host */
|
|
30
|
+
host?: string;
|
|
31
|
+
/** TCP port */
|
|
32
|
+
port?: number;
|
|
33
|
+
/** Connection timeout in seconds */
|
|
34
|
+
timeout?: number;
|
|
35
|
+
/** Maximum number of connections */
|
|
36
|
+
max?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Wrap postgres.js client to match DatabaseAdapter interface
|
|
40
|
+
*
|
|
41
|
+
* postgres.js uses tagged template literals for queries, but DatabaseAdapter
|
|
42
|
+
* uses (sql, params) signature. This adapter bridges the difference.
|
|
43
|
+
*
|
|
44
|
+
* @param sql - postgres.js client instance
|
|
45
|
+
* @returns DatabaseAdapter compatible wrapper
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const sql = postgres({ path: '/tmp/pglite.sock' });
|
|
50
|
+
* const db = wrapPostgres(sql);
|
|
51
|
+
* const result = await db.query<{ id: number }>(
|
|
52
|
+
* "SELECT id FROM agents WHERE name = $1",
|
|
53
|
+
* ["BlueLake"]
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function wrapPostgres(sql: postgres.Sql<Record<string, unknown>>): DatabaseAdapter;
|
|
58
|
+
/**
|
|
59
|
+
* Create socket adapter with connection validation
|
|
60
|
+
*
|
|
61
|
+
* Factory function that creates postgres.js client and wraps it.
|
|
62
|
+
* Validates connection before returning adapter.
|
|
63
|
+
*
|
|
64
|
+
* @param options - Socket connection options (path OR host/port)
|
|
65
|
+
* @returns DatabaseAdapter instance
|
|
66
|
+
* @throws Error if connection fails or invalid options
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* // Unix socket
|
|
71
|
+
* const db = await createSocketAdapter({ path: '/tmp/pglite.sock' });
|
|
72
|
+
*
|
|
73
|
+
* // TCP connection
|
|
74
|
+
* const db = await createSocketAdapter({ host: '127.0.0.1', port: 5432 });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function createSocketAdapter(options: SocketAdapterOptions): Promise<DatabaseAdapter>;
|
|
78
|
+
//# sourceMappingURL=socket-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket-adapter.d.ts","sourceRoot":"","sources":["../src/socket-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,SAAS,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC3B,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,eAAe,CA8BjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,eAAe,CAAC,CAuC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.integration-test.d.ts","sourceRoot":"","sources":["../../../src/streams/effect/ask.integration-test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.integration-test.d.ts","sourceRoot":"","sources":["../../../src/streams/effect/cursor.integration-test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/streams/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/streams/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAY9C;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,CAAC,CAAC,CAQZ;AASD;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAYZ;AAwBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB5D;AA2DD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BvE;AAuFD;;GAEG;AACH,wBAAsB,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWvE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CASvD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWvE;AAwHD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAqBlB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CAkBD;AAuCD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leader Election for PGLite Multi-Process Access
|
|
3
|
+
*
|
|
4
|
+
* PGLite is single-connection only. When multiple processes (e.g., swarm workers)
|
|
5
|
+
* try to initialize PGLite at the same database path, they corrupt each other.
|
|
6
|
+
*
|
|
7
|
+
* This module implements file-based leader election:
|
|
8
|
+
* 1. Acquire exclusive lock on .opencode/streams.lock before PGLite init
|
|
9
|
+
* 2. If lock acquired → proceed with initialization
|
|
10
|
+
* 3. If lock fails → wait and retry (another process is initializing)
|
|
11
|
+
* 4. Release lock after initialization (PGLite handles its own internal locking)
|
|
12
|
+
*
|
|
13
|
+
* The lock is only held during initialization, not during normal operation.
|
|
14
|
+
* This prevents the WASM corruption that occurs when multiple instances
|
|
15
|
+
* try to create/open the same database files simultaneously.
|
|
16
|
+
*
|
|
17
|
+
* @see https://pglite.dev/docs/multi-tab-worker for browser equivalent
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Get the lock file path for a database path
|
|
21
|
+
*/
|
|
22
|
+
export declare function getLockFilePath(dbPath: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Acquire exclusive lock for database initialization
|
|
25
|
+
*
|
|
26
|
+
* @param dbPath - Path to the database directory
|
|
27
|
+
* @returns Release function to call when done
|
|
28
|
+
* @throws Error if lock cannot be acquired within timeout
|
|
29
|
+
*/
|
|
30
|
+
export declare function acquireInitLock(dbPath: string): Promise<() => Promise<void>>;
|
|
31
|
+
/**
|
|
32
|
+
* Check if the database is currently being initialized by another process
|
|
33
|
+
*
|
|
34
|
+
* @param dbPath - Path to the database directory
|
|
35
|
+
* @returns true if lock is held (initialization in progress)
|
|
36
|
+
*/
|
|
37
|
+
export declare function isInitializationInProgress(dbPath: string): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Force release a stale lock (use with caution)
|
|
40
|
+
*
|
|
41
|
+
* @param dbPath - Path to the database directory
|
|
42
|
+
*/
|
|
43
|
+
export declare function forceReleaseLock(dbPath: string): Promise<void>;
|
|
44
|
+
//# sourceMappingURL=leader-election.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leader-election.d.ts","sourceRoot":"","sources":["../../src/streams/leader-election.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAkBH;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGtD;AAeD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CA2C9B;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.integration-test.d.ts","sourceRoot":"","sources":["../../src/streams/store.integration-test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swarm-mail",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Event sourcing primitives for multi-agent coordination. Local-first, no external servers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"swarm-mail-daemon": "./bin/daemon-cli.ts"
|
|
10
|
+
},
|
|
8
11
|
"files": [
|
|
9
12
|
"dist",
|
|
13
|
+
"bin",
|
|
10
14
|
"README.md"
|
|
11
15
|
],
|
|
12
16
|
"exports": {
|
|
@@ -22,21 +26,27 @@
|
|
|
22
26
|
"author": "Joel Hooks",
|
|
23
27
|
"license": "MIT",
|
|
24
28
|
"scripts": {
|
|
25
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target node --external @electric-sql/pglite && tsc",
|
|
26
|
-
"test": "
|
|
27
|
-
"test:
|
|
28
|
-
"test:
|
|
29
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target node --external @electric-sql/pglite --external postgres && tsc",
|
|
30
|
+
"test": "bun test src/streams/ --timeout 60000",
|
|
31
|
+
"test:beads": "bun test src/beads/ --timeout 60000",
|
|
32
|
+
"test:integration": "vitest run src/streams/**/*.integration-test.ts --testTimeout 60000",
|
|
33
|
+
"test:all": "bun test src/ --timeout 60000",
|
|
29
34
|
"typecheck": "tsc --noEmit",
|
|
30
35
|
"publish:pkg": "npm publish --access public --provenance"
|
|
31
36
|
},
|
|
32
37
|
"dependencies": {
|
|
33
38
|
"@electric-sql/pglite": "0.3.14",
|
|
39
|
+
"@electric-sql/pglite-socket": "^0.0.19",
|
|
34
40
|
"effect": "^3.19.12",
|
|
35
41
|
"minimatch": "^10.1.1",
|
|
36
42
|
"nanoid": "^5.1.6",
|
|
43
|
+
"postgres": "^3.4.7",
|
|
44
|
+
"proper-lockfile": "^4.1.2",
|
|
37
45
|
"zod": "4.1.8"
|
|
38
46
|
},
|
|
39
47
|
"devDependencies": {
|
|
48
|
+
"@types/node": "^25.0.3",
|
|
49
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
40
50
|
"bun-types": "^1.3.4",
|
|
41
51
|
"typescript": "^5.7.2",
|
|
42
52
|
"vitest": "^2.1.8"
|