@caupulican/pi-adaptative 0.80.23 → 0.80.26

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +16 -2
  3. package/dist/cli/args.d.ts +2 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +14 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/core/agent-session-services.d.ts +4 -0
  8. package/dist/core/agent-session-services.d.ts.map +1 -1
  9. package/dist/core/agent-session-services.js +22 -0
  10. package/dist/core/agent-session-services.js.map +1 -1
  11. package/dist/core/agent-session.d.ts +7 -1
  12. package/dist/core/agent-session.d.ts.map +1 -1
  13. package/dist/core/agent-session.js +126 -20
  14. package/dist/core/agent-session.js.map +1 -1
  15. package/dist/core/extensions/builtin.d.ts +3 -0
  16. package/dist/core/extensions/builtin.d.ts.map +1 -0
  17. package/dist/core/extensions/builtin.js +247 -0
  18. package/dist/core/extensions/builtin.js.map +1 -0
  19. package/dist/core/package-manager.d.ts +3 -0
  20. package/dist/core/package-manager.d.ts.map +1 -1
  21. package/dist/core/package-manager.js +58 -0
  22. package/dist/core/package-manager.js.map +1 -1
  23. package/dist/core/prompt-templates.d.ts.map +1 -1
  24. package/dist/core/prompt-templates.js +3 -1
  25. package/dist/core/prompt-templates.js.map +1 -1
  26. package/dist/core/resource-loader.d.ts +15 -2
  27. package/dist/core/resource-loader.d.ts.map +1 -1
  28. package/dist/core/resource-loader.js +235 -134
  29. package/dist/core/resource-loader.js.map +1 -1
  30. package/dist/core/resource-profile-blocks.d.ts +16 -0
  31. package/dist/core/resource-profile-blocks.d.ts.map +1 -0
  32. package/dist/core/resource-profile-blocks.js +120 -0
  33. package/dist/core/resource-profile-blocks.js.map +1 -0
  34. package/dist/core/sdk.d.ts +9 -0
  35. package/dist/core/sdk.d.ts.map +1 -1
  36. package/dist/core/sdk.js +17 -0
  37. package/dist/core/sdk.js.map +1 -1
  38. package/dist/core/settings-manager.d.ts +45 -1
  39. package/dist/core/settings-manager.d.ts.map +1 -1
  40. package/dist/core/settings-manager.js +218 -10
  41. package/dist/core/settings-manager.js.map +1 -1
  42. package/dist/core/skills.d.ts.map +1 -1
  43. package/dist/core/skills.js +3 -0
  44. package/dist/core/skills.js.map +1 -1
  45. package/dist/index.d.ts +2 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +2 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/main.d.ts.map +1 -1
  50. package/dist/main.js +17 -0
  51. package/dist/main.js.map +1 -1
  52. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  53. package/dist/modes/interactive/interactive-mode.js +20 -20
  54. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  55. package/docs/extensions.md +18 -1
  56. package/docs/prompt-templates.md +1 -0
  57. package/docs/settings.md +43 -1
  58. package/docs/skills.md +12 -0
  59. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  60. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  61. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  62. package/examples/extensions/sandbox/package-lock.json +2 -2
  63. package/examples/extensions/sandbox/package.json +1 -1
  64. package/examples/extensions/with-deps/package-lock.json +2 -2
  65. package/examples/extensions/with-deps/package.json +1 -1
  66. package/npm-shrinkwrap.json +12 -12
  67. package/package.json +4 -4
@@ -133,11 +133,28 @@ Additional paths and filters via `settings.json`:
133
133
  ],
134
134
  "disabledResources": {
135
135
  "extensions": ["old-extension", "project-only-extension"]
136
+ },
137
+ "activeResourceProfile": "lean",
138
+ "resourceProfiles": {
139
+ "lean": {
140
+ "extensions": { "block": ["old-extension"], "allow": [] },
141
+ "tools": { "allow": ["read", "rg", "python"] }
142
+ }
136
143
  }
137
144
  }
138
145
  ```
139
146
 
140
- Resource arrays support include/exclude patterns: plain entries include local paths, `!pattern` excludes matching auto-discovered resources, `+path` force-includes an exact path, and `-path` force-excludes an exact path. `disabledResources.extensions` is the explicit reversible unload form and is equivalent to exclude patterns. Put it in user settings for global unloads or project `.pi/settings.json` for project-specific unloads.
147
+ Resource arrays support include/exclude patterns: plain entries include local paths, `!pattern` excludes matching auto-discovered resources, `+path` force-includes an exact path, and `-path` force-excludes an exact path. `disabledResources.extensions` remains as the legacy explicit reversible unload form and is merged as a `resourceProfiles` block filter. Prefer `resourceProfiles` when you need focused per-session, per-repo, or subagent-specific loading.
148
+
149
+ Extensions may carry profile blocks inside comments. Pi reads only matching `<resource-profile>` blocks as JSON config before filtering, and ignores the rest of the extension file for profile parsing:
150
+
151
+ ```ts
152
+ /*
153
+ <resource-profile name="reviewer">
154
+ { "tools": { "allow": ["read", "rg"] }, "extensions": { "block": ["heavy-devtools"] } }
155
+ </resource-profile>
156
+ */
157
+ ```
141
158
 
142
159
  To share extensions via npm or git as pi packages, see [packages.md](packages.md).
143
160
 
@@ -31,6 +31,7 @@ Review the staged changes (`git diff --cached`). Focus on:
31
31
  - The filename becomes the command name. `review.md` becomes `/review`.
32
32
  - `description` is optional. If missing, the first non-empty line is used.
33
33
  - `argument-hint` is optional. When set, the hint is displayed before the description in the autocomplete dropdown.
34
+ - Optional `<resource-profile name="...">{...}</resource-profile>` blocks define profile filters as JSON. Pi reads only matching profile blocks as config and strips them from expanded prompt content.
34
35
 
35
36
  ### Argument Hints
36
37
 
package/docs/settings.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Settings
2
2
 
3
- Pi uses JSON settings files with project settings overriding global settings.
3
+ Pi uses JSON settings files with project settings overriding global settings. Pi also supports zero-footprint directory resource profiles stored under the user-level agent directory.
4
4
 
5
5
  | Location | Scope |
6
6
  |----------|-------|
7
7
  | `~/.pi/agent/settings.json` | Global (all projects) |
8
8
  | `.pi/settings.json` | Project (current directory) |
9
+ | `~/.pi/agent/resource-profiles/<hash>/settings.json` | User-level per repo/directory overlay; no repo files written |
9
10
 
10
11
  Edit directly or use `/settings` for common options.
11
12
 
@@ -281,6 +282,10 @@ Paths in `~/.pi/agent/settings.json` resolve relative to `~/.pi/agent`. Paths in
281
282
  | `prompts` | string[] | `[]` | Local prompt template paths or directories |
282
283
  | `themes` | string[] | `[]` | Local theme file paths or directories |
283
284
  | `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands |
285
+ | `resourceProfiles` | object | `{}` | Named resource allow/block filters for `extensions`, `skills`, `prompts`, `themes`, `agents`, and `tools` |
286
+ | `activeResourceProfile` | string/string[] | - | Active profile name(s) |
287
+ | `activeResourceProfiles` | string[] | - | Active profile names; equivalent to array form of `activeResourceProfile` |
288
+ | `disabledResources` | object | `{}` | Legacy block filters; still supported and merged into resource profiles |
284
289
 
285
290
  Arrays support glob patterns and exclusions. Use `!pattern` to exclude. Use `+path` to force-include an exact path and `-path` to force-exclude an exact path.
286
291
 
@@ -310,6 +315,43 @@ Object form filters which resources to load:
310
315
 
311
316
  See [packages.md](packages.md) for package management details.
312
317
 
318
+ #### resourceProfiles
319
+
320
+ Resource profiles dynamically filter resources after discovery. Each resource kind supports `allow` and `block` arrays. If `allow` is non-empty, only matching resources load; `block` is applied after allow. Patterns match relative paths, absolute paths, file names, and containing directory names.
321
+
322
+ ```json
323
+ {
324
+ "activeResourceProfile": "lean",
325
+ "resourceProfiles": {
326
+ "lean": {
327
+ "extensions": { "block": ["cmux-agent-manager", "heavy-devtools"] },
328
+ "skills": { "allow": ["engineering-principles", "graph-first-code-navigation"] },
329
+ "agents": { "block": ["GEMINI.md"] },
330
+ "tools": { "allow": ["read", "rg", "python"] }
331
+ }
332
+ }
333
+ }
334
+ ```
335
+
336
+ Use `--resource-profile lean` to select a profile for one session or subagent launch. Use `--resource-profile-json` for one-shot definitions that never touch disk:
337
+
338
+ ```bash
339
+ pi --resource-profile oneoff \
340
+ --resource-profile-json '{"oneoff":{"tools":{"allow":["read","rg"]}}}'
341
+ ```
342
+
343
+ Resource files may also carry profile blocks. Pi parses only the matching `<resource-profile>` block as JSON config and strips the block from prompt/agent/skill expansion content:
344
+
345
+ ```markdown
346
+ <resource-profile name="lean">
347
+ { "tools": { "allow": ["read", "rg"] }, "agents": { "block": ["GEMINI.md"] } }
348
+ </resource-profile>
349
+ ```
350
+
351
+ Supported carriers: extension files (`.ts`/`.js`, usually inside comments), prompt templates, skill files, and context agent files (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`). Resource-profile block contents are data, not instructions.
352
+
353
+ Zero-footprint repo/directory overlays live under `~/.pi/agent/resource-profiles/<hash>/settings.json`, where `<hash>` is derived from the nearest VCS root (or current directory when no VCS root exists). These files are user-level settings; Pi does not write `.pi/settings.json` just to remember directory profiles.
354
+
313
355
  ## Example
314
356
 
315
357
  ```json
package/docs/skills.md CHANGED
@@ -82,6 +82,18 @@ For project-level Claude Code skills, add to `.pi/settings.json`:
82
82
 
83
83
  This is progressive disclosure: names and descriptions are always in context, while full instructions load on-demand.
84
84
 
85
+ When multiple skills are loaded, descriptions are the routing contract. Write narrow descriptions and prefer the most task-specific skill. Combine skills only when they cover distinct parts of the request. Do not rely on the agent to apply every loaded skill.
86
+
87
+ Skills may carry optional resource profile blocks:
88
+
89
+ ```markdown
90
+ <resource-profile name="reviewer">
91
+ { "tools": { "allow": ["read", "rg"] } }
92
+ </resource-profile>
93
+ ```
94
+
95
+ These blocks are JSON config, not instructions. Pi parses only matching profile blocks and strips them from `/skill:name` expansion.
96
+
85
97
  ## Skill Commands
86
98
 
87
99
  Skills register as `/skill:name` commands:
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.80.20",
3
+ "version": "0.80.23",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.80.20",
9
+ "version": "0.80.23",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.80.20",
4
+ "version": "0.80.23",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.80.20",
4
+ "version": "0.80.23",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "0.80.20",
3
+ "version": "0.80.23",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "0.80.20",
9
+ "version": "0.80.23",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.80.20",
4
+ "version": "0.80.23",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.80.20",
3
+ "version": "0.80.23",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.80.20",
9
+ "version": "0.80.23",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.80.20",
4
+ "version": "0.80.23",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.80.23",
3
+ "version": "0.80.26",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@caupulican/pi-adaptative",
9
- "version": "0.80.23",
9
+ "version": "0.80.26",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@caupulican/pi-agent-core": "^0.80.23",
13
- "@caupulican/pi-ai": "^0.80.23",
14
- "@caupulican/pi-tui": "^0.80.23",
12
+ "@caupulican/pi-agent-core": "^0.80.26",
13
+ "@caupulican/pi-ai": "^0.80.26",
14
+ "@caupulican/pi-tui": "^0.80.26",
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.23",
478
- "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.80.23.tgz",
477
+ "version": "0.80.26",
478
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.80.26.tgz",
479
479
  "license": "MIT",
480
480
  "dependencies": {
481
- "@caupulican/pi-ai": "^0.80.23",
481
+ "@caupulican/pi-ai": "^0.80.26",
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.23",
492
- "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.80.23.tgz",
491
+ "version": "0.80.26",
492
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.80.26.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.23",
515
- "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.80.23.tgz",
514
+ "version": "0.80.26",
515
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.80.26.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.23",
3
+ "version": "0.80.26",
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
- "@caupulican/pi-agent-core": "^0.80.23",
45
- "@caupulican/pi-ai": "^0.80.23",
46
- "@caupulican/pi-tui": "^0.80.23",
44
+ "@caupulican/pi-agent-core": "^0.80.26",
45
+ "@caupulican/pi-ai": "^0.80.26",
46
+ "@caupulican/pi-tui": "^0.80.26",
47
47
  "@silvia-odwyer/photon-node": "0.3.4",
48
48
  "chalk": "5.6.2",
49
49
  "cross-spawn": "7.0.6",