TypeScript
fix(editors): stop treating the agy CLI as the Antigravity IDE (#7079)
Ishaan Kothari1e844a3d0647
diff --git a/apps/server/src/process/externalLauncher.test.ts b/apps/server/src/process/externalLauncher.test.tsindex f714a70f783..aab4d78f4d7 100644--- a/apps/server/src/process/externalLauncher.test.ts+++ b/apps/server/src/process/externalLauncher.test.ts@@ -923,6 +923,18 @@ it.effect("discovers editors through the service API", () =>);for (const { platform, installPath, editor, args } of [+ {+ platform: "darwin",+ installPath: "Applications/Antigravity IDE.app/Contents/Resources/app/bin/antigravity-ide",+ editor: "antigravity",+ args: ["--goto", "/workspace with spaces/file.ts:12:4"],+ },+ {+ platform: "linux",+ installPath: ".local/bin/antigravity-ide",+ editor: "antigravity",+ args: ["--goto", "/workspace with spaces/file.ts:12:4"],+ },{platform: "darwin",installPath: "Applications/Cursor.app/Contents/Resources/app/bin/code",@@ -1028,6 +1040,45 @@ for (const { platform, installPath, editor, args } of [);}+// `agy` is the standalone Antigravity CLI, which installs to ~/.local/bin on+// macOS and Linux and to its own bin folder on Windows. It is not the IDE.+for (const { platform, installPath, onPath } of [+ { platform: "darwin", installPath: ".local/bin/agy", onPath: true },+ { platform: "linux", installPath: ".local/bin/agy", onPath: false },+ { platform: "win32", installPath: "agy/bin/agy.cmd", onPath: true },+] as const) {+ it.effect.skipIf(windowsHost && platform !== "win32")(+ `does not report the agy CLI as the Antigravity IDE on ${platform}`,+ () =>+ Effect.gen(function* () {+ const fs = yield* FileSystem.FileSystem;+ const path = yield* Path.Path;+ const home = yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-cli-" });+ const executable = path.join(home, installPath);+ yield* fs.makeDirectory(path.dirname(executable), { recursive: true });+ yield* fs.writeFileString(executable, "#!/bin/sh\n");+ yield* fs.chmod(executable, 0o755);+ const editors = yield* Effect.gen(function* () {+ const launcher = yield* ExternalLauncher.ExternalLauncher;+ return yield* launcher.resolveAvailableEditors();+ }).pipe(+ Effect.provide(+ testLayer({+ platform,+ env: {+ HOME: home,+ LOCALAPPDATA: home,+ PATH: onPath ? path.dirname(executable) : path.join(home, "empty"),+ PATHEXT: ".COM;.EXE;.BAT;.CMD",+ },+ }),+ ),+ );+ assert.notInclude(editors, "antigravity");+ }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),+ );+}+it.effect.skipIf(windowsHost)("ignores unusable app bundles and keeps PATH launchers first", () =>Effect.gen(function* () {const fs = yield* FileSystem.FileSystem;diff --git a/packages/contracts/src/editor.ts b/packages/contracts/src/editor.tsindex 88028b79699..55f16e1e012 100644--- a/packages/contracts/src/editor.ts+++ b/packages/contracts/src/editor.ts@@ -59,7 +59,14 @@ export const EDITORS = [launchStyle: "direct-path",remoteScheme: "zed",},- { id: "antigravity", label: "Antigravity", commands: ["agy"], launchStyle: "goto" },+ {+ id: "antigravity",+ label: "Antigravity",+ // `agy` is the standalone Antigravity CLI, not the IDE. The IDE bundle+ // ships `antigravity-ide`, so it comes first for install-folder lookups.+ commands: ["antigravity-ide", "agy-ide"],+ launchStyle: "goto",+ },{ id: "idea", label: "IntelliJ IDEA", commands: ["idea"], launchStyle: "line-column" },{ id: "aqua", label: "Aqua", commands: ["aqua"], launchStyle: "line-column" },{ id: "clion", label: "CLion", commands: ["clion"], launchStyle: "line-column" },diff --git a/packages/shared/src/editor.ts b/packages/shared/src/editor.tsindex cc6def9d01e..1584f3a201d 100644--- a/packages/shared/src/editor.ts+++ b/packages/shared/src/editor.ts@@ -12,6 +12,8 @@ type Editor = (typeof EDITORS)[number];const installNames: Partial<Record<Editor["id"], ReadonlyArray<string>>> = {vscode: ["Visual Studio Code"],"vscode-insiders": ["Visual Studio Code - Insiders"],+ // `Antigravity.app` is the separate Hub, not the IDE.+ antigravity: ["Antigravity IDE"],idea: ["IntelliJ IDEA", "IntelliJ IDEA CE", "IntelliJ IDEA Ultimate"],pycharm: ["PyCharm", "PyCharm CE"],rider: ["Rider", "JetBrains Rider"],