axexec 1.1.3 → 1.1.5
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.
|
@@ -19,8 +19,6 @@ function getCredentialEnvironment(credentials) {
|
|
|
19
19
|
// axauth uses "accessToken", but also check legacy "oauthToken" and "token" keys
|
|
20
20
|
const oauthToken = resolveStringField(credentials.data, "accessToken", "oauthToken") ??
|
|
21
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");
|
|
24
22
|
switch (credentials.agent) {
|
|
25
23
|
case "claude": {
|
|
26
24
|
if (credentials.type === "api-key" && apiKey) {
|
|
@@ -41,12 +39,13 @@ function getCredentialEnvironment(credentials) {
|
|
|
41
39
|
if (credentials.type === "api-key" && apiKey) {
|
|
42
40
|
environment["GEMINI_API_KEY"] = apiKey;
|
|
43
41
|
}
|
|
44
|
-
else if (credentials.type === "oauth-credentials"
|
|
45
|
-
|
|
46
|
-
//
|
|
47
|
-
//
|
|
42
|
+
else if (credentials.type === "oauth-credentials") {
|
|
43
|
+
// Set GOOGLE_GENAI_USE_GCA to enable oauth-personal auth type.
|
|
44
|
+
// This tells Gemini to check for cached OAuth credentials (oauth_creds.json).
|
|
45
|
+
// DO NOT set GOOGLE_CLOUD_ACCESS_TOKEN - that bypasses the file and
|
|
46
|
+
// prevents token refresh. Credentials are written to oauth_creds.json
|
|
47
|
+
// by installGeminiCredentials().
|
|
48
48
|
environment["GOOGLE_GENAI_USE_GCA"] = "true";
|
|
49
|
-
environment["GOOGLE_CLOUD_ACCESS_TOKEN"] = googleAccessToken;
|
|
50
49
|
}
|
|
51
50
|
break;
|
|
52
51
|
}
|
|
@@ -23,11 +23,11 @@ declare function installClaudeCredentials(configDirectory: string, credentials:
|
|
|
23
23
|
* Installs Codex credentials to a config directory.
|
|
24
24
|
*
|
|
25
25
|
* File: auth.json
|
|
26
|
-
* Format: { OPENAI_API_KEY: "..." } or { tokens: {
|
|
26
|
+
* Format: { OPENAI_API_KEY: "..." } or { OPENAI_API_KEY: null, tokens: { id_token, access_token, refresh_token, account_id }, last_refresh: "..." }
|
|
27
27
|
*
|
|
28
28
|
* Handles:
|
|
29
29
|
* - api-key: Written as { OPENAI_API_KEY: "..." }
|
|
30
|
-
* - oauth-credentials: Written
|
|
30
|
+
* - oauth-credentials: Written directly (expected to already have correct structure)
|
|
31
31
|
*/
|
|
32
32
|
declare function installCodexCredentials(configDirectory: string, credentials: Credentials, warn?: WarningWriter): void;
|
|
33
33
|
/**
|
|
@@ -40,11 +40,11 @@ function installClaudeCredentials(configDirectory, credentials) {
|
|
|
40
40
|
* Installs Codex credentials to a config directory.
|
|
41
41
|
*
|
|
42
42
|
* File: auth.json
|
|
43
|
-
* Format: { OPENAI_API_KEY: "..." } or { tokens: {
|
|
43
|
+
* Format: { OPENAI_API_KEY: "..." } or { OPENAI_API_KEY: null, tokens: { id_token, access_token, refresh_token, account_id }, last_refresh: "..." }
|
|
44
44
|
*
|
|
45
45
|
* Handles:
|
|
46
46
|
* - api-key: Written as { OPENAI_API_KEY: "..." }
|
|
47
|
-
* - oauth-credentials: Written
|
|
47
|
+
* - oauth-credentials: Written directly (expected to already have correct structure)
|
|
48
48
|
*/
|
|
49
49
|
function installCodexCredentials(configDirectory, credentials, warn = defaultWarningWriter) {
|
|
50
50
|
const authPath = path.join(configDirectory, "auth.json");
|
|
@@ -59,10 +59,12 @@ function installCodexCredentials(configDirectory, credentials, warn = defaultWar
|
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case "oauth-credentials": {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
62
|
+
// Codex expects { OPENAI_API_KEY, tokens: { id_token, access_token, refresh_token, account_id }, last_refresh }
|
|
63
|
+
// The vault stores credentials in this exact format, so write directly.
|
|
64
|
+
// Remove internal _source field if present.
|
|
65
|
+
const data = { ...credentials.data };
|
|
66
|
+
delete data["_source"];
|
|
67
|
+
saveJsonFile(authPath, data);
|
|
66
68
|
break;
|
|
67
69
|
}
|
|
68
70
|
case "oauth-token": {
|
package/package.json
CHANGED