@herbertgao/pi-extensions 2026.9.17 → 2026.9.19

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 (307) hide show
  1. package/README.md +31 -33
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/node_modules/@herbertgao/pi-bark/package.json +2 -2
  4. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +4 -1
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.md +4 -1
  6. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/working-message.ts +21 -6
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +15 -4
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +43 -7
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +7 -2
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +1 -1
  11. package/node_modules/@herbertgao/pi-cc-extensions/package.json +75 -75
  12. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  13. package/node_modules/@herbertgao/pi-subagents/package.json +7 -7
  14. package/node_modules/@herbertgao/resume-from/package.json +4 -2
  15. package/node_modules/@herbertgao/sol-pi/package.json +6 -6
  16. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +99 -99
  17. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  18. package/node_modules/@tifan/pi-handoff/package.json +1 -1
  19. package/node_modules/@tifan/pi-handoff/src/index.ts +56 -26
  20. package/node_modules/@tifan/pi-mermaid-open/package.json +1 -1
  21. package/node_modules/@tifan/pi-preferred-thinking/package.json +1 -1
  22. package/node_modules/@tifan/pi-recap/package.json +1 -1
  23. package/node_modules/@tifan/pi-rename/package.json +1 -1
  24. package/node_modules/pi-antigravity/README.md +29 -6
  25. package/node_modules/pi-antigravity/package.json +14 -9
  26. package/node_modules/pi-antigravity/src/auth/accounts.ts +327 -0
  27. package/node_modules/pi-antigravity/src/auth/index.ts +9 -0
  28. package/node_modules/pi-antigravity/src/client/client.ts +1 -1
  29. package/node_modules/pi-antigravity/src/image/image.ts +4 -4
  30. package/node_modules/pi-antigravity/src/index.ts +203 -13
  31. package/node_modules/pi-antigravity/src/search/index.ts +1 -0
  32. package/node_modules/pi-antigravity/src/search/search.ts +325 -0
  33. package/node_modules/pi-antigravity/src/stream/stream.ts +191 -14
  34. package/node_modules/pi-antigravity/src/types/enums.ts +45 -36
  35. package/node_modules/pi-antigravity/src/types/types.ts +5 -12
  36. package/node_modules/pi-antigravity/src/utils/http.ts +7 -2
  37. package/node_modules/pi-antigravity/src/utils/util.ts +31 -3
  38. package/node_modules/pi-lens/package.json +158 -158
  39. package/node_modules/pi-multi-account/package.json +2 -2
  40. package/node_modules/pi-typesafe/README.md +3 -1
  41. package/node_modules/pi-typesafe/dist/auth.d.ts +9 -5
  42. package/node_modules/pi-typesafe/dist/auth.js +7 -3
  43. package/node_modules/pi-typesafe/dist/backends.d.ts +33 -3
  44. package/node_modules/pi-typesafe/dist/backends.js +95 -1
  45. package/node_modules/pi-typesafe/dist/client.d.ts +5 -5
  46. package/node_modules/pi-typesafe/dist/client.js +12 -9
  47. package/node_modules/pi-typesafe/dist/credentials.d.ts +14 -8
  48. package/node_modules/pi-typesafe/dist/credentials.js +10 -7
  49. package/node_modules/pi-typesafe/dist/errors.d.ts +2 -2
  50. package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
  51. package/node_modules/pi-typesafe/dist/index.js +1 -1
  52. package/node_modules/pi-typesafe/dist/login.d.ts +2 -2
  53. package/node_modules/pi-typesafe/dist/login.js +2 -2
  54. package/node_modules/pi-typesafe/package.json +6 -5
  55. package/node_modules/pi-web-access/CHANGELOG.md +72 -0
  56. package/node_modules/pi-web-access/README.md +34 -13
  57. package/node_modules/pi-web-access/chrome-cookies.ts +79 -25
  58. package/node_modules/pi-web-access/curator-page.ts +5 -1
  59. package/node_modules/pi-web-access/curator-server.ts +2 -0
  60. package/node_modules/pi-web-access/dist/index.js +1337 -1009
  61. package/node_modules/pi-web-access/exa.ts +20 -52
  62. package/node_modules/pi-web-access/extract.ts +41 -4
  63. package/node_modules/pi-web-access/gemini-search.ts +12 -4
  64. package/node_modules/pi-web-access/index.ts +29 -37
  65. package/node_modules/pi-web-access/openai-search.ts +35 -7
  66. package/node_modules/pi-web-access/package.json +8 -7
  67. package/node_modules/pi-web-access/page-query.ts +2 -2
  68. package/node_modules/pi-web-access/query-rewrite.ts +2 -3
  69. package/node_modules/pi-web-access/ssrf-protection.ts +27 -10
  70. package/node_modules/pi-web-access/storage.ts +48 -77
  71. package/node_modules/pi-web-access/summary-model-scope.ts +6 -77
  72. package/node_modules/pi-web-access/summary-review.ts +3 -4
  73. package/node_modules/pi-web-access/tavily.ts +67 -20
  74. package/node_modules/pi-web-access/tool-activation.ts +53 -33
  75. package/node_modules/pi-web-access/utils.ts +1 -1
  76. package/node_modules/pi-web-access/you.ts +164 -0
  77. package/node_modules/pi-web-access/zai.ts +161 -0
  78. package/node_modules/remote-pi/package.json +5 -1
  79. package/package.json +19 -31
  80. package/node_modules/pi-mcp-adapter/CHANGELOG.md +0 -1013
  81. package/node_modules/pi-mcp-adapter/LICENSE +0 -21
  82. package/node_modules/pi-mcp-adapter/OAUTH.md +0 -369
  83. package/node_modules/pi-mcp-adapter/README.md +0 -1021
  84. package/node_modules/pi-mcp-adapter/abort.ts +0 -34
  85. package/node_modules/pi-mcp-adapter/agent-dir.ts +0 -68
  86. package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +0 -416
  87. package/node_modules/pi-mcp-adapter/agent-plugin-provenance.ts +0 -36
  88. package/node_modules/pi-mcp-adapter/app-bridge.bundle.js +0 -67
  89. package/node_modules/pi-mcp-adapter/banner.png +0 -0
  90. package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +0 -193
  91. package/node_modules/pi-mcp-adapter/claude-plugin-loader.ts +0 -365
  92. package/node_modules/pi-mcp-adapter/cli.js +0 -454
  93. package/node_modules/pi-mcp-adapter/commands.ts +0 -861
  94. package/node_modules/pi-mcp-adapter/config.ts +0 -1565
  95. package/node_modules/pi-mcp-adapter/consent-manager.ts +0 -95
  96. package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +0 -244
  97. package/node_modules/pi-mcp-adapter/direct-tools.ts +0 -428
  98. package/node_modules/pi-mcp-adapter/dist/abort.d.ts +0 -2
  99. package/node_modules/pi-mcp-adapter/dist/abort.js +0 -36
  100. package/node_modules/pi-mcp-adapter/dist/abort.js.map +0 -1
  101. package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +0 -10
  102. package/node_modules/pi-mcp-adapter/dist/agent-dir.js +0 -63
  103. package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +0 -1
  104. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +0 -8
  105. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +0 -398
  106. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +0 -1
  107. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.d.ts +0 -1
  108. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js +0 -31
  109. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js.map +0 -1
  110. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +0 -6
  111. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +0 -194
  112. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +0 -1
  113. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.d.ts +0 -9
  114. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js +0 -362
  115. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js.map +0 -1
  116. package/node_modules/pi-mcp-adapter/dist/config.d.ts +0 -134
  117. package/node_modules/pi-mcp-adapter/dist/config.js +0 -1361
  118. package/node_modules/pi-mcp-adapter/dist/config.js.map +0 -1
  119. package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +0 -18
  120. package/node_modules/pi-mcp-adapter/dist/consent-manager.js +0 -88
  121. package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +0 -1
  122. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +0 -17
  123. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +0 -316
  124. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +0 -1
  125. package/node_modules/pi-mcp-adapter/dist/errors.d.ts +0 -131
  126. package/node_modules/pi-mcp-adapter/dist/errors.js +0 -278
  127. package/node_modules/pi-mcp-adapter/dist/errors.js.map +0 -1
  128. package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +0 -8
  129. package/node_modules/pi-mcp-adapter/dist/http-ca.js +0 -88
  130. package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +0 -1
  131. package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +0 -14
  132. package/node_modules/pi-mcp-adapter/dist/jev-client.js +0 -367
  133. package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +0 -1
  134. package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +0 -77
  135. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +0 -2
  136. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +0 -1
  137. package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +0 -51
  138. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +0 -205
  139. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +0 -1
  140. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +0 -2
  141. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +0 -68
  142. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +0 -1
  143. package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +0 -56
  144. package/node_modules/pi-mcp-adapter/dist/lifecycle.js +0 -410
  145. package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +0 -1
  146. package/node_modules/pi-mcp-adapter/dist/logger.d.ts +0 -51
  147. package/node_modules/pi-mcp-adapter/dist/logger.js +0 -131
  148. package/node_modules/pi-mcp-adapter/dist/logger.js.map +0 -1
  149. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +0 -26
  150. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +0 -103
  151. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +0 -1
  152. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +0 -118
  153. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +0 -1097
  154. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +0 -1
  155. package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +0 -170
  156. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +0 -1142
  157. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +0 -1
  158. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.d.ts +0 -24
  159. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +0 -203
  160. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +0 -1
  161. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +0 -53
  162. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +0 -441
  163. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +0 -1
  164. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +0 -148
  165. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +0 -689
  166. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +0 -1
  167. package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +0 -6
  168. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +0 -166
  169. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +0 -1
  170. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +0 -102
  171. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +0 -369
  172. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +0 -1
  173. package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +0 -95
  174. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +0 -242
  175. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +0 -1
  176. package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +0 -19
  177. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +0 -301
  178. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +0 -1
  179. package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +0 -6
  180. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +0 -505
  181. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +0 -1
  182. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +0 -2
  183. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +0 -144
  184. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +0 -1
  185. package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +0 -10
  186. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +0 -312
  187. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +0 -1
  188. package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +0 -1
  189. package/node_modules/pi-mcp-adapter/dist/resource-tools.js +0 -15
  190. package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +0 -1
  191. package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +0 -13
  192. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +0 -97
  193. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +0 -1
  194. package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +0 -17
  195. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +0 -203
  196. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +0 -1
  197. package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +0 -11
  198. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +0 -172
  199. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +0 -1
  200. package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +0 -157
  201. package/node_modules/pi-mcp-adapter/dist/server-manager.js +0 -1745
  202. package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +0 -1
  203. package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +0 -34
  204. package/node_modules/pi-mcp-adapter/dist/session-approvals.js +0 -140
  205. package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +0 -1
  206. package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +0 -26
  207. package/node_modules/pi-mcp-adapter/dist/session-recovery.js +0 -142
  208. package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +0 -1
  209. package/node_modules/pi-mcp-adapter/dist/state.d.ts +0 -73
  210. package/node_modules/pi-mcp-adapter/dist/state.js +0 -2
  211. package/node_modules/pi-mcp-adapter/dist/state.js.map +0 -1
  212. package/node_modules/pi-mcp-adapter/dist/types.d.ts +0 -642
  213. package/node_modules/pi-mcp-adapter/dist/types.js +0 -331
  214. package/node_modules/pi-mcp-adapter/dist/types.js.map +0 -1
  215. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +0 -6
  216. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +0 -37
  217. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +0 -1
  218. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +0 -17
  219. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +0 -219
  220. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +0 -1
  221. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +0 -104
  222. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +0 -59
  223. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +0 -1
  224. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +0 -4
  225. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +0 -27
  226. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +0 -1
  227. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +0 -15
  228. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +0 -85
  229. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +0 -1
  230. package/node_modules/pi-mcp-adapter/dist/utils.d.ts +0 -41
  231. package/node_modules/pi-mcp-adapter/dist/utils.js +0 -417
  232. package/node_modules/pi-mcp-adapter/dist/utils.js.map +0 -1
  233. package/node_modules/pi-mcp-adapter/elicitation-handler.ts +0 -358
  234. package/node_modules/pi-mcp-adapter/error-signal.ts +0 -32
  235. package/node_modules/pi-mcp-adapter/errors.ts +0 -364
  236. package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +0 -85
  237. package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +0 -34
  238. package/node_modules/pi-mcp-adapter/failure-backoff.ts +0 -23
  239. package/node_modules/pi-mcp-adapter/glimpse-ui.ts +0 -80
  240. package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -515
  241. package/node_modules/pi-mcp-adapter/http-ca.ts +0 -84
  242. package/node_modules/pi-mcp-adapter/index.ts +0 -2106
  243. package/node_modules/pi-mcp-adapter/init.ts +0 -721
  244. package/node_modules/pi-mcp-adapter/jev-client.ts +0 -300
  245. package/node_modules/pi-mcp-adapter/jev-contracts.ts +0 -53
  246. package/node_modules/pi-mcp-adapter/jev-key-store.ts +0 -192
  247. package/node_modules/pi-mcp-adapter/json-schema-validator.ts +0 -83
  248. package/node_modules/pi-mcp-adapter/lazy-loader.ts +0 -7
  249. package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -457
  250. package/node_modules/pi-mcp-adapter/logger.ts +0 -169
  251. package/node_modules/pi-mcp-adapter/mcp-auth-fetch.ts +0 -113
  252. package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +0 -1296
  253. package/node_modules/pi-mcp-adapter/mcp-auth.ts +0 -1287
  254. package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +0 -250
  255. package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +0 -534
  256. package/node_modules/pi-mcp-adapter/mcp-code.ts +0 -495
  257. package/node_modules/pi-mcp-adapter/mcp-install.ts +0 -60
  258. package/node_modules/pi-mcp-adapter/mcp-keyring-helper.cjs +0 -89
  259. package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +0 -819
  260. package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +0 -511
  261. package/node_modules/pi-mcp-adapter/mcp-panel-theme.ts +0 -104
  262. package/node_modules/pi-mcp-adapter/mcp-panel.ts +0 -1099
  263. package/node_modules/pi-mcp-adapter/mcp-probe.ts +0 -201
  264. package/node_modules/pi-mcp-adapter/mcp-references.ts +0 -373
  265. package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +0 -137
  266. package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +0 -747
  267. package/node_modules/pi-mcp-adapter/mcp-status.ts +0 -105
  268. package/node_modules/pi-mcp-adapter/mcp-tasks.ts +0 -467
  269. package/node_modules/pi-mcp-adapter/mcp-trace.ts +0 -306
  270. package/node_modules/pi-mcp-adapter/metadata-cache.ts +0 -362
  271. package/node_modules/pi-mcp-adapter/namespace-tools.ts +0 -334
  272. package/node_modules/pi-mcp-adapter/npx-resolver.ts +0 -543
  273. package/node_modules/pi-mcp-adapter/oauth-handler.ts +0 -30
  274. package/node_modules/pi-mcp-adapter/oauth.ts +0 -52
  275. package/node_modules/pi-mcp-adapter/onboarding-state.ts +0 -76
  276. package/node_modules/pi-mcp-adapter/package-mcp-loader.ts +0 -156
  277. package/node_modules/pi-mcp-adapter/package.json +0 -219
  278. package/node_modules/pi-mcp-adapter/panel-keys.ts +0 -53
  279. package/node_modules/pi-mcp-adapter/prompts.ts +0 -385
  280. package/node_modules/pi-mcp-adapter/proxy-modes.ts +0 -1735
  281. package/node_modules/pi-mcp-adapter/request-headers-command.ts +0 -333
  282. package/node_modules/pi-mcp-adapter/resource-tools.ts +0 -17
  283. package/node_modules/pi-mcp-adapter/runtime-owner.ts +0 -106
  284. package/node_modules/pi-mcp-adapter/sampling-handler.ts +0 -261
  285. package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +0 -144
  286. package/node_modules/pi-mcp-adapter/search-ranking.ts +0 -309
  287. package/node_modules/pi-mcp-adapter/secure-keyring.ts +0 -170
  288. package/node_modules/pi-mcp-adapter/semantic-search.ts +0 -186
  289. package/node_modules/pi-mcp-adapter/server-manager.ts +0 -2088
  290. package/node_modules/pi-mcp-adapter/session-approvals.ts +0 -201
  291. package/node_modules/pi-mcp-adapter/session-recovery.ts +0 -158
  292. package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +0 -49
  293. package/node_modules/pi-mcp-adapter/state.ts +0 -71
  294. package/node_modules/pi-mcp-adapter/tool-approval.ts +0 -205
  295. package/node_modules/pi-mcp-adapter/tool-metadata.ts +0 -302
  296. package/node_modules/pi-mcp-adapter/tool-registrar.ts +0 -255
  297. package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +0 -573
  298. package/node_modules/pi-mcp-adapter/ts-shape.ts +0 -149
  299. package/node_modules/pi-mcp-adapter/types.ts +0 -1120
  300. package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +0 -40
  301. package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +0 -266
  302. package/node_modules/pi-mcp-adapter/ui-server.ts +0 -993
  303. package/node_modules/pi-mcp-adapter/ui-session.ts +0 -624
  304. package/node_modules/pi-mcp-adapter/ui-stream-types.ts +0 -89
  305. package/node_modules/pi-mcp-adapter/ui-tool-visibility.ts +0 -25
  306. package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +0 -85
  307. package/node_modules/pi-mcp-adapter/utils.ts +0 -464
@@ -0,0 +1,327 @@
1
+ import { createHash } from "node:crypto";
2
+ import { chmodSync, existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { join } from "node:path";
5
+ import type { OAuthCredentials } from "@earendil-works/pi-ai";
6
+ import { defaultProjectId } from "../client/client.js";
7
+ import type { AntigravityApiKey, AntigravityOAuthCredentials } from "../types/types.js";
8
+ import { refreshAntigravityToken } from "./oauth.js";
9
+
10
+ const ACCOUNTS_FILE = "antigravity-accounts.json";
11
+ const AUTH_FILE = "auth.json";
12
+ const REFRESH_SKEW_MS = 5 * 60 * 1000;
13
+
14
+ export type StoredAccount = AntigravityOAuthCredentials & {
15
+ accountId: string;
16
+ addedAt: number;
17
+ lastUsedAt: number;
18
+ };
19
+
20
+ type AccountsFile = {
21
+ version: 1;
22
+ activeAccountId?: string;
23
+ accounts: Record<string, StoredAccount>;
24
+ };
25
+
26
+ export type AccountSummary = {
27
+ accountId: string;
28
+ email?: string;
29
+ active: boolean;
30
+ lastUsedAt: number;
31
+ };
32
+
33
+ function agentDir(): string {
34
+ return process.env.PI_CODING_AGENT_DIR || join(homedir(), ".pi", "agent");
35
+ }
36
+
37
+ function accountsPath(): string {
38
+ return join(agentDir(), ACCOUNTS_FILE);
39
+ }
40
+
41
+ function authPath(): string {
42
+ return join(agentDir(), AUTH_FILE);
43
+ }
44
+
45
+ function readJsonObject(path: string): Record<string, unknown> | undefined {
46
+ if (!existsSync(path)) return undefined;
47
+ try {
48
+ const parsed: unknown = JSON.parse(readFileSync(path, "utf8"));
49
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return undefined;
50
+ return parsed as Record<string, unknown>;
51
+ } catch {
52
+ return undefined;
53
+ }
54
+ }
55
+
56
+ function writePrivateJson(path: string, value: unknown): void {
57
+ const tempPath = `${path}.${process.pid}.tmp`;
58
+ writeFileSync(tempPath, `${JSON.stringify(value, null, 2)}\n`, { encoding: "utf8", mode: 0o600 });
59
+ chmodSync(tempPath, 0o600);
60
+ renameSync(tempPath, path);
61
+ chmodSync(path, 0o600);
62
+ }
63
+
64
+ function emptyStore(): AccountsFile {
65
+ return { version: 1, accounts: {} };
66
+ }
67
+
68
+ function isStoredAccount(value: unknown): value is StoredAccount {
69
+ if (!value || typeof value !== "object") return false;
70
+ const account = value as Partial<StoredAccount>;
71
+ return typeof account.refresh === "string" && account.refresh.length > 0;
72
+ }
73
+
74
+ function normalizeStore(value: Record<string, unknown> | undefined): AccountsFile {
75
+ if (!value || value.version !== 1 || !value.accounts || typeof value.accounts !== "object") {
76
+ return emptyStore();
77
+ }
78
+ const accounts: Record<string, StoredAccount> = {};
79
+ for (const [key, raw] of Object.entries(value.accounts as Record<string, unknown>)) {
80
+ if (!isStoredAccount(raw)) continue;
81
+ const accountId =
82
+ typeof raw.accountId === "string" && raw.accountId.trim() ? raw.accountId : key;
83
+ accounts[accountId] = { ...raw, accountId };
84
+ }
85
+ const activeAccountId =
86
+ typeof value.activeAccountId === "string"
87
+ ? value.activeAccountId
88
+ : typeof value.activeEmail === "string"
89
+ ? value.activeEmail
90
+ : undefined;
91
+ return {
92
+ version: 1,
93
+ activeAccountId: activeAccountId && accounts[activeAccountId] ? activeAccountId : undefined,
94
+ accounts,
95
+ };
96
+ }
97
+
98
+ export function loadAccountStore(): AccountsFile {
99
+ return normalizeStore(readJsonObject(accountsPath()));
100
+ }
101
+
102
+ function saveAccountStore(store: AccountsFile): void {
103
+ writePrivateJson(accountsPath(), store);
104
+ }
105
+
106
+ function accountIdFor(credentials: OAuthCredentials): string {
107
+ const email = (credentials as AntigravityOAuthCredentials).email?.trim().toLowerCase();
108
+ if (email) return email;
109
+ return `account-${createHash("sha256").update(credentials.refresh).digest("hex").slice(0, 16)}`;
110
+ }
111
+
112
+ function accountFromCredentials(
113
+ credentials: AntigravityOAuthCredentials,
114
+ existing?: StoredAccount,
115
+ ): StoredAccount {
116
+ const now = Date.now();
117
+ return {
118
+ ...credentials,
119
+ accountId: existing?.accountId || accountIdFor(credentials),
120
+ addedAt: existing?.addedAt || now,
121
+ lastUsedAt: now,
122
+ };
123
+ }
124
+
125
+ function sortedAccounts(store: AccountsFile): StoredAccount[] {
126
+ return Object.values(store.accounts).sort((a, b) => {
127
+ if (a.addedAt !== b.addedAt) return a.addedAt - b.addedAt;
128
+ return a.accountId.localeCompare(b.accountId);
129
+ });
130
+ }
131
+
132
+ function findAccount(
133
+ store: AccountsFile,
134
+ credentials: OAuthCredentials,
135
+ ): StoredAccount | undefined {
136
+ const email = (credentials as AntigravityOAuthCredentials).email?.trim().toLowerCase();
137
+ return Object.values(store.accounts).find(
138
+ (account) =>
139
+ account.refresh === credentials.refresh ||
140
+ (email !== undefined && account.email?.trim().toLowerCase() === email),
141
+ );
142
+ }
143
+
144
+ function findAccountId(store: AccountsFile, selector: string): string | undefined {
145
+ const normalized = selector.trim().toLowerCase();
146
+ if (!normalized) return undefined;
147
+ const entries = sortedAccounts(store);
148
+ if (/^\d+$/.test(normalized)) {
149
+ const index = Number.parseInt(normalized, 10);
150
+ if (index >= 1 && index <= entries.length) return entries[index - 1]?.accountId;
151
+ return undefined;
152
+ }
153
+ return entries.find(
154
+ (account) =>
155
+ account.accountId.toLowerCase() === normalized ||
156
+ account.email?.trim().toLowerCase() === normalized,
157
+ )?.accountId;
158
+ }
159
+
160
+ function readAuthFile(): Record<string, unknown> {
161
+ const path = authPath();
162
+ if (!existsSync(path)) return {};
163
+ const parsed = readJsonObject(path);
164
+ if (!parsed) {
165
+ throw new Error("Refusing to overwrite unreadable Pi auth.json");
166
+ }
167
+ return parsed;
168
+ }
169
+
170
+ function writeActiveCredential(account: StoredAccount | undefined): void {
171
+ const auth = readAuthFile();
172
+ if (account) {
173
+ auth.antigravity = {
174
+ type: "oauth",
175
+ email: account.email,
176
+ access: account.access,
177
+ refresh: account.refresh,
178
+ expires: account.expires,
179
+ projectId: account.projectId,
180
+ };
181
+ } else {
182
+ delete auth.antigravity;
183
+ }
184
+ writePrivateJson(authPath(), auth);
185
+ }
186
+
187
+ function currentAuthCredentials(): AntigravityOAuthCredentials | undefined {
188
+ const current = readJsonObject(authPath())?.antigravity;
189
+ if (!current || typeof current !== "object") return undefined;
190
+ const record = current as Record<string, unknown>;
191
+ if (typeof record.refresh !== "string" || !record.refresh) return undefined;
192
+ return {
193
+ access: typeof record.access === "string" ? record.access : "",
194
+ refresh: record.refresh,
195
+ expires: typeof record.expires === "number" ? record.expires : 0,
196
+ projectId: typeof record.projectId === "string" ? record.projectId : undefined,
197
+ email: typeof record.email === "string" ? record.email : undefined,
198
+ };
199
+ }
200
+
201
+ export function syncCurrentAuth(): void {
202
+ const credentials = currentAuthCredentials();
203
+ if (!credentials) return;
204
+ const store = loadAccountStore();
205
+ const existing = findAccount(store, credentials);
206
+ const account = accountFromCredentials(credentials, existing);
207
+ store.accounts[account.accountId] = account;
208
+ store.activeAccountId = account.accountId;
209
+ saveAccountStore(store);
210
+ }
211
+
212
+ export function rememberAccount(credentials: AntigravityOAuthCredentials): StoredAccount {
213
+ syncCurrentAuth();
214
+ const store = loadAccountStore();
215
+ const existing = findAccount(store, credentials);
216
+ const account = accountFromCredentials(credentials, existing);
217
+ store.accounts[account.accountId] = account;
218
+ store.activeAccountId = account.accountId;
219
+ saveAccountStore(store);
220
+ return account;
221
+ }
222
+
223
+ export function updateRememberedAccount(
224
+ previous: OAuthCredentials,
225
+ credentials: AntigravityOAuthCredentials,
226
+ ): void {
227
+ const store = loadAccountStore();
228
+ const existing = findAccount(store, previous);
229
+ if (!existing) return;
230
+ const account = accountFromCredentials(credentials, existing);
231
+ delete store.accounts[existing.accountId];
232
+ store.accounts[account.accountId] = account;
233
+ if (store.activeAccountId === existing.accountId) {
234
+ store.activeAccountId = account.accountId;
235
+ }
236
+ saveAccountStore(store);
237
+ }
238
+
239
+ export function listAccounts(): AccountSummary[] {
240
+ syncCurrentAuth();
241
+ const store = loadAccountStore();
242
+ return sortedAccounts(store).map((account) => ({
243
+ accountId: account.accountId,
244
+ email: account.email,
245
+ active: account.accountId === store.activeAccountId,
246
+ lastUsedAt: account.lastUsedAt,
247
+ }));
248
+ }
249
+
250
+ async function ensureFresh(account: StoredAccount): Promise<StoredAccount> {
251
+ if (account.access && account.expires > Date.now() + REFRESH_SKEW_MS) return account;
252
+ return accountFromCredentials(await refreshAntigravityToken(account), account);
253
+ }
254
+
255
+ function apiKeyFor(account: StoredAccount): AntigravityApiKey {
256
+ const email = account.email?.trim();
257
+ return {
258
+ token: account.access,
259
+ projectId: account.projectId || defaultProjectId(email || "antigravity-default"),
260
+ };
261
+ }
262
+
263
+ export async function activateAccount(selector: string): Promise<StoredAccount> {
264
+ syncCurrentAuth();
265
+ const store = loadAccountStore();
266
+ const accountId = findAccountId(store, selector);
267
+ if (!accountId) throw new Error(`Antigravity account not found: ${selector}`);
268
+ const existing = store.accounts[accountId];
269
+ if (!existing) throw new Error(`Antigravity account not found: ${selector}`);
270
+ const account = await ensureFresh(existing);
271
+ account.lastUsedAt = Date.now();
272
+ store.accounts[account.accountId] = account;
273
+ store.activeAccountId = account.accountId;
274
+ saveAccountStore(store);
275
+ writeActiveCredential(account);
276
+ return account;
277
+ }
278
+
279
+ export async function removeAccount(selector: string): Promise<StoredAccount | undefined> {
280
+ syncCurrentAuth();
281
+ const store = loadAccountStore();
282
+ const accountId = findAccountId(store, selector);
283
+ if (!accountId) throw new Error(`Antigravity account not found: ${selector}`);
284
+ delete store.accounts[accountId];
285
+ let next: StoredAccount | undefined;
286
+ if (store.activeAccountId === accountId) {
287
+ next = sortedAccounts(store).sort((a, b) => b.lastUsedAt - a.lastUsedAt)[0];
288
+ if (next) {
289
+ next = await ensureFresh(next);
290
+ next.lastUsedAt = Date.now();
291
+ store.accounts[next.accountId] = next;
292
+ }
293
+ store.activeAccountId = next?.accountId;
294
+ writeActiveCredential(next);
295
+ }
296
+ saveAccountStore(store);
297
+ return next;
298
+ }
299
+
300
+ /**
301
+ * Switch to the next stored account that has not already been tried in this request.
302
+ * Used when Antigravity returns a hard quota wall (HTTP 429).
303
+ */
304
+ export async function failoverToNextAccount(
305
+ triedAccessTokens: ReadonlySet<string>,
306
+ ): Promise<AntigravityApiKey | undefined> {
307
+ syncCurrentAuth();
308
+ const store = loadAccountStore();
309
+ const candidates = sortedAccounts(store).filter(
310
+ (account) => !triedAccessTokens.has(account.access),
311
+ );
312
+ for (const candidate of candidates) {
313
+ try {
314
+ const account = await ensureFresh(candidate);
315
+ if (!account.access || triedAccessTokens.has(account.access)) continue;
316
+ account.lastUsedAt = Date.now();
317
+ store.accounts[account.accountId] = account;
318
+ store.activeAccountId = account.accountId;
319
+ saveAccountStore(store);
320
+ writeActiveCredential(account);
321
+ return apiKeyFor(account);
322
+ } catch {
323
+ // Skip accounts whose refresh token is no longer valid.
324
+ }
325
+ }
326
+ return undefined;
327
+ }
@@ -12,3 +12,12 @@ export {
12
12
  OAUTH_CALLBACK_TIMEOUT_MS,
13
13
  } from "./oauth.js";
14
14
  export type { OAuthCredentials, OAuthLoginCallbacks } from "./oauth.js";
15
+ export {
16
+ activateAccount,
17
+ failoverToNextAccount,
18
+ listAccounts,
19
+ rememberAccount,
20
+ removeAccount,
21
+ updateRememberedAccount,
22
+ } from "./accounts.js";
23
+ export type { AccountSummary, StoredAccount } from "./accounts.js";
@@ -61,7 +61,7 @@ export function endpointCandidates(): string[] {
61
61
  }
62
62
 
63
63
  const DEFAULT_USER_AGENT =
64
- "antigravity/cli/1.1.23 (aidev_client; os_type=linux; arch=amd64; cl=974125021; auth_method=consumer)";
64
+ "antigravity/cli/1.2.4 (aidev_client; os_type=linux; arch=amd64; cl=982146307; auth_method=consumer)";
65
65
 
66
66
  /** Default User-Agent matching pure Antigravity CLI wire fingerprint. */
67
67
  export function defaultUserAgent(): string {
@@ -42,15 +42,15 @@ export type ImageGenerateRequest = {
42
42
  project: string;
43
43
  model: string;
44
44
  request: {
45
- contents: Array<{ role: GeminiRole.User; parts: Array<{ text: string }> }>;
46
- systemInstruction: { role: GeminiRole.User; parts: Array<{ text: string }> };
45
+ contents: Array<{ role: "user"; parts: Array<{ text: string }> }>;
46
+ systemInstruction: { role: "user"; parts: Array<{ text: string }> };
47
47
  generationConfig: {
48
48
  imageConfig: { aspectRatio: string };
49
49
  candidateCount: number;
50
50
  };
51
51
  };
52
- requestType: AntigravityRequestType.Agent;
53
- userAgent: AntigravityUserAgent.Antigravity;
52
+ requestType: "agent";
53
+ userAgent: "antigravity";
54
54
  requestId: string;
55
55
  };
56
56
 
@@ -1,8 +1,19 @@
1
1
  import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
2
  import { StringEnum, Type } from "@earendil-works/pi-ai";
3
- import { registerApiProvider } from "@earendil-works/pi-ai/compat";
4
- import { getApiKey, loginAntigravity, refreshAntigravityToken } from "./auth/index.js";
5
- import { DEFAULT_ENDPOINT, endpointCandidates } from "./client/index.js";
3
+ // Namespace import: Oh My Pi rewrites this specifier onto bundled pi-ai, which
4
+ // does not export registerApiProvider. A static named import fails plugin load.
5
+ import * as piAiCompat from "@earendil-works/pi-ai/compat";
6
+ import {
7
+ activateAccount,
8
+ getApiKey,
9
+ listAccounts,
10
+ loginAntigravity,
11
+ rememberAccount,
12
+ refreshAntigravityToken,
13
+ removeAccount,
14
+ updateRememberedAccount,
15
+ } from "./auth/index.js";
16
+ import { DEFAULT_ENDPOINT } from "./client/index.js";
6
17
  import { getLastDiagnostics, runWithDiagnostics } from "./diagnostics/index.js";
7
18
  import {
8
19
  DEFAULT_IMAGE_MODEL,
@@ -10,6 +21,7 @@ import {
10
21
  IMAGE_ASPECT_RATIOS,
11
22
  parseImageCommandArgs,
12
23
  } from "./image/index.js";
24
+ import { executeAntigravitySearch, parseSearchCommandArgs } from "./search/index.js";
13
25
  import {
14
26
  applyAntigravityCatalog,
15
27
  discoverAntigravityModels,
@@ -26,7 +38,7 @@ import {
26
38
  formatUsageSummary,
27
39
  resolveApiKeyFromContext,
28
40
  } from "./usage/index.js";
29
- import { prewarmConnection, redactSecrets } from "./utils/index.js";
41
+ import { redactSecrets, maskEmail } from "./utils/index.js";
30
42
 
31
43
  /**
32
44
  * Pi's interactive `notify` writes into the chat transcript. `console.log` in that
@@ -45,6 +57,22 @@ function emitCommandOutput(
45
57
  else console.log(text);
46
58
  }
47
59
 
60
+ async function loginAndRemember(
61
+ callbacks: Parameters<typeof loginAntigravity>[0],
62
+ ): ReturnType<typeof loginAntigravity> {
63
+ const credentials = await loginAntigravity(callbacks);
64
+ rememberAccount(credentials);
65
+ return credentials;
66
+ }
67
+
68
+ async function refreshAndRemember(
69
+ credentials: Parameters<typeof refreshAntigravityToken>[0],
70
+ ): ReturnType<typeof refreshAntigravityToken> {
71
+ const refreshed = await refreshAntigravityToken(credentials);
72
+ updateRememberedAccount(credentials, refreshed);
73
+ return refreshed;
74
+ }
75
+
48
76
  async function withUsage(
49
77
  ctx: ExtensionCommandContext,
50
78
  fn: (usage: Awaited<ReturnType<typeof fetchAccountUsage>>) => string,
@@ -68,17 +96,29 @@ async function withUsage(
68
96
  }
69
97
  }
70
98
 
71
- export default function (pi: ExtensionAPI): void {
72
- // Open the TLS connection up front so the first message of a session does not pay
73
- // the handshake. Opt out with ANTIGRAVITY_NO_PREWARM=1.
74
- const primaryEndpoint = endpointCandidates()[0];
75
- if (primaryEndpoint) prewarmConnection(primaryEndpoint);
99
+ type CompatApiProviderRegistrar = (provider: {
100
+ api: typeof ANTIGRAVITY_API;
101
+ stream: typeof streamAntigravity;
102
+ streamSimple: typeof streamAntigravity;
103
+ }) => void;
76
104
 
77
- registerApiProvider({
105
+ /**
106
+ * Pi dispatches custom APIs through the compat registry. Oh My Pi does not
107
+ * export `registerApiProvider` and registers the stream inside `registerProvider`.
108
+ */
109
+ function registerCompatApiProvider(): void {
110
+ const register = (piAiCompat as { registerApiProvider?: CompatApiProviderRegistrar })
111
+ .registerApiProvider;
112
+ if (typeof register !== "function") return;
113
+ register({
78
114
  api: ANTIGRAVITY_API,
79
115
  stream: streamAntigravity,
80
116
  streamSimple: streamAntigravity,
81
117
  });
118
+ }
119
+
120
+ export default function (pi: ExtensionAPI): void {
121
+ registerCompatApiProvider();
82
122
 
83
123
  const initialCatalog = getCurrentAntigravityCatalog();
84
124
 
@@ -90,8 +130,8 @@ export default function (pi: ExtensionAPI): void {
90
130
  refreshModels: refreshAntigravityModels,
91
131
  oauth: {
92
132
  name: PROVIDER_NAME,
93
- login: loginAntigravity,
94
- refreshToken: refreshAntigravityToken,
133
+ login: loginAndRemember,
134
+ refreshToken: refreshAndRemember,
95
135
  getApiKey,
96
136
  },
97
137
  streamSimple: streamAntigravity,
@@ -112,6 +152,51 @@ export default function (pi: ExtensionAPI): void {
112
152
  },
113
153
  });
114
154
 
155
+ pi.registerCommand("antigravity.accounts", {
156
+ description: "List, switch, or remove linked Antigravity Google accounts",
157
+ handler: async (args, ctx) => {
158
+ const command = args.trim();
159
+ try {
160
+ if (command.startsWith("switch ")) {
161
+ const account = await activateAccount(command.slice("switch ".length));
162
+ emitCommandOutput(
163
+ ctx,
164
+ `Active Antigravity account: ${account.email || account.accountId}`,
165
+ );
166
+ return;
167
+ }
168
+ if (command.startsWith("remove ")) {
169
+ const remaining = await removeAccount(command.slice("remove ".length));
170
+ const next = remaining
171
+ ? ` Active account is now ${remaining.email || remaining.accountId}.`
172
+ : "";
173
+ emitCommandOutput(ctx, `Antigravity account removed.${next}`);
174
+ return;
175
+ }
176
+ const accounts = listAccounts();
177
+ if (accounts.length === 0) {
178
+ emitCommandOutput(
179
+ ctx,
180
+ "No linked Antigravity accounts. Run /login antigravity to add one.",
181
+ "warning",
182
+ );
183
+ return;
184
+ }
185
+ const lines = accounts.map(
186
+ (account, index) =>
187
+ `${account.active ? "* " : " "}${index + 1}. ${account.email || account.accountId}`,
188
+ );
189
+ emitCommandOutput(
190
+ ctx,
191
+ `${lines.join("\n")}\nUse /antigravity.accounts switch <index|email> or /antigravity.accounts remove <index|email>.`,
192
+ );
193
+ } catch (error) {
194
+ const msg = error instanceof Error ? error.message : String(error);
195
+ emitCommandOutput(ctx, msg, "error");
196
+ }
197
+ },
198
+ });
199
+
115
200
  pi.registerCommand("antigravity.refresh", {
116
201
  description: "Force refresh Antigravity dynamic model catalog",
117
202
  handler: async (_args, ctx) => {
@@ -163,6 +248,12 @@ export default function (pi: ExtensionAPI): void {
163
248
  description: "Show sanitized Antigravity provider diagnostics",
164
249
  handler: async (_args, ctx) => {
165
250
  const d = getLastDiagnostics();
251
+ const accounts = listAccounts();
252
+ const active = accounts.find((account) => account.active);
253
+ const activeLabel = active
254
+ ? maskEmail(active.email) ||
255
+ (active.accountId.includes("@") ? maskEmail(active.accountId) : active.accountId)
256
+ : "none";
166
257
  const lines = [
167
258
  `provider=${PROVIDER_ID}`,
168
259
  `lastResolvedRuntimeModel=${d.resolvedRuntimeModel || "none"}`,
@@ -171,12 +262,14 @@ export default function (pi: ExtensionAPI): void {
171
262
  `lastEndpoint=${d.endpoint || "none"}`,
172
263
  `lastStatus=${d.status ?? "none"}`,
173
264
  `lastProjectId=${d.projectId || "none"}`,
265
+ `linkedAccounts=${accounts.length || "none"}`,
266
+ `activeAccount=${activeLabel || "none"}`,
174
267
  ...(d.latencyMs !== undefined ? [`lastLatencyMs=${d.latencyMs}`] : []),
175
268
  `toolSchemaWarnings=${d.toolSchemaWarnings || "none"}`,
176
269
  `lastError=${d.error ? redactSecrets(d.error) : "none"}`,
177
270
  "transport=native-streamSimple",
178
271
  "runtimeCli=not-used",
179
- "commands=/antigravity.usage /antigravity.models /antigravity.refresh /antigravity.doctor /antigravity.image",
272
+ "commands=/antigravity.usage /antigravity.models /antigravity.accounts /antigravity.refresh /antigravity.doctor /antigravity.image /antigravity.search",
180
273
  ];
181
274
  emitCommandOutput(ctx, `Antigravity doctor\n${lines.join("\n")}`);
182
275
  },
@@ -222,6 +315,44 @@ export default function (pi: ExtensionAPI): void {
222
315
  },
223
316
  });
224
317
 
318
+ pi.registerCommand("antigravity.search", {
319
+ description:
320
+ "Search the web via Antigravity Grounding (usage: /antigravity.search [--thinking] [--url <url>] <query>)",
321
+ handler: async (args, ctx) => {
322
+ const parsed = parseSearchCommandArgs(args || "");
323
+ if (!parsed.query) {
324
+ emitCommandOutput(
325
+ ctx,
326
+ "Usage: /antigravity.search [--thinking] [--url <url>] <query>",
327
+ "warning",
328
+ );
329
+ return;
330
+ }
331
+ try {
332
+ const apiKey = await resolveApiKeyFromContext(ctx);
333
+ if (!apiKey) {
334
+ emitCommandOutput(
335
+ ctx,
336
+ "No Antigravity credentials. Run /login antigravity first.",
337
+ "warning",
338
+ );
339
+ return;
340
+ }
341
+ if (ctx.hasUI) ctx.ui.notify("Searching Google via Antigravity Grounding…", "info");
342
+ const result = await executeAntigravitySearch({
343
+ apiKey,
344
+ query: parsed.query,
345
+ urls: parsed.urls,
346
+ thinking: parsed.thinking,
347
+ });
348
+ emitCommandOutput(ctx, result);
349
+ } catch (error) {
350
+ const msg = error instanceof Error ? error.message : String(error);
351
+ emitCommandOutput(ctx, `Antigravity search failed: ${redactSecrets(msg)}`, "warning");
352
+ }
353
+ },
354
+ });
355
+
225
356
  pi.registerTool({
226
357
  name: "generate_image",
227
358
  label: "Generate image",
@@ -277,4 +408,63 @@ export default function (pi: ExtensionAPI): void {
277
408
  };
278
409
  },
279
410
  });
411
+
412
+ pi.registerTool({
413
+ name: "google_search",
414
+ label: "Google Search",
415
+ description:
416
+ "Search the web using Google Search via Antigravity Grounding powered by Gemini 3 Flash. Returns real-time web results with multi-angle deep search and source citations. Use this whenever current, real-time information or web research is needed.",
417
+ promptSnippet: "Real-time Google Search grounding via Antigravity (Gemini 3 Flash)",
418
+ promptGuidelines: [
419
+ "Use google_search when you need real-time, up-to-date web information, latest news, documentation, or fact checking.",
420
+ "Pass specific URLs into the urls array if you want the search engine to fetch and analyze specific pages.",
421
+ "Set instruction to provide special research directives from the lead agent (e.g. focus on issues, compare benchmarks, restrict time range).",
422
+ ],
423
+ parameters: Type.Object({
424
+ query: Type.String({ description: "Search query or question." }),
425
+ instruction: Type.Optional(
426
+ Type.String({
427
+ description:
428
+ "Specific directive or focus from the lead agent (e.g., '重点关注英文社区近七天的讨论', 'focus on GitHub issues and benchmarks', 'ignore marketing announcements').",
429
+ }),
430
+ ),
431
+ urls: Type.Optional(
432
+ Type.Array(Type.String(), {
433
+ description: "Optional specific URLs to fetch and analyze alongside the search.",
434
+ }),
435
+ ),
436
+ thinking: Type.Optional(
437
+ Type.Boolean({
438
+ description: "Enable deeper thinking for complex analysis (default: false).",
439
+ }),
440
+ ),
441
+ }),
442
+ async execute(_toolCallId, params, signal, onUpdate, ctx) {
443
+ const apiKey = await ctx.modelRegistry.getApiKeyForProvider("antigravity");
444
+ if (!apiKey) {
445
+ throw new Error("No Antigravity credentials. Run /login antigravity first.");
446
+ }
447
+ onUpdate?.({
448
+ content: [{ type: "text", text: `Searching Google for: "${params.query}"…` }],
449
+ details: {},
450
+ });
451
+ try {
452
+ const result = await executeAntigravitySearch({
453
+ apiKey,
454
+ query: params.query,
455
+ instruction: params.instruction,
456
+ urls: params.urls,
457
+ thinking: params.thinking,
458
+ signal,
459
+ });
460
+ return {
461
+ content: [{ type: "text", text: result }],
462
+ details: {},
463
+ };
464
+ } catch (error) {
465
+ const msg = error instanceof Error ? error.message : String(error);
466
+ throw new Error(redactSecrets(msg), { cause: error });
467
+ }
468
+ },
469
+ });
280
470
  }
@@ -0,0 +1 @@
1
+ export * from "./search.js";