@mutagent/cli 0.1.266 → 0.1.268

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 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 join15, dirname as dirname4 } from "path";
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 join7 } from "path";
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", "diagnostics", "evaluator"];
1367
- var VALID_HARNESSES = ["claude-code", "codex", "omp"];
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 INIT_BINS = {
1378
- diagnostics: "mutagent-diagnostics",
1379
- evaluator: "mutagent-evaluator"
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
- if (pkg === "helix") {
1450
- const { version: resolved } = await installHelix({ harness: opts.harness, version }, deps.helix ?? {});
1451
- return finish({
1452
- package: pkg,
1453
- version: resolved,
1454
- harness: opts.harness,
1455
- scope: "project",
1456
- projectPath,
1457
- skillInstalled: true
1458
- }, deps);
1459
- }
1460
- const npmPackage = NPM_PACKAGES[pkg];
1461
- const installRoot = join6(deps.homeDir ?? join6(homedir3(), ".mutagent", pkg), version);
1462
- mkdirSync3(installRoot, { recursive: true });
1463
- const args = ["install", "--prefix", installRoot, "--no-save", `${npmPackage}@${version}`];
1464
- const runner = deps.runner ?? defaultRunner;
1465
- const result = await runner("npm", args);
1466
- if (result.code !== 0) {
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(join7(cwd, ".mutagentrc.json"));
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 join9 } from "path";
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 mkdirSync4, writeFileSync as writeFileSync4 } from "fs";
3380
- import { dirname, join as join8 } from "path";
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, diagnostics, evaluator), and sending
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 / diagnostics / evaluator | [workflows/install.md](./workflows/install.md) |
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 <helix\\|diagnostics\\|evaluator>\` meta-command |
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 a Mutagent package (helix, diagnostics, or
3779
- evaluator) into the user's environment via \`mutagent install <package>\`.
3780
- Login-gated. diagnostics/evaluator come from public npm; helix is fetched
3781
- from a private registry via a login-brokered signed URL (no static secret).
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
- > **Scope differs by package** read \`scope\` in the response, never assume:
3795
- > - \`helix\` → installed into the CURRENT project directory (\`scope: "project"\`).
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
- > This WRITES to the user's machine confirm before running (Core Rule 5).
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
- > **\`success: true\` does NOT mean the user is ready to go.** For \`diagnostics\`
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 <package> [--harness <claude-code|codex|omp>] \\
3820
- [--version <v>] [--json]
3753
+ mutagent install helix [--harness <claude-code|codex|omp>] \\
3754
+ [--version <v>] [--json]
3821
3755
  \`\`\`
3822
3756
 
3823
- Where \`<package>\` is one of:
3757
+ Where \`<package>\` is:
3824
3758
 
3825
3759
  | Package | Source | Notes |
3826
3760
  |---|---|---|
3827
- | \`diagnostics\` | public npm \`@mutagent/diagnostics\` | Ready to install |
3828
- | \`evaluator\` | public npm \`@mutagent/evaluator\` | Ready to install |
3829
- | \`helix\` | private registry via login-brokered signed URL | Ready to install login-gated download, sha256-verified, then initialized into your project |
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
- state the REAL destination for the package being installed, e.g.
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 <package> [--harness <h>] [--version <v>] --json
3791
+ 4. mutagent install helix [--harness <h>] [--version <v>] --json
3856
3792
  → run the install
3857
- → show the command output to the user: package, version, harness, and
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. Tell the user plainly that the npm
3864
- package is installed but the skill is not, then surface \`nextStep\`
3865
- (e.g. \`mutagent-diagnostics init\`) as the command to run next.
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 diagnostics --json
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": "diagnostics",
3891
- "version": "1.2.3",
3821
+ "package": "helix",
3822
+ "version": "0.1.0-alpha.25",
3892
3823
  "harness": "claude-code",
3893
- "scope": "global",
3894
- "skillInstalled": false,
3895
- "nextStep": "mutagent-diagnostics init",
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
- - \`skillInstalled: false\` (npm packages — \`diagnostics\`, \`evaluator\`): the npm
3907
- package is installed; the harness skill is **not**. Say so explicitly and give
3908
- the user \`nextStep\`. Reporting only "installed" here is a known past defect —
3909
- users were told a skill had landed when none had.
3910
- - \`skillInstalled: true\` (\`helix\`): the CLI resolved a signed download URL from
3911
- the login broker, downloaded + sha256-verified the plugin, and ran its init
3912
- into the project. Nothing further is needed. An \`INTEGRITY_ERROR\` means the
3913
- download failed checksum verification — retry.
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
- - **Treating \`success: true\` as "the user is ready".** For \`diagnostics\` and
3932
- \`evaluator\` it is not check \`skillInstalled\` and surface \`nextStep\`. Stopping
3933
- at \`success\` leaves the user with a package and no skill, believing it works.
3934
- - **Telling the user a globally-installed package is in their project.**
3935
- \`diagnostics\` and \`evaluator\` install globally (\`npm install -g\`). Report the
3936
- location from \`scope\`, never from the directory you ran in.
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 fixed per package and is not selectable.
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 = join8(targetRoot, SKILL_DIR);
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 = join8(skillDir, relPath);
4061
+ const destPath = join7(skillDir, relPath);
4136
4062
  const parentDir = dirname(destPath);
4137
4063
  if (!existsSync6(parentDir)) {
4138
- mkdirSync4(parentDir, { recursive: true });
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(join9(cwd, ".mutagentrc.json"), "utf-8"));
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 join10 } from "path";
4449
+ import { join as join9 } from "path";
4526
4450
  import { tmpdir } from "os";
4527
4451
  function stateFilePath(sessionId) {
4528
- return join10(tmpdir(), `mutagent-hook-${sessionId}.json`);
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 mkdirSync5 } from "fs";
5160
- import { join as join11 } from "path";
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 = join11(cwd, ".claude");
5223
- const settingsPath = join11(claudeDir, "settings.local.json");
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
- mkdirSync5(claudeDir, { recursive: true });
5187
+ mkdirSync4(claudeDir, { recursive: true });
5264
5188
  }
5265
5189
  writeFileSync6(settingsPath, JSON.stringify(settings, null, 2) + `
5266
5190
  `, "utf-8");
@@ -5509,7 +5433,7 @@ import { Command as Command10 } from "commander";
5509
5433
  import chalk17 from "chalk";
5510
5434
  import { type as osType, release as osRelease } from "os";
5511
5435
  import { readFileSync as readFileSync10 } from "fs";
5512
- import { join as join13, dirname as dirname2 } from "path";
5436
+ import { join as join12, dirname as dirname2 } from "path";
5513
5437
  import { fileURLToPath } from "url";
5514
5438
  init_errors();
5515
5439
  init_config();
@@ -5517,12 +5441,12 @@ init_config();
5517
5441
  // src/lib/transcript.ts
5518
5442
  init_errors();
5519
5443
  import { homedir as osHomedir } from "os";
5520
- import { join as join12 } from "path";
5444
+ import { join as join11 } from "path";
5521
5445
  import {
5522
5446
  existsSync as fsExistsSync,
5523
5447
  statSync as fsStatSync,
5524
5448
  readFileSync as readFileSync9,
5525
- readdirSync as readdirSync2,
5449
+ readdirSync,
5526
5450
  openSync,
5527
5451
  readSync,
5528
5452
  closeSync
@@ -5550,12 +5474,12 @@ function defaultScan(dir) {
5550
5474
  const walk = (current) => {
5551
5475
  let entries;
5552
5476
  try {
5553
- entries = readdirSync2(current, { withFileTypes: true });
5477
+ entries = readdirSync(current, { withFileTypes: true });
5554
5478
  } catch {
5555
5479
  return;
5556
5480
  }
5557
5481
  for (const entry of entries) {
5558
- const full = join12(current, entry.name);
5482
+ const full = join11(current, entry.name);
5559
5483
  if (entry.isDirectory())
5560
5484
  walk(full);
5561
5485
  else if (entry.isFile() && entry.name.endsWith(".jsonl"))
@@ -5566,11 +5490,11 @@ function defaultScan(dir) {
5566
5490
  return out;
5567
5491
  }
5568
5492
  function buildSources(env, home) {
5569
- const ompBase = env.PI_CODING_AGENT_DIR ?? join12(home, ".omp", "agent");
5493
+ const ompBase = env.PI_CODING_AGENT_DIR ?? join11(home, ".omp", "agent");
5570
5494
  return [
5571
- { harness: "claude-code", dir: join12(home, ".claude", "projects") },
5572
- { harness: "codex", dir: join12(home, ".codex", "sessions") },
5573
- { harness: "omp", dir: join12(ompBase, "sessions") }
5495
+ { harness: "claude-code", dir: join11(home, ".claude", "projects") },
5496
+ { harness: "codex", dir: join11(home, ".codex", "sessions") },
5497
+ { harness: "omp", dir: join11(ompBase, "sessions") }
5574
5498
  ];
5575
5499
  }
5576
5500
  function resolveTranscript(attach, deps = {}) {
@@ -5759,7 +5683,7 @@ var BY_DESIGN_ENTRIES = [
5759
5683
  id: "mutagent-tools-not-on-npm",
5760
5684
  title: "@mutagent/tools is not published to npm — on purpose",
5761
5685
  looksLike: pairPatterns(TOOLS_PKG, NOT_FOUND),
5762
- 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 with the diagnostics and evaluator packages — installing either one already gives you the tooling, and there is nothing separate to install."
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"
5763
5687
  },
5764
5688
  {
5765
5689
  id: "mutagent-helix-not-on-npm",
@@ -5774,7 +5698,7 @@ var BY_DESIGN_ENTRIES = [
5774
5698
  ...pairPatterns(String.raw`mutagent\s+trace`, NOT_A_COMMAND),
5775
5699
  /\btrace\b[^\n]{0,40}?(?:not\s+a\s+(?:valid\s+)?(?:sub)?command|unknown\s+command)/i
5776
5700
  ],
5777
- reality: "trace is not a subcommand of mutagent. It lives in mutagent-cli — a different binary — which is installed alongside @mutagent/diagnostics, @mutagent/evaluator, or helix. Run: mutagent-cli trace <args>"
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>"
5778
5702
  },
5779
5703
  {
5780
5704
  id: "two-separate-binaries",
@@ -5784,7 +5708,7 @@ var BY_DESIGN_ENTRIES = [
5784
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,
5785
5709
  new RegExp(String.raw`no\s+mutagent-cli[^\n]{0,40}?in\s+@mutagent\/cli`, "i")
5786
5710
  ],
5787
- 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 with the diagnostics and evaluator packages and carries the trace tooling. Having both installed is normal and expected."
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."
5788
5712
  }
5789
5713
  ];
5790
5714
  function matchByDesign(draft) {
@@ -5894,7 +5818,7 @@ function getCliVersion() {
5894
5818
  return process.env.CLI_VERSION;
5895
5819
  try {
5896
5820
  const __dirname2 = dirname2(fileURLToPath(import.meta.url));
5897
- const pkgPath = join13(__dirname2, "..", "..", "package.json");
5821
+ const pkgPath = join12(__dirname2, "..", "..", "package.json");
5898
5822
  const pkg = JSON.parse(readFileSync10(pkgPath, "utf-8"));
5899
5823
  return pkg.version ?? "0.1.1";
5900
5824
  } catch {
@@ -6102,7 +6026,7 @@ import { Command as Command11 } from "commander";
6102
6026
  import chalk18 from "chalk";
6103
6027
  init_errors();
6104
6028
  function createInstallCommand(deps) {
6105
- const install = new Command11("install").description("Install a Mutagent package (helix, diagnostics, evaluator)").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", `
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", `
6106
6030
  ${chalk18.bold("Arguments & flags:")}
6107
6031
  ${chalk18.bold("<package>")} ${VALID_PACKAGES.join(" | ")}
6108
6032
  ${chalk18.bold("--harness <h>")} ${VALID_HARNESSES.join(" | ")} ${chalk18.dim("(default: claude-code)")}
@@ -6111,24 +6035,20 @@ ${chalk18.bold("Arguments & flags:")}
6111
6035
 
6112
6036
  ${chalk18.bold("Install scope")} ${chalk18.dim("(fixed per package — not selectable)")}:
6113
6037
  ${chalk18.bold("helix")} → installed into the current directory
6114
- ${chalk18.bold("diagnostics")} | ${chalk18.bold("evaluator")} → ${chalk18.yellow("installed GLOBALLY")} by npm; run the
6115
- package's own init from your project afterwards.
6116
6038
  ${chalk18.dim("--global")} is retired: scope is no longer a choice.
6117
6039
 
6118
6040
  ${chalk18.bold("Examples:")}
6119
6041
  ${chalk18.dim("$")} mutagent install helix
6120
6042
  ${chalk18.dim("$")} mutagent install helix --harness codex
6121
- ${chalk18.dim("$")} mutagent install diagnostics
6122
- ${chalk18.dim("$")} mutagent install evaluator --version 1.2.3
6123
- ${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
6124
6045
 
6125
6046
  ${chalk18.bold("Packages:")}
6126
6047
  ${chalk18.bold("helix")} ${chalk18.green("(available)")} — the ADLC (Agent Development Life Cycle Orchestrator). Downloaded from a private
6127
6048
  registry via a login-brokered signed URL, sha256-verified, then
6128
6049
  initialized into your project. No static secret ships in the CLI.
6129
6050
  ${chalk18.dim("Installs every harness itself (Claude + Codex) — --harness does not apply.")}
6130
- ${chalk18.bold("diagnostics")} Public npm package @mutagent/diagnostics ${chalk18.green("(available)")}
6131
- ${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.")}
6132
6052
 
6133
6053
  ${chalk18.yellow("Note:")} install is login-gated. Run ${chalk18.cyan("mutagent login")} first (else exits with a login directive).
6134
6054
  `).action(async (pkg, options) => {
@@ -6154,8 +6074,8 @@ ${chalk18.yellow("Note:")} install is login-gated. Run ${chalk18.cyan("mutagent
6154
6074
  } else if (result.skillInstalled) {
6155
6075
  output.success(`Installed ${result.package}@${result.version} for ${result.harness} in ${result.projectPath ?? "this project"}`);
6156
6076
  } else {
6157
- output.success(`Installed npm package ${result.package}@${result.version} globally` + (result.command ? ` (${result.command})` : ""));
6158
- console.log(`${chalk18.yellow("⚠")} No skill was installed yet — the package ships its own setup step.`);
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.`);
6159
6079
  if (result.nextStep) {
6160
6080
  console.log(`${chalk18.blue("→")} Run next: ${chalk18.cyan(result.nextStep)}`);
6161
6081
  }
@@ -6170,7 +6090,7 @@ ${chalk18.yellow("Note:")} install is login-gated. Run ${chalk18.cyan("mutagent
6170
6090
  // src/commands/trace.ts
6171
6091
  import { Command as Command12 } from "commander";
6172
6092
  init_errors();
6173
- var TRACE_RELOCATION_HINT = "trace lives in the `mutagent-cli` binary, installed with @mutagent/diagnostics, @mutagent/evaluator or helix";
6093
+ var TRACE_RELOCATION_HINT = "trace lives in the `mutagent-cli` binary, which ships inside helix (install it with: mutagent install helix)";
6174
6094
  function createTraceCommand() {
6175
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", `
6176
6096
  This binary (mutagent) does not provide trace.
@@ -6184,7 +6104,7 @@ Install one of those, then run:
6184
6104
  const isJson = getJsonFlag(trace);
6185
6105
  const forwarded = args.length > 0 ? ` ${args.join(" ")}` : " <args>";
6186
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}
6187
- If mutagent-cli is not installed: mutagent install diagnostics`), isJson);
6107
+ If mutagent-cli is not installed: mutagent install helix`), isJson);
6188
6108
  });
6189
6109
  return trace;
6190
6110
  }
@@ -6204,12 +6124,12 @@ init_errors();
6204
6124
  // src/lib/sandbox-token.ts
6205
6125
  init_secure_file();
6206
6126
  init_errors();
6207
- import { existsSync as existsSync9, readFileSync as readFileSync11, mkdirSync as mkdirSync6, rmSync as rmSync2 } from "fs";
6208
- import { homedir as homedir4 } from "os";
6209
- import { join as join14, dirname as dirname3 } from "path";
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";
6210
6130
  function sandboxTokenFile() {
6211
6131
  const override = process.env.MUTAGENT_SANDBOX_TOKEN_FILE;
6212
- return override !== undefined && override !== "" ? override : join14(homedir4(), ".config", "mutagent", "sandbox-token.json");
6132
+ return override !== undefined && override !== "" ? override : join13(homedir3(), ".config", "mutagent", "sandbox-token.json");
6213
6133
  }
6214
6134
  var EXPIRY_SKEW_MS = 60000;
6215
6135
  function isCacheShape(value) {
@@ -6233,7 +6153,7 @@ function createFileTokenStore(path) {
6233
6153
  write(entry) {
6234
6154
  const dir = dirname3(path);
6235
6155
  if (!existsSync9(dir))
6236
- mkdirSync6(dir, { recursive: true });
6156
+ mkdirSync5(dir, { recursive: true });
6237
6157
  writeSecureFile(path, JSON.stringify(entry, null, 2));
6238
6158
  },
6239
6159
  clear() {
@@ -7628,7 +7548,7 @@ if (process.env.CLI_VERSION) {
7628
7548
  } else {
7629
7549
  try {
7630
7550
  const __dirname2 = dirname4(fileURLToPath2(import.meta.url));
7631
- const pkgPath = join15(__dirname2, "..", "..", "package.json");
7551
+ const pkgPath = join14(__dirname2, "..", "..", "package.json");
7632
7552
  const pkg = JSON.parse(readFileSync12(pkgPath, "utf-8"));
7633
7553
  cliVersion = pkg.version ?? cliVersion;
7634
7554
  } catch {}
@@ -7646,7 +7566,7 @@ program.addHelpText("beforeAll", () => renderBanner());
7646
7566
  program.addHelpText("after", `
7647
7567
  ${chalk25.bold.cyan("WORKFLOWS:")}
7648
7568
  ${chalk25.bold("Setup")} mutagent login → mutagent init
7649
- ${chalk25.bold("Lifecycle Tools")} mutagent install <helix|diagnostics|evaluator> ${chalk25.dim("(login-gated)")}
7569
+ ${chalk25.bold("Lifecycle Tools")} mutagent install helix ${chalk25.dim("(login-gated)")}
7650
7570
  ${chalk25.bold("Feedback")} mutagent feedback send "<what happened>" --category <cli|helix|stage:<x>> ${chalk25.dim("[--session <id>] [--attach-transcript]")}
7651
7571
 
7652
7572
  ${chalk25.dim("For CLI usage guidance for AI agents, see the Skill at")}
@@ -7677,8 +7597,8 @@ ${chalk25.yellow("Command Navigation:")}
7677
7597
  mutagent helix rm <id> --force ${chalk25.dim("Destroy a sandbox (the only thing that does)")}
7678
7598
 
7679
7599
  mutagent install helix ${chalk25.dim("Install the ADL lifecycle conductor locally (login-gated)")}
7680
- mutagent install evaluator --version 1.2.3 ${chalk25.dim("Pin a version")}
7681
- mutagent install --help ${chalk25.dim("helix | diagnostics | evaluator")}
7600
+ mutagent install helix --version 1.2.3 ${chalk25.dim("Pin a version")}
7601
+ mutagent install --help ${chalk25.dim("helix")}
7682
7602
 
7683
7603
  mutagent hooks --help ${chalk25.dim("Hook setup for Claude Code session telemetry upload")}
7684
7604
 
@@ -7755,5 +7675,5 @@ program.addCommand(createFeedbackCommand());
7755
7675
  program.addCommand(createTraceCommand());
7756
7676
  program.parse();
7757
7677
 
7758
- //# debugId=335186A30A7070F164756E2164756E21
7678
+ //# debugId=8A72E382D57F3D0964756E2164756E21
7759
7679
  //# sourceMappingURL=cli.js.map