nexus-agents 2.78.0 → 2.79.0

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.
@@ -79,7 +79,7 @@ import {
79
79
  clampTaskTtl,
80
80
  getAvailabilityCache,
81
81
  resolveFallback
82
- } from "./chunk-4N33QZLH.js";
82
+ } from "./chunk-ZI6G7U7Y.js";
83
83
  import {
84
84
  DEFAULTS
85
85
  } from "./chunk-HYU4GZY6.js";
@@ -50129,4 +50129,4 @@ export {
50129
50129
  detectBackend,
50130
50130
  createTaskTracker
50131
50131
  };
50132
- //# sourceMappingURL=chunk-6WBTNZAY.js.map
50132
+ //# sourceMappingURL=chunk-3ULMVOIF.js.map
@@ -8,7 +8,7 @@ import {
8
8
  checkSqlite,
9
9
  defaultConfig,
10
10
  initDataDirectories
11
- } from "./chunk-4N33QZLH.js";
11
+ } from "./chunk-ZI6G7U7Y.js";
12
12
  import {
13
13
  probeAllClis
14
14
  } from "./chunk-D6TM2VHX.js";
@@ -1948,4 +1948,4 @@ export {
1948
1948
  setupCommand,
1949
1949
  setupCommandAsync
1950
1950
  };
1951
- //# sourceMappingURL=chunk-GTGDVBLW.js.map
1951
+ //# sourceMappingURL=chunk-YMMYYAZT.js.map
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-7BMOZJYS.js";
39
39
 
40
40
  // src/version.ts
41
- var VERSION = true ? "2.78.0" : "dev";
41
+ var VERSION = true ? "2.79.0" : "dev";
42
42
 
43
43
  // src/config/schemas-core.ts
44
44
  import { z } from "zod";
@@ -1295,18 +1295,18 @@ function getConfig(options) {
1295
1295
  }
1296
1296
 
1297
1297
  // src/cli/setup-data-dir.ts
1298
- import { mkdirSync, existsSync as existsSync3 } from "fs";
1299
- import { join as join3 } from "path";
1298
+ import { mkdirSync, existsSync as existsSync4 } from "fs";
1299
+ import { join as join4 } from "path";
1300
1300
 
1301
1301
  // src/cli/doctor.ts
1302
1302
  import {
1303
- existsSync as existsSync2,
1304
- readFileSync as readFileSync2,
1303
+ existsSync as existsSync3,
1304
+ readFileSync as readFileSync3,
1305
1305
  readdirSync,
1306
1306
  accessSync,
1307
1307
  constants as fsConstants
1308
1308
  } from "fs";
1309
- import { join as join2 } from "path";
1309
+ import { join as join3 } from "path";
1310
1310
 
1311
1311
  // src/mcp/server.ts
1312
1312
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1768,8 +1768,100 @@ function printDoctorResults(result) {
1768
1768
  printDataDirectory(result.dataDirectory);
1769
1769
  writeLine("");
1770
1770
  printSandbox(result.sandbox);
1771
+ printHarnessAlignment(result.harnessAlignment);
1771
1772
  printDoctorSummary(result);
1772
1773
  }
1774
+ function printHarnessAlignment(check) {
1775
+ writeLine(`${colors.cyan}Checking agent-harness alignment...${colors.reset}`);
1776
+ writeLine("");
1777
+ writeLine(
1778
+ `${formatStatus(check.agentsMdExists)} AGENTS.md: ${check.agentsMdExists ? "present (federated surface)" : "MISSING \u2014 federation invariant broken"}`
1779
+ );
1780
+ for (const f of check.files) {
1781
+ if (!f.exists) {
1782
+ writeLine(` ${colors.gray}\u25CB${colors.reset} ${f.harness}: not present (${f.path})`);
1783
+ continue;
1784
+ }
1785
+ if (f.error !== null) {
1786
+ writeLine(` ${colors.red}\u2717${colors.reset} ${f.harness}: ${f.error}`);
1787
+ continue;
1788
+ }
1789
+ if (f.redirectsToAgentsMd) {
1790
+ writeLine(` ${colors.green}\u2713${colors.reset} ${f.harness}: aligned (${f.path})`);
1791
+ } else {
1792
+ writeLine(
1793
+ ` ${colors.yellow}\u26A0${colors.reset} ${f.harness}: drift \u2014 ${f.path} exists but does NOT mention AGENTS.md`
1794
+ );
1795
+ }
1796
+ }
1797
+ writeLine("");
1798
+ writeLine(
1799
+ ` Summary: ${String(check.alignedCount)} aligned, ${String(check.driftCount)} drift, ${String(check.missingCount)} absent`
1800
+ );
1801
+ if (check.driftCount > 0) {
1802
+ writeLine(
1803
+ ` ${colors.yellow}Drift detected.${colors.reset} Per docs/architecture/AGENT_COMPATIBILITY.md, harness configs must redirect to AGENTS.md \u2014 never duplicate content.`
1804
+ );
1805
+ }
1806
+ writeLine("");
1807
+ }
1808
+
1809
+ // src/cli/doctor-harness-alignment.ts
1810
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
1811
+ import { join as join2 } from "path";
1812
+ var HARNESS_FILES = [
1813
+ { harness: "Cursor", path: ".cursor/rules/agents.mdc" },
1814
+ { harness: "Windsurf", path: ".windsurf/rules/agents.md" },
1815
+ { harness: "Aider", path: ".aider.conf.yml" },
1816
+ { harness: "Continue", path: ".continue/rules/agents.md" },
1817
+ { harness: "Cline", path: ".clinerules/agents.md" }
1818
+ ];
1819
+ function checkHarnessAlignment(cwd = process.cwd()) {
1820
+ const agentsMdPath = join2(cwd, "AGENTS.md");
1821
+ const agentsMdExists = existsSync2(agentsMdPath);
1822
+ const files = HARNESS_FILES.map(
1823
+ ({ harness, path }) => inspectFile(harness, path, join2(cwd, path))
1824
+ );
1825
+ const alignedCount = files.filter((f) => f.exists && f.redirectsToAgentsMd).length;
1826
+ const driftCount = files.filter((f) => f.exists && !f.redirectsToAgentsMd).length;
1827
+ const missingCount = files.filter((f) => !f.exists).length;
1828
+ return {
1829
+ agentsMdExists,
1830
+ files,
1831
+ alignedCount,
1832
+ driftCount,
1833
+ missingCount
1834
+ };
1835
+ }
1836
+ function inspectFile(harness, relativePath, absolutePath) {
1837
+ if (!existsSync2(absolutePath)) {
1838
+ return {
1839
+ harness,
1840
+ path: relativePath,
1841
+ exists: false,
1842
+ redirectsToAgentsMd: false,
1843
+ error: null
1844
+ };
1845
+ }
1846
+ try {
1847
+ const content = readFileSync2(absolutePath, "utf-8");
1848
+ return {
1849
+ harness,
1850
+ path: relativePath,
1851
+ exists: true,
1852
+ redirectsToAgentsMd: content.includes("AGENTS.md"),
1853
+ error: null
1854
+ };
1855
+ } catch (error) {
1856
+ return {
1857
+ harness,
1858
+ path: relativePath,
1859
+ exists: true,
1860
+ redirectsToAgentsMd: false,
1861
+ error: error instanceof Error ? error.message : String(error)
1862
+ };
1863
+ }
1864
+ }
1773
1865
 
1774
1866
  // src/cli/doctor.ts
1775
1867
  var REQUIRED_NODE_MAJOR2 = 22;
@@ -1899,7 +1991,7 @@ function checkApiKeys() {
1899
1991
  }
1900
1992
  function checkConfigFile() {
1901
1993
  for (const configPath of CONFIG_FILE_PATHS) {
1902
- if (existsSync2(configPath)) {
1994
+ if (existsSync3(configPath)) {
1903
1995
  return { found: true, path: configPath };
1904
1996
  }
1905
1997
  }
@@ -1940,11 +2032,11 @@ function buildRegistryAdvisory(cliResults) {
1940
2032
  function hasPriorUsage() {
1941
2033
  try {
1942
2034
  const root = getNexusDataDir();
1943
- if (!existsSync2(root)) return false;
2035
+ if (!existsSync3(root)) return false;
1944
2036
  for (const sub of ["audit", "learning", "sessions", "voting"]) {
1945
2037
  const p = `${root}/${sub}`;
1946
2038
  try {
1947
- if (existsSync2(p) && readdirSync(p).length > 0) return true;
2039
+ if (existsSync3(p) && readdirSync(p).length > 0) return true;
1948
2040
  } catch {
1949
2041
  }
1950
2042
  }
@@ -1954,13 +2046,13 @@ function hasPriorUsage() {
1954
2046
  }
1955
2047
  }
1956
2048
  function countJsonlLines(filePath) {
1957
- if (!existsSync2(filePath)) return 0;
1958
- return readFileSync2(filePath, "utf-8").split("\n").filter((l) => l.trim().length > 0).length;
2049
+ if (!existsSync3(filePath)) return 0;
2050
+ return readFileSync3(filePath, "utf-8").split("\n").filter((l) => l.trim().length > 0).length;
1959
2051
  }
1960
2052
  function readRulesMetadata(filePath) {
1961
- if (!existsSync2(filePath)) return { count: 0, savedAt: null };
2053
+ if (!existsSync3(filePath)) return { count: 0, savedAt: null };
1962
2054
  try {
1963
- const raw = JSON.parse(readFileSync2(filePath, "utf-8"));
2055
+ const raw = JSON.parse(readFileSync3(filePath, "utf-8"));
1964
2056
  const rules = raw["rules"];
1965
2057
  const saved = raw["savedAt"];
1966
2058
  return {
@@ -1972,7 +2064,7 @@ function readRulesMetadata(filePath) {
1972
2064
  }
1973
2065
  }
1974
2066
  function checkDirAccess(dir) {
1975
- const exists = existsSync2(dir);
2067
+ const exists = existsSync3(dir);
1976
2068
  if (!exists) return { exists: false, writable: false };
1977
2069
  try {
1978
2070
  accessSync(dir, fsConstants.W_OK);
@@ -2032,10 +2124,10 @@ async function checkSqlite() {
2032
2124
  }
2033
2125
  function checkDataDirectory() {
2034
2126
  const rootPath = getNexusDataDir();
2035
- const rootExists = existsSync2(rootPath);
2127
+ const rootExists = existsSync3(rootPath);
2036
2128
  const subdirectories = DATA_SUBDIRECTORIES.map((name) => {
2037
- const fullPath = join2(rootPath, name);
2038
- const exists = existsSync2(fullPath);
2129
+ const fullPath = join3(rootPath, name);
2130
+ const exists = existsSync3(fullPath);
2039
2131
  return { name, path: fullPath, exists, writable: exists && isWritable(fullPath) };
2040
2132
  });
2041
2133
  return { rootExists, rootPath, subdirectories };
@@ -2084,6 +2176,7 @@ async function runDoctor() {
2084
2176
  const sqliteCheck = await checkSqlite();
2085
2177
  const dataDirectory = checkDataDirectory();
2086
2178
  const sandbox = checkSandbox();
2179
+ const harnessAlignment = checkHarnessAlignment();
2087
2180
  const hasAuthMethod = apiKeys.some((k) => k.configured) || clis.some((c) => c.installed && c.authenticated);
2088
2181
  const allHealthy = nodeVersion.supported && hasAuthMethod && mcpServerReady && clis.every((c) => c.installed && c.authenticated && c.versionStatus !== "unsupported");
2089
2182
  return {
@@ -2098,6 +2191,7 @@ async function runDoctor() {
2098
2191
  sqliteCheck,
2099
2192
  dataDirectory,
2100
2193
  sandbox,
2194
+ harnessAlignment,
2101
2195
  allHealthy,
2102
2196
  timestamp: new Date(getTimeProvider().now())
2103
2197
  };
@@ -2119,7 +2213,7 @@ async function runDoctorFix(result) {
2119
2213
  writeLine2("\u2500".repeat(40));
2120
2214
  let fixCount = 0;
2121
2215
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2122
- const { runSetup } = await import("./setup-command-VYV4RFWW.js");
2216
+ const { runSetup } = await import("./setup-command-R4BOEMLZ.js");
2123
2217
  const setupResult = runSetup({
2124
2218
  skipMcp: true,
2125
2219
  skipRules: true,
@@ -2166,7 +2260,7 @@ function initDataDirectories(dryRun = false) {
2166
2260
  ensureDir(NEXUS_DATA_DIR, dryRun, created, alreadyExisted);
2167
2261
  for (const subdir of DATA_SUBDIRECTORIES) {
2168
2262
  const mode = RESTRICTED_DIRS.has(subdir) ? 448 : void 0;
2169
- ensureDir(join3(NEXUS_DATA_DIR, subdir), dryRun, created, alreadyExisted, mode);
2263
+ ensureDir(join4(NEXUS_DATA_DIR, subdir), dryRun, created, alreadyExisted, mode);
2170
2264
  }
2171
2265
  return { success: true, rootPath: NEXUS_DATA_DIR, created, alreadyExisted, error: null };
2172
2266
  } catch (error) {
@@ -2175,7 +2269,7 @@ function initDataDirectories(dryRun = false) {
2175
2269
  }
2176
2270
  }
2177
2271
  function ensureDir(dirPath, dryRun, created, alreadyExisted, mode) {
2178
- if (existsSync3(dirPath)) {
2272
+ if (existsSync4(dirPath)) {
2179
2273
  alreadyExisted.push(dirPath);
2180
2274
  return;
2181
2275
  }
@@ -2229,4 +2323,4 @@ export {
2229
2323
  startStdioServer,
2230
2324
  closeServer
2231
2325
  };
2232
- //# sourceMappingURL=chunk-4N33QZLH.js.map
2326
+ //# sourceMappingURL=chunk-ZI6G7U7Y.js.map