@astralyn/pi 0.82.1 → 0.82.2

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 (44) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +21 -0
  3. package/README.md +14 -3
  4. package/dist/core/agent-session.d.ts +4 -0
  5. package/dist/core/agent-session.d.ts.map +1 -1
  6. package/dist/core/agent-session.js +193 -43
  7. package/dist/core/agent-session.js.map +1 -1
  8. package/dist/core/extensions/loader.d.ts.map +1 -1
  9. package/dist/core/extensions/loader.js +6 -13
  10. package/dist/core/extensions/loader.js.map +1 -1
  11. package/dist/core/tools/tool-definition-wrapper.d.ts +7 -2
  12. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  13. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  14. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  15. package/dist/modes/interactive/interactive-mode.js +25 -12
  16. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  17. package/docs/compaction.md +8 -2
  18. package/docs/containerization.md +1 -1
  19. package/docs/development.md +32 -35
  20. package/docs/distribution/README.md +34 -0
  21. package/docs/distribution/architecture.md +102 -0
  22. package/docs/distribution/extensions/README.md +17 -0
  23. package/docs/distribution/extensions/deepwiki.md +62 -0
  24. package/docs/distribution/extensions/question.md +59 -0
  25. package/docs/distribution/extensions/rewind.md +85 -0
  26. package/docs/distribution/extensions/router.md +139 -0
  27. package/docs/distribution/extensions/statusline.md +110 -0
  28. package/docs/distribution/extensions/subagent.md +102 -0
  29. package/docs/distribution/maintenance.md +121 -0
  30. package/docs/distribution/release.md +85 -0
  31. package/docs/distribution/themes.md +58 -0
  32. package/docs/distribution/tool-presentation.md +91 -0
  33. package/docs/extensions.md +4 -2
  34. package/docs/index.md +1 -1
  35. package/docs/rpc.md +2 -2
  36. package/docs/themes.md +1 -1
  37. package/examples/extensions/custom-provider-anthropic/package-lock.json +3 -3
  38. package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
  39. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  40. package/examples/extensions/doom-overlay/doom/build.sh +0 -0
  41. package/examples/extensions/sandbox/package-lock.json +1 -1
  42. package/examples/extensions/with-deps/package-lock.json +2 -2
  43. package/npm-shrinkwrap.json +3465 -624
  44. package/package.json +30 -18
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.82.2] - 2026-07-26
6
+
7
+ ### Fixed
8
+
9
+ - Fixed auto-compaction during long tool loops: Pi now checks the completed tool batch before the next provider request and continues the same run with rebuilt compacted context when successful. Cancellation, compaction failure, an unavailable cut point, or unsafe retained context now fails closed with an explicit error/aborted boundary before queued-message polling or another provider request.
10
+
11
+ ### Changed
12
+
13
+ - Converted the source repository to the standalone `@astralyn/pi` package. AI, Agent core, and TUI now resolve from exact upstream npm dependencies, matching the runtime shipped to users without maintaining unrelated source workspaces.
14
+
5
15
  ## [0.82.1] - 2026-07-25
6
16
 
7
17
  ### Fixed
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mario Zechner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,17 @@
1
- # Pi coding agent
1
+ # Pi
2
2
 
3
- > This package is the `@astralyn/pi` distribution maintained in this repository. It is based on [earendil-works/pi](https://github.com/earendil-works/pi) but is not an upstream release. Product usage and public APIs are indexed in [`docs/index.md`](docs/index.md); Fork architecture, bundled behavior, maintenance, and publishing live in the repository root [Fork documentation](../../docs/README.md).
3
+ > A personal `@astralyn/pi` distribution based on [earendil-works/pi](https://github.com/earendil-works/pi). It is not an upstream release.
4
+
5
+ This closed repository contains only the standalone coding-agent package maintained by its owner and invited Contributors. It does not accept external issues or pull requests. Product usage and public APIs are indexed in [`docs/index.md`](docs/index.md); distribution architecture, bundled behavior, maintenance, and publishing are under [`docs/distribution/`](docs/distribution/README.md).
6
+
7
+ ## What this distribution changes
8
+
9
+ - Native tool calls use a consistent `●` call / `│` result presentation with bounded collapsed output.
10
+ - Long tool loops auto-compact after a complete tool batch and before the next provider request, continuing the same run when the rebuilt context is safe and failing closed otherwise.
11
+ - Personal workflow extensions are bundled: `deepwiki`, `question`, `todo`, `rewind`, `router`, and `statusline`.
12
+ - `ice-cream-dark` and `ice-cream-light` are bundled themes.
13
+
14
+ The AI, Agent core, and TUI runtimes are exact upstream npm dependencies rather than locally forked workspaces. See the [architecture](docs/distribution/architecture.md) and [maintenance guide](docs/distribution/maintenance.md) for that boundary.
4
15
 
5
16
  Pi is a minimal terminal coding harness. Adapt pi to your workflows, not the other way around, without having to fork and modify pi internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Pi Packages](#pi-packages) and share them with others via npm or git.
6
17
 
@@ -671,7 +682,7 @@ These values are resolved when each command starts. See [Environment Variables](
671
682
 
672
683
  ## Development
673
684
 
674
- This repository is developed privately by its owner and invited Contributors. See [docs/development.md](docs/development.md) for upstream-compatible setup and debugging notes. Fork-specific development rules are in the repository root [AGENTS.md](../../AGENTS.md).
685
+ This repository is developed privately by its owner and invited Contributors. See [docs/development.md](docs/development.md) for setup and debugging notes. Distribution-specific development rules are in [AGENTS.md](AGENTS.md).
675
686
 
676
687
  ## License
677
688
 
@@ -207,6 +207,7 @@ export declare class AgentSession {
207
207
  private _pendingNextTurnMessages;
208
208
  private _compactionAbortController;
209
209
  private _autoCompactionAbortController;
210
+ private _stopAfterTurnRequested;
210
211
  private _overflowRecoveryAttempted;
211
212
  private _branchSummaryAbortController;
212
213
  private _retryAbortController;
@@ -502,8 +503,11 @@ export declare class AgentSession {
502
503
  * Cancel in-progress branch summarization.
503
504
  */
504
505
  abortBranchSummary(): void;
506
+ private _estimateContextTokensForCompaction;
507
+ private _maybeCompactBeforeNextToolTurn;
505
508
  private _checkCompaction;
506
509
  private _runAutoCompaction;
510
+ private _runAutoCompactionWithOutcome;
507
511
  /**
508
512
  * Toggle auto-compaction setting.
509
513
  */