@herbertgao/pi-extensions 2026.11.17 → 2026.11.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 (159) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -3
  3. package/THIRD_PARTY_NOTICES.md +2 -23
  4. package/node_modules/@estebanforge/pi-antigravity-bridge/CHANGELOG.md +956 -0
  5. package/node_modules/{pi-antigravity → @estebanforge/pi-antigravity-bridge}/LICENSE +1 -1
  6. package/node_modules/@estebanforge/pi-antigravity-bridge/README.md +240 -0
  7. package/node_modules/@estebanforge/pi-antigravity-bridge/extensions/index.ts +2117 -0
  8. package/node_modules/@estebanforge/pi-antigravity-bridge/package.json +61 -0
  9. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/connection.ts +644 -0
  10. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/driver.ts +1043 -0
  11. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/events.ts +323 -0
  12. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/home.ts +145 -0
  13. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/jsonrpc.ts +243 -0
  14. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/setup.ts +107 -0
  15. package/node_modules/@estebanforge/pi-antigravity-bridge/src/acp/usage-estimate.ts +61 -0
  16. package/node_modules/@estebanforge/pi-antigravity-bridge/src/agents.ts +64 -0
  17. package/node_modules/@estebanforge/pi-antigravity-bridge/src/agy-install.ts +93 -0
  18. package/node_modules/@estebanforge/pi-antigravity-bridge/src/agy-paths.ts +30 -0
  19. package/node_modules/@estebanforge/pi-antigravity-bridge/src/agy-setup.ts +81 -0
  20. package/node_modules/@estebanforge/pi-antigravity-bridge/src/agy-version.ts +289 -0
  21. package/node_modules/@estebanforge/pi-antigravity-bridge/src/approval-detect.ts +161 -0
  22. package/node_modules/@estebanforge/pi-antigravity-bridge/src/approval-gate.ts +233 -0
  23. package/node_modules/@estebanforge/pi-antigravity-bridge/src/approval-hook.ts +325 -0
  24. package/node_modules/@estebanforge/pi-antigravity-bridge/src/artifacts-ui.ts +88 -0
  25. package/node_modules/@estebanforge/pi-antigravity-bridge/src/artifacts.ts +144 -0
  26. package/node_modules/@estebanforge/pi-antigravity-bridge/src/ask-tool.ts +1221 -0
  27. package/node_modules/@estebanforge/pi-antigravity-bridge/src/background-watch.ts +225 -0
  28. package/node_modules/@estebanforge/pi-antigravity-bridge/src/bridge-catalog.ts +197 -0
  29. package/node_modules/@estebanforge/pi-antigravity-bridge/src/config.ts +523 -0
  30. package/node_modules/@estebanforge/pi-antigravity-bridge/src/daily-log.ts +196 -0
  31. package/node_modules/@estebanforge/pi-antigravity-bridge/src/dialog-lock.ts +48 -0
  32. package/node_modules/@estebanforge/pi-antigravity-bridge/src/diff-render.ts +207 -0
  33. package/node_modules/@estebanforge/pi-antigravity-bridge/src/driver-types.ts +168 -0
  34. package/node_modules/@estebanforge/pi-antigravity-bridge/src/driver.ts +907 -0
  35. package/node_modules/@estebanforge/pi-antigravity-bridge/src/engine-picker.ts +160 -0
  36. package/node_modules/@estebanforge/pi-antigravity-bridge/src/frame-guard.ts +38 -0
  37. package/node_modules/@estebanforge/pi-antigravity-bridge/src/handoff-toast.ts +21 -0
  38. package/node_modules/@estebanforge/pi-antigravity-bridge/src/mcp-registration.ts +376 -0
  39. package/node_modules/@estebanforge/pi-antigravity-bridge/src/mcp-server.ts +618 -0
  40. package/node_modules/@estebanforge/pi-antigravity-bridge/src/models.ts +404 -0
  41. package/node_modules/@estebanforge/pi-antigravity-bridge/src/native-tools.ts +104 -0
  42. package/node_modules/@estebanforge/pi-antigravity-bridge/src/parked-turn.ts +125 -0
  43. package/node_modules/@estebanforge/pi-antigravity-bridge/src/patch-cleanup.ts +523 -0
  44. package/node_modules/@estebanforge/pi-antigravity-bridge/src/poll-fold.ts +55 -0
  45. package/node_modules/@estebanforge/pi-antigravity-bridge/src/prompt-images.ts +92 -0
  46. package/node_modules/@estebanforge/pi-antigravity-bridge/src/provider.ts +2214 -0
  47. package/node_modules/@estebanforge/pi-antigravity-bridge/src/queued-messages.ts +152 -0
  48. package/node_modules/@estebanforge/pi-antigravity-bridge/src/quota-notice.ts +40 -0
  49. package/node_modules/@estebanforge/pi-antigravity-bridge/src/redact.ts +27 -0
  50. package/node_modules/@estebanforge/pi-antigravity-bridge/src/sessions.ts +197 -0
  51. package/node_modules/@estebanforge/pi-antigravity-bridge/src/skills.ts +207 -0
  52. package/node_modules/@estebanforge/pi-antigravity-bridge/src/stream-events.ts +161 -0
  53. package/node_modules/@estebanforge/pi-antigravity-bridge/src/stream-sanitizer.ts +180 -0
  54. package/node_modules/@estebanforge/pi-antigravity-bridge/src/subagent-roster.ts +245 -0
  55. package/node_modules/@estebanforge/pi-antigravity-bridge/src/sysprompt-agent.ts +130 -0
  56. package/node_modules/@estebanforge/pi-antigravity-bridge/src/tasks-ui.ts +90 -0
  57. package/node_modules/@estebanforge/pi-antigravity-bridge/src/tasks.ts +174 -0
  58. package/node_modules/@estebanforge/pi-antigravity-bridge/src/usage.ts +174 -0
  59. package/node_modules/@estebanforge/pi-antigravity-bridge/src/web-tools.ts +320 -0
  60. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +12 -0
  61. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +1 -1
  62. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +3 -1
  63. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +7 -0
  64. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/agent-badge.ts +244 -0
  65. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +1 -1
  66. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +10 -3
  67. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +18 -0
  68. package/node_modules/@herbertgao/pi-cc-extensions/package.json +1 -1
  69. package/node_modules/@herbertgao/pi-inline-skill-commands/README.md +18 -0
  70. package/node_modules/@herbertgao/pi-inline-skill-commands/package.json +1 -1
  71. package/node_modules/@herbertgao/pi-inline-skill-commands/src/index.ts +80 -0
  72. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +320 -102
  73. package/node_modules/@herbertgao/pi-subagents/SECURITY.md +2 -2
  74. package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +240 -30
  75. package/node_modules/@herbertgao/pi-subagents/docs/translations.md +63 -0
  76. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +1 -1
  77. package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
  78. package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +2 -0
  79. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +89 -6
  80. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +6 -2
  81. package/node_modules/@herbertgao/pi-subagents/src/agent-types.ts +27 -13
  82. package/node_modules/@herbertgao/pi-subagents/src/cache-retention.ts +39 -0
  83. package/node_modules/@herbertgao/pi-subagents/src/completion-outbox.ts +5 -0
  84. package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +217 -41
  85. package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +7 -0
  86. package/node_modules/@herbertgao/pi-subagents/src/group-join.ts +9 -0
  87. package/node_modules/@herbertgao/pi-subagents/src/index.ts +126 -93
  88. package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +3 -2
  89. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +21 -0
  90. package/node_modules/@herbertgao/pi-subagents/src/subagent-info.ts +115 -0
  91. package/node_modules/@herbertgao/pi-subagents/src/types.ts +11 -7
  92. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +2 -3
  93. package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +1 -1
  94. package/node_modules/@herbertgao/pi-subagents/src/workflow/meta.ts +2 -2
  95. package/node_modules/@herbertgao/pi-subagents/src/workflow-info.ts +184 -0
  96. package/node_modules/pi-commandcode-provider/CHANGELOG.md +10 -0
  97. package/node_modules/pi-commandcode-provider/README.md +3 -2
  98. package/node_modules/pi-commandcode-provider/index.ts +120 -13
  99. package/node_modules/pi-commandcode-provider/package.json +4 -3
  100. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +11 -2
  101. package/node_modules/pi-commandcode-provider/src/pricing.ts +17 -1
  102. package/node_modules/pi-commandcode-provider/src/quota-command.ts +3 -2
  103. package/node_modules/pi-commandcode-provider/src/zdr.ts +163 -0
  104. package/package.json +12 -15
  105. package/node_modules/pi-antigravity/README.md +0 -298
  106. package/node_modules/pi-antigravity/docs/reader-guarantees.md +0 -35
  107. package/node_modules/pi-antigravity/package.json +0 -87
  108. package/node_modules/pi-antigravity/src/auth/accounts.ts +0 -327
  109. package/node_modules/pi-antigravity/src/auth/index.ts +0 -23
  110. package/node_modules/pi-antigravity/src/auth/oauth.ts +0 -445
  111. package/node_modules/pi-antigravity/src/client/client.ts +0 -602
  112. package/node_modules/pi-antigravity/src/client/enterprise.ts +0 -150
  113. package/node_modules/pi-antigravity/src/client/index.ts +0 -2
  114. package/node_modules/pi-antigravity/src/diagnostics/diagnostics.ts +0 -104
  115. package/node_modules/pi-antigravity/src/diagnostics/index.ts +0 -1
  116. package/node_modules/pi-antigravity/src/features/generate-image.ts +0 -132
  117. package/node_modules/pi-antigravity/src/features/google-search.ts +0 -72
  118. package/node_modules/pi-antigravity/src/features/read-url-content.ts +0 -124
  119. package/node_modules/pi-antigravity/src/image/image.ts +0 -427
  120. package/node_modules/pi-antigravity/src/image/index.ts +0 -1
  121. package/node_modules/pi-antigravity/src/image/native.ts +0 -69
  122. package/node_modules/pi-antigravity/src/index.ts +0 -547
  123. package/node_modules/pi-antigravity/src/models/discovery.ts +0 -176
  124. package/node_modules/pi-antigravity/src/models/grouping.ts +0 -487
  125. package/node_modules/pi-antigravity/src/models/index.ts +0 -3
  126. package/node_modules/pi-antigravity/src/models/models.ts +0 -647
  127. package/node_modules/pi-antigravity/src/search/index.ts +0 -1
  128. package/node_modules/pi-antigravity/src/search/search.ts +0 -967
  129. package/node_modules/pi-antigravity/src/stream/index.ts +0 -1
  130. package/node_modules/pi-antigravity/src/stream/stream.ts +0 -1961
  131. package/node_modules/pi-antigravity/src/types/enums.ts +0 -52
  132. package/node_modules/pi-antigravity/src/types/index.ts +0 -2
  133. package/node_modules/pi-antigravity/src/types/types.ts +0 -329
  134. package/node_modules/pi-antigravity/src/usage/index.ts +0 -1
  135. package/node_modules/pi-antigravity/src/usage/usage.ts +0 -437
  136. package/node_modules/pi-antigravity/src/utils/address.ts +0 -180
  137. package/node_modules/pi-antigravity/src/utils/credits.ts +0 -149
  138. package/node_modules/pi-antigravity/src/utils/html.ts +0 -31
  139. package/node_modules/pi-antigravity/src/utils/http.ts +0 -96
  140. package/node_modules/pi-antigravity/src/utils/index.ts +0 -5
  141. package/node_modules/pi-antigravity/src/utils/security.ts +0 -278
  142. package/node_modules/pi-antigravity/src/utils/text.ts +0 -66
  143. package/node_modules/pi-antigravity/src/utils/util.ts +0 -217
  144. package/node_modules/pi-antigravity/src/web-fetch/document.ts +0 -83
  145. package/node_modules/pi-antigravity/src/web-fetch/fences.ts +0 -24
  146. package/node_modules/pi-antigravity/src/web-fetch/header.ts +0 -97
  147. package/node_modules/pi-antigravity/src/web-fetch/index.ts +0 -3
  148. package/node_modules/pi-antigravity/src/web-fetch/inspect.ts +0 -328
  149. package/node_modules/pi-antigravity/src/web-fetch/limits.ts +0 -4
  150. package/node_modules/pi-antigravity/src/web-fetch/markdown.ts +0 -744
  151. package/node_modules/pi-antigravity/src/web-fetch/mdn.ts +0 -164
  152. package/node_modules/pi-antigravity/src/web-fetch/media.ts +0 -11
  153. package/node_modules/pi-antigravity/src/web-fetch/metadata.ts +0 -9
  154. package/node_modules/pi-antigravity/src/web-fetch/representation.ts +0 -93
  155. package/node_modules/pi-antigravity/src/web-fetch/save.ts +0 -71
  156. package/node_modules/pi-antigravity/src/web-fetch/sites.ts +0 -138
  157. package/node_modules/pi-antigravity/src/web-fetch/vendor.d.ts +0 -9
  158. package/node_modules/pi-antigravity/src/web-fetch/web-fetch.ts +0 -957
  159. package/node_modules/pi-antigravity/tsconfig.json +0 -21
@@ -20,7 +20,7 @@ export interface TemporaryPricing {
20
20
  }
21
21
 
22
22
  export const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits"
23
- export const PRICING_LAST_VERIFIED = "2026-11-17"
23
+ export const PRICING_LAST_VERIFIED = "2026-11-20"
24
24
 
25
25
  export const ZERO_MODEL_COST: CommandCodeModelCost = {
26
26
  input: 0,
@@ -57,6 +57,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
57
57
  "inclusionai/ling-3.1-flash": { input: 0.3, output: 0.9, cacheRead: 0.06, cacheWrite: 0 },
58
58
  "mistral/mistral-large-4": { input: 1.36, output: 4.18, cacheRead: 0.14, cacheWrite: 0 },
59
59
  "tencent/hy3-paid": { input: 0.14, output: 0.58, cacheRead: 0.035, cacheWrite: 0 },
60
+ "tencent/hy4": { input: 0.834, output: 2.501, cacheRead: 0.042, cacheWrite: 0 },
60
61
  "tencent/hy4-flash": { input: 0.07, output: 0.281, cacheRead: 0.003, cacheWrite: 0 },
61
62
  "tencent/hy4-preview": { input: 0.834, output: 2.501, cacheRead: 0.042, cacheWrite: 0 },
62
63
  "moonshotai/Kimi-K3.1-Pro": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 0 },
@@ -265,6 +266,20 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
265
266
  },
266
267
 
267
268
  // OpenAI
269
+ "gpt-6.2-astra": {
270
+ input: 8,
271
+ output: 40,
272
+ cacheRead: 0.4,
273
+ cacheWrite: 10,
274
+ tiers: [{ inputTokensAbove: 272_000, input: 16, output: 60, cacheRead: 0.8, cacheWrite: 20 }],
275
+ },
276
+ "gpt-6.2-sol": {
277
+ input: 2,
278
+ output: 10,
279
+ cacheRead: 0.1,
280
+ cacheWrite: 2.5,
281
+ tiers: [{ inputTokensAbove: 272_000, input: 4, output: 15, cacheRead: 0.2, cacheWrite: 5 }],
282
+ },
268
283
  "gpt-6-astra": {
269
284
  input: 10,
270
285
  output: 50,
@@ -337,6 +352,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
337
352
  cacheRead: 0.15,
338
353
  cacheWrite: 0.08334,
339
354
  },
355
+ "google/gemini-4-neon": { input: 3, output: 15, cacheRead: 0.15, cacheWrite: 0 },
340
356
  "google/gemini-4-carbon": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 0 },
341
357
  "google/gemini-4-argon": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 0 },
342
358
  "google/gemini-3.8-flash": {
@@ -25,7 +25,8 @@ interface QuotaCommandApi {
25
25
 
26
26
  interface RegisterQuotaCommandOptions {
27
27
  apiBase: string
28
- headers?: Record<string, string>
28
+ /** A function is resolved per run so a header changed after startup (ZDR) is sent. */
29
+ headers?: Record<string, string> | (() => Record<string, string> | undefined)
29
30
  getConfiguredKey?: () => string | undefined
30
31
  fetchQuota?: typeof fetchCommandCodeQuota
31
32
  }
@@ -54,7 +55,7 @@ export function registerCommandCodeQuota(
54
55
  const result = await fetchQuota({
55
56
  apiKey,
56
57
  baseUrl: options.apiBase,
57
- extraHeaders: options.headers,
58
+ extraHeaders: typeof options.headers === "function" ? options.headers() : options.headers,
58
59
  })
59
60
  if (!result.ok) {
60
61
  ctx.ui.notify(redactValue(result.error.message), "error")
@@ -0,0 +1,163 @@
1
+ // Zero-data-retention opt-in, carried in settings.json for hosts where setting
2
+ // a process environment variable is inconvenient. Command Code documents the
3
+ // `x-cmd-zdr: 1` request header and the `CMD_ZDR=1` CLI environment variable.
4
+ import { randomUUID } from "node:crypto"
5
+ import { lstat, mkdir, readFile, realpath, rename, rm, writeFile } from "node:fs/promises"
6
+ import { dirname } from "node:path"
7
+
8
+ /** Top-level settings.json section owned by this provider. */
9
+ export const ZDR_SETTINGS_SECTION = "commandcode"
10
+ export const ZDR_SETTING_KEY = "enableZDR"
11
+
12
+ export type ZdrSource = "off" | "settings" | "env"
13
+ export type ZdrEnvVar = "CMD_ZDR" | "COMMANDCODE_ZDR"
14
+
15
+ export interface ZdrState {
16
+ enabled: boolean
17
+ source: ZdrSource
18
+ /** Environment variable that enabled ZDR, when `source` is `env`. */
19
+ envVar?: ZdrEnvVar
20
+ }
21
+
22
+ type Environment = Record<string, string | undefined>
23
+
24
+ function isRecord(value: unknown): value is Record<string, unknown> {
25
+ return typeof value === "object" && value !== null && !Array.isArray(value)
26
+ }
27
+
28
+ /**
29
+ * The host's own settings parser tolerates a leading UTF-8 BOM, so both the
30
+ * reader and the writer do too: a BOM must not silently drop a saved opt-in.
31
+ */
32
+ function stripBom(text: string): string {
33
+ return text.charCodeAt(0) === 0xfeff ? text.slice(1) : text
34
+ }
35
+
36
+ /** Only a literal `true` enables ZDR, so a typo cannot silently weaken privacy. */
37
+ export function readZdrSetting(settings: unknown): boolean {
38
+ if (!isRecord(settings)) return false
39
+ const section = settings[ZDR_SETTINGS_SECTION]
40
+ return isRecord(section) && section[ZDR_SETTING_KEY] === true
41
+ }
42
+
43
+ /** `CMD_ZDR` is the documented name; the legacy alias stays supported. */
44
+ export function zdrEnvVar(env: Environment = process.env): ZdrEnvVar | undefined {
45
+ if (env.CMD_ZDR === "1") return "CMD_ZDR"
46
+ if (env.COMMANDCODE_ZDR === "1") return "COMMANDCODE_ZDR"
47
+ return undefined
48
+ }
49
+
50
+ /** The environment wins so a shell export cannot be silently weakened by a settings file. */
51
+ export function resolveZdr(settings: unknown, env: Environment = process.env): ZdrState {
52
+ const envVar = zdrEnvVar(env)
53
+ if (envVar) return { enabled: true, source: "env", envVar }
54
+ if (readZdrSetting(settings)) return { enabled: true, source: "settings" }
55
+ return { enabled: false, source: "off" }
56
+ }
57
+
58
+ /**
59
+ * Read the opt-in from the agent settings file itself. Startup uses this instead
60
+ * of the host's merged global+project view: the opt-in is owned by the agent
61
+ * file that saveZdrSetting writes, so a project settings override cannot
62
+ * silently turn it off (or on) after a restart.
63
+ *
64
+ * A missing or unreadable file is "off"; a malformed file is left for the write
65
+ * path to report rather than failing the provider load.
66
+ */
67
+ export async function loadZdrSettings(path: string): Promise<unknown> {
68
+ try {
69
+ return JSON.parse(stripBom(await readFile(path, "utf8")))
70
+ } catch {
71
+ return undefined
72
+ }
73
+ }
74
+
75
+ export function zdrHeaders(state: ZdrState): Record<string, string> | undefined {
76
+ return state.enabled ? { "x-cmd-zdr": "1" } : undefined
77
+ }
78
+
79
+ export function describeZdr(state: ZdrState): string {
80
+ if (state.source === "env") return `on (${state.envVar ?? "environment"})`
81
+ if (state.source === "settings") return "on (settings.json commandcode.enableZDR)"
82
+ return "off"
83
+ }
84
+
85
+ /**
86
+ * A symlinked settings.json (e.g. a managed file) is updated through its target
87
+ * so the link survives; a dangling link is refused rather than replaced.
88
+ */
89
+ async function resolveSettingsTarget(path: string): Promise<string> {
90
+ try {
91
+ return await realpath(path)
92
+ } catch (error) {
93
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) {
94
+ throw new Error("Could not read settings.json in the agent directory; check file permissions")
95
+ }
96
+ }
97
+ const entry = await lstat(path).catch(() => undefined)
98
+ if (entry?.isSymbolicLink()) {
99
+ throw new Error("settings.json is a symlink to a missing file; refusing to replace the link")
100
+ }
101
+ return path
102
+ }
103
+
104
+ /**
105
+ * Persist the opt-in into the agent settings file, preserving every other key.
106
+ *
107
+ * Returns the written settings object so the caller resolves the effective
108
+ * state without waiting for the host to reload the file. The host re-reads the
109
+ * file and merges only the fields it modified on each of its own saves, so this
110
+ * key survives later host writes; writes from separate processes are not
111
+ * coordinated. A malformed file is never overwritten, and an unreadable file is
112
+ * reported instead of replaced.
113
+ */
114
+ export async function saveZdrSetting(settingsPath: string, enabled: boolean): Promise<unknown> {
115
+ const path = await resolveSettingsTarget(settingsPath)
116
+ let raw: string | undefined
117
+ try {
118
+ raw = await readFile(path, "utf8")
119
+ } catch (error) {
120
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) {
121
+ throw new Error("Could not read settings.json in the agent directory; check file permissions")
122
+ }
123
+ }
124
+
125
+ let settings: Record<string, unknown> = {}
126
+ const text = raw === undefined ? undefined : stripBom(raw)
127
+ if (text !== undefined && text.trim() !== "") {
128
+ let parsed: unknown
129
+ try {
130
+ parsed = JSON.parse(text)
131
+ } catch {
132
+ throw new Error(
133
+ "Invalid settings.json in the agent directory; refusing to overwrite it. Fix the JSON or set commandcode.enableZDR by hand.",
134
+ )
135
+ }
136
+ if (!isRecord(parsed)) {
137
+ throw new Error("settings.json must contain a JSON object; refusing to overwrite it")
138
+ }
139
+ settings = { ...parsed }
140
+ }
141
+ const section = settings[ZDR_SETTINGS_SECTION]
142
+ settings[ZDR_SETTINGS_SECTION] = {
143
+ ...(isRecord(section) ? section : {}),
144
+ [ZDR_SETTING_KEY]: enabled,
145
+ }
146
+
147
+ const temporary = `${path}.${randomUUID()}.tmp`
148
+ try {
149
+ await mkdir(dirname(path), { recursive: true })
150
+ await writeFile(temporary, `${JSON.stringify(settings, null, 2)}\n`, {
151
+ encoding: "utf8",
152
+ mode: 0o600,
153
+ flag: "wx",
154
+ })
155
+ await rename(temporary, path)
156
+ } catch {
157
+ throw new Error("Could not save settings.json in the agent directory; check file permissions")
158
+ } finally {
159
+ // Cleanup must not replace the sanitized error with an OS message containing local paths.
160
+ await rm(temporary, { force: true }).catch(() => {})
161
+ }
162
+ return settings
163
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.11.17",
3
+ "version": "2026.11.19",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -39,16 +39,18 @@
39
39
  "@ast-grep/cli": "0.51.1",
40
40
  "@ast-grep/napi": "^0.51.0",
41
41
  "@dietrichgebert/ponytail": "5.3.3",
42
+ "@estebanforge/pi-antigravity-bridge": "1.13.1",
43
+ "@estebanforge/pi-ask-shared": "^0.1.6",
44
+ "@estebanforge/pi-tui-dialogs": "^0.1.3",
42
45
  "@herbertgao/pi-agency": "0.1.4",
43
46
  "@herbertgao/pi-bark": "0.2.2",
44
- "@herbertgao/pi-cc-extensions": "1.0.21-local.2",
47
+ "@herbertgao/pi-cc-extensions": "1.0.21-local.4",
45
48
  "@herbertgao/pi-impeccable": "0.6.0",
46
- "@herbertgao/pi-inline-skill-commands": "0.1.1",
47
- "@herbertgao/pi-subagents": "0.26.1-local.2",
49
+ "@herbertgao/pi-inline-skill-commands": "0.2.0",
50
+ "@herbertgao/pi-subagents": "0.26.2-local.2",
48
51
  "@herbertgao/sol-pi": "0.4.3",
49
52
  "@juicesharp/rpiv-ask-user-question": "2.15.0",
50
53
  "@juicesharp/rpiv-config": "^2.15.0",
51
- "@mixmark-io/domino": "^2.2.0",
52
54
  "@modelcontextprotocol/sdk": "^1.32.1",
53
55
  "@mozilla/readability": "^0.6.0",
54
56
  "@napi-rs/keyring": "^2.1.0",
@@ -75,8 +77,7 @@
75
77
  "minimatch": "^11.0.4",
76
78
  "nanoid": "^5.1.16",
77
79
  "p-limit": "^6.1.0",
78
- "pi-antigravity": "0.14.0",
79
- "pi-commandcode-provider": "0.8.6",
80
+ "pi-commandcode-provider": "0.8.7",
80
81
  "pi-lens": "4.5.1",
81
82
  "pi-next-cue": "1.0.8",
82
83
  "pi-provider-qoder": "0.6.13",
@@ -84,10 +85,9 @@
84
85
  "pi-web-access": "0.48.0",
85
86
  "pidusage": "^4.0.1",
86
87
  "promise.try": "^2.0.1",
87
- "turndown": "^7.2.4",
88
- "turndown-plugin-gfm": "^1.0.2",
88
+ "turndown": "^7.2.5",
89
89
  "unbash": "4.0.10",
90
- "undici": "^8.12.3",
90
+ "undici": "^8.12.4",
91
91
  "unpdf": "^1.6.2",
92
92
  "vscode-jsonrpc": "^10.0.0",
93
93
  "ws": "^8.21.0",
@@ -106,6 +106,7 @@
106
106
  },
107
107
  "bundledDependencies": [
108
108
  "@dietrichgebert/ponytail",
109
+ "@estebanforge/pi-antigravity-bridge",
109
110
  "@herbertgao/pi-agency",
110
111
  "@herbertgao/pi-bark",
111
112
  "@herbertgao/pi-cc-extensions",
@@ -124,7 +125,6 @@
124
125
  "@tifan/pi-rename",
125
126
  "@tintinweb/pi-tasks",
126
127
  "grok-mermaid",
127
- "pi-antigravity",
128
128
  "pi-commandcode-provider",
129
129
  "pi-lens",
130
130
  "pi-next-cue",
@@ -158,10 +158,7 @@
158
158
  "./node_modules/pi-next-cue/index.ts",
159
159
  "./node_modules/pi-lens/dist/index.js",
160
160
  "./node_modules/pi-web-access/dist",
161
- "./node_modules/pi-antigravity/src/index.ts",
162
- "./node_modules/pi-antigravity/src/features/google-search.ts",
163
- "./node_modules/pi-antigravity/src/features/read-url-content.ts",
164
- "./node_modules/pi-antigravity/src/features/generate-image.ts",
161
+ "./node_modules/@estebanforge/pi-antigravity-bridge/extensions",
165
162
  "./node_modules/pi-provider-qoder/dist/index.js",
166
163
  "./node_modules/pi-commandcode-provider/index.ts",
167
164
  "./node_modules/pi-typesafe/extensions/index.js",
@@ -1,298 +0,0 @@
1
- # pi-antigravity
2
-
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)
5
- [![license](https://img.shields.io/npm/l/pi-antigravity)](LICENSE)
6
- [![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?logo=github)](https://github.com/sponsors/Rahularya01)
7
- [![omp status](https://omppackages.com/badge/pi-antigravity.svg)](https://omppackages.com/packages/pi-antigravity)
8
-
9
- **pi-antigravity** is a [Pi Coding Agent](https://pi.dev) provider that lets Pi talk directly to Google Antigravity / Cloud Code Assist models — Gemini, plus the Claude and GPT-OSS models Antigravity also advertises. Sign in with Google, pick a model, and go. Under the hood it handles OAuth login, native streaming, model routing, and quota diagnostics itself, so it never shells out to an external Antigravity CLI.
10
-
11
- Using [OpenCode](https://opencode.ai) instead of Pi? Install the companion plugin [`@rahularya01/opencode-antigravity`](https://www.npmjs.com/package/@rahularya01/opencode-antigravity).
12
-
13
- Want to equip Pi with MCP, web access, subagents, and todos? Install [`pi-essentials`](https://github.com/Rahularya01/pi-essentials) (currently in beta), an all-in-one companion extension designed for Pi.
14
-
15
- > **Unofficial integration.** This project is not affiliated with or endorsed by Google. Use it only with an account and services you are authorized to access, and review its source before granting OAuth permissions.
16
-
17
- ## Contents
18
-
19
- - [Requirements](#requirements)
20
- - [Install](#install)
21
- - [Quick start](#quick-start)
22
- - [Authentication and credential safety](#authentication-and-credential-safety)
23
- - [Commands](#commands)
24
- - [Tools](#tools)
25
- - [Models and routing](#models-and-routing)
26
- - [Configuration](#configuration)
27
- - [Troubleshooting](#troubleshooting)
28
- - [Development](#development)
29
-
30
- ## Requirements
31
-
32
- - Node **22.19.0 or later**
33
- - Pi Coding Agent and Pi AI version **0.80.0 or later**
34
- - A Google account that can use the relevant Cloud Code Assist / Antigravity services
35
- - A browser to complete the Google sign-in. Same-machine is best (the browser hits the local callback automatically); on a remote/headless machine, complete sign-in anywhere and paste the resulting callback URL back into Pi (see [Troubleshooting](#troubleshooting)).
36
-
37
- ## Install
38
-
39
- Install from npm:
40
-
41
- ```bash
42
- pi install npm:pi-antigravity
43
- ```
44
-
45
- Or install the latest repository version:
46
-
47
- ```bash
48
- pi install git:github.com/Rahularya01/pi-antigravity
49
- ```
50
-
51
- On Oh My Pi, install the same package with `omp plugin install npm:pi-antigravity`.
52
-
53
- Restart Pi (or run `/reload`) after installation. To update the npm package later, use `pi update npm:pi-antigravity`.
54
-
55
- ## Quick start
56
-
57
- 1. Start Pi and run `/login antigravity`.
58
- 2. Complete Google sign-in in your browser.
59
- 3. Select a model, for example:
60
-
61
- ```text
62
- /model antigravity/gemini-3.8-flash
63
- ```
64
-
65
- 4. Start working. If a request fails, run `/antigravity.doctor` for sanitized diagnostics.
66
-
67
- To link another account without losing the existing one, run `/login antigravity`
68
- again and complete Google sign-in with the other account. Manage linked accounts with:
69
-
70
- ```text
71
- /antigravity.accounts
72
- /antigravity.accounts switch <index|email>
73
- /antigravity.accounts remove <index|email>
74
- ```
75
-
76
- On a hard quota wall (HTTP 429 with a reset hint), the provider automatically tries the next linked account.
77
-
78
- ## Authentication and credential safety
79
-
80
- The provider uses the OAuth 2.0 Authorization Code flow with PKCE, so credentials are only ever exchanged with Google — never typed into Pi.
81
-
82
- 1. `/login antigravity` opens Google sign-in and starts a temporary callback listener at `http://localhost:51121/oauth-callback`.
83
- 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`).
84
- 3. Pi refreshes access tokens automatically when they expire — you shouldn't need to sign in again unless a token is revoked.
85
- 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.
86
- 5. Access is quota-backed by the signed-in Google account rather than billed per token, so Pi marks Antigravity models as subscription-backed (`(sub)` in the footer); any cost Pi shows for them is a catalog estimate.
87
-
88
- 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.**
89
-
90
- Signing in requests these Google OAuth scopes:
91
-
92
- <!-- prettier-ignore -->
93
- | Scope | Why it's needed |
94
- | --- | --- |
95
- | `aicode` | Access to the Cloud Code Assist / Antigravity model catalog and endpoints |
96
- | `cloud-platform` | General Cloud Code Assist API access |
97
- | `userinfo.email`, `userinfo.profile` | Identify the signed-in Google account |
98
- | `cclog` | Cloud Code Assist logging/telemetry endpoints used by the API |
99
- | `experimentsandconfigs` | Server-side experiment and config flags for the API |
100
-
101
- Review these permissions before approving access. If your credentials expire or are revoked, just re-run `/login antigravity` to sign in again.
102
-
103
- ## Commands
104
-
105
- <!-- prettier-ignore -->
106
- | Command | Description |
107
- | --- | --- |
108
- | `/login antigravity` | Sign in to Google and configure the provider. |
109
- | `/model antigravity/<model-id>` | Choose a registered Antigravity model. |
110
- | `/antigravity.usage` | Show the server-reported shared quota groups and reset times. |
111
- | `/antigravity.models` | List available runtime models, remaining shared-pool quota, and capabilities. |
112
- | `/antigravity.accounts` | List linked accounts; use `switch` or `remove` with an index or email to manage them. |
113
- | `/antigravity.credits [on\|off]` | Check or toggle automatic fallback to AI credits when standard quotas are exhausted. |
114
- | `/antigravity.models all` | Include tab/chat models normally hidden from the model list. |
115
- | `/antigravity.refresh` | Force refresh the dynamic model catalog from Antigravity. |
116
- | `/antigravity.doctor` | Show sanitized provider diagnostics, including the endpoint, status, and resolved runtime model. |
117
- | `/antigravity.image <prompt>` | Generate an image via Antigravity and save it under `.pi/generated-images/`. Optional `--ratio 16:9`, `--model`, `--path`. |
118
- | `/antigravity.search <query>` | Search the web using Google Search Grounding via Antigravity. Optional `--thinking`, `--url <url>`. |
119
- | `/antigravity.fetch <url>` | Read a public web page through the Antigravity fetch service and print it as markdown. Optional `--raw` keeps the crawled source. |
120
-
121
- 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.
122
-
123
- ## Tools
124
-
125
- ### Image generation
126
-
127
- The extension registers a `generate_image` tool the model can call. Images are written inside the project directory (default `.pi/generated-images/`). Image generation defaults to `gemini-3.1-flash-image`; model availability is account-dependent. Requests use the direct image endpoint, with the legacy streaming endpoint tried on HTTP 404. Existing model and endpoint fallbacks remain available.
128
-
129
- The `generate_image` tool accepts an optional `referenceImages` array of project-relative paths. Reference images are sent to Google alongside the prompt; only include images you intend to upload. PNG, JPEG, WebP, and GIF are supported, with MIME types detected from file contents. Each reference must be at most 10 MB, and at most four references are sent. Paths must remain inside the working directory, including symlink targets. For example:
130
-
131
- ```json
132
- {
133
- "prompt": "Design a deep bowl using the colors and artwork in these references",
134
- "referenceImages": ["references/oatmeal.png", "references/plate.jpg"],
135
- "path": "designs/bowl.png"
136
- }
137
- ```
138
-
139
- Omit `referenceImages` (or pass `[]`) for text-only generation. `/antigravity.image` remains text-only; reference paths are supported by the tool, not the slash command.
140
-
141
- ### Search
142
-
143
- The `google_search` tool allows models to perform real-time web search and URL analysis using Google Search Grounding over Cloud Code Assist. The default model is `gemini-3.5-flash-lite` (fallbacks: `gemini-3.1-flash-lite`, `gemini-3-flash`) and the default reply is a short evidence brief. It supports optional lead agent directives (`instruction`), specific target URLs (`urls`), and deep reasoning (`thinking: true` or `/antigravity.search --thinking`).
144
-
145
- ### Read a page
146
-
147
- Use the reader when you already know the page URL; use `google_search` to find sources. The answer is Google's crawled copy and can be stale or incomplete. For login pages, interactive applications, and unsupported formats, use a browser or another permitted local tool. Check `/antigravity.doctor` after a failed or degraded read. The [reader guarantees](docs/reader-guarantees.md) map its limits to offline regression checks.
148
-
149
- The `read_url_content` tool reads public pages. Fetching runs through Google's Cloud Code Assist endpoints, so the machine never contacts the target site. The character budget covers returned text and serialized details; small budgets may omit older attempt details, with an explicit omission count. `/antigravity.doctor` retains the bounded retrieval history. The tool resolves redirects with `v1internal:rewriteUri`, reads `v1internal:fetchFromTrawlerCache`, and retries with `liveFetch: true` when the cache is missing, clearly cut off, empty, or suspected to contain only a shell or access wall. A shared 10-second network deadline bounds redirects, endpoint failover, and recovery; useful content is retained if the deadline expires or recovery fails. Short readable fragments with unknown completeness do not trigger a retry. Endpoint failover is limited to transport failures; a read makes at most ten Google requests and tries at most one publisher representation URL. HTML conversion accepts at most 2,000,000 characters, 50,000 markup tokens, and 128 nested elements. More complex pages are not converted; Google's HTML is saved to a temp file instead.
150
-
151
- Before converting HTML to Markdown, the tool reads page metadata, bounded JSON-LD matched to the article, and advertised alternate representations. If cache and live results are inadequate, it tries at most one same-origin Markdown or supported article-JSON representation, preferring the page language and then Markdown; a mismatched-language fallback updates the reported language and retrieval outcome. JSON recovery supports GitHub Docs article bodies and WordPress single-post responses with matching article identity. Inadequate MDN copies can use the publisher's same-origin `index.json` representation within the same one-representation budget. Cut-off Wikipedia articles use Wikipedia's parse API for the same article, and cut-off `raw.githubusercontent.com` files use the full line list from the matching GitHub file page; both are used only when they name the requested article or file. Wikipedia titles are matched the way MediaWiki does (first letter capitalized, redirects followed); revisions, queries, and special pages are not recovered. These copies are tried even when Google cannot serve the original URL. MDN's JSON may supply a canonical article URL within the same origin and locale's `/docs/` prefix; results report that redirect. Recovery requires verified publisher identity and complete supported article sections; if Google cuts only the later sidebar JSON, the source is still reported as incomplete. Unknown section types or a cut-off article body are not silently repaired. Results report the article URL, any alternate representation URL, retrieval attempts, and available title, author, publication date, modification date, and language. Structured data is parsed, never executed.
152
-
153
- Conversion keeps headings, lists, links, code blocks, and data tables. Table grids are limited to 10,000 cells per page; nested or oversized grids are flattened without expanding their spans. It removes navigation and hidden decorations (a block named like chrome, such as `sidebar` or `menu`, is kept when it holds the article or most of the page's text), then selects a substantive `<main>`, `role="main"`, or `<article>` region, skipping empty placeholders. Source completeness, suspected content problems, and our own output truncation are reported separately. A closed HTML document is not proof that Google supplied the entire article. Empty results do not establish that the page requires JavaScript: Google's response may be cut off, blocked, or a shell.
154
-
155
- Output is capped by `ANTIGRAVITY_WEB_FETCH_MAX_CHARS` (default 60000), including the provenance header and saved-page footer. A long URL is elided inside the header so provenance cannot take the page's share of the budget away. Page-controlled metadata is stripped of line breaks and bounded before it reaches the header. When a page does not fit, the tool returns its beginning and saves the full Markdown, with the provenance header, to a private temp file (`pi-url-*/page.md`, mode 0600), the same way Pi saves long tool output. The answer ends with the file path, and `details.fullOutputPath` holds it; the agent reads or searches that file instead of fetching again. Pages beyond the conversion limits are refused, and Google's unconverted HTML is saved to `page.html` for searching. Raw mode is not bound by those limits: it returns the crawled source as it is, so the page's size limits the answer, not the read. A raw page that does not fit is saved as the source alone, without the provenance header. If a page cannot be saved (for example, the temp directory is not writable), the answer says so and still shows the beginning. Temp files are not deleted automatically. Service responses over 5 MB are refused before parsing. A live 401/403 or other recovery failure keeps an already usable cached copy.
156
-
157
- `/antigravity.fetch [--raw] <url>` exposes the same fetch interactively. Raw mode preserves the requested page's crawled source and does not substitute alternate representations. Literal private/local addresses, local hostnames, non-HTTP URLs, and URLs with embedded username/password are refused. Known sensitive query and fragment values, and token-shaped values, are redacted from provenance, progress messages, and errors, but remain part of the request sent to the fetch service. DNS names are resolved by Google's service rather than locally, so this check is a filter for obvious local/private targets, not a guarantee against every name that resolves internally. The service resolves the initial redirect chain, so local validation sees the final URI it reports rather than every remote hop: a final URI that names a private or local address fails closed and aborts the read, while a malformed one is ignored and the requested page is read. Explicit non-HTTP or credential-bearing redirects are refused. PDF URLs, PDF content types, and line-start PDF signatures within the first 1024 characters fail with guidance to download the URL directly and read the local file with an available PDF reader, subject to normal permissions. Alternate `.pdf` links are ignored rather than substituted. The tool itself does not download or extract PDFs. This remains a best-effort Google crawler tool, without a local HTTP or browser fallback, cookies, or login support.
158
-
159
- ### Native image API
160
-
161
- On Pi versions that support mixed-operation provider registration (`type: "image"` and `images` handlers), Antigravity exposes `gemini-3.1-flash-image` to codemode and `ctx.modelRegistry.generateImages()`. Older Pi versions can continue using the existing image tool and command; the native API is not available there.
162
-
163
- ```js
164
- const model = await models.getModelOfType("image", "antigravity", "gemini-3.1-flash-image");
165
- const result = await models.generateImages(model, {
166
- input: [{ type: "text", text: "A red square on white" }],
167
- });
168
- if (result.stopReason !== "stop") return result.errorMessage;
169
- for (const block of result.output) if (block.type === "image") image(block);
170
- ```
171
-
172
- The native API returns in-memory image/text blocks and does not save files. Input image blocks are accepted without local path loading. Extensions can pass `metadata: { aspectRatio: "16:9" }` through image options. Credentials are resolved by Pi. Backend usage is not currently reported by this adapter.
173
-
174
- ## Models and routing
175
-
176
- 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 Gemini 4 Argon or Gemini 4 Hydrogen — 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.
177
-
178
- Gemini 4 Argon is advertised only when the client version is current and the account is entitled. After upgrading, run `/antigravity.refresh` (or start any session; print mode refreshes before the prompt) and select `antigravity/gemini-4-argon`. Updating the client version does not grant entitlement. Headless `pi -p` resolves `--model` before extensions run, so the first invocation after an upgrade can still print `Using custom model id`; the request is routed from the refreshed catalog, and the next invocation reads the persisted list.
179
-
180
- Long sessions that switch providers are the highest-risk setup for tool-observation mimicry on Gemini 3.x. Foreign tool calls are flattened into `[Observation from ...]` text, and a model can imitate those logs instead of making a real tool call. Finish a task on one provider before switching.
181
-
182
- A tier that answers with a generic resource-exhausted error is retried on the other Antigravity endpoints and then on a sibling tier of the same generation (`-low` can move to `-high` or `-medium`). A hard quota message that includes a reset time does not do this.
183
-
184
- A successful refresh replaces the catalog with advertised models and routes, removing entries absent from all responding endpoints. Live capabilities and token limits override static defaults; grouped variants use the smallest advertised limits. Known thinking variants such as `gemini-4-hydrogen-low` / `-medium` / `-high` / `-xhigh` become one public model. Unfamiliar suffixes and opaque IDs stay usable as exact runtime IDs when they pass the catalog filters.
185
-
186
- Use `/antigravity.refresh` to bypass the four-hour cache, or `/antigravity.models` to view live availability and quota. Account/project changes and older cache formats trigger discovery on the next network-enabled refresh. Failed or unrecognized responses keep the last-known-good catalog; forced refreshes report the error. Arbitrary API schema changes can still require an extension update. `ANTIGRAVITY_USER_AGENT` overrides the default client fingerprint when a newer CLI version is required.
187
-
188
- ### Why Claude and GPT-OSS appear
189
-
190
- Antigravity / Cloud Code Assist exposes a multi-provider catalog. Depending on your account, its Google-authenticated API can advertise Google Gemini models alongside Claude models served through Anthropic Vertex and GPT-OSS served through OpenAI Vertex. This extension intentionally exposes those advertised Claude and GPT-OSS models through the single `antigravity` provider; they are not separate Pi providers and do not use a separate Anthropic or OpenAI login.
191
-
192
- The backend's display labels do not always match its runtime IDs. For example, `gemini-3.5-flash-extra-low`, `gemini-3.5-flash-low`, and `gemini-3-flash-agent` can be displayed as Gemini 3.5 Flash Low, Medium, and High. All supported models send integer `thinkingBudget` (Gemini 3.8/3.7/3.6: -1/4000/1000/0, Gemini 3.5: 10000/4000/1000/0, Gemini 3.1 Pro: 10001/1001/0, Claude: 1024/0, GPT-OSS: 8192/0) matching the official Antigravity CLI wire format.
193
-
194
- <!-- prettier-ignore -->
195
- | Public model ID | Input | Thinking levels shown | Max output tokens | Request routing |
196
- | --- | --- | --- | --- | --- |
197
- | `gemini-3.8-flash` | Text, image | Low, Medium, High | 65,536 | low → `gemini-3.8-flash-low`; medium → `gemini-3.8-flash-medium`; high → `gemini-3.8-flash-high` |
198
- | `gemini-3.7-flash` | Text, image | Low, Medium, High | 65,536 | low → `gemini-3.7-flash-low`; medium → `gemini-3.7-flash-medium`; high → `gemini-3.7-flash-high` |
199
- | `gemini-3.6-flash` | Text, image | Low, Medium, High | 65,536 | low → `gemini-3.6-flash-low`; medium → `gemini-3.6-flash-medium`; high → `gemini-3.6-flash-high` |
200
- | `gemini-3.5-flash` | Text, image | Low, Medium, High | 65,536 | low → `gemini-3.5-flash-extra-low`; medium → `gemini-3.5-flash-low`; high → `gemini-3-flash-agent` |
201
- | `gemini-3.1-pro` | Text, image | Low, High | 65,535 | low → `gemini-3.1-pro-low`; high → `gemini-pro-agent` |
202
- | `claude-sonnet-4-6` | Text, image | High | 64,000 | high → `claude-sonnet-4-6` |
203
- | `claude-opus-4-6` | Text, image | High | 64,000 | high → `claude-opus-4-6-thinking` |
204
- | `gpt-oss-120b` | Text | Medium | 32,768 | medium → `gpt-oss-120b-medium` |
205
-
206
- To limit which models Pi cycles through, enable specific entries in `~/.pi/agent/settings.json`:
207
-
208
- ```json
209
- {
210
- "models": {
211
- "antigravity/gemini-3.8-flash": { "enabled": true },
212
- "antigravity/gemini-3.7-flash": { "enabled": true },
213
- "antigravity/gemini-3.6-flash": { "enabled": true },
214
- "antigravity/gemini-3.5-flash": { "enabled": true },
215
- "antigravity/gemini-3.1-pro": { "enabled": true },
216
- "antigravity/claude-sonnet-4-6": { "enabled": true }
217
- }
218
- }
219
- ```
220
-
221
- ## Configuration
222
-
223
- All primary environment variables start with `ANTIGRAVITY_`. The legacy `NOAGY_` prefix is also accepted for compatibility.
224
-
225
- <!-- prettier-ignore -->
226
- | Variable | Purpose |
227
- | --- | --- |
228
- | `ANTIGRAVITY_BASE_URL` | Override the API base URL. It must be HTTPS, contain no URL credentials, and target an allowed Google APIs host. Ignored for inference once Gemini Enterprise routing is active. |
229
- | `ANTIGRAVITY_LOCATION` | `eu`, `us`, or `global`. `eu` and `us` send inference only to `businessaicode.<location>.rep.googleapis.com` and never fall back to the consumer `cloudcode-pa` hosts. Also read from `~/.gemini/antigravity-cli/settings.json` when that file stores `location`. |
230
- | `ANTIGRAVITY_ENTERPRISE` | Set to `1` to force Gemini Enterprise routing, including `global` (`businessaicode.googleapis.com`). |
231
- | `ANTIGRAVITY_ENTERPRISE_PROJECT` | Google Cloud project id for the selected Gemini Enterprise license. Required when enterprise routing is on. Also read from the CLI settings `project` / `projectId`. |
232
- | `ANTIGRAVITY_USER_TIER` | License tier id required with enterprise routing. Also read from the CLI settings `userTier`. |
233
- | `ANTIGRAVITY_PROJECT_ID` | Use a specific Cloud Code Assist project ID instead of discovery or the stable account fallback. |
234
- | `ANTIGRAVITY_CALLBACK_HOST` | Bind OAuth callback to `127.0.0.1`, `::1`, or `localhost` only. Defaults to `127.0.0.1`. |
235
- | `ANTIGRAVITY_USER_AGENT` | Override the request user-agent. |
236
- | `ANTIGRAVITY_RUNTIME_MODEL` | Pin requests to a runtime model ID, bypassing discovered/fallback routing. |
237
- | `ANTIGRAVITY_CATALOG_REFRESH_INTERVAL_MS` | Override catalog refresh TTL in ms. Defaults to 4 hours (`14400000`). Set to `0` to always refresh. |
238
- | `ANTIGRAVITY_CLIENT_ID` | Use a custom Google OAuth client ID. |
239
- | `ANTIGRAVITY_CLIENT_SECRET` | Use a custom Google OAuth client secret. Keep it out of source control and shell history. |
240
- | `ANTIGRAVITY_STREAM_STALL_TIMEOUT_MS` | Maximum silence between stream chunks; default `300000` ms. Set `0` to disable. |
241
- | `ANTIGRAVITY_STREAM_HEADER_TIMEOUT_MS` | Response-header deadline; default `180000` ms. Set `0` to disable. |
242
- | `ANTIGRAVITY_NO_KEEPALIVE` | Set to `1` to skip the keep-alive connection pool. |
243
- | `ANTIGRAVITY_NO_PREWARM` | Set to `1` to skip the TLS pre-warm request made on the first Antigravity request. |
244
- | `ANTIGRAVITY_NO_EXTRA_TOOLS` | Set to `1` to stop registering the model-facing `google_search`, `read_url_content`, and `generate_image` tools. The `/antigravity.search`, `/antigravity.fetch`, and `/antigravity.image` commands stay available. |
245
- | `ANTIGRAVITY_USE_CREDITS` | Set to `1` (or `0`) to explicitly enable (or disable) automatic AI credit overages when standard quota is depleted. Defaults to inheriting `useG1Credits` from `~/.gemini/antigravity-cli/settings.json` only when that file sets the flag. Otherwise credit overages stay off. |
246
- | `ANTIGRAVITY_NO_SEARCH_TOOL` | Set to `1` to skip only the `google_search` tool, e.g. when another extension provides web search. |
247
- | `ANTIGRAVITY_NO_FETCH_TOOL` | Set to `1` to skip only the `read_url_content` tool, e.g. when another extension already fetches URLs. |
248
- | `ANTIGRAVITY_NO_IMAGE_TOOL` | Set to `1` to skip only the `generate_image` tool. |
249
- | `ANTIGRAVITY_WEB_FETCH_MAX_CHARS` | Character budget for one `read_url_content` result. Defaults to 60000, roughly 15k tokens. |
250
- | `ANTIGRAVITY_DEFER_TOOLS` | Set to `1` to register `google_search`, `read_url_content`, and `generate_image` as deferred: they aren't declared to the model, but codemode scripts can call them and `tool_search` can load them. Needs `codemode` or `tool_search` active, e.g. `"defaultTools": ["+codemode"]`. Requires Pi 0.99.2+; older Pi keeps them direct. |
251
-
252
- `pi config` can disable each model-facing tool without disabling the provider. The package loads four extension resources: `src/index.ts` (provider, OAuth, and slash commands), `src/features/google-search.ts` (`google_search`), `src/features/read-url-content.ts` (`read_url_content`), and `src/features/generate-image.ts` (`generate_image`). Turn off a feature resource there to stop registering that tool. `/antigravity.search`, `/antigravity.fetch`, and `/antigravity.image` stay available from the provider extension.
253
-
254
- Environment variables still force a loaded tool off, including in scripts and headless runs. They cannot turn a resource back on after `pi config` disables it, because that file is not loaded. Either control is enough to hide the tool from the model. Run `/reload` after changing `pi config`.
255
-
256
- 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.
257
-
258
- ### Latency
259
-
260
- 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.
261
-
262
- ## Troubleshooting
263
-
264
- - **No credentials / 401 / 403:** Run `/login antigravity` again, then check `/antigravity.doctor`.
265
- - **403 `VALIDATION_REQUIRED` / "Verify your account":** Open the `accounts.google.com` link in the error, in a browser signed in to the same Google account, and finish verification. Re-login alone does not clear it. `/antigravity.doctor` omits that link because it carries session parameters.
266
- - **Remote/headless machine — browser can't reach `localhost:51121`:** The callback binds to loopback only, so a browser on another machine can't hit it. You have two options:
267
- - **Paste (no extra setup):** Run `/login antigravity`, open the shown URL and complete Google sign-in in _any_ browser. When it redirects to `http://localhost:51121/oauth-callback?…` and fails to load, copy that full URL from the address bar and paste it into the prompt Pi shows. The code is single-use and expires quickly, so paste promptly.
268
- - **SSH tunnel (reusable):** From the machine with the browser, run `ssh -N -L 51121:127.0.0.1:51121 <user>@<server>` and keep it open, then run `/login antigravity` on the server. The redirect to `localhost:51121` tunnels through to the local callback automatically.
269
- - **OAuth callback will not start:** Ensure port `51121` is free and `ANTIGRAVITY_CALLBACK_HOST` is a permitted loopback address.
270
- - **Model is unavailable:** Run `/antigravity.refresh`, then select a model from the updated list. Availability is account- and service-dependent; a generic resource-exhausted response alone does not prove a model was retired. Discovery uses the backend's recommended model list when supplied, since the raw catalog can retain old runtime IDs. If a resumed session selects a model removed by discovery, select another model; static routes and compatibility fallbacks do not restore models absent from the refreshed catalog.
271
- - **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.
272
- - **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.
273
- - **Need a safe diagnostic:** `/antigravity.doctor` redacts recognized secrets from its error output. Still review output before sharing it publicly.
274
- - **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.
275
-
276
- ## Development
277
-
278
- 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).
279
-
280
- ```bash
281
- corepack enable
282
- yarn install --immutable
283
- yarn check
284
- ```
285
-
286
- For an optional live fetch check, run `yarn smoke:fetch` after `/login antigravity`. It exercises the registered tool on three public URLs and checks that reading a saved page needs neither network nor credentials. Missing expected page text is a failure unless explicit retrieval failures explain a degraded copy, which is an upstream-availability warning. An unobserved MDN canonical alias is also a warning; when that alias is observed, redirect provenance is checked. It uses saved Pi credentials (`PI_AUTH_PATH` can select another auth file), leaves saved pages in the temp directory, and is excluded from `yarn check` and default CI. Exit codes: 0 for successful coverage, 1 for integration failures, 2 when upstream availability limits coverage, no page passes, or no saved page can be checked.
287
-
288
- 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.
289
-
290
- 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.
291
-
292
- ## Support the project
293
-
294
- If `pi-antigravity` is useful to you, consider [sponsoring the project on GitHub](https://github.com/sponsors/Rahularya01).
295
-
296
- ## License
297
-
298
- [MIT](LICENSE)