@herbertgao/pi-extensions 2026.8.15 → 2026.9.1

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 (351) hide show
  1. package/README.md +4 -1
  2. package/THIRD_PARTY_NOTICES.md +26 -0
  3. package/node_modules/@czottmann/pi-automode/CHANGELOG.md +13 -1
  4. package/node_modules/@czottmann/pi-automode/README.md +20 -0
  5. package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +1 -1
  6. package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +2 -1
  7. package/node_modules/@czottmann/pi-automode/docs/defaults.md +3 -2
  8. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +38 -2
  9. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +5 -3
  10. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +11 -3
  11. package/node_modules/@czottmann/pi-automode/package.json +1 -1
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +20 -0
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +46 -3
  14. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +55 -17
  15. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/packets.ts +6 -0
  16. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +5 -0
  17. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +34 -30
  18. package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
  19. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
  20. package/node_modules/@narumitw/pi-btw/README.md +5 -1
  21. package/node_modules/@narumitw/pi-btw/dist/index.ts +143 -14
  22. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
  23. package/node_modules/@narumitw/pi-btw/package.json +4 -4
  24. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +158 -7
  25. package/node_modules/@narumitw/pi-btw/src/text.ts +18 -0
  26. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +5 -16
  27. package/node_modules/@narumitw/pi-caffeinate/LICENSE +21 -0
  28. package/node_modules/@narumitw/pi-caffeinate/README.md +224 -0
  29. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1112 -0
  30. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +7 -0
  31. package/node_modules/@narumitw/pi-caffeinate/package.json +53 -0
  32. package/node_modules/@narumitw/pi-caffeinate/src/caffeinate.ts +811 -0
  33. package/node_modules/@narumitw/pi-caffeinate/src/dbus-inhibit.ts +153 -0
  34. package/node_modules/@narumitw/pi-caffeinate/src/index.ts +1 -0
  35. package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +43 -0
  36. package/node_modules/@narumitw/pi-caffeinate/src/inhibitors.ts +167 -0
  37. package/node_modules/@narumitw/pi-caffeinate/src/settings.ts +202 -0
  38. package/node_modules/@pi-plugins/fast-mode/README.md +5 -3
  39. package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
  40. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +20 -55
  41. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  42. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  43. package/node_modules/@tifan/pi-handoff/README.md +6 -3
  44. package/node_modules/@tifan/pi-handoff/package.json +1 -1
  45. package/node_modules/@tifan/pi-handoff/src/index.ts +8 -3
  46. package/node_modules/pi-lens/CHANGELOG.md +988 -0
  47. package/node_modules/pi-lens/README.md +3 -0
  48. package/node_modules/pi-lens/config/biome/core.jsonc +11 -2
  49. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +13 -1
  50. package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -2
  51. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +927 -80
  52. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +13 -4
  53. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +123 -3
  54. package/node_modules/pi-lens/dist/clients/ast-grep-rule-manager.js +60 -5
  55. package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +2 -2
  56. package/node_modules/pi-lens/dist/clients/bash-file-access.js +1 -3
  57. package/node_modules/pi-lens/dist/clients/biome-client.js +9 -2
  58. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +14 -0
  59. package/node_modules/pi-lens/dist/clients/bootstrap.js +509 -73
  60. package/node_modules/pi-lens/dist/clients/bounded-cache.js +152 -12
  61. package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +59 -4
  62. package/node_modules/pi-lens/dist/clients/bundled-resource-health.js +113 -0
  63. package/node_modules/pi-lens/dist/clients/bus-events-logger.js +2 -2
  64. package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +31 -4
  65. package/node_modules/pi-lens/dist/clients/cache-manager.js +105 -6
  66. package/node_modules/pi-lens/dist/clients/cache-observability.js +44 -18
  67. package/node_modules/pi-lens/dist/clients/cargo-manifest.js +422 -0
  68. package/node_modules/pi-lens/dist/clients/cascade-logger.js +2 -2
  69. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +13 -3
  70. package/node_modules/pi-lens/dist/clients/complexity-client.js +16 -5
  71. package/node_modules/pi-lens/dist/clients/config-core/deny.js +221 -0
  72. package/node_modules/pi-lens/dist/clients/config-core/index.js +47 -0
  73. package/node_modules/pi-lens/dist/clients/config-core/merge.js +357 -0
  74. package/node_modules/pi-lens/dist/clients/config-core/normalize.js +340 -0
  75. package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +248 -0
  76. package/node_modules/pi-lens/dist/clients/config-core/provenance.js +171 -0
  77. package/node_modules/pi-lens/dist/clients/config-core/records.js +218 -0
  78. package/node_modules/pi-lens/dist/clients/config-core/resolve.js +125 -0
  79. package/node_modules/pi-lens/dist/clients/config-core/safe-object.js +78 -0
  80. package/node_modules/pi-lens/dist/clients/config-core/schema.js +167 -0
  81. package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +281 -0
  82. package/node_modules/pi-lens/dist/clients/config-locations.js +160 -0
  83. package/node_modules/pi-lens/dist/clients/config-resolve.js +789 -0
  84. package/node_modules/pi-lens/dist/clients/config-schema.js +197 -0
  85. package/node_modules/pi-lens/dist/clients/config-warn.js +407 -0
  86. package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -14
  87. package/node_modules/pi-lens/dist/clients/dead-code-logger.js +2 -2
  88. package/node_modules/pi-lens/dist/clients/deadline-utils.js +178 -0
  89. package/node_modules/pi-lens/dist/clients/debug-handles.js +2 -2
  90. package/node_modules/pi-lens/dist/clients/debug-heap.js +3 -3
  91. package/node_modules/pi-lens/dist/clients/deferred-lsp-work.js +106 -0
  92. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +113 -7
  93. package/node_modules/pi-lens/dist/clients/dependency-checker.js +8 -19
  94. package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +12 -9
  95. package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +14 -4
  96. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +162 -18
  97. package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +97 -0
  98. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +9 -7
  99. package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +0 -1
  100. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +380 -26
  101. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +0 -1
  102. package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +0 -1
  103. package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +0 -1
  104. package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +0 -1
  105. package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -1
  106. package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +0 -1
  107. package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -1
  108. package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +0 -1
  109. package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +0 -1
  110. package/node_modules/pi-lens/dist/clients/dispatch/runners/fact-rules.js +0 -1
  111. package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +0 -1
  112. package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +0 -1
  113. package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +1 -3
  114. package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -1
  115. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +0 -1
  116. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +0 -1
  117. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +0 -1
  118. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +0 -1
  119. package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +0 -1
  120. package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +0 -1
  121. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +0 -1
  122. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +0 -1
  123. package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +0 -1
  124. package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +13 -18
  125. package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +0 -1
  126. package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +0 -1
  127. package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -1
  128. package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -1
  129. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +7 -4
  130. package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +0 -1
  131. package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +0 -1
  132. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -3
  133. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +0 -1
  134. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +0 -1
  135. package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +0 -1
  136. package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +0 -1
  137. package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -1
  138. package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +0 -1
  139. package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +0 -1
  140. package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +0 -1
  141. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +0 -1
  142. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +0 -1
  143. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -1
  144. package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +0 -1
  145. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +3 -0
  146. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +3 -4
  147. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +194 -80
  148. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +84 -15
  149. package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +0 -1
  150. package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +0 -1
  151. package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +0 -1
  152. package/node_modules/pi-lens/dist/clients/disposition-logger.js +3 -3
  153. package/node_modules/pi-lens/dist/clients/effective-config.js +403 -0
  154. package/node_modules/pi-lens/dist/clients/error-class.js +23 -0
  155. package/node_modules/pi-lens/dist/clients/event-loop-hold.js +274 -0
  156. package/node_modules/pi-lens/dist/clients/extension-log.js +2 -2
  157. package/node_modules/pi-lens/dist/clients/feature-hints.js +2 -1
  158. package/node_modules/pi-lens/dist/clients/file-time.js +6 -1
  159. package/node_modules/pi-lens/dist/clients/file-utils.js +112 -9
  160. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +50 -13
  161. package/node_modules/pi-lens/dist/clients/format-service.js +6 -1
  162. package/node_modules/pi-lens/dist/clients/formatters.js +276 -102
  163. package/node_modules/pi-lens/dist/clients/freshness-cadence.js +17 -0
  164. package/node_modules/pi-lens/dist/clients/generated-artifacts.js +114 -19
  165. package/node_modules/pi-lens/dist/clients/generation-guard.js +4 -9
  166. package/node_modules/pi-lens/dist/clients/git-guard.js +1 -1
  167. package/node_modules/pi-lens/dist/clients/go-client.js +39 -0
  168. package/node_modules/pi-lens/dist/clients/gradle-ktfmt-style.js +252 -0
  169. package/node_modules/pi-lens/dist/clients/hashline-anchor.js +424 -0
  170. package/node_modules/pi-lens/dist/clients/hook-budgets.js +76 -0
  171. package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +5 -2
  172. package/node_modules/pi-lens/dist/clients/host-ports.js +1 -1
  173. package/node_modules/pi-lens/dist/clients/installer/index.js +71 -52
  174. package/node_modules/pi-lens/dist/clients/instance-reaper.js +104 -230
  175. package/node_modules/pi-lens/dist/clients/instance-registry.js +6 -3
  176. package/node_modules/pi-lens/dist/clients/language-registry.js +595 -0
  177. package/node_modules/pi-lens/dist/clients/latency-logger.js +160 -2
  178. package/node_modules/pi-lens/dist/clients/ledger-bounds.js +13 -0
  179. package/node_modules/pi-lens/dist/clients/lens-config.js +141 -30
  180. package/node_modules/pi-lens/dist/clients/lens-engine.js +30 -37
  181. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +59 -6
  182. package/node_modules/pi-lens/dist/clients/log-cleanup.js +2 -2
  183. package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +3 -1
  184. package/node_modules/pi-lens/dist/clients/lsp/client.js +168 -30
  185. package/node_modules/pi-lens/dist/clients/lsp/config.js +483 -158
  186. package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +1 -1
  187. package/node_modules/pi-lens/dist/clients/lsp/edits.js +15 -2
  188. package/node_modules/pi-lens/dist/clients/lsp/index.js +676 -71
  189. package/node_modules/pi-lens/dist/clients/lsp/language.js +18 -169
  190. package/node_modules/pi-lens/dist/clients/lsp/launch.js +2 -1
  191. package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +5 -16
  192. package/node_modules/pi-lens/dist/clients/lsp/server.js +284 -147
  193. package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +116 -23
  194. package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +2 -7
  195. package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +9 -2
  196. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +1 -1
  197. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +163 -21
  198. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +36 -0
  199. package/node_modules/pi-lens/dist/clients/mcp/analyze.js +33 -4
  200. package/node_modules/pi-lens/dist/clients/mcp/session.js +5 -16
  201. package/node_modules/pi-lens/dist/clients/memory-sampler.js +8 -3
  202. package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +2 -4
  203. package/node_modules/pi-lens/dist/clients/module-report.js +20 -45
  204. package/node_modules/pi-lens/dist/clients/mutating-tool.js +651 -0
  205. package/node_modules/pi-lens/dist/clients/mutation-attribution.js +368 -0
  206. package/node_modules/pi-lens/dist/clients/mutation-bridge.js +240 -0
  207. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +247 -20
  208. package/node_modules/pi-lens/dist/clients/observed-mutation-sources.js +101 -0
  209. package/node_modules/pi-lens/dist/clients/observed-mutation.js +1215 -0
  210. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +68 -22
  211. package/node_modules/pi-lens/dist/clients/opengrep-config.js +4 -0
  212. package/node_modules/pi-lens/dist/clients/package-manager.js +195 -26
  213. package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +359 -80
  214. package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +23 -7
  215. package/node_modules/pi-lens/dist/clients/path-keyed-map.js +21 -2
  216. package/node_modules/pi-lens/dist/clients/path-utils.js +428 -13
  217. package/node_modules/pi-lens/dist/clients/persist-debounce.js +8 -1
  218. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +114 -0
  219. package/node_modules/pi-lens/dist/clients/pipeline.js +77 -16
  220. package/node_modules/pi-lens/dist/clients/probe-home-state.js +228 -0
  221. package/node_modules/pi-lens/dist/clients/process-bridge.js +66 -0
  222. package/node_modules/pi-lens/dist/clients/process-snapshot.js +68 -0
  223. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +4 -3
  224. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +27 -3
  225. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +51 -20
  226. package/node_modules/pi-lens/dist/clients/project-lens-config.js +393 -122
  227. package/node_modules/pi-lens/dist/clients/project-snapshot.js +52 -24
  228. package/node_modules/pi-lens/dist/clients/python-environment.js +217 -0
  229. package/node_modules/pi-lens/dist/clients/python-provenance.js +639 -0
  230. package/node_modules/pi-lens/dist/clients/quiet-window.js +6 -1
  231. package/node_modules/pi-lens/dist/clients/read-bridge.js +13 -21
  232. package/node_modules/pi-lens/dist/clients/read-expansion.js +9 -46
  233. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +15 -4
  234. package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +364 -212
  235. package/node_modules/pi-lens/dist/clients/read-guard.js +21 -0
  236. package/node_modules/pi-lens/dist/clients/resource-sampler.js +195 -96
  237. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +152 -109
  238. package/node_modules/pi-lens/dist/clients/review-graph/service.js +55 -3
  239. package/node_modules/pi-lens/dist/clients/review-graph/shared-extraction-ir.js +7 -15
  240. package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +10 -74
  241. package/node_modules/pi-lens/dist/clients/review-graph-logger.js +9 -3
  242. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +18 -2
  243. package/node_modules/pi-lens/dist/clients/runtime-context.js +49 -16
  244. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +25 -6
  245. package/node_modules/pi-lens/dist/clients/runtime-session.js +139 -22
  246. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +168 -35
  247. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +797 -243
  248. package/node_modules/pi-lens/dist/clients/runtime-turn.js +1028 -53
  249. package/node_modules/pi-lens/dist/clients/rust-client.js +31 -0
  250. package/node_modules/pi-lens/dist/clients/safe-spawn.js +33 -10
  251. package/node_modules/pi-lens/dist/clients/sanitize.js +7 -1
  252. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +1 -3
  253. package/node_modules/pi-lens/dist/clients/security-scan-client.js +3 -0
  254. package/node_modules/pi-lens/dist/clients/session-lifecycle.js +1 -1
  255. package/node_modules/pi-lens/dist/clients/session-start-observability.js +79 -0
  256. package/node_modules/pi-lens/dist/clients/sessionstart-logger.js +12 -3
  257. package/node_modules/pi-lens/dist/clients/sgconfig.js +6 -1
  258. package/node_modules/pi-lens/dist/clients/skills-resolver.js +105 -0
  259. package/node_modules/pi-lens/dist/clients/smells-rollup.js +2 -2
  260. package/node_modules/pi-lens/dist/clients/string-utils.js +13 -0
  261. package/node_modules/pi-lens/dist/clients/subagent-mode.js +17 -4
  262. package/node_modules/pi-lens/dist/clients/test-runner-client.js +176 -39
  263. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +239 -0
  264. package/node_modules/pi-lens/dist/clients/tool-definition.js +41 -1
  265. package/node_modules/pi-lens/dist/clients/tool-policy.js +91 -21
  266. package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +40 -40
  267. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +86 -48
  268. package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
  269. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +81 -1
  270. package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +51 -46
  271. package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +28 -0
  272. package/node_modules/pi-lens/dist/clients/typos-config.js +5 -0
  273. package/node_modules/pi-lens/dist/clients/user-notify.js +6 -2
  274. package/node_modules/pi-lens/dist/clients/widget-state.js +191 -26
  275. package/node_modules/pi-lens/dist/clients/word-index-logger.js +2 -2
  276. package/node_modules/pi-lens/dist/clients/word-index-store.js +20 -5
  277. package/node_modules/pi-lens/dist/clients/word-index.js +243 -31
  278. package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -1
  279. package/node_modules/pi-lens/dist/clients/zizmor-config.js +3 -0
  280. package/node_modules/pi-lens/dist/index.js +64335 -54300
  281. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +3 -1
  282. package/node_modules/pi-lens/dist/mcp/server.js +127 -5
  283. package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +583 -0
  284. package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +129 -0
  285. package/node_modules/pi-lens/dist/tools/effective-config.js +89 -0
  286. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +95 -24
  287. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +67 -80
  288. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +37 -16
  289. package/node_modules/pi-lens/dist/tools/shared.js +0 -1
  290. package/node_modules/pi-lens/docs/agent-guide.md +64 -1
  291. package/node_modules/pi-lens/docs/configuration.md +222 -0
  292. package/node_modules/pi-lens/docs/dependencies.md +3 -3
  293. package/node_modules/pi-lens/docs/features.md +44 -5
  294. package/node_modules/pi-lens/docs/language-coverage.md +2 -2
  295. package/node_modules/pi-lens/docs/pi-lens-fixer.md +25 -0
  296. package/node_modules/pi-lens/docs/pi-lens-investigator.md +25 -0
  297. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +27 -0
  298. package/node_modules/pi-lens/docs/pi-lens-subagent.md +38 -0
  299. package/node_modules/pi-lens/docs/pi-lens-warden.md +55 -0
  300. package/node_modules/pi-lens/docs/public-api-stability.md +359 -0
  301. package/node_modules/pi-lens/docs/release-qa-baseline.md +182 -0
  302. package/node_modules/pi-lens/docs/subagent-compat.md +110 -30
  303. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +2 -2
  304. package/node_modules/pi-lens/package.json +15 -23
  305. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-cross-language-method.yml +3 -3
  306. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-hallucinated-import.yml +2 -2
  307. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-sql-injection.yml +12 -2
  308. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +192 -1
  309. package/node_modules/pi-lens/scripts/install-selftest.mjs +58 -2
  310. package/node_modules/pi-lens/scripts/lib/skills-predicate.mjs +129 -0
  311. package/node_modules/pi-lens/scripts/rpc-load-check.mjs +3 -1
  312. package/node_modules/pi-mcp-adapter/CHANGELOG.md +27 -0
  313. package/node_modules/pi-mcp-adapter/README.md +13 -13
  314. package/node_modules/pi-mcp-adapter/commands.ts +58 -21
  315. package/node_modules/pi-mcp-adapter/config.ts +18 -4
  316. package/node_modules/pi-mcp-adapter/direct-tools.ts +26 -6
  317. package/node_modules/pi-mcp-adapter/dist/config.d.ts +4 -0
  318. package/node_modules/pi-mcp-adapter/dist/config.js +13 -4
  319. package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -1
  320. package/node_modules/pi-mcp-adapter/dist/types.d.ts +11 -3
  321. package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -1
  322. package/node_modules/pi-mcp-adapter/error-signal.ts +15 -4
  323. package/node_modules/pi-mcp-adapter/errors.ts +141 -0
  324. package/node_modules/pi-mcp-adapter/host-html-template.ts +58 -5
  325. package/node_modules/pi-mcp-adapter/index.ts +2 -3
  326. package/node_modules/pi-mcp-adapter/init.ts +5 -0
  327. package/node_modules/pi-mcp-adapter/mcp-panel.ts +30 -9
  328. package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +66 -28
  329. package/node_modules/pi-mcp-adapter/mcp-status.ts +2 -0
  330. package/node_modules/pi-mcp-adapter/package.json +2 -1
  331. package/node_modules/pi-mcp-adapter/proxy-modes.ts +66 -13
  332. package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +217 -0
  333. package/node_modules/pi-mcp-adapter/server-manager.ts +337 -6
  334. package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +1 -0
  335. package/node_modules/pi-mcp-adapter/types.ts +18 -3
  336. package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +18 -2
  337. package/node_modules/pi-mcp-adapter/ui-server.ts +179 -54
  338. package/node_modules/pi-mcp-adapter/ui-session.ts +28 -8
  339. package/node_modules/pi-web-access/CHANGELOG.md +28 -0
  340. package/node_modules/pi-web-access/README.md +62 -15
  341. package/node_modules/pi-web-access/curator-page.ts +3 -1
  342. package/node_modules/pi-web-access/curator-server.ts +5 -1
  343. package/node_modules/pi-web-access/gemini-search.ts +8 -4
  344. package/node_modules/pi-web-access/github-extract.ts +242 -1
  345. package/node_modules/pi-web-access/index.ts +118 -64
  346. package/node_modules/pi-web-access/mistral-search.ts +281 -0
  347. package/node_modules/pi-web-access/package.json +2 -2
  348. package/node_modules/pi-web-access/perplexity.ts +14 -1
  349. package/node_modules/pi-web-access/utils.ts +23 -6
  350. package/node_modules/pi-web-access/xai-search.ts +96 -33
  351. package/package.json +15 -11
@@ -246,7 +246,7 @@ export class ExpandedToolIoView {
246
246
  private hoveredSection: ToolIoSection | null = null;
247
247
  /** Which sections currently show the show-more affordance (after last render). */
248
248
  private truncated: { input: boolean; output: boolean } = { input: false, output: false };
249
- /** 0-based header line indexes that carry show-more after last render. */
249
+ /** 0-based body/footer line indexes that carry show-more after last render. */
250
250
  private showMoreHeaderRows: { input?: number; output?: number } = {};
251
251
 
252
252
  constructor(
@@ -306,12 +306,12 @@ export class ExpandedToolIoView {
306
306
  this.invalidate();
307
307
  }
308
308
 
309
- /** True when the plain header line is a truncated section with show-more. */
309
+ /** True when the plain footer line is a truncated section with show-more. */
310
310
  matchShowMoreLine(plainLine: string): ToolIoSection | null {
311
311
  const line = plainLine.replace(/\x1b\[[0-9;]*m/g, "");
312
- if (!line.includes(` • ${showMoreHintText()}`)) return null;
313
- if (/\bInput\b/.test(line) && this.truncated.input) return "input";
314
- if (/\bOutput\b/.test(line) && this.truncated.output) return "output";
312
+ if (!line.includes(` • ${showMoreHintText()}`) || !/\+\d+ more lines/.test(line)) return null;
313
+ if (this.truncated.input && line.includes("│")) return "input";
314
+ if (this.truncated.output) return "output";
315
315
  return null;
316
316
  }
317
317
 
@@ -355,24 +355,13 @@ export class ExpandedToolIoView {
355
355
  this.truncated = { input: false, output: false };
356
356
  this.showMoreHeaderRows = {};
357
357
 
358
- const pushHeader = (
359
- corner: "├" | "└",
360
- label: string,
361
- section: ToolIoSection,
362
- showMore: boolean,
363
- ) => {
358
+ const pushHeader = (corner: "├" | "└", label: string) => {
364
359
  const mark = theme.fg("dim", ` ${corner} `);
365
360
  const title = theme.fg(
366
361
  "accent",
367
362
  typeof theme.bold === "function" ? theme.bold(label) : label,
368
363
  );
369
- // hover 只高亮文字,圆点保持 dim(与 group hint 一致)。
370
- const more = showMore
371
- ? theme.fg("dim", " •") +
372
- theme.fg(this.hoveredSection === section ? "text" : "dim", ` ${showMoreHintText()}`)
373
- : "";
374
- if (showMore) this.showMoreHeaderRows[section] = lines.length;
375
- lines.push(truncateToWidth(mark + title + more, safeWidth, ""));
364
+ lines.push(truncateToWidth(mark + title, safeWidth, ""));
376
365
  };
377
366
 
378
367
  const pushRailLine = (styledContent: string, continued = true) => {
@@ -394,7 +383,7 @@ export class ExpandedToolIoView {
394
383
 
395
384
  const pushBody = (
396
385
  body: string,
397
- opts: { input?: boolean; limit: number; continued?: boolean },
386
+ opts: { input?: boolean; limit: number; continued?: boolean; section: ToolIoSection },
398
387
  ): boolean /* truncated */ => {
399
388
  const raw = body.replace(/\t/g, " ").replace(/\n+$/, "");
400
389
  if (!raw.trim()) {
@@ -417,7 +406,14 @@ export class ExpandedToolIoView {
417
406
  if (truncated) {
418
407
  const hidden = Math.max(0, wrapped.length - visible.length);
419
408
  if (hidden > 0) {
420
- pushRailLine(theme.fg("dim", `… +${hidden} more lines`), opts.continued);
409
+ const more =
410
+ theme.fg("dim", " •") +
411
+ theme.fg(
412
+ this.hoveredSection === opts.section ? "text" : "dim",
413
+ ` ${showMoreHintText()}`,
414
+ );
415
+ pushRailLine(theme.fg("dim", `… +${hidden} more lines`) + more, opts.continued);
416
+ this.showMoreHeaderRows[opts.section] = lines.length - 1;
421
417
  }
422
418
  }
423
419
  return truncated;
@@ -426,7 +422,6 @@ export class ExpandedToolIoView {
426
422
  const hasInput = this.inputBody.trim().length > 0;
427
423
  const outputText = this.getOutputBody();
428
424
 
429
- // Decide show-more from the same truncation rules as pushBody.
430
425
  const inputWouldTruncate =
431
426
  hasInput &&
432
427
  bodyExceedsLineLimit(this.inputBody, this.maxInputLines, contentWidth, true, theme);
@@ -441,20 +436,21 @@ export class ExpandedToolIoView {
441
436
 
442
437
  if (hasInput) {
443
438
  this.truncated.input = inputWouldTruncate;
444
- pushHeader("├", "Input", "input", inputWouldTruncate);
439
+ pushHeader("├", "Input");
445
440
  pushBody(this.inputBody, {
446
441
  input: true,
447
442
  limit: this.maxInputLines,
448
443
  continued: true,
444
+ section: "input",
449
445
  });
450
446
  pushBlankRail();
451
447
  this.truncated.output = outputWouldTruncate;
452
- pushHeader("└", "Output", "output", outputWouldTruncate);
453
- pushBody(outputText, { limit: this.maxOutputLines, continued: false });
448
+ pushHeader("└", "Output");
449
+ pushBody(outputText, { limit: this.maxOutputLines, continued: false, section: "output" });
454
450
  } else {
455
451
  this.truncated.output = outputWouldTruncate;
456
- pushHeader("└", "Output", "output", outputWouldTruncate);
457
- pushBody(outputText, { limit: this.maxOutputLines, continued: false });
452
+ pushHeader("└", "Output");
453
+ pushBody(outputText, { limit: this.maxOutputLines, continued: false, section: "output" });
458
454
  }
459
455
 
460
456
  this.cachedWidth = width;
@@ -655,16 +651,24 @@ export function renderExpandedToolResult(
655
651
  ): ExpandedToolIoView | ExpandedToolResultText | Text {
656
652
  const inputBody = formatToolInputArgs(args);
657
653
  const outputBody = body;
658
- const maxLines = config.expandedPreviewMaxLines;
654
+ const maxOutputLines = config.expandedOutputMaxLines;
655
+ const maxInputLines = config.expandedInputMaxLines;
659
656
 
660
657
  // Prefer structured Input/Output when we have args or non-empty output.
661
658
  if (inputBody.trim() || outputBody.trim()) {
662
659
  let view: ExpandedToolIoView;
663
660
  if (isExpandedToolIoView(lastComponent)) {
664
- lastComponent.setContent(inputBody, outputBody, isError, maxLines, maxLines);
661
+ lastComponent.setContent(inputBody, outputBody, isError, maxOutputLines, maxInputLines);
665
662
  view = lastComponent;
666
663
  } else {
667
- view = new ExpandedToolIoView(theme, inputBody, outputBody, isError, maxLines, maxLines);
664
+ view = new ExpandedToolIoView(
665
+ theme,
666
+ inputBody,
667
+ outputBody,
668
+ isError,
669
+ maxOutputLines,
670
+ maxInputLines,
671
+ );
668
672
  }
669
673
  if (context) rememberIoView(context, view);
670
674
  return view;
@@ -701,7 +705,7 @@ function frameViewId(view: ExpandedToolIoView): number | null {
701
705
  function withIoViewMarkers(view: ExpandedToolIoView, lines: string[]): string[] {
702
706
  const id = frameViewId(view);
703
707
  if (id === null) return lines;
704
- // Mark by exact header row from render — never scan body text for Input/Output labels.
708
+ // Mark by exact recorded show-more row from render — never scan body text heuristically.
705
709
  const marked = lines.slice();
706
710
  for (const { section, line } of view.showMoreHeaderLineIndexes()) {
707
711
  if (line < 0 || line >= marked.length) continue;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-cc-extensions",
3
- "version": "0.8.60",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
6
6
  "type": "module",
@@ -69,8 +69,8 @@
69
69
  },
70
70
  "x-upstream": {
71
71
  "package": "pi-cc-extensions",
72
- "version": "0.8.68",
72
+ "version": "0.8.69",
73
73
  "repository": "https://github.com/minuque/pi-cc-extensions",
74
- "commit": "1ca144c8fa3f2b391fd76d008f0148e04bad14be"
74
+ "commit": "5d7a2666f51da9f450bd019af10200c88cc1df98"
75
75
  }
76
76
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-ask-user-question",
3
- "version": "2.8.0",
3
+ "version": "2.9.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",
@@ -94,7 +94,7 @@
94
94
  }
95
95
  },
96
96
  "dependencies": {
97
- "@juicesharp/rpiv-config": "^2.8.0",
97
+ "@juicesharp/rpiv-config": "^2.9.0",
98
98
  "typebox": "^1.1.24"
99
99
  }
100
100
  }
@@ -9,7 +9,7 @@ Only context you explicitly bring back is loaded into the main editor.
9
9
 
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
- - Supports scrollable answers, transcript search, follow-up questions, queued steering, and in-memory resume.
12
+ - Supports scrollable answers, transcript search, a clickable jump-to-latest control, follow-up questions, queued steering, and in-memory resume.
13
13
  - Keeps side questions and answers out of the main conversation by default.
14
14
  - Brings back the latest answer, a question suffix, an exact range, or the complete thread only when requested.
15
15
  - Uses Pi's current model and thinking level or saved pi-btw choices.
@@ -120,6 +120,9 @@ A failed response remains visible and does not discard later queued questions.
120
120
  Steering never appends to the main conversation or editor.
121
121
 
122
122
  Use the mouse wheel, trackpad, or `PgUp`/`PgDn` to scroll transcript history.
123
+ On Pi 0.85 or newer, scrolling away from a following transcript shows **Jump to latest message** over its final visible row.
124
+ Click the control or use Pi's effective `tui.altScreen.bottom` binding (`End` by default) to resume at the latest content.
125
+ The control disappears after the transcript returns to follow-end mode.
123
126
  The footer shows history keys only when scrolling is available.
124
127
  Ctrl+C cancels the active response and discards the current draft and steering queue.
125
128
  Completed questions, answers, and visible errors remain available through Resume until the extension instance ends.
@@ -216,6 +219,7 @@ The file is read for every `/btw` invocation, so edits apply without `/reload`.
216
219
  - Resume state is memory-only and lasts only for the current extension instance.
217
220
  - A side thread retains the latest 40,000 characters of main-conversation context and adds a truncation notice when earlier content is omitted.
218
221
  - Clipboard access depends on Pi's host helper, the operating system, and the terminal.
222
+ - Pi versions before 0.85 omit the clickable jump-to-latest control.
219
223
 
220
224
  ## 🗂️ Package layout
221
225
 
@@ -482,8 +482,10 @@ import {
482
482
  } from "@earendil-works/pi-coding-agent";
483
483
  import {
484
484
  isKeyRelease,
485
+ isKittyProtocolActive,
485
486
  Key as Key2,
486
487
  matchesKey as matchesKey2,
488
+ parseKey,
487
489
  TuiAltScreen,
488
490
  truncateToWidth as truncateToWidth2
489
491
  } from "@earendil-works/pi-tui";
@@ -495,6 +497,18 @@ function sanitizeSingleLine(text) {
495
497
  return code > 31 && (code < 127 || code > 159);
496
498
  }).join("").replace(/ +/gu, " ").trim();
497
499
  }
500
+ function formatKeyLabel2(key) {
501
+ const sanitized = sanitizeSingleLine(key);
502
+ if (!sanitized) return "";
503
+ return sanitized.split("+").map((part) => {
504
+ const lower = part.toLowerCase();
505
+ if (lower === "shift") return "Shift";
506
+ if (lower === "ctrl") return "Ctrl";
507
+ if (lower === "alt") return "Alt";
508
+ if (lower === "super") return "Super";
509
+ return part.length === 1 ? part.toUpperCase() : `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`;
510
+ }).join("+");
511
+ }
498
512
 
499
513
  // src/fullscreen-ui.ts
500
514
  var FullscreenUiDisposedError = class extends Error {
@@ -607,6 +621,88 @@ var BtwTuiAltScreen = class extends TuiAltScreen {
607
621
  };
608
622
  var BRACKETED_PASTE_START = "\x1B[200~";
609
623
  var BRACKETED_PASTE_END = "\x1B[201~";
624
+ var ALT_SCREEN_ACTIONS_BEFORE_BOTTOM = [
625
+ "tui.altScreen.search",
626
+ "tui.altScreen.searchNext",
627
+ "tui.altScreen.searchPrevious",
628
+ "tui.altScreen.searchClose",
629
+ "tui.altScreen.pageUp",
630
+ "tui.altScreen.pageDown",
631
+ "tui.altScreen.halfPageUp",
632
+ "tui.altScreen.halfPageDown",
633
+ "tui.altScreen.lineUp",
634
+ "tui.altScreen.lineDown",
635
+ "tui.altScreen.previousPrompt",
636
+ "tui.altScreen.nextPrompt",
637
+ "tui.altScreen.top"
638
+ ];
639
+ var KEY_MODIFIER_ORDER = ["shift", "ctrl", "alt", "super"];
640
+ var MATCHABLE_SPECIAL_KEYS = /* @__PURE__ */ new Set([
641
+ "space",
642
+ "tab",
643
+ "enter",
644
+ "backspace",
645
+ "delete",
646
+ "insert",
647
+ "home",
648
+ "end",
649
+ "pageup",
650
+ "pagedown",
651
+ "up",
652
+ "down",
653
+ "left",
654
+ "right"
655
+ ]);
656
+ var MATCHABLE_SYMBOL_KEYS = new Set("`-=[]\\;',./!@#$%^&*()_+|~{}:<>?");
657
+ function normalizedKeyId(key) {
658
+ const parts = key.toLowerCase().split("+");
659
+ const base = parts.at(-1);
660
+ if (!base) return "";
661
+ const normalizedBase = base === "esc" ? "escape" : base === "return" ? "enter" : base;
662
+ const modifiers = KEY_MODIFIER_ORDER.filter((modifier) => parts.includes(modifier));
663
+ return [...modifiers, normalizedBase].join("+");
664
+ }
665
+ function formatEffectiveKeyLabel(key) {
666
+ const parts = key.split("+");
667
+ const base = parts.at(-1);
668
+ if (base === "pageup") parts[parts.length - 1] = "pageUp";
669
+ if (base === "pagedown") parts[parts.length - 1] = "pageDown";
670
+ return formatKeyLabel2(parts.join("+"));
671
+ }
672
+ function canMatchKeyInput(key) {
673
+ const parts = key.split("+");
674
+ const base = parts.at(-1) ?? "";
675
+ const modifiers = parts.slice(0, -1);
676
+ if (base === "escape") return modifiers.length === 0;
677
+ if (base === "clear") {
678
+ return modifiers.length === 0 || modifiers.length === 1 && (modifiers[0] === "shift" || modifiers[0] === "ctrl");
679
+ }
680
+ if (/^f(?:[1-9]|1[0-2])$/u.test(base)) return modifiers.length === 0;
681
+ return MATCHABLE_SPECIAL_KEYS.has(base) || base.length === 1 && (/^[a-z0-9]$/u.test(base) || MATCHABLE_SYMBOL_KEYS.has(base));
682
+ }
683
+ function rawCtrlInput(base) {
684
+ if (base.length !== 1) return void 0;
685
+ const rawBase = base === "-" ? "_" : base;
686
+ if (!"abcdefghijklmnopqrstuvwxyz[\\]_".includes(rawBase)) return void 0;
687
+ return String.fromCharCode(rawBase.charCodeAt(0) & 31);
688
+ }
689
+ function legacyRawInput(key) {
690
+ const parts = key.split("+");
691
+ const base = parts.at(-1) ?? "";
692
+ if (parts.length === 2 && parts[0] === "ctrl") return rawCtrlInput(base);
693
+ if (isKittyProtocolActive()) return void 0;
694
+ if (parts.length === 2 && parts[0] === "alt" && base.length === 1) return `\x1B${base}`;
695
+ if (parts.length === 3 && parts[0] === "ctrl" && parts[1] === "alt") {
696
+ const input = rawCtrlInput(base);
697
+ return input ? `\x1B${input}` : void 0;
698
+ }
699
+ return void 0;
700
+ }
701
+ function keyInputIdentity(key) {
702
+ const identity = normalizedKeyId(key);
703
+ const input = legacyRawInput(identity);
704
+ return input ? normalizedKeyId(parseKey(input) ?? identity) : identity;
705
+ }
610
706
  function hasManualSelectionCopyApi() {
611
707
  return typeof TuiAltScreen.prototype.hasActiveSelection === "function" && typeof TuiAltScreen.prototype.copyActiveSelectionToClipboard === "function";
612
708
  }
@@ -625,6 +721,25 @@ function createBtwFullscreenTui(parent, theme, keybindings, copyOnSelect, manual
625
721
  mouse: true,
626
722
  copyOnSelect,
627
723
  searchMatchStyle: (text) => theme.underline(styleSearchMatch(text)),
724
+ scrollToEndIndicator: () => {
725
+ const unavailableKeyIdentities = /* @__PURE__ */ new Set([keyInputIdentity(Key2.ctrl("c"))]);
726
+ for (const action of ALT_SCREEN_ACTIONS_BEFORE_BOTTOM) {
727
+ for (const actionKey of keybindings.getKeys(action)) {
728
+ unavailableKeyIdentities.add(keyInputIdentity(String(actionKey)));
729
+ }
730
+ }
731
+ if (!copyOnSelect) {
732
+ for (const copyKey of keybindings.getKeys("app.message.copy")) {
733
+ unavailableKeyIdentities.add(keyInputIdentity(String(copyKey)));
734
+ }
735
+ }
736
+ const key = keybindings.getKeys("tui.altScreen.bottom").map((candidate) => keyInputIdentity(String(candidate))).find(
737
+ (identity) => identity && canMatchKeyInput(identity) && !unavailableKeyIdentities.has(identity) && formatEffectiveKeyLabel(identity)
738
+ );
739
+ const label = theme.fg("text", " \u2193 Jump to latest message");
740
+ const shortcut = key ? theme.fg("muted", ` \xB7 ${formatEffectiveKeyLabel(key)}`) : "";
741
+ return theme.bg("selectedBg", `${label}${shortcut} `);
742
+ },
628
743
  searchCurrentMatchStyle: (text) => theme.bold(theme.inverse(styleSearchMatch(text))),
629
744
  openUrl,
630
745
  copySelection: async (text) => {
@@ -693,9 +808,11 @@ var BtwFullscreenHost = class {
693
808
  disposed = false;
694
809
  finished = false;
695
810
  parentStopped = false;
696
- parentRestarted = false;
811
+ parentRestoreAttempted = false;
697
812
  fullscreenCreated = false;
698
813
  fullscreenStopped = false;
814
+ parentRestoreQueued = false;
815
+ parentRestorePromise;
699
816
  cleanupError;
700
817
  setParentOverlay(overlay) {
701
818
  this.parentOverlay = overlay;
@@ -728,7 +845,7 @@ var BtwFullscreenHost = class {
728
845
  try {
729
846
  this.hardCancelActiveCustom?.();
730
847
  } finally {
731
- this.restoreParent();
848
+ this.queueParentRestore();
732
849
  }
733
850
  return { consume: true };
734
851
  });
@@ -741,14 +858,33 @@ var BtwFullscreenHost = class {
741
858
  } catch (error) {
742
859
  this.cleanupError ??= error;
743
860
  }
744
- this.restoreParent();
861
+ if (this.parentRestorePromise) await this.parentRestorePromise;
862
+ else this.restoreParent();
745
863
  if (this.cleanupError !== void 0) outcome = { kind: "failed", error: this.cleanupError };
746
864
  this.finished = true;
747
865
  this.done(outcome);
748
866
  }
867
+ queueParentRestore() {
868
+ if (this.parentRestoreQueued || this.parentRestoreAttempted) return;
869
+ this.parentRestoreQueued = true;
870
+ this.parentRestorePromise = Promise.resolve().then(async () => {
871
+ try {
872
+ await this.fullscreen?.terminal.drainInput?.();
873
+ } catch (error) {
874
+ this.cleanupError ??= error;
875
+ }
876
+ this.parentRestoreQueued = false;
877
+ this.restoreParent();
878
+ });
879
+ }
749
880
  restoreParent() {
750
- this.removeHardCancelListener?.();
881
+ const removeHardCancelListener = this.removeHardCancelListener;
751
882
  this.removeHardCancelListener = void 0;
883
+ try {
884
+ removeHardCancelListener?.();
885
+ } catch (error) {
886
+ this.cleanupError ??= error;
887
+ }
752
888
  if (this.fullscreenCreated && !this.fullscreenStopped) {
753
889
  this.fullscreenStopped = true;
754
890
  try {
@@ -757,7 +893,7 @@ var BtwFullscreenHost = class {
757
893
  this.cleanupError ??= error;
758
894
  }
759
895
  }
760
- if (!this.parentStopped || this.parentRestarted) return;
896
+ if (!this.parentStopped || this.parentRestoreAttempted) return;
761
897
  const parentOverlay = this.parentOverlay;
762
898
  this.parentOverlay = void 0;
763
899
  try {
@@ -766,8 +902,8 @@ var BtwFullscreenHost = class {
766
902
  this.cleanupError ??= error;
767
903
  }
768
904
  try {
905
+ this.parentRestoreAttempted = true;
769
906
  this.parent.start();
770
- this.parentRestarted = true;
771
907
  this.parent.renderNow(false);
772
908
  } catch (error) {
773
909
  this.cleanupError ??= error;
@@ -2355,14 +2491,7 @@ function renderSideThreadHeader(width, theme, thinkingLevel) {
2355
2491
  return theme.fg("muted", `${title}${"\u2500".repeat(ruleWidth)}`);
2356
2492
  }
2357
2493
  function thinkingKeyLabel(keybindings) {
2358
- const key = sanitizeSingleLine(String(keybindings.getKeys("app.thinking.cycle")[0] ?? "shift+tab")) || "Shift+Tab";
2359
- return key.split("+").map((part) => {
2360
- const lower = part.toLowerCase();
2361
- if (lower === "shift") return "Shift";
2362
- if (lower === "ctrl") return "Ctrl";
2363
- if (lower === "alt") return "Alt";
2364
- return part.length === 1 ? part.toUpperCase() : `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`;
2365
- }).join("+");
2494
+ return formatKeyLabel2(String(keybindings.getKeys("app.thinking.cycle")[0] ?? "shift+tab")) || "Shift+Tab";
2366
2495
  }
2367
2496
  function fitComposerLayout(header, contentLines, footer, editorLines, availableRows, statusLines = []) {
2368
2497
  const lines = [header, ...contentLines, ...statusLines, footer, ...editorLines];