nexus-agents 8.14.0 → 8.14.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.
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-OQB3XC5O.js";
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-GLIEFVVU.js";
9
+ } from "./chunk-ZFJ2NREZ.js";
10
10
  import {
11
11
  capitalize
12
12
  } from "./chunk-6T3EPABN.js";
@@ -37,6 +37,7 @@ import {
37
37
  } from "./chunk-7WJGV5DN.js";
38
38
  import {
39
39
  detectSandbox,
40
+ findRepoRoot,
40
41
  getNexusDataDir,
41
42
  getNexusRepoDir,
42
43
  getPerRepoSubdirs,
@@ -701,6 +702,13 @@ function printInstallFreshness(check) {
701
702
  function printHarnessAlignment(check) {
702
703
  writeLine(`${colors.cyan}Checking agent-harness alignment...${colors.reset}`);
703
704
  writeLine("");
705
+ if (!check.inProject) {
706
+ writeLine(
707
+ `${colors.gray}${symbols.circle}${colors.reset} AGENTS.md: not run inside a project \u2014 harness alignment not applicable (run doctor from your repo root)
708
+ `
709
+ );
710
+ return;
711
+ }
704
712
  writeLine(
705
713
  `${formatStatus(check.agentsMdExists)} AGENTS.md: ${check.agentsMdExists ? "present (federated surface)" : "MISSING \u2014 federation invariant broken"}`
706
714
  );
@@ -735,7 +743,7 @@ function printHarnessAlignment(check) {
735
743
 
736
744
  // src/cli/doctor-harness-alignment.ts
737
745
  import { existsSync, readFileSync } from "node:fs";
738
- import { join } from "node:path";
746
+ import { dirname, join, resolve } from "node:path";
739
747
  var HARNESS_FILES = [
740
748
  { harness: "Cursor", path: ".cursor/rules/agents.mdc" },
741
749
  { harness: "Windsurf", path: ".windsurf/rules/agents.md" },
@@ -747,6 +755,7 @@ var HARNESS_FILES = [
747
755
  { harness: "Gemini", path: "GEMINI.md" }
748
756
  ];
749
757
  function checkHarnessAlignment(cwd = process.cwd()) {
758
+ const inProject = findRepoRoot(cwd) !== null || hasPackageJsonAncestor(cwd);
750
759
  const agentsMdPath = join(cwd, "AGENTS.md");
751
760
  const agentsMdExists = existsSync(agentsMdPath);
752
761
  const files = HARNESS_FILES.map(
@@ -756,6 +765,7 @@ function checkHarnessAlignment(cwd = process.cwd()) {
756
765
  const driftCount = files.filter((f) => f.exists && !f.redirectsToAgentsMd).length;
757
766
  const missingCount = files.filter((f) => !f.exists).length;
758
767
  return {
768
+ inProject,
759
769
  agentsMdExists,
760
770
  files,
761
771
  alignedCount,
@@ -763,6 +773,15 @@ function checkHarnessAlignment(cwd = process.cwd()) {
763
773
  missingCount
764
774
  };
765
775
  }
776
+ function hasPackageJsonAncestor(start) {
777
+ let current = resolve(start);
778
+ for (; ; ) {
779
+ if (existsSync(join(current, "package.json"))) return true;
780
+ const parent = dirname(current);
781
+ if (parent === current) return false;
782
+ current = parent;
783
+ }
784
+ }
766
785
  function inspectFile(harness, relativePath, absolutePath) {
767
786
  if (!existsSync(absolutePath)) {
768
787
  return {
@@ -1201,7 +1220,7 @@ async function runDoctorFix(result) {
1201
1220
  writeLine2("\u2500".repeat(40));
1202
1221
  let fixCount = 0;
1203
1222
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1204
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-PFCBRVZ5.js");
1223
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-BORGYECN.js");
1205
1224
  const outcome = describeDataDirFix2(initDataDirectories2());
1206
1225
  writeLine2(outcome.line);
1207
1226
  if (outcome.counted) fixCount++;
@@ -1303,4 +1322,4 @@ export {
1303
1322
  startStdioServer,
1304
1323
  closeServer
1305
1324
  };
1306
- //# sourceMappingURL=chunk-DO63GVEY.js.map
1325
+ //# sourceMappingURL=chunk-CFUQFDBO.js.map