omp-antigravity-acp-provider 0.1.25 → 0.1.26

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
@@ -18,9 +18,9 @@ This derivative adds OMP-specific provider registration, confirmed model/thinkin
18
18
  The repository vendors the upstream **0.1.15** source under `extension/vendor/pi-antigravity-acp-provider` (MIT, see `extension/vendor/pi-antigravity-acp-provider/LICENSE`). The standalone artifact bundles its runtime code, supervisor and signed runtime manifest; end users need no production npm dependencies. It does not contain a copy of upstream's Git history. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the original copyright and license notice.
19
19
  ## Status
20
20
 
21
- Version 0.1.25 vendors `pi-antigravity-acp-provider 0.1.15` source for direct local modification while keeping the 0.1.24 session-ownership and profile-isolation fixes. Restart all OMP processes after upgrading so they participate in session ownership.
21
+ Version 0.1.26 waits for ACP process exit during session lease handoff and isolates idle runtimes while keeping the 0.1.24 session-ownership and profile-isolation fixes. Restart all OMP processes after upgrading so they participate in session ownership.
22
22
 
23
- Version 0.1.25 supports all models advertised by the official ACP server. Earlier live inference was tested with macOS, OMP 18.12.5, upstream provider 0.1.15 and official ACP runtime 1.4.1. The 0.1.21–0.1.24 continuity fixes are verified offline, including OMP 18.13.3 catalog loading and the local OMP summarizer source. Other platforms and full interactive Refine plan behavior with a real model remain unverified.
23
+ Version 0.1.26 supports all models advertised by the official ACP server. Earlier live inference was tested with macOS, OMP 18.12.5, upstream provider 0.1.15 and official ACP runtime 1.4.1. The 0.1.21–0.1.24 continuity fixes are verified offline, including OMP 18.13.3 catalog loading and the local OMP summarizer source. Other platforms and full interactive Refine plan behavior with a real model remain unverified.
24
24
 
25
25
  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.
26
26
 
@@ -57,7 +57,7 @@ Or, inside OMP:
57
57
 
58
58
  Select **omp-antigravity-acp-provider** in the browser, install it, and restart OMP to load the provider.
59
59
 
60
- 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.25** prebuilt npm adapter on first load. It disables npm install scripts and performs no local compilation. Node.js 22.19+ and npm must be on PATH. The standalone build bundles the required code and supervisor assets with no production dependencies: a clean test installation occupied approximately **2.6 MiB** (477 KiB tarball), down from roughly 150 MiB with the old dependency tree. This excludes the separately downloaded Google runtime. First preparation needs internet access; later loads reuse the installed cache without npm network access.
60
+ 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.26** prebuilt npm adapter on first load. It disables npm install scripts and performs no local compilation. Node.js 22.19+ and npm must be on PATH. The standalone build bundles the required code and supervisor assets with no production dependencies: a clean test installation occupied approximately **2.6 MiB** (477 KiB tarball), down from roughly 150 MiB with the old dependency tree. This excludes the separately downloaded Google runtime. First preparation needs internet access; later loads reuse the installed cache without npm network access.
61
61
 
62
62
  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.
63
63
 
@@ -81,7 +81,7 @@ omp plugin install npm:omp-antigravity-acp-provider
81
81
  To pin a specific release:
82
82
 
83
83
  ```sh
84
- omp plugin install npm:omp-antigravity-acp-provider@0.1.25
84
+ omp plugin install npm:omp-antigravity-acp-provider@0.1.26
85
85
  ```
86
86
 
87
87
  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.
@@ -75,6 +75,7 @@ export interface CommandControllerDeps {
75
75
  setPermissionModeState: (mode: string) => void;
76
76
  getLastToolAudit: () => ToolAuditSummary | undefined;
77
77
  getRuntimeForSession: (sessionId?: string) => RuntimeBundleView;
78
+ acquireRuntimeForSession?: (sessionId?: string) => { value: RuntimeBundleView; release: () => void };
78
79
  peekRuntimeForSession: (sessionId?: string) => RuntimeBundleView | undefined;
79
80
  getSavedSessionCount: () => number;
80
81
  getPermissionMode: () => string;
@@ -185,19 +186,24 @@ export function createAntigravityCommandHandler(deps: CommandControllerDeps) {
185
186
  await deps.auth.beginFreshGoogleLogin();
186
187
  // Direct Antigravity Google login through the command UI. OMP's /login
187
188
  // runs the same flow and additionally stores the provider marker.
188
- await deps.getRuntimeForSession().provider.auth.oauth.login({
189
- signal: undefined,
190
- notify(event) {
191
- const link = event.links?.[0];
192
- if (link) ctx.ui.notify(`${event.message ?? "Open this URL to authorize:"}\n${link.url}`, "info");
193
- else if (event.message) ctx.ui.notify(event.message, "info");
194
- },
195
- prompt: async (request) => {
196
- const answer = await ctx.ui.input?.(request.message, request.placeholder);
197
- if (!answer?.trim()) throw new Error("Antigravity OAuth login cancelled");
198
- return answer;
199
- },
200
- });
189
+ const lease = deps.acquireRuntimeForSession ? deps.acquireRuntimeForSession() : { value: deps.getRuntimeForSession(), release: () => {} };
190
+ try {
191
+ await lease.value.provider.auth.oauth.login({
192
+ signal: undefined,
193
+ notify(event) {
194
+ const link = event.links?.[0];
195
+ if (link) ctx.ui.notify(`${event.message ?? "Open this URL to authorize:"}\n${link.url}`, "info");
196
+ else if (event.message) ctx.ui.notify(event.message, "info");
197
+ },
198
+ prompt: async (request) => {
199
+ const answer = await ctx.ui.input?.(request.message, request.placeholder);
200
+ if (!answer?.trim()) throw new Error("Antigravity OAuth login cancelled");
201
+ return answer;
202
+ },
203
+ });
204
+ } finally {
205
+ lease.release();
206
+ }
201
207
  const auth = inspectAntigravityAuth();
202
208
  const email = antigravityAccountEmail();
203
209
  ctx.ui.notify(`Antigravity Google login finished${email ? ` as ${email}` : ""} — fresh sign-in; ACP auth: ${auth.status}${auth.authType ? ` (${auth.authType})` : ""}.`, "info");
@@ -145,7 +145,7 @@ export async function registerOmpAdapter(pi: OmpHostApi, stateDir: string) {
145
145
  pi.on("session_shutdown", async (_event: unknown, ctx: OmpCommandContext) => {
146
146
  const sessionId = sessionIdOf(ctx);
147
147
  if (sessionId) {
148
- await Promise.all([runtimes.close(sessionId), runtimes.close()]);
148
+ await Promise.all([runtimes.close(sessionId), runtimes.closeIdle()]);
149
149
  } else {
150
150
  await runtimes.closeAll();
151
151
  }
@@ -195,8 +195,8 @@ export async function registerOmpAdapter(pi: OmpHostApi, stateDir: string) {
195
195
  const request = runtimes.values().map(bundle => bundle.runtime.getPermission(params.requestId)).find(Boolean);
196
196
  if (!request) throw new Error("Permission request expired or missing");
197
197
  const labels = request.options.map((option: { label: string }) => option.label);
198
- const selected = await ctx.ui.select!(request.title, labels);
199
- const optionId = request.options[labels.indexOf(selected)]?.id;
198
+ const selected = await ctx.ui.select?.(request.title, labels);
199
+ const optionId = selected !== undefined ? request.options[labels.indexOf(selected)]?.id : undefined;
200
200
  return {
201
201
  content: [{ type: "text", text: optionId ? `Permission: ${selected}` : "Permission denied." }],
202
202
  details: { kind: PERMISSION_RESULT_KIND, requestId: request.id, optionId, cancelled: !optionId },
@@ -231,6 +231,7 @@ export async function registerOmpAdapter(pi: OmpHostApi, stateDir: string) {
231
231
  setPermissionModeState: mode => { permissionMode = mode; },
232
232
  getLastToolAudit: () => lastToolAudit,
233
233
  getRuntimeForSession: sessionId => runtimes.get(sessionId),
234
+ acquireRuntimeForSession: sessionId => runtimes.acquire(sessionId),
234
235
  peekRuntimeForSession: sessionId => runtimes.peek(sessionId),
235
236
  getSavedSessionCount: savedSessionCount,
236
237
  getPermissionMode: () => permissionMode,
@@ -346,19 +347,24 @@ export async function registerOmpAdapter(pi: OmpHostApi, stateDir: string) {
346
347
  // Always offer a fresh Google sign-in; without this a new server
347
348
  // process silently reuses the saved login and keeps the old account.
348
349
  await auth.beginFreshGoogleLogin();
349
- const result = await runtimes.get().provider.auth.oauth.login({
350
- signal: callbacks.signal,
351
- notify(event: { message?: string; links?: Array<{ url: string }> }) {
352
- if (event.links?.length) {
353
- for (const link of event.links) callbacks.onAuth({ url: link.url, instructions: event.message });
354
- } else callbacks.onProgress?.(event.message);
355
- },
356
- prompt: (request: { message: string; placeholder?: string }) => callbacks.onPrompt({ message: request.message, placeholder: request.placeholder }),
357
- });
358
- // Record the signed-in account on the marker credential so OMP's
359
- // account list can label it; the email is identity data, not a secret.
360
- const email = antigravityAccountEmail();
361
- return email ? { ...result, email } : result;
350
+ const lease = runtimes.acquire();
351
+ try {
352
+ const result = await lease.value.provider.auth.oauth.login({
353
+ signal: callbacks.signal,
354
+ notify(event: { message?: string; links?: Array<{ url: string }> }) {
355
+ if (event.links?.length) {
356
+ for (const link of event.links) callbacks.onAuth({ url: link.url, instructions: event.message });
357
+ } else callbacks.onProgress?.(event.message);
358
+ },
359
+ prompt: (request: { message: string; placeholder?: string }) => callbacks.onPrompt({ message: request.message, placeholder: request.placeholder }),
360
+ });
361
+ // Record the signed-in account on the marker credential so OMP's
362
+ // account list can label it; the email is identity data, not a secret.
363
+ const email = antigravityAccountEmail();
364
+ return email ? { ...result, email } : result;
365
+ } finally {
366
+ lease.release();
367
+ }
362
368
  },
363
369
  refreshToken: (credentials: unknown) => runtimes.get().provider.auth.oauth.refresh(credentials),
364
370
  getApiKey: () => MARKER,
@@ -79,6 +79,13 @@ export class SessionRuntimePool<T> {
79
79
  return [...this.entries.values()];
80
80
  }
81
81
 
82
+ async closeIdle(sessionId?: string): Promise<boolean> {
83
+ const entry = this.entries.get(sessionId);
84
+ if (!entry || this.leases.has(entry) || this.idle.canDispose?.(entry) === false) return false;
85
+ await this.close(sessionId);
86
+ return true;
87
+ }
88
+
82
89
  async close(sessionId?: string): Promise<void> {
83
90
  const entry = this.entries.get(sessionId);
84
91
  // Detach before awaiting teardown so a new turn cannot reuse a closed runtime.
@@ -60242,13 +60242,28 @@ var AntigravityRuntime = class {
60242
60242
  void connection.close().catch(() => {
60243
60243
  });
60244
60244
  });
60245
- releaseLease = async () => {
60245
+ let releaseDone;
60246
+ const releaseOwned = async () => {
60247
+ if (releaseDone) return releaseDone;
60248
+ releaseDone = releaseOwnedLease().catch(() => {
60249
+ });
60250
+ return releaseDone;
60251
+ };
60252
+ releaseLease = async (wait = false) => {
60246
60253
  if (connection.process.alive) {
60247
- void connection.process.exited.then(releaseOwnedLease).catch(() => {
60248
- });
60249
- return;
60254
+ if (wait) {
60255
+ await Promise.race([
60256
+ connection.process.exited,
60257
+ new Promise((resolve) => setTimeout(resolve, 2e3))
60258
+ ]).catch(() => {
60259
+ });
60260
+ } else {
60261
+ void connection.process.exited.then(releaseOwned).catch(() => {
60262
+ });
60263
+ return;
60264
+ }
60250
60265
  }
60251
- await releaseOwnedLease();
60266
+ await releaseOwned();
60252
60267
  };
60253
60268
  this.assertEpoch(epoch);
60254
60269
  }
@@ -60481,7 +60496,7 @@ var AntigravityRuntime = class {
60481
60496
  }
60482
60497
  } finally {
60483
60498
  await closing;
60484
- await binding.ompReleaseLease?.();
60499
+ await binding.ompReleaseLease?.(true);
60485
60500
  if (current && await current === binding && this.bindings.get(key) === current) this.bindings.delete(key);
60486
60501
  }
60487
60502
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-antigravity-acp-provider",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "ompAcpBundle": 1,
5
5
  "description": "Google Antigravity ACP provider for Oh My Pi (OMP), with tool bridging and per-model thinking; derived from zacbemis/pi-antigravity-acp-provider",
6
6
  "type": "module",
package/scripts/build.mjs CHANGED
@@ -192,7 +192,7 @@ const result = await build({
192
192
  // Continuity transactions are adapter-owned. Keep explicit pinned seams
193
193
  // so an upstream update cannot silently bypass the write-ahead marker.
194
194
  const continuityPatches = [
195
- ['interface Binding {', 'interface Binding {\n ompInFlight: boolean; ompInvalidated: boolean; ompDropPromise?: Promise<void>; ompExpectedAssistantHasOutput: boolean; ompReleaseLease?: () => Promise<void>;'],
195
+ ['interface Binding {', 'interface Binding {\n ompInFlight: boolean; ompInvalidated: boolean; ompDropPromise?: Promise<void>; ompExpectedAssistantHasOutput: boolean; ompReleaseLease?: (wait?: boolean) => Promise<void>;'],
196
196
  ['let completeTurn: (() => void) | undefined;', 'let ompDispatched = false;\n\t\tlet completeTurn: (() => void) | undefined;'],
197
197
  ['if (existing) return existing;', `if (existing) {
198
198
  const value = await existing;
@@ -242,12 +242,25 @@ const result = await build({
242
242
  try {
243
243
  if (key.startsWith('sid:') && typeof this.sessionStore?.acquireSessionLease === 'function') {
244
244
  const releaseOwnedLease = await this.sessionStore.acquireSessionLease(key.slice(4), () => { leaseLost = true; if (binding) binding.ompInvalidated = true; void connection.close().catch(() => {}); });
245
- releaseLease = async () => {
245
+ let releaseDone: Promise<void> | undefined;
246
+ const releaseOwned = async () => {
247
+ if (releaseDone) return releaseDone;
248
+ releaseDone = releaseOwnedLease().catch(() => {});
249
+ return releaseDone;
250
+ };
251
+ releaseLease = async (wait = false) => {
246
252
  if (connection.process.alive) {
247
- void connection.process.exited.then(releaseOwnedLease).catch(() => {});
248
- return;
253
+ if (wait) {
254
+ await Promise.race([
255
+ connection.process.exited,
256
+ new Promise(resolve => setTimeout(resolve, 2000)),
257
+ ]).catch(() => {});
258
+ } else {
259
+ void connection.process.exited.then(releaseOwned).catch(() => {});
260
+ return;
261
+ }
249
262
  }
250
- await releaseOwnedLease();
263
+ await releaseOwned();
251
264
  };
252
265
  this.assertEpoch(epoch);
253
266
  }
@@ -304,7 +317,7 @@ const result = await build({
304
317
  }
305
318
  } finally {
306
319
  await closing;
307
- await binding.ompReleaseLease?.();
320
+ await binding.ompReleaseLease?.(true);
308
321
  if (current && (await current) === binding && this.bindings.get(key) === current) this.bindings.delete(key);
309
322
  }
310
323
  })();