@caupulican/pi-adaptative 0.81.13 → 0.81.16

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 (55) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/bundled-resources/runtimes/hf-transformers-openai-server.py +427 -0
  3. package/dist/bundled-resources/skills/tool-call-repair/SKILL.md +13 -11
  4. package/dist/bundled-resources/skills/tool-call-repair/references/failure-grammar.md +16 -10
  5. package/dist/bundled-resources/skills/tool-call-repair/references/text-protocol-grammar.md +14 -7
  6. package/dist/core/agent-session.d.ts +11 -3
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js +132 -23
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/local-runtime-controller.d.ts +17 -9
  11. package/dist/core/local-runtime-controller.d.ts.map +1 -1
  12. package/dist/core/local-runtime-controller.js +124 -20
  13. package/dist/core/local-runtime-controller.js.map +1 -1
  14. package/dist/core/models/adaptation-store.d.ts +2 -0
  15. package/dist/core/models/adaptation-store.d.ts.map +1 -1
  16. package/dist/core/models/adaptation-store.js +4 -0
  17. package/dist/core/models/adaptation-store.js.map +1 -1
  18. package/dist/core/models/default-model-suggestions.d.ts +4 -4
  19. package/dist/core/models/default-model-suggestions.d.ts.map +1 -1
  20. package/dist/core/models/default-model-suggestions.js +9 -0
  21. package/dist/core/models/default-model-suggestions.js.map +1 -1
  22. package/dist/core/models/local-registration.d.ts +12 -0
  23. package/dist/core/models/local-registration.d.ts.map +1 -1
  24. package/dist/core/models/local-registration.js +68 -0
  25. package/dist/core/models/local-registration.js.map +1 -1
  26. package/dist/core/models/local-runtime.d.ts +77 -1
  27. package/dist/core/models/local-runtime.d.ts.map +1 -1
  28. package/dist/core/models/local-runtime.js +295 -4
  29. package/dist/core/models/local-runtime.js.map +1 -1
  30. package/dist/core/models/model-ref.d.ts +4 -0
  31. package/dist/core/models/model-ref.d.ts.map +1 -1
  32. package/dist/core/models/model-ref.js +12 -3
  33. package/dist/core/models/model-ref.js.map +1 -1
  34. package/dist/core/tool-repair-health.d.ts.map +1 -1
  35. package/dist/core/tool-repair-health.js +2 -1
  36. package/dist/core/tool-repair-health.js.map +1 -1
  37. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  38. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  39. package/dist/modes/interactive/interactive-mode.js +4 -0
  40. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  41. package/dist/modes/interactive/local-model-commands.d.ts +3 -1
  42. package/dist/modes/interactive/local-model-commands.d.ts.map +1 -1
  43. package/dist/modes/interactive/local-model-commands.js +133 -19
  44. package/dist/modes/interactive/local-model-commands.js.map +1 -1
  45. package/docs/models.md +19 -1
  46. package/docs/tool-repair.md +2 -0
  47. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  48. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  49. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  50. package/examples/extensions/sandbox/package-lock.json +2 -2
  51. package/examples/extensions/sandbox/package.json +1 -1
  52. package/examples/extensions/with-deps/package-lock.json +2 -2
  53. package/examples/extensions/with-deps/package.json +1 -1
  54. package/npm-shrinkwrap.json +12 -12
  55. package/package.json +4 -4
package/docs/models.md CHANGED
@@ -6,6 +6,8 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.pi/ag
6
6
 
7
7
  - [Minimal Example](#minimal-example)
8
8
  - [Full Example](#full-example)
9
+ - [Curated Local Suggestions](#curated-local-suggestions)
10
+ - [Ollama serving context](#ollama-serving-context)
9
11
  - [Supported APIs](#supported-apis)
10
12
  - [Provider Configuration](#provider-configuration)
11
13
  - [Model Configuration](#model-configuration)
@@ -38,10 +40,15 @@ The `apiKey` is required but Ollama ignores it, so any value works.
38
40
 
39
41
  ## Curated Local Suggestions
40
42
 
41
- Run `/models suggest` to choose from pi's curated local-model roster. Pi pulls the selected model through the managed Ollama runtime, probes it with `/fitness` on your hardware, then offers the shaped role assignment.
43
+ Run `/models suggest` to choose from pi's curated local-model roster. Pi installs the selected model through the matching managed local runtime, probes it with `/fitness` on your hardware, then offers the shaped role assignment.
44
+
45
+ Confirmed from source: Ollama/GGUF suggestions install through pi's managed Ollama runtime. Curated full-base Hugging Face suggestions install through the pi-managed Transformers runtime, which creates a venv under `~/.pi/agent/runtimes/hf-transformers`, caches HF weights under `~/.pi/agent/models/huggingface`, and registers models under provider `pi-hf-transformers` with OpenAI-compatible `/v1` endpoints. This keeps full-base HF models separate from system Python, user HF cache, and Ollama model storage.
46
+
47
+ For MiniCPM5-1B, the shipped pi-managed Transformers sidecar parses the model's `<function><param>` dialect into OpenAI `tool_calls`, so MiniCPM runs as a native tool-calling specialist and still benefits from pi's shared tool-argument repair layer. The text-protocol phone is reserved for models whose native probe is absent or echo-only, not for serving paths that can expose MiniCPM's native tool-call dialect.
42
48
 
43
49
  Current baked suggestions include:
44
50
 
51
+ - MiniCPM5-1B (full-base) → full-base Transformers executor / tiny local muscle. Install with `/models add hf.co/openbmb/MiniCPM5-1B`. This is the full-base Hugging Face model, not a GGUF/quantized artifact. Pi probes native tool-calling first and uses the text tool protocol only if native tool calls do not work.
45
52
  - FastContext-1.0-4B → repository scout (`context_scout`): the model the scout lane is built around, not a pi benchmark claim. Q4 is about 2.5 GB weights; expect about 5-6 GB peak with 32K-64K KV. Assignment writes `scout.model` and enables `scout.enabled` only after the `scout_auto` exam passes.
46
53
  - Ornith-1.0-9B → agentic-coding worker / router cheap tier: an external candidate, not from pi's own validation research. Q4_K_M is about 5.6 GB weights; expect about 7-8 GB peak with KV, and run it as the only local model on a 10 GB box. `/fitness` on your hardware is the validator.
47
54
 
@@ -127,6 +134,17 @@ Use `google-generative-ai` with a `baseUrl` to add models from Google AI Studio,
127
134
 
128
135
  The `baseUrl` is required when adding custom models to the `google-generative-ai` API type.
129
136
 
137
+ ## Ollama serving context
138
+
139
+ `contextWindow` in `models.json` tells pi how much context the model should be allowed to use. Ollama must also serve the model with a matching context size. If the Ollama server keeps its default `n_ctx`/`num_ctx` lower than the configured `contextWindow`, Ollama can reject OpenAI-compatible requests with `exceed_context_size_error` before pi can use the advertised window.
140
+
141
+ Raise Ollama's serving context instead of lowering `contextWindow` to hide the mismatch:
142
+
143
+ - set `OLLAMA_CONTEXT_LENGTH` for the Ollama server process; or
144
+ - configure a per-model `num_ctx` value in the Ollama model options / Modelfile you serve.
145
+
146
+ When an Ollama OpenAI-compatible request fails with `exceed_context_size_error`, pi surfaces the model name and this remediation hint in the provider error.
147
+
130
148
  ## Supported APIs
131
149
 
132
150
  | API | Description |
@@ -51,12 +51,14 @@ The repair registry currently names these deterministic modes:
51
51
  - `nullOptionalDrop`
52
52
  - `nullRequiredBounce`
53
53
  - `jsonStringParse`
54
+ - `jsonObjectPropertySalvage`
54
55
  - `singleObjectWrap`
55
56
  - `bareScalarWrap`
56
57
  - `emptyObjectPlaceholder`
57
58
  - `numberFromString`
58
59
  - `boolFromString`
59
60
  - `enumCaseNormalize`
61
+ - `propertyCaseNormalize`
60
62
  - `singleElementUnwrap`
61
63
  - `stringifiedNumberInArray`
62
64
  - `bashCommandArgvJoin`
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.81.13",
3
+ "version": "0.81.16",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.81.13",
9
+ "version": "0.81.16",
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.81.13",
4
+ "version": "0.81.16",
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.81.13",
4
+ "version": "0.81.16",
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.81.13",
3
+ "version": "0.81.16",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "0.81.13",
9
+ "version": "0.81.16",
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.81.13",
4
+ "version": "0.81.16",
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.81.13",
3
+ "version": "0.81.16",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.81.13",
9
+ "version": "0.81.16",
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.81.13",
4
+ "version": "0.81.16",
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.81.13",
3
+ "version": "0.81.16",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@caupulican/pi-adaptative",
9
- "version": "0.81.13",
9
+ "version": "0.81.16",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@caupulican/pi-agent-core": "^0.81.13",
13
- "@caupulican/pi-ai": "^0.81.13",
14
- "@caupulican/pi-tui": "^0.81.13",
12
+ "@caupulican/pi-agent-core": "^0.81.16",
13
+ "@caupulican/pi-ai": "^0.81.16",
14
+ "@caupulican/pi-tui": "^0.81.16",
15
15
  "@ff-labs/fff-node": "0.9.6",
16
16
  "@silvia-odwyer/photon-node": "0.3.4",
17
17
  "chalk": "5.6.2",
@@ -475,11 +475,11 @@
475
475
  }
476
476
  },
477
477
  "node_modules/@caupulican/pi-agent-core": {
478
- "version": "0.81.13",
479
- "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.81.13.tgz",
478
+ "version": "0.81.16",
479
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.81.16.tgz",
480
480
  "license": "MIT",
481
481
  "dependencies": {
482
- "@caupulican/pi-ai": "^0.81.13",
482
+ "@caupulican/pi-ai": "^0.81.16",
483
483
  "ignore": "7.0.5",
484
484
  "typebox": "1.1.38",
485
485
  "yaml": "2.9.0"
@@ -489,8 +489,8 @@
489
489
  }
490
490
  },
491
491
  "node_modules/@caupulican/pi-ai": {
492
- "version": "0.81.13",
493
- "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.81.13.tgz",
492
+ "version": "0.81.16",
493
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.81.16.tgz",
494
494
  "license": "MIT",
495
495
  "dependencies": {
496
496
  "@anthropic-ai/sdk": "0.91.1",
@@ -512,8 +512,8 @@
512
512
  }
513
513
  },
514
514
  "node_modules/@caupulican/pi-tui": {
515
- "version": "0.81.13",
516
- "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.81.13.tgz",
515
+ "version": "0.81.16",
516
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.81.16.tgz",
517
517
  "license": "MIT",
518
518
  "dependencies": {
519
519
  "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.81.13",
3
+ "version": "0.81.16",
4
4
  "description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -43,9 +43,9 @@
43
43
  "prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
44
44
  },
45
45
  "dependencies": {
46
- "@caupulican/pi-agent-core": "^0.81.13",
47
- "@caupulican/pi-ai": "^0.81.13",
48
- "@caupulican/pi-tui": "^0.81.13",
46
+ "@caupulican/pi-agent-core": "^0.81.16",
47
+ "@caupulican/pi-ai": "^0.81.16",
48
+ "@caupulican/pi-tui": "^0.81.16",
49
49
  "@ff-labs/fff-node": "0.9.6",
50
50
  "@silvia-odwyer/photon-node": "0.3.4",
51
51
  "chalk": "5.6.2",