@lincoln504/pi-research 1.6.17 → 1.6.19
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 +2 -5
- package/agent-skill/pi-research/README.md +1 -1
- package/agent-skill/pi-research/SKILL.md +1 -1
- package/dist/cli.mjs +3 -3
- package/docs/AGENT-SKILL.md +1 -1
- package/docs/CHANGELOG.md +43 -5
- package/docs/SDK.md +1 -1
- package/package.json +8 -7
- package/scripts/setup.cjs +6 -3
- package/src/core/llm/llm-utils.ts +5 -7
- package/src/core/pi-version.ts +1 -1
- package/src/index.ts +4 -3
package/README.md
CHANGED
|
@@ -34,8 +34,6 @@
|
|
|
34
34
|
|
|
35
35
|
Search and scraping run locally in a stealth browser, with no search provider and no monthly cap. The only cost is LLM tokens.
|
|
36
36
|
|
|
37
|
-
Currently recommended model to configure for research: [`openrouter/inclusionai/ling-3.0-flash`](https://openrouter.ai/inclusionai/ling-3.0-flash).
|
|
38
|
-
|
|
39
37
|
### Install
|
|
40
38
|
|
|
41
39
|
As a [Pi](https://github.com/earendil-works/pi) Coding Agent extension:
|
|
@@ -51,7 +49,7 @@ npm install -g @lincoln504/pi-research
|
|
|
51
49
|
pi-research skill install
|
|
52
50
|
```
|
|
53
51
|
|
|
54
|
-
No extra setup is needed. The package ships ready-made bindings for every platform and runs no install scripts. The stealth browser (
|
|
52
|
+
No extra setup is needed. The package ships ready-made bindings for every platform and runs no install scripts. The stealth browser (1GB+ installed) downloads on first use, so the first scrape takes a few minutes. npm ≥11.19 skips install scripts by default. Leave it that way: nothing needs approving or building. Only Windows with npm older than 11.19 can fail when the install tries to compile from source. Upgrading npm fixes it.
|
|
55
53
|
|
|
56
54
|
In pi, the extension 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).
|
|
57
55
|
|
|
@@ -83,13 +81,12 @@ Three depth levels (normal, deep, ultra) set the team size and number of rounds.
|
|
|
83
81
|
|
|
84
82
|
### Requirements / limitations
|
|
85
83
|
|
|
86
|
-
- Node.js >= 22.
|
|
84
|
+
- Node.js >= 22.22.2
|
|
87
85
|
- An LLM with a 100k+ context window (an API key or a local model)
|
|
88
86
|
- Internet access on a residential IP, since search, scraping, and YouTube transcripts get bot-blocked from datacenter/VPS/cloud IPs
|
|
89
87
|
- pi. The pi extension uses the host's copy while the standalone CLI and agent skill install it as a dependency.
|
|
90
88
|
- Local knowledge-store embeddings need `@huggingface/transformers`, an optional dependency. If its native image chain (sharp) cannot install, npm skips it with a warning and the install still succeeds, so everything works except local embeddings. The store tells you how to restore them.
|
|
91
89
|
- Cloudflare Turnstile and similar systems block scraping on some sites. A run compensates with a wide pool of search results to scrape.
|
|
92
|
-
- npm reports 1 moderate advisory (adm-zip, pulled in by onnxruntime and the camoufox browser downloader). Installs are unaffected; just don't run `npm audit fix --force` (its suggested downgrade reintroduces a high-severity advisory). Details: [docs/AUDIT-GATE.md](docs/AUDIT-GATE.md).
|
|
93
90
|
|
|
94
91
|
### Channels
|
|
95
92
|
|
|
@@ -38,7 +38,7 @@ model/key is missing.
|
|
|
38
38
|
|
|
39
39
|
### Prerequisites
|
|
40
40
|
|
|
41
|
-
- Node.js >= 22.
|
|
41
|
+
- Node.js >= 22.22.2
|
|
42
42
|
- `pi-research` installed somewhere the launcher can find it, and a configured
|
|
43
43
|
model (`PI_RESEARCH_MODEL`) + API key. See [`references/configuration.md`](references/configuration.md).
|
|
44
44
|
|
|
@@ -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.19", "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
|
@@ -3615,9 +3615,9 @@ function buildSafeOptions(model, options, defaultCap = 4096, thinkingLevel = "of
|
|
|
3615
3615
|
...options,
|
|
3616
3616
|
// Ensure maxTokens is never null/None to avoid provider-side crashes
|
|
3617
3617
|
maxTokens: options.maxTokens ?? Math.min(defaultCap, model.maxTokens || defaultCap),
|
|
3618
|
-
//
|
|
3619
|
-
//
|
|
3620
|
-
reasoning: effective
|
|
3618
|
+
// compat API treats any truthy reasoning as thinking-enabled; 'off' has no budget
|
|
3619
|
+
// entry, so it would send maxTokens as NaN. undefined is its no-reasoning value.
|
|
3620
|
+
reasoning: effective === "off" ? void 0 : effective
|
|
3621
3621
|
};
|
|
3622
3622
|
}
|
|
3623
3623
|
function validateAndExtractText(response, label) {
|
package/docs/AGENT-SKILL.md
CHANGED
|
@@ -125,7 +125,7 @@ Manual. Symlink the directory into any agent's skills folder yourself:
|
|
|
125
125
|
|
|
126
126
|
### Prerequisites
|
|
127
127
|
|
|
128
|
-
- Node.js >= 22.
|
|
128
|
+
- Node.js >= 22.22.2
|
|
129
129
|
- `pi-research` installed where the launcher can find it, plus a configured model
|
|
130
130
|
(`PI_RESEARCH_MODEL`) + API key. See [Configuration](CONFIGURATION.md).
|
|
131
131
|
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,37 @@ 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
|
-
## [
|
|
8
|
+
## [1.6.19] - 2026-09-18
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`scripts/verify-changelog.cjs`: a release gate that the tagged commit carries a dated changelog section for its version.** The release path validated the tag against `package.json` and `SKILL.md` but never against `docs/CHANGELOG.md`, so a release could be tagged with its changes still sitting under `## [Unreleased]` — which happened twice. `v1.6.12`'s block was later folded into `[1.6.13]` (misattributing it), and `v1.6.17`'s was overwritten by the next release and lost outright. The gate fails closed on a missing, undated, empty, duplicated, or non-newest section; it is unit-tested (`test/unit/scripts/verify-changelog.test.ts`, 11 cases) and runs in CI's lint job and in the release workflow's pre-publish job. The two historical gaps are repaired in the same pass: `[1.6.17]` is restored from git, `[1.6.12]` is reconstructed from the commits in `v1.6.11..v1.6.12` (the Stack Exchange clickable-link fix and the explicit `vite` devDependency, both of which `[1.6.13]` had absorbed, plus the previously undocumented Japanese translation), and `[1.6.18]` gains its missing date.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **README: the adm-zip advisory bullet is removed from the requirements/limitations list.** It only asserted the absence of advisories, which is the audit gate's job (`docs/AUDIT-GATE.md`), not a user-facing limitation. The stealth-browser size claim is corrected from "~500MB" to "1GB+ installed" (the Linux asset downloads at ~630MB and unpacks to ~1.3GB).
|
|
17
|
+
- **Supported Node floor raised from 22.19.0 to 22.22.2** (`engines.node`, `.nvmrc`, README, `docs/AGENT-SKILL.md`, `docs/SDK.md`, all three translations, the `agent-skill` README, the `scripts/setup.cjs` check + warning, and the lockfile root). `jsdom` 30 — a production dependency — and `npm` 12, which CI's install jobs run, both declare `^22.22.2 || ^24.15.0 || >=26.0.0`, so the old floor installed a tree outside its own dependency's support. CI's npm upgrade moved to a separate-prefix install as a result (see Fixed).
|
|
18
|
+
- **Two stale in-code comments that still named the pre-0.85.0 pi floor are corrected to 0.85.0** (`src/core/pi-version.ts`, `src/index.ts`). No behavioral or dependency change.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **CI no longer upgrades npm by replacing the bundled npm in place.** Node 22.22.2 bundles npm 10.9.7, which cannot install a new npm over itself: the reify deletes npm's own `node_modules` entries while the running process still needs them, and it dies with `Cannot find module 'promise-retry'` (reproduced locally on v22.22.2; CI runs 35414345489 and 35414867837, the ubuntu/macOS unit-test and validate legs). `--force`, `--ignore-scripts` and `--no-audit` all reproduce it, so `--force` was never the fix and the original comment's engines rationale was wrong. `scripts/use-npm12.cjs` installs npm 12 into a separate prefix and puts it on PATH; the release workflow's `publish` job does the same inline for npm 11, which self-upgraded on the same Node and would otherwise have failed the publish.
|
|
23
|
+
|
|
24
|
+
## [1.6.18] - 2026-09-16
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **`buildSafeOptions` no longer sends the literal `'off'` reasoning level into pi-ai's compat API (merged PR #13 by @lukey03).** pi-ai 0.85.1's compat path treats any truthy `reasoning` as thinking-enabled, and `'off'` has no entry in its thinking-budget table, so `maxTokens` was computed as `NaN` and serialized as `max_tokens: null` — every coordinator/plan call 400'd on providers that validate the cap (observed on Fireworks' anthropic-messages endpoint, where research never got past the first planning call). `'off'` now crosses the boundary as `undefined`, pi-ai's no-reasoning value; explicit non-off levels, caller precedence, and the maxTokens cap are unchanged. The new `build-safe-options.test.ts` drives the real compat `completeSimple` against a stubbed transport and asserts on the actual request body (5 of its 9 tests fail pre-patch); the one coordinator-boundary assertion that expected the literal `'off'` was updated to the compat contract.
|
|
28
|
+
|
|
29
|
+
### Security
|
|
30
|
+
|
|
31
|
+
- **The adm-zip allowlist exception is REMOVED — the advisory is fixed upstream and the production audit is clean.** `adm-zip` 0.6.1 (published 2026-09-11) contains the fix for GHSA-vwc7-r8mq-g2x9 / CVE-2026-76845 (cthackers/adm-zip PR #575, commit `eaa35fa`: extraction no longer writes through destination symlinks, plus setuid/setgid/sticky-bit stripping and related symlink hardening) — the exact `clearsWhen` condition the 1.6.16 exception documented. The `adm-zip` override moves `^0.6.0` → `^0.6.1` to pin the floor explicitly; both parents (`onnxruntime-node`, `camoufox-js`) already resolve 0.6.1 from their own `^0.6.0` ranges, so consumers clear the advisory with a fresh install and can drop any suppression they added. `config/tooling/audit-exceptions.json` is now empty and `npm audit --omit=dev` reports zero vulnerabilities; `docs/AUDIT-GATE.md` keeps the worked example as the triage runbook and records the clearance (the GitHub advisory page still read "patched versions: None" as of 2026-09-16 — its last review predates the release by three days).
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- **README: the "Currently recommended model" line is removed** (leaving the README with no model endorsement), and the leftover double blank line it left behind is fixed.
|
|
36
|
+
- **Dev dependency lockfile refresh, all in-range: `vitest` 5.0.0 → 5.0.1, `@vitest/coverage-v8` 5.0.0 → 5.0.1, `vite` 8.2.2 → 8.3.0, `dependency-cruiser` 18.2.0 → 18.3.1, `jsdom` 30.0.1 → 30.1.0, `webgpu` 0.6.0 → 0.6.1.** Deliberate holds re-verified and unchanged: `typebox` stays 1.3.7 (lockstep with the host pi 0.85.1 line), `apache-arrow` stays 21.1.0 (21.2.0 breaks LanceDB IPC), `playwright-core` stays 1.60.0 (camoufox-js 0.12.0 peers `<1.61.0`), `typescript` stays `<6.1.0` (@typescript-eslint peer ceiling), and `@huggingface/transformers` stays 4.2.0 (4.3.0 pulls an `onnxruntime-web` dev build, `1.31.0-dev.20260914`, and reshuffles the optional native stack for no needed gain). The full gate suite is green: lint, all four type-checks (TS 6 and TS 7 native, src and tests), 3,073 unit tests, dependency-cruiser, build + manifest verify, and the audit gate with an empty allowlist.
|
|
37
|
+
|
|
38
|
+
## [1.6.17] - 2026-09-09
|
|
9
39
|
|
|
10
40
|
### Changed
|
|
11
41
|
|
|
@@ -55,14 +85,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
55
85
|
|
|
56
86
|
- **`npm ci` under npm 12 rejected the lockfile an `npm update` had rewritten** (this release cycle's own dep refresh): the rewrite dropped the `node-domexception@1.0.28` alias entry backing the `@nolyfill/domexception` override while leaving a stale real `node-domexception@1.0.0` copy nested under `@earendil-works/pi-coding-agent`. npm 11 (the local dev npm) accepted the tree; CI's npm 12 is stricter and failed every `npm ci --legacy-peer-deps` leg. The lockfile was regenerated with npm 12 itself, which collapses the stale nested copy so the override is the only resolution; `npm ci --legacy-peer-deps` now validates clean under both npm 11 and npm 12, and CI is green cross-OS.
|
|
57
87
|
|
|
58
|
-
- **Stack Exchange tool output can no longer open a real browser tab when clicked.** The tool's formatters emitted markdown links (`[title](link)`) and bare URLs, and question/answer bodies carried third-party markup — any markdown-rendering surface (assistant replies, research reports, the terminal UI, which turns markdown links AND bare URLs into OSC 8 terminal hyperlinks and opens them in the system browser on mouse press+release) turned these into click-to-open-tab targets in the middle of scrolling tool output. New `src/utils/plain-url.ts` fixes this at the source, cross-platform and renderer-independent: `plainUrl()` wraps every emitted URL in backticks (code spans tokenize before autolink/link parsing in every CommonMark renderer, so a code-spanned URL can never become a link but stays byte-exact and copyable for the model), and `fenceBlock()` wraps third-party body content in a fenced code block whose length grows past any backtick run in the content (embedded links, headings and tables render inert; content containing its own ``` fences cannot close the fence early). All stackexchange formatters (questions, answers, users, sites, compact variants, and the `get`+compact path) now emit code-spanned URLs and own-line-fenced bodies — fence placement matters: an opening fence inline after `- **Body:**` is NOT recognized as a code block by CommonMark and was verified (against pi's bundled `marked`) to still render embedded links clickable, so the fence starts on its own line. The tool's prompt guidelines now also instruct the model never to re-emit result URLs as markdown links, covering the assistant-echo path. Pinned by `test/unit/stackexchange/output/no-clickable-links.test.ts`, which scans each formatter's clickable surface (post code-span/fence stripping) for link syntax and — when `marked` is resolvable — renders the actual output and asserts zero anchor elements.
|
|
59
|
-
|
|
60
|
-
- **CI: declare `vite` as an explicit devDependency.** CI installs with `--legacy-peer-deps`, which skips peer dependency resolution — `vite` was only reachable as a transitive peer and the install could not resolve it. Now declared directly.
|
|
61
|
-
|
|
62
88
|
### Verified
|
|
63
89
|
|
|
64
90
|
- 3,064 unit tests over 242 files, ESLint clean, all four type-checks (TS 6 src + tests, TS 7 native src + tests), dependency-cruiser and madge clean (190 modules, no circular dependencies), build, and `npm ci --dry-run` manifest verification; `npm audit` reports 0 vulnerabilities. The packed tarball was installed into a clean project: pi 0.85.1 resolves fresh, the documented dual apache-arrow layout (21.1.0 nested / 18.1.0 hoisted for LanceDB) reproduces, and the installed CLI boots. CI green cross-OS (ubuntu ×2, macOS, Windows) including the consumer fresh-install and Arrow/LanceDB interop legs. For this cycle additionally: the tarball installed and the CLI booted under npm 10, npm 11, and npm 12 alike, with the dual apache-arrow layout identical across all three.
|
|
65
91
|
|
|
92
|
+
## [1.6.12] - 2026-09-07
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
|
|
96
|
+
- **Consolidated Japanese translation** (`docs/DOCUMENTATION-JA.md`), listed after the zh-CN doc in the README.
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
|
|
100
|
+
- **Stack Exchange tool output can no longer open a real browser tab when clicked.** The tool's formatters emitted markdown links (`[title](link)`) and bare URLs, and question/answer bodies carried third-party markup — any markdown-rendering surface (assistant replies, research reports, the terminal UI, which turns markdown links AND bare URLs into OSC 8 terminal hyperlinks and opens them in the system browser on mouse press+release) turned these into click-to-open-tab targets in the middle of scrolling tool output. New `src/utils/plain-url.ts` fixes this at the source, cross-platform and renderer-independent: `plainUrl()` wraps every emitted URL in backticks (code spans tokenize before autolink/link parsing in every CommonMark renderer, so a code-spanned URL can never become a link but stays byte-exact and copyable for the model), and `fenceBlock()` wraps third-party body content in a fenced code block whose length grows past any backtick run in the content (embedded links, headings and tables render inert; content containing its own ``` fences cannot close the fence early). All stackexchange formatters (questions, answers, users, sites, compact variants, and the `get`+compact path) now emit code-spanned URLs and own-line-fenced bodies — fence placement matters: an opening fence inline after `- **Body:**` is NOT recognized as a code block by CommonMark and was verified (against pi's bundled `marked`) to still render embedded links clickable, so the fence starts on its own line. The tool's prompt guidelines now also instruct the model never to re-emit result URLs as markdown links, covering the assistant-echo path. Pinned by `test/unit/stackexchange/output/no-clickable-links.test.ts`, which scans each formatter's clickable surface (post code-span/fence stripping) for link syntax and — when `marked` is resolvable — renders the actual output and asserts zero anchor elements.
|
|
101
|
+
|
|
102
|
+
- **CI: declare `vite` as an explicit devDependency.** CI installs with `--legacy-peer-deps`, which skips peer dependency resolution — `vite` was only reachable as a transitive peer and the install could not resolve it. Now declared directly.
|
|
103
|
+
|
|
66
104
|
## [1.6.11] - 2026-09-04
|
|
67
105
|
|
|
68
106
|
### Changed
|
package/docs/SDK.md
CHANGED
|
@@ -50,7 +50,7 @@ global file entirely and run purely from defaults + `process.env` + `options.con
|
|
|
50
50
|
> `ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING`. That applies to
|
|
51
51
|
> `--experimental-transform-types` exactly as it does to
|
|
52
52
|
> `--experimental-strip-types`, so neither flag helps here; a loader (or the pi
|
|
53
|
-
> host) is mandatory. (`engines.node` is `>=22.
|
|
53
|
+
> host) is mandatory. (`engines.node` is `>=22.22.2`.)
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
56
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincoln504/pi-research",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.19",
|
|
4
4
|
"description": "Web research for your agents with smart and safe tooling + knowledge store",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
|
-
"node": ">=22.
|
|
76
|
+
"node": ">=22.22.2"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"lint": "npx eslint --config config/tooling/eslint.config.js src/",
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"install:system-deps": "node scripts/setup.cjs --system-deps",
|
|
105
105
|
"deps:check": "depcruise --config config/tooling/dependency-cruiser.cjs --output-type err-long src",
|
|
106
106
|
"deps:generate": "npx --yes madge@8.0.0 --image docs/deps.svg src/index.ts",
|
|
107
|
+
"verify:changelog": "node scripts/verify-changelog.cjs",
|
|
107
108
|
"analyze:dependencies": "ncu",
|
|
108
109
|
"analyze:compatibility": "depngn"
|
|
109
110
|
},
|
|
@@ -116,8 +117,8 @@
|
|
|
116
117
|
"dependencies": {
|
|
117
118
|
"@earendil-works/pi-ai": ">=0.85.0 <1",
|
|
118
119
|
"@earendil-works/pi-coding-agent": ">=0.85.0 <1",
|
|
119
|
-
"@earendil-works/pi-tui": ">=0.85.0 <1",
|
|
120
120
|
"@earendil-works/pi-server": ">=0.85.0 <1",
|
|
121
|
+
"@earendil-works/pi-tui": ">=0.85.0 <1",
|
|
121
122
|
"@kreuzberg/html-to-markdown-node": "^3.7.2",
|
|
122
123
|
"@lancedb/lancedb": "0.38.0",
|
|
123
124
|
"apache-arrow": "21.1.0",
|
|
@@ -125,7 +126,7 @@
|
|
|
125
126
|
"camoufox-js": "^0.12.0",
|
|
126
127
|
"esbuild": "^0.28.2",
|
|
127
128
|
"impit": "0.14.5",
|
|
128
|
-
"jsdom": "^30.0
|
|
129
|
+
"jsdom": "^30.1.0",
|
|
129
130
|
"node-html-markdown": "^2.0.0",
|
|
130
131
|
"pdf-oxide-wasm": "^0.3.77",
|
|
131
132
|
"playwright-core": "1.60.0",
|
|
@@ -147,7 +148,7 @@
|
|
|
147
148
|
"ua-parser-js": "^1.0.41",
|
|
148
149
|
"protobufjs": "7.6.5",
|
|
149
150
|
"vite": "^8.2.2",
|
|
150
|
-
"adm-zip": "^0.6.
|
|
151
|
+
"adm-zip": "^0.6.1",
|
|
151
152
|
"jsdom": {
|
|
152
153
|
"undici": "^8.10.2"
|
|
153
154
|
},
|
|
@@ -158,13 +159,13 @@
|
|
|
158
159
|
"@types/jsdom": "^30.0.0",
|
|
159
160
|
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
160
161
|
"@typescript-eslint/parser": "^8.70.0",
|
|
161
|
-
"@vitest/coverage-v8": "^5.0.
|
|
162
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
162
163
|
"dependency-cruiser": "^18.2.0",
|
|
163
164
|
"depngn": "^0.6.0",
|
|
164
165
|
"eslint": "^10.10.0",
|
|
165
166
|
"npm-check-updates": "^23.1.0",
|
|
166
167
|
"typescript": ">=6.0.3 <6.1.0",
|
|
167
168
|
"vite": "^8.2.2",
|
|
168
|
-
"vitest": "^5.0.
|
|
169
|
+
"vitest": "^5.0.1"
|
|
169
170
|
}
|
|
170
171
|
}
|
package/scripts/setup.cjs
CHANGED
|
@@ -23,9 +23,12 @@ const isLinux = process.platform === 'linux';
|
|
|
23
23
|
const isDarwin = process.platform === 'darwin';
|
|
24
24
|
const isWindows = process.platform === 'win32';
|
|
25
25
|
|
|
26
|
-
const [nodeMajor, nodeMinor] = process.version.replace('v', '').split('.').map((n) => parseInt(n, 10));
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const [nodeMajor, nodeMinor, nodePatch] = process.version.replace('v', '').split('.').map((n) => parseInt(n, 10));
|
|
27
|
+
// Minimum is 22.22.2 — the floor `jsdom` 30 (a runtime dependency) and npm 12 both declare.
|
|
28
|
+
const belowMinimum =
|
|
29
|
+
nodeMajor < 22 || (nodeMajor === 22 && (nodeMinor < 22 || (nodeMinor === 22 && nodePatch < 2)));
|
|
30
|
+
if (belowMinimum) {
|
|
31
|
+
console.warn(`WARNING: Node.js ${process.version} is below the minimum (>=22.22.2). Upgrade to 22.22.2+.`);
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
/**
|
|
@@ -14,10 +14,8 @@ import { completeSimple } from './pi-ai-completion.ts';
|
|
|
14
14
|
*
|
|
15
15
|
* - Ensures maxTokens is always set (satisfies providers that reject a null cap),
|
|
16
16
|
* clamped to the model's own ceiling so a large requested cap is never invalid.
|
|
17
|
-
* - Sets the chain-of-thought "thinking" level, defaulting to 'off'
|
|
18
|
-
*
|
|
19
|
-
* supports (disabling thinking where an off state exists, omitting the parameter
|
|
20
|
-
* where it does not). The fix is therefore model-agnostic — pi-ai owns the
|
|
17
|
+
* - Sets the chain-of-thought "thinking" level, defaulting to 'off' (normalized to
|
|
18
|
+
* undefined at the compat boundary, see the reasoning line below). pi-ai owns the
|
|
21
19
|
* per-provider translation; this code never hardcodes a provider-specific payload.
|
|
22
20
|
* 'off' is deliberate: these engine calls emit structured JSON / cited reports, so a
|
|
23
21
|
* thinking block only consumes the output-token budget (often truncating before the
|
|
@@ -47,9 +45,9 @@ export function buildSafeOptions(
|
|
|
47
45
|
...options,
|
|
48
46
|
// Ensure maxTokens is never null/None to avoid provider-side crashes
|
|
49
47
|
maxTokens: options.maxTokens ?? Math.min(defaultCap, model.maxTokens || defaultCap),
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
reasoning: effective
|
|
48
|
+
// compat API treats any truthy reasoning as thinking-enabled; 'off' has no budget
|
|
49
|
+
// entry, so it would send maxTokens as NaN. undefined is its no-reasoning value.
|
|
50
|
+
reasoning: effective === 'off' ? undefined : (effective as SimpleStreamOptions['reasoning']),
|
|
53
51
|
};
|
|
54
52
|
}
|
|
55
53
|
|
package/src/core/pi-version.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* - As a pi EXTENSION, the host supplies `@earendil-works/*`. Our package.json
|
|
9
9
|
* range never constrains it, so an in-process check is the only enforcement.
|
|
10
|
-
* - As a standalone CLI/SDK, the range is `>=0.
|
|
10
|
+
* - As a standalone CLI/SDK, the range is `>=0.85.0 <1` and published tarballs
|
|
11
11
|
* carry no lockfile, so every fresh install resolves the newest 0.x at that
|
|
12
12
|
* instant. pi is pre-1.0: a minor bump may break anything under semver, and
|
|
13
13
|
* already has (0.83.0 extended the ResourceLoader contract).
|
package/src/index.ts
CHANGED
|
@@ -91,9 +91,10 @@ function extractResultText(result: AgentToolResult<unknown>): string {
|
|
|
91
91
|
* Pi Research Extension
|
|
92
92
|
*/
|
|
93
93
|
export default async function (pi: ExtensionAPI) {
|
|
94
|
-
// Runtime version check — must match the @earendil-works/* dependency minimum (>=0.
|
|
95
|
-
// The floor
|
|
96
|
-
// and only 0.84.0+ hardcodes the equivalent guard internally (see pi-version.ts)
|
|
94
|
+
// Runtime version check — must match the @earendil-works/* dependency minimum (>=0.85.0).
|
|
95
|
+
// The floor was raised to 0.84.0 because setRuntimeApiKey() lost its `allowNetwork` option
|
|
96
|
+
// there and only 0.84.0+ hardcodes the equivalent guard internally (see pi-version.ts), then
|
|
97
|
+
// to 0.85.0 to track the pi extension package line. The
|
|
97
98
|
// APIs it rests on arrived in 0.80.8, which introduced ModelRuntime and removed
|
|
98
99
|
// AuthStorage/ModelRegistry.create(); buildModelRegistry (model-registry-factory.ts)
|
|
99
100
|
// unconditionally calls ModelRuntime.create(), and createAgentSession() is invoked
|