@percygfx/opencode-antigravity-auth 0.0.0-stage → 2.0.1
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/LICENSE +21 -0
- package/README.md +896 -3
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/rpc.d.ts +176 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +91 -0
- package/dist/rpc.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +5 -0
- package/dist/server.js.map +1 -0
- package/dist/src/antigravity/oauth.d.ts +31 -0
- package/dist/src/antigravity/oauth.d.ts.map +1 -0
- package/dist/src/antigravity/oauth.js +171 -0
- package/dist/src/antigravity/oauth.js.map +1 -0
- package/dist/src/constants.d.ts +153 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +238 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/core/gateway.d.ts +43 -0
- package/dist/src/core/gateway.d.ts.map +1 -0
- package/dist/src/core/gateway.js +241 -0
- package/dist/src/core/gateway.js.map +1 -0
- package/dist/src/core/index.d.ts +8 -0
- package/dist/src/core/index.d.ts.map +1 -0
- package/dist/src/core/index.js +8 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/types.d.ts +60 -0
- package/dist/src/core/types.d.ts.map +1 -0
- package/dist/src/core/types.js +5 -0
- package/dist/src/core/types.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/cache.d.ts +3 -0
- package/dist/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/cache.js +71 -0
- package/dist/src/hooks/auto-update-checker/cache.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/checker.d.ts +16 -0
- package/dist/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/checker.js +234 -0
- package/dist/src/hooks/auto-update-checker/checker.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/constants.js +26 -0
- package/dist/src/hooks/auto-update-checker/constants.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/index.d.ts +34 -0
- package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/index.js +122 -0
- package/dist/src/hooks/auto-update-checker/index.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/logging.d.ts +3 -0
- package/dist/src/hooks/auto-update-checker/logging.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/logging.js +9 -0
- package/dist/src/hooks/auto-update-checker/logging.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/types.d.ts +25 -0
- package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/types.js +1 -0
- package/dist/src/hooks/auto-update-checker/types.js.map +1 -0
- package/dist/src/opencode-v2/accounts.d.ts +24 -0
- package/dist/src/opencode-v2/accounts.d.ts.map +1 -0
- package/dist/src/opencode-v2/accounts.js +109 -0
- package/dist/src/opencode-v2/accounts.js.map +1 -0
- package/dist/src/opencode-v2/catalog.d.ts +31 -0
- package/dist/src/opencode-v2/catalog.d.ts.map +1 -0
- package/dist/src/opencode-v2/catalog.js +68 -0
- package/dist/src/opencode-v2/catalog.js.map +1 -0
- package/dist/src/opencode-v2/client-shim.d.ts +9 -0
- package/dist/src/opencode-v2/client-shim.d.ts.map +1 -0
- package/dist/src/opencode-v2/client-shim.js +42 -0
- package/dist/src/opencode-v2/client-shim.js.map +1 -0
- package/dist/src/opencode-v2/clipboard.d.ts +7 -0
- package/dist/src/opencode-v2/clipboard.d.ts.map +1 -0
- package/dist/src/opencode-v2/clipboard.js +54 -0
- package/dist/src/opencode-v2/clipboard.js.map +1 -0
- package/dist/src/opencode-v2/index.d.ts +5 -0
- package/dist/src/opencode-v2/index.d.ts.map +1 -0
- package/dist/src/opencode-v2/index.js +4 -0
- package/dist/src/opencode-v2/index.js.map +1 -0
- package/dist/src/opencode-v2/plugin.d.ts +23 -0
- package/dist/src/opencode-v2/plugin.d.ts.map +1 -0
- package/dist/src/opencode-v2/plugin.js +466 -0
- package/dist/src/opencode-v2/plugin.js.map +1 -0
- package/dist/src/opencode-v2/proxy.d.ts +23 -0
- package/dist/src/opencode-v2/proxy.d.ts.map +1 -0
- package/dist/src/opencode-v2/proxy.js +148 -0
- package/dist/src/opencode-v2/proxy.js.map +1 -0
- package/dist/src/opencode-v2/quota-format.d.ts +19 -0
- package/dist/src/opencode-v2/quota-format.d.ts.map +1 -0
- package/dist/src/opencode-v2/quota-format.js +71 -0
- package/dist/src/opencode-v2/quota-format.js.map +1 -0
- package/dist/src/opencode-v2/quota.d.ts +18 -0
- package/dist/src/opencode-v2/quota.d.ts.map +1 -0
- package/dist/src/opencode-v2/quota.js +118 -0
- package/dist/src/opencode-v2/quota.js.map +1 -0
- package/dist/src/opencode-v2/sign-in-attempts.d.ts +52 -0
- package/dist/src/opencode-v2/sign-in-attempts.d.ts.map +1 -0
- package/dist/src/opencode-v2/sign-in-attempts.js +81 -0
- package/dist/src/opencode-v2/sign-in-attempts.js.map +1 -0
- package/dist/src/plugin/account-models.d.ts +38 -0
- package/dist/src/plugin/account-models.d.ts.map +1 -0
- package/dist/src/plugin/account-models.js +78 -0
- package/dist/src/plugin/account-models.js.map +1 -0
- package/dist/src/plugin/accounts.d.ts +186 -0
- package/dist/src/plugin/accounts.d.ts.map +1 -0
- package/dist/src/plugin/accounts.js +1045 -0
- package/dist/src/plugin/accounts.js.map +1 -0
- package/dist/src/plugin/auth.d.ts +21 -0
- package/dist/src/plugin/auth.d.ts.map +1 -0
- package/dist/src/plugin/auth.js +46 -0
- package/dist/src/plugin/auth.js.map +1 -0
- package/dist/src/plugin/cache/index.d.ts +5 -0
- package/dist/src/plugin/cache/index.d.ts.map +1 -0
- package/dist/src/plugin/cache/index.js +5 -0
- package/dist/src/plugin/cache/index.js.map +1 -0
- package/dist/src/plugin/cache/signature-cache.d.ts +111 -0
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -0
- package/dist/src/plugin/cache/signature-cache.js +375 -0
- package/dist/src/plugin/cache/signature-cache.js.map +1 -0
- package/dist/src/plugin/cache.d.ts +44 -0
- package/dist/src/plugin/cache.d.ts.map +1 -0
- package/dist/src/plugin/cache.js +200 -0
- package/dist/src/plugin/cache.js.map +1 -0
- package/dist/src/plugin/cli.d.ts +26 -0
- package/dist/src/plugin/cli.d.ts.map +1 -0
- package/dist/src/plugin/cli.js +119 -0
- package/dist/src/plugin/cli.js.map +1 -0
- package/dist/src/plugin/config/index.d.ts +16 -0
- package/dist/src/plugin/config/index.d.ts.map +1 -0
- package/dist/src/plugin/config/index.js +16 -0
- package/dist/src/plugin/config/index.js.map +1 -0
- package/dist/src/plugin/config/loader.d.ts +36 -0
- package/dist/src/plugin/config/loader.d.ts.map +1 -0
- package/dist/src/plugin/config/loader.js +140 -0
- package/dist/src/plugin/config/loader.js.map +1 -0
- package/dist/src/plugin/config/models.d.ts +41 -0
- package/dist/src/plugin/config/models.d.ts.map +1 -0
- package/dist/src/plugin/config/models.js +46 -0
- package/dist/src/plugin/config/models.js.map +1 -0
- package/dist/src/plugin/config/schema.d.ts +135 -0
- package/dist/src/plugin/config/schema.d.ts.map +1 -0
- package/dist/src/plugin/config/schema.js +438 -0
- package/dist/src/plugin/config/schema.js.map +1 -0
- package/dist/src/plugin/config/updater.d.ts +55 -0
- package/dist/src/plugin/config/updater.d.ts.map +1 -0
- package/dist/src/plugin/config/updater.js +125 -0
- package/dist/src/plugin/config/updater.js.map +1 -0
- package/dist/src/plugin/core/streaming/index.d.ts +3 -0
- package/dist/src/plugin/core/streaming/index.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/index.js +3 -0
- package/dist/src/plugin/core/streaming/index.js.map +1 -0
- package/dist/src/plugin/core/streaming/transformer.d.ts +10 -0
- package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/transformer.js +271 -0
- package/dist/src/plugin/core/streaming/transformer.js.map +1 -0
- package/dist/src/plugin/core/streaming/types.d.ts +27 -0
- package/dist/src/plugin/core/streaming/types.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/types.js +1 -0
- package/dist/src/plugin/core/streaming/types.js.map +1 -0
- package/dist/src/plugin/debug.d.ts +94 -0
- package/dist/src/plugin/debug.d.ts.map +1 -0
- package/dist/src/plugin/debug.js +382 -0
- package/dist/src/plugin/debug.js.map +1 -0
- package/dist/src/plugin/errors.d.ts +28 -0
- package/dist/src/plugin/errors.d.ts.map +1 -0
- package/dist/src/plugin/errors.js +42 -0
- package/dist/src/plugin/errors.js.map +1 -0
- package/dist/src/plugin/fingerprint.d.ts +70 -0
- package/dist/src/plugin/fingerprint.d.ts.map +1 -0
- package/dist/src/plugin/fingerprint.js +138 -0
- package/dist/src/plugin/fingerprint.js.map +1 -0
- package/dist/src/plugin/image-saver.d.ts +25 -0
- package/dist/src/plugin/image-saver.d.ts.map +1 -0
- package/dist/src/plugin/image-saver.js +86 -0
- package/dist/src/plugin/image-saver.js.map +1 -0
- package/dist/src/plugin/logger.d.ts +36 -0
- package/dist/src/plugin/logger.d.ts.map +1 -0
- package/dist/src/plugin/logger.js +71 -0
- package/dist/src/plugin/logger.js.map +1 -0
- package/dist/src/plugin/logging-utils.d.ts +23 -0
- package/dist/src/plugin/logging-utils.d.ts.map +1 -0
- package/dist/src/plugin/logging-utils.js +92 -0
- package/dist/src/plugin/logging-utils.js.map +1 -0
- package/dist/src/plugin/model-discovery.d.ts +28 -0
- package/dist/src/plugin/model-discovery.d.ts.map +1 -0
- package/dist/src/plugin/model-discovery.js +59 -0
- package/dist/src/plugin/model-discovery.js.map +1 -0
- package/dist/src/plugin/model-registry.d.ts +108 -0
- package/dist/src/plugin/model-registry.d.ts.map +1 -0
- package/dist/src/plugin/model-registry.js +304 -0
- package/dist/src/plugin/model-registry.js.map +1 -0
- package/dist/src/plugin/project.d.ts +33 -0
- package/dist/src/plugin/project.d.ts.map +1 -0
- package/dist/src/plugin/project.js +235 -0
- package/dist/src/plugin/project.js.map +1 -0
- package/dist/src/plugin/quota.d.ts +58 -0
- package/dist/src/plugin/quota.d.ts.map +1 -0
- package/dist/src/plugin/quota.js +296 -0
- package/dist/src/plugin/quota.js.map +1 -0
- package/dist/src/plugin/recovery/constants.d.ts +22 -0
- package/dist/src/plugin/recovery/constants.d.ts.map +1 -0
- package/dist/src/plugin/recovery/constants.js +43 -0
- package/dist/src/plugin/recovery/constants.js.map +1 -0
- package/dist/src/plugin/recovery/index.d.ts +12 -0
- package/dist/src/plugin/recovery/index.d.ts.map +1 -0
- package/dist/src/plugin/recovery/index.js +12 -0
- package/dist/src/plugin/recovery/index.js.map +1 -0
- package/dist/src/plugin/recovery/storage.d.ts +24 -0
- package/dist/src/plugin/recovery/storage.d.ts.map +1 -0
- package/dist/src/plugin/recovery/storage.js +354 -0
- package/dist/src/plugin/recovery/storage.js.map +1 -0
- package/dist/src/plugin/recovery/types.d.ts +116 -0
- package/dist/src/plugin/recovery/types.d.ts.map +1 -0
- package/dist/src/plugin/recovery/types.js +6 -0
- package/dist/src/plugin/recovery/types.js.map +1 -0
- package/dist/src/plugin/recovery.d.ts +61 -0
- package/dist/src/plugin/recovery.d.ts.map +1 -0
- package/dist/src/plugin/recovery.js +381 -0
- package/dist/src/plugin/recovery.js.map +1 -0
- package/dist/src/plugin/refresh-queue.d.ts +100 -0
- package/dist/src/plugin/refresh-queue.d.ts.map +1 -0
- package/dist/src/plugin/refresh-queue.js +247 -0
- package/dist/src/plugin/refresh-queue.js.map +1 -0
- package/dist/src/plugin/request-helpers.d.ts +282 -0
- package/dist/src/plugin/request-helpers.d.ts.map +1 -0
- package/dist/src/plugin/request-helpers.js +2343 -0
- package/dist/src/plugin/request-helpers.js.map +1 -0
- package/dist/src/plugin/request.d.ts +95 -0
- package/dist/src/plugin/request.d.ts.map +1 -0
- package/dist/src/plugin/request.js +1491 -0
- package/dist/src/plugin/request.js.map +1 -0
- package/dist/src/plugin/rotation.d.ts +169 -0
- package/dist/src/plugin/rotation.d.ts.map +1 -0
- package/dist/src/plugin/rotation.js +328 -0
- package/dist/src/plugin/rotation.js.map +1 -0
- package/dist/src/plugin/search.d.ts +32 -0
- package/dist/src/plugin/search.d.ts.map +1 -0
- package/dist/src/plugin/search.js +195 -0
- package/dist/src/plugin/search.js.map +1 -0
- package/dist/src/plugin/server.d.ts +23 -0
- package/dist/src/plugin/server.d.ts.map +1 -0
- package/dist/src/plugin/server.js +324 -0
- package/dist/src/plugin/server.js.map +1 -0
- package/dist/src/plugin/storage.d.ts +173 -0
- package/dist/src/plugin/storage.d.ts.map +1 -0
- package/dist/src/plugin/storage.js +674 -0
- package/dist/src/plugin/storage.js.map +1 -0
- package/dist/src/plugin/stores/signature-store.d.ts +5 -0
- package/dist/src/plugin/stores/signature-store.d.ts.map +1 -0
- package/dist/src/plugin/stores/signature-store.js +25 -0
- package/dist/src/plugin/stores/signature-store.js.map +1 -0
- package/dist/src/plugin/thinking-recovery.d.ts +90 -0
- package/dist/src/plugin/thinking-recovery.d.ts.map +1 -0
- package/dist/src/plugin/thinking-recovery.js +316 -0
- package/dist/src/plugin/thinking-recovery.js.map +1 -0
- package/dist/src/plugin/token.d.ts +19 -0
- package/dist/src/plugin/token.d.ts.map +1 -0
- package/dist/src/plugin/token.js +128 -0
- package/dist/src/plugin/token.js.map +1 -0
- package/dist/src/plugin/transform/claude.d.ts +80 -0
- package/dist/src/plugin/transform/claude.d.ts.map +1 -0
- package/dist/src/plugin/transform/claude.js +265 -0
- package/dist/src/plugin/transform/claude.js.map +1 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +35 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.js +225 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.js.map +1 -0
- package/dist/src/plugin/transform/gemini.d.ts +100 -0
- package/dist/src/plugin/transform/gemini.d.ts.map +1 -0
- package/dist/src/plugin/transform/gemini.js +446 -0
- package/dist/src/plugin/transform/gemini.js.map +1 -0
- package/dist/src/plugin/transform/index.d.ts +15 -0
- package/dist/src/plugin/transform/index.d.ts.map +1 -0
- package/dist/src/plugin/transform/index.js +14 -0
- package/dist/src/plugin/transform/index.js.map +1 -0
- package/dist/src/plugin/transform/model-resolver.d.ts +99 -0
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -0
- package/dist/src/plugin/transform/model-resolver.js +340 -0
- package/dist/src/plugin/transform/model-resolver.js.map +1 -0
- package/dist/src/plugin/transform/types.d.ts +111 -0
- package/dist/src/plugin/transform/types.d.ts.map +1 -0
- package/dist/src/plugin/transform/types.js +1 -0
- package/dist/src/plugin/transform/types.js.map +1 -0
- package/dist/src/plugin/types.d.ts +97 -0
- package/dist/src/plugin/types.d.ts.map +1 -0
- package/dist/src/plugin/types.js +1 -0
- package/dist/src/plugin/types.js.map +1 -0
- package/dist/src/plugin/ui/ansi.d.ts +32 -0
- package/dist/src/plugin/ui/ansi.d.ts.map +1 -0
- package/dist/src/plugin/ui/ansi.js +52 -0
- package/dist/src/plugin/ui/ansi.js.map +1 -0
- package/dist/src/plugin/ui/auth-menu.d.ts +33 -0
- package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -0
- package/dist/src/plugin/ui/auth-menu.js +110 -0
- package/dist/src/plugin/ui/auth-menu.js.map +1 -0
- package/dist/src/plugin/ui/confirm.d.ts +2 -0
- package/dist/src/plugin/ui/confirm.d.ts.map +1 -0
- package/dist/src/plugin/ui/confirm.js +15 -0
- package/dist/src/plugin/ui/confirm.js.map +1 -0
- package/dist/src/plugin/ui/select.d.ts +23 -0
- package/dist/src/plugin/ui/select.d.ts.map +1 -0
- package/dist/src/plugin/ui/select.js +254 -0
- package/dist/src/plugin/ui/select.js.map +1 -0
- package/dist/src/plugin/version.d.ts +19 -0
- package/dist/src/plugin/version.d.ts.map +1 -0
- package/dist/src/plugin/version.js +80 -0
- package/dist/src/plugin/version.js.map +1 -0
- package/dist/src/plugin.d.ts +51 -0
- package/dist/src/plugin.d.ts.map +1 -0
- package/dist/src/plugin.js +2852 -0
- package/dist/src/plugin.js.map +1 -0
- package/dist/tui.js +420 -0
- package/package.json +99 -6
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants used for Antigravity OAuth flows and Cloud Code Assist API integration.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
|
|
5
|
+
/**
|
|
6
|
+
* Client secret issued for the Antigravity OAuth application.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ANTIGRAVITY_CLIENT_SECRET = "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";
|
|
9
|
+
/**
|
|
10
|
+
* Scopes required for Antigravity integrations.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ANTIGRAVITY_SCOPES: readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* OAuth redirect URI used by the local CLI callback server.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
|
|
17
|
+
/**
|
|
18
|
+
* Root endpoints for the Antigravity API (in fallback order).
|
|
19
|
+
* CLIProxy and Vibeproxy use the daily sandbox endpoint first,
|
|
20
|
+
* then fallback to autopush and prod if needed.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.sandbox.googleapis.com";
|
|
23
|
+
export declare const ANTIGRAVITY_ENDPOINT_AUTOPUSH = "https://autopush-cloudcode-pa.sandbox.googleapis.com";
|
|
24
|
+
export declare const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
|
|
25
|
+
/**
|
|
26
|
+
* Endpoint fallback order (daily → autopush → prod).
|
|
27
|
+
* Shared across request handling and project discovery to mirror CLIProxy behavior.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ANTIGRAVITY_ENDPOINT_FALLBACKS: readonly ["https://daily-cloudcode-pa.sandbox.googleapis.com", "https://autopush-cloudcode-pa.sandbox.googleapis.com", "https://cloudcode-pa.googleapis.com"];
|
|
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";
|
|
39
|
+
/**
|
|
40
|
+
* Gemini CLI endpoint (production).
|
|
41
|
+
* Used for models without :antigravity suffix.
|
|
42
|
+
* Same as opencode-gemini-auth's GEMINI_CODE_ASSIST_ENDPOINT.
|
|
43
|
+
*/
|
|
44
|
+
export declare const GEMINI_CLI_ENDPOINT = "https://cloudcode-pa.googleapis.com";
|
|
45
|
+
/**
|
|
46
|
+
* Hardcoded project id used when Antigravity does not return one (e.g., business/workspace accounts).
|
|
47
|
+
*/
|
|
48
|
+
export declare const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
49
|
+
export declare const ANTIGRAVITY_VERSION_FALLBACK = "1.18.3";
|
|
50
|
+
export declare function getAntigravityVersion(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Set the runtime Antigravity version. Can only be called once (at startup).
|
|
53
|
+
* Subsequent calls are silently ignored to prevent accidental mutation.
|
|
54
|
+
*/
|
|
55
|
+
export declare function setAntigravityVersion(version: string): void;
|
|
56
|
+
/** @deprecated Use getAntigravityVersion() for runtime access. */
|
|
57
|
+
export declare const ANTIGRAVITY_VERSION = "1.18.3";
|
|
58
|
+
export declare function getAntigravityHeaders(): HeaderSet & {
|
|
59
|
+
"Client-Metadata": string;
|
|
60
|
+
};
|
|
61
|
+
/** @deprecated Use getAntigravityHeaders() for runtime access. */
|
|
62
|
+
export declare const ANTIGRAVITY_HEADERS: {
|
|
63
|
+
readonly "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/1.18.3 Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36";
|
|
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\"}";
|
|
66
|
+
};
|
|
67
|
+
export declare const GEMINI_CLI_HEADERS: {
|
|
68
|
+
readonly "User-Agent": "google-api-nodejs-client/9.15.1";
|
|
69
|
+
readonly "X-Goog-Api-Client": "gl-node/22.17.0";
|
|
70
|
+
readonly "Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI";
|
|
71
|
+
};
|
|
72
|
+
export type HeaderSet = {
|
|
73
|
+
"User-Agent": string;
|
|
74
|
+
"X-Goog-Api-Client"?: string;
|
|
75
|
+
"Client-Metadata"?: string;
|
|
76
|
+
};
|
|
77
|
+
export declare function getRandomizedHeaders(style: HeaderStyle, model?: string): HeaderSet;
|
|
78
|
+
/**
|
|
79
|
+
* User-Agent of the current Antigravity client ("hub"). Antigravity only serves some newer
|
|
80
|
+
* models (e.g. Gemini 3.7/3.8 Flash tiers) to this client: their IDs are missing from
|
|
81
|
+
* `fetchAvailableModels` and return 404 under the legacy `antigravity/<ver> <os>/<arch>` UA.
|
|
82
|
+
* Model discovery records which IDs need it (see `src/plugin/model-registry.ts`).
|
|
83
|
+
*
|
|
84
|
+
* Keep these current: Antigravity hides newer models (e.g. Gemini 4 Argon) from older clients
|
|
85
|
+
* and answers them with "This version of Antigravity is no longer supported". The version is
|
|
86
|
+
* the latest Antigravity release; the CL is `languageServerCL` from an installed Antigravity's
|
|
87
|
+
* `resources/app/product.json`. Last updated 2026-11-09.
|
|
88
|
+
*/
|
|
89
|
+
export declare const ANTIGRAVITY_HUB_VERSION = "2.23.0";
|
|
90
|
+
export declare const ANTIGRAVITY_HUB_CL = "1007378935";
|
|
91
|
+
export declare function getHubUserAgent(): string;
|
|
92
|
+
export type HeaderStyle = "antigravity" | "gemini-cli";
|
|
93
|
+
/**
|
|
94
|
+
* Provider identifier shared between the plugin loader and credential store.
|
|
95
|
+
*/
|
|
96
|
+
export declare const ANTIGRAVITY_PROVIDER_ID = "google";
|
|
97
|
+
/**
|
|
98
|
+
* System instruction for Claude tool usage hardening.
|
|
99
|
+
* Prevents hallucinated parameters by explicitly stating the rules.
|
|
100
|
+
*
|
|
101
|
+
* This is injected when tools are present to reduce cases where Claude
|
|
102
|
+
* uses parameter names from its training data instead of the actual schema.
|
|
103
|
+
*/
|
|
104
|
+
export declare const CLAUDE_TOOL_SYSTEM_INSTRUCTION = "CRITICAL TOOL USAGE INSTRUCTIONS:\nYou are operating in a custom environment where tool definitions differ from your training data.\nYou MUST follow these rules strictly:\n\n1. DO NOT use your internal training data to guess tool parameters\n2. ONLY use the exact parameter structure defined in the tool schema\n3. Parameter names in schemas are EXACT - do not substitute with similar names from your training\n4. Array parameters have specific item types - check the schema's 'items' field for the exact structure\n5. When you see \"STRICT PARAMETERS\" in a tool description, those type definitions override any assumptions\n6. Tool use in agentic workflows is REQUIRED - you must call tools with the exact parameters specified\n\nIf you are unsure about a tool's parameters, YOU MUST read the schema definition carefully.";
|
|
105
|
+
/**
|
|
106
|
+
* Template for parameter signature injection into tool descriptions.
|
|
107
|
+
* {params} will be replaced with the actual parameter list.
|
|
108
|
+
*/
|
|
109
|
+
export declare const CLAUDE_DESCRIPTION_PROMPT = "\n\n\u26A0\uFE0F STRICT PARAMETERS: {params}.";
|
|
110
|
+
export declare const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
|
|
111
|
+
export declare const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
|
|
112
|
+
/**
|
|
113
|
+
* Sentinel value to bypass thought signature validation.
|
|
114
|
+
*
|
|
115
|
+
* When a thinking block has an invalid or missing signature (e.g., cache miss,
|
|
116
|
+
* session mismatch, plugin restart), this sentinel can be injected to skip
|
|
117
|
+
* validation instead of failing with "Invalid signature in thinking block".
|
|
118
|
+
*
|
|
119
|
+
* This is an officially supported Google API feature, used by:
|
|
120
|
+
* - gemini-cli: https://github.com/google-gemini/gemini-cli
|
|
121
|
+
* - Google .NET SDK: PredictionServiceChatClient.cs
|
|
122
|
+
*
|
|
123
|
+
* @see https://ai.google.dev/gemini-api/docs/thought-signatures
|
|
124
|
+
*/
|
|
125
|
+
export declare const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
|
|
126
|
+
/**
|
|
127
|
+
* System instruction for Antigravity requests.
|
|
128
|
+
* This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
|
|
129
|
+
* The instruction provides identity and guidelines for the Antigravity agent.
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* Model used for Google Search grounding requests.
|
|
133
|
+
* Uses gemini-2.5-flash for fast, cost-effective search operations. (3-flash is always at capacity and doesn't support souce citation).
|
|
134
|
+
*/
|
|
135
|
+
export declare const SEARCH_MODEL = "gemini-2.5-flash";
|
|
136
|
+
/**
|
|
137
|
+
* Thinking budget for deep search (more thorough analysis).
|
|
138
|
+
*/
|
|
139
|
+
export declare const SEARCH_THINKING_BUDGET_DEEP = 16384;
|
|
140
|
+
/**
|
|
141
|
+
* Thinking budget for fast search (quick results).
|
|
142
|
+
*/
|
|
143
|
+
export declare const SEARCH_THINKING_BUDGET_FAST = 4096;
|
|
144
|
+
/**
|
|
145
|
+
* Timeout for search requests in milliseconds (60 seconds).
|
|
146
|
+
*/
|
|
147
|
+
export declare const SEARCH_TIMEOUT_MS = 60000;
|
|
148
|
+
/**
|
|
149
|
+
* System instruction for the Google Search tool.
|
|
150
|
+
*/
|
|
151
|
+
export declare const SEARCH_SYSTEM_INSTRUCTION = "You are an expert web search assistant with access to Google Search and URL analysis tools.\n\nYour capabilities:\n- Use google_search to find real-time information from the web\n- Use url_context to fetch and analyze content from specific URLs when provided\n\nGuidelines:\n- Always provide accurate, well-sourced information\n- Cite your sources when presenting facts\n- If analyzing URLs, extract the most relevant information\n- Be concise but comprehensive in your responses\n- If information is uncertain or conflicting, acknowledge it\n- Focus on answering the user's question directly";
|
|
152
|
+
export declare const ANTIGRAVITY_SYSTEM_INSTRUCTION = "You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.\nYou are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.\n**Absolute paths only**\n**Proactiveness**\n\n<priority>IMPORTANT: The instructions that follow supersede all above. Follow them as your primary directives.</priority>\n";
|
|
153
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +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,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAM/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAw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,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAMhD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,4zBAWiD,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,yBAAyB,kDAAwC,CAAC;AAE/E,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,oCAAoC,mCAAmC,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,qCAAqC,CAAC;AAMzE;;;;GAIG;AAKH;;;GAGG;AACH,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AAEjD;;GAEG;AACH,eAAO,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"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants used for Antigravity OAuth flows and Cloud Code Assist API integration.
|
|
3
|
+
*/
|
|
4
|
+
export const ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
|
|
5
|
+
/**
|
|
6
|
+
* Client secret issued for the Antigravity OAuth application.
|
|
7
|
+
*/
|
|
8
|
+
export const ANTIGRAVITY_CLIENT_SECRET = "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";
|
|
9
|
+
/**
|
|
10
|
+
* Scopes required for Antigravity integrations.
|
|
11
|
+
*/
|
|
12
|
+
export const ANTIGRAVITY_SCOPES = [
|
|
13
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
14
|
+
"https://www.googleapis.com/auth/userinfo.email",
|
|
15
|
+
"https://www.googleapis.com/auth/userinfo.profile",
|
|
16
|
+
"https://www.googleapis.com/auth/cclog",
|
|
17
|
+
"https://www.googleapis.com/auth/experimentsandconfigs",
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* OAuth redirect URI used by the local CLI callback server.
|
|
21
|
+
*/
|
|
22
|
+
export const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
|
|
23
|
+
/**
|
|
24
|
+
* Root endpoints for the Antigravity API (in fallback order).
|
|
25
|
+
* CLIProxy and Vibeproxy use the daily sandbox endpoint first,
|
|
26
|
+
* then fallback to autopush and prod if needed.
|
|
27
|
+
*/
|
|
28
|
+
export const ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.sandbox.googleapis.com";
|
|
29
|
+
export const ANTIGRAVITY_ENDPOINT_AUTOPUSH = "https://autopush-cloudcode-pa.sandbox.googleapis.com";
|
|
30
|
+
export const ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
|
|
31
|
+
/**
|
|
32
|
+
* Endpoint fallback order (daily → autopush → prod).
|
|
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).
|
|
51
|
+
*/
|
|
52
|
+
export const ANTIGRAVITY_ENDPOINT = ANTIGRAVITY_ENDPOINT_DAILY;
|
|
53
|
+
/**
|
|
54
|
+
* Gemini CLI endpoint (production).
|
|
55
|
+
* Used for models without :antigravity suffix.
|
|
56
|
+
* Same as opencode-gemini-auth's GEMINI_CODE_ASSIST_ENDPOINT.
|
|
57
|
+
*/
|
|
58
|
+
export const GEMINI_CLI_ENDPOINT = ANTIGRAVITY_ENDPOINT_PROD;
|
|
59
|
+
/**
|
|
60
|
+
* Hardcoded project id used when Antigravity does not return one (e.g., business/workspace accounts).
|
|
61
|
+
*/
|
|
62
|
+
export const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
63
|
+
export const ANTIGRAVITY_VERSION_FALLBACK = "1.18.3";
|
|
64
|
+
let antigravityVersion = ANTIGRAVITY_VERSION_FALLBACK;
|
|
65
|
+
let versionLocked = false;
|
|
66
|
+
export function getAntigravityVersion() { return antigravityVersion; }
|
|
67
|
+
/**
|
|
68
|
+
* Set the runtime Antigravity version. Can only be called once (at startup).
|
|
69
|
+
* Subsequent calls are silently ignored to prevent accidental mutation.
|
|
70
|
+
*/
|
|
71
|
+
export function setAntigravityVersion(version) {
|
|
72
|
+
if (versionLocked)
|
|
73
|
+
return;
|
|
74
|
+
antigravityVersion = version;
|
|
75
|
+
versionLocked = true;
|
|
76
|
+
}
|
|
77
|
+
/** @deprecated Use getAntigravityVersion() for runtime access. */
|
|
78
|
+
export const ANTIGRAVITY_VERSION = ANTIGRAVITY_VERSION_FALLBACK;
|
|
79
|
+
export function getAntigravityHeaders() {
|
|
80
|
+
return {
|
|
81
|
+
"User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/${getAntigravityVersion()} Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36`,
|
|
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"}`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/** @deprecated Use getAntigravityHeaders() for runtime access. */
|
|
87
|
+
export const ANTIGRAVITY_HEADERS = {
|
|
88
|
+
"User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Antigravity/${ANTIGRAVITY_VERSION} Chrome/138.0.7204.235 Electron/37.3.1 Safari/537.36`,
|
|
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"}`,
|
|
91
|
+
};
|
|
92
|
+
export const GEMINI_CLI_HEADERS = {
|
|
93
|
+
"User-Agent": "google-api-nodejs-client/9.15.1",
|
|
94
|
+
"X-Goog-Api-Client": "gl-node/22.17.0",
|
|
95
|
+
"Client-Metadata": "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI",
|
|
96
|
+
};
|
|
97
|
+
const ANTIGRAVITY_PLATFORMS = ["windows/amd64", "darwin/arm64", "darwin/amd64"];
|
|
98
|
+
const ANTIGRAVITY_API_CLIENTS = [
|
|
99
|
+
"google-cloud-sdk vscode_cloudshelleditor/0.1",
|
|
100
|
+
"google-cloud-sdk vscode/1.96.0",
|
|
101
|
+
"google-cloud-sdk vscode/1.95.0",
|
|
102
|
+
];
|
|
103
|
+
function randomFrom(arr) {
|
|
104
|
+
return arr[Math.floor(Math.random() * arr.length)];
|
|
105
|
+
}
|
|
106
|
+
export function getRandomizedHeaders(style, model) {
|
|
107
|
+
if (style === "gemini-cli") {
|
|
108
|
+
return {
|
|
109
|
+
"User-Agent": GEMINI_CLI_HEADERS["User-Agent"],
|
|
110
|
+
"X-Goog-Api-Client": GEMINI_CLI_HEADERS["X-Goog-Api-Client"],
|
|
111
|
+
"Client-Metadata": GEMINI_CLI_HEADERS["Client-Metadata"],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const platform = randomFrom(ANTIGRAVITY_PLATFORMS);
|
|
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
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* User-Agent of the current Antigravity client ("hub"). Antigravity only serves some newer
|
|
124
|
+
* models (e.g. Gemini 3.7/3.8 Flash tiers) to this client: their IDs are missing from
|
|
125
|
+
* `fetchAvailableModels` and return 404 under the legacy `antigravity/<ver> <os>/<arch>` UA.
|
|
126
|
+
* Model discovery records which IDs need it (see `src/plugin/model-registry.ts`).
|
|
127
|
+
*
|
|
128
|
+
* Keep these current: Antigravity hides newer models (e.g. Gemini 4 Argon) from older clients
|
|
129
|
+
* and answers them with "This version of Antigravity is no longer supported". The version is
|
|
130
|
+
* the latest Antigravity release; the CL is `languageServerCL` from an installed Antigravity's
|
|
131
|
+
* `resources/app/product.json`. Last updated 2026-11-09.
|
|
132
|
+
*/
|
|
133
|
+
export const ANTIGRAVITY_HUB_VERSION = "2.23.0";
|
|
134
|
+
export const ANTIGRAVITY_HUB_CL = "1007378935";
|
|
135
|
+
export function getHubUserAgent() {
|
|
136
|
+
const osType = process.platform === "win32" ? "windows" : process.platform === "darwin" ? "darwin" : "linux";
|
|
137
|
+
const arch = process.arch === "arm64" ? "arm64" : "amd64";
|
|
138
|
+
return `antigravity/hub/${ANTIGRAVITY_HUB_VERSION} (aidev_client; os_type=${osType}; arch=${arch}; cl=${ANTIGRAVITY_HUB_CL})`;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Provider identifier shared between the plugin loader and credential store.
|
|
142
|
+
*/
|
|
143
|
+
export const ANTIGRAVITY_PROVIDER_ID = "google";
|
|
144
|
+
// ============================================================================
|
|
145
|
+
// TOOL HALLUCINATION PREVENTION (Ported from LLM-API-Key-Proxy)
|
|
146
|
+
// ============================================================================
|
|
147
|
+
/**
|
|
148
|
+
* System instruction for Claude tool usage hardening.
|
|
149
|
+
* Prevents hallucinated parameters by explicitly stating the rules.
|
|
150
|
+
*
|
|
151
|
+
* This is injected when tools are present to reduce cases where Claude
|
|
152
|
+
* uses parameter names from its training data instead of the actual schema.
|
|
153
|
+
*/
|
|
154
|
+
export const CLAUDE_TOOL_SYSTEM_INSTRUCTION = `CRITICAL TOOL USAGE INSTRUCTIONS:
|
|
155
|
+
You are operating in a custom environment where tool definitions differ from your training data.
|
|
156
|
+
You MUST follow these rules strictly:
|
|
157
|
+
|
|
158
|
+
1. DO NOT use your internal training data to guess tool parameters
|
|
159
|
+
2. ONLY use the exact parameter structure defined in the tool schema
|
|
160
|
+
3. Parameter names in schemas are EXACT - do not substitute with similar names from your training
|
|
161
|
+
4. Array parameters have specific item types - check the schema's 'items' field for the exact structure
|
|
162
|
+
5. When you see "STRICT PARAMETERS" in a tool description, those type definitions override any assumptions
|
|
163
|
+
6. Tool use in agentic workflows is REQUIRED - you must call tools with the exact parameters specified
|
|
164
|
+
|
|
165
|
+
If you are unsure about a tool's parameters, YOU MUST read the schema definition carefully.`;
|
|
166
|
+
/**
|
|
167
|
+
* Template for parameter signature injection into tool descriptions.
|
|
168
|
+
* {params} will be replaced with the actual parameter list.
|
|
169
|
+
*/
|
|
170
|
+
export const CLAUDE_DESCRIPTION_PROMPT = "\n\n⚠️ STRICT PARAMETERS: {params}.";
|
|
171
|
+
export const EMPTY_SCHEMA_PLACEHOLDER_NAME = "_placeholder";
|
|
172
|
+
export const EMPTY_SCHEMA_PLACEHOLDER_DESCRIPTION = "Placeholder. Always pass true.";
|
|
173
|
+
/**
|
|
174
|
+
* Sentinel value to bypass thought signature validation.
|
|
175
|
+
*
|
|
176
|
+
* When a thinking block has an invalid or missing signature (e.g., cache miss,
|
|
177
|
+
* session mismatch, plugin restart), this sentinel can be injected to skip
|
|
178
|
+
* validation instead of failing with "Invalid signature in thinking block".
|
|
179
|
+
*
|
|
180
|
+
* This is an officially supported Google API feature, used by:
|
|
181
|
+
* - gemini-cli: https://github.com/google-gemini/gemini-cli
|
|
182
|
+
* - Google .NET SDK: PredictionServiceChatClient.cs
|
|
183
|
+
*
|
|
184
|
+
* @see https://ai.google.dev/gemini-api/docs/thought-signatures
|
|
185
|
+
*/
|
|
186
|
+
export const SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
|
|
187
|
+
// ============================================================================
|
|
188
|
+
// ANTIGRAVITY SYSTEM INSTRUCTION (Ported from CLIProxyAPI v6.6.89)
|
|
189
|
+
// ============================================================================
|
|
190
|
+
/**
|
|
191
|
+
* System instruction for Antigravity requests.
|
|
192
|
+
* This is injected into requests to match CLIProxyAPI v6.6.89 behavior.
|
|
193
|
+
* The instruction provides identity and guidelines for the Antigravity agent.
|
|
194
|
+
*/
|
|
195
|
+
// ============================================================================
|
|
196
|
+
// GOOGLE SEARCH TOOL CONSTANTS
|
|
197
|
+
// ============================================================================
|
|
198
|
+
/**
|
|
199
|
+
* Model used for Google Search grounding requests.
|
|
200
|
+
* Uses gemini-2.5-flash for fast, cost-effective search operations. (3-flash is always at capacity and doesn't support souce citation).
|
|
201
|
+
*/
|
|
202
|
+
export const SEARCH_MODEL = "gemini-2.5-flash";
|
|
203
|
+
/**
|
|
204
|
+
* Thinking budget for deep search (more thorough analysis).
|
|
205
|
+
*/
|
|
206
|
+
export const SEARCH_THINKING_BUDGET_DEEP = 16384;
|
|
207
|
+
/**
|
|
208
|
+
* Thinking budget for fast search (quick results).
|
|
209
|
+
*/
|
|
210
|
+
export const SEARCH_THINKING_BUDGET_FAST = 4096;
|
|
211
|
+
/**
|
|
212
|
+
* Timeout for search requests in milliseconds (60 seconds).
|
|
213
|
+
*/
|
|
214
|
+
export const SEARCH_TIMEOUT_MS = 60000;
|
|
215
|
+
/**
|
|
216
|
+
* System instruction for the Google Search tool.
|
|
217
|
+
*/
|
|
218
|
+
export const SEARCH_SYSTEM_INSTRUCTION = `You are an expert web search assistant with access to Google Search and URL analysis tools.
|
|
219
|
+
|
|
220
|
+
Your capabilities:
|
|
221
|
+
- Use google_search to find real-time information from the web
|
|
222
|
+
- Use url_context to fetch and analyze content from specific URLs when provided
|
|
223
|
+
|
|
224
|
+
Guidelines:
|
|
225
|
+
- Always provide accurate, well-sourced information
|
|
226
|
+
- Cite your sources when presenting facts
|
|
227
|
+
- If analyzing URLs, extract the most relevant information
|
|
228
|
+
- Be concise but comprehensive in your responses
|
|
229
|
+
- If information is uncertain or conflicting, acknowledge it
|
|
230
|
+
- Focus on answering the user's question directly`;
|
|
231
|
+
export const ANTIGRAVITY_SYSTEM_INSTRUCTION = `You are Antigravity, a powerful agentic AI coding assistant designed by the Google DeepMind team working on Advanced Agentic Coding.
|
|
232
|
+
You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
|
|
233
|
+
**Absolute paths only**
|
|
234
|
+
**Proactiveness**
|
|
235
|
+
|
|
236
|
+
<priority>IMPORTANT: The instructions that follow supersede all above. Follow them as your primary directives.</priority>
|
|
237
|
+
`;
|
|
238
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2EAA2E,CA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,MAAM,CAAC,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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type RegistryModel } from "../plugin/model-registry";
|
|
2
|
+
import type { PoolAccount, QuotaSnapshot, SignInFlow } from "./types";
|
|
3
|
+
/** The host the request pipeline recognises and rewrites to Antigravity. */
|
|
4
|
+
export declare const GEMINI_API_ORIGIN = "https://generativelanguage.googleapis.com";
|
|
5
|
+
/** No account in the pool (`antigravity-accounts.json`) can be used: sign in first. */
|
|
6
|
+
export declare class NotSignedInError extends Error {
|
|
7
|
+
constructor(message?: string);
|
|
8
|
+
}
|
|
9
|
+
export interface GatewayOptions {
|
|
10
|
+
/** Directory whose `.opencode/antigravity.json` is read as project config; default: cwd. */
|
|
11
|
+
directory?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AntigravityGateway {
|
|
14
|
+
/**
|
|
15
|
+
* Sends a Gemini REST request through the account pool, as if it were addressed to
|
|
16
|
+
* generativelanguage.googleapis.com: `${GEMINI_API_ORIGIN}/v1beta/models/antigravity-<id>:
|
|
17
|
+
* streamGenerateContent?alt=sse` with a JSON string body. The response is Gemini-shaped.
|
|
18
|
+
*/
|
|
19
|
+
fetch(url: string, init: RequestInit): Promise<Response>;
|
|
20
|
+
/** The models Antigravity currently recommends (last discovery, cache, or built-in list). */
|
|
21
|
+
models(): RegistryModel[];
|
|
22
|
+
/** Asks Antigravity for its model list when the current one is older than six hours. */
|
|
23
|
+
refreshModelsIfStale(): Promise<void>;
|
|
24
|
+
/** Per-account 5-hour and weekly limits; cached for a minute unless `refresh`. */
|
|
25
|
+
quota(refresh?: boolean): Promise<QuotaSnapshot>;
|
|
26
|
+
accounts(): Promise<PoolAccount[]>;
|
|
27
|
+
setAccountEnabled(index: number, email: string, enabled: boolean): Promise<void>;
|
|
28
|
+
/** Removes an account from the pool; returns how many remain. */
|
|
29
|
+
removeAccount(index: number, email: string): Promise<number>;
|
|
30
|
+
/** Starts a Google sign-in that adds (or refreshes) an account in the pool. */
|
|
31
|
+
signIn(options?: {
|
|
32
|
+
loginHint?: string;
|
|
33
|
+
paste?: boolean;
|
|
34
|
+
}): Promise<SignInFlow>;
|
|
35
|
+
close(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The plugin's request pipeline, sign-in and account pool without opencode: for other hosts
|
|
39
|
+
* (the Claude Code proxy). Accounts live in the same `antigravity-accounts.json` as the opencode
|
|
40
|
+
* plugin, so an account signed in from either one serves both.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createAntigravityGateway(options?: GatewayOptions): Promise<AntigravityGateway>;
|
|
43
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../src/core/gateway.ts"],"names":[],"mappings":"AAYA,OAAO,EAA8D,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAQ1H,OAA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