@herbertgao/pi-extensions 2026.10.10 → 2026.10.12
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 +13 -11
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/node_modules/@herbertgao/pi-agency/README.md +5 -3
- package/node_modules/@herbertgao/pi-agency/package.json +1 -1
- package/node_modules/@herbertgao/pi-agency/src/index.ts +51 -7
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +126 -42
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +24 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +69 -16
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
- package/node_modules/@herbertgao/pi-subagents/src/agent-color.ts +11 -2
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +10 -5
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +3 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +1 -1
- package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +1 -0
- package/node_modules/@herbertgao/sol-pi/README.md +8 -2
- package/node_modules/@herbertgao/sol-pi/agents-install.md +2 -2
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +28 -4
- package/node_modules/@herbertgao/sol-pi/docs/configuration.md +17 -4
- package/node_modules/@herbertgao/sol-pi/package.json +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +35 -25
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +95 -26
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +39 -2
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +24 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +12 -7
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +138 -130
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +88 -14
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +9 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +14 -5
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/shell-options.ts +22 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +11 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/answer-channel.ts +109 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +117 -71
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/startup-performance.md +83 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +74 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/events.ts +84 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/index.ts +10 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/reconcile.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +5 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +19 -19
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/i18n-bridge.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +10 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/row-intent.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/contract.ts +6 -6
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/focus.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +9 -9
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +5 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/external-answer.ts +125 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/validate-questionnaire.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/component-binding.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/option-list-view.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/markdown-content-cache.ts +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +5 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-layout-decider.ts +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +10 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/submit-picker.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/tab-bar.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/wrapping-select.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +9 -9
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/props-adapter.ts +8 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-components.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +10 -10
- package/node_modules/@narumitw/pi-btw/README.md +14 -5
- package/node_modules/@narumitw/pi-btw/dist/index.ts +1067 -557
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
- package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +277 -0
- package/node_modules/@narumitw/pi-btw/docs/native-appearance.md +857 -0
- package/node_modules/@narumitw/pi-btw/docs/workflows.md +34 -13
- package/node_modules/@narumitw/pi-btw/package.json +4 -4
- package/node_modules/@narumitw/pi-btw/src/btw.ts +152 -108
- package/node_modules/@narumitw/pi-btw/src/conversation-chrome.ts +93 -0
- package/node_modules/@narumitw/pi-btw/src/fullscreen-renderer.ts +329 -0
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +109 -309
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +101 -23
- package/node_modules/@narumitw/pi-btw/src/menu.ts +42 -27
- package/node_modules/@narumitw/pi-btw/src/session-lifetime.ts +66 -0
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +366 -164
- package/node_modules/@narumitw/pi-btw/src/workspace-layout.ts +96 -36
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1 -0
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +1 -0
- package/node_modules/pi-antigravity/README.md +6 -2
- package/node_modules/pi-antigravity/package.json +2 -2
- package/node_modules/pi-antigravity/src/client/client.ts +44 -52
- package/node_modules/pi-antigravity/src/index.ts +13 -0
- package/node_modules/pi-antigravity/src/models/discovery.ts +25 -2
- package/node_modules/pi-antigravity/src/models/grouping.ts +107 -68
- package/node_modules/pi-antigravity/src/models/models.ts +10 -0
- package/node_modules/pi-antigravity/src/search/search.ts +581 -43
- package/node_modules/pi-antigravity/src/stream/stream.ts +53 -13
- package/node_modules/pi-antigravity/src/types/types.ts +13 -0
- package/node_modules/pi-antigravity/src/usage/usage.ts +11 -3
- package/node_modules/pi-lens/CHANGELOG.md +281 -0
- package/node_modules/pi-lens/README.md +13 -1
- package/node_modules/pi-lens/dist/{chunk-SS36ZX4J.js → chunk-24AKHFGP.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-JSQFTSC6.js → chunk-2FN63LPV.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-5UCAH366.js → chunk-2KXTHF3M.js} +20 -20
- package/node_modules/pi-lens/dist/{chunk-EU63SDCG.js → chunk-3DA2JDOL.js} +367 -281
- package/node_modules/pi-lens/dist/{chunk-RWWYJ623.js → chunk-3KAZU3VR.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-3PTHXJXR.js +28 -0
- package/node_modules/pi-lens/dist/chunk-3QED2P4V.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-N2H3ZPZY.js → chunk-3RKP3FMS.js} +1 -0
- package/node_modules/pi-lens/dist/{chunk-XVF2VVXP.js → chunk-5HSRT26B.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-MXGY6KPT.js → chunk-5IUSNGOC.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-EJIUXPBX.js → chunk-5OFV52AM.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-AW7R2GWG.js → chunk-5VSF4UUQ.js} +12 -7
- package/node_modules/pi-lens/dist/{chunk-6STA6Z7I.js → chunk-5WRPDP2A.js} +18 -18
- package/node_modules/pi-lens/dist/{chunk-YIUAVF7E.js → chunk-6DLWKFEX.js} +35 -34
- package/node_modules/pi-lens/dist/{chunk-WOA4LN2R.js → chunk-7D6L4MTX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-GAEGEPOC.js → chunk-7HXE67BN.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-AGSS7277.js +84 -0
- package/node_modules/pi-lens/dist/{chunk-R3PCY3YS.js → chunk-AMERCH6V.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-WU567RSC.js → chunk-ATKJFDQN.js} +14 -10
- package/node_modules/pi-lens/dist/{chunk-VSSBEUFT.js → chunk-AWSCPCN2.js} +16 -16
- package/node_modules/pi-lens/dist/{chunk-VCHXCQFG.js → chunk-BWD5EPKO.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-H6MF6EVN.js → chunk-CT4MN5IU.js} +1200 -230
- package/node_modules/pi-lens/dist/{chunk-FCSOVF55.js → chunk-CUHSHSB6.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-CHOW74WE.js → chunk-CYRKQRPM.js} +7 -10
- package/node_modules/pi-lens/dist/{chunk-Q7DUK4LX.js → chunk-DEL2U6CM.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-6C7JWPCP.js → chunk-DGUKIYSI.js} +26 -23
- package/node_modules/pi-lens/dist/{chunk-PHDMFAKM.js → chunk-DUO2TU77.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-MRXKYPCS.js → chunk-EBC36LNN.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-CSHFH5IN.js → chunk-ED36RF6Y.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-76MWC2K6.js → chunk-EUXZEFTV.js} +90 -97
- package/node_modules/pi-lens/dist/{chunk-QOZXJ4NA.js → chunk-FM4RDMKT.js} +11 -8
- package/node_modules/pi-lens/dist/{chunk-ACXEQZOU.js → chunk-GAQ7OQG6.js} +31 -28
- package/node_modules/pi-lens/dist/{chunk-XAGLWMJ4.js → chunk-GL5LUMZE.js} +23 -23
- package/node_modules/pi-lens/dist/{chunk-BKE7E7TC.js → chunk-GMX5OS7B.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-ZHFZWTZV.js → chunk-GSLNCYGG.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-3W7IEVVL.js → chunk-GSM5UU7A.js} +26 -34
- package/node_modules/pi-lens/dist/{chunk-724UL2TJ.js → chunk-GXFV6MYU.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-HAD7QRQI.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-QOBUHWHX.js → chunk-HRNHZA3N.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-VWCXW2E7.js → chunk-HWCCCQNX.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-7DYBLXYA.js → chunk-HYGZEMX6.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-IJYGIDF4.js +186 -0
- package/node_modules/pi-lens/dist/{chunk-4W4VLAPJ.js → chunk-IQWN5JCP.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-SQ4TVJBR.js → chunk-IUE7SSKV.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-IBGIOBEE.js → chunk-IWDLU6K3.js} +68 -5
- package/node_modules/pi-lens/dist/{chunk-XCJN5IJU.js → chunk-IYNJ6YPZ.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-JAU72XNY.js → chunk-J64T55EI.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-2BBLFX75.js → chunk-J6MPGQTS.js} +5 -5
- package/node_modules/pi-lens/dist/chunk-JORED7EX.js +44 -0
- package/node_modules/pi-lens/dist/{chunk-6SDEP3AJ.js → chunk-JUKMK5Y4.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-FMSO6RDZ.js → chunk-JW3YWBVB.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-L3BLXZG7.js → chunk-KAPJINKN.js} +30 -69
- package/node_modules/pi-lens/dist/{chunk-2B73ZPOK.js → chunk-KN35K52N.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-C34ZXZ7O.js → chunk-KUA4OJ5Y.js} +24 -11
- package/node_modules/pi-lens/dist/chunk-KYUB6QDC.js +72 -0
- package/node_modules/pi-lens/dist/{chunk-67WMNWEE.js → chunk-LLJNQKQW.js} +12 -10
- package/node_modules/pi-lens/dist/chunk-LZSEQW6A.js +57 -0
- package/node_modules/pi-lens/dist/{chunk-ZANLILYD.js → chunk-M2IFVFWU.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-M2UD3LPU.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-XIJZVPD5.js → chunk-MBKQHGA7.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-P7266HLM.js → chunk-MPNJLASA.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6GFRNVYR.js → chunk-MZGQNL3Y.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-ZWFS3OEF.js → chunk-N5FLEO7W.js} +33 -32
- package/node_modules/pi-lens/dist/{chunk-3JNKMP3B.js → chunk-O4NWQT6I.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-T6CPIZNT.js → chunk-OHKJ7PQF.js} +33 -32
- package/node_modules/pi-lens/dist/{chunk-VRZP76YM.js → chunk-P63GXC37.js} +4 -1
- package/node_modules/pi-lens/dist/{chunk-XTMJ7XDT.js → chunk-POMLXPMY.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-QQNQ7SJW.js → chunk-QBFBRV2B.js} +10 -4
- package/node_modules/pi-lens/dist/{chunk-CMMHNUZ2.js → chunk-R3T7CLQ2.js} +60 -38
- package/node_modules/pi-lens/dist/{chunk-23WOO7TX.js → chunk-R7YOCSNV.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-2CD5RS6M.js → chunk-RKBXZN3A.js} +23 -2
- package/node_modules/pi-lens/dist/{chunk-OCAGUNBC.js → chunk-RKKOYPRA.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-52FUZI6K.js → chunk-RMLC67LF.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-XMSXXAHW.js → chunk-ROYSX2S5.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-M6HSLBWY.js → chunk-RVK72CZX.js} +6507 -7514
- package/node_modules/pi-lens/dist/{chunk-FLKWCIZH.js → chunk-S2HEXIWI.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-UZ3TUTRV.js → chunk-S67KYG37.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-VCO24T4L.js → chunk-SD4I7ZO4.js} +14 -14
- package/node_modules/pi-lens/dist/{chunk-Z527N6YQ.js → chunk-SKAMFC7A.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-MQLUAEOC.js → chunk-SRYEJNES.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-BRGDSBJE.js → chunk-SYE6T2EB.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-GXW6K4YJ.js → chunk-T57LYLZT.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ZXYDQ3TZ.js → chunk-T7FEBKXN.js} +48 -15
- package/node_modules/pi-lens/dist/{chunk-3EFKIGZN.js → chunk-TIQ2PKDW.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-QILIYSJF.js → chunk-TLX72JTG.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-TYM6OUIT.js → chunk-TOY6QKOH.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-IZSHAIJ7.js → chunk-TRETHTQO.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-3VPVG5SU.js → chunk-U44DJXQP.js} +10 -6
- package/node_modules/pi-lens/dist/{chunk-PNQDPDRC.js → chunk-UA7ZXYDR.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-OXXKQCSV.js → chunk-UBOQLVT2.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-QGQ5CCCG.js → chunk-UMS2MFPZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-QHJ6DQ2R.js → chunk-US7ECLD7.js} +55 -13
- package/node_modules/pi-lens/dist/{chunk-AB3YYG6N.js → chunk-UZ2XCLYS.js} +8 -8
- package/node_modules/pi-lens/dist/chunk-V35JG4JB.js +2667 -0
- package/node_modules/pi-lens/dist/{chunk-N3X6Q4YT.js → chunk-VOOAPROD.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-SAEFPSB6.js → chunk-W66O5E25.js} +21 -11
- package/node_modules/pi-lens/dist/{chunk-KBG47GHP.js → chunk-WMYE35PX.js} +15 -11
- package/node_modules/pi-lens/dist/{chunk-5NGR67U5.js → chunk-XBJVAEEO.js} +32 -5
- package/node_modules/pi-lens/dist/{chunk-YYOIQFRS.js → chunk-XHJBS436.js} +122 -44
- package/node_modules/pi-lens/dist/{chunk-GBPP5P7X.js → chunk-XTBDCR27.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-4UNXBNE2.js → chunk-XTFDJI3T.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-UXGETRP4.js → chunk-XYURS6EN.js} +13 -12
- package/node_modules/pi-lens/dist/{chunk-RPLINGVB.js → chunk-Y6GZHWSJ.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-2VUQMUMT.js → chunk-YCWYO6TQ.js} +41 -38
- package/node_modules/pi-lens/dist/{chunk-77M37OKR.js → chunk-YH5MVY2U.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-AOHZU2BM.js → chunk-YNE3RP52.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-YSZNHOBY.js → chunk-ZHH37KZL.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-ZGDGW2V3.js → chunk-ZIVJBOO3.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-RXCOMYPY.js → chunk-ZVUL7QYY.js} +29 -28
- package/node_modules/pi-lens/dist/index.js +11052 -5852
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -9
- package/node_modules/pi-lens/dist/mcp/cli.js +41 -38
- package/node_modules/pi-lens/dist/mcp/server.js +1120 -474
- package/node_modules/pi-lens/dist/mcp/worker.js +61 -58
- package/node_modules/pi-lens/dist/probes/installer.js +19 -19
- package/node_modules/pi-lens/dist/workers/project-snapshot-persist-worker.js +28 -9
- package/node_modules/pi-lens/dist/workers/review-graph-persist-worker.js +1 -1
- package/node_modules/pi-lens/docs/configuration.md +11 -0
- package/node_modules/pi-lens/docs/engineering-principles.md +32 -0
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +1 -1
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +15 -26
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +117 -13
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +97 -7
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +8 -2
- package/node_modules/pi-lens/docs/pi-lens-retro.md +4 -1
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +112 -4
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +22 -14
- package/node_modules/pi-lens/docs/release-qa-baseline.md +3 -1
- package/node_modules/pi-lens/docs/servercapabilities.md +9 -19
- package/node_modules/pi-lens/package.json +7 -5
- package/node_modules/pi-lens/scripts/download-grammars.js +40 -7
- package/node_modules/pi-lens/scripts/lib/latency-log-phases.mjs +95 -0
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +570 -81
- package/node_modules/pi-provider-qoder/dist/index.js +323 -154
- package/node_modules/pi-provider-qoder/package.json +1 -1
- package/node_modules/pi-web-access/CHANGELOG.md +60 -0
- package/node_modules/pi-web-access/README.md +96 -10
- package/node_modules/pi-web-access/anysearch.ts +4 -3
- package/node_modules/pi-web-access/bocha.ts +4 -3
- package/node_modules/pi-web-access/brightdata-unlocker.ts +3 -2
- package/node_modules/pi-web-access/brightdata.ts +4 -3
- package/node_modules/pi-web-access/ceramic.ts +3 -2
- package/node_modules/pi-web-access/credential-source.ts +54 -4
- package/node_modules/pi-web-access/curator-page.ts +5 -1
- package/node_modules/pi-web-access/curator-server.ts +2 -0
- package/node_modules/pi-web-access/deepseek.ts +377 -0
- package/node_modules/pi-web-access/dist/index.js +1463 -748
- package/node_modules/pi-web-access/dist/mcp-cli.js +1393 -717
- package/node_modules/pi-web-access/extract.ts +58 -6
- package/node_modules/pi-web-access/gemini-adc.ts +48 -1
- package/node_modules/pi-web-access/gemini-search.ts +33 -6
- package/node_modules/pi-web-access/index.ts +36 -4
- package/node_modules/pi-web-access/jina-search.ts +6 -4
- package/node_modules/pi-web-access/kagi.ts +5 -4
- package/node_modules/pi-web-access/keenable.ts +3 -2
- package/node_modules/pi-web-access/linkup.ts +170 -0
- package/node_modules/pi-web-access/mistral-search.ts +4 -3
- package/node_modules/pi-web-access/ollama.ts +5 -4
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/page-query.ts +12 -6
- package/node_modules/pi-web-access/parallel.ts +7 -7
- package/node_modules/pi-web-access/perplexity.ts +5 -3
- package/node_modules/pi-web-access/querit.ts +4 -3
- package/node_modules/pi-web-access/query-rewrite.ts +16 -13
- package/node_modules/pi-web-access/search1api.ts +4 -3
- package/node_modules/pi-web-access/searchinfinity.ts +4 -3
- package/node_modules/pi-web-access/serpapi.ts +7 -5
- package/node_modules/pi-web-access/serpbase.ts +5 -4
- package/node_modules/pi-web-access/serpdive.ts +4 -3
- package/node_modules/pi-web-access/serper.ts +6 -4
- package/node_modules/pi-web-access/serply.ts +3 -2
- package/node_modules/pi-web-access/summary-review.ts +16 -6
- package/node_modules/pi-web-access/utils.ts +27 -1
- package/node_modules/pi-web-access/valyu.ts +4 -3
- package/node_modules/pi-web-access/web-tool-core.ts +7 -0
- package/node_modules/pi-web-access/xai-search.ts +49 -7
- package/node_modules/pi-web-access/xcrawl.ts +4 -3
- package/node_modules/pi-web-access/you.ts +3 -2
- package/package.json +15 -15
- package/node_modules/pi-lens/dist/chunk-3YN6V5TV.js +0 -85
- package/node_modules/pi-lens/dist/chunk-466Z26MG.js +0 -30
- package/node_modules/pi-lens/dist/chunk-EC47DWFA.js +0 -56
- package/node_modules/pi-lens/dist/chunk-KDERNTCQ.js +0 -28
- package/node_modules/pi-lens/dist/chunk-KSX3TXSZ.js +0 -69
- package/node_modules/pi-lens/dist/chunk-LOP6GRPH.js +0 -31
- package/node_modules/pi-lens/dist/chunk-UOPVJQ4N.js +0 -103
- /package/node_modules/pi-lens/dist/{chunk-FC4RP4I2.js → chunk-6HWVI6MI.js} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Loader, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
|
+
import type { BtwThinkingLevel } from "./side-thread.js";
|
|
4
|
+
import { sanitizeSingleLine } from "./text.js";
|
|
5
|
+
|
|
6
|
+
/** Display-only identity, not a model/session runtime or a source of request options. */
|
|
7
|
+
export interface BtwDisplayModel {
|
|
8
|
+
id: string;
|
|
9
|
+
provider: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface BtwWorkspaceFocus {
|
|
13
|
+
pane: "side" | "main";
|
|
14
|
+
shortcutLabel: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Pi's status classes are not root exports. Use the public Loader extension
|
|
18
|
+
// points to supply the same border text without importing app-owned handlers.
|
|
19
|
+
export class BtwWorkingIndicator extends Loader {
|
|
20
|
+
renderInBorder(width: number): string {
|
|
21
|
+
const line = super.render(width + 2)[1] ?? "";
|
|
22
|
+
return truncateToWidth(line.startsWith(" ") ? line.slice(1).trimEnd() : line.trimEnd(), width, "");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
renderSpinnerInBorder(width: number): string {
|
|
26
|
+
return truncateToWidth(this.getRenderedIndicator(), width, "");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Native CustomEditor's border geometry, through public Editor/Loader hooks. */
|
|
31
|
+
export function renderWorkingBorder(
|
|
32
|
+
width: number,
|
|
33
|
+
hiddenLineCount: number,
|
|
34
|
+
borderColor: (text: string) => string,
|
|
35
|
+
status: BtwWorkingIndicator,
|
|
36
|
+
): string | undefined {
|
|
37
|
+
if (width <= 0) return "";
|
|
38
|
+
let label = status.renderInBorder(Math.max(1, width - 5));
|
|
39
|
+
let labelWidth = visibleWidth(label);
|
|
40
|
+
if (labelWidth === 0) return undefined;
|
|
41
|
+
const overflow = hiddenLineCount > 0 ? ` ↑ ${hiddenLineCount} more ` : undefined;
|
|
42
|
+
const overflowWidth = overflow ? visibleWidth(overflow) : 0;
|
|
43
|
+
const overflowStart = Math.floor((width - overflowWidth) / 2);
|
|
44
|
+
const fitsOverflow = () =>
|
|
45
|
+
overflow !== undefined && overflowWidth + 2 <= width && overflowStart - (3 + labelWidth + 1) >= 1;
|
|
46
|
+
if (overflow && !fitsOverflow()) {
|
|
47
|
+
label = status.renderSpinnerInBorder(width);
|
|
48
|
+
labelWidth = visibleWidth(label);
|
|
49
|
+
}
|
|
50
|
+
if (fitsOverflow()) {
|
|
51
|
+
const leftWidth = 3 + labelWidth + 1;
|
|
52
|
+
return (
|
|
53
|
+
borderColor("── ") +
|
|
54
|
+
label +
|
|
55
|
+
borderColor(
|
|
56
|
+
` ${"─".repeat(overflowStart - leftWidth)}${overflow}${"─".repeat(width - overflowStart - overflowWidth)}`,
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (width >= labelWidth + 5) {
|
|
61
|
+
return borderColor("── ") + label + borderColor(` ${"─".repeat(width - labelWidth - 4)}`);
|
|
62
|
+
}
|
|
63
|
+
label = status.renderSpinnerInBorder(width);
|
|
64
|
+
labelWidth = visibleWidth(label);
|
|
65
|
+
const prefix = Math.min(3, Math.max(0, width - labelWidth));
|
|
66
|
+
return borderColor("─".repeat(prefix)) + label + borderColor("─".repeat(Math.max(0, width - prefix - labelWidth)));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function renderConversationFooter(
|
|
70
|
+
width: number,
|
|
71
|
+
theme: Theme,
|
|
72
|
+
options: {
|
|
73
|
+
model?: BtwDisplayModel;
|
|
74
|
+
thinkingLevel?: BtwThinkingLevel;
|
|
75
|
+
focus?: BtwWorkspaceFocus;
|
|
76
|
+
hint: string;
|
|
77
|
+
warning?: boolean;
|
|
78
|
+
},
|
|
79
|
+
): string[] {
|
|
80
|
+
if (width < 3) return [];
|
|
81
|
+
const focus = options.focus ? `${options.focus.pane === "side" ? "BTW" : "Main"} focus` : undefined;
|
|
82
|
+
const left = focus && visibleWidth(`btw · ${focus}`) <= width ? `btw · ${focus}` : "btw";
|
|
83
|
+
const model = options.model ? sanitizeSingleLine(`${options.model.provider}/${options.model.id}`) : "";
|
|
84
|
+
const thinking = options.thinkingLevel ? `thinking ${options.thinkingLevel}` : "";
|
|
85
|
+
const right = [[model, thinking].filter(Boolean).join(" • "), thinking, model].find(
|
|
86
|
+
(value) => value && visibleWidth(left) + 2 + visibleWidth(value) <= width,
|
|
87
|
+
);
|
|
88
|
+
const identity = right ? `${left}${" ".repeat(width - visibleWidth(left) - visibleWidth(right))}${right}` : left;
|
|
89
|
+
return [
|
|
90
|
+
theme.fg("dim", identity),
|
|
91
|
+
...(options.hint ? [theme.fg(options.warning ? "warning" : "muted", options.hint)] : []),
|
|
92
|
+
];
|
|
93
|
+
}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import {
|
|
4
|
+
type Component,
|
|
5
|
+
isKeyRelease,
|
|
6
|
+
isKittyProtocolActive,
|
|
7
|
+
Key,
|
|
8
|
+
type KeybindingsManager,
|
|
9
|
+
parseKey,
|
|
10
|
+
type ScrollView,
|
|
11
|
+
type TUI,
|
|
12
|
+
TuiAltScreen,
|
|
13
|
+
type TuiInputListener,
|
|
14
|
+
type TuiInputListenerResult,
|
|
15
|
+
type TuiStopOptions,
|
|
16
|
+
} from "@earendil-works/pi-tui";
|
|
17
|
+
import { formatKeyLabel, sanitizeSingleLine } from "./text.js";
|
|
18
|
+
|
|
19
|
+
export type BtwFullscreenTui = TUI & {
|
|
20
|
+
flash?: (message: string, durationMs?: number) => void;
|
|
21
|
+
setLayoutRoot(component: Component | undefined): void;
|
|
22
|
+
hasFocusedOverlay?(): boolean;
|
|
23
|
+
addInputListenerBeforeAll?(listener: TuiInputListener): () => void;
|
|
24
|
+
addInputListenerBeforeViewport?(listener: TuiInputListener): () => void;
|
|
25
|
+
setViewportTarget?(scrollView: ScrollView | undefined): void;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type BtwInputListeners = {
|
|
29
|
+
beforeAll: Set<TuiInputListener>;
|
|
30
|
+
beforeViewport: Set<TuiInputListener>;
|
|
31
|
+
regular: Set<TuiInputListener>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const btwInputListeners = new WeakMap<BtwTuiAltScreen, BtwInputListeners>();
|
|
35
|
+
|
|
36
|
+
function dispatchBtwInput(listeners: BtwInputListeners, data: string): TuiInputListenerResult {
|
|
37
|
+
let current = data;
|
|
38
|
+
for (const group of [listeners.beforeAll, listeners.beforeViewport, listeners.regular]) {
|
|
39
|
+
for (const listener of group) {
|
|
40
|
+
const result = listener(current);
|
|
41
|
+
if (result?.consume) return result;
|
|
42
|
+
if (result?.data !== undefined) current = result.data;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return current === data ? undefined : { data: current };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class BtwTuiAltScreen extends TuiAltScreen {
|
|
49
|
+
private terminalActive = false;
|
|
50
|
+
|
|
51
|
+
protected override beforeTerminalStart(): void {
|
|
52
|
+
super.beforeTerminalStart();
|
|
53
|
+
this.terminalActive = true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected override beforeTerminalStop(options: TuiStopOptions): void {
|
|
57
|
+
this.terminalActive = false;
|
|
58
|
+
super.beforeTerminalStop(options);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
override flash(message: string, durationMs?: number): void {
|
|
62
|
+
// Native clipboard callbacks cannot be cancelled. A late result must not
|
|
63
|
+
// create flash timers or redraw the terminal after ownership has moved.
|
|
64
|
+
if (this.terminalActive) super.flash(message, durationMs);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
hasFocusedOverlay(): boolean {
|
|
68
|
+
return this.isOverlayFocused();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
setViewportTarget(scrollView: ScrollView | undefined): void {
|
|
72
|
+
const layout: unknown = Reflect.get(this, "currentLayout");
|
|
73
|
+
if (layout === undefined) return;
|
|
74
|
+
if (typeof layout !== "object" || layout === null || !Reflect.set(layout, "primaryScrollView", scrollView)) {
|
|
75
|
+
throw new Error("Pi BTW cannot route this fullscreen layout; update Pi.");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
override addInputListener(listener: TuiInputListener): () => void {
|
|
80
|
+
let listeners = btwInputListeners.get(this);
|
|
81
|
+
if (!listeners) {
|
|
82
|
+
const registeredListeners: BtwInputListeners = {
|
|
83
|
+
beforeAll: new Set(),
|
|
84
|
+
beforeViewport: new Set(),
|
|
85
|
+
regular: new Set(),
|
|
86
|
+
};
|
|
87
|
+
btwInputListeners.set(this, registeredListeners);
|
|
88
|
+
super.addInputListener((data) => dispatchBtwInput(registeredListeners, data));
|
|
89
|
+
listeners = registeredListeners;
|
|
90
|
+
}
|
|
91
|
+
listeners.regular.add(listener);
|
|
92
|
+
return () => listeners.regular.delete(listener);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
addInputListenerBeforeAll(listener: TuiInputListener): () => void {
|
|
96
|
+
const listeners = btwInputListeners.get(this);
|
|
97
|
+
if (!listeners) return super.addInputListener(listener);
|
|
98
|
+
listeners.beforeAll.add(listener);
|
|
99
|
+
return () => listeners.beforeAll.delete(listener);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
addInputListenerBeforeViewport(listener: TuiInputListener): () => void {
|
|
103
|
+
const listeners = btwInputListeners.get(this);
|
|
104
|
+
if (!listeners) return super.addInputListener(listener);
|
|
105
|
+
listeners.beforeViewport.add(listener);
|
|
106
|
+
return () => listeners.beforeViewport.delete(listener);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
override removeInputListener(listener: TuiInputListener): void {
|
|
110
|
+
const listeners = btwInputListeners.get(this);
|
|
111
|
+
if (!listeners) {
|
|
112
|
+
super.removeInputListener(listener);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
listeners.beforeAll.delete(listener);
|
|
116
|
+
listeners.beforeViewport.delete(listener);
|
|
117
|
+
listeners.regular.delete(listener);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const BRACKETED_PASTE_START = "\u001b[200~";
|
|
122
|
+
const BRACKETED_PASTE_END = "\u001b[201~";
|
|
123
|
+
|
|
124
|
+
// TuiAltScreen evaluates these actions before bottom, so shared keys cannot jump to latest.
|
|
125
|
+
const ALT_SCREEN_ACTIONS_BEFORE_BOTTOM = [
|
|
126
|
+
"tui.altScreen.search",
|
|
127
|
+
"tui.altScreen.searchNext",
|
|
128
|
+
"tui.altScreen.searchPrevious",
|
|
129
|
+
"tui.altScreen.searchClose",
|
|
130
|
+
"tui.altScreen.pageUp",
|
|
131
|
+
"tui.altScreen.pageDown",
|
|
132
|
+
"tui.altScreen.halfPageUp",
|
|
133
|
+
"tui.altScreen.halfPageDown",
|
|
134
|
+
"tui.altScreen.lineUp",
|
|
135
|
+
"tui.altScreen.lineDown",
|
|
136
|
+
"tui.altScreen.previousPrompt",
|
|
137
|
+
"tui.altScreen.nextPrompt",
|
|
138
|
+
"tui.altScreen.top",
|
|
139
|
+
] as const;
|
|
140
|
+
const KEY_MODIFIER_ORDER = ["shift", "ctrl", "alt", "super"] as const;
|
|
141
|
+
const MATCHABLE_SPECIAL_KEYS = new Set([
|
|
142
|
+
"space",
|
|
143
|
+
"tab",
|
|
144
|
+
"enter",
|
|
145
|
+
"backspace",
|
|
146
|
+
"delete",
|
|
147
|
+
"insert",
|
|
148
|
+
"home",
|
|
149
|
+
"end",
|
|
150
|
+
"pageup",
|
|
151
|
+
"pagedown",
|
|
152
|
+
"up",
|
|
153
|
+
"down",
|
|
154
|
+
"left",
|
|
155
|
+
"right",
|
|
156
|
+
]);
|
|
157
|
+
const MATCHABLE_SYMBOL_KEYS = new Set("`-=[]\\;',./!@#$%^&*()_+|~{}:<>?");
|
|
158
|
+
|
|
159
|
+
function normalizedKeyId(key: string): string {
|
|
160
|
+
const parts = key.toLowerCase().split("+");
|
|
161
|
+
const base = parts.at(-1);
|
|
162
|
+
if (!base) return "";
|
|
163
|
+
const configuredModifiers = parts.slice(0, -1);
|
|
164
|
+
if (
|
|
165
|
+
new Set(configuredModifiers).size !== configuredModifiers.length ||
|
|
166
|
+
configuredModifiers.some((modifier) => !KEY_MODIFIER_ORDER.includes(modifier as never))
|
|
167
|
+
)
|
|
168
|
+
return "";
|
|
169
|
+
const normalizedBase = base === "esc" ? "escape" : base === "return" ? "enter" : base;
|
|
170
|
+
const modifiers = KEY_MODIFIER_ORDER.filter((modifier) => parts.includes(modifier));
|
|
171
|
+
return [...modifiers, normalizedBase].join("+");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function formatEffectiveKeyLabel(key: string): string {
|
|
175
|
+
const parts = key.split("+");
|
|
176
|
+
const base = parts.at(-1);
|
|
177
|
+
if (base === "pageup") parts[parts.length - 1] = "pageUp";
|
|
178
|
+
if (base === "pagedown") parts[parts.length - 1] = "pageDown";
|
|
179
|
+
return formatKeyLabel(parts.join("+"));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function canMatchKeyInput(key: string): boolean {
|
|
183
|
+
const parts = key.split("+");
|
|
184
|
+
const base = parts.at(-1) ?? "";
|
|
185
|
+
const modifiers = parts.slice(0, -1);
|
|
186
|
+
if (base === "escape") return modifiers.length === 0;
|
|
187
|
+
if (base === "clear") {
|
|
188
|
+
return modifiers.length === 0 || (modifiers.length === 1 && (modifiers[0] === "shift" || modifiers[0] === "ctrl"));
|
|
189
|
+
}
|
|
190
|
+
if (/^f(?:[1-9]|1[0-2])$/u.test(base)) return modifiers.length === 0;
|
|
191
|
+
return (
|
|
192
|
+
MATCHABLE_SPECIAL_KEYS.has(base) ||
|
|
193
|
+
(base.length === 1 && (/^[a-z0-9]$/u.test(base) || MATCHABLE_SYMBOL_KEYS.has(base)))
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function rawCtrlInput(base: string): string | undefined {
|
|
198
|
+
if (base.length !== 1) return undefined;
|
|
199
|
+
const rawBase = base === "-" ? "_" : base;
|
|
200
|
+
if (!"abcdefghijklmnopqrstuvwxyz[\\]_".includes(rawBase)) return undefined;
|
|
201
|
+
return String.fromCharCode(rawBase.charCodeAt(0) & 0x1f);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function legacyRawInput(key: string): string | undefined {
|
|
205
|
+
const parts = key.split("+");
|
|
206
|
+
const base = parts.at(-1) ?? "";
|
|
207
|
+
if (parts.length === 2 && parts[0] === "ctrl") return rawCtrlInput(base);
|
|
208
|
+
if (isKittyProtocolActive()) return undefined;
|
|
209
|
+
if (parts.length === 2 && parts[0] === "alt" && base.length === 1) return `\u001b${base}`;
|
|
210
|
+
if (parts.length === 3 && parts[0] === "ctrl" && parts[1] === "alt") {
|
|
211
|
+
const input = rawCtrlInput(base);
|
|
212
|
+
return input ? `\u001b${input}` : undefined;
|
|
213
|
+
}
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Mirror matchesKey(), using parseKey() to canonicalize IDs that share legacy raw input.
|
|
218
|
+
function keyInputIdentity(key: string): string {
|
|
219
|
+
const identity = normalizedKeyId(key);
|
|
220
|
+
const input = legacyRawInput(identity);
|
|
221
|
+
return input ? normalizedKeyId(parseKey(input) ?? identity) : identity;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function hasManualSelectionCopyApi(): boolean {
|
|
225
|
+
return (
|
|
226
|
+
typeof TuiAltScreen.prototype.hasActiveSelection === "function" &&
|
|
227
|
+
typeof TuiAltScreen.prototype.copyActiveSelectionToClipboard === "function"
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function createBtwFullscreenTui(
|
|
232
|
+
parent: TUI,
|
|
233
|
+
theme: Theme,
|
|
234
|
+
keybindings: KeybindingsManager,
|
|
235
|
+
copyOnSelect: boolean,
|
|
236
|
+
manualSelectionCopySupported: boolean,
|
|
237
|
+
openUrl: (url: string) => void,
|
|
238
|
+
copyToClipboard: (text: string) => Promise<void>,
|
|
239
|
+
): BtwFullscreenTui {
|
|
240
|
+
if (!copyOnSelect && !manualSelectionCopySupported) {
|
|
241
|
+
throw new Error(
|
|
242
|
+
"Manual fullscreen selection copying is unavailable in this Pi version; update Pi or enable automatic selection copying.",
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
const styleSearchMatch = (text: string) => theme.bg("searchMatchBg", theme.fg("searchMatchText", text));
|
|
246
|
+
const fullscreen = new BtwTuiAltScreen(parent.terminal, parent.getShowHardwareCursor(), undefined, {
|
|
247
|
+
mouse: true,
|
|
248
|
+
wheelScrollLines: "auto",
|
|
249
|
+
copyOnSelect,
|
|
250
|
+
searchMatchStyle: (text) => theme.underline(styleSearchMatch(text)),
|
|
251
|
+
scrollToEndIndicator: () => {
|
|
252
|
+
const unavailableKeyIdentities = new Set<string>([keyInputIdentity(Key.ctrl("c"))]);
|
|
253
|
+
for (const action of ALT_SCREEN_ACTIONS_BEFORE_BOTTOM) {
|
|
254
|
+
for (const actionKey of keybindings.getKeys(action)) {
|
|
255
|
+
unavailableKeyIdentities.add(keyInputIdentity(String(actionKey)));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (!copyOnSelect) {
|
|
259
|
+
for (const copyKey of keybindings.getKeys("app.message.copy")) {
|
|
260
|
+
unavailableKeyIdentities.add(keyInputIdentity(String(copyKey)));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const key = keybindings
|
|
264
|
+
.getKeys("tui.altScreen.bottom")
|
|
265
|
+
.map((candidate) => keyInputIdentity(String(candidate)))
|
|
266
|
+
.find(
|
|
267
|
+
(identity) =>
|
|
268
|
+
identity &&
|
|
269
|
+
canMatchKeyInput(identity) &&
|
|
270
|
+
!unavailableKeyIdentities.has(identity) &&
|
|
271
|
+
formatEffectiveKeyLabel(identity),
|
|
272
|
+
);
|
|
273
|
+
const label = theme.fg("text", " ↓ Jump to latest message");
|
|
274
|
+
const shortcut = key ? theme.fg("muted", ` · ${formatEffectiveKeyLabel(key)}`) : "";
|
|
275
|
+
return theme.bg("selectedBg", `${label}${shortcut} `);
|
|
276
|
+
},
|
|
277
|
+
searchCurrentMatchStyle: (text) => theme.bold(theme.inverse(styleSearchMatch(text))),
|
|
278
|
+
searchNavigationButtonStyle: (text, hovered) => (hovered ? theme.underline(text) : text),
|
|
279
|
+
openUrl,
|
|
280
|
+
copySelection: async (text) => {
|
|
281
|
+
try {
|
|
282
|
+
await copyToClipboard(text);
|
|
283
|
+
return true;
|
|
284
|
+
} catch (error) {
|
|
285
|
+
return sanitizeSingleLine(error instanceof Error ? error.message : String(error)) || "Copy failed";
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
if (!copyOnSelect) {
|
|
290
|
+
let isInBracketedPaste = false;
|
|
291
|
+
fullscreen.addInputListenerBeforeViewport((data) => {
|
|
292
|
+
const wasInBracketedPaste = isInBracketedPaste;
|
|
293
|
+
const startsBracketedPaste = data.includes(BRACKETED_PASTE_START);
|
|
294
|
+
if (startsBracketedPaste) isInBracketedPaste = true;
|
|
295
|
+
if (isInBracketedPaste && data.includes(BRACKETED_PASTE_END)) {
|
|
296
|
+
isInBracketedPaste = false;
|
|
297
|
+
}
|
|
298
|
+
if (
|
|
299
|
+
wasInBracketedPaste ||
|
|
300
|
+
startsBracketedPaste ||
|
|
301
|
+
fullscreen.hasFocusedOverlay() ||
|
|
302
|
+
isKeyRelease(data) ||
|
|
303
|
+
!keybindings.matches(data, "app.message.copy")
|
|
304
|
+
) {
|
|
305
|
+
return undefined;
|
|
306
|
+
}
|
|
307
|
+
if (!fullscreen.hasActiveSelection()) {
|
|
308
|
+
fullscreen.flash("No selection to copy");
|
|
309
|
+
return { consume: true };
|
|
310
|
+
}
|
|
311
|
+
void fullscreen.copyActiveSelectionToClipboard().catch(() => fullscreen.flash("Copy failed"));
|
|
312
|
+
return { consume: true };
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
return fullscreen;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Pi does not export its browser opener, so mirror its shell-free launcher for this isolated TUI.
|
|
319
|
+
export function openUrlInBrowser(target: string): void {
|
|
320
|
+
const [command, args] =
|
|
321
|
+
process.platform === "darwin"
|
|
322
|
+
? ["open", [target]]
|
|
323
|
+
: process.platform === "win32"
|
|
324
|
+
? ["rundll32", ["url.dll,FileProtocolHandler", target]]
|
|
325
|
+
: ["xdg-open", [target]];
|
|
326
|
+
spawn(command, args, { stdio: "ignore", detached: true })
|
|
327
|
+
.on("error", () => {})
|
|
328
|
+
.unref();
|
|
329
|
+
}
|