pi-hashline-edit-pro 0.17.7 → 0.17.9

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/hash-store.ts +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-hashline-edit-pro",
3
- "version": "0.17.7",
3
+ "version": "0.17.9",
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",
package/src/hash-store.ts CHANGED
@@ -213,7 +213,17 @@ 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 {
219
+ const debug = process.env.PI_HASHLINE_DEBUG === "1" || process.env.PI_HASHLINE_DEBUG === "true";
220
+ if (debug) {
221
+ console.error('better-sqlite3 native binding failed, falling back to sql.js');
222
+ }
223
+ BetterDatabase = null;
224
+ await ensureSqlJs();
225
+ handle = openSqlJsDb(storePath);
226
+ }
217
227
  } else {
218
228
  await ensureSqlJs();
219
229
  handle = openSqlJsDb(storePath);