@cortexkit/pi-antigravity-auth 1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jens
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @cortexkit/pi-antigravity-auth
2
+
3
+ Google Antigravity OAuth extension for [pi](https://github.com/earendil-works/pi-mono).
4
+ Authenticate with your Google account and use Gemini 3 models through
5
+ Antigravity's endpoints.
6
+
7
+ > [!CAUTION]
8
+ > Using this extension violates Google's Terms of Service. Accounts may be
9
+ > suspended or banned. This is an unofficial tool not endorsed by Google.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pi package add @cortexkit/pi-antigravity-auth
15
+ ```
16
+
17
+ ## Login
18
+
19
+ ```
20
+ /login google-antigravity
21
+ ```
22
+
23
+ A browser URL is shown. Complete the Google OAuth flow and paste the resulting
24
+ callback URL (or authorization code) back into the prompt.
25
+
26
+ ## Models
27
+
28
+ The extension registers the Antigravity model catalog under the
29
+ `google-antigravity` provider, including:
30
+
31
+ - `antigravity-gemini-3.5-flash`
32
+ - `antigravity-gemini-3.1-pro`
33
+ - `antigravity-claude-sonnet-4-6-thinking`
34
+ - `antigravity-claude-opus-4-6-thinking`
35
+
36
+ Select a model with `/model` or `pi -m google-antigravity/antigravity-gemini-3.5-flash`.
37
+
38
+ ## Configuration
39
+
40
+ | Environment variable | Description |
41
+ | --- | --- |
42
+ | `PI_AGENT_DIR` | Override the pi agent directory (default `~/.pi/agent`). |
43
+ | `PI_ANTIGRAVITY_AUTH_FILE` | Override the account storage file path. |
44
+
45
+ ## Notes
46
+
47
+ This package shares its transport, OAuth, fingerprint, and request-transform
48
+ logic with the OpenCode plugin via
49
+ [`@cortexkit/antigravity-auth-core`](../core). The current pi release targets a
50
+ single authenticated account; multi-account rotation and quota gating are
51
+ provided by the OpenCode plugin and are planned for pi in a later release.
52
+
53
+ ## License
54
+
55
+ MIT
@@ -0,0 +1,46 @@
1
+ import type { Context } from "@earendil-works/pi-ai";
2
+ /** Gemini `contents` part shapes. */
3
+ type GeminiPart = {
4
+ text: string;
5
+ } | {
6
+ inlineData: {
7
+ mimeType: string;
8
+ data: string;
9
+ };
10
+ } | {
11
+ functionCall: {
12
+ name: string;
13
+ args: Record<string, unknown>;
14
+ };
15
+ thoughtSignature?: string;
16
+ } | {
17
+ functionResponse: {
18
+ name: string;
19
+ response: Record<string, unknown>;
20
+ };
21
+ };
22
+ interface GeminiContent {
23
+ role: "user" | "model";
24
+ parts: GeminiPart[];
25
+ }
26
+ interface GeminiTool {
27
+ functionDeclarations: Array<{
28
+ name: string;
29
+ description: string;
30
+ parametersJsonSchema?: Record<string, unknown>;
31
+ }>;
32
+ }
33
+ export interface GeminiRequest {
34
+ contents: GeminiContent[];
35
+ tools?: GeminiTool[];
36
+ systemInstruction?: {
37
+ parts: GeminiPart[];
38
+ };
39
+ }
40
+ /**
41
+ * Convert a pi `Context` into a Gemini `generateContent` request body
42
+ * (the inner `request` object of the Antigravity envelope).
43
+ */
44
+ export declare function buildGeminiRequest(context: Context): GeminiRequest;
45
+ export {};
46
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAQR,MAAM,uBAAuB,CAAA;AAE9B,qCAAqC;AACrC,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,UAAU,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAClD;IAAE,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5F;IAAE,gBAAgB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAA;CAAE,CAAA;AAE7E,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,UAAU,UAAU;IAClB,oBAAoB,EAAE,KAAK,CAAC;QAC1B,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC/C,CAAC,CAAA;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAA;IACpB,iBAAiB,CAAC,EAAE;QAAE,KAAK,EAAE,UAAU,EAAE,CAAA;KAAE,CAAA;CAC5C;AA4GD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAalE"}
@@ -0,0 +1,3 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ export default function cortexKitPiAntigravityAuth(pi: ExtensionAPI): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAiEnE,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAwBzE"}