@herbertgao/pi-extensions 2026.10.12 → 2026.10.14
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 -11
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +7 -9
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +7 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +14 -8
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +22 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +28 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +33 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +60 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +1 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +20 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +42 -18
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +12 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +131 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +217 -113
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +12 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/subagent-notification.ts +556 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +50 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +11 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/patch-keys.ts +4 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +1 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +27 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/config.ts +23 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +15 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +9 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/de.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +8 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/es.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/fr.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt-BR.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/ru.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/uk.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +11 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +49 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +13 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +19 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +36 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +13 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +24 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/transcript.ts +144 -0
- package/node_modules/@narumitw/pi-btw/README.md +7 -2
- package/node_modules/@narumitw/pi-btw/dist/index.ts +371 -118
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
- package/node_modules/@narumitw/pi-btw/docs/main-context-runtime.md +45 -0
- package/node_modules/@narumitw/pi-btw/docs/workflows.md +48 -5
- package/node_modules/@narumitw/pi-btw/package.json +1 -1
- package/node_modules/@narumitw/pi-btw/src/btw.ts +39 -14
- package/node_modules/@narumitw/pi-btw/src/import-main-updates.ts +84 -0
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +29 -4
- package/node_modules/@narumitw/pi-btw/src/main-context-snapshot.ts +125 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +1 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +66 -17
- package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +5 -5
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +47 -6
- package/node_modules/pi-lens/CHANGELOG.md +440 -0
- package/node_modules/pi-lens/README.md +13 -3
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/node_modules/pi-lens/dist/chunk-22Y2BM7H.js +23 -0
- package/node_modules/pi-lens/dist/{chunk-ATKJFDQN.js → chunk-27VWVB23.js} +12 -14
- package/node_modules/pi-lens/dist/{chunk-S2HEXIWI.js → chunk-2FYKETQJ.js} +10 -6
- package/node_modules/pi-lens/dist/{chunk-SRYEJNES.js → chunk-2LDMXL2M.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-ZHH37KZL.js → chunk-2SDHYHHO.js} +17 -17
- package/node_modules/pi-lens/dist/chunk-2Y6OJRSI.js +38 -0
- package/node_modules/pi-lens/dist/chunk-3SNDVPOR.js +507 -0
- package/node_modules/pi-lens/dist/{chunk-5OFV52AM.js → chunk-3WCEHYOI.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-44X7VIKR.js +73 -0
- package/node_modules/pi-lens/dist/{chunk-DEL2U6CM.js → chunk-4FHUGDKU.js} +16 -14
- package/node_modules/pi-lens/dist/{chunk-CT4MN5IU.js → chunk-4ODSZ35Z.js} +353 -359
- package/node_modules/pi-lens/dist/{chunk-ZIVJBOO3.js → chunk-4U7GDSZQ.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-54NIOJJZ.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-N5FLEO7W.js → chunk-5DKE4HGX.js} +37 -37
- package/node_modules/pi-lens/dist/{chunk-P63GXC37.js → chunk-5LRUKYFA.js} +31 -4
- package/node_modules/pi-lens/dist/{chunk-HRNHZA3N.js → chunk-63NMUNYP.js} +12 -16
- package/node_modules/pi-lens/dist/{chunk-HWCCCQNX.js → chunk-6XSESGWD.js} +13 -6
- package/node_modules/pi-lens/dist/{chunk-UMS2MFPZ.js → chunk-72J27ICO.js} +2 -3
- package/node_modules/pi-lens/dist/{chunk-ED36RF6Y.js → chunk-7FLRUH6B.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-7IYC4ENJ.js +297 -0
- package/node_modules/pi-lens/dist/chunk-7WWQAW5P.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-3DA2JDOL.js → chunk-7ZS7MC24.js} +551 -203
- package/node_modules/pi-lens/dist/{chunk-WMYE35PX.js → chunk-AHWA4AKM.js} +7 -5
- package/node_modules/pi-lens/dist/{chunk-JW3YWBVB.js → chunk-AI3GP74G.js} +17 -19
- package/node_modules/pi-lens/dist/{chunk-AGSS7277.js → chunk-APFJKOP6.js} +6 -23
- package/node_modules/pi-lens/dist/{chunk-ZVUL7QYY.js → chunk-ASRAO7KG.js} +29 -32
- package/node_modules/pi-lens/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
- package/node_modules/pi-lens/dist/{chunk-TLX72JTG.js → chunk-CG5V25HX.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-CKEQFGLT.js +32 -0
- package/node_modules/pi-lens/dist/{chunk-Y6GZHWSJ.js → chunk-COOUUC5W.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-XTBDCR27.js → chunk-CPZ5JJW6.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-RKKOYPRA.js → chunk-DS2USX5G.js} +13 -15
- package/node_modules/pi-lens/dist/chunk-EA2ZRG44.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-GSLNCYGG.js → chunk-EDMLIW6W.js} +13 -14
- package/node_modules/pi-lens/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
- package/node_modules/pi-lens/dist/chunk-EKNWOL2I.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-R3T7CLQ2.js → chunk-ELZRSR5N.js} +41 -41
- package/node_modules/pi-lens/dist/{chunk-GMX5OS7B.js → chunk-EN5AM7PX.js} +11 -12
- package/node_modules/pi-lens/dist/{chunk-3RKP3FMS.js → chunk-EWXXLS26.js} +226 -24
- package/node_modules/pi-lens/dist/chunk-EX4EXBW7.js +37 -0
- package/node_modules/pi-lens/dist/{chunk-XHJBS436.js → chunk-EXVXBSGN.js} +25 -25
- package/node_modules/pi-lens/dist/{chunk-MZGQNL3Y.js → chunk-F7BO6FWH.js} +12 -13
- package/node_modules/pi-lens/dist/{chunk-V35JG4JB.js → chunk-FEDWAYDS.js} +152 -334
- package/node_modules/pi-lens/dist/{chunk-J64T55EI.js → chunk-FWZRGGGY.js} +73 -9
- package/node_modules/pi-lens/dist/{chunk-T57LYLZT.js → chunk-G224FADB.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-G5UCJFT7.js +26 -0
- package/node_modules/pi-lens/dist/{chunk-LLJNQKQW.js → chunk-GLW3YDZZ.js} +20 -13
- package/node_modules/pi-lens/dist/{chunk-GXFV6MYU.js → chunk-GTDSYEA2.js} +72 -39
- package/node_modules/pi-lens/dist/{chunk-DUO2TU77.js → chunk-GYRZ72R4.js} +10 -4
- package/node_modules/pi-lens/dist/chunk-HYVXA3BB.js +49 -0
- package/node_modules/pi-lens/dist/{chunk-W66O5E25.js → chunk-IEBJF3PN.js} +13 -15
- package/node_modules/pi-lens/dist/{chunk-GAQ7OQG6.js → chunk-IL7K66ZQ.js} +83 -94
- package/node_modules/pi-lens/dist/{chunk-T7FEBKXN.js → chunk-JWOVP5BL.js} +7 -9
- package/node_modules/pi-lens/dist/{chunk-UBOQLVT2.js → chunk-K2GUZ4DN.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-5VSF4UUQ.js → chunk-K4SZB56V.js} +34 -39
- package/node_modules/pi-lens/dist/{chunk-7D6L4MTX.js → chunk-KCBRHV5E.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-GSM5UU7A.js → chunk-KFXCL4OV.js} +38 -28
- package/node_modules/pi-lens/dist/{chunk-J6MPGQTS.js → chunk-KJJAVH3X.js} +81 -15
- package/node_modules/pi-lens/dist/{chunk-BWD5EPKO.js → chunk-KPVLQHCZ.js} +4 -6
- package/node_modules/pi-lens/dist/{chunk-MPNJLASA.js → chunk-KX56K73G.js} +10 -13
- package/node_modules/pi-lens/dist/{chunk-AWSCPCN2.js → chunk-LMCTHJ2H.js} +19 -19
- package/node_modules/pi-lens/dist/{chunk-IWDLU6K3.js → chunk-MEFLGBCS.js} +4 -6
- package/node_modules/pi-lens/dist/{chunk-TOY6QKOH.js → chunk-MKPCELNI.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-POMLXPMY.js → chunk-N3PLNNCW.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-N5FBM25N.js +22 -0
- package/node_modules/pi-lens/dist/{chunk-CYRKQRPM.js → chunk-NFNVDDGB.js} +2 -4
- package/node_modules/pi-lens/dist/{chunk-RMLC67LF.js → chunk-NLIVE7L6.js} +2 -30
- package/node_modules/pi-lens/dist/{chunk-24AKHFGP.js → chunk-OMJ3OFBJ.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-IQWN5JCP.js → chunk-OZNCKLOX.js} +13 -14
- package/node_modules/pi-lens/dist/chunk-P5XUGPIX.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-2KXTHF3M.js → chunk-PJXNTPB2.js} +253 -33
- package/node_modules/pi-lens/dist/chunk-PKOXJIVT.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-DGUKIYSI.js → chunk-PP2A5V2T.js} +8 -10
- package/node_modules/pi-lens/dist/{chunk-KAPJINKN.js → chunk-Q42LJANT.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-UZ2XCLYS.js → chunk-Q4BKKOVC.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-TIQ2PKDW.js → chunk-QT66NEYN.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-U44DJXQP.js → chunk-RCHO5W7M.js} +15 -18
- package/node_modules/pi-lens/dist/{chunk-YH5MVY2U.js → chunk-RG3MXTRI.js} +7 -7
- package/node_modules/pi-lens/dist/chunk-RG7OODGM.js +57 -0
- package/node_modules/pi-lens/dist/{chunk-OHKJ7PQF.js → chunk-RU34BA4D.js} +43 -39
- package/node_modules/pi-lens/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
- package/node_modules/pi-lens/dist/{chunk-XBJVAEEO.js → chunk-S55TEC7I.js} +3 -2
- package/node_modules/pi-lens/dist/{chunk-RVK72CZX.js → chunk-SJHC3BCZ.js} +1397 -481
- package/node_modules/pi-lens/dist/{chunk-IYNJ6YPZ.js → chunk-SNEUMLM7.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-S67KYG37.js → chunk-T4NGVFYI.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-YCWYO6TQ.js → chunk-THEXI2QO.js} +48 -45
- package/node_modules/pi-lens/dist/{chunk-AMERCH6V.js → chunk-TL2TCJYL.js} +15 -16
- package/node_modules/pi-lens/dist/{chunk-KUA4OJ5Y.js → chunk-TPYYEDP5.js} +823 -350
- package/node_modules/pi-lens/dist/{chunk-YNE3RP52.js → chunk-TVZRLTG6.js} +8 -1
- package/node_modules/pi-lens/dist/{chunk-ROYSX2S5.js → chunk-UCVMSOXF.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-UL5SXQVX.js +32 -0
- package/node_modules/pi-lens/dist/{chunk-7HXE67BN.js → chunk-UO66IMVP.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-VOOAPROD.js → chunk-UVY4TOJH.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-RKBXZN3A.js → chunk-VIDEKABZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-2FN63LPV.js → chunk-VITFDI3O.js} +13 -14
- package/node_modules/pi-lens/dist/{chunk-6DLWKFEX.js → chunk-VUAVE3QC.js} +41 -42
- package/node_modules/pi-lens/dist/{chunk-FM4RDMKT.js → chunk-WUY4BZEP.js} +10 -12
- package/node_modules/pi-lens/dist/{chunk-SD4I7ZO4.js → chunk-X3UTCXAA.js} +43 -53
- package/node_modules/pi-lens/dist/chunk-XHDBJODR.js +45 -0
- package/node_modules/pi-lens/dist/{chunk-5IUSNGOC.js → chunk-XHLK33VM.js} +28 -21
- package/node_modules/pi-lens/dist/{chunk-3KAZU3VR.js → chunk-XI34NWDI.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-QBFBRV2B.js → chunk-XWFIHYCH.js} +4 -2
- package/node_modules/pi-lens/dist/{chunk-JUKMK5Y4.js → chunk-Y2TPADJR.js} +10 -11
- package/node_modules/pi-lens/dist/{chunk-EBC36LNN.js → chunk-Y5KTA2OB.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-HYGZEMX6.js → chunk-YKVDBNPO.js} +11 -5
- package/node_modules/pi-lens/dist/{chunk-KN35K52N.js → chunk-YSDPVDFC.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-YWNO5Q4R.js +44 -0
- package/node_modules/pi-lens/dist/{chunk-US7ECLD7.js → chunk-YWWG4AQA.js} +119 -28
- package/node_modules/pi-lens/dist/{chunk-O4NWQT6I.js → chunk-YXDCRUKQ.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-XYURS6EN.js → chunk-YXGRRORB.js} +15 -17
- package/node_modules/pi-lens/dist/{chunk-IUE7SSKV.js → chunk-ZAPSUBLU.js} +13 -7
- package/node_modules/pi-lens/dist/{chunk-EUXZEFTV.js → chunk-ZPJM7DID.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-5HSRT26B.js → chunk-ZSUX7KEM.js} +16 -15
- package/node_modules/pi-lens/dist/index.js +37155 -32210
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +11 -12
- package/node_modules/pi-lens/dist/mcp/cli.js +46 -45
- package/node_modules/pi-lens/dist/mcp/server.js +1210 -574
- package/node_modules/pi-lens/dist/mcp/worker.js +65 -65
- package/node_modules/pi-lens/dist/probes/installer.js +21 -23
- package/node_modules/pi-lens/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
- package/node_modules/pi-lens/docs/adr/README.md +1 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +5 -3
- package/node_modules/pi-lens/docs/configuration.md +9 -0
- package/node_modules/pi-lens/docs/engineering-principles.md +12 -0
- package/node_modules/pi-lens/docs/environment-variables.md +20 -0
- package/node_modules/pi-lens/docs/features.md +16 -1
- package/node_modules/pi-lens/docs/globalconfig.md +37 -8
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +105 -12
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +37 -18
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +22 -1
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +14 -0
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +23 -10
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +64 -8
- package/node_modules/pi-lens/docs/pi-lens-retro.md +2 -2
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +48 -1
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +8 -1
- package/node_modules/pi-lens/docs/release-qa-baseline.md +19 -7
- package/node_modules/pi-lens/docs/servercapabilities.md +47 -47
- package/node_modules/pi-lens/docs/settings.md +9 -5
- package/node_modules/pi-lens/docs/subagent-compat.md +1 -1
- package/node_modules/pi-lens/docs/usage.md +1 -0
- package/node_modules/pi-lens/package.json +6 -4
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
- package/node_modules/pi-lens/rules/rule-catalog.json +25 -1
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +15 -5
- package/node_modules/pi-lens/scripts/lib/is-main-module.mjs +27 -0
- package/node_modules/pi-lens/scripts/lib/scratch-home-env.mjs +21 -0
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +4 -6
- package/node_modules/pi-lens/scripts/warm-loader-cache.mjs +2 -5
- package/node_modules/pi-next-cue/package.json +4 -1
- package/node_modules/pi-provider-qoder/dist/index.js +438 -283
- package/node_modules/pi-provider-qoder/package.json +1 -1
- package/node_modules/pi-typesafe/README.md +6 -6
- package/node_modules/pi-typesafe/dist/ask.js +9 -2
- package/node_modules/pi-typesafe/dist/auth.d.ts +3 -2
- package/node_modules/pi-typesafe/dist/auth.js +2 -2
- package/node_modules/pi-typesafe/dist/backends.d.ts +20 -5
- package/node_modules/pi-typesafe/dist/backends.js +32 -8
- package/node_modules/pi-typesafe/dist/batch.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/batch.js +2 -2
- package/node_modules/pi-typesafe/dist/client.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/client.js +24 -12
- package/node_modules/pi-typesafe/dist/credentials.d.ts +8 -6
- package/node_modules/pi-typesafe/dist/credentials.js +70 -16
- package/node_modules/pi-typesafe/dist/extension.js +118 -26
- package/node_modules/pi-typesafe/dist/index.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/key-prompt.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/key-prompt.js +6 -6
- package/node_modules/pi-typesafe/dist/login.d.ts +11 -10
- package/node_modules/pi-typesafe/dist/login.js +24 -21
- package/node_modules/pi-typesafe/dist/schema.d.ts +8 -8
- package/node_modules/pi-typesafe/dist/schema.js +29 -7
- package/node_modules/pi-typesafe/package.json +2 -2
- package/package.json +12 -12
- package/node_modules/pi-lens/dist/chunk-3PTHXJXR.js +0 -28
- package/node_modules/pi-lens/dist/chunk-3QED2P4V.js +0 -31
- package/node_modules/pi-lens/dist/chunk-5WRPDP2A.js +0 -47
- package/node_modules/pi-lens/dist/chunk-ABBOA7UD.js +0 -157
- package/node_modules/pi-lens/dist/chunk-CUHSHSB6.js +0 -273
- package/node_modules/pi-lens/dist/chunk-GL5LUMZE.js +0 -51
- package/node_modules/pi-lens/dist/chunk-HAD7QRQI.js +0 -30
- package/node_modules/pi-lens/dist/chunk-JORED7EX.js +0 -44
- package/node_modules/pi-lens/dist/chunk-KYUB6QDC.js +0 -72
- package/node_modules/pi-lens/dist/chunk-LZSEQW6A.js +0 -57
- package/node_modules/pi-lens/dist/chunk-M2IFVFWU.js +0 -79
- package/node_modules/pi-lens/dist/chunk-M2UD3LPU.js +0 -88
- package/node_modules/pi-lens/dist/chunk-MBKQHGA7.js +0 -39
- package/node_modules/pi-lens/dist/chunk-R7YOCSNV.js +0 -23
- package/node_modules/pi-lens/dist/chunk-SKAMFC7A.js +0 -28
- package/node_modules/pi-lens/dist/chunk-SYE6T2EB.js +0 -28
- package/node_modules/pi-lens/dist/chunk-TRETHTQO.js +0 -26
- package/node_modules/pi-lens/dist/chunk-UA7ZXYDR.js +0 -184
- package/node_modules/pi-lens/dist/chunk-XTFDJI3T.js +0 -24
- package/node_modules/pi-lens/dist/chunk-Z3CCVDUB.js +0 -76
- package/node_modules/pi-next-cue/.github/workflows/publish.yml +0 -20
|
@@ -20,10 +20,7 @@ import { createCcstyleTool } from "./tool/ccstyle-tool.ts";
|
|
|
20
20
|
import type { WriteExecutionMetadataStore } from "./tool/diff/index.ts";
|
|
21
21
|
export { shouldRenderRichDiff } from "./tool/ccstyle-tool.ts";
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const DEDICATED_RENDERER_TOOLS = new Set(["Agent"]);
|
|
25
|
-
|
|
26
|
-
/** 排除名单内且自带 renderer 的工具保留原渲染。 */
|
|
23
|
+
/** 排除名单内且自带 renderer 的工具保留原渲染;excludeRenderers 里的工具也交给原生渲染器。 */
|
|
27
24
|
export function preservesOriginalRenderer(
|
|
28
25
|
extensionDefinition: any,
|
|
29
26
|
toolName: string,
|
|
@@ -117,7 +114,6 @@ function shouldGloballyStyleTool(component: any, patch: GlobalToolRenderPatch):
|
|
|
117
114
|
// compact 也复用同一套 ccstyle call/result,避免折叠态工具卡回落到 Pi 原生样式。
|
|
118
115
|
const useCcstyle =
|
|
119
116
|
patch.mode() !== "off" &&
|
|
120
|
-
!DEDICATED_RENDERER_TOOLS.has(toolName) &&
|
|
121
117
|
!preservesOriginalRenderer(extensionDefinition, toolName, builtInDefinition);
|
|
122
118
|
component[COMPONENT_TOOL_RENDER_MODE] = useCcstyle;
|
|
123
119
|
return useCcstyle;
|
|
@@ -50,13 +50,17 @@ import {
|
|
|
50
50
|
setMessageDisplayTheme,
|
|
51
51
|
} from "./tool/message-display.ts";
|
|
52
52
|
import { GLOBAL_TOOL_RENDER_PATCH, patchRegistry } from "../utils/patch-keys.ts";
|
|
53
|
+
import {
|
|
54
|
+
installSubagentNotificationRenderer,
|
|
55
|
+
refreshSubagentNotifications,
|
|
56
|
+
} from "./tool/subagent-notification.ts";
|
|
53
57
|
|
|
54
58
|
/**
|
|
55
59
|
* Claude Code Style for pi — 装配入口。
|
|
56
60
|
*
|
|
57
61
|
* mode=on → default-mode(工具卡样式 + 展开背景)
|
|
58
62
|
* mode=compact → compact-mode(消息折叠摘要)
|
|
59
|
-
* 共用 → tool-grouping / message-display / mouse / write override
|
|
63
|
+
* 共用 → tool-grouping / message-display / subagent-notification / mouse / write override
|
|
60
64
|
*/
|
|
61
65
|
|
|
62
66
|
let compactModeHooks: CompactModeHooks | undefined;
|
|
@@ -65,6 +69,7 @@ function refreshCurrentTranscript(ctx?: any, toolGrouping?: ToolGroupingHooks):
|
|
|
65
69
|
const tui = getToolMouseTui();
|
|
66
70
|
toolGrouping?.refresh(tui);
|
|
67
71
|
refreshMessageDisplays(tui);
|
|
72
|
+
refreshSubagentNotifications(tui);
|
|
68
73
|
refreshCompactModeComponents(tui);
|
|
69
74
|
compactModeHooks?.refresh();
|
|
70
75
|
tui?.requestRender?.(true);
|
|
@@ -118,6 +123,7 @@ export default function (
|
|
|
118
123
|
toolGrouping: ToolGroupingHooks;
|
|
119
124
|
compactMode: CompactModeHooks;
|
|
120
125
|
disposeMessageDisplay: () => void;
|
|
126
|
+
disposeSubagentNotificationRenderer: () => void;
|
|
121
127
|
disposeToolExpandedBackground: () => void;
|
|
122
128
|
}
|
|
123
129
|
| undefined;
|
|
@@ -143,6 +149,8 @@ export default function (
|
|
|
143
149
|
});
|
|
144
150
|
compactModeHooks = compactMode;
|
|
145
151
|
const disposeMessageDisplay = installMessageDisplayRendering();
|
|
152
|
+
// pi-subagents 的结束通知:换查找结果而不注册,加载先后都归本插件,off 还给原生。
|
|
153
|
+
const disposeSubagentNotificationRenderer = installSubagentNotificationRenderer();
|
|
146
154
|
// 展开背景必须在 compact-mode 之后装,shutdown 时先于 compact 释放。
|
|
147
155
|
const disposeToolExpandedBackground = installToolExpandedBackground();
|
|
148
156
|
installation = {
|
|
@@ -150,6 +158,7 @@ export default function (
|
|
|
150
158
|
toolGrouping,
|
|
151
159
|
compactMode,
|
|
152
160
|
disposeMessageDisplay,
|
|
161
|
+
disposeSubagentNotificationRenderer,
|
|
153
162
|
disposeToolExpandedBackground,
|
|
154
163
|
};
|
|
155
164
|
return installation;
|
|
@@ -254,11 +263,14 @@ export default function (
|
|
|
254
263
|
syncCompactMode(ctx);
|
|
255
264
|
// compact-thinking 的 session_start 处理在本 handler 之后执行(在其之上再装
|
|
256
265
|
// 一层 updateContent);延迟再同步一次,保证 compact 补丁最终位于外层。
|
|
266
|
+
// 历史回放也在这之后跑完:sync 末尾按 ctx.isIdle() 收尾末尾回合,
|
|
267
|
+
// 它没有后续消息,不收就会停在 Running。
|
|
257
268
|
setTimeout(() => syncCompactMode(ctx), 0);
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
269
|
+
scheduleSessionRender(() => {
|
|
270
|
+
hooks.toolGrouping.refresh(getToolMouseTui());
|
|
271
|
+
// /reload、/resume 在 session_start 之前就重建了 transcript:已挂载的通知卡换上本插件的渲染器。
|
|
272
|
+
refreshSubagentNotifications(getToolMouseTui());
|
|
273
|
+
});
|
|
262
274
|
});
|
|
263
275
|
|
|
264
276
|
pi.on("session_compact", async (event, ctx) => {
|
|
@@ -295,6 +307,8 @@ export default function (
|
|
|
295
307
|
|
|
296
308
|
pi.on("agent_end", async () => {
|
|
297
309
|
clearLiveToolCalls();
|
|
310
|
+
// 这轮跑完:末尾回合没有正文收口(纯工具回合)就一直挂着 Running。
|
|
311
|
+
compactModeHooks?.settleFinishedRound();
|
|
298
312
|
});
|
|
299
313
|
|
|
300
314
|
pi.on("session_shutdown", async () => {
|
|
@@ -312,6 +326,7 @@ export default function (
|
|
|
312
326
|
current.compactMode.shutdown();
|
|
313
327
|
compactModeHooks = undefined;
|
|
314
328
|
current.disposeMessageDisplay();
|
|
329
|
+
current.disposeSubagentNotificationRenderer();
|
|
315
330
|
disposeStickyPromptPatches();
|
|
316
331
|
clearAllAnimations();
|
|
317
332
|
installation = undefined;
|
|
@@ -102,7 +102,10 @@ function deCircled(markdown: string): string {
|
|
|
102
102
|
// 跨行链接规整
|
|
103
103
|
// ============================================================================
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
// \x1b 排除:Pi 的带颜色 Mermaid 输出把每行包成含 ANSI SGR(\x1b[...m)的 code span,
|
|
106
|
+
// 转义序列里的 `[` 不能当成链接起点,否则匹配会从第一个转义跨行直到后面真正的 `](`,
|
|
107
|
+
// 把图和之后的段落全压成一行(#84)。
|
|
108
|
+
const MULTILINE_LINK_RE = /(?<!\x1b)\[([^\]\n\x1b]*(?:\n[^\]\n\x1b]*)+)\](?=\()/g;
|
|
106
109
|
|
|
107
110
|
/** 防止 Markdown 跨行链接把行尾填充空格纳入 OSC 8 点击区。 */
|
|
108
111
|
function normalizeMultilineLinks(markdown: string): string {
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
markCompactRoundToolExpanded,
|
|
13
13
|
setHoveredCompactAssistant,
|
|
14
14
|
} from "../compact-mode.ts";
|
|
15
|
-
import { isMessageDisplayComponent } from "../tool/message-display.ts";
|
|
16
15
|
import { isLazyProxyTui } from "../../utils/fullscreen-detect.ts";
|
|
17
16
|
import { setToolTuiFullscreen, isCollapseHintLine } from "../tool/names.ts";
|
|
18
17
|
import {
|
|
@@ -43,6 +42,7 @@ import {
|
|
|
43
42
|
collapsedHintHitbox,
|
|
44
43
|
fullscreenContentWidth,
|
|
45
44
|
fullscreenLeafAt,
|
|
45
|
+
isMessageCard,
|
|
46
46
|
isScrollbarColumnAt,
|
|
47
47
|
} from "./layout.ts";
|
|
48
48
|
import {
|
|
@@ -122,7 +122,7 @@ let sessionRenderTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
122
122
|
let latestInteractionFrame: InteractionFrame = { regions: [] };
|
|
123
123
|
|
|
124
124
|
/** Summary markers used by Pi and ccstyle; unlike the trailing hint, these survive truncation. */
|
|
125
|
-
const COLLAPSED_TOOL_SUMMARY = /^\s*(
|
|
125
|
+
const COLLAPSED_TOOL_SUMMARY = /^\s*(?:↳|└|⎿|●|✓|✗|…|\.\.\.)/;
|
|
126
126
|
|
|
127
127
|
function interactionRegionAt(packet: SgrMousePacket): InteractionRegion | null {
|
|
128
128
|
const matches = latestInteractionFrame.regions.filter(
|
|
@@ -347,28 +347,52 @@ function releaseFullscreenToolMouseMotion(tui?: any): void {
|
|
|
347
347
|
const FULLSCREEN_VIEWPORT_PATCH = Symbol("ccstyle.fullscreen-viewport-patch");
|
|
348
348
|
|
|
349
349
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
350
|
+
* 折叠卡上哪些行声明为展开入口。resultRendererComponent 自带 isCollapsedHintLine
|
|
351
|
+
* 的(diff/ask/codemode)按它声明的判,行号原样转发;不带的原生卡(grep/find/ls/
|
|
352
|
+
* read/bash/fallback)按原生展开提示的收尾特征判——pi 给结果区套整卡 MouseRegion,
|
|
353
|
+
* 正文行(含路径文本)也会被官方 click 展开,这里把入口收到提示那几行。
|
|
354
|
+
* localRow 是组件 render 内的行号(frame marker / 布局 localRow),供声明按行判。
|
|
352
355
|
*/
|
|
353
|
-
function isCollapsedHintRow(component: any, finalLine: string): boolean {
|
|
356
|
+
function isCollapsedHintRow(component: any, finalLine: string, localRow?: number): boolean {
|
|
354
357
|
const result = component?.resultRendererComponent;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
+
if (typeof result?.isCollapsedHintLine === "function") {
|
|
359
|
+
return result.isCollapsedHintLine(finalLine, localRow);
|
|
360
|
+
}
|
|
361
|
+
return isNativeExpandHintLine(finalLine);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** 原生折叠卡展开提示的收尾特征:`(... N more lines, ctrl+o to expand)` 或行尾的 `to show more`。 */
|
|
365
|
+
function isNativeExpandHintLine(line: string): boolean {
|
|
366
|
+
return /(\([^()]*\/(?: click| to expand)\)|(?:[\w/+]+\s+)?to (?:expand|show more)\)?)\s*$/.test(
|
|
367
|
+
stripTerminalSequencesPreservingLayout(line),
|
|
368
|
+
);
|
|
358
369
|
}
|
|
359
370
|
|
|
360
371
|
/**
|
|
361
372
|
* pi 0.87 给工具结果区套了 MouseRegion:整卡左键 click 都会 setExpanded。
|
|
362
|
-
*
|
|
363
|
-
*
|
|
373
|
+
* 声明了展开入口的组件(diff remainder 等)与带原生展开提示的卡只放行入口行,
|
|
374
|
+
* 其余位置直接吞掉 click,避免官方把正文当展开入口;无任何展开提示行的原生卡
|
|
375
|
+
* (短输出 / excludeRenderers / mode=off)保持官方整卡 toggle。
|
|
364
376
|
*/
|
|
365
377
|
function blocksOfficialCardToggle(component: any, event: any): boolean {
|
|
366
378
|
if (event?.type !== "click" || event.button !== "left" || component?.expanded) return false;
|
|
367
|
-
const result = component?.resultRendererComponent;
|
|
368
|
-
if (typeof result?.isCollapsedHintLine !== "function") return false;
|
|
369
379
|
const lines = component.render?.(Math.max(1, Math.floor(Number(event.width) || 0)));
|
|
370
|
-
const
|
|
371
|
-
|
|
380
|
+
const row = event.y;
|
|
381
|
+
const line = Array.isArray(lines) ? lines[row] : undefined;
|
|
382
|
+
if (typeof line !== "string") return false;
|
|
383
|
+
|
|
384
|
+
const result = component?.resultRendererComponent;
|
|
385
|
+
if (typeof result?.isCollapsedHintLine === "function") {
|
|
386
|
+
return !result.isCollapsedHintLine(line, row);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// 原生卡:只有整卡里确实存在展开提示行时,才把入口收到那些行;
|
|
390
|
+
// 无提示的短卡放行官方整卡 expand。
|
|
391
|
+
const hasNativeHint =
|
|
392
|
+
Array.isArray(lines) &&
|
|
393
|
+
lines.some((entry) => typeof entry === "string" && isNativeExpandHintLine(entry));
|
|
394
|
+
if (!hasNativeHint) return false;
|
|
395
|
+
return !isNativeExpandHintLine(line);
|
|
372
396
|
}
|
|
373
397
|
|
|
374
398
|
/**
|
|
@@ -410,7 +434,7 @@ function handleFullscreenToolClick(tui: any, packet: SgrMousePacket): boolean {
|
|
|
410
434
|
const isGroup = component instanceof ToolGroupComponent;
|
|
411
435
|
const isAssistant = isCompactAssistantComponent(component);
|
|
412
436
|
const isThinking = component instanceof ThinkingPreviewBlock;
|
|
413
|
-
const isMessage =
|
|
437
|
+
const isMessage = isMessageCard(component);
|
|
414
438
|
if (!isTool && !isGroup && !isAssistant && !isThinking && !isMessage) return false;
|
|
415
439
|
if (!component.expanded) {
|
|
416
440
|
// collapsed 仅按钮文本可展开,不能把同一行正文/留白变成点击区。
|
|
@@ -419,7 +443,7 @@ function handleFullscreenToolClick(tui: any, packet: SgrMousePacket): boolean {
|
|
|
419
443
|
const onHint = Boolean(
|
|
420
444
|
hint &&
|
|
421
445
|
(isThinking || (packet.col >= hint.startCol && packet.col <= hint.endCol)) &&
|
|
422
|
-
isCollapsedHintRow(component, line),
|
|
446
|
+
isCollapsedHintRow(component, line, hit.localRow),
|
|
423
447
|
);
|
|
424
448
|
if (!onHint) {
|
|
425
449
|
// 面板内非提示区(工具卡标题/摘要行、thinking 预览正文):单击收起整块面板。
|
|
@@ -573,7 +597,7 @@ function handleFullscreenToolHover(tui: any, packet: SgrMousePacket): void {
|
|
|
573
597
|
} else if (isCompactAssistantComponent(component)) {
|
|
574
598
|
// compact 摘要行:折叠时仅提示文字高亮,展开卡整体高亮。
|
|
575
599
|
if (component.expanded || overHint) target = { kind: "assistant", component };
|
|
576
|
-
} else if (
|
|
600
|
+
} else if (isMessageCard(component)) {
|
|
577
601
|
if (overHint) target = { kind: "message", component };
|
|
578
602
|
}
|
|
579
603
|
}
|
|
@@ -758,7 +782,7 @@ function buildInteractionFrame(
|
|
|
758
782
|
if (
|
|
759
783
|
box &&
|
|
760
784
|
COLLAPSED_TOOL_SUMMARY.test(stripTerminalSequences(line)) &&
|
|
761
|
-
isCollapsedHintRow(component, line)
|
|
785
|
+
isCollapsedHintRow(component, line, placement.componentRow)
|
|
762
786
|
) {
|
|
763
787
|
regions.push({ kind: "collapsed-hint", row: finalRow, ...box, component });
|
|
764
788
|
}
|
|
@@ -3,6 +3,7 @@ import { ThinkingPreviewBlock } from "../../feature/compact-thinking.ts";
|
|
|
3
3
|
import { isCompactAssistantComponent } from "../compact-mode.ts";
|
|
4
4
|
import { ToolGroupComponent } from "../tool/grouping.ts";
|
|
5
5
|
import { isMessageDisplayComponent } from "../tool/message-display.ts";
|
|
6
|
+
import { isSubagentNotificationView } from "../tool/subagent-notification.ts";
|
|
6
7
|
import { isToolExecutionComponent, stripTerminalSequencesPreservingLayout } from "./packets.ts";
|
|
7
8
|
import { getScrollButtonWidget } from "./scroll.ts";
|
|
8
9
|
|
|
@@ -15,11 +16,19 @@ export type ComponentRowHit = {
|
|
|
15
16
|
owner?: any;
|
|
16
17
|
};
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* 消息类卡片:skill/压缩/分支摘要三种消息组件,以及单独出现的 subagent 通知行。
|
|
21
|
+
* 点击、悬停与 single-expand 规则相同。
|
|
22
|
+
*/
|
|
23
|
+
export function isMessageCard(component: any): boolean {
|
|
24
|
+
return isMessageDisplayComponent(component) || isSubagentNotificationView(component);
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
/** 行内 [click to show more] / [↑ Collapse] 提示的命中列区间(1-based,含两端)。 */
|
|
19
28
|
export function collapsedHintHitbox(line: string): { startCol: number; endCol: number } | null {
|
|
20
29
|
const plain = stripTerminalSequencesPreservingLayout(line);
|
|
21
30
|
const match =
|
|
22
|
-
/(\([^()\n]* \/ click\)|click to show more|to show more|↑ Collapse|to collapse)(?=\)?\s*$)/.exec(
|
|
31
|
+
/(\([^()\n]*(?: \/ click|, (?:[\w/+]+\s+)?to (?:expand|show more))\)|click to show more|to show more|↑ Collapse|to collapse)(?=\)?\s*$)/.exec(
|
|
23
32
|
plain,
|
|
24
33
|
);
|
|
25
34
|
if (!match?.[1]) return null;
|
|
@@ -140,7 +149,7 @@ export function componentAtLocalRow(
|
|
|
140
149
|
if (component instanceof ThinkingPreviewBlock) {
|
|
141
150
|
return { component, row: localRow };
|
|
142
151
|
}
|
|
143
|
-
if (
|
|
152
|
+
if (isMessageCard(component)) {
|
|
144
153
|
return { component, row: localRow };
|
|
145
154
|
}
|
|
146
155
|
if (component === getScrollButtonWidget()) {
|
|
@@ -182,7 +191,7 @@ export function collectFullscreenToolCards(
|
|
|
182
191
|
component instanceof ToolGroupComponent ||
|
|
183
192
|
isCompactAssistantComponent(component) ||
|
|
184
193
|
component instanceof ThinkingPreviewBlock ||
|
|
185
|
-
|
|
194
|
+
isMessageCard(component)
|
|
186
195
|
) {
|
|
187
196
|
out.push(component);
|
|
188
197
|
return;
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
expandedBodyComponent,
|
|
31
31
|
formatToolDuration,
|
|
32
32
|
insetComponent,
|
|
33
|
+
renderCollapsedToolResult,
|
|
33
34
|
renderCollapsedToolResultToWidth,
|
|
34
35
|
textFromResult,
|
|
35
36
|
toolViewportWidth,
|
|
@@ -46,6 +47,12 @@ import {
|
|
|
46
47
|
toolIconColor,
|
|
47
48
|
} from "./tool-state.ts";
|
|
48
49
|
import { showMoreHintText } from "./names.ts";
|
|
50
|
+
import { oneLine } from "../../utils/format.ts";
|
|
51
|
+
import {
|
|
52
|
+
isFailedSubagentStatus,
|
|
53
|
+
measuredStats,
|
|
54
|
+
agentStatusLabel,
|
|
55
|
+
} from "./subagent-notification.ts";
|
|
49
56
|
|
|
50
57
|
/** 成功勾:亮绿 truecolor(与 message-display 一致)。 */
|
|
51
58
|
const BRIGHT_GREEN = "[38;2;80;220;100m";
|
|
@@ -82,6 +89,8 @@ function renderDefault(tool: any, slot: "renderCall" | "renderResult", args: any
|
|
|
82
89
|
return new Text(fallback, 0, 0);
|
|
83
90
|
}
|
|
84
91
|
|
|
92
|
+
export const AGENT_TOOL_NAME = "Agent";
|
|
93
|
+
|
|
85
94
|
type ParsedTask = { id: string; status: string; subject: string };
|
|
86
95
|
|
|
87
96
|
function parseTaskList(text: string): ParsedTask[] {
|
|
@@ -185,6 +194,114 @@ function shellDurationText(toolName: string, context: any, isPartial: boolean):
|
|
|
185
194
|
return elapsed === undefined ? "" : formatToolDuration(elapsed);
|
|
186
195
|
}
|
|
187
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Agent 的 renderResult:与 pi-subagents 保持同样的分支,但收敛成 ccstyle 的 ↳ 行。
|
|
199
|
+
* running/partial 转交原渲染器(只有它有 spinner frame 和 activity 文案);
|
|
200
|
+
* background/completed/stopped/error 画单行摘要,展开态结果正文交给通用展开视图。
|
|
201
|
+
*/
|
|
202
|
+
function renderAgentResult(
|
|
203
|
+
originalTool: any,
|
|
204
|
+
result: any,
|
|
205
|
+
options: any,
|
|
206
|
+
theme: any,
|
|
207
|
+
context: any,
|
|
208
|
+
expanded: boolean,
|
|
209
|
+
isError: boolean,
|
|
210
|
+
): any | undefined {
|
|
211
|
+
const details = result?.details;
|
|
212
|
+
const text = textFromResult(result);
|
|
213
|
+
// 没拿到子代理状态(pi-subagents 原始路径的兜底)就沿用通用渲染。
|
|
214
|
+
if (!details?.status) return undefined;
|
|
215
|
+
|
|
216
|
+
const isPartial = Boolean(options?.isPartial);
|
|
217
|
+
const status = String(details.status);
|
|
218
|
+
|
|
219
|
+
// running:pi-subagents 的 spinner/activity 组件才能实时动,原样转交。
|
|
220
|
+
if (isPartial || status === "running") {
|
|
221
|
+
return renderDefault(originalTool, "renderResult", [result, options, theme, context], text);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const stats = measuredStats(details).join(" · ");
|
|
225
|
+
|
|
226
|
+
const agentId = details.agentId ? `ID: ${details.agentId}` : "";
|
|
227
|
+
const tail = (body: string) => (stats ? `${body} · ${stats}` : body);
|
|
228
|
+
|
|
229
|
+
if (status === "background") {
|
|
230
|
+
if (!expanded) {
|
|
231
|
+
const body = tail(`Running in background${agentId ? ` · ${agentId}` : ""}`);
|
|
232
|
+
return new Text(theme.fg("muted", renderCollapsedToolResult(body, "")), 0, 0);
|
|
233
|
+
}
|
|
234
|
+
const view = renderExpandedToolResult(
|
|
235
|
+
`Running in background${agentId ? ` · ${agentId}` : ""}`,
|
|
236
|
+
theme,
|
|
237
|
+
false,
|
|
238
|
+
context?.lastComponent,
|
|
239
|
+
context?.args,
|
|
240
|
+
context,
|
|
241
|
+
true,
|
|
242
|
+
);
|
|
243
|
+
return view;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (status === "completed" || status === "steered") {
|
|
247
|
+
if (!expanded) {
|
|
248
|
+
const label = status === "steered" ? "Wrapped up (turn limit)" : "Done";
|
|
249
|
+
const body = [label, stats].filter(Boolean).join(" · ");
|
|
250
|
+
return new Text(theme.fg("muted", renderCollapsedToolResult(body, "")), 0, 0);
|
|
251
|
+
}
|
|
252
|
+
const view = renderExpandedToolResult(
|
|
253
|
+
text || "Done",
|
|
254
|
+
theme,
|
|
255
|
+
Boolean(isError),
|
|
256
|
+
context?.lastComponent,
|
|
257
|
+
context?.args,
|
|
258
|
+
context,
|
|
259
|
+
true,
|
|
260
|
+
);
|
|
261
|
+
return view;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (status === "stopped") {
|
|
265
|
+
if (!expanded) {
|
|
266
|
+
const body = tail("Stopped");
|
|
267
|
+
return new Text(theme.fg("muted", renderCollapsedToolResult(body, "")), 0, 0);
|
|
268
|
+
}
|
|
269
|
+
return renderExpandedToolResult(
|
|
270
|
+
text || "Stopped",
|
|
271
|
+
theme,
|
|
272
|
+
Boolean(isError),
|
|
273
|
+
context?.lastComponent,
|
|
274
|
+
context?.args,
|
|
275
|
+
context,
|
|
276
|
+
true,
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// error / aborted:折叠时首行错误文案 + 统计;展开时走通用展开视图。
|
|
281
|
+
const label = agentStatusLabel(status);
|
|
282
|
+
const firstLine = text.split("\n").find((line) => line.trim()) ?? label;
|
|
283
|
+
if (!expanded) {
|
|
284
|
+
const body = tail(oneLine(firstLine, 72));
|
|
285
|
+
return new Text(
|
|
286
|
+
theme.fg(
|
|
287
|
+
isFailedSubagentStatus(status) ? "error" : "muted",
|
|
288
|
+
renderCollapsedToolResult(body, ""),
|
|
289
|
+
),
|
|
290
|
+
0,
|
|
291
|
+
0,
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
return renderExpandedToolResult(
|
|
295
|
+
text || label,
|
|
296
|
+
theme,
|
|
297
|
+
isFailedSubagentStatus(status) || Boolean(isError),
|
|
298
|
+
context?.lastComponent,
|
|
299
|
+
context?.args,
|
|
300
|
+
context,
|
|
301
|
+
true,
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
188
305
|
/** 用 ccstyle call/result 包装任意工具定义。 */
|
|
189
306
|
export function createCcstyleTool(
|
|
190
307
|
originalTool: any,
|
|
@@ -315,6 +432,20 @@ export function createCcstyleTool(
|
|
|
315
432
|
|
|
316
433
|
const expanded = isToolExpanded(options, context);
|
|
317
434
|
const isError = Boolean(options?.isError || context?.isError);
|
|
435
|
+
// Agent:running 转交原渲染器(spinner/activity 只有它有);其余画 ↳ 摘要行。
|
|
436
|
+
// toolName 大小写宽松匹配:上游改名也不静默失效。
|
|
437
|
+
if (toolName.toLowerCase() === AGENT_TOOL_NAME.toLowerCase()) {
|
|
438
|
+
const agentResult = renderAgentResult(
|
|
439
|
+
originalTool,
|
|
440
|
+
result,
|
|
441
|
+
options,
|
|
442
|
+
theme,
|
|
443
|
+
context,
|
|
444
|
+
expanded,
|
|
445
|
+
isError,
|
|
446
|
+
);
|
|
447
|
+
if (agentResult) return agentResult;
|
|
448
|
+
}
|
|
318
449
|
// codemode:折叠态自己画子调用树,展开态给全部子调用与去掉脚本头的输出
|
|
319
450
|
if (toolName === CODEMODE_TOOL_NAME) {
|
|
320
451
|
if (!options?.isPartial) setToolVisualState(context, isError ? "error" : "success");
|