@herbertgao/pi-extensions 2026.9.10 → 2026.9.11
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 +1 -0
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/node_modules/@herbertgao/pi-bark/package.json +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -2
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +2 -2
- package/node_modules/@herbertgao/resume-from/package.json +1 -1
- package/node_modules/@herbertgao/sol-pi/README.md +3 -3
- package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +4 -4
- package/node_modules/@herbertgao/sol-pi/agents-install.md +4 -4
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +6 -6
- package/node_modules/@herbertgao/sol-pi/package.json +2 -2
- package/node_modules/@narumitw/pi-btw/dist/index.ts +39 -89
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
- package/node_modules/@narumitw/pi-btw/package.json +4 -4
- package/node_modules/@narumitw/pi-btw/src/btw.ts +28 -87
- package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +8 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +40 -37
- package/node_modules/@narumitw/pi-caffeinate/README.md +21 -66
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +10 -41
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-caffeinate/package.json +50 -51
- package/node_modules/@narumitw/pi-caffeinate/src/caffeinate.ts +637 -663
- package/node_modules/@narumitw/pi-caffeinate/src/dbus-inhibit.ts +114 -120
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +29 -29
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitors.ts +108 -126
- package/node_modules/@narumitw/pi-caffeinate/src/settings.ts +124 -128
- package/node_modules/pi-multi-account/CHANGELOG.md +1209 -0
- package/node_modules/pi-multi-account/CONTRIBUTING.md +61 -0
- package/node_modules/pi-multi-account/LICENSE +21 -0
- package/node_modules/pi-multi-account/README.md +197 -0
- package/node_modules/pi-multi-account/SECURITY.md +27 -0
- package/node_modules/pi-multi-account/auth-file-transaction.ts +56 -0
- package/node_modules/pi-multi-account/child-usability.ts +233 -0
- package/node_modules/pi-multi-account/compaction-summary.ts +32 -0
- package/node_modules/pi-multi-account/completion-route-planner.ts +224 -0
- package/node_modules/pi-multi-account/context-guard.ts +420 -0
- package/node_modules/pi-multi-account/cursor/LICENSE +21 -0
- package/node_modules/pi-multi-account/cursor/NOTICE +2 -0
- package/node_modules/pi-multi-account/cursor/auth.ts +165 -0
- package/node_modules/pi-multi-account/cursor/bridge-handle.ts +155 -0
- package/node_modules/pi-multi-account/cursor/conversation-registry.ts +104 -0
- package/node_modules/pi-multi-account/cursor/cursor-models-raw.json +611 -0
- package/node_modules/pi-multi-account/cursor/cursor-shared.ts +192 -0
- package/node_modules/pi-multi-account/cursor/h2-bridge.mjs +175 -0
- package/node_modules/pi-multi-account/cursor/index.ts +572 -0
- package/node_modules/pi-multi-account/cursor/message-parsing.ts +323 -0
- package/node_modules/pi-multi-account/cursor/prompt-usage.ts +53 -0
- package/node_modules/pi-multi-account/cursor/proto/agent_pb.ts +15294 -0
- package/node_modules/pi-multi-account/cursor/proxy.ts +2510 -0
- package/node_modules/pi-multi-account/cursor/session-lifecycle.ts +40 -0
- package/node_modules/pi-multi-account/cursor/sse-keepalive.ts +24 -0
- package/node_modules/pi-multi-account/cursor/stream-lifecycle.ts +193 -0
- package/node_modules/pi-multi-account/cursor/upstream-watchdog.ts +88 -0
- package/node_modules/pi-multi-account/cursor-bridge.ts +240 -0
- package/node_modules/pi-multi-account/cursor-model-name.ts +12 -0
- package/node_modules/pi-multi-account/index.ts +11825 -0
- package/node_modules/pi-multi-account/model-catalog.ts +354 -0
- package/node_modules/pi-multi-account/package.json +101 -0
- package/node_modules/pi-multi-account/pi-contract.ts +281 -0
- package/node_modules/pi-multi-account/provider-payload-stream.ts +44 -0
- package/node_modules/pi-multi-account/provider-priority.ts +189 -0
- package/node_modules/pi-multi-account/slot-proxy-auth.ts +167 -0
- package/node_modules/pi-multi-account/slot-proxy.ts +344 -0
- package/node_modules/pi-multi-account/state-file-transaction.ts +67 -0
- package/node_modules/pi-multi-account/usage.ts +1099 -0
- package/node_modules/pi-typesafe/README.md +6 -2
- package/node_modules/pi-typesafe/dist/client.d.ts +11 -0
- package/node_modules/pi-typesafe/dist/client.js +45 -10
- package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/package.json +2 -2
- package/node_modules/pi-web-access/CHANGELOG.md +36 -0
- package/node_modules/pi-web-access/README.md +75 -18
- package/node_modules/pi-web-access/anysearch.ts +4 -15
- package/node_modules/pi-web-access/bocha.ts +3 -22
- package/node_modules/pi-web-access/brave.ts +3 -21
- package/node_modules/pi-web-access/brightdata.ts +5 -32
- package/node_modules/pi-web-access/content-find.ts +168 -53
- package/node_modules/pi-web-access/curator-page.ts +4 -1
- package/node_modules/pi-web-access/curator-run.ts +2 -1
- package/node_modules/pi-web-access/curator-server.ts +1 -0
- package/node_modules/pi-web-access/dist/index.js +24620 -0
- package/node_modules/pi-web-access/domain-filter-normalization.ts +14 -0
- package/node_modules/pi-web-access/duckduckgo.ts +3 -21
- package/node_modules/pi-web-access/extract.ts +3 -1
- package/node_modules/pi-web-access/firecrawl.ts +5 -29
- package/node_modules/pi-web-access/gemini-search.ts +81 -32
- package/node_modules/pi-web-access/index.ts +149 -148
- package/node_modules/pi-web-access/jina-search.ts +4 -15
- package/node_modules/pi-web-access/kagi.ts +4 -13
- package/node_modules/pi-web-access/kimi-search.ts +5 -30
- package/node_modules/pi-web-access/mistral-search.ts +1 -15
- package/node_modules/pi-web-access/ollama.ts +2 -7
- package/node_modules/pi-web-access/openai-search.ts +174 -36
- package/node_modules/pi-web-access/opencode-session-headers.ts +24 -0
- package/node_modules/pi-web-access/package.json +10 -4
- package/node_modules/pi-web-access/page-query.ts +10 -2
- package/node_modules/pi-web-access/parallel.ts +1 -15
- package/node_modules/pi-web-access/pdf-extract.ts +3 -0
- package/node_modules/pi-web-access/querit.ts +5 -29
- package/node_modules/pi-web-access/search-answer-formatting.ts +11 -0
- package/node_modules/pi-web-access/search-result-count-normalization.ts +4 -0
- package/node_modules/pi-web-access/search1api.ts +5 -29
- package/node_modules/pi-web-access/searchinfinity.ts +5 -29
- package/node_modules/pi-web-access/searxng.ts +3 -21
- package/node_modules/pi-web-access/serpapi.ts +5 -28
- package/node_modules/pi-web-access/serpbase.ts +3 -22
- package/node_modules/pi-web-access/serpdive.ts +3 -21
- package/node_modules/pi-web-access/serper.ts +5 -28
- package/node_modules/pi-web-access/serply.ts +197 -0
- package/node_modules/pi-web-access/source-check.ts +11 -47
- package/node_modules/pi-web-access/summary-review.ts +7 -3
- package/node_modules/pi-web-access/tavily.ts +3 -21
- package/node_modules/pi-web-access/tinyfish.ts +5 -29
- package/node_modules/pi-web-access/utils.ts +9 -1
- package/node_modules/pi-web-access/valyu.ts +5 -28
- package/node_modules/pi-web-access/xai-search.ts +1 -15
- package/node_modules/pi-web-access/xcrawl.ts +5 -32
- package/package.json +17 -11
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ The package bundles 6 active `@herbertgao/*` child packages—`pi-bark`, `pi-cc-
|
|
|
28
28
|
- `@tifan/pi-rename@0.6.0`
|
|
29
29
|
- `pi-mcp-adapter@2.31.0`
|
|
30
30
|
- `pi-typesafe@0.5.0`
|
|
31
|
+
- `pi-multi-account@1.22.0`
|
|
31
32
|
- `pi-footer@0.5.1`
|
|
32
33
|
- `pi-jev-auto-mode@0.4.1`
|
|
33
34
|
- `pi-lens@4.2.1`
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -160,3 +160,29 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
160
160
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
161
161
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
162
162
|
THE SOFTWARE.
|
|
163
|
+
|
|
164
|
+
## `pi-multi-account`
|
|
165
|
+
|
|
166
|
+
The aggregate bundles the MIT-licensed [`pi-multi-account`](https://github.com/Sarrius/pi-multi-account) package version 1.22.0 under its original attribution:
|
|
167
|
+
|
|
168
|
+
MIT License
|
|
169
|
+
|
|
170
|
+
Copyright (c) 2026 pi-multi-account contributors
|
|
171
|
+
|
|
172
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
173
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
174
|
+
in the Software without restriction, including without limitation the rights
|
|
175
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
176
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
177
|
+
furnished to do so, subject to the following conditions:
|
|
178
|
+
|
|
179
|
+
The above copyright notice and this permission notice shall be included in
|
|
180
|
+
all copies or substantial portions of the Software.
|
|
181
|
+
|
|
182
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
183
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
184
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
185
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
186
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
187
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
188
|
+
THE SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-bark",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Send Bark notifications when Pi finishes or needs user input.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bark",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@earendil-works/pi-coding-agent": "^0.84.0 || ^0.85.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
45
|
+
"node": ">=24"
|
|
46
46
|
},
|
|
47
47
|
"pi": {
|
|
48
48
|
"extensions": [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<a href="https://pi.dev/packages?name=%40herbertgao%2Fpi-cc-extensions"><img alt="Pi package catalog" src="https://img.shields.io/badge/Pi-package-58B7FF?style=flat-square"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@herbertgao/pi-cc-extensions"><img alt="npm version" src="https://img.shields.io/npm/v/%40herbertgao%2Fpi-cc-extensions?style=flat-square&color=66E3C4"></a>
|
|
8
|
-
<a href="#compatibility"><img alt="Node.js
|
|
8
|
+
<a href="#compatibility"><img alt="Node.js 24 or newer" src="https://img.shields.io/badge/Node.js-%E2%89%A524-66E3C4?style=flat-square"></a>
|
|
9
9
|
<a href="./extensions"><img alt="TypeScript extensions" src="https://img.shields.io/badge/TypeScript-extensions-3178C6?style=flat-square"></a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
@@ -85,7 +85,7 @@ bun run typecheck
|
|
|
85
85
|
|
|
86
86
|
## Compatibility
|
|
87
87
|
|
|
88
|
-
- Node.js `>=
|
|
88
|
+
- Node.js `>=24`, Pi `^0.84.0 || ^0.85.0` (loaded through `pi.extensions` and `pi.themes` in the root `package.json`)
|
|
89
89
|
|
|
90
90
|
## Recommended companions
|
|
91
91
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<a href="https://pi.dev/packages?name=%40herbertgao%2Fpi-cc-extensions"><img alt="Pi package catalog" src="https://img.shields.io/badge/Pi-package-58B7FF?style=flat-square"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@herbertgao/pi-cc-extensions"><img alt="npm version" src="https://img.shields.io/npm/v/%40herbertgao%2Fpi-cc-extensions?style=flat-square&color=66E3C4"></a>
|
|
8
|
-
<a href="#兼容性"><img alt="Node.js
|
|
8
|
+
<a href="#兼容性"><img alt="Node.js 24 or newer" src="https://img.shields.io/badge/Node.js-%E2%89%A524-66E3C4?style=flat-square"></a>
|
|
9
9
|
<a href="./extensions"><img alt="TypeScript extensions" src="https://img.shields.io/badge/TypeScript-extensions-3178C6?style=flat-square"></a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
@@ -85,7 +85,7 @@ bun run typecheck
|
|
|
85
85
|
|
|
86
86
|
## 兼容性
|
|
87
87
|
|
|
88
|
-
- Node.js `>=
|
|
88
|
+
- Node.js `>=24`,Pi `^0.84.0 || ^0.85.0`(通过根目录 `package.json` 的 `pi.extensions` 和 `pi.themes` 加载)
|
|
89
89
|
|
|
90
90
|
## 推荐搭配
|
|
91
91
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-cc-extensions",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@earendil-works/pi-tui": "^0.84.0 || ^0.85.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
|
-
"node": ">=
|
|
59
|
+
"node": ">=24"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"x-upstream": {
|
|
71
71
|
"package": "pi-cc-extensions",
|
|
72
72
|
"version": "0.8.71",
|
|
73
|
+
"reviewedVersion": "0.9.1",
|
|
73
74
|
"repository": "https://github.com/minuque/pi-cc-extensions",
|
|
74
75
|
"commit": "e43e0041b59f5d7f03be9b9d103a5f9e954e4c11"
|
|
75
76
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#219](https://github.com/HerbertGao/pi-extensions/pull/219) [`6525a59`](https://github.com/HerbertGao/pi-extensions/commit/6525a5995b8bb815517e326f1eef78d25c0a3c5e) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Bundle `pi-multi-account@1.22.0` for automatic multi-account failover and rotation across supported Pi providers. Update the aggregate host to Pi 0.85.1 and widen the maintained child package compatibility ranges.
|
|
8
|
+
|
|
3
9
|
## 0.18.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-subagents",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Claude Code-style autonomous subagents and workflow orchestration for Pi, with HerbertGao-maintained UI extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@earendil-works/pi-tui": ">=0.84.0"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
62
|
+
"node": ">=24"
|
|
63
63
|
},
|
|
64
64
|
"pi": {
|
|
65
65
|
"extensions": [
|
|
@@ -56,16 +56,16 @@ Read the [SoL-Pi blog](https://nvlabs.github.io/SoL-Pi/) for a deeper look at th
|
|
|
56
56
|
|
|
57
57
|
### Requirements
|
|
58
58
|
|
|
59
|
-
- Node.js
|
|
59
|
+
- Node.js 24 or newer
|
|
60
60
|
- npm
|
|
61
|
-
- `@earendil-works/pi-coding-agent` 0.
|
|
61
|
+
- `@earendil-works/pi-coding-agent` 0.85.1
|
|
62
62
|
|
|
63
63
|
### Install
|
|
64
64
|
|
|
65
65
|
Install the tested Pi release:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npm install --global @earendil-works/pi-coding-agent@0.
|
|
68
|
+
npm install --global @earendil-works/pi-coding-agent@0.85.1
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Then install SoL-Pi directly from [NVlabs/SoL-Pi](https://github.com/NVlabs/SoL-Pi):
|
|
@@ -8,10 +8,10 @@ The following packages are supplied by the user's Pi installation and retain the
|
|
|
8
8
|
|
|
9
9
|
| Package | Development-tested version | License | Source |
|
|
10
10
|
| --- | ---: | --- | --- |
|
|
11
|
-
| `@earendil-works/pi-agent-core` | 0.
|
|
12
|
-
| `@earendil-works/pi-ai` | 0.
|
|
13
|
-
| `@earendil-works/pi-coding-agent` | 0.
|
|
14
|
-
| `@earendil-works/pi-tui` | 0.
|
|
11
|
+
| `@earendil-works/pi-agent-core` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
|
|
12
|
+
| `@earendil-works/pi-ai` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
|
|
13
|
+
| `@earendil-works/pi-coding-agent` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
|
|
14
|
+
| `@earendil-works/pi-tui` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
|
|
15
15
|
| `typebox` | 1.3.7 | MIT | <https://github.com/sinclairzx81/typebox> |
|
|
16
16
|
|
|
17
17
|
## Development-only dependencies
|
|
@@ -7,7 +7,7 @@ Installation and configuration are complete only when Pi remains unmodified, the
|
|
|
7
7
|
## Rules
|
|
8
8
|
|
|
9
9
|
- Do not modify, patch, fork, or vendor upstream Pi. SoL-Pi must load as a standalone extension through Pi's public package interface.
|
|
10
|
-
- Use Node.js
|
|
10
|
+
- Use Node.js 24 or newer and the tested Pi release `@earendil-works/pi-coding-agent@0.85.1`. Treat a different Pi version as a compatibility change and rerun the full suite before using it.
|
|
11
11
|
- Do not clean, reset, switch, or overwrite unrelated repository changes.
|
|
12
12
|
- Do not print, log, commit, upload, or include any secret in a command line. Check only whether a credential is present.
|
|
13
13
|
- Keep SoL-Pi settings in `sol-pi.json`. The Evidence-Preserving Reducer provider/model route is a SoL-Pi setting; provider URLs, credentials, the main agent model, and shell behavior remain Pi settings.
|
|
@@ -35,7 +35,7 @@ node --version
|
|
|
35
35
|
npm --version
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Require Node.js
|
|
38
|
+
Require Node.js 24 or newer. Install from the lockfile and run the source checks:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
npm ci --ignore-scripts
|
|
@@ -54,11 +54,11 @@ Stop if any command fails. Do not hide a failure with `|| true` or replace `npm
|
|
|
54
54
|
Install the tested Pi release without changing its source:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
npm install --global --ignore-scripts @earendil-works/pi-coding-agent@0.
|
|
57
|
+
npm install --global --ignore-scripts @earendil-works/pi-coding-agent@0.85.1
|
|
58
58
|
pi --version
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Require `pi --version` to report `0.
|
|
61
|
+
Require `pi --version` to report `0.85.1`.
|
|
62
62
|
|
|
63
63
|
For a project-local registration, run this from `target_project` and substitute the resolved absolute `sol_pi_root`:
|
|
64
64
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pi Compatibility
|
|
2
2
|
|
|
3
|
-
SoL-Pi is developed and tested against `@earendil-works/pi-coding-agent` 0.
|
|
3
|
+
SoL-Pi is developed and tested against `@earendil-works/pi-coding-agent` 0.85.1. Its public API surface is also type-checked and exercised against Pi 0.81.1, the base used by the original Pi fork. The runtime range is deliberately expressed as a peer dependency because Pi owns installation and upgrade of its packages.
|
|
4
4
|
|
|
5
5
|
SoL-Pi imports only public package exports:
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ ObservationPack changes only the messages projected through the public `context`
|
|
|
31
31
|
|
|
32
32
|
The reducer handles public `tool_result` events and resolves the configured reducer provider/model through Pi's model registry before calling `ExtensionContext.modelRegistry.complete()` when available. For the Pi 0.81.1 fork, which exposes no registry `complete()` method, it resolves authentication for that reducer model through `getApiKeyAndHeaders()` and calls the shared `@earendil-works/pi-ai/compat` completion API. The reducer preserves the original result whenever the configured reducer model is unavailable or eligibility, model-call, schema, source-hash, exact-quote, size, or likely-secret checks fail.
|
|
33
33
|
|
|
34
|
-
All persistent paths use `SessionManager.getSessionDir()` and `getSessionId()`, which are present in both the fork and Pi 0.
|
|
34
|
+
All persistent paths use `SessionManager.getSessionDir()` and `getSessionId()`, which are present in both the fork and Pi 0.85.1. SoL-Pi creates no configurable storage-path surface.
|
|
35
35
|
|
|
36
36
|
The unpublished shared artifact layout is not read or migrated. Each session starts from its own `<sessionDir>/sol-pi/<sessionId>/` directory.
|
|
37
37
|
|
|
@@ -41,13 +41,13 @@ Online Context Compact uses ordinary public `context` and `before_provider_reque
|
|
|
41
41
|
|
|
42
42
|
Before selecting or executing a boundary compaction, it also checks the optional `Symbol.for("pi-subagents:manager")` registry exposed by `pi-subagents`. A running top-level subagent, or an unreadable registry, suppresses that compaction rather than risking a context rewrite during delegated work. When the registry is absent, the check is a no-op.
|
|
43
43
|
|
|
44
|
-
Pi does not expose its active retained-tail compaction setting through the public extension context. The standalone extension therefore uses the documented Pi 0.
|
|
44
|
+
Pi does not expose its active retained-tail compaction setting through the public extension context. The standalone extension therefore uses the documented Pi 0.85.1 default of 20,000 tokens for its economic estimate. Its programmatic factory accepts an explicit matching value for a non-default Pi setting.
|
|
45
45
|
|
|
46
|
-
Pi 0.
|
|
46
|
+
Pi 0.85.1's `ExtensionContext.compact()` aborts the active agent before it summarizes, and `agent_settled` fires only once a whole run has drained every turn, retry, auto-compaction, and queued continuation. A plan boundary that selects compaction therefore saves its plan and progress state, calls `ExtensionContext.abort()` to stop the run, and runs compaction from the `agent_settled` that stop produces. The handler awaits the compaction's own `onComplete`/`onError` callbacks. On success, the extension sends a hidden reminder through public `ExtensionAPI.sendMessage()` with `triggerTurn: true`, so Pi starts a new turn against the compacted context and rebuilds the plan even when the native summary omits that instruction.
|
|
47
47
|
|
|
48
48
|
A settlement barrier keeps the original `agent_settled` dispatch open until the triggered continuation settles. Print- and JSON-mode processes therefore complete the compact-and-continue sequence within the same Pi invocation; an outer driver does not need to resume the session or send `Continue working`. This continuation is armed only by a successful boundary compaction. Cancelling or exiting does not schedule one. A Pi build that never emits `agent_settled` starts no boundary compaction.
|
|
49
49
|
|
|
50
|
-
Pi 0.
|
|
50
|
+
Pi 0.85.1 does not return a promise from `ExtensionAPI.sendMessage()`. The barrier is therefore verified for standalone SoL-Pi and depends on Pi starting the requested turn synchronously. A later-loaded third-party extension that performs long asynchronous work in its own `agent_settled` handler is outside this guarantee and needs an integration test with that extension set.
|
|
51
51
|
|
|
52
52
|
Pi reports the session as idle while an extension-requested manual compaction is running. SoL-Pi cancels `session_before_tree` during that interval to prevent tree navigation from moving the active leaf underneath the compaction. Navigation works normally after the compaction callback settles.
|
|
53
53
|
|
|
@@ -57,7 +57,7 @@ The standalone entry passes `cacheWriteReadRatio` from `sol-pi.json` directly in
|
|
|
57
57
|
|
|
58
58
|
## Interactive TUI
|
|
59
59
|
|
|
60
|
-
The lightning savings treatment uses Pi 0.
|
|
60
|
+
The lightning savings treatment uses Pi 0.85.1's public `renderCall`,
|
|
61
61
|
`renderResult`, `ctx.ui.notify()`, and keyed `ctx.ui.setStatus()` APIs. It checks
|
|
62
62
|
`ctx.mode === "tui"` rather than `ctx.hasUI`, because RPC mode also reports UI
|
|
63
63
|
support. The renderer therefore changes only the interactive terminal display;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/sol-pi",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Token-efficient context and tool extensions for Pi, maintained from NVlabs/SoL-Pi.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"vitest": "^4.0.18"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
62
|
+
"node": ">=24"
|
|
63
63
|
},
|
|
64
64
|
"pi": {
|
|
65
65
|
"extensions": [
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
|
|
4
4
|
// src/btw.ts
|
|
5
|
-
import {
|
|
6
|
-
clampThinkingLevel,
|
|
7
|
-
getSupportedThinkingLevels as getSupportedThinkingLevels2
|
|
8
|
-
} from "@earendil-works/pi-ai";
|
|
9
|
-
import { BorderedLoader as BorderedLoader2 } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { clampThinkingLevel, getSupportedThinkingLevels as getSupportedThinkingLevels2 } from "@earendil-works/pi-ai";
|
|
10
6
|
|
|
11
7
|
// src/bring-to-main.ts
|
|
12
8
|
import { Key, matchesKey, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
@@ -1352,7 +1348,11 @@ async function completeSideThreadTurn({
|
|
|
1352
1348
|
const response = await completeSimple(
|
|
1353
1349
|
model,
|
|
1354
1350
|
{ systemPrompt: SYSTEM_PROMPT, messages: buildSideThreadMessages(thread, question) },
|
|
1355
|
-
buildStreamOptions(
|
|
1351
|
+
buildStreamOptions(
|
|
1352
|
+
auth,
|
|
1353
|
+
{ thinkingLevel, signal, model, sessionId },
|
|
1354
|
+
completeSimple.appliesRequestHeaderTransforms === true
|
|
1355
|
+
)
|
|
1356
1356
|
);
|
|
1357
1357
|
if (signal?.aborted || response?.stopReason === "aborted") return { kind: "aborted" };
|
|
1358
1358
|
if (!isAssistantMessage(response)) {
|
|
@@ -1405,34 +1405,25 @@ function createUserMessage(text) {
|
|
|
1405
1405
|
timestamp: Date.now()
|
|
1406
1406
|
};
|
|
1407
1407
|
}
|
|
1408
|
-
var OPENCODE_HOST = "opencode.ai";
|
|
1409
|
-
function matchesOpencodeHost(baseUrl) {
|
|
1410
|
-
if (!baseUrl) return false;
|
|
1411
|
-
try {
|
|
1412
|
-
return new URL(baseUrl).hostname === OPENCODE_HOST;
|
|
1413
|
-
} catch {
|
|
1414
|
-
return false;
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
1408
|
function getOpencodeSessionHeaders(model, sessionId) {
|
|
1418
|
-
if (!sessionId) return void 0;
|
|
1419
|
-
if (model.provider !== "opencode" && model.provider !== "opencode-go" && !matchesOpencodeHost(model.baseUrl)) {
|
|
1420
|
-
return void 0;
|
|
1421
|
-
}
|
|
1409
|
+
if (!sessionId || model.provider !== "opencode" && model.provider !== "opencode-go") return void 0;
|
|
1422
1410
|
return { "x-opencode-session": sessionId, "x-opencode-client": "pi" };
|
|
1423
1411
|
}
|
|
1424
1412
|
function mergeSessionHeaders(authHeaders, sessionHeaders) {
|
|
1425
1413
|
if (!sessionHeaders && !authHeaders) return void 0;
|
|
1426
1414
|
return { ...sessionHeaders, ...authHeaders };
|
|
1427
1415
|
}
|
|
1428
|
-
function buildStreamOptions(auth, { thinkingLevel, signal, model, sessionId }) {
|
|
1416
|
+
function buildStreamOptions(auth, { thinkingLevel, signal, model, sessionId }, applyRequestHeaderTransforms) {
|
|
1429
1417
|
const sessionHeaders = model ? getOpencodeSessionHeaders(model, sessionId) : void 0;
|
|
1430
1418
|
const options = {
|
|
1431
|
-
apiKey: auth
|
|
1432
|
-
headers: mergeSessionHeaders(auth
|
|
1433
|
-
env: auth
|
|
1419
|
+
apiKey: auth?.apiKey,
|
|
1420
|
+
headers: applyRequestHeaderTransforms ? auth?.headers : mergeSessionHeaders(auth?.headers, sessionHeaders),
|
|
1421
|
+
env: auth?.env,
|
|
1434
1422
|
signal
|
|
1435
1423
|
};
|
|
1424
|
+
if (applyRequestHeaderTransforms && sessionHeaders) {
|
|
1425
|
+
options.transformHeaders = (headers) => mergeSessionHeaders(headers, sessionHeaders) ?? {};
|
|
1426
|
+
}
|
|
1436
1427
|
if (thinkingLevel !== "off") options.reasoning = thinkingLevel;
|
|
1437
1428
|
return options;
|
|
1438
1429
|
}
|
|
@@ -2413,6 +2404,14 @@ function sanitizeEntryForDisplay(entry) {
|
|
|
2413
2404
|
...entry,
|
|
2414
2405
|
name: entry.name === void 0 ? void 0 : sanitizeSingleLine(entry.name)
|
|
2415
2406
|
};
|
|
2407
|
+
case "usage":
|
|
2408
|
+
return {
|
|
2409
|
+
...entry,
|
|
2410
|
+
kind: sanitizeSingleLine(entry.kind),
|
|
2411
|
+
provider: sanitizeSingleLine(entry.provider),
|
|
2412
|
+
model: sanitizeSingleLine(entry.model),
|
|
2413
|
+
note: entry.note === void 0 ? void 0 : sanitizeSingleLine(entry.note)
|
|
2414
|
+
};
|
|
2416
2415
|
}
|
|
2417
2416
|
}
|
|
2418
2417
|
function sanitizeDisplayContent(content) {
|
|
@@ -3107,11 +3106,9 @@ function escapeTerminalControls2(text) {
|
|
|
3107
3106
|
// src/btw.ts
|
|
3108
3107
|
var MAX_CONTEXT_CHARS = 4e4;
|
|
3109
3108
|
function createModelRegistryCompleteSimple(modelRegistry) {
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
return provider.streamSimple(model, context, options).result();
|
|
3114
|
-
};
|
|
3109
|
+
const completeSimple = async (model, context, options) => modelRegistry.streamSimple(model, context, options).result();
|
|
3110
|
+
completeSimple.appliesRequestHeaderTransforms = true;
|
|
3111
|
+
return completeSimple;
|
|
3115
3112
|
}
|
|
3116
3113
|
async function resolveBtwModel({
|
|
3117
3114
|
settings,
|
|
@@ -3120,6 +3117,8 @@ async function resolveBtwModel({
|
|
|
3120
3117
|
warn
|
|
3121
3118
|
}) {
|
|
3122
3119
|
const reportWarning = (message) => warn?.(sanitizeSingleLine(message));
|
|
3120
|
+
const availableModels = modelRegistry.getAvailable();
|
|
3121
|
+
const isAvailable = (model) => availableModels.some((candidate) => candidate.provider === model.provider && candidate.id === model.id);
|
|
3123
3122
|
if (settings.model) {
|
|
3124
3123
|
const fallback = currentModel ? `${currentModel.provider}/${currentModel.id}` : "the current model";
|
|
3125
3124
|
const reference = parseBtwModelReference(settings.model);
|
|
@@ -3130,45 +3129,16 @@ async function resolveBtwModel({
|
|
|
3130
3129
|
const configuredModel = modelRegistry.find(reference.provider, reference.modelId);
|
|
3131
3130
|
if (!configuredModel) {
|
|
3132
3131
|
reportWarning(`pi-btw model ${settings.model} was not found; falling back to ${fallback}.`);
|
|
3132
|
+
} else if (isAvailable(configuredModel)) {
|
|
3133
|
+
return { model: configuredModel };
|
|
3133
3134
|
} else {
|
|
3134
3135
|
const sameAsCurrent = configuredModel === currentModel || configuredModel.provider === currentModel?.provider && configuredModel.id === currentModel.id;
|
|
3135
3136
|
const fallbackAction = sameAsCurrent ? "no distinct current model is available" : `falling back to ${fallback}`;
|
|
3136
|
-
|
|
3137
|
-
const auth = await modelRegistry.getApiKeyAndHeaders(configuredModel);
|
|
3138
|
-
if (auth.ok && hasRequestAuth(auth)) {
|
|
3139
|
-
return {
|
|
3140
|
-
model: auth.baseUrl ? { ...configuredModel, baseUrl: auth.baseUrl } : configuredModel,
|
|
3141
|
-
auth
|
|
3142
|
-
};
|
|
3143
|
-
}
|
|
3144
|
-
const reason = auth.ok ? "has no request credentials" : auth.error;
|
|
3145
|
-
reportWarning(`pi-btw model ${settings.model} is unavailable (${reason}); ${fallbackAction}.`);
|
|
3146
|
-
} catch (error) {
|
|
3147
|
-
reportWarning(`pi-btw model ${settings.model} credentials failed (${formatError5(error)}); ${fallbackAction}.`);
|
|
3148
|
-
}
|
|
3137
|
+
reportWarning(`pi-btw model ${settings.model} is unavailable; ${fallbackAction}.`);
|
|
3149
3138
|
if (sameAsCurrent) return void 0;
|
|
3150
3139
|
}
|
|
3151
3140
|
}
|
|
3152
|
-
|
|
3153
|
-
try {
|
|
3154
|
-
const auth = await modelRegistry.getApiKeyAndHeaders(currentModel);
|
|
3155
|
-
if (auth.ok && hasRequestAuth(auth)) {
|
|
3156
|
-
return {
|
|
3157
|
-
model: auth.baseUrl ? { ...currentModel, baseUrl: auth.baseUrl } : currentModel,
|
|
3158
|
-
auth
|
|
3159
|
-
};
|
|
3160
|
-
}
|
|
3161
|
-
} catch {
|
|
3162
|
-
}
|
|
3163
|
-
return void 0;
|
|
3164
|
-
}
|
|
3165
|
-
function hasRequestAuth(auth) {
|
|
3166
|
-
return Boolean(
|
|
3167
|
-
auth.apiKey || providerHeadersHaveValue(auth.headers) || auth.env && Object.keys(auth.env).length > 0
|
|
3168
|
-
);
|
|
3169
|
-
}
|
|
3170
|
-
function providerHeadersHaveValue(headers) {
|
|
3171
|
-
return headers !== void 0 && Object.values(headers).some((value) => value !== null);
|
|
3141
|
+
return currentModel && isAvailable(currentModel) ? { model: currentModel } : void 0;
|
|
3172
3142
|
}
|
|
3173
3143
|
function formatError5(error) {
|
|
3174
3144
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -3189,7 +3159,7 @@ function btw(pi, dependencies = {}) {
|
|
|
3189
3159
|
const showCommandMenu = dependencies.showCommandMenu ?? showCommandMenuForBtw;
|
|
3190
3160
|
const pickEntry = dependencies.pickMainEntry ?? pickMainEntry;
|
|
3191
3161
|
const loadSettings = dependencies.loadSettings ?? loadSettingsForCommand;
|
|
3192
|
-
const resolveModel = dependencies.resolveModel ??
|
|
3162
|
+
const resolveModel = dependencies.resolveModel ?? resolveBtwModelForCommand;
|
|
3193
3163
|
const runThread = dependencies.runThread ?? runBtwThread;
|
|
3194
3164
|
const runFullscreen = dependencies.runFullscreen ?? runBtwFullscreen;
|
|
3195
3165
|
const resumableThreads = /* @__PURE__ */ new Map();
|
|
@@ -3308,33 +3278,14 @@ async function loadSettingsForCommand(ctx) {
|
|
|
3308
3278
|
}
|
|
3309
3279
|
return {};
|
|
3310
3280
|
}
|
|
3311
|
-
async function
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
settled = true;
|
|
3318
|
-
done({ kind: "cancelled" });
|
|
3319
|
-
};
|
|
3320
|
-
resolveBtwModel({
|
|
3321
|
-
settings,
|
|
3322
|
-
currentModel: ctx.model,
|
|
3323
|
-
modelRegistry: ctx.modelRegistry,
|
|
3324
|
-
warn: (message) => {
|
|
3325
|
-
if (!settled) notifySafely3(ctx, message, "warning");
|
|
3326
|
-
}
|
|
3327
|
-
}).then((selected) => {
|
|
3328
|
-
if (settled) return;
|
|
3329
|
-
settled = true;
|
|
3330
|
-
done(selected ? { kind: "selected", selected } : { kind: "unavailable" });
|
|
3331
|
-
}).catch(() => {
|
|
3332
|
-
if (settled) return;
|
|
3333
|
-
settled = true;
|
|
3334
|
-
done({ kind: "unavailable" });
|
|
3335
|
-
});
|
|
3336
|
-
return loader;
|
|
3281
|
+
async function resolveBtwModelForCommand(settings, ctx) {
|
|
3282
|
+
const selected = await resolveBtwModel({
|
|
3283
|
+
settings,
|
|
3284
|
+
currentModel: ctx.model,
|
|
3285
|
+
modelRegistry: ctx.modelRegistry,
|
|
3286
|
+
warn: (message) => notifySafely3(ctx, message, "warning")
|
|
3337
3287
|
});
|
|
3288
|
+
return selected ? { kind: "selected", selected } : { kind: "unavailable" };
|
|
3338
3289
|
}
|
|
3339
3290
|
async function runBtwThread({
|
|
3340
3291
|
initialQuestion,
|
|
@@ -3684,7 +3635,6 @@ async function askThreadQuestion(thread, question, selected, thinkingLevel, ctx,
|
|
|
3684
3635
|
question,
|
|
3685
3636
|
model: selected.model,
|
|
3686
3637
|
thinkingLevel,
|
|
3687
|
-
auth: selected.auth,
|
|
3688
3638
|
signal: view.signal,
|
|
3689
3639
|
completeSimple: createModelRegistryCompleteSimple(ctx.modelRegistry),
|
|
3690
3640
|
sessionId: readBtwSessionId(ctx)
|