@herbertgao/pi-extensions 2026.11.10 → 2026.11.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +10 -10
  3. package/THIRD_PARTY_NOTICES.md +3 -3
  4. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +16 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -4
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -4
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +22 -15
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +22 -8
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +0 -29
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +5 -2
  11. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +73 -47
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +3 -2
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +0 -40
  14. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-parse.ts +4 -1
  15. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +79 -18
  16. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-io.ts +0 -5
  17. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +18 -4
  18. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +15 -0
  19. package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
  20. package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +12 -0
  21. package/node_modules/@herbertgao/pi-impeccable/README.md +2 -2
  22. package/node_modules/@herbertgao/pi-impeccable/package.json +4 -4
  23. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/SKILL.md +4 -2
  24. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/adapt.md +2 -2
  25. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/animate.md +17 -0
  26. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/audit.md +12 -1
  27. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/audit.native.md +4 -0
  28. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique-rubric.md +496 -0
  29. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique.md +13 -505
  30. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/documenter.md +1 -1
  31. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/finish-reviewer.md +1 -1
  32. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/motion-reviewer.md +29 -0
  33. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/distill.md +1 -1
  34. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/document.md +3 -1
  35. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/foundations.md +44 -0
  36. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/hooks.md +3 -3
  37. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/live-setup.md +1 -1
  38. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/live.md +26 -12
  39. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work-comp.md +24 -0
  40. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work-world.md +20 -0
  41. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work.md +9 -37
  42. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/onboard.md +7 -6
  43. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/overdrive.md +2 -2
  44. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/quieter.md +1 -1
  45. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/typeset.md +6 -0
  46. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/visualize.md +1 -1
  47. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/VERSION +1 -1
  48. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt +5 -5
  49. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/impeccable +69 -16
  50. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/impeccable.cmd +55 -7
  51. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/live-browser.js +51 -22
  52. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  53. package/node_modules/@herbertgao/pi-subagents/README.md +27 -9
  54. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +11 -11
  55. package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
  56. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +13 -0
  57. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +51 -32
  58. package/node_modules/@herbertgao/pi-subagents/src/default-agents.ts +7 -0
  59. package/node_modules/@herbertgao/pi-subagents/src/index.ts +334 -893
  60. package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +4 -1
  61. package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +13 -0
  62. package/node_modules/@herbertgao/pi-subagents/src/schedule-store.ts +18 -13
  63. package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +25 -5
  64. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +215 -69
  65. package/node_modules/@herbertgao/pi-subagents/src/types.ts +17 -0
  66. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +9 -0
  67. package/node_modules/@herbertgao/pi-subagents/src/ui/agents-menu.ts +705 -0
  68. package/node_modules/@herbertgao/pi-subagents/src/ui/settings-menu.ts +361 -0
  69. package/node_modules/@herbertgao/pi-subagents/src/ui/viewer-keys.ts +1 -1
  70. package/node_modules/pi-antigravity/README.md +58 -9
  71. package/node_modules/pi-antigravity/docs/reader-guarantees.md +35 -0
  72. package/node_modules/pi-antigravity/package.json +15 -6
  73. package/node_modules/pi-antigravity/src/client/client.ts +63 -14
  74. package/node_modules/pi-antigravity/src/client/enterprise.ts +150 -0
  75. package/node_modules/pi-antigravity/src/client/index.ts +1 -0
  76. package/node_modules/pi-antigravity/src/diagnostics/diagnostics.ts +7 -0
  77. package/node_modules/pi-antigravity/src/features/generate-image.ts +56 -2
  78. package/node_modules/pi-antigravity/src/features/read-url-content.ts +124 -0
  79. package/node_modules/pi-antigravity/src/image/image.ts +16 -2
  80. package/node_modules/pi-antigravity/src/index.ts +145 -2
  81. package/node_modules/pi-antigravity/src/models/discovery.ts +3 -4
  82. package/node_modules/pi-antigravity/src/models/grouping.ts +39 -15
  83. package/node_modules/pi-antigravity/src/models/models.ts +126 -14
  84. package/node_modules/pi-antigravity/src/stream/stream.ts +189 -30
  85. package/node_modules/pi-antigravity/src/types/types.ts +30 -1
  86. package/node_modules/pi-antigravity/src/usage/usage.ts +58 -0
  87. package/node_modules/pi-antigravity/src/utils/address.ts +180 -0
  88. package/node_modules/pi-antigravity/src/utils/credits.ts +149 -0
  89. package/node_modules/pi-antigravity/src/utils/html.ts +31 -0
  90. package/node_modules/pi-antigravity/src/utils/index.ts +2 -0
  91. package/node_modules/pi-antigravity/src/utils/security.ts +172 -13
  92. package/node_modules/pi-antigravity/src/utils/text.ts +66 -0
  93. package/node_modules/pi-antigravity/src/utils/util.ts +5 -4
  94. package/node_modules/pi-antigravity/src/web-fetch/document.ts +83 -0
  95. package/node_modules/pi-antigravity/src/web-fetch/fences.ts +24 -0
  96. package/node_modules/pi-antigravity/src/web-fetch/header.ts +97 -0
  97. package/node_modules/pi-antigravity/src/web-fetch/index.ts +3 -0
  98. package/node_modules/pi-antigravity/src/web-fetch/inspect.ts +328 -0
  99. package/node_modules/pi-antigravity/src/web-fetch/limits.ts +4 -0
  100. package/node_modules/pi-antigravity/src/web-fetch/markdown.ts +744 -0
  101. package/node_modules/pi-antigravity/src/web-fetch/mdn.ts +164 -0
  102. package/node_modules/pi-antigravity/src/web-fetch/media.ts +11 -0
  103. package/node_modules/pi-antigravity/src/web-fetch/metadata.ts +9 -0
  104. package/node_modules/pi-antigravity/src/web-fetch/representation.ts +93 -0
  105. package/node_modules/pi-antigravity/src/web-fetch/save.ts +71 -0
  106. package/node_modules/pi-antigravity/src/web-fetch/sites.ts +138 -0
  107. package/node_modules/pi-antigravity/src/web-fetch/vendor.d.ts +9 -0
  108. package/node_modules/pi-antigravity/src/web-fetch/web-fetch.ts +957 -0
  109. package/node_modules/pi-antigravity/tsconfig.json +2 -2
  110. package/node_modules/pi-commandcode-provider/CHANGELOG.md +21 -1
  111. package/node_modules/pi-commandcode-provider/README.md +2 -2
  112. package/node_modules/pi-commandcode-provider/index.ts +2 -1
  113. package/node_modules/pi-commandcode-provider/package.json +5 -4
  114. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +15 -9
  115. package/node_modules/pi-commandcode-provider/src/oauth.ts +69 -12
  116. package/node_modules/pi-commandcode-provider/src/pricing.ts +8 -1
  117. package/node_modules/pi-commandcode-provider/src/responses-compat.ts +137 -0
  118. package/node_modules/pi-lens/CHANGELOG-USER.md +6 -6
  119. package/node_modules/pi-lens/CHANGELOG.md +172 -0
  120. package/node_modules/pi-lens/README.md +103 -217
  121. package/node_modules/pi-lens/dist/{chunk-KXDQD34C.js → chunk-27JQHK7Y.js} +1 -1
  122. package/node_modules/pi-lens/dist/{chunk-W6VLB6LL.js → chunk-2APSZHHI.js} +61 -3
  123. package/node_modules/pi-lens/dist/{chunk-5EEWCJG7.js → chunk-2H5GHZKC.js} +8 -8
  124. package/node_modules/pi-lens/dist/{chunk-TS5EIWEF.js → chunk-2H7NFZ4Q.js} +11 -11
  125. package/node_modules/pi-lens/dist/{chunk-6GWCYEP7.js → chunk-37IDWT6O.js} +64 -16
  126. package/node_modules/pi-lens/dist/{chunk-OEPWTSUG.js → chunk-3PAS2ERX.js} +8 -8
  127. package/node_modules/pi-lens/dist/{chunk-ET3DSSFZ.js → chunk-3PO4YYOX.js} +9 -17
  128. package/node_modules/pi-lens/dist/{chunk-C6V2DSZZ.js → chunk-3QXFUP6T.js} +11 -11
  129. package/node_modules/pi-lens/dist/{chunk-HWMNTQBJ.js → chunk-3TSMQZG6.js} +32 -11
  130. package/node_modules/pi-lens/dist/{chunk-QY6J2FTK.js → chunk-4DAHGU3V.js} +15 -14
  131. package/node_modules/pi-lens/dist/{chunk-PCREZ4HJ.js → chunk-4IZZEN63.js} +33 -34
  132. package/node_modules/pi-lens/dist/{chunk-OYXD2MOM.js → chunk-5HBQL7DH.js} +2 -2
  133. package/node_modules/pi-lens/dist/{chunk-B4FAFEBP.js → chunk-5JB4WENL.js} +1 -1
  134. package/node_modules/pi-lens/dist/chunk-5YJXF2IS.js +56 -0
  135. package/node_modules/pi-lens/dist/{chunk-GHATCG2A.js → chunk-6CFSDLHE.js} +22 -18
  136. package/node_modules/pi-lens/dist/{chunk-FVQKX5KI.js → chunk-6E5QLMWI.js} +24 -22
  137. package/node_modules/pi-lens/dist/{chunk-AVBEPUCD.js → chunk-6GLMMGCX.js} +2 -2
  138. package/node_modules/pi-lens/dist/{chunk-YTXFNCVN.js → chunk-74AMPWNC.js} +2 -2
  139. package/node_modules/pi-lens/dist/{chunk-K2GV34T2.js → chunk-7CLWC2UH.js} +26 -37
  140. package/node_modules/pi-lens/dist/{chunk-MOEWCPMC.js → chunk-7DPXUPRF.js} +2 -2
  141. package/node_modules/pi-lens/dist/{chunk-7BEADGAZ.js → chunk-7U36VQL6.js} +2 -2
  142. package/node_modules/pi-lens/dist/{chunk-PPYUBO6Y.js → chunk-7WKVCZI4.js} +1 -1
  143. package/node_modules/pi-lens/dist/{chunk-ILC2B7IJ.js → chunk-7ZVTFLCC.js} +10 -10
  144. package/node_modules/pi-lens/dist/{chunk-IT7MFVGP.js → chunk-ADYQRETD.js} +2 -2
  145. package/node_modules/pi-lens/dist/{chunk-NCDH2JB7.js → chunk-ARTYCUGF.js} +25 -10
  146. package/node_modules/pi-lens/dist/{chunk-Z6WTLVUL.js → chunk-AXAR5ZW2.js} +225 -104
  147. package/node_modules/pi-lens/dist/{chunk-PK3GDU4M.js → chunk-AZG5UJYY.js} +1 -1
  148. package/node_modules/pi-lens/dist/{chunk-NRVWLTOY.js → chunk-B2OXE4AH.js} +60 -21
  149. package/node_modules/pi-lens/dist/{chunk-ORYQGVC3.js → chunk-B42AIWPJ.js} +2 -2
  150. package/node_modules/pi-lens/dist/{chunk-IC4L65U7.js → chunk-BBSDJTOV.js} +12 -13
  151. package/node_modules/pi-lens/dist/{chunk-HJWF7CGW.js → chunk-BKWFDWYM.js} +16 -16
  152. package/node_modules/pi-lens/dist/{chunk-D2ZYRI7M.js → chunk-C5PLBTNR.js} +1 -1
  153. package/node_modules/pi-lens/dist/{chunk-SRXYSLMW.js → chunk-CQY2HEH7.js} +1 -1
  154. package/node_modules/pi-lens/dist/{chunk-7424ANRU.js → chunk-CXQYK4YT.js} +1 -1
  155. package/node_modules/pi-lens/dist/{chunk-HYR25MV3.js → chunk-CZJGAOKL.js} +8 -7
  156. package/node_modules/pi-lens/dist/{chunk-DIIDMDZU.js → chunk-DCA2MXVQ.js} +11 -11
  157. package/node_modules/pi-lens/dist/{chunk-K2LD6YNH.js → chunk-DFKOA74L.js} +9 -9
  158. package/node_modules/pi-lens/dist/{chunk-AYDE7RFV.js → chunk-DI4AZZNY.js} +2 -2
  159. package/node_modules/pi-lens/dist/{chunk-6EXGCXM5.js → chunk-G53LBDNU.js} +99 -5
  160. package/node_modules/pi-lens/dist/chunk-GCSDF5IE.js +27 -0
  161. package/node_modules/pi-lens/dist/{chunk-5KLRCUDT.js → chunk-H5API74E.js} +6 -6
  162. package/node_modules/pi-lens/dist/chunk-HBX55MWO.js +27 -0
  163. package/node_modules/pi-lens/dist/{chunk-JRSS6KM4.js → chunk-HIJ4CHFF.js} +2 -2
  164. package/node_modules/pi-lens/dist/{chunk-3MHY4BQY.js → chunk-HIRBC72R.js} +4 -4
  165. package/node_modules/pi-lens/dist/{chunk-F7AMFFVK.js → chunk-HRLF35WL.js} +8 -8
  166. package/node_modules/pi-lens/dist/{chunk-HSTN27NR.js → chunk-I2FYOZNW.js} +9 -9
  167. package/node_modules/pi-lens/dist/{chunk-5FDUKJZO.js → chunk-I3NZVAMN.js} +9 -9
  168. package/node_modules/pi-lens/dist/{chunk-NZINZCHB.js → chunk-INBK3HIT.js} +3 -3
  169. package/node_modules/pi-lens/dist/{chunk-PXGVB2CY.js → chunk-J2ZB5MDS.js} +20 -18
  170. package/node_modules/pi-lens/dist/{chunk-HYDJUVOE.js → chunk-JGUDT5KD.js} +4 -4
  171. package/node_modules/pi-lens/dist/chunk-JOIKBUQN.js +88 -0
  172. package/node_modules/pi-lens/dist/{chunk-AZXTLZHE.js → chunk-K4Z7MK6T.js} +169 -165
  173. package/node_modules/pi-lens/dist/{chunk-WTSQKJAR.js → chunk-K7O6AHSJ.js} +10 -10
  174. package/node_modules/pi-lens/dist/{chunk-S6ZQFPOX.js → chunk-KNJH6WJQ.js} +6 -6
  175. package/node_modules/pi-lens/dist/{chunk-SUIZOCSY.js → chunk-KNSOA43J.js} +1 -1
  176. package/node_modules/pi-lens/dist/{chunk-3QMLB4TI.js → chunk-KXGTLAUW.js} +2 -2
  177. package/node_modules/pi-lens/dist/{chunk-OHEUOWYT.js → chunk-KZ732ZVW.js} +1 -1
  178. package/node_modules/pi-lens/dist/{chunk-G3LR6V6N.js → chunk-L6BDRYUK.js} +19 -17
  179. package/node_modules/pi-lens/dist/{chunk-OVPR3GQ6.js → chunk-LGH2HHZG.js} +24 -6
  180. package/node_modules/pi-lens/dist/{chunk-3R3Z54J7.js → chunk-LOEJFTF2.js} +1 -1
  181. package/node_modules/pi-lens/dist/{chunk-HGEE5LDW.js → chunk-LQQNFCQJ.js} +1 -1
  182. package/node_modules/pi-lens/dist/chunk-LVLPA32Q.js +810 -0
  183. package/node_modules/pi-lens/dist/chunk-M2YMBT5G.js +73 -0
  184. package/node_modules/pi-lens/dist/{chunk-Z2W5YJBW.js → chunk-MJRGPEQ5.js} +11 -11
  185. package/node_modules/pi-lens/dist/{chunk-3EIZMRXI.js → chunk-MOAVEPC4.js} +10 -10
  186. package/node_modules/pi-lens/dist/{chunk-TOOXNL6M.js → chunk-NGNBJIUO.js} +7 -7
  187. package/node_modules/pi-lens/dist/{chunk-AGEQRJ5A.js → chunk-NHA5K226.js} +1 -1
  188. package/node_modules/pi-lens/dist/{chunk-YLW26OHX.js → chunk-NNEQOC3U.js} +31 -59
  189. package/node_modules/pi-lens/dist/{chunk-ZWZD4TJ5.js → chunk-O2MHF7QM.js} +35 -36
  190. package/node_modules/pi-lens/dist/{chunk-PTJXMYRY.js → chunk-OLWGYBYT.js} +15 -16
  191. package/node_modules/pi-lens/dist/{chunk-JKAVKTMY.js → chunk-OZQQ3AIR.js} +17 -20
  192. package/node_modules/pi-lens/dist/{chunk-6JLNZ6DP.js → chunk-P5MSLVUW.js} +10 -10
  193. package/node_modules/pi-lens/dist/{chunk-OF2YGDUE.js → chunk-PFJLYRO3.js} +37 -38
  194. package/node_modules/pi-lens/dist/chunk-PKWEBMCA.js +2957 -0
  195. package/node_modules/pi-lens/dist/{chunk-JLMS7EMD.js → chunk-PPQHMSPH.js} +16 -15
  196. package/node_modules/pi-lens/dist/{chunk-6EIV3H7O.js → chunk-PQF6YGYB.js} +12 -5
  197. package/node_modules/pi-lens/dist/{chunk-VU2PRGRI.js → chunk-PQXUZYTQ.js} +4 -4
  198. package/node_modules/pi-lens/dist/{chunk-MV6ST2KT.js → chunk-Q7J3JYJ2.js} +13 -12
  199. package/node_modules/pi-lens/dist/{chunk-BMMRLJA4.js → chunk-QE5DJ7MX.js} +27 -10
  200. package/node_modules/pi-lens/dist/{chunk-IZ36G463.js → chunk-QE7BJQ6K.js} +7 -7
  201. package/node_modules/pi-lens/dist/{chunk-E5SSUV2A.js → chunk-QMWKSYWB.js} +4 -4
  202. package/node_modules/pi-lens/dist/{chunk-QJ4T73J5.js → chunk-QV3JPCMK.js} +1 -1
  203. package/node_modules/pi-lens/dist/{chunk-3PMLYGJN.js → chunk-R4L7KZ7R.js} +5 -5
  204. package/node_modules/pi-lens/dist/{chunk-7ZVEFWOE.js → chunk-RIH3UBK4.js} +10 -10
  205. package/node_modules/pi-lens/dist/{chunk-T5EGSBM2.js → chunk-RJ3APNIP.js} +3 -3
  206. package/node_modules/pi-lens/dist/{chunk-AAIVSSUU.js → chunk-S6MCMD27.js} +35 -12
  207. package/node_modules/pi-lens/dist/{chunk-SF7KSXB5.js → chunk-SCU62JLX.js} +6 -6
  208. package/node_modules/pi-lens/dist/{chunk-FDLGJFAE.js → chunk-SDYLT45T.js} +3 -3
  209. package/node_modules/pi-lens/dist/chunk-TFKN5EIR.js +27 -0
  210. package/node_modules/pi-lens/dist/{chunk-Y7XMKBFP.js → chunk-TKOFTLGB.js} +34 -26
  211. package/node_modules/pi-lens/dist/chunk-TQWRH25U.js +35 -0
  212. package/node_modules/pi-lens/dist/{chunk-DZSQXG66.js → chunk-TWEOJE3D.js} +277 -62
  213. package/node_modules/pi-lens/dist/{chunk-R67WQ5RY.js → chunk-UN72ZAJ5.js} +8 -8
  214. package/node_modules/pi-lens/dist/{chunk-AD7JDEI6.js → chunk-UNP6Y4JV.js} +16 -16
  215. package/node_modules/pi-lens/dist/{chunk-D6ANA6YU.js → chunk-VGRGW4UL.js} +63 -55
  216. package/node_modules/pi-lens/dist/{chunk-DFAY7JUN.js → chunk-VSQT6IHZ.js} +2 -2
  217. package/node_modules/pi-lens/dist/{chunk-7T64QA5D.js → chunk-VWEBZ2JV.js} +39 -38
  218. package/node_modules/pi-lens/dist/{chunk-HRQTYU2T.js → chunk-W26QZ3OM.js} +1 -1
  219. package/node_modules/pi-lens/dist/{chunk-2HWVG3IM.js → chunk-XDNWR7SG.js} +2 -2
  220. package/node_modules/pi-lens/dist/{chunk-75TVYCQW.js → chunk-XSC3BCN3.js} +5 -5
  221. package/node_modules/pi-lens/dist/{chunk-ME6MF2N2.js → chunk-YCR6ZYTE.js} +1 -1
  222. package/node_modules/pi-lens/dist/{chunk-LD7SXICE.js → chunk-ZI7YHV6I.js} +5 -5
  223. package/node_modules/pi-lens/dist/{chunk-E3PNZDPH.js → chunk-ZQSSO7LO.js} +33 -1
  224. package/node_modules/pi-lens/dist/{chunk-T6PPK3T6.js → chunk-ZULZS2I6.js} +385 -407
  225. package/node_modules/pi-lens/dist/index.js +6508 -5413
  226. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +9 -9
  227. package/node_modules/pi-lens/dist/mcp/cli.js +39 -38
  228. package/node_modules/pi-lens/dist/mcp/server.js +602 -345
  229. package/node_modules/pi-lens/dist/mcp/worker.js +57 -58
  230. package/node_modules/pi-lens/dist/probes/installer.js +19 -17
  231. package/node_modules/pi-lens/docs/architecture.md +113 -0
  232. package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +2 -2
  233. package/node_modules/pi-lens/docs/ci.md +18 -4
  234. package/node_modules/pi-lens/docs/defect-shapes.md +41 -3
  235. package/node_modules/pi-lens/docs/dependencies.md +10 -10
  236. package/node_modules/pi-lens/docs/features.md +3 -3
  237. package/node_modules/pi-lens/docs/invariants/dispatch-runners.md +13 -1
  238. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +19 -0
  239. package/node_modules/pi-lens/docs/language-coverage.md +39 -0
  240. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +10 -4
  241. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +1 -1
  242. package/node_modules/pi-lens/docs/pi-lens-fixer.md +4 -0
  243. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +1 -1
  244. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +4 -5
  245. package/node_modules/pi-lens/docs/pi-lens-subagent.md +5 -2
  246. package/node_modules/pi-lens/docs/prose-standard.md +112 -0
  247. package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
  248. package/node_modules/pi-lens/docs/usage.md +50 -0
  249. package/node_modules/pi-lens/package.json +1 -1
  250. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/array-callback-return-js-test.yml +23 -0
  251. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/array-callback-return-test.yml +23 -0
  252. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-js-test.yml +8 -0
  253. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-test.yml +8 -0
  254. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-js-test.yml +16 -0
  255. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-test.yml +16 -0
  256. package/node_modules/pi-lens/rules/ast-grep-rules/rules/array-callback-return-js.yml +8 -0
  257. package/node_modules/pi-lens/rules/ast-grep-rules/rules/array-callback-return.yml +8 -0
  258. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check-js.yml +17 -5
  259. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check.yml +17 -5
  260. package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-throwing-call-js.yml +8 -1
  261. package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-throwing-call.yml +8 -1
  262. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/ts-react-antipatterns.yml +8 -0
  263. package/node_modules/pi-web-access/CHANGELOG.md +29 -0
  264. package/node_modules/pi-web-access/README.md +35 -15
  265. package/node_modules/pi-web-access/anysearch.ts +7 -3
  266. package/node_modules/pi-web-access/autom.ts +196 -0
  267. package/node_modules/pi-web-access/cloro.ts +254 -0
  268. package/node_modules/pi-web-access/curator-page.ts +7 -1
  269. package/node_modules/pi-web-access/curator-server.ts +3 -0
  270. package/node_modules/pi-web-access/dist/index.js +12931 -12111
  271. package/node_modules/pi-web-access/dist/mcp-cli.js +1188 -416
  272. package/node_modules/pi-web-access/domain-filter-normalization.ts +30 -0
  273. package/node_modules/pi-web-access/duckduckgo-rate-limit.ts +144 -34
  274. package/node_modules/pi-web-access/duckduckgo.ts +11 -3
  275. package/node_modules/pi-web-access/extract.ts +60 -4
  276. package/node_modules/pi-web-access/gemini-search.ts +25 -5
  277. package/node_modules/pi-web-access/index.ts +9 -1
  278. package/node_modules/pi-web-access/package.json +2 -2
  279. package/node_modules/pi-web-access/page-query.ts +12 -3
  280. package/node_modules/pi-web-access/specstream.ts +276 -0
  281. package/node_modules/pi-web-access/tool-activation.ts +21 -6
  282. package/node_modules/pi-web-access/utils.ts +4 -0
  283. package/node_modules/pi-web-access/video-extract.ts +2 -2
  284. package/node_modules/pi-web-access/web-tool-core.ts +24 -5
  285. package/node_modules/pi-web-access/youtube-extract.ts +2 -2
  286. package/package.json +11 -8
  287. package/node_modules/pi-lens/dist/chunk-3VWEZ6H2.js +0 -72
  288. package/node_modules/pi-lens/dist/chunk-7KWI5UHL.js +0 -28
  289. package/node_modules/pi-lens/dist/chunk-7M64NTAK.js +0 -38
  290. package/node_modules/pi-lens/dist/chunk-BEIPWPVR.js +0 -1037
  291. package/node_modules/pi-lens/dist/chunk-D7OEGXDX.js +0 -2417
  292. package/node_modules/pi-lens/dist/chunk-KUDUKKQE.js +0 -89
  293. package/node_modules/pi-lens/dist/chunk-TM3A3K7T.js +0 -28
  294. package/node_modules/pi-lens/dist/chunk-VD7MQFEV.js +0 -56
  295. package/node_modules/pi-lens/dist/chunk-YLHJWAQS.js +0 -256
  296. package/node_modules/pi-lens/dist/chunk-YULIERZW.js +0 -27
@@ -26,7 +26,7 @@
26
26
  * 工具计数:read 按非空路径去重、其余按调用计数(首次出现顺序);edit/write 不进摘要。
27
27
  * 时长 = 回合流逝挂钟;进行中 Running...,结束 Ran for。
28
28
  * abort/error/length 状态行挂在摘要外层,避免被折叠吞掉。
29
- * 最终 agent 回合摘要由 feature/agent-summary 独占(bash/read/edit/write/other)。
29
+ * 最终 agent 回合摘要由 feature/agent-summary 独占(bash/read/edit(含 write)/other)。
30
30
  *
31
31
  * 补丁生命周期遵循仓库既有模式:Symbol 所有权、dispose 仅恢复仍由本安装持有的
32
32
  * 方法、重入守卫防止 /reload 后残留闭包递归。
@@ -47,7 +47,7 @@ import { toolLoadingIcon } from "../utils/tool-loading-icon.ts";
47
47
  import { sanitizeToolResultText } from "../utils/tool-result-sanitize.ts";
48
48
  import { refreshTranscriptComponent } from "./transcript-refresh.ts";
49
49
  import { getMessageDisplayTheme } from "./tool/message-display.ts";
50
- import { showMoreHintText } from "./tool/names.ts";
50
+ import { isToolTuiFullscreen, showMoreHintText } from "./tool/names.ts";
51
51
  import {
52
52
  countEditDiffStats,
53
53
  countWriteDiffStats,
@@ -69,7 +69,7 @@ export function isCompactRoundTail(value: unknown): boolean {
69
69
  return Boolean(value && typeof value === "object" && (value as any)[COMPACT_ROUND_TAIL_KEY]);
70
70
  }
71
71
  import { renderExpandedToolResult } from "./tool/tool-io.ts";
72
- import { paddedBackgroundRow } from "./tool/grouping.ts";
72
+ import { imageBackgroundRow, paddedBackgroundRow } from "./tool/grouping.ts";
73
73
  import { styleChangeCounts } from "./tool/ccstyle-tool.ts";
74
74
  import { formatDisplayPath } from "./tool/names.ts";
75
75
  import {
@@ -413,14 +413,15 @@ function layoutExpandedToolCard(
413
413
  /** live 首行被吃掉的前导缩进:续行同步左移同样格数,保持块内相对对齐。 */
414
414
  let liveLead = 0;
415
415
  const pushRow = (raw: string, imageKind?: ImageRowKind) => {
416
- // 内联图片:锚点行原样输出(live 只补 `↳`),占位行保持零宽。
417
- // 补底色/缩进会让 pi-tui 认不出整块图片,占位行会当成普通行盖在图片上。
416
+ // 内联图片:live 槽位不铺底色,锚点行只补 `↳`、占位行保持零宽;
417
+ // 面板里按全屏/主屏渲染器决定能否给图片行铺底色(见 imageBackgroundRow)。
418
418
  if (imageKind) {
419
- if (imageKind === "filler") {
420
- lines.push("");
421
- return;
419
+ if (live) lines.push(imageKind === "filler" ? "" : `${theme.fg("muted", "↳")} ${raw}`);
420
+ else {
421
+ // 与普通行同口径:剥掉 1 格 lead,由底色行补回的 1 格左边距代替。
422
+ const line = raw.replace(/^((?:\x1b\[[0-?]*[ -/]*[@-~])*) /, "$1");
423
+ lines.push(imageBackgroundRow(theme, outerSlot, line, imageKind, width));
422
424
  }
423
- lines.push(live ? `${theme.fg("muted", "↳")} ${raw}` : raw);
424
425
  return;
425
426
  }
426
427
  if (!live) {
@@ -489,6 +490,20 @@ function layoutExpandedToolCard(
489
490
  return { lines, hits };
490
491
  }
491
492
 
493
+ /**
494
+ * 面板子卡是否还是上一帧的那些行。引用相等是常态(子卡自己缓存行),
495
+ * 但 pi 的 Spacer.render 每次都新建数组,按引用判等会让整张面板每帧重排
496
+ * (逐行重铺底色,单行约 30us)。内容逐行相同时按命中算。
497
+ */
498
+ function samePaintedLines(left: string[], right: string[]): boolean {
499
+ if (left === right) return true;
500
+ if (left.length !== right.length) return false;
501
+ for (let index = 0; index < left.length; index++) {
502
+ if (left[index] !== right[index]) return false;
503
+ }
504
+ return true;
505
+ }
506
+
492
507
  function compactRoundCard(
493
508
  cardItems: Array<{ child?: any; tool?: any }>,
494
509
  toolRender: (tool: any, width: number) => string[],
@@ -518,7 +533,9 @@ function compactRoundCard(
518
533
  theme: unknown;
519
534
  /** 背景槽位也是面板行的输入:改配置后不能复用旧底色的整卡。 */
520
535
  bgSlot: string;
521
- paints: unknown[];
536
+ /** 全屏与主屏的图片行输出不同(见 imageBackgroundRow)。 */
537
+ fullscreen: boolean;
538
+ paints: string[][];
522
539
  lines: string[];
523
540
  hits: Array<{ child: any; start: number; end: number }>;
524
541
  }
@@ -539,8 +556,9 @@ function compactRoundCard(
539
556
  paint.width === width &&
540
557
  paint.theme === theme &&
541
558
  paint.bgSlot === bgSlot &&
559
+ paint.fullscreen === isToolTuiFullscreen() &&
542
560
  paint.paints.length === paints.length &&
543
- paint.paints.every((item, index) => item === paints[index])
561
+ paint.paints.every((item, index) => samePaintedLines(item, paints[index]))
544
562
  ) {
545
563
  return paint;
546
564
  }
@@ -549,6 +567,7 @@ function compactRoundCard(
549
567
  width,
550
568
  theme,
551
569
  bgSlot,
570
+ fullscreen: isToolTuiFullscreen(),
552
571
  paints,
553
572
  lines: laid.lines,
554
573
  hits: laid.hits,
@@ -1241,6 +1260,8 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1241
1260
  settleUntil?: number;
1242
1261
  /** 已请求收尾但回合还有活干(消息仍在流式、工具还在跑):活干完再兑现。 */
1243
1262
  endRequest?: { endTimestamp?: number };
1263
+ /** 段内已冒出外层调用(edit/write/ask):本段到此为止,不再并入后续消息。 */
1264
+ outerSealed?: boolean;
1244
1265
  /** 消息已有 toolCall、工具组件还没到:等它一 updateDisplay 就重画槽位。 */
1245
1266
  pendingLiveTool?: boolean;
1246
1267
  foldTimer?: ReturnType<typeof setTimeout>;
@@ -1627,9 +1648,13 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1627
1648
  /**
1628
1649
  * 可以并入的活动回合。被用户消息隔开时返回 undefined,调用方收掉旧回合另起一个,
1629
1650
  * 保证回合不跨用户消息——否则区间里的用户消息会被当成外来行挪到回合末尾之后。
1651
+ * 外层工具已经封口的回合同样不能并入:工具还在跑时 seal 只挂起收尾,activeRound
1652
+ * 仍指着它;下一条带思考或内层工具的消息必须另起摘要,计数才不会跨过 ask/write。
1630
1653
  */
1631
1654
  const joinableActiveRound = (component: any): CompactRound | undefined =>
1632
- activeRound && !crossesUserMessage(activeRound, component) ? activeRound : undefined;
1655
+ activeRound && !activeRound.outerSealed && !crossesUserMessage(activeRound, component)
1656
+ ? activeRound
1657
+ : undefined;
1633
1658
 
1634
1659
  /** 取并入目标;旧回合被用户消息隔开时先收尾(静默期一转场,新回合立即接手)。 */
1635
1660
  const joinOrCreateRound = (component: any, message: any): CompactRound => {
@@ -1711,10 +1736,11 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1711
1736
 
1712
1737
  /**
1713
1738
  * 尾行归位。目标位:活回合(运行中/收尾静默期)且未展开 → 容器最末,
1714
- * 计数行钉在 transcript 可写底缘,运行中到达的提示行/custom 条目只能落在
1715
- * 它上方,不会被顶离底部截成两行;其余(收尾回合、展开的回合)→ 回合最后
1716
- * 一个成员之后,外来行统一换到摘要行之下。展开的回合不按 live 推到底:
1717
- * 展开卡属于回合原位,推进容器末尾会把它挪到别的消息之间。
1739
+ * 计数行钉在可写底缘,运行中到达的提示行/custom 条目只能落在
1740
+ * 它上方,不会被顶离底部截成两行;其余(收尾回合、展开的回合)→ 本回合
1741
+ * 第一个外露行之前(外层行切段:摘要只盖它之前那一段工具),没有外露行
1742
+ * 则落在最后一个成员之后;外来行统一换到摘要行之下。展开的回合不按 live
1743
+ * 推到底:展开卡属于回合原位,推进容器末尾会把它挪到别的消息之间。
1718
1744
  * 尾行已在目标位就不动容器:展开/收起只换 tail.parts,无谓的重摘重插
1719
1745
  * 本身就是摘要行挪位的来源。
1720
1746
  */
@@ -1735,6 +1761,13 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1735
1761
  // 回合还在跑时它们留在原位,摘要行才能钉在可写底缘。
1736
1762
  const staysAbove = (value: any): boolean =>
1737
1763
  isMember(value) && (!isOuterToolRow(ids, value) || live);
1764
+ const pinToEnd = live && round.anchor?.expanded !== true;
1765
+ /** 摘要行落在第一个外露行之前:外层行切出的那一段到此为止。 */
1766
+ const outerFirst = (list: any[]): number => {
1767
+ if (live) return -1;
1768
+ for (let i = 0; i < list.length; i++) if (isOuterToolRow(ids, list[i])) return i;
1769
+ return -1;
1770
+ };
1738
1771
  const current = children.indexOf(tail.host);
1739
1772
  // 摘尾行前先定目标位,已在位就整段跳过。
1740
1773
  let last = -1;
@@ -1742,14 +1775,13 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1742
1775
  if (children[i] === tail.host || !staysAbove(children[i])) continue;
1743
1776
  last = i;
1744
1777
  }
1745
- // 外露行压在摘要行上方时仍要重排:尾行就算在目标位上也得让位。
1746
- const outerAbove =
1747
- !live &&
1748
- current > 0 &&
1749
- children.some((value: any, index: number) => index < current && isOuterToolRow(ids, value));
1750
- const pinToEnd = live && round.anchor?.expanded !== true;
1751
- const desired = pinToEnd || last < 0 ? children.length - 1 : last + 1;
1752
- if (current === desired && !outerAbove) return;
1778
+ const outer = outerFirst(children);
1779
+ // 目标位要和下面的 insertAt 一致。非活回合有外露行时,摘要插在那一行之前;
1780
+ // 尾还在数组里,所以「已经贴在外露行前面」是 outer - 1,不是 last + 1。
1781
+ // 中间夹着通知时 last + 1 对不上,每帧都会把摘要摘下来再插回去。
1782
+ let desired = pinToEnd || last < 0 ? children.length - 1 : last + 1;
1783
+ if (!pinToEnd && outer >= 0) desired = current < outer ? outer - 1 : outer;
1784
+ if (current >= 0 && current === desired) return;
1753
1785
  if (current >= 0) children.splice(current, 1);
1754
1786
  let first = -1;
1755
1787
  last = -1;
@@ -1773,7 +1805,8 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
1773
1805
  intruders.unshift(children.splice(i, 1)[0]);
1774
1806
  }
1775
1807
  if (lastMember) last = children.indexOf(lastMember);
1776
- const insertAt = last < 0 ? children.length : last + 1;
1808
+ const outerAfter = outerFirst(children);
1809
+ const insertAt = outerAfter >= 0 ? outerAfter : last < 0 ? children.length : last + 1;
1777
1810
  if (pinToEnd) {
1778
1811
  // 活回合:外来行压到最后成员之后,尾行占容器最末。
1779
1812
  children.splice(insertAt, 0, ...intruders);
@@ -2350,30 +2383,14 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2350
2383
 
2351
2384
  if (hasToolCalls) {
2352
2385
  let round = roundByComponent.get(this);
2353
- const previousMessage = round?.messages.get(this);
2354
- const previousHadOuter = Array.isArray(previousMessage?.content)
2355
- ? previousMessage.content.some(
2356
- (item: any) => item?.type === "toolCall" && OUTER_TOOLS.has(String(item?.name ?? "")),
2357
- )
2358
- : false;
2359
2386
  if (!round) {
2360
- // 外层行打断摘要段:本条消息带外层调用且可并入的活动回合已有内容时,
2361
- // 旧回合就地完结(不走静默期)。本条消息自己含 inner 调用或思考才另起一段;
2362
- // 外层独段(edit-only 消息)不建回合——没有可汇总内容,建段只会挂空摘要行。
2387
+ // 外层行打断摘要段:本条消息带外层调用且可并入活动回合时,旧回合就地
2388
+ // 完结(不走静默期)。外层独段(edit-only 消息)不并段也不建段——它没有
2389
+ // 可汇总内容,建段只会挂空摘要行;摘要行落在这一行之前就够了。
2363
2390
  const joinable = joinableActiveRound(this);
2364
- if (joinable && hasOuterToolCall) {
2391
+ if (joinable && hasOuterToolCall && !hasInnerToolCall && !hasThinkingContent) {
2392
+ joinable.outerSealed = true;
2365
2393
  sealRound(joinable, message?.timestamp);
2366
- if (hasInnerToolCall || hasThinkingContent) {
2367
- round = createRound(this, message);
2368
- roundByComponent.set(this, round);
2369
- round.messages.set(this, message);
2370
- if (isUsableTimestamp(message.timestamp) && message.timestamp < round.startedAt) {
2371
- round.startedAt = message.timestamp;
2372
- }
2373
- renderRound(round);
2374
- return undefined;
2375
- }
2376
- // 外层独段:text/thinking 照原生渲染,edit 行由 tool render 外置,没有摘要行。
2377
2394
  return passThroughAssistant(this, message);
2378
2395
  }
2379
2396
  if (hasInnerToolCall || hasThinkingContent) {
@@ -2387,6 +2404,12 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2387
2404
  if (isUsableTimestamp(message.timestamp) && message.timestamp < round.startedAt) {
2388
2405
  round.startedAt = message.timestamp;
2389
2406
  }
2407
+ if (hasOuterToolCall) {
2408
+ // 本条消息自带外层调用:它就是本段的最后一格,后续消息另起一段。
2409
+ round.outerSealed = true;
2410
+ sealRound(round, message?.timestamp);
2411
+ return undefined;
2412
+ }
2390
2413
  renderRound(round);
2391
2414
  return undefined;
2392
2415
  }
@@ -2394,9 +2417,12 @@ export function installCompactMode(deps: CompactModeInstallDeps): CompactModeHoo
2394
2417
  if (activeRound) finishRound(activeRound, message?.timestamp);
2395
2418
  return passThroughAssistant(this, message);
2396
2419
  }
2397
- if (hasOuterToolCall && !previousHadOuter && roundLive(round)) {
2420
+ if (hasOuterToolCall && !round.outerSealed && roundLive(round)) {
2398
2421
  // 消息入段后流式增长才冒出外层调用(先 thinking 后 toolCall):
2399
2422
  // 就地封口所在段,本条消息按消息级归属留在原段,后续消息另起一段。
2423
+ // 不能拿 round.messages 里的上一份消息判「是否新增」:流式消息的
2424
+ // content 是同一个数组实例,外层调用一出现上一份也就有了。
2425
+ round.outerSealed = true;
2400
2426
  sealRound(round, message?.timestamp);
2401
2427
  }
2402
2428
  round.messages.set(this, message);
@@ -623,8 +623,9 @@ function handleFullscreenToolHover(tui: any, packet: SgrMousePacket): void {
623
623
  target = { kind: "tool", component, view, section };
624
624
  }
625
625
  } else if (isCompactAssistantComponent(component)) {
626
- // compact 摘要行:折叠时仅提示文字高亮,展开卡整体高亮。
627
- if (component.expanded || overHint) target = { kind: "assistant", component };
626
+ // compact 摘要行:折叠时仅提示文字高亮。展开的面板本身没有 hover 样式,
627
+ // 命中面板空白行不再点亮它,否则面板里每次指针移动都要多一帧重排。
628
+ if (!component.expanded && overHint) target = { kind: "assistant", component };
628
629
  } else if (isMessageCard(component)) {
629
630
  if (overHint) target = { kind: "message", component };
630
631
  }
@@ -98,46 +98,6 @@ function fitSummaryParts(parts: readonly string[], width: number): string {
98
98
  return visibleWidth(text) <= width ? text : headTruncateToWidth(text, width);
99
99
  }
100
100
 
101
- /**
102
- * 摘要行的打分:调用最能说明脚本在干什么,字符串次之,行长只在前两者相同时决胜。
103
- * 调用权重必须大于「字符串分 + 行长上限」,否则长赋值会压过短调用。
104
- */
105
- const CODE_SUMMARY_CALL_SCORE = 4;
106
- const CODE_SUMMARY_STRING_SCORE = 2;
107
-
108
- /**
109
- * 无子调用时的脚本摘要:取信息量最大的一行语句,压成单行。
110
- *
111
- * 要的是一段真实的 JavaScript 片段,折叠行才能用 highlightCode 着色;
112
- * 标识符链(`a → b → c`)着色器认不出,染不上。跳过注释、空行和 `// @options`。
113
- * 只是折叠行的提示,不求还原语义;看代码还是展开 Input。
114
- */
115
- export function codemodeCodeSummary(code: unknown): string | undefined {
116
- if (typeof code !== "string" || !code.trim()) return undefined;
117
- let best: { text: string; score: number } | undefined;
118
- let skippingBlock = false;
119
- for (const raw of code.split("\n")) {
120
- const line = raw.trim();
121
- if (skippingBlock) {
122
- if (line.includes("*/")) skippingBlock = false;
123
- continue;
124
- }
125
- if (line.startsWith("/*")) {
126
- if (!line.includes("*/")) skippingBlock = true;
127
- continue;
128
- }
129
- if (!line || line.startsWith("//") || line.startsWith("*")) continue;
130
- const text = oneLine(line);
131
- if (!text) continue;
132
- const score =
133
- (text.includes("(") ? CODE_SUMMARY_CALL_SCORE : 0) +
134
- (/["'`]/.test(text) ? CODE_SUMMARY_STRING_SCORE : 0) +
135
- Math.min(text.length, 100) / 100;
136
- if (!best || score > best.score) best = { text, score };
137
- }
138
- return best?.text;
139
- }
140
-
141
101
  /**
142
102
  * 没有子调用时的脚本行:语句逐行用 │ 树线列出,行数跟 expandedInputMaxLines。
143
103
  * 超出的收成一行 `… N more lines`。注释、空行和 `// @options` 不占行。
@@ -44,9 +44,12 @@ export interface DiffStats {
44
44
  lines: number;
45
45
  }
46
46
 
47
+ // Pi emits space-delimited rows only (`+12 content`, blank-numbered ` ...`).
48
+ // Pipe rows, hashline anchors and unified patch rows are kept from the upstream
49
+ // parser (ATTRIBUTION.md); hashline edit tools such as pi-hashline-edit emit
50
+ // `+12#AB:content` in details.diff.
47
51
  const CANONICAL_LINE_PATTERN = /^([+\- ])(\s*\d+)\|(.*)$/;
48
52
  const HASHLINE_ANCHOR_LINE_PATTERN = /^([+\- ])(\s*\d+)#([A-Za-z0-9]+| {2}):(.*)$/;
49
- // Pi still emits space-separated numbered rows, unlike OMP's pipe-delimited format.
50
53
  const PI_LINE_PATTERN = /^([+\- ])(\s*\d+)\s(.*)$/;
51
54
  const PI_OMISSION_LINE_PATTERN = /^ {3,}\.\.\.$/;
52
55
  const HUNK_HEADER_PATTERN = /^@@\s+-(\d+)(?:,(\d+))?\s+\+(\d+)(?:,(\d+))?\s+@@(.*)$/;
@@ -28,6 +28,7 @@ import {
28
28
  contentRowRange,
29
29
  hasVisibleText,
30
30
  imageBlockRows,
31
+ type ImageRowKind,
31
32
  imagePlacement,
32
33
  stripAnsi,
33
34
  stripBackgroundAnsi,
@@ -207,7 +208,8 @@ function visibleLines(lines: string[]): string[] {
207
208
  for (let index = 0; index < lines.length; index++) {
208
209
  const placement = imagePlacement(lines[index]);
209
210
  if (!placement) {
210
- if (stripAnsi(lines[index]).trim()) keep.add(index);
211
+ // 鼠标命中的零宽 APC 标记也算空:只剥 CSI 会把图片前的空行留下来。
212
+ if (hasVisibleText(lines[index])) keep.add(index);
211
213
  continue;
212
214
  }
213
215
  const start = placement.grows === "up" ? index - placement.rows + 1 : index;
@@ -249,18 +251,49 @@ export function paddedBackgroundRow(
249
251
  bgAnsiOverride?: string,
250
252
  ): string {
251
253
  const innerWidth = Math.max(0, width - 2);
252
- const clipped = truncateToWidth(stripBackgroundAnsi(content), innerWidth, "");
254
+ const plain = stripBackgroundAnsi(content);
255
+ // 放得下就不走 truncateToWidth:它在未超宽时原样返回,但含 SGR 的行要逐 grapheme
256
+ // 走慢路径(约 30us/行),展开面板每帧逐行铺底色时这里是主要开销。
257
+ const clipped =
258
+ visibleWidth(plain) <= innerWidth ? plain : truncateToWidth(plain, innerWidth, "");
253
259
  const row = ` ${clipped}${" ".repeat(Math.max(0, innerWidth - visibleWidth(clipped)))} `;
254
- const bgAnsi =
255
- bgAnsiOverride ||
256
- (typeof theme?.bg === "function"
257
- ? theme.getBgAnsi?.(slot) || theme.bg(slot, "").match(/^\x1b\[[0-?]*[ -/]*[@-~]/)?.[0] || ""
258
- : "");
260
+ const bgAnsi = bgAnsiOverride || backgroundAnsi(theme, slot);
259
261
  const stable = bgAnsi ? row.replace(/\x1b\[(?:0)?m/g, (reset) => reset + bgAnsi) : row;
260
262
  if (!bgAnsi) return typeof theme?.bg === "function" ? theme.bg(slot, stable) : row;
261
263
  return `${bgAnsi}${stable}\x1b[49m`;
262
264
  }
263
265
 
266
+ function backgroundAnsi(theme: any, slot: string): string {
267
+ if (typeof theme?.bg !== "function") return "";
268
+ return theme.getBgAnsi?.(slot) || theme.bg(slot, "").match(/^\x1b\[[0-?]*[ -/]*[@-~]/)?.[0] || "";
269
+ }
270
+
271
+ /**
272
+ * 展开卡里内联图片块的一行。
273
+ *
274
+ * 全屏(alt-screen)渲染器先画文字、最后画图片,占位行可以带树线和底色:
275
+ * 占位行按普通行铺满底色;锚点行先用 ECH 按底色擦满整行(不移动光标、不写字符),
276
+ * 再写前缀和图片序列,图片首行右侧也有底色。
277
+ * 主屏渲染器靠「锚点行 + 其后连续零宽行」给图片预留行,占位行只能零宽,锚点行不补底色。
278
+ */
279
+ export function imageBackgroundRow(
280
+ theme: any,
281
+ slot: string,
282
+ content: string,
283
+ kind: ImageRowKind,
284
+ width: number,
285
+ ): string {
286
+ if (kind === "filler") {
287
+ return isToolTuiFullscreen() ? paddedBackgroundRow(theme, slot, content, width) : "";
288
+ }
289
+ // 与普通底色行同口径:左边留 1 格边距,图片才与上方正文对齐。
290
+ const row = ` ${content}`;
291
+ const bgAnsi = isToolTuiFullscreen() ? backgroundAnsi(theme, slot) : "";
292
+ if (!bgAnsi) return row;
293
+ const stable = row.replace(/\x1b\[(?:0)?m/g, (reset) => reset + bgAnsi);
294
+ return `${bgAnsi}\x1b[${Math.max(1, width)}X${stable}\x1b[49m`;
295
+ }
296
+
264
297
  function toolSummary(tool: any): ToolCallSummary {
265
298
  return toolCallSummary(toolName(tool), tool?.args ?? {}, {
266
299
  title: toolTitle(tool),
@@ -380,12 +413,24 @@ function expandedToolRows(tool: any, width: number): string[] {
380
413
  }
381
414
  const rows = rendered.length
382
415
  ? // 续行只剥外层 Box 的 1 格 left pad,保留 Input/Output 相对缩进
383
- rendered.map((line, index) => (index === 0 ? line : stripLeadingSpaces(line, 1)))
416
+ alignImageAnchors(
417
+ rendered.map((line, index) => (index === 0 ? line : stripLeadingSpaces(line, 1))),
418
+ )
384
419
  : [toolSummary(tool).main];
385
420
  expandedToolRowsCache.set(paint, rows);
386
421
  return rows;
387
422
  }
388
423
 
424
+ /** 图片锚点行缩进到上一行正文的位置:图片与 Output 正文左对齐,不贴着树线。 */
425
+ function alignImageAnchors(rows: string[]): string[] {
426
+ let indent = "";
427
+ return rows.map((line) => {
428
+ if (imagePlacement(line)) return indent + line;
429
+ if (hasVisibleText(line)) indent = /^ */.exec(stripAnsi(line))?.[0] ?? "";
430
+ return line;
431
+ });
432
+ }
433
+
389
434
  function toolItem(tool: any): GroupDisplayItem {
390
435
  const toolStatus = status(tool);
391
436
  return {
@@ -417,9 +462,23 @@ function collapsedGroupLine(
417
462
  return truncateToWidth(`${prefix}${item.summary(room, theme)}`, rowWidth, "");
418
463
  }
419
464
 
420
- /** 末项结尾的尾随空行不计入卡高(内联图片的占位行除外,见 contentRowRange)。 */
465
+ /** 行内只有树线和空白:渲染出来的空 rail 行,本身就是一个间隔行。 */
466
+ function isBlankRail(line: string): boolean {
467
+ return /^[\s│]*$/.test(stripAnsi(line));
468
+ }
469
+
470
+ /**
471
+ * 项与项之间留一行空行,把上一项的 Output 和下一项的工具行隔开;末项不加。
472
+ * 项自己已经用空 rail 行收尾的(子代理通知卡),不再叠第二行。
473
+ * 末项结尾的尾随空行不计入卡高(内联图片的占位行除外,见 contentRowRange)。
474
+ */
421
475
  function panelRows(rows: string[], last: boolean): string[] {
422
- if (!last) return rows;
476
+ if (!last) {
477
+ // 多行图片的占位行是零宽空行,看起来像空 rail,但终端里它被图片盖住,
478
+ // 不是已经留出的间隔。末行属于图片块时仍要补一行可见空行。
479
+ const endsOnImage = rows.length > 0 && imageBlockRows(rows).has(rows.length - 1);
480
+ return rows.length && !endsOnImage && isBlankRail(rows[rows.length - 1]) ? rows : [...rows, ""];
481
+ }
423
482
  const end = Math.max(1, contentRowRange(rows).last + 1);
424
483
  return end >= rows.length ? rows : rows.slice(0, end);
425
484
  }
@@ -681,14 +740,16 @@ export class ToolGroupComponent extends Container {
681
740
  ? `${fg("dim", branch)} ${fg(color, statusIcon(item.status))} `
682
741
  : fg("dim", continuation);
683
742
  const imageKind = imageRows.get(lineIndex);
684
- // 图片占位行必须零宽:补空格/底色会盖住图片,pi-tui 也认不出整块图片。
685
- if (imageKind === "filler") {
686
- lines.push("");
687
- continue;
688
- }
689
- // 锚点行只带树枝前缀:行尾补的底色空格会画在图片首行上。
690
- if (imageKind === "anchor") {
691
- lines.push(prefix + rows[lineIndex]);
743
+ if (imageKind) {
744
+ lines.push(
745
+ imageBackgroundRow(
746
+ theme,
747
+ backgroundSlot,
748
+ prefix + (imageKind === "anchor" ? rows[lineIndex] : ""),
749
+ imageKind,
750
+ width,
751
+ ),
752
+ );
692
753
  continue;
693
754
  }
694
755
  lines.push(paddedBackgroundRow(theme, backgroundSlot, prefix + rows[lineIndex], width));
@@ -310,10 +310,6 @@ export class ExpandedToolIoView {
310
310
  lines.push(truncateToWidth(theme.fg("dim", prefix) + styledContent, safeWidth, ""));
311
311
  };
312
312
 
313
- const pushBlankRail = () => {
314
- lines.push(truncateToWidth(theme.fg("dim", `${lead}│`), safeWidth, ""));
315
- };
316
-
317
313
  const pushBody = (
318
314
  body: string,
319
315
  opts: {
@@ -400,7 +396,6 @@ export class ExpandedToolIoView {
400
396
  continued: true,
401
397
  section: "input",
402
398
  });
403
- pushBlankRail();
404
399
  this.truncated.output = outputWouldTruncate;
405
400
  pushHeader("└", "Output");
406
401
  pushBody(outputText, {
@@ -11,6 +11,8 @@ const CSI_SEQUENCE_RE = /\x1b\[[0-?]*[ -/]*[@-~]/g;
11
11
  const OSC_SEQUENCE_RE = /\x1b\][^\x07]*(?:\x07|\x1b\\)/g;
12
12
  /** compact-mode 原有 hasVisibleText 用的更严格 OSC(内容不允许内嵌 ESC)。 */
13
13
  const OSC_SEQUENCE_STRICT_RE = /\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g;
14
+ /** APC 序列:鼠标命中用的零宽行标记(\x1b_cc:…\x07)、kitty 图片(\x1b_G…\x1b\\)。 */
15
+ const APC_SEQUENCE_RE = /\x1b_[^\x07\x1b]*(?:\x07|\x1b\\)/g;
14
16
 
15
17
  /** 剥离一行内所有 CSI 序列。 */
16
18
  export function stripAnsi(line: string): string {
@@ -19,7 +21,10 @@ export function stripAnsi(line: string): string {
19
21
 
20
22
  /** 仅剥离终端序列、保留原布局(换行/空白不动),用于命中区间计算。 */
21
23
  export function stripTerminalSequencesPreservingLayout(value: string): string {
22
- return value.replace(OSC_SEQUENCE_RE, "").replace(CSI_SEQUENCE_RE, "");
24
+ return value
25
+ .replace(OSC_SEQUENCE_RE, "")
26
+ .replace(APC_SEQUENCE_RE, "")
27
+ .replace(CSI_SEQUENCE_RE, "");
23
28
  }
24
29
 
25
30
  /** 剥离终端序列并折叠空白(用于纯文本比较)。 */
@@ -27,10 +32,16 @@ export function stripTerminalSequences(value: string): string {
27
32
  return stripTerminalSequencesPreservingLayout(value).replace(/\s+/g, " ").trim();
28
33
  }
29
34
 
30
- /** 去掉行内所有 CSI/OSC 序列后是否仍有可见文本(判断工具卡首尾内容行)。 */
35
+ /** 去掉行内所有 CSI/OSC/APC 序列后是否仍有可见文本(判断工具卡首尾内容行)。 */
31
36
  export function hasVisibleText(line: string): boolean {
32
37
  // OSC 用更严格的变体:内容内嵌 ESC 时不吞并后续文本,保持 compact-mode 原有语义。
33
- return line.replace(CSI_SEQUENCE_RE, "").replace(OSC_SEQUENCE_STRICT_RE, "").trim().length > 0;
38
+ return (
39
+ line
40
+ .replace(CSI_SEQUENCE_RE, "")
41
+ .replace(OSC_SEQUENCE_STRICT_RE, "")
42
+ .replace(APC_SEQUENCE_RE, "")
43
+ .trim().length > 0
44
+ );
34
45
  }
35
46
 
36
47
  const KITTY_IMAGE_PREFIX = "\x1b_G";
@@ -123,7 +134,10 @@ export function stripLeadingStatusIcon(line: string): string {
123
134
  }
124
135
 
125
136
  /** 终端序列零宽(不计入 plain 下标),与 stripAnsi/stripTerminalSequencesPreservingLayout 一致。 */
126
- const ANY_SEQUENCE_RE = new RegExp(`${CSI_SEQUENCE_RE.source}|${OSC_SEQUENCE_RE.source}`, "g");
137
+ const ANY_SEQUENCE_RE = new RegExp(
138
+ `${CSI_SEQUENCE_RE.source}|${OSC_SEQUENCE_RE.source}|${APC_SEQUENCE_RE.source}`,
139
+ "g",
140
+ );
127
141
 
128
142
  /** 只保留 [start, end) 之外的字符(base 为 text 首字符在 plain 串中的下标)。 */
129
143
  function keepOutsideRange(text: string, base: number, start: number, end: number): string {
@@ -22,6 +22,21 @@ export function formatDuration(ms: number): string {
22
22
  return `${seconds}s`;
23
23
  }
24
24
 
25
+ /**
26
+ * 时刻 → "11/15 6:51 PM"(M/D 加 12 小时制,英文 AM/PM)。
27
+ * 跨天的会话里只看时分分不清是哪一天,所以带上日期。
28
+ * 自己拼而不用 toLocaleTimeString/toLocaleDateString:新版 ICU 在 AM/PM 前放的是窄不换行空格(U+202F),
29
+ * 日期分隔符也随 locale 变,各版本不一致。
30
+ * 非法值返回 "",调用方据此省略这一段。
31
+ */
32
+ export function formatTimestamp(ms: number): string {
33
+ if (!Number.isFinite(ms) || ms <= 0) return "";
34
+ const date = new Date(ms);
35
+ const hour = date.getHours() % 12 || 12;
36
+ const minute = String(date.getMinutes()).padStart(2, "0");
37
+ return `${date.getMonth() + 1}/${date.getDate()} ${hour}:${minute} ${date.getHours() < 12 ? "AM" : "PM"}`;
38
+ }
39
+
25
40
  /** 文本单行化:去换行空白,超宽截断加省略号。 */
26
41
  export function oneLine(value: unknown, max = 96): string {
27
42
  const text = sanitizeToolResultText(String(value ?? ""), 4096)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-cc-extensions",
3
- "version": "1.0.17-local.1",
3
+ "version": "1.0.20-local.1",
4
4
  "license": "MIT",
5
5
  "description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
6
6
  "type": "module",
@@ -74,10 +74,10 @@
74
74
  },
75
75
  "x-upstream": {
76
76
  "package": "pi-cc-extensions",
77
- "version": "1.0.17",
78
- "reviewedVersion": "1.0.17",
77
+ "version": "1.0.20",
78
+ "reviewedVersion": "1.0.20",
79
79
  "repository": "https://github.com/minuque/pi-cc-extensions",
80
- "commit": "04c4274d08135b5880bad285f92b11e9b22d115e",
80
+ "commit": "1c3a42614709c1b14a836b669359771c71939200",
81
81
  "trackVersion": true
82
82
  }
83
83
  }
@@ -1,5 +1,17 @@
1
1
  # @herbertgao/pi-impeccable
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#383](https://github.com/HerbertGao/pi-extensions/pull/383) [`34e9a94`](https://github.com/HerbertGao/pi-extensions/commit/34e9a9445806afbd5be85034fe32ceea1919f9eb) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Vendor the official Impeccable 4.9.2 Pi skill. The launcher pins engine 0.1.25. A critique reads the design-review rubric, and a new surface reads the world or comp playbook when that part applies. The local Go staged-removal fix is kept.
8
+
9
+ ## 0.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#377](https://github.com/HerbertGao/pi-extensions/pull/377) [`b02be94`](https://github.com/HerbertGao/pi-extensions/commit/b02be9410f637abc110fd2ee02def0f9d75fd419) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Vendor the official Impeccable 4.9.1 Pi skill. The launcher pins engine 0.1.24, and a GitHub HTTP 5xx during download says the outage is on GitHub's side. `/impeccable foundations` walks a product-foundations checklist. Hiding the live bar stops capturing clicks. The local Go staged-removal fix is kept.
14
+
3
15
  ## 0.3.0
4
16
 
5
17
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  # @herbertgao/pi-impeccable
2
2
 
3
- The [Impeccable](https://github.com/pbakaus/impeccable) design skill for [Pi](https://pi.dev/), vendored from the official `skill-v4.8.2` release. It provides design steering, critique, audit, and deterministic anti-pattern detection without an installer, background service, or global skill directory.
3
+ The [Impeccable](https://github.com/pbakaus/impeccable) design skill for [Pi](https://pi.dev/), vendored from the official `4.9.2` Pi skill payload (`cli-v4.9.2`). It provides design steering, critique, audit, and deterministic anti-pattern detection without an installer, background service, or global skill directory.
4
4
 
5
5
  ## Install
6
6
 
@@ -27,7 +27,7 @@ Upstream `pin` and `unpin` only discover skill installations in project harness
27
27
 
28
28
  ## Updates and provenance
29
29
 
30
- This package vendors the official Pi payload: 58 files from commit [`035c8f319edd019936525a062fe99e83ca8d12c6`](https://github.com/pbakaus/impeccable/commit/035c8f319edd019936525a062fe99e83ca8d12c6). `scripts/live-browser.js` has one local fix on top of that commit: Go still cleans edit markers on the live selection, but it no longer detaches a staged removal, so Undo and Discard can restore the hidden node. The review cursor stays at that commit. Updates are reviewed and released through this repository rather than the upstream auto-updater.
30
+ This package vendors the official Pi payload: 63 files from commit [`bba37e8ff05a099ae8f72db929453b31c82bef20`](https://github.com/pbakaus/impeccable/commit/bba37e8ff05a099ae8f72db929453b31c82bef20). `scripts/live-browser.js` has one local fix on top of that commit: Go still cleans edit markers on the live selection, but it no longer detaches a staged removal, so Undo and Discard can restore the hidden node. The review cursor stays at that commit. Updates are reviewed and released through this repository rather than the upstream auto-updater. The launcher pins engine `0.1.25`. `/impeccable foundations` walks a product-foundations checklist, and a hidden live bar stops capturing page clicks.
31
31
 
32
32
  ## License
33
33
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-impeccable",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "The Impeccable design skill for Pi, vendored from the official release.",
5
5
  "keywords": [
6
6
  "design",
@@ -46,9 +46,9 @@
46
46
  },
47
47
  "x-upstream": {
48
48
  "package": "impeccable",
49
- "version": "4.8.2",
50
- "reviewedVersion": "4.8.2",
49
+ "version": "4.9.2",
50
+ "reviewedVersion": "4.9.2",
51
51
  "repository": "https://github.com/pbakaus/impeccable",
52
- "commit": "035c8f319edd019936525a062fe99e83ca8d12c6"
52
+ "commit": "bba37e8ff05a099ae8f72db929453b31c82bef20"
53
53
  }
54
54
  }