@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
|
@@ -23,6 +23,11 @@ export const ASK_USER_PROMPT_EVENT = "rpiv:ask-user:prompt" as const;
|
|
|
23
23
|
|
|
24
24
|
export interface AskUserPromptEventPayload {
|
|
25
25
|
questions: ReadonlyArray<AskUserPromptQuestion>;
|
|
26
|
+
/**
|
|
27
|
+
* The tool call's id — always set. Names this questionnaire on
|
|
28
|
+
* `ASK_USER_BLOCKED_EVENT` and `ASK_USER_ANSWER_EVENT`.
|
|
29
|
+
*/
|
|
30
|
+
toolCallId?: string;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
/**
|
|
@@ -35,6 +40,11 @@ export const ASK_USER_BLOCKED_EVENT = "rpiv:ask-user:blocked" as const;
|
|
|
35
40
|
export interface AskUserBlockedEventPayload {
|
|
36
41
|
/** True while input is awaited; false when the wait ends (answer, cancel, or error). */
|
|
37
42
|
active: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The tool call's id — always set. Several questionnaires can be open at once,
|
|
45
|
+
* so pair `active: false` with the prompt it closes by this id.
|
|
46
|
+
*/
|
|
47
|
+
toolCallId?: string;
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
export interface AskUserPromptQuestion {
|
|
@@ -57,3 +67,77 @@ export interface AskUserPromptOption {
|
|
|
57
67
|
/** True iff the option carries rich preview content (content not shipped). */
|
|
58
68
|
hasPreview: boolean;
|
|
59
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* INBOUND — the only event in this contract the package listens for rather than
|
|
73
|
+
* emits. Answers (or cancels) one open questionnaire without the TUI keystroke
|
|
74
|
+
* path, so a program driving Pi from outside — a pane supervisor, a phone or web
|
|
75
|
+
* bridge, a test harness — need not synthesize keys against a rendered dialog.
|
|
76
|
+
*
|
|
77
|
+
* `toolCallId` names the questionnaire: the id carried by its
|
|
78
|
+
* `ASK_USER_PROMPT_EVENT`. It is accepted from the moment that prompt is emitted
|
|
79
|
+
* (before the dialog is on screen) until the questionnaire closes; the first
|
|
80
|
+
* answer wins, whether typed in the terminal or sent here.
|
|
81
|
+
*
|
|
82
|
+
* Validation is strict and all-or-nothing: every question answered, every index
|
|
83
|
+
* in range, nothing duplicated — or nothing is applied and the dialog stays open.
|
|
84
|
+
* A partially applied answer would reach the model indistinguishable from one
|
|
85
|
+
* the user gave. Unknown fields are ignored (policy rule 2).
|
|
86
|
+
*
|
|
87
|
+
* Every attempt gets one verdict on `ASK_USER_ANSWER_RESULT_EVENT`; this payload
|
|
88
|
+
* carries no callback because payloads must survive JSON serialization.
|
|
89
|
+
*/
|
|
90
|
+
export const ASK_USER_ANSWER_EVENT = "rpiv:ask-user:answer" as const;
|
|
91
|
+
|
|
92
|
+
export interface AskUserAnswerEventPayload {
|
|
93
|
+
/** The questionnaire to answer — `toolCallId` from its prompt event. */
|
|
94
|
+
toolCallId: string;
|
|
95
|
+
/** Echoed back on the verdict so an emitter can pair it with this request. */
|
|
96
|
+
requestId?: string;
|
|
97
|
+
/** One entry per question. Omitted (or empty) only with `cancel`. */
|
|
98
|
+
answers?: ReadonlyArray<AskUserAnswerEntry>;
|
|
99
|
+
/** Note for the whole questionnaire — what `n` on the Submit tab attaches in the TUI. */
|
|
100
|
+
globalNote?: string;
|
|
101
|
+
/** Decline the questionnaire, as Esc does: the model is told the user declined. */
|
|
102
|
+
cancel?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* One question's answer. Single-select takes exactly one of `optionIndexes`
|
|
107
|
+
* (one index) or `text`; multi-select takes either or both, like the TUI's
|
|
108
|
+
* checked options plus its `Type something.` row.
|
|
109
|
+
*/
|
|
110
|
+
export interface AskUserAnswerEntry {
|
|
111
|
+
/** 0-based index into the prompt's `questions`. */
|
|
112
|
+
questionIndex: number;
|
|
113
|
+
/** 0-based, distinct indices into the question's `options`. */
|
|
114
|
+
optionIndexes?: readonly number[];
|
|
115
|
+
/** Custom answer — what the `Type something.` row produces. Must not be blank. */
|
|
116
|
+
text?: string;
|
|
117
|
+
/** Note on this question — what the `n` key attaches in the TUI. */
|
|
118
|
+
notes?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Verdict for an `ASK_USER_ANSWER_EVENT`. One per attempt, accepted or not. */
|
|
122
|
+
export const ASK_USER_ANSWER_RESULT_EVENT = "rpiv:ask-user:answer-result" as const;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Why an answer was refused — branch on this, not on `reason`:
|
|
126
|
+
* - `not_found`: no open questionnaire has that `toolCallId` (never opened, or already closed).
|
|
127
|
+
* - `invalid_payload`: a field is missing or has the wrong type.
|
|
128
|
+
* - `invalid_answer`: well-formed, but does not fit the questions (missing, duplicated, out of range).
|
|
129
|
+
* - `unsupported_host`: the questionnaire runs in an RPC host's own dialogs, which cannot be answered here.
|
|
130
|
+
*/
|
|
131
|
+
export type AskUserAnswerRejectCode = "not_found" | "invalid_payload" | "invalid_answer" | "unsupported_host";
|
|
132
|
+
|
|
133
|
+
export interface AskUserAnswerResultEventPayload {
|
|
134
|
+
ok: boolean;
|
|
135
|
+
/** Set when `ok` is false. */
|
|
136
|
+
code?: AskUserAnswerRejectCode;
|
|
137
|
+
/** Human-readable detail for logs. Wording may change — do not parse it. */
|
|
138
|
+
reason?: string;
|
|
139
|
+
/** Echoed from the request when it was a string. */
|
|
140
|
+
requestId?: string;
|
|
141
|
+
/** Echoed from the request when it was a string. */
|
|
142
|
+
toolCallId?: string;
|
|
143
|
+
}
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
20
|
-
import { registerAskUserQuestionTool } from "./ask-user-question.
|
|
21
|
-
import { registerAskUserQuestionReconciler } from "./reconcile.
|
|
22
|
-
import { I18N_NAMESPACE } from "./state/i18n-bridge.
|
|
20
|
+
import { registerAskUserQuestionTool } from "./ask-user-question.ts";
|
|
21
|
+
import { registerAskUserQuestionReconciler } from "./reconcile.ts";
|
|
22
|
+
import { I18N_NAMESPACE } from "./state/i18n-bridge.ts";
|
|
23
23
|
|
|
24
24
|
type I18nLoader = {
|
|
25
25
|
registerLocalesFromDir: (namespace: string, packageUrl: string, options?: { label?: string }) => void;
|
|
@@ -40,13 +40,19 @@ try {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export {
|
|
43
|
+
ASK_USER_ANSWER_EVENT,
|
|
44
|
+
ASK_USER_ANSWER_RESULT_EVENT,
|
|
43
45
|
ASK_USER_BLOCKED_EVENT,
|
|
44
46
|
ASK_USER_PROMPT_EVENT,
|
|
47
|
+
type AskUserAnswerEntry,
|
|
48
|
+
type AskUserAnswerEventPayload,
|
|
49
|
+
type AskUserAnswerRejectCode,
|
|
50
|
+
type AskUserAnswerResultEventPayload,
|
|
45
51
|
type AskUserBlockedEventPayload,
|
|
46
52
|
type AskUserPromptEventPayload,
|
|
47
53
|
type AskUserPromptOption,
|
|
48
54
|
type AskUserPromptQuestion,
|
|
49
|
-
} from "./events.
|
|
55
|
+
} from "./events.ts";
|
|
50
56
|
|
|
51
57
|
export default function (pi: ExtensionAPI) {
|
|
52
58
|
registerAskUserQuestionTool(pi);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-ask-user-question",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.9",
|
|
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",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"test": "vitest run"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
|
+
"answer-channel.ts",
|
|
33
34
|
"ask-user-question.ts",
|
|
34
35
|
"rpc-fallback.ts",
|
|
35
36
|
"config.ts",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"state/selectors/projections.ts",
|
|
57
58
|
"state/state-reducer.ts",
|
|
58
59
|
"state/state.ts",
|
|
60
|
+
"tool/external-answer.ts",
|
|
59
61
|
"tool/format-answer.ts",
|
|
60
62
|
"tool/normalize-params.ts",
|
|
61
63
|
"tool/response-envelope.ts",
|
|
@@ -99,6 +101,6 @@
|
|
|
99
101
|
}
|
|
100
102
|
},
|
|
101
103
|
"dependencies": {
|
|
102
|
-
"@juicesharp/rpiv-config": "^2.13.
|
|
104
|
+
"@juicesharp/rpiv-config": "^2.13.9"
|
|
103
105
|
}
|
|
104
106
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
18
|
-
import { ASK_USER_QUESTION_TOOL_NAME } from "./ask-user-question.
|
|
18
|
+
import { ASK_USER_QUESTION_TOOL_NAME } from "./ask-user-question.ts";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Strip-or-restore `ask_user_question` to match `ctx.hasUI`. Reads the active
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* option numbers, custom text, or both separated by a semicolon.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { displayLabel, t } from "./state/i18n-bridge.
|
|
22
|
-
import type { QuestionAnswer, QuestionData, QuestionnaireResult, QuestionParams } from "./tool/types.
|
|
21
|
+
import { displayLabel, t } from "./state/i18n-bridge.ts";
|
|
22
|
+
import type { QuestionAnswer, QuestionData, QuestionnaireResult, QuestionParams } from "./tool/types.ts";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Canonical-English fallbacks; resolved through `t()` at dialog time so the
|
|
@@ -136,12 +136,13 @@ async function askSingleSelect(
|
|
|
136
136
|
preview: o.preview && o.preview.length > 0 ? o.preview : undefined,
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
// "Type something." sentinel → free-text follow-up; cancelling it
|
|
139
|
+
// "Type something." sentinel → free-text follow-up; cancelling it, or a blank reply (#301),
|
|
140
|
+
// goes back to the options.
|
|
140
141
|
const typed = await ui.input(
|
|
141
142
|
`${header}${q.question}\n\n${q.options.map(formatOptionLine).join("\n")}\n\n${t("rpc.custom_answer_title", CUSTOM_ANSWER_TITLE)}`,
|
|
142
143
|
"",
|
|
143
144
|
);
|
|
144
|
-
if (typed == null) continue;
|
|
145
|
+
if (typed == null || typed.trim().length === 0) continue;
|
|
145
146
|
return { questionIndex, question: q.question, kind: "custom", answer: typed };
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { getMarkdownTheme, type Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { Editor, type EditorTheme, type TUI } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { QuestionData } from "../tool/types.
|
|
3
|
+
import type { QuestionData } from "../tool/types.ts";
|
|
4
4
|
import {
|
|
5
5
|
type BoundGlobalBinding,
|
|
6
6
|
type BoundPerTabBinding,
|
|
7
7
|
globalBinding,
|
|
8
8
|
perTabBinding,
|
|
9
|
-
} from "../view/component-binding.
|
|
10
|
-
import { MultiSelectView } from "../view/components/multi-select-view.
|
|
11
|
-
import { OptionListView } from "../view/components/option-list-view.
|
|
12
|
-
import { PreviewBlockRenderer } from "../view/components/preview/preview-block-renderer.
|
|
13
|
-
import { crossTabLeftWidthWithDonation } from "../view/components/preview/preview-layout-decider.
|
|
14
|
-
import type { PreviewPaneProps } from "../view/components/preview/preview-pane.
|
|
15
|
-
import { PreviewPane } from "../view/components/preview/preview-pane.
|
|
16
|
-
import { SubmitPicker } from "../view/components/submit-picker.
|
|
17
|
-
import { TabBar } from "../view/components/tab-bar.
|
|
18
|
-
import type { WrappingSelectItem, WrappingSelectTheme } from "../view/components/wrapping-select.
|
|
19
|
-
import { DialogView } from "../view/dialog-builder.
|
|
20
|
-
import { QuestionnairePropsAdapter } from "../view/props-adapter.
|
|
21
|
-
import type { StatefulView } from "../view/stateful-view.
|
|
22
|
-
import type { TabBodyHeights, TabComponents } from "../view/tab-components.
|
|
23
|
-
import type { PerTabSelector } from "./selectors/contract.
|
|
24
|
-
import { selectActivePreviewPaneIndex } from "./selectors/derivations.
|
|
9
|
+
} from "../view/component-binding.ts";
|
|
10
|
+
import { MultiSelectView } from "../view/components/multi-select-view.ts";
|
|
11
|
+
import { OptionListView } from "../view/components/option-list-view.ts";
|
|
12
|
+
import { PreviewBlockRenderer } from "../view/components/preview/preview-block-renderer.ts";
|
|
13
|
+
import { crossTabLeftWidthWithDonation } from "../view/components/preview/preview-layout-decider.ts";
|
|
14
|
+
import type { PreviewPaneProps } from "../view/components/preview/preview-pane.ts";
|
|
15
|
+
import { PreviewPane } from "../view/components/preview/preview-pane.ts";
|
|
16
|
+
import { SubmitPicker } from "../view/components/submit-picker.ts";
|
|
17
|
+
import { TabBar } from "../view/components/tab-bar.ts";
|
|
18
|
+
import type { WrappingSelectItem, WrappingSelectTheme } from "../view/components/wrapping-select.ts";
|
|
19
|
+
import { DialogView } from "../view/dialog-builder.ts";
|
|
20
|
+
import { QuestionnairePropsAdapter } from "../view/props-adapter.ts";
|
|
21
|
+
import type { StatefulView } from "../view/stateful-view.ts";
|
|
22
|
+
import type { TabBodyHeights, TabComponents } from "../view/tab-components.ts";
|
|
23
|
+
import type { PerTabSelector } from "./selectors/contract.ts";
|
|
24
|
+
import { selectActivePreviewPaneIndex } from "./selectors/derivations.ts";
|
|
25
25
|
import {
|
|
26
26
|
selectDialogProps,
|
|
27
27
|
selectMultiSelectProps,
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
selectPreviewPaneProps,
|
|
30
30
|
selectSubmitPickerProps,
|
|
31
31
|
selectTabBarProps,
|
|
32
|
-
} from "./selectors/projections.
|
|
33
|
-
import type { QuestionnaireState } from "./state.
|
|
32
|
+
} from "./selectors/projections.ts";
|
|
33
|
+
import type { QuestionnaireState } from "./state.ts";
|
|
34
34
|
|
|
35
35
|
export interface QuestionnaireBuildConfig {
|
|
36
36
|
tui: TUI;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* the canonical `ROW_INTENT_META[kind].label`, never `displayLabel(kind)`.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import { ROW_INTENT_META, type SentinelKind } from "./row-intent.
|
|
23
|
+
import { ROW_INTENT_META, type SentinelKind } from "./row-intent.ts";
|
|
24
24
|
|
|
25
25
|
export const I18N_NAMESPACE = "@juicesharp/rpiv-ask-user-question";
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Key, matchesKey } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { QuestionAnswer } from "../tool/types.
|
|
3
|
-
import { ROW_INTENT_META } from "./row-intent.
|
|
4
|
-
import type { QuestionnaireRuntime, QuestionnaireState } from "./state.
|
|
2
|
+
import type { QuestionAnswer } from "../tool/types.ts";
|
|
3
|
+
import { ROW_INTENT_META } from "./row-intent.ts";
|
|
4
|
+
import type { QuestionnaireRuntime, QuestionnaireState } from "./state.ts";
|
|
5
5
|
|
|
6
6
|
const KEYBIND_UP = "tui.select.up";
|
|
7
7
|
const KEYBIND_DOWN = "tui.select.down";
|
|
@@ -80,12 +80,15 @@ function buildSingleSelectAnswer(state: QuestionnaireState, runtime: Questionnai
|
|
|
80
80
|
const item = runtime.currentItem;
|
|
81
81
|
|
|
82
82
|
if (state.inputMode) {
|
|
83
|
+
// A blank draft is not an answer (#301): Enter stays on the row instead of recording
|
|
84
|
+
// an empty custom answer. Skipping a question is the Submit tab's `unanswered:` path.
|
|
83
85
|
const label = runtime.inputBuffer;
|
|
86
|
+
if (label.trim().length === 0) return null;
|
|
84
87
|
return {
|
|
85
88
|
questionIndex: state.currentTab,
|
|
86
89
|
question: q.question,
|
|
87
90
|
kind: "custom",
|
|
88
|
-
answer: label
|
|
91
|
+
answer: label,
|
|
89
92
|
};
|
|
90
93
|
}
|
|
91
94
|
if (!item) return null;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { Editor, OverlayHandle, TUI } from "@earendil-works/pi-tui";
|
|
3
|
-
import { COLLAPSE_KEY_OFF, formatKeySpecForDisplay } from "../config.
|
|
4
|
-
import type { QuestionData, QuestionnaireResult, QuestionParams } from "../tool/types.
|
|
5
|
-
import type { WrappingSelectItem } from "../view/components/wrapping-select.
|
|
6
|
-
import { COLLAPSED_HINT_TEMPLATE, HINT_PART_CANCEL, KEY_PLACEHOLDER } from "../view/dialog-builder.
|
|
7
|
-
import type { QuestionnairePropsAdapter } from "../view/props-adapter.
|
|
8
|
-
import { buildQuestionnaire, type QuestionnaireBuilt } from "./build-questionnaire.
|
|
9
|
-
import { t } from "./i18n-bridge.
|
|
10
|
-
import { type QuestionnaireAction, routeKey } from "./key-router.
|
|
11
|
-
import type { QuestionnaireRuntime, QuestionnaireState } from "./state.
|
|
12
|
-
import { type ApplyContext, type Effect, reduce } from "./state-reducer.
|
|
3
|
+
import { COLLAPSE_KEY_OFF, formatKeySpecForDisplay } from "../config.ts";
|
|
4
|
+
import type { QuestionData, QuestionnaireResult, QuestionParams } from "../tool/types.ts";
|
|
5
|
+
import type { WrappingSelectItem } from "../view/components/wrapping-select.ts";
|
|
6
|
+
import { COLLAPSED_HINT_TEMPLATE, HINT_PART_CANCEL, KEY_PLACEHOLDER } from "../view/dialog-builder.ts";
|
|
7
|
+
import type { QuestionnairePropsAdapter } from "../view/props-adapter.ts";
|
|
8
|
+
import { buildQuestionnaire, type QuestionnaireBuilt } from "./build-questionnaire.ts";
|
|
9
|
+
import { t } from "./i18n-bridge.ts";
|
|
10
|
+
import { type QuestionnaireAction, routeKey } from "./key-router.ts";
|
|
11
|
+
import type { QuestionnaireRuntime, QuestionnaireState } from "./state.ts";
|
|
12
|
+
import { type ApplyContext, type Effect, reduce } from "./state-reducer.ts";
|
|
13
13
|
|
|
14
14
|
export interface QuestionnaireSessionConfig {
|
|
15
15
|
tui: TUI;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QuestionData } from "../tool/types.
|
|
2
|
-
import type { WrappingSelectItem } from "../view/components/wrapping-select.
|
|
1
|
+
import type { QuestionData } from "../tool/types.ts";
|
|
2
|
+
import type { WrappingSelectItem } from "../view/components/wrapping-select.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Row kind discriminator. Single source of truth — derived from the runtime
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { QuestionData } from "../../tool/types.
|
|
2
|
-
import type { PreviewPaneProps } from "../../view/components/preview/preview-pane.
|
|
3
|
-
import type { WrappingSelectItem } from "../../view/components/wrapping-select.
|
|
4
|
-
import type { ActiveView, StatefulView } from "../../view/stateful-view.
|
|
5
|
-
import type { TabComponents } from "../../view/tab-components.
|
|
6
|
-
import type { QuestionnaireState } from "../state.
|
|
1
|
+
import type { QuestionData } from "../../tool/types.ts";
|
|
2
|
+
import type { PreviewPaneProps } from "../../view/components/preview/preview-pane.ts";
|
|
3
|
+
import type { WrappingSelectItem } from "../../view/components/wrapping-select.ts";
|
|
4
|
+
import type { ActiveView, StatefulView } from "../../view/stateful-view.ts";
|
|
5
|
+
import type { TabComponents } from "../../view/tab-components.ts";
|
|
6
|
+
import type { QuestionnaireState } from "../state.ts";
|
|
7
7
|
|
|
8
8
|
export interface BindingContext {
|
|
9
9
|
readonly questions: readonly QuestionData[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QuestionAnswer, QuestionData } from "../../tool/types.
|
|
2
|
-
import type { WrappingSelectItem } from "../../view/components/wrapping-select.
|
|
1
|
+
import type { QuestionAnswer, QuestionData } from "../../tool/types.ts";
|
|
2
|
+
import type { WrappingSelectItem } from "../../view/components/wrapping-select.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Which row in the active tab should be marked as "previously confirmed"? Drives the
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { MULTI_SUBMIT_LABEL, type MultiSelectViewProps } from "../../view/components/multi-select-view.
|
|
2
|
-
import type { OptionListViewProps } from "../../view/components/option-list-view.
|
|
3
|
-
import type { PreviewPaneProps } from "../../view/components/preview/preview-pane.
|
|
4
|
-
import type { SubmitPickerProps } from "../../view/components/submit-picker.
|
|
5
|
-
import type { TabBarProps } from "../../view/components/tab-bar.
|
|
6
|
-
import type { DialogProps } from "../../view/dialog-builder.
|
|
7
|
-
import { displayLabel } from "../i18n-bridge.
|
|
8
|
-
import type { GlobalSelector, PerTabBindingContext, PerTabSelector } from "./contract.
|
|
9
|
-
import { selectConfirmedIndicator, selectSavedNote } from "./derivations.
|
|
1
|
+
import { MULTI_SUBMIT_LABEL, type MultiSelectViewProps } from "../../view/components/multi-select-view.ts";
|
|
2
|
+
import type { OptionListViewProps } from "../../view/components/option-list-view.ts";
|
|
3
|
+
import type { PreviewPaneProps } from "../../view/components/preview/preview-pane.ts";
|
|
4
|
+
import type { SubmitPickerProps } from "../../view/components/submit-picker.ts";
|
|
5
|
+
import type { TabBarProps } from "../../view/components/tab-bar.ts";
|
|
6
|
+
import type { DialogProps } from "../../view/dialog-builder.ts";
|
|
7
|
+
import { displayLabel } from "../i18n-bridge.ts";
|
|
8
|
+
import type { GlobalSelector, PerTabBindingContext, PerTabSelector } from "./contract.ts";
|
|
9
|
+
import { selectConfirmedIndicator, selectSavedNote } from "./derivations.ts";
|
|
10
10
|
|
|
11
11
|
function emptyMultiSelectProps(ctx: PerTabBindingContext): MultiSelectViewProps {
|
|
12
12
|
return {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { QuestionAnswer, QuestionData, QuestionnaireResult } from "../tool/types.
|
|
2
|
-
import type { WrappingSelectItem } from "../view/components/wrapping-select.
|
|
3
|
-
import type { QuestionnaireAction } from "./key-router.
|
|
4
|
-
import { ROW_INTENT_META } from "./row-intent.
|
|
5
|
-
import type { QuestionnaireState } from "./state.
|
|
1
|
+
import type { QuestionAnswer, QuestionData, QuestionnaireResult } from "../tool/types.ts";
|
|
2
|
+
import type { WrappingSelectItem } from "../view/components/wrapping-select.ts";
|
|
3
|
+
import type { QuestionnaireAction } from "./key-router.ts";
|
|
4
|
+
import { ROW_INTENT_META } from "./row-intent.ts";
|
|
5
|
+
import type { QuestionnaireState } from "./state.ts";
|
|
6
6
|
|
|
7
7
|
/** Session-lifetime constants. No live-component reads — peripheral values live on canonical state. */
|
|
8
8
|
export interface ApplyContext {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QuestionAnswer, QuestionData } from "../tool/types.
|
|
2
|
-
import type { WrappingSelectItem } from "../view/components/wrapping-select.
|
|
1
|
+
import type { QuestionAnswer, QuestionData } from "../tool/types.ts";
|
|
2
|
+
import type { WrappingSelectItem } from "../view/components/wrapping-select.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Canonical state for the questionnaire dialog. Single source of truth — both the
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { AskUserAnswerRejectCode } from "../events.ts";
|
|
2
|
+
import type { QuestionAnswer, QuestionData, QuestionnaireResult } from "./types.ts";
|
|
3
|
+
|
|
4
|
+
export type ExternalAnswerOutcome =
|
|
5
|
+
| { ok: true; result: QuestionnaireResult }
|
|
6
|
+
| { ok: false; code: AskUserAnswerRejectCode; reason: string };
|
|
7
|
+
|
|
8
|
+
const reject = (code: AskUserAnswerRejectCode, reason: string): ExternalAnswerOutcome => ({ ok: false, code, reason });
|
|
9
|
+
|
|
10
|
+
const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
11
|
+
|
|
12
|
+
/** A note as the TUI stores it: trimmed, and absent when blank (`notesExitHandler`). */
|
|
13
|
+
function noteOf(v: string | undefined): string | undefined {
|
|
14
|
+
const trimmed = v?.trim();
|
|
15
|
+
return trimmed ? trimmed : undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Turn an inbound `rpiv:ask-user:answer` payload (`AskUserAnswerEventPayload`, still
|
|
20
|
+
* untrusted) into the `QuestionnaireResult` the dialog would have produced. Pure of
|
|
21
|
+
* `(questions, payload)`. Answers are shaped as the reducer shapes them — preview
|
|
22
|
+
* attached to a picked single-select option, multi-select labels in authored order
|
|
23
|
+
* with custom text in `answer`, notes trimmed — so the envelope and `details` are the
|
|
24
|
+
* same whether the user typed or a program answered.
|
|
25
|
+
*
|
|
26
|
+
* Strict by design: the contract can be relaxed later without breaking emitters,
|
|
27
|
+
* never tightened. `invalid_payload` is a wrong shape or type, `invalid_answer` a
|
|
28
|
+
* well-formed answer that does not fit these questions.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveExternalAnswer(
|
|
31
|
+
questions: readonly QuestionData[],
|
|
32
|
+
payload: Record<string, unknown>,
|
|
33
|
+
): ExternalAnswerOutcome {
|
|
34
|
+
const { answers, globalNote, cancel } = payload;
|
|
35
|
+
if (cancel !== undefined && typeof cancel !== "boolean")
|
|
36
|
+
return reject("invalid_payload", "cancel must be a boolean");
|
|
37
|
+
if (globalNote !== undefined && typeof globalNote !== "string") {
|
|
38
|
+
return reject("invalid_payload", "globalNote must be a string");
|
|
39
|
+
}
|
|
40
|
+
const note = noteOf(globalNote);
|
|
41
|
+
const withNote = note ? { globalNote: note } : {};
|
|
42
|
+
|
|
43
|
+
if (cancel === true) {
|
|
44
|
+
if (answers !== undefined && !(Array.isArray(answers) && answers.length === 0)) {
|
|
45
|
+
return reject("invalid_payload", "cancel takes no answers");
|
|
46
|
+
}
|
|
47
|
+
return { ok: true, result: { answers: [], cancelled: true, ...withNote } };
|
|
48
|
+
}
|
|
49
|
+
if (!Array.isArray(answers)) return reject("invalid_payload", "answers must be an array");
|
|
50
|
+
|
|
51
|
+
const byQuestion = new Map<number, Record<string, unknown>>();
|
|
52
|
+
for (const entry of answers) {
|
|
53
|
+
if (!isRecord(entry)) return reject("invalid_payload", "each answer must be an object");
|
|
54
|
+
const index = entry.questionIndex;
|
|
55
|
+
if (!Number.isInteger(index)) return reject("invalid_payload", "questionIndex must be an integer");
|
|
56
|
+
const i = index as number;
|
|
57
|
+
if (i < 0 || i >= questions.length) {
|
|
58
|
+
return reject("invalid_answer", `questionIndex ${i} out of range (0..${questions.length - 1})`);
|
|
59
|
+
}
|
|
60
|
+
if (byQuestion.has(i)) return reject("invalid_answer", `question ${i} answered twice`);
|
|
61
|
+
byQuestion.set(i, entry);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const resolved: QuestionAnswer[] = [];
|
|
65
|
+
for (let i = 0; i < questions.length; i++) {
|
|
66
|
+
const entry = byQuestion.get(i);
|
|
67
|
+
if (!entry) return reject("invalid_answer", `no answer for question ${i} ("${questions[i]!.header}")`);
|
|
68
|
+
const answer = resolveEntry(questions[i]!, i, entry);
|
|
69
|
+
if (!answer.ok) return answer;
|
|
70
|
+
resolved.push(answer.answer);
|
|
71
|
+
}
|
|
72
|
+
return { ok: true, result: { answers: resolved, cancelled: false, ...withNote } };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function resolveEntry(
|
|
76
|
+
q: QuestionData,
|
|
77
|
+
i: number,
|
|
78
|
+
entry: Record<string, unknown>,
|
|
79
|
+
): { ok: true; answer: QuestionAnswer } | Extract<ExternalAnswerOutcome, { ok: false }> {
|
|
80
|
+
const { optionIndexes, text, notes } = entry;
|
|
81
|
+
if (optionIndexes !== undefined && (!Array.isArray(optionIndexes) || !optionIndexes.every(Number.isInteger))) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
code: "invalid_payload",
|
|
85
|
+
reason: `question ${i}: optionIndexes must be an array of integers`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (text !== undefined && typeof text !== "string") {
|
|
89
|
+
return { ok: false, code: "invalid_payload", reason: `question ${i}: text must be a string` };
|
|
90
|
+
}
|
|
91
|
+
if (notes !== undefined && typeof notes !== "string") {
|
|
92
|
+
return { ok: false, code: "invalid_payload", reason: `question ${i}: notes must be a string` };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const invalid = (reason: string) => ({
|
|
96
|
+
ok: false as const,
|
|
97
|
+
code: "invalid_answer" as const,
|
|
98
|
+
reason: `question ${i}: ${reason}`,
|
|
99
|
+
});
|
|
100
|
+
const picked = (optionIndexes ?? []) as number[];
|
|
101
|
+
const out = picked.find((n) => n < 0 || n >= q.options.length);
|
|
102
|
+
if (out !== undefined) return invalid(`option index ${out} out of range (0..${q.options.length - 1})`);
|
|
103
|
+
if (new Set(picked).size !== picked.length) return invalid("option index repeated");
|
|
104
|
+
if (text !== undefined && text.trim().length === 0) return invalid("text is blank");
|
|
105
|
+
if (picked.length === 0 && text === undefined) return invalid("needs optionIndexes or text");
|
|
106
|
+
|
|
107
|
+
const base = { questionIndex: i, question: q.question };
|
|
108
|
+
const note = noteOf(notes as string | undefined);
|
|
109
|
+
const withNote = note ? { notes: note } : {};
|
|
110
|
+
|
|
111
|
+
if (q.multiSelect) {
|
|
112
|
+
const selected = q.options.filter((_o, n) => picked.includes(n)).map((o) => o.label);
|
|
113
|
+
return {
|
|
114
|
+
ok: true,
|
|
115
|
+
answer: { ...base, kind: "multi", answer: (text as string | undefined) ?? null, selected, ...withNote },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (picked.length > 0 && text !== undefined) return invalid("single-select takes optionIndexes or text, not both");
|
|
119
|
+
if (picked.length > 1) return invalid(`single-select takes one option, got ${picked.length}`);
|
|
120
|
+
if (text !== undefined)
|
|
121
|
+
return { ok: true, answer: { ...base, kind: "custom", answer: text as string, ...withNote } };
|
|
122
|
+
const option = q.options[picked[0]!]!;
|
|
123
|
+
const withPreview = option.preview && option.preview.length > 0 ? { preview: option.preview } : {};
|
|
124
|
+
return { ok: true, answer: { ...base, kind: "option", answer: option.label, ...withPreview, ...withNote } };
|
|
125
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { formatAnswerScalar } from "./format-answer.
|
|
2
|
-
import type { QuestionAnswer, QuestionnaireResult, QuestionParams } from "./types.
|
|
1
|
+
import { formatAnswerScalar } from "./format-answer.ts";
|
|
2
|
+
import type { QuestionAnswer, QuestionnaireResult, QuestionParams } from "./types.ts";
|
|
3
3
|
|
|
4
4
|
export const DECLINE_MESSAGE = "User declined to answer questions";
|
|
5
5
|
export const ENVELOPE_PREFIX = "User has answered your questions:";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_QUESTIONS, MIN_OPTIONS, type QuestionnaireError, type QuestionParams, RESERVED_LABELS } from "./types.
|
|
1
|
+
import { MAX_QUESTIONS, MIN_OPTIONS, type QuestionnaireError, type QuestionParams, RESERVED_LABELS } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
export const ERROR_NO_QUESTIONS = "Error: At least one question is required";
|
|
4
4
|
export const ERROR_TOO_MANY_QUESTIONS = `Error: At most ${MAX_QUESTIONS} questions are allowed per invocation`;
|
|
@@ -3,10 +3,10 @@ import type {
|
|
|
3
3
|
GlobalSelector,
|
|
4
4
|
PerTabBindingContext,
|
|
5
5
|
PerTabSelector,
|
|
6
|
-
} from "../state/selectors/contract.
|
|
7
|
-
import type { QuestionnaireState } from "../state/state.
|
|
8
|
-
import type { StatefulView } from "./stateful-view.
|
|
9
|
-
import type { TabComponents } from "./tab-components.
|
|
6
|
+
} from "../state/selectors/contract.ts";
|
|
7
|
+
import type { QuestionnaireState } from "../state/state.ts";
|
|
8
|
+
import type { StatefulView } from "./stateful-view.ts";
|
|
9
|
+
import type { TabComponents } from "./tab-components.ts";
|
|
10
10
|
|
|
11
11
|
export interface ComponentBinding<P> {
|
|
12
12
|
readonly component: StatefulView<P>;
|
package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
3
|
-
import { displayLabel } from "../../state/i18n-bridge.
|
|
4
|
-
import type { QuestionData } from "../../tool/types.
|
|
5
|
-
import type { StatefulView } from "../stateful-view.
|
|
6
|
-
import { renderInlineInputRow } from "./inline-input.
|
|
3
|
+
import { displayLabel } from "../../state/i18n-bridge.ts";
|
|
4
|
+
import type { QuestionData } from "../../tool/types.ts";
|
|
5
|
+
import type { StatefulView } from "../stateful-view.ts";
|
|
6
|
+
import { renderInlineInputRow } from "./inline-input.ts";
|
|
7
7
|
|
|
8
8
|
const ACTIVE_POINTER = "❯ ";
|
|
9
9
|
const INACTIVE_POINTER = " ";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StatefulView } from "../stateful-view.
|
|
2
|
-
import { WrappingSelect, type WrappingSelectItem, type WrappingSelectTheme } from "./wrapping-select.
|
|
1
|
+
import type { StatefulView } from "../stateful-view.ts";
|
|
2
|
+
import { WrappingSelect, type WrappingSelectItem, type WrappingSelectTheme } from "./wrapping-select.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Maximum number of option rows visible in the WrappingSelect window. Lifted here from
|