@herbertgao/pi-extensions 2026.10.6 → 2026.10.8
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 +11 -15
- package/THIRD_PARTY_NOTICES.md +2 -54
- package/extensions/clef-format.mjs +113 -0
- package/extensions/clef.mjs +112 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +1 -1
- package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail.mjs +30 -6
- package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
- package/node_modules/@dietrichgebert/ponytail/README.md +5 -1
- package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +3 -3
- package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +4 -4
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +158 -127
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-config.js +5 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-map.js +8 -3
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-runtime.js +14 -8
- package/node_modules/@dietrichgebert/ponytail/package.json +1 -1
- package/node_modules/@dietrichgebert/ponytail/pi-extension/index.js +16 -3
- package/node_modules/@dietrichgebert/ponytail/scripts/cursor-hooks.js +13 -3
- package/node_modules/@dietrichgebert/ponytail/scripts/uninstall.js +3 -2
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +3 -3
- package/node_modules/@herbertgao/pi-agency/package.json +2 -2
- package/node_modules/@herbertgao/pi-bark/package.json +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +29 -28
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +7 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +16 -27
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +49 -48
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +2 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +228 -141
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/reference/index.ts +2 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer-layout.ts +105 -23
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +59 -43
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +96 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +6 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +124 -54
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +7 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +69 -28
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +23 -8
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +24 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +121 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-limits.ts +3 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-palette.ts +39 -8
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-presentation.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +13 -13
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/message-display.ts +3 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +49 -49
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +24 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-state.ts +51 -2
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +5 -5
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark.json +71 -70
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json +71 -70
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
- package/node_modules/@herbertgao/pi-subagents/docs/packages.md +211 -0
- package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +61 -63
- package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +24 -16
- package/node_modules/@herbertgao/pi-subagents/package.json +5 -5
- package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +51 -14
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +123 -55
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +144 -13
- package/node_modules/@herbertgao/pi-subagents/src/agent-source-badge.ts +78 -0
- package/node_modules/@herbertgao/pi-subagents/src/completion-outbox.ts +122 -0
- package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +171 -79
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +597 -296
- package/node_modules/@herbertgao/pi-subagents/src/package-resources.ts +724 -0
- package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +1 -1
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +66 -0
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +26 -4
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +2 -0
- package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +354 -32
- package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +33 -15
- package/node_modules/@herbertgao/pi-subagents/src/workflow/host.ts +6 -0
- package/node_modules/@herbertgao/pi-subagents/src/workflow/saved.ts +48 -2
- package/node_modules/@herbertgao/sol-pi/package.json +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +89 -39
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +56 -23
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +6 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/de.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/es.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/fr.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt-BR.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/ru.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/uk.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +5 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +122 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +73 -36
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +10 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +15 -13
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +5 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +15 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +4 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +29 -18
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +5 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +46 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +19 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +9 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +56 -25
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +131 -46
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +94 -106
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +51 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/scroll-window.ts +73 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +31 -10
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +474 -93
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
- package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
- package/node_modules/@tifan/pi-inline-skills/package.json +5 -1
- package/node_modules/@tifan/pi-inline-skills/src/index.ts +5 -2
- package/node_modules/pi-lens/CHANGELOG.md +88 -0
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -1
- package/node_modules/pi-lens/dist/{chunk-BJF25SUG.js → chunk-23WOO7TX.js} +11 -10
- package/node_modules/pi-lens/dist/{chunk-WATC3IQR.js → chunk-2B73ZPOK.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-N2IRDBZI.js → chunk-2BBLFX75.js} +101 -11
- package/node_modules/pi-lens/dist/{chunk-TA5L5KWQ.js → chunk-2CD5RS6M.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-3TTPKMEF.js → chunk-2VUQMUMT.js} +38 -37
- package/node_modules/pi-lens/dist/{chunk-5JHXUETW.js → chunk-3EFKIGZN.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-3JNKMP3B.js +17 -0
- package/node_modules/pi-lens/dist/{chunk-6P54TMWL.js → chunk-3VPVG5SU.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-ZETYB3XG.js → chunk-3W7IEVVL.js} +44 -28
- package/node_modules/pi-lens/dist/chunk-3YN6V5TV.js +85 -0
- package/node_modules/pi-lens/dist/chunk-466Z26MG.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-PCHDGUKT.js → chunk-4UNXBNE2.js} +12 -11
- package/node_modules/pi-lens/dist/{chunk-J7WJZ6W7.js → chunk-4W4VLAPJ.js} +12 -11
- package/node_modules/pi-lens/dist/{chunk-F5VLZHUW.js → chunk-52FUZI6K.js} +4 -2
- package/node_modules/pi-lens/dist/{chunk-H5EV3VMF.js → chunk-5NGR67U5.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-CBD2B5CP.js → chunk-5UCAH366.js} +21 -20
- package/node_modules/pi-lens/dist/{chunk-BHWHXMQ2.js → chunk-67WMNWEE.js} +9 -8
- package/node_modules/pi-lens/dist/{chunk-USHG4DLH.js → chunk-6C7JWPCP.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-VPWKF3GN.js → chunk-6GFRNVYR.js} +11 -10
- package/node_modules/pi-lens/dist/{chunk-3JL6IFD7.js → chunk-6SDEP3AJ.js} +9 -8
- package/node_modules/pi-lens/dist/{chunk-NJF2X5XF.js → chunk-6STA6Z7I.js} +19 -17
- package/node_modules/pi-lens/dist/{chunk-KJCWXUUS.js → chunk-724UL2TJ.js} +6 -4
- package/node_modules/pi-lens/dist/{chunk-MQA2YBAH.js → chunk-76MWC2K6.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-YLN4K6WD.js → chunk-77M37OKR.js} +10 -8
- package/node_modules/pi-lens/dist/{chunk-XHSCVSOL.js → chunk-7DYBLXYA.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-OC7LYAU5.js → chunk-AB3YYG6N.js} +24 -10
- package/node_modules/pi-lens/dist/{chunk-LD7WFTRX.js → chunk-ACXEQZOU.js} +16 -16
- package/node_modules/pi-lens/dist/{chunk-VSMJK3ZJ.js → chunk-AOHZU2BM.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-T4QZ6FEH.js → chunk-AW7R2GWG.js} +65 -8
- package/node_modules/pi-lens/dist/{chunk-GAYGGICG.js → chunk-BKE7E7TC.js} +10 -9
- package/node_modules/pi-lens/dist/{chunk-EUT3B22Y.js → chunk-BRGDSBJE.js} +13 -12
- package/node_modules/pi-lens/dist/{chunk-T54VJRAD.js → chunk-C34ZXZ7O.js} +55 -11
- package/node_modules/pi-lens/dist/{chunk-UGSMCQ4D.js → chunk-CHOW74WE.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-H2W2AXD3.js → chunk-CMMHNUZ2.js} +66 -58
- package/node_modules/pi-lens/dist/chunk-CSHFH5IN.js +17 -0
- package/node_modules/pi-lens/dist/chunk-EC47DWFA.js +56 -0
- package/node_modules/pi-lens/dist/{chunk-KJN4IOEJ.js → chunk-EJIUXPBX.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-IQZXOZ7S.js → chunk-EU63SDCG.js} +720 -334
- package/node_modules/pi-lens/dist/{chunk-LNOMA3MP.js → chunk-FCSOVF55.js} +107 -3
- package/node_modules/pi-lens/dist/{chunk-CFYISHUW.js → chunk-FLKWCIZH.js} +8 -5
- package/node_modules/pi-lens/dist/{chunk-OYTMZXRF.js → chunk-FMSO6RDZ.js} +16 -14
- package/node_modules/pi-lens/dist/{chunk-IUKPRZER.js → chunk-GAEGEPOC.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6XX5HCLK.js → chunk-GBPP5P7X.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-TQFBZVCG.js → chunk-GXW6K4YJ.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ZZUFZUQZ.js → chunk-H6MF6EVN.js} +331 -107
- package/node_modules/pi-lens/dist/{chunk-3JSEWUWI.js → chunk-IBGIOBEE.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-IZSHAIJ7.js +26 -0
- package/node_modules/pi-lens/dist/{chunk-7ELY2CSM.js → chunk-JAU72XNY.js} +16 -14
- package/node_modules/pi-lens/dist/chunk-JMYYOTQG.js +77 -0
- package/node_modules/pi-lens/dist/{chunk-ELVWJYRV.js → chunk-JSQFTSC6.js} +12 -11
- package/node_modules/pi-lens/dist/{chunk-J6DFZDFA.js → chunk-KBG47GHP.js} +4 -4
- package/node_modules/pi-lens/dist/chunk-KDERNTCQ.js +28 -0
- package/node_modules/pi-lens/dist/chunk-KSX3TXSZ.js +69 -0
- package/node_modules/pi-lens/dist/{chunk-XGUL4SLQ.js → chunk-L3BLXZG7.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-LOP6GRPH.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-MTDRLSI7.js → chunk-M6HSLBWY.js} +1064 -986
- package/node_modules/pi-lens/dist/chunk-MQLUAEOC.js +162 -0
- package/node_modules/pi-lens/dist/{chunk-3MRXIJ6I.js → chunk-MRXKYPCS.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-D65GOCJB.js → chunk-MXGY6KPT.js} +19 -16
- package/node_modules/pi-lens/dist/{chunk-G3RLJYA2.js → chunk-N2H3ZPZY.js} +47 -1
- package/node_modules/pi-lens/dist/{chunk-HREZQCT3.js → chunk-N3X6Q4YT.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-HSIRMK2D.js → chunk-OCAGUNBC.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-ZOEYVXSV.js → chunk-OXXKQCSV.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-S6AMWKPC.js → chunk-P7266HLM.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-64LU2OVH.js → chunk-PHDMFAKM.js} +12 -2
- package/node_modules/pi-lens/dist/{chunk-IMSQR4WO.js → chunk-PNQDPDRC.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-IUR76K6A.js → chunk-Q7DUK4LX.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-CULQYFLU.js → chunk-QGQ5CCCG.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-UEAHAMEI.js → chunk-QHJ6DQ2R.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-BNKLYOOO.js → chunk-QILIYSJF.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-VYKKMYVT.js → chunk-QOBUHWHX.js} +11 -6
- package/node_modules/pi-lens/dist/{chunk-3PNFWVHT.js → chunk-QQNQ7SJW.js} +2 -75
- package/node_modules/pi-lens/dist/{chunk-7M4T5N3V.js → chunk-R3PCY3YS.js} +14 -13
- package/node_modules/pi-lens/dist/{chunk-MGIWSROG.js → chunk-RPLINGVB.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-CMU4RMJB.js → chunk-RWWYJ623.js} +10 -1
- package/node_modules/pi-lens/dist/{chunk-3FERWMCH.js → chunk-RXCOMYPY.js} +27 -26
- package/node_modules/pi-lens/dist/{chunk-7BX5DWSA.js → chunk-SAEFPSB6.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-N7YNJE5R.js → chunk-SQ4TVJBR.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-DMS52BEP.js → chunk-SS36ZX4J.js} +9 -7
- package/node_modules/pi-lens/dist/{chunk-JONGANYH.js → chunk-T6CPIZNT.js} +32 -30
- package/node_modules/pi-lens/dist/{chunk-6UYA642J.js → chunk-TYM6OUIT.js} +13 -12
- package/node_modules/pi-lens/dist/{chunk-ALQRYH6O.js → chunk-UXGETRP4.js} +13 -12
- package/node_modules/pi-lens/dist/{chunk-FGALODG3.js → chunk-UZ3TUTRV.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-J3FZR3YY.js → chunk-VCHXCQFG.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-3P4PF2BX.js → chunk-VCO24T4L.js} +34 -22
- package/node_modules/pi-lens/dist/{chunk-O7HZX7CA.js → chunk-VRZP76YM.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-VZHJS6DR.js → chunk-VSSBEUFT.js} +16 -15
- package/node_modules/pi-lens/dist/{chunk-U52SAGRM.js → chunk-VWCXW2E7.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-WW5BLB74.js → chunk-WOA4LN2R.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-ZMOMPX2Z.js → chunk-WU567RSC.js} +11 -10
- package/node_modules/pi-lens/dist/{chunk-N77WFUL7.js → chunk-XAGLWMJ4.js} +23 -22
- package/node_modules/pi-lens/dist/{chunk-WSEWKCXU.js → chunk-XCJN5IJU.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-IR6XFA5P.js → chunk-XIJZVPD5.js} +16 -14
- package/node_modules/pi-lens/dist/{chunk-OYOB3ZFG.js → chunk-XMSXXAHW.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-34OCDWOS.js → chunk-XTMJ7XDT.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-Z6BB4JLQ.js → chunk-XVF2VVXP.js} +5 -3
- package/node_modules/pi-lens/dist/{chunk-AFZYMAIV.js → chunk-YIUAVF7E.js} +37 -35
- package/node_modules/pi-lens/dist/{chunk-NFXP47RV.js → chunk-YSZNHOBY.js} +85 -31
- package/node_modules/pi-lens/dist/{chunk-V5MEBST3.js → chunk-YYOIQFRS.js} +21 -21
- package/node_modules/pi-lens/dist/chunk-Z527N6YQ.js +28 -0
- package/node_modules/pi-lens/dist/{chunk-D6YF5HKX.js → chunk-ZANLILYD.js} +22 -2
- package/node_modules/pi-lens/dist/{chunk-2UMYMRI3.js → chunk-ZGDGW2V3.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6B5I6ICN.js → chunk-ZHFZWTZV.js} +12 -11
- package/node_modules/pi-lens/dist/{chunk-OEX24ECI.js → chunk-ZWFS3OEF.js} +51 -41
- package/node_modules/pi-lens/dist/{chunk-AXKPQ6ZI.js → chunk-ZXYDQ3TZ.js} +5 -5
- package/node_modules/pi-lens/dist/index.js +73783 -71033
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +18 -8
- package/node_modules/pi-lens/dist/mcp/cli.js +48 -37
- package/node_modules/pi-lens/dist/mcp/server.js +568 -397
- package/node_modules/pi-lens/dist/mcp/worker.js +67 -55
- package/node_modules/pi-lens/dist/probes/installer.js +20 -19
- package/node_modules/pi-lens/docs/astplayground.md +1 -1
- package/node_modules/pi-lens/docs/configuration.md +29 -0
- package/node_modules/pi-lens/docs/dependencies.md +3 -0
- package/node_modules/pi-lens/docs/features.md +2 -2
- package/node_modules/pi-lens/docs/globalconfig.md +2 -0
- package/node_modules/pi-lens/docs/language-coverage.md +2 -1
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +29 -7
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +38 -47
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +4 -0
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +17 -4
- package/node_modules/pi-lens/docs/pi-lens-retro.md +2 -1
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +18 -0
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +7 -0
- package/node_modules/pi-lens/docs/real-harness.md +17 -0
- package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +37 -2
- package/node_modules/pi-lens/docs/servercapabilities.md +15 -4
- package/node_modules/pi-lens/docs/settings.md +2 -1
- package/node_modules/pi-lens/package.json +1 -1
- package/node_modules/pi-provider-qoder/dist/index.js +166 -33
- package/node_modules/pi-provider-qoder/package.json +1 -1
- package/node_modules/pi-typesafe/README.md +3 -3
- package/node_modules/pi-typesafe/dist/backends.d.ts +7 -2
- package/node_modules/pi-typesafe/dist/backends.js +42 -0
- package/node_modules/pi-typesafe/dist/batch.d.ts +10 -6
- package/node_modules/pi-typesafe/dist/batch.js +20 -9
- package/node_modules/pi-typesafe/dist/client.d.ts +4 -1
- package/node_modules/pi-typesafe/dist/client.js +5 -4
- package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/schema.d.ts +18 -3
- package/node_modules/pi-typesafe/dist/schema.js +29 -3
- package/node_modules/pi-typesafe/package.json +1 -1
- package/node_modules/pi-web-access/CHANGELOG.md +66 -0
- package/node_modules/pi-web-access/README.md +17 -8
- package/node_modules/pi-web-access/brave.ts +20 -2
- package/node_modules/pi-web-access/content-find.ts +2 -1
- package/node_modules/pi-web-access/dist/index.js +668 -408
- package/node_modules/pi-web-access/dist/mcp-cli.js +666 -418
- package/node_modules/pi-web-access/duckduckgo.ts +5 -1
- package/node_modules/pi-web-access/endpoint-pdf-extract.ts +225 -0
- package/node_modules/pi-web-access/extract.ts +54 -14
- package/node_modules/pi-web-access/fetch-params.ts +10 -0
- package/node_modules/pi-web-access/gemini-api.ts +15 -0
- package/node_modules/pi-web-access/gemini-search.ts +32 -152
- package/node_modules/pi-web-access/github-issue-pr.ts +80 -68
- package/node_modules/pi-web-access/index.ts +3 -0
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/pdf-extract.ts +38 -4
- package/node_modules/pi-web-access/perplexity.ts +19 -2
- package/node_modules/pi-web-access/searxng.ts +2 -1
- package/node_modules/pi-web-access/ssrf-protection.ts +35 -4
- package/node_modules/pi-web-access/summary-review.ts +10 -0
- package/node_modules/pi-web-access/tool-arguments.ts +5 -2
- package/node_modules/pi-web-access/video-extract.ts +6 -2
- package/node_modules/pi-web-access/web-tool-core.ts +53 -13
- package/package.json +21 -26
- package/node_modules/pi-jev-auto-mode/CHANGELOG.md +0 -118
- package/node_modules/pi-jev-auto-mode/LICENSE +0 -21
- package/node_modules/pi-jev-auto-mode/README.md +0 -292
- package/node_modules/pi-jev-auto-mode/SECURITY.md +0 -32
- package/node_modules/pi-jev-auto-mode/docs/calibration.md +0 -154
- package/node_modules/pi-jev-auto-mode/docs/design.md +0 -164
- package/node_modules/pi-jev-auto-mode/docs/security.md +0 -124
- package/node_modules/pi-jev-auto-mode/index.ts +0 -1
- package/node_modules/pi-jev-auto-mode/package.json +0 -72
- package/node_modules/pi-jev-auto-mode/src/call.ts +0 -180
- package/node_modules/pi-jev-auto-mode/src/decide.ts +0 -86
- package/node_modules/pi-jev-auto-mode/src/extension.ts +0 -881
- package/node_modules/pi-jev-auto-mode/src/intent.ts +0 -71
- package/node_modules/pi-jev-auto-mode/src/jev/availability.ts +0 -53
- package/node_modules/pi-jev-auto-mode/src/jev/criteria.ts +0 -19
- package/node_modules/pi-jev-auto-mode/src/jev/decide.ts +0 -187
- package/node_modules/pi-jev-auto-mode/src/jev/engine.ts +0 -165
- package/node_modules/pi-jev-auto-mode/src/jev/index.ts +0 -20
- package/node_modules/pi-jev-auto-mode/src/jev/questions.ts +0 -273
- package/node_modules/pi-jev-auto-mode/src/jev/response.ts +0 -64
- package/node_modules/pi-jev-auto-mode/src/jev/state.ts +0 -20
- package/node_modules/pi-jev-auto-mode/src/jev/transport.ts +0 -117
- package/node_modules/pi-jev-auto-mode/src/jev/types.ts +0 -46
- package/node_modules/pi-jev-auto-mode/src/policy.ts +0 -558
- package/node_modules/pi-jev-auto-mode/src/records.ts +0 -184
- package/node_modules/pi-jev-auto-mode/src/settings.ts +0 -349
- package/node_modules/pi-jev-auto-mode/src/ui.ts +0 -243
- package/node_modules/pi-lens/dist/chunk-2FQ62SPM.js +0 -83
- package/node_modules/pi-lens/dist/chunk-7AXO3ZDF.js +0 -30
- package/node_modules/pi-lens/dist/chunk-KMGPUKFD.js +0 -25
- package/node_modules/pi-lens/dist/chunk-OZJINN4O.js +0 -84
- package/node_modules/pi-lens/dist/chunk-RJFED73B.js +0 -79
- package/node_modules/pi-lens/dist/chunk-RTQNRM5X.js +0 -27
- package/node_modules/pi-lens/dist/chunk-VGEVL5EQ.js +0 -29
- package/node_modules/pi-lens/dist/chunk-WPE5FPGR.js +0 -54
- package/node_modules/pi-lens/dist/chunk-Z7QQA2KT.js +0 -27
- package/node_modules/resume-from/LICENSE +0 -21
- package/node_modules/resume-from/README.md +0 -167
- package/node_modules/resume-from/dist/adapters/claude-code/adapter.d.ts +0 -20
- package/node_modules/resume-from/dist/adapters/claude-code/adapter.js +0 -59
- package/node_modules/resume-from/dist/adapters/claude-code/contract.d.ts +0 -8
- package/node_modules/resume-from/dist/adapters/claude-code/contract.js +0 -4
- package/node_modules/resume-from/dist/adapters/claude-code/entries.d.ts +0 -30
- package/node_modules/resume-from/dist/adapters/claude-code/entries.js +0 -107
- package/node_modules/resume-from/dist/adapters/claude-code/index.d.ts +0 -3
- package/node_modules/resume-from/dist/adapters/claude-code/index.js +0 -2
- package/node_modules/resume-from/dist/adapters/claude-code/layout.d.ts +0 -29
- package/node_modules/resume-from/dist/adapters/claude-code/layout.js +0 -80
- package/node_modules/resume-from/dist/adapters/claude-code/readback.d.ts +0 -9
- package/node_modules/resume-from/dist/adapters/claude-code/readback.js +0 -39
- package/node_modules/resume-from/dist/adapters/claude-code/reader.d.ts +0 -40
- package/node_modules/resume-from/dist/adapters/claude-code/reader.js +0 -436
- package/node_modules/resume-from/dist/adapters/claude-code/redaction.d.ts +0 -26
- package/node_modules/resume-from/dist/adapters/claude-code/redaction.js +0 -145
- package/node_modules/resume-from/dist/adapters/claude-code/validation.d.ts +0 -4
- package/node_modules/resume-from/dist/adapters/claude-code/validation.js +0 -39
- package/node_modules/resume-from/dist/adapters/claude-code/writer.d.ts +0 -21
- package/node_modules/resume-from/dist/adapters/claude-code/writer.js +0 -306
- package/node_modules/resume-from/dist/adapters/codex/contract.d.ts +0 -13
- package/node_modules/resume-from/dist/adapters/codex/contract.js +0 -4
- package/node_modules/resume-from/dist/adapters/codex/index.d.ts +0 -6
- package/node_modules/resume-from/dist/adapters/codex/index.js +0 -43
- package/node_modules/resume-from/dist/adapters/codex/read.d.ts +0 -44
- package/node_modules/resume-from/dist/adapters/codex/read.js +0 -723
- package/node_modules/resume-from/dist/adapters/codex/readback.d.ts +0 -9
- package/node_modules/resume-from/dist/adapters/codex/readback.js +0 -47
- package/node_modules/resume-from/dist/adapters/codex/redaction.d.ts +0 -26
- package/node_modules/resume-from/dist/adapters/codex/redaction.js +0 -145
- package/node_modules/resume-from/dist/adapters/codex/rollout.d.ts +0 -115
- package/node_modules/resume-from/dist/adapters/codex/rollout.js +0 -269
- package/node_modules/resume-from/dist/adapters/codex/validation.d.ts +0 -7
- package/node_modules/resume-from/dist/adapters/codex/validation.js +0 -78
- package/node_modules/resume-from/dist/adapters/codex/write.d.ts +0 -17
- package/node_modules/resume-from/dist/adapters/codex/write.js +0 -141
- package/node_modules/resume-from/dist/adapters/contract.d.ts +0 -78
- package/node_modules/resume-from/dist/adapters/contract.js +0 -4
- package/node_modules/resume-from/dist/adapters/pi/adapter.d.ts +0 -15
- package/node_modules/resume-from/dist/adapters/pi/adapter.js +0 -213
- package/node_modules/resume-from/dist/adapters/pi/contract.d.ts +0 -24
- package/node_modules/resume-from/dist/adapters/pi/contract.js +0 -4
- package/node_modules/resume-from/dist/adapters/pi/format.d.ts +0 -162
- package/node_modules/resume-from/dist/adapters/pi/format.js +0 -223
- package/node_modules/resume-from/dist/adapters/pi/index.d.ts +0 -7
- package/node_modules/resume-from/dist/adapters/pi/index.js +0 -10
- package/node_modules/resume-from/dist/adapters/pi/parse.d.ts +0 -41
- package/node_modules/resume-from/dist/adapters/pi/parse.js +0 -371
- package/node_modules/resume-from/dist/adapters/pi/redaction.d.ts +0 -26
- package/node_modules/resume-from/dist/adapters/pi/redaction.js +0 -145
- package/node_modules/resume-from/dist/adapters/pi/serialize.d.ts +0 -20
- package/node_modules/resume-from/dist/adapters/pi/serialize.js +0 -87
- package/node_modules/resume-from/dist/adapters/pi/validate.d.ts +0 -14
- package/node_modules/resume-from/dist/adapters/pi/validate.js +0 -134
- package/node_modules/resume-from/dist/bin.d.ts +0 -35
- package/node_modules/resume-from/dist/bin.js +0 -135
- package/node_modules/resume-from/dist/contract.d.ts +0 -10
- package/node_modules/resume-from/dist/contract.js +0 -4
- package/node_modules/resume-from/dist/host/agents.d.ts +0 -29
- package/node_modules/resume-from/dist/host/agents.js +0 -20
- package/node_modules/resume-from/dist/host/cli/args.d.ts +0 -21
- package/node_modules/resume-from/dist/host/cli/args.js +0 -187
- package/node_modules/resume-from/dist/host/cli/contract.d.ts +0 -27
- package/node_modules/resume-from/dist/host/cli/contract.js +0 -4
- package/node_modules/resume-from/dist/host/cli/index.d.ts +0 -2
- package/node_modules/resume-from/dist/host/cli/index.js +0 -1
- package/node_modules/resume-from/dist/host/cli/presentation.d.ts +0 -2
- package/node_modules/resume-from/dist/host/cli/presentation.js +0 -11
- package/node_modules/resume-from/dist/host/cli/render.d.ts +0 -3
- package/node_modules/resume-from/dist/host/cli/render.js +0 -70
- package/node_modules/resume-from/dist/host/cli/runner.d.ts +0 -8
- package/node_modules/resume-from/dist/host/cli/runner.js +0 -125
- package/node_modules/resume-from/dist/host/contract.d.ts +0 -42
- package/node_modules/resume-from/dist/host/contract.js +0 -4
- package/node_modules/resume-from/dist/host/entry.d.ts +0 -52
- package/node_modules/resume-from/dist/host/entry.js +0 -91
- package/node_modules/resume-from/dist/host/index.d.ts +0 -11
- package/node_modules/resume-from/dist/host/index.js +0 -10
- package/node_modules/resume-from/dist/host/pi-extension/command.d.ts +0 -18
- package/node_modules/resume-from/dist/host/pi-extension/command.js +0 -126
- package/node_modules/resume-from/dist/host/pi-extension/contract.d.ts +0 -34
- package/node_modules/resume-from/dist/host/pi-extension/contract.js +0 -4
- package/node_modules/resume-from/dist/host/pi-extension/index.d.ts +0 -6
- package/node_modules/resume-from/dist/host/pi-extension/index.js +0 -4
- package/node_modules/resume-from/dist/host/pi-extension/picker.d.ts +0 -16
- package/node_modules/resume-from/dist/host/pi-extension/picker.js +0 -35
- package/node_modules/resume-from/dist/host/pi-extension/presentation.d.ts +0 -2
- package/node_modules/resume-from/dist/host/pi-extension/presentation.js +0 -11
- package/node_modules/resume-from/dist/host/pi-extension/register.d.ts +0 -25
- package/node_modules/resume-from/dist/host/pi-extension/register.js +0 -11
- package/node_modules/resume-from/dist/host/pi-extension/ui.d.ts +0 -20
- package/node_modules/resume-from/dist/host/pi-extension/ui.js +0 -1
- package/node_modules/resume-from/dist/host/profile.d.ts +0 -8
- package/node_modules/resume-from/dist/host/profile.js +0 -31
- package/node_modules/resume-from/dist/host/registry.d.ts +0 -8
- package/node_modules/resume-from/dist/host/registry.js +0 -33
- package/node_modules/resume-from/dist/host/wiring.d.ts +0 -41
- package/node_modules/resume-from/dist/host/wiring.js +0 -66
- package/node_modules/resume-from/dist/import/confirmation.d.ts +0 -9
- package/node_modules/resume-from/dist/import/confirmation.js +0 -27
- package/node_modules/resume-from/dist/import/contract.d.ts +0 -43
- package/node_modules/resume-from/dist/import/contract.js +0 -4
- package/node_modules/resume-from/dist/import/discovery/contract.d.ts +0 -63
- package/node_modules/resume-from/dist/import/discovery/contract.js +0 -4
- package/node_modules/resume-from/dist/import/discovery/errors.d.ts +0 -9
- package/node_modules/resume-from/dist/import/discovery/errors.js +0 -12
- package/node_modules/resume-from/dist/import/discovery/finder.d.ts +0 -11
- package/node_modules/resume-from/dist/import/discovery/finder.js +0 -269
- package/node_modules/resume-from/dist/import/discovery/homes.d.ts +0 -23
- package/node_modules/resume-from/dist/import/discovery/homes.js +0 -83
- package/node_modules/resume-from/dist/import/discovery/index.d.ts +0 -2
- package/node_modules/resume-from/dist/import/discovery/index.js +0 -2
- package/node_modules/resume-from/dist/import/discovery/ordering.d.ts +0 -3
- package/node_modules/resume-from/dist/import/discovery/ordering.js +0 -21
- package/node_modules/resume-from/dist/import/errors.d.ts +0 -22
- package/node_modules/resume-from/dist/import/errors.js +0 -20
- package/node_modules/resume-from/dist/import/index.d.ts +0 -3
- package/node_modules/resume-from/dist/import/index.js +0 -5
- package/node_modules/resume-from/dist/import/landing/contract.d.ts +0 -44
- package/node_modules/resume-from/dist/import/landing/contract.js +0 -4
- package/node_modules/resume-from/dist/import/landing/errors.d.ts +0 -15
- package/node_modules/resume-from/dist/import/landing/errors.js +0 -15
- package/node_modules/resume-from/dist/import/landing/handover.d.ts +0 -5
- package/node_modules/resume-from/dist/import/landing/handover.js +0 -12
- package/node_modules/resume-from/dist/import/landing/index.d.ts +0 -4
- package/node_modules/resume-from/dist/import/landing/index.js +0 -4
- package/node_modules/resume-from/dist/import/landing/lander.d.ts +0 -7
- package/node_modules/resume-from/dist/import/landing/lander.js +0 -133
- package/node_modules/resume-from/dist/import/landing/marker.d.ts +0 -9
- package/node_modules/resume-from/dist/import/landing/marker.js +0 -46
- package/node_modules/resume-from/dist/import/pipeline.d.ts +0 -28
- package/node_modules/resume-from/dist/import/pipeline.js +0 -154
- package/node_modules/resume-from/dist/import/preview/builder.d.ts +0 -6
- package/node_modules/resume-from/dist/import/preview/builder.js +0 -80
- package/node_modules/resume-from/dist/import/preview/contract.d.ts +0 -39
- package/node_modules/resume-from/dist/import/preview/contract.js +0 -4
- package/node_modules/resume-from/dist/import/preview/format.d.ts +0 -19
- package/node_modules/resume-from/dist/import/preview/format.js +0 -45
- package/node_modules/resume-from/dist/import/preview/index.d.ts +0 -2
- package/node_modules/resume-from/dist/import/preview/index.js +0 -1
- package/node_modules/resume-from/dist/import/preview/warnings.d.ts +0 -14
- package/node_modules/resume-from/dist/import/preview/warnings.js +0 -86
- package/node_modules/resume-from/dist/import/transfer/contract.d.ts +0 -48
- package/node_modules/resume-from/dist/import/transfer/contract.js +0 -4
- package/node_modules/resume-from/dist/import/transfer/index.d.ts +0 -2
- package/node_modules/resume-from/dist/import/transfer/index.js +0 -1
- package/node_modules/resume-from/dist/import/transfer/rules.d.ts +0 -3
- package/node_modules/resume-from/dist/import/transfer/rules.js +0 -228
- package/node_modules/resume-from/dist/import/wiring.d.ts +0 -24
- package/node_modules/resume-from/dist/import/wiring.js +0 -37
- package/node_modules/resume-from/dist/index.d.ts +0 -36
- package/node_modules/resume-from/dist/index.js +0 -36
- package/node_modules/resume-from/dist/platform/config/contract.d.ts +0 -35
- package/node_modules/resume-from/dist/platform/config/contract.js +0 -4
- package/node_modules/resume-from/dist/platform/config/defaults.d.ts +0 -16
- package/node_modules/resume-from/dist/platform/config/defaults.js +0 -22
- package/node_modules/resume-from/dist/platform/config/errors.d.ts +0 -9
- package/node_modules/resume-from/dist/platform/config/errors.js +0 -12
- package/node_modules/resume-from/dist/platform/config/index.d.ts +0 -5
- package/node_modules/resume-from/dist/platform/config/index.js +0 -6
- package/node_modules/resume-from/dist/platform/config/loader.d.ts +0 -10
- package/node_modules/resume-from/dist/platform/config/loader.js +0 -47
- package/node_modules/resume-from/dist/platform/config/paths.d.ts +0 -13
- package/node_modules/resume-from/dist/platform/config/paths.js +0 -37
- package/node_modules/resume-from/dist/platform/config/validate.d.ts +0 -9
- package/node_modules/resume-from/dist/platform/config/validate.js +0 -117
- package/node_modules/resume-from/dist/platform/repo/contract.d.ts +0 -36
- package/node_modules/resume-from/dist/platform/repo/contract.js +0 -4
- package/node_modules/resume-from/dist/platform/repo/git.d.ts +0 -21
- package/node_modules/resume-from/dist/platform/repo/git.js +0 -77
- package/node_modules/resume-from/dist/platform/repo/index.d.ts +0 -2
- package/node_modules/resume-from/dist/platform/repo/index.js +0 -1
- package/node_modules/resume-from/dist/platform/repo/reader.d.ts +0 -3
- package/node_modules/resume-from/dist/platform/repo/reader.js +0 -170
- package/node_modules/resume-from/dist/platform/store/contract.d.ts +0 -31
- package/node_modules/resume-from/dist/platform/store/contract.js +0 -4
- package/node_modules/resume-from/dist/platform/store/file-committer.d.ts +0 -3
- package/node_modules/resume-from/dist/platform/store/file-committer.js +0 -391
- package/node_modules/resume-from/dist/platform/store/index.d.ts +0 -2
- package/node_modules/resume-from/dist/platform/store/index.js +0 -2
- package/node_modules/resume-from/dist/platform/tokens/contract.d.ts +0 -12
- package/node_modules/resume-from/dist/platform/tokens/contract.js +0 -4
- package/node_modules/resume-from/dist/platform/tokens/estimator.d.ts +0 -12
- package/node_modules/resume-from/dist/platform/tokens/estimator.js +0 -111
- package/node_modules/resume-from/dist/platform/tokens/index.d.ts +0 -2
- package/node_modules/resume-from/dist/platform/tokens/index.js +0 -1
- package/node_modules/resume-from/dist/session/contract.d.ts +0 -116
- package/node_modules/resume-from/dist/session/contract.js +0 -4
- package/node_modules/resume-from/package.json +0 -83
- package/node_modules/resume-from/shims/pi/extensions/resume-from.js +0 -118
|
@@ -6,7 +6,45 @@
|
|
|
6
6
|
export const PI_USAGE_KEY = "pi-usage";
|
|
7
7
|
export const PI_USAGE_SOURCE = "@narumitw/pi-usage";
|
|
8
8
|
const LEGACY_PI_USAGE_KEYS = new Set(["localUsage", "piUsage"]);
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
/** 内置芯片。不是 setStatus key,由本扩展自己画。 */
|
|
11
|
+
export const FOOTER_MODEL_KEY = "model";
|
|
12
|
+
export const FOOTER_CONTEXT_KEY = "context";
|
|
13
|
+
export const FOOTER_CACHE_KEY = "cache";
|
|
14
|
+
export const FOOTER_RATE_KEY = "rate";
|
|
15
|
+
export const FOOTER_COST_KEY = "cost";
|
|
16
|
+
export const FOOTER_CWD_KEY = "cwd";
|
|
17
|
+
export const FOOTER_GIT_KEY = "git";
|
|
18
|
+
|
|
19
|
+
/** 默认第一行,顺序与改成可排布之前的硬编码一致。 */
|
|
20
|
+
export const DEFAULT_FOOTER_LINE1_KEYS = [
|
|
21
|
+
FOOTER_MODEL_KEY,
|
|
22
|
+
FOOTER_CONTEXT_KEY,
|
|
23
|
+
FOOTER_CACHE_KEY,
|
|
24
|
+
FOOTER_RATE_KEY,
|
|
25
|
+
FOOTER_COST_KEY,
|
|
26
|
+
PI_USAGE_KEY,
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
29
|
+
/** 默认第二行。cwd 在前,git 在后。 */
|
|
30
|
+
export const DEFAULT_FOOTER_LINE2_KEYS = [FOOTER_CWD_KEY, FOOTER_GIT_KEY] as const;
|
|
31
|
+
|
|
32
|
+
/** 改成可排布之前就写死的项。pi-usage 不算:旧配置里本来就有它。 */
|
|
33
|
+
const LEGACY_FIXED_FOOTER_KEYS = [
|
|
34
|
+
FOOTER_MODEL_KEY,
|
|
35
|
+
FOOTER_CONTEXT_KEY,
|
|
36
|
+
FOOTER_CACHE_KEY,
|
|
37
|
+
FOOTER_RATE_KEY,
|
|
38
|
+
FOOTER_COST_KEY,
|
|
39
|
+
FOOTER_CWD_KEY,
|
|
40
|
+
FOOTER_GIT_KEY,
|
|
41
|
+
] as const;
|
|
42
|
+
|
|
43
|
+
const BUILTIN_FOOTER_KEYS = new Set<string>(LEGACY_FIXED_FOOTER_KEYS);
|
|
44
|
+
|
|
45
|
+
export function isBuiltinFooterKey(key: string): boolean {
|
|
46
|
+
return BUILTIN_FOOTER_KEYS.has(key);
|
|
47
|
+
}
|
|
10
48
|
|
|
11
49
|
export type FooterLineId = 1 | 2 | 3;
|
|
12
50
|
|
|
@@ -19,18 +57,20 @@ export type FooterChipLayout = {
|
|
|
19
57
|
|
|
20
58
|
export const DEFAULT_FOOTER_CHIP_LAYOUT: FooterChipLayout = {
|
|
21
59
|
footerHiddenKeys: [],
|
|
22
|
-
footerLine1Keys: [
|
|
23
|
-
footerLine2Keys: [],
|
|
60
|
+
footerLine1Keys: [...DEFAULT_FOOTER_LINE1_KEYS],
|
|
61
|
+
footerLine2Keys: [...DEFAULT_FOOTER_LINE2_KEYS],
|
|
24
62
|
footerLine3Keys: [],
|
|
25
63
|
};
|
|
26
64
|
|
|
65
|
+
/** 别的扩展写的 model 状态与本扩展的模型芯片重名,不当插件芯片接纳。配置里的 model 不受影响。 */
|
|
27
66
|
export function isSkippedFooterStatusKey(key: string): boolean {
|
|
28
|
-
return key ===
|
|
67
|
+
return key === FOOTER_MODEL_KEY;
|
|
29
68
|
}
|
|
30
69
|
|
|
31
|
-
/**
|
|
70
|
+
/** 未单独配置时的默认行:内置项按原来的行,usage 类在 line1,其余 line2。不会默认进 line3。 */
|
|
32
71
|
export function defaultFooterLine(key: string): FooterLineId {
|
|
33
|
-
if (
|
|
72
|
+
if ((DEFAULT_FOOTER_LINE1_KEYS as readonly string[]).includes(key)) return 1;
|
|
73
|
+
if ((DEFAULT_FOOTER_LINE2_KEYS as readonly string[]).includes(key)) return 2;
|
|
34
74
|
if (/usage|quota|balance/i.test(key)) return 1;
|
|
35
75
|
return 2;
|
|
36
76
|
}
|
|
@@ -43,7 +83,7 @@ export function normalizeFooterKeyList(value: unknown): string[] {
|
|
|
43
83
|
if (typeof item !== "string") continue;
|
|
44
84
|
let key = item.trim();
|
|
45
85
|
if (LEGACY_PI_USAGE_KEYS.has(key)) key = PI_USAGE_KEY;
|
|
46
|
-
if (!key ||
|
|
86
|
+
if (!key || seen.has(key)) continue;
|
|
47
87
|
seen.add(key);
|
|
48
88
|
out.push(key);
|
|
49
89
|
}
|
|
@@ -60,37 +100,81 @@ function takeUnique(keys: string[], seen: Set<string>): string[] {
|
|
|
60
100
|
return out;
|
|
61
101
|
}
|
|
62
102
|
|
|
63
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* 旧配置只排插件芯片,内置项是硬编码的。
|
|
105
|
+
* 三条行都没出现过内置 key 时,按原位置补上,已有插件顺序不动。
|
|
106
|
+
*/
|
|
107
|
+
function ensureBuiltinKeys(
|
|
108
|
+
line1: string[],
|
|
109
|
+
line2: string[],
|
|
110
|
+
line3: string[],
|
|
111
|
+
): { footerLine1Keys: string[]; footerLine2Keys: string[]; footerLine3Keys: string[] } {
|
|
112
|
+
const seen = new Set([...line1, ...line2, ...line3]);
|
|
113
|
+
if (LEGACY_FIXED_FOOTER_KEYS.some((key) => seen.has(key))) {
|
|
114
|
+
return { footerLine1Keys: line1, footerLine2Keys: line2, footerLine3Keys: line3 };
|
|
115
|
+
}
|
|
116
|
+
const line1Builtins = DEFAULT_FOOTER_LINE1_KEYS.filter((key) => key !== PI_USAGE_KEY);
|
|
117
|
+
const usageAt = line1.indexOf(PI_USAGE_KEY);
|
|
118
|
+
const footerLine1Keys =
|
|
119
|
+
usageAt >= 0
|
|
120
|
+
? [...line1.slice(0, usageAt), ...line1Builtins, ...line1.slice(usageAt)]
|
|
121
|
+
: [...line1Builtins, ...line1];
|
|
122
|
+
return {
|
|
123
|
+
footerLine1Keys,
|
|
124
|
+
footerLine2Keys: [...DEFAULT_FOOTER_LINE2_KEYS, ...line2],
|
|
125
|
+
footerLine3Keys: line3,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** 跨行去重(line1 → line2 → line3);旧配置补上内置芯片。 */
|
|
64
130
|
export function normalizeFooterChipLayout(source: Record<string, unknown>): FooterChipLayout {
|
|
65
131
|
const hasHidden = Array.isArray(source.footerHiddenKeys);
|
|
66
132
|
const hasAnyLine = [source.footerLine1Keys, source.footerLine2Keys, source.footerLine3Keys].some(
|
|
67
133
|
Array.isArray,
|
|
68
134
|
);
|
|
69
|
-
const seen = new Set<string>();
|
|
70
|
-
let footerLine1Keys = takeUnique(normalizeFooterKeyList(source.footerLine1Keys), seen);
|
|
71
|
-
const footerLine2Keys = takeUnique(normalizeFooterKeyList(source.footerLine2Keys), seen);
|
|
72
|
-
const footerLine3Keys = takeUnique(normalizeFooterKeyList(source.footerLine3Keys), seen);
|
|
73
|
-
const footerHiddenKeys = normalizeFooterKeyList(source.footerHiddenKeys);
|
|
74
|
-
|
|
75
|
-
if (!seen.has(PI_USAGE_KEY)) {
|
|
76
|
-
footerLine1Keys = [PI_USAGE_KEY, ...footerLine1Keys];
|
|
77
|
-
}
|
|
78
135
|
if (!hasHidden && !hasAnyLine) {
|
|
79
|
-
return {
|
|
136
|
+
return {
|
|
137
|
+
footerHiddenKeys: [],
|
|
138
|
+
footerLine1Keys: [...DEFAULT_FOOTER_LINE1_KEYS],
|
|
139
|
+
footerLine2Keys: [...DEFAULT_FOOTER_LINE2_KEYS],
|
|
140
|
+
footerLine3Keys: [],
|
|
141
|
+
};
|
|
80
142
|
}
|
|
81
|
-
|
|
143
|
+
const seen = new Set<string>();
|
|
144
|
+
const line1 = takeUnique(normalizeFooterKeyList(source.footerLine1Keys), seen);
|
|
145
|
+
const line2 = takeUnique(normalizeFooterKeyList(source.footerLine2Keys), seen);
|
|
146
|
+
const line3 = takeUnique(normalizeFooterKeyList(source.footerLine3Keys), seen);
|
|
147
|
+
return {
|
|
148
|
+
footerHiddenKeys: normalizeFooterKeyList(source.footerHiddenKeys),
|
|
149
|
+
...ensureBuiltinKeys(line1, line2, line3),
|
|
150
|
+
};
|
|
82
151
|
}
|
|
83
152
|
|
|
84
|
-
|
|
153
|
+
const BUILTIN_FOOTER_LABEL: Record<string, string> = {
|
|
154
|
+
[FOOTER_MODEL_KEY]: "Model and thinking level",
|
|
155
|
+
[FOOTER_CONTEXT_KEY]: "Context window bar",
|
|
156
|
+
[FOOTER_CACHE_KEY]: "Cache hit rate",
|
|
157
|
+
[FOOTER_RATE_KEY]: "Output rate",
|
|
158
|
+
[FOOTER_COST_KEY]: "Session cost",
|
|
159
|
+
[FOOTER_CWD_KEY]: "Working directory and session name",
|
|
160
|
+
[FOOTER_GIT_KEY]: "Branch and change stats",
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** 面板描述用:内置项写明内容,pi-usage 注明来源,其它芯片用来源 setStatus key。 */
|
|
85
164
|
export function footerChipSource(key: string): string {
|
|
86
165
|
return key === PI_USAGE_KEY ? PI_USAGE_SOURCE : key;
|
|
87
166
|
}
|
|
88
167
|
|
|
89
168
|
export function footerChipDescription(key: string, liveText: string): string {
|
|
169
|
+
const builtin = BUILTIN_FOOTER_LABEL[key];
|
|
170
|
+
if (builtin) {
|
|
171
|
+
const live = liveText.trim();
|
|
172
|
+
return live ? `${builtin} · ${live}` : builtin;
|
|
173
|
+
}
|
|
90
174
|
const source = footerChipSource(key);
|
|
91
175
|
const live = liveText.trim();
|
|
92
176
|
if (live) return `${live} · from ${source}`;
|
|
93
|
-
if (key === PI_USAGE_KEY) return `From ${
|
|
177
|
+
if (key === PI_USAGE_KEY) return `From ${PI_USAGE_SOURCE}. No text right now.`;
|
|
94
178
|
return `inactive · from ${source}`;
|
|
95
179
|
}
|
|
96
180
|
|
|
@@ -151,7 +235,6 @@ export function moveFooterKeyToLine(
|
|
|
151
235
|
key: string,
|
|
152
236
|
line: FooterLineId,
|
|
153
237
|
): FooterChipLayout {
|
|
154
|
-
if (isSkippedFooterStatusKey(key)) return layout;
|
|
155
238
|
const current = footerLineOfKey(layout, key);
|
|
156
239
|
if (current === line) return layout;
|
|
157
240
|
const stripped: FooterChipLayout = {
|
|
@@ -193,7 +276,6 @@ export function reorderFooterKey(
|
|
|
193
276
|
}
|
|
194
277
|
|
|
195
278
|
export function toggleFooterKeyHidden(layout: FooterChipLayout, key: string): FooterChipLayout {
|
|
196
|
-
if (isSkippedFooterStatusKey(key)) return layout;
|
|
197
279
|
const hidden = new Set(layout.footerHiddenKeys);
|
|
198
280
|
if (hidden.has(key)) hidden.delete(key);
|
|
199
281
|
else hidden.add(key);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 自定义底栏:chips + zentui 图标/句子
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 第三行:仅当 line3
|
|
4
|
+
* 默认第一行:model thinking · ██████░░░░ 45%/200k · 42% · $0.01 · pi-usage · 其余 line1 芯片
|
|
5
|
+
* 默认第二行:cwd in session · branch (+16 −1) · 其余 line2 芯片
|
|
6
|
+
* 第三行:仅当 line3 有可见芯片时出现
|
|
7
|
+
* model / context / cache / rate / cost / cwd / git 与插件芯片同一套排布,可换行、调序、隐藏
|
|
7
8
|
*
|
|
8
9
|
* - line1 短芯片,· 分隔;缓存用 zentui ,费用 success
|
|
9
10
|
* - line2 用 zentui 句式 in / on +
|
|
@@ -23,7 +24,15 @@ import { stripAnsi } from "../../utils/ansi-text.ts";
|
|
|
23
24
|
import { formatFooterCost } from "./footer-currency.ts";
|
|
24
25
|
import { formatTokenCount } from "../../utils/format.ts";
|
|
25
26
|
import {
|
|
27
|
+
FOOTER_CACHE_KEY,
|
|
28
|
+
FOOTER_CONTEXT_KEY,
|
|
29
|
+
FOOTER_COST_KEY,
|
|
30
|
+
FOOTER_CWD_KEY,
|
|
31
|
+
FOOTER_GIT_KEY,
|
|
32
|
+
FOOTER_MODEL_KEY,
|
|
33
|
+
FOOTER_RATE_KEY,
|
|
26
34
|
PI_USAGE_KEY,
|
|
35
|
+
isBuiltinFooterKey,
|
|
27
36
|
isSkippedFooterStatusKey,
|
|
28
37
|
resolveFooterChipLayout,
|
|
29
38
|
visibleFooterPluginTexts,
|
|
@@ -31,6 +40,7 @@ import {
|
|
|
31
40
|
} from "./footer-layout.ts";
|
|
32
41
|
import { createGitStatsRefresher, readGitStats, type GitStats } from "./git-stats.ts";
|
|
33
42
|
import { MCP_STATUS_KEY, buildMcpChip } from "./mcp-chip.ts";
|
|
43
|
+
import { inputTextIndent } from "./prompt-editor.ts";
|
|
34
44
|
import { currentTtftMs, displayTokenRate, formatTokenRate } from "./token-rate.ts";
|
|
35
45
|
|
|
36
46
|
export { parseGitStats } from "./git-stats.ts";
|
|
@@ -144,11 +154,11 @@ function ownMcpChip(): string {
|
|
|
144
154
|
return cachedMcpChip && !cachedExtensionStatuses.has(MCP_STATUS_KEY) ? cachedMcpChip : "";
|
|
145
155
|
}
|
|
146
156
|
|
|
147
|
-
/** 面板用:当前 setStatus 文案 + 本包 pi-usage / MCP
|
|
157
|
+
/** 面板用:当前 setStatus 文案 + 本包 pi-usage / MCP(无文案时为空字符串)。内置项由配置保证在列表里。 */
|
|
148
158
|
export function getFooterStatusSnapshot(): Map<string, string> {
|
|
149
159
|
const out = new Map<string, string>();
|
|
150
160
|
for (const [key, text] of cachedExtensionStatuses) {
|
|
151
|
-
if (isSkippedFooterStatusKey(key)) continue;
|
|
161
|
+
if (isSkippedFooterStatusKey(key) || isBuiltinFooterKey(key)) continue;
|
|
152
162
|
out.set(key, text);
|
|
153
163
|
}
|
|
154
164
|
out.set(PI_USAGE_KEY, cachedLocalUsageText);
|
|
@@ -418,21 +428,6 @@ const createCustomFooterFactory =
|
|
|
418
428
|
if (mcpChip) pluginTexts.set(MCP_STATUS_KEY, mcpChip);
|
|
419
429
|
const layout = resolveFooterChipLayout(layoutFromConfig(), [...pluginTexts.keys()]);
|
|
420
430
|
const dimPlugin = (text: string) => colorUsageChip(theme, text);
|
|
421
|
-
const line1Plugins = visibleFooterPluginTexts(
|
|
422
|
-
layout.footerLine1Keys,
|
|
423
|
-
layout.footerHiddenKeys,
|
|
424
|
-
pluginTexts,
|
|
425
|
-
).map(dimPlugin);
|
|
426
|
-
const line2Plugins = visibleFooterPluginTexts(
|
|
427
|
-
layout.footerLine2Keys,
|
|
428
|
-
layout.footerHiddenKeys,
|
|
429
|
-
pluginTexts,
|
|
430
|
-
).map(dimPlugin);
|
|
431
|
-
const line3Plugins = visibleFooterPluginTexts(
|
|
432
|
-
layout.footerLine3Keys,
|
|
433
|
-
layout.footerHiddenKeys,
|
|
434
|
-
pluginTexts,
|
|
435
|
-
).map(dimPlugin);
|
|
436
431
|
|
|
437
432
|
const pctLabel = percent === null || percent === undefined ? "?" : `${Math.floor(percent)}%`;
|
|
438
433
|
const cachePct = getCachePct();
|
|
@@ -447,22 +442,13 @@ const createCustomFooterFactory =
|
|
|
447
442
|
config.footerTokenRateTtft,
|
|
448
443
|
)
|
|
449
444
|
: "";
|
|
450
|
-
const
|
|
451
|
-
const costChip =
|
|
445
|
+
const costLabel =
|
|
452
446
|
cost || usingSubscription
|
|
453
|
-
?
|
|
454
|
-
"dim",
|
|
455
|
-
formatFooterCost(cost, config.footerCurrency, config.footerCurrencyRate),
|
|
456
|
-
) + (usingSubscription ? theme.fg("warning", " sub") : "")
|
|
447
|
+
? formatFooterCost(cost, config.footerCurrency, config.footerCurrencyRate)
|
|
457
448
|
: "";
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
cacheLabel ? theme.fg("dim", cacheLabel) : "",
|
|
462
|
-
rateChip,
|
|
463
|
-
costChip,
|
|
464
|
-
...line1Plugins,
|
|
465
|
-
]);
|
|
449
|
+
const costChip = costLabel
|
|
450
|
+
? theme.fg("dim", costLabel) + (usingSubscription ? theme.fg("warning", " sub") : "")
|
|
451
|
+
: "";
|
|
466
452
|
|
|
467
453
|
const gitColor = theme.getThinkingBorderColor("medium");
|
|
468
454
|
let place = theme.fg("accent", cwdLabel);
|
|
@@ -471,6 +457,7 @@ const createCustomFooterFactory =
|
|
|
471
457
|
place += theme.fg("muted", " in ") + theme.fg("success", sessionName);
|
|
472
458
|
}
|
|
473
459
|
const branch = footerData.getGitBranch();
|
|
460
|
+
let gitChip = "";
|
|
474
461
|
if (branch) {
|
|
475
462
|
const s = gitStats;
|
|
476
463
|
let stats = "";
|
|
@@ -484,16 +471,45 @@ const createCustomFooterFactory =
|
|
|
484
471
|
theme.fg("error", `−${s.del}`) +
|
|
485
472
|
theme.fg("dim", ")");
|
|
486
473
|
const gitLabel = glyphs.git ? `${glyphs.git} ${branch}` : branch;
|
|
487
|
-
|
|
474
|
+
gitChip = gitColor(gitLabel) + stats;
|
|
488
475
|
}
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
476
|
+
|
|
477
|
+
const builtinChips = new Map<string, string>([
|
|
478
|
+
[
|
|
479
|
+
FOOTER_MODEL_KEY,
|
|
480
|
+
modelChip(theme, modelLabel, model?.reasoning ? thinkingLevelStr : "", thinkingColor),
|
|
481
|
+
],
|
|
482
|
+
[
|
|
483
|
+
FOOTER_CONTEXT_KEY,
|
|
484
|
+
barGauge(percent ?? 0) + theme.fg("dim", ` ${pctLabel}/${fmt(contextWindow)}`),
|
|
485
|
+
],
|
|
486
|
+
[FOOTER_CACHE_KEY, cacheLabel ? theme.fg("dim", cacheLabel) : ""],
|
|
487
|
+
[FOOTER_RATE_KEY, rateLabel ? theme.fg("dim", rateLabel) : ""],
|
|
488
|
+
[FOOTER_COST_KEY, costChip],
|
|
489
|
+
[FOOTER_CWD_KEY, place],
|
|
490
|
+
[FOOTER_GIT_KEY, gitChip],
|
|
491
|
+
]);
|
|
492
|
+
|
|
493
|
+
const lineOf = (keys: readonly string[]) =>
|
|
494
|
+
joinChips(
|
|
495
|
+
keys
|
|
496
|
+
.filter((key) => !layout.footerHiddenKeys.includes(key))
|
|
497
|
+
.map((key) => {
|
|
498
|
+
if (isBuiltinFooterKey(key)) return builtinChips.get(key) ?? "";
|
|
499
|
+
const text = visibleFooterPluginTexts([key], [], pluginTexts)[0];
|
|
500
|
+
return text ? dimPlugin(text) : "";
|
|
501
|
+
}),
|
|
502
|
+
);
|
|
503
|
+
const line1 = lineOf(layout.footerLine1Keys);
|
|
504
|
+
const line2 = lineOf(layout.footerLine2Keys);
|
|
505
|
+
const line3 = lineOf(layout.footerLine3Keys);
|
|
506
|
+
|
|
507
|
+
// 对齐输入文本起始列:editorPaddingX + `❯ ` 的 2 列(随编辑器 render 实时更新)。
|
|
508
|
+
const indent = " ".repeat(inputTextIndent());
|
|
509
|
+
const fit = (line: string) =>
|
|
510
|
+
indent + truncateToWidth(line, Math.max(1, width - indent.length));
|
|
511
|
+
|
|
512
|
+
return [fit(line1), ...(line2 ? [fit(line2)] : []), ...(line3 ? [fit(line3)] : [])];
|
|
497
513
|
};
|
|
498
514
|
|
|
499
515
|
return {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 输入框 `❯` 提示符(issue #68)。
|
|
3
|
+
*
|
|
4
|
+
* `PromptEditor` 继承 `CustomEditor`:pi 的 setCustomEditorComponent 会自动接线
|
|
5
|
+
* onSubmit/onChange/actionHandlers/autocomplete/工作状态指示器,本扩展只管渲染。
|
|
6
|
+
*
|
|
7
|
+
* `❯ ` 恒占左侧 2 列:渲染前把 paddingX 抬到「用户值 + 2」(直接改字段绕过
|
|
8
|
+
* setter,避免每帧 requestRender 自激),渲染后恢复。首内容行前两列换成
|
|
9
|
+
* `❯ `,其后仍保留用户 editorPaddingX 的空格。
|
|
10
|
+
* `❯` 颜色直接用 `borderColor`,随 thinking 等级 / bash mode 自动联动。
|
|
11
|
+
*
|
|
12
|
+
* `userPaddingX` 记录渲染时读到的用户 editorPaddingX(pi 通过 setPaddingX
|
|
13
|
+
* 同步进本编辑器),footer 用 `inputTextIndent()` 对齐输入文本起始列:
|
|
14
|
+
* 前缀开 = userPaddingX + 2,关 = userPaddingX。
|
|
15
|
+
*/
|
|
16
|
+
import { CustomEditor, type ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
17
|
+
import { config } from "../../config/config.ts";
|
|
18
|
+
|
|
19
|
+
/** `❯ ` 固定 2 列:glyph + 尾随空格。 */
|
|
20
|
+
const PROMPT_GLYPH = "❯";
|
|
21
|
+
const PROMPT_COLS = 2;
|
|
22
|
+
|
|
23
|
+
/** 最近一次 render 读到的用户 editorPaddingX;未启用过提示符时为 0。 */
|
|
24
|
+
let userPaddingX = 0;
|
|
25
|
+
|
|
26
|
+
/** 输入文本起始列:footer 按它对齐。 */
|
|
27
|
+
export function inputTextIndent(): number {
|
|
28
|
+
return config.enableEditorPrefix ? userPaddingX + PROMPT_COLS : userPaddingX;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class PromptEditor extends CustomEditor {
|
|
32
|
+
render(width: number): string[] {
|
|
33
|
+
// ❯ + 用户 padding:文本从 userPaddingX+2 列开始。
|
|
34
|
+
const self = this as unknown as { paddingX: number };
|
|
35
|
+
const saved = self.paddingX;
|
|
36
|
+
userPaddingX = saved;
|
|
37
|
+
self.paddingX = saved + PROMPT_COLS;
|
|
38
|
+
try {
|
|
39
|
+
const lines = super.render(width);
|
|
40
|
+
// 布局:lines[0] 顶边框,lines[1..n-2] 内容,lines[n-1] 底边框(autocomplete 在底边框后追加,
|
|
41
|
+
// 首内容行恒为 index 1)。开头是 paddingX 个纯空格,前两列换成 ❯+空格,剩余 padding 保留;
|
|
42
|
+
// 续行不动——Claude Code 行为。
|
|
43
|
+
if (lines.length > 2 && lines[1].startsWith(" ")) {
|
|
44
|
+
lines[1] = this.borderColor(PROMPT_GLYPH) + " " + lines[1].slice(2);
|
|
45
|
+
}
|
|
46
|
+
return lines;
|
|
47
|
+
} finally {
|
|
48
|
+
self.paddingX = saved;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type EditorFactory = Parameters<ExtensionContext["ui"]["setEditorComponent"]>[0];
|
|
54
|
+
|
|
55
|
+
const promptEditorFactory: EditorFactory = (tui, theme, keybindings) =>
|
|
56
|
+
new PromptEditor(tui, theme, keybindings, { embedWorkingStatus: true });
|
|
57
|
+
|
|
58
|
+
/** 是否正占着插槽;占据前的工厂用于原样还回去。 */
|
|
59
|
+
let active = false;
|
|
60
|
+
let previousEditorFactory: EditorFactory | undefined;
|
|
61
|
+
|
|
62
|
+
/** 撤销本扩展占据的插槽;从未占用就不碰插槽。 */
|
|
63
|
+
function releasePromptEditor(ctx: ExtensionContext): void {
|
|
64
|
+
if (!active) return;
|
|
65
|
+
ctx.ui.setEditorComponent(previousEditorFactory);
|
|
66
|
+
active = false;
|
|
67
|
+
previousEditorFactory = undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 应用输入框前缀;enableEditorPrefix=false 时只撤自己装的那层。 */
|
|
71
|
+
export function applyPromptEditor(ctx: ExtensionContext): void {
|
|
72
|
+
if (!ctx?.hasUI || typeof ctx.ui?.setEditorComponent !== "function") return;
|
|
73
|
+
try {
|
|
74
|
+
if (!config.enableEditorPrefix) {
|
|
75
|
+
releasePromptEditor(ctx);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (!active) {
|
|
79
|
+
// pi 的插槽是硬替换、没有栈,先记住是谁占着,撤销时还回去。
|
|
80
|
+
previousEditorFactory = ctx.ui.getEditorComponent?.();
|
|
81
|
+
active = true;
|
|
82
|
+
}
|
|
83
|
+
ctx.ui.setEditorComponent(promptEditorFactory);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
ctx.ui.notify(
|
|
86
|
+
`prompt editor error: ${err instanceof Error ? err.message : String(err)}`,
|
|
87
|
+
"error",
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** 恢复本扩展占据前的编辑器;未占用时不动作。 */
|
|
93
|
+
export function clearPromptEditor(ctx: ExtensionContext): void {
|
|
94
|
+
if (!ctx?.hasUI || typeof ctx.ui?.setEditorComponent !== "function") return;
|
|
95
|
+
releasePromptEditor(ctx);
|
|
96
|
+
}
|
|
@@ -5,6 +5,7 @@ import { config } from "./config/config.ts";
|
|
|
5
5
|
import piAliases from "./feature/shell/aliases.ts";
|
|
6
6
|
import { installFlushDockedBash } from "./feature/shell/flush-docked-bash.ts";
|
|
7
7
|
import customFooter from "./feature/shell/footer.ts";
|
|
8
|
+
import { applyPromptEditor } from "./feature/shell/prompt-editor.ts";
|
|
8
9
|
import piStartupHeader, { installEarlyStartupHeader } from "./feature/shell/startup-header.ts";
|
|
9
10
|
import workingMessage from "./feature/shell/working-message.ts";
|
|
10
11
|
|
|
@@ -42,6 +43,11 @@ export default function (pi: ExtensionAPI): void {
|
|
|
42
43
|
if (config.enableWorkingMessage) workingMessage(pi);
|
|
43
44
|
customFooter(pi);
|
|
44
45
|
|
|
46
|
+
// 输入框 ❯ 提示符:session_start 时按配置应用;setEditorComponent 是一次性替换。
|
|
47
|
+
pi.on("session_start", (_event, ctx) => {
|
|
48
|
+
applyPromptEditor(ctx);
|
|
49
|
+
});
|
|
50
|
+
|
|
45
51
|
// Renderer 必须先注册 lifecycle handler,shutdown 时才能先解开外层 compact
|
|
46
52
|
// patch,thinking 随后才能恢复原生原型;bridge 转发给稍后安装的 controller。
|
|
47
53
|
let compactThinking: CompactThinkingController | undefined;
|