@mutagent/cli 0.1.265 → 0.1.267
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 +184 -227
- package/dist/bin/cli.js.map +11 -11
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -886,7 +886,7 @@ var init_sdk_client = __esm(() => {
|
|
|
886
886
|
import { Command as Command14 } from "commander";
|
|
887
887
|
import chalk25 from "chalk";
|
|
888
888
|
import { readFileSync as readFileSync12 } from "fs";
|
|
889
|
-
import { join as
|
|
889
|
+
import { join as join14, dirname as dirname4 } from "path";
|
|
890
890
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
891
891
|
|
|
892
892
|
// src/commands/auth.ts
|
|
@@ -895,7 +895,7 @@ init_sdk_client();
|
|
|
895
895
|
import { Command } from "commander";
|
|
896
896
|
import chalk4 from "chalk";
|
|
897
897
|
import { existsSync as existsSync5 } from "fs";
|
|
898
|
-
import { join as
|
|
898
|
+
import { join as join6 } from "path";
|
|
899
899
|
|
|
900
900
|
// src/lib/output.ts
|
|
901
901
|
import chalk from "chalk";
|
|
@@ -1133,10 +1133,6 @@ function scaffoldRcConfig(cwd = process.cwd(), deps = {}) {
|
|
|
1133
1133
|
// src/lib/installer.ts
|
|
1134
1134
|
init_errors();
|
|
1135
1135
|
init_config();
|
|
1136
|
-
import { spawn as spawn2 } from "child_process";
|
|
1137
|
-
import { mkdirSync as mkdirSync3, readdirSync } from "fs";
|
|
1138
|
-
import { homedir as homedir3 } from "os";
|
|
1139
|
-
import { join as join6 } from "path";
|
|
1140
1136
|
|
|
1141
1137
|
// src/lib/installer-helix.ts
|
|
1142
1138
|
init_errors();
|
|
@@ -1363,61 +1359,15 @@ function safeRm(path) {
|
|
|
1363
1359
|
}
|
|
1364
1360
|
|
|
1365
1361
|
// src/lib/installer.ts
|
|
1366
|
-
var VALID_PACKAGES = ["helix"
|
|
1367
|
-
var
|
|
1368
|
-
var VERSION_MATRIX = {
|
|
1369
|
-
helix: "latest",
|
|
1370
|
-
diagnostics: "latest",
|
|
1371
|
-
evaluator: "latest"
|
|
1372
|
-
};
|
|
1373
|
-
var NPM_PACKAGES = {
|
|
1362
|
+
var VALID_PACKAGES = ["helix"];
|
|
1363
|
+
var RETIRED_PACKAGES = {
|
|
1374
1364
|
diagnostics: "@mutagent/diagnostics",
|
|
1375
1365
|
evaluator: "@mutagent/evaluator"
|
|
1376
1366
|
};
|
|
1377
|
-
var
|
|
1378
|
-
|
|
1379
|
-
|
|
1367
|
+
var VALID_HARNESSES = ["claude-code", "codex", "omp"];
|
|
1368
|
+
var VERSION_MATRIX = {
|
|
1369
|
+
helix: "latest"
|
|
1380
1370
|
};
|
|
1381
|
-
var defaultRunner = (cmd, args) => new Promise((resolve, reject) => {
|
|
1382
|
-
const child = spawn2(cmd, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
1383
|
-
let stdout = "";
|
|
1384
|
-
let stderr = "";
|
|
1385
|
-
child.stdout.on("data", (chunk) => {
|
|
1386
|
-
stdout += chunk.toString("utf-8");
|
|
1387
|
-
});
|
|
1388
|
-
child.stderr.on("data", (chunk) => {
|
|
1389
|
-
stderr += chunk.toString("utf-8");
|
|
1390
|
-
});
|
|
1391
|
-
child.on("error", (err) => {
|
|
1392
|
-
reject(new MutagentError("INSTALL_FAILED", `Failed to run ${cmd}: ${err.message}`, `Ensure "${cmd}" is installed and available on your PATH.`));
|
|
1393
|
-
});
|
|
1394
|
-
child.on("close", (code) => {
|
|
1395
|
-
resolve({ code: code ?? 1, stdout, stderr });
|
|
1396
|
-
});
|
|
1397
|
-
});
|
|
1398
|
-
function countProjectFiles(root) {
|
|
1399
|
-
const roots = [".claude", ".codex", ".agents"];
|
|
1400
|
-
let n = 0;
|
|
1401
|
-
const walk = (dir, depth) => {
|
|
1402
|
-
if (depth > 6)
|
|
1403
|
-
return;
|
|
1404
|
-
let entries;
|
|
1405
|
-
try {
|
|
1406
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
1407
|
-
} catch {
|
|
1408
|
-
return;
|
|
1409
|
-
}
|
|
1410
|
-
for (const e of entries) {
|
|
1411
|
-
if (e.isDirectory())
|
|
1412
|
-
walk(join6(dir, e.name), depth + 1);
|
|
1413
|
-
else
|
|
1414
|
-
n++;
|
|
1415
|
-
}
|
|
1416
|
-
};
|
|
1417
|
-
for (const r of roots)
|
|
1418
|
-
walk(join6(root, r), 0);
|
|
1419
|
-
return n;
|
|
1420
|
-
}
|
|
1421
1371
|
function isValidPackage(pkg) {
|
|
1422
1372
|
return VALID_PACKAGES.includes(pkg);
|
|
1423
1373
|
}
|
|
@@ -1425,6 +1375,10 @@ function isValidHarness(harness) {
|
|
|
1425
1375
|
return VALID_HARNESSES.includes(harness);
|
|
1426
1376
|
}
|
|
1427
1377
|
async function installPackage(pkg, opts, deps = {}) {
|
|
1378
|
+
const retiredNpmName = RETIRED_PACKAGES[pkg];
|
|
1379
|
+
if (retiredNpmName !== undefined) {
|
|
1380
|
+
throw new MutagentError("INVALID_ARGUMENTS", `"${pkg}" is no longer an install target — ${retiredNpmName} is no longer published.`, `The ${pkg} skill now ships inside helix. Run: mutagent install helix`);
|
|
1381
|
+
}
|
|
1428
1382
|
const isAuthed = deps.isAuthed ?? hasCredentials;
|
|
1429
1383
|
if (!isAuthed()) {
|
|
1430
1384
|
throw new MutagentError("AUTH_REQUIRED", `Authentication required to install ${pkg}.`, "Run: mutagent login");
|
|
@@ -1446,44 +1400,24 @@ async function installPackage(pkg, opts, deps = {}) {
|
|
|
1446
1400
|
throw new MutagentError("INVALID_ARGUMENTS", `Unknown harness "${opts.harness}". Valid: ${VALID_HARNESSES.join(", ")}`, "Run: mutagent install --help");
|
|
1447
1401
|
}
|
|
1448
1402
|
const version = opts.version ?? VERSION_MATRIX[pkg];
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
const detail = result.stderr.trim();
|
|
1468
|
-
throw new MutagentError("INSTALL_FAILED", `npm failed to install ${npmPackage}@${version} (exit ${String(result.code)}).${detail ? ` ${detail.slice(0, 200)}` : ""}`, `Verify the package and version exist, and that ${installRoot} is writable.`);
|
|
1469
|
-
}
|
|
1470
|
-
const pkgDir = join6(installRoot, "node_modules", npmPackage);
|
|
1471
|
-
const initBin = await (deps.locateInitBin ?? defaultLocateInitBin)(pkgDir);
|
|
1472
|
-
const countFiles = deps.countProjectFiles ?? countProjectFiles;
|
|
1473
|
-
const before = countFiles(projectPath);
|
|
1474
|
-
const initCode = await (deps.runInit ?? defaultRunInit)(initBin, ["init", "--yes"], projectPath);
|
|
1475
|
-
const landed = countFiles(projectPath) > before;
|
|
1476
|
-
return finish({
|
|
1477
|
-
package: pkg,
|
|
1478
|
-
version,
|
|
1479
|
-
harness: opts.harness,
|
|
1480
|
-
scope: "project",
|
|
1481
|
-
projectPath,
|
|
1482
|
-
installRoot,
|
|
1483
|
-
skillInstalled: initCode === 0 && landed,
|
|
1484
|
-
...initCode === 0 && landed ? {} : { nextStep: `${INIT_BINS[pkg]} init` },
|
|
1485
|
-
command: `npm ${args.join(" ")}`
|
|
1486
|
-
}, deps);
|
|
1403
|
+
switch (pkg) {
|
|
1404
|
+
case "helix": {
|
|
1405
|
+
const { version: resolved } = await installHelix({ harness: opts.harness, version }, deps.helix ?? {});
|
|
1406
|
+
return finish({
|
|
1407
|
+
package: pkg,
|
|
1408
|
+
version: resolved,
|
|
1409
|
+
harness: opts.harness,
|
|
1410
|
+
scope: "project",
|
|
1411
|
+
projectPath,
|
|
1412
|
+
skillInstalled: true
|
|
1413
|
+
}, deps);
|
|
1414
|
+
}
|
|
1415
|
+
default:
|
|
1416
|
+
return assertNoInstallPath(pkg);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
function assertNoInstallPath(pkg) {
|
|
1420
|
+
throw new MutagentError("INVALID_ARGUMENTS", `No install path is implemented for "${String(pkg)}".`, "Run: mutagent install --help");
|
|
1487
1421
|
}
|
|
1488
1422
|
async function finish(result, deps) {
|
|
1489
1423
|
await reportInstall({ pkg: result.package, version: result.version, harness: result.harness }, deps.telemetry ?? {});
|
|
@@ -1981,7 +1915,7 @@ Examples:
|
|
|
1981
1915
|
}
|
|
1982
1916
|
const isValid = await validateApiKey(apiKey, endpoint);
|
|
1983
1917
|
const cwd = process.cwd();
|
|
1984
|
-
const hasOnboarding = existsSync5(
|
|
1918
|
+
const hasOnboarding = existsSync5(join6(cwd, ".mutagentrc.json"));
|
|
1985
1919
|
if (isJson) {
|
|
1986
1920
|
const statusResult = {
|
|
1987
1921
|
authenticated: isValid,
|
|
@@ -3370,14 +3304,14 @@ init_config();
|
|
|
3370
3304
|
import { Command as Command7 } from "commander";
|
|
3371
3305
|
import chalk13 from "chalk";
|
|
3372
3306
|
import { readFileSync as readFileSync5 } from "fs";
|
|
3373
|
-
import { join as
|
|
3307
|
+
import { join as join8 } from "path";
|
|
3374
3308
|
init_errors();
|
|
3375
3309
|
|
|
3376
3310
|
// src/commands/skills.ts
|
|
3377
3311
|
import { Command as Command6 } from "commander";
|
|
3378
3312
|
import chalk12 from "chalk";
|
|
3379
|
-
import { existsSync as existsSync6, mkdirSync as
|
|
3380
|
-
import { dirname, join as
|
|
3313
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
3314
|
+
import { dirname, join as join7 } from "path";
|
|
3381
3315
|
import { execSync } from "child_process";
|
|
3382
3316
|
|
|
3383
3317
|
// src/generated/skill-content.ts
|
|
@@ -3387,7 +3321,7 @@ name: mutagent-cli
|
|
|
3387
3321
|
description: |
|
|
3388
3322
|
Mutagent CLI - the command-line client for the Mutagent platform.
|
|
3389
3323
|
Guides coding agents through setup (login, init, providers, workspaces),
|
|
3390
|
-
installing Mutagent packages (helix
|
|
3324
|
+
installing Mutagent packages (helix), and sending
|
|
3391
3325
|
product feedback.
|
|
3392
3326
|
Triggers: "mutagent", "mutagent cli", "mutagent login", "set up mutagent",
|
|
3393
3327
|
"install diagnostics", "install evaluator", "install helix", "mutagent install",
|
|
@@ -3520,7 +3454,7 @@ skill never inlines flags. The active surface:
|
|
|
3520
3454
|
| \`usage\` | Show usage + quota | [workflows/setup.md](./workflows/setup.md) |
|
|
3521
3455
|
| \`skills install\` | Install this skill into a project | [workflows/setup.md](./workflows/setup.md) |
|
|
3522
3456
|
| \`hooks install\` | Install Claude Code telemetry hooks | [workflows/setup.md](./workflows/setup.md) |
|
|
3523
|
-
| \`install <pkg>\` | Install helix
|
|
3457
|
+
| \`install <pkg>\` | Install helix (diagnostics / evaluator are retired) | [workflows/install.md](./workflows/install.md) |
|
|
3524
3458
|
| \`feedback send\` | Send product feedback | [workflows/feedback.md](./workflows/feedback.md) |
|
|
3525
3459
|
|
|
3526
3460
|
---
|
|
@@ -3542,7 +3476,7 @@ Match the user's first request. Load ONLY the matching subfile per the table. Do
|
|
|
3542
3476
|
| User said / signal detected | Load subfile | Why |
|
|
3543
3477
|
|---|---|---|
|
|
3544
3478
|
| "log in", "authenticate", "set up mutagent", "init", "which workspace", "what models", "usage", "quota", "install the skill", "install hooks" | [workflows/setup.md](./workflows/setup.md) | Auth + project setup + discovery commands |
|
|
3545
|
-
| "install helix", "install diagnostics", "install evaluator", "add mutagent package" | [workflows/install.md](./workflows/install.md) | Login-gated meta-installer |
|
|
3479
|
+
| "install helix", "install diagnostics", "install evaluator", "add mutagent package" | [workflows/install.md](./workflows/install.md) | Login-gated meta-installer (diagnostics/evaluator are retired → helix) |
|
|
3546
3480
|
| "send feedback", "report a bug", "file feedback", "the CLI crashed" | [workflows/feedback.md](./workflows/feedback.md) | Product feedback (+ optional transcript) |
|
|
3547
3481
|
| Unclear / first time | run \`mutagent --help --json\` then reroute | Discover the surface before acting |
|
|
3548
3482
|
|
|
@@ -3553,7 +3487,7 @@ Match the user's first request. Load ONLY the matching subfile per the table. Do
|
|
|
3553
3487
|
| File | WHEN to load | WHY |
|
|
3554
3488
|
|---|---|---|
|
|
3555
3489
|
| [workflows/setup.md](./workflows/setup.md) | User is onboarding: login, init, config, workspaces, providers, usage, skill/hooks install | Auth + configuration + discovery |
|
|
3556
|
-
| [workflows/install.md](./workflows/install.md) | User wants to install a Mutagent package | \`install
|
|
3490
|
+
| [workflows/install.md](./workflows/install.md) | User wants to install a Mutagent package | \`install helix\` meta-command |
|
|
3557
3491
|
| [workflows/feedback.md](./workflows/feedback.md) | User wants to send feedback or report a bug | \`feedback send\` + \`--attach-transcript\` |
|
|
3558
3492
|
|
|
3559
3493
|
---
|
|
@@ -3775,33 +3709,33 @@ how they learn something sensitive was in the file at all.
|
|
|
3775
3709
|
"workflows/install.md": `---
|
|
3776
3710
|
name: mutagent-cli-workflows-install
|
|
3777
3711
|
description: |
|
|
3778
|
-
Meta-installer workflow. Installs
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3712
|
+
Meta-installer workflow. Installs helix into the user's environment via
|
|
3713
|
+
\`mutagent install helix\`. Login-gated. helix is fetched from a private
|
|
3714
|
+
registry via a login-brokered signed URL (no static secret ships in the CLI).
|
|
3715
|
+
\`diagnostics\` and \`evaluator\` are RETIRED as install targets — both skills
|
|
3716
|
+
now ship inside helix.
|
|
3782
3717
|
triggers:
|
|
3783
|
-
- "install diagnostics"
|
|
3784
|
-
- "install evaluator"
|
|
3785
3718
|
- "install helix"
|
|
3786
3719
|
- "mutagent install"
|
|
3787
3720
|
- "add mutagent package"
|
|
3721
|
+
- "install diagnostics"
|
|
3722
|
+
- "install evaluator"
|
|
3788
3723
|
- "set up diagnostics"
|
|
3789
3724
|
- "set up evaluator"
|
|
3790
3725
|
---
|
|
3791
3726
|
|
|
3792
3727
|
# Workflow — Install (Meta-Installer)
|
|
3793
3728
|
|
|
3794
|
-
>
|
|
3795
|
-
>
|
|
3796
|
-
> - \`diagnostics\` / \`evaluator\` → **npm installs the package GLOBALLY**
|
|
3797
|
-
> (\`scope: "global"\`, literally \`npm install -g\`). It does NOT go in the
|
|
3798
|
-
> user's project. Its skill init is the part you later run in the project.
|
|
3729
|
+
> **\`helix\` is the only install target.** It installs into the CURRENT project
|
|
3730
|
+
> directory (\`scope: "project"\`).
|
|
3799
3731
|
>
|
|
3800
|
-
>
|
|
3732
|
+
> \`diagnostics\` and \`evaluator\` are **retired** — their npm packages are no
|
|
3733
|
+
> longer published. Both skills ship *inside* the helix payload, so a user
|
|
3734
|
+
> asking for either one needs \`mutagent install helix\`. The CLI says so itself:
|
|
3735
|
+
> \`mutagent install diagnostics\` fails with \`INVALID_ARGUMENTS\` and names helix
|
|
3736
|
+
> as the route. Do not work around that error — follow it.
|
|
3801
3737
|
>
|
|
3802
|
-
>
|
|
3803
|
-
> and \`evaluator\` it means the npm package landed; the skill still needs the
|
|
3804
|
-
> package's own init. Branch on \`skillInstalled\` — see *Output handling* below.
|
|
3738
|
+
> This WRITES to the user's machine — confirm before running (Core Rule 5).
|
|
3805
3739
|
|
|
3806
3740
|
Read the **Core Rules** in [SKILL.md](../SKILL.md) first. Key reminders:
|
|
3807
3741
|
- \`--json\` on every command
|
|
@@ -3816,23 +3750,28 @@ Read the **Core Rules** in [SKILL.md](../SKILL.md) first. Key reminders:
|
|
|
3816
3750
|
\`\`\`bash
|
|
3817
3751
|
mutagent install --help # authoritative flags — read before first use
|
|
3818
3752
|
|
|
3819
|
-
mutagent install
|
|
3820
|
-
|
|
3753
|
+
mutagent install helix [--harness <claude-code|codex|omp>] \\
|
|
3754
|
+
[--version <v>] [--json]
|
|
3821
3755
|
\`\`\`
|
|
3822
3756
|
|
|
3823
|
-
Where \`<package>\` is
|
|
3757
|
+
Where \`<package>\` is:
|
|
3824
3758
|
|
|
3825
3759
|
| Package | Source | Notes |
|
|
3826
3760
|
|---|---|---|
|
|
3827
|
-
| \`
|
|
3828
|
-
|
|
3829
|
-
|
|
3761
|
+
| \`helix\` | private registry via login-brokered signed URL | Ready to install — login-gated download, sha256-verified, then initialized into your project. Carries the diagnostics + evaluator skills and the \`mutagent-cli\` binary. |
|
|
3762
|
+
|
|
3763
|
+
Retired — these are rejected by name, they do not fall through to a generic error:
|
|
3764
|
+
|
|
3765
|
+
| Retired target | Was | Use instead |
|
|
3766
|
+
|---|---|---|
|
|
3767
|
+
| \`diagnostics\` | public npm \`@mutagent/diagnostics\` | \`mutagent install helix\` |
|
|
3768
|
+
| \`evaluator\` | public npm \`@mutagent/evaluator\` | \`mutagent install helix\` |
|
|
3830
3769
|
|
|
3831
3770
|
**Flags** (verify against \`--help\`):
|
|
3832
|
-
- \`--harness <claude-code|codex|omp>\` -- target coding-agent harness (default \`claude-code\`).
|
|
3833
|
-
- Install scope is FIXED PER PACKAGE and is not selectable: \`helix\` installs into the current directory; \`diagnostics\`/\`evaluator\` are installed GLOBALLY by npm. \`--global\` is retired: passing it fails and explains both paths.
|
|
3771
|
+
- \`--harness <claude-code|codex|omp>\` -- target coding-agent harness (default \`claude-code\`). helix installs every harness itself, so this does not change what lands.
|
|
3834
3772
|
- \`--version <v>\` -- pin a specific version (default: latest).
|
|
3835
3773
|
- \`--json\` -- structured output (Rule 1).
|
|
3774
|
+
- Install scope is NOT selectable: helix installs into the current directory. \`--global\` is retired — passing it fails and explains what happens instead.
|
|
3836
3775
|
|
|
3837
3776
|
---
|
|
3838
3777
|
|
|
@@ -3847,23 +3786,17 @@ Where \`<package>\` is one of:
|
|
|
3847
3786
|
→ read the current packages + flags (Rule 2)
|
|
3848
3787
|
|
|
3849
3788
|
3. Confirm with the user WHAT will be installed and WHERE
|
|
3850
|
-
→
|
|
3851
|
-
helix: "I'll install helix into <current directory>. Proceed?"
|
|
3852
|
-
diagnostics: "I'll install @mutagent/diagnostics GLOBALLY via npm, then
|
|
3853
|
-
you'll run its init inside your project. Proceed?"
|
|
3789
|
+
→ "I'll install helix into <current directory>. Proceed?"
|
|
3854
3790
|
|
|
3855
|
-
4. mutagent install
|
|
3791
|
+
4. mutagent install helix [--harness <h>] [--version <v>] --json
|
|
3856
3792
|
→ run the install
|
|
3857
|
-
→ show the
|
|
3858
|
-
\`scope\`. Surface \`projectPath\` ONLY when \`scope\` is \`"project"\` — it is
|
|
3859
|
-
ABSENT from the response on the global npm path.
|
|
3793
|
+
→ show the output: package, version, harness, scope, and projectPath
|
|
3860
3794
|
|
|
3861
3795
|
5. CHECK \`skillInstalled\` in the JSON response — do NOT stop at \`success: true\`
|
|
3862
3796
|
→ skillInstalled === true → done; the skill is installed and usable
|
|
3863
|
-
→ skillInstalled === false → NOT done.
|
|
3864
|
-
|
|
3865
|
-
(
|
|
3866
|
-
Confirm before running it — it writes to their project (Core Rule 5).
|
|
3797
|
+
→ skillInstalled === false → NOT done. Say so plainly and surface \`nextStep\`
|
|
3798
|
+
as the command to run next. Confirm before running it — it writes to
|
|
3799
|
+
their project (Core Rule 5).
|
|
3867
3800
|
\`\`\`
|
|
3868
3801
|
|
|
3869
3802
|
---
|
|
@@ -3873,9 +3806,7 @@ Where \`<package>\` is one of:
|
|
|
3873
3806
|
\`\`\`bash
|
|
3874
3807
|
mutagent install helix --json
|
|
3875
3808
|
mutagent install helix --harness codex --json
|
|
3876
|
-
mutagent install
|
|
3877
|
-
mutagent install evaluator --version 1.2.3 --json
|
|
3878
|
-
mutagent install diagnostics --harness codex --json
|
|
3809
|
+
mutagent install helix --version 1.2.3 --json
|
|
3879
3810
|
\`\`\`
|
|
3880
3811
|
|
|
3881
3812
|
---
|
|
@@ -3887,39 +3818,33 @@ Success shape:
|
|
|
3887
3818
|
\`\`\`json
|
|
3888
3819
|
{
|
|
3889
3820
|
"success": true,
|
|
3890
|
-
"package": "
|
|
3891
|
-
"version": "1.
|
|
3821
|
+
"package": "helix",
|
|
3822
|
+
"version": "0.1.0-alpha.25",
|
|
3892
3823
|
"harness": "claude-code",
|
|
3893
|
-
"scope": "
|
|
3894
|
-
"
|
|
3895
|
-
"
|
|
3824
|
+
"scope": "project",
|
|
3825
|
+
"projectPath": "/path/to/the/users/project",
|
|
3826
|
+
"skillInstalled": true,
|
|
3896
3827
|
"_links": { "install": "...", "login": "..." }
|
|
3897
3828
|
}
|
|
3898
3829
|
\`\`\`
|
|
3899
3830
|
|
|
3900
|
-
\`helix\` instead returns \`"scope": "project"\` with \`"projectPath"\`, and
|
|
3901
|
-
\`"skillInstalled": true\`.
|
|
3902
|
-
|
|
3903
3831
|
- **\`skillInstalled\` is the field to branch on — NOT \`success\`.** \`success: true\`
|
|
3904
3832
|
reports that the install step did its job, not that the user is ready.
|
|
3905
|
-
\`nextStep\` is present only when work remains
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
- **\`scope\` tells you WHERE it went. Read it; do not assume.**
|
|
3915
|
-
- \`"global"\` (\`diagnostics\`, \`evaluator\`) — npm installed the package into its
|
|
3916
|
-
GLOBAL root (\`npm install -g\`). The package is **not** in the user's project;
|
|
3917
|
-
never tell the user it is. No path is reported — run \`npm root -g\` if the
|
|
3918
|
-
user needs the directory.
|
|
3919
|
-
- \`"project"\` (\`helix\`) — installed into \`projectPath\`. Surface it so the user
|
|
3920
|
-
can confirm the location.
|
|
3833
|
+
\`nextStep\` is present only when work remains; on a completed helix install it
|
|
3834
|
+
is absent.
|
|
3835
|
+
- \`skillInstalled: true\`: the CLI resolved a signed download URL from the login
|
|
3836
|
+
broker, downloaded + sha256-verified the plugin, and ran its init into the
|
|
3837
|
+
project. Nothing further is needed. An \`INTEGRITY_ERROR\` means the download
|
|
3838
|
+
failed checksum verification — retry.
|
|
3839
|
+
- **\`scope\` tells you WHERE it went. Read it; do not assume.** It is \`"project"\`,
|
|
3840
|
+
and \`projectPath\` is the directory. Surface it so the user can confirm the
|
|
3841
|
+
location.
|
|
3921
3842
|
- On an auth error (including a broker \`AUTH_REQUIRED\`): route to the login
|
|
3922
3843
|
workflow, then retry.
|
|
3844
|
+
- On \`INVALID_ARGUMENTS\` naming a retired target (\`diagnostics\`, \`evaluator\`):
|
|
3845
|
+
the package is gone from npm and the skill ships inside helix. Tell the user
|
|
3846
|
+
that, then offer \`mutagent install helix\`. Do NOT suggest \`npm install
|
|
3847
|
+
@mutagent/diagnostics\` as a fallback — it will 404.
|
|
3923
3848
|
- On \`INVALID_ARGUMENTS\` naming \`--global\`: the flag is retired. Re-run without
|
|
3924
3849
|
it, or \`cd\` to the intended project first — the error names the path that
|
|
3925
3850
|
would have been used.
|
|
@@ -3928,16 +3853,17 @@ Success shape:
|
|
|
3928
3853
|
|
|
3929
3854
|
## Common pitfalls
|
|
3930
3855
|
|
|
3931
|
-
- **
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
- **
|
|
3935
|
-
|
|
3936
|
-
|
|
3856
|
+
- **Telling the user to \`npm install @mutagent/diagnostics\` or
|
|
3857
|
+
\`@mutagent/evaluator\`.** Both are unpublished; the install 404s. The skills
|
|
3858
|
+
are inside helix.
|
|
3859
|
+
- **Treating a retired-target error as a typo.** \`mutagent install diagnostics\`
|
|
3860
|
+
is a command that used to work. The user is not confused about spelling —
|
|
3861
|
+
they want diagnostics. Route them to helix, which has it.
|
|
3862
|
+
- **Treating \`success: true\` as "the user is ready".** Check \`skillInstalled\`.
|
|
3937
3863
|
- Running before login → auth error (install is login-gated).
|
|
3938
3864
|
- Assuming \`helix\` installs from public npm — it is fetched from a private registry via a login-brokered signed URL (the CLI holds no static secret).
|
|
3939
3865
|
- Installing without confirming with the user first (Core Rule 5).
|
|
3940
|
-
- Passing \`--global\` — retired; scope is
|
|
3866
|
+
- Passing \`--global\` — retired; scope is not selectable.
|
|
3941
3867
|
|
|
3942
3868
|
---
|
|
3943
3869
|
|
|
@@ -4121,7 +4047,7 @@ function getSkillFiles() {
|
|
|
4121
4047
|
}
|
|
4122
4048
|
function installCliSkill(targetRoot) {
|
|
4123
4049
|
const files = getSkillFiles();
|
|
4124
|
-
const skillDir =
|
|
4050
|
+
const skillDir = join7(targetRoot, SKILL_DIR);
|
|
4125
4051
|
const writtenFiles = [];
|
|
4126
4052
|
let totalBytes = 0;
|
|
4127
4053
|
const sortedKeys = Object.keys(files).sort((a, b) => {
|
|
@@ -4132,10 +4058,10 @@ function installCliSkill(targetRoot) {
|
|
|
4132
4058
|
return a.localeCompare(b);
|
|
4133
4059
|
});
|
|
4134
4060
|
for (const relPath of sortedKeys) {
|
|
4135
|
-
const destPath =
|
|
4061
|
+
const destPath = join7(skillDir, relPath);
|
|
4136
4062
|
const parentDir = dirname(destPath);
|
|
4137
4063
|
if (!existsSync6(parentDir)) {
|
|
4138
|
-
|
|
4064
|
+
mkdirSync3(parentDir, { recursive: true });
|
|
4139
4065
|
}
|
|
4140
4066
|
const raw = files[relPath] ?? "";
|
|
4141
4067
|
const finalContent = raw.endsWith(`
|
|
@@ -4226,7 +4152,7 @@ What it does:
|
|
|
4226
4152
|
let rcConfig;
|
|
4227
4153
|
if (rcExists) {
|
|
4228
4154
|
try {
|
|
4229
|
-
rcConfig = JSON.parse(readFileSync5(
|
|
4155
|
+
rcConfig = JSON.parse(readFileSync5(join8(cwd, ".mutagentrc.json"), "utf-8"));
|
|
4230
4156
|
} catch {
|
|
4231
4157
|
rcConfig = {};
|
|
4232
4158
|
}
|
|
@@ -4298,8 +4224,6 @@ What it does:
|
|
|
4298
4224
|
console.log("");
|
|
4299
4225
|
console.log(chalk13.bold(` What's next:`));
|
|
4300
4226
|
console.log(` ${chalk13.cyan("mutagent install helix".padEnd(30))}${chalk13.dim("# the ADL lifecycle conductor")}`);
|
|
4301
|
-
console.log(` ${chalk13.cyan("mutagent install diagnostics".padEnd(30))}${chalk13.dim("# trace diagnosis (optional)")}`);
|
|
4302
|
-
console.log(` ${chalk13.cyan("mutagent install evaluator".padEnd(30))}${chalk13.dim("# eval mining + judging (optional)")}`);
|
|
4303
4227
|
console.log("");
|
|
4304
4228
|
console.log(chalk13.dim(" Your coding agent now knows these workflows — restart it to pick up"));
|
|
4305
4229
|
console.log(chalk13.dim(' the skill, then just say "set up Mutagent on this project".'));
|
|
@@ -4522,10 +4446,10 @@ import { randomUUID } from "crypto";
|
|
|
4522
4446
|
|
|
4523
4447
|
// src/commands/hooks/state.ts
|
|
4524
4448
|
import { readFileSync as readFileSync6, writeFileSync as writeFileSync5, renameSync as renameSync2, unlinkSync, existsSync as existsSync7 } from "fs";
|
|
4525
|
-
import { join as
|
|
4449
|
+
import { join as join9 } from "path";
|
|
4526
4450
|
import { tmpdir } from "os";
|
|
4527
4451
|
function stateFilePath(sessionId) {
|
|
4528
|
-
return
|
|
4452
|
+
return join9(tmpdir(), `mutagent-hook-${sessionId}.json`);
|
|
4529
4453
|
}
|
|
4530
4454
|
function readState(sessionId) {
|
|
4531
4455
|
const path = stateFilePath(sessionId);
|
|
@@ -5156,8 +5080,8 @@ async function handlePostToolUseFailure() {
|
|
|
5156
5080
|
}
|
|
5157
5081
|
|
|
5158
5082
|
// src/commands/hooks/install.ts
|
|
5159
|
-
import { readFileSync as readFileSync7, writeFileSync as writeFileSync6, existsSync as existsSync8, mkdirSync as
|
|
5160
|
-
import { join as
|
|
5083
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync6, existsSync as existsSync8, mkdirSync as mkdirSync4 } from "fs";
|
|
5084
|
+
import { join as join10 } from "path";
|
|
5161
5085
|
|
|
5162
5086
|
class SettingsParseError extends Error {
|
|
5163
5087
|
settingsPath;
|
|
@@ -5219,8 +5143,8 @@ function migrateV1Hooks(settings) {
|
|
|
5219
5143
|
return migrated;
|
|
5220
5144
|
}
|
|
5221
5145
|
function installHooks(cwd) {
|
|
5222
|
-
const claudeDir =
|
|
5223
|
-
const settingsPath =
|
|
5146
|
+
const claudeDir = join10(cwd, ".claude");
|
|
5147
|
+
const settingsPath = join10(claudeDir, "settings.local.json");
|
|
5224
5148
|
const existed = existsSync8(settingsPath);
|
|
5225
5149
|
let settings = {};
|
|
5226
5150
|
if (existed) {
|
|
@@ -5260,7 +5184,7 @@ function installHooks(cwd) {
|
|
|
5260
5184
|
let userWarning;
|
|
5261
5185
|
if (added.length > 0 || migrated.length > 0) {
|
|
5262
5186
|
if (!existsSync8(claudeDir)) {
|
|
5263
|
-
|
|
5187
|
+
mkdirSync4(claudeDir, { recursive: true });
|
|
5264
5188
|
}
|
|
5265
5189
|
writeFileSync6(settingsPath, JSON.stringify(settings, null, 2) + `
|
|
5266
5190
|
`, "utf-8");
|
|
@@ -5319,10 +5243,23 @@ Examples:
|
|
|
5319
5243
|
AI Agent Directive: use --dry-run first; it reports span counts and any
|
|
5320
5244
|
unparseable lines without sending anything.
|
|
5321
5245
|
`).action(async (files, opts) => {
|
|
5246
|
+
const isJson = getJsonFlag(hooks);
|
|
5247
|
+
const report = [];
|
|
5248
|
+
const say = (msg) => {
|
|
5249
|
+
if (!isJson)
|
|
5250
|
+
process.stderr.write(msg);
|
|
5251
|
+
};
|
|
5322
5252
|
const maxSpans = Number.parseInt(opts.maxSpans ?? "200", 10);
|
|
5323
5253
|
if (!Number.isFinite(maxSpans) || maxSpans < 1) {
|
|
5324
|
-
|
|
5254
|
+
if (isJson) {
|
|
5255
|
+
new OutputFormatter("json").output({
|
|
5256
|
+
error: "InvalidOption",
|
|
5257
|
+
message: "--max-spans must be a positive integer"
|
|
5258
|
+
});
|
|
5259
|
+
} else {
|
|
5260
|
+
process.stderr.write(`[mutagent hooks] --max-spans must be a positive integer
|
|
5325
5261
|
`);
|
|
5262
|
+
}
|
|
5326
5263
|
process.exitCode = 2;
|
|
5327
5264
|
return;
|
|
5328
5265
|
}
|
|
@@ -5332,7 +5269,9 @@ unparseable lines without sending anything.
|
|
|
5332
5269
|
try {
|
|
5333
5270
|
raw = readFileSync8(file, "utf8");
|
|
5334
5271
|
} catch (err) {
|
|
5335
|
-
|
|
5272
|
+
const why = err instanceof Error ? err.message : String(err);
|
|
5273
|
+
report.push({ file: basename(file), skipped: why });
|
|
5274
|
+
say(`[mutagent hooks] skipped ${file}: ${why}
|
|
5336
5275
|
`);
|
|
5337
5276
|
continue;
|
|
5338
5277
|
}
|
|
@@ -5343,28 +5282,50 @@ unparseable lines without sending anything.
|
|
|
5343
5282
|
skipped
|
|
5344
5283
|
});
|
|
5345
5284
|
if (trace === null) {
|
|
5346
|
-
|
|
5285
|
+
report.push({ file: basename(file), skipped: "no session record" });
|
|
5286
|
+
say(`[mutagent hooks] ${basename(file)}: no session record, skipped
|
|
5347
5287
|
`);
|
|
5348
5288
|
continue;
|
|
5349
5289
|
}
|
|
5350
|
-
|
|
5290
|
+
report.push({
|
|
5291
|
+
file: basename(file),
|
|
5292
|
+
traceId: trace.traceId,
|
|
5293
|
+
...trace.sessionId !== undefined ? { sessionId: trace.sessionId } : {},
|
|
5294
|
+
spans: trace.spans.length,
|
|
5295
|
+
unparseableLines: skipped,
|
|
5296
|
+
recordsIgnored: ignored
|
|
5297
|
+
});
|
|
5298
|
+
say(`[mutagent hooks] ${basename(file)}: ${String(trace.spans.length)} spans` + `${skipped > 0 ? `, ${String(skipped)} unparseable lines` : ""}` + `${ignored > 0 ? `, ${String(ignored)} records ignored` : ""}
|
|
5351
5299
|
`);
|
|
5352
5300
|
batch.push(trace);
|
|
5353
5301
|
}
|
|
5302
|
+
const emit = (imported, dryRun) => {
|
|
5303
|
+
if (!isJson)
|
|
5304
|
+
return;
|
|
5305
|
+
new OutputFormatter("json").output({
|
|
5306
|
+
imported,
|
|
5307
|
+
dryRun,
|
|
5308
|
+
sessions: report,
|
|
5309
|
+
count: report.length
|
|
5310
|
+
});
|
|
5311
|
+
};
|
|
5354
5312
|
if (batch.length === 0) {
|
|
5355
|
-
|
|
5313
|
+
say(`[mutagent hooks] nothing to import
|
|
5356
5314
|
`);
|
|
5315
|
+
emit(0, opts.dryRun === true);
|
|
5357
5316
|
process.exitCode = 1;
|
|
5358
5317
|
return;
|
|
5359
5318
|
}
|
|
5360
5319
|
if (opts.dryRun === true) {
|
|
5361
|
-
|
|
5320
|
+
say(`[mutagent hooks] --dry-run: ${String(batch.length)} trace(s) not sent
|
|
5362
5321
|
`);
|
|
5322
|
+
emit(0, true);
|
|
5363
5323
|
return;
|
|
5364
5324
|
}
|
|
5365
5325
|
await sendBatchTrace(batch);
|
|
5366
|
-
|
|
5326
|
+
say(`[mutagent hooks] imported ${String(batch.length)} session(s)
|
|
5367
5327
|
`);
|
|
5328
|
+
emit(batch.length, false);
|
|
5368
5329
|
});
|
|
5369
5330
|
hooks.command("install").description("Install Mutagent hooks into .claude/settings.local.json (safe merge — never overwrites existing hooks)").option("--cwd <dir>", "Target directory (defaults to cwd)", process.cwd()).addHelpText("after", `
|
|
5370
5331
|
Reads existing .claude/settings.local.json (if present) and deep-merges
|
|
@@ -5472,7 +5433,7 @@ import { Command as Command10 } from "commander";
|
|
|
5472
5433
|
import chalk17 from "chalk";
|
|
5473
5434
|
import { type as osType, release as osRelease } from "os";
|
|
5474
5435
|
import { readFileSync as readFileSync10 } from "fs";
|
|
5475
|
-
import { join as
|
|
5436
|
+
import { join as join12, dirname as dirname2 } from "path";
|
|
5476
5437
|
import { fileURLToPath } from "url";
|
|
5477
5438
|
init_errors();
|
|
5478
5439
|
init_config();
|
|
@@ -5480,12 +5441,12 @@ init_config();
|
|
|
5480
5441
|
// src/lib/transcript.ts
|
|
5481
5442
|
init_errors();
|
|
5482
5443
|
import { homedir as osHomedir } from "os";
|
|
5483
|
-
import { join as
|
|
5444
|
+
import { join as join11 } from "path";
|
|
5484
5445
|
import {
|
|
5485
5446
|
existsSync as fsExistsSync,
|
|
5486
5447
|
statSync as fsStatSync,
|
|
5487
5448
|
readFileSync as readFileSync9,
|
|
5488
|
-
readdirSync
|
|
5449
|
+
readdirSync,
|
|
5489
5450
|
openSync,
|
|
5490
5451
|
readSync,
|
|
5491
5452
|
closeSync
|
|
@@ -5513,12 +5474,12 @@ function defaultScan(dir) {
|
|
|
5513
5474
|
const walk = (current) => {
|
|
5514
5475
|
let entries;
|
|
5515
5476
|
try {
|
|
5516
|
-
entries =
|
|
5477
|
+
entries = readdirSync(current, { withFileTypes: true });
|
|
5517
5478
|
} catch {
|
|
5518
5479
|
return;
|
|
5519
5480
|
}
|
|
5520
5481
|
for (const entry of entries) {
|
|
5521
|
-
const full =
|
|
5482
|
+
const full = join11(current, entry.name);
|
|
5522
5483
|
if (entry.isDirectory())
|
|
5523
5484
|
walk(full);
|
|
5524
5485
|
else if (entry.isFile() && entry.name.endsWith(".jsonl"))
|
|
@@ -5529,11 +5490,11 @@ function defaultScan(dir) {
|
|
|
5529
5490
|
return out;
|
|
5530
5491
|
}
|
|
5531
5492
|
function buildSources(env, home) {
|
|
5532
|
-
const ompBase = env.PI_CODING_AGENT_DIR ??
|
|
5493
|
+
const ompBase = env.PI_CODING_AGENT_DIR ?? join11(home, ".omp", "agent");
|
|
5533
5494
|
return [
|
|
5534
|
-
{ harness: "claude-code", dir:
|
|
5535
|
-
{ harness: "codex", dir:
|
|
5536
|
-
{ harness: "omp", dir:
|
|
5495
|
+
{ harness: "claude-code", dir: join11(home, ".claude", "projects") },
|
|
5496
|
+
{ harness: "codex", dir: join11(home, ".codex", "sessions") },
|
|
5497
|
+
{ harness: "omp", dir: join11(ompBase, "sessions") }
|
|
5537
5498
|
];
|
|
5538
5499
|
}
|
|
5539
5500
|
function resolveTranscript(attach, deps = {}) {
|
|
@@ -5722,7 +5683,7 @@ var BY_DESIGN_ENTRIES = [
|
|
|
5722
5683
|
id: "mutagent-tools-not-on-npm",
|
|
5723
5684
|
title: "@mutagent/tools is not published to npm — on purpose",
|
|
5724
5685
|
looksLike: pairPatterns(TOOLS_PKG, NOT_FOUND),
|
|
5725
|
-
reality: "@mutagent/tools is intentionally not published to the public npm registry, so a 404 there is the expected result rather than a broken release. Its functionality is compiled into the mutagent-cli binary that ships
|
|
5686
|
+
reality: "@mutagent/tools is intentionally not published to the public npm registry, so a 404 there is the expected result rather than a broken release. Its functionality is compiled into the mutagent-cli binary that ships inside helix — installing helix already gives you the tooling, and there is nothing separate to install. Install it with: mutagent install helix"
|
|
5726
5687
|
},
|
|
5727
5688
|
{
|
|
5728
5689
|
id: "mutagent-helix-not-on-npm",
|
|
@@ -5737,7 +5698,7 @@ var BY_DESIGN_ENTRIES = [
|
|
|
5737
5698
|
...pairPatterns(String.raw`mutagent\s+trace`, NOT_A_COMMAND),
|
|
5738
5699
|
/\btrace\b[^\n]{0,40}?(?:not\s+a\s+(?:valid\s+)?(?:sub)?command|unknown\s+command)/i
|
|
5739
5700
|
],
|
|
5740
|
-
reality: "trace is not a subcommand of mutagent. It lives in mutagent-cli — a different binary — which
|
|
5701
|
+
reality: "trace is not a subcommand of mutagent. It lives in mutagent-cli — a different binary — which ships inside helix. Install it with: mutagent install helix, then run: mutagent-cli trace <args>"
|
|
5741
5702
|
},
|
|
5742
5703
|
{
|
|
5743
5704
|
id: "two-separate-binaries",
|
|
@@ -5747,7 +5708,7 @@ var BY_DESIGN_ENTRIES = [
|
|
|
5747
5708
|
/mutagent-cli\s+(?:binary|executable|command)[^\n]{0,60}?(?:missing|not\s+found|doesn'?t\s+exist|does\s+not\s+exist|not\s+installed)/i,
|
|
5748
5709
|
new RegExp(String.raw`no\s+mutagent-cli[^\n]{0,40}?in\s+@mutagent\/cli`, "i")
|
|
5749
5710
|
],
|
|
5750
|
-
reality: "mutagent and mutagent-cli are separate binaries that come from separate packages. @mutagent/cli provides the mutagent binary only — account, configuration, and installation commands. The mutagent-cli binary ships
|
|
5711
|
+
reality: "mutagent and mutagent-cli are separate binaries that come from separate packages. @mutagent/cli provides the mutagent binary only — account, configuration, and installation commands. The mutagent-cli binary ships inside helix and carries the trace tooling. Having both installed is normal and expected."
|
|
5751
5712
|
}
|
|
5752
5713
|
];
|
|
5753
5714
|
function matchByDesign(draft) {
|
|
@@ -5857,7 +5818,7 @@ function getCliVersion() {
|
|
|
5857
5818
|
return process.env.CLI_VERSION;
|
|
5858
5819
|
try {
|
|
5859
5820
|
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
5860
|
-
const pkgPath =
|
|
5821
|
+
const pkgPath = join12(__dirname2, "..", "..", "package.json");
|
|
5861
5822
|
const pkg = JSON.parse(readFileSync10(pkgPath, "utf-8"));
|
|
5862
5823
|
return pkg.version ?? "0.1.1";
|
|
5863
5824
|
} catch {
|
|
@@ -6065,7 +6026,7 @@ import { Command as Command11 } from "commander";
|
|
|
6065
6026
|
import chalk18 from "chalk";
|
|
6066
6027
|
init_errors();
|
|
6067
6028
|
function createInstallCommand(deps) {
|
|
6068
|
-
const install = new Command11("install").description("Install a Mutagent package (helix
|
|
6029
|
+
const install = new Command11("install").description("Install a Mutagent package (helix)").argument("<package>", `Package to install: ${VALID_PACKAGES.join(", ")}`).option("--harness <harness>", `Target harness: ${VALID_HARNESSES.join(", ")}`, "claude-code").option("--global", "(retired) Install scope is fixed per package").option("--version <version>", "Package version to install (default: latest)").addHelpText("after", `
|
|
6069
6030
|
${chalk18.bold("Arguments & flags:")}
|
|
6070
6031
|
${chalk18.bold("<package>")} ${VALID_PACKAGES.join(" | ")}
|
|
6071
6032
|
${chalk18.bold("--harness <h>")} ${VALID_HARNESSES.join(" | ")} ${chalk18.dim("(default: claude-code)")}
|
|
@@ -6074,24 +6035,20 @@ ${chalk18.bold("Arguments & flags:")}
|
|
|
6074
6035
|
|
|
6075
6036
|
${chalk18.bold("Install scope")} ${chalk18.dim("(fixed per package — not selectable)")}:
|
|
6076
6037
|
${chalk18.bold("helix")} → installed into the current directory
|
|
6077
|
-
${chalk18.bold("diagnostics")} | ${chalk18.bold("evaluator")} → ${chalk18.yellow("installed GLOBALLY")} by npm; run the
|
|
6078
|
-
package's own init from your project afterwards.
|
|
6079
6038
|
${chalk18.dim("--global")} is retired: scope is no longer a choice.
|
|
6080
6039
|
|
|
6081
6040
|
${chalk18.bold("Examples:")}
|
|
6082
6041
|
${chalk18.dim("$")} mutagent install helix
|
|
6083
6042
|
${chalk18.dim("$")} mutagent install helix --harness codex
|
|
6084
|
-
${chalk18.dim("$")} mutagent install
|
|
6085
|
-
${chalk18.dim("$")} mutagent install
|
|
6086
|
-
${chalk18.dim("$")} mutagent install diagnostics --harness codex --json
|
|
6043
|
+
${chalk18.dim("$")} mutagent install helix --version 1.2.3
|
|
6044
|
+
${chalk18.dim("$")} mutagent install helix --json
|
|
6087
6045
|
|
|
6088
6046
|
${chalk18.bold("Packages:")}
|
|
6089
6047
|
${chalk18.bold("helix")} ${chalk18.green("(available)")} — the ADLC (Agent Development Life Cycle Orchestrator). Downloaded from a private
|
|
6090
6048
|
registry via a login-brokered signed URL, sha256-verified, then
|
|
6091
6049
|
initialized into your project. No static secret ships in the CLI.
|
|
6092
6050
|
${chalk18.dim("Installs every harness itself (Claude + Codex) — --harness does not apply.")}
|
|
6093
|
-
|
|
6094
|
-
${chalk18.bold("evaluator")} Public npm package @mutagent/evaluator ${chalk18.green("(available)")}
|
|
6051
|
+
${chalk18.dim("Carries the diagnostics and evaluator skills, plus the mutagent-cli binary.")}
|
|
6095
6052
|
|
|
6096
6053
|
${chalk18.yellow("Note:")} install is login-gated. Run ${chalk18.cyan("mutagent login")} first (else exits with a login directive).
|
|
6097
6054
|
`).action(async (pkg, options) => {
|
|
@@ -6117,8 +6074,8 @@ ${chalk18.yellow("Note:")} install is login-gated. Run ${chalk18.cyan("mutagent
|
|
|
6117
6074
|
} else if (result.skillInstalled) {
|
|
6118
6075
|
output.success(`Installed ${result.package}@${result.version} for ${result.harness} in ${result.projectPath ?? "this project"}`);
|
|
6119
6076
|
} else {
|
|
6120
|
-
output.success(`Installed
|
|
6121
|
-
console.log(`${chalk18.yellow("⚠")} No skill was installed yet —
|
|
6077
|
+
output.success(`Installed ${result.package}@${result.version}, but the skill is not in place yet`);
|
|
6078
|
+
console.log(`${chalk18.yellow("⚠")} No skill was installed yet — a setup step still has to run.`);
|
|
6122
6079
|
if (result.nextStep) {
|
|
6123
6080
|
console.log(`${chalk18.blue("→")} Run next: ${chalk18.cyan(result.nextStep)}`);
|
|
6124
6081
|
}
|
|
@@ -6133,7 +6090,7 @@ ${chalk18.yellow("Note:")} install is login-gated. Run ${chalk18.cyan("mutagent
|
|
|
6133
6090
|
// src/commands/trace.ts
|
|
6134
6091
|
import { Command as Command12 } from "commander";
|
|
6135
6092
|
init_errors();
|
|
6136
|
-
var TRACE_RELOCATION_HINT = "trace lives in the `mutagent-cli` binary,
|
|
6093
|
+
var TRACE_RELOCATION_HINT = "trace lives in the `mutagent-cli` binary, which ships inside helix (install it with: mutagent install helix)";
|
|
6137
6094
|
function createTraceCommand() {
|
|
6138
6095
|
const trace = new Command12("trace").description("Not in this binary — trace lives in mutagent-cli").allowUnknownOption(true).allowExcessArguments(true).argument("[args...]", "Arguments intended for `mutagent-cli trace`").addHelpText("after", `
|
|
6139
6096
|
This binary (mutagent) does not provide trace.
|
|
@@ -6147,7 +6104,7 @@ Install one of those, then run:
|
|
|
6147
6104
|
const isJson = getJsonFlag(trace);
|
|
6148
6105
|
const forwarded = args.length > 0 ? ` ${args.join(" ")}` : " <args>";
|
|
6149
6106
|
handleError(new MutagentError("INVALID_ARGUMENTS", `\`mutagent trace\` is not a command — ${TRACE_RELOCATION_HINT}.`, `Run it with the other binary instead: mutagent-cli trace${forwarded}
|
|
6150
|
-
If mutagent-cli is not installed: mutagent install
|
|
6107
|
+
If mutagent-cli is not installed: mutagent install helix`), isJson);
|
|
6151
6108
|
});
|
|
6152
6109
|
return trace;
|
|
6153
6110
|
}
|
|
@@ -6167,12 +6124,12 @@ init_errors();
|
|
|
6167
6124
|
// src/lib/sandbox-token.ts
|
|
6168
6125
|
init_secure_file();
|
|
6169
6126
|
init_errors();
|
|
6170
|
-
import { existsSync as existsSync9, readFileSync as readFileSync11, mkdirSync as
|
|
6171
|
-
import { homedir as
|
|
6172
|
-
import { join as
|
|
6127
|
+
import { existsSync as existsSync9, readFileSync as readFileSync11, mkdirSync as mkdirSync5, rmSync as rmSync2 } from "fs";
|
|
6128
|
+
import { homedir as homedir3 } from "os";
|
|
6129
|
+
import { join as join13, dirname as dirname3 } from "path";
|
|
6173
6130
|
function sandboxTokenFile() {
|
|
6174
6131
|
const override = process.env.MUTAGENT_SANDBOX_TOKEN_FILE;
|
|
6175
|
-
return override !== undefined && override !== "" ? override :
|
|
6132
|
+
return override !== undefined && override !== "" ? override : join13(homedir3(), ".config", "mutagent", "sandbox-token.json");
|
|
6176
6133
|
}
|
|
6177
6134
|
var EXPIRY_SKEW_MS = 60000;
|
|
6178
6135
|
function isCacheShape(value) {
|
|
@@ -6196,7 +6153,7 @@ function createFileTokenStore(path) {
|
|
|
6196
6153
|
write(entry) {
|
|
6197
6154
|
const dir = dirname3(path);
|
|
6198
6155
|
if (!existsSync9(dir))
|
|
6199
|
-
|
|
6156
|
+
mkdirSync5(dir, { recursive: true });
|
|
6200
6157
|
writeSecureFile(path, JSON.stringify(entry, null, 2));
|
|
6201
6158
|
},
|
|
6202
6159
|
clear() {
|
|
@@ -7591,7 +7548,7 @@ if (process.env.CLI_VERSION) {
|
|
|
7591
7548
|
} else {
|
|
7592
7549
|
try {
|
|
7593
7550
|
const __dirname2 = dirname4(fileURLToPath2(import.meta.url));
|
|
7594
|
-
const pkgPath =
|
|
7551
|
+
const pkgPath = join14(__dirname2, "..", "..", "package.json");
|
|
7595
7552
|
const pkg = JSON.parse(readFileSync12(pkgPath, "utf-8"));
|
|
7596
7553
|
cliVersion = pkg.version ?? cliVersion;
|
|
7597
7554
|
} catch {}
|
|
@@ -7609,7 +7566,7 @@ program.addHelpText("beforeAll", () => renderBanner());
|
|
|
7609
7566
|
program.addHelpText("after", `
|
|
7610
7567
|
${chalk25.bold.cyan("WORKFLOWS:")}
|
|
7611
7568
|
${chalk25.bold("Setup")} mutagent login → mutagent init
|
|
7612
|
-
${chalk25.bold("Lifecycle Tools")} mutagent install
|
|
7569
|
+
${chalk25.bold("Lifecycle Tools")} mutagent install helix ${chalk25.dim("(login-gated)")}
|
|
7613
7570
|
${chalk25.bold("Feedback")} mutagent feedback send "<what happened>" --category <cli|helix|stage:<x>> ${chalk25.dim("[--session <id>] [--attach-transcript]")}
|
|
7614
7571
|
|
|
7615
7572
|
${chalk25.dim("For CLI usage guidance for AI agents, see the Skill at")}
|
|
@@ -7640,8 +7597,8 @@ ${chalk25.yellow("Command Navigation:")}
|
|
|
7640
7597
|
mutagent helix rm <id> --force ${chalk25.dim("Destroy a sandbox (the only thing that does)")}
|
|
7641
7598
|
|
|
7642
7599
|
mutagent install helix ${chalk25.dim("Install the ADL lifecycle conductor locally (login-gated)")}
|
|
7643
|
-
mutagent install
|
|
7644
|
-
mutagent install --help ${chalk25.dim("helix
|
|
7600
|
+
mutagent install helix --version 1.2.3 ${chalk25.dim("Pin a version")}
|
|
7601
|
+
mutagent install --help ${chalk25.dim("helix")}
|
|
7645
7602
|
|
|
7646
7603
|
mutagent hooks --help ${chalk25.dim("Hook setup for Claude Code session telemetry upload")}
|
|
7647
7604
|
|
|
@@ -7718,5 +7675,5 @@ program.addCommand(createFeedbackCommand());
|
|
|
7718
7675
|
program.addCommand(createTraceCommand());
|
|
7719
7676
|
program.parse();
|
|
7720
7677
|
|
|
7721
|
-
//# debugId=
|
|
7678
|
+
//# debugId=8A72E382D57F3D0964756E2164756E21
|
|
7722
7679
|
//# sourceMappingURL=cli.js.map
|