@herbertgao/pi-extensions 2026.10.10 → 2026.10.11

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 (108) hide show
  1. package/README.md +10 -8
  2. package/THIRD_PARTY_NOTICES.md +2 -2
  3. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -0
  4. package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -1
  6. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +3 -3
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +126 -42
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +24 -6
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +69 -16
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +1 -1
  11. package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
  12. package/node_modules/@herbertgao/sol-pi/README.md +7 -1
  13. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +28 -4
  14. package/node_modules/@herbertgao/sol-pi/docs/configuration.md +17 -4
  15. package/node_modules/@herbertgao/sol-pi/package.json +1 -1
  16. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +35 -25
  17. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +95 -26
  18. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +39 -2
  19. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +24 -0
  20. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +12 -7
  21. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +138 -130
  22. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +88 -14
  23. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +9 -0
  24. package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +14 -5
  25. package/node_modules/@herbertgao/sol-pi/src/sol-pi/shell-options.ts +22 -0
  26. package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +11 -0
  27. package/node_modules/@juicesharp/rpiv-ask-user-question/answer-channel.ts +109 -0
  28. package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +117 -71
  29. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +2 -0
  30. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +3 -1
  31. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/startup-performance.md +83 -0
  32. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +74 -5
  33. package/node_modules/@juicesharp/rpiv-ask-user-question/events.ts +84 -0
  34. package/node_modules/@juicesharp/rpiv-ask-user-question/index.ts +10 -4
  35. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -2
  36. package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +1 -1
  37. package/node_modules/@juicesharp/rpiv-ask-user-question/reconcile.ts +1 -1
  38. package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +5 -4
  39. package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +19 -19
  40. package/node_modules/@juicesharp/rpiv-ask-user-question/state/i18n-bridge.ts +1 -1
  41. package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +7 -4
  42. package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +10 -10
  43. package/node_modules/@juicesharp/rpiv-ask-user-question/state/row-intent.ts +2 -2
  44. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/contract.ts +6 -6
  45. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +2 -2
  46. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/focus.ts +1 -1
  47. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +9 -9
  48. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +5 -5
  49. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -2
  50. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/external-answer.ts +125 -0
  51. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +1 -1
  52. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +1 -1
  53. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +2 -2
  54. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +1 -1
  55. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/validate-questionnaire.ts +1 -1
  56. package/node_modules/@juicesharp/rpiv-ask-user-question/view/component-binding.ts +4 -4
  57. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -4
  58. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/option-list-view.ts +2 -2
  59. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/markdown-content-cache.ts +3 -3
  60. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +5 -5
  61. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-layout-decider.ts +3 -3
  62. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +10 -10
  63. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/submit-picker.ts +2 -2
  64. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/tab-bar.ts +1 -1
  65. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/wrapping-select.ts +1 -1
  66. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +9 -9
  67. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +1 -1
  68. package/node_modules/@juicesharp/rpiv-ask-user-question/view/props-adapter.ts +8 -8
  69. package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-components.ts +4 -4
  70. package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +10 -10
  71. package/node_modules/@narumitw/pi-btw/dist/index.ts +3 -0
  72. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
  73. package/node_modules/@narumitw/pi-btw/package.json +4 -4
  74. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +6 -0
  75. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +1 -1
  76. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1 -0
  77. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
  78. package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
  79. package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +1 -0
  80. package/node_modules/pi-antigravity/README.md +6 -2
  81. package/node_modules/pi-antigravity/package.json +2 -2
  82. package/node_modules/pi-antigravity/src/client/client.ts +44 -52
  83. package/node_modules/pi-antigravity/src/index.ts +13 -0
  84. package/node_modules/pi-antigravity/src/models/discovery.ts +25 -2
  85. package/node_modules/pi-antigravity/src/models/grouping.ts +107 -68
  86. package/node_modules/pi-antigravity/src/models/models.ts +10 -0
  87. package/node_modules/pi-antigravity/src/search/search.ts +581 -43
  88. package/node_modules/pi-antigravity/src/stream/stream.ts +53 -13
  89. package/node_modules/pi-antigravity/src/types/types.ts +13 -0
  90. package/node_modules/pi-antigravity/src/usage/usage.ts +11 -3
  91. package/node_modules/pi-web-access/CHANGELOG.md +21 -0
  92. package/node_modules/pi-web-access/README.md +22 -7
  93. package/node_modules/pi-web-access/credential-source.ts +54 -4
  94. package/node_modules/pi-web-access/curator-page.ts +3 -1
  95. package/node_modules/pi-web-access/curator-server.ts +1 -0
  96. package/node_modules/pi-web-access/deepseek.ts +204 -0
  97. package/node_modules/pi-web-access/dist/index.js +927 -642
  98. package/node_modules/pi-web-access/dist/mcp-cli.js +877 -615
  99. package/node_modules/pi-web-access/gemini-adc.ts +48 -1
  100. package/node_modules/pi-web-access/gemini-search.ts +8 -4
  101. package/node_modules/pi-web-access/index.ts +16 -1
  102. package/node_modules/pi-web-access/package.json +1 -1
  103. package/node_modules/pi-web-access/page-query.ts +12 -6
  104. package/node_modules/pi-web-access/query-rewrite.ts +16 -13
  105. package/node_modules/pi-web-access/summary-review.ts +16 -6
  106. package/node_modules/pi-web-access/utils.ts +3 -0
  107. package/node_modules/pi-web-access/web-tool-core.ts +2 -0
  108. package/package.json +9 -9
package/README.md CHANGED
@@ -20,12 +20,12 @@ When migrating from `pi-mcp-adapter`, remove any standalone adapter install as w
20
20
 
21
21
  The package bundles 5 active `@herbertgao/*` child packages—`pi-agency`, `pi-bark`, `pi-cc-extensions`, `pi-subagents`, and `sol-pi`—plus the following upstream packages under their original names:
22
22
 
23
- - `pi-antigravity@0.10.0`
23
+ - `pi-antigravity@0.11.0`
24
24
  - `pi-provider-qoder@0.6.1`
25
25
  - `@dietrichgebert/ponytail@5.3.2`
26
- - `@juicesharp/rpiv-ask-user-question@2.13.8`
27
- - `@narumitw/pi-btw@0.61.1`
28
- - `@narumitw/pi-caffeinate@0.49.11`
26
+ - `@juicesharp/rpiv-ask-user-question@2.13.9`
27
+ - `@narumitw/pi-btw@0.61.2`
28
+ - `@narumitw/pi-caffeinate@0.49.12`
29
29
  - `@pi-plugins/fast-mode@0.1.14`
30
30
  - `@tifan/pi-copy-response@0.2.7`
31
31
  - `@tifan/pi-handoff@2.2.2`
@@ -37,11 +37,13 @@ The package bundles 5 active `@herbertgao/*` child packages—`pi-agency`, `pi-b
37
37
  - `pi-typesafe@0.10.0`
38
38
  - `pi-next-cue@1.0.7`
39
39
  - `pi-lens@4.4.3`
40
- - `pi-web-access@0.41.0`
40
+ - `pi-web-access@0.42.0`
41
41
 
42
42
  Pi loads their extensions and skills through `node_modules/` paths inside one package root. The upstream companions are pinned and bundled, not forked or renamed.
43
43
 
44
- The locally customized CC and SoL-Pi packages now follow complete upstream baselines `pi-cc-extensions@1.0.7` and SoL-Pi main `e1a586af`, with local behavior replayed on top. Action Fusion and ccstyle write rich diffs coexist without disabling either feature. All four SoL-Pi features remain opt-in; its new non-persistent-session evidence archives remain on disk for consumers and require host or caller cleanup.
44
+ The locally customized CC package follows upstream `pi-cc-extensions@1.0.8`; SoL-Pi follows its complete main baseline `e1a586af` with Pi 1.x/codemode compatibility updates through `21956803`. Local behavior not already covered upstream is retained. SoL-Pi's `update_plan` now follows upstream's model-only contract: invoke it directly, not inside codemode scripts. Action Fusion and ccstyle write rich diffs coexist without disabling either feature. All four SoL-Pi features remain opt-in; its new non-persistent-session evidence archives remain on disk for consumers and require host or caller cleanup.
45
+
46
+ Antigravity `0.11.0` enriches search citations by visiting source sites by default (`ANTIGRAVITY_NO_SOURCE_ENRICH=1` disables enrichment). It refreshes a curated model catalog and upgrades the existing model cache; previously listed model IDs may disappear. Ask `2.13.9` lets other extensions in the same process answer or cancel TUI questionnaires through its event channel, without sender authentication. Web Access `0.42.0` keeps direct tool exposure by default; DeepSeek search, deferred exposure, and GCE ADC support require explicit configuration.
45
47
 
46
48
  Ponytail `5.3.2` updates the Pi skill guidance, including how to turn it off. Its Pi extension entry is unchanged; the new Claude Code band/board hooks are not registered by this aggregate.
47
49
 
@@ -53,11 +55,11 @@ Ponytail `5.3.2` updates the Pi skill guidance, including how to turn it off. It
53
55
 
54
56
  `@herbertgao/pi-bark` sends localized Bark pushes when a user-facing Pi run fully settles or `@juicesharp/rpiv-ask-user-question` needs an answer. Notifications include emoji-labeled machine/path metadata and support the bundled official Pi badge through Bark's `icon` parameter. Configure it in `$PI_CODING_AGENT_DIR/bark.json` (normally `~/.pi/agent/bark.json`); see the [package README](../pi-bark/README.md). Without a valid endpoint it stays inactive.
55
57
 
56
- `@narumitw/pi-caffeinate@0.49.11` 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. Its D-Bus dependency remains on the normal socket transport under Node; Bun on Linux/macOS can use FFI and an in-process reader thread for Unix file-descriptor transport, falling back when unavailable. No daemon or build step is added.
58
+ `@narumitw/pi-caffeinate@0.49.12` 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. Its D-Bus dependency remains on the normal socket transport under Node; Bun on Linux/macOS can use FFI and an in-process reader thread for Unix file-descriptor transport, falling back when unavailable. No daemon or build step is added.
57
59
 
58
60
  `clef` asks Cloudflare Clef-flash an on-demand yes/no, choice, or score and prints the questions and answers in the transcript, plus a one-line notice. It is not a permission gate. `pi-typesafe@0.9.1` provides `/typesafe` and `typesafe_evaluate` for explicit structured decisions; `/typesafe enable` or `PI_TYPESAFE_ENABLED=1` is still required for agent tool calls. The Pi extension continues to use the TypeSafe API, not Liquid. The package's programmatic client additionally supports Liquid with its own API key and free or paid models; existing usage accounting now merges writes under a short-lived file lock (up to 200ms synchronous wait under contention).
59
61
 
60
- `@herbertgao/sol-pi` 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.4.3` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. `pi-web-access@0.40.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. It adds structured search/fetch data for codemode and an optional, manually started `pi-web-access-mcp` stdio CLI; installing the aggregate does not start that server. Degoog, Keenable, and the new Ceramic provider are explicit-only, excluded from automatic and `all` selection. OpenAI search now defaults to `gpt-6-luna`, results and clone cleanup are scoped per extension instance, and the promoted `@modelcontextprotocol/sdk@^1.32.1` moves the bundle off GHSA-6qxp-vccf-f47h. Perplexity search now uses the Search API's ranked pages and snippets rather than a Sonar-generated answer; requests requiring prose still use Sonar. `pi-antigravity@0.10.0` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. `pi-provider-qoder@0.5.1` registers the `qoder` and `qoder-cn` model providers. Sign in with `/login qoder` (browser or a personal access token from [qoder.com/account/integrations](https://qoder.com/account/integrations)) or `/login qoder-cn` (token from [qoder.com.cn/account/integrations](https://qoder.com.cn/account/integrations)). `QODER_PERSONAL_ACCESS_TOKEN` and `QODERCN_PERSONAL_ACCESS_TOKEN` log those providers in at startup. `/qoder-usage footer on` replaces the status-bar footer for that session, so leave it off while the pi-cc footer is in use. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
62
+ `@herbertgao/sol-pi` 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.4.3` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. `pi-web-access@0.42.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. It adds structured search/fetch data for codemode and an optional, manually started `pi-web-access-mcp` stdio CLI; installing the aggregate does not start that server. Degoog, Keenable, and the new Ceramic provider are explicit-only, excluded from automatic and `all` selection. OpenAI search now defaults to `gpt-6-luna`, results and clone cleanup are scoped per extension instance, and the promoted `@modelcontextprotocol/sdk@^1.32.1` moves the bundle off GHSA-6qxp-vccf-f47h. Perplexity search now uses the Search API's ranked pages and snippets rather than a Sonar-generated answer; requests requiring prose still use Sonar. `pi-antigravity@0.11.0` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. `pi-provider-qoder@0.5.1` registers the `qoder` and `qoder-cn` model providers. Sign in with `/login qoder` (browser or a personal access token from [qoder.com/account/integrations](https://qoder.com/account/integrations)) or `/login qoder-cn` (token from [qoder.com.cn/account/integrations](https://qoder.com.cn/account/integrations)). `QODER_PERSONAL_ACCESS_TOKEN` and `QODERCN_PERSONAL_ACCESS_TOKEN` log those providers in at startup. `/qoder-usage footer on` replaces the status-bar footer for that session, so leave it off while the pi-cc footer is in use. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
61
63
 
62
64
  `pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
63
65
 
@@ -36,7 +36,7 @@ THE SOFTWARE.
36
36
 
37
37
  ## `@narumitw/pi-caffeinate`
38
38
 
39
- The aggregate bundles [`@narumitw/pi-caffeinate`](https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-caffeinate) version 0.49.11 under its original MIT license:
39
+ The aggregate bundles [`@narumitw/pi-caffeinate`](https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-caffeinate) version 0.49.12 under its original MIT license:
40
40
 
41
41
  MIT License
42
42
 
@@ -86,7 +86,7 @@ THE SOFTWARE.
86
86
 
87
87
  ## `pi-antigravity`
88
88
 
89
- The aggregate bundles the MIT-licensed [`pi-antigravity`](https://github.com/Rahularya01/pi-antigravity) package version 0.10.0 under its original attribution:
89
+ The aggregate bundles the MIT-licensed [`pi-antigravity`](https://github.com/Rahularya01/pi-antigravity) package version 0.11.0 under its original attribution:
90
90
 
91
91
  MIT License
92
92
 
@@ -98,6 +98,8 @@ Renderer snapshots for `on` / `compact` modes: [default](./docs/tool-render-exam
98
98
 
99
99
  > [!TIP]
100
100
  > **Fullscreen**: click `click to show more` to expand tool cards, thinking, Skill, and compact summaries. An expanded diff always shows every line; when expanded Input/Output exceeds the line cap, the footer `… +N more lines · click to show more` opens a full preview. Click to collapse.
101
+ >
102
+ > Both `scrollButtonMode` values show the same `Back to bottom` / `N new message(s)` text: `dock` draws it in a dedicated row, `native` in Pi’s floating overlay.
101
103
 
102
104
  > [!NOTE]
103
105
  > **Mermaid rendering**: set `markdown.mermaid` to `final` via `~/.pi/agent/settings.json` or the Mermaid diagrams option in `/settings`. Default `streaming` redraws per frame; `final` renders once at completion.
@@ -126,6 +128,7 @@ pi -e . # one run, does not edit settings.json
126
128
 
127
129
  ## Credits
128
130
 
131
+ - Based on [`minuque/pi-cc-extensions`](https://github.com/minuque/pi-cc-extensions) 1.0.8 (MIT), upstream baseline [`2cb2c1e`](https://github.com/minuque/pi-cc-extensions/commit/2cb2c1ec7240f183ff68cbab0ea6ae3239529f23), with this repository's configuration migration and compatibility patches retained.
129
132
  - Rich diffs are adapted from [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display) (MIT). See [`extensions/renderer/tool/diff/ATTRIBUTION.md`](./extensions/renderer/tool/diff/ATTRIBUTION.md).
130
133
 
131
134
  ## License
@@ -97,6 +97,8 @@ pi install git:github.com/HerbertGao/pi-extensions
97
97
 
98
98
  > [!TIP]
99
99
  > **全屏模式**:单击 `click to show more` 展开工具卡、思考、Skill 和 compact 摘要;工具卡展开态 diff 全量显示,Input/Output 超行时末行 `… +N more lines · click to show more` 打开全量预览,单击收起。
100
+ >
101
+ > `scrollButtonMode` 两种模式文案相同(`Back to bottom` / `N new message(s)`):`dock` 画在独占行,`native` 画在 Pi 原生浮层。
100
102
 
101
103
  > [!NOTE]
102
104
  > **Mermaid 渲染**:建议把 `markdown.mermaid` 设为 `final`(`~/.pi/agent/settings.json` 或 `/settings` 面板的 Mermaid diagrams 选项)。默认 `streaming` 逐帧重绘,`final` 渲染最终版更稳定。
@@ -125,6 +127,7 @@ pi -e . # 只跑一次,不改 settings.json
125
127
 
126
128
  ## 致谢
127
129
 
130
+ - 基于 [`minuque/pi-cc-extensions`](https://github.com/minuque/pi-cc-extensions) 1.0.8(MIT),上游基线 [`2cb2c1e`](https://github.com/minuque/pi-cc-extensions/commit/2cb2c1ec7240f183ff68cbab0ea6ae3239529f23);保留本仓库的配置迁移与兼容性补丁。
128
131
  - Rich diff 改编自 [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display)(MIT);详见 [`extensions/renderer/tool/diff/ATTRIBUTION.md`](./extensions/renderer/tool/diff/ATTRIBUTION.md)。
129
132
 
130
133
  ## 许可证
@@ -66,7 +66,7 @@ export type Config = {
66
66
  showStartupHeader: boolean;
67
67
  /** fullscreen:userMessage 正文首行滚出视口上沿后钉住,直到下一条指令接手。 */
68
68
  stickyUserMessage: boolean;
69
- /** fullscreen 回到底部按钮:扩展 dock 行,或 Pi 原生浮层。 */
69
+ /** fullscreen 回到底部按钮:扩展 dock 行,或 Pi 原生浮层;两者文案相同。 */
70
70
  scrollButtonMode: ScrollButtonMode;
71
71
  enableSessionReference: boolean;
72
72
  enableSubagentAutocomplete: boolean;
@@ -605,11 +605,11 @@ export async function showCcstylePanel(
605
605
  };
606
606
  const scrollButtonSetting = {
607
607
  id: "scrollButtonMode",
608
- label: "Scroll to bottom",
608
+ label: "Scroll button mode",
609
609
  description:
610
610
  config.scrollButtonMode === "dock"
611
611
  ? "Fullscreen: show the extension's dedicated Back to bottom row."
612
- : "Fullscreen: use Pi's native floating Jump to latest overlay.",
612
+ : "Fullscreen: show the same Back to bottom text in Pi's native floating overlay.",
613
613
  currentValue: config.scrollButtonMode,
614
614
  values: [...SCROLL_BUTTON_MODES],
615
615
  };
@@ -1021,7 +1021,7 @@ export async function showCcstylePanel(
1021
1021
  scrollButtonSetting.description =
1022
1022
  config.scrollButtonMode === "dock"
1023
1023
  ? "Fullscreen: show the extension's dedicated Back to bottom row."
1024
- : "Fullscreen: use Pi's native floating Jump to latest overlay.";
1024
+ : "Fullscreen: show the same Back to bottom text in Pi's native floating overlay.";
1025
1025
  break;
1026
1026
  }
1027
1027
  case "showStartupHeader": {
@@ -7,9 +7,11 @@
7
7
  * 与 `editDiffCollapsedLines` / `writeDiffCollapsedLines` / `expandedPreviewMaxLines`。
8
8
  * Agent/Task 族:调用只进摘要计数,tool 卡始终折叠(避免 pending→完成高度闪动)。
9
9
  * edit/write 与 ask_user_question 留在外层:不进摘要计数,折叠态也单独成行。
10
+ * 外层行一旦在消息里出现,当前回合就地完结(不计静默期),后续消息另起回合:
11
+ * 摘要行因此只折叠连续的一段工具调用,展开/收起不再跨外层行搬位置。
10
12
  * 用户消息是回合的硬边界:steer 消息插进回合中间、或上一回合没正文就收尾时,回合
11
- * 就地收口、后续消息另起一回合,区间里的用户消息不会被当成外来行挪走(摘要行、
12
- * 展开面板因此留在自己回合的位置上)。
13
+ * 就地收口、后续消息另起一回合。custom 通知/summary 类组件既不是成员也不算外来行,
14
+ * 原地留在两段之间,不打断统计也不被挪位。
13
15
  * 底部 Agents/Tasks 面板由 pi-subagents/pi-tasks 独立 widget 负责,不经 tool 卡外置。
14
16
  *
15
17
  * live 围观态(回合进行中 / 收尾静默期):正文跟折叠态同形;摘要行与单一槽位卡
@@ -30,6 +32,7 @@
30
32
  */
31
33
  import {
32
34
  AssistantMessageComponent,
35
+ CustomMessageComponent,
33
36
  SkillInvocationMessageComponent,
34
37
  ToolExecutionComponent,
35
38
  UserMessageComponent,
@@ -385,6 +388,9 @@ function layoutExpandedToolCard(
385
388
  ): { lines: string[]; hits: Array<{ child: any; start: number; end: number }> } {
386
389
  const slot = aggregateToolCardBgSlot(children.map((child) => child?.__ccTool).filter(Boolean));
387
390
  const toolBgAnsi = darkenBgAnsi(theme, slot);
391
+ // 展开面板外卡底色随组内工具状态聚合(与 default 模式分组卡同口径):
392
+ // 有一个失败用失败底色、没有失败但有进行中用进行中底色、全成功用成功底色。
393
+ const outerSlot = slot;
388
394
  /** live 每行前面的标记宽度(首行 `↳ `,其余对齐空格)。 */
389
395
  const markerWidth = live ? 2 : 0;
390
396
  const innerWidth = Math.max(0, width - 2 - markerWidth);
@@ -399,7 +405,7 @@ function layoutExpandedToolCard(
399
405
  // 面板 pad 1 是唯一左边距:剥掉子行 collapsed 态自带的 1 格 lead,
400
406
  // 否则标题行偏到 2、↳ 行偏到 4,左右不再对称。
401
407
  const line = raw.replace(/^((?:\x1b\[[0-?]*[ -/]*[@-~])*) /, "$1");
402
- lines.push(paddedBackgroundRow(theme, slot, line, width));
408
+ lines.push(paddedBackgroundRow(theme, outerSlot, line, width));
403
409
  return;
404
410
  }
405
411
  // 槽位里不重复展开入口(见 SLOT_HINT_PATTERNS)。
@@ -420,14 +426,13 @@ function layoutExpandedToolCard(
420
426
  };
421
427
  const pushBlank = () => {
422
428
  if (live || lastBlank) return;
423
- lines.push(paddedBackgroundRow(theme, slot, "", width));
429
+ lines.push(paddedBackgroundRow(theme, outerSlot, "", width));
424
430
  lastBlank = true;
425
431
  };
426
432
  for (let childIndex = 0; childIndex < children.length; childIndex++) {
427
433
  const child = children[childIndex];
428
434
  const painted = paints?.[childIndex];
429
435
  const childLines = Array.isArray(painted) ? painted : child.render(innerWidth);
430
- // live 不留空行、也不叠深色内卡:槽位没有边框。
431
436
  const innerCard = !live && isThinkingPreview(child) && child.expanded === true;
432
437
  let first = -1;
433
438
  let last = -1;
@@ -440,7 +445,7 @@ function layoutExpandedToolCard(
440
445
  if (first < 0) {
441
446
  if (live) continue;
442
447
  for (const line of childLines) {
443
- lines.push(paddedBackgroundRow(theme, slot, line, width));
448
+ lines.push(paddedBackgroundRow(theme, outerSlot, line, width));
444
449
  lastBlank = !hasVisibleText(line);
445
450
  }
446
451
  continue;
@@ -502,6 +507,7 @@ function compactRoundCard(
502
507
  | undefined;
503
508
  const layout = (width: number) => {
504
509
  const theme = themeOf();
510
+ // 与 default 模式分组卡同口径:外卡底色随组内工具聚合,子卡状态变了要重绘。
505
511
  const bgSlot = aggregateToolCardBgSlot(
506
512
  children.map((child) => child?.__ccTool).filter(Boolean),
507
513
  );
@@ -1320,6 +1326,16 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1320
1326
  }, FOLD_SETTLE_MS);
1321
1327
  };
1322
1328
 
1329
+ /**
1330
+ * 外层行(edit/write/ask)切出的段落封口:跳过静默期直接定稿。
1331
+ * 静默期是为"正文 token 先于 toolCall 到达"的双重转场准备的;外层边界
1332
+ * 出现时摘要段内容已完整,立即收拢让 Ran for 当场落位,槽位卡一并撤走。
1333
+ */
1334
+ const sealRound = (round: CompactRound, endTimestamp?: number): void => {
1335
+ finalizeRound(round, endTimestamp);
1336
+ renderRound(round);
1337
+ };
1338
+
1323
1339
  /** 新回合接替时立即收掉还在静默期的回合,把两次转场并成一次。 */
1324
1340
  const flushSettle = (): void => {
1325
1341
  for (const round of [...pendingFoldRounds]) {
@@ -1460,6 +1476,13 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1460
1476
  const isUserMessageComponent = (value: any): boolean =>
1461
1477
  value instanceof UserMessageComponent || value instanceof SkillInvocationMessageComponent;
1462
1478
 
1479
+ /**
1480
+ * 回合内的透明行:custom 通知(系统提示、extension 注入)既不是成员也不算外来行。
1481
+ * 它落在两个成员之间时原地保留——不打断统计、不被搬到摘要行下方。
1482
+ * 硬边界仍只有用户消息;summary/compaction 块由各自的 message 边界收口。
1483
+ */
1484
+ const isTransparentComponent = (value: any): boolean => value instanceof CustomMessageComponent;
1485
+
1463
1486
  /**
1464
1487
  * 新组件与回合已有成员之间是否隔着一条用户消息。隔着就说明这是下一回合的内容:
1465
1488
  * steer 消息插进了回合中间,或上一回合没有正文就收尾、用户又问了新问题。
@@ -1599,7 +1622,14 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1599
1622
  const intruders: any[] = [];
1600
1623
  for (let i = last - 1; i > first; i--) {
1601
1624
  // 用户消息永远留在原地:挪走会把别人的消息挪到用户消息下面去。
1602
- if (isMember(children[i]) || isUserMessageComponent(children[i])) continue;
1625
+ // custom 通知同理:它是回合内的透明行,不被统计也不挪位。
1626
+ if (
1627
+ isMember(children[i]) ||
1628
+ isUserMessageComponent(children[i]) ||
1629
+ isTransparentComponent(children[i])
1630
+ ) {
1631
+ continue;
1632
+ }
1603
1633
  intruders.unshift(children.splice(i, 1)[0]);
1604
1634
  }
1605
1635
  if (lastMember) last = children.indexOf(lastMember);
@@ -1759,22 +1789,24 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1759
1789
 
1760
1790
  const thinkingKids: any[] = [];
1761
1791
  for (const [component, message] of round.messages) {
1762
- if (component !== previewComponent) {
1792
+ if (component === previewComponent) {
1793
+ passThroughAssistant(component, message);
1794
+ const kids = Array.isArray(component.contentContainer?.children)
1795
+ ? [...component.contentContainer.children]
1796
+ : [];
1763
1797
  component.contentContainer?.clear?.();
1764
- continue;
1765
- }
1766
- passThroughAssistant(component, message);
1767
- const kids = Array.isArray(component.contentContainer?.children)
1768
- ? [...component.contentContainer.children]
1769
- : [];
1770
- component.contentContainer?.clear?.();
1771
- // 只摘思考预览块进槽位;已收尾的思考回收进摘要行。
1772
- for (const kid of kids) {
1773
- if (typeof kid?.setHintHovered === "function") thinkingKids.push(kid);
1798
+ // 只摘思考预览块进槽位;已收尾的思考回收进摘要行。
1799
+ for (const kid of kids) {
1800
+ if (typeof kid?.setHintHovered === "function") thinkingKids.push(kid);
1801
+ }
1774
1802
  }
1803
+ // text 在各消息自己的位置渲染,不随回合折叠态;非 anchor 成员的
1804
+ // 中止/错误状态仍汇总在 anchor 外层,不在成员处重复成行。
1805
+ renderAssistantWithoutThinking(
1806
+ component,
1807
+ component === round.anchor ? message : { ...message, stopReason: "stop" },
1808
+ );
1775
1809
  }
1776
- // 正文照折叠态渲染(不含 thinking):live 与收尾后同形,收尾只剩槽位卡消失。
1777
- renderAssistantWithoutThinking(round.anchor, round.messages.get(round.anchor));
1778
1810
 
1779
1811
  const toolsById = new Map<string, any>();
1780
1812
  for (const tool of trackedToolComponents) {
@@ -1900,10 +1932,14 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1900
1932
  // 否则消息内容里的 thinking([thinking, text, toolCall])会盖到文本上面。
1901
1933
  const anchorChildren: any[] = [];
1902
1934
  let cardItems: Array<{ child?: any; tool?: any }> = [];
1903
- const flushPanel = () => {
1935
+ // 纯 spacer 串拆不开面板,还给它所在消息的组件(通常是上一个
1936
+ // text 块的前导空行)。
1937
+ const flushPanel = (spacerOwner: any = round.anchor) => {
1904
1938
  if (cardItems.length === 0) return;
1905
1939
  if (cardItems.every((item) => !item.tool && isSpacerComponent(item.child))) {
1906
- for (const item of cardItems) anchorChildren.push(item.child);
1940
+ for (const item of cardItems) {
1941
+ spacerOwner?.contentContainer?.addChild?.(item.child);
1942
+ }
1907
1943
  } else {
1908
1944
  // 面板上沿留 1 行卡外空行:面板底色与 userMessage 同色,
1909
1945
  // 贴在一起会看成一个块;卡内顶部再加 1 行 padding 保持上下对称。
@@ -1920,13 +1956,15 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1920
1956
  }
1921
1957
  cardItems = [];
1922
1958
  };
1923
- const takeChild = (child: any, outside: boolean) => {
1959
+ // outside 的块(text 及其前导空行)留在各自组件上原位渲染:展开态下
1960
+ // 助手文本不跨消息搬家;它不切断面板——cardItems 跨消息延续,回合的
1961
+ // thinking/工具统一汇成末尾的一张共享面板,混排 text 不再把卡撕成几段。
1962
+ const takeChild = (component: any, child: any, outside: boolean) => {
1924
1963
  if (!outside) {
1925
1964
  cardItems.push({ child });
1926
1965
  return;
1927
1966
  }
1928
- flushPanel();
1929
- anchorChildren.push(child);
1967
+ component.contentContainer?.addChild?.(child);
1930
1968
  };
1931
1969
  const placedToolIds = new Set<string>();
1932
1970
  const placeTool = (id: string, fallbackName?: string) => {
@@ -1972,11 +2010,11 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1972
2010
  }
1973
2011
  }
1974
2012
  while (cursor.i < kids.length) local.push({ outside: false, child: kids[cursor.i++] });
1975
- for (const entry of local) if (entry.outside) takeChild(entry.child, true);
2013
+ for (const entry of local) if (entry.outside) takeChild(component, entry.child, true);
1976
2014
  for (const entry of local) {
1977
2015
  if (entry.outside) continue;
1978
2016
  if (entry.toolId) placeTool(entry.toolId, entry.toolName);
1979
- else takeChild(entry.child, false);
2017
+ else takeChild(component, entry.child, false);
1980
2018
  }
1981
2019
  }
1982
2020
  for (const message of round.detachedMessages) {
@@ -2001,15 +2039,10 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2001
2039
  !explicitRoundToolIds.has(String(tool.toolCallId ?? "")),
2002
2040
  );
2003
2041
  flushPanel();
2042
+ // anchorChildren 只剩面板件(spacer+panelBoundSpacer 都是 childAtRow 组件):
2043
+ // 面板挂回摘要行原位,text 已在各自组件上。
2004
2044
  if (mounted) {
2005
- // 正文留在各自的 assistant 消息上,面板挂回摘要行原位。
2006
- const outside: any[] = [];
2007
- const panel: any[] = [];
2008
- for (const child of anchorChildren) {
2009
- (typeof child?.childAtRow === "function" ? panel : outside).push(child);
2010
- }
2011
- for (const child of outside) round.anchor.contentContainer.addChild(child);
2012
- if (panel.length > 0) mountRoundTail(round, () => panel);
2045
+ if (anchorChildren.length > 0) mountRoundTail(round, () => anchorChildren);
2013
2046
  else unmountRoundTail(round);
2014
2047
  } else {
2015
2048
  unmountRoundTail(round);
@@ -2041,7 +2074,8 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2041
2074
  // 折叠时工具行被隐藏:abort/error/length 必须挂在摘要外层。
2042
2075
  appendStopStatus(component, stopStatus);
2043
2076
  } else {
2044
- component.contentContainer?.clear?.();
2077
+ // 成员的 text 同样留在自己组件上;中止状态只在 anchor 外层报一次。
2078
+ renderAssistantWithoutThinking(component, { ...message, stopReason: "stop" });
2045
2079
  }
2046
2080
  }
2047
2081
  };
@@ -2143,6 +2177,15 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2143
2177
 
2144
2178
  const content = Array.isArray(message?.content) ? message.content : [];
2145
2179
  const hasToolCalls = content.some((item: any) => item?.type === "toolCall");
2180
+ const hasOuterToolCall = content.some(
2181
+ (item: any) => item?.type === "toolCall" && OUTER_TOOLS.has(String(item?.name ?? "")),
2182
+ );
2183
+ const hasInnerToolCall = content.some(
2184
+ (item: any) => item?.type === "toolCall" && !OUTER_TOOLS.has(String(item?.name ?? "")),
2185
+ );
2186
+ const hasThinkingContent = content.some(
2187
+ (item: any) => item?.type === "thinking" && String(item?.thinking ?? "").trim(),
2188
+ );
2146
2189
  const hasText = content.some(
2147
2190
  (item: any) => item?.type === "text" && typeof item.text === "string" && item.text.trim(),
2148
2191
  );
@@ -2150,13 +2193,54 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2150
2193
 
2151
2194
  if (hasToolCalls) {
2152
2195
  let round = roundByComponent.get(this);
2196
+ const previousMessage = round?.messages.get(this);
2197
+ const previousHadOuter = Array.isArray(previousMessage?.content)
2198
+ ? previousMessage.content.some(
2199
+ (item: any) => item?.type === "toolCall" && OUTER_TOOLS.has(String(item?.name ?? "")),
2200
+ )
2201
+ : false;
2153
2202
  if (!round) {
2154
- // 本条消息是否带 text 不是回合边界:pi 流式协议里同一条
2155
- // assistant 消息会以 text+toolCall、toolCall-only 反复到达。
2156
- // 只在「组件未挂进任何回合」时并入 activeRound;被用户消息
2157
- // 隔开(steer/上回合没正文)时由 joinOrCreateRound 收尾另起。
2158
- round = joinOrCreateRound(this, message);
2159
- roundByComponent.set(this, round);
2203
+ // 外层行打断摘要段:本条消息带外层调用且可并入的活动回合已有内容时,
2204
+ // 旧回合就地完结(不走静默期)。本条消息自己含 inner 调用或思考才另起一段;
2205
+ // 外层独段(edit-only 消息)不建回合——没有可汇总内容,建段只会挂空摘要行。
2206
+ const joinable = joinableActiveRound(this);
2207
+ if (joinable && hasOuterToolCall) {
2208
+ sealRound(joinable, message?.timestamp);
2209
+ if (hasInnerToolCall || hasThinkingContent) {
2210
+ round = createRound(this, message);
2211
+ roundByComponent.set(this, round);
2212
+ round.messages.set(this, message);
2213
+ if (isUsableTimestamp(message.timestamp) && message.timestamp < round.startedAt) {
2214
+ round.startedAt = message.timestamp;
2215
+ }
2216
+ renderRound(round);
2217
+ return undefined;
2218
+ }
2219
+ // 外层独段:text/thinking 照原生渲染,edit 行由 tool render 外置,没有摘要行。
2220
+ return passThroughAssistant(this, message);
2221
+ }
2222
+ if (hasInnerToolCall || hasThinkingContent) {
2223
+ // 本条消息是否带 text 不是回合边界:pi 流式协议里同一条
2224
+ // assistant 消息会以 text+toolCall、toolCall-only 反复到达。
2225
+ // 只在「组件未挂进任何回合」时并入 activeRound;被用户消息
2226
+ // 隔开(steer/上回合没正文)时由 joinOrCreateRound 收尾另起。
2227
+ round = joinOrCreateRound(this, message);
2228
+ roundByComponent.set(this, round);
2229
+ round.messages.set(this, message);
2230
+ if (isUsableTimestamp(message.timestamp) && message.timestamp < round.startedAt) {
2231
+ round.startedAt = message.timestamp;
2232
+ }
2233
+ renderRound(round);
2234
+ return undefined;
2235
+ }
2236
+ // 外层独段、又没有可并入的活动回合:不建回合,text/工具各归其位。
2237
+ if (activeRound) finishRound(activeRound, message?.timestamp);
2238
+ return passThroughAssistant(this, message);
2239
+ }
2240
+ if (hasOuterToolCall && !previousHadOuter && roundLive(round)) {
2241
+ // 消息入段后流式增长才冒出外层调用(先 thinking 后 toolCall):
2242
+ // 就地封口所在段,本条消息按消息级归属留在原段,后续消息另起一段。
2243
+ sealRound(round, message?.timestamp);
2160
2244
  }
2161
2245
  round.messages.set(this, message);
2162
2246
  if (isUsableTimestamp(message.timestamp) && message.timestamp < round.startedAt) {
@@ -50,8 +50,8 @@ import {
50
50
  hideScrollButton,
51
51
  dockScrollButtonActive,
52
52
  restoreOfficialScrollToEnd,
53
+ restoreNativeScrollIndicatorText,
53
54
  syncOfficialScrollToEnd,
54
- isScrollBottomInput,
55
55
  renderScrollButton,
56
56
  resetScrollButtonState,
57
57
  scheduleScrollButtonSync,
@@ -78,6 +78,7 @@ import {
78
78
  } from "./hover.ts";
79
79
  import {
80
80
  handleStickyPromptClick,
81
+ stickyBarHit,
81
82
  resetStickyPromptState,
82
83
  updateStickyPromptHover,
83
84
  } from "./sticky-prompt.ts";
@@ -613,6 +614,18 @@ function packetInsideOverlay(tui: any, packet: SgrMousePacket): boolean {
613
614
  return false;
614
615
  }
615
616
 
617
+ /** 原生指示器优先于工具卡;覆盖它的粘性行仍保留原有点击优先级。 */
618
+ function packetOnNativeIndicator(tui: any, packet: SgrMousePacket): boolean {
619
+ const rect = tui.scrollToEndIndicatorRect;
620
+ return Boolean(
621
+ rect &&
622
+ packet.row - 1 === rect.row &&
623
+ packet.col - 1 >= rect.column &&
624
+ packet.col - 1 < rect.column + rect.width &&
625
+ !stickyBarHit(tui, packet),
626
+ );
627
+ }
628
+
616
629
  /**
617
630
  * 实例级包装 TuiAltScreen.handleViewportInput(惰性 Proxy 安全):
618
631
  * 原型方法取 original(绕开 proxy 函数包装),实例 own property 装 wrapper
@@ -636,6 +649,13 @@ function patchFullscreenViewportInput(tui: any): void {
636
649
  // dispatchMouseToOverlay → overlay.handleMouse;overlay 外的包仍
637
650
  // 走扩展收起/展开/hover。两条路径各管各的。
638
651
  if (packets) {
652
+ const nativePacket = packets.find((packet) => packetOnNativeIndicator(tui, packet));
653
+ if (nativePacket) {
654
+ clearPendingCollapsePress();
655
+ applyFullscreenHover(tui, null);
656
+ updateStickyPromptHover(tui, nativePacket);
657
+ return Reflect.apply(original, this, [data]);
658
+ }
639
659
  // 布局还没出来或仍是上一帧:不要把点击收成工具展开。返回 undefined
640
660
  // 让焦点 overlay 的 handleInput 拿到原始 SGR;官方链也靠这份布局,调它会消费且打到 transcript。
641
661
  if (tui.hasOverlay?.() && !overlayLayoutsCurrent(tui)) return undefined;
@@ -985,13 +1005,9 @@ function handleToolMouseInput(data: string): { consume: true } | undefined {
985
1005
  if (!getToolMouseTui()) return undefined;
986
1006
  // 惰性 Proxy fullscreen:鼠标由 handleViewportInput 包装消费(官方链之前),
987
1007
  // 此处只处理键盘(鼠标事件在官方 listener 已被 consume,到不了这里)。
1008
+ // 回底键归 Pi viewport(tui.altScreen.bottom,overlay 聚焦时让给 overlay),不在此重复处理。
988
1009
  if (fullscreenLazyTui(getToolMouseTui())) {
989
1010
  scheduleScrollButtonSync(getToolMouseTui(), data);
990
- if (isScrollBottomInput(data)) {
991
- getToolMouseTui().scrollToBottom?.();
992
- hideScrollButton(getToolMouseTui());
993
- return { consume: true };
994
- }
995
1011
  return undefined;
996
1012
  }
997
1013
  updateScrollButtonFromInput(getToolMouseTui(), data);
@@ -1080,6 +1096,7 @@ export function resetToolHoverState(): void {
1080
1096
  setScrollButtonVisible(false);
1081
1097
  setScrollButtonHovered(false);
1082
1098
  resetStickyPromptState();
1099
+ restoreNativeScrollIndicatorText();
1083
1100
  restoreOfficialScrollToEnd(getToolMouseTui());
1084
1101
  releaseFullscreenToolMouseMotion(getToolMouseTui());
1085
1102
  }
@@ -1172,6 +1189,7 @@ export function installToolMouseInteraction(
1172
1189
  return renderScrollButton(width, theme);
1173
1190
  },
1174
1191
  invalidate() {},
1192
+ dispose: restoreNativeScrollIndicatorText,
1175
1193
  });
1176
1194
  return getScrollButtonWidget();
1177
1195
  }