omp-antigravity-acp-provider 0.1.43 → 0.2.2
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/AGENT_INSTALL.md +3 -2
- package/README.md +127 -28
- package/THIRD_PARTY_NOTICES.md +12 -1
- package/extension/acp-errors.ts +40 -9
- package/extension/adapter-config.ts +221 -0
- package/extension/assets/src/acp/supervisor.mjs +21 -9
- package/extension/auth-sync.ts +245 -55
- package/extension/catalog-store.ts +52 -26
- package/extension/commands.ts +59 -153
- package/extension/diagnostics.ts +5 -1
- package/extension/index.ts +520 -93
- package/extension/lock-release.ts +13 -0
- package/extension/model-catalog.ts +37 -3
- package/extension/omp-session-lifecycle.ts +13 -2
- package/extension/omp-session-source.ts +16 -5
- package/extension/pricing.ts +92 -16
- package/extension/proxy-env.ts +23 -0
- package/extension/quota-usage.ts +254 -0
- package/extension/redact.ts +51 -0
- package/extension/runtime/acp/antigravity.ts +185 -0
- package/extension/runtime/acp/bounded-stream.ts +171 -0
- package/extension/runtime/acp/connection.ts +507 -0
- package/extension/runtime/acp/credential-storage.ts +113 -0
- package/extension/runtime/acp/errors.ts +54 -0
- package/extension/runtime/acp/events.ts +66 -0
- package/extension/runtime/acp/headless-oauth.ts +209 -0
- package/extension/runtime/acp/prompt-watchdog.ts +80 -0
- package/extension/runtime/acp/proxy.ts +54 -0
- package/extension/runtime/acp/runtime-manifest.ts +185 -0
- package/extension/runtime/acp/session-state.ts +76 -0
- package/extension/runtime/asset.ts +24 -0
- package/extension/runtime/binding.ts +145 -0
- package/extension/runtime/config.ts +119 -0
- package/extension/runtime/constants.ts +18 -0
- package/extension/runtime/history-seed.ts +227 -0
- package/extension/runtime/image-history.ts +233 -0
- package/extension/runtime/index.ts +23 -0
- package/extension/runtime/launch.ts +545 -0
- package/extension/runtime/managed.ts +872 -0
- package/extension/runtime/models.ts +192 -0
- package/extension/runtime/process.ts +281 -0
- package/extension/{context-transfer.ts → runtime/prompt.ts} +183 -70
- package/extension/runtime/provider.ts +149 -0
- package/extension/runtime/routing.ts +47 -0
- package/extension/runtime/runtime-manifest.json +205 -0
- package/extension/runtime/runtime.ts +2204 -0
- package/extension/runtime/status.ts +87 -0
- package/extension/runtime/stream/json.ts +17 -0
- package/extension/runtime/stream/pi-events.ts +142 -0
- package/extension/runtime/stream/usage.ts +37 -0
- package/extension/runtime/supervisor.mjs +113 -0
- package/extension/runtime/tools/args.ts +96 -0
- package/extension/runtime/tools/bridge.ts +331 -0
- package/extension/{tool-relay.ts → runtime/tools/relay.ts} +24 -11
- package/extension/runtime/tools/schema.ts +256 -0
- package/extension/runtime.mjs +3117 -1328
- package/extension/secret-service.ts +85 -0
- package/extension/session-cleanup.ts +74 -8
- package/extension/session-store.ts +13 -3
- package/extension/tier-connection.ts +254 -59
- package/extension/tool-order.ts +4 -2
- package/extension/tool-routing.ts +112 -30
- package/extension/turn-cancellation.ts +11 -3
- package/extension/usage-accounting.ts +74 -2
- package/extension/usage-db.ts +95 -22
- package/extension/usage.ts +1 -1
- package/package.json +12 -6
- package/extension/acp-runtime-source.ts +0 -231
- package/extension/history-fingerprint.ts +0 -80
- package/extension/structured-fingerprint.ts +0 -63
package/AGENT_INSTALL.md
CHANGED
|
@@ -15,11 +15,12 @@ Steps:
|
|
|
15
15
|
2. Run `omp plugin list --json` and search `npm[].name` and `marketplace[].id` for `antigravity-acp-provider`. If one exists, stop and report it instead of installing a second copy.
|
|
16
16
|
3. Install with `omp plugin install npm:omp-antigravity-acp-provider`. For the marketplace variant, run `omp plugin marketplace add SenCha930511/omp-antigravity-acp-provider` first, then `omp plugin install omp-antigravity-acp-provider@sencha-plugins`.
|
|
17
17
|
4. Run `omp plugin list --json` again and confirm exactly one adapter is present. Record its version.
|
|
18
|
-
5. Run `omp models antigravity-acp --json`.
|
|
18
|
+
5. Run `omp models antigravity-acp --json`. Offline/cached listing must not start the ACP server. Before discovery, the built-in Gemini, Hydrogen and known partner-model fallback entries may be listed; neither those entries nor an empty catalog proves a live login. Report any failure instead of retrying in a loop.
|
|
19
19
|
6. Tell the user to restart OMP, then run `/login` → "Google Antigravity (ACP)" and `/antigravity-acp refresh` inside OMP. Do not perform these steps yourself.
|
|
20
20
|
|
|
21
21
|
Notes:
|
|
22
|
-
- The adapter
|
|
22
|
+
- The adapter prefers a usable `agy` CLI and falls back to the managed registry runtime. It never installs the CLI. An explicit `AGY_ACP_BIN` environment variable overrides the choice. Do not set it unless the user asks.
|
|
23
|
+
- To pin a channel, set `runtimeSource` in `~/.omp/agent/antigravity-acp-provider/config.json` to `auto`, `cli`, or `managed`. A pinned source fails instead of downloading the other channel.
|
|
23
24
|
- ACP sessions are stored under `~/.gemini/antigravity-acp/`. The user's personal `agy` CLI chats under `~/.gemini/antigravity-cli/` are never read or deleted by the adapter.
|
|
24
25
|
|
|
25
26
|
Acceptance: one adapter installed, `omp models antigravity-acp --json` returns valid JSON, and no credential material appears in any output. Report the commands run, the adapter version, any model IDs and the first step that failed.
|
package/README.md
CHANGED
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](package.json)
|
|
7
7
|
[](https://github.com/SenCha930511/omp-antigravity-acp-provider)
|
|
8
|
-
[](https://github.com/SenCha930511/omp-antigravity-acp-provider)
|
|
9
9
|
[](https://github.com/SenCha930511/omp-antigravity-acp-provider/stargazers)
|
|
10
10
|
|
|
11
11
|
Google Antigravity's official ACP server, adapted for **Oh My Pi (OMP)**.
|
|
12
12
|
|
|
13
|
+
Current version: `0.2.2`.
|
|
14
|
+
|
|
13
15
|
**An OMP-focused derivative fork of [zacbemis/pi-antigravity-acp-provider](https://github.com/zacbemis/pi-antigravity-acp-provider).** Original project by [zacbemis](https://github.com/zacbemis) and contributors, licensed under MIT.
|
|
14
16
|
|
|
15
17
|
This is an independent adaptation, **NOT** an official Google or OMP integration. It uses ACP over stdio. The local HTTP MCP bridge carries tool calls; it is not a model API reverse proxy.
|
|
@@ -17,27 +19,51 @@ This is an independent adaptation, **NOT** an official Google or OMP integration
|
|
|
17
19
|
## Features
|
|
18
20
|
|
|
19
21
|
- All server-advertised models, including Claude, GPT-OSS and future IDs when the ACP endpoint advertises them.
|
|
20
|
-
-
|
|
21
|
-
- Per-model thinking levels, exposed only when the server confirms them.
|
|
22
|
+
- CLI-first selection. When a usable `agy` CLI is on `PATH`, the adapter launches it through a generated `AGY_ACP_BIN` wrapper. The managed runtime is the fallback. An explicit `AGY_ACP_BIN` always wins.
|
|
23
|
+
- Per-model thinking levels, exposed only when the server confirms them. The offline catalog includes Gemini 4 Hydrogen through `xhigh` and known partner models; the first inference after an empty cache attempts real server discovery.
|
|
22
24
|
- OMP tools through an authenticated loopback MCP bridge.
|
|
23
25
|
- Optional `disabled` native-tool mode for strict OMP-only sessions.
|
|
24
|
-
-
|
|
26
|
+
- Standby ACP initialization coordinated with discovery, plus warm session reuse and guarded oldest-image history continuity.
|
|
25
27
|
- `/login` plus `/antigravity-acp` account, usage and cleanup commands.
|
|
26
|
-
- API-equivalent cost estimates, not subscription billing.
|
|
28
|
+
- API-equivalent cost estimates from a model-ID rate table, not subscription billing. Native response usage takes precedence, with a read-only SQLite fallback for completed model steps when no supplemental usage query runs.
|
|
27
29
|
- Long-running OMP tools survive the MCP request window through a relay. The model resumes the same result with `pi_omp_await_result`; the control tool is a separate MCP server and never appears in OMP's tool list.
|
|
28
30
|
- Permission requests are tied to the originating session, turn and tool call. Forged, conflicting or previous-turn identities fail closed, while normal requests still use OMP's human review.
|
|
29
31
|
- The MCP `tools/list` reflects the current OMP tool set. The offline wire test covers add, remove and restore on one warm ACP session.
|
|
32
|
+
- Tool-argument hardening on the MCP bridge. Habitual alias mistakes such as `path` for `file_path` are corrected only when the tool schema makes the mapping unambiguous, and rejected calls return the missing required keys plus the tool's expected signature instead of a bare schema failure.
|
|
33
|
+
- Loopback traffic always bypasses proxied environments. When `HTTP(S)_PROXY` or `ALL_PROXY` is set for the ACP child process, the adapter appends `localhost`, `127.0.0.1` and `::1` to `NO_PROXY`/`no_proxy` so the loopback MCP bridge is never routed through an external proxy.
|
|
34
|
+
- OAuth material is redacted from failure text. Authorization URLs, sensitive query values, `Bearer` tokens and OAuth pairs such as `code_challenge` or `access_token` are masked before messages reach OMP, while ordinary diagnostics like `exit code=1` stay intact.
|
|
35
|
+
- Fresh-login and logout synchronization bounds credential-disable suppression and clears only the current login attempt's state, so a failed or cancelled login cannot suppress a later real logout.
|
|
36
|
+
|
|
37
|
+
## Supported platforms
|
|
38
|
+
|
|
39
|
+
The adapter is a Node.js OMP plugin. The table lists the configuration each platform accepts and the validation actually performed, not a promise that every path has been run on every system.
|
|
40
|
+
|
|
41
|
+
| Platform | Configuration | Validation |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| macOS on arm64 | `agy` on `PATH`, an explicit `AGY_ACP_BIN`, or the managed runtime in `~/.local/opt/agy-acp/`. Keychain lookups use `/usr/bin/security`. | Live: Gemini inference, MCP tools, steering, cancellation and continuation, local plugin linking. |
|
|
44
|
+
| Linux | `agy` on `PATH`, an explicit `AGY_ACP_BIN`, or the managed runtime. Secret Service items are inspected and removed with `secret-tool` from libsecret. | Offline tests with synthetic fixtures. No live Linux run in this environment. |
|
|
45
|
+
| Windows | `agy.exe` on `PATH`, an explicit `AGY_ACP_BIN` pointing at your ACP command, or the generated `.cmd` wrapper. | Configuration only. The supervisor wrapper and the full managed-runtime download have not been run on Windows. |
|
|
46
|
+
|
|
47
|
+
### Credentials and keyrings
|
|
48
|
+
|
|
49
|
+
Google browser consent works on every platform. The ACP server stores the result in its own credential store, and the adapter checks the same store for login readiness and logout.
|
|
50
|
+
|
|
51
|
+
- **macOS.** The adapter checks the login keychain item `gemini` / `antigravity-acp` with `/usr/bin/security`. The attribute-only lookup does not prompt for the keychain password. Logout removes that item. Keychain-stored tokens expose no account email, so `account` shows the address only when a token file exists.
|
|
52
|
+
- **Linux.** Secret Service holds the same item as `service=gemini`, `username=antigravity`. The adapter needs `secret-tool` from libsecret to detect or delete it; install it from your distribution's libsecret package. A confirmed missing item is distinct from an unavailable or locked backend. Without `secret-tool`, the backend's state cannot be confirmed. Login readiness falls back to the token file under `~/.gemini/antigravity-acp/` and to `GEMINI_API_KEY`. A login that exists only in Secret Service is not detected in that state, while token-file and API-key inference still work.
|
|
53
|
+
- **Windows.** There is no keyring integration. The token file and `GEMINI_API_KEY` are supported credential sources.
|
|
54
|
+
|
|
55
|
+
On Windows, CLI discovery searches for `agy` and `agy.exe`. Set `AGY_ACP_BIN` explicitly for an npm-generated `.cmd` shim. The `.cmd` supervisor wrapper has not been exercised on Windows.
|
|
30
56
|
|
|
31
57
|
## Install: for human
|
|
32
58
|
|
|
33
|
-
Follow these steps in order. The whole flow takes a few minutes, plus Google's sign-in
|
|
59
|
+
Follow these steps in order. The whole flow takes a few minutes, plus Google's sign-in. A runtime download is only needed when no usable `agy` CLI is installed.
|
|
34
60
|
|
|
35
61
|
### 1. Check prerequisites
|
|
36
62
|
|
|
37
63
|
- OMP is installed and `omp --version` works.
|
|
38
64
|
- Node.js 22.19 or newer (`node --version`) and npm are on `PATH`; the marketplace launcher uses them on first load.
|
|
39
|
-
- A supported platform: macOS, Linux or Windows.
|
|
40
|
-
- Internet access
|
|
65
|
+
- A supported platform: macOS, Linux or Windows. [Supported platforms](#supported-platforms) lists what each one accepts and what has been validated.
|
|
66
|
+
- Internet access when no usable `agy` CLI is installed. The managed fallback downloads separately (about 383 MiB on macOS) into `~/.local/opt/agy-acp/`.
|
|
41
67
|
|
|
42
68
|
### 2. Install exactly one adapter
|
|
43
69
|
|
|
@@ -54,6 +80,8 @@ Or install the published npm package directly:
|
|
|
54
80
|
omp plugin install npm:omp-antigravity-acp-provider
|
|
55
81
|
```
|
|
56
82
|
|
|
83
|
+
To pin this version, use `omp plugin install npm:omp-antigravity-acp-provider@0.2.2`.
|
|
84
|
+
|
|
57
85
|
Do not install both. Remove or disable any older Antigravity ACP adapter first.
|
|
58
86
|
|
|
59
87
|
### 3. Restart OMP
|
|
@@ -62,7 +90,7 @@ The provider registers at startup. Restart every running OMP process so they agr
|
|
|
62
90
|
|
|
63
91
|
### 4. Sign in
|
|
64
92
|
|
|
65
|
-
Run `/login`, choose **Google Antigravity (ACP)**, and complete Google's consent in the browser. On a headless machine the provider relays the callback URL.
|
|
93
|
+
Run `/login`, choose **Google Antigravity (ACP)**, and complete Google's consent in the browser. On a headless machine the provider relays the callback URL. Alternatively, add the **Antigravity Gemini API key** method in `/login` and paste a Gemini API key, or export `GEMINI_API_KEY` before starting OMP. On Linux, keyring requirements are covered under [Supported platforms](#supported-platforms).
|
|
66
94
|
|
|
67
95
|
### 5. Load models and pick one
|
|
68
96
|
|
|
@@ -81,6 +109,14 @@ Run `/login`, choose **Google Antigravity (ACP)**, and complete Google's consent
|
|
|
81
109
|
|
|
82
110
|
This shows the runtime, native-tool mode and usage state. Send a short prompt to confirm inference.
|
|
83
111
|
|
|
112
|
+
### Upgrade or remove
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
omp plugin upgrade omp-antigravity-acp-provider
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
To remove the installed plugin, use `omp plugin uninstall omp-antigravity-acp-provider`. Removing a plugin does not sign out Google or delete its ACP history. Handle logout and session cleanup separately before removal when that is desired; do not install both the npm and marketplace variants.
|
|
119
|
+
|
|
84
120
|
### Troubleshooting
|
|
85
121
|
|
|
86
122
|
| Symptom | Check |
|
|
@@ -99,22 +135,58 @@ The installation runbook is in [AGENT_INSTALL.md](AGENT_INSTALL.md). Hand that f
|
|
|
99
135
|
|
|
100
136
|
## ACP server channels and selection
|
|
101
137
|
|
|
102
|
-
Google ships the same ACP server through two channels
|
|
138
|
+
Google ships the same ACP server through two channels. The adapter chooses one at every OMP startup.
|
|
103
139
|
|
|
104
|
-
- **`agy` CLI
|
|
105
|
-
- **Managed runtime
|
|
140
|
+
- **`agy` CLI.** Preferred whenever `agy` or `agy.exe` is on `PATH` and `agy acp --version` returns a semantic version. The adapter writes `agy-acp-cli.sh` or `agy-acp-cli.cmd` and points `AGY_ACP_BIN` at that wrapper.
|
|
141
|
+
- **Managed runtime.** The registry-signed release in `~/.local/opt/agy-acp/`. It is the fallback when the CLI is missing or unusable.
|
|
142
|
+
The bundled signed manifest may select 1.3.0 until Google's newer release is approved. System-append routing and `native-tools disabled` require 1.4.1 or newer.
|
|
106
143
|
|
|
107
144
|
Selection order:
|
|
108
145
|
|
|
109
|
-
1. An explicit `AGY_ACP_BIN`
|
|
110
|
-
2.
|
|
111
|
-
3.
|
|
146
|
+
1. An explicit non-wrapper `AGY_ACP_BIN` wins. The adapter's generated wrapper is not a user override.
|
|
147
|
+
2. If `runtimeSource` is `cli` or `managed`, the adapter uses that source exclusively. A missing pinned source fails the first ACP use and is not downloaded.
|
|
148
|
+
3. If `runtimeSource` is `auto`, a usable CLI wins, even when its version is older than the managed runtime.
|
|
149
|
+
4. In `auto`, if the CLI is missing or unusable, the adapter uses the managed runtime. If the managed runtime is missing, it downloads it from Google's registry.
|
|
150
|
+
5. In `auto`, if writing the CLI wrapper or runtime record fails, the adapter falls back to the managed runtime.
|
|
151
|
+
|
|
152
|
+
The adapter never installs the `agy` CLI. It downloads the managed runtime only in `auto` when no usable CLI is selected. Inference and quota use the same selection.
|
|
153
|
+
|
|
154
|
+
On the first session start after OMP launches, the adapter attempts one background model refresh. A successful refresh re-registers the provider so newly advertised models and their API-equivalent rates become available. If login or ACP startup fails, the cached catalog remains usable and `/antigravity-acp refresh` still forces a refresh. Before a cache exists, the offline catalog advertises Hydrogen (`low`, `medium`, `high`, `xhigh`), Argon and known partner models rather than treating those unverified entries as a completed server discovery. The first real inference then attempts discovery and updates the registered catalog.
|
|
155
|
+
|
|
156
|
+
### Standby warmup
|
|
157
|
+
|
|
158
|
+
Warmup is enabled by default. Set `OMP_ACP_WARMUP=off` to keep every request on the cold path. With authentication and a usable runtime target, it creates one initialized, **session-less** standby after startup discovery closes, then lets the first matching inference rebind its handlers on that transport. It never creates a throwaway inference session.
|
|
159
|
+
|
|
160
|
+
Runtime target, cwd, permission auto-approval, native-tool policy and usage mode must match before reuse. Policy changes, failed initialization, invalidation and shutdown close the standby; initialization or authentication failure is silent and leaves the normal inference path available. Synthetic tests cover invalidation and handler rebinding; [Supported platforms](#supported-platforms) distinguishes those from live platform validation.
|
|
161
|
+
|
|
162
|
+
The CLI selection record caches binary stat metadata to avoid repeatedly querying an unchanged binary's version. This is a local cache optimization, not a claim that every CLI runtime is equally fast on every platform.
|
|
163
|
+
|
|
164
|
+
Create or edit `~/.omp/agent/antigravity-acp-provider/config.json`:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"permissions": "follow",
|
|
169
|
+
"runtimeSource": "auto",
|
|
170
|
+
"nativeTools": "prefer",
|
|
171
|
+
"debugToolUpdates": false,
|
|
172
|
+
"usageMode": "off",
|
|
173
|
+
"diagnostics": false
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`permissions` accepts `default`, `auto_edit`, `yolo`, or `follow`. `runtimeSource` accepts `auto`, `cli`, or `managed`. `nativeTools` accepts `prefer` or `disabled`. `usageMode` accepts `auto` or `off`. `debugToolUpdates` and `diagnostics` are config-only booleans. Missing fields use these defaults: `permissions: "follow"`, `runtimeSource: "auto"`, `nativeTools: "prefer"`, `debugToolUpdates: false`, `usageMode: "off"`, and `diagnostics: false`. `follow` reads OMP's effective approval mode at plugin startup: OMP CLI `--approval-mode` and `--auto-approve` take precedence, then the project `.omp` override, then the active agent config. It maps `yolo` to `yolo`, `write` to `auto_edit`, and both ask modes to `default`. Restart OMP after changing OMP's approval mode so the ACP process is recreated with the matching auto-approval policy. Slash commands write the command-backed fields and keep the legacy setting files in sync. Context budgets remain in `context.json`; cleanup policy remains in `cleanup.json`.
|
|
178
|
+
|
|
179
|
+
- `auto` uses the CLI first and falls back to the managed runtime. If no usable CLI exists, it downloads the managed runtime.
|
|
180
|
+
- `cli` requires a usable `agy` CLI. If the CLI is missing or unusable, the first ACP use fails and nothing is downloaded.
|
|
181
|
+
- `managed` requires the managed runtime. If it is missing, the first ACP use fails and nothing is downloaded.
|
|
182
|
+
|
|
183
|
+
A pinned source never falls back to the other channel and never downloads it. An explicit non-wrapper `AGY_ACP_BIN` still wins over this setting. If `PI_CODING_AGENT_DIR` is set, use its actual path for `config.json`. Other `runtimeSource` values fail provider startup.
|
|
112
184
|
|
|
113
185
|
Session storage follows the server's own `--app_data_dir`. The generated wrapper pins `antigravity-acp` — the managed runtime's own default — so CLI-launched ACP sessions land in `~/.gemini/antigravity-acp/`, where `/antigravity-acp cleanup` and session ownership tracking operate. Personal `agy` CLI chats stay in `~/.gemini/antigravity-cli/` and are never read or deleted by the adapter. `GEMINI_HOME` relocates the managed runtime's tree (upstream behavior); the `agy` CLI stores under `~/.gemini` regardless.
|
|
114
186
|
|
|
115
187
|
The active channel and its versions are recorded in `~/.omp/agent/antigravity-acp-provider/acp-runtime-source.json` whenever the CLI is chosen.
|
|
116
188
|
|
|
117
|
-
Permission IDs differ between the channels. Managed ACP 1.4.5 supports `default`, `auto_edit`, and `yolo` directly. CLI ACP 1.5.3 advertises `default`, `accept-edits`, and `plan` instead. The adapter maps `auto-edit` to `accept-edits`. For `yolo`, it selects wire mode `default` and passes the CLI's official `--dangerously-skip-permissions` flag. This preserves auto-approval instead of substituting `accept-edits`. Changing permission modes recreates the ACP runtime so a process with auto-approval cannot serve a later `default` or `auto-edit` request. An explicit `AGY_ACP_BIN` is left unchanged.
|
|
189
|
+
Permission IDs differ between the channels. Managed ACP 1.4.5 supports `default`, `auto_edit`, and `yolo` directly. CLI ACP 1.5.3 advertises `default`, `accept-edits`, and `plan` instead. The adapter maps `auto-edit` to `accept-edits`. For `yolo`, it selects wire mode `default` and passes the CLI's official `--dangerously-skip-permissions` flag. This preserves auto-approval instead of substituting `accept-edits`. `follow` resolves OMP's effective approval mode first, with CLI `--approval-mode` and `--auto-approve` overrides taking precedence over project and agent config: `yolo` to `yolo`, `write` to `auto_edit`, and `always-ask` or `always-ask-cached` to `default`. Changing permission modes recreates the ACP runtime so a process with auto-approval cannot serve a later `default` or `auto-edit` request. An explicit `AGY_ACP_BIN` is left unchanged.
|
|
118
190
|
|
|
119
191
|
CLI ACP 1.5.3 omits `mcpCapabilities` from its initialization response, but it still discovers HTTP MCP servers and calls `tools/list`. The adapter normalizes this capability for that server identity so OMP tools remain available. CLI 1.5.3 reports no audio input, while the adapter's model catalog already limits input to text and images.
|
|
120
192
|
|
|
@@ -122,10 +194,24 @@ CLI ACP 1.5.3 omits `mcpCapabilities` from its initialization response, but it s
|
|
|
122
194
|
|
|
123
195
|
ACP may report live occupancy with `usage_update`. When it does, the adapter forwards that server value. When a runtime (for example CLI ACP 1.5.4) reports only cumulative billable usage, the adapter estimates the full OMP context from the system prompt, retained messages and tool schemas with `estimateTransferTokens`, then sets `usage.contextTokens` and marks `contextTokensSource: "estimate"`. The billable `input`, `cacheRead` and `output` counters are left untouched.
|
|
124
196
|
|
|
125
|
-
The estimate is a heuristic, not a server measurement.
|
|
197
|
+
The estimate is a heuristic, not a server measurement. To use managed ACP when exact occupancy matters, set `AGY_ACP_BIN` to the managed binary. CLI-first selection does not switch automatically. In this source checkout, `scripts/with-managed-context.sh` starts OMP with the installed managed binary while preserving an explicit `AGY_ACP_BIN`. Run `/antigravity-acp refresh` afterward to inspect the models that runtime actually advertises.
|
|
126
198
|
|
|
127
199
|
Keep `compaction.autoContinue` enabled for normal long-running work. The false context rollover was fixed at the occupancy signal, not by disabling automatic continuation.
|
|
128
200
|
|
|
201
|
+
### Supplemental per-turn usage
|
|
202
|
+
|
|
203
|
+
Native usage on the model response takes precedence. When there is none and no supplemental `/usage` query is running, the adapter may read the ACP server's own per-session SQLite store. It prefers `bun:sqlite` under OMP's Bun host and falls back to `node:sqlite`; both open the existing database read-only. Only completed model steps after a per-session cursor are counted, with two short WAL-consistency retries if the newest step has not committed yet.
|
|
204
|
+
|
|
205
|
+
This fallback never creates a missing database and accepts only a UUID-shaped ACP session ID. It can enrich usage and estimated cost, but is not authoritative server billing. It does not replace `usage_update` context occupancy. `OMP_ACP_USAGE=off` disables both the supplemental `/usage` query and local-store accounting; the command setting `usage off` disables only the supplemental query. No extra model request is sent to collect local-store usage.
|
|
206
|
+
|
|
207
|
+
Managed quota discovery waits up to 20 seconds for the official `/usage` advertisement. A brief 1.5-second grace before closing a successful or timed-out probe gives the server's background token refresh room to settle; cancellation still follows the bounded abort-safe process cleanup. This is cleanup protection, not a guarantee that a quota value or OAuth refresh will be available.
|
|
208
|
+
|
|
209
|
+
### History continuity and seed safety
|
|
210
|
+
|
|
211
|
+
When OMP removes the **oldest** image blocks to meet its image budget, the adapter recognizes the proven one-way eviction and can retain the warm ACP session. Checkpoints retain bounded positions and digests, not image bytes. Text edits, image substitutions, changed tool identities and unsupported message shapes force a clean rebuild instead of preserving a mismatched history.
|
|
212
|
+
|
|
213
|
+
Large history transfers can use hidden seed steps. Each requires the exact response `OK` and has a 60-second deadline. Adapter-mediated tool and permission requests fail the step without dispatching bridged work; an unsafe partial ACP session is retired before retry. An already-executed native operation cannot be undone merely by rejecting its later notification, so this guard is not a rollback mechanism. Compact history before retrying after these explicit failures.
|
|
214
|
+
|
|
129
215
|
## Commands
|
|
130
216
|
|
|
131
217
|
Use the `/antigravity-acp ` prefix once, followed by a row below. For example, `status` means `/antigravity-acp status`.
|
|
@@ -138,19 +224,19 @@ Use the `/antigravity-acp ` prefix once, followed by a row below. For example, `
|
|
|
138
224
|
| `account` | Show the signed-in account, ACP authentication and non-secret OMP marker. Token ownership, logout behavior and account/store inconsistencies are not hidden. |
|
|
139
225
|
| `login` | Start a fresh Google authorization. |
|
|
140
226
|
| `logout` | Clear Antigravity credentials, saved sessions and the OMP marker. |
|
|
141
|
-
| `quota` | Query live quota and print one model heading with one remaining/reset row per quota window. Query failures are reported explicitly. |
|
|
142
227
|
| `refresh` | Discover and cache advertised models, then list the refreshed IDs. |
|
|
143
228
|
| `usage` | Show configured → effective supplemental-query mode (`OMP_ACP_USAGE=off` forces `off`) and only populated per-connection context, compaction and accounting details. |
|
|
144
229
|
| `usage auto` | Query supplemental usage after each reply. Context occupancy updates remain enabled. |
|
|
145
230
|
| `usage off` | Skip supplemental queries without disabling context occupancy updates. |
|
|
146
231
|
|
|
147
|
-
Quota results use a
|
|
232
|
+
Quota results use a 60-second cache. When the adapter selects the CLI, the automatic quota query runs the CLI's print-mode `/usage` command with the same `--app_data_dir` as the CLI ACP wrapper. When it selects managed ACP, the query uses a short-lived ACP session. An explicit `AGY_ACP_BIN` remains authoritative. If an ACP runtime does not advertise `usage`, the adapter reports the limitation without sending a model prompt. Usage counters from temporary ACP sessions are excluded.
|
|
233
|
+
|
|
234
|
+
OMP's built-in `omp usage`, interactive `/usage`, and the statusline `usage` segment read the same quota through the provider's registered usage source. The adapter uses the CLI `/usage` command first and queries an installed managed runtime only when the user is signed in. A usage probe never downloads a runtime. Statusline selects the active model's limit group when that group maps to one model. Multi-model groups remain visible in `/usage`.
|
|
148
235
|
|
|
149
236
|
### Advanced maintenance
|
|
150
237
|
|
|
151
238
|
| Subcommand and options | Purpose |
|
|
152
239
|
| --- | --- |
|
|
153
|
-
| `tools` | Inspect offered/available OMP tools, every omission reason and live MCP capability checks. |
|
|
154
240
|
| `context` | Show saved shared defaults separately from each cached model's effective limits and model-only overrides. Effective values include the input, output, reserve, transfer and image budgets used by runtime compatibility checks. |
|
|
155
241
|
| `context set default KEY NUMBER` | Change a shared numeric context setting. |
|
|
156
242
|
| `context set MODEL KEY NUMBER` | Change one model override. Reselect the model or restart OMP to refresh its displayed limits. |
|
|
@@ -161,13 +247,10 @@ Quota results use a separate short-lived ACP session and a 60-second cache. When
|
|
|
161
247
|
| `cleanup timeout [DAYS]` | Apply timeout collection, optionally with a custom idle retention in days. |
|
|
162
248
|
| `cleanup balanced [DAYS]` | Apply timeout and soft-budget cleanup with recovery protection, optionally with custom idle days. |
|
|
163
249
|
| `cleanup budget MAX_SESSIONS MAX_MIB` | Set soft session/byte limits; `0` disables either limit. Active and recently used sessions can remain above a soft budget. Timeout deletion loses ACP-only state but retains OMP history. |
|
|
164
|
-
| `diagnostics` | Show collection state and non-empty samples as count/median/max per stage. |
|
|
165
|
-
| `diagnostics on\|off` | Enable or disable bounded local timing collection. |
|
|
166
|
-
| `diagnostics reset` | Clear collected samples without changing the enabled state. |
|
|
167
|
-
| `debug on\|off` | Toggle raw ACP tool-status lines; normal tool results and thought summaries are preserved. |
|
|
168
250
|
| `native-tools prefer` | Let OMP tools shadow matching ACP-native tools. |
|
|
169
251
|
| `native-tools disabled` | Disable ACP-native built-ins for strict OMP-tool sessions while retaining MCP configuration; connections are recreated on the next request. |
|
|
170
252
|
| `permissions default` | Confirm edits and commands. |
|
|
253
|
+
| `permissions follow` | Follow OMP's `tools.approvalMode`; this is the default. |
|
|
171
254
|
| `permissions auto-edit` | Auto-accept edits. |
|
|
172
255
|
| `permissions yolo` | Auto-accept everything; changing modes recreates runtimes to avoid reusing an unsafe process. |
|
|
173
256
|
|
|
@@ -177,7 +260,7 @@ The OMP input autocompletes this command. Type `/antigravity-acp ` to list the s
|
|
|
177
260
|
|
|
178
261
|
## Steering and queued messages
|
|
179
262
|
|
|
180
|
-
By default a new user message waits for the active ACP turn to finish (`OMP_ACP_STEER_MODE=queue`) and then continues on the warm session, avoiding a full replay and OMP auto-compaction. Set `OMP_ACP_STEER_MODE=steer` to restore immediate interruption. At tool/permission boundaries the adapter falls back to steer and waits for the ACP terminal response; `OMP_ACP_STEER_GRACE_MS` (default 60000) and `OMP_ACP_STEER_GRACE_MAX_MS` (default 300000) bound that wait.
|
|
263
|
+
By default a new user message waits for the active ACP turn to finish (`OMP_ACP_STEER_MODE=queue`) and then continues on the warm session, avoiding a full replay and OMP auto-compaction. Set `OMP_ACP_STEER_MODE=steer` to restore immediate interruption. At tool/permission boundaries the adapter falls back to steer and waits for the ACP terminal response; `OMP_ACP_STEER_GRACE_MS` (default 60000) and `OMP_ACP_STEER_GRACE_MAX_MS` (default 300000) bound that wait. Explicit user cancellation is never held: the adapter aborts the upstream prompt immediately, so the ACP server receives `session/cancel` at once. Queue steering still holds the active turn, and the graceful drain and checkpoint reuse semantics are unchanged.
|
|
181
264
|
|
|
182
265
|
ACP runtimes stay warm for 15 minutes by default. Set `OMP_ACP_IDLE_TIMEOUT_MS=0` to keep them until OMP exits, or lower the value to reclaim memory sooner.
|
|
183
266
|
|
|
@@ -199,7 +282,8 @@ A `refusal` stop reason is reported as an explicit provider refusal. An empty `e
|
|
|
199
282
|
## Limitations vs direct OAuth
|
|
200
283
|
|
|
201
284
|
- No direct model API endpoint or reverse-proxy mode.
|
|
202
|
-
-
|
|
285
|
+
- Credentials come from the ACP server's own stores: Google browser consent, `GEMINI_API_KEY`, or a Gemini API key saved in OMP's auth store. Raw OAuth tokens supplied by hand and service accounts are not accepted. Keyring access is limited to what the adapter can inspect; see [Supported platforms](#supported-platforms).
|
|
286
|
+
- Usage and quota through a key saved in OMP's auth store can be incomplete, because the host usage provider is not passed that credential.
|
|
203
287
|
- Only models advertised by the ACP server are available.
|
|
204
288
|
- Only thinking levels confirmed by the ACP server are selectable.
|
|
205
289
|
- No arbitrary generation controls: temperature, top_p, seed, stop sequences, tool_choice, response format, or output-token limit.
|
|
@@ -207,10 +291,25 @@ A `refusal` stop reason is reported as an explicit provider refusal. An empty `e
|
|
|
207
291
|
- No guaranteed prompt-cache hits, cache discounts, or identical tokenization.
|
|
208
292
|
- No full native history or hidden reasoning across a cold rebuild; server-side compaction is outside adapter control.
|
|
209
293
|
- No per-tool native allowlist; `native-tools` supports only `prefer` and `disabled`, and global MCP servers remain.
|
|
210
|
-
- No standalone client;
|
|
294
|
+
- No standalone client; a usable ACP server, either the `agy` CLI or the managed runtime, is required.
|
|
211
295
|
|
|
212
296
|
Detailed behavior, advanced settings and limitations: [docs/](docs/) and [CHANGELOG.md](CHANGELOG.md).
|
|
213
297
|
|
|
298
|
+
## Release tooling
|
|
299
|
+
|
|
300
|
+
For a prepared release, first update `CHANGELOG.md`, then run `npm run release:bump -- X.Y.Z`. The helper updates all six supported version declarations and runs the version consistency checker; it does not commit, tag, push or publish. `npm run check:versions` verifies the current metadata, and `node scripts/check-release-versions.mjs --release --tag vX.Y.Z` additionally checks the tag and changelog heading.
|
|
301
|
+
|
|
302
|
+
The `Release` workflow runs only for pushed `v*` tags. It reruns the offline check, validates the packed tarball against the tag and commit, then uses npm trusted publishing with provenance before creating or reusing the GitHub release. The tag run is the only publishing path; do not publish from a local checkout.
|
|
303
|
+
|
|
304
|
+
## Contributors
|
|
305
|
+
|
|
306
|
+
The Linux Secret Service credential handling and model metadata/fallback adaptations come from [Maddock (@notmaddock)](https://github.com/notmaddock)'s work, including [PR #2](https://github.com/SenCha930511/omp-antigravity-acp-provider/pull/2). Image-eviction continuity and hidden-seed guards are adapted from `ldfhhc/omp-antigravity-acp-provider`. Auth/discovery, Bun SQLite usage, CLI stat caching, quota timing, warmup and release-helper adaptations use work from `00lllooolll00/omp-antigravity-acp-provider`, with additional integration and lifecycle fixes in this repository.
|
|
307
|
+
The standard Google OAuth endpoint and AccountChooser handling in headless login is adapted from [Dwi Fitriyanto (@masred)](https://github.com/masred)'s [PR #14](https://github.com/SenCha930511/omp-antigravity-acp-provider/pull/14).
|
|
308
|
+
|
|
309
|
+
See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for links to all four fork projects and the separation between their adaptations and the upstream project attribution.
|
|
310
|
+
|
|
311
|
+
GitHub counts a contributor when a commit that credits them, as author or through a `Co-authored-by:` trailer, reaches the default branch ([contributor list](https://docs.github.com/en/repositories/viewing-activity-and-data-for-your-repository/viewing-a-projects-contributors), [co-authored commits](https://docs.github.com/en/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authors)). Until commits carrying that credit are on the default branch of the public repository, its contributors page will not list the addition.
|
|
312
|
+
|
|
214
313
|
## License
|
|
215
314
|
|
|
216
|
-
MIT. See [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Upstream
|
|
315
|
+
MIT. See [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Upstream 0.1.15 code is incorporated into the owned runtime sources under `extension/runtime/` (MIT) and kept with attribution. Official Google executables and their licenses are separate.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
omp-antigravity-acp-provider is an OMP-focused derivative fork/adaptation of [pi-antigravity-acp-provider](https://github.com/zacbemis/pi-antigravity-acp-provider), originally created by [zacbemis](https://github.com/zacbemis) and contributors and distributed under MIT.
|
|
3
|
+
omp-antigravity-acp-provider is an OMP-focused derivative fork/adaptation of [pi-antigravity-acp-provider](https://github.com/zacbemis/pi-antigravity-acp-provider), originally created by [zacbemis](https://github.com/zacbemis) and contributors and distributed under MIT. Upstream 0.1.15 code is incorporated directly into the owned runtime sources under `extension/runtime/` and is kept with attribution; there is no separate vendored copy or upstream package dependency.
|
|
4
4
|
|
|
5
5
|
The upstream authors retain credit for the original ACP transport, authentication, runtime installation, session restoration and MCP bridge implementation.
|
|
6
6
|
|
|
7
7
|
Its original license notice follows. The adapter adds OMP-specific registration, model selectors, lifecycle handling, tool-routing instructions and cost estimation. Published npm packages include the generated `THIRD_PARTY_LICENSES.txt` with license notices for bundled dependencies. Google runtime executables are not included.
|
|
8
8
|
|
|
9
|
+
## Community fork adaptations
|
|
10
|
+
|
|
11
|
+
The following community work was adapted into the owned adapter architecture rather than merging the pre-refactor source trees. These notices cover adaptation, not endorsement by the contributors or by Google.
|
|
12
|
+
|
|
13
|
+
- [notmaddock/omp-antigravity-acp-provider](https://github.com/notmaddock/omp-antigravity-acp-provider) (`@notmaddock`): Linux Secret Service authentication and known Claude/GPT-OSS metadata plus offline partner-model fallback.
|
|
14
|
+
- [ldfhhc/omp-antigravity-acp-provider](https://github.com/ldfhhc/omp-antigravity-acp-provider) (`@ldfhhc`): oldest-image history continuity and hidden history/request seed guards. The independently guarded implementation lives in `extension/runtime/image-history.ts` and `extension/runtime/history-seed.ts`.
|
|
15
|
+
- [00lllooolll00/omp-antigravity-acp-provider](https://github.com/00lllooolll00/omp-antigravity-acp-provider) (`@00lllooolll00`): fresh-login watcher protection, Hydrogen/offline catalog discovery, Bun SQLite usage, CLI stat caching, quota refresh grace, standby warmup and release helper ideas, adapted and additionally hardened in this repository.
|
|
16
|
+
- [masred/omp-antigravity-acp-provider](https://github.com/masred/omp-antigravity-acp-provider) (`@masred`): standard Google OAuth endpoints and AccountChooser handling for headless login, adapted into `extension/runtime/acp/headless-oauth.ts`.
|
|
17
|
+
|
|
18
|
+
Each contribution remains distinguishable in the owned source and its feature commit where applicable. The adapter does not copy fork-specific package names, publishing identities or personal skill files.
|
|
19
|
+
|
|
9
20
|
```
|
|
10
21
|
MIT License
|
|
11
22
|
|
package/extension/acp-errors.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// OMP decides whether to retry from the assistant error text. Keep the
|
|
2
2
|
// transport's distinction between account exhaustion and a transient throttle
|
|
3
3
|
// visible instead of collapsing both into "protocol".
|
|
4
|
+
import { redactSensitiveText } from "./redact.ts";
|
|
5
|
+
|
|
4
6
|
export type AcpFailureCode =
|
|
5
7
|
| "auth"
|
|
6
8
|
| "quota"
|
|
@@ -100,20 +102,49 @@ function isAntigravityAcpError(error: unknown): error is AntigravityAcpErrorLike
|
|
|
100
102
|
&& typeof (error as { code?: unknown }).code === "string";
|
|
101
103
|
}
|
|
102
104
|
|
|
105
|
+
function sanitizedCause(error: unknown): Error {
|
|
106
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
107
|
+
const sanitized = new Error(redactSensitiveText(message));
|
|
108
|
+
if (error instanceof Error) {
|
|
109
|
+
sanitized.name = error.name;
|
|
110
|
+
if (error.stack) sanitized.stack = redactSensitiveText(error.stack);
|
|
111
|
+
const code = (error as { code?: unknown }).code;
|
|
112
|
+
if (typeof code === "string") Object.assign(sanitized, { code });
|
|
113
|
+
}
|
|
114
|
+
return sanitized;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function needsSanitization(error: unknown): boolean {
|
|
118
|
+
return error instanceof Error
|
|
119
|
+
&& (error.cause !== undefined || Boolean(error.stack && redactSensitiveText(error.stack) !== error.stack));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function sanitizedError(error: unknown): Error {
|
|
123
|
+
const sanitized = sanitizedCause(error);
|
|
124
|
+
if (error instanceof Error && error.cause !== undefined) sanitized.cause = sanitizedCause(error.cause);
|
|
125
|
+
return sanitized;
|
|
126
|
+
}
|
|
127
|
+
|
|
103
128
|
export function classifyAcpFailure(error: unknown): Error {
|
|
104
129
|
if (isAntigravityAcpError(error)) {
|
|
105
130
|
if (error.code === "aborted") return error;
|
|
106
|
-
|
|
107
|
-
if (error.code === "
|
|
108
|
-
if (error.code === "
|
|
109
|
-
if (error.code === "
|
|
110
|
-
if (error.code === "
|
|
111
|
-
if (error.code === "
|
|
131
|
+
const cause = { cause: sanitizedCause(error) };
|
|
132
|
+
if (error.code === "auth") return new AcpFailure("auth", redactSensitiveText(appendHint(error.message, AUTH_RULE)), cause);
|
|
133
|
+
if (error.code === "quota") return new AcpFailure("quota", redactSensitiveText(appendHint(error.message, QUOTA_RULE)), cause);
|
|
134
|
+
if (error.code === "timeout") return new AcpFailure("timeout", redactSensitiveText(appendHint(error.message, TIMEOUT_RULE)), cause);
|
|
135
|
+
if (error.code === "spawn" || error.code === "process_exit") return new AcpFailure("transport", redactSensitiveText(appendHint(error.message, TRANSPORT_RULE)), cause);
|
|
136
|
+
if (error.code === "protocol" || error.code === "invalid_input") return new AcpFailure("protocol", redactSensitiveText(appendHint(error.message, PROTOCOL_RULE)), cause);
|
|
137
|
+
if (error.code === "model") return new AcpFailure("model", redactSensitiveText(error.message), cause);
|
|
112
138
|
}
|
|
113
139
|
const message = error instanceof Error ? error.message : String(error);
|
|
114
|
-
if (!message.trim()) return error instanceof Error ? error : new Error(message);
|
|
140
|
+
if (!message.trim()) return needsSanitization(error) ? sanitizedError(error) : error instanceof Error ? error : new Error(message);
|
|
115
141
|
for (const rule of RULES) {
|
|
116
|
-
if (rule.match.test(message))
|
|
142
|
+
if (rule.match.test(message)) {
|
|
143
|
+
return new AcpFailure(rule.code, redactSensitiveText(appendHint(message, rule)), { cause: sanitizedCause(error) });
|
|
144
|
+
}
|
|
117
145
|
}
|
|
118
|
-
|
|
146
|
+
const redacted = redactSensitiveText(message);
|
|
147
|
+
const needs = needsSanitization(error);
|
|
148
|
+
if (redacted === message && !needs) return error instanceof Error ? error : new Error(message);
|
|
149
|
+
return redacted === message ? sanitizedError(error) : new Error(redacted);
|
|
119
150
|
}
|