@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
@@ -137,6 +137,19 @@ function registerCompatApiProvider(): void {
137
137
  export default function (pi: ExtensionAPI): void {
138
138
  registerCompatApiProvider();
139
139
 
140
+ // Print and RPC modes do not refresh catalogs before resolving --model. Refresh on
141
+ // session start so a stale 1.2.x cache is replaced before the prompt, and so the next
142
+ // headless process hydrates Gemini 4 from the persisted store (#93).
143
+ pi.on("session_start", async (_event, ctx) => {
144
+ if (process.env.PI_OFFLINE !== undefined) return;
145
+ if (typeof ctx.modelRegistry?.refresh !== "function") return;
146
+ try {
147
+ await ctx.modelRegistry.refresh({ providers: [PROVIDER_ID] });
148
+ } catch {
149
+ // Last-known-good catalog stays in place. Forced refreshes still report via the command.
150
+ }
151
+ });
152
+
140
153
  const initialCatalog = getCurrentAntigravityCatalog();
141
154
 
142
155
  const providerConfig = {
@@ -1,3 +1,4 @@
1
+ import { createHash } from "node:crypto";
1
2
  import type {
2
3
  Api,
3
4
  Credential,
@@ -23,11 +24,14 @@ import {
23
24
 
24
25
  export const DEFAULT_CATALOG_REFRESH_INTERVAL_MS = 4 * 60 * 60 * 1000;
25
26
  export const ANTIGRAVITY_PERSIST_KEY = "pi-antigravity";
27
+ export const CATALOG_SCHEMA_VERSION = 2;
26
28
 
27
29
  type PersistedAntigravityCatalog = {
28
30
  catalog: AntigravityCatalog;
29
31
  checkedAt: number;
30
32
  modelEnums: Record<string, string>;
33
+ schemaVersion: number;
34
+ credentialKey: string;
31
35
  };
32
36
 
33
37
  export function getCatalogRefreshIntervalMs(): number {
@@ -66,10 +70,10 @@ export async function discoverAntigravityModels(
66
70
  const available = await fetchAvailableModelsCatalog(creds.token, creds.projectId, signal);
67
71
  const models = available.data.models;
68
72
  if (!models || Object.keys(models).length === 0) {
69
- return { models: [], routing: {} };
73
+ throw new Error("Antigravity returned an empty or unrecognized model catalog");
70
74
  }
71
75
  registerDiscoveredModelEnums(models);
72
- return buildAntigravityCatalog(models, fallbackCatalog());
76
+ return buildAntigravityCatalog(models, fallbackCatalog(), available.data.agentModelSorts);
73
77
  }
74
78
 
75
79
  export async function refreshAntigravityModels(
@@ -82,9 +86,26 @@ export async function refreshAntigravityModels(
82
86
  const apiKey = apiKeyFromCredential(context.credential);
83
87
  if (!apiKey || context.signal.aborted) return current.models;
84
88
 
89
+ // A different account/project or pre-upgrade cache must not suppress a fresh
90
+ // discovery. Keep hydration above so offline startup still has usable models.
91
+ const credentialKey = createHash("sha256")
92
+ .update(
93
+ JSON.stringify([
94
+ context.credential?.type === "oauth" ? context.credential.refresh : apiKey,
95
+ parseApiKey(apiKey).projectId,
96
+ ]),
97
+ )
98
+ .digest("hex");
99
+ const stored: unknown = context.stored;
100
+ const persisted = isRecord(stored) ? stored[ANTIGRAVITY_PERSIST_KEY] : undefined;
101
+ const sameSource =
102
+ isRecord(persisted) &&
103
+ persisted.schemaVersion === CATALOG_SCHEMA_VERSION &&
104
+ persisted.credentialKey === credentialKey;
85
105
  const now = Date.now();
86
106
  if (
87
107
  !context.force &&
108
+ sameSource &&
88
109
  checkedAt > 0 &&
89
110
  now >= checkedAt &&
90
111
  now - checkedAt < getCatalogRefreshIntervalMs()
@@ -106,6 +127,8 @@ export async function refreshAntigravityModels(
106
127
  catalog: next,
107
128
  checkedAt: refreshedAt,
108
129
  modelEnums: snapshotDynamicModelEnums(),
130
+ schemaVersion: CATALOG_SCHEMA_VERSION,
131
+ credentialKey,
109
132
  } satisfies PersistedAntigravityCatalog,
110
133
  } as unknown as ModelsStoreEntry,
111
134
  });
@@ -1,6 +1,7 @@
1
1
  import type { ProviderModelConfig } from "@earendil-works/pi-coding-agent";
2
2
  import { ThinkingEffort } from "../types/enums.js";
3
3
  import type { AntigravityRouting, ModelInfoRaw } from "../types/types.js";
4
+ import { isRecord } from "../utils/util.js";
4
5
 
5
6
  export type AntigravityCatalog = {
6
7
  models: ProviderModelConfig[];
@@ -17,6 +18,8 @@ type RuntimeGroup = {
17
18
  /** Catalog capability: true/false when advertised, undefined when omitted. */
18
19
  supportsThinking?: boolean;
19
20
  supportsImages?: boolean;
21
+ contextWindow?: number;
22
+ maxOutputTokens?: number;
20
23
  };
21
24
 
22
25
  const THINKING_SUFFIXES: Array<{ suffix: string; level: ThinkingLevel }> = [
@@ -39,12 +42,6 @@ const DISPLAY_LEVELS: Array<{ pattern: RegExp; level: ThinkingLevel }> = [
39
42
  { pattern: /\(\s*low\s*\)/i, level: ThinkingEffort.Low },
40
43
  ];
41
44
 
42
- /** Known backend aliases whose runtime IDs do not share a thinking suffix with the public family. */
43
- const RUNTIME_ALIASES: Record<string, { publicId: string; level: ThinkingLevel }> = {
44
- "gemini-3-flash-agent": { publicId: "gemini-3.5-flash", level: ThinkingEffort.High },
45
- "gemini-pro-agent": { publicId: "gemini-3.1-pro", level: ThinkingEffort.High },
46
- };
47
-
48
45
  const PI_LEVELS = [
49
46
  ThinkingEffort.Off,
50
47
  ThinkingEffort.Minimal,
@@ -57,12 +54,11 @@ const PI_LEVELS = [
57
54
 
58
55
  const ZERO_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
59
56
 
60
- export function isSelectableRuntimeModelId(id: string): boolean {
61
- if (!/^(gemini-|claude-|gpt-oss-)/i.test(id) || /\s/.test(id) || /^MODEL_/i.test(id)) {
62
- return false;
63
- }
57
+ export function isSelectableRuntimeModelId(id: string, info?: ModelInfoRaw): boolean {
58
+ if (!/^[a-z0-9][a-z0-9_.-]*$/i.test(id) || /^MODEL_/i.test(id)) return false;
64
59
  if (/^(chat_|tab_)/i.test(id)) return false;
65
- if (/image/i.test(id)) return false;
60
+ if (/image/i.test(id) || /image/i.test(modelDisplayName(info) ?? "")) return false;
61
+ if (info?.isInternal === true || info?.apiProvider === "API_PROVIDER_INTERNAL") return false;
66
62
  return true;
67
63
  }
68
64
 
@@ -74,69 +70,84 @@ export function resolvedCatalog(
74
70
  return current;
75
71
  }
76
72
 
73
+ export function extractRecommendedModelIds(agentModelSorts: unknown): Set<string> | undefined {
74
+ if (!Array.isArray(agentModelSorts) || agentModelSorts.length === 0) return undefined;
75
+ const ids = new Set<string>();
76
+ for (const sort of agentModelSorts) {
77
+ if (!isRecord(sort)) continue;
78
+ const groups = Array.isArray(sort.groups) ? sort.groups : [];
79
+ for (const group of groups) {
80
+ if (!isRecord(group) || !Array.isArray(group.modelIds)) continue;
81
+ for (const id of group.modelIds) {
82
+ if (typeof id === "string" && id) ids.add(id);
83
+ }
84
+ }
85
+ }
86
+ return ids.size > 0 ? ids : undefined;
87
+ }
88
+
77
89
  export function buildAntigravityCatalog(
78
90
  rawModels: Record<string, ModelInfoRaw>,
79
91
  fallback: AntigravityCatalog,
92
+ agentModelSorts?: unknown,
80
93
  ): AntigravityCatalog {
81
- const groups = new Map<string, RuntimeGroup>();
82
-
83
- for (const [runtimeId, info] of Object.entries(rawModels)) {
84
- if (!isSelectableRuntimeModelId(runtimeId)) continue;
85
- if (info?.isInternal) continue;
86
-
87
- const displayName = modelDisplayName(info);
88
- if (runtimeId.endsWith("-tiered")) {
89
- const baseId = runtimeId.slice(0, -"-tiered".length);
90
- const group = ensureGroup(groups, baseId);
94
+ const recommendedIds = extractRecommendedModelIds(agentModelSorts);
95
+
96
+ function collectGroups(filterIds?: Set<string>): Map<string, RuntimeGroup> {
97
+ const collected = new Map<string, RuntimeGroup>();
98
+
99
+ for (const [runtimeId, info] of Object.entries(rawModels)) {
100
+ if (!isSelectableRuntimeModelId(runtimeId, info)) continue;
101
+ if (info?.isInternal) continue;
102
+ if (filterIds && !filterIds.has(runtimeId)) continue;
103
+
104
+ const displayName = modelDisplayName(info);
105
+ if (runtimeId.endsWith("-tiered")) {
106
+ const baseId = runtimeId.slice(0, -"-tiered".length);
107
+ const group = ensureGroup(collected, baseId);
108
+ absorbMetadata(group, info, displayName);
109
+ if (!group.unsuffixed) group.unsuffixed = runtimeId;
110
+ continue;
111
+ }
112
+
113
+ const suffix = parseThinkingSuffix(runtimeId);
114
+ const publicId = suffix?.baseId ?? runtimeId;
115
+ const group = ensureGroup(collected, publicId);
91
116
  absorbMetadata(group, info, displayName);
92
- if (!group.unsuffixed) group.unsuffixed = runtimeId;
93
- continue;
94
- }
95
117
 
96
- const alias = RUNTIME_ALIASES[runtimeId];
97
- const suffix = alias ? undefined : parseThinkingSuffix(runtimeId);
98
- const publicId = alias?.publicId ?? suffix?.baseId ?? runtimeId;
99
- const group = ensureGroup(groups, publicId);
100
- absorbMetadata(group, info, displayName);
118
+ const level = levelFromDisplayName(displayName) ?? suffix?.level;
119
+ if (level) group.variants[level] = runtimeId;
120
+ else group.unsuffixed = runtimeId;
121
+ }
101
122
 
102
- const level = alias?.level ?? levelFromDisplayName(displayName) ?? suffix?.level;
103
- if (level) group.variants[level] = runtimeId;
104
- else group.unsuffixed = runtimeId;
123
+ mergeAgentSingletons(collected);
124
+ return collected;
105
125
  }
106
126
 
107
- mergeAgentSingletons(groups);
127
+ let groups = collectGroups(recommendedIds);
128
+ if (groups.size === 0 && recommendedIds) {
129
+ groups = collectGroups();
130
+ }
108
131
 
109
- if (groups.size === 0) return fallback;
132
+ if (groups.size === 0) throw new Error("Antigravity catalog contains no supported chat models");
110
133
 
111
134
  const models: ProviderModelConfig[] = [];
112
135
  const routing: Record<string, AntigravityRouting> = {};
113
136
 
114
137
  for (const group of groups.values()) {
115
- const fallbackModel = fallback.models.find((model) => model.id === group.publicId);
116
- const fallbackRouting = fallback.routing[group.publicId];
117
- if (fallbackModel && fallbackRouting) {
118
- models.push(fallbackModel);
119
- routing[group.publicId] = fallbackRouting;
120
- continue;
121
- }
122
-
123
138
  const synthesized = synthesizeModel(group, fallback.models);
124
139
  models.push(synthesized.model);
125
140
  routing[group.publicId] = synthesized.routing;
126
141
  }
127
142
 
128
- for (const fallbackModel of fallback.models) {
129
- if (routing[fallbackModel.id]) continue;
130
- const fallbackRouting = fallback.routing[fallbackModel.id];
131
- if (!fallbackRouting) continue;
132
- models.push(fallbackModel);
133
- routing[fallbackModel.id] = fallbackRouting;
134
- }
135
-
136
143
  models.sort(comparePublicModels);
137
144
  return { models, routing };
138
145
  }
139
146
 
147
+ function positiveTokenLimit(value: unknown): number | undefined {
148
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : undefined;
149
+ }
150
+
140
151
  function ensureGroup(groups: Map<string, RuntimeGroup>, publicId: string): RuntimeGroup {
141
152
  const existing = groups.get(publicId);
142
153
  if (existing) return existing;
@@ -155,20 +166,34 @@ function absorbMetadata(
155
166
  displayName: string | undefined,
156
167
  ): void {
157
168
  if (displayName) group.displayNames.push(displayName);
169
+ // A public model can route to any variant. Advertise the smallest supplied
170
+ // limit so every route remains within the server's advertised capabilities.
171
+ const contextWindow = positiveTokenLimit(info?.maxTokens);
172
+ const maxOutputTokens = positiveTokenLimit(info?.maxOutputTokens);
173
+ if (contextWindow !== undefined) {
174
+ group.contextWindow = Math.min(group.contextWindow ?? contextWindow, contextWindow);
175
+ }
176
+ if (maxOutputTokens !== undefined) {
177
+ group.maxOutputTokens = Math.min(group.maxOutputTokens ?? maxOutputTokens, maxOutputTokens);
178
+ }
158
179
  if (info?.supportsThinking === true) group.supportsThinking = true;
159
180
  else if (info?.supportsThinking === false && group.supportsThinking !== true) {
160
181
  group.supportsThinking = false;
161
182
  }
162
- if (info?.supportsImages === true) group.supportsImages = true;
163
- if (info?.supportsImages === false && group.supportsImages === undefined) {
164
- group.supportsImages = false;
183
+ if (info?.supportsImages === false) group.supportsImages = false;
184
+ else if (info?.supportsImages === true && group.supportsImages === undefined) {
185
+ group.supportsImages = true;
165
186
  }
166
187
  }
167
188
 
168
189
  function mergeAgentSingletons(groups: Map<string, RuntimeGroup>): void {
169
190
  for (const [publicId, group] of [...groups.entries()]) {
170
- if (!publicId.endsWith("-agent")) continue;
171
- if (Object.keys(group.variants).length > 0) continue;
191
+ if (!publicId.endsWith("-agent") || group.supportsThinking === false) continue;
192
+ const runtimeIds = [group.unsuffixed, ...Object.values(group.variants)].filter(
193
+ (id): id is string => id !== undefined,
194
+ );
195
+ if (runtimeIds.length !== 1) continue;
196
+ const [runtimeId] = runtimeIds;
172
197
  const family = displayFamily(group.displayNames[0]);
173
198
  if (!family) continue;
174
199
  const target = [...groups.values()].find(
@@ -176,10 +201,23 @@ function mergeAgentSingletons(groups: Map<string, RuntimeGroup>): void {
176
201
  candidate.publicId !== publicId &&
177
202
  candidate.displayNames.some((name) => displayFamily(name) === family),
178
203
  );
179
- if (!target || !group.unsuffixed) continue;
180
- const level = levelFromDisplayName(group.displayNames[0]) ?? ThinkingEffort.High;
181
- target.variants[level] = group.unsuffixed;
182
- absorbMetadata(target, { supportsThinking: group.supportsThinking }, group.displayNames[0]);
204
+ if (!target) continue;
205
+ const level =
206
+ (Object.keys(group.variants) as ThinkingLevel[]).find(
207
+ (candidate) => group.variants[candidate] === runtimeId,
208
+ ) ?? levelFromDisplayName(group.displayNames[0]);
209
+ if (!level || target.variants[level]) continue;
210
+ target.variants[level] = runtimeId;
211
+ absorbMetadata(
212
+ target,
213
+ {
214
+ supportsThinking: group.supportsThinking,
215
+ supportsImages: group.supportsImages,
216
+ maxTokens: group.contextWindow,
217
+ maxOutputTokens: group.maxOutputTokens,
218
+ },
219
+ group.displayNames[0],
220
+ );
183
221
  groups.delete(publicId);
184
222
  }
185
223
  }
@@ -229,9 +267,11 @@ function synthesizeModel(
229
267
  const routing = routingFromVariants(group.publicId, group.variants, group.unsuffixed);
230
268
  const supportsImages = group.supportsImages ?? template?.input.includes("image") ?? true;
231
269
  const reasoning =
232
- advertisedLevels.size > 0 ||
233
- group.supportsThinking === true ||
234
- (group.supportsThinking === undefined && Boolean(template?.reasoning));
270
+ group.supportsThinking === false
271
+ ? false
272
+ : advertisedLevels.size > 0 ||
273
+ group.supportsThinking === true ||
274
+ (group.supportsThinking === undefined && Boolean(template?.reasoning));
235
275
  return {
236
276
  model: {
237
277
  id: group.publicId,
@@ -240,19 +280,19 @@ function synthesizeModel(
240
280
  thinkingLevelMap: reasoning ? thinkingLevelMapFromLevels(advertisedLevels) : undefined,
241
281
  input: supportsImages ? ["text", "image"] : ["text"],
242
282
  cost: template?.cost ?? ZERO_COST,
243
- contextWindow: template?.contextWindow ?? 128000,
244
- maxTokens: template?.maxTokens ?? 8192,
283
+ contextWindow: group.contextWindow ?? template?.contextWindow ?? 128000,
284
+ maxTokens: group.maxOutputTokens ?? template?.maxTokens ?? 8192,
245
285
  },
246
286
  routing,
247
287
  };
248
288
  }
249
289
 
250
290
  function advertisedThinkingLevels(group: RuntimeGroup): Set<string> {
291
+ // An explicit denial overrides levels inferred from display names or suffixes.
292
+ if (group.supportsThinking === false) return new Set();
251
293
  const levels = new Set(Object.keys(group.variants));
252
294
  if (levels.size > 0) return levels;
253
- // Explicit false from the catalog must not grow a fake High control.
254
- if (group.supportsThinking === false) return levels;
255
- if (group.supportsThinking === true || group.unsuffixed) {
295
+ if (group.supportsThinking === true) {
256
296
  levels.add(ThinkingEffort.High);
257
297
  }
258
298
  return levels;
@@ -327,7 +367,6 @@ function thinkingLevelMapFromLevels(levels: Set<string>): ProviderModelConfig["t
327
367
  for (const level of PI_LEVELS) {
328
368
  map[level] = levels.has(level) ? level : null;
329
369
  }
330
- if (levels.size === 0) map.high = "high";
331
370
  return map;
332
371
  }
333
372
 
@@ -149,6 +149,9 @@ export const RUNTIME_MAX_OUTPUT_TOKENS: Record<string, number> = {
149
149
  };
150
150
 
151
151
  export function getMaxOutputTokens(modelId: string, runtimeModel?: string): number {
152
+ // Refreshed (and restored) catalog limits take precedence over static defaults.
153
+ const discovered = currentModels.find((model) => model.id === modelId);
154
+ if (currentModels !== ANTIGRAVITY_MODELS && discovered) return discovered.maxTokens;
152
155
  if (runtimeModel && RUNTIME_MAX_OUTPUT_TOKENS[runtimeModel] !== undefined) {
153
156
  return RUNTIME_MAX_OUTPUT_TOKENS[runtimeModel];
154
157
  }
@@ -490,6 +493,13 @@ export function getThinkingConfig(
490
493
  thinkingBudget: effort === "high" || effort === "xhigh" ? 10_001 : 1_001,
491
494
  };
492
495
  }
496
+ // Gemini 4 Argon rejects thinkingBudget 0 and any budget under 1000 (#93).
497
+ if (modelId.includes("argon") || modelId.startsWith("gemini-4")) {
498
+ if (!effort || effort === "off") return undefined;
499
+ const thinkingBudget =
500
+ effort === "high" || effort === "xhigh" ? -1 : effort === "medium" ? 4_000 : 1_000;
501
+ return { includeThoughts: true, thinkingBudget };
502
+ }
493
503
  if (modelId.startsWith("gemini-")) {
494
504
  if (!effort || effort === "off") return { includeThoughts: false, thinkingBudget: 0 };
495
505
  const thinkingBudget =