@herbertgao/pi-extensions 2026.9.11 → 2026.9.13
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/README.md +4 -4
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +1 -1
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +5 -4
- package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +39 -16
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@narumitw/pi-btw/README.md +21 -4
- package/node_modules/@narumitw/pi-btw/dist/index.ts +1668 -958
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
- package/node_modules/@narumitw/pi-btw/docs/workflows.md +10 -2
- package/node_modules/@narumitw/pi-btw/package.json +1 -1
- package/node_modules/@narumitw/pi-btw/src/btw.ts +17 -79
- package/node_modules/@narumitw/pi-btw/src/conversation-context.ts +74 -0
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +196 -7
- package/node_modules/@narumitw/pi-btw/src/main-thread-updates.ts +40 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +34 -2
- package/node_modules/@narumitw/pi-btw/src/settings.ts +49 -0
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +9 -1
- package/node_modules/@narumitw/pi-btw/src/workspace-layout.ts +559 -0
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +62 -0
- package/node_modules/pi-mcp-adapter/README.md +75 -7
- package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +193 -0
- package/node_modules/pi-mcp-adapter/cli.js +56 -5
- package/node_modules/pi-mcp-adapter/commands.ts +96 -5
- package/node_modules/pi-mcp-adapter/config.ts +73 -6
- package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +22 -28
- package/node_modules/pi-mcp-adapter/direct-tools.ts +13 -5
- package/node_modules/pi-mcp-adapter/dist/abort.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/abort.js +36 -0
- package/node_modules/pi-mcp-adapter/dist/abort.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +194 -0
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +5 -0
- package/node_modules/pi-mcp-adapter/dist/config.js +75 -6
- package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +18 -0
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js +88 -0
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +17 -0
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +316 -0
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/errors.d.ts +131 -0
- package/node_modules/pi-mcp-adapter/dist/errors.js +278 -0
- package/node_modules/pi-mcp-adapter/dist/errors.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +8 -0
- package/node_modules/pi-mcp-adapter/dist/http-ca.js +88 -0
- package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +15 -0
- package/node_modules/pi-mcp-adapter/dist/jev-client.js +340 -0
- package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +77 -0
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +2 -0
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +22 -0
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +85 -0
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +55 -0
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +56 -0
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js +410 -0
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/logger.d.ts +51 -0
- package/node_modules/pi-mcp-adapter/dist/logger.js +131 -0
- package/node_modules/pi-mcp-adapter/dist/logger.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +26 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +103 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +118 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +1098 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +168 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +1117 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +7 -140
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +53 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +441 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +148 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +689 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +166 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +102 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +369 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +95 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +242 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +2 -11
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +505 -0
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +10 -0
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +312 -0
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +13 -0
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +97 -0
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +17 -0
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +203 -0
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +11 -0
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +172 -0
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +157 -0
- package/node_modules/pi-mcp-adapter/dist/server-manager.js +1743 -0
- package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +34 -0
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js +140 -0
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +26 -0
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js +142 -0
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/state.d.ts +73 -0
- package/node_modules/pi-mcp-adapter/dist/state.js +2 -0
- package/node_modules/pi-mcp-adapter/dist/state.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +36 -0
- package/node_modules/pi-mcp-adapter/dist/types.js +18 -0
- package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +17 -0
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +219 -0
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +15 -0
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +85 -0
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/utils.d.ts +1 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js +13 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js.map +1 -1
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +29 -19
- package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +85 -0
- package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +34 -0
- package/node_modules/pi-mcp-adapter/index.ts +129 -6
- package/node_modules/pi-mcp-adapter/init.ts +6 -19
- package/node_modules/pi-mcp-adapter/jev-client.ts +273 -0
- package/node_modules/pi-mcp-adapter/jev-contracts.ts +53 -0
- package/node_modules/pi-mcp-adapter/jev-key-store.ts +79 -0
- package/node_modules/pi-mcp-adapter/lifecycle.ts +14 -3
- package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +7 -142
- package/node_modules/pi-mcp-adapter/mcp-code.ts +119 -11
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +4 -0
- package/node_modules/pi-mcp-adapter/mcp-references.ts +5 -3
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +5 -0
- package/node_modules/pi-mcp-adapter/mcp-tasks.ts +467 -0
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +2 -13
- package/node_modules/pi-mcp-adapter/namespace-tools.ts +1 -1
- package/node_modules/pi-mcp-adapter/package.json +17 -9
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +319 -166
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +6 -3
- package/node_modules/pi-mcp-adapter/search-ranking.ts +38 -7
- package/node_modules/pi-mcp-adapter/secure-keyring.ts +170 -0
- package/node_modules/pi-mcp-adapter/semantic-search.ts +186 -0
- package/node_modules/pi-mcp-adapter/server-manager.ts +293 -50
- package/node_modules/pi-mcp-adapter/session-approvals.ts +14 -0
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +2 -0
- package/node_modules/pi-mcp-adapter/state.ts +3 -1
- package/node_modules/pi-mcp-adapter/tool-approval.ts +26 -4
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +6 -14
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +8 -6
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +4 -1
- package/node_modules/pi-mcp-adapter/types.ts +53 -0
- package/node_modules/pi-mcp-adapter/ui-server.ts +17 -9
- package/node_modules/pi-mcp-adapter/utils.ts +16 -0
- package/node_modules/pi-multi-account/CHANGELOG.md +23 -0
- package/node_modules/pi-multi-account/README.md +38 -11
- package/node_modules/pi-multi-account/index.ts +371 -96
- package/node_modules/pi-multi-account/package.json +5 -4
- package/node_modules/pi-multi-account/provider-payload-stream.ts +36 -28
- package/node_modules/pi-multi-account/usage.ts +31 -2
- package/node_modules/pi-typesafe/README.md +3 -1
- package/node_modules/pi-typesafe/dist/auth.d.ts +10 -3
- package/node_modules/pi-typesafe/dist/auth.js +13 -7
- package/node_modules/pi-typesafe/dist/backends.d.ts +31 -0
- package/node_modules/pi-typesafe/dist/backends.js +33 -0
- package/node_modules/pi-typesafe/dist/client.d.ts +3 -9
- package/node_modules/pi-typesafe/dist/client.js +63 -39
- package/node_modules/pi-typesafe/dist/credentials.d.ts +11 -5
- package/node_modules/pi-typesafe/dist/credentials.js +15 -8
- package/node_modules/pi-typesafe/dist/extension.js +4 -1
- package/node_modules/pi-typesafe/dist/index.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/login.d.ts +13 -7
- package/node_modules/pi-typesafe/dist/login.js +17 -8
- package/node_modules/pi-typesafe/dist/schema.js +19 -13
- package/node_modules/pi-typesafe/package.json +1 -1
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The package bundles 6 active `@herbertgao/*` child packages—`pi-bark`, `pi-cc-
|
|
|
15
15
|
- `pi-antigravity@0.7.2`
|
|
16
16
|
- `@dietrichgebert/ponytail@4.9.0`
|
|
17
17
|
- `@juicesharp/rpiv-ask-user-question@2.8.0`
|
|
18
|
-
- `@narumitw/pi-btw@0.
|
|
18
|
+
- `@narumitw/pi-btw@0.61.0`
|
|
19
19
|
|
|
20
20
|
- `@narumitw/pi-caffeinate@0.49.7`
|
|
21
21
|
- `@pi-plugins/fast-mode@0.1.10`
|
|
@@ -27,8 +27,8 @@ The package bundles 6 active `@herbertgao/*` child packages—`pi-bark`, `pi-cc-
|
|
|
27
27
|
- `@tifan/pi-recap@0.4.6`
|
|
28
28
|
- `@tifan/pi-rename@0.6.0`
|
|
29
29
|
- `pi-mcp-adapter@2.31.0`
|
|
30
|
-
- `pi-typesafe@0.
|
|
31
|
-
- `pi-multi-account@1.
|
|
30
|
+
- `pi-typesafe@0.7.1`
|
|
31
|
+
- `pi-multi-account@1.23.0`
|
|
32
32
|
- `pi-footer@0.5.1`
|
|
33
33
|
- `pi-jev-auto-mode@0.4.1`
|
|
34
34
|
- `pi-lens@4.2.1`
|
|
@@ -43,7 +43,7 @@ Pi loads their extensions and skills through `node_modules/` paths inside one pa
|
|
|
43
43
|
|
|
44
44
|
`@narumitw/pi-caffeinate@0.49.7` uses the host platform's sleep inhibitor during each Pi agent run. On macOS, `/caffeinate sleep` keeps the system awake while allowing the display to sleep; `/caffeinate display` also keeps the display awake. It releases the inhibitor when the run or session ends.
|
|
45
45
|
|
|
46
|
-
`pi-jev-auto-mode@0.4.1` adds fail-closed Jev safety gates for shell commands and file changes. `pi-typesafe@0.
|
|
46
|
+
`pi-jev-auto-mode@0.4.1` adds fail-closed Jev safety gates for shell commands and file changes. `pi-typesafe@0.7.1` adds the `/typesafe` command and `typesafe_evaluate` tool for explicit structured decisions; both use the TypeSafe API after login.
|
|
47
47
|
|
|
48
48
|
`@herbertgao/resume-from@0.2.0` keeps Claude Code sessions associated with their original repository when the active transcript later moves into a nested cwd. `@herbertgao/sol-pi@0.1.0` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.2.1` expands language routing and bounds retained diagnostic facts across multi-root sessions. `pi-web-access@0.27.0` adds configurable fetch deadlines and answer models plus isolated GitHub clone runtimes. Preferred Thinking 1.0.1 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
|
|
49
49
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -163,7 +163,7 @@ THE SOFTWARE.
|
|
|
163
163
|
|
|
164
164
|
## `pi-multi-account`
|
|
165
165
|
|
|
166
|
-
The aggregate bundles the MIT-licensed [`pi-multi-account`](https://github.com/Sarrius/pi-multi-account) package version 1.
|
|
166
|
+
The aggregate bundles the MIT-licensed [`pi-multi-account`](https://github.com/Sarrius/pi-multi-account) package version 1.23.0 under its original attribution:
|
|
167
167
|
|
|
168
168
|
MIT License
|
|
169
169
|
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"x-upstream": {
|
|
71
71
|
"package": "pi-cc-extensions",
|
|
72
72
|
"version": "0.8.71",
|
|
73
|
-
"reviewedVersion": "0.9.
|
|
73
|
+
"reviewedVersion": "0.9.2",
|
|
74
74
|
"repository": "https://github.com/minuque/pi-cc-extensions",
|
|
75
75
|
"commit": "e43e0041b59f5d7f03be9b9d103a5f9e954e4c11"
|
|
76
76
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#227](https://github.com/HerbertGao/pi-extensions/pull/227) [`d052f3f`](https://github.com/HerbertGao/pi-extensions/commit/d052f3f3c81e9b6a74d344e9de0f83b8d28341d3) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Retain completed subagent results until they are consumed, including when cleanup runs after ten minutes.
|
|
8
|
+
|
|
9
|
+
Fix a separate Pi 0.87 compatibility issue in mention clones: restore history through SessionManager and provide the live prompt through the before_agent_start hook instead of writing getter-only agent state.
|
|
10
|
+
|
|
3
11
|
## 0.18.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -440,8 +440,8 @@ export class AgentManager {
|
|
|
440
440
|
|
|
441
441
|
/**
|
|
442
442
|
* Evicted agents that can still be reached by name, keyed by handle. Outlives
|
|
443
|
-
* the 10-minute record cleanup — that timer
|
|
444
|
-
*
|
|
443
|
+
* the 10-minute record cleanup — that timer bounds memory after results are
|
|
444
|
+
* consumed — and is cleared alongside
|
|
445
445
|
* completed records on session start/switch.
|
|
446
446
|
*/
|
|
447
447
|
private tombstones = new Map<string, AgentTombstone>()
|
|
@@ -483,7 +483,7 @@ export class AgentManager {
|
|
|
483
483
|
this.onCompact = onCompact
|
|
484
484
|
this.onUsage = onUsage
|
|
485
485
|
this.maxConcurrent = maxConcurrent
|
|
486
|
-
// Cleanup completed agents after 10 minutes
|
|
486
|
+
// Cleanup consumed completed agents after 10 minutes
|
|
487
487
|
this.cleanupInterval = setInterval(() => this.cleanup(), 60_000)
|
|
488
488
|
this.cleanupInterval.unref()
|
|
489
489
|
}
|
|
@@ -1640,6 +1640,7 @@ export class AgentManager {
|
|
|
1640
1640
|
for (const [id, record] of this.agents) {
|
|
1641
1641
|
if (record.status === "running" || record.status === "queued") continue
|
|
1642
1642
|
if ((record.completedAt ?? 0) >= cutoff) continue
|
|
1643
|
+
if (!record.resultConsumed) continue
|
|
1643
1644
|
this.removeRecord(id, record)
|
|
1644
1645
|
}
|
|
1645
1646
|
}
|
|
@@ -1648,7 +1649,7 @@ export class AgentManager {
|
|
|
1648
1649
|
* Remove all completed/stopped/errored records immediately.
|
|
1649
1650
|
* Called on session start/switch so tasks from a prior session don't persist.
|
|
1650
1651
|
* Pass skipUnconsumed=true to preserve records the LLM hasn't read yet
|
|
1651
|
-
* (resultConsumed=false)
|
|
1652
|
+
* (resultConsumed=false). The cleanup timer only evicts consumed results.
|
|
1652
1653
|
*/
|
|
1653
1654
|
clearCompleted(skipUnconsumed = false): void {
|
|
1654
1655
|
for (const [id, record] of this.agents) {
|
|
@@ -64,8 +64,11 @@
|
|
|
64
64
|
import type { Model } from "@earendil-works/pi-ai"
|
|
65
65
|
import {
|
|
66
66
|
buildSessionContext,
|
|
67
|
+
convertToLlm,
|
|
67
68
|
createAgentSession,
|
|
69
|
+
DefaultResourceLoader,
|
|
68
70
|
type ExtensionContext,
|
|
71
|
+
getAgentDir,
|
|
69
72
|
SessionManager,
|
|
70
73
|
type ToolDefinition,
|
|
71
74
|
} from "@earendil-works/pi-coding-agent"
|
|
@@ -163,12 +166,43 @@ export async function runMentionClone(
|
|
|
163
166
|
// `/think` is on anyway. Same shim shape as `modelRuntime` below.
|
|
164
167
|
const thinkingLevel = (ctx as { thinkingLevel?: ThinkingLevel })
|
|
165
168
|
.thinkingLevel
|
|
166
|
-
const
|
|
167
|
-
|
|
169
|
+
const sessionManager = SessionManager.inMemory(ctx.cwd)
|
|
170
|
+
for (const entry of conversation.messages) {
|
|
171
|
+
// The live prompt is copied below. Do not replay the parent's system
|
|
172
|
+
// messages: newer Pi also stores its tool declarations there.
|
|
173
|
+
if ((entry.role as string) === "system") continue
|
|
174
|
+
// Summary messages are projections, not appendable session entries.
|
|
175
|
+
// Preserve exactly the user message Pi would send for each summary.
|
|
176
|
+
if (
|
|
177
|
+
entry.role === "compactionSummary" ||
|
|
178
|
+
entry.role === "branchSummary"
|
|
179
|
+
) {
|
|
180
|
+
for (const message of convertToLlm([entry]))
|
|
181
|
+
sessionManager.appendMessage(message)
|
|
182
|
+
} else {
|
|
183
|
+
sessionManager.appendMessage(entry)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const systemPrompt = ctx.getSystemPrompt?.()
|
|
187
|
+
const created = await runInChildSessionContext(async () => {
|
|
188
|
+
const resourceLoader = new DefaultResourceLoader({
|
|
189
|
+
cwd: ctx.cwd,
|
|
190
|
+
agentDir: getAgentDir(),
|
|
191
|
+
extensionFactories: [
|
|
192
|
+
(pi) => {
|
|
193
|
+
pi.on("before_agent_start", () =>
|
|
194
|
+
systemPrompt ? { systemPrompt } : undefined,
|
|
195
|
+
)
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
})
|
|
199
|
+
await resourceLoader.reload()
|
|
200
|
+
return createAgentSession({
|
|
168
201
|
cwd: ctx.cwd,
|
|
169
202
|
// Nothing about the copy is worth persisting, and an in-memory manager
|
|
170
203
|
// is also what keeps the real session untouched.
|
|
171
|
-
sessionManager
|
|
204
|
+
sessionManager,
|
|
205
|
+
resourceLoader,
|
|
172
206
|
model: ctx.model as Model<never> | undefined,
|
|
173
207
|
...(thinkingLevel && { thinkingLevel }),
|
|
174
208
|
modelRegistry: ctx.modelRegistry,
|
|
@@ -185,21 +219,10 @@ export async function runMentionClone(
|
|
|
185
219
|
// agent-runner's `tools: sessionTools` beside its nested `customTools`.
|
|
186
220
|
tools: [cloneAgentTool.name],
|
|
187
221
|
customTools: [cloneAgentTool],
|
|
188
|
-
} as Parameters<typeof createAgentSession>[0])
|
|
189
|
-
)
|
|
222
|
+
} as Parameters<typeof createAgentSession>[0])
|
|
223
|
+
})
|
|
190
224
|
session = created.session
|
|
191
225
|
|
|
192
|
-
// The clone rebuilds a system prompt from cwd and agentDir, which is close
|
|
193
|
-
// but not the live one — extensions contribute to it per turn. Copy the
|
|
194
|
-
// real thing, so the copy reasons under the instructions the user's model
|
|
195
|
-
// is actually working under.
|
|
196
|
-
const systemPrompt = ctx.getSystemPrompt?.()
|
|
197
|
-
if (systemPrompt) session.agent.state.systemPrompt = systemPrompt
|
|
198
|
-
|
|
199
|
-
// The conversation itself. Pushed rather than assigned so the array the
|
|
200
|
-
// session was built around stays the one it goes on using.
|
|
201
|
-
session.agent.state.messages.push(...conversation.messages)
|
|
202
|
-
|
|
203
226
|
// User text first, reminder after — the order Claude Code's attachment
|
|
204
227
|
// renderer produces, where the reminder trails the message it is about.
|
|
205
228
|
await session.prompt(`${message}\n\n${agentMentionReminder(type)}`)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-ask-user-question",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Pi extension. A structured questionnaire the model can put to you when it would otherwise guess, with typed options instead of free-form replies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@juicesharp/rpiv-config": "^2.
|
|
98
|
+
"@juicesharp/rpiv-config": "^2.11.0",
|
|
99
99
|
"typebox": "^1.1.24"
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -10,6 +10,7 @@ Only context you explicitly bring back is loaded into the main editor.
|
|
|
10
10
|
- Starts a side thread immediately with `/btw <question>` or opens the manager with `/btw`.
|
|
11
11
|
- Uses any persisted main-session branch as context without switching branches.
|
|
12
12
|
- Supports scrollable answers, transcript search, a clickable jump-to-latest control, follow-up questions, queued steering, and in-memory resume.
|
|
13
|
+
- Offers fullscreen, side-thread-left, and side-thread-right workspaces with Pi's live main-thread view, click-to-focus input, and a draggable remembered divider.
|
|
13
14
|
- Renders supported Mermaid fences as width-safe, themed Unicode diagrams without a browser or network request.
|
|
14
15
|
- Keeps side questions and answers out of the main conversation by default.
|
|
15
16
|
- Brings back the latest answer, a question suffix, an exact range, or the complete thread only when requested.
|
|
@@ -77,7 +78,9 @@ The normal location is `~/.pi/agent/pi-btw.json`.
|
|
|
77
78
|
"model": "anthropic/claude-sonnet-4-5",
|
|
78
79
|
"thinkingLevel": "low",
|
|
79
80
|
"rememberThinkingLevelChanges": true,
|
|
80
|
-
"fullscreenCopyOnSelect": true
|
|
81
|
+
"fullscreenCopyOnSelect": true,
|
|
82
|
+
"layout": "left-pane",
|
|
83
|
+
"sidePaneRatio": 0.5
|
|
81
84
|
}
|
|
82
85
|
```
|
|
83
86
|
|
|
@@ -106,10 +109,23 @@ When **Same as main thread** is selected, shortcut changes stay local even when
|
|
|
106
109
|
If a shortcut write fails, the local change remains active and pi-btw warns that it was not remembered.
|
|
107
110
|
A failed Settings-screen save instead restores the previous displayed value.
|
|
108
111
|
|
|
109
|
-
`fullscreenCopyOnSelect` controls only pi-btw's dedicated
|
|
112
|
+
`fullscreenCopyOnSelect` controls only pi-btw's dedicated workspace and defaults to `true` when omitted.
|
|
110
113
|
Turn **Copy selection automatically** off to retain highlighted selections and copy them with Pi's effective `app.message.copy` binding.
|
|
111
114
|
Pi-btw does not inherit Pi core's setting of the same name because Pi's public extension API does not expose its effective value.
|
|
112
115
|
|
|
116
|
+
`layout` controls the dedicated workspace and defaults to `fullscreen` when omitted.
|
|
117
|
+
Accepted values are `fullscreen`, `left-pane`, and `right-pane`.
|
|
118
|
+
The pane names identify the side thread's position; the other pane reuses Pi's native main-thread rendering at pane width and stays current while BTW is open.
|
|
119
|
+
A single muted divider separates the panes; click either pane to move keyboard focus to it.
|
|
120
|
+
Drag the divider with the primary mouse button to resize both panes.
|
|
121
|
+
The side-thread share is limited to 20–80% and saved as `sidePaneRatio` when the button is released, independent of whether the side thread is on the left or right.
|
|
122
|
+
If the save fails, the workspace restores the last saved ratio and reports the error.
|
|
123
|
+
Pi's search and keyboard viewport controls apply to the active pane.
|
|
124
|
+
The mouse wheel scrolls the pane under the pointer without moving keyboard focus, and both panes continue redrawing while either pane is active.
|
|
125
|
+
If you selected context from the main-thread tree, the main pane still shows the active main thread while the side model receives the selected branch.
|
|
126
|
+
Pane layouts collapse to the side thread alone below 80 terminal columns and return keyboard focus to it.
|
|
127
|
+
Choose **Side-thread layout** in Settings; changes apply the next time a new or resumed BTW workspace opens.
|
|
128
|
+
|
|
113
129
|
### Keybindings
|
|
114
130
|
|
|
115
131
|
Open `/btw` → **Settings**, select a shortcut row, then choose **Edit key combination…** or **Restore default**.
|
|
@@ -149,9 +165,9 @@ An explicitly unbound Pi thinking action stays unbound. Remove an override field
|
|
|
149
165
|
### Persistence
|
|
150
166
|
|
|
151
167
|
Reading a missing settings file has no side effects.
|
|
152
|
-
Pi-btw creates it only after a Settings change
|
|
168
|
+
Pi-btw creates it only after a Settings change, a remembered shortcut change, or a divider drag.
|
|
153
169
|
Within one Pi process, saves run in order and publish atomically through a same-directory temporary file and rename.
|
|
154
|
-
Saves preserve
|
|
170
|
+
Saves preserve other recognized settings and unknown fields.
|
|
155
171
|
Malformed or invalid files block saves and remain unchanged.
|
|
156
172
|
Files must be valid UTF-8 and no larger than 64 KiB.
|
|
157
173
|
Separate Pi processes and external editors are outside the in-process ordering boundary.
|
|
@@ -160,6 +176,7 @@ The file is read for every `/btw` invocation, so edits apply without `/reload`.
|
|
|
160
176
|
## 🚧 Limitations
|
|
161
177
|
|
|
162
178
|
- `/btw` supports TUI mode only.
|
|
179
|
+
- Only the clicked pane receives keyboard input; hovering or scrolling over the other pane does not move focus.
|
|
163
180
|
- Resume state is memory-only and lasts only for the current extension instance.
|
|
164
181
|
- A side thread retains the latest 40,000 characters of main-conversation context and adds a truncation notice when earlier content is omitted.
|
|
165
182
|
- Clipboard access depends on Pi's host helper, the operating system, and the terminal.
|