@herbertgao/pi-extensions 2026.10.19 → 2026.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +759 -0
- package/README.md +21 -6
- package/THIRD_PARTY_NOTICES.md +53 -2
- package/extensions/clef.mjs +1 -1
- package/node_modules/@herbertgao/pi-agency/CHANGELOG.md +19 -0
- package/node_modules/@herbertgao/pi-agency/package.json +4 -2
- package/node_modules/@herbertgao/pi-agency/src/index.ts +1 -1
- package/node_modules/@herbertgao/pi-bark/CHANGELOG.md +52 -0
- package/node_modules/@herbertgao/pi-bark/package.json +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +207 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +7 -5
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +10 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +20 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +61 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +11 -16
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +60 -11
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +29 -11
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer-layout.ts +54 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +23 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/session-tokens.ts +52 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +5 -4
- package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +13 -0
- package/node_modules/@herbertgao/pi-impeccable/package.json +2 -1
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +142 -45
- package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +17 -7
- package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +111 -59
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +135 -117
- package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +41 -14
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +110 -19
- package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +8 -0
- package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +31 -0
- package/node_modules/@herbertgao/sol-pi/CHANGELOG.md +84 -0
- package/node_modules/@herbertgao/sol-pi/README.md +3 -3
- package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +4 -4
- package/node_modules/@herbertgao/sol-pi/agents-install.md +3 -3
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +1 -1
- package/node_modules/@herbertgao/sol-pi/package.json +2 -1
- package/node_modules/@tintinweb/pi-tasks/CHANGELOG.md +270 -0
- package/node_modules/@tintinweb/pi-tasks/CONTRIBUTING.md +67 -0
- package/node_modules/@tintinweb/pi-tasks/CUSTOMIZING.md +289 -0
- package/node_modules/@tintinweb/pi-tasks/LICENSE +21 -0
- package/node_modules/@tintinweb/pi-tasks/README.md +417 -0
- package/node_modules/@tintinweb/pi-tasks/SECURITY.md +107 -0
- package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.d.ts +64 -0
- package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.js +129 -0
- package/node_modules/@tintinweb/pi-tasks/dist/index.d.ts +17 -0
- package/node_modules/@tintinweb/pi-tasks/dist/index.js +1338 -0
- package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.d.ts +29 -0
- package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.js +121 -0
- package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.d.ts +39 -0
- package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.js +61 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.d.ts +48 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.js +68 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-paths.d.ts +44 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-paths.js +60 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-sort.d.ts +23 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-sort.js +69 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-store.d.ts +61 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-store.js +397 -0
- package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.d.ts +16 -0
- package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.js +51 -0
- package/node_modules/@tintinweb/pi-tasks/dist/types.d.ts +36 -0
- package/node_modules/@tintinweb/pi-tasks/dist/types.js +4 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.d.ts +15 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.js +140 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.d.ts +69 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.js +278 -0
- package/node_modules/@tintinweb/pi-tasks/package.json +57 -0
- package/node_modules/@tintinweb/pi-tasks/src/auto-clear.ts +134 -0
- package/node_modules/@tintinweb/pi-tasks/src/index.ts +1417 -0
- package/node_modules/@tintinweb/pi-tasks/src/process-tracker.ts +140 -0
- package/node_modules/@tintinweb/pi-tasks/src/reminder-cadence.ts +90 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-glyphs.ts +110 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-paths.ts +65 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-sort.ts +90 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-store.ts +402 -0
- package/node_modules/@tintinweb/pi-tasks/src/tasks-config.ts +77 -0
- package/node_modules/@tintinweb/pi-tasks/src/types.ts +40 -0
- package/node_modules/@tintinweb/pi-tasks/src/ui/settings-menu.ts +174 -0
- package/node_modules/@tintinweb/pi-tasks/src/ui/task-widget.ts +325 -0
- package/node_modules/pi-commandcode-provider/CHANGELOG.md +330 -0
- package/node_modules/pi-commandcode-provider/CONTRIBUTING.md +192 -0
- package/node_modules/pi-commandcode-provider/LICENSE +21 -0
- package/node_modules/pi-commandcode-provider/README.md +243 -0
- package/node_modules/pi-commandcode-provider/RELEASE.md +194 -0
- package/node_modules/pi-commandcode-provider/index.ts +309 -0
- package/node_modules/pi-commandcode-provider/package.json +91 -0
- package/node_modules/pi-commandcode-provider/scripts/live-e2e-profile.mjs +87 -0
- package/node_modules/pi-commandcode-provider/scripts/pi-authenticated.mjs +50 -0
- package/node_modules/pi-commandcode-provider/scripts/pi-isolated.mjs +79 -0
- package/node_modules/pi-commandcode-provider/src/api-key.ts +69 -0
- package/node_modules/pi-commandcode-provider/src/auth-server.ts +229 -0
- package/node_modules/pi-commandcode-provider/src/commandcode-catalog-overrides.ts +28 -0
- package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +260 -0
- package/node_modules/pi-commandcode-provider/src/converters.ts +477 -0
- package/node_modules/pi-commandcode-provider/src/core.ts +836 -0
- package/node_modules/pi-commandcode-provider/src/cost.ts +76 -0
- package/node_modules/pi-commandcode-provider/src/json-schema.ts +417 -0
- package/node_modules/pi-commandcode-provider/src/models.ts +515 -0
- package/node_modules/pi-commandcode-provider/src/oauth.ts +229 -0
- package/node_modules/pi-commandcode-provider/src/overflow.ts +120 -0
- package/node_modules/pi-commandcode-provider/src/pricing.ts +370 -0
- package/node_modules/pi-commandcode-provider/src/quota-command.ts +66 -0
- package/node_modules/pi-commandcode-provider/src/quota-format.ts +143 -0
- package/node_modules/pi-commandcode-provider/src/quota-types.ts +47 -0
- package/node_modules/pi-commandcode-provider/src/quota.ts +357 -0
- package/node_modules/pi-commandcode-provider/src/responses-stream.ts +249 -0
- package/node_modules/pi-commandcode-provider/src/runtime.ts +330 -0
- package/node_modules/pi-commandcode-provider/src/transcript.ts +56 -0
- package/node_modules/pi-commandcode-provider/src/transport.ts +147 -0
- package/node_modules/pi-commandcode-provider/src/types.ts +212 -0
- package/node_modules/pi-commandcode-provider/src/usage.ts +261 -0
- package/node_modules/pi-lens/CHANGELOG.md +149 -0
- package/node_modules/pi-lens/README.md +12 -2
- package/node_modules/pi-lens/config/markdownlint/run-no-fix.mjs +36 -0
- package/node_modules/pi-lens/dist/{chunk-WME2OQST.js → chunk-2453RRJ2.js} +11 -6
- package/node_modules/pi-lens/dist/{chunk-FZKFVUEC.js → chunk-2BKUFQKR.js} +276 -208
- package/node_modules/pi-lens/dist/chunk-2TS4GLOJ.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-QHSNL7B2.js → chunk-2ZE3AUJQ.js} +12 -14
- package/node_modules/pi-lens/dist/{chunk-MPKRJBPK.js → chunk-35WKJWO5.js} +28 -30
- package/node_modules/pi-lens/dist/chunk-3JAHQBSY.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-4LM3VAZH.js → chunk-3O5EII3W.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-447YZL4S.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-H7OR7DFZ.js → chunk-4B2YFN4U.js} +25 -21
- package/node_modules/pi-lens/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-RRV3FNNM.js → chunk-4LL2VRNY.js} +27 -28
- package/node_modules/pi-lens/dist/{chunk-BZARLRJW.js → chunk-4NBWFYWW.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-KKCK636N.js → chunk-4QG55RRC.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-RQS4QQSD.js → chunk-4W52ZKZX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-HWDAVBFU.js → chunk-57X2CDRX.js} +23 -23
- package/node_modules/pi-lens/dist/{chunk-MB6PXBUA.js → chunk-5F3XF3SX.js} +7 -15
- package/node_modules/pi-lens/dist/{chunk-O4BJFESU.js → chunk-5RNB4HVK.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ZMAUPOMG.js → chunk-5T5A6YAJ.js} +35 -34
- package/node_modules/pi-lens/dist/{chunk-4ZYJHQMB.js → chunk-6FIRFP6A.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-4YHYPW2G.js → chunk-6GMGEKQN.js} +9 -5
- package/node_modules/pi-lens/dist/{chunk-4LOE5R5P.js → chunk-6LJOJ6EO.js} +20 -15
- package/node_modules/pi-lens/dist/{chunk-3YY7IXIL.js → chunk-6YUNI7B5.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-FB5SCCPT.js → chunk-7CGIDRIK.js} +16 -15
- package/node_modules/pi-lens/dist/{chunk-L3CMBQMH.js → chunk-7MAD5ZAY.js} +16 -17
- package/node_modules/pi-lens/dist/{chunk-WDBICWH3.js → chunk-7TNILKGY.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-RORGS5II.js → chunk-A5GRLYPZ.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-MNJIXFX4.js → chunk-AGGUWKRK.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ABPKUVA4.js → chunk-BBET6HD6.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-L5JYIU47.js → chunk-BHWW6FAX.js} +14 -13
- package/node_modules/pi-lens/dist/{chunk-URCQWAQ4.js → chunk-BOPDQ7AZ.js} +23 -21
- package/node_modules/pi-lens/dist/{chunk-KDX35VXP.js → chunk-BQG2QFVO.js} +158 -133
- package/node_modules/pi-lens/dist/{chunk-CB4WHS4H.js → chunk-BUZIQDFS.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-DH5JPM3K.js → chunk-CUDD35TW.js} +10 -9
- package/node_modules/pi-lens/dist/{chunk-AWDSEDER.js → chunk-CZL44WFN.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-N5WSK2K7.js → chunk-DIWK3LBC.js} +12 -15
- package/node_modules/pi-lens/dist/{chunk-24BILSZW.js → chunk-DYRZGUMA.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-PR6PO3ES.js → chunk-FHEV6T4L.js} +22 -18
- package/node_modules/pi-lens/dist/{chunk-DQZFQSR5.js → chunk-FRLAUP2B.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-EKWX4WD3.js → chunk-G6JKM4O7.js} +7 -7
- package/node_modules/pi-lens/dist/chunk-GGYOZWHW.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-XT2HTCJ5.js → chunk-GIRBSBGL.js} +6 -5
- package/node_modules/pi-lens/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
- package/node_modules/pi-lens/dist/{chunk-U6VN4NVL.js → chunk-HHR7WGCI.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
- package/node_modules/pi-lens/dist/{chunk-SNDXCFRS.js → chunk-HUAM7QG3.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-QOE342SU.js → chunk-HXFUTMX2.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-U7BD2QL7.js → chunk-I22THIHI.js} +12 -12
- package/node_modules/pi-lens/dist/chunk-IE5D3RA5.js +58 -0
- package/node_modules/pi-lens/dist/{chunk-DPGEAHZT.js → chunk-IYVYZQRL.js} +10 -16
- package/node_modules/pi-lens/dist/{chunk-3F6BMY53.js → chunk-JBP7KESM.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-U5HPROLA.js → chunk-JE6HKLC7.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-ZE3KXHS7.js → chunk-JPRDTY5S.js} +85 -3
- package/node_modules/pi-lens/dist/{chunk-HO6LWE2E.js → chunk-JYLOYTZD.js} +17 -1
- package/node_modules/pi-lens/dist/{chunk-KW5JQPO5.js → chunk-JZRP4DGP.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-CPSR3AVL.js → chunk-KZ4ALBCH.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6IR3ZYIB.js → chunk-L3CLUGDY.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-LV4UMYVH.js → chunk-L4NEVZ4T.js} +28 -27
- package/node_modules/pi-lens/dist/chunk-LPYTPNOJ.js +22 -0
- package/node_modules/pi-lens/dist/{chunk-WGRJOXED.js → chunk-LSFXZLPW.js} +1016 -636
- package/node_modules/pi-lens/dist/{chunk-LBLBAFG3.js → chunk-MC6VB2E5.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-T7A2HK2B.js → chunk-NSPVR3FN.js} +19 -18
- package/node_modules/pi-lens/dist/{chunk-ZGSJDWQU.js → chunk-O2ARHQKF.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-OXOI55RU.js → chunk-O4N5BQ3T.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-3FRLWYBG.js → chunk-OC7VWJBZ.js} +39 -40
- package/node_modules/pi-lens/dist/chunk-OFNMHPBT.js +89 -0
- package/node_modules/pi-lens/dist/{chunk-HR3OJ3TH.js → chunk-OWTG6UMO.js} +21 -21
- package/node_modules/pi-lens/dist/{chunk-75GAYVNO.js → chunk-OY7WZI7Q.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-ZJTT47IG.js → chunk-OZWXLJMX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-PKLB2XJL.js +8 -0
- package/node_modules/pi-lens/dist/{chunk-EAOK7MIZ.js → chunk-PKSUMEPT.js} +17 -4
- package/node_modules/pi-lens/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-4L36HG27.js → chunk-R2QQC33W.js} +14 -14
- package/node_modules/pi-lens/dist/{chunk-LUBPZN36.js → chunk-R4QWJQ2H.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-Y7F7IEE3.js → chunk-RZG472YW.js} +65 -7
- package/node_modules/pi-lens/dist/{chunk-PUZ3E2J4.js → chunk-SDFKOLSF.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-YHC2O2WO.js → chunk-SFLHSL5R.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-CCV2EU7T.js → chunk-SP4TFY5F.js} +14 -13
- package/node_modules/pi-lens/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
- package/node_modules/pi-lens/dist/{chunk-3K2F6UDZ.js → chunk-T2S3FNNJ.js} +44 -42
- package/node_modules/pi-lens/dist/{chunk-2TF6RXWB.js → chunk-TV6RXRYH.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-F7K5IBZG.js → chunk-UHHLR2VY.js} +40 -40
- package/node_modules/pi-lens/dist/chunk-UYXV5NIS.js +20 -0
- package/node_modules/pi-lens/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-VUZWQ7UG.js → chunk-VN3L2JWZ.js} +46 -72
- package/node_modules/pi-lens/dist/{chunk-NA7SEXHE.js → chunk-VOP4PJKA.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-LLS45EWB.js → chunk-VPLBLWFO.js} +6 -8
- package/node_modules/pi-lens/dist/chunk-W3BGKBBK.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
- package/node_modules/pi-lens/dist/{chunk-YVHBNSME.js → chunk-WMDUT4KH.js} +1148 -1132
- package/node_modules/pi-lens/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-WXUDRAG6.js +24 -0
- package/node_modules/pi-lens/dist/{chunk-KPPJTH44.js → chunk-X35S7HSB.js} +28 -10
- package/node_modules/pi-lens/dist/{chunk-JMEKXFOL.js → chunk-X66YJ2SS.js} +40 -34
- package/node_modules/pi-lens/dist/{chunk-CE6VMBCB.js → chunk-XOMGO63G.js} +22 -21
- package/node_modules/pi-lens/dist/{chunk-LS3QJRUB.js → chunk-XWIME22V.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-R5MOQM2H.js → chunk-XYLC35E4.js} +119 -87
- package/node_modules/pi-lens/dist/{chunk-OE5ZBP7F.js → chunk-YHGYAEFH.js} +18 -18
- package/node_modules/pi-lens/dist/{chunk-7E2563GA.js → chunk-ZFORSIED.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-E7HJ56Y7.js → chunk-ZKLTNLAW.js} +64 -73
- package/node_modules/pi-lens/dist/chunk-ZONZ6YY3.js +74 -0
- package/node_modules/pi-lens/dist/chunk-ZSM35JF4.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-RC2Z6K47.js → chunk-ZZDIOAAJ.js} +15 -6
- package/node_modules/pi-lens/dist/index.js +6993 -5396
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -10
- package/node_modules/pi-lens/dist/mcp/cli.js +44 -42
- package/node_modules/pi-lens/dist/mcp/server.js +1627 -504
- package/node_modules/pi-lens/dist/mcp/worker.js +62 -61
- package/node_modules/pi-lens/dist/probes/installer.js +20 -19
- package/node_modules/pi-lens/docs/adr/0003-git-guard-latch-writer.md +11 -6
- package/node_modules/pi-lens/docs/agent-tools.md +18 -8
- package/node_modules/pi-lens/docs/alignment-families.md +29 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +6 -4
- package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +126 -0
- package/node_modules/pi-lens/docs/configuration.md +99 -3
- package/node_modules/pi-lens/docs/defect-shapes.md +55 -12
- package/node_modules/pi-lens/docs/engineering-principles.md +27 -2
- package/node_modules/pi-lens/docs/features.md +2 -2
- package/node_modules/pi-lens/docs/invariants/git-guard-host.md +7 -3
- package/node_modules/pi-lens/docs/invariants/language-config.md +15 -4
- package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +16 -2
- package/node_modules/pi-lens/docs/invariants/paths-os.md +4 -2
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +119 -39
- package/node_modules/pi-lens/docs/merge-queue-rollout.md +1 -1
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +24 -17
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +20 -11
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +9 -0
- package/node_modules/pi-lens/docs/pi-lens-orchestration.md +4 -1
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +5 -5
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +6 -3
- package/node_modules/pi-lens/docs/public-api-stability.md +18 -2
- package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +10 -0
- package/node_modules/pi-lens/docs/settings.md +10 -6
- package/node_modules/pi-lens/docs/word-index.md +17 -5
- package/node_modules/pi-lens/package.json +5 -3
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/self-scan-baseline.json +1 -1
- package/node_modules/pi-provider-qoder/README.md +22 -0
- package/node_modules/pi-provider-qoder/dist/index.js +375 -12
- package/node_modules/pi-provider-qoder/package.json +5 -2
- package/package.json +17 -13
- package/node_modules/@tifan/pi-preferred-thinking/README.md +0 -54
- package/node_modules/@tifan/pi-preferred-thinking/package.json +0 -43
- package/node_modules/@tifan/pi-preferred-thinking/src/index.ts +0 -236
- package/node_modules/pi-lens/dist/chunk-46TNM7XZ.js +0 -88
- package/node_modules/pi-lens/dist/chunk-72OKUXSD.js +0 -31
- package/node_modules/pi-lens/dist/chunk-7GLOLOSH.js +0 -57
- package/node_modules/pi-lens/dist/chunk-AKUUMGD5.js +0 -26
- package/node_modules/pi-lens/dist/chunk-ASUXV767.js +0 -22
- package/node_modules/pi-lens/dist/chunk-CTADOKYM.js +0 -25
- package/node_modules/pi-lens/dist/chunk-JJ2RRESP.js +0 -58
- package/node_modules/pi-lens/dist/chunk-LSC3VADM.js +0 -23
- package/node_modules/pi-lens/dist/chunk-SHLDT3OI.js +0 -27
- package/node_modules/pi-lens/dist/chunk-UF7RTZSO.js +0 -27
- package/node_modules/pi-lens/dist/chunk-W4WP2ERB.js +0 -30
- package/node_modules/pi-lens/dist/chunk-YES5CACN.js +0 -73
|
@@ -33,7 +33,7 @@ pi install git:github.com/HerbertGao/pi-extensions
|
|
|
33
33
|
| 配置面板 | `Style / Features / UI / Diff / Thinking / Footer` 六页签 | `/ccstyle` |
|
|
34
34
|
| 上下文检查 | 查看上下文占用,并预览 System prompt、Memory、Skills、Tools definition 和消息内容 | `/context` |
|
|
35
35
|
| Session/Subagent 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@` |
|
|
36
|
-
| 状态栏 |
|
|
36
|
+
| 状态栏 | 显示:模型、上下文、缓存、费用、本次对话累计 token、git并适配 @narumitw/pi-usage 实时显示额度;git/缓存图标可关 Nerd Font | `/ccstyle` |
|
|
37
37
|
| 主题 | 随包提供内置 CC Dark、CC Light 主题 | `/settings` → Theme |
|
|
38
38
|
|
|
39
39
|
`on` / `compact` 两种模式的渲染样例:[默认模式](./docs/tool-render-examples-default.md) · [紧凑模式](./docs/tool-render-examples-compact.md)
|
|
@@ -77,19 +77,22 @@ pi install git:github.com/HerbertGao/pi-extensions
|
|
|
77
77
|
|
|
78
78
|
// thinking
|
|
79
79
|
"useSummaryTitlesAsThinkingTitle": true, // 用最新摘要作思考标题
|
|
80
|
-
"previewLines": 3, //
|
|
80
|
+
"previewLines": 3, // 思考中的预览行数,0 隐藏
|
|
81
|
+
"completedPreviewLines": null, // 完成态预览行数,0 隐藏;null 跟随 previewLines。面板可输入任意值或 follow
|
|
81
82
|
"animationIntervalMs": 90, // 标题动画间隔(毫秒)
|
|
82
83
|
|
|
83
84
|
// footer
|
|
84
85
|
"enableCustomFooter": true, // 自定义状态栏
|
|
85
|
-
"footerTokenRate": true,
|
|
86
|
-
"footerTokenRateMode": "average",
|
|
86
|
+
"footerTokenRate": true, // 输出速率芯片;false 隐藏
|
|
87
|
+
"footerTokenRateMode": "average", // average:整段指令平均(avg);live:最近 1 秒瞬时(live)
|
|
88
|
+
"footerTokenRateTtft": true, // 速率芯片是否带 TTFT;false 只显示 tok/s
|
|
89
|
+
"footerSessionTokens": false, // 本次对话累计 token 芯片(∑);累加会话条目的 usage.totalTokens,默认关
|
|
87
90
|
"footerCurrency": "USD", // 底栏费用的显示币种
|
|
88
91
|
"footerCurrencyRate": null, // 1 单位费用换成多少显示币种;null 只换符号、不乘倍率
|
|
89
92
|
"footerNerdIcons": true, // git/缓存用 Nerd Font 图标;false 为纯文本
|
|
90
93
|
"footerGitStatsMode": "working", // working(默认):未提交改动;branch:分支累计净改动
|
|
91
94
|
"footerHiddenKeys": [], // 隐藏的芯片 key
|
|
92
|
-
"footerLine1Keys": ["model", "context", "cache", "rate", "cost", "pi-usage"], // 每行芯片顺序;内置项与插件同一套排布
|
|
95
|
+
"footerLine1Keys": ["model", "context", "cache", "rate", "cost", "tokens", "pi-usage"], // 每行芯片顺序;内置项与插件同一套排布
|
|
93
96
|
"footerLine2Keys": ["cwd", "git"], // cwd:目录和会话名;git:分支和改动。可换到任意行
|
|
94
97
|
"footerLine3Keys": [] // 有可见芯片才占行
|
|
95
98
|
}
|
|
@@ -113,7 +116,7 @@ pi -e . # 只跑一次,不改 settings.json
|
|
|
113
116
|
|
|
114
117
|
## 兼容性
|
|
115
118
|
|
|
116
|
-
- Node.js `>=22.19.0`;monorepo 使用 Pi `1.
|
|
119
|
+
- Node.js `>=22.19.0`;monorepo 使用 Pi `1.5.0`,发布包的 Pi peer 版本保持 `*`。
|
|
117
120
|
|
|
118
121
|
## 推荐搭配
|
|
119
122
|
|
|
@@ -125,7 +128,7 @@ pi -e . # 只跑一次,不改 settings.json
|
|
|
125
128
|
|
|
126
129
|
## 致谢
|
|
127
130
|
|
|
128
|
-
- 基于 [`minuque/pi-cc-extensions`](https://github.com/minuque/pi-cc-extensions) 1.0.
|
|
131
|
+
- 基于 [`minuque/pi-cc-extensions`](https://github.com/minuque/pi-cc-extensions) 1.0.13(MIT),上游基线 [`2ee840f`](https://github.com/minuque/pi-cc-extensions/commit/2ee840f0049be01e352a86f96a6c6e8be9f74670);保留本仓库的配置迁移与兼容性补丁。
|
|
129
132
|
- Rich diff 改编自 [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display)(MIT);详见 [`extensions/renderer/tool/diff/ATTRIBUTION.md`](./extensions/renderer/tool/diff/ATTRIBUTION.md)。
|
|
130
133
|
|
|
131
134
|
## 许可证
|
|
@@ -62,6 +62,8 @@ export type Config = {
|
|
|
62
62
|
toolLabelClip: number;
|
|
63
63
|
useSummaryTitlesAsThinkingTitle: boolean;
|
|
64
64
|
previewLines: number;
|
|
65
|
+
/** 思考完成后的折叠预览行数;null = 跟随 previewLines(保持旧行为)。 */
|
|
66
|
+
completedPreviewLines: number | null;
|
|
65
67
|
animationIntervalMs: number;
|
|
66
68
|
showStartupHeader: boolean;
|
|
67
69
|
/** fullscreen:userMessage 正文首行滚出视口上沿后钉住,直到下一条指令接手。 */
|
|
@@ -85,6 +87,8 @@ export type Config = {
|
|
|
85
87
|
footerTokenRateMode: FooterTokenRateMode;
|
|
86
88
|
/** 速率芯片是否带 TTFT。关则只显示速率。 */
|
|
87
89
|
footerTokenRateTtft: boolean;
|
|
90
|
+
/** 会话累计 token 芯片(累加会话条目的 usage.totalTokens)。默认关。 */
|
|
91
|
+
footerSessionTokens: boolean;
|
|
88
92
|
/** ISO 4217 显示币种。USD 时不换算。 */
|
|
89
93
|
footerCurrency: string;
|
|
90
94
|
/** 1 单位费用对应的显示币种数量。null 只换符号、不乘倍率。 */
|
|
@@ -119,6 +123,8 @@ export const EXPANDED_OUTPUT_MAX_LINES_VALUES = ["10", "20", "40", "80", "120"];
|
|
|
119
123
|
/** 工具摘要里 path/command 等输入的折叠字符数;0 = 只按可用宽度截断。 */
|
|
120
124
|
export const TOOL_LABEL_CLIP_VALUES = ["0", "40", "60", "80", "100", "120", "160"];
|
|
121
125
|
export const THINKING_PREVIEW_LINES_VALUES = ["0", "1", "3", "5", "10"];
|
|
126
|
+
/** 完成态思考预览预设;follow = 跟随 previewLines。 */
|
|
127
|
+
export const COMPLETED_THINKING_PREVIEW_LINES_VALUES = ["follow", ...THINKING_PREVIEW_LINES_VALUES];
|
|
122
128
|
export const THINKING_ANIMATION_INTERVAL_VALUES = ["40", "60", "90", "120", "180"];
|
|
123
129
|
/** Tools commonly toggled in excludeRenderers via the settings panel. */
|
|
124
130
|
export const EXCLUDE_RENDERER_CANDIDATES = [
|
|
@@ -150,6 +156,7 @@ export const DEFAULT_CONFIG: Config = {
|
|
|
150
156
|
toolLabelClip: 0,
|
|
151
157
|
useSummaryTitlesAsThinkingTitle: true,
|
|
152
158
|
previewLines: 3,
|
|
159
|
+
completedPreviewLines: null,
|
|
153
160
|
animationIntervalMs: 90,
|
|
154
161
|
showStartupHeader: true,
|
|
155
162
|
stickyUserMessage: true,
|
|
@@ -166,6 +173,7 @@ export const DEFAULT_CONFIG: Config = {
|
|
|
166
173
|
footerTokenRate: true,
|
|
167
174
|
footerTokenRateMode: "average",
|
|
168
175
|
footerTokenRateTtft: true,
|
|
176
|
+
footerSessionTokens: false,
|
|
169
177
|
footerCurrency: "USD",
|
|
170
178
|
footerCurrencyRate: null,
|
|
171
179
|
footerNerdIcons: true,
|
|
@@ -196,6 +204,13 @@ export function pickPositiveNumber(value: unknown, fallback: number, min = 1): n
|
|
|
196
204
|
return Number.isFinite(n) ? Math.max(min, n) : fallback;
|
|
197
205
|
}
|
|
198
206
|
|
|
207
|
+
/** 思考完成后的预览行数。null(缺失/空/非法)= 跟随 previewLines,保持旧配置行为。 */
|
|
208
|
+
export function pickCompletedPreviewLines(value: unknown): number | null {
|
|
209
|
+
if (value === undefined || value === null || value === "") return null;
|
|
210
|
+
const n = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
211
|
+
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : null;
|
|
212
|
+
}
|
|
213
|
+
|
|
199
214
|
function normalizeCurrency(value: unknown): string {
|
|
200
215
|
return typeof value === "string" && /^[A-Za-z]{3}$/.test(value.trim())
|
|
201
216
|
? value.trim().toUpperCase()
|
|
@@ -277,6 +292,7 @@ export function normalizeConfig(input: unknown): Config {
|
|
|
277
292
|
0,
|
|
278
293
|
Number.MAX_SAFE_INTEGER,
|
|
279
294
|
),
|
|
295
|
+
completedPreviewLines: pickCompletedPreviewLines(source.completedPreviewLines),
|
|
280
296
|
animationIntervalMs: pickPositiveNumber(
|
|
281
297
|
source.animationIntervalMs,
|
|
282
298
|
DEFAULT_CONFIG.animationIntervalMs,
|
|
@@ -304,6 +320,7 @@ export function normalizeConfig(input: unknown): Config {
|
|
|
304
320
|
DEFAULT_CONFIG.footerTokenRateMode,
|
|
305
321
|
),
|
|
306
322
|
footerTokenRateTtft: source.footerTokenRateTtft !== false,
|
|
323
|
+
footerSessionTokens: source.footerSessionTokens === true,
|
|
307
324
|
footerCurrency: normalizeCurrency(source.footerCurrency),
|
|
308
325
|
footerCurrencyRate: normalizeFooterCurrencyRate(source.footerCurrencyRate),
|
|
309
326
|
footerNerdIcons: source.footerNerdIcons !== false,
|
|
@@ -320,6 +337,7 @@ export function getCompactThinkingConfig(source: Config = config): CompactThinki
|
|
|
320
337
|
return {
|
|
321
338
|
useSummaryTitlesAsThinkingTitle: source.useSummaryTitlesAsThinkingTitle,
|
|
322
339
|
previewLines: source.previewLines,
|
|
340
|
+
completedPreviewLines: source.completedPreviewLines,
|
|
323
341
|
animationIntervalMs: source.animationIntervalMs,
|
|
324
342
|
};
|
|
325
343
|
}
|
|
@@ -393,6 +411,7 @@ export function formatConfigStatus(source: Config = config): string {
|
|
|
393
411
|
`toolLabelClip=${source.toolLabelClip}`,
|
|
394
412
|
`thinkingTitle=${source.useSummaryTitlesAsThinkingTitle ? "summary" : "default"}`,
|
|
395
413
|
`thinkingPreview=${source.previewLines}`,
|
|
414
|
+
`thinkingPreviewDone=${source.completedPreviewLines ?? "follow"}`,
|
|
396
415
|
`thinkingAnimation=${source.animationIntervalMs}ms`,
|
|
397
416
|
`startupHeader=${source.showStartupHeader ? "on" : "off"}`,
|
|
398
417
|
`stickyUserMessage=${source.stickyUserMessage ? "on" : "off"}`,
|
|
@@ -409,6 +428,7 @@ export function formatConfigStatus(source: Config = config): string {
|
|
|
409
428
|
`footerTokenRate=${source.footerTokenRate ? "on" : "off"}`,
|
|
410
429
|
`footerTokenRateMode=${source.footerTokenRateMode}`,
|
|
411
430
|
`footerTokenRateTtft=${source.footerTokenRateTtft ? "on" : "off"}`,
|
|
431
|
+
`footerSessionTokens=${source.footerSessionTokens ? "on" : "off"}`,
|
|
412
432
|
`footerCurrency=${source.footerCurrency}`,
|
|
413
433
|
`footerRate=${source.footerCurrencyRate ?? "-"}`,
|
|
414
434
|
`footerIcons=${source.footerNerdIcons ? "nerd" : "plain"}`,
|
|
@@ -33,6 +33,7 @@ import { applyStartupHeader, clearStartupHeader } from "../feature/shell/startup
|
|
|
33
33
|
import type { ToolGroupingHooks } from "../renderer/tool/grouping.ts";
|
|
34
34
|
import {
|
|
35
35
|
config,
|
|
36
|
+
COMPLETED_THINKING_PREVIEW_LINES_VALUES,
|
|
36
37
|
DEFAULT_CONFIG,
|
|
37
38
|
DIFF_COLLAPSED_LINES_VALUES,
|
|
38
39
|
DIFF_INDICATOR_MODES,
|
|
@@ -45,6 +46,7 @@ import {
|
|
|
45
46
|
FOOTER_TOKEN_RATE_MODES,
|
|
46
47
|
formatExcludeRenderers,
|
|
47
48
|
getCompactThinkingConfig,
|
|
49
|
+
pickCompletedPreviewLines,
|
|
48
50
|
pickPositiveInt,
|
|
49
51
|
pickPositiveNumber,
|
|
50
52
|
pickToolLabelClip,
|
|
@@ -111,6 +113,12 @@ function footerTokenRateTtftDescription(enabled: boolean): string {
|
|
|
111
113
|
: "Time to first token hidden. The rate chip shows tok/s only.";
|
|
112
114
|
}
|
|
113
115
|
|
|
116
|
+
function footerSessionTokensDescription(enabled: boolean): string {
|
|
117
|
+
return enabled
|
|
118
|
+
? "Cumulative tokens used in this conversation, summed from the session's usage.totalTokens. Turn off to hide it."
|
|
119
|
+
: "Conversation token total hidden.";
|
|
120
|
+
}
|
|
121
|
+
|
|
114
122
|
function footerGitStatsDescription(mode: FooterGitStatsMode): string {
|
|
115
123
|
return mode === "branch"
|
|
116
124
|
? "Net changes since the merge base, including uncommitted edits. Base: origin/HEAD, then local main/master. Untracked files excluded; unavailable stats hidden."
|
|
@@ -364,20 +372,28 @@ function buildValueInputSubmenu(
|
|
|
364
372
|
};
|
|
365
373
|
}
|
|
366
374
|
|
|
367
|
-
/**
|
|
375
|
+
/** 数值项:预填当前值,空输入取消,非法输入留下错误;allowFollow 时额外接受 follow。 */
|
|
368
376
|
function buildNumberInputSubmenu(
|
|
369
377
|
theme: any,
|
|
370
378
|
setting: { label: string; currentValue: string },
|
|
371
379
|
closeSubmenu: (selected?: string) => void,
|
|
380
|
+
allowFollow = false,
|
|
372
381
|
) {
|
|
373
382
|
return buildValueInputSubmenu(
|
|
374
383
|
theme,
|
|
375
384
|
{
|
|
376
385
|
prompt: ` ${setting.label} — custom value:`,
|
|
377
386
|
initial: setting.currentValue,
|
|
378
|
-
hint:
|
|
379
|
-
|
|
380
|
-
|
|
387
|
+
hint: allowFollow
|
|
388
|
+
? " Enter to apply · Esc to go back · follow = Preview lines"
|
|
389
|
+
: " Enter to apply · Esc to go back",
|
|
390
|
+
accept: (raw) =>
|
|
391
|
+
raw === ""
|
|
392
|
+
? undefined
|
|
393
|
+
: (allowFollow && raw === "follow") || Number.isFinite(Number(raw))
|
|
394
|
+
? raw
|
|
395
|
+
: null,
|
|
396
|
+
invalid: (raw) => `${allowFollow ? "Invalid value" : "Invalid number"}: "${raw}"`,
|
|
381
397
|
},
|
|
382
398
|
closeSubmenu,
|
|
383
399
|
);
|
|
@@ -576,12 +592,23 @@ export async function showCcstylePanel(
|
|
|
576
592
|
const thinkingPreviewSetting = {
|
|
577
593
|
id: "previewLines",
|
|
578
594
|
label: "Preview lines",
|
|
579
|
-
description: "Thinking preview lines; 0 hides the preview body.",
|
|
595
|
+
description: "Thinking preview lines while a run is in progress; 0 hides the preview body.",
|
|
580
596
|
currentValue: String(config.previewLines),
|
|
581
597
|
values: [...THINKING_PREVIEW_LINES_VALUES],
|
|
582
598
|
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
583
599
|
buildNumberInputSubmenu(theme, thinkingPreviewSetting, closeSubmenu),
|
|
584
600
|
};
|
|
601
|
+
const completedThinkingPreviewSetting = {
|
|
602
|
+
id: "completedPreviewLines",
|
|
603
|
+
label: "Completed preview",
|
|
604
|
+
description:
|
|
605
|
+
"Thinking preview lines once the run finishes; follow = same as Preview lines. Enter to type a custom value or follow.",
|
|
606
|
+
currentValue:
|
|
607
|
+
config.completedPreviewLines === null ? "follow" : String(config.completedPreviewLines),
|
|
608
|
+
values: [...COMPLETED_THINKING_PREVIEW_LINES_VALUES],
|
|
609
|
+
submenu: (_current: string, closeSubmenu: (selected?: string) => void) =>
|
|
610
|
+
buildNumberInputSubmenu(theme, completedThinkingPreviewSetting, closeSubmenu, true),
|
|
611
|
+
};
|
|
585
612
|
const thinkingAnimationSetting = {
|
|
586
613
|
id: "animationIntervalMs",
|
|
587
614
|
label: "Animation interval ms",
|
|
@@ -782,6 +809,13 @@ export async function showCcstylePanel(
|
|
|
782
809
|
currentValue: config.footerTokenRateTtft ? "on" : "off",
|
|
783
810
|
values: ["on", "off"],
|
|
784
811
|
};
|
|
812
|
+
const footerSessionTokensSetting = {
|
|
813
|
+
id: "footerSessionTokens",
|
|
814
|
+
label: "Conversation tokens",
|
|
815
|
+
description: footerSessionTokensDescription(config.footerSessionTokens),
|
|
816
|
+
currentValue: config.footerSessionTokens ? "on" : "off",
|
|
817
|
+
values: ["on", "off"],
|
|
818
|
+
};
|
|
785
819
|
const pluginChipsSetting = {
|
|
786
820
|
id: "footerPluginChips",
|
|
787
821
|
label: "Footer chips",
|
|
@@ -880,6 +914,14 @@ export async function showCcstylePanel(
|
|
|
880
914
|
ctx.ui.notify(`Updated ${id}: ${value}`, "info");
|
|
881
915
|
return;
|
|
882
916
|
}
|
|
917
|
+
if (id === "footerSessionTokens") {
|
|
918
|
+
const enabled = value === "on";
|
|
919
|
+
updateConfig({ footerSessionTokens: enabled });
|
|
920
|
+
footerSessionTokensSetting.currentValue = enabled ? "on" : "off";
|
|
921
|
+
footerSessionTokensSetting.description = footerSessionTokensDescription(enabled);
|
|
922
|
+
ctx.ui.notify(`Updated ${id}: ${value}`, "info");
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
883
925
|
if (id === "enableEditorPrefix") {
|
|
884
926
|
const enabled = value === "on";
|
|
885
927
|
updateConfig({ enableEditorPrefix: enabled });
|
|
@@ -1008,6 +1050,13 @@ export async function showCcstylePanel(
|
|
|
1008
1050
|
updateConfig({ previewLines: pickPositiveInt(value, DEFAULT_CONFIG.previewLines, 0) });
|
|
1009
1051
|
thinkingPreviewSetting.currentValue = String(config.previewLines);
|
|
1010
1052
|
break;
|
|
1053
|
+
case "completedPreviewLines":
|
|
1054
|
+
updateConfig({
|
|
1055
|
+
completedPreviewLines: value === "follow" ? null : pickCompletedPreviewLines(value),
|
|
1056
|
+
});
|
|
1057
|
+
completedThinkingPreviewSetting.currentValue =
|
|
1058
|
+
config.completedPreviewLines === null ? "follow" : String(config.completedPreviewLines);
|
|
1059
|
+
break;
|
|
1011
1060
|
case "animationIntervalMs":
|
|
1012
1061
|
updateConfig({
|
|
1013
1062
|
animationIntervalMs: pickPositiveNumber(value, DEFAULT_CONFIG.animationIntervalMs),
|
|
@@ -1095,7 +1144,12 @@ export async function showCcstylePanel(
|
|
|
1095
1144
|
{
|
|
1096
1145
|
id: "thinking",
|
|
1097
1146
|
label: "Thinking",
|
|
1098
|
-
items: [
|
|
1147
|
+
items: [
|
|
1148
|
+
thinkingTitleSetting,
|
|
1149
|
+
thinkingPreviewSetting,
|
|
1150
|
+
completedThinkingPreviewSetting,
|
|
1151
|
+
thinkingAnimationSetting,
|
|
1152
|
+
],
|
|
1099
1153
|
},
|
|
1100
1154
|
{
|
|
1101
1155
|
id: "footer",
|
|
@@ -1105,6 +1159,7 @@ export async function showCcstylePanel(
|
|
|
1105
1159
|
footerTokenRateSetting,
|
|
1106
1160
|
footerTokenRateModeSetting,
|
|
1107
1161
|
footerTokenRateTtftSetting,
|
|
1162
|
+
footerSessionTokensSetting,
|
|
1108
1163
|
footerCurrencySetting,
|
|
1109
1164
|
footerCurrencyRateSetting,
|
|
1110
1165
|
footerNerdIconsSetting,
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* 计数:bash/powershell 按调用次数;read/edit/write 按非空 path/file_path 去重;other 按调用次数。
|
|
6
6
|
* 失败单独累计;另记回合耗时。
|
|
7
7
|
*
|
|
8
|
-
* 呈现:`
|
|
8
|
+
* 呈现:`summarySegments` 分段(文字 + 语义色),渲染层自己拼行并上色。
|
|
9
|
+
* 不要经 Markdown 渲染:pi 的 Markdown 组件会剥掉输入里的终端序列,数字会失去语义色。
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
12
|
-
import { formatDuration } from "../../utils/format.ts";
|
|
13
13
|
|
|
14
14
|
/** 工具分类。 */
|
|
15
15
|
export type AgentToolCategory = "bash" | "read" | "edit" | "write" | "other";
|
|
@@ -113,25 +113,20 @@ function summaryParts(data: AgentSummaryData): string[] {
|
|
|
113
113
|
return parts;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
):
|
|
116
|
+
/** 摘要段:一段文字 + 语义色;数字上色由渲染层完成。 */
|
|
117
|
+
export type SummarySegment = { text: string; tone: "success" | "failed" };
|
|
118
|
+
|
|
119
|
+
export function summarySegments(data: AgentSummaryData): SummarySegment[] {
|
|
120
120
|
const parts = summaryParts(data);
|
|
121
|
-
if (parts.length === 0) return
|
|
121
|
+
if (parts.length === 0) return [];
|
|
122
122
|
const capitalizeFirst = (part: string, first: boolean) => {
|
|
123
123
|
const verb = part.match(/^[a-z]+/)?.[0] ?? "";
|
|
124
124
|
return first && verb ? verb[0].toUpperCase() + verb.slice(1) + part.slice(verb.length) : part;
|
|
125
125
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.map((part) => paintNumber(part.endsWith("failed") ? colors.failed : colors.success, part))
|
|
131
|
-
.join(", ");
|
|
132
|
-
const duration = formatDuration(data.durationMs);
|
|
133
|
-
const line = duration ? `${text} · ${duration}` : text;
|
|
134
|
-
return `> *${line}*`;
|
|
126
|
+
return parts.map((part, index) => ({
|
|
127
|
+
text: capitalizeFirst(part, index === 0),
|
|
128
|
+
tone: part.endsWith("failed") ? "failed" : "success",
|
|
129
|
+
}));
|
|
135
130
|
}
|
|
136
131
|
|
|
137
132
|
/**
|
|
@@ -1,27 +1,76 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent 回合摘要展示:agent_end 时把本回合工具统计写入会话条目,
|
|
3
|
-
* 由 entry renderer
|
|
3
|
+
* 由 entry renderer 渲染成一行引用行 `│ Ran 1 command, wrote 1 file · 15s`。
|
|
4
4
|
*
|
|
5
5
|
* 统计复用 ./core.ts(bash|powershell/read/edit/write/other)。
|
|
6
6
|
* appendEntry 不进 LLM 上下文,只显示在聊天区。
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
|
+
* 不走 Markdown:pi 的 Markdown 组件会剥掉输入里的终端序列,
|
|
9
|
+
* 数字的语义色只能由组件自己拼。竖线取 mdQuoteBorder,文字取 mdQuote + 斜体,数字取 success/error。
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
|
-
import {
|
|
11
|
-
import { getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
12
|
+
import { wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
12
13
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
13
|
-
import {
|
|
14
|
+
import { formatDuration } from "../../utils/format.ts";
|
|
15
|
+
import { bindAgentSummary, summarySegments, type SummarySegment } from "./core.ts";
|
|
16
|
+
import type { AgentSummaryData } from "./core.ts";
|
|
14
17
|
|
|
15
18
|
export const AGENT_SUMMARY_ENTRY_TYPE = "agent-summary";
|
|
16
19
|
|
|
20
|
+
type SummaryTheme = {
|
|
21
|
+
fg(color: string, text: string): string;
|
|
22
|
+
italic(text: string): string;
|
|
23
|
+
getFgAnsi(color: string): string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** 取样式函数在正文前产生的 SGR 前缀;行内 reset 之后要靠它把样式续上。 */
|
|
27
|
+
function stylePrefix(style: (text: string) => string): string {
|
|
28
|
+
const sentinel = "\u0000";
|
|
29
|
+
const styled = style(sentinel);
|
|
30
|
+
const index = styled.indexOf(sentinel);
|
|
31
|
+
return index >= 0 ? styled.slice(0, index) : "";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 只给段内第一个数字上色;没有数字的段原样返回。 */
|
|
35
|
+
function paintNumber(segment: SummarySegment, theme: SummaryTheme): string {
|
|
36
|
+
const match = /(\d+)/.exec(segment.text);
|
|
37
|
+
if (!match) return segment.text;
|
|
38
|
+
const ansi = theme.getFgAnsi(segment.tone === "failed" ? "error" : "success");
|
|
39
|
+
if (!ansi) return segment.text;
|
|
40
|
+
const start = match.index;
|
|
41
|
+
return `${segment.text.slice(0, start)}${ansi}${match[1]}\x1b[0m${segment.text.slice(start + match[1].length)}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** 摘要行:左侧 mdQuoteBorder 竖线 + 斜体 mdQuote 正文,数字按成功/失败上色。 */
|
|
45
|
+
class AgentSummaryLine {
|
|
46
|
+
private readonly body: string;
|
|
47
|
+
private readonly border: string;
|
|
48
|
+
private readonly theme: SummaryTheme;
|
|
49
|
+
|
|
50
|
+
constructor(segments: readonly SummarySegment[], duration: string, theme: SummaryTheme) {
|
|
51
|
+
this.theme = theme;
|
|
52
|
+
this.border = theme.fg("mdQuoteBorder", "│");
|
|
53
|
+
const quoteStyle = (text: string) => theme.italic(theme.fg("mdQuote", text));
|
|
54
|
+
const counts = segments.map((segment) => paintNumber(segment, theme)).join(", ");
|
|
55
|
+
const text = duration ? `${counts} · ${duration}` : counts;
|
|
56
|
+
const prefix = stylePrefix(quoteStyle);
|
|
57
|
+
this.body = quoteStyle(prefix ? text.replace(/\x1b\[0m/g, `\x1b[0m${prefix}`) : text);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
invalidate(): void {}
|
|
61
|
+
|
|
62
|
+
render(width: number): string[] {
|
|
63
|
+
const contentWidth = Math.max(1, width - 4);
|
|
64
|
+
return wrapTextWithAnsi(this.body, contentWidth).map((line) => ` ${this.border} ${line}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
17
68
|
export default function (pi: ExtensionAPI): void {
|
|
18
69
|
pi.registerEntryRenderer(AGENT_SUMMARY_ENTRY_TYPE, (entry, _options, theme) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!line) return undefined;
|
|
24
|
-
return new Markdown(line, 1, 0, getMarkdownTheme());
|
|
70
|
+
const segments = summarySegments(entry.data as AgentSummaryData);
|
|
71
|
+
if (segments.length === 0) return undefined;
|
|
72
|
+
const duration = formatDuration((entry.data as AgentSummaryData).durationMs);
|
|
73
|
+
return new AgentSummaryLine(segments, duration, theme as unknown as SummaryTheme);
|
|
25
74
|
});
|
|
26
75
|
|
|
27
76
|
bindAgentSummary(pi, (data) => {
|
|
@@ -41,6 +41,8 @@ type AssistantMessageComponentLike = InstanceType<typeof AssistantMessageCompone
|
|
|
41
41
|
export type CompactThinkingConfig = {
|
|
42
42
|
useSummaryTitlesAsThinkingTitle: boolean;
|
|
43
43
|
previewLines: number;
|
|
44
|
+
/** 思考完成后的折叠预览行数;null = 跟随 previewLines(保持旧行为)。 */
|
|
45
|
+
completedPreviewLines: number | null;
|
|
44
46
|
animationIntervalMs: number;
|
|
45
47
|
};
|
|
46
48
|
|
|
@@ -112,6 +114,7 @@ type PatchedPrototype = typeof AssistantMessageComponent.prototype & {
|
|
|
112
114
|
const config: CompactThinkingConfig = {
|
|
113
115
|
useSummaryTitlesAsThinkingTitle: true,
|
|
114
116
|
previewLines: 3,
|
|
117
|
+
completedPreviewLines: null,
|
|
115
118
|
animationIntervalMs: 90,
|
|
116
119
|
};
|
|
117
120
|
|
|
@@ -273,11 +276,12 @@ function layoutThinkingPreview(
|
|
|
273
276
|
text: string,
|
|
274
277
|
width: number,
|
|
275
278
|
padding: number,
|
|
279
|
+
previewLines: number,
|
|
276
280
|
): { visible: string[]; hiddenLines: number } {
|
|
277
|
-
if (!text ||
|
|
281
|
+
if (!text || previewLines <= 0) return { visible: [], hiddenLines: 0 };
|
|
278
282
|
const contentWidth = Math.max(1, width - padding * 2);
|
|
279
283
|
const budget = Math.max(
|
|
280
|
-
width * (
|
|
284
|
+
width * (previewLines + PREVIEW_BUDGET_SLACK_LINES),
|
|
281
285
|
PREVIEW_BUDGET_MIN_CHARS,
|
|
282
286
|
);
|
|
283
287
|
let source = text;
|
|
@@ -298,8 +302,8 @@ function layoutThinkingPreview(
|
|
|
298
302
|
};
|
|
299
303
|
cachePreview(cacheKey, entry);
|
|
300
304
|
}
|
|
301
|
-
const hiddenLines = entry.hiddenBefore + Math.max(0, entry.lines.length -
|
|
302
|
-
const visible = hiddenLines > 0 ? entry.lines.slice(-
|
|
305
|
+
const hiddenLines = entry.hiddenBefore + Math.max(0, entry.lines.length - previewLines);
|
|
306
|
+
const visible = hiddenLines > 0 ? entry.lines.slice(-previewLines) : entry.lines;
|
|
303
307
|
return { visible, hiddenLines };
|
|
304
308
|
}
|
|
305
309
|
|
|
@@ -335,6 +339,8 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
335
339
|
private style: (text: string) => string;
|
|
336
340
|
private theme: Theme | undefined;
|
|
337
341
|
private hintHovered = false;
|
|
342
|
+
/** 构造时的活动态:活动块用 previewLines,完成块用 completedPreviewLines。 */
|
|
343
|
+
private active: boolean;
|
|
338
344
|
private collapsedMemo:
|
|
339
345
|
| {
|
|
340
346
|
width: number;
|
|
@@ -351,8 +357,9 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
351
357
|
padding: number,
|
|
352
358
|
messageTimestamp: number,
|
|
353
359
|
style: (text: string) => string,
|
|
354
|
-
theme
|
|
355
|
-
runStartIndex
|
|
360
|
+
theme: Theme | undefined,
|
|
361
|
+
runStartIndex: number,
|
|
362
|
+
active: boolean,
|
|
356
363
|
) {
|
|
357
364
|
this.heading = heading;
|
|
358
365
|
this.text = text;
|
|
@@ -361,6 +368,14 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
361
368
|
this.runStartIndex = runStartIndex;
|
|
362
369
|
this.style = style;
|
|
363
370
|
this.theme = theme;
|
|
371
|
+
this.active = active;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** 活动块用 previewLines;完成块用 completedPreviewLines(null 跟随 previewLines)。 */
|
|
375
|
+
private effectivePreviewLines(): number {
|
|
376
|
+
return this.active
|
|
377
|
+
? config.previewLines
|
|
378
|
+
: (config.completedPreviewLines ?? config.previewLines);
|
|
364
379
|
}
|
|
365
380
|
|
|
366
381
|
private paint(color: string, text: string): string {
|
|
@@ -393,7 +408,7 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
393
408
|
private headingLines(width: number, hiddenLines: number, padding: number): string[] {
|
|
394
409
|
const hint = this.expanded
|
|
395
410
|
? undefined
|
|
396
|
-
: hiddenPreviewHint(hiddenLines, Boolean(this.text) &&
|
|
411
|
+
: hiddenPreviewHint(hiddenLines, Boolean(this.text) && this.effectivePreviewLines() <= 0);
|
|
397
412
|
if (!hint) return new Text(this.heading, padding, 0).render(width);
|
|
398
413
|
const rawHint = hint.prefix + hint.action + hint.suffix;
|
|
399
414
|
const contentWidth = Math.max(1, width - padding * 2);
|
|
@@ -411,7 +426,7 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
411
426
|
}
|
|
412
427
|
|
|
413
428
|
private bodyLines(width: number, padding: number): { lines: string[]; hiddenLines: number } {
|
|
414
|
-
if (!this.text || (
|
|
429
|
+
if (!this.text || (this.effectivePreviewLines() <= 0 && !this.expanded)) {
|
|
415
430
|
return { lines: [], hiddenLines: 0 };
|
|
416
431
|
}
|
|
417
432
|
if (this.expanded) {
|
|
@@ -420,7 +435,7 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
420
435
|
hiddenLines: 0,
|
|
421
436
|
};
|
|
422
437
|
}
|
|
423
|
-
const preview = layoutThinkingPreview(this.text, width, padding);
|
|
438
|
+
const preview = layoutThinkingPreview(this.text, width, padding, this.effectivePreviewLines());
|
|
424
439
|
return { lines: preview.visible, hiddenLines: preview.hiddenLines };
|
|
425
440
|
}
|
|
426
441
|
|
|
@@ -447,7 +462,7 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
447
462
|
const expandAction = thinkingExpandAction();
|
|
448
463
|
if (
|
|
449
464
|
this.collapsedMemo?.width === width &&
|
|
450
|
-
this.collapsedMemo.previewLines ===
|
|
465
|
+
this.collapsedMemo.previewLines === this.effectivePreviewLines() &&
|
|
451
466
|
this.collapsedMemo.hintHovered === this.hintHovered &&
|
|
452
467
|
this.collapsedMemo.expandAction === expandAction
|
|
453
468
|
) {
|
|
@@ -464,7 +479,7 @@ export class ThinkingPreviewBlock implements Component {
|
|
|
464
479
|
: heading;
|
|
465
480
|
this.collapsedMemo = {
|
|
466
481
|
width,
|
|
467
|
-
previewLines:
|
|
482
|
+
previewLines: this.effectivePreviewLines(),
|
|
468
483
|
hintHovered: this.hintHovered,
|
|
469
484
|
expandAction,
|
|
470
485
|
lines,
|
|
@@ -715,6 +730,8 @@ function compactThinking(pi: ExtensionAPI) {
|
|
|
715
730
|
}
|
|
716
731
|
const runEndIndex = i - 1;
|
|
717
732
|
i--;
|
|
733
|
+
// Keep this run-scoped snapshot: a timestamp-only render query would mark
|
|
734
|
+
// earlier thinking runs active when one message alternates text and thinking.
|
|
718
735
|
const active = isActiveRun(message, runStartIndex, runEndIndex);
|
|
719
736
|
// OpenAI can spend several seconds reasoning before it emits the first
|
|
720
737
|
// summary token. Keep an empty active block visible as animated
|
|
@@ -759,6 +776,7 @@ function compactThinking(pi: ExtensionAPI) {
|
|
|
759
776
|
thinkingStyle,
|
|
760
777
|
activeTheme,
|
|
761
778
|
runStartIndex,
|
|
779
|
+
active,
|
|
762
780
|
),
|
|
763
781
|
);
|
|
764
782
|
|