nexus-agents 2.61.0 → 2.62.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.
- package/dist/{chunk-KNAPTURC.js → chunk-OJBW4II4.js} +2 -2
- package/dist/{chunk-NB6IYTMN.js → chunk-V7AFOKWC.js} +3 -3
- package/dist/{chunk-TRWIEUI2.js → chunk-X5WDX7L3.js} +2 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +219 -39
- package/dist/cli.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{setup-command-QJGB34JY.js → setup-command-FC67SJSP.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-KNAPTURC.js.map → chunk-OJBW4II4.js.map} +0 -0
- /package/dist/{chunk-NB6IYTMN.js.map → chunk-V7AFOKWC.js.map} +0 -0
- /package/dist/{chunk-TRWIEUI2.js.map → chunk-X5WDX7L3.js.map} +0 -0
- /package/dist/{setup-command-QJGB34JY.js.map → setup-command-FC67SJSP.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
checkSqlite,
|
|
9
9
|
defaultConfig,
|
|
10
10
|
initDataDirectories
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V7AFOKWC.js";
|
|
12
12
|
import {
|
|
13
13
|
BUILT_IN_EXPERTS
|
|
14
14
|
} from "./chunk-GJVHRJO2.js";
|
|
@@ -1933,4 +1933,4 @@ export {
|
|
|
1933
1933
|
setupCommand,
|
|
1934
1934
|
setupCommandAsync
|
|
1935
1935
|
};
|
|
1936
|
-
//# sourceMappingURL=chunk-
|
|
1936
|
+
//# sourceMappingURL=chunk-OJBW4II4.js.map
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-CLYZ7FWP.js";
|
|
39
39
|
|
|
40
40
|
// src/version.ts
|
|
41
|
-
var VERSION = true ? "2.
|
|
41
|
+
var VERSION = true ? "2.62.0" : "dev";
|
|
42
42
|
|
|
43
43
|
// src/config/schemas-core.ts
|
|
44
44
|
import { z } from "zod";
|
|
@@ -2025,7 +2025,7 @@ async function runDoctorFix(result) {
|
|
|
2025
2025
|
writeLine2("\u2500".repeat(40));
|
|
2026
2026
|
let fixCount = 0;
|
|
2027
2027
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
2028
|
-
const { runSetup } = await import("./setup-command-
|
|
2028
|
+
const { runSetup } = await import("./setup-command-FC67SJSP.js");
|
|
2029
2029
|
const setupResult = runSetup({
|
|
2030
2030
|
skipMcp: true,
|
|
2031
2031
|
skipRules: true,
|
|
@@ -2135,4 +2135,4 @@ export {
|
|
|
2135
2135
|
startStdioServer,
|
|
2136
2136
|
closeServer
|
|
2137
2137
|
};
|
|
2138
|
-
//# sourceMappingURL=chunk-
|
|
2138
|
+
//# sourceMappingURL=chunk-V7AFOKWC.js.map
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
clampTaskTtl,
|
|
69
69
|
getAvailabilityCache,
|
|
70
70
|
resolveFallback
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-V7AFOKWC.js";
|
|
72
72
|
import {
|
|
73
73
|
DEFAULTS
|
|
74
74
|
} from "./chunk-H43PABG4.js";
|
|
@@ -53661,4 +53661,4 @@ export {
|
|
|
53661
53661
|
detectBackend,
|
|
53662
53662
|
createTaskTracker
|
|
53663
53663
|
};
|
|
53664
|
-
//# sourceMappingURL=chunk-
|
|
53664
|
+
//# sourceMappingURL=chunk-X5WDX7L3.js.map
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ import "./chunk-6QU4DJYW.js";
|
|
|
16
16
|
import {
|
|
17
17
|
setupCommandAsync,
|
|
18
18
|
verifyCommand
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OJBW4II4.js";
|
|
20
20
|
import "./chunk-QGZBCD2A.js";
|
|
21
21
|
import {
|
|
22
22
|
AuthHandler,
|
|
@@ -142,7 +142,7 @@ import {
|
|
|
142
142
|
validateCommand,
|
|
143
143
|
validateWorkflow,
|
|
144
144
|
wrapInMarkdownFence
|
|
145
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-X5WDX7L3.js";
|
|
146
146
|
import "./chunk-ED6VQWNG.js";
|
|
147
147
|
import {
|
|
148
148
|
resolveToken
|
|
@@ -201,7 +201,7 @@ import {
|
|
|
201
201
|
loadConfig,
|
|
202
202
|
runDoctor,
|
|
203
203
|
validateNexusEnv
|
|
204
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-V7AFOKWC.js";
|
|
205
205
|
import {
|
|
206
206
|
DEFAULTS
|
|
207
207
|
} from "./chunk-H43PABG4.js";
|
|
@@ -17663,6 +17663,11 @@ var PARSE_ARGS_CONFIG = {
|
|
|
17663
17663
|
gitignore: {
|
|
17664
17664
|
type: "boolean",
|
|
17665
17665
|
default: false
|
|
17666
|
+
},
|
|
17667
|
+
// init --portable --mcp-config flag (#2308)
|
|
17668
|
+
"mcp-config": {
|
|
17669
|
+
type: "boolean",
|
|
17670
|
+
default: false
|
|
17666
17671
|
}
|
|
17667
17672
|
},
|
|
17668
17673
|
allowPositionals: true,
|
|
@@ -17721,18 +17726,135 @@ function isValidCommand(value) {
|
|
|
17721
17726
|
}
|
|
17722
17727
|
|
|
17723
17728
|
// src/cli-commands-handlers.ts
|
|
17724
|
-
import { existsSync as
|
|
17729
|
+
import { existsSync as existsSync20 } from "fs";
|
|
17725
17730
|
|
|
17726
17731
|
// src/cli/init-portable.ts
|
|
17727
17732
|
import {
|
|
17728
|
-
existsSync as
|
|
17733
|
+
existsSync as existsSync18,
|
|
17729
17734
|
mkdirSync as mkdirSync3,
|
|
17730
17735
|
readdirSync as readdirSync2,
|
|
17731
17736
|
statSync as statSync3,
|
|
17732
|
-
appendFileSync,
|
|
17733
|
-
readFileSync as
|
|
17737
|
+
appendFileSync as appendFileSync2,
|
|
17738
|
+
readFileSync as readFileSync11
|
|
17734
17739
|
} from "fs";
|
|
17735
|
-
import { resolve as resolve11, join as
|
|
17740
|
+
import { resolve as resolve11, join as join14, isAbsolute as isAbsolute2 } from "path";
|
|
17741
|
+
|
|
17742
|
+
// src/cli/mcp-config-emitter.ts
|
|
17743
|
+
import { existsSync as existsSync17, readFileSync as readFileSync10, writeFileSync as writeFileSync5, appendFileSync } from "fs";
|
|
17744
|
+
import { join as join13 } from "path";
|
|
17745
|
+
var MCP_CONFIG_FILENAME = ".mcp.json";
|
|
17746
|
+
var NEXUS_SERVER_KEY = "nexus-agents";
|
|
17747
|
+
function buildNexusServerEntry(dataDir) {
|
|
17748
|
+
return {
|
|
17749
|
+
command: "nexus-agents",
|
|
17750
|
+
args: ["--mode=server"],
|
|
17751
|
+
env: { NEXUS_DATA_DIR: dataDir }
|
|
17752
|
+
};
|
|
17753
|
+
}
|
|
17754
|
+
function entriesEqual(a, b) {
|
|
17755
|
+
if (a.command !== b.command) return false;
|
|
17756
|
+
if (a.args.length !== b.args.length) return false;
|
|
17757
|
+
for (let i = 0; i < a.args.length; i++) if (a.args[i] !== b.args[i]) return false;
|
|
17758
|
+
const aEnv = a.env ?? {};
|
|
17759
|
+
const bEnv = b.env ?? {};
|
|
17760
|
+
const aKeys = Object.keys(aEnv);
|
|
17761
|
+
const bKeys = Object.keys(bEnv);
|
|
17762
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
17763
|
+
for (const k of aKeys) if (aEnv[k] !== bEnv[k]) return false;
|
|
17764
|
+
return true;
|
|
17765
|
+
}
|
|
17766
|
+
function loadExistingConfig(path23) {
|
|
17767
|
+
if (!existsSync17(path23)) return { ok: true, value: void 0 };
|
|
17768
|
+
let raw;
|
|
17769
|
+
try {
|
|
17770
|
+
raw = readFileSync10(path23, "utf-8");
|
|
17771
|
+
} catch (e) {
|
|
17772
|
+
return { ok: false, error: e instanceof Error ? e.message : String(e) };
|
|
17773
|
+
}
|
|
17774
|
+
try {
|
|
17775
|
+
const parsed = JSON.parse(raw);
|
|
17776
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
17777
|
+
return { ok: false, error: `${path23}: top-level JSON must be an object` };
|
|
17778
|
+
}
|
|
17779
|
+
return { ok: true, value: parsed };
|
|
17780
|
+
} catch (e) {
|
|
17781
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
17782
|
+
return { ok: false, error: `${path23}: invalid JSON \u2014 ${msg}` };
|
|
17783
|
+
}
|
|
17784
|
+
}
|
|
17785
|
+
function decideEmission(existing, desired, force) {
|
|
17786
|
+
if (existing === void 0) {
|
|
17787
|
+
return { kind: "write", nextConfig: { mcpServers: { [NEXUS_SERVER_KEY]: desired } } };
|
|
17788
|
+
}
|
|
17789
|
+
const servers = existing.mcpServers ?? {};
|
|
17790
|
+
const current = servers[NEXUS_SERVER_KEY];
|
|
17791
|
+
if (current !== void 0 && entriesEqual(current, desired)) {
|
|
17792
|
+
return { kind: "noop" };
|
|
17793
|
+
}
|
|
17794
|
+
if (current !== void 0 && !force) {
|
|
17795
|
+
return {
|
|
17796
|
+
kind: "refuse",
|
|
17797
|
+
reason: `existing ${NEXUS_SERVER_KEY} entry differs; pass --force to overwrite`
|
|
17798
|
+
};
|
|
17799
|
+
}
|
|
17800
|
+
const nextServers = { ...servers, [NEXUS_SERVER_KEY]: desired };
|
|
17801
|
+
return { kind: "write", nextConfig: { ...existing, mcpServers: nextServers } };
|
|
17802
|
+
}
|
|
17803
|
+
function autoGitignoreMcpConfig(workspaceDir, dryRun) {
|
|
17804
|
+
const gitDir = join13(workspaceDir, ".git");
|
|
17805
|
+
if (!existsSync17(gitDir)) return false;
|
|
17806
|
+
const gitignorePath = join13(workspaceDir, ".gitignore");
|
|
17807
|
+
let existing = "";
|
|
17808
|
+
if (existsSync17(gitignorePath)) {
|
|
17809
|
+
existing = readFileSync10(gitignorePath, "utf-8");
|
|
17810
|
+
const already = existing.split("\n").some((l) => l.trim() === MCP_CONFIG_FILENAME || l.trim() === `/${MCP_CONFIG_FILENAME}`);
|
|
17811
|
+
if (already) return false;
|
|
17812
|
+
}
|
|
17813
|
+
if (!dryRun) {
|
|
17814
|
+
const sep3 = existing.length > 0 && !existing.endsWith("\n") ? "\n" : "";
|
|
17815
|
+
appendFileSync(gitignorePath, `${sep3}${MCP_CONFIG_FILENAME}
|
|
17816
|
+
`, "utf-8");
|
|
17817
|
+
}
|
|
17818
|
+
return true;
|
|
17819
|
+
}
|
|
17820
|
+
function emitMcpConfig(options) {
|
|
17821
|
+
const mcpConfigPath = join13(options.workspaceDir, MCP_CONFIG_FILENAME);
|
|
17822
|
+
const dryRun = options.dryRun === true;
|
|
17823
|
+
const force = options.force === true;
|
|
17824
|
+
const desired = buildNexusServerEntry(options.dataDir);
|
|
17825
|
+
const loaded = loadExistingConfig(mcpConfigPath);
|
|
17826
|
+
if (!loaded.ok) return makeFailure(mcpConfigPath, loaded.error);
|
|
17827
|
+
const decision = decideEmission(loaded.value, desired, force);
|
|
17828
|
+
if (decision.kind === "refuse") return makeFailure(mcpConfigPath, decision.reason);
|
|
17829
|
+
if (decision.kind === "noop") {
|
|
17830
|
+
return makeSuccess({
|
|
17831
|
+
mcpConfigPath,
|
|
17832
|
+
written: false,
|
|
17833
|
+
alreadyMatched: true,
|
|
17834
|
+
gitignoreUpdated: false
|
|
17835
|
+
});
|
|
17836
|
+
}
|
|
17837
|
+
if (!dryRun) {
|
|
17838
|
+
writeFileSync5(mcpConfigPath, JSON.stringify(decision.nextConfig, null, 2) + "\n", "utf-8");
|
|
17839
|
+
}
|
|
17840
|
+
const gitignoreUpdated = autoGitignoreMcpConfig(options.workspaceDir, dryRun);
|
|
17841
|
+
return makeSuccess({ mcpConfigPath, written: true, alreadyMatched: false, gitignoreUpdated });
|
|
17842
|
+
}
|
|
17843
|
+
function makeSuccess(opts) {
|
|
17844
|
+
return { success: true, error: null, ...opts };
|
|
17845
|
+
}
|
|
17846
|
+
function makeFailure(mcpConfigPath, error) {
|
|
17847
|
+
return {
|
|
17848
|
+
success: false,
|
|
17849
|
+
mcpConfigPath,
|
|
17850
|
+
written: false,
|
|
17851
|
+
alreadyMatched: false,
|
|
17852
|
+
gitignoreUpdated: false,
|
|
17853
|
+
error
|
|
17854
|
+
};
|
|
17855
|
+
}
|
|
17856
|
+
|
|
17857
|
+
// src/cli/init-portable.ts
|
|
17736
17858
|
var DEFAULT_PORTABLE_DIRNAME = ".nexus-agents";
|
|
17737
17859
|
var RESTRICTED_SUBDIRS = /* @__PURE__ */ new Set(["auth"]);
|
|
17738
17860
|
function resolveTargetPath(rawPath) {
|
|
@@ -17742,13 +17864,13 @@ function resolveTargetPath(rawPath) {
|
|
|
17742
17864
|
return isAbsolute2(rawPath) ? rawPath : resolve11(process.cwd(), rawPath);
|
|
17743
17865
|
}
|
|
17744
17866
|
function isNonEmpty(dir) {
|
|
17745
|
-
if (!
|
|
17867
|
+
if (!existsSync18(dir)) return false;
|
|
17746
17868
|
const stat2 = statSync3(dir);
|
|
17747
17869
|
if (!stat2.isDirectory()) return true;
|
|
17748
17870
|
return readdirSync2(dir).length > 0;
|
|
17749
17871
|
}
|
|
17750
17872
|
function ensureDir(path23, dryRun, created, alreadyExisted, mode) {
|
|
17751
|
-
if (
|
|
17873
|
+
if (existsSync18(path23)) {
|
|
17752
17874
|
alreadyExisted.push(path23);
|
|
17753
17875
|
return;
|
|
17754
17876
|
}
|
|
@@ -17758,37 +17880,37 @@ function ensureDir(path23, dryRun, created, alreadyExisted, mode) {
|
|
|
17758
17880
|
created.push(path23);
|
|
17759
17881
|
}
|
|
17760
17882
|
function maybeUpdateGitignore(workspaceDir, portableDirName, dryRun) {
|
|
17761
|
-
const gitDir =
|
|
17762
|
-
if (!
|
|
17763
|
-
const gitignorePath =
|
|
17883
|
+
const gitDir = join14(workspaceDir, ".git");
|
|
17884
|
+
if (!existsSync18(gitDir)) return false;
|
|
17885
|
+
const gitignorePath = join14(workspaceDir, ".gitignore");
|
|
17764
17886
|
const entry = `${portableDirName}/`;
|
|
17765
17887
|
let existing = "";
|
|
17766
|
-
if (
|
|
17767
|
-
existing =
|
|
17888
|
+
if (existsSync18(gitignorePath)) {
|
|
17889
|
+
existing = readFileSync11(gitignorePath, "utf-8");
|
|
17768
17890
|
if (existing.split("\n").some((l) => l.trim() === entry || l.trim() === portableDirName)) {
|
|
17769
17891
|
return false;
|
|
17770
17892
|
}
|
|
17771
17893
|
}
|
|
17772
17894
|
if (!dryRun) {
|
|
17773
17895
|
const sep3 = existing.length > 0 && !existing.endsWith("\n") ? "\n" : "";
|
|
17774
|
-
|
|
17896
|
+
appendFileSync2(gitignorePath, `${sep3}${entry}
|
|
17775
17897
|
`, "utf-8");
|
|
17776
17898
|
}
|
|
17777
17899
|
return true;
|
|
17778
17900
|
}
|
|
17779
17901
|
function inspectTarget(target) {
|
|
17780
|
-
const exists =
|
|
17902
|
+
const exists = existsSync18(target);
|
|
17781
17903
|
if (!exists) return { exists: false, nonEmpty: false, isExistingNexusDir: false };
|
|
17782
17904
|
const nonEmpty = isNonEmpty(target);
|
|
17783
17905
|
const stat2 = statSync3(target);
|
|
17784
|
-
const isExistingNexusDir = stat2.isDirectory() &&
|
|
17906
|
+
const isExistingNexusDir = stat2.isDirectory() && existsSync18(join14(target, "audit"));
|
|
17785
17907
|
return { exists, nonEmpty, isExistingNexusDir };
|
|
17786
17908
|
}
|
|
17787
17909
|
function createDataLayout(target, dryRun, created, alreadyExisted) {
|
|
17788
17910
|
ensureDir(target, dryRun, created, alreadyExisted);
|
|
17789
17911
|
for (const subdir of DATA_SUBDIRECTORIES) {
|
|
17790
17912
|
const mode = RESTRICTED_SUBDIRS.has(subdir) ? 448 : void 0;
|
|
17791
|
-
ensureDir(
|
|
17913
|
+
ensureDir(join14(target, subdir), dryRun, created, alreadyExisted, mode);
|
|
17792
17914
|
}
|
|
17793
17915
|
}
|
|
17794
17916
|
function makeResult(opts) {
|
|
@@ -17799,6 +17921,7 @@ function makeResult(opts) {
|
|
|
17799
17921
|
alreadyExisted: opts.alreadyExisted,
|
|
17800
17922
|
skipped: opts.skipped ?? false,
|
|
17801
17923
|
gitignoreUpdated: opts.gitignoreUpdated ?? false,
|
|
17924
|
+
...opts.mcpConfig !== void 0 ? { mcpConfig: opts.mcpConfig } : {},
|
|
17802
17925
|
error: opts.error ?? null
|
|
17803
17926
|
};
|
|
17804
17927
|
}
|
|
@@ -17808,6 +17931,25 @@ function applyGitignoreOption(target, options, dryRun) {
|
|
|
17808
17931
|
const portableName = target.slice(workspaceDir.length + 1);
|
|
17809
17932
|
return maybeUpdateGitignore(workspaceDir, portableName, dryRun);
|
|
17810
17933
|
}
|
|
17934
|
+
function applyMcpConfigOption(target, options, dryRun) {
|
|
17935
|
+
if (options.mcpConfig !== true) return void 0;
|
|
17936
|
+
const workspaceDir = resolve11(target, "..");
|
|
17937
|
+
return emitMcpConfig({
|
|
17938
|
+
workspaceDir,
|
|
17939
|
+
dataDir: target,
|
|
17940
|
+
force: options.force === true,
|
|
17941
|
+
dryRun
|
|
17942
|
+
});
|
|
17943
|
+
}
|
|
17944
|
+
function buildSuccessResult(base, flags, mcpConfig) {
|
|
17945
|
+
if (mcpConfig === void 0) {
|
|
17946
|
+
return makeResult({ ...base, ...flags, success: true });
|
|
17947
|
+
}
|
|
17948
|
+
if (mcpConfig.success) {
|
|
17949
|
+
return makeResult({ ...base, ...flags, success: true, mcpConfig });
|
|
17950
|
+
}
|
|
17951
|
+
return makeResult({ ...base, ...flags, success: false, mcpConfig, error: mcpConfig.error });
|
|
17952
|
+
}
|
|
17811
17953
|
function initPortable(options = {}) {
|
|
17812
17954
|
const created = [];
|
|
17813
17955
|
const alreadyExisted = [];
|
|
@@ -17819,7 +17961,11 @@ function initPortable(options = {}) {
|
|
|
17819
17961
|
const state = inspectTarget(target);
|
|
17820
17962
|
if (state.isExistingNexusDir && !force) {
|
|
17821
17963
|
createDataLayout(target, dryRun, created, alreadyExisted);
|
|
17822
|
-
return
|
|
17964
|
+
return buildSuccessResult(
|
|
17965
|
+
base,
|
|
17966
|
+
{ skipped: true },
|
|
17967
|
+
applyMcpConfigOption(target, options, dryRun)
|
|
17968
|
+
);
|
|
17823
17969
|
}
|
|
17824
17970
|
if (state.nonEmpty && !state.isExistingNexusDir && !force) {
|
|
17825
17971
|
const error = `target ${target} already exists and is not empty; pass --force to use anyway`;
|
|
@@ -17827,37 +17973,62 @@ function initPortable(options = {}) {
|
|
|
17827
17973
|
}
|
|
17828
17974
|
createDataLayout(target, dryRun, created, alreadyExisted);
|
|
17829
17975
|
const gitignoreUpdated = applyGitignoreOption(target, options, dryRun);
|
|
17830
|
-
return
|
|
17976
|
+
return buildSuccessResult(
|
|
17977
|
+
base,
|
|
17978
|
+
{ gitignoreUpdated },
|
|
17979
|
+
applyMcpConfigOption(target, options, dryRun)
|
|
17980
|
+
);
|
|
17831
17981
|
} catch (error) {
|
|
17832
17982
|
const msg = error instanceof Error ? error.message : String(error);
|
|
17833
17983
|
return makeResult({ ...base, success: false, error: msg });
|
|
17834
17984
|
}
|
|
17835
17985
|
}
|
|
17986
|
+
function renderMcpConfigLines(mcpConfig) {
|
|
17987
|
+
const lines = [];
|
|
17988
|
+
if (mcpConfig.alreadyMatched) {
|
|
17989
|
+
lines.push(`\u2713 .mcp.json already up to date: ${mcpConfig.mcpConfigPath}`);
|
|
17990
|
+
} else if (mcpConfig.written) {
|
|
17991
|
+
lines.push(`\u2713 Wrote MCP config: ${mcpConfig.mcpConfigPath}`);
|
|
17992
|
+
}
|
|
17993
|
+
if (mcpConfig.gitignoreUpdated) {
|
|
17994
|
+
lines.push(`\u2713 Added .mcp.json to .gitignore (per-machine; do not commit)`);
|
|
17995
|
+
}
|
|
17996
|
+
return lines;
|
|
17997
|
+
}
|
|
17998
|
+
function renderMcpConfigCaveat(mcpConfig) {
|
|
17999
|
+
if (mcpConfig?.written !== true) return [];
|
|
18000
|
+
return [
|
|
18001
|
+
"",
|
|
18002
|
+
"Note: .mcp.json contains an absolute path to your local data dir.",
|
|
18003
|
+
"It is per-machine and should NOT be committed \u2014 collaborators should",
|
|
18004
|
+
"run `nexus-agents init --portable --mcp-config` themselves."
|
|
18005
|
+
];
|
|
18006
|
+
}
|
|
17836
18007
|
function formatInitPortableMessage(result, dryRun) {
|
|
17837
18008
|
if (!result.success) {
|
|
17838
18009
|
return `init --portable failed: ${result.error ?? "unknown error"}
|
|
17839
18010
|
`;
|
|
17840
18011
|
}
|
|
17841
|
-
const lines = [];
|
|
17842
18012
|
if (dryRun) {
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
lines.push(`\u2713 Already initialized: ${result.absolutePath}`);
|
|
17849
|
-
} else {
|
|
17850
|
-
lines.push(`\u2713 Created: ${result.absolutePath}`);
|
|
17851
|
-
}
|
|
17852
|
-
if (result.gitignoreUpdated) {
|
|
17853
|
-
lines.push(`\u2713 Added entry to .gitignore`);
|
|
18013
|
+
const lines2 = [
|
|
18014
|
+
`(dry-run) would create ${String(result.created.length)} entries under:`,
|
|
18015
|
+
` ${result.absolutePath}`
|
|
18016
|
+
];
|
|
18017
|
+
return lines2.join("\n") + "\n";
|
|
17854
18018
|
}
|
|
18019
|
+
const lines = [];
|
|
18020
|
+
lines.push(
|
|
18021
|
+
result.skipped ? `\u2713 Already initialized: ${result.absolutePath}` : `\u2713 Created: ${result.absolutePath}`
|
|
18022
|
+
);
|
|
18023
|
+
if (result.gitignoreUpdated) lines.push(`\u2713 Added entry to .gitignore`);
|
|
18024
|
+
if (result.mcpConfig !== void 0) lines.push(...renderMcpConfigLines(result.mcpConfig));
|
|
17855
18025
|
lines.push("");
|
|
17856
18026
|
lines.push("Activate by exporting:");
|
|
17857
18027
|
lines.push(` export NEXUS_DATA_DIR=${result.absolutePath}`);
|
|
17858
18028
|
lines.push("");
|
|
17859
18029
|
lines.push("Or one-off:");
|
|
17860
18030
|
lines.push(` NEXUS_DATA_DIR=${result.absolutePath} nexus-agents <cmd>`);
|
|
18031
|
+
lines.push(...renderMcpConfigCaveat(result.mcpConfig));
|
|
17861
18032
|
return lines.join("\n") + "\n";
|
|
17862
18033
|
}
|
|
17863
18034
|
|
|
@@ -20672,8 +20843,8 @@ function printFirstRunHint() {
|
|
|
20672
20843
|
const isTTY = process.stderr.isTTY;
|
|
20673
20844
|
if (!isTTY) return;
|
|
20674
20845
|
const dataDir = getNexusDataDir();
|
|
20675
|
-
const hasConfig =
|
|
20676
|
-
if (
|
|
20846
|
+
const hasConfig = existsSync20("./nexus-agents.yaml") || existsSync20("./nexus-agents.yml");
|
|
20847
|
+
if (existsSync20(dataDir) || hasConfig) return;
|
|
20677
20848
|
process.stderr.write(
|
|
20678
20849
|
"\n\x1B[36mnexus-agents\x1B[0m: First time? Run \x1B[1mnexus-agents setup\x1B[0m to configure.\n\n"
|
|
20679
20850
|
);
|
|
@@ -20851,7 +21022,8 @@ function handleInitCommand(args) {
|
|
|
20851
21022
|
...targetPath !== void 0 && targetPath !== "" ? { path: targetPath } : {},
|
|
20852
21023
|
force: args.options.force,
|
|
20853
21024
|
dryRun: args.options.dryRun,
|
|
20854
|
-
gitignore: args.options.gitignore ?? false
|
|
21025
|
+
gitignore: args.options.gitignore ?? false,
|
|
21026
|
+
mcpConfig: args.options.mcpConfig ?? false
|
|
20855
21027
|
});
|
|
20856
21028
|
process.stdout.write(formatInitPortableMessage(result, args.options.dryRun));
|
|
20857
21029
|
process.exit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
|
|
@@ -22329,7 +22501,7 @@ function handleStatusCommand2(args) {
|
|
|
22329
22501
|
|
|
22330
22502
|
// src/cli/scenario-command.ts
|
|
22331
22503
|
import { readdir as readdir4 } from "fs/promises";
|
|
22332
|
-
import { join as
|
|
22504
|
+
import { join as join16, resolve as resolve14 } from "path";
|
|
22333
22505
|
|
|
22334
22506
|
// src/testing/e2e/scenario-runner.ts
|
|
22335
22507
|
import { readFile as readFile7 } from "fs/promises";
|
|
@@ -22699,7 +22871,7 @@ async function handleRun(args) {
|
|
|
22699
22871
|
process.exit(EXIT_CODES.SERVER_START_FAILED);
|
|
22700
22872
|
}
|
|
22701
22873
|
const runner = createScenarioRunner();
|
|
22702
|
-
const fixturePath =
|
|
22874
|
+
const fixturePath = join16(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
|
|
22703
22875
|
try {
|
|
22704
22876
|
const fixture = await runner.loadFixture(fixturePath);
|
|
22705
22877
|
const result = await runner.run(fixture);
|
|
@@ -23410,7 +23582,15 @@ function buildOptions(values) {
|
|
|
23410
23582
|
...buildSweBenchOptions(values),
|
|
23411
23583
|
...buildAtbenchOptions(values),
|
|
23412
23584
|
...buildLearningMetricsOptions(values),
|
|
23413
|
-
...buildSetupOptions(values)
|
|
23585
|
+
...buildSetupOptions(values),
|
|
23586
|
+
...buildInitOptions(values)
|
|
23587
|
+
};
|
|
23588
|
+
}
|
|
23589
|
+
function buildInitOptions(values) {
|
|
23590
|
+
return {
|
|
23591
|
+
portable: values.portable,
|
|
23592
|
+
gitignore: values.gitignore,
|
|
23593
|
+
mcpConfig: values["mcp-config"]
|
|
23414
23594
|
};
|
|
23415
23595
|
}
|
|
23416
23596
|
function parseCliArgs(args = process.argv.slice(2)) {
|