pi-agy-acp 0.1.1 → 0.1.3
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/CHANGELOG.md +29 -0
- package/README.md +18 -37
- package/docs/development.md +65 -18
- package/docs/reference.md +55 -50
- package/index.ts +155 -17
- package/package.json +9 -4
- package/src/acp-process.ts +7 -5
- package/src/config.ts +75 -0
- package/src/conversation.ts +261 -37
- package/src/format.ts +70 -14
- package/src/history.ts +30 -7
- package/src/jsonrpc.ts +16 -0
- package/src/mcp-bridge.ts +227 -32
- package/src/pi-stream.ts +120 -46
- package/src/preflight.ts +1 -14
- package/src/quota.ts +15 -0
- package/src/runtime.ts +390 -496
- package/src/util.ts +35 -5
- package/src/version.ts +5 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.3]
|
|
4
|
+
|
|
5
|
+
- Default quota display to `used` across the status bar, quota panel, and warnings, with `/agy-acp quota [used|remaining]` persistence in `settings.json` and `PI_AGY_QUOTA_DISPLAY` startup override.
|
|
6
|
+
- Harden MCP HTTP request boundaries, runtime disposal, conversation turn ownership, and tool continuation/cancellation handling.
|
|
7
|
+
- Correct the minimum Node.js version to 22.19.0 to match Pi 1.5.x requirements.
|
|
8
|
+
- Add contribution and security policies, issue templates, dependency updates, and CI coverage for Node.js 22.19.0 and 24.
|
|
9
|
+
|
|
10
|
+
## [0.1.2]
|
|
11
|
+
|
|
12
|
+
- Fix model refresh self-cancellation and support forced or cancelled refreshes.
|
|
13
|
+
- Keep ACP running during compaction and tree navigation while clearing conversation sessions.
|
|
14
|
+
- Report context overflow and exhausted quota in the format Pi uses for recovery and retry decisions.
|
|
15
|
+
- Handle fragmented tool arguments and skip empty system updates.
|
|
16
|
+
- Show cached quota in the status bar and check quota after settled Antigravity runs, with deduplicated low-quota warnings.
|
|
17
|
+
- Stop automatic prompt-cache warming and keep runtime warnings out of the TUI.
|
|
18
|
+
- Report the package version in ACP and MCP handshakes.
|
|
19
|
+
|
|
20
|
+
## [0.1.1]
|
|
21
|
+
|
|
22
|
+
- Add CI and release workflows, with tag validation and safe release retries.
|
|
23
|
+
- Deduplicate model discovery and clean up temporary ACP session files and rotated logs.
|
|
24
|
+
|
|
25
|
+
## [0.1.0]
|
|
26
|
+
|
|
27
|
+
- Add the Antigravity ACP provider for Pi, including streaming, images, and parallel tool calls.
|
|
28
|
+
- Discover account models and reasoning levels through ACP.
|
|
29
|
+
- Add status and quota panels with account details, remaining-quota bars, and reset countdowns.
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# pi-agy-acp
|
|
2
2
|
|
|
3
|
+
[](https://github.com/fdkevin0/pi-agy-acp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/pi-agy-acp)
|
|
5
|
+
|
|
3
6
|
Use Google Antigravity in Pi through the official, locally installed `agy` CLI.
|
|
4
7
|
This extension registers the `antigravity-acp` provider and lets Pi execute the
|
|
5
8
|
model's tool calls. It supports streaming text and reasoning, images, and
|
|
@@ -7,45 +10,32 @@ parallel tool calls.
|
|
|
7
10
|
|
|
8
11
|
## Prerequisites
|
|
9
12
|
|
|
10
|
-
- Node.js >= 22.
|
|
13
|
+
- Node.js >= 22.19.0.
|
|
11
14
|
- Pi (`@earendil-works/pi-coding-agent`) 1.5.x.
|
|
12
15
|
- The official `agy` CLI >= 1.4.12, signed in with your Google account.
|
|
13
16
|
Run `agy` in your terminal to complete sign-in before using the extension.
|
|
14
17
|
|
|
15
18
|
## Install
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
Install from GitHub (recommended) or npm:
|
|
18
21
|
|
|
19
22
|
```sh
|
|
20
23
|
pi install git:github.com/fdkevin0/pi-agy-acp
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
From npm:
|
|
24
|
-
|
|
25
|
-
```sh
|
|
24
|
+
# Or:
|
|
26
25
|
pi install npm:pi-agy-acp
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
pi install -l git:github.com/fdkevin0/pi-agy-acp
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
To try it for one invocation without saving an installation to settings:
|
|
28
|
+
Add `-l` to install only for the current project (`.pi/settings.json`). To try,
|
|
29
|
+
update, or remove the extension:
|
|
36
30
|
|
|
37
31
|
```sh
|
|
38
32
|
pi -e git:github.com/fdkevin0/pi-agy-acp
|
|
33
|
+
pi update --extensions
|
|
34
|
+
pi remove git:github.com/fdkevin0/pi-agy-acp
|
|
39
35
|
```
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
git clone https://github.com/fdkevin0/pi-agy-acp.git
|
|
45
|
-
pi install ./pi-agy-acp
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
See [development setup](docs/development.md) for dependencies and local testing.
|
|
37
|
+
For npm, remove `npm:pi-agy-acp` instead. Add `-l` when removing a project-local
|
|
38
|
+
installation. See [development setup](docs/development.md) for local testing.
|
|
49
39
|
|
|
50
40
|
## Usage
|
|
51
41
|
|
|
@@ -57,23 +47,11 @@ automatically from your account.
|
|
|
57
47
|
| Command | Purpose |
|
|
58
48
|
| --- | --- |
|
|
59
49
|
| `/agy-acp` or `/agy-acp status` | Show runtime state, account details, models, sessions, and the last turn. |
|
|
60
|
-
| `/agy-acp quota` | Show
|
|
50
|
+
| `/agy-acp quota [used\|remaining]` | Show account details, grouped quota bars, and reset countdowns (remembers the last selected mode). |
|
|
61
51
|
| `/agy-acp reset` | Close ACP sessions; the next request rebuilds the connection. |
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```sh
|
|
66
|
-
pi update --extensions
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Remove a GitHub installation:
|
|
70
|
-
|
|
71
|
-
```sh
|
|
72
|
-
pi remove git:github.com/fdkevin0/pi-agy-acp
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
For an npm installation, use `pi remove npm:pi-agy-acp`. Add `-l` when removing
|
|
76
|
-
a project-local installation.
|
|
53
|
+
After an Antigravity turn settles, the status bar shows quota usage (for example,
|
|
54
|
+
`AGY 20%`, or `AGY 80%` in `remaining` mode) and warns when quota is low; see [quota status](docs/reference.md#quota-status-and-warnings).
|
|
77
55
|
|
|
78
56
|
Default prices are zero, not a promise of free calls. Pi pricing overrides are
|
|
79
57
|
used when configured.
|
|
@@ -82,4 +60,7 @@ used when configured.
|
|
|
82
60
|
|
|
83
61
|
- [Reference](docs/reference.md): commands, configuration, stored data, model discovery, and limitations.
|
|
84
62
|
- [Development](docs/development.md): setup, request flow, source layout, and verification.
|
|
63
|
+
- [Changelog](CHANGELOG.md): release history and upcoming changes.
|
|
85
64
|
- [Attribution](NOTICE) and [MIT license](LICENSE).
|
|
65
|
+
|
|
66
|
+
For contributions, see [CONTRIBUTING.md](https://github.com/fdkevin0/pi-agy-acp/blob/main/CONTRIBUTING.md). Report vulnerabilities through the [security policy](https://github.com/fdkevin0/pi-agy-acp/blob/main/SECURITY.md).
|
package/docs/development.md
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
Start with the [installation guide](../README.md#install) to use the extension.
|
|
4
4
|
For settings and user-visible limits, see the [reference](reference.md).
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Clone the repository and install its dependencies:
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
+
git clone https://github.com/fdkevin0/pi-agy-acp.git
|
|
10
|
+
cd pi-agy-acp
|
|
9
11
|
npm install
|
|
10
12
|
pi -e ./index.ts
|
|
11
13
|
```
|
|
@@ -24,13 +26,53 @@ pi -e ./index.ts
|
|
|
24
26
|
5. The adapter drains the runtime's generator before publishing completion, so
|
|
25
27
|
session cleanup finishes before Pi can start its next step.
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
timers.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
- **Model discovery:** Registration and cache-only refresh start no processes,
|
|
30
|
+
sockets, or timers. Concurrent refreshes share a discovery session; after a live
|
|
31
|
+
catalog is observed, later refreshes reuse it unless forced. Refresh suppresses
|
|
32
|
+
provider re-registration so it cannot cancel itself. Cancellation ends the
|
|
33
|
+
caller's wait; shared discovery still closes its session and cleans its files.
|
|
34
|
+
- **Session lifecycle:** The bridge binds to `127.0.0.1`, uses per-session bearer
|
|
35
|
+
credentials, and validates structured tool identity before granting permissions.
|
|
36
|
+
Tree navigation and compaction close conversation sessions and their files,
|
|
37
|
+
retaining the process, bridge, and caches. `session_start` (`new`, `resume`, or
|
|
38
|
+
`fork`) uses the same light reset if the runtime survives; `session_shutdown`
|
|
39
|
+
and `/agy-acp reset` dispose the runtime.
|
|
40
|
+
Disposal is idempotent, drains in-flight startup and bridge binding, cancels
|
|
41
|
+
waiters, and rolls back late session replies from obsolete processes or
|
|
42
|
+
conversations. A turn owns cancellation through streaming and parked tool
|
|
43
|
+
execution until its step drains, `agent_settled` runs, or the process exits;
|
|
44
|
+
only a fully drained `tool-calls` handoff preserves parked tool calls.
|
|
45
|
+
First interruption wins (`abandon` vs. `fail`), cancellation takes priority
|
|
46
|
+
over buffered output, and turn/tenant identities guard all async callbacks.
|
|
47
|
+
- **Quota and TUI:** Settled checks share the reader's TTL and in-flight request
|
|
48
|
+
without blocking Pi. Model selection reads memory only. UI generation checks
|
|
49
|
+
discard stale background results; warning keys include bucket, reset time, and
|
|
50
|
+
threshold. An explicit quota query can discover uncached account tiers through
|
|
51
|
+
one tool-less ACP session per runtime, persisting the tier in `catalog.json`.
|
|
52
|
+
Email lookup reads at most the last 64 KiB of each candidate login log and uses
|
|
53
|
+
the last match in the first matching file. Runtime warnings stay off stderr to
|
|
54
|
+
preserve TUI rendering; diagnostics use status and agy's logs.
|
|
55
|
+
- **Pi stream and error contracts:** `onPayload` can replace the request, and
|
|
56
|
+
`onProviderStreamEvent` observes events before conversion. At the first stream
|
|
57
|
+
event, `onResponse` receives synthetic status `200` and empty headers before
|
|
58
|
+
normalization; startup failures and an initial aborted finish emit no response.
|
|
59
|
+
ACP supplies no HTTP response metadata. Context overflow and exhausted quota
|
|
60
|
+
receive `context_length_exceeded` and `quota exceeded` markers for Pi's
|
|
61
|
+
compaction and retry decisions; transport timeouts remain distinct.
|
|
62
|
+
|
|
63
|
+
## MCP HTTP boundary
|
|
64
|
+
|
|
65
|
+
The loopback bridge returns 400 for invalid URLs and 413 for authenticated POST
|
|
66
|
+
bodies exceeding 1 MiB (1,048,576 bytes), including chunked uploads. Rejected
|
|
67
|
+
oversized uploads close their connection after the error response. JSON parse
|
|
68
|
+
errors retain the MCP parse-error response. Unexpected handler failures return
|
|
69
|
+
500 before headers or destroy an already-started response; listener errors go to
|
|
70
|
+
the diagnostic sink.
|
|
71
|
+
|
|
72
|
+
Node's HTTP parser enforces a 10-second header reception deadline and a 30-second
|
|
73
|
+
whole-request reception deadline, checked every second. These are reception limits
|
|
74
|
+
only and do not cap completed SSE tool streams. Shutdown stops accepting
|
|
75
|
+
connections and destroys all tracked sockets without waiting for tool promises.
|
|
34
76
|
|
|
35
77
|
## Source layout
|
|
36
78
|
|
|
@@ -38,10 +80,11 @@ compaction trigger cleanup and rebuilding; shutdown closes processes and the bri
|
|
|
38
80
|
| --- | --- |
|
|
39
81
|
| `index.ts` | Provider registration, commands, and Pi lifecycle hooks. |
|
|
40
82
|
| `src/pi-stream.ts`, `src/protocol.ts` | Pi message conversion and bridge event contracts. |
|
|
41
|
-
| `src/runtime.ts`, `src/conversation.ts`, `src/history.ts` |
|
|
42
|
-
| `src/acp-process.ts`, `src/jsonrpc.ts`, `src/mcp-bridge.ts` | ACP transport
|
|
83
|
+
| `src/runtime.ts`, `src/conversation.ts`, `src/history.ts` | Session orchestration, pending calls, tool identity metadata, streaming, and history replay. |
|
|
84
|
+
| `src/acp-process.ts`, `src/jsonrpc.ts`, `src/mcp-bridge.ts` | ACP transport, local MCP server, tool schema compression, and tool deltas. |
|
|
43
85
|
| `src/host.ts`, `src/preflight.ts`, `src/config.ts` | Process execution, executable discovery, and isolated home setup. |
|
|
44
86
|
| `src/catalog.ts`, `src/quota.ts`, `src/format.ts`, `src/util.ts` | Model catalog, quota queries, TUI notice formatting, and shared utilities. |
|
|
87
|
+
| `src/version.ts` | ACP/MCP version read from `package.json`. |
|
|
45
88
|
| `tests/` | Scripted agy fixture, runtime tests, and Pi integration tests. |
|
|
46
89
|
|
|
47
90
|
Upstream provenance and licensing are recorded in [NOTICE](../NOTICE) and
|
|
@@ -59,9 +102,8 @@ Tests run directly with Node's native TypeScript support; `tsx` is not required.
|
|
|
59
102
|
Automated tests use a scripted local `agy` substitute so `npm test` runs offline
|
|
60
103
|
without consuming account quota. They need permission to listen on `127.0.0.1`.
|
|
61
104
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
account metadata caching, bounded login-log reads, and Pi stream completion.
|
|
105
|
+
Tests cover ACP transport and sessions, tool routing and permissions, model and
|
|
106
|
+
account discovery, Pi streaming and cancellation, and quota UI behavior.
|
|
65
107
|
Listing models verifies extension loading, not access to the real service.
|
|
66
108
|
|
|
67
109
|
To inspect the package contents without publishing:
|
|
@@ -74,12 +116,17 @@ npm pack --dry-run
|
|
|
74
116
|
|
|
75
117
|
`ci.yml` checks pull requests and pushes to `main`. `release.yml` runs only for
|
|
76
118
|
version-tag pushes or manual runs on an existing tag, so ordinary commits do not
|
|
77
|
-
run a second test suite or trigger publication.
|
|
78
|
-
committed lockfile, so dependency
|
|
119
|
+
run a second test suite or trigger publication. CI tests Node.js 22.19.0 and 24;
|
|
120
|
+
releases use Node.js 24. There is no committed lockfile, so dependency
|
|
121
|
+
installation uses `npm install`.
|
|
122
|
+
|
|
123
|
+
All changes to `main` require a pull request, passing CI on both Node versions,
|
|
124
|
+
and resolved review discussions. Squash merge after CI passes; no second-person
|
|
125
|
+
approval is required.
|
|
79
126
|
|
|
80
|
-
To release, bump `package.json
|
|
81
|
-
`vX.Y.Z` tag
|
|
82
|
-
a time and never move a published tag. It validates the tag and version, then
|
|
127
|
+
To release, bump `package.json` through a pull request, merge it, and tag the
|
|
128
|
+
merged commit with its matching `vX.Y.Z` tag, then push the tag. The workflow
|
|
129
|
+
accepts stable versions only; publish one version at a time and never move a published tag. It validates the tag and version, then
|
|
83
130
|
checks, tests, and packs before publishing. Only a registry 404 means the version
|
|
84
131
|
is absent; network, authentication, and server errors stop the job.
|
|
85
132
|
|
package/docs/reference.md
CHANGED
|
@@ -7,11 +7,11 @@ For installation and your first request, start with the [installation guide](../
|
|
|
7
7
|
| Command | Behavior |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| `/agy-acp` or `/agy-acp status` | Show a status panel with runtime state, paths, sessions, model reasoning levels, and the last turn. |
|
|
10
|
-
| `/agy-acp quota` | Show account details, grouped quota bars, and reset countdowns. |
|
|
10
|
+
| `/agy-acp quota [used\|remaining]` | Show account details, grouped quota bars, and reset countdowns, optionally switching and remembering the display mode. |
|
|
11
11
|
| `/agy-acp reset` | Close ACP sessions; the next request rebuilds a session from Pi's history. |
|
|
12
12
|
|
|
13
13
|
Subcommands support completion with Tab. Unknown arguments display
|
|
14
|
-
`Usage: /agy-acp [status|quota|reset]` as a warning.
|
|
14
|
+
`Usage: /agy-acp [status|quota [used|remaining]|reset]` as a warning.
|
|
15
15
|
|
|
16
16
|
### Status panel
|
|
17
17
|
|
|
@@ -35,8 +35,10 @@ editor. The underlying quota query may finish and update the cache, but its resu
|
|
|
35
35
|
will not appear after cancellation. Non-TUI modes query directly without a loader.
|
|
36
36
|
|
|
37
37
|
Quota is read through `agy -p /usage --output-format json`. Each model group has
|
|
38
|
-
one row per quota window, with a 12-cell bar
|
|
39
|
-
|
|
38
|
+
one row per quota window, with a 12-cell bar, a rounded percentage, and a relative
|
|
39
|
+
reset time. By default (`used` mode), bars and percentages count up from `0%`; pass
|
|
40
|
+
`remaining` (`/agy-acp quota remaining`) to count down from `100%`. The last
|
|
41
|
+
selected mode is saved in `settings.json` inside `PI_AGY_HOME`. For example:
|
|
40
42
|
|
|
41
43
|
```text
|
|
42
44
|
Antigravity Quota
|
|
@@ -44,8 +46,8 @@ Antigravity Quota
|
|
|
44
46
|
|
|
45
47
|
Gemini Models
|
|
46
48
|
Gemini Flash, Gemini Pro
|
|
47
|
-
5h [
|
|
48
|
-
weekly [
|
|
49
|
+
5h [░░░░░░░░░░░░] 0% · resets in 4h 59m
|
|
50
|
+
weekly [█░░░░░░░░░░░] 9% · resets in 6d 7h
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
Missing values display `n/a`; an elapsed reset time displays `resetting soon`.
|
|
@@ -53,30 +55,44 @@ Severity uses the actual remaining fraction rather than the rounded percentage:
|
|
|
53
55
|
|
|
54
56
|
| Condition | Notification |
|
|
55
57
|
| --- | --- |
|
|
56
|
-
| All known windows above 20% | Info |
|
|
57
|
-
| Any window at or below 20
|
|
58
|
-
| Any window at or below 5
|
|
58
|
+
| All known windows above 20% remaining (<80% used) | Info |
|
|
59
|
+
| Any window at or below 20% remaining (≥80% used), with none at or below 5% remaining | Warning |
|
|
60
|
+
| Any window at or below 5% remaining (≥95% used), or a failed quota query | Error |
|
|
59
61
|
|
|
60
62
|
Errors include the reason. If cached groups are available after a failed query,
|
|
61
|
-
the title marks them as `(stale)` and still displays their bars. An empty
|
|
62
|
-
response displays `No quota data available.`.
|
|
63
|
+
the title marks them as `(stale)` and still displays their bars. An empty
|
|
64
|
+
successful response displays `No quota data available.`.
|
|
63
65
|
|
|
64
66
|
### Account details
|
|
65
67
|
|
|
66
|
-
Both panels show the email and subscription plan when known
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
68
|
+
Both panels show the email and subscription plan when known, omitting unavailable
|
|
69
|
+
fields. If no plan is cached, the first `/agy-acp quota` query also tries to discover
|
|
70
|
+
it. This may start ACP but sends no model prompt; failure does not prevent quota
|
|
71
|
+
from appearing. Use `/agy-acp reset` to retry discovery. Viewing status never starts it.
|
|
72
|
+
|
|
73
|
+
The email comes from login logs. With the default home only, the extension also
|
|
74
|
+
checks `~/.gemini/antigravity-cli/cli.log` if needed; a custom `PI_AGY_HOME` stays
|
|
75
|
+
isolated. Cached plans and login logs can be stale after an account change.
|
|
76
|
+
|
|
77
|
+
### Quota status and warnings
|
|
78
|
+
|
|
79
|
+
When a run using `antigravity-acp` fully settles, the extension checks `/usage`
|
|
80
|
+
in the background and shows a compact status such as `AGY 20%` (or `AGY 80%`
|
|
81
|
+
in `remaining` mode). It uses the lowest remaining window in the selected model
|
|
82
|
+
family's group, falling back to the lowest remaining quota across groups when
|
|
83
|
+
the family cannot be matched. Failed checks stay silent. Successful results and
|
|
84
|
+
failures both respect the two-minute quota TTL, and overlapping background
|
|
85
|
+
checks are skipped.
|
|
86
|
+
|
|
87
|
+
At 20% and 5% remaining (80% and 95% used), a warning appears once per bucket,
|
|
88
|
+
reset time, and threshold. `/agy-acp quota` explicitly refreshes quota and updates
|
|
89
|
+
the status; `/agy-acp status` uses fresh cached quota only. Neither session start
|
|
90
|
+
nor model selection launches a quota command. Selecting another provider hides the
|
|
91
|
+
status; returning to Antigravity uses only a fresh in-memory snapshot. Reset and
|
|
92
|
+
shutdown clear the status.
|
|
93
|
+
|
|
94
|
+
While loaded, this extension vetoes Pi's automatic prompt-cache warming to avoid
|
|
95
|
+
idle requests consuming quota. It does not alter explicit model requests.
|
|
80
96
|
|
|
81
97
|
## Configuration
|
|
82
98
|
|
|
@@ -86,6 +102,7 @@ Set these environment variables before starting Pi:
|
|
|
86
102
|
| --- | --- | --- |
|
|
87
103
|
| `PI_AGY_COMMAND` | Absolute path to the `agy` executable. | Automatic discovery. |
|
|
88
104
|
| `PI_AGY_HOME` | Dedicated directory for this extension's agy state. | `~/.pi/agent/cache/antigravity-acp` |
|
|
105
|
+
| `PI_AGY_QUOTA_DISPLAY` | Startup quota display mode (`used` or `remaining`), overriding `settings.json` for startup. Invalid values are ignored; `/agy-acp quota <mode>` overrides it for the active session. | `settings.json`, then `used` |
|
|
89
106
|
|
|
90
107
|
For example:
|
|
91
108
|
|
|
@@ -98,13 +115,11 @@ PI_AGY_COMMAND=/absolute/path/to/agy pi -e ./index.ts
|
|
|
98
115
|
The dedicated directory isolates the bridge agent from your normal agy tools and
|
|
99
116
|
plugins. It contains agy-managed session data, logs, and the extension's model cache.
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
different `PI_AGY_HOME` for each concurrently running Pi instance, since startup
|
|
107
|
-
cleanup assumes exclusive use of the directory.
|
|
118
|
+
Temporary session data and old logs are removed automatically. The current log,
|
|
119
|
+
model cache, `settings.json` (quota display preference), and authentication files
|
|
120
|
+
are retained; sessions rebuild from Pi's history. Cleanup is best-effort if files are locked. Use a different `PI_AGY_HOME`
|
|
121
|
+
for each concurrently running Pi instance, since startup cleanup assumes exclusive
|
|
122
|
+
use of the directory.
|
|
108
123
|
|
|
109
124
|
With file-backed authentication, the extension copies the existing OAuth token
|
|
110
125
|
from your normal agy directory and sets its permissions to `0600`. Do not commit
|
|
@@ -112,16 +127,12 @@ or share this directory. Authentication and token refresh remain agy's responsib
|
|
|
112
127
|
|
|
113
128
|
## Models and context
|
|
114
129
|
|
|
115
|
-
Loading the extension
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
ACP. Server-advertised models are not hidden, and live catalog changes update
|
|
122
|
-
Pi's model selector. The selector exposes only the ACP reasoning levels offered
|
|
123
|
-
for each model. Direct requests map `minimal` to `low` and `xhigh` or `max` to
|
|
124
|
-
`high`; `off` leaves the ACP effort unspecified, using the runtime default.
|
|
130
|
+
Loading the extension uses the cached catalog, or five fallback model families,
|
|
131
|
+
without starting agy. Model refresh or the first request updates available models
|
|
132
|
+
and reasoning levels from ACP. A forced refresh queries again; refreshes can be
|
|
133
|
+
cancelled. The selector exposes only the reasoning levels offered for each model.
|
|
134
|
+
Direct requests map `minimal` to `low` and `xhigh` or `max` to `high`; `off` uses
|
|
135
|
+
the runtime default.
|
|
125
136
|
|
|
126
137
|
The fallback families are:
|
|
127
138
|
|
|
@@ -152,16 +163,10 @@ binary patch scripts.
|
|
|
152
163
|
## Compatibility limits
|
|
153
164
|
|
|
154
165
|
This version targets the `@earendil-works/*` Pi packages at version 1.5.x.
|
|
155
|
-
Host peer dependencies use `*` as required by Pi package conventions;
|
|
156
|
-
|
|
166
|
+
Host peer dependencies use `*` as required by Pi package conventions; development
|
|
167
|
+
dependencies constrain CI to Pi 1.5.x, which requires Node.js >= 22.19.0. Compatibility with older
|
|
157
168
|
`@mariozechner/*` interfaces is not claimed.
|
|
158
169
|
|
|
159
|
-
The bridge supports `onPayload` request replacement and `onProviderStreamEvent`
|
|
160
|
-
observation before conversion to Pi events. At the first ACP stream event, it
|
|
161
|
-
invokes `onResponse` with synthetic status `200` and empty headers before
|
|
162
|
-
normalizing that event. This is a Pi instrumentation notification, not an HTTP
|
|
163
|
-
response from agy. Startup errors before the first event do not emit it.
|
|
164
|
-
|
|
165
170
|
Sampling parameters, output limits, forced `toolChoice`, and provider-scoped
|
|
166
171
|
environment overrides are not mapped to ACP. See
|
|
167
172
|
[development checks](development.md#verification) for the scope of automated validation.
|