@herbertgao/pi-extensions 2026.10.10 → 2026.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/README.md +13 -11
  2. package/THIRD_PARTY_NOTICES.md +3 -3
  3. package/node_modules/@herbertgao/pi-agency/README.md +5 -3
  4. package/node_modules/@herbertgao/pi-agency/package.json +1 -1
  5. package/node_modules/@herbertgao/pi-agency/src/index.ts +51 -7
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -0
  7. package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -0
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -1
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +3 -3
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +126 -42
  11. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +24 -6
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +69 -16
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +1 -1
  14. package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
  15. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  16. package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
  17. package/node_modules/@herbertgao/pi-subagents/src/agent-color.ts +11 -2
  18. package/node_modules/@herbertgao/pi-subagents/src/index.ts +10 -5
  19. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +3 -2
  20. package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +1 -1
  21. package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +1 -0
  22. package/node_modules/@herbertgao/sol-pi/README.md +8 -2
  23. package/node_modules/@herbertgao/sol-pi/agents-install.md +2 -2
  24. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +28 -4
  25. package/node_modules/@herbertgao/sol-pi/docs/configuration.md +17 -4
  26. package/node_modules/@herbertgao/sol-pi/package.json +1 -1
  27. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +35 -25
  28. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +95 -26
  29. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +39 -2
  30. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +24 -0
  31. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +12 -7
  32. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +138 -130
  33. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +88 -14
  34. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +9 -0
  35. package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +14 -5
  36. package/node_modules/@herbertgao/sol-pi/src/sol-pi/shell-options.ts +22 -0
  37. package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +11 -0
  38. package/node_modules/@juicesharp/rpiv-ask-user-question/answer-channel.ts +109 -0
  39. package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +117 -71
  40. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +2 -0
  41. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +3 -1
  42. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/startup-performance.md +83 -0
  43. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +74 -5
  44. package/node_modules/@juicesharp/rpiv-ask-user-question/events.ts +84 -0
  45. package/node_modules/@juicesharp/rpiv-ask-user-question/index.ts +10 -4
  46. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -2
  47. package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +1 -1
  48. package/node_modules/@juicesharp/rpiv-ask-user-question/reconcile.ts +1 -1
  49. package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +5 -4
  50. package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +19 -19
  51. package/node_modules/@juicesharp/rpiv-ask-user-question/state/i18n-bridge.ts +1 -1
  52. package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +7 -4
  53. package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +10 -10
  54. package/node_modules/@juicesharp/rpiv-ask-user-question/state/row-intent.ts +2 -2
  55. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/contract.ts +6 -6
  56. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +2 -2
  57. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/focus.ts +1 -1
  58. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +9 -9
  59. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +5 -5
  60. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -2
  61. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/external-answer.ts +125 -0
  62. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +1 -1
  63. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +1 -1
  64. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +2 -2
  65. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +1 -1
  66. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/validate-questionnaire.ts +1 -1
  67. package/node_modules/@juicesharp/rpiv-ask-user-question/view/component-binding.ts +4 -4
  68. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -4
  69. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/option-list-view.ts +2 -2
  70. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/markdown-content-cache.ts +3 -3
  71. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +5 -5
  72. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-layout-decider.ts +3 -3
  73. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +10 -10
  74. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/submit-picker.ts +2 -2
  75. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/tab-bar.ts +1 -1
  76. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/wrapping-select.ts +1 -1
  77. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +9 -9
  78. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +1 -1
  79. package/node_modules/@juicesharp/rpiv-ask-user-question/view/props-adapter.ts +8 -8
  80. package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-components.ts +4 -4
  81. package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +10 -10
  82. package/node_modules/@narumitw/pi-btw/README.md +14 -5
  83. package/node_modules/@narumitw/pi-btw/dist/index.ts +1067 -557
  84. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
  85. package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +277 -0
  86. package/node_modules/@narumitw/pi-btw/docs/native-appearance.md +857 -0
  87. package/node_modules/@narumitw/pi-btw/docs/workflows.md +34 -13
  88. package/node_modules/@narumitw/pi-btw/package.json +4 -4
  89. package/node_modules/@narumitw/pi-btw/src/btw.ts +152 -108
  90. package/node_modules/@narumitw/pi-btw/src/conversation-chrome.ts +93 -0
  91. package/node_modules/@narumitw/pi-btw/src/fullscreen-renderer.ts +329 -0
  92. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +109 -309
  93. package/node_modules/@narumitw/pi-btw/src/keybindings.ts +101 -23
  94. package/node_modules/@narumitw/pi-btw/src/menu.ts +42 -27
  95. package/node_modules/@narumitw/pi-btw/src/session-lifetime.ts +66 -0
  96. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +366 -164
  97. package/node_modules/@narumitw/pi-btw/src/workspace-layout.ts +96 -36
  98. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1 -0
  99. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
  100. package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
  101. package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +1 -0
  102. package/node_modules/pi-antigravity/README.md +6 -2
  103. package/node_modules/pi-antigravity/package.json +2 -2
  104. package/node_modules/pi-antigravity/src/client/client.ts +44 -52
  105. package/node_modules/pi-antigravity/src/index.ts +13 -0
  106. package/node_modules/pi-antigravity/src/models/discovery.ts +25 -2
  107. package/node_modules/pi-antigravity/src/models/grouping.ts +107 -68
  108. package/node_modules/pi-antigravity/src/models/models.ts +10 -0
  109. package/node_modules/pi-antigravity/src/search/search.ts +581 -43
  110. package/node_modules/pi-antigravity/src/stream/stream.ts +53 -13
  111. package/node_modules/pi-antigravity/src/types/types.ts +13 -0
  112. package/node_modules/pi-antigravity/src/usage/usage.ts +11 -3
  113. package/node_modules/pi-lens/CHANGELOG.md +281 -0
  114. package/node_modules/pi-lens/README.md +13 -1
  115. package/node_modules/pi-lens/dist/{chunk-SS36ZX4J.js → chunk-24AKHFGP.js} +6 -6
  116. package/node_modules/pi-lens/dist/{chunk-JSQFTSC6.js → chunk-2FN63LPV.js} +11 -11
  117. package/node_modules/pi-lens/dist/{chunk-5UCAH366.js → chunk-2KXTHF3M.js} +20 -20
  118. package/node_modules/pi-lens/dist/{chunk-EU63SDCG.js → chunk-3DA2JDOL.js} +367 -281
  119. package/node_modules/pi-lens/dist/{chunk-RWWYJ623.js → chunk-3KAZU3VR.js} +1 -1
  120. package/node_modules/pi-lens/dist/chunk-3PTHXJXR.js +28 -0
  121. package/node_modules/pi-lens/dist/chunk-3QED2P4V.js +31 -0
  122. package/node_modules/pi-lens/dist/{chunk-N2H3ZPZY.js → chunk-3RKP3FMS.js} +1 -0
  123. package/node_modules/pi-lens/dist/{chunk-XVF2VVXP.js → chunk-5HSRT26B.js} +2 -2
  124. package/node_modules/pi-lens/dist/{chunk-MXGY6KPT.js → chunk-5IUSNGOC.js} +15 -15
  125. package/node_modules/pi-lens/dist/{chunk-EJIUXPBX.js → chunk-5OFV52AM.js} +1 -1
  126. package/node_modules/pi-lens/dist/{chunk-AW7R2GWG.js → chunk-5VSF4UUQ.js} +12 -7
  127. package/node_modules/pi-lens/dist/{chunk-6STA6Z7I.js → chunk-5WRPDP2A.js} +18 -18
  128. package/node_modules/pi-lens/dist/{chunk-YIUAVF7E.js → chunk-6DLWKFEX.js} +35 -34
  129. package/node_modules/pi-lens/dist/{chunk-WOA4LN2R.js → chunk-7D6L4MTX.js} +2 -2
  130. package/node_modules/pi-lens/dist/{chunk-GAEGEPOC.js → chunk-7HXE67BN.js} +2 -2
  131. package/node_modules/pi-lens/dist/chunk-AGSS7277.js +84 -0
  132. package/node_modules/pi-lens/dist/{chunk-R3PCY3YS.js → chunk-AMERCH6V.js} +13 -13
  133. package/node_modules/pi-lens/dist/{chunk-WU567RSC.js → chunk-ATKJFDQN.js} +14 -10
  134. package/node_modules/pi-lens/dist/{chunk-VSSBEUFT.js → chunk-AWSCPCN2.js} +16 -16
  135. package/node_modules/pi-lens/dist/{chunk-VCHXCQFG.js → chunk-BWD5EPKO.js} +3 -3
  136. package/node_modules/pi-lens/dist/{chunk-H6MF6EVN.js → chunk-CT4MN5IU.js} +1200 -230
  137. package/node_modules/pi-lens/dist/{chunk-FCSOVF55.js → chunk-CUHSHSB6.js} +6 -6
  138. package/node_modules/pi-lens/dist/{chunk-CHOW74WE.js → chunk-CYRKQRPM.js} +7 -10
  139. package/node_modules/pi-lens/dist/{chunk-Q7DUK4LX.js → chunk-DEL2U6CM.js} +5 -5
  140. package/node_modules/pi-lens/dist/{chunk-6C7JWPCP.js → chunk-DGUKIYSI.js} +26 -23
  141. package/node_modules/pi-lens/dist/{chunk-PHDMFAKM.js → chunk-DUO2TU77.js} +2 -2
  142. package/node_modules/pi-lens/dist/{chunk-MRXKYPCS.js → chunk-EBC36LNN.js} +2 -2
  143. package/node_modules/pi-lens/dist/{chunk-CSHFH5IN.js → chunk-ED36RF6Y.js} +1 -1
  144. package/node_modules/pi-lens/dist/{chunk-76MWC2K6.js → chunk-EUXZEFTV.js} +90 -97
  145. package/node_modules/pi-lens/dist/{chunk-QOZXJ4NA.js → chunk-FM4RDMKT.js} +11 -8
  146. package/node_modules/pi-lens/dist/{chunk-ACXEQZOU.js → chunk-GAQ7OQG6.js} +31 -28
  147. package/node_modules/pi-lens/dist/{chunk-XAGLWMJ4.js → chunk-GL5LUMZE.js} +23 -23
  148. package/node_modules/pi-lens/dist/{chunk-BKE7E7TC.js → chunk-GMX5OS7B.js} +9 -9
  149. package/node_modules/pi-lens/dist/{chunk-ZHFZWTZV.js → chunk-GSLNCYGG.js} +11 -11
  150. package/node_modules/pi-lens/dist/{chunk-3W7IEVVL.js → chunk-GSM5UU7A.js} +26 -34
  151. package/node_modules/pi-lens/dist/{chunk-724UL2TJ.js → chunk-GXFV6MYU.js} +3 -3
  152. package/node_modules/pi-lens/dist/chunk-HAD7QRQI.js +30 -0
  153. package/node_modules/pi-lens/dist/{chunk-QOBUHWHX.js → chunk-HRNHZA3N.js} +6 -6
  154. package/node_modules/pi-lens/dist/{chunk-VWCXW2E7.js → chunk-HWCCCQNX.js} +1 -1
  155. package/node_modules/pi-lens/dist/{chunk-7DYBLXYA.js → chunk-HYGZEMX6.js} +3 -3
  156. package/node_modules/pi-lens/dist/chunk-IJYGIDF4.js +186 -0
  157. package/node_modules/pi-lens/dist/{chunk-4W4VLAPJ.js → chunk-IQWN5JCP.js} +11 -11
  158. package/node_modules/pi-lens/dist/{chunk-SQ4TVJBR.js → chunk-IUE7SSKV.js} +7 -7
  159. package/node_modules/pi-lens/dist/{chunk-IBGIOBEE.js → chunk-IWDLU6K3.js} +68 -5
  160. package/node_modules/pi-lens/dist/{chunk-XCJN5IJU.js → chunk-IYNJ6YPZ.js} +4 -4
  161. package/node_modules/pi-lens/dist/{chunk-JAU72XNY.js → chunk-J64T55EI.js} +3 -3
  162. package/node_modules/pi-lens/dist/{chunk-2BBLFX75.js → chunk-J6MPGQTS.js} +5 -5
  163. package/node_modules/pi-lens/dist/chunk-JORED7EX.js +44 -0
  164. package/node_modules/pi-lens/dist/{chunk-6SDEP3AJ.js → chunk-JUKMK5Y4.js} +8 -8
  165. package/node_modules/pi-lens/dist/{chunk-FMSO6RDZ.js → chunk-JW3YWBVB.js} +15 -15
  166. package/node_modules/pi-lens/dist/{chunk-L3BLXZG7.js → chunk-KAPJINKN.js} +30 -69
  167. package/node_modules/pi-lens/dist/{chunk-2B73ZPOK.js → chunk-KN35K52N.js} +3 -3
  168. package/node_modules/pi-lens/dist/{chunk-C34ZXZ7O.js → chunk-KUA4OJ5Y.js} +24 -11
  169. package/node_modules/pi-lens/dist/chunk-KYUB6QDC.js +72 -0
  170. package/node_modules/pi-lens/dist/{chunk-67WMNWEE.js → chunk-LLJNQKQW.js} +12 -10
  171. package/node_modules/pi-lens/dist/chunk-LZSEQW6A.js +57 -0
  172. package/node_modules/pi-lens/dist/{chunk-ZANLILYD.js → chunk-M2IFVFWU.js} +2 -2
  173. package/node_modules/pi-lens/dist/chunk-M2UD3LPU.js +88 -0
  174. package/node_modules/pi-lens/dist/{chunk-XIJZVPD5.js → chunk-MBKQHGA7.js} +15 -15
  175. package/node_modules/pi-lens/dist/{chunk-P7266HLM.js → chunk-MPNJLASA.js} +2 -2
  176. package/node_modules/pi-lens/dist/{chunk-6GFRNVYR.js → chunk-MZGQNL3Y.js} +10 -10
  177. package/node_modules/pi-lens/dist/{chunk-ZWFS3OEF.js → chunk-N5FLEO7W.js} +33 -32
  178. package/node_modules/pi-lens/dist/{chunk-3JNKMP3B.js → chunk-O4NWQT6I.js} +4 -4
  179. package/node_modules/pi-lens/dist/{chunk-T6CPIZNT.js → chunk-OHKJ7PQF.js} +33 -32
  180. package/node_modules/pi-lens/dist/{chunk-VRZP76YM.js → chunk-P63GXC37.js} +4 -1
  181. package/node_modules/pi-lens/dist/{chunk-XTMJ7XDT.js → chunk-POMLXPMY.js} +1 -1
  182. package/node_modules/pi-lens/dist/{chunk-QQNQ7SJW.js → chunk-QBFBRV2B.js} +10 -4
  183. package/node_modules/pi-lens/dist/{chunk-CMMHNUZ2.js → chunk-R3T7CLQ2.js} +60 -38
  184. package/node_modules/pi-lens/dist/{chunk-23WOO7TX.js → chunk-R7YOCSNV.js} +10 -10
  185. package/node_modules/pi-lens/dist/{chunk-2CD5RS6M.js → chunk-RKBXZN3A.js} +23 -2
  186. package/node_modules/pi-lens/dist/{chunk-OCAGUNBC.js → chunk-RKKOYPRA.js} +12 -12
  187. package/node_modules/pi-lens/dist/{chunk-52FUZI6K.js → chunk-RMLC67LF.js} +1 -1
  188. package/node_modules/pi-lens/dist/{chunk-XMSXXAHW.js → chunk-ROYSX2S5.js} +2 -2
  189. package/node_modules/pi-lens/dist/{chunk-M6HSLBWY.js → chunk-RVK72CZX.js} +6507 -7514
  190. package/node_modules/pi-lens/dist/{chunk-FLKWCIZH.js → chunk-S2HEXIWI.js} +5 -5
  191. package/node_modules/pi-lens/dist/{chunk-UZ3TUTRV.js → chunk-S67KYG37.js} +1 -1
  192. package/node_modules/pi-lens/dist/{chunk-VCO24T4L.js → chunk-SD4I7ZO4.js} +14 -14
  193. package/node_modules/pi-lens/dist/{chunk-Z527N6YQ.js → chunk-SKAMFC7A.js} +12 -12
  194. package/node_modules/pi-lens/dist/{chunk-MQLUAEOC.js → chunk-SRYEJNES.js} +2 -2
  195. package/node_modules/pi-lens/dist/{chunk-BRGDSBJE.js → chunk-SYE6T2EB.js} +12 -12
  196. package/node_modules/pi-lens/dist/{chunk-GXW6K4YJ.js → chunk-T57LYLZT.js} +1 -1
  197. package/node_modules/pi-lens/dist/{chunk-ZXYDQ3TZ.js → chunk-T7FEBKXN.js} +48 -15
  198. package/node_modules/pi-lens/dist/{chunk-3EFKIGZN.js → chunk-TIQ2PKDW.js} +3 -3
  199. package/node_modules/pi-lens/dist/{chunk-QILIYSJF.js → chunk-TLX72JTG.js} +1 -1
  200. package/node_modules/pi-lens/dist/{chunk-TYM6OUIT.js → chunk-TOY6QKOH.js} +12 -12
  201. package/node_modules/pi-lens/dist/{chunk-IZSHAIJ7.js → chunk-TRETHTQO.js} +12 -12
  202. package/node_modules/pi-lens/dist/{chunk-3VPVG5SU.js → chunk-U44DJXQP.js} +10 -6
  203. package/node_modules/pi-lens/dist/{chunk-PNQDPDRC.js → chunk-UA7ZXYDR.js} +1 -1
  204. package/node_modules/pi-lens/dist/{chunk-OXXKQCSV.js → chunk-UBOQLVT2.js} +4 -4
  205. package/node_modules/pi-lens/dist/{chunk-QGQ5CCCG.js → chunk-UMS2MFPZ.js} +2 -2
  206. package/node_modules/pi-lens/dist/{chunk-QHJ6DQ2R.js → chunk-US7ECLD7.js} +55 -13
  207. package/node_modules/pi-lens/dist/{chunk-AB3YYG6N.js → chunk-UZ2XCLYS.js} +8 -8
  208. package/node_modules/pi-lens/dist/chunk-V35JG4JB.js +2667 -0
  209. package/node_modules/pi-lens/dist/{chunk-N3X6Q4YT.js → chunk-VOOAPROD.js} +3 -3
  210. package/node_modules/pi-lens/dist/{chunk-SAEFPSB6.js → chunk-W66O5E25.js} +21 -11
  211. package/node_modules/pi-lens/dist/{chunk-KBG47GHP.js → chunk-WMYE35PX.js} +15 -11
  212. package/node_modules/pi-lens/dist/{chunk-5NGR67U5.js → chunk-XBJVAEEO.js} +32 -5
  213. package/node_modules/pi-lens/dist/{chunk-YYOIQFRS.js → chunk-XHJBS436.js} +122 -44
  214. package/node_modules/pi-lens/dist/{chunk-GBPP5P7X.js → chunk-XTBDCR27.js} +4 -4
  215. package/node_modules/pi-lens/dist/{chunk-4UNXBNE2.js → chunk-XTFDJI3T.js} +11 -11
  216. package/node_modules/pi-lens/dist/{chunk-UXGETRP4.js → chunk-XYURS6EN.js} +13 -12
  217. package/node_modules/pi-lens/dist/{chunk-RPLINGVB.js → chunk-Y6GZHWSJ.js} +6 -6
  218. package/node_modules/pi-lens/dist/{chunk-2VUQMUMT.js → chunk-YCWYO6TQ.js} +41 -38
  219. package/node_modules/pi-lens/dist/{chunk-77M37OKR.js → chunk-YH5MVY2U.js} +7 -7
  220. package/node_modules/pi-lens/dist/{chunk-AOHZU2BM.js → chunk-YNE3RP52.js} +1 -1
  221. package/node_modules/pi-lens/dist/{chunk-YSZNHOBY.js → chunk-ZHH37KZL.js} +12 -12
  222. package/node_modules/pi-lens/dist/{chunk-ZGDGW2V3.js → chunk-ZIVJBOO3.js} +2 -2
  223. package/node_modules/pi-lens/dist/{chunk-RXCOMYPY.js → chunk-ZVUL7QYY.js} +29 -28
  224. package/node_modules/pi-lens/dist/index.js +11052 -5852
  225. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -9
  226. package/node_modules/pi-lens/dist/mcp/cli.js +41 -38
  227. package/node_modules/pi-lens/dist/mcp/server.js +1120 -474
  228. package/node_modules/pi-lens/dist/mcp/worker.js +61 -58
  229. package/node_modules/pi-lens/dist/probes/installer.js +19 -19
  230. package/node_modules/pi-lens/dist/workers/project-snapshot-persist-worker.js +28 -9
  231. package/node_modules/pi-lens/dist/workers/review-graph-persist-worker.js +1 -1
  232. package/node_modules/pi-lens/docs/configuration.md +11 -0
  233. package/node_modules/pi-lens/docs/engineering-principles.md +32 -0
  234. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +1 -1
  235. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +15 -26
  236. package/node_modules/pi-lens/docs/pi-lens-fixer.md +117 -13
  237. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +97 -7
  238. package/node_modules/pi-lens/docs/pi-lens-monitor.md +8 -2
  239. package/node_modules/pi-lens/docs/pi-lens-retro.md +4 -1
  240. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +112 -4
  241. package/node_modules/pi-lens/docs/pi-lens-subagent.md +22 -14
  242. package/node_modules/pi-lens/docs/release-qa-baseline.md +3 -1
  243. package/node_modules/pi-lens/docs/servercapabilities.md +9 -19
  244. package/node_modules/pi-lens/package.json +7 -5
  245. package/node_modules/pi-lens/scripts/download-grammars.js +40 -7
  246. package/node_modules/pi-lens/scripts/lib/latency-log-phases.mjs +95 -0
  247. package/node_modules/pi-lens/scripts/rpc-load-check.mjs +570 -81
  248. package/node_modules/pi-provider-qoder/dist/index.js +323 -154
  249. package/node_modules/pi-provider-qoder/package.json +1 -1
  250. package/node_modules/pi-web-access/CHANGELOG.md +60 -0
  251. package/node_modules/pi-web-access/README.md +96 -10
  252. package/node_modules/pi-web-access/anysearch.ts +4 -3
  253. package/node_modules/pi-web-access/bocha.ts +4 -3
  254. package/node_modules/pi-web-access/brightdata-unlocker.ts +3 -2
  255. package/node_modules/pi-web-access/brightdata.ts +4 -3
  256. package/node_modules/pi-web-access/ceramic.ts +3 -2
  257. package/node_modules/pi-web-access/credential-source.ts +54 -4
  258. package/node_modules/pi-web-access/curator-page.ts +5 -1
  259. package/node_modules/pi-web-access/curator-server.ts +2 -0
  260. package/node_modules/pi-web-access/deepseek.ts +377 -0
  261. package/node_modules/pi-web-access/dist/index.js +1463 -748
  262. package/node_modules/pi-web-access/dist/mcp-cli.js +1393 -717
  263. package/node_modules/pi-web-access/extract.ts +58 -6
  264. package/node_modules/pi-web-access/gemini-adc.ts +48 -1
  265. package/node_modules/pi-web-access/gemini-search.ts +33 -6
  266. package/node_modules/pi-web-access/index.ts +36 -4
  267. package/node_modules/pi-web-access/jina-search.ts +6 -4
  268. package/node_modules/pi-web-access/kagi.ts +5 -4
  269. package/node_modules/pi-web-access/keenable.ts +3 -2
  270. package/node_modules/pi-web-access/linkup.ts +170 -0
  271. package/node_modules/pi-web-access/mistral-search.ts +4 -3
  272. package/node_modules/pi-web-access/ollama.ts +5 -4
  273. package/node_modules/pi-web-access/package.json +1 -1
  274. package/node_modules/pi-web-access/page-query.ts +12 -6
  275. package/node_modules/pi-web-access/parallel.ts +7 -7
  276. package/node_modules/pi-web-access/perplexity.ts +5 -3
  277. package/node_modules/pi-web-access/querit.ts +4 -3
  278. package/node_modules/pi-web-access/query-rewrite.ts +16 -13
  279. package/node_modules/pi-web-access/search1api.ts +4 -3
  280. package/node_modules/pi-web-access/searchinfinity.ts +4 -3
  281. package/node_modules/pi-web-access/serpapi.ts +7 -5
  282. package/node_modules/pi-web-access/serpbase.ts +5 -4
  283. package/node_modules/pi-web-access/serpdive.ts +4 -3
  284. package/node_modules/pi-web-access/serper.ts +6 -4
  285. package/node_modules/pi-web-access/serply.ts +3 -2
  286. package/node_modules/pi-web-access/summary-review.ts +16 -6
  287. package/node_modules/pi-web-access/utils.ts +27 -1
  288. package/node_modules/pi-web-access/valyu.ts +4 -3
  289. package/node_modules/pi-web-access/web-tool-core.ts +7 -0
  290. package/node_modules/pi-web-access/xai-search.ts +49 -7
  291. package/node_modules/pi-web-access/xcrawl.ts +4 -3
  292. package/node_modules/pi-web-access/you.ts +3 -2
  293. package/package.json +15 -15
  294. package/node_modules/pi-lens/dist/chunk-3YN6V5TV.js +0 -85
  295. package/node_modules/pi-lens/dist/chunk-466Z26MG.js +0 -30
  296. package/node_modules/pi-lens/dist/chunk-EC47DWFA.js +0 -56
  297. package/node_modules/pi-lens/dist/chunk-KDERNTCQ.js +0 -28
  298. package/node_modules/pi-lens/dist/chunk-KSX3TXSZ.js +0 -69
  299. package/node_modules/pi-lens/dist/chunk-LOP6GRPH.js +0 -31
  300. package/node_modules/pi-lens/dist/chunk-UOPVJQ4N.js +0 -103
  301. /package/node_modules/pi-lens/dist/{chunk-FC4RP4I2.js → chunk-6HWVI6MI.js} +0 -0
@@ -5,9 +5,9 @@ import type { SearchOptions, SearchResponse } from "./perplexity.ts";
5
5
  import { formatSearchResultsAsAnswer } from "./search-answer-formatting.ts";
6
6
  import { normalizeSearchResultCount } from "./search-result-count-normalization.ts";
7
7
  import { hasCredentialSource, redactCredential, resolveCredential } from "./credential-source.ts";
8
- import { getWebSearchConfigPath } from "./utils.ts";
8
+ import { fetchWithCredentialRedirects, getWebSearchConfigPath, resolveProviderApiUrl } from "./utils.ts";
9
9
 
10
- const SERPER_SEARCH_URL = "https://google.serper.dev/search";
10
+ const SERPER_API_BASE_URL = "https://google.serper.dev";
11
11
  const CONFIG_PATH = getWebSearchConfigPath();
12
12
  const SEARCH_TIMEOUT_MS = 60_000;
13
13
  const RECENCY_TBS: Record<NonNullable<SearchOptions["recencyFilter"]>, string> = {
@@ -19,6 +19,7 @@ const RECENCY_TBS: Record<NonNullable<SearchOptions["recencyFilter"]>, string> =
19
19
 
20
20
  interface WebSearchConfig {
21
21
  serperApiKey?: unknown;
22
+ serperBaseUrl?: unknown;
22
23
  }
23
24
 
24
25
  interface SerperResult {
@@ -129,6 +130,7 @@ export function isSerperAvailable(): boolean {
129
130
  }
130
131
 
131
132
  export async function searchWithSerper(query: string, options: SearchOptions = {}): Promise<SearchResponse> {
133
+ const apiUrl = resolveProviderApiUrl("serper", `${SERPER_API_BASE_URL}/search`, loadConfig().serperBaseUrl);
132
134
  const apiKey = await requireApiKey(options.signal);
133
135
  const numResults = normalizeSearchResultCount(options.numResults);
134
136
  const filters = parseDomainFilter(options.domainFilter);
@@ -136,12 +138,12 @@ export async function searchWithSerper(query: string, options: SearchOptions = {
136
138
  const activityId = activityMonitor.logStart({ type: "api", query });
137
139
  let response: Response;
138
140
  try {
139
- response = await fetch(SERPER_SEARCH_URL, {
141
+ response = await fetchWithCredentialRedirects(apiUrl, {
140
142
  method: "POST",
141
143
  headers: { "X-API-KEY": apiKey, "Content-Type": "application/json", Accept: "application/json" },
142
144
  body: JSON.stringify({ q: buildQuery(query, filters), num: requestCount, ...(options.recencyFilter ? { tbs: RECENCY_TBS[options.recencyFilter] } : {}) }),
143
145
  signal: options.signal ? AbortSignal.any([AbortSignal.timeout(SEARCH_TIMEOUT_MS), options.signal]) : AbortSignal.timeout(SEARCH_TIMEOUT_MS),
144
- });
146
+ }, ["X-API-KEY"]);
145
147
  } catch (err) {
146
148
  const message = errorMessage(err);
147
149
  const redactedMessage = redactCredential(message, apiKey);
@@ -5,7 +5,7 @@ import type { SearchOptions, SearchResponse } from "./perplexity.ts";
5
5
  import { formatSearchResultsAsAnswer } from "./search-answer-formatting.ts";
6
6
  import { normalizeSearchResultCount } from "./search-result-count-normalization.ts";
7
7
  import { hasCredentialSource, redactCredential, resolveCredential } from "./credential-source.ts";
8
- import { fetchWithCredentialRedirects, getWebSearchConfigPath } from "./utils.ts";
8
+ import { fetchWithCredentialRedirects, getWebSearchConfigPath, resolveProviderApiUrl } from "./utils.ts";
9
9
 
10
10
  const SERPLY_SEARCH_URL = "https://api.serply.io/v1/search";
11
11
  const CONFIG_PATH = getWebSearchConfigPath();
@@ -18,6 +18,7 @@ const RECENCY_TBS: Record<NonNullable<SearchOptions["recencyFilter"]>, string> =
18
18
  };
19
19
 
20
20
  interface WebSearchConfig {
21
+ serplyBaseUrl?: unknown;
21
22
  serplyApiKey?: unknown;
22
23
  }
23
24
 
@@ -129,7 +130,7 @@ export async function searchWithSerply(query: string, options: SearchOptions = {
129
130
  const numResults = normalizeSearchResultCount(options.numResults);
130
131
  const filters = parseDomainFilter(options.domainFilter);
131
132
  const requestCount = options.domainFilter?.length ? Math.min(20, numResults + 5) : numResults;
132
- const url = new URL(SERPLY_SEARCH_URL);
133
+ const url = new URL(resolveProviderApiUrl("serply", SERPLY_SEARCH_URL, loadConfig().serplyBaseUrl));
133
134
  url.searchParams.set("q", buildQuery(query, filters));
134
135
  url.searchParams.set("num", String(requestCount));
135
136
  if (options.recencyFilter) url.searchParams.set("tbs", RECENCY_TBS[options.recencyFilter]);
@@ -315,7 +315,9 @@ export async function generateSummaryDraft(
315
315
 
316
316
  const registry = ctx.modelRegistry as SummaryModelRegistry;
317
317
  const customCompleteFn = completeFn !== undefined;
318
- const usesRegistryComplete = !customCompleteFn && typeof registry.complete === "function";
318
+ // streamSimple is Pi's provider-neutral path and routes virtual models; complete() does not (#574).
319
+ const usesRegistryStreamSimple = !customCompleteFn && typeof registry.streamSimple === "function";
320
+ const usesRegistryComplete = !customCompleteFn && !usesRegistryStreamSimple && typeof registry.complete === "function";
319
321
  let piAiCompat: typeof import("@earendil-works/pi-ai/compat") | undefined;
320
322
 
321
323
  const generationStartedAt = Date.now();
@@ -368,10 +370,10 @@ export async function generateSummaryDraft(
368
370
  let resolved: Awaited<ReturnType<typeof resolveSummaryModelCandidates>>;
369
371
  try {
370
372
  checkSummaryDeadline();
371
- if (!customCompleteFn && !usesRegistryComplete) {
373
+ if (!customCompleteFn && !usesRegistryStreamSimple && !usesRegistryComplete) {
372
374
  piAiCompat = await raceSummaryOperation(import("@earendil-works/pi-ai/compat"));
373
375
  }
374
- completeFn ??= usesRegistryComplete ? registry.complete!.bind(registry) as CompleteFunction : piAiCompat!.complete;
376
+ if (!usesRegistryStreamSimple) completeFn ??= usesRegistryComplete ? registry.complete!.bind(registry) as CompleteFunction : piAiCompat!.complete;
375
377
  resolved = await raceSummaryOperation(resolveSummaryModelCandidates(ctx, modelOverride));
376
378
  } catch (err) {
377
379
  checkSummaryDeadline();
@@ -395,6 +397,12 @@ export async function generateSummaryDraft(
395
397
  const enabledThinkingLevel = requestedThinkingLevel && requestedThinkingLevel !== "off"
396
398
  ? requestedThinkingLevel as ThinkingLevel
397
399
  : undefined;
400
+ const simpleOptions = {
401
+ sessionId,
402
+ cacheRetention: "none" as const,
403
+ signal: completionSignal,
404
+ ...(enabledThinkingLevel ? { reasoning: enabledThinkingLevel } : {}),
405
+ };
398
406
  const completionOptions = {
399
407
  ...(usesRegistryComplete ? {} : { apiKey, headers }),
400
408
  sessionId,
@@ -404,9 +412,11 @@ export async function generateSummaryDraft(
404
412
  ...(enabledThinkingLevel ? { reasoningEffort: enabledThinkingLevel } : {}),
405
413
  };
406
414
  checkSummaryDeadline();
407
- const completion = thinkingLevel !== undefined && !customCompleteFn && !usesRegistryComplete
408
- ? piAiCompat!.completeSimple(model, { messages: [userMessage] }, { apiKey, headers, sessionId, cacheRetention: "none", signal: completionSignal, ...(enabledThinkingLevel ? { reasoning: enabledThinkingLevel } : {}) })
409
- : completeFn(model, { messages: [userMessage] }, completionOptions);
415
+ const completion = usesRegistryStreamSimple
416
+ ? registry.streamSimple(model, { messages: [userMessage] }, simpleOptions).result()
417
+ : thinkingLevel !== undefined && !customCompleteFn && !usesRegistryComplete
418
+ ? piAiCompat!.completeSimple(model, { messages: [userMessage] }, { apiKey, headers, ...simpleOptions })
419
+ : completeFn!(model, { messages: [userMessage] }, completionOptions);
410
420
 
411
421
  const response = await raceSummaryOperation(Promise.resolve(completion));
412
422
  if (response.stopReason === "aborted") {
@@ -85,6 +85,25 @@ export function resolveApiBaseUrl(options: ApiBaseUrlOptions): string {
85
85
  return url.toString().replace(/\/+$/, "");
86
86
  }
87
87
 
88
+ // Other tools commonly set the bare OLLAMA_BASE_URL (a local Ollama server) and DEEPSEEK_BASE_URL
89
+ // (an OpenAI-compatible root ending in /v1), so these providers read PI_-prefixed names instead.
90
+ const PI_PREFIXED_ENVIRONMENT_STEMS = new Set(["ollama", "deepseek"]);
91
+
92
+ /** Resolve a provider's API root without dropping its endpoint path or a gateway prefix. */
93
+ export function resolveProviderApiUrl(configStem: string, defaultUrl: string, configuredValue: unknown): string {
94
+ const official = new URL(defaultUrl);
95
+ const environmentKey = (PI_PREFIXED_ENVIRONMENT_STEMS.has(configStem) ? "PI_" : "")
96
+ + configStem.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase() + "_BASE_URL";
97
+ const baseUrl = resolveApiBaseUrl({
98
+ configKey: configStem + "BaseUrl",
99
+ configuredValue,
100
+ defaultValue: official.origin,
101
+ environmentKey,
102
+ environmentValue: process.env[environmentKey],
103
+ });
104
+ return baseUrl + official.pathname + official.search;
105
+ }
106
+
88
107
  const API_REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);
89
108
  const API_REQUEST_BODY_HEADERS = ["Content-Encoding", "Content-Language", "Content-Location", "Content-Type"];
90
109
  const MAX_API_REDIRECTS = 5;
@@ -93,8 +112,11 @@ export async function fetchWithCredentialRedirects(
93
112
  url: string,
94
113
  init: RequestInit,
95
114
  credentialHeaders: readonly string[],
115
+ credentialQueryParams: readonly string[] = [],
96
116
  ): Promise<Response> {
97
117
  let current = new URL(url);
118
+ const source = new URL(url);
119
+ for (const name of credentialQueryParams) source.searchParams.delete(name);
98
120
  let requestInit = init;
99
121
 
100
122
  for (let redirects = 0; ; redirects++) {
@@ -104,7 +126,7 @@ export async function fetchWithCredentialRedirects(
104
126
  const location = response.headers.get("location");
105
127
  if (!location) return response;
106
128
  if (redirects === MAX_API_REDIRECTS) {
107
- throw new Error(`Too many API redirects from ${url}`);
129
+ throw new Error(`Too many API redirects from ${source}`);
108
130
  }
109
131
 
110
132
  const next = new URL(location, current);
@@ -122,6 +144,7 @@ export async function fetchWithCredentialRedirects(
122
144
  requestInit = { ...withoutBody, method: "GET", headers };
123
145
  }
124
146
  if (next.origin !== current.origin) {
147
+ for (const name of credentialQueryParams) next.searchParams.delete(name);
125
148
  const headers = new Headers(requestInit.headers);
126
149
  for (const name of credentialHeaders) headers.delete(name);
127
150
  requestInit = { ...requestInit, headers };
@@ -306,6 +329,9 @@ function noProxyEntryMatches(hostname: string, entry: string): boolean {
306
329
  export function isProxyBypassedUrl(url: URL): boolean {
307
330
  const hostname = url.hostname.toLowerCase().replace(/^\[|\]$/g, "");
308
331
  if (hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "127.0.0.1" || hostname === "::1") return true;
332
+ // GCE metadata server (and any GCE_METADATA_HOST override) must be reached directly, never via proxy.
333
+ const gceHost = process.env.GCE_METADATA_HOST?.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "");
334
+ if (hostname === "metadata.google.internal" || hostname === "169.254.169.254" || (gceHost && noProxyEntryMatches(hostname, gceHost))) return true;
309
335
  const noProxy = process.env.NO_PROXY || process.env.no_proxy;
310
336
  if (noProxy && noProxy.split(",").some((entry) => noProxyEntryMatches(hostname, entry.trim()))) return true;
311
337
  return false;
@@ -6,7 +6,7 @@ import type { SearchOptions, SearchResponse } from "./perplexity.ts";
6
6
  import { formatSearchResultsAsAnswer } from "./search-answer-formatting.ts";
7
7
  import { normalizeSearchResultCount } from "./search-result-count-normalization.ts";
8
8
  import { hasCredentialSource, redactCredential, resolveCredential } from "./credential-source.ts";
9
- import { getWebSearchConfigPath } from "./utils.ts";
9
+ import { getWebSearchConfigPath, resolveProviderApiUrl, fetchWithCredentialRedirects } from "./utils.ts";
10
10
 
11
11
  const VALYU_SEARCH_URL = "https://api.valyu.ai/v1/search";
12
12
  const CONFIG_PATH = getWebSearchConfigPath();
@@ -15,6 +15,7 @@ const MAX_SNIPPET_CHARS = 2_500;
15
15
  const MAX_CONTENT_CHARS = 4_000;
16
16
 
17
17
  interface WebSearchConfig {
18
+ valyuBaseUrl?: unknown;
18
19
  valyuApiKey?: unknown;
19
20
  }
20
21
 
@@ -123,12 +124,12 @@ export async function searchWithValyu(query: string, options: SearchOptions & {
123
124
  const activityId = activityMonitor.logStart({ type: "api", query });
124
125
  let response: Response;
125
126
  try {
126
- response = await fetch(VALYU_SEARCH_URL, {
127
+ response = await fetchWithCredentialRedirects(resolveProviderApiUrl("valyu", VALYU_SEARCH_URL, loadConfig().valyuBaseUrl), {
127
128
  method: "POST",
128
129
  headers: { "x-api-key": apiKey, "Content-Type": "application/json", Accept: "application/json" },
129
130
  body: JSON.stringify({ query, max_num_results: numResults, ...mapDomainFilter(options.domainFilter), ...(startDate ? { start_date: startDate } : {}) }),
130
131
  signal: options.signal ? AbortSignal.any([AbortSignal.timeout(SEARCH_TIMEOUT_MS), options.signal]) : AbortSignal.timeout(SEARCH_TIMEOUT_MS),
131
- });
132
+ }, ["x-api-key"]);
132
133
  } catch (err) {
133
134
  const message = errorMessage(err);
134
135
  const redactedMessage = redactCredential(message, apiKey);
@@ -64,6 +64,9 @@ export interface WebSearchConfig {
64
64
  valyuApiKey?: unknown;
65
65
  keenableApiKey?: unknown;
66
66
  ceramicApiKey?: unknown;
67
+ linkupApiKey?: unknown;
68
+ linkupDepth?: unknown;
69
+ deepseekApiKey?: unknown;
67
70
  degoogBaseUrl?: unknown;
68
71
  degoogApiKey?: unknown;
69
72
  degoogEngines?: unknown;
@@ -89,6 +92,7 @@ export interface WebSearchConfig {
89
92
  };
90
93
  tools?: Partial<Record<keyof ToolNames, { enabled?: boolean }>>;
91
94
  toolActivation?: unknown;
95
+ toolExposure?: unknown;
92
96
  commands?: Partial<Record<"websearch" | "curator" | "search" | "google-account", { enabled?: boolean }>>;
93
97
  toolNames?: Partial<ToolNames>;
94
98
  shortcuts?: {
@@ -769,6 +773,7 @@ export function createWebToolCore(host: WebToolCoreHost): WebToolCoreInstance {
769
773
  const allUrls: string[] = [];
770
774
  const allInlineContent: ExtractedContent[] = [];
771
775
  const resolvedProvider = resolveRequestedProvider(params.provider);
776
+ const providerFromConfig = (normalizeProviderInput(params.provider) ?? "auto") === "auto";
772
777
 
773
778
  const queryResponses = await runSearchQueries(queryList, async (query) => {
774
779
  signal?.throwIfAborted();
@@ -780,6 +785,7 @@ export function createWebToolCore(host: WebToolCoreHost): WebToolCoreInstance {
780
785
  try {
781
786
  const { answer, results, inlineContent, provider, providerResponses } = await search(query, {
782
787
  provider: resolvedProvider,
788
+ providerFromConfig,
783
789
  numResults: params.numResults,
784
790
  recencyFilter,
785
791
  domainFilter: params.domainFilter,
@@ -878,6 +884,7 @@ export function createWebToolCore(host: WebToolCoreHost): WebToolCoreInstance {
878
884
  try {
879
885
  const response = await search(query, {
880
886
  provider: resolveRequestedProvider(params.provider),
887
+ providerFromConfig: (normalizeProviderInput(params.provider) ?? "auto") === "auto",
881
888
  numResults,
882
889
  recencyFilter,
883
890
  domainFilter,
@@ -25,7 +25,8 @@ import { getWebSearchConfigPath } from "./utils.ts";
25
25
 
26
26
  const XAI_RESPONSES_URL = "https://api.x.ai/v1/responses";
27
27
  const CONFIG_PATH = getWebSearchConfigPath();
28
- const SEARCH_TIMEOUT_MS = 60_000;
28
+ const DEFAULT_SEARCH_TIMEOUT_MS = 60_000;
29
+ const MAX_SEARCH_TIMEOUT_MS = 600_000;
29
30
 
30
31
  // Ordered best-first. pi's builtin xai catalog is small and xAI retires models
31
32
  // briskly, so this is a preference list, not an assumption: the first one the
@@ -40,7 +41,9 @@ const DEFAULT_XAI_SEARCH_TOOLS = ["web_search"] as const satisfies readonly XaiS
40
41
 
41
42
  interface WebSearchConfig {
42
43
  xaiApiKey?: unknown;
44
+ xaiResponsesUrl?: unknown;
43
45
  xaiSearchModel?: unknown;
46
+ xaiSearchTimeoutMs?: unknown;
44
47
  xaiSearchTools?: unknown;
45
48
  }
46
49
 
@@ -79,6 +82,33 @@ function resolveConfiguredSearchModel(value: unknown): string | undefined {
79
82
  return value.trim();
80
83
  }
81
84
 
85
+ // A custom endpoint (for example a gateway relaying to a Grok subscription)
86
+ // only ever receives the configured xAI API key, never Pi's xAI sign-in.
87
+ function resolveConfiguredResponsesUrl(value: unknown): string | undefined {
88
+ if (value === undefined) return undefined;
89
+ if (typeof value !== "string" || value.trim().length === 0) {
90
+ throw new Error(`xaiResponsesUrl in ${CONFIG_PATH} must be an absolute http(s) URL`);
91
+ }
92
+ let url: URL;
93
+ try {
94
+ url = new URL(value.trim());
95
+ } catch {
96
+ throw new Error(`xaiResponsesUrl in ${CONFIG_PATH} must be an absolute http(s) URL`);
97
+ }
98
+ if (url.protocol !== "https:" && url.protocol !== "http:") {
99
+ throw new Error(`xaiResponsesUrl in ${CONFIG_PATH} must use http or https`);
100
+ }
101
+ return url.toString();
102
+ }
103
+
104
+ function resolveConfiguredSearchTimeoutMs(value: unknown): number {
105
+ if (value === undefined) return DEFAULT_SEARCH_TIMEOUT_MS;
106
+ if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) {
107
+ throw new Error(`xaiSearchTimeoutMs in ${CONFIG_PATH} must be a positive integer`);
108
+ }
109
+ return Math.min(value, MAX_SEARCH_TIMEOUT_MS);
110
+ }
111
+
82
112
  function resolveConfiguredSearchTools(value: unknown): XaiSearchTool[] {
83
113
  if (value === undefined) return [...DEFAULT_XAI_SEARCH_TOOLS];
84
114
  if (!Array.isArray(value) || value.length === 0) {
@@ -138,7 +168,7 @@ export async function resolveXaiAuth(ctx?: ExtensionContext, signal?: AbortSigna
138
168
  const config = loadConfig();
139
169
  const modelOverride = resolveConfiguredSearchModel(config.xaiSearchModel);
140
170
  const tools = resolveConfiguredSearchTools(config.xaiSearchTools);
141
- if (ctx) {
171
+ if (ctx && resolveConfiguredResponsesUrl(config.xaiResponsesUrl) === undefined) {
142
172
  const auth = await resolvePiAuth(ctx, modelOverride, tools);
143
173
  if (auth) return auth;
144
174
  }
@@ -161,13 +191,16 @@ export async function resolveXaiAuth(ctx?: ExtensionContext, signal?: AbortSigna
161
191
  export async function isXaiSearchAvailable(ctx?: ExtensionContext): Promise<boolean> {
162
192
  let config: WebSearchConfig;
163
193
  let tools: XaiSearchTool[];
194
+ let customUrl: string | undefined;
164
195
  try {
165
196
  config = loadConfig();
166
197
  tools = resolveConfiguredSearchTools(config.xaiSearchTools);
198
+ customUrl = resolveConfiguredResponsesUrl(config.xaiResponsesUrl);
199
+ resolveConfiguredSearchTimeoutMs(config.xaiSearchTimeoutMs);
167
200
  } catch {
168
201
  return false;
169
202
  }
170
- if (ctx && await resolvePiAuth(ctx, undefined, tools)) return true;
203
+ if (ctx && customUrl === undefined && await resolvePiAuth(ctx, undefined, tools)) return true;
171
204
  return hasCredentialSource({
172
205
  provider: "xAI",
173
206
  configuredValue: config.xaiApiKey,
@@ -330,9 +363,18 @@ export async function searchWithXai(
330
363
  options: SearchOptions = {},
331
364
  ctx?: ExtensionContext,
332
365
  ): Promise<SearchResponse> {
333
- const tools = resolveConfiguredSearchTools(loadConfig().xaiSearchTools);
366
+ const config = loadConfig();
367
+ const tools = resolveConfiguredSearchTools(config.xaiSearchTools);
368
+ const customUrl = resolveConfiguredResponsesUrl(config.xaiResponsesUrl);
369
+ const timeoutMs = resolveConfiguredSearchTimeoutMs(config.xaiSearchTimeoutMs);
334
370
  const auth = await resolveXaiAuth(ctx, options.signal);
335
371
  if (!auth) {
372
+ if (customUrl) {
373
+ throw new Error(
374
+ `xAI search unavailable: xaiResponsesUrl is set, so Pi's xAI sign-in is not used. ` +
375
+ `Set xaiApiKey in ${CONFIG_PATH} or the XAI_API_KEY environment variable to the key for that endpoint.`,
376
+ );
377
+ }
336
378
  throw new Error(
337
379
  "xAI search unavailable. Either:\n" +
338
380
  " 1. Use /login to sign in with a SuperGrok or X Premium subscription\n" +
@@ -343,7 +385,7 @@ export async function searchWithXai(
343
385
 
344
386
  const activityId = activityMonitor.logStart({ type: "api", query });
345
387
  try {
346
- const response = await fetch(XAI_RESPONSES_URL, {
388
+ const response = await fetch(customUrl ?? XAI_RESPONSES_URL, {
347
389
  method: "POST",
348
390
  headers: {
349
391
  ...toRequestHeaders(auth.headers),
@@ -356,8 +398,8 @@ export async function searchWithXai(
356
398
  tools: tools.map((type) => ({ type })),
357
399
  }),
358
400
  signal: options.signal
359
- ? AbortSignal.any([AbortSignal.timeout(SEARCH_TIMEOUT_MS), options.signal])
360
- : AbortSignal.timeout(SEARCH_TIMEOUT_MS),
401
+ ? AbortSignal.any([AbortSignal.timeout(timeoutMs), options.signal])
402
+ : AbortSignal.timeout(timeoutMs),
361
403
  });
362
404
 
363
405
  if (!response.ok) {
@@ -5,7 +5,7 @@ import type { SearchOptions, SearchResponse } from "./perplexity.ts";
5
5
  import { formatSearchResultsAsAnswer } from "./search-answer-formatting.ts";
6
6
  import { normalizeSearchResultCount } from "./search-result-count-normalization.ts";
7
7
  import { hasCredentialSource, redactCredential, resolveCredential } from "./credential-source.ts";
8
- import { getWebSearchConfigPath } from "./utils.ts";
8
+ import { getWebSearchConfigPath, resolveProviderApiUrl, fetchWithCredentialRedirects } from "./utils.ts";
9
9
 
10
10
  const XCRAWL_API_URL = "https://run.xcrawl.com/v1/serp";
11
11
  const CONFIG_PATH = getWebSearchConfigPath();
@@ -14,6 +14,7 @@ const CONFIG_PATH = getWebSearchConfigPath();
14
14
  const SEARCH_TIMEOUT_MS = 60_000;
15
15
 
16
16
  interface WebSearchConfig {
17
+ xcrawlBaseUrl?: unknown;
17
18
  xcrawlApiKey?: unknown;
18
19
  }
19
20
 
@@ -173,7 +174,7 @@ export async function searchWithXCrawl(query: string, options: SearchOptions = {
173
174
  let response: Response;
174
175
 
175
176
  try {
176
- response = await fetch(XCRAWL_API_URL, {
177
+ response = await fetchWithCredentialRedirects(resolveProviderApiUrl("xcrawl", XCRAWL_API_URL, loadConfig().xcrawlBaseUrl), {
177
178
  method: "POST",
178
179
  headers: {
179
180
  Authorization: `Bearer ${apiKey}`,
@@ -183,7 +184,7 @@ export async function searchWithXCrawl(query: string, options: SearchOptions = {
183
184
  signal: options.signal
184
185
  ? AbortSignal.any([timeoutSignal, options.signal])
185
186
  : timeoutSignal,
186
- });
187
+ }, ["Authorization"]);
187
188
  } catch (err) {
188
189
  const message = errorMessage(err);
189
190
  if (options.signal?.aborted) {
@@ -5,13 +5,14 @@ import type { SearchOptions, SearchResponse } from "./perplexity.ts";
5
5
  import { formatSearchResultsAsAnswer } from "./search-answer-formatting.ts";
6
6
  import { normalizeSearchResultCount } from "./search-result-count-normalization.ts";
7
7
  import { hasCredentialSource, redactCredential, resolveCredential } from "./credential-source.ts";
8
- import { fetchWithCredentialRedirects, getWebSearchConfigPath } from "./utils.ts";
8
+ import { fetchWithCredentialRedirects, getWebSearchConfigPath, resolveProviderApiUrl } from "./utils.ts";
9
9
 
10
10
  const YOU_SEARCH_URL = "https://ydc-index.io/v1/search";
11
11
  const CONFIG_PATH = getWebSearchConfigPath();
12
12
  const SEARCH_TIMEOUT_MS = 60_000;
13
13
 
14
14
  interface WebSearchConfig {
15
+ youBaseUrl?: unknown;
15
16
  youApiKey?: unknown;
16
17
  }
17
18
 
@@ -100,7 +101,7 @@ export async function searchWithYou(query: string, options: SearchOptions = {}):
100
101
  let response: Response;
101
102
  let entries: unknown[];
102
103
  try {
103
- response = await fetchWithCredentialRedirects(YOU_SEARCH_URL, {
104
+ response = await fetchWithCredentialRedirects(resolveProviderApiUrl("you", YOU_SEARCH_URL, loadConfig().youBaseUrl), {
104
105
  method: "POST",
105
106
  headers: { Accept: "application/json", "Content-Type": "application/json", "X-API-Key": apiKey },
106
107
  body: JSON.stringify(body),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.10.10",
3
+ "version": "2026.10.12",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -35,21 +35,21 @@
35
35
  "postpack": "node ../../scripts/aggregate-bundle.mjs restore"
36
36
  },
37
37
  "dependencies": {
38
- "@ast-grep/cli": "0.45.3",
39
- "@ast-grep/napi": "^0.45.0",
38
+ "@ast-grep/cli": "0.50.0",
39
+ "@ast-grep/napi": "^0.50.0",
40
40
  "@dietrichgebert/ponytail": "5.3.2",
41
- "@herbertgao/pi-agency": "0.1.1",
41
+ "@herbertgao/pi-agency": "0.1.2",
42
42
  "@herbertgao/pi-bark": "0.2.1",
43
- "@herbertgao/pi-cc-extensions": "1.0.7-local.1",
44
- "@herbertgao/pi-subagents": "0.22.0-local.1",
45
- "@herbertgao/sol-pi": "0.4.1",
46
- "@juicesharp/rpiv-ask-user-question": "2.13.8",
47
- "@juicesharp/rpiv-config": "^2.13.8",
43
+ "@herbertgao/pi-cc-extensions": "1.0.8-local.1",
44
+ "@herbertgao/pi-subagents": "0.22.0-local.2",
45
+ "@herbertgao/sol-pi": "0.4.2",
46
+ "@juicesharp/rpiv-ask-user-question": "2.13.9",
47
+ "@juicesharp/rpiv-config": "^2.13.9",
48
48
  "@modelcontextprotocol/sdk": "^1.32.1",
49
49
  "@mozilla/readability": "^0.6.0",
50
50
  "@napi-rs/keyring": "^2.1.0",
51
- "@narumitw/pi-btw": "0.61.1",
52
- "@narumitw/pi-caffeinate": "0.49.11",
51
+ "@narumitw/pi-btw": "0.62.0",
52
+ "@narumitw/pi-caffeinate": "0.49.12",
53
53
  "@narumitw/pi-tui-kit": "^0.64.0",
54
54
  "@pi-plugins/fast-mode": "0.1.14",
55
55
  "@shikijs/cli": "^4.0.2",
@@ -71,12 +71,12 @@
71
71
  "minimatch": "^10.2.6",
72
72
  "nanoid": "^5.0.0",
73
73
  "p-limit": "^6.1.0",
74
- "pi-antigravity": "0.10.0",
75
- "pi-lens": "4.4.3",
74
+ "pi-antigravity": "0.11.0",
75
+ "pi-lens": "4.4.4",
76
76
  "pi-next-cue": "1.0.7",
77
- "pi-provider-qoder": "0.6.1",
77
+ "pi-provider-qoder": "0.6.2",
78
78
  "pi-typesafe": "0.10.0",
79
- "pi-web-access": "0.41.0",
79
+ "pi-web-access": "0.44.0",
80
80
  "pidusage": "^4.0.1",
81
81
  "promise.try": "^2.0.1",
82
82
  "turndown": "^7.2.0",
@@ -1,85 +0,0 @@
1
- import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- _getWarmWordIndexCacheStateForTests,
4
- _resetWarmWordIndexCacheForTests,
5
- acquireWarmWordIndex,
6
- analyzeFile,
7
- summarizeWarningTiers
8
- } from "./chunk-H6MF6EVN.js";
9
- import "./chunk-OXXKQCSV.js";
10
- import "./chunk-EJIUXPBX.js";
11
- import "./chunk-2CD5RS6M.js";
12
- import "./chunk-FC4RP4I2.js";
13
- import "./chunk-UZ3TUTRV.js";
14
- import "./chunk-XMSXXAHW.js";
15
- import "./chunk-77M37OKR.js";
16
- import "./chunk-CSHFH5IN.js";
17
- import "./chunk-VCHXCQFG.js";
18
- import "./chunk-3EFKIGZN.js";
19
- import "./chunk-MRXKYPCS.js";
20
- import "./chunk-7DYBLXYA.js";
21
- import "./chunk-AB3YYG6N.js";
22
- import "./chunk-YSZNHOBY.js";
23
- import "./chunk-RPLINGVB.js";
24
- import "./chunk-XCJN5IJU.js";
25
- import "./chunk-76MWC2K6.js";
26
- import "./chunk-GXW6K4YJ.js";
27
- import "./chunk-2B73ZPOK.js";
28
- import "./chunk-YYOIQFRS.js";
29
- import "./chunk-3MED75HT.js";
30
- import "./chunk-M6HSLBWY.js";
31
- import "./chunk-IBGIOBEE.js";
32
- import "./chunk-XIMYZ3JA.js";
33
- import "./chunk-EU63SDCG.js";
34
- import "./chunk-VWCXW2E7.js";
35
- import "./chunk-FCSOVF55.js";
36
- import "./chunk-PNQDPDRC.js";
37
- import "./chunk-ZXYDQ3TZ.js";
38
- import "./chunk-5W3R6LFT.js";
39
- import "./chunk-QHJ6DQ2R.js";
40
- import "./chunk-Z54ZSOBZ.js";
41
- import "./chunk-724UL2TJ.js";
42
- import "./chunk-QOZXJ4NA.js";
43
- import "./chunk-GBPP5P7X.js";
44
- import "./chunk-P7266HLM.js";
45
- import "./chunk-MQLUAEOC.js";
46
- import "./chunk-52FUZI6K.js";
47
- import "./chunk-SAEFPSB6.js";
48
- import "./chunk-GAEGEPOC.js";
49
- import "./chunk-Z3CCVDUB.js";
50
- import "./chunk-L3BLXZG7.js";
51
- import "./chunk-2BEMIWEW.js";
52
- import "./chunk-ACXEQZOU.js";
53
- import "./chunk-Q7DUK4LX.js";
54
- import "./chunk-AW7R2GWG.js";
55
- import "./chunk-RWWYJ623.js";
56
- import "./chunk-VRZP76YM.js";
57
- import "./chunk-QOBUHWHX.js";
58
- import "./chunk-QILIYSJF.js";
59
- import "./chunk-6C7JWPCP.js";
60
- import "./chunk-5NGR67U5.js";
61
- import "./chunk-C34ZXZ7O.js";
62
- import "./chunk-BW5KFIQC.js";
63
- import "./chunk-QYF5S6P6.js";
64
- import "./chunk-PHDMFAKM.js";
65
- import "./chunk-2BBLFX75.js";
66
- import "./chunk-XVF2VVXP.js";
67
- import "./chunk-ZANLILYD.js";
68
- import "./chunk-2EECBNC5.js";
69
- import "./chunk-JAU72XNY.js";
70
- import "./chunk-XTMJ7XDT.js";
71
- import "./chunk-JMYYOTQG.js";
72
- import "./chunk-QQNQ7SJW.js";
73
- import "./chunk-AOHZU2BM.js";
74
- import "./chunk-LJDODBBZ.js";
75
- import "./chunk-CHOW74WE.js";
76
- import "./chunk-ABBOA7UD.js";
77
- import "./chunk-N2H3ZPZY.js";
78
- import "./chunk-NXL4FFQQ.js";
79
- export {
80
- _getWarmWordIndexCacheStateForTests,
81
- _resetWarmWordIndexCacheForTests,
82
- acquireWarmWordIndex,
83
- analyzeFile,
84
- summarizeWarningTiers
85
- };
@@ -1,30 +0,0 @@
1
- import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- importFactProvider,
4
- importFactsApplyTo
5
- } from "./chunk-XCJN5IJU.js";
6
- import "./chunk-GXW6K4YJ.js";
7
- import "./chunk-QHJ6DQ2R.js";
8
- import "./chunk-Z54ZSOBZ.js";
9
- import "./chunk-724UL2TJ.js";
10
- import "./chunk-QOZXJ4NA.js";
11
- import "./chunk-VRZP76YM.js";
12
- import "./chunk-C34ZXZ7O.js";
13
- import "./chunk-PHDMFAKM.js";
14
- import "./chunk-2BBLFX75.js";
15
- import "./chunk-XVF2VVXP.js";
16
- import "./chunk-ZANLILYD.js";
17
- import "./chunk-2EECBNC5.js";
18
- import "./chunk-JAU72XNY.js";
19
- import "./chunk-XTMJ7XDT.js";
20
- import "./chunk-JMYYOTQG.js";
21
- import "./chunk-QQNQ7SJW.js";
22
- import "./chunk-AOHZU2BM.js";
23
- import "./chunk-LJDODBBZ.js";
24
- import "./chunk-ABBOA7UD.js";
25
- import "./chunk-N2H3ZPZY.js";
26
- import "./chunk-NXL4FFQQ.js";
27
- export {
28
- importFactProvider,
29
- importFactsApplyTo
30
- };