@estebanforge/pi-antigravity-bridge 1.12.0 → 1.12.1

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.12.1] - 2026-11-19
6
+
7
+ ### Fixed
8
+
9
+ - **The agy installer no longer reports a working install as a failure (issue #19).** The Linux/macOS pipeline ran `curl | bash` under `set -o pipefail`: when Google's `install.sh` found agy already present it exited without draining the pipe, curl died with write error 23, and the bridge surfaced the raw notice plus curl noise as "installation failed" followed by a contradictory "agy is not installed" line. The download now lands in a temp file first (a consumer early-exit can no longer fake a download failure; real curl errors stay loud), the version-floor branch points at `agy update` instead of offering an installer that cannot upgrade an existing install, and the post-install verification failure now names the actual remedy (set `AGY_BIN` or fix PATH for pi) instead of advising a terminal that already works. Installer output in the failure toast is tail-truncated; the full text stays in the daily log.
10
+
5
11
  ## [1.12.0] - 2026-11-19
6
12
 
7
13
  ### Fixed
package/README.md CHANGED
@@ -87,7 +87,7 @@ Install with pi's package manager:
87
87
  pi install npm:@estebanforge/pi-antigravity-bridge
88
88
  ```
89
89
 
90
- Requires the **`agy` CLI** installed and authenticated. On an interactive start without it, the extension offers once per process to run Google's official installer after your confirmation, without blocking bridge startup. Linux and macOS use `set -o pipefail; curl -fsSL https://antigravity.google/cli/install.sh | bash`; Windows PowerShell uses `irm https://antigravity.google/cli/install.ps1 | iex`. Installation is verified before the success message. Then run `agy` once to complete Google OAuth and restart pi. The extension resolves `agy` on `$PATH`, or via `AGY_BIN`; a bad explicit override gets correction instructions instead of an install. Headless sessions print the instructions without installing.
90
+ Requires the **`agy` CLI** installed and authenticated. On an interactive start without it, the extension offers once per process to run Google's official installer after your confirmation, without blocking bridge startup. Linux and macOS download the install script to a temp file and run it under bash; Windows PowerShell uses `irm https://antigravity.google/cli/install.ps1 | iex`. Installation is verified before the success message. Then run `agy` once to complete Google OAuth and restart pi. The extension resolves `agy` on `$PATH`, or via `AGY_BIN`; a bad explicit override gets correction instructions instead of an install, and a too-old `agy` points at `agy update` (the installer cannot upgrade an existing install). Headless sessions print the instructions without installing.
91
91
 
92
92
  ## Usage
93
93
 
@@ -69,7 +69,7 @@ import { ensureQueuedMessagesDefaults } from "../src/queued-messages.js";
69
69
  import type { TurnDriver, TurnOutcome } from "../src/driver-types.js";
70
70
  import { configPath, loadConfig, logsDir, MAX_TURN_CAP_MIN, parseCapMinutes, removeLegacyAcpBin, saveConfig, type AcpConfig, type AgyMode, type BridgeTools, type Engine, type ThinkingTier } from "../src/config.js";
71
71
  import { agyMissingMessage, ENGINE_SETTINGS_ROW_ID, engineSettingsRow, isAgyInstalled, savedEngineMessage, showEnginePicker, shouldOfferEnginePicker } from "../src/engine-picker.js";
72
- import { agyVersionVerdict, checkAgyCliVersion, describeAgyVersionCheck, MIN_AGY_ACP_VERSION, MIN_AGY_VERSION, MIN_GEMINI_DIR_VERSION, probeGeminiDirFlag, resolveStreamHomeMode } from "../src/agy-version.js";
72
+ import { agyVersionVerdict, agyUpdateMessage, checkAgyCliVersion, describeAgyVersionCheck, MIN_AGY_ACP_VERSION, MIN_AGY_VERSION, MIN_GEMINI_DIR_VERSION, probeGeminiDirFlag, resolveStreamHomeMode } from "../src/agy-version.js";
73
73
  import { isValidAgyAgentName, listAgyAgents } from "../src/agents.js";
74
74
  import { formatSubagentRoster, SubagentRoster } from "../src/subagent-roster.js";
75
75
  import { spawn } from "node:child_process";
@@ -227,6 +227,7 @@ export default async function (pi: ExtensionAPI): Promise<void> {
227
227
  let agySetupOffer: (() => Promise<void>) | null = null;
228
228
  let agyMissingWarned = false;
229
229
  let agyVersionWarned = false;
230
+ let agyVersionMessage = "";
230
231
  // Two turn engines behind one contract: `agy acp` (default for new
231
232
  // installs) and the stream-json `agy` CLI
232
233
  // (fallback). Neither spawns anything until its first turn.
@@ -743,7 +744,9 @@ export default async function (pi: ExtensionAPI): Promise<void> {
743
744
  return;
744
745
  }
745
746
  if (agyVersionWarned) {
746
- if (explicit && ctx.mode === "tui") offerSetup(ctx.ui, true);
747
+ // The installer no-ops on an existing install, so re-offering it
748
+ // on an explicit re-check would toast a false "installed" (issue #19).
749
+ if (explicit && ctx.mode === "tui") ctx.ui.notify(agyVersionMessage, "warning");
747
750
  return;
748
751
  }
749
752
  const rawCheck = await checkAgyCliVersion(binary);
@@ -751,11 +754,10 @@ export default async function (pi: ExtensionAPI): Promise<void> {
751
754
  const check = agyVersionVerdict(rawCheck.raw, floor);
752
755
  if (check.status !== "unsupported") return;
753
756
  agyVersionWarned = true;
754
- const msg = `agy ${check.version} is too old for ${selectedEngine}; install ${floor} or newer.`;
757
+ agyVersionMessage = agyUpdateMessage(check.version ?? rawCheck.raw, floor);
755
758
  if (ctx.mode === "tui") {
756
- ctx.ui.notify(msg, "warning");
757
- offerSetup(ctx.ui, explicit);
758
- } else console.error(`[antigravity-bridge] ${msg}`);
759
+ ctx.ui.notify(agyVersionMessage, "warning");
760
+ } else console.error(`[antigravity-bridge] ${agyVersionMessage}`);
759
761
  } catch (err) {
760
762
  fileLog.log("agy-version-check", { error: String(err) }, "warn");
761
763
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estebanforge/pi-antigravity-bridge",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Gemini provider for Pi on the Antigravity ACP server (official Google ACP) or the stream-json agy CLI. Use antigravity/* models in Pi. Full /model picker support. Models runs Pi's tools. ToS safe to use.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -13,9 +13,12 @@ export function agyInstallCommand(platform: NodeJS.Platform = process.platform):
13
13
  args: ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", "irm https://antigravity.google/cli/install.ps1 | iex"],
14
14
  };
15
15
  }
16
+ // curl|bash under pipefail turned install.sh's early "already installed"
17
+ // exit into curl write error 23, reported as a failed install (issue #19).
18
+ // Download to a file first so a consumer early-exit cannot fake one.
16
19
  return {
17
20
  command: "bash",
18
- args: ["-c", "set -o pipefail; curl -fsSL https://antigravity.google/cli/install.sh | bash"],
21
+ args: ["-c", "t=$(mktemp) && trap 'rm -f \"$t\"' EXIT && curl -fsSL https://antigravity.google/cli/install.sh -o \"$t\" && bash \"$t\""],
19
22
  };
20
23
  }
21
24
 
@@ -77,7 +80,12 @@ export async function installAgyCli(opts: {
77
80
  const result = await (opts.run ?? defaultRunner)(agyInstallCommand(opts.platform), opts.timeoutMs ?? 10 * 60_000);
78
81
  if (result.code !== 0) return { ok: false, error: result.output || `installer exited with code ${result.code ?? "unknown"}` };
79
82
  const verify = opts.verify ?? (() => isAgyInstalled(process.env.AGY_BIN || "agy"));
80
- if (!(await verify())) return { ok: false, error: "installer finished, but agy is not available in this pi process; open a new terminal, run `agy --version`, then restart pi" };
83
+ if (!(await verify())) {
84
+ // The installer output often names where agy already lives (the
85
+ // already-installed notice); the tail turns the guidance actionable.
86
+ const tail = result.output.split("\n").slice(-3).join("\n");
87
+ return { ok: false, error: `installer finished, but agy is not available in this pi process; set AGY_BIN to the binary path or add its directory to PATH, then restart pi${tail ? `\n${tail}` : ""}` };
88
+ }
81
89
  return { ok: true, output: result.output };
82
90
  } catch (err) {
83
91
  return { ok: false, error: err instanceof Error ? err.message : String(err) };
package/src/agy-setup.ts CHANGED
@@ -6,12 +6,17 @@ export interface AgySetupUi {
6
6
  setStatus: (id: string, text?: string) => void;
7
7
  }
8
8
 
9
+ const toastError = (error: string): string => {
10
+ const tail = error.split("\n").slice(-5).join("\n");
11
+ return tail.length > 600 ? tail.slice(-600) : tail;
12
+ };
13
+
9
14
  export function createAgySetupOffer(opts: {
10
15
  ui: AgySetupUi;
11
16
  binaryOverride?: string;
12
17
  install?: typeof installAgyCli;
13
18
  missingMessage: () => string;
14
- log: (event: string, data: unknown, level: "warn" | "info") => void;
19
+ log: (event: string, data: unknown, level: "warn" | "info" | "error") => void;
15
20
  }): () => Promise<void> {
16
21
  let offered = false;
17
22
  let inFlight: Promise<void> | null = null;
@@ -50,13 +55,17 @@ export function createAgySetupOffer(opts: {
50
55
  opts.ui.setStatus("agy-install", "Installing Antigravity CLI…");
51
56
  const result = await install();
52
57
  if (!result.ok) {
53
- opts.log("agy-install", { error: result.error }, "warn");
54
- notify(`Antigravity CLI installation failed: ${result.error}\n${opts.missingMessage()}`, "warning");
58
+ // Error tier: the default log keeps only errors, so the full
59
+ // installer output survives on disk while the toast shows the tail.
60
+ opts.log("agy-install", { error: result.error }, "error");
61
+ // The error text carries its own remedy; appending the
62
+ // missing-CLI copy contradicted "already installed" (issue #19).
63
+ notify(`Antigravity CLI installation failed: ${toastError(result.error)}`, "warning");
55
64
  return;
56
65
  }
57
66
  notify(`Antigravity CLI installed. ${agyAuthenticationMessage()}`, "info");
58
67
  } catch (err) {
59
- opts.log("agy-install", { error: String(err) }, "warn");
68
+ opts.log("agy-install", { error: String(err) }, "error");
60
69
  notify(`Antigravity CLI setup failed: ${String(err)}\n${opts.missingMessage()}`, "warning");
61
70
  } finally {
62
71
  try {
@@ -19,6 +19,12 @@ import path from "node:path";
19
19
  * and the event mapping rely on; older agy predates verified fields. */
20
20
  export const MIN_AGY_VERSION = "1.1.22";
21
21
  export const MIN_AGY_ACP_VERSION = "1.5.3";
22
+
23
+ /** A too-old agy cannot be fixed by the official installer (it no-ops on an
24
+ * existing install); the CLI updates itself, so the remedy is `agy update`. */
25
+ export function agyUpdateMessage(version: string, floor: string): string {
26
+ return `agy ${version} is too old for this engine; run \`agy update\` in a terminal to upgrade to ${floor} or newer (the official installer cannot upgrade an existing install).`;
27
+ }
22
28
  /** Highest agy release where the top-level --gemini_dir flag was
23
29
  * live-verified to isolate MCP discovery (issue #14 work, 2026-11-13).
24
30
  * The flag is undocumented upstream and may change shape in future