@oxygen-agent/cli 1.285.53 → 1.286.13

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/README.md CHANGED
@@ -34,4 +34,4 @@ oxygen update
34
34
 
35
35
  For product documentation, visit https://oxygen-agent.com/docs. For support, visit https://oxygen-agent.com.
36
36
 
37
- Version: 1.285.53
37
+ Version: 1.286.13
@@ -10,8 +10,22 @@ const ACCOUNT_NAME = "default";
10
10
  const DEFAULT_API_URL = "https://oxygen-agent.com";
11
11
  const DEFAULT_PROFILE_NAME = "default";
12
12
  const WINDOWS_CREDENTIAL_PAYLOAD_ENV = "OXYGEN_CLI_WINDOWS_CREDENTIAL_PAYLOAD";
13
+ function readEnvApiUrl(env) {
14
+ const apiUrl = env.OXYGEN_API_URL?.trim();
15
+ return apiUrl ? normalizeApiUrl(apiUrl) : null;
16
+ }
13
17
  export function defaultApiUrl(env = process.env) {
14
- return normalizeApiUrl(env.OXYGEN_API_URL ?? DEFAULT_API_URL);
18
+ return readEnvApiUrl(env) ?? DEFAULT_API_URL;
19
+ }
20
+ // OXYGEN_API_URL names the deployment every command must talk to, so it has to
21
+ // win over a stored profile's persisted apiUrl (which defaults to production).
22
+ // Reading it only on the env-token branch made `OXYGEN_API_URL=<dev>` a no-op
23
+ // for anyone logged in, silently pointing verification runs at prod (OXY-3550).
24
+ function withApiUrlOverride(credentials, env) {
25
+ const override = readEnvApiUrl(env);
26
+ if (!override || override === credentials.apiUrl)
27
+ return credentials;
28
+ return { ...credentials, apiUrl: override };
15
29
  }
16
30
  export async function loadCredentials(env = process.env) {
17
31
  const envToken = readEnvToken(env);
@@ -33,14 +47,15 @@ export async function loadCredentials(env = process.env) {
33
47
  const activeProfile = requestedProfile ?? readProfileName(document.activeProfile) ?? DEFAULT_PROFILE_NAME;
34
48
  const profileCredentials = profiles[activeProfile];
35
49
  if (profileCredentials)
36
- return profileCredentials;
50
+ return withApiUrlOverride(profileCredentials, env);
37
51
  if (requestedProfile) {
38
52
  throw new OxygenError("profile_not_found", `Oxygen CLI profile "${requestedProfile}" is not stored.`, {
39
53
  details: { profile: requestedProfile },
40
54
  exitCode: 1,
41
55
  });
42
56
  }
43
- return parseStoredCredentialsObject(document);
57
+ const storedCredentials = parseStoredCredentialsObject(document);
58
+ return storedCredentials ? withApiUrlOverride(storedCredentials, env) : null;
44
59
  }
45
60
  export async function saveCredentials(credentials, env = process.env, options = {}) {
46
61
  const normalized = normalizeStoredCredentialsRecord(credentials);
@@ -135,7 +150,8 @@ export async function resolveActiveProfile(env = process.env) {
135
150
  const profiles = document ? readProfiles(document) : {};
136
151
  const fileActive = readProfileName(document?.activeProfile);
137
152
  const candidate = envProfile ?? fileActive ?? DEFAULT_PROFILE_NAME;
138
- const credentials = profiles[candidate] ?? null;
153
+ const stored = profiles[candidate];
154
+ const credentials = stored ? withApiUrlOverride(stored, env) : null;
139
155
  const source = envProfile
140
156
  ? "env"
141
157
  : fileActive
@@ -1,2 +1,2 @@
1
- export declare const OXYGEN_VERSION = "1.285.53";
1
+ export declare const OXYGEN_VERSION = "1.286.13";
2
2
  export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.181.0";
@@ -1,4 +1,4 @@
1
- export const OXYGEN_VERSION = "1.285.53";
1
+ export const OXYGEN_VERSION = "1.286.13";
2
2
  // Bump this only when deployed CLI/API contracts require a newer CLI.
3
3
  // 1.181.0: paid table action runs and background columns run require
4
4
  // approved=true in addition to max_credits; older CLIs cannot send the flag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxygen-agent/cli",
3
- "version": "1.285.53",
3
+ "version": "1.286.13",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",