omp-antigravity-acp-provider 0.1.11 → 0.1.12

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/README.md CHANGED
@@ -19,7 +19,7 @@ The repository keeps the OMP adapter sources separately and installs upstream ve
19
19
 
20
20
  ## Status
21
21
 
22
- Version 0.1.11 supports all models advertised by the official ACP server. Tested with macOS, OMP 18.12.3, upstream provider 0.1.15 and official ACP runtime 1.4.1. Other platforms and OMP versions are not yet verified.
22
+ Version 0.1.12 supports all models advertised by the official ACP server. Tested with macOS, OMP 18.12.3, upstream provider 0.1.15 and official ACP runtime 1.4.1. Other platforms and OMP versions are not yet verified.
23
23
 
24
24
  Google's consumer-plan policies can restrict third-party agent access even through the official CLI or ACP executable. An official transport does not establish permission to use a subscription in OMP. Check the current [Antigravity FAQ](https://www.antigravity.google/docs/faq/) and [terms](https://antigravity.google/terms) for your account.
25
25
 
@@ -56,7 +56,7 @@ Or, inside OMP:
56
56
 
57
57
  Select **omp-antigravity-acp-provider** in the browser, install it, and restart OMP to load the provider.
58
58
 
59
- OMP's marketplace installer currently copies Git content without installing npm dependencies. This marketplace therefore ships a small source launcher that retrieves the exact published **0.1.11** prebuilt npm adapter and production dependencies on first load. It disables npm install scripts, skips Pi CLI peer installation, and performs no local compilation. Node.js 22.19+ and npm must be on PATH. First preparation needs internet access and roughly **150 MiB** of disk space; later loads reuse the installed cache without npm network access.
59
+ OMP's marketplace installer currently copies Git content without installing npm dependencies. This marketplace therefore ships a small source launcher that retrieves the exact published **0.1.12** prebuilt npm adapter and production dependencies on first load. It disables npm install scripts, skips Pi CLI peer installation, and performs no local compilation. Node.js 22.19+ and npm must be on PATH. First preparation needs internet access and roughly **150 MiB** of disk space; later loads reuse the installed cache without npm network access.
60
60
 
61
61
  The launcher stores its versioned dependencies in `.runtime/` inside the installed marketplace plugin's cache directory. Uninstalling the marketplace plugin removes that cache when it is no longer referenced by another scope. Google credentials and the separately downloaded official ACP runtime are unaffected.
62
62
 
@@ -80,7 +80,7 @@ omp plugin install npm:omp-antigravity-acp-provider
80
80
  To pin a specific release:
81
81
 
82
82
  ```sh
83
- omp plugin install npm:omp-antigravity-acp-provider@0.1.11
83
+ omp plugin install npm:omp-antigravity-acp-provider@0.1.12
84
84
  ```
85
85
 
86
86
  Restart OMP after installation. The npm package includes the built adapter; users do not need esbuild or a manual build step. Disable any older ACP adapter for the same provider before loading this package.
@@ -139,6 +139,8 @@ This repository does not change an existing OMP installation or overwrite its se
139
139
 
140
140
  `/antigravity-acp login` runs the same Google authorization through a command dialog without touching OMP's stored account record; use it to re-authenticate or switch the Antigravity-side Google account. `/antigravity-acp account` shows the current authentication state on both sides.
141
141
 
142
+ Both login paths always start a fresh Google sign-in: stored Antigravity credentials are cleared first, so the Google account chooser is always offered and a saved login cannot silently keep the previous account. The Google browser session itself is outside this adapter's control; pick the intended account (or "Use another account") on Google's consent screen.
143
+
142
144
  First use or login may download the official runtime. The observed macOS runtime occupies about **383 MiB**; size varies by platform/version. It lives outside this repository under `~/.local/opt/agy-acp/`. Do not remove it while ACP processes are running.
143
145
 
144
146
  If OMP's `enabledModels` whitelist is configured, add `antigravity-acp/*` alongside your existing entries in `~/.omp/agent/config.yml` to allow newly discovered models. Use individual `antigravity-acp/<server-model-id>` entries instead if you prefer a restricted list. The adapter does not rewrite that whitelist or any model-role preset.
@@ -177,7 +179,7 @@ The initial permission mode follows upstream configuration, whose default is `yo
177
179
 
178
180
  ### Sign out
179
181
 
180
- OMP's oauth contract has no provider-side logout hook, so `/logout` by itself only removes OMP's stored non-secret marker record. This adapter watches the credential store and finishes the Antigravity-side logout automatically: after `/logout` removes the marker, it closes this process's ACP runtimes, clears saved ACP session mappings, deletes the local token file and the settings auth choice, and removes the matching macOS keychain entry, then confirms with a notification. The cleanup waits for in-flight Antigravity requests to finish, a re-login before it runs cancels it, and automatic credential soft-disables (for example an expired refresh grant) never trigger it. Set `OMP_ACP_FOLLOW_LOGOUT=0` before starting OMP to keep OMP's `/logout` marker-only. `/antigravity-acp logout` performs the same complete logout in one command without waiting for OMP; it refuses to run while Antigravity requests are active. If its OMP-marker removal is unavailable through the host API, the command says so and OMP's `/logout` finishes that part.
182
+ OMP's oauth contract has no provider-side logout hook, so `/logout` by itself only removes OMP's stored non-secret marker record. This adapter watches the credential store and finishes the Antigravity-side logout automatically: after `/logout` removes the marker, it closes this process's ACP runtimes, clears saved ACP session mappings, deletes the local token file and the settings auth choice, and removes the matching macOS keychain entry, then confirms with one line (`/antigravity-acp account` shows the details). The keychain removal waits for this adapter's ACP server processes to fully exit and verifies the deletion, because a dying server can flush its token back. The cleanup waits for in-flight Antigravity requests to finish, a re-login before it runs cancels it, and automatic credential soft-disables (for example an expired refresh grant) never trigger it. Set `OMP_ACP_FOLLOW_LOGOUT=0` before starting OMP to keep OMP's `/logout` marker-only. `/antigravity-acp logout` performs the same complete logout in one command without waiting for OMP; it refuses to run while Antigravity requests are active. If its OMP-marker removal is unavailable through the host API, the command says so and OMP's `/logout` finishes that part.
181
183
 
182
184
  The debug switch controls gray `[Antigravity tool: …]` and `[Antigravity tool update: …]` lines. It defaults to off and applies immediately to this process's active ACP connections. Normal OMP tool displays/results, real thought chunks and plan messages are preserved. The option is saved as `debugToolUpdates` in `omp-tools.json` alongside `nativeTools`; toggling either option preserves the other. Existing policy files without the debug field default to off. Other OMP processes need a restart to read a setting changed elsewhere. `OMP_ACP_TRACE=1` is a separate, opt-in terminal diagnostic setting.
183
185
 
@@ -12,7 +12,7 @@ import { EFFORTS, projectCatalog, readModels, selectRuntimeModel } from "./model
12
12
  import { advertisedRecord, choices, selector } from "./selectors.ts";
13
13
  import { TOOL_ROUTING, parseNativeToolMode } from "./tool-routing.ts";
14
14
  import { loadNativeToolMode, loadToolPolicy, saveNativeToolMode, saveDebugToolUpdates } from "./tool-policy.ts";
15
- import { Type, createAntigravityProvider, AntigravityRuntime, PERMISSION_TOOL_NAME, PERMISSION_RESULT_KIND, loadConfig, savePermissionMode, inspectAntigravityAuth, hasAntigravityAuth, AcpSessionStore, ensureAntigravityAcpReady, TierConnection, planToolProjection, PiEventWriter, SessionCleanup } from "./runtime.mjs";
15
+ import { Type, createAntigravityProvider, AntigravityRuntime, PERMISSION_TOOL_NAME, PERMISSION_RESULT_KIND, loadConfig, savePermissionMode, inspectAntigravityAuth, hasAntigravityAuth, clearAntigravityCredentials, describeCredentialStorage, AcpSessionStore, ensureAntigravityAcpReady, TierConnection, planToolProjection, PiEventWriter, SessionCleanup } from "./runtime.mjs";
16
16
 
17
17
  const MARKER = "pi-antigravity-acp:managed-by-antigravity";
18
18
 
@@ -54,7 +54,7 @@ function ompCredentialSummary(ctx: any) {
54
54
  if (!stored) return { present: false };
55
55
  return {
56
56
  present: true,
57
- record: stored.refresh === MARKER ? "managed marker (non-secret)" : "oauth",
57
+ record: stored.refresh === MARKER ? "non-secret managed marker" : "oauth credential",
58
58
  authorizedAt: typeof stored.authorizedAt === "number" ? new Date(stored.authorizedAt).toISOString() : undefined,
59
59
  };
60
60
  } catch (error: any) {
@@ -139,6 +139,33 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
139
139
  return Boolean(ctx?.modelRegistry?.authStorage?.credentials?.getOAuth?.("antigravity-acp"));
140
140
  } catch { return undefined; }
141
141
  }
142
+ // A dying ACP server can flush its in-memory token back to the keychain,
143
+ // racing a plain deletion and restoring the previous account. Wait for this
144
+ // adapter's server processes to fully exit first, then verify the removal.
145
+ async function removeKeychainCredentialDurably(): Promise<boolean | undefined> {
146
+ const pending = [...connections].map(connection => connection.process.exited.catch(() => undefined));
147
+ if (pending.length > 0) {
148
+ await Promise.race([Promise.allSettled(pending), new Promise(resolve => setTimeout(resolve, 10_000))]);
149
+ }
150
+ for (let attempt = 0; attempt < 3; attempt++) {
151
+ if (keychain.present() === false) return true;
152
+ const removed = keychain.remove();
153
+ if (removed !== true) return removed;
154
+ await new Promise(resolve => setTimeout(resolve, 400));
155
+ }
156
+ return keychain.present() === false;
157
+ }
158
+ // /login must mean a fresh Google sign-in: drop stored credentials (and this
159
+ // process's old-account servers) so a new server cannot silently reuse the
160
+ // saved login and keep the previous account.
161
+ async function beginFreshGoogleLogin() {
162
+ if (runtimes.values().some(bundle => bundle.isBusy())) {
163
+ throw new Error("Wait for active Antigravity requests to finish before logging in.");
164
+ }
165
+ await runtimes.closeAll();
166
+ clearAntigravityCredentials();
167
+ keychain.remove();
168
+ }
142
169
  async function finishFollowedLogout(ctx: any) {
143
170
  if (runtimes.values().some(bundle => bundle.isBusy())) {
144
171
  // Never interrupt an in-flight Antigravity request; retry once idle.
@@ -153,16 +180,13 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
153
180
  runtimes.get();
154
181
  await Promise.all(runtimes.values().map(bundle => bundle.runtime.logout()));
155
182
  await runtimes.closeAll();
156
- const keychainRemoved = keychain.remove();
157
- const after = inspectAntigravityAuth();
183
+ const keychainRemoved = await removeKeychainCredentialDurably();
184
+ // Keep the confirmation terse; /antigravity-acp account shows the details.
185
+ const cleared = ["Google credentials", "saved ACP sessions"];
186
+ if (keychainRemoved === true) cleared.push("the macOS keychain entry");
187
+ const list = cleared.slice(0, -1).join(", ") + " and " + cleared[cleared.length - 1];
158
188
  try {
159
- ctx?.ui?.notify?.([
160
- "Antigravity ACP: finished the logout OMP started.",
161
- `ACP auth after logout: ${after.status}${after.authType ? ` (${after.authType})` : ""}`,
162
- `macOS keychain entry: ${keychainRemoved === undefined ? "not applicable (non-macOS)" : keychainRemoved ? "removed" : "not present or not removable"}`,
163
- "Saved ACP sessions: cleared",
164
- "Run /antigravity-acp login or OMP /login to sign in again.",
165
- ].join("\n"), "info");
189
+ ctx?.ui?.notify?.(`Antigravity ACP: finished the logout OMP started — ${list} cleared.${keychainRemoved === false ? " The macOS keychain entry was not present or not removable." : ""}`, "info");
166
190
  } catch { /* the host UI may already be gone */ }
167
191
  }
168
192
  function watchOmpCredentials(ctx: any) {
@@ -278,6 +302,7 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
278
302
  if (command === "login") {
279
303
  if (value) throw new Error("Usage: /antigravity-acp login");
280
304
  await prepareRuntime();
305
+ await beginFreshGoogleLogin();
281
306
  // Direct Antigravity Google login through the command UI. OMP's /login
282
307
  // runs the same flow and additionally stores the provider marker.
283
308
  await runtimes.get().provider.auth.oauth.login({
@@ -294,7 +319,7 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
294
319
  },
295
320
  });
296
321
  const auth = inspectAntigravityAuth();
297
- ctx.ui.notify(`Antigravity Google login finished. ACP auth: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}.\nRun /antigravity-acp account to inspect the stored state, or OMP /login to also record the provider marker in OMP's account list.`, "info");
322
+ ctx.ui.notify(`Antigravity Google login finished — fresh sign-in; ACP auth: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}.`, "info");
298
323
  return;
299
324
  }
300
325
  if (command === "logout") {
@@ -308,20 +333,17 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
308
333
  // removes the local token file plus the settings auth choice.
309
334
  await Promise.all(runtimes.values().map(bundle => bundle.runtime.logout()));
310
335
  await runtimes.closeAll();
311
- const keychainRemoved = keychain.remove();
336
+ const keychainRemoved = await removeKeychainCredentialDurably();
312
337
  // Removing the marker ourselves must not trigger the follow-up logout.
313
338
  selfLogout = true;
314
339
  let ompMarker: "removed" | "absent" | "unavailable";
315
340
  try { ompMarker = await removeOmpCredentialRecord(ctx); } finally { selfLogout = false; }
316
- const after = inspectAntigravityAuth();
317
- ctx.ui.notify([
318
- "Antigravity ACP logout",
319
- `ACP auth after logout: ${after.status}${after.authType ? ` (${after.authType})` : ""}`,
320
- `macOS keychain entry: ${keychainRemoved === undefined ? "not applicable (non-macOS)" : keychainRemoved ? "removed" : "not present or not removable"}`,
321
- "Saved ACP sessions: cleared",
322
- `OMP marker record: ${ompMarker === "removed" ? "removed" : ompMarker === "absent" ? "was not stored" : "could not be removed; run /logout to drop it"}`,
323
- "Run /antigravity-acp login or OMP /login to sign in again.",
324
- ].join("\n"), "info");
341
+ // Keep the confirmation terse; /antigravity-acp account shows the details.
342
+ const cleared = ["Google credentials", "saved ACP sessions"];
343
+ if (keychainRemoved === true) cleared.push("the macOS keychain entry");
344
+ if (ompMarker === "removed") cleared.push("the OMP marker record");
345
+ const list = cleared.slice(0, -1).join(", ") + " and " + cleared[cleared.length - 1];
346
+ ctx.ui.notify(`Antigravity ACP: logged out — ${list} cleared.${ompMarker === "unavailable" ? " The OMP marker record could not be removed; run /logout to drop it." : ""}${keychainRemoved === false ? " The macOS keychain entry was not present or not removable." : ""}`, "info");
325
347
  return;
326
348
  }
327
349
  if (command === "account") {
@@ -329,17 +351,25 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
329
351
  const auth = inspectAntigravityAuth();
330
352
  let ompSource: string | undefined;
331
353
  try { ompSource = ctx?.modelRegistry?.authStorage?.keys?.describe?.("antigravity-acp", sessionIdOf(ctx)); } catch { /* host version dependent */ }
332
- const snapshot = await runtimes.get(sessionIdOf(ctx)).runtime.snapshot();
333
- ctx.ui.notify(JSON.stringify({
334
- provider: "antigravity-acp",
335
- ompCredential: ompCredentialSummary(ctx),
336
- ompAuthSource: ompSource,
337
- acpAuth: { status: auth.status, authType: auth.authType, tokenFile: auth.tokenFile, settingsFile: auth.settingsFile, usable: authReady() },
338
- macOSKeychainEntry: keychain.present(),
339
- savedAcpSessions: runtimes.get(sessionIdOf(ctx)).runtime.sessionStore?.read().length ?? 0,
340
- runtime: { permissionMode: snapshot.permissionMode, activeSessions: snapshot.bindings },
341
- note: "Google OAuth tokens stay in Antigravity-owned storage (~/.gemini/antigravity-acp or the macOS keychain). OMP stores only a non-secret marker. /antigravity-acp logout clears both sides in one command; OMP /logout also triggers the Antigravity-side cleanup automatically (set OMP_ACP_FOLLOW_LOGOUT=0 to disable).",
342
- }, null, 2), "info");
354
+ const runtime = runtimes.get(sessionIdOf(ctx)).runtime;
355
+ const snapshot = await runtime.snapshot();
356
+ const omp = ompCredentialSummary(ctx);
357
+ const marker = omp.present === undefined ? "unknown (host did not expose the credential store)"
358
+ : omp.present ? `present, authorized ${omp.authorizedAt ?? "unknown time"} (${omp.record})`
359
+ : "not stored; run /login or /antigravity-acp login";
360
+ // Mirrors the upstream provider's status/doctor wording for the shared
361
+ // fields, with OMP-specific lines in the same style.
362
+ ctx.ui.notify([
363
+ "Antigravity ACP account",
364
+ `Authentication: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}`,
365
+ `Credential storage (preflight): ${describeCredentialStorage()}`,
366
+ `OMP marker record: ${marker}`,
367
+ ompSource ? `OMP auth source: ${ompSource}` : undefined,
368
+ `Saved ACP sessions: ${runtime.sessionStore?.read().length ?? 0}`,
369
+ `Requested permission mode: ${snapshot.permissionMode === "auto_edit" ? "auto-edit" : snapshot.permissionMode}`,
370
+ `Active bindings: ${snapshot.bindings}`,
371
+ "Google OAuth tokens stay in Antigravity-owned storage; OMP stores only a non-secret marker. /antigravity-acp logout clears both sides; OMP /logout also finishes the Antigravity-side cleanup.",
372
+ ].filter(Boolean).join("\n"), "info");
343
373
  return;
344
374
  }
345
375
  const { runtime } = runtimes.get(sessionIdOf(ctx));
@@ -505,6 +535,9 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
505
535
  name: "Google Antigravity (ACP)",
506
536
  async login(callbacks: any) {
507
537
  await prepareRuntime();
538
+ // Always offer a fresh Google sign-in; without this a new server
539
+ // process silently reuses the saved login and keeps the old account.
540
+ await beginFreshGoogleLogin();
508
541
  return runtimes.get().provider.auth.oauth.login({
509
542
  signal: callbacks.signal,
510
543
  notify(event: any) {
@@ -43549,6 +43549,21 @@ function applyCredentialStorageEnvironment(baseEnv = process.env, options = {})
43549
43549
  const decision = resolveCredentialStorageDecision({ ...options, env: baseEnv });
43550
43550
  return { ...baseEnv, ...decision.env };
43551
43551
  }
43552
+ function describeCredentialStorage(options = {}) {
43553
+ const decision = resolveCredentialStorageDecision(options);
43554
+ switch (decision.reason) {
43555
+ case "missing-keychain-entry":
43556
+ return `secure file (expected: keychain entry ${KEYCHAIN_SERVICE}/${KEYCHAIN_ACCOUNT} is absent, so spawned server processes are pinned with ${FORCE_FILE_STORAGE_ENV}=1)`;
43557
+ case "keychain-entry-present":
43558
+ return `macOS keychain (expected: keychain entry ${KEYCHAIN_SERVICE}/${KEYCHAIN_ACCOUNT} is present)`;
43559
+ case "explicit-override":
43560
+ return `${FORCE_FILE_STORAGE_ENV} set by the user`;
43561
+ case "no-refreshable-token-file":
43562
+ return "server default (expected: no refreshable token file to reuse)";
43563
+ default:
43564
+ return "server default (secure file)";
43565
+ }
43566
+ }
43552
43567
 
43553
43568
  // node_modules/pi-antigravity-acp-provider/src/acp/process.ts
43554
43569
  var STDERR_LIMIT = 16 * 1024;
@@ -60988,7 +61003,9 @@ export {
60988
61003
  SessionCleanup,
60989
61004
  TierConnection,
60990
61005
  typebox_exports as Type,
61006
+ clearAntigravityCredentials,
60991
61007
  createAntigravityProvider,
61008
+ describeCredentialStorage,
60992
61009
  ensureAntigravityAcpReady,
60993
61010
  hasAntigravityAuth,
60994
61011
  inspectAntigravityAuth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-antigravity-acp-provider",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Google Antigravity ACP provider for Oh My Pi (OMP), with tool bridging and per-model thinking; derived from zacbemis/pi-antigravity-acp-provider",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/scripts/build.mjs CHANGED
@@ -11,7 +11,8 @@ const exports = [
11
11
  ["createAntigravityProvider", "provider.ts"],
12
12
  ["AntigravityRuntime, PERMISSION_TOOL_NAME, PERMISSION_RESULT_KIND", "runtime.ts"],
13
13
  ["loadConfig, savePermissionMode", "config.ts"],
14
- ["inspectAntigravityAuth, hasAntigravityAuth", "acp/antigravity.ts"],
14
+ ["inspectAntigravityAuth, hasAntigravityAuth, clearAntigravityCredentials", "acp/antigravity.ts"],
15
+ ["describeCredentialStorage", "acp/credential-storage.ts"],
15
16
  ["projectModels", "models.ts"],
16
17
  ["AcpSessionStore", "acp/session-store.ts"],
17
18
  ["ensureAntigravityAcpReady", "acp/setup.ts"],