pi-hashline-edit-pro 0.17.2 → 0.17.3

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.2",
3
+ "version": "0.17.3",
4
4
  "description": "Strict hashline read/replace tool for pi-coding-agent with hash-anchored edits (3-char, 18-bit, perfect hashing)",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -23,7 +23,8 @@
23
23
  "src",
24
24
  "prompts",
25
25
  "README.md",
26
- "LICENSE"
26
+ "LICENSE",
27
+ "scripts"
27
28
  ],
28
29
  "pi": {
29
30
  "extensions": [
@@ -31,6 +32,7 @@
31
32
  ]
32
33
  },
33
34
  "dependencies": {
35
+ "better-sqlite3": "^13.0.1",
34
36
  "diff": "^8.0.2",
35
37
  "file-type": "^21.3.0",
36
38
  "sql.js": "1.11",
@@ -48,9 +50,13 @@
48
50
  },
49
51
  "devDependencies": {
50
52
  "@earendil-works/pi-coding-agent": "^0.74.0",
53
+ "@types/better-sqlite3": "^7.6.13",
51
54
  "@types/node": "^22.0.0",
52
55
  "@types/sql.js": "^1.4.11",
53
56
  "typescript": "^5.8.0",
54
57
  "vitest": "^4.1.8"
58
+ },
59
+ "allowScripts": {
60
+ "better-sqlite3@13.0.1": true
55
61
  }
56
62
  }
@@ -0,0 +1,26 @@
1
+ const { execSync } = require("child_process");
2
+ const path = require("path");
3
+
4
+ const root = path.resolve(__dirname, "..");
5
+
6
+ try {
7
+ require(path.join(root, "node_modules", "better-sqlite3"));
8
+ process.exit(0);
9
+ } catch (e) {
10
+ const msg = e && typeof e.message === "string" ? e.message : String(e);
11
+ if (/GLIBC|Cannot find module|dlopen|not found/i.test(msg)) {
12
+ console.error("better-sqlite3 prebuilt incompatible, rebuilding from source...");
13
+ try {
14
+ execSync("npm rebuild better-sqlite3 --build-from-source", {
15
+ cwd: root,
16
+ stdio: "inherit",
17
+ timeout: 120000,
18
+ });
19
+ console.error("better-sqlite3 rebuilt successfully from source.");
20
+ } catch (rebuildErr) {
21
+ console.error("better-sqlite3 rebuild failed:", rebuildErr.message);
22
+ console.error("Will fall back to sql.js at runtime.");
23
+ process.exit(0);
24
+ }
25
+ }
26
+ }