omp-antigravity-acp-provider 0.1.12 → 0.1.14
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 +7 -5
- package/extension/index.ts +77 -8
- package/extension/runtime.mjs +1 -0
- package/package.json +1 -1
- package/scripts/build.mjs +1 -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.14 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.14** 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.14
|
|
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` |
|
|
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 provider's non-secret config apiKey fallback is registered only until a logout is observed: removing the marker credential makes the adapter re-register without it in the same tick, so OMP's own logout report finds no remaining "provider config (fallback)" source and the model catalog hides until the next `/login`. Fresh profiles that never stored a marker keep the fallback so first-run model listing works; storing a marker again restores it.
|
|
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
|
|
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, 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) {
|
|
@@ -132,8 +161,17 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
132
161
|
let markerPresent: boolean | undefined;
|
|
133
162
|
let suppressFollow = false;
|
|
134
163
|
let selfLogout = false;
|
|
164
|
+
// Whether registerProvider keeps the non-secret config apiKey fallback.
|
|
165
|
+
let apiKeyFallback = true;
|
|
135
166
|
let followTimer: ReturnType<typeof setTimeout> | undefined;
|
|
136
167
|
let followRetry: ReturnType<typeof setTimeout> | undefined;
|
|
168
|
+
function syncProviderRegistration() {
|
|
169
|
+
// Re-registering without an apiKey does not clear OMP's stored key
|
|
170
|
+
// config; unregister first so a logout report finds no remaining
|
|
171
|
+
// "provider config (fallback)" source.
|
|
172
|
+
try { pi.unregisterProvider?.("antigravity-acp"); } catch { /* older hosts */ }
|
|
173
|
+
try { adapted.registerProvider(); } catch { /* advisory */ }
|
|
174
|
+
}
|
|
137
175
|
function ompMarkerStored(ctx: any): boolean | undefined {
|
|
138
176
|
try {
|
|
139
177
|
return Boolean(ctx?.modelRegistry?.authStorage?.credentials?.getOAuth?.("antigravity-acp"));
|
|
@@ -209,14 +247,31 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
209
247
|
const wasPresent = markerPresent === true;
|
|
210
248
|
markerPresent = current;
|
|
211
249
|
if (current) suppressFollow = false;
|
|
250
|
+
if (wasPresent !== current) {
|
|
251
|
+
// Flip the config apiKey in the same synchronous tick as the marker
|
|
252
|
+
// change: OMP's own logout report then finds no remaining
|
|
253
|
+
// "provider config (fallback)" source, while a fresh profile that
|
|
254
|
+
// never stored a marker keeps the catalog visible.
|
|
255
|
+
apiKeyFallback = current;
|
|
256
|
+
syncProviderRegistration();
|
|
257
|
+
}
|
|
212
258
|
if (!wasPresent || current || selfLogout) return;
|
|
213
259
|
clearTimeout(followTimer);
|
|
214
260
|
followTimer = setTimeout(() => {
|
|
215
261
|
followTimer = undefined;
|
|
216
262
|
if (process.env.OMP_ACP_FOLLOW_LOGOUT === "0") return;
|
|
217
|
-
if (suppressFollow) {
|
|
263
|
+
if (suppressFollow) {
|
|
264
|
+
suppressFollow = false;
|
|
265
|
+
apiKeyFallback = true;
|
|
266
|
+
syncProviderRegistration();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
218
269
|
// A quick re-login after the removal cancels the cleanup.
|
|
219
|
-
if (ompMarkerStored(ctx) !== false)
|
|
270
|
+
if (ompMarkerStored(ctx) !== false) {
|
|
271
|
+
apiKeyFallback = true;
|
|
272
|
+
syncProviderRegistration();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
220
275
|
void finishFollowedLogout(ctx);
|
|
221
276
|
}, logoutFollow.delayMs);
|
|
222
277
|
followTimer.unref?.();
|
|
@@ -319,7 +374,8 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
319
374
|
},
|
|
320
375
|
});
|
|
321
376
|
const auth = inspectAntigravityAuth();
|
|
322
|
-
|
|
377
|
+
const email = antigravityAccountEmail();
|
|
378
|
+
ctx.ui.notify(`Antigravity Google login finished${email ? ` as ${email}` : ""} — fresh sign-in; ACP auth: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}.`, "info");
|
|
323
379
|
return;
|
|
324
380
|
}
|
|
325
381
|
if (command === "logout") {
|
|
@@ -338,6 +394,11 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
338
394
|
selfLogout = true;
|
|
339
395
|
let ompMarker: "removed" | "absent" | "unavailable";
|
|
340
396
|
try { ompMarker = await removeOmpCredentialRecord(ctx); } finally { selfLogout = false; }
|
|
397
|
+
if (ompMarker !== "unavailable") {
|
|
398
|
+
// Drop the config apiKey with the marker even without the watcher.
|
|
399
|
+
apiKeyFallback = false;
|
|
400
|
+
syncProviderRegistration();
|
|
401
|
+
}
|
|
341
402
|
// Keep the confirmation terse; /antigravity-acp account shows the details.
|
|
342
403
|
const cleared = ["Google credentials", "saved ACP sessions"];
|
|
343
404
|
if (keychainRemoved === true) cleared.push("the macOS keychain entry");
|
|
@@ -355,12 +416,13 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
355
416
|
const snapshot = await runtime.snapshot();
|
|
356
417
|
const omp = ompCredentialSummary(ctx);
|
|
357
418
|
const marker = omp.present === undefined ? "unknown (host did not expose the credential store)"
|
|
358
|
-
: omp.present ? `present, authorized ${omp.authorizedAt ?? "unknown time"} (${omp.record})`
|
|
419
|
+
: omp.present ? `present, authorized ${omp.authorizedAt ?? "unknown time"}${omp.email ? ` as ${omp.email}` : ""} (${omp.record})`
|
|
359
420
|
: "not stored; run /login or /antigravity-acp login";
|
|
360
421
|
// Mirrors the upstream provider's status/doctor wording for the shared
|
|
361
422
|
// fields, with OMP-specific lines in the same style.
|
|
362
423
|
ctx.ui.notify([
|
|
363
424
|
"Antigravity ACP account",
|
|
425
|
+
`Google account: ${antigravityAccountEmail() ?? "not signed in"}`,
|
|
364
426
|
`Authentication: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}`,
|
|
365
427
|
`Credential storage (preflight): ${describeCredentialStorage()}`,
|
|
366
428
|
`OMP marker record: ${marker}`,
|
|
@@ -475,8 +537,11 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
475
537
|
return () => target.registerProvider("antigravity-acp", {
|
|
476
538
|
api: "antigravity-acp",
|
|
477
539
|
baseUrl: "acp://antigravity",
|
|
478
|
-
//
|
|
479
|
-
|
|
540
|
+
// A config apiKey keeps OMP's own logout report claiming a remaining
|
|
541
|
+
// "provider config (fallback)" source, but dropping it entirely hides
|
|
542
|
+
// the catalog before the first /login. Register it only while an OMP
|
|
543
|
+
// marker is known to exist or before any logout was observed.
|
|
544
|
+
apiKey: apiKeyFallback ? MARKER : undefined,
|
|
480
545
|
models: initialModels,
|
|
481
546
|
async fetchDynamicModels() {
|
|
482
547
|
// OMP may call this during startup, even for another provider.
|
|
@@ -538,7 +603,7 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
538
603
|
// Always offer a fresh Google sign-in; without this a new server
|
|
539
604
|
// process silently reuses the saved login and keeps the old account.
|
|
540
605
|
await beginFreshGoogleLogin();
|
|
541
|
-
|
|
606
|
+
const result = await runtimes.get().provider.auth.oauth.login({
|
|
542
607
|
signal: callbacks.signal,
|
|
543
608
|
notify(event: any) {
|
|
544
609
|
if (event.links?.length) {
|
|
@@ -547,6 +612,10 @@ export async function registerOmpAdapter(pi: any, stateDir: string) {
|
|
|
547
612
|
},
|
|
548
613
|
prompt: (request: any) => callbacks.onPrompt({ message: request.message, placeholder: request.placeholder }),
|
|
549
614
|
});
|
|
615
|
+
// Record the signed-in account on the marker credential so OMP's
|
|
616
|
+
// account list can label it; the email is identity data, not a secret.
|
|
617
|
+
const email = antigravityAccountEmail();
|
|
618
|
+
return email ? { ...result, email } : result;
|
|
550
619
|
},
|
|
551
620
|
refreshToken: (credentials: any) => runtimes.get().provider.auth.oauth.refresh(credentials),
|
|
552
621
|
getApiKey: () => MARKER,
|
package/extension/runtime.mjs
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "0.1.14",
|
|
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"],
|