@mutagent/cli 0.2.117 → 0.2.118
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/bin/cli.js +7 -3
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -305,14 +305,16 @@ function loadConfig() {
|
|
|
305
305
|
const fileSelection = fileDescribesKey ? credentials?.defaultWorkspace : undefined;
|
|
306
306
|
const selected = fileSelection ?? rcConfig?.defaultWorkspace;
|
|
307
307
|
const defaultWorkspace = envWorkspace !== "" ? envWorkspace : selected;
|
|
308
|
-
const
|
|
308
|
+
const inSandbox = inCloudSandbox();
|
|
309
|
+
const storedKey = inSandbox ? undefined : credentials?.apiKey ?? rcConfig?.apiKey;
|
|
310
|
+
const storedEndpoint = inSandbox ? undefined : credentials?.endpoint ?? rcConfig?.endpoint;
|
|
309
311
|
const merged = {
|
|
310
312
|
providers: {},
|
|
311
313
|
environment: "production",
|
|
312
314
|
...rcConfig,
|
|
313
315
|
...credentials,
|
|
314
316
|
apiKey: envKey ?? storedKey,
|
|
315
|
-
endpoint: process.env.MUTAGENT_ENDPOINT ??
|
|
317
|
+
endpoint: process.env.MUTAGENT_ENDPOINT ?? storedEndpoint,
|
|
316
318
|
defaultWorkspace,
|
|
317
319
|
workspaceOrigin: envWorkspace !== "" ? "override" : selected ? "selection" : undefined,
|
|
318
320
|
workspaceName: envWorkspace === "" && fileSelection !== undefined && fileSelection === selected ? credentials?.workspaceName : undefined,
|
|
@@ -372,6 +374,8 @@ function clearCredentials() {
|
|
|
372
374
|
function hasCredentials() {
|
|
373
375
|
if (process.env.MUTAGENT_API_KEY)
|
|
374
376
|
return true;
|
|
377
|
+
if (inCloudSandbox())
|
|
378
|
+
return true;
|
|
375
379
|
if (!existsSync(CREDENTIALS_FILE))
|
|
376
380
|
return false;
|
|
377
381
|
const credentials = parseJsonSafe(readFileSync(CREDENTIALS_FILE, "utf-8"), credentialsSchema);
|
|
@@ -40479,4 +40483,4 @@ if (process.env.CLI_VERSION) {
|
|
|
40479
40483
|
}
|
|
40480
40484
|
runCli(process.argv.slice(2), cliVersion);
|
|
40481
40485
|
|
|
40482
|
-
//# debugId=
|
|
40486
|
+
//# debugId=7B351CAFF933F24B64756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -285,14 +285,16 @@ function loadConfig() {
|
|
|
285
285
|
const fileSelection = fileDescribesKey ? credentials?.defaultWorkspace : undefined;
|
|
286
286
|
const selected = fileSelection ?? rcConfig?.defaultWorkspace;
|
|
287
287
|
const defaultWorkspace = envWorkspace !== "" ? envWorkspace : selected;
|
|
288
|
-
const
|
|
288
|
+
const inSandbox = inCloudSandbox();
|
|
289
|
+
const storedKey = inSandbox ? undefined : credentials?.apiKey ?? rcConfig?.apiKey;
|
|
290
|
+
const storedEndpoint = inSandbox ? undefined : credentials?.endpoint ?? rcConfig?.endpoint;
|
|
289
291
|
const merged = {
|
|
290
292
|
providers: {},
|
|
291
293
|
environment: "production",
|
|
292
294
|
...rcConfig,
|
|
293
295
|
...credentials,
|
|
294
296
|
apiKey: envKey ?? storedKey,
|
|
295
|
-
endpoint: process.env.MUTAGENT_ENDPOINT ??
|
|
297
|
+
endpoint: process.env.MUTAGENT_ENDPOINT ?? storedEndpoint,
|
|
296
298
|
defaultWorkspace,
|
|
297
299
|
workspaceOrigin: envWorkspace !== "" ? "override" : selected ? "selection" : undefined,
|
|
298
300
|
workspaceName: envWorkspace === "" && fileSelection !== undefined && fileSelection === selected ? credentials?.workspaceName : undefined,
|
|
@@ -352,6 +354,8 @@ function clearCredentials() {
|
|
|
352
354
|
function hasCredentials() {
|
|
353
355
|
if (process.env.MUTAGENT_API_KEY)
|
|
354
356
|
return true;
|
|
357
|
+
if (inCloudSandbox())
|
|
358
|
+
return true;
|
|
355
359
|
if (!existsSync(CREDENTIALS_FILE))
|
|
356
360
|
return false;
|
|
357
361
|
const credentials = parseJsonSafe(readFileSync(CREDENTIALS_FILE, "utf-8"), credentialsSchema);
|
|
@@ -2084,4 +2088,4 @@ export {
|
|
|
2084
2088
|
version
|
|
2085
2089
|
};
|
|
2086
2090
|
|
|
2087
|
-
//# debugId=
|
|
2091
|
+
//# debugId=2497007B7285F9A164756E2164756E21
|
package/package.json
CHANGED