agent-enderun 0.1.3 → 0.1.4
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/.enderun/config.json
CHANGED
package/bin/cli.js
CHANGED
|
@@ -369,6 +369,12 @@ async function initCommand(selectedAdapter) {
|
|
|
369
369
|
for (const item of filesToProcess) {
|
|
370
370
|
const src = path.join(sourceDir, item);
|
|
371
371
|
let dest = path.join(targetDir, item);
|
|
372
|
+
|
|
373
|
+
// Detect target project scope
|
|
374
|
+
let targetScope = "";
|
|
375
|
+
if (targetPkg.name && targetPkg.name.startsWith("@")) {
|
|
376
|
+
targetScope = targetPkg.name.split("/")[0];
|
|
377
|
+
}
|
|
372
378
|
|
|
373
379
|
// FORCED CLEANUP: Delete existing framework directories in target before copying
|
|
374
380
|
if (["packages/framework-mcp", "packages/shared-types", ".enderun", ".gemini", ".claude"].includes(item)) {
|
|
@@ -403,7 +409,7 @@ async function initCommand(selectedAdapter) {
|
|
|
403
409
|
// When copying framework dir, skip logs and project-specific state
|
|
404
410
|
const skipFiles = (item === ".enderun") ? ["logs", "PROJECT_MEMORY.md", "BRAIN_DASHBOARD.md", "PROJECT_MEMORY.lock"] : [];
|
|
405
411
|
const isDocs = item === "docs";
|
|
406
|
-
copyDir(src, dest, new Set(skipFiles), isDocs, targetBase);
|
|
412
|
+
copyDir(src, dest, new Set(skipFiles), isDocs, targetBase, targetScope);
|
|
407
413
|
} else {
|
|
408
414
|
// Special files handling
|
|
409
415
|
if (item === "package.json") continue;
|
|
@@ -428,7 +434,7 @@ async function initCommand(selectedAdapter) {
|
|
|
428
434
|
if (ext === ".json") {
|
|
429
435
|
try {
|
|
430
436
|
const json = JSON.parse(content);
|
|
431
|
-
content = JSON.stringify(sanitizeJson(json), null, 2);
|
|
437
|
+
content = JSON.stringify(sanitizeJson(json, targetScope), null, 2);
|
|
432
438
|
} catch (e) {
|
|
433
439
|
content = content.replace(/workspace:[^"'\s]*/g, "*");
|
|
434
440
|
}
|
|
@@ -453,7 +459,7 @@ async function initCommand(selectedAdapter) {
|
|
|
453
459
|
initializeMemory(finalMemoryPath, targetBase);
|
|
454
460
|
|
|
455
461
|
// Deep clean ALL package.json files in target packages directory
|
|
456
|
-
deepCleanProtocols(path.join(targetDir, "packages"));
|
|
462
|
+
deepCleanProtocols(path.join(targetDir, "packages"), targetScope);
|
|
457
463
|
|
|
458
464
|
// Initialize git if missing
|
|
459
465
|
if (!fs.existsSync(path.join(targetDir, ".git"))) {
|
|
@@ -530,19 +536,19 @@ async function initCommand(selectedAdapter) {
|
|
|
530
536
|
/**
|
|
531
537
|
* Recursively scans a directory for package.json files and removes workspace: protocols.
|
|
532
538
|
*/
|
|
533
|
-
function deepCleanProtocols(dir) {
|
|
539
|
+
function deepCleanProtocols(dir, targetScope = "") {
|
|
534
540
|
if (!fs.existsSync(dir)) return;
|
|
535
541
|
|
|
536
542
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
537
543
|
for (const entry of entries) {
|
|
538
544
|
const fullPath = path.join(dir, entry.name);
|
|
539
545
|
if (entry.isDirectory()) {
|
|
540
|
-
deepCleanProtocols(fullPath);
|
|
546
|
+
deepCleanProtocols(fullPath, targetScope);
|
|
541
547
|
} else if (entry.name === "package.json") {
|
|
542
548
|
try {
|
|
543
549
|
const content = fs.readFileSync(fullPath, "utf8");
|
|
544
550
|
const json = JSON.parse(content);
|
|
545
|
-
const cleaned = JSON.stringify(sanitizeJson(json), null, 2);
|
|
551
|
+
const cleaned = JSON.stringify(sanitizeJson(json, targetScope), null, 2);
|
|
546
552
|
fs.writeFileSync(fullPath, cleaned);
|
|
547
553
|
} catch (e) {
|
|
548
554
|
// ignore malformed json
|
|
@@ -623,21 +629,36 @@ function checkCommand() {
|
|
|
623
629
|
}
|
|
624
630
|
}
|
|
625
631
|
|
|
626
|
-
function sanitizeJson(obj) {
|
|
632
|
+
function sanitizeJson(obj, targetScope = "") {
|
|
627
633
|
if (typeof obj !== "object" || obj === null) return obj;
|
|
628
|
-
if (Array.isArray(obj)) return obj.map(sanitizeJson);
|
|
634
|
+
if (Array.isArray(obj)) return obj.map(item => sanitizeJson(item, targetScope));
|
|
629
635
|
const cleaned = {};
|
|
630
636
|
for (const [key, value] of Object.entries(obj)) {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
637
|
+
let finalKey = key;
|
|
638
|
+
let finalValue = value;
|
|
639
|
+
|
|
640
|
+
// Replace scope if needed
|
|
641
|
+
if (targetScope) {
|
|
642
|
+
if (typeof key === "string" && key.startsWith("@ai-enderun/")) {
|
|
643
|
+
finalKey = key.replace("@ai-enderun/", `${targetScope}/`);
|
|
644
|
+
}
|
|
645
|
+
if (typeof value === "string") {
|
|
646
|
+
if (value.startsWith("@ai-enderun/")) {
|
|
647
|
+
finalValue = value.replace("@ai-enderun/", `${targetScope}/`);
|
|
648
|
+
} else if (value.startsWith("workspace:")) {
|
|
649
|
+
finalValue = "*";
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
} else if (typeof value === "string" && value.startsWith("workspace:")) {
|
|
653
|
+
finalValue = "*";
|
|
635
654
|
}
|
|
655
|
+
|
|
656
|
+
cleaned[finalKey] = (typeof finalValue === "object") ? sanitizeJson(finalValue, targetScope) : finalValue;
|
|
636
657
|
}
|
|
637
658
|
return cleaned;
|
|
638
659
|
}
|
|
639
660
|
|
|
640
|
-
function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, frameworkDir = ".enderun") {
|
|
661
|
+
function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, frameworkDir = ".enderun", targetScope = "") {
|
|
641
662
|
const DEFAULT_SKIP = new Set(["node_modules", ".git", ".DS_Store", "package-lock.json"]);
|
|
642
663
|
const actualSkip = new Set([...DEFAULT_SKIP, ...skipSet]);
|
|
643
664
|
|
|
@@ -652,7 +673,7 @@ function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, framewo
|
|
|
652
673
|
const destPath = path.join(dest, entry.name);
|
|
653
674
|
|
|
654
675
|
if (entry.isDirectory()) {
|
|
655
|
-
copyDir(srcPath, destPath, skipSet, nonDestructive, frameworkDir);
|
|
676
|
+
copyDir(srcPath, destPath, skipSet, nonDestructive, frameworkDir, targetScope);
|
|
656
677
|
} else {
|
|
657
678
|
if (nonDestructive && fs.existsSync(destPath)) {
|
|
658
679
|
return;
|
|
@@ -669,7 +690,7 @@ function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, framewo
|
|
|
669
690
|
if (ext === ".json") {
|
|
670
691
|
try {
|
|
671
692
|
const json = JSON.parse(content);
|
|
672
|
-
content = JSON.stringify(sanitizeJson(json), null, 2);
|
|
693
|
+
content = JSON.stringify(sanitizeJson(json, targetScope), null, 2);
|
|
673
694
|
} catch (e) {
|
|
674
695
|
content = content.replace(/workspace:[^"'\s]*/g, "*");
|
|
675
696
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-enderun",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/*"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {},
|
|
18
18
|
"devDependencies": {},
|
|
19
19
|
"enderun": {
|
|
20
|
-
"version": "0.1.
|
|
20
|
+
"version": "0.1.4",
|
|
21
21
|
"initializedAt": "2026-05-09T13:24:27.472Z"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.4",
|
|
3
3
|
"last_updated": "2026-05-09T13:04:00Z",
|
|
4
4
|
"contract_hash": "daf1d688875061ef66697f39ac2449a34631e9b93926ed3e694b4e4ac7423d98",
|
|
5
5
|
"breaking_changes": [
|
|
6
|
-
{ "version": "0.1.
|
|
6
|
+
{ "version": "0.1.4", "description": "Initial framework setup" }
|
|
7
7
|
],
|
|
8
8
|
"deprecated_versions": []
|
|
9
9
|
}
|