@pi-unipi/unipi 2.8.1 → 2.10.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +11 -6
  3. package/package.json +30 -29
  4. package/packages/ask-user/package.json +10 -6
  5. package/packages/autocomplete/package.json +6 -4
  6. package/packages/autocomplete/src/constants.ts +7 -0
  7. package/packages/background-tasks/package.json +7 -6
  8. package/packages/btw/extensions/btw.ts +16 -2
  9. package/packages/btw/package.json +11 -7
  10. package/packages/compactor/README.md +3 -2
  11. package/packages/compactor/package.json +6 -6
  12. package/packages/compactor/src/index.ts +8 -1
  13. package/packages/core/package.json +5 -5
  14. package/packages/footer/package.json +7 -5
  15. package/packages/image/package.json +11 -7
  16. package/packages/info-screen/package.json +7 -5
  17. package/packages/input-shortcuts/package.json +7 -5
  18. package/packages/kanboard/package.json +10 -6
  19. package/packages/mcp/README.md +1 -1
  20. package/packages/mcp/package.json +10 -6
  21. package/packages/memory/package.json +10 -6
  22. package/packages/milestone/package.json +10 -6
  23. package/packages/notify/package.json +7 -5
  24. package/packages/ralph/package.json +13 -8
  25. package/packages/subagents/package.json +10 -7
  26. package/packages/subagents/src/agent-runner.ts +8 -2
  27. package/packages/trajectory/README.md +43 -0
  28. package/packages/trajectory/index.ts +58 -0
  29. package/packages/trajectory/package.json +43 -0
  30. package/packages/trajectory/src/capture.ts +83 -0
  31. package/packages/trajectory/src/project.ts +193 -0
  32. package/packages/trajectory/src/server.ts +88 -0
  33. package/packages/trajectory/src/telemetry.ts +75 -0
  34. package/packages/trajectory/src/ui.ts +67 -0
  35. package/packages/unipi/bundled.js +769 -263
  36. package/packages/unipi/index.ts +2 -0
  37. package/packages/updater/package.json +10 -6
  38. package/packages/utility/README.md +11 -77
  39. package/packages/utility/package.json +11 -9
  40. package/packages/utility/src/index.ts +3 -4
  41. package/packages/web-api/package.json +10 -6
  42. package/packages/workflow/package.json +11 -7
package/CHANGELOG.md CHANGED
@@ -6,6 +6,63 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.10.0] — 2026-08-25
10
+
11
+ This release adds UniPi Trajectory, a localhost-only live inspector for the current Pi session, with durable redacted sidecar telemetry for exact request/tool timings and provider metadata.
12
+
13
+ ### Added
14
+
15
+ - `@pi-unipi/trajectory`: new `/unipi:trajectory` command that opens or reuses a local session inspector on `127.0.0.1:8176-8186`.
16
+ - Trajectory UI: turn-aware ledger, Input/Model/Tools overview timeline, search, turn/tool folding, drag-to-focus, detail tabs, light/dark theme toggle, and responsive inspector.
17
+ - Trajectory projection: current `SessionManager.getBranch()` is projected into user, assistant, tool, compaction, and branch records without mutating Pi session history or provider context.
18
+ - Trajectory telemetry: append-only `~/.unipi/trajectory/<session-id>.jsonl` sidecars capture redacted provider payload/options, tool schemas, response status/headers, TTFT, decoding/total request timing, token/cache usage, and tool execution duration when Pi hooks expose them.
19
+
20
+ ### Changed
21
+
22
+ - Umbrella `@pi-unipi/unipi` now includes trajectory and the autocomplete registry lists `/unipi:trajectory`.
23
+ - All `@pi-unipi/*` packages re-versioned to `2.10.0` so npm installs keep a single synchronized workspace set and avoid nested stale package copies.
24
+
25
+ ## [2.9.0] — 2026-08-24
26
+
27
+ 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).
28
+
29
+ ### Changed
30
+
31
+ - `@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`.
32
+ - 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.
33
+
34
+ ### Fixed
35
+
36
+ - `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.
37
+
38
+ ### SDK migration (0.80 → 0.84)
39
+
40
+ - `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.
41
+ - `subagents`: agent-runner sessions migrated the same way; `sessionOpts` now typed as `CreateAgentSessionOptions` (the SDK made `createAgentSession`'s options parameter optional).
42
+ - `background-tasks`: fusion SDK integration test migrated off the removed `AuthStorage`/`ModelRegistry.create()` onto `ModelRuntime.create({ authPath })` with `registerProvider`/`getModel`.
43
+ - 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.
44
+
45
+ ### Fixed (test suite / docs hygiene)
46
+
47
+ - `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.
48
+ - `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.
49
+ - `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`).
50
+ - 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.
51
+
52
+ ## [2.6.2] — 2026-08-22
53
+
54
+ 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.
55
+
56
+ ### Fixed
57
+
58
+ - 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).
59
+ - `background-tasks`, `subagents`, and `ralph` tarballs no longer ship test files (pre-existing since 2.6.0).
60
+ - 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.
61
+
62
+ ### Notes
63
+
64
+ - `core` and `cocoindex` keep their intentionally empty manifests — they are libraries with no extension entry point, loaded transitively.
65
+
9
66
  ## [2.6.1] — 2026-08-20
10
67
 
11
68
  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
- 20 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.
3
+ 22 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.
@@ -41,6 +43,8 @@ pi install npm:@pi-unipi/unipi
41
43
 
42
44
  **[Kanboard](./packages/kanboard/README.md)** — Web UI and TUI overlay for kanban boards. Parses all workflow documents into cards with progress indicators.
43
45
 
46
+ **[Trajectory](./packages/trajectory/README.md)** — Live localhost session inspector. Explore turns, reasoning, tool payloads/results, timing, token/cache usage, and compactions for the current session.
47
+
44
48
  **[Info Screen](./packages/info-screen/README.md)** — Dashboard overlay showing module status, tools, and custom data groups.
45
49
 
46
50
  **[Utility](./packages/utility/README.md)** — Environment info, diagnostics, cleanup, name badge, and Shiki-powered diff rendering.
@@ -86,7 +90,6 @@ Coexists triggers enhance behavior when packages are installed together. Workflo
86
90
  | Ralph | `/unipi:ralph` | start, stop, resume, status |
87
91
  | Memory | `/unipi:memory-` | process, search, consolidate, forget |
88
92
  | Compactor | `/unipi:` | lossless-compact, session-recall, compact-stats, compact-settings, compact-preset, compact-help |
89
- | CocoIndex | `/unipi:cocoindex-` | init, update, status, search, settings |
90
93
  | Notify | `/unipi:notify-` | settings, test, set-tg, set-ntfy |
91
94
  | MCP | `/unipi:mcp-` | add, settings, sync, status |
92
95
  | Web | `/unipi:web-` | settings, cache-clear |
@@ -94,6 +97,7 @@ Coexists triggers enhance behavior when packages are installed together. Workflo
94
97
  | Utility | `/unipi:` | env, doctor, status, cleanup, badge-name |
95
98
  | Milestone | `/unipi:milestone-` | onboard, update |
96
99
  | Kanboard | `/unipi:kanboard` | toggle, doctor |
100
+ | Trajectory | `/unipi:trajectory` | open the live current-session inspector |
97
101
  | Footer | `/unipi:footer` | toggle, settings |
98
102
  | Updater | `/unipi:` | readme, changelog, updater-settings |
99
103
  | Info | `/unipi:info` | dashboard, settings |
@@ -110,7 +114,8 @@ Coexists triggers enhance behavior when packages are installed together. Workflo
110
114
  | `notify_user` | notify | Push notifications |
111
115
  | `ask_user` | ask-user | User input |
112
116
  | `compact` / `session_recall` / `sandbox` | compactor | Context management |
113
- | `ctx_batch` / `ctx_env` | utility | Batch execution, env info |
117
+ | `ctx_env` | utility | Environment info |
118
+ | `set_session_name` | utility | Session name for badge |
114
119
 
115
120
  ## Development
116
121
 
@@ -131,7 +136,6 @@ unipi/
131
136
  │ ├── ralph/ # Iterative loops
132
137
  │ ├── memory/ # SQLite + vector search
133
138
  │ ├── compactor/ # Context engine
134
- │ ├── cocoindex/ # Project indexing and semantic search
135
139
  │ ├── subagents/ # Parallel execution
136
140
  │ ├── web-api/ # Web research
137
141
  │ ├── image/ # Image generation and vision
@@ -142,6 +146,7 @@ unipi/
142
146
  │ ├── ask-user/ # Structured input
143
147
  │ ├── milestone/ # Goal tracking
144
148
  │ ├── kanboard/ # Kanban visualization
149
+ │ ├── trajectory/ # Live session trajectory inspector
145
150
  │ ├── info-screen/ # Dashboard overlay
146
151
  │ ├── utility/ # Diagnostics, diff rendering
147
152
  │ ├── updater/ # Auto-update, browsers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/unipi",
3
- "version": "2.8.1",
3
+ "version": "2.10.0",
4
4
  "description": "All-in-one extension suite for Pi coding agent",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -76,39 +76,40 @@
76
76
  ]
77
77
  },
78
78
  "peerDependencies": {
79
- "@earendil-works/pi-ai": "^0.80.0",
80
- "@earendil-works/pi-coding-agent": "^0.80.0",
81
- "@earendil-works/pi-tui": "^0.80.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.6.1",
86
- "@pi-unipi/background-tasks": "2.6.3",
87
- "@pi-unipi/btw": "2.6.1",
88
- "@pi-unipi/command-enchantment": "2.6.1",
89
- "@pi-unipi/compactor": "2.6.1",
90
- "@pi-unipi/core": "2.6.1",
91
- "@pi-unipi/footer": "2.6.1",
92
- "@pi-unipi/image": "2.6.1",
93
- "@pi-unipi/info-screen": "2.6.1",
94
- "@pi-unipi/input-shortcuts": "2.6.1",
95
- "@pi-unipi/kanboard": "2.6.1",
96
- "@pi-unipi/mcp": "2.6.1",
97
- "@pi-unipi/memory": "2.6.1",
98
- "@pi-unipi/milestone": "2.6.1",
99
- "@pi-unipi/notify": "2.6.1",
100
- "@pi-unipi/ralph": "2.6.1",
101
- "@pi-unipi/subagents": "2.6.1",
102
- "@pi-unipi/updater": "2.6.1",
103
- "@pi-unipi/utility": "2.6.1",
104
- "@pi-unipi/web-api": "2.6.1",
105
- "@pi-unipi/workflow": "2.6.1"
85
+ "@pi-unipi/ask-user": "2.10.0",
86
+ "@pi-unipi/background-tasks": "2.10.0",
87
+ "@pi-unipi/btw": "2.10.0",
88
+ "@pi-unipi/command-enchantment": "2.10.0",
89
+ "@pi-unipi/compactor": "2.10.0",
90
+ "@pi-unipi/core": "2.10.0",
91
+ "@pi-unipi/footer": "2.10.0",
92
+ "@pi-unipi/image": "2.10.0",
93
+ "@pi-unipi/info-screen": "2.10.0",
94
+ "@pi-unipi/input-shortcuts": "2.10.0",
95
+ "@pi-unipi/kanboard": "2.10.0",
96
+ "@pi-unipi/mcp": "2.10.0",
97
+ "@pi-unipi/memory": "2.10.0",
98
+ "@pi-unipi/milestone": "2.10.0",
99
+ "@pi-unipi/notify": "2.10.0",
100
+ "@pi-unipi/ralph": "2.10.0",
101
+ "@pi-unipi/subagents": "2.10.0",
102
+ "@pi-unipi/trajectory": "2.10.0",
103
+ "@pi-unipi/updater": "2.10.0",
104
+ "@pi-unipi/utility": "2.10.0",
105
+ "@pi-unipi/web-api": "2.10.0",
106
+ "@pi-unipi/workflow": "2.10.0"
106
107
  },
107
108
  "devDependencies": {
108
- "@earendil-works/pi-agent-core": "^0.80.0",
109
- "@earendil-works/pi-ai": "^0.80.0",
110
- "@earendil-works/pi-coding-agent": "^0.80.0",
111
- "@earendil-works/pi-tui": "^0.80.0",
109
+ "@earendil-works/pi-agent-core": "^0.84.0",
110
+ "@earendil-works/pi-ai": "^0.84.0",
111
+ "@earendil-works/pi-coding-agent": "^0.84.0",
112
+ "@earendil-works/pi-tui": "^0.84.0",
112
113
  "@types/better-sqlite3": "^9.6.0",
113
114
  "@types/node": "^25.6.0",
114
115
  "diff": "^7.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/ask-user",
3
- "version": "2.6.1",
3
+ "version": "2.10.0",
4
4
  "description": "Structured user input tool for Pi coding agent — single-select, multi-select, freeform",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -40,16 +40,20 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@pi-unipi/core": "2.6.1"
43
+ "@pi-unipi/core": "2.10.0"
44
44
  },
45
45
  "peerDependencies": {
46
- "@earendil-works/pi-coding-agent": "^0.80.0",
47
- "@earendil-works/pi-tui": "^0.80.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
- "skills": [],
51
+ "extensions": [
52
+ "./index.ts"
53
+ ],
54
+ "skills": [
55
+ "./skills"
56
+ ],
53
57
  "prompts": [],
54
58
  "themes": []
55
59
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/command-enchantment",
3
- "version": "2.6.1",
3
+ "version": "2.10.0",
4
4
  "description": "Enhanced TUI autocomplete for /unipi:* commands — colored, sorted, and grouped by package",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -29,8 +29,8 @@
29
29
  "!src/**/*.test.ts"
30
30
  ],
31
31
  "peerDependencies": {
32
- "@earendil-works/pi-coding-agent": "^0.80.0",
33
- "@earendil-works/pi-tui": "^0.80.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": []
@@ -30,6 +30,7 @@ export const PACKAGE_ORDER: string[] = [
30
30
  "compact",
31
31
  "notify",
32
32
  "kanboard",
33
+ "trajectory",
33
34
  "footer",
34
35
  "updater",
35
36
  "input-shortcuts",
@@ -54,6 +55,7 @@ export const PACKAGE_COLORS: Record<string, string> = {
54
55
  compact: `${ESC}[37m`, // White
55
56
  notify: `${ESC}[96m`, // Bright Cyan
56
57
  kanboard: `${ESC}[92m`, // Bright Green
58
+ trajectory: `${ESC}[94m`, // Bright Blue
57
59
  footer: `${ESC}[34m`, // Blue
58
60
  updater: `${ESC}[93m`, // Bright Yellow
59
61
  "input-shortcuts": `${ESC}[95m`, // Bright Magenta
@@ -190,6 +192,9 @@ export const COMMAND_REGISTRY: Record<string, string> = {
190
192
  "unipi:kanboard": "kanboard",
191
193
  "unipi:kanboard-doctor": "kanboard",
192
194
 
195
+ // trajectory (1 command)
196
+ "unipi:trajectory": "trajectory",
197
+
193
198
  // footer (3 commands)
194
199
  "unipi:footer": "footer",
195
200
  "unipi:footer-settings": "footer",
@@ -267,6 +272,7 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
267
272
  "unipi:util-settings": "Unified settings — badge + diff rendering config",
268
273
  "unipi:kanboard": "Start the kanboard visualization server",
269
274
  "unipi:kanboard-doctor": "Diagnose and fix kanboard parser issues",
275
+ "unipi:trajectory": "Open/reuse trajectory; add stop/off or toggle to close it",
270
276
 
271
277
  "unipi:ask-user-settings": "Configure ask-user settings",
272
278
 
@@ -340,6 +346,7 @@ export const PACKAGE_LABELS: Record<string, string> = {
340
346
  compact: "compact",
341
347
  notify: "notify",
342
348
  kanboard: "kanboard",
349
+ trajectory: "trajectory",
343
350
  footer: "footer",
344
351
  updater: "updater",
345
352
  "input-shortcuts": "input-shortcuts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pi-unipi/background-tasks",
3
- "version": "2.6.3",
4
- "description": "Background tasks for UniPi \u2014 durable shell jobs, delegated agents, attested Pi runs, and fixed-purpose Fusion workflows",
3
+ "version": "2.10.0",
4
+ "description": "Background tasks for UniPi durable shell jobs, delegated agents, attested Pi runs, and fixed-purpose Fusion workflows",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "types": "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.80.0",
13
- "@pi-unipi/core": "2.6.1",
12
+ "@earendil-works/pi-ai": "^0.84.0",
13
+ "@pi-unipi/core": "2.10.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.80.0",
22
- "@earendil-works/pi-tui": "^0.80.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
- modelRegistry: ctx.modelRegistry as AgentSession["modelRegistry"],
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
- modelRegistry: ctx.modelRegistry as AgentSession["modelRegistry"],
1833
+ modelRuntime: sessionModelRuntime(ctx),
1820
1834
  thinkingLevel: "off",
1821
1835
  tools: [],
1822
1836
  resourceLoader: createBtwResourceLoader(ctx, [BTW_SUMMARIZE_SYSTEM_PROMPT]),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/btw",
3
- "version": "2.6.1",
3
+ "version": "2.10.0",
4
4
  "description": "A pi extension for parallel side conversations with /unipi:btw — part of the Unipi suite",
5
5
  "type": "module",
6
6
  "main": "extensions/btw.ts",
@@ -32,16 +32,20 @@
32
32
  "access": "public"
33
33
  },
34
34
  "peerDependencies": {
35
- "@earendil-works/pi-ai": "^0.80.0",
36
- "@earendil-works/pi-coding-agent": "^0.80.0",
37
- "@earendil-works/pi-tui": "^0.80.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.6.1"
40
+ "@pi-unipi/core": "2.10.0"
41
41
  },
42
42
  "pi": {
43
- "extensions": [],
44
- "skills": [],
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 `turn_end` and can call compaction when the threshold is reached. Disabled by default for backward compatibility. |
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. **`turn_end`**
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/compactor",
3
- "version": "2.6.1",
3
+ "version": "2.10.0",
4
4
  "description": "Context engine for Pi — zero-LLM compaction, session continuity, sandbox execution, and tool display optimization",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -34,13 +34,13 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@pi-unipi/core": "2.6.1",
38
- "@pi-unipi/info-screen": "2.6.1",
39
- "@earendil-works/pi-agent-core": "^0.80.0"
37
+ "@pi-unipi/core": "2.10.0",
38
+ "@pi-unipi/info-screen": "2.10.0",
39
+ "@earendil-works/pi-agent-core": "^0.84.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@earendil-works/pi-coding-agent": "^0.80.0",
43
- "@earendil-works/pi-tui": "^0.80.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
- pi.on("turn_end", async (_event, ctx) => {
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.6.1",
3
+ "version": "2.10.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.80.0",
28
- "@earendil-works/pi-tui": "^0.80.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.80.0",
33
- "@earendil-works/pi-tui": "^0.80.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/footer",
3
- "version": "2.6.1",
3
+ "version": "2.10.0",
4
4
  "description": "Persistent status bar for Unipi — subscribes to UNIPI_EVENTS and renders key stats from all unipi packages",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -32,18 +32,20 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@pi-unipi/core": "2.6.1"
35
+ "@pi-unipi/core": "2.10.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@earendil-works/pi-coding-agent": "^0.80.0",
39
- "@earendil-works/pi-tui": "^0.80.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.6.1",
3
+ "version": "2.10.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.6.1"
37
+ "@pi-unipi/core": "2.10.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@earendil-works/pi-ai": "^0.80.0",
41
- "@earendil-works/pi-coding-agent": "^0.80.0",
42
- "@earendil-works/pi-tui": "^0.80.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
- "skills": [],
52
+ "extensions": [
53
+ "./src/index.ts"
54
+ ],
55
+ "skills": [
56
+ "./skills"
57
+ ],
54
58
  "prompts": [],
55
59
  "themes": []
56
60
  }