@caupulican/pi-adaptative 0.78.3 → 0.79.0
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 +17 -0
- package/README.md +4 -4
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +16 -13
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +20 -10
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +16 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +8 -12
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +8 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +13 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +346 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +24 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +419 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/extensions.md +2 -2
- package/docs/quickstart.md +4 -4
- package/docs/sdk.md +3 -3
- package/docs/settings.md +4 -0
- package/docs/usage.md +5 -5
- 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/examples/sdk/07-context-files.ts +2 -2
- package/npm-shrinkwrap.json +15 -18
- package/package.json +4 -4
package/docs/extensions.md
CHANGED
|
@@ -480,7 +480,7 @@ pi.on("before_agent_start", async (event, ctx) => {
|
|
|
480
480
|
// .promptGuidelines - custom guideline bullets
|
|
481
481
|
// .appendSystemPrompt - text from --append-system-prompt flags
|
|
482
482
|
// .cwd - working directory
|
|
483
|
-
// .contextFiles -
|
|
483
|
+
// .contextFiles - eagerly loaded AGENTS.md/CLAUDE.md/GEMINI.md context files
|
|
484
484
|
// .skills - discovered skills; startup prompt includes locations only, not frontmatter
|
|
485
485
|
|
|
486
486
|
return {
|
|
@@ -496,7 +496,7 @@ pi.on("before_agent_start", async (event, ctx) => {
|
|
|
496
496
|
});
|
|
497
497
|
```
|
|
498
498
|
|
|
499
|
-
The `systemPromptOptions` field gives extensions access to the same structured data Pi uses to build the system prompt. This lets you inspect what Pi has discovered — custom prompts, guidelines, tool snippets, context file
|
|
499
|
+
The `systemPromptOptions` field gives extensions access to the same structured data Pi uses to build the system prompt. This lets you inspect what Pi has discovered — custom prompts, guidelines, tool snippets, context file contents, skills — without re-discovering resources or re-parsing flags. Use it when your extension needs to make deep, informed changes to the system prompt while respecting user-provided configuration.
|
|
500
500
|
|
|
501
501
|
Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
|
|
502
502
|
|
package/docs/quickstart.md
CHANGED
|
@@ -85,7 +85,7 @@ Additional built-in read-only tools (`grep`, `find`, `ls`) are available through
|
|
|
85
85
|
|
|
86
86
|
## Give pi project instructions
|
|
87
87
|
|
|
88
|
-
Pi discovers context file
|
|
88
|
+
Pi discovers and injects context file contents at startup. Add an `AGENTS.md` file to tell it how to work in a project:
|
|
89
89
|
|
|
90
90
|
```markdown
|
|
91
91
|
# Project Instructions
|
|
@@ -97,10 +97,10 @@ Pi discovers context file locations at startup and lazy-loads their contents onl
|
|
|
97
97
|
|
|
98
98
|
Pi discovers:
|
|
99
99
|
|
|
100
|
-
-
|
|
101
|
-
- `AGENTS.md` or `
|
|
100
|
+
- `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` in `~/.pi/agent/` for global instructions
|
|
101
|
+
- `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` from parent directories and the current directory
|
|
102
102
|
|
|
103
|
-
Restart pi, or run `/reload`, after changing context file
|
|
103
|
+
Restart pi, or run `/reload`, after changing context file contents or locations so the next prompt rebuild includes the latest instructions.
|
|
104
104
|
|
|
105
105
|
## Common things to try
|
|
106
106
|
|
package/docs/sdk.md
CHANGED
|
@@ -348,7 +348,7 @@ const { session } = await createAgentSession({
|
|
|
348
348
|
- `.pi/skills/`
|
|
349
349
|
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
|
|
350
350
|
- Project prompts (`.pi/prompts/`)
|
|
351
|
-
- Context files (`AGENTS.md` walking up from cwd)
|
|
351
|
+
- Context files (`AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` walking up from cwd)
|
|
352
352
|
- Session directory naming
|
|
353
353
|
|
|
354
354
|
`agentDir` is used by `DefaultResourceLoader` for:
|
|
@@ -357,7 +357,7 @@ const { session } = await createAgentSession({
|
|
|
357
357
|
- `skills/` under `agentDir` (for example `~/.pi/agent/skills/`)
|
|
358
358
|
- `~/.agents/skills/`
|
|
359
359
|
- Global prompts (`prompts/`)
|
|
360
|
-
- Global context file (`AGENTS.md`)
|
|
360
|
+
- Global context file (`AGENTS.md`, `CLAUDE.md`, or `GEMINI.md`)
|
|
361
361
|
- Settings (`settings.json`)
|
|
362
362
|
- Custom models (`models.json`)
|
|
363
363
|
- Credentials (`auth.json`)
|
|
@@ -633,7 +633,7 @@ const loader = new DefaultResourceLoader({
|
|
|
633
633
|
agentsFilesOverride: (current) => ({
|
|
634
634
|
agentsFiles: [
|
|
635
635
|
...current.agentsFiles,
|
|
636
|
-
{ path: "/virtual/AGENTS.md" },
|
|
636
|
+
{ path: "/virtual/AGENTS.md", content: "Virtual project instructions" },
|
|
637
637
|
],
|
|
638
638
|
}),
|
|
639
639
|
});
|
package/docs/settings.md
CHANGED
|
@@ -75,6 +75,8 @@ Set `PI_SKIP_VERSION_CHECK=1` to disable the Pi version update check. Use `--off
|
|
|
75
75
|
| `selfModification.enabled` | boolean | `false` | Allow the agent to modify Pi's own source/harness when explicitly tasked |
|
|
76
76
|
| `selfModification.sourcePath` | string | - | Path to the `pi-adaptative` source checkout the agent must use for self-modification |
|
|
77
77
|
|
|
78
|
+
Use `/settings` → **Self modification** to configure this interactively. The submenu lets you choose whether to save globally or to the current project's `.pi/settings.json`. Pi warns when the path does not look like a `pi-adaptative` checkout, and a new session or `/reload` is recommended after changing guardrail settings.
|
|
79
|
+
|
|
78
80
|
When disabled, the system prompt tells the agent not to edit Pi core, the installed runtime, or harness source for self-evolution. To permit self-modification, enable the setting and provide the source checkout path:
|
|
79
81
|
|
|
80
82
|
```json
|
|
@@ -101,6 +103,8 @@ The agent is instructed to edit only that source checkout, preserve unrelated ch
|
|
|
101
103
|
| `autoLearn.maxConcurrentLearners` | number | `2` | Maximum running Auto Learn background learners across all session tenants |
|
|
102
104
|
| `autoLearn.applyHighConfidence` | boolean | `false` | Allow the learner to apply high-confidence memory candidates; tooling/core changes remain proposal/approval-gated |
|
|
103
105
|
|
|
106
|
+
Use `/settings` → **Auto Learn** to configure this interactively, including the scavenger model. The submenu lets you choose whether to save globally or to the current project's `.pi/settings.json`. The model picker prioritizes models from currently configured subscription/API accounts and still offers a manual custom-pattern entry. Use `/auto-learn status` to inspect trigger state, cooldown, and running leases; use `/auto-learn run` to start one learner immediately.
|
|
107
|
+
|
|
104
108
|
When enabled, Auto Learn uses a shared state file under the learning extension data directory to coordinate non-colliding background learners across sessions. Each long session gets its own tenant lease, and all learners read/renew the same state before scavenging stored histories for tooling capability and agent-behavior improvements. Learners also query available user/project memory first, using existing rules, preferences, corrections, and project facts to polish candidates, avoid duplicates, and improve accuracy.
|
|
105
109
|
|
|
106
110
|
```json
|
package/docs/usage.md
CHANGED
|
@@ -93,13 +93,13 @@ See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
|
93
93
|
|
|
94
94
|
## Context Files
|
|
95
95
|
|
|
96
|
-
Pi discovers `AGENTS.md` or `
|
|
96
|
+
Pi discovers `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` context files at startup from:
|
|
97
97
|
|
|
98
|
-
-
|
|
98
|
+
- `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` in `~/.pi/agent/` for global instructions
|
|
99
99
|
- parent directories, walking up from the current working directory
|
|
100
100
|
- the current directory
|
|
101
101
|
|
|
102
|
-
Use context files for project conventions, commands, safety rules, and preferences. Their contents are
|
|
102
|
+
Use context files for project conventions, commands, safety rules, and preferences. Their contents are injected into the startup system prompt so every session begins with the active project context. Disable discovery with `--no-context-files` or `-nc`.
|
|
103
103
|
|
|
104
104
|
### System Prompt Files
|
|
105
105
|
|
|
@@ -204,7 +204,7 @@ Built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`.
|
|
|
204
204
|
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
205
205
|
| `--theme <path>` | Load a theme; repeatable |
|
|
206
206
|
| `--no-themes` | Disable theme discovery |
|
|
207
|
-
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `
|
|
207
|
+
| `--no-context-files`, `-nc` | Disable `AGENTS.md`, `CLAUDE.md`, and `GEMINI.md` discovery |
|
|
208
208
|
|
|
209
209
|
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
210
210
|
|
|
@@ -216,7 +216,7 @@ pi --no-extensions -e ./my-extension.ts
|
|
|
216
216
|
|
|
217
217
|
| Option | Description |
|
|
218
218
|
|--------|-------------|
|
|
219
|
-
| `--system-prompt <text>` | Replace default prompt; context file and skill locations are still appended
|
|
219
|
+
| `--system-prompt <text>` | Replace default prompt; context file contents and lazy-loadable skill locations are still appended |
|
|
220
220
|
| `--append-system-prompt <text>` | Append to system prompt |
|
|
221
221
|
| `--verbose` | Force verbose startup |
|
|
222
222
|
| `-h`, `--help` | Show help |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.79.0",
|
|
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.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.79.0",
|
|
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.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.79.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Context Files (AGENTS.md)
|
|
3
3
|
*
|
|
4
|
-
* Context files provide project-specific instructions
|
|
4
|
+
* Context files provide project-specific instructions injected into the startup prompt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {
|
|
@@ -16,7 +16,7 @@ const loader = new DefaultResourceLoader({
|
|
|
16
16
|
cwd: process.cwd(),
|
|
17
17
|
agentDir: getAgentDir(),
|
|
18
18
|
agentsFilesOverride: (current) => ({
|
|
19
|
-
agentsFiles: [...current.agentsFiles, { path: "/virtual/AGENTS.md" }],
|
|
19
|
+
agentsFiles: [...current.agentsFiles, { path: "/virtual/AGENTS.md", content: "Virtual project instructions" }],
|
|
20
20
|
}),
|
|
21
21
|
});
|
|
22
22
|
await loader.reload();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@caupulican/pi-adaptative",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.79.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@earendil-works/pi-agent-core": "npm:@caupulican/pi-agent-core@0.
|
|
13
|
-
"@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.
|
|
14
|
-
"@earendil-works/pi-tui": "npm:@caupulican/pi-tui@0.
|
|
12
|
+
"@earendil-works/pi-agent-core": "npm:@caupulican/pi-agent-core@0.79.0",
|
|
13
|
+
"@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.79.0",
|
|
14
|
+
"@earendil-works/pi-tui": "npm:@caupulican/pi-tui@0.79.0",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"chalk": "5.6.2",
|
|
17
17
|
"cross-spawn": "7.0.6",
|
|
@@ -474,23 +474,22 @@
|
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
"node_modules/@earendil-works/pi-agent-core": {
|
|
477
|
-
"version": "0.
|
|
478
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.
|
|
477
|
+
"version": "0.79.0",
|
|
478
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.79.0.tgz",
|
|
479
479
|
"license": "MIT",
|
|
480
480
|
"dependencies": {
|
|
481
|
-
"@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.
|
|
481
|
+
"@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.79.0",
|
|
482
482
|
"ignore": "7.0.5",
|
|
483
483
|
"typebox": "1.1.38",
|
|
484
484
|
"yaml": "2.9.0"
|
|
485
485
|
},
|
|
486
486
|
"engines": {
|
|
487
487
|
"node": ">=22.19.0"
|
|
488
|
-
}
|
|
489
|
-
"name": "@caupulican/pi-agent-core"
|
|
488
|
+
}
|
|
490
489
|
},
|
|
491
490
|
"node_modules/@earendil-works/pi-ai": {
|
|
492
|
-
"version": "0.
|
|
493
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.
|
|
491
|
+
"version": "0.79.0",
|
|
492
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.79.0.tgz",
|
|
494
493
|
"license": "MIT",
|
|
495
494
|
"dependencies": {
|
|
496
495
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -509,12 +508,11 @@
|
|
|
509
508
|
},
|
|
510
509
|
"engines": {
|
|
511
510
|
"node": ">=22.19.0"
|
|
512
|
-
}
|
|
513
|
-
"name": "@caupulican/pi-ai"
|
|
511
|
+
}
|
|
514
512
|
},
|
|
515
513
|
"node_modules/@earendil-works/pi-tui": {
|
|
516
|
-
"version": "0.
|
|
517
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.
|
|
514
|
+
"version": "0.79.0",
|
|
515
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.79.0.tgz",
|
|
518
516
|
"license": "MIT",
|
|
519
517
|
"dependencies": {
|
|
520
518
|
"get-east-asian-width": "1.6.0",
|
|
@@ -522,8 +520,7 @@
|
|
|
522
520
|
},
|
|
523
521
|
"engines": {
|
|
524
522
|
"node": ">=22.19.0"
|
|
525
|
-
}
|
|
526
|
-
"name": "@caupulican/pi-tui"
|
|
523
|
+
}
|
|
527
524
|
},
|
|
528
525
|
"node_modules/@google/genai": {
|
|
529
526
|
"version": "1.52.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@earendil-works/pi-agent-core": "npm:@caupulican/pi-agent-core@0.
|
|
45
|
-
"@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.
|
|
46
|
-
"@earendil-works/pi-tui": "npm:@caupulican/pi-tui@0.
|
|
44
|
+
"@earendil-works/pi-agent-core": "npm:@caupulican/pi-agent-core@0.79.0",
|
|
45
|
+
"@earendil-works/pi-ai": "npm:@caupulican/pi-ai@0.79.0",
|
|
46
|
+
"@earendil-works/pi-tui": "npm:@caupulican/pi-tui@0.79.0",
|
|
47
47
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
48
48
|
"chalk": "5.6.2",
|
|
49
49
|
"cross-spawn": "7.0.6",
|