agent-enderun 0.9.5 → 1.0.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.
Files changed (70) hide show
  1. package/.enderun/ENDERUN.md +1 -1
  2. package/.enderun/PROJECT_MEMORY.md +2 -21
  3. package/.enderun/STATUS.md +11 -7
  4. package/.enderun/agents/analyst.md +28 -0
  5. package/.enderun/agents/backend.md +33 -367
  6. package/.enderun/agents/database.md +27 -45
  7. package/.enderun/agents/devops.md +27 -187
  8. package/.enderun/agents/explorer.md +23 -124
  9. package/.enderun/agents/frontend.md +32 -345
  10. package/.enderun/agents/git.md +26 -110
  11. package/.enderun/agents/manager.md +30 -299
  12. package/.enderun/agents/mobile.md +28 -91
  13. package/.enderun/agents/native.md +27 -96
  14. package/.enderun/agents/quality.md +26 -114
  15. package/.enderun/agents/security.md +28 -0
  16. package/.enderun/config.json +1 -1
  17. package/.enderun/knowledge/analyst_reference_guide.md +31 -0
  18. package/.enderun/knowledge/backend_reference_guide.md +165 -0
  19. package/.enderun/knowledge/database_reference_guide.md +38 -0
  20. package/.enderun/knowledge/devops_reference_guide.md +43 -0
  21. package/.enderun/knowledge/explorer_reference_guide.md +34 -0
  22. package/.enderun/knowledge/frontend_reference_guide.md +64 -0
  23. package/.enderun/knowledge/git_reference_guide.md +51 -0
  24. package/.enderun/knowledge/manager_reference_guide.md +55 -0
  25. package/.enderun/knowledge/mobile_reference_guide.md +35 -0
  26. package/.enderun/knowledge/native_reference_guide.md +34 -0
  27. package/.enderun/knowledge/quality_reference_guide.md +42 -0
  28. package/.enderun/knowledge/security_reference_guide.md +35 -0
  29. package/.enderun/logs/manager.json +1 -17
  30. package/.enderun/memory-graph/agent-contexts/analyst.json +1 -0
  31. package/.enderun/memory-graph/agent-contexts/backend.json +1 -1
  32. package/.enderun/memory-graph/agent-contexts/devops.json +1 -1
  33. package/.enderun/memory-graph/agent-contexts/explorer.json +1 -1
  34. package/.enderun/memory-graph/agent-contexts/frontend.json +1 -1
  35. package/.enderun/memory-graph/agent-contexts/git.json +1 -1
  36. package/.enderun/memory-graph/agent-contexts/manager.json +1 -1
  37. package/.enderun/memory-graph/agent-contexts/mobile.json +1 -1
  38. package/.enderun/memory-graph/agent-contexts/native.json +1 -1
  39. package/.enderun/memory-graph/agent-contexts/quality.json +1 -1
  40. package/.enderun/memory-graph/agent-contexts/security.json +1 -0
  41. package/.enderun/memory-graph/shared-facts.json +1 -1
  42. package/README.md +95 -21
  43. package/agent.md +1 -1
  44. package/bin/cli.js +2 -1
  45. package/bin/init-check.js +1 -1
  46. package/bin/update-contract.js +1 -1
  47. package/claude.md +1 -1
  48. package/dist/.keep +1 -0
  49. package/docs/README.md +11 -1
  50. package/docs/getting-started.md +1 -1
  51. package/eslint.config.js +1 -1
  52. package/framework-mcp/dist/index.js +2 -2
  53. package/framework-mcp/dist/utils/cli.js +1 -1
  54. package/framework-mcp/package.json +1 -1
  55. package/framework-mcp/src/index.ts +3 -3
  56. package/framework-mcp/src/utils/cli.ts +1 -1
  57. package/gemini.md +7 -1
  58. package/grok.md +1 -1
  59. package/package.json +5 -4
  60. package/src/cli/adapters.ts +29 -8
  61. package/src/cli/commands/check.ts +7 -1
  62. package/src/cli/commands/init.ts +80 -27
  63. package/src/cli/commands/orchestrate.ts +98 -92
  64. package/src/cli/index.ts +5 -2
  65. package/src/cli/utils/app.ts +1 -1
  66. package/src/cli/utils/fs.ts +47 -13
  67. package/src/cli/utils/memory.ts +11 -4
  68. package/src/cli/utils/pkg.ts +5 -4
  69. package/docs/architecture/README.md +0 -9
  70. package/docs/user/README.md +0 -35
@@ -4,7 +4,7 @@ import path from "path";
4
4
  import { remapFrameworkContent } from "../adapters.js"; // Import from the new adapters.js
5
5
  import type { AdapterId } from "../adapters.js";
6
6
 
7
- export function updateGitIgnore(targetPath: string, frameworkDir = ".gemini"): void {
7
+ export function updateGitIgnore(targetPath: string, frameworkDir = ".gemini", dryRun = false): void {
8
8
  const IGNORE_LINES = [
9
9
  "# AI-Enderun",
10
10
  `${frameworkDir}/logs/*.json`,
@@ -29,29 +29,41 @@ export function updateGitIgnore(targetPath: string, frameworkDir = ".gemini"): v
29
29
  }
30
30
 
31
31
  if (added) {
32
- fs.writeFileSync(targetPath, content);
33
- console.warn("✅ .gitignore updated.");
32
+ if (dryRun) {
33
+ console.warn(`[DRY RUN] Would update .gitignore at ${targetPath}`);
34
+ } else {
35
+ fs.writeFileSync(targetPath, content);
36
+ console.warn("✅ .gitignore updated.");
37
+ }
34
38
  }
35
39
  }
36
40
 
37
- export function ensureDir(dirPath: string): void {
41
+ export function ensureDir(dirPath: string, dryRun = false): void {
38
42
  if (!fs.existsSync(dirPath)) {
39
- fs.mkdirSync(dirPath, { recursive: true });
43
+ if (dryRun) {
44
+ console.warn(`[DRY RUN] Would create directory: ${dirPath}`);
45
+ } else {
46
+ fs.mkdirSync(dirPath, { recursive: true });
47
+ }
40
48
  }
41
49
  }
42
50
 
43
- export function writeTextFile(filePath: string, content: string): void {
51
+ export function writeTextFile(filePath: string, content: string, dryRun = false): void {
52
+ if (dryRun) {
53
+ console.warn(`[DRY RUN] Would write file: ${filePath}`);
54
+ return;
55
+ }
44
56
  ensureDir(path.dirname(filePath));
45
57
  // Use template literal for content handling to avoid issues with raw newlines
46
58
  fs.writeFileSync(filePath, content.endsWith("\n") ? content : `${content}\n`);
47
59
  }
48
60
 
49
- export function writeJsonFile(filePath: string, value: unknown): void {
50
- writeTextFile(filePath, JSON.stringify(value, null, 2));
61
+ export function writeJsonFile(filePath: string, value: unknown, dryRun = false): void {
62
+ writeTextFile(filePath, JSON.stringify(value, null, 2), dryRun);
51
63
  }
52
64
 
53
65
  interface SanitizeJsonFunction {
54
- (obj: any, targetScope?: string): any;
66
+ (obj: unknown, targetScope?: string): unknown;
55
67
  }
56
68
 
57
69
  export function copyDir(
@@ -63,11 +75,12 @@ export function copyDir(
63
75
  targetScope = "",
64
76
  sanitizeJson: SanitizeJsonFunction,
65
77
  adapterId: AdapterId = "gemini",
78
+ dryRun = false,
66
79
  ): void {
67
80
  const DEFAULT_SKIP = new Set(["node_modules", ".git", ".DS_Store", "package-lock.json"]);
68
81
  const actualSkip = new Set([...DEFAULT_SKIP, ...skipSet]);
69
82
 
70
- if (!fs.existsSync(dest)) {
83
+ if (!fs.existsSync(dest) && !dryRun) {
71
84
  fs.mkdirSync(dest, { recursive: true });
72
85
  }
73
86
 
@@ -75,7 +88,19 @@ export function copyDir(
75
88
  if (actualSkip.has(entry.name)) return;
76
89
 
77
90
  const srcPath = path.join(src, entry.name);
78
- const destPath = path.join(dest, entry.name);
91
+
92
+ // Physical folder remapping during copy
93
+ let effectiveEntryName = entry.name;
94
+ if (entry.isDirectory()) {
95
+ if (entry.name === "agents") {
96
+ if (adapterId === "antigravity") effectiveEntryName = "skills";
97
+ else if (adapterId === "grok") effectiveEntryName = "plugins";
98
+ } else if (entry.name === "knowledge") {
99
+ if (adapterId === "antigravity") effectiveEntryName = "rules";
100
+ }
101
+ }
102
+
103
+ const destPath = path.join(dest, effectiveEntryName);
79
104
 
80
105
  if (entry.isDirectory()) {
81
106
  copyDir(
@@ -87,6 +112,7 @@ export function copyDir(
87
112
  targetScope,
88
113
  sanitizeJson,
89
114
  adapterId,
115
+ dryRun,
90
116
  );
91
117
  } else {
92
118
  if (nonDestructive && fs.existsSync(destPath)) {
@@ -112,9 +138,17 @@ export function copyDir(
112
138
  content = content.replace(/workspace:[^"'\s]*/g, "*");
113
139
  }
114
140
 
115
- fs.writeFileSync(destPath, content);
141
+ if (dryRun) {
142
+ console.warn(`[DRY RUN] Would process and write: ${destPath}`);
143
+ } else {
144
+ fs.writeFileSync(destPath, content);
145
+ }
116
146
  } else {
117
- fs.copyFileSync(srcPath, destPath);
147
+ if (dryRun) {
148
+ console.warn(`[DRY RUN] Would copy binary file: ${destPath}`);
149
+ } else {
150
+ fs.copyFileSync(srcPath, destPath);
151
+ }
118
152
  }
119
153
  }
120
154
  });
@@ -11,7 +11,9 @@ export function getFrameworkDir(): string {
11
11
  const dirPath = path.join(targetDir, dir);
12
12
  if (!fs.existsSync(dirPath)) continue;
13
13
  const hasMemory = fs.existsSync(path.join(dirPath, "PROJECT_MEMORY.md"));
14
- const hasAgents = fs.existsSync(path.join(dirPath, "agents"));
14
+ const hasAgents = fs.existsSync(path.join(dirPath, "agents")) ||
15
+ fs.existsSync(path.join(dirPath, "skills")) ||
16
+ fs.existsSync(path.join(dirPath, "plugins"));
15
17
  if (hasMemory || hasAgents) {
16
18
  return dir;
17
19
  }
@@ -74,7 +76,7 @@ export function releaseMemoryLock(lockPath: string): void {
74
76
  /**
75
77
  * Create initial PROJECT_MEMORY.md if missing.
76
78
  */
77
- export function initializeMemory(memoryPath: string, targetBase: string): void {
79
+ export function initializeMemory(memoryPath: string, targetBase: string, dryRun = false): void {
78
80
  if (fs.existsSync(memoryPath)) return;
79
81
 
80
82
  const traceId = generateULID();
@@ -136,6 +138,11 @@ This file is the Single Source of Truth (SSOT) and the persistent memory of the
136
138
  `;
137
139
 
138
140
  const finalTemplate = template.replace(/\{\{FRAMEWORK_DIR\}\}/g, targetBase);
139
- fs.writeFileSync(memoryPath, finalTemplate);
140
- console.warn(`✅ PROJECT_MEMORY.md initialized in ${targetBase}`);
141
+
142
+ if (dryRun) {
143
+ console.warn(`[DRY RUN] Would initialize PROJECT_MEMORY.md at ${memoryPath}`);
144
+ } else {
145
+ fs.writeFileSync(memoryPath, finalTemplate);
146
+ console.warn(`✅ PROJECT_MEMORY.md initialized in ${targetBase}`);
147
+ }
141
148
  }
@@ -136,11 +136,12 @@ export function mergePackageJson(targetPath: string, sourcePath: string): void {
136
136
  console.warn("✅ package.json updated with Enderun scripts and dependencies.");
137
137
  }
138
138
 
139
- export function sanitizeJson(obj: Record<string, unknown>, targetScope = ""): Record<string, unknown> {
139
+ export function sanitizeJson(obj: unknown, targetScope = ""): unknown {
140
140
  if (typeof obj !== "object" || obj === null) return obj;
141
- if (Array.isArray(obj)) return obj.map(item => sanitizeJson(item as Record<string, unknown>, targetScope)) as unknown as Record<string, unknown>;
141
+ if (Array.isArray(obj)) return obj.map(item => sanitizeJson(item, targetScope));
142
142
  const cleaned: Record<string, unknown> = {};
143
- for (const [key, value] of Object.entries(obj)) {
143
+ const record = obj as Record<string, unknown>;
144
+ for (const [key, value] of Object.entries(record)) {
144
145
  let finalKey = key;
145
146
  let finalValue = value;
146
147
 
@@ -185,7 +186,7 @@ export function sanitizeJson(obj: Record<string, unknown>, targetScope = ""): Re
185
186
  finalValue = "*";
186
187
  }
187
188
 
188
- cleaned[finalKey] = (typeof finalValue === "object" && finalValue !== null) ? sanitizeJson(finalValue as Record<string, unknown>, targetScope) : finalValue;
189
+ cleaned[finalKey] = (typeof finalValue === "object" && finalValue !== null) ? sanitizeJson(finalValue, targetScope) : finalValue;
189
190
  }
190
191
  return cleaned;
191
192
  }
@@ -1,9 +0,0 @@
1
- # Architecture Patterns — Agent Enderun
2
-
3
- This directory contains the non-negotiable technical standards and architectural patterns for the Agent Enderun framework.
4
-
5
- ## Directory Structure
6
- - `standards/`: Technical SOPs, design systems, and compliance mandates.
7
-
8
- ## Core Mandate
9
- All agents MUST read and adhere to these documents before initiating any implementation task.
@@ -1,35 +0,0 @@
1
- # Agent Enderun — Governance and Architecture Portal
2
-
3
- This portal is the **Central Knowledge Source** for enterprise projects developed under the Agent Enderun framework. The project's architectural decisions, standards, and governance protocols are sealed here.
4
-
5
- Unlike ordinary projects, Agent Enderun projects are built on a structure where AI agents operate autonomously but are bound by a rigid, human-authored constitution. This documentation is the **Immutable Guide** for both AI agents (Army) and human developers.
6
-
7
- ### 📋 Documentation Guide
8
-
9
- #### [1. Architecture & Governance](architecture/)
10
- * **[Architecture Decision Records (ADRs)](architecture/decisions/)**: Answers to "Why" and "How" questions at critical project milestones.
11
- * **[Approval & High-Risk Workflows](architecture/approval-flows.md)**: Explains how tokens are generated, audited, and how high-risk actions (e.g., database deletion, privilege escalation) are sealed.
12
- * **[Notification Strategy](architecture/notification-strategy.md)**: Dynamic and corporate notification patterns that do not disrupt the user experience.
13
-
14
- #### [2. Frontend Standards](frontend/)
15
- * **[Component Patterns](frontend/component-patterns.md)**: Zero-UI-Library policy, guide on how all components are hand-crafted and type-safe using Panda CSS.
16
- * **[Form Validations](frontend/forms.md)**: Zero-error form management systems managed with Zod and React hooks.
17
- * **[Toaster Configuration](frontend/notifications.md)**: Integration of tools like Sonner with the corporate theme.
18
-
19
- #### [3. Backend Standards](backend/)
20
- * **[Error Handling](backend/error-handling.md)**: Professional error management hierarchy that does not leak to the front-end and is traceable in logs.
21
- * **[Audit Logging](backend/audit-logging.md)**: Contracts for how every operation is permanently processed into the database with a Trace ID.
22
-
23
- ## 🛰️ Phase-Based Development Life Cycle
24
- All projects must pass the following 5 phases sequentially and completely:
25
-
26
- 1. **PHASE_0 (Discovery):** Tech-stack (`tech-stack.md`) sealed, risk analysis performed.
27
- 2. **PHASE_1 (Architecture & Contract):** First, types and API contracts are written. Contracts must be approved before a single line of application code is written.
28
- 3. **PHASE_2 (Core Development):** Backend and Frontend are built in parallel. Branded Types usage is mandatory.
29
- 4. **PHASE_3 (Integration & Test):** @quality agent takes over. 80% Test Coverage threshold must be met before proceeding to the next phase.
30
- 5. **PHASE_4 (Optimization & Deployment):** Security scans and performance tests are completed.
31
-
32
- > **Agent Directive:** The documents under this folder define the operational boundaries of the agents. An agent cannot deviate from a rule defined here. If a rule needs to be updated, this can only be done with @manager approval and ADR registration.
33
-
34
- **Version:** v0.9.0
35
- **Status:** Active Governance