axexec 1.1.1 → 1.1.3
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.
|
@@ -16,7 +16,11 @@ function getCredentialEnvironment(credentials) {
|
|
|
16
16
|
// Extract API key from credentials data
|
|
17
17
|
const apiKey = resolveStringField(credentials.data, "apiKey", "key");
|
|
18
18
|
// Extract OAuth token from credentials data
|
|
19
|
-
|
|
19
|
+
// axauth uses "accessToken", but also check legacy "oauthToken" and "token" keys
|
|
20
|
+
const oauthToken = resolveStringField(credentials.data, "accessToken", "oauthToken") ??
|
|
21
|
+
resolveStringField(credentials.data, "token", "token");
|
|
22
|
+
// Extract Google OAuth access_token (snake_case, used by Gemini)
|
|
23
|
+
const googleAccessToken = resolveStringField(credentials.data, "access_token", "accessToken");
|
|
20
24
|
switch (credentials.agent) {
|
|
21
25
|
case "claude": {
|
|
22
26
|
if (credentials.type === "api-key" && apiKey) {
|
|
@@ -37,6 +41,13 @@ function getCredentialEnvironment(credentials) {
|
|
|
37
41
|
if (credentials.type === "api-key" && apiKey) {
|
|
38
42
|
environment["GEMINI_API_KEY"] = apiKey;
|
|
39
43
|
}
|
|
44
|
+
else if (credentials.type === "oauth-credentials" &&
|
|
45
|
+
googleAccessToken) {
|
|
46
|
+
// For non-interactive mode, Gemini needs pre-obtained access token
|
|
47
|
+
// via GOOGLE_GENAI_USE_GCA + GOOGLE_CLOUD_ACCESS_TOKEN
|
|
48
|
+
environment["GOOGLE_GENAI_USE_GCA"] = "true";
|
|
49
|
+
environment["GOOGLE_CLOUD_ACCESS_TOKEN"] = googleAccessToken;
|
|
50
|
+
}
|
|
40
51
|
break;
|
|
41
52
|
}
|
|
42
53
|
case "opencode": {
|
|
@@ -63,11 +74,17 @@ function getCredentialEnvironment(credentials) {
|
|
|
63
74
|
}
|
|
64
75
|
case "copilot": {
|
|
65
76
|
// Copilot uses GitHub token as its credential
|
|
77
|
+
// axauth returns oauth-token type with accessToken field
|
|
66
78
|
if (credentials.type === "api-key" && apiKey) {
|
|
67
79
|
environment["COPILOT_GITHUB_TOKEN"] = apiKey;
|
|
68
80
|
environment["GH_TOKEN"] = apiKey;
|
|
69
81
|
environment["GITHUB_TOKEN"] = apiKey;
|
|
70
82
|
}
|
|
83
|
+
else if (credentials.type === "oauth-token" && oauthToken) {
|
|
84
|
+
environment["COPILOT_GITHUB_TOKEN"] = oauthToken;
|
|
85
|
+
environment["GH_TOKEN"] = oauthToken;
|
|
86
|
+
environment["GITHUB_TOKEN"] = oauthToken;
|
|
87
|
+
}
|
|
71
88
|
break;
|
|
72
89
|
}
|
|
73
90
|
}
|
package/package.json
CHANGED