harnessed 1.0.3 → 1.0.4

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/cli.mjs CHANGED
@@ -670,7 +670,7 @@ var init_resume = __esm({
670
670
 
671
671
  // package.json
672
672
  var package_default = {
673
- version: "1.0.3"};
673
+ version: "1.0.4"};
674
674
 
675
675
  // src/manifest/errors.ts
676
676
  function instancePathToKeyPath(instancePath) {
@@ -3489,6 +3489,9 @@ ${newEntry}
3489
3489
  if (!bk.ok) return { ok: false, phase: "preflight", error: bk.error };
3490
3490
  const r = await runArgs(addArgs, install.cwd ?? ctx.cwd);
3491
3491
  if (r.exitCode !== 0) {
3492
+ if (r.stderr.includes("already exists in .mcp.json")) {
3493
+ return { ok: true, alreadyInstalled: true, backupId: bk.backupId };
3494
+ }
3492
3495
  return {
3493
3496
  ok: false,
3494
3497
  phase: "spawn",
@@ -3634,6 +3637,9 @@ ${newEntry}
3634
3637
  if (!bk.ok) return { ok: false, phase: "preflight", error: bk.error };
3635
3638
  const r = await runArgs(addArgs, install.cwd ?? ctx.cwd);
3636
3639
  if (r.exitCode !== 0) {
3640
+ if (r.stderr.includes("already exists in .mcp.json")) {
3641
+ return { ok: true, alreadyInstalled: true, backupId: bk.backupId };
3642
+ }
3637
3643
  return {
3638
3644
  ok: false,
3639
3645
  phase: "spawn",
@@ -4068,6 +4074,7 @@ function registerInstallBase(program2) {
4068
4074
  color: "auto"
4069
4075
  };
4070
4076
  const installed = [];
4077
+ const alreadyInstalled = [];
4071
4078
  const skipped = [];
4072
4079
  const failed = [];
4073
4080
  for (const path of await listBaseManifests(getPackageRoot())) {
@@ -4091,18 +4098,21 @@ function registerInstallBase(program2) {
4091
4098
  }
4092
4099
  const r = await runInstall(v.manifest, opts);
4093
4100
  if ("aborted" in r) skipped.push({ name, reason: `aborted: ${r.reason}` });
4101
+ else if (r.ok && "alreadyInstalled" in r && r.alreadyInstalled) alreadyInstalled.push(name);
4094
4102
  else if (r.ok) installed.push(name);
4095
4103
  else failed.push({ name, reason: r.error.message });
4096
4104
  }
4097
4105
  console.log(
4098
4106
  `
4099
- installed: ${installed.length} / skipped (deferred phase 2.1): ${skipped.length} / failed: ${failed.length}`
4107
+ installed: ${installed.length} / already-installed: ${alreadyInstalled.length} / skipped (deferred phase 2.1): ${skipped.length} / failed: ${failed.length}`
4100
4108
  );
4101
- for (const i of installed) console.log(` installed ${i}`);
4102
- for (const s of skipped) console.log(` skipped ${s.name} \u2014 ${s.reason}`);
4103
- for (const f of failed) console.error(` failed ${f.name} \u2014 ${f.reason}`);
4109
+ for (const i of installed) console.log(` installed ${i}`);
4110
+ for (const a of alreadyInstalled)
4111
+ console.log(` already-installed ${a} \u2014 run \`/mcp\` in Claude Code to verify connection`);
4112
+ for (const s of skipped) console.log(` skipped ${s.name} \u2014 ${s.reason}`);
4113
+ for (const f of failed) console.error(` failed ${f.name} \u2014 ${f.reason}`);
4104
4114
  if (failed.length > 0) process.exit(1);
4105
- if (installed.length === 0) process.exit(2);
4115
+ if (installed.length === 0 && alreadyInstalled.length === 0) process.exit(2);
4106
4116
  process.exit(0);
4107
4117
  });
4108
4118
  }
@@ -4399,11 +4409,14 @@ Step A complete: ${skillsInstalled} workflow skill(s) installed to ${skillsBase}
4399
4409
  }
4400
4410
  const r = await runInstall(v.manifest, opts);
4401
4411
  if ("aborted" in r) return { status: "skipped", name };
4412
+ if (r.ok && "alreadyInstalled" in r && r.alreadyInstalled)
4413
+ return { status: "already-installed", name };
4402
4414
  if (r.ok) return { status: "installed", name };
4403
4415
  return { status: "failed", name, reason: r.error.message };
4404
4416
  })
4405
4417
  );
4406
4418
  const baseInstalled = [];
4419
+ const baseAlreadyInstalled = [];
4407
4420
  const baseSkipped = [];
4408
4421
  const baseFailed = [];
4409
4422
  for (const s of settled) {
@@ -4413,6 +4426,7 @@ Step A complete: ${skillsInstalled} workflow skill(s) installed to ${skillsBase}
4413
4426
  reason: String(s.reason)
4414
4427
  };
4415
4428
  if (v.status === "installed") baseInstalled.push(v.name);
4429
+ else if (v.status === "already-installed") baseAlreadyInstalled.push(v.name);
4416
4430
  else if (v.status === "skipped") baseSkipped.push(v.name);
4417
4431
  else
4418
4432
  baseFailed.push(
@@ -4421,15 +4435,25 @@ Step A complete: ${skillsInstalled} workflow skill(s) installed to ${skillsBase}
4421
4435
  }
4422
4436
  const stepBMs = ((Date.now() - stepBStart) / 1e3).toFixed(1);
4423
4437
  console.log(
4424
- `Step B complete: ${baseInstalled.length} manifest(s) installed / ${baseSkipped.length} skipped / ${baseFailed.length} failed [parallel ${stepBMs}s]`
4438
+ `Step B complete: ${baseInstalled.length} manifest(s) installed / ${baseAlreadyInstalled.length} already-installed / ${baseSkipped.length} skipped / ${baseFailed.length} failed [parallel ${stepBMs}s]`
4425
4439
  );
4426
- for (const n of baseInstalled) console.log(` [B] installed ${n}`);
4427
- for (const n of baseSkipped) console.log(` [B] skipped ${n}`);
4428
- for (const n of baseFailed) console.error(` [B] failed ${n}`);
4440
+ for (const n of baseInstalled) console.log(` [B] installed ${n}`);
4441
+ for (const n of baseAlreadyInstalled)
4442
+ console.log(
4443
+ ` [B] already-installed ${n} \u2014 run \`/mcp\` in Claude Code to verify connection`
4444
+ );
4445
+ for (const n of baseSkipped) console.log(` [B] skipped ${n}`);
4446
+ for (const n of baseFailed) console.error(` [B] failed ${n}`);
4429
4447
  console.log(
4430
4448
  `
4431
- setup complete: ${skillsInstalled} workflow skill(s) + ${baseInstalled.length} base manifest(s) installed`
4449
+ setup complete: ${skillsInstalled} workflow skill(s) + ${baseInstalled.length + baseAlreadyInstalled.length} base manifest(s) configured`
4432
4450
  );
4451
+ if (baseAlreadyInstalled.length > 0 || baseInstalled.length > 0) {
4452
+ console.log(
4453
+ `
4454
+ MCP servers configured. Run \`/mcp\` in Claude Code to verify each server's connection status. If a server shows disconnected, restart Claude Code or check the MCP command spec.`
4455
+ );
4456
+ }
4433
4457
  process.exit(0);
4434
4458
  });
4435
4459
  }