nexarch 0.8.1 → 0.8.3
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/commands/init-project.js +28 -17
- package/dist/lib/mcp.js +1 -1
- package/package.json +1 -1
|
@@ -489,24 +489,19 @@ function resolveWorkspaceDirs(rootDir, workspaces) {
|
|
|
489
489
|
}
|
|
490
490
|
return dirs;
|
|
491
491
|
}
|
|
492
|
-
// Collect all package.json paths: root + workspace packages +
|
|
492
|
+
// Collect all package.json paths: root + workspace packages + fallback scans.
|
|
493
493
|
function findPackageJsonPaths(rootDir) {
|
|
494
494
|
const paths = [];
|
|
495
|
+
const seen = new Set();
|
|
495
496
|
const rootPkgPath = join(rootDir, "package.json");
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (existsSync(pkgPath))
|
|
505
|
-
paths.push(pkgPath);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
// Non-workspace: scan up to 2 levels deep
|
|
497
|
+
const pushPath = (pkgPath) => {
|
|
498
|
+
const norm = pkgPath.replace(/\\/g, "/");
|
|
499
|
+
if (seen.has(norm))
|
|
500
|
+
return;
|
|
501
|
+
seen.add(norm);
|
|
502
|
+
paths.push(pkgPath);
|
|
503
|
+
};
|
|
504
|
+
const scanTwoLevels = () => {
|
|
510
505
|
try {
|
|
511
506
|
for (const l1 of readdirSync(rootDir)) {
|
|
512
507
|
if (SKIP_DIRS.has(l1) || l1.startsWith("."))
|
|
@@ -517,7 +512,7 @@ function findPackageJsonPaths(rootDir) {
|
|
|
517
512
|
continue;
|
|
518
513
|
const l1Pkg = join(l1Path, "package.json");
|
|
519
514
|
if (existsSync(l1Pkg)) {
|
|
520
|
-
|
|
515
|
+
pushPath(l1Pkg);
|
|
521
516
|
continue;
|
|
522
517
|
}
|
|
523
518
|
for (const l2 of readdirSync(l1Path)) {
|
|
@@ -529,7 +524,7 @@ function findPackageJsonPaths(rootDir) {
|
|
|
529
524
|
continue;
|
|
530
525
|
const l2Pkg = join(l2Path, "package.json");
|
|
531
526
|
if (existsSync(l2Pkg))
|
|
532
|
-
|
|
527
|
+
pushPath(l2Pkg);
|
|
533
528
|
}
|
|
534
529
|
catch { }
|
|
535
530
|
}
|
|
@@ -538,7 +533,23 @@ function findPackageJsonPaths(rootDir) {
|
|
|
538
533
|
}
|
|
539
534
|
}
|
|
540
535
|
catch { }
|
|
536
|
+
};
|
|
537
|
+
if (existsSync(rootPkgPath)) {
|
|
538
|
+
pushPath(rootPkgPath);
|
|
539
|
+
const rootPkg = readRootPackage(rootPkgPath);
|
|
540
|
+
if (rootPkg.workspaces) {
|
|
541
|
+
for (const wsDir of resolveWorkspaceDirs(rootDir, rootPkg.workspaces)) {
|
|
542
|
+
const pkgPath = join(wsDir, "package.json");
|
|
543
|
+
if (existsSync(pkgPath))
|
|
544
|
+
pushPath(pkgPath);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
// Keep fallback in case workspace globs are incomplete.
|
|
548
|
+
scanTwoLevels();
|
|
549
|
+
return paths;
|
|
541
550
|
}
|
|
551
|
+
// No root package.json: still detect monorepos/components by scanning children.
|
|
552
|
+
scanTwoLevels();
|
|
542
553
|
return paths;
|
|
543
554
|
}
|
|
544
555
|
// ─── Ecosystem scanners ───────────────────────────────────────────────────────
|
package/dist/lib/mcp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import https from "https";
|
|
2
2
|
import { requireCredentials } from "./credentials.js";
|
|
3
3
|
const MCP_GATEWAY_URL = "https://mcp.nexarch.ai";
|
|
4
|
-
const REQUEST_TIMEOUT_MS =
|
|
4
|
+
const REQUEST_TIMEOUT_MS = 90 * 1000;
|
|
5
5
|
async function callMcpRpc(method, params = {}, options = {}) {
|
|
6
6
|
const creds = requireCredentials();
|
|
7
7
|
const companyId = options.companyId ?? creds.companyId;
|