@rohirik/openltm-core 2.9.0 → 2.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rohirik/openltm-core",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Shared LTM storage engine — path-agnostic SQLite core used by Claude Code, OpenCode, and Pi adapters",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -14,6 +14,7 @@ import {
14
14
  MEMORY_ADDED,
15
15
  } from "../../events/index.js";
16
16
  import { _resetHonkerForTesting } from "../../lib/honker.js";
17
+ import { resetCapabilitiesForTesting } from "../../extensions.js";
17
18
 
18
19
  function seedDb(): Database {
19
20
  const db = new Database(":memory:");
@@ -25,6 +26,9 @@ describe("cross-process sync — flag + dormant contract (no honker)", () => {
25
26
  beforeEach(() => {
26
27
  _resetHonkerForTesting();
27
28
  delete process.env["LTM_HONKER_EXT"];
29
+ // Reset cached caps so a prior test's honker=true (vendored binary is
30
+ // discoverable here) does not leak in — keeps this the dormant contract.
31
+ resetCapabilitiesForTesting();
28
32
  });
29
33
  afterEach(() => {
30
34
  _resetHonkerForTesting();
@@ -7,11 +7,15 @@
7
7
  import { describe, it, expect, beforeEach } from "bun:test";
8
8
  import { notifyLtm, startLtmListener, LTM_CHANNEL } from "../../events/index.js";
9
9
  import { _resetHonkerForTesting } from "../../lib/honker.js";
10
+ import { resetCapabilitiesForTesting } from "../../extensions.js";
10
11
 
11
12
  describe("events — dormant path (no honker)", () => {
12
13
  beforeEach(() => {
13
14
  _resetHonkerForTesting();
14
15
  delete process.env["LTM_HONKER_EXT"];
16
+ // Reset cached caps so a prior test's honker=true (vendored binary is
17
+ // discoverable here) does not leak in — keeps this the dormant contract.
18
+ resetCapabilitiesForTesting();
15
19
  });
16
20
 
17
21
  it("exposes the stable channel name", () => {
@@ -15,10 +15,15 @@ import {
15
15
  } from "../../queue/index.js";
16
16
  import { startEmbeddingWorker } from "../../queue/worker.js";
17
17
  import { isHonkerAvailable, _resetHonkerForTesting } from "../../lib/honker.js";
18
+ import { resetCapabilitiesForTesting } from "../../extensions.js";
18
19
 
19
20
  describe("queue — dormant path (no honker)", () => {
20
21
  beforeEach(() => {
21
22
  _resetHonkerForTesting();
23
+ // Force the dormant contract: a prior test may have cached caps.honker=true
24
+ // process-wide (the vendored binary is discoverable here). Reset so
25
+ // getCapabilities() returns the all-false default and honker stays dormant.
26
+ resetCapabilitiesForTesting();
22
27
  });
23
28
 
24
29
  it("EMBED_QUEUE has a stable name", () => {
@@ -13,11 +13,15 @@ import {
13
13
  DEFAULT_JANITOR_CRON,
14
14
  } from "../../scheduler/index.js";
15
15
  import { _resetHonkerForTesting } from "../../lib/honker.js";
16
+ import { resetCapabilitiesForTesting } from "../../extensions.js";
16
17
 
17
18
  describe("scheduler — dormant path (no honker)", () => {
18
19
  beforeEach(() => {
19
20
  _resetHonkerForTesting();
20
21
  delete process.env["LTM_HONKER_EXT"];
22
+ // Reset cached caps so a prior test's honker=true (vendored binary is
23
+ // discoverable here) does not leak in — keeps this the dormant contract.
24
+ resetCapabilitiesForTesting();
21
25
  });
22
26
 
23
27
  it("exposes stable names + default cron", () => {
package/src/extensions.ts CHANGED
@@ -105,8 +105,16 @@ export function ensureCustomSqlite(): boolean {
105
105
  const lib = locateSystemSqlite();
106
106
  if (!lib) return false;
107
107
  try {
108
- (Database as unknown as { setCustomSQLite: (p: string) => void }).setCustomSQLite(lib);
108
+ const DB = Database as unknown as { setCustomSQLite: (p: string) => void };
109
+ DB.setCustomSQLite(lib);
109
110
  _customSqliteApplied = true;
111
+ // setCustomSQLite is a once-per-process global (Bun throws "SQLite already
112
+ // loaded" on a second call). honker-bun's open() calls it again on its own
113
+ // connection and would throw — silently killing the honker handle even
114
+ // though the extension-enabled SQLite is already active process-wide. Now
115
+ // that we've loaded it, neutralise further calls so honker-bun (and any
116
+ // other consumer) no-ops instead of throwing.
117
+ DB.setCustomSQLite = () => {};
110
118
  return true;
111
119
  } catch {
112
120
  return false;