pi-hashline-edit-pro 0.17.3 → 0.17.4

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.3",
3
+ "version": "0.17.4",
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": {
@@ -1,4 +1,5 @@
1
1
  const { execSync } = require("child_process");
2
+ const fs = require("fs");
2
3
  const path = require("path");
3
4
 
4
5
  const root = path.resolve(__dirname, "..");
@@ -8,10 +9,19 @@ try {
8
9
  process.exit(0);
9
10
  } catch (e) {
10
11
  const msg = e && typeof e.message === "string" ? e.message : String(e);
11
- if (/GLIBC|Cannot find module|dlopen|not found/i.test(msg)) {
12
+ if (/GLIBC|Cannot find module|dlo|not found/i.test(msg)) {
12
13
  console.error("better-sqlite3 prebuilt incompatible, rebuilding from source...");
14
+ const prebuildDir = path.join(root, "node_modules", "better-sqlite3", "prebuilds");
15
+ if (fs.existsSync(prebuildDir)) {
16
+ const platform = process.platform + "-" + process.arch;
17
+ const prebuilt = path.join(prebuildDir, platform + ".node");
18
+ if (fs.existsSync(prebuilt)) {
19
+ fs.unlinkSync(prebuilt);
20
+ console.error("Removed incompatible prebuilt:", platform + ".node");
21
+ }
22
+ }
13
23
  try {
14
- execSync("npm rebuild better-sqlite3 --build-from-source", {
24
+ execSync("npm rebuild better-sqlite3", {
15
25
  cwd: root,
16
26
  stdio: "inherit",
17
27
  timeout: 120000,