@anthonyhaussman/opencode-agy-auth 1.5.8-alpha.0 → 1.5.9-alpha.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 CHANGED
@@ -6,6 +6,22 @@
6
6
  [![License](https://img.shields.io/github/license/anthonyhaussman/opencode-agy-auth)](https://github.com/anthonyhaussman/opencode-agy-auth/blob/main/LICENSE)
7
7
  [![GitHub stars](https://img.shields.io/github/stars/anthonyhaussman/opencode-agy-auth?style=social)](https://github.com/anthonyhaussman/opencode-agy-auth)
8
8
 
9
+ > [!WARNING]
10
+ > **Using this plugin can get your Google account disabled.**
11
+ >
12
+ > Google's current Antigravity terms prohibit using third-party software, tools, or services (explicitly including OpenCode) to access an Antigravity/Gemini CLI login. Accounts detected doing so are blocked with:
13
+ >
14
+ > `This service has been disabled in this account for violation of Terms of Service. Please submit an appeal to continue using this product.`
15
+ >
16
+ > A disabled account can only be restored through [Google's appeal form](https://docs.google.com/forms/d/e/1FAIpQLScOJWibQ_-hYuVv63kJTgEqlgAaOwRLGFTbXm-QY1gz8U0CGA/viewform). The plugin prints this warning on every startup.
17
+ >
18
+ > Supported alternatives that do not rely on an Antigravity login:
19
+ >
20
+ > - OpenCode's native `google` provider with a Gemini API key (`GOOGLE_GENERATIVE_AI_API_KEY`, from Google AI Studio).
21
+ > - OpenCode's native `google-vertex` provider with your own Google Cloud project.
22
+ >
23
+ > Use this plugin at your own risk. The maintainer takes no responsibility for any action Google takes against your account.
24
+
9
25
  An [OpenCode](https://opencode.ai/) authentication plugin that enables seamless interaction with the Antigravity CLI (`agy`) by hooking into its authentication, quota retrieval, and dynamic model fetching layers.
10
26
 
11
27
  ## Features
@@ -13,7 +29,7 @@ An [OpenCode](https://opencode.ai/) authentication plugin that enables seamless
13
29
  - **OAuth 2.0 Integration**: Uses Antigravity's OAuth flows for authentication.
14
30
  - **Dynamic Model Retrieval**: Fetches available models based on user tier and current allocations.
15
31
  - **Quota Tracking**: Injects the `agy_quota` tool into OpenCode to check usage limits directly.
16
- - **Traffic Simulation**: Maintains background heartbeat with `agy` servers.
32
+ - **Background Session Requests**: Sends the session-level requests the Antigravity backend expects alongside model calls.
17
33
  - **Dual OpenCode Compatibility**: Natively supports both OpenCode v1 (>= 1.18.29) and OpenCode v2 out of the box without breaking changes.
18
34
 
19
35
  ## Installation
package/dist/index.js CHANGED
@@ -268,7 +268,7 @@ function createAgyActivityRequestId() {
268
268
  import os from "os";
269
269
 
270
270
  // src/sdk/agy-cli-version.ts
271
- var AGY_CLI_VERSION = "1.5.8";
271
+ var AGY_CLI_VERSION = "1.5.9";
272
272
 
273
273
  // src/sdk/user-agent.ts
274
274
  var cachedUserAgent = null;
@@ -21089,6 +21089,36 @@ function resolveModelTier(baseModelId, headersOrInit) {
21089
21089
  return mapping["medium"] ?? mapping["high"] ?? baseModelId;
21090
21090
  }
21091
21091
 
21092
+ // src/plugin/tos-warning.ts
21093
+ var AGY_TOS_APPEAL_URL = "https://docs.google.com/forms/d/e/1FAIpQLScOJWibQ_-hYuVv63kJTgEqlgAaOwRLGFTbXm-QY1gz8U0CGA/viewform";
21094
+ var AGY_TOS_WARNING_TITLE = "Antigravity Terms of Service Risk";
21095
+ var AGY_TOS_WARNING = 'Google\'s current Antigravity terms prohibit using third-party tools (including OpenCode) to access an Antigravity/Gemini CLI login. Using this plugin can get your Google account disabled ("This service has been disabled in this account for violation of Terms of Service"). Use at your own risk. Supported alternatives: the native `google` provider with GOOGLE_GENERATIVE_AI_API_KEY, or `google-vertex`.';
21096
+ var tosWarningEmitted = false;
21097
+ function emitAgyTosWarning(client) {
21098
+ if (tosWarningEmitted) {
21099
+ return;
21100
+ }
21101
+ tosWarningEmitted = true;
21102
+ console.warn(`[Agy Auth] WARNING: ${AGY_TOS_WARNING} Appeal form: ${AGY_TOS_APPEAL_URL}`);
21103
+ const showToast = client?.tui?.showToast;
21104
+ if (!showToast) {
21105
+ return;
21106
+ }
21107
+ try {
21108
+ void Promise.resolve(
21109
+ showToast.call(client.tui, {
21110
+ body: {
21111
+ title: AGY_TOS_WARNING_TITLE,
21112
+ message: AGY_TOS_WARNING,
21113
+ variant: "error",
21114
+ duration: 15e3
21115
+ }
21116
+ })
21117
+ ).catch(() => void 0);
21118
+ } catch {
21119
+ }
21120
+ }
21121
+
21092
21122
  // src/plugin.ts
21093
21123
  var AGY_QUOTA_COMMAND = "agyquota";
21094
21124
  var AGY_QUOTA_COMMAND_TEMPLATE = `Retrieve Agy Code Assist quota usage for the current authenticated account.
@@ -21201,6 +21231,7 @@ for (const [modelId, simple] of Object.entries(STATIC_MODELS_SIMPLE)) {
21201
21231
  }
21202
21232
  var AgyCLIOAuthPlugin = async ({ client }) => {
21203
21233
  let latestConfig;
21234
+ emitAgyTosWarning(client);
21204
21235
  updateStaticModelsWithPricing(STATIC_MODELS);
21205
21236
  const getModelsList = (provider) => {
21206
21237
  const userModels = provider.models || {};
@@ -22010,6 +22041,7 @@ function registerV2SessionHooks(ctx) {
22010
22041
 
22011
22042
  // src/plugin/v2.ts
22012
22043
  async function setupOpenCodeV2(ctx) {
22044
+ emitAgyTosWarning();
22013
22045
  try {
22014
22046
  initDiskSignatureCache({
22015
22047
  enabled: true,