@lincoln504/pi-research 1.6.3 → 1.6.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/README.md CHANGED
@@ -44,7 +44,13 @@ npm install -g @lincoln504/pi-research
44
44
  pi-research skill install
45
45
  ```
46
46
 
47
- On npm 12 or newer, add `--allow-scripts` to either install above. npm 12 stopped running dependency install scripts by default, and the stealth browser's native dependencies are built by one — without it searches fail with a missing-module error rather than a warning at install time.
47
+ On npm 12 or newer, allow the one install script search depends on before installing:
48
+
49
+ ```bash
50
+ npm config set allow-scripts=better-sqlite3 --location=user
51
+ ```
52
+
53
+ npm 12 stopped running dependency install scripts by default, and the stealth browser's SQLite module is built by one. Skipped, the install still succeeds with a warning — but every search fails with a missing-module error. The config covers both installs; for the standalone install, `--allow-scripts=better-sqlite3` on the `npm install -g` line also works. The bare flag allows nothing, and `pi install` accepts only the config form.
48
54
 
49
55
  In pi it works out of the box on the session's model and pi's configuration. Standalone use ([agent skill](docs/AGENT-SKILL.md) or [SDK](docs/SDK.md)) needs a model configured. See [Configuration](docs/CONFIGURATION.md). The first install downloads the stealth browser engine, which takes a few minutes.
50
56
 
@@ -47,6 +47,10 @@ npm install -g @lincoln504/pi-research
47
47
  node "<skill_dir>/scripts/run.mjs" status # verify detection
48
48
  ```
49
49
 
50
+ On npm 12 or newer, first run `npm config set allow-scripts=better-sqlite3 --location=user`:
51
+ npm 12 blocks the install script that builds the stealth browser's SQLite module, and
52
+ without it every search fails with a missing-module error.
53
+
50
54
  ### Install the skill
51
55
 
52
56
  Recommended. From the pi extension, run `/research-config` and choose
@@ -2,7 +2,7 @@
2
2
  name: pi-research
3
3
  description: "Multi-agent web research for any coding agent. Use for anything requiring current information from the internet — news, trends, product/service/company facts, statistics, people, places, events, APIs, library behavior, or 'what is X / how does X work' questions. Also use to search a local knowledge store of previously researched findings before doing live research. Powered by the pi-research engine (search, stealth scraping, security databases, Stack Exchange). Not for reading local files, running project commands, or analyzing this repository's own source."
4
4
  license: MIT
5
- metadata: { "author": "Lincoln Deen", "version": "1.6.3", "package": "@lincoln504/pi-research", "engine": "pi-research-sdk", "openclaw": { "requires": { "bins": ["node"] } } }
5
+ metadata: { "author": "Lincoln Deen", "version": "1.6.4", "package": "@lincoln504/pi-research", "engine": "pi-research-sdk", "openclaw": { "requires": { "bins": ["node"] } } }
6
6
  allowed-tools: Bash(node:*)
7
7
  ---
8
8
 
package/dist/cli.mjs CHANGED
@@ -17556,7 +17556,7 @@ async function performSearch(queries, config, signal, onProgress, container = ge
17556
17556
  if (isNativeBindingError(sampleWorkerError)) {
17557
17557
  metrics.increment("browser_search_total_failures_total", 1, { cause: "native_binding" });
17558
17558
  throw new Error(
17559
- `Search completely failed: ${reason}, all with a missing native module. This is an incomplete install, not a network problem: the browser engine's native dependencies were never built. npm 12 does not run dependency install scripts by default \u2014 reinstall allowing them (npm install @lincoln504/pi-research --allow-scripts, or npm approve-scripts --allow-scripts-pending), then retry.` + (sampleWorkerError ? ` Last worker error: ${sampleWorkerError}` : "")
17559
+ `Search completely failed: ${reason}, all with a missing native module. This is an incomplete install, not a network problem: the browser engine's native dependencies were never built. npm 12 does not run dependency install scripts by default \u2014 reinstall allowing the script (global install: npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3; project install: npm approve-scripts better-sqlite3, then npm rebuild better-sqlite3), then retry.` + (sampleWorkerError ? ` Last worker error: ${sampleWorkerError}` : "")
17560
17560
  );
17561
17561
  }
17562
17562
  throw new Error(
@@ -26752,10 +26752,14 @@ async function cmdStatus(json) {
26752
26752
  installed: browserInstalled,
26753
26753
  nativeDepsOk: nativeDeps.ok,
26754
26754
  nativeDepsError: nativeDeps.ok ? null : nativeDeps.error,
26755
- nativeDepsFix: nativeDeps.ok ? null : "Reinstall allowing dependency install scripts: npm install -g @lincoln504/pi-research --allow-scripts (npm 12 turns them off by default).",
26755
+ // --allow-scripts is a package-name LIST, not a boolean: the bare flag is
26756
+ // accepted and silently allows nothing (measured on npm 12.0.2). It is
26757
+ // also global/one-off only — a project-scoped install rejects it with
26758
+ // EALLOWSCRIPTS, where `npm approve-scripts` is the supported route.
26759
+ nativeDepsFix: nativeDeps.ok ? null : "Reinstall allowing the dependency install script: npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3 (npm 12 blocks dependency install scripts by default). For a project-scoped install: npm approve-scripts better-sqlite3, then npm rebuild better-sqlite3.",
26756
26760
  // Same remedy the health check prints, so both surfaces name one command.
26757
26761
  fix: browserInstalled ? null : "npx camoufox-js fetch",
26758
- note: browserInstalled ? null : "Stealth browser not installed \u2014 scraping falls back to plain fetch, which some sites block. npm 11.19+ blocks install scripts by default, which skips this package's postinstall."
26762
+ note: browserInstalled ? null : "Stealth browser not installed \u2014 scraping falls back to plain fetch, which some sites block. npm 12 blocks install scripts by default, which skips this package's postinstall; the engine is fetched on first use instead."
26759
26763
  },
26760
26764
  knowledgeStoreMode: cfg.KNOWLEDGE_STORE_MODE,
26761
26765
  defaultDepth: cfg.DEFAULT_RESEARCH_DEPTH,
@@ -21,6 +21,10 @@ npm install -g @lincoln504/pi-research # the engine (puts `pi-research` on PAT
21
21
  pi-research skill install # link the skill into every detected agent
22
22
  ```
23
23
 
24
+ On npm 12 or newer, first run `npm config set allow-scripts=better-sqlite3 --location=user`:
25
+ npm 12 blocks the install script that builds the stealth browser's SQLite module, and
26
+ without it every search fails with a missing-module error (see the [README](../README.md#install)).
27
+
24
28
  `skill install` targets only agents already set up under `$HOME`, never overwrites a
25
29
  different skill in the slot, and records what it created so `pi-research skill uninstall`
26
30
  removes exactly that. Run `pi-research skill status` to see where it is installed.
package/docs/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.6.4] - 2026-08-26
9
+
10
+ The npm 12 install remedy shipped in 1.6.2 was put through real installs in
11
+ disposable npm 12.0.2 containers and found not to work: the bare `--allow-scripts`
12
+ flag every surface recommended is accepted by npm and allows nothing.
13
+
14
+ ### Fixed
15
+
16
+ - **`status` and the total-search-failure error printed a repair command that repairs nothing.** Measured per npm version against a scripted tarball: npm ≤11.15 runs dependency install scripts silently, 11.16–11.19 warn but still run them, and npm 12 blocks them — so the 1.6.2 claim that "npm 11.19+ blocks" was wrong on version, and the remedy was worse than wrong on form: `--allow-scripts` is a comma-separated package-name list, so the bare flag is accepted and allows nothing — the install stays broken. The flag is also global-install-only: a project-scoped install (the SDK path, and what `pi install` runs underneath) rejects it with `EALLOWSCRIPTS`. And after a blocked install, approving and rerunning `npm install` does not rebuild the already-extracted package. Both surfaces now print commands measured to work — `--allow-scripts=better-sqlite3` for a global install; `npm approve-scripts better-sqlite3` then `npm rebuild better-sqlite3` for a project-scoped one (`src/cli.ts`, `src/web-research/browser-search.ts`).
17
+
18
+ ### Changed
19
+
20
+ - **Install docs lead with the one form measured to cover every install path** — `npm config set allow-scripts=better-sqlite3 --location=user`, verified against a fresh `pi install` and a project install — and the npm 12 note now appears on every surface that shows an install command (README, SDK, agent-skill docs, and the shipped skill README) rather than the README alone, with the wording tightened.
21
+
22
+ ### Verified
23
+
24
+ - Each printed command form measured on real installs in npm 12.0.2 containers: the global flag form builds the binding, the user-level config form covers global, project, and `pi install`, and the approve + rebuild flow repairs an already-blocked install.
25
+ - 2938 unit tests over 233 files, lint, and type-check green.
26
+
8
27
  ## [1.6.3] - 2026-08-25
9
28
 
10
29
  A unit test that had already been granted CI-jitter headroom twice went red a third
package/docs/SDK.md CHANGED
@@ -13,6 +13,19 @@ run the `pi` extension, which keeps its own private copy your scripts can't impo
13
13
  npm install @lincoln504/pi-research
14
14
  ```
15
15
 
16
+ On npm 12 or newer, allow the one install script search depends on before installing:
17
+
18
+ ```bash
19
+ npm config set allow-scripts=better-sqlite3 --location=user
20
+ ```
21
+
22
+ npm 12 blocks dependency install scripts by default, and a project-scoped install
23
+ rejects the `--allow-scripts` flag — hence the config form. Skipped, the install
24
+ succeeds but every search fails with a missing-module error. To repair an install
25
+ that already ran blocked: `npm approve-scripts better-sqlite3` (pins the approval
26
+ in your project's `allowScripts` field), then `npm rebuild better-sqlite3` —
27
+ rerunning `npm install` does not rebuild the already-extracted package.
28
+
16
29
  Then pick the model: pass `model` to `initResearchSDK`, or set `PI_RESEARCH_MODEL`
17
30
  (env or `~/.pi/research/config.env`). The SDK never follows the model selected
18
31
  inside the pi extension; only when neither is set does it fall back to the first
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincoln504/pi-research",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Web research for your agents with smart and safe tooling + knowledge store",
5
5
  "type": "module",
6
6
  "private": false,
package/src/cli.ts CHANGED
@@ -793,9 +793,10 @@ async function cmdStatus(json?: boolean): Promise<number> {
793
793
  const paths = resolvedConfigPaths();
794
794
  const cfg = getConfig(process.cwd(), 'cli');
795
795
  // The stealth browser is installed by this package's `postinstall`
796
- // (scripts/setup.cjs), which npm 11.19+ BLOCKS BY DEFAULT — it now warns
797
- // "packages have install scripts not yet covered by allowScripts" and carries
798
- // on, so the browser is simply absent on an otherwise successful install.
796
+ // (scripts/setup.cjs), which npm 12 BLOCKS BY DEFAULT (11.16–11.19 only warn
797
+ // and still run it — measured per version against a scripted tarball) — npm
798
+ // prints "packages had install scripts blocked" and carries on, so the
799
+ // browser is simply absent on an otherwise successful install.
799
800
  // A missing browser DEGRADES capability rather than breaking the tool — the fetch
800
801
  // path still serves most pages — so it is reported alongside `ready` rather than
801
802
  // folded into it. isBrowserAvailable() is a resolve + existsSync; it never launches
@@ -827,14 +828,18 @@ async function cmdStatus(json?: boolean): Promise<number> {
827
828
  installed: browserInstalled,
828
829
  nativeDepsOk: nativeDeps.ok,
829
830
  nativeDepsError: nativeDeps.ok ? null : nativeDeps.error,
831
+ // --allow-scripts is a package-name LIST, not a boolean: the bare flag is
832
+ // accepted and silently allows nothing (measured on npm 12.0.2). It is
833
+ // also global/one-off only — a project-scoped install rejects it with
834
+ // EALLOWSCRIPTS, where `npm approve-scripts` is the supported route.
830
835
  nativeDepsFix: nativeDeps.ok
831
836
  ? null
832
- : 'Reinstall allowing dependency install scripts: npm install -g @lincoln504/pi-research --allow-scripts (npm 12 turns them off by default).',
837
+ : 'Reinstall allowing the dependency install script: npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3 (npm 12 blocks dependency install scripts by default). For a project-scoped install: npm approve-scripts better-sqlite3, then npm rebuild better-sqlite3.',
833
838
  // Same remedy the health check prints, so both surfaces name one command.
834
839
  fix: browserInstalled ? null : 'npx camoufox-js fetch',
835
840
  note: browserInstalled
836
841
  ? null
837
- : 'Stealth browser not installed — scraping falls back to plain fetch, which some sites block. npm 11.19+ blocks install scripts by default, which skips this package\'s postinstall.',
842
+ : 'Stealth browser not installed — scraping falls back to plain fetch, which some sites block. npm 12 blocks install scripts by default, which skips this package\'s postinstall; the engine is fetched on first use instead.',
838
843
  },
839
844
  knowledgeStoreMode: cfg.KNOWLEDGE_STORE_MODE,
840
845
  defaultDepth: cfg.DEFAULT_RESEARCH_DEPTH,
@@ -333,8 +333,9 @@ export async function performSearch(
333
333
  `Search completely failed: ${reason}, all with a missing native module. ` +
334
334
  `This is an incomplete install, not a network problem: the browser engine's ` +
335
335
  `native dependencies were never built. npm 12 does not run dependency install ` +
336
- `scripts by default — reinstall allowing them (npm install @lincoln504/pi-research ` +
337
- `--allow-scripts, or npm approve-scripts --allow-scripts-pending), then retry.` +
336
+ `scripts by default — reinstall allowing the script (global install: ` +
337
+ `npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3; ` +
338
+ `project install: npm approve-scripts better-sqlite3, then npm rebuild better-sqlite3), then retry.` +
338
339
  (sampleWorkerError ? ` Last worker error: ${sampleWorkerError}` : '')
339
340
  );
340
341
  }