@caupulican/pi-adaptative 0.80.34 → 0.80.38
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/CHANGELOG.md +5 -1
- package/README.md +1 -0
- package/dist/core/extensions/loader.d.ts +18 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +130 -17
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +6 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +6 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +3 -6
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +45 -21
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +24 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +377 -88
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/extensions.md +24 -0
- package/docs/providers.md +16 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +5 -5
package/docs/extensions.md
CHANGED
|
@@ -286,6 +286,30 @@ This pattern makes the fetched models available during normal startup and to `pi
|
|
|
286
286
|
|
|
287
287
|
Run `npm install` in the extension directory, then imports from `node_modules/` work automatically.
|
|
288
288
|
|
|
289
|
+
### Lazy tool packages
|
|
290
|
+
|
|
291
|
+
Large tool-only extensions can opt into lazy loading so pi discovers tool metadata at boot without importing the extension module or retaining its state. Add `pi.lazyTools` to the package manifest. The extension factory is imported and run only when one of those tools is executed.
|
|
292
|
+
|
|
293
|
+
```json
|
|
294
|
+
{
|
|
295
|
+
"name": "heavy-tool-extension",
|
|
296
|
+
"pi": {
|
|
297
|
+
"extensions": ["./src/index.ts"],
|
|
298
|
+
"lazyTools": [
|
|
299
|
+
{
|
|
300
|
+
"name": "heavy_query",
|
|
301
|
+
"label": "Heavy Query",
|
|
302
|
+
"description": "Run the heavy query engine on demand",
|
|
303
|
+
"promptSnippet": "Run the heavy query engine",
|
|
304
|
+
"parameters": { "type": "object", "properties": {}, "additionalProperties": false }
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Use lazy loading only for tool-only startup behavior. Event handlers, commands, flags, providers, shortcuts, and dynamic resource discovery require the factory to run at startup, so those extensions should stay eager or split heavy tools into a separate lazy package.
|
|
312
|
+
|
|
289
313
|
## Events
|
|
290
314
|
|
|
291
315
|
### Lifecycle Overview
|
package/docs/providers.md
CHANGED
|
@@ -76,6 +76,7 @@ pi
|
|
|
76
76
|
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
77
77
|
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
78
78
|
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
79
|
+
| Fugu | `SAKANA_API_KEY` or `FUGU_API_KEY` (`FUGU_BASE_URL` optional) | `fugu` |
|
|
79
80
|
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
|
|
80
81
|
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
81
82
|
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
@@ -110,6 +111,7 @@ Store credentials in `~/.pi/agent/auth.json`:
|
|
|
110
111
|
{
|
|
111
112
|
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
|
|
112
113
|
"openai": { "type": "api_key", "key": "sk-..." },
|
|
114
|
+
"fugu": { "type": "api_key", "key": "$SAKANA_API_KEY" },
|
|
113
115
|
"deepseek": { "type": "api_key", "key": "sk-..." },
|
|
114
116
|
"google": { "type": "api_key", "key": "..." },
|
|
115
117
|
"opencode": { "type": "api_key", "key": "..." },
|
|
@@ -124,6 +126,20 @@ Store credentials in `~/.pi/agent/auth.json`:
|
|
|
124
126
|
|
|
125
127
|
The file is created with `0600` permissions (user read/write only). Auth file credentials take priority over environment variables.
|
|
126
128
|
|
|
129
|
+
#### Fugu
|
|
130
|
+
|
|
131
|
+
Sakana Fugu uses the OpenAI Responses-compatible Sakana API at `https://api.sakana.ai/v1`.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
export SAKANA_API_KEY=... # preferred; matches Sakana's Codex/Fugu setup
|
|
135
|
+
# or export FUGU_API_KEY=...
|
|
136
|
+
# optional: export FUGU_BASE_URL=https://api.sakana.ai
|
|
137
|
+
pi --provider fugu --model fugu
|
|
138
|
+
pi --provider fugu --model fugu-ultra --thinking xhigh
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Both `fugu` and `fugu-ultra` support image input and only the `high` and `xhigh` reasoning levels. `FUGU_BASE_URL` is normalized to include `/v1`. Complex `fugu-ultra` tasks may need higher request timeouts.
|
|
142
|
+
|
|
127
143
|
### Key Resolution
|
|
128
144
|
|
|
129
145
|
The `key` field supports command execution, environment interpolation, and literals:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.35",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.35",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.35",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.35",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.35",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.35",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.38",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@caupulican/pi-adaptative",
|
|
9
|
-
"version": "0.80.
|
|
9
|
+
"version": "0.80.38",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@caupulican/pi-agent-core": "^0.80.
|
|
13
|
-
"@caupulican/pi-ai": "^0.80.
|
|
14
|
-
"@caupulican/pi-tui": "^0.80.
|
|
12
|
+
"@caupulican/pi-agent-core": "^0.80.38",
|
|
13
|
+
"@caupulican/pi-ai": "^0.80.38",
|
|
14
|
+
"@caupulican/pi-tui": "^0.80.38",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"chalk": "5.6.2",
|
|
17
17
|
"cross-spawn": "7.0.6",
|
|
@@ -474,11 +474,11 @@
|
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
"node_modules/@caupulican/pi-agent-core": {
|
|
477
|
-
"version": "0.80.
|
|
478
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.80.
|
|
477
|
+
"version": "0.80.38",
|
|
478
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.80.38.tgz",
|
|
479
479
|
"license": "MIT",
|
|
480
480
|
"dependencies": {
|
|
481
|
-
"@caupulican/pi-ai": "^0.80.
|
|
481
|
+
"@caupulican/pi-ai": "^0.80.38",
|
|
482
482
|
"ignore": "7.0.5",
|
|
483
483
|
"typebox": "1.1.38",
|
|
484
484
|
"yaml": "2.9.0"
|
|
@@ -488,8 +488,8 @@
|
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
"node_modules/@caupulican/pi-ai": {
|
|
491
|
-
"version": "0.80.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.80.
|
|
491
|
+
"version": "0.80.38",
|
|
492
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.80.38.tgz",
|
|
493
493
|
"license": "MIT",
|
|
494
494
|
"dependencies": {
|
|
495
495
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -511,8 +511,8 @@
|
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
513
|
"node_modules/@caupulican/pi-tui": {
|
|
514
|
-
"version": "0.80.
|
|
515
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.80.
|
|
514
|
+
"version": "0.80.38",
|
|
515
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.80.38.tgz",
|
|
516
516
|
"license": "MIT",
|
|
517
517
|
"dependencies": {
|
|
518
518
|
"get-east-asian-width": "1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.38",
|
|
4
4
|
"description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
34
|
"clean": "shx rm -rf dist",
|
|
35
|
-
"build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets",
|
|
35
|
+
"build": "node ../../scripts/tsgo-or-tsc.mjs -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets",
|
|
36
36
|
"build:binary": "npm --prefix ../tui run build && npm --prefix ../ai run build && npm --prefix ../agent run build && npm run build && bun build --compile ./dist/bun/cli.js ./src/utils/image-resize-worker.ts --outfile dist/pi && npm run copy-binary-assets",
|
|
37
37
|
"copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/modes/interactive/assets && shx cp src/modes/interactive/assets/*.png dist/modes/interactive/assets/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/",
|
|
38
38
|
"copy-binary-assets": "shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/assets && shx cp src/modes/interactive/assets/*.png dist/assets/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@caupulican/pi-agent-core": "^0.80.
|
|
45
|
-
"@caupulican/pi-ai": "^0.80.
|
|
46
|
-
"@caupulican/pi-tui": "^0.80.
|
|
44
|
+
"@caupulican/pi-agent-core": "^0.80.38",
|
|
45
|
+
"@caupulican/pi-ai": "^0.80.38",
|
|
46
|
+
"@caupulican/pi-tui": "^0.80.38",
|
|
47
47
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
48
48
|
"chalk": "5.6.2",
|
|
49
49
|
"cross-spawn": "7.0.6",
|