omp-antigravity-acp-provider 0.1.12 → 0.1.13

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.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.
22
+ Version 0.1.13 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.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.
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.13** 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.12
83
+ omp plugin install npm:omp-antigravity-acp-provider@0.1.13
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.
@@ -151,7 +151,7 @@ After upgrading from an older adapter, run `/antigravity-acp refresh` once to re
151
151
 
152
152
  | Command | Purpose |
153
153
  | --- | --- |
154
- | `/antigravity-acp account` | Authentication state on both the OMP and Antigravity sides |
154
+ | `/antigravity-acp account` | Signed-in Google account and authentication state on both the OMP and Antigravity sides |
155
155
  | `/antigravity-acp login` | Run the Antigravity Google authorization in a command dialog |
156
156
  | `/antigravity-acp logout` | Clear Antigravity credentials, saved ACP sessions and OMP's marker record |
157
157
  | `/antigravity-acp status` | Runtime, confirmed thinking and usage information |
@@ -181,6 +181,8 @@ The initial permission mode follows upstream configuration, whose default is `yo
181
181
 
182
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.
183
183
 
184
+ The logout only touches ACP-owned state: the `antigravity-acp` keychain item and the `~/.gemini/antigravity-acp/` directory. The separate `gemini`/`antigravity` keychain item and files such as `~/.gemini/jetski-standalone-oauth-token` belong to the agy CLI/Antigravity IDE and are intentionally left alone; logging those out is out of scope for this adapter.
185
+
184
186
  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.
185
187
 
186
188
  ## OMP tool routing and native-tool mode
@@ -317,7 +319,7 @@ See the [0.1.8 context/compaction and usage benchmark](docs/context-compaction-0
317
319
 
318
320
  `npm run test:usage` uses Bun and mocked protocol responses to verify restored-session baselines, counter resets, query failures and advertised-command gating without starting ACP. `bun scripts/verify-continuity-live.ts --live` is a separate Flash-only probe of long history, synthetic tools, usage accounting and idle process reclamation/restoration; it consumes quota. Its one-second idle setting is isolated to the test process and is not the production default.
319
321
 
320
- `npm run test:auth` uses Bun with an isolated `GEMINI_HOME`, a stubbed keychain and a stubbed OAuth flow to verify the account view, login dialog mapping, logout cleanup, the active-request guard and the credential-store watch behind OMP-logout following (removal, automatic-disable suppression, re-login cancellation, opt-out and busy deferral) without starting ACP. Real Google login and logout change account state, so they are not part of any automated test.
322
+ `npm run test:auth` uses Bun with an isolated `GEMINI_HOME`, a stubbed keychain and a stubbed OAuth flow to verify the account view (including Google-account email extraction from the stored id_token), login dialog mapping, logout cleanup, the active-request guard and the credential-store watch behind OMP-logout following (removal, automatic-disable suppression, re-login cancellation, opt-out and busy deferral) without starting ACP. Real Google login and logout change account state, so they are not part of any automated test.
321
323
 
322
324
  `npm run test:packed` additionally requires OMP on PATH. It installs the exact npm tarball into a temporary consumer directory with development dependencies omitted and install scripts disabled, checks runtime assets, and loads its model catalog with ACP execution disabled. It downloads production dependencies and removes the temporary installation afterward.
323
325
 
@@ -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, clearAntigravityCredentials, describeCredentialStorage, 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, resolveAntigravityAcpDirectory, describeCredentialStorage, AcpSessionStore, ensureAntigravityAcpReady, TierConnection, planToolProjection, PiEventWriter, SessionCleanup } from "./runtime.mjs";
16
16
 
17
17
  const MARKER = "pi-antigravity-acp:managed-by-antigravity";
18
18
 
@@ -36,8 +36,36 @@ export const keychain = {
36
36
  return true;
37
37
  } catch { return false; }
38
38
  },
39
+ // Extract only the email claim from the ACP item's stored id_token. The
40
+ // token bytes stay in this process and are never logged or persisted; the
41
+ // agy CLI's separate keychain item is never read.
42
+ accountEmail(): string | undefined {
43
+ if (process.platform !== "darwin") return undefined;
44
+ try {
45
+ const raw = execFileSync("/usr/bin/security", ["find-generic-password", "-s", "gemini", "-a", "antigravity-acp", "-w"], { timeout: 3000 });
46
+ return emailFromTokenJson(raw.toString("utf8"));
47
+ } catch { return undefined; }
48
+ },
39
49
  };
40
50
 
51
+ function emailFromTokenJson(raw: string): string | undefined {
52
+ try {
53
+ const idToken = JSON.parse(raw)?.id_token;
54
+ if (typeof idToken !== "string" || !idToken.includes(".")) return undefined;
55
+ const claims = JSON.parse(Buffer.from(idToken.split(".")[1], "base64url").toString("utf8"));
56
+ return typeof claims.email === "string" && claims.email.includes("@") ? claims.email : undefined;
57
+ } catch { return undefined; }
58
+ }
59
+
60
+ // The signed-in Google account, from the ACP server's own stored token. The
61
+ // token file is preferred because it needs no keychain access.
62
+ function antigravityAccountEmail(): string | undefined {
63
+ try {
64
+ return emailFromTokenJson(fs.readFileSync(path.join(resolveAntigravityAcpDirectory(), "acp_token.json"), "utf8"));
65
+ } catch { /* keychain storage or signed out */ }
66
+ return keychain.accountEmail();
67
+ }
68
+
41
69
  // Timing knobs for following OMP-side logouts; mutable so offline tests can
42
70
  // run the delayed detection without real waits.
43
71
  export const logoutFollow = { delayMs: 500, retryMs: 15_000 };
@@ -55,6 +83,7 @@ function ompCredentialSummary(ctx: any) {
55
83
  return {
56
84
  present: true,
57
85
  record: stored.refresh === MARKER ? "non-secret managed marker" : "oauth credential",
86
+ email: typeof stored.email === "string" && stored.email ? stored.email : undefined,
58
87
  authorizedAt: typeof stored.authorizedAt === "number" ? new Date(stored.authorizedAt).toISOString() : undefined,
59
88
  };
60
89
  } catch (error: any) {
@@ -319,7 +348,8 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
319
348
  },
320
349
  });
321
350
  const auth = inspectAntigravityAuth();
322
- ctx.ui.notify(`Antigravity Google login finished — fresh sign-in; ACP auth: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}.`, "info");
351
+ const email = antigravityAccountEmail();
352
+ ctx.ui.notify(`Antigravity Google login finished${email ? ` as ${email}` : ""} — fresh sign-in; ACP auth: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}.`, "info");
323
353
  return;
324
354
  }
325
355
  if (command === "logout") {
@@ -355,12 +385,13 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
355
385
  const snapshot = await runtime.snapshot();
356
386
  const omp = ompCredentialSummary(ctx);
357
387
  const marker = omp.present === undefined ? "unknown (host did not expose the credential store)"
358
- : omp.present ? `present, authorized ${omp.authorizedAt ?? "unknown time"} (${omp.record})`
388
+ : omp.present ? `present, authorized ${omp.authorizedAt ?? "unknown time"}${omp.email ? ` as ${omp.email}` : ""} (${omp.record})`
359
389
  : "not stored; run /login or /antigravity-acp login";
360
390
  // Mirrors the upstream provider's status/doctor wording for the shared
361
391
  // fields, with OMP-specific lines in the same style.
362
392
  ctx.ui.notify([
363
393
  "Antigravity ACP account",
394
+ `Google account: ${antigravityAccountEmail() ?? "not signed in"}`,
364
395
  `Authentication: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}`,
365
396
  `Credential storage (preflight): ${describeCredentialStorage()}`,
366
397
  `OMP marker record: ${marker}`,
@@ -538,7 +569,7 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
538
569
  // Always offer a fresh Google sign-in; without this a new server
539
570
  // process silently reuses the saved login and keeps the old account.
540
571
  await beginFreshGoogleLogin();
541
- return runtimes.get().provider.auth.oauth.login({
572
+ const result = await runtimes.get().provider.auth.oauth.login({
542
573
  signal: callbacks.signal,
543
574
  notify(event: any) {
544
575
  if (event.links?.length) {
@@ -547,6 +578,10 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
547
578
  },
548
579
  prompt: (request: any) => callbacks.onPrompt({ message: request.message, placeholder: request.placeholder }),
549
580
  });
581
+ // Record the signed-in account on the marker credential so OMP's
582
+ // account list can label it; the email is identity data, not a secret.
583
+ const email = antigravityAccountEmail();
584
+ return email ? { ...result, email } : result;
550
585
  },
551
586
  refreshToken: (credentials: any) => runtimes.get().provider.auth.oauth.refresh(credentials),
552
587
  getApiKey: () => MARKER,
@@ -61012,6 +61012,7 @@ export {
61012
61012
  loadConfig,
61013
61013
  planToolProjection,
61014
61014
  projectModels,
61015
+ resolveAntigravityAcpDirectory,
61015
61016
  savePermissionMode
61016
61017
  };
61017
61018
  /*! Bundled license information:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-antigravity-acp-provider",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
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,7 @@ 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, clearAntigravityCredentials", "acp/antigravity.ts"],
14
+ ["inspectAntigravityAuth, hasAntigravityAuth, clearAntigravityCredentials, resolveAntigravityAcpDirectory", "acp/antigravity.ts"],
15
15
  ["describeCredentialStorage", "acp/credential-storage.ts"],
16
16
  ["projectModels", "models.ts"],
17
17
  ["AcpSessionStore", "acp/session-store.ts"],