omp-antigravity-acp-provider 0.1.11 → 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 +10 -6
- package/extension/index.ts +102 -34
- package/extension/runtime.mjs +18 -0
- package/package.json +1 -1
- package/scripts/build.mjs +2 -1
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.
|
|
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.
|
|
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.
|
|
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.
|
|
@@ -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.
|
|
@@ -149,7 +151,7 @@ After upgrading from an older adapter, run `/antigravity-acp refresh` once to re
|
|
|
149
151
|
|
|
150
152
|
| Command | Purpose |
|
|
151
153
|
| --- | --- |
|
|
152
|
-
| `/antigravity-acp account` |
|
|
154
|
+
| `/antigravity-acp account` | Signed-in Google account and authentication state on both the OMP and Antigravity sides |
|
|
153
155
|
| `/antigravity-acp login` | Run the Antigravity Google authorization in a command dialog |
|
|
154
156
|
| `/antigravity-acp logout` | Clear Antigravity credentials, saved ACP sessions and OMP's marker record |
|
|
155
157
|
| `/antigravity-acp status` | Runtime, confirmed thinking and usage information |
|
|
@@ -177,7 +179,9 @@ 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
|
|
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
|
+
|
|
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.
|
|
181
185
|
|
|
182
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.
|
|
183
187
|
|
|
@@ -315,7 +319,7 @@ See the [0.1.8 context/compaction and usage benchmark](docs/context-compaction-0
|
|
|
315
319
|
|
|
316
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.
|
|
317
321
|
|
|
318
|
-
`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.
|
|
319
323
|
|
|
320
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.
|
|
321
325
|
|
package/extension/index.ts
CHANGED
|
@@ -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, 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 };
|
|
@@ -54,7 +82,8 @@ function ompCredentialSummary(ctx: any) {
|
|
|
54
82
|
if (!stored) return { present: false };
|
|
55
83
|
return {
|
|
56
84
|
present: true,
|
|
57
|
-
record: stored.refresh === MARKER ? "managed marker
|
|
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) {
|
|
@@ -139,6 +168,33 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
139
168
|
return Boolean(ctx?.modelRegistry?.authStorage?.credentials?.getOAuth?.("antigravity-acp"));
|
|
140
169
|
} catch { return undefined; }
|
|
141
170
|
}
|
|
171
|
+
// A dying ACP server can flush its in-memory token back to the keychain,
|
|
172
|
+
// racing a plain deletion and restoring the previous account. Wait for this
|
|
173
|
+
// adapter's server processes to fully exit first, then verify the removal.
|
|
174
|
+
async function removeKeychainCredentialDurably(): Promise<boolean | undefined> {
|
|
175
|
+
const pending = [...connections].map(connection => connection.process.exited.catch(() => undefined));
|
|
176
|
+
if (pending.length > 0) {
|
|
177
|
+
await Promise.race([Promise.allSettled(pending), new Promise(resolve => setTimeout(resolve, 10_000))]);
|
|
178
|
+
}
|
|
179
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
180
|
+
if (keychain.present() === false) return true;
|
|
181
|
+
const removed = keychain.remove();
|
|
182
|
+
if (removed !== true) return removed;
|
|
183
|
+
await new Promise(resolve => setTimeout(resolve, 400));
|
|
184
|
+
}
|
|
185
|
+
return keychain.present() === false;
|
|
186
|
+
}
|
|
187
|
+
// /login must mean a fresh Google sign-in: drop stored credentials (and this
|
|
188
|
+
// process's old-account servers) so a new server cannot silently reuse the
|
|
189
|
+
// saved login and keep the previous account.
|
|
190
|
+
async function beginFreshGoogleLogin() {
|
|
191
|
+
if (runtimes.values().some(bundle => bundle.isBusy())) {
|
|
192
|
+
throw new Error("Wait for active Antigravity requests to finish before logging in.");
|
|
193
|
+
}
|
|
194
|
+
await runtimes.closeAll();
|
|
195
|
+
clearAntigravityCredentials();
|
|
196
|
+
keychain.remove();
|
|
197
|
+
}
|
|
142
198
|
async function finishFollowedLogout(ctx: any) {
|
|
143
199
|
if (runtimes.values().some(bundle => bundle.isBusy())) {
|
|
144
200
|
// Never interrupt an in-flight Antigravity request; retry once idle.
|
|
@@ -153,16 +209,13 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
153
209
|
runtimes.get();
|
|
154
210
|
await Promise.all(runtimes.values().map(bundle => bundle.runtime.logout()));
|
|
155
211
|
await runtimes.closeAll();
|
|
156
|
-
const keychainRemoved =
|
|
157
|
-
|
|
212
|
+
const keychainRemoved = await removeKeychainCredentialDurably();
|
|
213
|
+
// Keep the confirmation terse; /antigravity-acp account shows the details.
|
|
214
|
+
const cleared = ["Google credentials", "saved ACP sessions"];
|
|
215
|
+
if (keychainRemoved === true) cleared.push("the macOS keychain entry");
|
|
216
|
+
const list = cleared.slice(0, -1).join(", ") + " and " + cleared[cleared.length - 1];
|
|
158
217
|
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");
|
|
218
|
+
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
219
|
} catch { /* the host UI may already be gone */ }
|
|
167
220
|
}
|
|
168
221
|
function watchOmpCredentials(ctx: any) {
|
|
@@ -278,6 +331,7 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
278
331
|
if (command === "login") {
|
|
279
332
|
if (value) throw new Error("Usage: /antigravity-acp login");
|
|
280
333
|
await prepareRuntime();
|
|
334
|
+
await beginFreshGoogleLogin();
|
|
281
335
|
// Direct Antigravity Google login through the command UI. OMP's /login
|
|
282
336
|
// runs the same flow and additionally stores the provider marker.
|
|
283
337
|
await runtimes.get().provider.auth.oauth.login({
|
|
@@ -294,7 +348,8 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
294
348
|
},
|
|
295
349
|
});
|
|
296
350
|
const auth = inspectAntigravityAuth();
|
|
297
|
-
|
|
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");
|
|
298
353
|
return;
|
|
299
354
|
}
|
|
300
355
|
if (command === "logout") {
|
|
@@ -308,20 +363,17 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
308
363
|
// removes the local token file plus the settings auth choice.
|
|
309
364
|
await Promise.all(runtimes.values().map(bundle => bundle.runtime.logout()));
|
|
310
365
|
await runtimes.closeAll();
|
|
311
|
-
const keychainRemoved =
|
|
366
|
+
const keychainRemoved = await removeKeychainCredentialDurably();
|
|
312
367
|
// Removing the marker ourselves must not trigger the follow-up logout.
|
|
313
368
|
selfLogout = true;
|
|
314
369
|
let ompMarker: "removed" | "absent" | "unavailable";
|
|
315
370
|
try { ompMarker = await removeOmpCredentialRecord(ctx); } finally { selfLogout = false; }
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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");
|
|
371
|
+
// Keep the confirmation terse; /antigravity-acp account shows the details.
|
|
372
|
+
const cleared = ["Google credentials", "saved ACP sessions"];
|
|
373
|
+
if (keychainRemoved === true) cleared.push("the macOS keychain entry");
|
|
374
|
+
if (ompMarker === "removed") cleared.push("the OMP marker record");
|
|
375
|
+
const list = cleared.slice(0, -1).join(", ") + " and " + cleared[cleared.length - 1];
|
|
376
|
+
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
377
|
return;
|
|
326
378
|
}
|
|
327
379
|
if (command === "account") {
|
|
@@ -329,17 +381,26 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
329
381
|
const auth = inspectAntigravityAuth();
|
|
330
382
|
let ompSource: string | undefined;
|
|
331
383
|
try { ompSource = ctx?.modelRegistry?.authStorage?.keys?.describe?.("antigravity-acp", sessionIdOf(ctx)); } catch { /* host version dependent */ }
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
384
|
+
const runtime = runtimes.get(sessionIdOf(ctx)).runtime;
|
|
385
|
+
const snapshot = await runtime.snapshot();
|
|
386
|
+
const omp = ompCredentialSummary(ctx);
|
|
387
|
+
const marker = omp.present === undefined ? "unknown (host did not expose the credential store)"
|
|
388
|
+
: omp.present ? `present, authorized ${omp.authorizedAt ?? "unknown time"}${omp.email ? ` as ${omp.email}` : ""} (${omp.record})`
|
|
389
|
+
: "not stored; run /login or /antigravity-acp login";
|
|
390
|
+
// Mirrors the upstream provider's status/doctor wording for the shared
|
|
391
|
+
// fields, with OMP-specific lines in the same style.
|
|
392
|
+
ctx.ui.notify([
|
|
393
|
+
"Antigravity ACP account",
|
|
394
|
+
`Google account: ${antigravityAccountEmail() ?? "not signed in"}`,
|
|
395
|
+
`Authentication: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}`,
|
|
396
|
+
`Credential storage (preflight): ${describeCredentialStorage()}`,
|
|
397
|
+
`OMP marker record: ${marker}`,
|
|
398
|
+
ompSource ? `OMP auth source: ${ompSource}` : undefined,
|
|
399
|
+
`Saved ACP sessions: ${runtime.sessionStore?.read().length ?? 0}`,
|
|
400
|
+
`Requested permission mode: ${snapshot.permissionMode === "auto_edit" ? "auto-edit" : snapshot.permissionMode}`,
|
|
401
|
+
`Active bindings: ${snapshot.bindings}`,
|
|
402
|
+
"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.",
|
|
403
|
+
].filter(Boolean).join("\n"), "info");
|
|
343
404
|
return;
|
|
344
405
|
}
|
|
345
406
|
const { runtime } = runtimes.get(sessionIdOf(ctx));
|
|
@@ -505,7 +566,10 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
505
566
|
name: "Google Antigravity (ACP)",
|
|
506
567
|
async login(callbacks: any) {
|
|
507
568
|
await prepareRuntime();
|
|
508
|
-
|
|
569
|
+
// Always offer a fresh Google sign-in; without this a new server
|
|
570
|
+
// process silently reuses the saved login and keeps the old account.
|
|
571
|
+
await beginFreshGoogleLogin();
|
|
572
|
+
const result = await runtimes.get().provider.auth.oauth.login({
|
|
509
573
|
signal: callbacks.signal,
|
|
510
574
|
notify(event: any) {
|
|
511
575
|
if (event.links?.length) {
|
|
@@ -514,6 +578,10 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
514
578
|
},
|
|
515
579
|
prompt: (request: any) => callbacks.onPrompt({ message: request.message, placeholder: request.placeholder }),
|
|
516
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;
|
|
517
585
|
},
|
|
518
586
|
refreshToken: (credentials: any) => runtimes.get().provider.auth.oauth.refresh(credentials),
|
|
519
587
|
getApiKey: () => MARKER,
|
package/extension/runtime.mjs
CHANGED
|
@@ -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,13 +61003,16 @@ 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,
|
|
60995
61012
|
loadConfig,
|
|
60996
61013
|
planToolProjection,
|
|
60997
61014
|
projectModels,
|
|
61015
|
+
resolveAntigravityAcpDirectory,
|
|
60998
61016
|
savePermissionMode
|
|
60999
61017
|
};
|
|
61000
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.
|
|
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,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, resolveAntigravityAcpDirectory", "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"],
|