@mutagent/cli 0.2.141 → 0.2.143
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 +30 -7
- package/dist/index.js +6 -3
- package/package.json +2 -2
package/dist/bin/cli.js
CHANGED
|
@@ -455,9 +455,12 @@ function sandboxScopedFailure(failure, commandPath) {
|
|
|
455
455
|
return failure;
|
|
456
456
|
const command = commandPath === "" ? "This command" : `\`mutagent ${commandPath}\``;
|
|
457
457
|
const alternative = SANDBOX_ALTERNATIVES[commandPath.split(" ")[0] ?? ""];
|
|
458
|
-
return new MutagentError("SANDBOX_SCOPE", `${command} isn't available inside a cloud session: this session is signed in with its own session token, which covers
|
|
458
|
+
return new MutagentError("SANDBOX_SCOPE", `${command} isn't available inside a cloud session: this session is signed in with its own session token, which covers ${TOKEN_COVERS}.`, alternative === undefined ? IN_SESSION_COMMANDS : `Run: ${alternative}`);
|
|
459
459
|
}
|
|
460
|
-
|
|
460
|
+
function sandboxSignInRefusal() {
|
|
461
|
+
return new MutagentError("SANDBOX_SCOPE", `There is nothing to sign in to inside a cloud session: this session is signed in with its own session token, the only credential a sandbox uses, which covers ${TOKEN_COVERS}.`, IN_SESSION_COMMANDS);
|
|
462
|
+
}
|
|
463
|
+
var SANDBOX_TOKEN_VAR2 = "MUTAGENT_SANDBOX_TOKEN", SANDBOX_ALTERNATIVES, TOKEN_COVERS = "the Factory, traces, pushing, updating, listing and showing reports, and this session", IN_SESSION_COMMANDS = "Inside this session use the Factory and traces commands, or reports push, reports update, reports list or reports show (mutagent --help lists them).";
|
|
461
464
|
var init_sandbox_scope_error = __esm(() => {
|
|
462
465
|
init_config();
|
|
463
466
|
init_errors();
|
|
@@ -19043,6 +19046,9 @@ class BrowserAuthError extends Error {
|
|
|
19043
19046
|
}
|
|
19044
19047
|
}
|
|
19045
19048
|
|
|
19049
|
+
// src/lib/auth-flow.ts
|
|
19050
|
+
init_sandbox_scope_error();
|
|
19051
|
+
|
|
19046
19052
|
// src/lib/gateway-poll.ts
|
|
19047
19053
|
function sleep2(ms) {
|
|
19048
19054
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -19080,6 +19086,8 @@ async function pollUntil(fetchOnce, isDone, opts = {}) {
|
|
|
19080
19086
|
|
|
19081
19087
|
// src/lib/auth-flow.ts
|
|
19082
19088
|
async function performLoginAction(opts) {
|
|
19089
|
+
if (inSandboxSession())
|
|
19090
|
+
throw sandboxSignInRefusal();
|
|
19083
19091
|
const { isJson, output } = opts;
|
|
19084
19092
|
const wasFirstLogin = !hasCredentials();
|
|
19085
19093
|
const envApiKey = process.env.MUTAGENT_API_KEY;
|
|
@@ -31236,6 +31244,7 @@ init_output();
|
|
|
31236
31244
|
init_known_secrets();
|
|
31237
31245
|
import chalk41 from "chalk";
|
|
31238
31246
|
init_errors();
|
|
31247
|
+
init_sandbox_scope_error();
|
|
31239
31248
|
|
|
31240
31249
|
// src/lib/gateway-notices.ts
|
|
31241
31250
|
var FILED_AS_TRIAGE = "filed_as_triage";
|
|
@@ -31427,8 +31436,9 @@ function printHuman2(error) {
|
|
|
31427
31436
|
}
|
|
31428
31437
|
function handleGatewayError(error, isJson, provider, resource) {
|
|
31429
31438
|
const gwError = toGatewayCliError(error, provider, resource);
|
|
31430
|
-
|
|
31431
|
-
|
|
31439
|
+
const scoped = sandboxScopedFailure(gwError, runningCommandPath());
|
|
31440
|
+
if (isJson || scoped !== gwError)
|
|
31441
|
+
handleError(scoped, isJson);
|
|
31432
31442
|
printHuman2(gwError);
|
|
31433
31443
|
process.exit(gwError.exitCode);
|
|
31434
31444
|
}
|
|
@@ -33152,6 +33162,8 @@ function nextForRun(run) {
|
|
|
33152
33162
|
}
|
|
33153
33163
|
function printRunStatus(run) {
|
|
33154
33164
|
console.log(`${chalk49.bold(run.eventId)} ${run.phase}`);
|
|
33165
|
+
if (run.runId)
|
|
33166
|
+
console.log(chalk49.dim(` run: ${run.runId} (session and model: mutagent gateway runs show ${run.runId})`));
|
|
33155
33167
|
if (run.sandbox)
|
|
33156
33168
|
console.log(chalk49.dim(` sandbox: ${run.sandbox.kind} (${run.sandbox.environment})`));
|
|
33157
33169
|
if (run.startedAt)
|
|
@@ -33205,6 +33217,15 @@ function printRunSummary(r) {
|
|
|
33205
33217
|
console.log(` ${r.id} ${chalk49.dim(r.state)} ${r.origin.kind}${r.origin.id ? `:${r.origin.id}` : ""} ${r.repository?.name ?? ""}`);
|
|
33206
33218
|
printRunError(r.error, " ");
|
|
33207
33219
|
}
|
|
33220
|
+
function printRunDetail(r) {
|
|
33221
|
+
printRunSummary(r);
|
|
33222
|
+
if (typeof r.sessionRef === "string" && r.sessionRef !== "") {
|
|
33223
|
+
console.log(chalk49.dim(` session: ${r.sessionRef} (traces: mutagent traces get --session ${r.sessionRef})`));
|
|
33224
|
+
}
|
|
33225
|
+
if (r.model !== undefined) {
|
|
33226
|
+
console.log(chalk49.dim(` model: ${r.model ?? "platform default (not pinned; Helix chose its default)"}`));
|
|
33227
|
+
}
|
|
33228
|
+
}
|
|
33208
33229
|
function assertUntil(value) {
|
|
33209
33230
|
const v = value.trim();
|
|
33210
33231
|
if (v === "now" || /^[1-9][0-9]{0,3}[mhd]$/.test(v) || /^\d{4}-\d{2}-\d{2}/.test(v) && !Number.isNaN(Date.parse(v)))
|
|
@@ -33281,7 +33302,9 @@ AI Agent Directive:
|
|
|
33281
33302
|
--json returns { success, ok, data }. An event-id hit has 'phase'; a run-id hit has 'state'
|
|
33282
33303
|
— branch on whichever key is present. Once the event started a run, the event-id hit
|
|
33283
33304
|
also has runId (the primary run) and runIds (every run, primary first): the ids
|
|
33284
|
-
'runs logs' and 'runs cancel' take.
|
|
33305
|
+
'runs logs' and 'runs cancel' take. A run-id hit also has sessionRef (the hs1_ that
|
|
33306
|
+
'mutagent traces get --session' takes; null until the run starts) and model (null: not
|
|
33307
|
+
pinned by the platform, Helix chose its default). data.error.code filed_as_triage is not a failure:
|
|
33285
33308
|
read data.error.triageItem { id, link } (null when the server did not name them) and
|
|
33286
33309
|
run 'next' to show the item.
|
|
33287
33310
|
`).action(async (id) => {
|
|
@@ -33299,7 +33322,7 @@ AI Agent Directive:
|
|
|
33299
33322
|
const run = await asRunId(found.runId, (runId) => getRun(runId, workspaceId));
|
|
33300
33323
|
const display = withDisplayError(run);
|
|
33301
33324
|
printGatewayOk(isJson, display, { human: () => {
|
|
33302
|
-
|
|
33325
|
+
printRunDetail(display);
|
|
33303
33326
|
} });
|
|
33304
33327
|
return;
|
|
33305
33328
|
});
|
|
@@ -40641,4 +40664,4 @@ if (process.env.CLI_VERSION) {
|
|
|
40641
40664
|
}
|
|
40642
40665
|
runCli(process.argv.slice(2), cliVersion);
|
|
40643
40666
|
|
|
40644
|
-
//# debugId=
|
|
40667
|
+
//# debugId=2B91AA42173EBAAE64756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -454,9 +454,12 @@ function sandboxScopedFailure(failure, commandPath) {
|
|
|
454
454
|
return failure;
|
|
455
455
|
const command = commandPath === "" ? "This command" : `\`mutagent ${commandPath}\``;
|
|
456
456
|
const alternative = SANDBOX_ALTERNATIVES[commandPath.split(" ")[0] ?? ""];
|
|
457
|
-
return new MutagentError("SANDBOX_SCOPE", `${command} isn't available inside a cloud session: this session is signed in with its own session token, which covers
|
|
457
|
+
return new MutagentError("SANDBOX_SCOPE", `${command} isn't available inside a cloud session: this session is signed in with its own session token, which covers ${TOKEN_COVERS}.`, alternative === undefined ? IN_SESSION_COMMANDS : `Run: ${alternative}`);
|
|
458
458
|
}
|
|
459
|
-
|
|
459
|
+
function sandboxSignInRefusal() {
|
|
460
|
+
return new MutagentError("SANDBOX_SCOPE", `There is nothing to sign in to inside a cloud session: this session is signed in with its own session token, the only credential a sandbox uses, which covers ${TOKEN_COVERS}.`, IN_SESSION_COMMANDS);
|
|
461
|
+
}
|
|
462
|
+
var SANDBOX_TOKEN_VAR2 = "MUTAGENT_SANDBOX_TOKEN", SANDBOX_ALTERNATIVES, TOKEN_COVERS = "the Factory, traces, pushing, updating, listing and showing reports, and this session", IN_SESSION_COMMANDS = "Inside this session use the Factory and traces commands, or reports push, reports update, reports list or reports show (mutagent --help lists them).";
|
|
460
463
|
var init_sandbox_scope_error = __esm(() => {
|
|
461
464
|
init_config();
|
|
462
465
|
init_errors();
|
|
@@ -2088,4 +2091,4 @@ export {
|
|
|
2088
2091
|
version
|
|
2089
2092
|
};
|
|
2090
2093
|
|
|
2091
|
-
//# debugId=
|
|
2094
|
+
//# debugId=37053E84CDADCCC664756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutagent/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.143",
|
|
4
4
|
"description": "Bun-native CLI for the MutagenT AI platform - auth, provider config, and lifecycle-tool installer for AI-native workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"bugs": {
|
|
95
95
|
"url": "https://docs.mutagent.io/support"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "1209716461bf91e99c7bff99b9ccd1396f91b952"
|
|
98
98
|
}
|