opencode-gemini-cli-oauth 1.1.21 → 1.2.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/dist/constants.d.ts +9 -20
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +18 -29
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +4 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -14
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +27 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +170 -0
- package/dist/oauth.js.map +1 -0
- package/dist/plugin.d.ts +11 -28
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +170 -70
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +5 -44
- package/dist/types.d.ts.map +1 -1
- package/package.json +23 -21
- package/dist/auth/account-manager.d.ts +0 -16
- package/dist/auth/account-manager.d.ts.map +0 -1
- package/dist/auth/account-manager.js +0 -63
- package/dist/auth/account-manager.js.map +0 -1
- package/dist/auth/oauth.d.ts +0 -27
- package/dist/auth/oauth.d.ts.map +0 -1
- package/dist/auth/oauth.js +0 -89
- package/dist/auth/oauth.js.map +0 -1
- package/dist/cli/setup.d.ts +0 -3
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js +0 -234
- package/dist/cli/setup.js.map +0 -1
- package/dist/index-minimal.d.ts +0 -2
- package/dist/index-minimal.d.ts.map +0 -1
- package/dist/index-minimal.js +0 -2
- package/dist/index-minimal.js.map +0 -1
- package/dist/index-simple.d.ts +0 -5
- package/dist/index-simple.d.ts.map +0 -1
- package/dist/index-simple.js +0 -5
- package/dist/index-simple.js.map +0 -1
- package/dist/plugin-minimal.d.ts +0 -21
- package/dist/plugin-minimal.d.ts.map +0 -1
- package/dist/plugin-minimal.js +0 -27
- package/dist/plugin-minimal.js.map +0 -1
- package/dist/plugin-simple.d.ts +0 -28
- package/dist/plugin-simple.d.ts.map +0 -1
- package/dist/plugin-simple.js +0 -117
- package/dist/plugin-simple.js.map +0 -1
- package/dist/storage/storage.d.ts +0 -56
- package/dist/storage/storage.d.ts.map +0 -1
- package/dist/storage/storage.js +0 -138
- package/dist/storage/storage.js.map +0 -1
package/dist/plugin.js
CHANGED
|
@@ -2,85 +2,185 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2025 Yusuf
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
|
+
*
|
|
6
|
+
* OpenCode Gemini CLI OAuth Plugin
|
|
7
|
+
*
|
|
8
|
+
* This plugin allows OpenCode to use Gemini models via OAuth credentials
|
|
9
|
+
* from the official Gemini CLI (gemini auth login).
|
|
5
10
|
*/
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
import { getAccessToken, verifyCredentials, getUserInfo, hasCredentials, } from "./oauth.js";
|
|
12
|
+
import { PROVIDER_ID } from "./constants.js";
|
|
13
|
+
// CloudCode endpoint used by Gemini CLI
|
|
14
|
+
const CLOUDCODE_ENDPOINT = "https://cloudcode-pa.googleapis.com";
|
|
15
|
+
const CLOUDCODE_API_VERSION = "v1internal";
|
|
16
|
+
/**
|
|
17
|
+
* Transform generativelanguage.googleapis.com request to cloudcode-pa.googleapis.com format
|
|
18
|
+
*/
|
|
19
|
+
function transformToCloudCodeRequest(urlStr, bodyStr, model, action, streaming) {
|
|
20
|
+
// Parse the original body
|
|
21
|
+
let originalBody = {};
|
|
22
|
+
if (bodyStr) {
|
|
23
|
+
try {
|
|
24
|
+
originalBody = JSON.parse(bodyStr);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// If body is not JSON, use as-is
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Build CloudCode API URL
|
|
31
|
+
// Format: https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse
|
|
32
|
+
const cloudCodeUrl = `${CLOUDCODE_ENDPOINT}/${CLOUDCODE_API_VERSION}:${action}${streaming ? "?alt=sse" : ""}`;
|
|
33
|
+
// Wrap the request body in CloudCode format
|
|
34
|
+
// The request format needs: { model: "...", request: { contents: [...], ... } }
|
|
35
|
+
const cloudCodeBody = {
|
|
36
|
+
model: model,
|
|
37
|
+
request: originalBody,
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
url: cloudCodeUrl,
|
|
41
|
+
body: JSON.stringify(cloudCodeBody),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create the Gemini CLI OAuth plugin
|
|
46
|
+
*/
|
|
47
|
+
export const GeminiCliOAuthPlugin = async (input) => {
|
|
48
|
+
console.error("[gemini-cli-oauth] Plugin initialized");
|
|
49
|
+
const { client } = input;
|
|
50
|
+
// Get the original fetch function
|
|
51
|
+
const originalFetch = globalThis.fetch;
|
|
52
|
+
/**
|
|
53
|
+
* Custom fetch that transforms requests to use CloudCode endpoint with OAuth
|
|
54
|
+
*/
|
|
55
|
+
const authenticatedFetch = async (url, init) => {
|
|
56
|
+
const urlStr = typeof url === "string" ? url : url instanceof URL ? url.href : url.url;
|
|
57
|
+
// Only intercept requests to Google's generative language API
|
|
58
|
+
const isGenerativeLanguageApi = urlStr.includes("generativelanguage.googleapis.com");
|
|
59
|
+
const isCloudCodeApi = urlStr.includes("cloudcode-pa.googleapis.com");
|
|
60
|
+
if (!isGenerativeLanguageApi && !isCloudCodeApi) {
|
|
61
|
+
return originalFetch(url, init);
|
|
62
|
+
}
|
|
17
63
|
try {
|
|
18
|
-
//
|
|
19
|
-
const token = await
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const urlObj = new URL(input);
|
|
31
|
-
urlObj.searchParams.delete('key');
|
|
32
|
-
targetInput = urlObj.toString();
|
|
64
|
+
// Get valid access token (refreshes if needed)
|
|
65
|
+
const token = await getAccessToken();
|
|
66
|
+
// Clone init and add/replace Authorization header
|
|
67
|
+
const headers = new Headers(init?.headers);
|
|
68
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
69
|
+
headers.delete("x-goog-api-key");
|
|
70
|
+
// If already a CloudCode request, just add auth
|
|
71
|
+
if (isCloudCodeApi) {
|
|
72
|
+
return originalFetch(url, {
|
|
73
|
+
...init,
|
|
74
|
+
headers,
|
|
75
|
+
});
|
|
33
76
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
// Transform generativelanguage.googleapis.com to cloudcode-pa.googleapis.com
|
|
78
|
+
// Extract model and action from URL: /models/{model}:{action}
|
|
79
|
+
const match = urlStr.match(/\/models\/([^:]+):(\w+)/);
|
|
80
|
+
if (!match) {
|
|
81
|
+
console.error("[gemini-cli-oauth] Could not parse model/action from URL:", urlStr);
|
|
82
|
+
// Fall back to original request with auth
|
|
83
|
+
return originalFetch(url, { ...init, headers });
|
|
38
84
|
}
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
85
|
+
const [, model, action] = match;
|
|
86
|
+
const streaming = urlStr.includes("alt=sse") || action === "streamGenerateContent";
|
|
87
|
+
// Get the original body
|
|
88
|
+
const bodyStr = typeof init?.body === "string" ? init.body : null;
|
|
89
|
+
// Transform to CloudCode format
|
|
90
|
+
const transformed = transformToCloudCodeRequest(urlStr, bodyStr, model, action, streaming);
|
|
91
|
+
console.error("[gemini-cli-oauth] Transformed URL:", transformed.url);
|
|
92
|
+
return originalFetch(transformed.url, {
|
|
93
|
+
...init,
|
|
94
|
+
method: "POST",
|
|
95
|
+
headers,
|
|
96
|
+
body: transformed.body,
|
|
97
|
+
});
|
|
43
98
|
}
|
|
44
99
|
catch (error) {
|
|
45
|
-
console.error(
|
|
46
|
-
|
|
100
|
+
console.error("[gemini-cli-oauth] OAuth error:", error);
|
|
101
|
+
throw error;
|
|
47
102
|
}
|
|
48
103
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Auth hook - inline type to avoid version mismatch
|
|
106
|
+
*/
|
|
107
|
+
const authHook = {
|
|
108
|
+
provider: PROVIDER_ID,
|
|
109
|
+
/**
|
|
110
|
+
* Loader function - called when the provider is used
|
|
111
|
+
* Returns the auth configuration with custom fetch
|
|
112
|
+
*/
|
|
113
|
+
loader: async (_getAuth, _provider) => {
|
|
114
|
+
console.error("[gemini-cli-oauth] Loader called");
|
|
115
|
+
// Check if we have valid credentials
|
|
116
|
+
const hasValidCreds = await hasCredentials();
|
|
117
|
+
if (!hasValidCreds) {
|
|
118
|
+
// Show toast notification if client is available
|
|
119
|
+
if (client?.tui?.showToast) {
|
|
120
|
+
await client.tui.showToast({
|
|
121
|
+
body: {
|
|
122
|
+
title: "Gemini CLI OAuth",
|
|
123
|
+
message: "No credentials found. Run 'gemini auth login' first.",
|
|
124
|
+
variant: "warning",
|
|
125
|
+
},
|
|
126
|
+
}).catch(() => { });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
// Empty API key - our custom fetch handles auth via OAuth Bearer token
|
|
131
|
+
apiKey: "",
|
|
132
|
+
// Custom fetch that injects OAuth token
|
|
133
|
+
fetch: authenticatedFetch,
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Auth methods shown in the OpenCode auth menu
|
|
138
|
+
*/
|
|
139
|
+
methods: [
|
|
140
|
+
{
|
|
141
|
+
type: "oauth",
|
|
142
|
+
label: "Google Account (via Gemini CLI)",
|
|
143
|
+
authorize: async () => {
|
|
144
|
+
return {
|
|
145
|
+
url: "",
|
|
146
|
+
instructions: "This plugin uses credentials from the Gemini CLI.\n\n" +
|
|
147
|
+
"To authenticate:\n" +
|
|
148
|
+
"1. Open a terminal\n" +
|
|
149
|
+
"2. Run: gemini auth login\n" +
|
|
150
|
+
"3. Complete the Google sign-in in your browser\n" +
|
|
151
|
+
"4. Return here and click 'I've completed sign-in'\n\n" +
|
|
152
|
+
"Your credentials will be shared between Gemini CLI and OpenCode.",
|
|
153
|
+
method: "auto",
|
|
154
|
+
callback: async () => {
|
|
155
|
+
try {
|
|
156
|
+
// Check if credentials exist and are valid
|
|
157
|
+
const isValid = await verifyCredentials();
|
|
158
|
+
if (isValid) {
|
|
159
|
+
const userInfo = await getUserInfo();
|
|
160
|
+
return {
|
|
161
|
+
type: "success",
|
|
162
|
+
key: `GEMINI_CLI_OAUTH_${userInfo.email}`,
|
|
163
|
+
};
|
|
75
164
|
}
|
|
76
|
-
|
|
77
|
-
|
|
165
|
+
return {
|
|
166
|
+
type: "failed",
|
|
167
|
+
};
|
|
78
168
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
169
|
+
catch {
|
|
170
|
+
return {
|
|
171
|
+
type: "failed",
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
],
|
|
84
179
|
};
|
|
85
|
-
|
|
180
|
+
return {
|
|
181
|
+
auth: authHook,
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
// Default export for OpenCode plugin system
|
|
185
|
+
export default GeminiCliOAuthPlugin;
|
|
86
186
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,wCAAwC;AACxC,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AACjE,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C;;GAEG;AACH,SAAS,2BAA2B,CAClC,MAAc,EACd,OAAsB,EACtB,KAAa,EACb,MAAc,EACd,SAAkB;IAElB,0BAA0B;IAC1B,IAAI,YAAY,GAAQ,EAAE,CAAC;IAC3B,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,CAAC;YACH,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,iCAAiC;QACnC,CAAC;IACH,CAAC;IAED,0BAA0B;IAC1B,uFAAuF;IACvF,MAAM,YAAY,GAAG,GAAG,kBAAkB,IAAI,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAE9G,4CAA4C;IAC5C,gFAAgF;IAChF,MAAM,aAAa,GAAG;QACpB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAW,KAAK,EAC/C,KAAkB,EACF,EAAE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;4BAAC,MAAM,CAAC;gCACP,OAAO;oCACL,IAAI,EAAE,QAAQ;iCACf,CAAC;4BACJ,CAAC;wBACH,CAAC;qBACF,CAAC;gBACJ,CAAC;aACF;SACF;KACF,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,eAAe,oBAAoB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -14,39 +14,6 @@ export interface OAuthCredentials {
|
|
|
14
14
|
expiry_date: number;
|
|
15
15
|
id_token?: string;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Google account information
|
|
19
|
-
*/
|
|
20
|
-
export interface GoogleAccount {
|
|
21
|
-
email: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
picture?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Account pool entry
|
|
27
|
-
*/
|
|
28
|
-
export interface AccountPoolEntry {
|
|
29
|
-
email: string;
|
|
30
|
-
credentials: OAuthCredentials;
|
|
31
|
-
lastUsed: number;
|
|
32
|
-
requestCount: number;
|
|
33
|
-
rateLimitUntil?: number;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Account pool storage
|
|
37
|
-
*/
|
|
38
|
-
export interface AccountPool {
|
|
39
|
-
accounts: AccountPoolEntry[];
|
|
40
|
-
currentIndex: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Plugin configuration
|
|
44
|
-
*/
|
|
45
|
-
export interface PluginConfig {
|
|
46
|
-
enableMultiAccount: boolean;
|
|
47
|
-
autoRotateOnRateLimit: boolean;
|
|
48
|
-
debugMode: boolean;
|
|
49
|
-
}
|
|
50
17
|
/**
|
|
51
18
|
* Token refresh result
|
|
52
19
|
*/
|
|
@@ -57,17 +24,11 @@ export interface TokenRefreshResult {
|
|
|
57
24
|
error?: string;
|
|
58
25
|
}
|
|
59
26
|
/**
|
|
60
|
-
*
|
|
27
|
+
* User info from Google
|
|
61
28
|
*/
|
|
62
|
-
export interface
|
|
63
|
-
|
|
64
|
-
|
|
29
|
+
export interface UserInfo {
|
|
30
|
+
email: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
picture?: string;
|
|
65
33
|
}
|
|
66
|
-
/**
|
|
67
|
-
* OpenCode auth loader function signature
|
|
68
|
-
*/
|
|
69
|
-
export type AuthLoader = (getAuth: () => Promise<any>, provider: string) => Promise<{
|
|
70
|
-
apiKey: string;
|
|
71
|
-
fetch: typeof fetch;
|
|
72
|
-
}>;
|
|
73
34
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-gemini-cli-oauth",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "OpenCode plugin for Gemini CLI OAuth authentication - use Google account quota without API keys",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
5
7
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"clean": "rm -rf dist",
|
|
12
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "Yusuf",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/yusuf/opencode-gemini-cli-oauth.git"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"opencode",
|
|
@@ -19,27 +19,29 @@
|
|
|
19
19
|
"ai",
|
|
20
20
|
"plugin"
|
|
21
21
|
],
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20.0.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
|
-
"dist",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
26
|
+
"dist/",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
29
|
],
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc -p tsconfig.build.json",
|
|
32
|
+
"dev": "tsc --watch",
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
34
35
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"typescript": "^5"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
40
|
+
"@opencode-ai/plugin": "^0.15.30",
|
|
39
41
|
"@types/node": "^22.10.5",
|
|
40
42
|
"typescript": "^5.7.2"
|
|
41
43
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@ai-sdk/google": "^3.0.10"
|
|
44
46
|
}
|
|
45
47
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Yusuf
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
export declare const accountManager: {
|
|
7
|
-
/**
|
|
8
|
-
* Initialize account pool
|
|
9
|
-
*/
|
|
10
|
-
initialize(): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Get access token
|
|
13
|
-
*/
|
|
14
|
-
getCurrentAccessToken(): Promise<string>;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=account-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account-manager.d.ts","sourceRoot":"","sources":["../../src/auth/account-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,cAAc;IACzB;;OAEG;kBACiB,OAAO,CAAC,IAAI,CAAC;IAwBjC;;OAEG;6BAC4B,OAAO,CAAC,MAAM,CAAC;CA+B/C,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Yusuf
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
import { StorageManager } from '../storage/storage.js';
|
|
7
|
-
import { oauth } from './oauth.js';
|
|
8
|
-
export const accountManager = {
|
|
9
|
-
/**
|
|
10
|
-
* Initialize account pool
|
|
11
|
-
*/
|
|
12
|
-
async initialize() {
|
|
13
|
-
const credentials = await StorageManager.readOAuthCredentials();
|
|
14
|
-
if (!credentials)
|
|
15
|
-
return;
|
|
16
|
-
const userInfo = await oauth.getUserInfo();
|
|
17
|
-
const pool = await StorageManager.readAccountPool();
|
|
18
|
-
const existingAccount = pool.accounts.find((acc) => acc.email === userInfo.email);
|
|
19
|
-
if (existingAccount) {
|
|
20
|
-
await StorageManager.updateAccountInPool(userInfo.email, {
|
|
21
|
-
credentials,
|
|
22
|
-
lastUsed: Date.now(),
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const newEntry = {
|
|
27
|
-
email: userInfo.email,
|
|
28
|
-
credentials,
|
|
29
|
-
lastUsed: Date.now(),
|
|
30
|
-
requestCount: 0,
|
|
31
|
-
};
|
|
32
|
-
await StorageManager.upsertAccountInPool(newEntry);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* Get access token
|
|
37
|
-
*/
|
|
38
|
-
async getCurrentAccessToken() {
|
|
39
|
-
const account = await StorageManager.getCurrentAccount();
|
|
40
|
-
if (!account) {
|
|
41
|
-
return await oauth.getAccessToken();
|
|
42
|
-
}
|
|
43
|
-
const now = Date.now();
|
|
44
|
-
const expiryTime = account.credentials.expiry_date || 0;
|
|
45
|
-
const needsRefresh = expiryTime - now < 5 * 60 * 1000;
|
|
46
|
-
if (needsRefresh) {
|
|
47
|
-
const refreshResult = await oauth.refreshAccessToken(account.credentials.refresh_token);
|
|
48
|
-
if (refreshResult.success && refreshResult.accessToken) {
|
|
49
|
-
const updatedCredentials = {
|
|
50
|
-
...account.credentials,
|
|
51
|
-
access_token: refreshResult.accessToken,
|
|
52
|
-
expiry_date: refreshResult.expiryDate || Date.now() + 3600 * 1000,
|
|
53
|
-
};
|
|
54
|
-
await StorageManager.updateAccountInPool(account.email, {
|
|
55
|
-
credentials: updatedCredentials,
|
|
56
|
-
});
|
|
57
|
-
return refreshResult.accessToken;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return account.credentials.access_token;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=account-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account-manager.js","sourceRoot":"","sources":["../../src/auth/account-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,oBAAoB,EAAE,CAAC;QAChE,IAAI,CAAC,WAAW;YAAE,OAAO;QAEzB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,eAAe,EAAE,CAAC;QACpD,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC;QAElF,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,cAAc,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,EAAE;gBACvD,WAAW;gBACX,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;aACrB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,GAAqB;gBACjC,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,WAAW;gBACX,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;gBACp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|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Yusuf
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
import type { TokenRefreshResult } from '../types.js';
|
|
7
|
-
export declare const oauth: {
|
|
8
|
-
/**
|
|
9
|
-
* Get access token from stored credentials
|
|
10
|
-
*/
|
|
11
|
-
getAccessToken(): Promise<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Refresh access token
|
|
14
|
-
*/
|
|
15
|
-
refreshAccessToken(refreshToken: string, retryCount?: number): Promise<TokenRefreshResult>;
|
|
16
|
-
/**
|
|
17
|
-
* Verify credentials
|
|
18
|
-
*/
|
|
19
|
-
verifyCredentials(): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Get user info
|
|
22
|
-
*/
|
|
23
|
-
getUserInfo(): Promise<{
|
|
24
|
-
email: string;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=oauth.d.ts.map
|
package/dist/auth/oauth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/auth/oauth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAAoB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAOxE,eAAO,MAAM,KAAK;IAChB;;OAEG;sBACqB,OAAO,CAAC,MAAM,CAAC;IA4BvC;;OAEG;qCAEa,MAAM,wBAEnB,OAAO,CAAC,kBAAkB,CAAC;IAkC9B;;OAEG;yBACwB,OAAO,CAAC,OAAO,CAAC;IAU3C;;OAEG;mBACkB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAKhD,CAAC"}
|
package/dist/auth/oauth.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Yusuf
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
import { OAuth2Client } from 'google-auth-library';
|
|
7
|
-
import { OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, TOKEN_EXPIRY_BUFFER_MS, MAX_REFRESH_RETRIES, } from '../constants.js';
|
|
8
|
-
import { StorageManager } from '../storage/storage.js';
|
|
9
|
-
const client = new OAuth2Client({
|
|
10
|
-
clientId: OAUTH_CLIENT_ID,
|
|
11
|
-
clientSecret: OAUTH_CLIENT_SECRET,
|
|
12
|
-
});
|
|
13
|
-
export const oauth = {
|
|
14
|
-
/**
|
|
15
|
-
* Get access token from stored credentials
|
|
16
|
-
*/
|
|
17
|
-
async getAccessToken() {
|
|
18
|
-
const credentials = await StorageManager.readOAuthCredentials();
|
|
19
|
-
if (!credentials) {
|
|
20
|
-
throw new Error('No OAuth credentials found. Please authenticate using Gemini CLI: gemini auth login');
|
|
21
|
-
}
|
|
22
|
-
const now = Date.now();
|
|
23
|
-
const expiryTime = credentials.expiry_date || 0;
|
|
24
|
-
const needsRefresh = expiryTime - now < TOKEN_EXPIRY_BUFFER_MS;
|
|
25
|
-
if (needsRefresh) {
|
|
26
|
-
const refreshResult = await this.refreshAccessToken(credentials.refresh_token);
|
|
27
|
-
if (!refreshResult.success) {
|
|
28
|
-
throw new Error(`Failed to refresh access token: ${refreshResult.error}. Please re-authenticate`);
|
|
29
|
-
}
|
|
30
|
-
return refreshResult.accessToken;
|
|
31
|
-
}
|
|
32
|
-
return credentials.access_token;
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* Refresh access token
|
|
36
|
-
*/
|
|
37
|
-
async refreshAccessToken(refreshToken, retryCount = 0) {
|
|
38
|
-
try {
|
|
39
|
-
client.setCredentials({ refresh_token: refreshToken });
|
|
40
|
-
const { credentials } = await client.refreshAccessToken();
|
|
41
|
-
if (!credentials.access_token) {
|
|
42
|
-
throw new Error('No access token returned from refresh');
|
|
43
|
-
}
|
|
44
|
-
const existingCreds = await StorageManager.readOAuthCredentials();
|
|
45
|
-
const updatedCreds = {
|
|
46
|
-
...existingCreds,
|
|
47
|
-
access_token: credentials.access_token,
|
|
48
|
-
expiry_date: credentials.expiry_date || Date.now() + 3600 * 1000,
|
|
49
|
-
token_type: credentials.token_type || 'Bearer',
|
|
50
|
-
};
|
|
51
|
-
await StorageManager.writeOAuthCredentials(updatedCreds);
|
|
52
|
-
return {
|
|
53
|
-
success: true,
|
|
54
|
-
accessToken: credentials.access_token,
|
|
55
|
-
expiryDate: credentials.expiry_date || undefined,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
60
|
-
if (retryCount < MAX_REFRESH_RETRIES) {
|
|
61
|
-
await new Promise((resolve) => setTimeout(resolve, 1000 * (retryCount + 1)));
|
|
62
|
-
return this.refreshAccessToken(refreshToken, retryCount + 1);
|
|
63
|
-
}
|
|
64
|
-
return { success: false, error: errorMessage };
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
/**
|
|
68
|
-
* Verify credentials
|
|
69
|
-
*/
|
|
70
|
-
async verifyCredentials() {
|
|
71
|
-
try {
|
|
72
|
-
const token = await this.getAccessToken();
|
|
73
|
-
const tokenInfo = await client.getTokenInfo(token);
|
|
74
|
-
return !!tokenInfo.email;
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* Get user info
|
|
82
|
-
*/
|
|
83
|
-
async getUserInfo() {
|
|
84
|
-
const token = await this.getAccessToken();
|
|
85
|
-
const tokenInfo = await client.getTokenInfo(token);
|
|
86
|
-
return { email: tokenInfo.email || 'unknown' };
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=oauth.js.map
|
package/dist/auth/oauth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceR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