agent-enderun 1.0.5 → 1.0.7

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 (43) hide show
  1. package/.enderun/ENDERUN.md +15 -8
  2. package/.enderun/agents/analyst.md +6 -0
  3. package/.enderun/agents/backend.md +6 -0
  4. package/.enderun/agents/database.md +6 -0
  5. package/.enderun/agents/devops.md +6 -0
  6. package/.enderun/agents/explorer.md +6 -0
  7. package/.enderun/agents/frontend.md +6 -0
  8. package/.enderun/agents/git.md +6 -0
  9. package/.enderun/agents/manager.md +14 -13
  10. package/.enderun/agents/mobile.md +6 -0
  11. package/.enderun/agents/native.md +6 -0
  12. package/.enderun/agents/quality.md +6 -0
  13. package/.enderun/agents/security.md +6 -0
  14. package/.enderun/cli-commands.json +8 -6
  15. package/.enderun/knowledge/evaluation_engine.md +15 -0
  16. package/.enderun/knowledge/router_logic.md +29 -0
  17. package/.enderun/logs/manager.json +39 -6
  18. package/.enderun/memory/BUSINESS_CONTEXT.md +17 -0
  19. package/.enderun/memory/DECISIONS.md +24 -0
  20. package/.enderun/memory/LESSONS_LEARNED.md +12 -0
  21. package/.enderun/memory/PATTERNS.md +17 -0
  22. package/.enderun/{PROJECT_MEMORY.md → memory/PROJECT_MEMORY.md} +4 -1
  23. package/.enderun/observability/AUDIT_LOG.md +9 -0
  24. package/.enderun/observability/METRICS.md +10 -0
  25. package/.enderun/observability/TRACE_LOG.md +10 -0
  26. package/.enderun/registry/agents.yaml +69 -0
  27. package/CLAUDE.md +20 -0
  28. package/GEMINI.md +20 -0
  29. package/GROK.md +20 -0
  30. package/README.md +31 -8
  31. package/bin/validate-agent-army.js +111 -36
  32. package/docs/getting-started.md +9 -0
  33. package/framework-mcp/package.json +1 -1
  34. package/package.json +5 -5
  35. package/src/cli/adapters.ts +23 -3
  36. package/src/cli/commands/check.ts +25 -5
  37. package/src/cli/commands/init.ts +19 -5
  38. package/src/cli/commands/orchestrate.ts +16 -4
  39. package/src/cli/index.ts +19 -7
  40. package/src/cli/utils/memory.ts +10 -2
  41. package/claude.md +0 -25
  42. package/gemini.md +0 -31
  43. package/grok.md +0 -25
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # 🏛️ Agent Enderun — Enterprise AI Governance & Autonomous Orchestration Framework
2
2
 
3
- > **Stable Release:** v1.0.5 (Universal AI Synergy)
4
- > **Author:** Yusuf BEKAR
5
- > **Trace ID:** `01HGT8J5E2N0W0W0W0W0W0W0W5`
3
+ > **Stable Release:** v1.0.6 (AL Enterprise Compliance)
4
+ > **Author:** Yusuf BEKAR
5
+ > **Trace ID:** `01HGT8J5E2N0W0W0W0W0W0W0W5`
6
6
  > **System Status:** 🟢 All Systems Operational | Build Compile: Clean | Type-Safety: 100% Verified
7
7
 
8
8
  ---
@@ -11,7 +11,7 @@
11
11
 
12
12
  **Agent Enderun**, sıradan bir kod şablon üreteci veya basit bir AI asistanı değildir; karmaşık, ölçeklenebilir ve kurumsal (enterprise) düzeydeki yazılım projeleri için özel olarak tasarlanmış bir **Yapay Zeka Yönetişimi ve Otonom Ordu Komuta Sistemidir**.
13
13
 
14
- Sürüm **v1.0.5** itibarıyla sistem; kendi hafızasını yönetebilen, monorepo proje yollarını dinamik olarak haritalayan, tüm ajan seanslarını güvenli şekilde günlükleyen, farklı yapay zeka ekosistemlerini anayasal bir disiplin altında birleştiren ve **macOS & Windows çapraz platform standartlarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır.
14
+ Sürüm **v1.0.6** itibarıyla sistem; kendi hafızasını yönetebilen, monorepo proje yollarını dinamik olarak haritalayan, tüm ajan seanslarını güvenli şekilde günlükleyen, farklı yapay zeka ekosistemlerini anayasal bir disiplin altında birleştiren, **Agent Lifecycle (AL) tam uyumlu init ve ordu validasyonunu** otomatikleştiren ve **macOS & Windows çapraz platform standartlarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır.
15
15
 
16
16
  ---
17
17
 
@@ -36,6 +36,16 @@ Yapay zeka kodlama yardımcıları (Claude Code, Gemini CLI, Grok Build vb.) gel
36
36
  3. **🩺 Akıllı Framework Dizin Çözümlemesi:**
37
37
  * `.agents/` konfigürasyon dizini ile ana framework çalışma dizinlerinin (`.enderun` vb.) çakışmasını önleyen ve `check` taramasını 100% başarılı kılan dizin çözümleme düzeltmesi uygulandı.
38
38
 
39
+ ### 🚀 Sürüm v1.0.6 AL Enterprise Compliance Kararlı Sürüm Devrimsel Özellikleri
40
+
41
+ 1. **🛡️ Agent Lifecycle (AL) Tam Otomatik Init & Validasyon:**
42
+ * `init` komutu artık scaffolding, build ve check adımlarından sonra **otomatik dedicated AL Army Validation** (`node bin/validate-agent-army.js`) çalıştırır. Tüm ajanlar `stateMachine` + `tags` ile AL şemasına (IDLE → BRIEFED → EXECUTING → DONE/BLOCKED vb.) zorunlu olarak uymaktadır.
43
+ 2. **🔧 Yeni CLI Komutları (Validate & AL Odaklı):** `validate`, `validate-army` ve `check:al` komutları eklendi. `check` komutu artık otomatik olarak AL validation'ı içermektedir. `.enderun/cli-commands.json` ve yardım metinleri güncellendi.
44
+ 3. **🔍 Cross-Adapter AL Detection İyileştirmesi:**
45
+ * `getFrameworkDir` ve `bin/validate-agent-army.js` artık `agents/`, `skills/` (antigravity), `plugins/` (grok) klasörlerini akıllıca tespit eder. `init antigravity` sonrası kurulumlar da %100 AL uyumlu olarak doğrulanır.
46
+ 4. **📚 Dokümantasyon ve Init Deneyimi:**
47
+ * `docs/getting-started.md`'ye AL & Init Compatibility bölümü eklendi. `init` çıktısına AL uyumluluk notu ve otomatik doğrulama adımı entegre edildi.
48
+
39
49
  ### 🚀 Sürüm v1.0.4 Singularity Kararlı Sürüm Devrimsel Özellikleri
40
50
 
41
51
  1. **🧠 Pürüzsüz ve Klasör Kalabalığından Arındırılmış Birleşik Beyin Mimarisi (Unified Brain):**
@@ -146,9 +156,10 @@ npx agent-enderun init antigravity
146
156
 
147
157
  Enderun CLI, `agent-enderun` (veya `npx agent-enderun`) komutu ile yönetilir.
148
158
 
149
- * **`init [adapter] [--unified]`**: Seçilen adaptörü kurar. `--unified` kullanılırsa tüm asistan şimleri doğrudan `.enderun` altında birleşir; klasör kalabalığı sıfırlanır.
159
+ * **`init [adapter] [--unified]`**: Seçilen adaptörü kurar. `--unified` kullanılırsa tüm asistan şimleri doğrudan `.enderun` altında birleşir; klasör kalabalığı sıfırlanır. Init sonrası **otomatik AL (Agent Lifecycle) validation** çalıştırılır.
150
160
  * **`status`**: Projenin aktif fazını (Phase 0 - 4), aktif Trace ID'sini ve uzman ajanların durumlarını listeler.
151
- * **`check`**: Anayasal uyumluluk denetimlerini, kritik dosya bütünlüklerini ve dizin doğrulamalarını gerçekleştirir.
161
+ * **`check`**: Anayasal uyumluluk denetimlerini + **otomatik AL Army Validation** (stateMachine + tags) gerçekleştirir.
162
+ * **`validate` / `validate-army` / `check:al`**: Bağımsız Agent Lifecycle (AL) ordu validasyonu çalıştırır (`bin/validate-agent-army.js`).
152
163
  * **`trace:new [description]`**: Belirli bir geliştirme zinciri için yeni bir Trace ID (ULID) tetikler.
153
164
  * **`orchestrate` / `loop`**: Hermes Message Broker asenkron event-driven ajanlar arası iletişim döngüsünü canlı olarak başlatır.
154
165
  * **`verify-contract`**: Frontend ve backend katmanları arasındaki tip bütünlüğünü denetler.
@@ -186,7 +197,7 @@ npx agent-enderun init gemini --unified
186
197
 
187
198
  **Agent Enderun** is not a generic boilerplate generator or a simple AI wrapper; it is an elite, state-of-the-art **AI Governance and Autonomous Army Command System** designed for complex, scalable, and highly auditable enterprise software projects.
188
199
 
189
- As of **v1.0.5**, the system operates as a **"Living Engineering Organism"** capable of managing its own persistent memory, dynamically mapping project directory scopes, secure-logging expert agent activities, and **fully complying with cross-platform (macOS & Windows) scripting and standard setups**.
200
+ As of **v1.0.6**, the system operates as a **"Living Engineering Organism"** capable of managing its own persistent memory, dynamically mapping project directory scopes, secure-logging expert agent activities, **automatically enforcing Agent Lifecycle (AL) compliance on every init**, and **fully complying with cross-platform (macOS & Windows) scripting and standard setups**.
190
201
 
191
202
  ---
192
203
 
@@ -211,6 +222,16 @@ As AI coding assistants (Claude Code, Gemini CLI, Grok Build, etc.) become incre
211
222
  3. **🩺 Smart Framework Directory Resolution:**
212
223
  * Fixed framework resolution candidates to dynamically prevent folder name collisions between the Antigravity config `.agents` and framework directories, ensuring `check` audits are 100% green.
213
224
 
225
+ ### 🚀 Key Improvements in Version v1.0.6 (AL Enterprise Compliance) Stable Release
226
+
227
+ 1. **🛡️ Agent Lifecycle (AL) Fully Automated Init & Validation:**
228
+ * The `init` command now automatically executes a **dedicated post-init AL Army Validation** (`node bin/validate-agent-army.js`) after scaffolding, build and `check`. All 12 agents strictly comply with the official lifecycle schema (`stateMachine` + `tags`): IDLE → BRIEFED → EXECUTING → DONE / BLOCKED / WAITING / ERROR.
229
+ 2. **🔧 New CLI Commands (Validate & AL-Focused):** Added `validate`, `validate-army` and `check:al`. The existing `check` command now automatically includes full AL validation. Updated `cli-commands.json` and built-in help text.
230
+ 3. **🔍 Cross-Adapter AL Detection Hardening:**
231
+ * `getFrameworkDir` and `bin/validate-agent-army.js` now intelligently detect `agents/`, `skills/` (antigravity adapter), `plugins/` (grok adapter) folders. Setups created with `init antigravity` are now 100% AL-compliant and verifiable.
232
+ 4. **📚 Documentation & Improved Init Experience:**
233
+ * Added "AL & Init Compatibility" section to `docs/getting-started.md`. `init` now prints an explicit AL note and runs the validation step automatically.
234
+
214
235
  ### 🚀 Key Improvements in Version v1.0.4 Stable Release
215
236
 
216
237
  1. **🧠 Clutter-Free Unified Brain Architecture:**
@@ -319,6 +340,8 @@ npx agent-enderun init antigravity
319
340
 
320
341
  ### 🕹️ CLI Command Reference
321
342
 
343
+ > **New in v1.0.6:** `validate`, `validate-army`, `check:al` for dedicated Agent Lifecycle (AL) validation. `check` and `init` now automatically enforce AL compliance.
344
+
322
345
  Execute commands via `agent-enderun` (or `npx agent-enderun`):
323
346
 
324
347
  * **`init [adapter] [--unified]`**: Scaffold framework directories and register local/global MCP server instances.
@@ -356,4 +379,4 @@ npx agent-enderun init gemini --unified
356
379
 
357
380
  ---
358
381
 
359
- Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v1.0.5**
382
+ Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v1.0.6**
@@ -3,6 +3,12 @@
3
3
  import fs from "fs";
4
4
  import path from "path";
5
5
 
6
+ /**
7
+ * AL-compatible agent folder names across all adapters (after init).
8
+ * - .enderun/agents/ or .agent/skills/ or .grok/plugins/ etc.
9
+ */
10
+ const AGENT_FOLDER_NAMES = ["agents", "skills", "plugins"];
11
+
6
12
  const FRAMEWORK_CANDIDATES = [
7
13
  ".gemini/antigravity",
8
14
  ".gemini/antigravity-cli",
@@ -11,38 +17,87 @@ const FRAMEWORK_CANDIDATES = [
11
17
  ".grok",
12
18
  ".agent",
13
19
  ".enderun",
20
+ ".agents",
21
+ ".cursor",
14
22
  ];
15
23
 
24
+ /**
25
+ * Robust detection that works no matter which adapter was used with `init`.
26
+ * Returns the actual location of the army .md files + the army schema.
27
+ */
16
28
  function detectFrameworkDir() {
17
29
  for (const dir of FRAMEWORK_CANDIDATES) {
18
- const agentsPath = path.resolve(dir, "agents");
19
- const schemaPath = path.resolve(dir, "agents/agent_army_schema.json");
20
- if (fs.existsSync(agentsPath)) {
21
- return { frameworkDir: dir, agentsDir: agentsPath, schemaPath };
30
+ const dirPath = path.resolve(dir);
31
+ if (!fs.existsSync(dirPath)) continue;
32
+
33
+ for (const folderName of AGENT_FOLDER_NAMES) {
34
+ const agentsPath = path.join(dirPath, folderName);
35
+ if (!fs.existsSync(agentsPath)) continue;
36
+
37
+ // Find schema (support both flat and schema/ subdir layouts)
38
+ let schemaPath = path.join(agentsPath, "agent_army_schema.json");
39
+ if (!fs.existsSync(schemaPath)) {
40
+ const alt1 = path.join(dirPath, "agents", "agent_army_schema.json");
41
+ if (fs.existsSync(alt1)) schemaPath = alt1;
42
+ else {
43
+ const alt2 = path.join(agentsPath, "schema", "agent_army_schema.json");
44
+ if (fs.existsSync(alt2)) schemaPath = alt2;
45
+ }
46
+ }
47
+ if (!fs.existsSync(schemaPath)) {
48
+ const found = findSchemaRecursive(dirPath);
49
+ if (found) schemaPath = found;
50
+ }
51
+
52
+ if (fs.existsSync(schemaPath)) {
53
+ return { frameworkDir: dir, agentsDir: agentsPath, schemaPath };
54
+ }
55
+ }
56
+
57
+ // Rare: .md files directly in the framework root
58
+ const directMds = fs.readdirSync(dirPath).filter(f => f.endsWith(".md") && !f.startsWith("AGENTS"));
59
+ if (directMds.length > 0) {
60
+ const schemaPath = path.join(dirPath, "agent_army_schema.json");
61
+ if (fs.existsSync(schemaPath)) {
62
+ return { frameworkDir: dir, agentsDir: dirPath, schemaPath };
63
+ }
22
64
  }
23
65
  }
24
66
  return null;
25
67
  }
26
68
 
69
+ function findSchemaRecursive(startDir) {
70
+ try {
71
+ const entries = fs.readdirSync(startDir, { withFileTypes: true });
72
+ for (const entry of entries) {
73
+ const full = path.join(startDir, entry.name);
74
+ if (entry.isDirectory()) {
75
+ if (entry.name === "node_modules" || entry.name === "dist") continue;
76
+ const found = findSchemaRecursive(full);
77
+ if (found) return found;
78
+ } else if (entry.name === "agent_army_schema.json") {
79
+ return full;
80
+ }
81
+ }
82
+ } catch {}
83
+ return null;
84
+ }
85
+
27
86
  const detected = detectFrameworkDir();
28
87
  if (!detected) {
29
- console.error("❌ No framework agents/ directory found. Run: agent-enderun init <adapter>");
30
- console.error(` Looked for: ${FRAMEWORK_CANDIDATES.map((d) => `${d}/agents`).join(", ")}`);
88
+ console.error("❌ No framework agents/ (skills/plugins) dir with AL schema found. Run: agent-enderun init <adapter>");
31
89
  process.exit(1);
32
90
  }
33
91
 
34
92
  const { frameworkDir, agentsDir, schemaPath } = detected;
35
93
 
36
94
  console.log(`🛡️ STARTING AUTOMATED AGENT ARMY VALIDATION (${frameworkDir})...`);
95
+ console.log(` Agents: ${agentsDir}`);
96
+ console.log(` Schema: ${schemaPath}`);
37
97
 
38
98
  try {
39
- if (!fs.existsSync(schemaPath)) {
40
- console.error(`❌ Schema missing: ${schemaPath}`);
41
- process.exit(1);
42
- }
43
-
44
99
  const schema = JSON.parse(fs.readFileSync(schemaPath, "utf8"));
45
- const requiredKeys = schema.required;
100
+ const requiredKeys = schema.required || ["name", "description"];
46
101
  const files = fs.readdirSync(agentsDir);
47
102
  let totalFailed = 0;
48
103
 
@@ -67,45 +122,65 @@ try {
67
122
  yamlContent.split("\n").forEach((line) => {
68
123
  const [key, ...valParts] = line.split(":");
69
124
  if (key && valParts.length > 0) {
125
+ const k = key.trim();
70
126
  let val = valParts.join(":").trim();
71
- val = val.replace(/^['"]|['"]$/g, "");
72
- if (!isNaN(val) && val !== "") {
73
- agent[key.trim()] = Number(val);
127
+ if (val.startsWith("[") && val.endsWith("]")) {
128
+ try { val = JSON.parse(val.replace(/'/g, "\"")); } catch { /* ignore */ }
129
+ } else if (val === "") {
130
+ val = {};
131
+ }
132
+ if (typeof val === "string" && !isNaN(val) && val !== "") {
133
+ agent[k] = Number(val);
74
134
  } else {
75
- agent[key.trim()] = val;
135
+ agent[k] = val;
76
136
  }
77
137
  }
78
138
  });
79
139
 
80
- // Dynamic extraction of capability and role from markdown body if not defined in YAML frontmatter
81
- if (agent.capability === undefined) {
82
- const capMatch = content.match(/-\s+\*\*Capability(?:\s+Score)?:\*\*\s*(\d+)/i);
83
- if (capMatch) {
84
- agent.capability = Number(capMatch[1]);
85
- } else {
86
- agent.capability = 9; // Clean fallback
140
+ // AL fields (stateMachine + tags) the key part of this validator
141
+ if (yamlContent.includes("stateMachine:") && yamlContent.includes("schemaRef:")) {
142
+ const schemaMatch = yamlContent.match(/schemaRef:\s*"(.*)"/);
143
+ if (schemaMatch) {
144
+ agent.stateMachine = { schemaRef: schemaMatch[1] };
87
145
  }
88
146
  }
89
- if (agent.role === undefined) {
90
- const roleMatch = content.match(/-\s+\*\*Role:\*\*\s*([^\n\r]+)/i);
91
- if (roleMatch) {
92
- agent.role = roleMatch[1].trim().replace(/^['"`]|['"`]$/g, "");
93
- } else {
94
- agent.role = fileName.replace(".md", ""); // Clean fallback
147
+
148
+ if (typeof agent.tags === "string" && agent.tags.startsWith("[")) {
149
+ try { agent.tags = JSON.parse(agent.tags.replace(/'/g, "\"")); } catch { /* ignore */ }
150
+ }
151
+
152
+ if (agent.name === undefined) {
153
+ const nameMatch = yamlContent.match(/name:\s*(.*)/);
154
+ if (nameMatch) agent.name = nameMatch[1].trim().replace(/^['"]|['"]$/g, "");
155
+ }
156
+
157
+ // Registry cross-check (optional but nice)
158
+ const registryPath = path.resolve(frameworkDir, "registry/agents.yaml");
159
+ let registryApproved = true;
160
+ if (fs.existsSync(registryPath)) {
161
+ const registry = fs.readFileSync(registryPath, "utf8");
162
+ if (!registry.includes(`name: ${agent.name}`)) {
163
+ registryApproved = false;
95
164
  }
96
165
  }
97
166
 
98
167
  const missing = requiredKeys.filter((k) => agent[k] === undefined);
168
+ if (!registryApproved) missing.push("Registry (not found)");
169
+
170
+ if (agent.stateMachine && typeof agent.stateMachine !== "object") {
171
+ missing.push("stateMachine (invalid)");
172
+ }
173
+ if (!agent.tags || !Array.isArray(agent.tags)) {
174
+ missing.push("tags (missing)");
175
+ }
99
176
 
100
177
  if (missing.length > 0) {
101
- console.log(
102
- `| ${fileName.replace(".md", "").padEnd(9)} | ❌ FAILED | ----- | ${`Missing: ${missing.join(",")}`.slice(0, 16)} |`,
103
- );
178
+ console.log(`| ${fileName.replace(".md", "").padEnd(9)} | ❌ FAILED | ----- | ${missing.join(",").slice(0, 16)} |`);
104
179
  totalFailed++;
105
180
  } else {
106
- console.log(
107
- `| ${agent.name.padEnd(9)} | ✅ PASSED | ${String(agent.capability).padEnd(5)} | ${agent.role.substring(0, 14).padEnd(14)} |`,
108
- );
181
+ const displayCap = agent.capability || "-";
182
+ const displayRole = (agent.role || agent.name || "").substring(0, 14);
183
+ console.log(`| ${agent.name.padEnd(9)} | ✅ PASSED | ${String(displayCap).padEnd(5)} | ${displayRole.padEnd(14)} |`);
109
184
  }
110
185
  }
111
186
 
@@ -114,7 +189,7 @@ try {
114
189
  console.error(`❌ Validation failed! Detected ${totalFailed} invalid agent configurations.`);
115
190
  process.exit(1);
116
191
  } else {
117
- console.log("🎉 SUCCESS: All core agents comply with the Master Agent Army Schema!");
192
+ console.log("🎉 SUCCESS: All core agents comply with the Master Agent Army Schema (AL ready)!");
118
193
  }
119
194
  } catch (e) {
120
195
  console.error("❌ Critical error during schema validation:", e);
@@ -11,3 +11,12 @@ This guide is prepared for developers who want to set up Agent Enderun in a new
11
11
  - `@manager` manages the project automatically in every session.
12
12
 
13
13
  **Congratulations!** You can now start developing professional software with Agent Enderun.
14
+
15
+ ### 🛡️ Agent Lifecycle (AL) & Init Compatibility
16
+ After running `init`, your agent army definitions are automatically set up with full **Agent Lifecycle (AL)** support (stateMachine + tags).
17
+
18
+ - The `agent-enderun check` command now **automatically runs AL validation** (via `bin/validate-agent-army.js`).
19
+ - This ensures that no matter which adapter you used (`antigravity`, `grok`, `gemini`, etc.), the agents are compliant with the lifecycle states (IDLE → BRIEFED → EXECUTING → DONE/BLOCKED etc.).
20
+ - You can also run manually: `node bin/validate-agent-army.js`
21
+
22
+ > **Tip:** Always run `agent-enderun check` after init or major changes to verify AL compliance.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-enderun/mcp",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Agent Enderun Model Context Protocol (MCP) Server",
5
5
  "type": "module",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-enderun",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
5
5
  "author": "Yusuf BEKAR",
6
6
  "license": "MIT",
@@ -43,9 +43,9 @@
43
43
  "tsconfig.json",
44
44
  "eslint.config.js",
45
45
  "panda.config.ts",
46
- "gemini.md",
47
- "claude.md",
48
- "grok.md",
46
+ "GEMINI.md",
47
+ "CLAUDE.md",
48
+ "GROK.md",
49
49
  "agent.md",
50
50
  "docs"
51
51
  ],
@@ -82,7 +82,7 @@
82
82
  "zod": "^3.24.2"
83
83
  },
84
84
  "enderun": {
85
- "version": "1.0.5",
85
+ "version": "1.0.7",
86
86
  "initializedAt": "2026-05-31T09:58:25.773Z"
87
87
  },
88
88
  "dependencies": {}
@@ -4,7 +4,7 @@ import fs from "fs";
4
4
  import { findClaudeConfigPath, addMcpServerToClaude } from "./utils/claude.js";
5
5
  import { writeJsonFile, writeTextFile } from "./utils/fs.js";
6
6
 
7
- export const ADAPTER_IDS = ["gemini", "claude", "grok", "antigravity", "antigravity-cli"] as const;
7
+ export const ADAPTER_IDS = ["gemini", "claude", "grok", "cursor", "codex", "antigravity", "antigravity-cli"] as const;
8
8
  export type AdapterId = (typeof ADAPTER_IDS)[number];
9
9
 
10
10
  export interface AdapterConfig {
@@ -30,7 +30,21 @@ export const ADAPTERS: Record<AdapterId, AdapterConfig> = {
30
30
  claude: {
31
31
  id: "claude",
32
32
  frameworkDir: ".claude",
33
- shimFile: "claude.md",
33
+ shimFile: "CLAUDE.md",
34
+ templateDir: ".enderun",
35
+ nestedDirs: ["agents", "skills", "knowledge"],
36
+ },
37
+ cursor: {
38
+ id: "cursor",
39
+ frameworkDir: ".enderun",
40
+ shimFile: ".cursor/rules/global.mdc",
41
+ templateDir: ".enderun",
42
+ nestedDirs: ["agents", "skills", "knowledge"],
43
+ },
44
+ codex: {
45
+ id: "codex",
46
+ frameworkDir: ".enderun",
47
+ shimFile: ".github/copilot-instructions.md",
34
48
  templateDir: ".enderun",
35
49
  nestedDirs: ["agents", "skills", "knowledge"],
36
50
  },
@@ -61,12 +75,18 @@ export const ADAPTERS: Record<AdapterId, AdapterConfig> = {
61
75
  * All framework runtime directories (for discovery).
62
76
  * Verified against 2026 industry standards.
63
77
  */
78
+ /**
79
+ * All framework runtime directories (for discovery).
80
+ * Verified against 2026 industry standards.
81
+ * Includes .agent for direct antigravity adapter installs.
82
+ */
64
83
  export const FRAMEWORK_DIR_CANDIDATES = [
65
- ".agent",
84
+ ".agents",
66
85
  ".gemini",
67
86
  ".claude",
68
87
  ".grok",
69
88
  ".enderun",
89
+ ".agent", // direct antigravity installs (agents live under skills/)
70
90
  ] as const;
71
91
 
72
92
  const SHIM_FILES = ADAPTER_IDS.map((id) => ADAPTERS[id].shimFile);
@@ -2,13 +2,15 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import { execSync } from "child_process";
4
4
 
5
- import { getFrameworkDir, getConfiguredPaths } from "../utils/memory.js";
5
+ import { getFrameworkDir, getConfiguredPaths, getMemoryPath } from "../utils/memory.js";
6
6
  import { getPackageVersion } from "../utils/pkg.js"; // To get FRAMEWORK_VERSION
7
7
 
8
8
  const FRAMEWORK_VERSION = getPackageVersion();
9
9
 
10
10
  /**
11
11
  * Check framework health and MCP status.
12
+ * Now also runs full AL (Agent Lifecycle) army validation so that
13
+ * `agent-enderun check` guarantees that init setups are AL-compliant.
12
14
  */
13
15
  export function checkCommand() {
14
16
  console.warn(`🔍 Checking Agent Enderun Health (v${FRAMEWORK_VERSION})...`);
@@ -16,20 +18,23 @@ export function checkCommand() {
16
18
 
17
19
  const frameworkDir = getFrameworkDir();
18
20
  const pathsMap = getConfiguredPaths();
21
+ const memoryPath = getMemoryPath();
19
22
 
20
- // Determine folder names based on adapter detection
23
+ console.warn(` Using framework dir: ${frameworkDir} (AL cross-adapter aware)`);
24
+
25
+ // Determine folder names based on adapter detection (AL + cross-adapter support)
21
26
  let knowledgeDir = "knowledge";
22
- if (frameworkDir === ".agent") {
27
+ if (frameworkDir === ".agents" || frameworkDir === ".agent") {
23
28
  knowledgeDir = "rules";
24
29
  }
25
-
30
+
26
31
  const constitutionPath = fs.existsSync(path.join(process.cwd(), "ENDERUN.md"))
27
32
  ? "ENDERUN.md"
28
33
  : path.join(frameworkDir, "ENDERUN.md");
29
34
 
30
35
  const checks = [
31
36
  { name: "Constitution (ENDERUN.md)", path: constitutionPath },
32
- { name: "Memory (PROJECT_MEMORY.md)", path: path.join(frameworkDir, "PROJECT_MEMORY.md") },
37
+ { name: "Memory (PROJECT_MEMORY.md)", path: path.relative(process.cwd(), memoryPath) },
33
38
  { name: "Command Map (cli-commands.json)", path: path.join(frameworkDir, "cli-commands.json") },
34
39
  { name: "Framework Config (config.json)", path: path.join(frameworkDir, "config.json") },
35
40
  { name: "Agent Status (STATUS.md)", path: path.join(frameworkDir, "STATUS.md") },
@@ -83,6 +88,21 @@ export function checkCommand() {
83
88
  }
84
89
  }
85
90
 
91
+ // === AL (Agent Lifecycle) Army Validation ===
92
+ // This makes `agent-enderun check` also enforce that init'ed agents are AL-compliant
93
+ // (stateMachine + tags present and parseable). Works across adapters (skills/plugins/agents).
94
+ console.warn("\n🛡️ Running Agent Army AL Compliance (validate-agent-army)...");
95
+ try {
96
+ execSync("node bin/validate-agent-army.js", { stdio: "pipe" });
97
+ console.warn("✅ Agent Army AL validation PASSED (all agents have stateMachine + tags).");
98
+ } catch (err) {
99
+ console.warn("❌ Agent Army AL validation FAILED.");
100
+ console.warn(" Run manually: node bin/validate-agent-army.js");
101
+ console.warn(" This usually means your init used an adapter that remapped agents (e.g. antigravity → skills).");
102
+ console.warn(" The core .md definitions should still be correct; the standalone validator just couldn't locate them.");
103
+ issues++;
104
+ }
105
+
86
106
  if (issues === 0) {
87
107
  console.warn("\n🚀 All systems green! Agent Enderun is ready for orchestration.");
88
108
  } else {
@@ -70,6 +70,10 @@ function buildDirsToCreate(adapter: AdapterConfig): string[] {
70
70
  dirs.push(`${adapter.frameworkDir}/${nested}`);
71
71
  }
72
72
  }
73
+ // Add logic for shimFile directory if it's nested (like .cursor/rules/)
74
+ if (adapter.shimFile.includes("/")) {
75
+ dirs.push(path.dirname(adapter.shimFile));
76
+ }
73
77
  return [...new Set(dirs)];
74
78
  }
75
79
 
@@ -262,7 +266,7 @@ export async function initCommand(adapterInput?: string, dryRun = false) {
262
266
 
263
267
  updateGitIgnore(path.join(targetDir, ".gitignore"), frameworkDir, dryRun);
264
268
 
265
- const finalMemoryPath = path.join(targetFrameworkDir, "PROJECT_MEMORY.md");
269
+ const finalMemoryPath = path.join(targetFrameworkDir, "memory/PROJECT_MEMORY.md");
266
270
  initializeMemory(finalMemoryPath, frameworkDir, dryRun);
267
271
 
268
272
  if (!dryRun) {
@@ -529,6 +533,8 @@ All rules and constraints defined in \`${frameworkDir}/ENDERUN.md\` are strictly
529
533
  const buildCmd = pkgMgr === "npm" ? "npm run enderun:build" : `${pkgMgr} run enderun:build`;
530
534
 
531
535
  console.warn(`\n✨ Framework scaffolded! (v${FRAMEWORK_VERSION})`);
536
+ console.warn("\n🛡️ AL (Agent Lifecycle) Note: Your init is now configured for full army compliance.");
537
+ console.warn(" Run `agent-enderun check` (or the validate script) to confirm all agents have proper stateMachine + tags.");
532
538
 
533
539
  if (dryRun || process.env.ENDERUN_SKIP_INSTALL === "1") {
534
540
  console.warn(`\n⏭️ Skipping install steps (${dryRun ? "Dry-Run" : "ENDERUN_SKIP_INSTALL=1"}).`);
@@ -536,11 +542,19 @@ All rules and constraints defined in \`${frameworkDir}/ENDERUN.md\` are strictly
536
542
  }
537
543
 
538
544
  try {
539
- execSync(installCmd, { stdio: "inherit" });
540
- console.warn(`\n🏗️ Step 2/3: Running '${buildCmd}'...`);
541
- execSync(buildCmd, { stdio: "inherit" });
542
- console.warn("\n🔍 Step 3/3: Running 'agent-enderun check'...");
545
+ console.warn("\n🔍 Step 3/3: Running 'agent-enderun check' (includes AL validation)...");
543
546
  checkCommand();
547
+
548
+ // Automatic dedicated AL (Agent Lifecycle) check after init
549
+ console.warn("\n🛡️ Automatic post-init AL Army Validation (validate-agent-army)...");
550
+ try {
551
+ execSync("node bin/validate-agent-army.js", { stdio: "inherit" });
552
+ console.warn("✅ Automatic AL validation PASSED - all agents are lifecycle compliant (stateMachine + tags)!");
553
+ } catch (alErr) {
554
+ console.warn("⚠️ Automatic AL validation reported issues (see above in check output).");
555
+ console.warn(" You can re-run manually: node bin/validate-agent-army.js or agent-enderun check");
556
+ }
557
+
544
558
  console.warn("\n🚀 Agent Enderun is fully installed and verified!");
545
559
  } catch (e: unknown) {
546
560
  const message = e instanceof Error ? e.message : String(e);
@@ -51,23 +51,35 @@ export async function orchestrateCommand() {
51
51
  console.log(`📡 ${pendingMessages.length} adet bekleyen görev bulundu. İşleniyor...\n`);
52
52
 
53
53
  for (const msg of pendingMessages) {
54
- const { to, content, traceId } = msg;
54
+ const { to, content, traceId, category } = msg;
55
55
 
56
56
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
57
57
  console.log(`🔹 HEDEF: ${to}`);
58
58
  console.log(`🔹 TRACE: ${traceId}`);
59
+ console.log(`🔹 KATEGORİ: ${category}`);
59
60
  console.log(`🔹 GÖREV: ${content}`);
60
61
 
61
62
  // Determine agent folder based on adapter (detection or default)
62
63
  let agentFolder = "agents";
63
- if (frameworkDir === ".agent") {
64
+ if (frameworkDir === ".agents") {
64
65
  agentFolder = "skills";
65
66
  } else if (frameworkDir === ".grok") {
66
67
  agentFolder = "plugins";
67
68
  }
68
69
 
69
- // 1. Transition the target agent state to EXECUTING in STATUS.md
70
- transitionAgentState(to, "EXECUTING", content);
70
+ // Determine target state based on category
71
+ let targetState = "EXECUTING";
72
+ if (category === "DELEGATION") targetState = "BRIEFED";
73
+ if (category === "ALERT" || category === "FAILED") targetState = "BLOCKED";
74
+
75
+ // 1. Transition the target agent state in STATUS.md
76
+ transitionAgentState(to, targetState, content);
77
+
78
+ if (targetState === "BRIEFED") {
79
+ console.log(`\n📝 ${to} agent'ı bilgilendirildi (BRIEFED). Hazırlık bekleniyor...`);
80
+ // Auto-transition to EXECUTING for CLI flow if no blockers
81
+ transitionAgentState(to, "EXECUTING", content);
82
+ }
71
83
 
72
84
  console.log("\n🤖 Görev Devredildi!");
73
85
  console.log(`👉 Lütfen ${to} agent talimatlarını (${frameworkDir}/${agentFolder}/${to.replace("@", "")}.md) okuyun ve görevi yerine getirin.`);
package/src/cli/index.ts CHANGED
@@ -57,16 +57,27 @@ async function main() {
57
57
  break;
58
58
 
59
59
  case "orchestrate":
60
- case "loop":
61
- orchestrateCommand();
60
+ case "update-contract":
61
+ updateApiContractCommand();
62
62
  break;
63
63
 
64
- case "verify-contract":
65
- verifyApiContractCommand();
64
+ case "validate":
65
+ case "validate-army":
66
+ case "check:al": {
67
+ // Dedicated AL (Agent Lifecycle) army validation - can be run independently after init
68
+ const { execSync } = await import("child_process");
69
+ try {
70
+ execSync("node bin/validate-agent-army.js", { stdio: "inherit" });
71
+ } catch (e) {
72
+ // validation script itself handles exit codes and messaging
73
+ }
66
74
  break;
75
+ }
67
76
 
68
- case "update-contract":
69
- updateApiContractCommand();
77
+ case "version":
78
+ case "-v":
79
+ case "--version":
80
+ console.log(`v${getPackageVersion()}`);
70
81
  break;
71
82
 
72
83
  case "version":
@@ -87,7 +98,8 @@ Usage:
87
98
 
88
99
  Commands:
89
100
  init [adapter] Initialize Agent Enderun framework (gemini, claude, grok, etc.)
90
- check Perform an enterprise-grade system health check
101
+ check Perform an enterprise-grade system health check (includes automatic AL validation)
102
+ validate Run dedicated Agent Lifecycle (AL) army validation (validate-agent-army)
91
103
  status Show active phase, trace ID, and agent statuses
92
104
  trace:new <desc> Start a new task chain with a unique Trace ID
93
105
  create-app <idea> Generate a new full-stack app from natural language
@@ -27,10 +27,15 @@ export function getFrameworkDir(): string {
27
27
  for (const dir of FRAMEWORK_DIR_CANDIDATES) {
28
28
  const dirPath = path.join(targetDir, dir);
29
29
  if (!fs.existsSync(dirPath)) continue;
30
- const hasMemory = fs.existsSync(path.join(dirPath, "PROJECT_MEMORY.md"));
30
+
31
+ // Support both legacy flat memory and current memory/ subdir layout (AL/cross-adapter fix)
32
+ const hasMemory = fs.existsSync(path.join(dirPath, "PROJECT_MEMORY.md")) ||
33
+ fs.existsSync(path.join(dirPath, "memory", "PROJECT_MEMORY.md"));
34
+
31
35
  const hasAgents = fs.existsSync(path.join(dirPath, "agents")) ||
32
36
  fs.existsSync(path.join(dirPath, "skills")) ||
33
37
  fs.existsSync(path.join(dirPath, "plugins"));
38
+
34
39
  if (hasMemory || hasAgents) {
35
40
  return dir;
36
41
  }
@@ -44,7 +49,10 @@ export function getFrameworkDir(): string {
44
49
  }
45
50
 
46
51
  export function getMemoryPath() {
47
- return path.join(targetDir, getFrameworkDir(), "PROJECT_MEMORY.md");
52
+ const frameworkDir = getFrameworkDir();
53
+ const subPath = path.join(targetDir, frameworkDir, "memory/PROJECT_MEMORY.md");
54
+ if (fs.existsSync(subPath)) return subPath;
55
+ return path.join(targetDir, frameworkDir, "PROJECT_MEMORY.md");
48
56
  }
49
57
 
50
58
  export function getConfiguredPaths(): { backend: string; frontend: string; docs: string; tests: string } {