harnessed 4.16.1 → 4.16.2

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
@@ -38,7 +38,7 @@ var init_package = __esm({
38
38
  "package.json"() {
39
39
  package_default = {
40
40
  name: "harnessed",
41
- version: "4.16.1",
41
+ version: "4.16.2",
42
42
  description: "AI coding harness package manager + composition orchestrator",
43
43
  type: "module",
44
44
  license: "Apache-2.0",
@@ -6330,7 +6330,7 @@ function gitRevParseHead(cwd, timeoutMs = 1e4) {
6330
6330
  });
6331
6331
  });
6332
6332
  }
6333
- function extractCloneTarget(cmd) {
6333
+ function extractRawCloneDest(cmd) {
6334
6334
  const idx = cmd.indexOf("git clone");
6335
6335
  if (idx < 0) return null;
6336
6336
  const tail = cmd.slice(idx + "git clone".length).trim();
@@ -6349,6 +6349,12 @@ function extractCloneTarget(cmd) {
6349
6349
  }
6350
6350
  const dest = tokens[i + 1];
6351
6351
  if (!dest || dest === "&&" || dest === ";" || dest === "|") return null;
6352
+ return { raw: dest, cloneIdx: idx };
6353
+ }
6354
+ function extractCloneTarget(cmd) {
6355
+ const parsed = extractRawCloneDest(cmd);
6356
+ if (!parsed) return null;
6357
+ const dest = parsed.raw;
6352
6358
  if (dest.startsWith("~/")) {
6353
6359
  const home = process.env.HOME ?? process.env.USERPROFILE;
6354
6360
  if (!home) return null;
@@ -6356,6 +6362,18 @@ function extractCloneTarget(cmd) {
6356
6362
  }
6357
6363
  return dest;
6358
6364
  }
6365
+ function isSelfCleaningCloneCmd(cmd) {
6366
+ const parsed = extractRawCloneDest(cmd);
6367
+ if (!parsed) return false;
6368
+ const needle = `rm -rf ${parsed.raw}`;
6369
+ let idx = cmd.indexOf(needle, parsed.cloneIdx);
6370
+ while (idx >= 0) {
6371
+ const after = cmd[idx + needle.length];
6372
+ if (after === void 0 || /\s/.test(after)) return true;
6373
+ idx = cmd.indexOf(needle, idx + 1);
6374
+ }
6375
+ return false;
6376
+ }
6359
6377
  var installGitCloneWithSetup;
6360
6378
  var init_gitCloneWithSetup2 = __esm({
6361
6379
  "src/installers/gitCloneWithSetup.ts"() {
@@ -6461,8 +6479,8 @@ var init_gitCloneWithSetup2 = __esm({
6461
6479
  )
6462
6480
  };
6463
6481
  }
6464
- const rp = await gitRevParseHead(cloneTarget);
6465
- if (rp.exit !== 0 || !rp.sha) {
6482
+ const rp = isSelfCleaningCloneCmd(install.cmd) ? null : await gitRevParseHead(cloneTarget);
6483
+ if (rp === null) ; else if (rp.exit !== 0 || !rp.sha) {
6466
6484
  console.warn(
6467
6485
  ` \u26A0 ${name}: git_ref SHA pin '${install.git_ref}' unverifiable \u2014 \`git rev-parse HEAD\` exit ${rp.exit} in ${cloneTarget} (the install cmd may remove its own clone dir); falling back to the manifest verify cmd as the install authority`
6468
6486
  );
@@ -9790,7 +9808,7 @@ async function runStepBInstall(manifestPaths, runOpts = {}) {
9790
9808
  try {
9791
9809
  const r = await runInstall(manifest, opts);
9792
9810
  if ("aborted" in r) {
9793
- const reason = r.reason === "harness-mismatch" ? `harness-mismatch \u2014 claude-only install method (no ${detectPlatform().id} equivalent)` : r.reason;
9811
+ const reason = r.reason === "harness-mismatch" ? `harness-mismatch \u2014 claude-only install method (no ${detectPlatform().id} equivalent)` : r.reason === "level-flag-missing" && runOpts.updateInstalled === true ? `L4 system-scope \u2014 excluded from force-update; update manually: \`${manifest.spec.install.cmd}\`` : r.reason;
9794
9812
  return emit({ status: "skipped", name, reason });
9795
9813
  }
9796
9814
  if (r.ok && "alreadyInstalled" in r && r.alreadyInstalled)