opencode-antigravity-auth 1.6.0 → 2.0.0
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 +36 -12
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/src/antigravity/oauth.d.ts.map +1 -1
- package/dist/src/antigravity/oauth.js +25 -29
- package/dist/src/antigravity/oauth.js.map +1 -1
- package/dist/src/constants.d.ts +53 -25
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +66 -47
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/cache.js +1 -1
- package/dist/src/hooks/auto-update-checker/checker.d.ts +1 -1
- package/dist/src/hooks/auto-update-checker/checker.js +2 -2
- package/dist/src/hooks/auto-update-checker/index.d.ts +4 -4
- package/dist/src/hooks/auto-update-checker/index.js +6 -6
- package/dist/src/hooks/auto-update-checker/logging.js +1 -1
- package/dist/src/plugin/accounts.d.ts +8 -8
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +13 -7
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/auth.d.ts +1 -1
- package/dist/src/plugin/cache/index.d.ts +1 -1
- package/dist/src/plugin/cache/index.js +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts +1 -1
- package/dist/src/plugin/cache/signature-cache.js +1 -1
- package/dist/src/plugin/cache.d.ts +7 -5
- package/dist/src/plugin/cache.d.ts.map +1 -1
- package/dist/src/plugin/cache.js +20 -3
- package/dist/src/plugin/cache.js.map +1 -1
- package/dist/src/plugin/cli.d.ts +3 -3
- package/dist/src/plugin/cli.js +3 -3
- package/dist/src/plugin/config/index.d.ts +2 -2
- package/dist/src/plugin/config/index.js +2 -2
- package/dist/src/plugin/config/loader.d.ts +1 -1
- package/dist/src/plugin/config/loader.js +2 -2
- package/dist/src/plugin/config/models-v2.d.ts +36 -0
- package/dist/src/plugin/config/models-v2.d.ts.map +1 -0
- package/dist/src/plugin/config/models-v2.js +51 -0
- package/dist/src/plugin/config/models-v2.js.map +1 -0
- package/dist/src/plugin/config/models.d.ts +1 -1
- package/dist/src/plugin/config/updater.d.ts +16 -3
- package/dist/src/plugin/config/updater.d.ts.map +1 -1
- package/dist/src/plugin/config/updater.js +53 -10
- package/dist/src/plugin/config/updater.js.map +1 -1
- package/dist/src/plugin/core/streaming/index.d.ts +2 -2
- package/dist/src/plugin/core/streaming/index.js +2 -2
- package/dist/src/plugin/core/streaming/transformer.d.ts +1 -1
- package/dist/src/plugin/core/streaming/transformer.js +1 -1
- package/dist/src/plugin/debug.d.ts +1 -1
- package/dist/src/plugin/debug.js +2 -2
- package/dist/src/plugin/fingerprint.d.ts +8 -5
- package/dist/src/plugin/fingerprint.d.ts.map +1 -1
- package/dist/src/plugin/fingerprint.js +23 -41
- package/dist/src/plugin/fingerprint.js.map +1 -1
- package/dist/src/plugin/logger.d.ts +1 -1
- package/dist/src/plugin/logger.js +2 -2
- package/dist/src/plugin/project.d.ts +4 -4
- package/dist/src/plugin/project.d.ts.map +1 -1
- package/dist/src/plugin/project.js +95 -94
- package/dist/src/plugin/project.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +2 -2
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +12 -8
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/recovery/index.d.ts +3 -3
- package/dist/src/plugin/recovery/index.js +3 -3
- package/dist/src/plugin/recovery/storage.d.ts +1 -1
- package/dist/src/plugin/recovery/storage.js +1 -1
- package/dist/src/plugin/recovery.d.ts +3 -3
- package/dist/src/plugin/recovery.js +3 -3
- package/dist/src/plugin/refresh-queue.d.ts +2 -2
- package/dist/src/plugin/refresh-queue.js +2 -2
- package/dist/src/plugin/request-helpers.d.ts +1 -1
- package/dist/src/plugin/request-helpers.js +5 -5
- package/dist/src/plugin/request.d.ts +9 -6
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +23 -23
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/search.js +7 -7
- package/dist/src/plugin/search.js.map +1 -1
- package/dist/src/plugin/server.js +1 -1
- package/dist/src/plugin/storage.d.ts +3 -3
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +56 -67
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/stores/signature-store.d.ts +1 -1
- package/dist/src/plugin/token.d.ts +1 -1
- package/dist/src/plugin/token.js +5 -5
- package/dist/src/plugin/transform/claude.d.ts +1 -1
- package/dist/src/plugin/transform/claude.js +1 -1
- package/dist/src/plugin/transform/cross-model-sanitizer.js +2 -2
- package/dist/src/plugin/transform/gemini.d.ts +1 -1
- package/dist/src/plugin/transform/index.d.ts +9 -9
- package/dist/src/plugin/transform/index.js +4 -4
- package/dist/src/plugin/transform/model-resolver.d.ts +12 -1
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
- package/dist/src/plugin/transform/model-resolver.js +26 -4
- package/dist/src/plugin/transform/model-resolver.js.map +1 -1
- package/dist/src/plugin/transform/types.d.ts +1 -1
- package/dist/src/plugin/types.d.ts +26 -2
- package/dist/src/plugin/types.d.ts.map +1 -1
- package/dist/src/plugin/ui/auth-menu.d.ts +1 -1
- package/dist/src/plugin/ui/auth-menu.js +4 -4
- package/dist/src/plugin/ui/confirm.js +1 -1
- package/dist/src/plugin/ui/select.js +1 -1
- package/dist/src/plugin/version.d.ts +35 -6
- package/dist/src/plugin/version.d.ts.map +1 -1
- package/dist/src/plugin/version.js +138 -42
- package/dist/src/plugin/version.js.map +1 -1
- package/dist/src/plugin.d.ts +11 -7
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +89 -54
- package/dist/src/plugin.js.map +1 -1
- package/dist/src/v2.d.ts +4 -0
- package/dist/src/v2.d.ts.map +1 -0
- package/dist/src/v2.js +391 -0
- package/dist/src/v2.js.map +1 -0
- package/index.js +4 -0
- package/package.json +15 -7
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://x.com/dopesalmon)
|
|
8
8
|
|
|
9
|
-
Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth so you can use Antigravity rate limits and access models like `gemini-3-pro` and `claude-opus-4-6-thinking` with your Google credentials.
|
|
9
|
+
Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth so you can use Antigravity rate limits and access models like `gemini-3.1-pro` and `claude-opus-4-6-thinking` with your Google credentials.
|
|
10
10
|
|
|
11
11
|
## What You Get
|
|
12
12
|
|
|
13
|
-
- **Claude Opus 4.6, Sonnet 4.6** and **Gemini 3 Pro/Flash** via Google OAuth
|
|
13
|
+
- **Claude Opus 4.6, Sonnet 4.6** and **Gemini 3.1 Pro/Flash** via Google OAuth
|
|
14
14
|
- **Multi-account support** — add multiple Google accounts, auto-rotates when rate-limited
|
|
15
15
|
- **Dual quota system** — access both Antigravity and Gemini CLI quotas from one plugin
|
|
16
16
|
- **Thinking models** — extended thinking for Claude and Gemini 3 with configurable budgets
|
|
@@ -24,18 +24,13 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
|
|
|
24
24
|
<summary><b>⚠️ Terms of Service Warning — Read Before Installing</b></summary>
|
|
25
25
|
|
|
26
26
|
> [!CAUTION]
|
|
27
|
-
> Using this plugin
|
|
28
|
-
>
|
|
29
|
-
> **High-risk scenarios:**
|
|
30
|
-
> - 🚨 **Fresh Google accounts** have a very high chance of getting banned
|
|
31
|
-
> - 🚨 **New accounts with Pro/Ultra subscriptions** are frequently flagged and banned
|
|
27
|
+
> Using this plugin (and any proxy for Antigravity) violates Google's Terms of Service. A number of users have reported their Google accounts being **banned** or **shadow-banned** (restricted access without explicit notification).
|
|
32
28
|
>
|
|
33
29
|
> **By using this plugin, you acknowledge:**
|
|
34
30
|
> - This is an unofficial tool not endorsed by Google
|
|
35
31
|
> - Your account may be suspended or permanently banned
|
|
36
32
|
> - You assume all risks associated with using this plugin
|
|
37
33
|
>
|
|
38
|
-
> **Recommendation:** Use an established Google account that you don't rely on for critical services. Avoid creating new accounts specifically for this plugin.
|
|
39
34
|
|
|
40
35
|
</details>
|
|
41
36
|
|
|
@@ -43,6 +38,35 @@ Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth
|
|
|
43
38
|
|
|
44
39
|
## Installation
|
|
45
40
|
|
|
41
|
+
### OpenCode V2
|
|
42
|
+
|
|
43
|
+
Version **2.0.0** targets OpenCode **2.1.2 or newer**. V2 requires a new plugin implementation, plural
|
|
44
|
+
configuration keys, and a `#variant` suffix on model references.
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"$schema": "https://opencode.ai/config.json",
|
|
49
|
+
"plugins": ["opencode-antigravity-auth@latest"]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use this configuration once version 2.0.0 is published; PR checkouts can be
|
|
54
|
+
built and loaded by absolute directory path. The plugin registers its models automatically. Connect **Google → Google OAuth
|
|
55
|
+
(Antigravity)** with `opencode auth login`, then run:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
opencode run --model=google/antigravity-gemini-3-flash#high "Hello"
|
|
59
|
+
opencode run --model=google/antigravity-claude-opus-4-6-thinking#max "Hello"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Existing `antigravity-accounts.json` accounts are reused. Revoked refresh tokens
|
|
63
|
+
still require a fresh Google sign-in. See [the V2 migration and verification
|
|
64
|
+
guide](docs/OPENCODE-V2.md) for configuration examples, current Antigravity
|
|
65
|
+
protocol changes, and the runtime regression test.
|
|
66
|
+
|
|
67
|
+
The package also supports the V1 object plugin entrypoint in OpenCode
|
|
68
|
+
**1.18.29+**. The instructions below use V1 configuration and command syntax.
|
|
69
|
+
|
|
46
70
|
<details open>
|
|
47
71
|
<summary><b>For Humans</b></summary>
|
|
48
72
|
|
|
@@ -73,7 +97,7 @@ Install the opencode-antigravity-auth plugin and add the Antigravity model defin
|
|
|
73
97
|
```
|
|
74
98
|
|
|
75
99
|
3. **Add models** — choose one:
|
|
76
|
-
- Run `opencode auth login` → select **"Configure models in opencode.json"** (auto-configures all models)
|
|
100
|
+
- Run `opencode auth login` → Google → OAuth with Google (Antigravity) → select **"Configure models in opencode.json"** (auto-configures all models)
|
|
77
101
|
- Or manually copy the [full configuration](#models) below
|
|
78
102
|
|
|
79
103
|
4. **Use it:**
|
|
@@ -247,7 +271,7 @@ Add this to your `~/.config/opencode/opencode.json`:
|
|
|
247
271
|
|
|
248
272
|
## Multi-Account Setup
|
|
249
273
|
|
|
250
|
-
Add multiple Google accounts for higher combined
|
|
274
|
+
Add multiple Google accounts for a higher combined quota. The plugin automatically rotates between accounts when one is rate-limited.
|
|
251
275
|
|
|
252
276
|
```bash
|
|
253
277
|
opencode auth login # Run again to add more accounts
|
|
@@ -262,7 +286,7 @@ For details on load balancing, dual quota pools, and account storage, see [docs/
|
|
|
262
286
|
|
|
263
287
|
---
|
|
264
288
|
|
|
265
|
-
##
|
|
289
|
+
## Troubleshooting
|
|
266
290
|
|
|
267
291
|
> **Quick Reset**: Most issues can be resolved by deleting `~/.config/opencode/antigravity-accounts.json` and running `opencode auth login` again.
|
|
268
292
|
|
|
@@ -682,7 +706,7 @@ See the full [Troubleshooting Guide](docs/TROUBLESHOOTING.md) for solutions to c
|
|
|
682
706
|
|
|
683
707
|
## Support
|
|
684
708
|
|
|
685
|
-
If this plugin
|
|
709
|
+
If this plugin saves you time, consider supporting its development:
|
|
686
710
|
|
|
687
711
|
[](https://ko-fi.com/S6S81QBOIR)
|
|
688
712
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export { AntigravityCLIOAuthPlugin, GoogleOAuthPlugin, } from "./src/plugin";
|
|
2
|
-
export { authorizeAntigravity, exchangeAntigravity, } from "./src/antigravity/oauth";
|
|
3
|
-
export type { AntigravityAuthorization, AntigravityTokenExchangeResult, } from "./src/antigravity/oauth";
|
|
1
|
+
export { AntigravityCLIOAuthPlugin, GoogleOAuthPlugin, } from "./src/plugin.js";
|
|
2
|
+
export { authorizeAntigravity, exchangeAntigravity, } from "./src/antigravity/oauth.js";
|
|
3
|
+
export type { AntigravityAuthorization, AntigravityTokenExchangeResult, } from "./src/antigravity/oauth.js";
|
|
4
|
+
/** One package entrypoint for OpenCode V2 and V1.18.29+ server plugins. */
|
|
5
|
+
declare const _default: {
|
|
6
|
+
server: ({ client, directory, runtimeVersion, fetch: sendFetch }: import("./src/plugin/types.ts").PluginContext) => Promise<import("./src/plugin/types.ts").PluginResult>;
|
|
7
|
+
id: string;
|
|
8
|
+
setup: (context: import("@opencode/plugin/promise/plugin").Context) => Promise<import("@opencode/plugin/promise/plugin").Cleanup | void> | import("@opencode/plugin/promise/plugin").Cleanup | void;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
4
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,2EAA2E;;;;;;AAC3E,wBAAgE"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { AntigravityV2Plugin } from "./src/v2.js";
|
|
2
|
+
import { AntigravityCLIOAuthPlugin as legacyServer } from "./src/plugin.js";
|
|
3
|
+
export { AntigravityCLIOAuthPlugin, GoogleOAuthPlugin, } from "./src/plugin.js";
|
|
4
|
+
export { authorizeAntigravity, exchangeAntigravity, } from "./src/antigravity/oauth.js";
|
|
5
|
+
/** One package entrypoint for OpenCode V2 and V1.18.29+ server plugins. */
|
|
6
|
+
export default { ...AntigravityV2Plugin, server: legacyServer };
|
|
3
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,yBAAyB,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAMjC,2EAA2E;AAC3E,eAAe,EAAE,GAAG,mBAAmB,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,8BAA8B,GACtC,+BAA+B,GAC/B,+BAA+B,CAAC;AAoCpC;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,SAAK,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAsB5F;AA2ED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,8BAA8B,CAAC,CAsEzC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { generatePKCE } from "@openauthjs/openauth/pkce";
|
|
2
|
-
import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES,
|
|
3
|
-
import { createLogger } from "../plugin/logger";
|
|
4
|
-
import { calculateTokenExpiry } from "../plugin/auth";
|
|
2
|
+
import { ANTIGRAVITY_CLIENT_ID, ANTIGRAVITY_CLIENT_SECRET, ANTIGRAVITY_REDIRECT_URI, ANTIGRAVITY_SCOPES, ANTIGRAVITY_ENDPOINT, getAntigravityUserAgent, GEMINI_CLI_HEADERS, } from "../constants.js";
|
|
3
|
+
import { createLogger } from "../plugin/logger.js";
|
|
4
|
+
import { calculateTokenExpiry } from "../plugin/auth.js";
|
|
5
5
|
const log = createLogger("oauth");
|
|
6
6
|
/**
|
|
7
7
|
* Encode an object into a URL-safe base64 string.
|
|
@@ -62,29 +62,25 @@ async function fetchProjectID(accessToken) {
|
|
|
62
62
|
const loadHeaders = {
|
|
63
63
|
Authorization: `Bearer ${accessToken}`,
|
|
64
64
|
"Content-Type": "application/json",
|
|
65
|
-
"User-Agent":
|
|
66
|
-
"Client-Metadata": getAntigravityHeaders()["Client-Metadata"],
|
|
65
|
+
"User-Agent": getAntigravityUserAgent(),
|
|
67
66
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
errors.push(`loadCodeAssist ${response.status} at ${baseEndpoint}${message ? `: ${message}` : ""}`);
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
67
|
+
try {
|
|
68
|
+
const url = `${ANTIGRAVITY_ENDPOINT}/v1internal:loadCodeAssist`;
|
|
69
|
+
const response = await fetchWithTimeout(url, {
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers: loadHeaders,
|
|
72
|
+
// The Antigravity Hub sends only ideType; MACOS/WINDOWS are not valid platform values.
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
metadata: {
|
|
75
|
+
ideType: "ANTIGRAVITY",
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
79
|
+
if (!response.ok) {
|
|
80
|
+
const message = await response.text().catch(() => "");
|
|
81
|
+
errors.push(`loadCodeAssist ${response.status} at ${ANTIGRAVITY_ENDPOINT}${message ? `: ${message}` : ""}`);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
88
84
|
const data = await response.json();
|
|
89
85
|
if (typeof data.cloudaicompanionProject === "string" && data.cloudaicompanionProject) {
|
|
90
86
|
return data.cloudaicompanionProject;
|
|
@@ -94,12 +90,12 @@ async function fetchProjectID(accessToken) {
|
|
|
94
90
|
data.cloudaicompanionProject.id) {
|
|
95
91
|
return data.cloudaicompanionProject.id;
|
|
96
92
|
}
|
|
97
|
-
errors.push(`loadCodeAssist missing project id at ${
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
errors.push(`loadCodeAssist error at ${baseEndpoint}: ${e instanceof Error ? e.message : String(e)}`);
|
|
93
|
+
errors.push(`loadCodeAssist missing project id at ${ANTIGRAVITY_ENDPOINT}`);
|
|
101
94
|
}
|
|
102
95
|
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
errors.push(`loadCodeAssist error at ${ANTIGRAVITY_ENDPOINT}: ${e instanceof Error ? e.message : String(e)}`);
|
|
98
|
+
}
|
|
103
99
|
if (errors.length) {
|
|
104
100
|
log.warn("Failed to resolve Antigravity project via loadCodeAssist", { errors: errors.join("; ") });
|
|
105
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/antigravity/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAiDlC;;GAEG;AACH,SAAS,WAAW,CAAC,OAA6B;IAChD,OAAO,MAAM,CAAC,IAAI,CAAC,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AY,CAAC,UAAU,CAAC;YACjE,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,SAAS,EAAE,kBAAkB,IAAI,EAAE;SACpC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -15,38 +15,52 @@ export declare const ANTIGRAVITY_SCOPES: readonly string[];
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Antigravity Cloud Code host. Consumer Antigravity Hub clients send generate,
|
|
19
|
+
* stream, loadCodeAssist, onboardUser, and fetchAvailableModels requests to the
|
|
20
|
+
* non-sandbox daily host only; mixing hosts can grant incompatible entitlements.
|
|
21
21
|
*/
|
|
22
|
-
export declare const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.
|
|
23
|
-
|
|
22
|
+
export declare const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.googleapis.com";
|
|
23
|
+
/** Production Cloud Code host, used by the Gemini CLI quota path. */
|
|
24
24
|
export declare const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Shared across request handling and project discovery to mirror CLIProxy behavior.
|
|
26
|
+
* Primary endpoint for Antigravity-style requests.
|
|
28
27
|
*/
|
|
29
|
-
export declare const
|
|
30
|
-
/**
|
|
31
|
-
* Preferred endpoint order for project discovery (prod first, then fallbacks).
|
|
32
|
-
* loadCodeAssist appears to be best supported on prod for managed project resolution.
|
|
33
|
-
*/
|
|
34
|
-
export declare const ANTIGRAVITY_LOAD_ENDPOINTS: readonly ["https://cloudcode-pa.googleapis.com", "https://daily-cloudcode-pa.sandbox.googleapis.com", "https://autopush-cloudcode-pa.sandbox.googleapis.com"];
|
|
35
|
-
/**
|
|
36
|
-
* Primary endpoint to use (daily sandbox - same as CLIProxy/Vibeproxy).
|
|
37
|
-
*/
|
|
38
|
-
export declare const ANTIGRAVITY_ENDPOINT = "https://daily-cloudcode-pa.sandbox.googleapis.com";
|
|
28
|
+
export declare const ANTIGRAVITY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
|
|
39
29
|
/**
|
|
40
30
|
* Gemini CLI endpoint (production).
|
|
41
31
|
* Used for models without :antigravity suffix.
|
|
42
32
|
* Same as opencode-gemini-auth's GEMINI_CODE_ASSIST_ENDPOINT.
|
|
43
33
|
*/
|
|
44
34
|
export declare const GEMINI_CLI_ENDPOINT = "https://cloudcode-pa.googleapis.com";
|
|
35
|
+
/**
|
|
36
|
+
* Endpoints to try, in order, for a header style. Antigravity never falls back
|
|
37
|
+
* across hosts; Gemini CLI stays on production.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getEndpointFallbacks(style: HeaderStyle): readonly string[];
|
|
45
40
|
/**
|
|
46
41
|
* Hardcoded project id used when Antigravity does not return one (e.g., business/workspace accounts).
|
|
47
42
|
*/
|
|
48
43
|
export declare const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
49
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Cloud Code only serves newer models to Antigravity Hub clients at or above this version.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ANTIGRAVITY_MINIMUM_VERSION = "2.23.0";
|
|
48
|
+
/**
|
|
49
|
+
* Hub release reported when the update manifest is unreachable. Keep it at or above
|
|
50
|
+
* ANTIGRAVITY_MINIMUM_VERSION and update it together with ANTIGRAVITY_HUB_CHANGELISTS.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ANTIGRAVITY_VERSION_FALLBACK = "2.24.0";
|
|
53
|
+
/**
|
|
54
|
+
* Build changelists of specific Hub releases. Releases without a known CL omit the
|
|
55
|
+
* cl= field instead of claiming another build's CL.
|
|
56
|
+
*/
|
|
57
|
+
export declare const ANTIGRAVITY_HUB_CHANGELISTS: Readonly<Record<string, string>>;
|
|
58
|
+
/** Platform of the arm64 macOS update manifest the runtime version is read from. */
|
|
59
|
+
export declare const ANTIGRAVITY_HUB_PLATFORM = "os_type=darwin; arch=arm64";
|
|
60
|
+
/** Suffix the Hub appends to its User-Agent on onboardUser control-plane calls. */
|
|
61
|
+
export declare const ANTIGRAVITY_NODE_API_CLIENT = "google-api-nodejs-client/10.3.0";
|
|
62
|
+
/** X-Goog-Api-Client the Hub sends on onboardUser control-plane calls. */
|
|
63
|
+
export declare const ANTIGRAVITY_GOOG_API_CLIENT = "gl-node/22.21.1";
|
|
50
64
|
export declare function getAntigravityVersion(): string;
|
|
51
65
|
/**
|
|
52
66
|
* Set the runtime Antigravity version. Can only be called once (at startup).
|
|
@@ -54,15 +68,25 @@ export declare function getAntigravityVersion(): string;
|
|
|
54
68
|
*/
|
|
55
69
|
export declare function setAntigravityVersion(version: string): void;
|
|
56
70
|
/** @deprecated Use getAntigravityVersion() for runtime access. */
|
|
57
|
-
export declare const ANTIGRAVITY_VERSION = "
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
export declare const ANTIGRAVITY_VERSION = "2.24.0";
|
|
72
|
+
/**
|
|
73
|
+
* Antigravity Hub User-Agent, e.g.
|
|
74
|
+
* `antigravity/hub/2.24.0 (aidev_client; os_type=darwin; arch=arm64; cl=1000335682)`.
|
|
75
|
+
* Resolved at call time so requests always carry the current runtime version.
|
|
76
|
+
*/
|
|
77
|
+
export declare function getAntigravityUserAgent(version?: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Long Hub User-Agent used by onboardUser control-plane requests.
|
|
80
|
+
*/
|
|
81
|
+
export declare function getAntigravityOnboardUserAgent(version?: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Headers for Antigravity content, project, and quota requests. The Hub sends only
|
|
84
|
+
* its User-Agent: no X-Goog-Api-Client and no Client-Metadata.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getAntigravityHeaders(): HeaderSet;
|
|
61
87
|
/** @deprecated Use getAntigravityHeaders() for runtime access. */
|
|
62
88
|
export declare const ANTIGRAVITY_HEADERS: {
|
|
63
|
-
readonly "User-Agent":
|
|
64
|
-
readonly "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1";
|
|
65
|
-
readonly "Client-Metadata": "{\"ideType\":\"ANTIGRAVITY\",\"platform\":\"WINDOWS\",\"pluginType\":\"GEMINI\"}" | "{\"ideType\":\"ANTIGRAVITY\",\"platform\":\"MACOS\",\"pluginType\":\"GEMINI\"}";
|
|
89
|
+
readonly "User-Agent": string;
|
|
66
90
|
};
|
|
67
91
|
export declare const GEMINI_CLI_HEADERS: {
|
|
68
92
|
readonly "User-Agent": "google-api-nodejs-client/9.15.1";
|
|
@@ -74,6 +98,10 @@ export type HeaderSet = {
|
|
|
74
98
|
"X-Goog-Api-Client"?: string;
|
|
75
99
|
"Client-Metadata"?: string;
|
|
76
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Header set for a request style. Antigravity no longer randomizes platform or
|
|
103
|
+
* API client values: the Hub User-Agent is tied to the manifest release and CL.
|
|
104
|
+
*/
|
|
77
105
|
export declare function getRandomizedHeaders(style: HeaderStyle, model?: string): HeaderSet;
|
|
78
106
|
export type HeaderStyle = "antigravity" | "gemini-cli";
|
|
79
107
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB,8EAA8E,CAAC;AAEjH;;GAEG;AACH,eAAO,MAAM,yBAAyB,wCAAwC,CAAC;AAE/E;;GAEG;AACH,eAA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MAAM,2BAA2B,OAAO,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,yBAAyB,qlBAYY,CAAC;AAEnD,eAAO,MAAM,8BAA8B,ifAM1C,CAAC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -21,33 +21,15 @@ export const ANTIGRAVITY_SCOPES = [
|
|
|
21
21
|
*/
|
|
22
22
|
export const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Antigravity Cloud Code host. Consumer Antigravity Hub clients send generate,
|
|
25
|
+
* stream, loadCodeAssist, onboardUser, and fetchAvailableModels requests to the
|
|
26
|
+
* non-sandbox daily host only; mixing hosts can grant incompatible entitlements.
|
|
27
27
|
*/
|
|
28
|
-
export const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.
|
|
29
|
-
|
|
28
|
+
export const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.googleapis.com";
|
|
29
|
+
/** Production Cloud Code host, used by the Gemini CLI quota path. */
|
|
30
30
|
export const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* Shared across request handling and project discovery to mirror CLIProxy behavior.
|
|
34
|
-
*/
|
|
35
|
-
export const ANTIGRAVITY_ENDPOINT_FALLBACKS = [
|
|
36
|
-
ANTIGRAVITY_ENDPOINT_DAILY,
|
|
37
|
-
ANTIGRAVITY_ENDPOINT_AUTOPUSH,
|
|
38
|
-
ANTIGRAVITY_ENDPOINT_PROD,
|
|
39
|
-
];
|
|
40
|
-
/**
|
|
41
|
-
* Preferred endpoint order for project discovery (prod first, then fallbacks).
|
|
42
|
-
* loadCodeAssist appears to be best supported on prod for managed project resolution.
|
|
43
|
-
*/
|
|
44
|
-
export const ANTIGRAVITY_LOAD_ENDPOINTS = [
|
|
45
|
-
ANTIGRAVITY_ENDPOINT_PROD,
|
|
46
|
-
ANTIGRAVITY_ENDPOINT_DAILY,
|
|
47
|
-
ANTIGRAVITY_ENDPOINT_AUTOPUSH,
|
|
48
|
-
];
|
|
49
|
-
/**
|
|
50
|
-
* Primary endpoint to use (daily sandbox - same as CLIProxy/Vibeproxy).
|
|
32
|
+
* Primary endpoint for Antigravity-style requests.
|
|
51
33
|
*/
|
|
52
34
|
export const ANTIGRAVITY_ENDPOINT = ANTIGRAVITY_ENDPOINT_DAILY;
|
|
53
35
|
/**
|
|
@@ -56,11 +38,43 @@ export const ANTIGRAVITY_ENDPOINT = ANTIGRAVITY_ENDPOINT_DAILY;
|
|
|
56
38
|
* Same as opencode-gemini-auth's GEMINI_CODE_ASSIST_ENDPOINT.
|
|
57
39
|
*/
|
|
58
40
|
export const GEMINI_CLI_ENDPOINT = ANTIGRAVITY_ENDPOINT_PROD;
|
|
41
|
+
const ANTIGRAVITY_REQUEST_ENDPOINTS = [ANTIGRAVITY_ENDPOINT];
|
|
42
|
+
const GEMINI_CLI_REQUEST_ENDPOINTS = [GEMINI_CLI_ENDPOINT];
|
|
43
|
+
/**
|
|
44
|
+
* Endpoints to try, in order, for a header style. Antigravity never falls back
|
|
45
|
+
* across hosts; Gemini CLI stays on production.
|
|
46
|
+
*/
|
|
47
|
+
export function getEndpointFallbacks(style) {
|
|
48
|
+
return style === "gemini-cli" ? GEMINI_CLI_REQUEST_ENDPOINTS : ANTIGRAVITY_REQUEST_ENDPOINTS;
|
|
49
|
+
}
|
|
59
50
|
/**
|
|
60
51
|
* Hardcoded project id used when Antigravity does not return one (e.g., business/workspace accounts).
|
|
61
52
|
*/
|
|
62
53
|
export const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
63
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Cloud Code only serves newer models to Antigravity Hub clients at or above this version.
|
|
56
|
+
*/
|
|
57
|
+
export const ANTIGRAVITY_MINIMUM_VERSION = "2.23.0";
|
|
58
|
+
/**
|
|
59
|
+
* Hub release reported when the update manifest is unreachable. Keep it at or above
|
|
60
|
+
* ANTIGRAVITY_MINIMUM_VERSION and update it together with ANTIGRAVITY_HUB_CHANGELISTS.
|
|
61
|
+
*/
|
|
62
|
+
export const ANTIGRAVITY_VERSION_FALLBACK = "2.24.0";
|
|
63
|
+
/**
|
|
64
|
+
* Build changelists of specific Hub releases. Releases without a known CL omit the
|
|
65
|
+
* cl= field instead of claiming another build's CL.
|
|
66
|
+
*/
|
|
67
|
+
export const ANTIGRAVITY_HUB_CHANGELISTS = {
|
|
68
|
+
"2.23.0": "998057262",
|
|
69
|
+
"2.23.1": "998881661",
|
|
70
|
+
"2.24.0": "1000335682",
|
|
71
|
+
};
|
|
72
|
+
/** Platform of the arm64 macOS update manifest the runtime version is read from. */
|
|
73
|
+
export const ANTIGRAVITY_HUB_PLATFORM = "os_type=darwin; arch=arm64";
|
|
74
|
+
/** Suffix the Hub appends to its User-Agent on onboardUser control-plane calls. */
|
|
75
|
+
export const ANTIGRAVITY_NODE_API_CLIENT = "google-api-nodejs-client/10.3.0";
|
|
76
|
+
/** X-Goog-Api-Client the Hub sends on onboardUser control-plane calls. */
|
|
77
|
+
export const ANTIGRAVITY_GOOG_API_CLIENT = "gl-node/22.21.1";
|
|
64
78
|
let antigravityVersion = ANTIGRAVITY_VERSION_FALLBACK;
|
|
65
79
|
let versionLocked = false;
|
|
66
80
|
export function getAntigravityVersion() { return antigravityVersion; }
|
|
@@ -76,33 +90,44 @@ export function setAntigravityVersion(version) {
|
|
|
76
90
|
}
|
|
77
91
|
/** @deprecated Use getAntigravityVersion() for runtime access. */
|
|
78
92
|
export const ANTIGRAVITY_VERSION = ANTIGRAVITY_VERSION_FALLBACK;
|
|
93
|
+
/**
|
|
94
|
+
* Antigravity Hub User-Agent, e.g.
|
|
95
|
+
* `antigravity/hub/2.24.0 (aidev_client; os_type=darwin; arch=arm64; cl=1000335682)`.
|
|
96
|
+
* Resolved at call time so requests always carry the current runtime version.
|
|
97
|
+
*/
|
|
98
|
+
export function getAntigravityUserAgent(version = getAntigravityVersion()) {
|
|
99
|
+
const changelist = ANTIGRAVITY_HUB_CHANGELISTS[version];
|
|
100
|
+
const clPart = changelist ? `; cl=${changelist}` : "";
|
|
101
|
+
return `antigravity/hub/${version} (aidev_client; ${ANTIGRAVITY_HUB_PLATFORM}${clPart})`;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Long Hub User-Agent used by onboardUser control-plane requests.
|
|
105
|
+
*/
|
|
106
|
+
export function getAntigravityOnboardUserAgent(version = getAntigravityVersion()) {
|
|
107
|
+
return `${getAntigravityUserAgent(version)} ${ANTIGRAVITY_NODE_API_CLIENT}`;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Headers for Antigravity content, project, and quota requests. The Hub sends only
|
|
111
|
+
* its User-Agent: no X-Goog-Api-Client and no Client-Metadata.
|
|
112
|
+
*/
|
|
79
113
|
export function getAntigravityHeaders() {
|
|
80
114
|
return {
|
|
81
|
-
"User-Agent":
|
|
82
|
-
"X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
|
|
83
|
-
"Client-Metadata": `{"ideType":"ANTIGRAVITY","platform":"${process.platform === "win32" ? "WINDOWS" : "MACOS"}","pluginType":"GEMINI"}`,
|
|
115
|
+
"User-Agent": getAntigravityUserAgent(),
|
|
84
116
|
};
|
|
85
117
|
}
|
|
86
118
|
/** @deprecated Use getAntigravityHeaders() for runtime access. */
|
|
87
119
|
export const ANTIGRAVITY_HEADERS = {
|
|
88
|
-
"User-Agent":
|
|
89
|
-
"X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
|
|
90
|
-
"Client-Metadata": `{"ideType":"ANTIGRAVITY","platform":"${process.platform === "win32" ? "WINDOWS" : "MACOS"}","pluginType":"GEMINI"}`,
|
|
120
|
+
"User-Agent": getAntigravityUserAgent(ANTIGRAVITY_VERSION_FALLBACK),
|
|
91
121
|
};
|
|
92
122
|
export const GEMINI_CLI_HEADERS = {
|
|
93
123
|
"User-Agent": "google-api-nodejs-client/9.15.1",
|
|
94
124
|
"X-Goog-Api-Client": "gl-node/22.17.0",
|
|
95
125
|
"Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI",
|
|
96
126
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"google-cloud-sdk vscode/1.95.0",
|
|
102
|
-
];
|
|
103
|
-
function randomFrom(arr) {
|
|
104
|
-
return arr[Math.floor(Math.random() * arr.length)];
|
|
105
|
-
}
|
|
127
|
+
/**
|
|
128
|
+
* Header set for a request style. Antigravity no longer randomizes platform or
|
|
129
|
+
* API client values: the Hub User-Agent is tied to the manifest release and CL.
|
|
130
|
+
*/
|
|
106
131
|
export function getRandomizedHeaders(style, model) {
|
|
107
132
|
if (style === "gemini-cli") {
|
|
108
133
|
return {
|
|
@@ -111,13 +136,7 @@ export function getRandomizedHeaders(style, model) {
|
|
|
111
136
|
"Client-Metadata": GEMINI_CLI_HEADERS["Client-Metadata"],
|
|
112
137
|
};
|
|
113
138
|
}
|
|
114
|
-
|
|
115
|
-
const metadataPlatform = platform.startsWith("windows") ? "WINDOWS" : "MACOS";
|
|
116
|
-
return {
|
|
117
|
-
"User-Agent": `antigravity/${getAntigravityVersion()} ${platform}`,
|
|
118
|
-
"X-Goog-Api-Client": randomFrom(ANTIGRAVITY_API_CLIENTS),
|
|
119
|
-
"Client-Metadata": `{"ideType":"ANTIGRAVITY","platform":"${metadataPlatform}","pluginType":"GEMINI"}`,
|
|
120
|
-
};
|
|
139
|
+
return getAntigravityHeaders();
|
|
121
140
|
}
|
|
122
141
|
/**
|
|
123
142
|
* Provider identifier shared between the plugin loader and credential store.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2EAA2E,CAAC;AAEjH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,uCAAuC;IACvC,uDAAuD;CACxD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uCAAuC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2EAA2E,CAAC;AAEjH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,uCAAuC;IACvC,uDAAuD;CACxD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uCAAuC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,2CAA2C,CAAC;AACtF,qEAAqE;AACrE,MAAM,CAAC,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D,MAAM,6BAA6B,GAAG,CAAC,oBAAoB,CAAU,CAAC;AACtE,MAAM,4BAA4B,GAAG,CAAC,mBAAmB,CAAU,CAAC;AAEpE;;;GAGG;A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AAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAC5D,MAAM,CAAC,MAAM,oCAAoC,GAAG,gCAAgC,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kCAAkC,CAAC;AAEzE,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAE/E;;;;GAIG;AACH,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;kDAYS,CAAC;AAEnD,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;CAM7C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
import { CACHE_DIR, PACKAGE_NAME } from "./constants";
|
|
3
|
+
import { CACHE_DIR, PACKAGE_NAME } from "./constants.js";
|
|
4
4
|
function stripTrailingCommas(json) {
|
|
5
5
|
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UpdateCheckResult } from "./types";
|
|
1
|
+
import type { UpdateCheckResult } from "./types.js";
|
|
2
2
|
export declare function isLocalDevMode(directory: string): boolean;
|
|
3
3
|
export declare function getLocalDevPath(directory: string): string | null;
|
|
4
4
|
export declare function getLocalDevVersion(directory: string): string | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { PACKAGE_NAME, NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT, INSTALLED_PACKAGE_JSON, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC, } from "./constants";
|
|
5
|
-
import { logAutoUpdate } from "./logging";
|
|
4
|
+
import { PACKAGE_NAME, NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT, INSTALLED_PACKAGE_JSON, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC, } from "./constants.js";
|
|
5
|
+
import { logAutoUpdate } from "./logging.js";
|
|
6
6
|
export function isLocalDevMode(directory) {
|
|
7
7
|
return getLocalDevPath(directory) !== null;
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AutoUpdateCheckerOptions } from "./types";
|
|
1
|
+
import type { AutoUpdateCheckerOptions } from "./types.js";
|
|
2
2
|
interface PluginClient {
|
|
3
3
|
tui: {
|
|
4
4
|
showToast(options: {
|
|
@@ -28,7 +28,7 @@ export declare function createAutoUpdateCheckerHook(client: PluginClient, direct
|
|
|
28
28
|
event: PluginEvent;
|
|
29
29
|
}) => void;
|
|
30
30
|
};
|
|
31
|
-
export type { UpdateCheckResult, AutoUpdateCheckerOptions } from "./types";
|
|
32
|
-
export { checkForUpdate, getCachedVersion, getLatestVersion } from "./checker";
|
|
33
|
-
export { invalidatePackage, invalidateCache } from "./cache";
|
|
31
|
+
export type { UpdateCheckResult, AutoUpdateCheckerOptions } from "./types.js";
|
|
32
|
+
export { checkForUpdate, getCachedVersion, getLatestVersion } from "./checker.js";
|
|
33
|
+
export { invalidatePackage, invalidateCache } from "./cache.js";
|
|
34
34
|
//# sourceMappingURL=index.d.ts.map
|