@lincoln504/pi-research 1.6.3 → 1.6.5
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 +8 -2
- package/agent-skill/pi-research/README.md +5 -1
- package/agent-skill/pi-research/SKILL.md +1 -1
- package/dist/cli.mjs +7 -3
- package/docs/AGENT-SKILL.md +7 -2
- package/docs/CHANGELOG.md +38 -1
- package/docs/SDK.md +13 -0
- package/package.json +1 -1
- package/src/cli.ts +10 -5
- package/src/web-research/browser-search.ts +3 -2
package/README.md
CHANGED
|
@@ -40,11 +40,17 @@ pi install npm:@lincoln504/pi-research
|
|
|
40
40
|
Standalone, as an [agent skill](docs/AGENT-SKILL.md) for Claude Code, Codex, and other skills-compatible agents:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
npm install -g @lincoln504/pi-research
|
|
43
|
+
npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3
|
|
44
44
|
pi-research skill install
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
On npm 12 or newer,
|
|
47
|
+
On npm 12 or newer, npm skips dependency install scripts by default; the flag allows the one that builds search's SQLite module — without it, every search fails with a missing-module error (the flag is harmless on older npm). `pi install` passes no flags to npm, so on npm 12 bracket any install or update with the same allowance as config — set, run, delete — because while the setting is in place it can break installs of other projects with git dependencies ([npm/cli#9783](https://github.com/npm/cli/issues/9783)):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm config set allow-scripts=better-sqlite3 --location=user
|
|
51
|
+
pi install npm:@lincoln504/pi-research
|
|
52
|
+
npm config delete allow-scripts --location=user
|
|
53
|
+
```
|
|
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
|
|
|
@@ -43,10 +43,14 @@ model/key is missing.
|
|
|
43
43
|
model (`PI_RESEARCH_MODEL`) + API key. See [`references/configuration.md`](references/configuration.md).
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npm install -g @lincoln504/pi-research
|
|
46
|
+
npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3
|
|
47
47
|
node "<skill_dir>/scripts/run.mjs" status # verify detection
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
On npm 12 or newer the flag is needed: npm blocks the install script that builds the
|
|
51
|
+
stealth browser's SQLite module, and without it every search fails with a
|
|
52
|
+
missing-module error. It is harmless on older npm.
|
|
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.
|
|
5
|
+
metadata: { "author": "Lincoln Deen", "version": "1.6.5", "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
|
|
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
|
-
|
|
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
|
|
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,
|
package/docs/AGENT-SKILL.md
CHANGED
|
@@ -17,10 +17,15 @@ For standalone use without pi, install the engine globally, then link the skill
|
|
|
17
17
|
every coding agent detected on this machine:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install -g @lincoln504/pi-research # the engine (puts `pi-research` on PATH)
|
|
20
|
+
npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3 # the engine (puts `pi-research` on PATH)
|
|
21
21
|
pi-research skill install # link the skill into every detected agent
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
On npm 12 or newer the flag is needed: npm blocks dependency install scripts by
|
|
25
|
+
default, and without the one that builds the stealth browser's SQLite module every
|
|
26
|
+
search fails with a missing-module error. It is harmless on older npm (see the
|
|
27
|
+
[README](../README.md#install)).
|
|
28
|
+
|
|
24
29
|
`skill install` targets only agents already set up under `$HOME`, never overwrites a
|
|
25
30
|
different skill in the slot, and records what it created so `pi-research skill uninstall`
|
|
26
31
|
removes exactly that. Run `pi-research skill status` to see where it is installed.
|
|
@@ -125,7 +130,7 @@ Manual. Symlink the directory into any agent's skills folder yourself:
|
|
|
125
130
|
(`PI_RESEARCH_MODEL`) + API key. See [Configuration](CONFIGURATION.md).
|
|
126
131
|
|
|
127
132
|
```bash
|
|
128
|
-
npm install -g @lincoln504/pi-research
|
|
133
|
+
npm install -g @lincoln504/pi-research --allow-scripts=better-sqlite3
|
|
129
134
|
node "<skill_dir>/scripts/run.mjs" status # verify the engine is detected
|
|
130
135
|
```
|
|
131
136
|
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,43 @@ 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.5] - 2026-08-26
|
|
9
|
+
|
|
10
|
+
1.6.4 verified its commands and then recommended the wrong one first: the user-level
|
|
11
|
+
`allow-scripts` config that "covers every install path" does cover them — at a cost
|
|
12
|
+
npm's own tracker had already documented, which the container runs (installing only
|
|
13
|
+
this package) could not see.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **The install docs led with a config setting that breaks unrelated projects.** While a user-level `allow-scripts` is set, any `npm install` or `npm ci` of a project with a git dependency fails with `EALLOWSCRIPTS` (npm/cli#9783, filed 2026-07-18): git-dependency preparation spawns an inner project-scoped install that receives the setting as `npm_config_allow_scripts`, where npm judges it as a forbidden command-line flag. The same env-forwarding breaks any install reached through `npm run-script` (npm/cli#9912, filed 2026-08-24) — including a `pi install` invoked from an npm script. The 1.6.4 remedy also never said to remove the setting, so a user following it kept the trap armed permanently. Every surface now leads with the remedy that touches nothing else: the inline `--allow-scripts=better-sqlite3` flag on the global install (a one-off — harmless on npm 11.16–11.19, where it at most silences the advisory warning, and on npm ≤11.15, where an unknown config flag is an accepted warning, measured: warning and exit 0), project-local `npm approve-scripts better-sqlite3` + `npm rebuild better-sqlite3` for the SDK path (also the repair for an install that already ran blocked), and for `pi install` — which passes no flags to npm — set the config, install, delete it again, with the reason stated at the point of use. The README prose is shorter than what it replaces (`README.md`, `docs/SDK.md`, `docs/AGENT-SKILL.md`, `agent-skill/pi-research/README.md`).
|
|
18
|
+
- **The manual per-agent install section showed a bare `npm install -g`.** The npm-12 note sat ~110 lines above at the top of the page, so a reader landing at the manual flow — or arriving by search — saw an unguarded command whose failure mode is a search that dies with a missing-module error and an install that reported success. The flag now rides on the command itself, which needs no note (`docs/AGENT-SKILL.md`).
|
|
19
|
+
- **The 1.6.3 "Verified" line named one job for two failures.** It credited "the ubuntu-latest job that caught the failure" directly below a bullet whose failure was seen on macos-latest; the release contained two failures on two runners (the lock race on ubuntu, the cleanup crash on macos). The line now names both, so the record matches the commits (`docs/CHANGELOG.md`).
|
|
20
|
+
|
|
21
|
+
### Verified
|
|
22
|
+
|
|
23
|
+
- 2938 unit tests over 233 files, lint, and type-check green.
|
|
24
|
+
- The flag-on-the-line and approve+rebuild forms are the same forms 1.6.4 measured working in npm 12.0.2 containers. The older-npm acceptance of the flag was measured directly (an unknown config flag warns and exits 0, so the install line is safe on the npm shipped with the minimum supported Node). The set-install-delete bracket reuses the config form 1.6.4 verified reaching `pi install`, with the removal step and its reason taken from npm/cli#9783's workaround guidance.
|
|
25
|
+
|
|
26
|
+
## [1.6.4] - 2026-08-26
|
|
27
|
+
|
|
28
|
+
The npm 12 install remedy shipped in 1.6.2 was put through real installs in
|
|
29
|
+
disposable npm 12.0.2 containers and found not to work: the bare `--allow-scripts`
|
|
30
|
+
flag every surface recommended is accepted by npm and allows nothing.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **`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`).
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- **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.
|
|
39
|
+
|
|
40
|
+
### Verified
|
|
41
|
+
|
|
42
|
+
- 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.
|
|
43
|
+
- 2938 unit tests over 233 files, lint, and type-check green.
|
|
44
|
+
|
|
8
45
|
## [1.6.3] - 2026-08-25
|
|
9
46
|
|
|
10
47
|
A unit test that had already been granted CI-jitter headroom twice went red a third
|
|
@@ -19,7 +56,7 @@ identified a real race in the lock acquire loop rather than a slow runner.
|
|
|
19
56
|
|
|
20
57
|
### Verified
|
|
21
58
|
|
|
22
|
-
- 2938 unit tests over 233 files, lint, type-check, and the full CI matrix green on the fix
|
|
59
|
+
- 2938 unit tests over 233 files, lint, type-check, and the full CI matrix green on the fix commits — including the ubuntu-latest job that caught the lock race and the macos-latest job that caught the cleanup crash.
|
|
23
60
|
|
|
24
61
|
## [1.6.2] - 2026-08-24
|
|
25
62
|
|
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, npm skips dependency install scripts by default and a project-scoped
|
|
17
|
+
install rejects the `--allow-scripts` flag — record the one script search depends on in
|
|
18
|
+
your project instead, then run it:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm approve-scripts better-sqlite3 # pins the approval in your allowScripts field
|
|
22
|
+
npm rebuild better-sqlite3
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Without that script every search fails with a missing-module error, and rerunning
|
|
26
|
+
`npm install` does not run it — `npm rebuild` does. The same pair repairs an install
|
|
27
|
+
that already ran blocked.
|
|
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
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
|
|
797
|
-
//
|
|
798
|
-
//
|
|
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
|
|
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
|
|
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
|
|
337
|
-
|
|
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
|
}
|