@getbourdon/participants 0.4.0 → 0.5.0-rc.2

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.
@@ -17,8 +17,7 @@
17
17
  import type DatabaseT from "better-sqlite3";
18
18
  /** A better-sqlite3 connection (re-exported type alias for reader signatures). */
19
19
  export type SqliteDatabase = DatabaseT.Database;
20
- /** True when the better-sqlite3 native addon loaded successfully. Tests gate
21
- * the SQLite-reader assertions on this so a missing addon skips, not fails. */
20
+ /** True when the native addon can open and close a disposable in-memory DB. */
22
21
  export declare function sqliteAvailable(): boolean;
23
22
  export interface OpenReadonlyOptions {
24
23
  /** `immutable=1`: skip locks + ignore the WAL. Only for genuinely static
@@ -21,6 +21,7 @@ const moduleUrl = (typeof import.meta !== "undefined" && import.meta.url) ||
21
21
  (typeof __filename !== "undefined" ? __filename : process.cwd());
22
22
  const nodeRequire = createRequire(moduleUrl);
23
23
  let driver;
24
+ let nativeAvailable;
24
25
  /** Lazily resolve the better-sqlite3 constructor, or null if the addon is
25
26
  * unavailable (failed native build). Cached after the first attempt. */
26
27
  function loadDriver() {
@@ -34,10 +35,22 @@ function loadDriver() {
34
35
  }
35
36
  return driver;
36
37
  }
37
- /** True when the better-sqlite3 native addon loaded successfully. Tests gate
38
- * the SQLite-reader assertions on this so a missing addon skips, not fails. */
38
+ /** True when the native addon can open and close a disposable in-memory DB. */
39
39
  export function sqliteAvailable() {
40
- return loadDriver() !== null;
40
+ if (nativeAvailable !== undefined)
41
+ return nativeAvailable;
42
+ const Ctor = loadDriver();
43
+ if (!Ctor)
44
+ return (nativeAvailable = false);
45
+ try {
46
+ const probe = new Ctor(":memory:");
47
+ probe.close();
48
+ nativeAvailable = true;
49
+ }
50
+ catch {
51
+ nativeAvailable = false;
52
+ }
53
+ return nativeAvailable;
41
54
  }
42
55
  // -- Read-only connection -----------------------------------------------------
43
56
  /**
@@ -135,7 +148,10 @@ export function epochToIsoDatetime(value) {
135
148
  const d = new Date(n * 1000);
136
149
  if (Number.isNaN(d.getTime()))
137
150
  return null;
138
- return d.toISOString().replace(/\.\d{3}Z$/, "+00:00").replace(/Z$/, "+00:00");
151
+ return d
152
+ .toISOString()
153
+ .replace(/\.\d{3}Z$/, "+00:00")
154
+ .replace(/Z$/, "+00:00");
139
155
  }
140
156
  function basenameOf(p) {
141
157
  const trimmed = p.replace(/[\\/]+$/, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getbourdon/participants",
3
- "version": "0.4.0",
3
+ "version": "0.5.0-rc.2",
4
4
  "description": "Bourdon participants — the external-agent → L5 reader layer (BUSL-1.1). Each participant normalizes a foreign agent's native memory store into a visibility-filtered, redacted L5 manifest: read-only SQLite readers (better-sqlite3 mode=ro: hermes), file/convention readers (claude-code), and network readers (github-copilot) with a TTL JSON cache + lazy AuthProvider that never persists a token. Four invariants enforced in code, not by trust: visibility-filter-before-emission, deterministic exportL5, healthCheck never throws, redact every native string. Discovery is a static TS registry (agent_id-sorted, first-wins, log-and-skip) replacing Python's pkgutil scan. Python (pip install bourdon) is the oracle; this mirror asserts against @getbourdon/conformance native_stores fixtures.",
5
5
  "license": "BUSL-1.1",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "LICENSE_FAQ.md"
21
21
  ],
22
22
  "engines": {
23
- "node": ">=20"
23
+ "node": ">=24.0.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public",
@@ -35,15 +35,15 @@
35
35
  "dependencies": {
36
36
  "smol-toml": "^1.7.1",
37
37
  "yaml": "^2.6.1",
38
- "@getbourdon/l5": "0.5.0",
39
- "@getbourdon/redaction": "0.1.6"
38
+ "@getbourdon/l5": "0.6.0-rc.2",
39
+ "@getbourdon/redaction": "0.3.0-rc.2"
40
40
  },
41
41
  "optionalDependencies": {
42
42
  "better-sqlite3": "^12.2.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/better-sqlite3": "^7.6.12",
46
- "@getbourdon/conformance": "0.8.0"
46
+ "@getbourdon/conformance": "0.10.0-rc.2"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsup",