@pi-unipi/unipi 2.8.1 → 2.9.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 +41 -0
- package/README.md +7 -6
- package/package.json +29 -29
- package/packages/ask-user/package.json +11 -7
- package/packages/autocomplete/package.json +7 -5
- package/packages/background-tasks/package.json +6 -5
- package/packages/btw/extensions/btw.ts +16 -2
- package/packages/btw/package.json +12 -8
- package/packages/compactor/README.md +3 -2
- package/packages/compactor/package.json +7 -7
- package/packages/compactor/src/index.ts +8 -1
- package/packages/core/package.json +5 -5
- package/packages/footer/package.json +8 -6
- package/packages/image/package.json +11 -7
- package/packages/info-screen/package.json +8 -6
- package/packages/input-shortcuts/package.json +8 -6
- package/packages/kanboard/package.json +11 -7
- package/packages/mcp/README.md +1 -1
- package/packages/mcp/package.json +11 -7
- package/packages/memory/package.json +10 -6
- package/packages/milestone/package.json +11 -7
- package/packages/notify/package.json +8 -6
- package/packages/ralph/package.json +13 -8
- package/packages/subagents/package.json +9 -6
- package/packages/subagents/src/agent-runner.ts +8 -2
- package/packages/unipi/bundled.js +9 -4
- package/packages/updater/package.json +11 -7
- package/packages/utility/README.md +11 -77
- package/packages/utility/package.json +12 -10
- package/packages/utility/src/index.ts +3 -4
- package/packages/web-api/package.json +10 -6
- package/packages/workflow/package.json +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,47 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [2.9.0] — 2026-08-24
|
|
10
|
+
|
|
11
|
+
This release upgrades the Pi SDK floor to `^0.84.0` (resolves to 0.84.2) across all packages and re-synchronizes every package onto a single shared version (2.9.0) after the 2.6/2.8 version drift caused npm to resolve registry copies of workspace packages — stale peers that broke clean installs (ERESOLVE) and shipped nested stale copies. It also ships the compactor auto-compaction abort fix (issue #30).
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `@earendil-works/pi-coding-agent`, `pi-ai`, `pi-tui`, `pi-agent-core` peer dependencies bumped `^0.80.0` → `^0.84.0` in the root and all 21 workspace packages. Users on Pi 0.84.x can now co-install Unipi packages cleanly; users on older Pi releases should stay on `@pi-unipi/*@<2.9.0`.
|
|
16
|
+
- All packages and the umbrella re-versioned to a single `2.9.0`; every `@pi-unipi/*` cross-dependency pin updated to match, so npm links workspace packages instead of pulling registry snapshots.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `compactor`: percentage auto-compaction now triggers at `agent_end` instead of `turn_end`. Pi's `ctx.compact()` aborts the active agent operation first, and `turn_end` fires between turns of a still-running agent loop, so the trigger killed the next in-flight provider request with `stopReason=error "This operation was aborted"` and the turn was lost (issue #30). `agent_end` fires only after the run has fully settled — the same checkpoint Pi core uses for its own native auto-compaction.
|
|
21
|
+
|
|
22
|
+
### SDK migration (0.80 → 0.84)
|
|
23
|
+
|
|
24
|
+
- `btw`: child sessions now pass `modelRuntime` (extracted from the extension-facing `ModelRegistry` facade) to `createAgentSession` — the SDK replaced the removed `modelRegistry` option in 0.81. The synthetic BTW resource loader implements the new `getSystemPromptSource`/`getAppendSystemPromptSources` members.
|
|
25
|
+
- `subagents`: agent-runner sessions migrated the same way; `sessionOpts` now typed as `CreateAgentSessionOptions` (the SDK made `createAgentSession`'s options parameter optional).
|
|
26
|
+
- `background-tasks`: fusion SDK integration test migrated off the removed `AuthStorage`/`ModelRegistry.create()` onto `ModelRuntime.create({ authPath })` with `registerProvider`/`getModel`.
|
|
27
|
+
- Compatibility verified against 0.84.2: extension event map is additive only (`agent_settled`, `before_provider_headers`, `session_info_changed` added; nothing removed), all consumed event payloads byte-identical, and `ctx.compact()` retains its abort-first semantics that issue #30's fix targets.
|
|
28
|
+
|
|
29
|
+
### Fixed (test suite / docs hygiene)
|
|
30
|
+
|
|
31
|
+
- `utility`: removed 11 stale test files targeting modules deleted by the 2026-08 ponytail audits (`diff/*`, `display/*`, `cache/ttl-cache`, `tools/batch`, `tui/settings-inspector`) — the workspace suite had been failing 27 tests since those deletions; badge-settings TUI test updated to the badge-only settings surface; dropped the unused `@types/diff` devDependency.
|
|
32
|
+
- `utility`: README rewritten to match shipped features (batch tool, Shiki diff rendering, TTL cache, and display-capability modules were previously deleted); root README tool table no longer lists the removed `ctx_batch` tool.
|
|
33
|
+
- `web-api`: two stale tests updated to the post-ponytail API (`getRankedProviders` instead of the removed `getProviderByRank`; the removed `checkWigoloHealth` replaced by asserting the actionable install hint on `WigoloUnavailableError`).
|
|
34
|
+
- Root-level `tests/info-screen-boot-timer.test.js`, `tests/prefix-provider-payload.test.js`, and `tests/prefix-tool-registration.test.js` remain broken from pre-existing toolchain drift (`.js`-specifier imports that Node 24 type-stripping cannot resolve); they are outside the workspace test step and documented here rather than silently ignored.
|
|
35
|
+
|
|
36
|
+
## [2.6.2] — 2026-08-22
|
|
37
|
+
|
|
38
|
+
This release fixes split-package installs: since 2.0.11, every per-package `pi` manifest shipped with empty `extensions`/`skills` arrays, so installing a split package like `@pi-unipi/ralph` on its own loaded nothing (issue #29). The regression came from `d914a25` ("fix: disable split package resource discovery", v2.0.11), which blanked the manifests of all nested packages to stop duplicate skill discovery inside the all-in-one umbrella install — without realizing pi reads a present manifest literally, so standalone installs also loaded nothing. Notify (#18) and compactor (#23) were fixed the same way earlier; this release fixes the remaining packages at once.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- All split packages now declare their real entry point and skills in their `pi` manifest: `ralph` (`./index.ts`, `./SKILL.md`), `workflow`, `memory`, `btw`, `ask-user`, `mcp`, `utility`, `milestone`, `kanboard`, `updater`, `image`, `info-screen`, `input-shortcuts`, `web-api`, `footer`, and `command-enchantment` (autocomplete) get `extensions`; `notify` additionally gets its `skills` mount; `subagents` additionally gets its `prompts` mount (issue #29).
|
|
43
|
+
- `background-tasks`, `subagents`, and `ralph` tarballs no longer ship test files (pre-existing since 2.6.0).
|
|
44
|
+
- Added a regression guard to `scripts/test-tarball-manifests.mjs`: any package with a `main` entry must declare non-empty `pi.extensions`, and every manifest mount must exist in the tarball.
|
|
45
|
+
|
|
46
|
+
### Notes
|
|
47
|
+
|
|
48
|
+
- `core` and `cocoindex` keep their intentionally empty manifests — they are libraries with no extension entry point, loaded transitively.
|
|
49
|
+
|
|
9
50
|
## [2.6.1] — 2026-08-20
|
|
10
51
|
|
|
11
52
|
This release fixes the notify settings overlay and recap model selector in terminals using the kitty keyboard protocol (Ghostty under Herdr), and makes the model selector reflect Pi's live model registry.
|
package/README.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# Unipi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
21 workspace packages that turn Pi into a full development workstation. Structured workflows, persistent memory, parallel agents, web research, notifications, context management, command autocomplete, and a live status bar — all wired together through a shared event system.
|
|
4
4
|
|
|
5
5
|
One command installs everything:
|
|
6
6
|
```bash
|
|
7
7
|
pi install npm:@pi-unipi/unipi
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- **Pi (`@earendil-works/pi-coding-agent`) `^0.84.0`** — Unipi 2.9.0 tracks the Pi 0.84 SDK (extension event map incl. `agent_settled`, `ModelRuntime` session options, kitty-protocol keyboard handling). Older Pi releases (0.80–0.83) still load most extensions, but npm will flag the peer dependency mismatch; pin `@pi-unipi/*@<2.9.0` if you must stay on an older Pi.
|
|
13
|
+
|
|
10
14
|
## What You Get
|
|
11
15
|
|
|
12
16
|
**[Workflow](./packages/workflow/README.md)** — 20 commands that take ideas to shipped code. Brainstorm, plan, execute in worktrees, review, consolidate. The agent follows skill files step by step.
|
|
@@ -19,8 +23,6 @@ pi install npm:@pi-unipi/unipi
|
|
|
19
23
|
|
|
20
24
|
**[Prefix-cache architecture](./docs/prefix-cache-architecture.md)** — Append-only request discipline, explicit cache epochs, deterministic tools, privacy-safe diagnostics, provider limitations, and bounded cold-epoch output.
|
|
21
25
|
|
|
22
|
-
**[CocoIndex](./packages/cocoindex/README.md)** — Project indexing and semantic code search backed by CocoIndex and LanceDB. Agent tools and slash commands for status, init, update, and search.
|
|
23
|
-
|
|
24
26
|
**[Subagents](./packages/subagents/README.md)** — Parallel execution with file locking. Spawn background agents to research, fix, or build while the main agent keeps going.
|
|
25
27
|
|
|
26
28
|
**[Web API](./packages/web-api/README.md)** — Web search, page reading, content summarization. Defaults to [wigolo](https://github.com/KnockOutEZ/wigolo), a local-first engine with multi-engine search and on-device reranking — $0/query, no API key. Plus a smart-fetch engine with browser-grade TLS fingerprinting. Paid providers as fallbacks, and auto-selection falls through when a provider is unavailable.
|
|
@@ -86,7 +88,6 @@ Coexists triggers enhance behavior when packages are installed together. Workflo
|
|
|
86
88
|
| Ralph | `/unipi:ralph` | start, stop, resume, status |
|
|
87
89
|
| Memory | `/unipi:memory-` | process, search, consolidate, forget |
|
|
88
90
|
| Compactor | `/unipi:` | lossless-compact, session-recall, compact-stats, compact-settings, compact-preset, compact-help |
|
|
89
|
-
| CocoIndex | `/unipi:cocoindex-` | init, update, status, search, settings |
|
|
90
91
|
| Notify | `/unipi:notify-` | settings, test, set-tg, set-ntfy |
|
|
91
92
|
| MCP | `/unipi:mcp-` | add, settings, sync, status |
|
|
92
93
|
| Web | `/unipi:web-` | settings, cache-clear |
|
|
@@ -110,7 +111,8 @@ Coexists triggers enhance behavior when packages are installed together. Workflo
|
|
|
110
111
|
| `notify_user` | notify | Push notifications |
|
|
111
112
|
| `ask_user` | ask-user | User input |
|
|
112
113
|
| `compact` / `session_recall` / `sandbox` | compactor | Context management |
|
|
113
|
-
| `
|
|
114
|
+
| `ctx_env` | utility | Environment info |
|
|
115
|
+
| `set_session_name` | utility | Session name for badge |
|
|
114
116
|
|
|
115
117
|
## Development
|
|
116
118
|
|
|
@@ -131,7 +133,6 @@ unipi/
|
|
|
131
133
|
│ ├── ralph/ # Iterative loops
|
|
132
134
|
│ ├── memory/ # SQLite + vector search
|
|
133
135
|
│ ├── compactor/ # Context engine
|
|
134
|
-
│ ├── cocoindex/ # Project indexing and semantic search
|
|
135
136
|
│ ├── subagents/ # Parallel execution
|
|
136
137
|
│ ├── web-api/ # Web research
|
|
137
138
|
│ ├── image/ # Image generation and vision
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/unipi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "All-in-one extension suite for Pi coding agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,39 +76,39 @@
|
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@earendil-works/pi-ai": "^0.
|
|
80
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
81
|
-
"@earendil-works/pi-tui": "^0.
|
|
79
|
+
"@earendil-works/pi-ai": "^0.84.0",
|
|
80
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
81
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
82
82
|
"typebox": "^1.1.38"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@pi-unipi/ask-user": "2.
|
|
86
|
-
"@pi-unipi/background-tasks": "2.
|
|
87
|
-
"@pi-unipi/btw": "2.
|
|
88
|
-
"@pi-unipi/command-enchantment": "2.
|
|
89
|
-
"@pi-unipi/compactor": "2.
|
|
90
|
-
"@pi-unipi/core": "2.
|
|
91
|
-
"@pi-unipi/footer": "2.
|
|
92
|
-
"@pi-unipi/image": "2.
|
|
93
|
-
"@pi-unipi/info-screen": "2.
|
|
94
|
-
"@pi-unipi/input-shortcuts": "2.
|
|
95
|
-
"@pi-unipi/kanboard": "2.
|
|
96
|
-
"@pi-unipi/mcp": "2.
|
|
97
|
-
"@pi-unipi/memory": "2.
|
|
98
|
-
"@pi-unipi/milestone": "2.
|
|
99
|
-
"@pi-unipi/notify": "2.
|
|
100
|
-
"@pi-unipi/ralph": "2.
|
|
101
|
-
"@pi-unipi/subagents": "2.
|
|
102
|
-
"@pi-unipi/updater": "2.
|
|
103
|
-
"@pi-unipi/utility": "2.
|
|
104
|
-
"@pi-unipi/web-api": "2.
|
|
105
|
-
"@pi-unipi/workflow": "2.
|
|
85
|
+
"@pi-unipi/ask-user": "2.9.0",
|
|
86
|
+
"@pi-unipi/background-tasks": "2.9.0",
|
|
87
|
+
"@pi-unipi/btw": "2.9.0",
|
|
88
|
+
"@pi-unipi/command-enchantment": "2.9.0",
|
|
89
|
+
"@pi-unipi/compactor": "2.9.0",
|
|
90
|
+
"@pi-unipi/core": "2.9.0",
|
|
91
|
+
"@pi-unipi/footer": "2.9.0",
|
|
92
|
+
"@pi-unipi/image": "2.9.0",
|
|
93
|
+
"@pi-unipi/info-screen": "2.9.0",
|
|
94
|
+
"@pi-unipi/input-shortcuts": "2.9.0",
|
|
95
|
+
"@pi-unipi/kanboard": "2.9.0",
|
|
96
|
+
"@pi-unipi/mcp": "2.9.0",
|
|
97
|
+
"@pi-unipi/memory": "2.9.0",
|
|
98
|
+
"@pi-unipi/milestone": "2.9.0",
|
|
99
|
+
"@pi-unipi/notify": "2.9.0",
|
|
100
|
+
"@pi-unipi/ralph": "2.9.0",
|
|
101
|
+
"@pi-unipi/subagents": "2.9.0",
|
|
102
|
+
"@pi-unipi/updater": "2.9.0",
|
|
103
|
+
"@pi-unipi/utility": "2.9.0",
|
|
104
|
+
"@pi-unipi/web-api": "2.9.0",
|
|
105
|
+
"@pi-unipi/workflow": "2.9.0"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
109
|
-
"@earendil-works/pi-ai": "^0.
|
|
110
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
111
|
-
"@earendil-works/pi-tui": "^0.
|
|
108
|
+
"@earendil-works/pi-agent-core": "^0.84.0",
|
|
109
|
+
"@earendil-works/pi-ai": "^0.84.0",
|
|
110
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
111
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
112
112
|
"@types/better-sqlite3": "^9.6.0",
|
|
113
113
|
"@types/node": "^25.6.0",
|
|
114
114
|
"diff": "^7.0.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/ask-user",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Structured user input tool for Pi coding agent
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Structured user input tool for Pi coding agent \u2014 single-select, multi-select, freeform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,16 +40,20 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@pi-unipi/core": "2.
|
|
43
|
+
"@pi-unipi/core": "2.9.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
47
|
-
"@earendil-works/pi-tui": "^0.
|
|
46
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
47
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
48
48
|
"typebox": "^1.1.38"
|
|
49
49
|
},
|
|
50
50
|
"pi": {
|
|
51
|
-
"extensions": [
|
|
52
|
-
|
|
51
|
+
"extensions": [
|
|
52
|
+
"./index.ts"
|
|
53
|
+
],
|
|
54
|
+
"skills": [
|
|
55
|
+
"./skills"
|
|
56
|
+
],
|
|
53
57
|
"prompts": [],
|
|
54
58
|
"themes": []
|
|
55
59
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/command-enchantment",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Enhanced TUI autocomplete for /unipi:* commands
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Enhanced TUI autocomplete for /unipi:* commands \u2014 colored, sorted, and grouped by package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"!src/**/*.test.ts"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
33
|
-
"@earendil-works/pi-tui": "^0.
|
|
32
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
33
|
+
"@earendil-works/pi-tui": "^0.84.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"test": "vitest run"
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"vitest": "^4.1.5"
|
|
41
41
|
},
|
|
42
42
|
"pi": {
|
|
43
|
-
"extensions": [
|
|
43
|
+
"extensions": [
|
|
44
|
+
"./src/index.ts"
|
|
45
|
+
],
|
|
44
46
|
"skills": [],
|
|
45
47
|
"prompts": [],
|
|
46
48
|
"themes": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/background-tasks",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Background tasks for UniPi \u2014 durable shell jobs, delegated agents, attested Pi runs, and fixed-purpose Fusion workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"test": "npx tsx --test src/__tests__/*.test.ts"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@earendil-works/pi-ai": "^0.
|
|
13
|
-
"@pi-unipi/core": "2.
|
|
12
|
+
"@earendil-works/pi-ai": "^0.84.0",
|
|
13
|
+
"@pi-unipi/core": "2.9.0",
|
|
14
14
|
"turndown": "^7.2.4"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
"typescript": "^5.8.3"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
22
|
-
"@earendil-works/pi-tui": "^0.
|
|
21
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
22
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
23
23
|
"typebox": "^1.1.38"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"src/**/*.ts",
|
|
27
27
|
"src/**/*.json",
|
|
28
|
+
"!src/__tests__/**",
|
|
28
29
|
"extensions/*.ts",
|
|
29
30
|
"README.md"
|
|
30
31
|
],
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
type ExtensionAPI,
|
|
27
27
|
type ExtensionCommandContext,
|
|
28
28
|
type ExtensionContext,
|
|
29
|
+
type ModelRuntime,
|
|
29
30
|
type ResourceLoader,
|
|
30
31
|
} from "@earendil-works/pi-coding-agent";
|
|
31
32
|
import { type AssistantMessage, type Message, type ThinkingLevel as AiThinkingLevel, type UserMessage } from "@earendil-works/pi-ai";
|
|
@@ -161,6 +162,17 @@ function stripDynamicSystemPromptFooter(systemPrompt: string): string {
|
|
|
161
162
|
.trim();
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Extract the canonical ModelRuntime from the extension-facing ModelRegistry
|
|
167
|
+
* facade. The SDK (>=0.84) exposes `modelRuntime` on AgentSession and expects
|
|
168
|
+
* it in CreateAgentSessionOptions; the extension context only hands us the
|
|
169
|
+
* ModelRegistry wrapper, whose `runtime` field is the same instance the
|
|
170
|
+
* parent session uses (agent-session wires `new ModelRegistry(this._modelRuntime)`).
|
|
171
|
+
*/
|
|
172
|
+
function sessionModelRuntime(ctx: ExtensionCommandContext): ModelRuntime {
|
|
173
|
+
return (ctx.modelRegistry as unknown as { runtime: ModelRuntime }).runtime;
|
|
174
|
+
}
|
|
175
|
+
|
|
164
176
|
function createBtwResourceLoader(
|
|
165
177
|
ctx: ExtensionCommandContext,
|
|
166
178
|
appendSystemPrompt: string[] = [BTW_SYSTEM_PROMPT],
|
|
@@ -175,7 +187,9 @@ function createBtwResourceLoader(
|
|
|
175
187
|
getThemes: () => ({ themes: [], diagnostics: [] }),
|
|
176
188
|
getAgentsFiles: () => ({ agentsFiles: [] }),
|
|
177
189
|
getSystemPrompt: () => systemPrompt,
|
|
190
|
+
getSystemPromptSource: () => undefined,
|
|
178
191
|
getAppendSystemPrompt: () => appendSystemPrompt,
|
|
192
|
+
getAppendSystemPromptSources: () => [],
|
|
179
193
|
extendResources: () => {},
|
|
180
194
|
reload: async () => {},
|
|
181
195
|
};
|
|
@@ -1339,7 +1353,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1339
1353
|
const { session } = await createAgentSession({
|
|
1340
1354
|
sessionManager: SessionManager.inMemory(),
|
|
1341
1355
|
model: ctx.model,
|
|
1342
|
-
|
|
1356
|
+
modelRuntime: sessionModelRuntime(ctx),
|
|
1343
1357
|
thinkingLevel: pi.getThinkingLevel() as SessionThinkingLevel,
|
|
1344
1358
|
tools: ["read", "bash", "edit", "write"],
|
|
1345
1359
|
resourceLoader: createBtwResourceLoader(ctx),
|
|
@@ -1816,7 +1830,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1816
1830
|
const { session } = await createAgentSession({
|
|
1817
1831
|
sessionManager: SessionManager.inMemory(),
|
|
1818
1832
|
model,
|
|
1819
|
-
|
|
1833
|
+
modelRuntime: sessionModelRuntime(ctx),
|
|
1820
1834
|
thinkingLevel: "off",
|
|
1821
1835
|
tools: [],
|
|
1822
1836
|
resourceLoader: createBtwResourceLoader(ctx, [BTW_SUMMARIZE_SYSTEM_PROMPT]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/btw",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A pi extension for parallel side conversations with /unipi:btw
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "A pi extension for parallel side conversations with /unipi:btw \u2014 part of the Unipi suite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "extensions/btw.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,16 +32,20 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@earendil-works/pi-ai": "^0.
|
|
36
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
37
|
-
"@earendil-works/pi-tui": "^0.
|
|
35
|
+
"@earendil-works/pi-ai": "^0.84.0",
|
|
36
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
37
|
+
"@earendil-works/pi-tui": "^0.84.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@pi-unipi/core": "2.
|
|
40
|
+
"@pi-unipi/core": "2.9.0"
|
|
41
41
|
},
|
|
42
42
|
"pi": {
|
|
43
|
-
"extensions": [
|
|
44
|
-
|
|
43
|
+
"extensions": [
|
|
44
|
+
"./extensions/btw.ts"
|
|
45
|
+
],
|
|
46
|
+
"skills": [
|
|
47
|
+
"./skills"
|
|
48
|
+
],
|
|
45
49
|
"prompts": [],
|
|
46
50
|
"themes": []
|
|
47
51
|
}
|
|
@@ -112,7 +112,7 @@ These settings control UniPi-managed percentage auto-compaction. They are separa
|
|
|
112
112
|
|
|
113
113
|
| Setting | Default | Meaning |
|
|
114
114
|
|---|---:|---|
|
|
115
|
-
| `Percentage Trigger` | `off` | When on, UniPi checks context usage at `
|
|
115
|
+
| `Percentage Trigger` | `off` | When on, UniPi checks context usage at `agent_end` (after the agent run settles) and can call compaction when the threshold is reached. Disabled by default for backward compatibility. |
|
|
116
116
|
| `Threshold` | `80%` | Trigger point using Pi's live `ctx.getContextUsage().percent`. |
|
|
117
117
|
| `Cooldown` | `60s` | Minimum time between UniPi-triggered compaction attempts. Prevents loops. |
|
|
118
118
|
| `Repeat Growth` | `4k` | If usage is still above threshold after compaction, require this many new tokens before triggering again. |
|
|
@@ -217,10 +217,11 @@ Typical session order:
|
|
|
217
217
|
- Updates runtime byte/tool counters.
|
|
218
218
|
- Applies display overrides and width-safe diff clamping before output reaches the TUI.
|
|
219
219
|
|
|
220
|
-
6. **`
|
|
220
|
+
6. **`agent_end`**
|
|
221
221
|
- If percentage auto-compaction is enabled, reads `ctx.getContextUsage()`.
|
|
222
222
|
- Runs cooldown/repeat-growth safeguards.
|
|
223
223
|
- Calls `ctx.compact({ customInstructions: COMPACTOR_INSTRUCTION })` when eligible.
|
|
224
|
+
- Fires only after the agent run settles: `ctx.compact()` aborts any active operation first, so triggering mid-run (e.g. at `turn_end`) would kill the next provider request.
|
|
224
225
|
|
|
225
226
|
7. **Pi decides to compact**
|
|
226
227
|
- This can be from `/unipi:lossless-compact`, UniPi percentage auto-compaction, or Pi core's reserve-token fallback.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/compactor",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Context engine for Pi
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Context engine for Pi \u2014 zero-LLM compaction, session continuity, sandbox execution, and tool display optimization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@pi-unipi/core": "2.
|
|
38
|
-
"@pi-unipi/info-screen": "2.
|
|
39
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
37
|
+
"@pi-unipi/core": "2.9.0",
|
|
38
|
+
"@pi-unipi/info-screen": "2.9.0",
|
|
39
|
+
"@earendil-works/pi-agent-core": "^0.84.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
43
|
-
"@earendil-works/pi-tui": "^0.
|
|
42
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
43
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
44
44
|
"typebox": "^1.1.38"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -229,7 +229,14 @@ export default function compactorExtension(pi: ExtensionAPI): void {
|
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
// Trigger percentage auto-compaction at agent_end, NOT turn_end.
|
|
233
|
+
// Pi's ctx.compact() aborts the active agent operation first
|
|
234
|
+
// (AgentSession.compact() -> await this.abort()). turn_end fires between
|
|
235
|
+
// turns of a still-running agent loop, so compacting there kills the next
|
|
236
|
+
// in-flight provider request ("This operation was aborted" stopReason=error
|
|
237
|
+
// turns). agent_end fires only after the run has fully settled, matching
|
|
238
|
+
// Pi core's own native auto-compaction check point ("checked on agent_end").
|
|
239
|
+
pi.on("agent_end", async (_event, ctx) => {
|
|
233
240
|
const cwd = (ctx as any).cwd ?? process.cwd();
|
|
234
241
|
config = loadConfig(cwd);
|
|
235
242
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Shared utilities, event types, and constants for Unipi extension suite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
28
|
-
"@earendil-works/pi-tui": "^0.
|
|
27
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
28
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
29
29
|
"typebox": "^1.1.38"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
33
|
-
"@earendil-works/pi-tui": "^0.
|
|
32
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
33
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
34
34
|
"typebox": "^1.1.38",
|
|
35
35
|
"@types/node": "^22.0.0"
|
|
36
36
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/footer",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Persistent status bar for Unipi
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Persistent status bar for Unipi \u2014 subscribes to UNIPI_EVENTS and renders key stats from all unipi packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,18 +32,20 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@pi-unipi/core": "2.
|
|
35
|
+
"@pi-unipi/core": "2.9.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
39
|
-
"@earendil-works/pi-tui": "^0.
|
|
38
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
39
|
+
"@earendil-works/pi-tui": "^0.84.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^25.6.0",
|
|
43
43
|
"typescript": "^6.0.0"
|
|
44
44
|
},
|
|
45
45
|
"pi": {
|
|
46
|
-
"extensions": [
|
|
46
|
+
"extensions": [
|
|
47
|
+
"./index.ts"
|
|
48
|
+
],
|
|
47
49
|
"skills": [],
|
|
48
50
|
"prompts": [],
|
|
49
51
|
"themes": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/image",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Image generation and image recognition tools for the Pi coding agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@pi-unipi/core": "2.
|
|
37
|
+
"@pi-unipi/core": "2.9.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@earendil-works/pi-ai": "^0.
|
|
41
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
42
|
-
"@earendil-works/pi-tui": "^0.
|
|
40
|
+
"@earendil-works/pi-ai": "^0.84.0",
|
|
41
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
42
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
43
43
|
"typebox": "^1.1.38"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -49,8 +49,12 @@
|
|
|
49
49
|
"test": "npx tsx --test tests/**/*.test.ts"
|
|
50
50
|
},
|
|
51
51
|
"pi": {
|
|
52
|
-
"extensions": [
|
|
53
|
-
|
|
52
|
+
"extensions": [
|
|
53
|
+
"./src/index.ts"
|
|
54
|
+
],
|
|
55
|
+
"skills": [
|
|
56
|
+
"./skills"
|
|
57
|
+
],
|
|
54
58
|
"prompts": [],
|
|
55
59
|
"themes": []
|
|
56
60
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/info-screen",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Dashboard and module registry for Unipi
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Dashboard and module registry for Unipi \u2014 configurable info overlay with tabbed groups",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,18 +33,20 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@pi-unipi/core": "2.
|
|
36
|
+
"@pi-unipi/core": "2.9.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
40
|
-
"@earendil-works/pi-tui": "^0.
|
|
39
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
40
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
41
41
|
"typebox": "^1.1.38"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^25.6.0"
|
|
45
45
|
},
|
|
46
46
|
"pi": {
|
|
47
|
-
"extensions": [
|
|
47
|
+
"extensions": [
|
|
48
|
+
"./index.ts"
|
|
49
|
+
],
|
|
48
50
|
"skills": [],
|
|
49
51
|
"prompts": [],
|
|
50
52
|
"themes": []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/input-shortcuts",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Keyboard shortcuts for stash/restore, undo/redo, clipboard, and thinking toggle
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Keyboard shortcuts for stash/restore, undo/redo, clipboard, and thinking toggle \u2014 chord-based overlay system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,18 +33,20 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@pi-unipi/core": "2.
|
|
36
|
+
"@pi-unipi/core": "2.9.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
40
|
-
"@earendil-works/pi-tui": "^0.
|
|
39
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
40
|
+
"@earendil-works/pi-tui": "^0.84.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^25.6.0",
|
|
44
44
|
"typescript": "^6.0.0"
|
|
45
45
|
},
|
|
46
46
|
"pi": {
|
|
47
|
-
"extensions": [
|
|
47
|
+
"extensions": [
|
|
48
|
+
"./src/index.ts"
|
|
49
|
+
],
|
|
48
50
|
"skills": [],
|
|
49
51
|
"prompts": [],
|
|
50
52
|
"themes": []
|