pi-hashline-edit-pro 0.17.6 → 0.17.8

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": "pi-hashline-edit-pro",
3
- "version": "0.17.6",
3
+ "version": "0.17.8",
4
4
  "type": "module",
5
5
  "description": "Strict hashline read/replace tool for pi-coding-agent with hash-anchored edits (3-char, 18-bit, perfect hashing)",
6
6
  "main": "index.ts",
@@ -48,8 +48,8 @@
48
48
  "test:watch": "vitest",
49
49
  "lint": "eslint 'src/**/*.ts' 'index.ts'",
50
50
  "typecheck": "tsc --noEmit",
51
- "postinstall": "node scripts/ensure-better-sqlite3.js",
52
- "preuninstall": "node scripts/cleanup-better-sqlite3.js"
51
+ "postinstall": "node scripts/ensure-better-sqlite3.cjs",
52
+ "preuninstall": "node scripts/cleanup-better-sqlite3.cjs"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@earendil-works/pi-coding-agent": "^0.74.0",
package/src/hash-store.ts CHANGED
@@ -213,7 +213,14 @@ export async function loadHashStore(): Promise<HashStore> {
213
213
 
214
214
  let handle: BackendHandle;
215
215
  if (BetterDatabase) {
216
- handle = openBetterDb(storePath);
216
+ try {
217
+ handle = openBetterDb(storePath);
218
+ } catch (error) {
219
+ console.error('better-sqlite3 native binding failed, falling back to sql.js:', error);
220
+ BetterDatabase = null;
221
+ await ensureSqlJs();
222
+ handle = openSqlJsDb(storePath);
223
+ }
217
224
  } else {
218
225
  await ensureSqlJs();
219
226
  handle = openSqlJsDb(storePath);