@herbertgao/pi-extensions 2026.9.18 → 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 (48) hide show
  1. package/README.md +19 -20
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/working-message.ts +21 -6
  4. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +15 -4
  5. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +43 -7
  6. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +7 -2
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +1 -1
  8. package/node_modules/@herbertgao/pi-cc-extensions/package.json +2 -2
  9. package/node_modules/pi-antigravity/README.md +29 -6
  10. package/node_modules/pi-antigravity/package.json +12 -7
  11. package/node_modules/pi-antigravity/src/auth/accounts.ts +327 -0
  12. package/node_modules/pi-antigravity/src/auth/index.ts +9 -0
  13. package/node_modules/pi-antigravity/src/client/client.ts +1 -1
  14. package/node_modules/pi-antigravity/src/image/image.ts +4 -4
  15. package/node_modules/pi-antigravity/src/index.ts +203 -13
  16. package/node_modules/pi-antigravity/src/search/index.ts +1 -0
  17. package/node_modules/pi-antigravity/src/search/search.ts +325 -0
  18. package/node_modules/pi-antigravity/src/stream/stream.ts +191 -14
  19. package/node_modules/pi-antigravity/src/types/enums.ts +45 -36
  20. package/node_modules/pi-antigravity/src/types/types.ts +5 -12
  21. package/node_modules/pi-antigravity/src/utils/http.ts +7 -2
  22. package/node_modules/pi-antigravity/src/utils/util.ts +31 -3
  23. package/node_modules/pi-typesafe/README.md +2 -0
  24. package/node_modules/pi-typesafe/package.json +2 -1
  25. package/node_modules/pi-web-access/CHANGELOG.md +72 -0
  26. package/node_modules/pi-web-access/README.md +34 -13
  27. package/node_modules/pi-web-access/chrome-cookies.ts +79 -25
  28. package/node_modules/pi-web-access/curator-page.ts +5 -1
  29. package/node_modules/pi-web-access/curator-server.ts +2 -0
  30. package/node_modules/pi-web-access/dist/index.js +1337 -1009
  31. package/node_modules/pi-web-access/exa.ts +20 -52
  32. package/node_modules/pi-web-access/extract.ts +41 -4
  33. package/node_modules/pi-web-access/gemini-search.ts +12 -4
  34. package/node_modules/pi-web-access/index.ts +29 -37
  35. package/node_modules/pi-web-access/openai-search.ts +35 -7
  36. package/node_modules/pi-web-access/package.json +6 -5
  37. package/node_modules/pi-web-access/page-query.ts +2 -2
  38. package/node_modules/pi-web-access/query-rewrite.ts +2 -3
  39. package/node_modules/pi-web-access/ssrf-protection.ts +27 -10
  40. package/node_modules/pi-web-access/storage.ts +48 -77
  41. package/node_modules/pi-web-access/summary-model-scope.ts +6 -77
  42. package/node_modules/pi-web-access/summary-review.ts +3 -4
  43. package/node_modules/pi-web-access/tavily.ts +67 -20
  44. package/node_modules/pi-web-access/tool-activation.ts +53 -33
  45. package/node_modules/pi-web-access/utils.ts +1 -1
  46. package/node_modules/pi-web-access/you.ts +164 -0
  47. package/node_modules/pi-web-access/zai.ts +161 -0
  48. package/package.json +6 -6
package/README.md CHANGED
@@ -18,29 +18,28 @@ When migrating from `pi-mcp-adapter`, remove any standalone adapter install as w
18
18
 
19
19
  ## Bundled extensions
20
20
 
21
- The package bundles 6 active `@herbertgao/*` child packages—`pi-bark`, `pi-cc-extensions`, `resume-from`, `pi-subagents`, `sol-pi`, and the maintained Antigravity provider mirror—plus the following upstream packages under their original names:
22
-
23
- - `pi-antigravity@0.7.2`
24
- - `@dietrichgebert/ponytail@4.9.0`
25
- - `@juicesharp/rpiv-ask-user-question@2.8.0`
26
- - `@narumitw/pi-btw@0.61.0`
27
-
28
- - `@narumitw/pi-caffeinate@0.49.7`
29
- - `@pi-plugins/fast-mode@0.1.10`
30
- - `@tifan/pi-copy-response@0.2.6`
21
+ The package bundles 5 active `@herbertgao/*` child packages—`pi-bark`, `pi-cc-extensions`, `resume-from`, `pi-subagents`, and `sol-pi`—plus the following upstream packages under their original names:
22
+
23
+ - `pi-antigravity@0.8.1`
24
+ - `@dietrichgebert/ponytail@4.10.0`
25
+ - `@juicesharp/rpiv-ask-user-question@2.11.0`
26
+ - `@narumitw/pi-btw@0.61.1`
27
+ - `@narumitw/pi-caffeinate@0.49.8`
28
+ - `@pi-plugins/fast-mode@0.1.12`
29
+ - `@tifan/pi-copy-response@0.2.7`
31
30
  - `@tifan/pi-handoff@2.2.2`
32
- - `@tifan/pi-inline-skills@1.0.5`
33
- - `@tifan/pi-mermaid-open@0.2.0`
34
- - `@tifan/pi-preferred-thinking@1.0.1`
35
- - `@tifan/pi-recap@0.4.6`
31
+ - `@tifan/pi-inline-skills@1.0.6`
32
+ - `@tifan/pi-mermaid-open@0.2.1`
33
+ - `@tifan/pi-preferred-thinking@1.0.2`
34
+ - `@tifan/pi-recap@0.4.7`
36
35
  - `@tifan/pi-rename@0.6.0`
37
- - `pi-typesafe@0.8.0`
36
+ - `pi-typesafe@0.8.1`
38
37
  - `pi-multi-account@1.23.2`
39
38
  - `pi-next-cue@1.0.7`
40
39
  - `pi-footer@0.5.1`
41
40
  - `pi-jev-auto-mode@0.5.0`
42
- - `pi-lens@4.2.1`
43
- - `pi-web-access@0.27.0`
41
+ - `pi-lens@4.3.0`
42
+ - `pi-web-access@0.34.0`
44
43
  - `remote-pi@0.7.0`
45
44
 
46
45
  Pi loads their extensions and skills through `node_modules/` paths inside one package root. The upstream companions are pinned and bundled, not forked or renamed.
@@ -49,11 +48,11 @@ Pi loads their extensions and skills through `node_modules/` paths inside one pa
49
48
 
50
49
  `@herbertgao/pi-bark` sends localized Bark pushes when a user-facing Pi run fully settles or `@juicesharp/rpiv-ask-user-question` needs an answer. Notifications include emoji-labeled machine/path metadata and support the bundled official Pi badge through Bark's `icon` parameter. Configure it in `$PI_CODING_AGENT_DIR/bark.json` (normally `~/.pi/agent/bark.json`); see the [package README](../pi-bark/README.md). Without a valid endpoint it stays inactive.
51
50
 
52
- `@narumitw/pi-caffeinate@0.49.7` uses the host platform's sleep inhibitor during each Pi agent run. On macOS, `/caffeinate sleep` keeps the system awake while allowing the display to sleep; `/caffeinate display` also keeps the display awake. It releases the inhibitor when the run or session ends.
51
+ `@narumitw/pi-caffeinate@0.49.8` uses the host platform's sleep inhibitor during each Pi agent run. On macOS, `/caffeinate sleep` keeps the system awake while allowing the display to sleep; `/caffeinate display` also keeps the display awake. It releases the inhibitor when the run or session ends.
53
52
 
54
- `pi-jev-auto-mode@0.5.0` adds fail-closed Jev safety gates for shell commands and file changes. `pi-typesafe@0.8.0` adds the `/typesafe` command and `typesafe_evaluate` tool for explicit structured decisions; both use the TypeSafe API after login.
53
+ `pi-jev-auto-mode@0.5.0` adds fail-closed Jev safety gates for shell commands and file changes. `pi-typesafe@0.8.1` adds the `/typesafe` command and `typesafe_evaluate` tool for explicit structured decisions; both use the TypeSafe API after login.
55
54
 
56
- `@herbertgao/resume-from@0.2.0` keeps Claude Code sessions associated with their original repository when the active transcript later moves into a nested cwd. `@herbertgao/sol-pi@0.1.0` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.2.1` expands language routing and bounds retained diagnostic facts across multi-root sessions. `pi-web-access@0.27.0` adds configurable fetch deadlines and answer models plus isolated GitHub clone runtimes. Preferred Thinking 1.0.1 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
55
+ `@herbertgao/resume-from@0.2.0` keeps Claude Code sessions associated with their original repository when the active transcript later moves into a nested cwd. `@herbertgao/sol-pi@0.1.0` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.3.0` expands language routing and bounds retained diagnostic facts across multi-root sessions. `pi-web-access@0.34.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. `pi-antigravity@0.8.1` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
57
56
 
58
57
  `pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
59
58
 
@@ -86,7 +86,7 @@ THE SOFTWARE.
86
86
 
87
87
  ## `pi-antigravity`
88
88
 
89
- The aggregate bundles the MIT-licensed [`pi-antigravity`](https://github.com/Rahularya01/pi-antigravity) package version 0.7.2 under its original attribution:
89
+ The aggregate bundles the MIT-licensed [`pi-antigravity`](https://github.com/Rahularya01/pi-antigravity) package version 0.8.1 under its original attribution:
90
90
 
91
91
  MIT License
92
92
 
@@ -98,18 +98,30 @@ export default function (pi: ExtensionAPI): void {
98
98
  return parts.length ? `Working... (${parts.join(" · ")})` : "";
99
99
  }
100
100
 
101
+ function workingUiAvailable(): boolean {
102
+ try {
103
+ return activeCtx?.hasUI === true;
104
+ } catch {
105
+ // A stale ctx after session replacement/reload throws from its getter; stop driving the footer.
106
+ turnActive = false;
107
+ activeCtx = null;
108
+ stopRefreshLoop();
109
+ return false;
110
+ }
111
+ }
112
+
101
113
  function restoreDefaultWorkingMessage(): void {
102
114
  lastMessage = null;
103
- if (!activeCtx?.hasUI) return;
115
+ if (!workingUiAvailable()) return;
104
116
  try {
105
- activeCtx.ui.setWorkingMessage();
117
+ activeCtx?.ui.setWorkingMessage();
106
118
  } catch {
107
119
  // Noop when the TUI is unavailable.
108
120
  }
109
121
  }
110
122
 
111
123
  function syncWorkingMessage(force = false): void {
112
- if (!activeCtx?.hasUI) return;
124
+ if (!workingUiAvailable()) return;
113
125
  const next = buildWorkingMessage();
114
126
  if (!next) {
115
127
  if (force) restoreDefaultWorkingMessage();
@@ -118,7 +130,7 @@ export default function (pi: ExtensionAPI): void {
118
130
  if (!force && next === lastMessage) return;
119
131
  lastMessage = next;
120
132
  try {
121
- activeCtx.ui.setWorkingMessage(next);
133
+ activeCtx?.ui.setWorkingMessage(next);
122
134
  } catch {
123
135
  // Noop when the TUI is unavailable.
124
136
  }
@@ -130,9 +142,12 @@ export default function (pi: ExtensionAPI): void {
130
142
  refreshTimer = null;
131
143
  try {
132
144
  syncWorkingMessage();
133
- } finally {
134
- scheduleRefreshTick();
145
+ } catch {
146
+ // An exception here would become an uncaughtException and kill Pi; stop the decorative refresh.
147
+ turnActive = false;
148
+ return;
135
149
  }
150
+ scheduleRefreshTick();
136
151
  }, REFRESH_INTERVAL_MS);
137
152
  refreshTimer.unref?.();
138
153
  }
@@ -216,10 +216,21 @@ export default function (
216
216
  });
217
217
 
218
218
  pi.on("session_start", async (_event, ctx) => {
219
- // 延迟到 session_start 注册 write override:加载阶段 getAllTools 不可用且其他扩展
220
- // 尚未注册工具,无法检测外部 write 所有者(如 pi-spark),直接注册会与对方撞名。
221
- // session_start 时所有扩展已加载完毕,installWriteOverride 内部会检测并让位。
222
- installWriteOverride(pi, writeExecutionMetadata);
219
+ // Confirm write ownership one tick after every extension's session_start has run:
220
+ // others register tools in their own session_start, and registering first would
221
+ // silently drop their write (first registration wins).
222
+ setTimeout(() => {
223
+ installWriteOverride(pi, writeExecutionMetadata, (owner) => {
224
+ try {
225
+ ctx.ui?.notify?.(
226
+ `ccstyle: write is owned by ${owner.path || owner.source}; rich diff yields`,
227
+ "warning",
228
+ );
229
+ } catch {
230
+ // ctx may be stale by the next tick; the notice is decorative.
231
+ }
232
+ });
233
+ }, 0);
223
234
  const hooks = ensureTuiInstallation(ctx);
224
235
  // 鼠标交互独立于渲染层:fullscreen 渲染层让位(hooks undefined)但
225
236
  // 工具点击/回到底部适配仍需安装;保持在渲染层安装之后以维持原顺序。
@@ -59,6 +59,8 @@ export function renderRichToolResult(
59
59
  );
60
60
  }
61
61
  if (toolName !== "write") return undefined;
62
+ // Yield point: when another extension owns write there is no execution metadata; fall back to the plain result row.
63
+ if (!ownsWriteTool()) return undefined;
62
64
 
63
65
  const metadata = writeMetadata.get(context?.toolCallId);
64
66
  if (!metadata) {
@@ -83,24 +85,58 @@ export function renderRichToolResult(
83
85
  );
84
86
  }
85
87
 
86
- function hasExternalWriteOwner(pi: ExtensionAPI): boolean {
88
+ /** Extension currently owning write, reported in the conflict notice. */
89
+ export type ExternalWriteOwner = { source: string; path: string };
90
+
91
+ const WRITE_OWNERSHIP_SLOT = Symbol.for("pi.ccstyle.write-ownership");
92
+ /** Parameters object of the write override registered by this module; identifies our own tool in getAllTools(). */
93
+ let ownWriteParameters: unknown;
94
+
95
+ function writeOwnership(): { owned?: boolean } {
96
+ const slots = globalThis as any;
97
+ slots[WRITE_OWNERSHIP_SLOT] ??= {};
98
+ return slots[WRITE_OWNERSHIP_SLOT];
99
+ }
100
+
101
+ /** Whether this package executes write; unknown ownership keeps the existing rich-diff behavior. */
102
+ export function ownsWriteTool(): boolean {
103
+ return writeOwnership().owned !== false;
104
+ }
105
+
106
+ function findExternalWriteOwner(pi: ExtensionAPI): ExternalWriteOwner | undefined {
87
107
  try {
88
- const tools = pi.getAllTools();
89
- const write = tools.find((tool: any) => tool?.name === "write") as any;
90
- const source = write?.sourceInfo?.source;
91
- return Boolean(write && typeof source === "string" && source !== "builtin");
108
+ const tools = pi.getAllTools() as any[];
109
+ const write = tools?.find((tool: any) => tool?.name === "write") as any;
110
+ const sourceInfo = write?.sourceInfo;
111
+ const source = sourceInfo?.source;
112
+ if (!write || typeof source !== "string" || source === "builtin") return undefined;
113
+ // Our own override from an earlier session_start in this runtime.
114
+ if (ownWriteParameters !== undefined && write.parameters === ownWriteParameters)
115
+ return undefined;
116
+ return { source, path: typeof sourceInfo?.path === "string" ? sourceInfo.path : "" };
92
117
  } catch {
93
118
  // getAllTools is unavailable before the extension runtime is bound.
94
- return false;
119
+ return undefined;
95
120
  }
96
121
  }
97
122
 
98
123
  export function installWriteOverride(
99
124
  pi: ExtensionAPI,
100
125
  store = new WriteExecutionMetadataStore(),
126
+ /** Called when another extension already owns write. */
127
+ onExternalOwner?: (owner: ExternalWriteOwner) => void,
101
128
  ): WriteExecutionMetadataStore {
102
- if (typeof (pi as any).registerTool !== "function" || hasExternalWriteOwner(pi)) return store;
129
+ if (typeof (pi as any).registerTool !== "function") return store;
130
+ const state = writeOwnership();
131
+ const external = findExternalWriteOwner(pi);
132
+ if (external) {
133
+ state.owned = false;
134
+ onExternalOwner?.(external);
135
+ return store;
136
+ }
137
+ state.owned = true;
103
138
  const nativeWrite = createWriteToolDefinition(process.cwd()) as any;
139
+ ownWriteParameters = nativeWrite.parameters;
104
140
  pi.registerTool({
105
141
  ...nativeWrite,
106
142
  async execute(
@@ -8,7 +8,12 @@ import {
8
8
  } from "@earendil-works/pi-tui";
9
9
  import { TOOL_LOADING_INTERVAL_MS, toolLoadingIcon } from "../../utils/tool-loading-icon.ts";
10
10
  import { sanitizeToolResultText } from "../../utils/tool-result-sanitize.ts";
11
- import { fitToolCallSummary, pathSummary, type ToolCallSummary } from "./result.ts";
11
+ import {
12
+ fitToolCallSummary,
13
+ pathSummary,
14
+ toolViewportWidth,
15
+ type ToolCallSummary,
16
+ } from "./result.ts";
12
17
  import { isToolTuiFullscreen, showMoreHintText } from "../show-more-hint.ts";
13
18
 
14
19
  const PATCH_KEY = Symbol.for("pi.ccstyle.tool-grouping-patch");
@@ -444,7 +449,7 @@ export class ToolGroupComponent extends Container {
444
449
  "",
445
450
  truncateToWidth(
446
451
  ` ${fg(overallColor, "●")} ${label}: ${countText}${nameList} ${hint}`,
447
- width,
452
+ toolViewportWidth(width),
448
453
  "…",
449
454
  ),
450
455
  ];
@@ -566,8 +566,8 @@ export type ToolCallSummary = {
566
566
  };
567
567
 
568
568
  function pathApi(value: string) {
569
- if (win32.isAbsolute(value)) return win32;
570
569
  if (posix.isAbsolute(value)) return posix;
570
+ if (win32.isAbsolute(value)) return win32;
571
571
  return undefined;
572
572
  }
573
573
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-cc-extensions",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "license": "MIT",
5
5
  "description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
6
6
  "type": "module",
@@ -70,7 +70,7 @@
70
70
  "x-upstream": {
71
71
  "package": "pi-cc-extensions",
72
72
  "version": "0.8.71",
73
- "reviewedVersion": "0.9.5",
73
+ "reviewedVersion": "0.9.9",
74
74
  "repository": "https://github.com/minuque/pi-cc-extensions",
75
75
  "commit": "e43e0041b59f5d7f03be9b9d103a5f9e954e4c11"
76
76
  }
@@ -1,6 +1,7 @@
1
1
  # pi-antigravity
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/pi-antigravity?logo=npm)](https://www.npmjs.com/package/pi-antigravity)
4
+ [![npm downloads](https://img.shields.io/npm/dm/pi-antigravity?logo=npm)](https://www.npmjs.com/package/pi-antigravity)
4
5
  [![license](https://img.shields.io/npm/l/pi-antigravity)](LICENSE)
5
6
  [![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?logo=github)](https://github.com/sponsors/Rahularya01)
6
7
 
@@ -44,6 +45,8 @@ Or install the latest repository version:
44
45
  pi install git:github.com/Rahularya01/pi-antigravity
45
46
  ```
46
47
 
48
+ On Oh My Pi, install the same package with `omp plugin install npm:pi-antigravity`.
49
+
47
50
  Restart Pi (or run `/reload`) after installation. To update the npm package later, use `pi update npm:pi-antigravity`.
48
51
 
49
52
  ## Quick start
@@ -58,6 +61,17 @@ Restart Pi (or run `/reload`) after installation. To update the npm package late
58
61
 
59
62
  4. Start working. If a request fails, run `/antigravity.doctor` for sanitized diagnostics.
60
63
 
64
+ To link another account without losing the existing one, run `/login antigravity`
65
+ again and complete Google sign-in with the other account. Manage linked accounts with:
66
+
67
+ ```text
68
+ /antigravity.accounts
69
+ /antigravity.accounts switch <index|email>
70
+ /antigravity.accounts remove <index|email>
71
+ ```
72
+
73
+ On a hard quota wall (HTTP 429 with a reset hint), the provider automatically tries the next linked account.
74
+
61
75
  ## Authentication and credential safety
62
76
 
63
77
  The provider uses the OAuth 2.0 Authorization Code flow with PKCE, so credentials are only ever exchanged with Google — never typed into Pi.
@@ -65,8 +79,9 @@ The provider uses the OAuth 2.0 Authorization Code flow with PKCE, so credential
65
79
  1. `/login antigravity` opens Google sign-in and starts a temporary callback listener at `http://localhost:51121/oauth-callback`.
66
80
  2. After you approve access, Pi exchanges the callback code for tokens and stores the provider credentials in Pi's auth store (normally `~/.pi/agent/auth.json`).
67
81
  3. Pi refreshes access tokens automatically when they expire — you shouldn't need to sign in again unless a token is revoked.
82
+ 4. Successful logins and token rotations are also kept in `~/.pi/agent/antigravity-accounts.json` with owner-only permissions so linked accounts can be switched without re-authenticating.
68
83
 
69
- The callback listener binds only to a loopback host, so it isn't reachable from outside your machine. The auth file it writes to contains sensitive access and refresh tokens: **do not commit it, paste it into issues, or share its contents.**
84
+ The callback listener binds only to a loopback host, so it isn't reachable from outside your machine. The auth and account files it writes to contain sensitive access and refresh tokens: **do not commit them, paste them into issues, or share their contents.**
70
85
 
71
86
  Signing in requests these Google OAuth scopes:
72
87
 
@@ -90,15 +105,19 @@ Review these permissions before approving access. If your credentials expire or
90
105
  | `/model antigravity/<model-id>` | Choose a registered Antigravity model. |
91
106
  | `/antigravity.usage` | Show the server-reported shared quota groups and reset times. |
92
107
  | `/antigravity.models` | List available runtime models, remaining shared-pool quota, and capabilities. |
108
+ | `/antigravity.accounts` | List linked accounts; use `switch` or `remove` with an index or email to manage them. |
93
109
  | `/antigravity.models all` | Include tab/chat models normally hidden from the model list. |
94
110
  | `/antigravity.refresh` | Force refresh the dynamic model catalog from Antigravity. |
95
111
  | `/antigravity.doctor` | Show sanitized provider diagnostics, including the endpoint, status, and resolved runtime model. |
96
112
  | `/antigravity.image <prompt>` | Generate an image via Antigravity and save it under `.pi/generated-images/`. Optional `--ratio 16:9`, `--model`, `--path`. |
113
+ | `/antigravity.search <query>` | Search the web using Google Search Grounding via Antigravity. Optional `--thinking`, `--url <url>`. |
97
114
 
98
115
  Model availability, entitlement, quota groups, and resets are returned by the service and can differ by account. The quota percentage shown for a model can represent a shared pool, not a private per-model allowance.
99
116
 
100
117
  The extension also registers a `generate_image` tool the model can call. Images are written inside the project directory (default `.pi/generated-images/`). Image models such as `gemini-3-pro-image` are account-dependent; `/antigravity.image` falls back to other advertised Gemini image IDs on 404.
101
118
 
119
+ It also registers a `google_search` tool allowing models to perform real-time web search and URL analysis using Google Search Grounding over Cloud Code Assist (powered by `gemini-3-flash` with dynamic fallback). It supports optional lead agent directives (`instruction`), specific target URLs (`urls`), and deep reasoning (`thinking: true`).
120
+
102
121
  ## Models and routing
103
122
 
104
123
  After you sign in, the provider refreshes its catalog from Antigravity (`fetchAvailableModels`) and groups runtime thinking variants into public Pi model IDs. Newly enabled models — for example a new Gemini Flash generation — become selectable after that refresh without waiting for an extension release. A last-known-good cache is kept for offline/cold start; the static table below is only the conservative fallback and a routing reference.
@@ -154,13 +173,13 @@ All primary environment variables start with `ANTIGRAVITY_`. The legacy `NOAGY_`
154
173
  | `ANTIGRAVITY_CLIENT_ID` | Use a custom Google OAuth client ID. |
155
174
  | `ANTIGRAVITY_CLIENT_SECRET` | Use a custom Google OAuth client secret. Keep it out of source control and shell history. |
156
175
  | `ANTIGRAVITY_NO_KEEPALIVE` | Set to `1` to skip the keep-alive connection pool. |
157
- | `ANTIGRAVITY_NO_PREWARM` | Set to `1` to skip the TLS pre-warm request made when the extension loads. |
176
+ | `ANTIGRAVITY_NO_PREWARM` | Set to `1` to skip the TLS pre-warm request made on the first Antigravity request. |
158
177
 
159
178
  By default, the provider tries `https://daily-cloudcode-pa.googleapis.com`, then the sandbox host, then `https://cloudcode-pa.googleapis.com`. Prefer the built-in OAuth client unless you have a reason to use your own credentials.
160
179
 
161
180
  ### Latency
162
181
 
163
- Provider requests reuse a keep-alive connection pool when the runtime supports it, so consecutive turns do not repeat the DNS, TCP, and TLS handshake. When `HTTP_PROXY`, `HTTPS_PROXY`, or `ALL_PROXY` is set, that pool is skipped so Pi's proxy-aware dispatcher is used instead. The connection is also opened when the extension loads so the first message of a session skips the handshake too. For the lowest time-to-first-token, pick a fast runtime: `gemini-3.8-flash` with reasoning off routes to `gemini-3.8-flash-low` at thinking level `LOW`. Setting `ANTIGRAVITY_PROJECT_ID` also removes the project-discovery round-trip when credentials do not already carry a project ID.
182
+ Provider requests reuse a keep-alive connection pool when the runtime supports it, so consecutive turns do not repeat the DNS, TCP, and TLS handshake. When `HTTP_PROXY`, `HTTPS_PROXY`, or `ALL_PROXY` is set, that pool is skipped so Pi's proxy-aware dispatcher is used instead. The connection is opened on the first Antigravity request rather than at Pi startup, so other extensions are not stalled by an unauthenticated handshake. For the lowest time-to-first-token, pick a fast runtime: `gemini-3.8-flash` with reasoning off routes to `gemini-3.8-flash-low` at thinking level `LOW`. Setting `ANTIGRAVITY_PROJECT_ID` also removes the project-discovery round-trip when credentials do not already carry a project ID.
164
183
 
165
184
  ## Troubleshooting
166
185
 
@@ -173,16 +192,20 @@ Provider requests reuse a keep-alive connection pool when the runtime supports i
173
192
  - **Claude/GPT tool-call schema error:** Upgrade to the latest package release. The provider adapts Pi's JSON Schema tool definitions for the Cloud Code Assist custom-tool bridge.
174
193
  - **Quota or rate limit:** Run `/antigravity.usage`. A `429` response usually indicates quota or rate limiting; changing models may still draw from the same shared pool.
175
194
  - **Need a safe diagnostic:** `/antigravity.doctor` redacts recognized secrets from its error output. Still review output before sharing it publicly.
195
+ - **Oh My Pi says `registerApiProvider` is not exported:** Upgrade to 0.8.1 or later. Older builds statically import a Pi compat export that Oh My Pi's bundled runtime does not provide. The provider still registers through `pi.registerProvider` on that host.
176
196
 
177
197
  ## Development
178
198
 
179
- This repo uses [Bun](https://bun.sh) for install, scripts, and CI. The published extension itself runs on Node (Pi's CLI).
199
+ This repo uses [Yarn 4](https://yarnpkg.com/) via Corepack for install, scripts, and CI. The published extension itself runs on Node (Pi's CLI).
180
200
 
181
201
  ```bash
182
- bun install
183
- bun run check
202
+ corepack enable
203
+ yarn install
204
+ yarn check
184
205
  ```
185
206
 
207
+ Installs are hardened against common supply-chain attacks: lifecycle scripts are off, lockfile checksums must match the npm registry, and package versions younger than three days are rejected. Do not add a second registry or enable `enableScripts` without a review.
208
+
186
209
  The package declares its Pi extension in `package.json` under `pi.extensions`. See the [Pi package documentation](https://pi.dev/docs/latest/packages) for package installation, manifest, and gallery conventions.
187
210
 
188
211
  ## Support the project
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-antigravity",
3
- "version": "0.7.2",
3
+ "version": "0.8.1",
4
4
  "description": "Personal Antigravity / Cloud Code Assist provider for Pi Coding Agent",
5
5
  "author": "Rahul Arya",
6
6
  "license": "MIT",
@@ -28,18 +28,22 @@
28
28
  "src",
29
29
  "tsconfig.json"
30
30
  ],
31
- "packageManager": "bun@1.4.0",
31
+ "packageManager": "yarn@4.18.0+sha512.fcb8716fe7cd0eece141ffc18b92193a9df9204c1ba83189c288835223fc0bbe64af473bab0d5e9927a7daeb5caf2bb07eb2787cc9338ca040ea125f2a1f2f7e",
32
+ "engines": {
33
+ "node": ">=22.15.0"
34
+ },
32
35
  "scripts": {
33
36
  "typecheck": "tsc --noEmit",
34
37
  "lint": "eslint src",
35
38
  "lint:fix": "eslint src --fix",
36
39
  "format": "prettier --write .",
37
40
  "format:check": "prettier --check .",
38
- "security-check": "bun scripts/security-check.ts",
39
- "test": "bun scripts/test-model-routing.ts && bun scripts/test-model-discovery.ts && bun scripts/test-usage-formatter.ts && bun scripts/test-stream-sse.ts && bun scripts/test-stream-header-deadline.ts && bun scripts/test-http-proxy.ts && bun scripts/test-image-gen.ts",
40
- "smoke:tools": "bun scripts/smoke-tool-schema.ts",
41
- "smoke:models": "bun scripts/smoke-all-models.mjs",
42
- "check": "bun run typecheck && bun run lint && bun run format:check && bun run security-check && bun run test"
41
+ "security-check": "node scripts/run-ts.mjs scripts/security-check.ts",
42
+ "test": "node scripts/run-ts.mjs scripts/test-model-routing.ts && node scripts/run-ts.mjs scripts/test-model-discovery.ts && node scripts/run-ts.mjs scripts/test-usage-formatter.ts && node scripts/run-ts.mjs scripts/test-stream-sse.ts && node scripts/run-ts.mjs scripts/test-stream-header-deadline.ts && node scripts/run-ts.mjs scripts/test-http-proxy.ts && node scripts/run-ts.mjs scripts/test-image-gen.ts && node scripts/run-ts.mjs scripts/test-transcript-context.ts && node scripts/run-ts.mjs scripts/test-accounts.ts && node scripts/run-ts.mjs scripts/test-search.ts",
43
+ "smoke:tools": "node scripts/run-ts.mjs scripts/smoke-tool-schema.ts",
44
+ "smoke:models": "node scripts/run-ts.mjs scripts/smoke-all-models.mjs",
45
+ "audit": "yarn npm audit --environment production --recursive && yarn npm audit --severity high --all --recursive",
46
+ "check": "yarn typecheck && yarn lint && yarn format:check && yarn security-check && yarn test && yarn audit"
43
47
  },
44
48
  "pi": {
45
49
  "extensions": [
@@ -52,6 +56,7 @@
52
56
  },
53
57
  "devDependencies": {
54
58
  "@earendil-works/pi-ai": "^0.84.2",
59
+ "@earendil-works/pi-coding-agent": "^0.84.2",
55
60
  "@eslint/js": "^10.0.1",
56
61
  "@types/node": "^26.1.1",
57
62
  "eslint": "^10.7.0",