@caupulican/pi-adaptative 0.81.35 → 0.81.37

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 (148) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +10 -8
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/core/agent-session.d.ts +5 -0
  6. package/dist/core/agent-session.d.ts.map +1 -1
  7. package/dist/core/agent-session.js +17 -0
  8. package/dist/core/agent-session.js.map +1 -1
  9. package/dist/core/autonomy/approval-gate.d.ts.map +1 -1
  10. package/dist/core/autonomy/approval-gate.js +2 -0
  11. package/dist/core/autonomy/approval-gate.js.map +1 -1
  12. package/dist/core/autonomy/foreground-envelope.d.ts.map +1 -1
  13. package/dist/core/autonomy/foreground-envelope.js +2 -0
  14. package/dist/core/autonomy/foreground-envelope.js.map +1 -1
  15. package/dist/core/autonomy/gates.d.ts.map +1 -1
  16. package/dist/core/autonomy/gates.js +9 -2
  17. package/dist/core/autonomy/gates.js.map +1 -1
  18. package/dist/core/autonomy/risk-assessment.d.ts.map +1 -1
  19. package/dist/core/autonomy/risk-assessment.js +2 -0
  20. package/dist/core/autonomy/risk-assessment.js.map +1 -1
  21. package/dist/core/bash-execution-controller.d.ts +9 -4
  22. package/dist/core/bash-execution-controller.d.ts.map +1 -1
  23. package/dist/core/bash-execution-controller.js +7 -6
  24. package/dist/core/bash-execution-controller.js.map +1 -1
  25. package/dist/core/bash-executor.d.ts +2 -0
  26. package/dist/core/bash-executor.d.ts.map +1 -1
  27. package/dist/core/bash-executor.js +3 -2
  28. package/dist/core/bash-executor.js.map +1 -1
  29. package/dist/core/default-tool-surface.d.ts +7 -0
  30. package/dist/core/default-tool-surface.d.ts.map +1 -1
  31. package/dist/core/default-tool-surface.js +29 -10
  32. package/dist/core/default-tool-surface.js.map +1 -1
  33. package/dist/core/doctor.d.ts +10 -10
  34. package/dist/core/doctor.d.ts.map +1 -1
  35. package/dist/core/doctor.js +30 -20
  36. package/dist/core/doctor.js.map +1 -1
  37. package/dist/core/exec.d.ts +2 -0
  38. package/dist/core/exec.d.ts.map +1 -1
  39. package/dist/core/exec.js +1 -0
  40. package/dist/core/exec.js.map +1 -1
  41. package/dist/core/extensions/types.d.ts +13 -3
  42. package/dist/core/extensions/types.d.ts.map +1 -1
  43. package/dist/core/extensions/types.js +3 -0
  44. package/dist/core/extensions/types.js.map +1 -1
  45. package/dist/core/memory/memory-manager.d.ts.map +1 -1
  46. package/dist/core/memory/memory-manager.js +1 -0
  47. package/dist/core/memory/memory-manager.js.map +1 -1
  48. package/dist/core/model-capability.d.ts.map +1 -1
  49. package/dist/core/model-capability.js +2 -0
  50. package/dist/core/model-capability.js.map +1 -1
  51. package/dist/core/model-router/tool-escalation.d.ts.map +1 -1
  52. package/dist/core/model-router/tool-escalation.js +17 -3
  53. package/dist/core/model-router/tool-escalation.js.map +1 -1
  54. package/dist/core/python-runtime.d.ts +46 -0
  55. package/dist/core/python-runtime.d.ts.map +1 -0
  56. package/dist/core/python-runtime.js +157 -0
  57. package/dist/core/python-runtime.js.map +1 -0
  58. package/dist/core/runtime-builder.d.ts +4 -0
  59. package/dist/core/runtime-builder.d.ts.map +1 -1
  60. package/dist/core/runtime-builder.js +31 -9
  61. package/dist/core/runtime-builder.js.map +1 -1
  62. package/dist/core/security/untrusted-boundary.d.ts +2 -2
  63. package/dist/core/security/untrusted-boundary.d.ts.map +1 -1
  64. package/dist/core/security/untrusted-boundary.js +4 -3
  65. package/dist/core/security/untrusted-boundary.js.map +1 -1
  66. package/dist/core/settings-manager.d.ts.map +1 -1
  67. package/dist/core/settings-manager.js +2 -0
  68. package/dist/core/settings-manager.js.map +1 -1
  69. package/dist/core/slash-commands.d.ts.map +1 -1
  70. package/dist/core/slash-commands.js +8 -0
  71. package/dist/core/slash-commands.js.map +1 -1
  72. package/dist/core/system-prompt.d.ts.map +1 -1
  73. package/dist/core/system-prompt.js +13 -2
  74. package/dist/core/system-prompt.js.map +1 -1
  75. package/dist/core/tasks/session-task-state.d.ts +10 -0
  76. package/dist/core/tasks/session-task-state.d.ts.map +1 -0
  77. package/dist/core/tasks/session-task-state.js +29 -0
  78. package/dist/core/tasks/session-task-state.js.map +1 -0
  79. package/dist/core/tasks/task-command.d.ts +30 -0
  80. package/dist/core/tasks/task-command.d.ts.map +1 -0
  81. package/dist/core/tasks/task-command.js +79 -0
  82. package/dist/core/tasks/task-command.js.map +1 -0
  83. package/dist/core/tasks/task-state.d.ts +71 -0
  84. package/dist/core/tasks/task-state.d.ts.map +1 -0
  85. package/dist/core/tasks/task-state.js +372 -0
  86. package/dist/core/tasks/task-state.js.map +1 -0
  87. package/dist/core/tool-selection/tool-selection-controller.d.ts.map +1 -1
  88. package/dist/core/tool-selection/tool-selection-controller.js +1 -1
  89. package/dist/core/tool-selection/tool-selection-controller.js.map +1 -1
  90. package/dist/core/tools/bash.d.ts +20 -2
  91. package/dist/core/tools/bash.d.ts.map +1 -1
  92. package/dist/core/tools/bash.js +122 -197
  93. package/dist/core/tools/bash.js.map +1 -1
  94. package/dist/core/tools/find.d.ts.map +1 -1
  95. package/dist/core/tools/find.js +3 -0
  96. package/dist/core/tools/find.js.map +1 -1
  97. package/dist/core/tools/grep.d.ts.map +1 -1
  98. package/dist/core/tools/grep.js +3 -0
  99. package/dist/core/tools/grep.js.map +1 -1
  100. package/dist/core/tools/index.d.ts +9 -6
  101. package/dist/core/tools/index.d.ts.map +1 -1
  102. package/dist/core/tools/index.js +24 -9
  103. package/dist/core/tools/index.js.map +1 -1
  104. package/dist/core/tools/python.d.ts +64 -0
  105. package/dist/core/tools/python.d.ts.map +1 -0
  106. package/dist/core/tools/python.js +241 -0
  107. package/dist/core/tools/python.js.map +1 -0
  108. package/dist/core/tools/shell-contract-router.d.ts +13 -0
  109. package/dist/core/tools/shell-contract-router.d.ts.map +1 -0
  110. package/dist/core/tools/shell-contract-router.js +295 -0
  111. package/dist/core/tools/shell-contract-router.js.map +1 -0
  112. package/dist/core/tools/task-steps.d.ts +46 -0
  113. package/dist/core/tools/task-steps.d.ts.map +1 -0
  114. package/dist/core/tools/task-steps.js +160 -0
  115. package/dist/core/tools/task-steps.js.map +1 -0
  116. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  117. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  118. package/dist/modes/interactive/interactive-mode.js +12 -0
  119. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  120. package/dist/modes/interactive/session-flow-commands.d.ts +10 -0
  121. package/dist/modes/interactive/session-flow-commands.d.ts.map +1 -1
  122. package/dist/modes/interactive/session-flow-commands.js +43 -0
  123. package/dist/modes/interactive/session-flow-commands.js.map +1 -1
  124. package/dist/utils/shell.d.ts +6 -8
  125. package/dist/utils/shell.d.ts.map +1 -1
  126. package/dist/utils/shell.js +61 -70
  127. package/dist/utils/shell.js.map +1 -1
  128. package/dist/utils/tools-manager.d.ts +23 -3
  129. package/dist/utils/tools-manager.d.ts.map +1 -1
  130. package/dist/utils/tools-manager.js +94 -11
  131. package/dist/utils/tools-manager.js.map +1 -1
  132. package/docs/index.md +2 -0
  133. package/docs/python.md +43 -0
  134. package/docs/settings.md +7 -3
  135. package/docs/task-steps.md +90 -0
  136. package/docs/termux.md +7 -0
  137. package/docs/usage.md +5 -6
  138. package/docs/windows.md +15 -12
  139. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  140. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  141. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  142. package/examples/extensions/sandbox/package-lock.json +2 -2
  143. package/examples/extensions/sandbox/package.json +1 -1
  144. package/examples/extensions/with-deps/package-lock.json +2 -2
  145. package/examples/extensions/with-deps/package.json +1 -1
  146. package/npm-shrinkwrap.json +32 -37
  147. package/package.json +9 -7
  148. package/scripts/postinstall-python-runtime.mjs +20 -0
package/docs/usage.md CHANGED
@@ -31,8 +31,8 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
31
31
  | Path completion | Press Tab to complete paths |
32
32
  | Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
33
33
  | Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
34
- | Shell command | `!command` runs and sends output to the model |
35
- | Hidden shell command | `!!command` runs without sending output to the model |
34
+ | Platform shell command | `!command` runs in PowerShell on Windows or Bash elsewhere and sends output to the model |
35
+ | Hidden platform shell command | `!!command` runs without sending output to the model |
36
36
  | External editor | Ctrl+G opens `$VISUAL` or `$EDITOR` |
37
37
 
38
38
  See [Keybindings](keybindings.md) for all shortcuts and customization.
@@ -64,6 +64,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
64
64
  | `/toolhealth` | Show tool repair diagnostics and learned standing rules |
65
65
  | `/toolprobe [provider/model]` | Probe native/text tool-call support and persist a host-local verdict |
66
66
  | `/toolrule-remove <model> <mode>` | Remove one learned tool repair standing rule |
67
+ | `/task`, `/steps` | Manage the native session checklist; see [Task steps](task-steps.md) |
67
68
  | `/quit` | Quit pi |
68
69
 
69
70
  ## Message Queue
@@ -201,7 +202,7 @@ cat README.md | pi -p "Summarize this text"
201
202
  | `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
202
203
  | `--no-tools`, `-nt` | Disable all tools |
203
204
 
204
- Built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`.
205
+ Built-in tools include `read`, `edit`, `write`, `grep`, `find`, `ls`, and the uv-managed `python` tool. The agent always sees one stable `bash` tool contract. On Windows, Pi parses its supported simple-command grammar and converts it deterministically to PowerShell; unsupported shell constructs fail closed. Agent, interactive, and RPC shell calls have a 120-second wall-clock default, and Python calls default to 30 seconds. Native goal, task-step, delegation, context, and toolkit tools are activated when their capability/profile gates allow them.
205
206
 
206
207
  ### Resource Options
207
208
 
@@ -292,8 +293,6 @@ pi --exclude-tools ask_question
292
293
 
293
294
  ## Design Principles
294
295
 
295
- Pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
296
-
297
- It intentionally does not include built-in MCP, sub-agents, permission popups, plan mode, to-dos, or background bash. You can build or install those workflows as extensions or packages, or use external tools such as containers and tmux.
296
+ Pi keeps the core focused and pushes project-specific workflows into extensions, skills, prompt templates, and packages. Core includes the cross-project lifecycle primitives it depends on itself: native goals, task steps, bounded worker delegation, and a platform-selected shell. Broader integrations such as MCP and external-provider teams remain extension/package territory.
298
297
 
299
298
  For the full rationale, read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/).
package/docs/windows.md CHANGED
@@ -6,22 +6,25 @@ Pi supports native Windows on x64 and ARM64. The Node.js package runs under Wind
6
6
 
7
7
  - Windows 10 or newer
8
8
  - Node.js 22.19 or newer for the npm package
9
- - [Git for Windows](https://git-scm.com/download/win), including Git Bash
9
+ - Windows PowerShell 5.1 or PowerShell 7
10
+ - Git for Windows for native Git commands
10
11
  - Windows Terminal, WezTerm, or the VS Code terminal for the best keyboard support
11
12
 
12
- Pi keeps Bash as the command-tool contract on every platform so tool calls and project scripts have the same semantics. On Windows, Pi resolves Bash in this order:
13
+ The model always sees one stable `bash` tool contract. On Windows, Pi parses one simple command, converts supported Bash-like builtins and external argv deterministically to PowerShell, and fails closed for unsupported syntax. The agent never selects a shell or emits native PowerShell. Pi resolves the Windows backend in this order:
13
14
 
14
15
  1. `shellPath` in `%USERPROFILE%\.pi\agent\settings.json`
15
- 2. Git Bash under `Program Files`
16
- 3. `bash.exe` on `PATH` from MSYS2, Cygwin, or WSL
16
+ 2. PowerShell 7 (`pwsh.exe`) on `PATH` or under `Program Files`
17
+ 3. Windows PowerShell (`powershell.exe`) under `System32` or on `PATH`
17
18
 
18
- Git for Windows is the recommended native setup. Using its Bash subprocess does not make Pi a WSL application.
19
+ The backend runs with `-NoLogo -NoProfile -NonInteractive -Command` and a best-effort UTF-8 console-output prefix. Supported contract forms include quoted external commands and bounded forms of `pwd`, `echo`, `which`, `ls`, `cat`, `head`, `tail`, `grep`, `find`, `rm`, `cp`, `mv`, `mkdir`, and `touch`. Pipelines, redirection, variable or command expansion, shell chaining, nested shells, POSIX scripts, unclosed quotes, and unsupported builtin options return an actionable error instead of reaching PowerShell unchanged. Every agent, interactive, and RPC shell call has a 120-second wall-clock default, even while output continues.
19
20
 
20
- To configure another Bash:
21
+ The native `python` tool uses the same contract on Windows and Unix-like systems. Pi provisions a pinned uv executable, resolves or installs Python 3.13 through uv, then spawns the interpreter directly with UTF-8 and bytecode-cache suppression. Python calls default to 30 seconds. See [Native Python](python.md).
22
+
23
+ To select an explicit PowerShell executable:
21
24
 
22
25
  ```json
23
26
  {
24
- "shellPath": "C:\\cygwin64\\bin\\bash.exe"
27
+ "shellPath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
25
28
  }
26
29
  ```
27
30
 
@@ -44,7 +47,7 @@ A Windows release is expected to preserve the same Pi features as Linux and macO
44
47
  | --- | --- | --- |
45
48
  | CLI, print, JSON, and RPC modes | Native | Full package build and test suite on `windows-latest` |
46
49
  | Interactive TUI and configurable keybindings | Native | TUI tests on Windows; packaged `win32-console-mode.node`; Windows Terminal mappings below |
47
- | `read`, `write`, `edit`, `grep`, `find`, and `bash` tools | Native; Bash prerequisite | Coding-agent tests on Windows; release `pi.exe` executes Bash through RPC |
50
+ | `read`, `write`, `edit`, `grep`, `find`, and stable `bash` contract tools | Native; Bash-like commands are routed deterministically to PowerShell | Router/platform-shell tests plus native Windows CI; release `pi.exe` executes the platform shell through RPC |
48
51
  | Provider APIs, OAuth, API-key auth, model routing, and retries | Native | AI, agent, and coding-agent tests on Windows; live credentials are not used in CI |
49
52
  | Extensions, skills, prompts, themes, and pi packages | Native | Discovery, loading, reload, package-manager, and isolation tests on Windows |
50
53
  | Sessions, branching, compaction, context storage, export, and sharing | Native | Agent and coding-agent session tests on Windows |
@@ -54,7 +57,7 @@ A Windows release is expected to preserve the same Pi features as Linux and macO
54
57
  | Toolkit scripts | Native | PowerShell, Bash, and `uv` runners use the same bounded process lifecycle |
55
58
  | External editor and browser launch | Native | Windows process-launch tests; `$EDITOR`/`$VISUAL` and the default browser remain user choices |
56
59
  | Self-update | npm and pnpm global installs | Windows native-dependency quarantine and update-path tests |
57
- | Release binary | Native x64 and ARM64 | Each archive runs `--version`, `--help`, `--list-models`, RPC state, and an RPC Bash command on its matching GitHub-hosted Windows architecture |
60
+ | Release binary | Native x64 and ARM64 | Each archive runs `--version`, `--help`, `--list-models`, RPC state, and an RPC platform-shell command on its matching GitHub-hosted Windows architecture |
58
61
  | tmux agent manager | Available only when a real tmux is supplied by WSL, MSYS2, or Cygwin | Optional integration; core background delegation does not require tmux |
59
62
  | Suspend with `Ctrl+Z` | Not an applicable Windows process concept | Pi reports the platform limitation instead of hanging or pretending to suspend |
60
63
 
@@ -88,12 +91,12 @@ See [Terminal setup](terminal-setup.md) for VS Code, WezTerm, and other terminal
88
91
 
89
92
  ## Troubleshooting
90
93
 
91
- ### No Bash shell found
94
+ ### No PowerShell executable found
92
95
 
93
- Install Git for Windows or set `shellPath` to an existing `bash.exe`. Confirm it from PowerShell:
96
+ Restore Windows PowerShell, install PowerShell 7, or set `shellPath` to an existing `pwsh.exe`/`powershell.exe`. Confirm discovery from a terminal:
94
97
 
95
98
  ```powershell
96
- & "C:\Program Files\Git\bin\bash.exe" --version
99
+ Get-Command pwsh, powershell -ErrorAction SilentlyContinue
97
100
  ```
98
101
 
99
102
  ### Modified Enter does not reach Pi
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.81.35",
3
+ "version": "0.81.37",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.81.35",
9
+ "version": "0.81.37",
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.35",
4
+ "version": "0.81.37",
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.35",
4
+ "version": "0.81.37",
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.35",
3
+ "version": "0.81.37",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "0.81.35",
9
+ "version": "0.81.37",
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.35",
4
+ "version": "0.81.37",
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.35",
3
+ "version": "0.81.37",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.81.35",
9
+ "version": "0.81.37",
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.35",
4
+ "version": "0.81.37",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.81.35",
3
+ "version": "0.81.37",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@caupulican/pi-adaptative",
9
- "version": "0.81.35",
9
+ "version": "0.81.37",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@caupulican/pi-agent-core": "^0.81.35",
13
- "@caupulican/pi-ai": "^0.81.35",
14
- "@caupulican/pi-tui": "^0.81.35",
15
- "@ff-labs/fff-node": "0.9.6",
12
+ "@caupulican/pi-agent-core": "^0.81.37",
13
+ "@caupulican/pi-ai": "^0.81.37",
14
+ "@caupulican/pi-tui": "^0.81.37",
16
15
  "@silvia-odwyer/photon-node": "0.3.4",
17
16
  "chalk": "5.6.2",
18
17
  "cross-spawn": "7.0.6",
@@ -25,10 +24,11 @@
25
24
  "minimatch": "10.2.5",
26
25
  "proper-lockfile": "4.1.2",
27
26
  "typebox": "1.1.38",
28
- "undici": "8.3.0",
27
+ "undici": "8.5.0",
29
28
  "yaml": "2.9.0"
30
29
  },
31
30
  "optionalDependencies": {
31
+ "@ff-labs/fff-node": "0.9.6",
32
32
  "@mariozechner/clipboard": "0.3.9"
33
33
  },
34
34
  "bin": {
@@ -475,11 +475,11 @@
475
475
  }
476
476
  },
477
477
  "node_modules/@caupulican/pi-agent-core": {
478
- "version": "0.81.35",
479
- "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.81.35.tgz",
478
+ "version": "0.81.37",
479
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.81.37.tgz",
480
480
  "license": "MIT",
481
481
  "dependencies": {
482
- "@caupulican/pi-ai": "^0.81.35",
482
+ "@caupulican/pi-ai": "^0.81.37",
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.35",
493
- "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.81.35.tgz",
492
+ "version": "0.81.37",
493
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.81.37.tgz",
494
494
  "license": "MIT",
495
495
  "dependencies": {
496
496
  "@anthropic-ai/sdk": "0.91.1",
@@ -542,8 +542,8 @@
542
542
  }
543
543
  },
544
544
  "node_modules/@caupulican/pi-tui": {
545
- "version": "0.81.35",
546
- "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.81.35.tgz",
545
+ "version": "0.81.37",
546
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.81.37.tgz",
547
547
  "license": "MIT",
548
548
  "dependencies": {
549
549
  "get-east-asian-width": "1.6.0",
@@ -686,7 +686,8 @@
686
686
  "cpu": [
687
687
  "x64",
688
688
  "arm64"
689
- ]
689
+ ],
690
+ "optional": true
690
691
  },
691
692
  "node_modules/@google/genai": {
692
693
  "version": "1.52.0",
@@ -933,9 +934,9 @@
933
934
  "license": "BSD-3-Clause"
934
935
  },
935
936
  "node_modules/@protobufjs/eventemitter": {
936
- "version": "1.1.0",
937
- "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
938
- "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",
937
+ "version": "1.1.1",
938
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",
939
+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
939
940
  "license": "BSD-3-Clause"
940
941
  },
941
942
  "node_modules/@protobufjs/fetch": {
@@ -953,12 +954,6 @@
953
954
  "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
954
955
  "license": "BSD-3-Clause"
955
956
  },
956
- "node_modules/@protobufjs/inquire": {
957
- "version": "1.1.2",
958
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz",
959
- "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==",
960
- "license": "BSD-3-Clause"
961
- },
962
957
  "node_modules/@protobufjs/path": {
963
958
  "version": "1.1.2",
964
959
  "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
@@ -1513,7 +1508,8 @@
1513
1508
  "@yuuang/ffi-rs-win32-arm64-msvc": "1.3.2",
1514
1509
  "@yuuang/ffi-rs-win32-ia32-msvc": "1.3.2",
1515
1510
  "@yuuang/ffi-rs-win32-x64-msvc": "1.3.2"
1516
- }
1511
+ },
1512
+ "optional": true
1517
1513
  },
1518
1514
  "node_modules/formdata-polyfill": {
1519
1515
  "version": "4.0.10",
@@ -1911,23 +1907,22 @@
1911
1907
  }
1912
1908
  },
1913
1909
  "node_modules/protobufjs": {
1914
- "version": "7.5.9",
1915
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.9.tgz",
1916
- "integrity": "sha512-Od4muIm3HW1AouyHF5lONOf1FWo3hY1NbFDoy191X9GzhpgW1clCoaFjfVs2rKJNFYpTNJbje4cbAIDBZJ63ZA==",
1910
+ "version": "7.6.5",
1911
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz",
1912
+ "integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==",
1917
1913
  "license": "BSD-3-Clause",
1918
1914
  "dependencies": {
1919
1915
  "@protobufjs/aspromise": "^1.1.2",
1920
1916
  "@protobufjs/base64": "^1.1.2",
1921
1917
  "@protobufjs/codegen": "^2.0.5",
1922
- "@protobufjs/eventemitter": "^1.1.0",
1918
+ "@protobufjs/eventemitter": "^1.1.1",
1923
1919
  "@protobufjs/fetch": "^1.1.1",
1924
1920
  "@protobufjs/float": "^1.0.2",
1925
- "@protobufjs/inquire": "^1.1.2",
1926
1921
  "@protobufjs/path": "^1.1.2",
1927
1922
  "@protobufjs/pool": "^1.1.0",
1928
1923
  "@protobufjs/utf8": "^1.1.1",
1929
1924
  "@types/node": ">=13.7.0",
1930
- "long": "^5.0.0"
1925
+ "long": "^5.3.2"
1931
1926
  },
1932
1927
  "engines": {
1933
1928
  "node": ">=12.0.0"
@@ -2021,9 +2016,9 @@
2021
2016
  "license": "MIT"
2022
2017
  },
2023
2018
  "node_modules/undici": {
2024
- "version": "8.3.0",
2025
- "resolved": "https://registry.npmjs.org/undici/-/undici-8.3.0.tgz",
2026
- "integrity": "sha512-TkUDgb6tl7KOGZ+7e8E3d2FYgUQgF6z5YypqjWmixVQSQERFcVrVg0ySADm2LVLRh5ljAaHTCR5Fmz3Q34rB7Q==",
2019
+ "version": "8.5.0",
2020
+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.5.0.tgz",
2021
+ "integrity": "sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==",
2027
2022
  "license": "MIT",
2028
2023
  "engines": {
2029
2024
  "node": ">=22.19.0"
@@ -2060,9 +2055,9 @@
2060
2055
  }
2061
2056
  },
2062
2057
  "node_modules/ws": {
2063
- "version": "8.20.1",
2064
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz",
2065
- "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==",
2058
+ "version": "8.21.0",
2059
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
2060
+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
2066
2061
  "license": "MIT",
2067
2062
  "peerDependencies": {
2068
2063
  "bufferutil": "^4.0.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.81.35",
3
+ "version": "0.81.37",
4
4
  "description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -59,6 +59,7 @@
59
59
  "!dist/docs/resource-management-design.md",
60
60
  "!dist/docs/untrusted-content-boundary-design.md",
61
61
  "examples",
62
+ "scripts/postinstall-python-runtime.mjs",
62
63
  "CHANGELOG.md",
63
64
  "npm-shrinkwrap.json"
64
65
  ],
@@ -70,13 +71,13 @@
70
71
  "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 mkdir -p dist/bundled-resources && shx cp -r src/bundled-resources/* dist/bundled-resources/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/",
71
72
  "test": "vitest --run",
72
73
  "shrinkwrap": "node ../../scripts/generate-coding-agent-shrinkwrap.mjs",
73
- "prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
74
+ "prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap",
75
+ "postinstall": "node scripts/postinstall-python-runtime.mjs"
74
76
  },
75
77
  "dependencies": {
76
- "@caupulican/pi-agent-core": "^0.81.35",
77
- "@caupulican/pi-ai": "^0.81.35",
78
- "@caupulican/pi-tui": "^0.81.35",
79
- "@ff-labs/fff-node": "0.9.6",
78
+ "@caupulican/pi-agent-core": "^0.81.37",
79
+ "@caupulican/pi-ai": "^0.81.37",
80
+ "@caupulican/pi-tui": "^0.81.37",
80
81
  "@silvia-odwyer/photon-node": "0.3.4",
81
82
  "chalk": "5.6.2",
82
83
  "cross-spawn": "7.0.6",
@@ -89,7 +90,7 @@
89
90
  "minimatch": "10.2.5",
90
91
  "proper-lockfile": "4.1.2",
91
92
  "typebox": "1.1.38",
92
- "undici": "8.3.0",
93
+ "undici": "8.5.0",
93
94
  "yaml": "2.9.0"
94
95
  },
95
96
  "overrides": {
@@ -99,6 +100,7 @@
99
100
  }
100
101
  },
101
102
  "optionalDependencies": {
103
+ "@ff-labs/fff-node": "0.9.6",
102
104
  "@mariozechner/clipboard": "0.3.9"
103
105
  },
104
106
  "devDependencies": {
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+
3
+ if (process.env.PI_OFFLINE === "1" || process.env.PI_OFFLINE?.toLowerCase() === "true") {
4
+ console.log("pi: offline mode enabled; skipped uv/Python provisioning");
5
+ process.exit(0);
6
+ }
7
+
8
+ try {
9
+ const { ensurePythonRuntime } = await import("../dist/core/python-runtime.js");
10
+ const outcome = await ensurePythonRuntime({ force: true, silent: false });
11
+ if (outcome.status === "ready") {
12
+ console.log(`pi: Python ready via uv (${outcome.pythonPath})`);
13
+ } else {
14
+ console.warn(`pi: Python provisioning deferred: ${outcome.reason}`);
15
+ }
16
+ } catch (error) {
17
+ // Package installation must remain usable offline and on unsupported hosts.
18
+ // Doctor and first tool use retry through the same bounded runtime manager.
19
+ console.warn(`pi: Python provisioning deferred: ${error instanceof Error ? error.message : String(error)}`);
20
+ }