agent-enderun 0.1.0 → 0.1.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.
@@ -2,5 +2,5 @@
2
2
  "logLevel": "info",
3
3
  "outputFormat": "text",
4
4
  "defaultProfile": "Lightweight",
5
- "version": "0.1.0"
5
+ "version": "0.1.2"
6
6
  }
package/bin/cli.js CHANGED
@@ -370,7 +370,18 @@ async function initCommand(selectedAdapter) {
370
370
  const src = path.join(sourceDir, item);
371
371
  let dest = path.join(targetDir, item);
372
372
 
373
- // Clean up existing lockfiles in target to prevent EUNSUPPORTEDPROTOCOL from previous failed runs
373
+ // FORCED CLEANUP: Delete existing framework directories in target before copying
374
+ if (["packages/framework-mcp", "packages/shared-types", ".enderun", ".gemini", ".claude"].includes(item)) {
375
+ if (fs.existsSync(dest)) {
376
+ try {
377
+ fs.rmSync(dest, { recursive: true, force: true });
378
+ } catch (e) {
379
+ // ignore
380
+ }
381
+ }
382
+ }
383
+
384
+ // Clean up existing lockfiles in target
374
385
  if (fs.existsSync(dest)) {
375
386
  const lockFile = path.join(dest, "package-lock.json");
376
387
  if (fs.existsSync(lockFile)) {
@@ -414,7 +425,16 @@ async function initCommand(selectedAdapter) {
414
425
  content = content.replace(/\{\{ADAPTER\}\}/g, selectedAdapter || "enderun");
415
426
 
416
427
  // Sanitize workspace: protocol in all text files
417
- content = content.replace(/workspace:[^"'\s]*/g, "*");
428
+ if (ext === ".json") {
429
+ try {
430
+ const json = JSON.parse(content);
431
+ content = JSON.stringify(sanitizeJson(json), null, 2);
432
+ } catch (e) {
433
+ content = content.replace(/workspace:[^"'\s]*/g, "*");
434
+ }
435
+ } else {
436
+ content = content.replace(/workspace:[^"'\s]*/g, "*");
437
+ }
418
438
 
419
439
  fs.writeFileSync(dest, content);
420
440
  } else {
@@ -429,8 +449,10 @@ async function initCommand(selectedAdapter) {
429
449
  mergePackageJson(path.join(targetDir, "package.json"), path.join(sourceDir, "package.json"));
430
450
  updateGitIgnore(path.join(targetDir, ".gitignore"), targetBase);
431
451
 
432
- const finalMemoryPath = path.join(targetDir, targetBase, "PROJECT_MEMORY.md");
433
452
  initializeMemory(finalMemoryPath, targetBase);
453
+
454
+ // Deep clean ALL package.json files in target packages directory
455
+ deepCleanProtocols(path.join(targetDir, "packages"));
434
456
 
435
457
  // Initialize git if missing
436
458
  if (!fs.existsSync(path.join(targetDir, ".git"))) {
@@ -504,6 +526,32 @@ async function initCommand(selectedAdapter) {
504
526
  }
505
527
  }
506
528
 
529
+ /**
530
+ * Recursively scans a directory for package.json files and removes workspace: protocols.
531
+ */
532
+ function deepCleanProtocols(dir) {
533
+ if (!fs.existsSync(dir)) return;
534
+
535
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
536
+ for (const entry of entries) {
537
+ const fullPath = path.join(dir, entry.name);
538
+ if (entry.isDirectory()) {
539
+ deepCleanProtocols(fullPath);
540
+ } else if (entry.name === "package.json") {
541
+ try {
542
+ const content = fs.readFileSync(fullPath, "utf8");
543
+ const json = JSON.parse(content);
544
+ const cleaned = JSON.stringify(sanitizeJson(json), null, 2);
545
+ fs.writeFileSync(fullPath, cleaned);
546
+ } catch (e) {
547
+ // ignore malformed json
548
+ }
549
+ } else if (entry.name === "package-lock.json") {
550
+ fs.unlinkSync(fullPath);
551
+ }
552
+ }
553
+ }
554
+
507
555
  /**
508
556
  * Check framework health and MCP status.
509
557
  */
@@ -574,6 +622,20 @@ function checkCommand() {
574
622
  }
575
623
  }
576
624
 
625
+ function sanitizeJson(obj) {
626
+ if (typeof obj !== "object" || obj === null) return obj;
627
+ if (Array.isArray(obj)) return obj.map(sanitizeJson);
628
+ const cleaned = {};
629
+ for (const [key, value] of Object.entries(obj)) {
630
+ if (typeof value === "string" && value.startsWith("workspace:")) {
631
+ cleaned[key] = "*";
632
+ } else {
633
+ cleaned[key] = sanitizeJson(value);
634
+ }
635
+ }
636
+ return cleaned;
637
+ }
638
+
577
639
  function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, frameworkDir = ".enderun") {
578
640
  const DEFAULT_SKIP = new Set(["node_modules", ".git", ".DS_Store", "package-lock.json"]);
579
641
  const actualSkip = new Set([...DEFAULT_SKIP, ...skipSet]);
@@ -603,7 +665,16 @@ function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, framewo
603
665
  content = content.replace(/\{\{FRAMEWORK_DIR\}\}/g, frameworkDir);
604
666
 
605
667
  // Sanitize workspace: protocol
606
- content = content.replace(/workspace:[^"'\s]*/g, "*");
668
+ if (ext === ".json") {
669
+ try {
670
+ const json = JSON.parse(content);
671
+ content = JSON.stringify(sanitizeJson(json), null, 2);
672
+ } catch (e) {
673
+ content = content.replace(/workspace:[^"'\s]*/g, "*");
674
+ }
675
+ } else {
676
+ content = content.replace(/workspace:[^"'\s]*/g, "*");
677
+ }
607
678
 
608
679
  // Also replace ADAPTER
609
680
  const adapterName = frameworkDir.startsWith(".") ? frameworkDir.slice(1) : frameworkDir;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-enderun",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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.0.9",
20
+ "version": "0.1.2",
21
21
  "initializedAt": "2026-05-09T13:24:27.472Z"
22
22
  }
23
23
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-enderun-mcp",
3
- "version": "0.0.9",
3
+ "version": "0.1.2",
4
4
  "description": "Enterprise-grade MCP Server for AI Agent Framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,9 +1,9 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "0.1.2",
3
3
  "last_updated": "2026-05-09T13:04:00Z",
4
4
  "contract_hash": "daf1d688875061ef66697f39ac2449a34631e9b93926ed3e694b4e4ac7423d98",
5
5
  "breaking_changes": [
6
- { "version": "0.1.0", "description": "Initial framework setup" }
6
+ { "version": "0.1.2", "description": "Initial framework setup" }
7
7
  ],
8
8
  "deprecated_versions": []
9
9
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-enderun/shared-types",
3
- "version": "0.0.9",
3
+ "version": "0.1.2",
4
4
  "description": "Shared TypeScript types for AI-Enderun Framework. Ensures Contract-First synchronization between agents.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",