agent-enderun 0.9.2 → 0.9.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/PROJECT_MEMORY.md +22 -25
- package/.enderun/agents/backend.md +1 -0
- package/.enderun/agents/frontend.md +2 -1
- package/.enderun/agents/manager.md +1 -1
- package/.enderun/agents/quality.md +2 -0
- package/.enderun/logs/manager.json +17 -0
- package/.enderun/mcp_config.json +4 -2
- package/README.md +179 -117
- package/bin/init-check.js +9 -1
- package/bin/update-contract.js +9 -1
- package/bin/validate-agent-army.js +9 -1
- package/framework-mcp/dist/index.js +75 -2
- package/framework-mcp/package.json +1 -1
- package/framework-mcp/src/index.ts +90 -2
- package/mcp.json +4 -2
- package/package.json +2 -1
- package/src/cli/adapters.ts +6 -1
- package/src/cli/commands/contract.ts +40 -0
- package/src/cli/index.ts +6 -1
- package/src/cli/utils/app.ts +1 -10
- package/src/cli/utils/claude.ts +8 -3
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
## CURRENT STATUS
|
|
2
2
|
|
|
3
|
-
- Phase:
|
|
4
|
-
- Trace ID:
|
|
3
|
+
- Phase: PHASE_0 (Genesis)
|
|
4
|
+
- Trace ID: 01HGT8J5E2N0W0W0W0W0W0W0W5
|
|
5
5
|
- @manager state: ENTERPRISE_FULL_PROFILE_ACTIVE
|
|
6
6
|
|
|
7
7
|
## ACTIVE TASKS
|
|
8
8
|
|
|
9
9
|
| Trace ID | Task | Agent | Priority | Status |
|
|
10
10
|
| :--- | :--- | :--- | :--- | :--- |
|
|
11
|
-
| 01HGT8J5E2N0W0W0W0W0W0W0W4 | Define initial API contracts (Dashboard) | @backend | P0 | COMPLETED |
|
|
12
|
-
| 01HGT8J5E2N0W0W0W0W0W0W0W4 | Knowledge Base Rehabilitation & Governance Audit | @manager | P0 | COMPLETED |
|
|
13
|
-
| 01HGT8J5E2N0W0W0W0W0W0W0W4 | Transition to Dynamic Hermes Orchestration Loop | @manager | P0 | COMPLETED |
|
|
14
11
|
|
|
15
12
|
## CRITICAL DECISIONS
|
|
16
13
|
- **Tech Stack:** Node.js/Fastify, React/Vite, PostgreSQL, Kysely.
|
|
@@ -20,25 +17,25 @@
|
|
|
20
17
|
- **Sovereign Backend Structure:** Every backend service MUST maintain its own database logic (schema, migrations, seeds) within `src/database/` to ensure full isolation.
|
|
21
18
|
|
|
22
19
|
## HISTORY
|
|
23
|
-
- **SYSTEM INITIALIZED:** Framework v0.9.0 promoted to stable release state.
|
|
24
|
-
- **PHASE TRANSITION:** Moved to PHASE_1. Enterprise profile selected.
|
|
25
|
-
- **CONTRACT DEFINITION:** API contracts defined and hash updated.
|
|
26
|
-
- **AGENT ADDED:** Created @database agent for schema and seeding authority.
|
|
27
|
-
- **AGENT MERGE:** Governance (@manager) and Orchestration (@orchestrator) roles merged into unified @manager authority.
|
|
28
|
-
- **DESIGN MANDATE:** Formally adopted 'Mobile-First, Responsive' design discipline and created Design System documentation.
|
|
29
|
-
- **UI GOVERNANCE:** Banned native browser dialogues (`alert`/`confirm`) and mandated integrated `Toaster`/`Modal` components.
|
|
30
|
-
- **LOGGING GOVERNANCE:** Implemented structured logging, banned `console.log`, and mandated audit logging for state-mutating operations.
|
|
31
|
-
- **LEARNING ENGINE:** Implemented 'Lessons Learned Engine'. Agents analyze failures to create 'Prevention Rules' and verify them before every task.
|
|
32
|
-
- **GOVERNANCE UPDATE:** Adopted 'Strategic Consultation Mandate'. Agents must now propose at least two distinct strategic options for major implementations and await user direction.
|
|
33
|
-
- **LANGUAGE MANDATE:** Standardized all documentation, agent definitions, and system reports to English-Only.
|
|
34
|
-
- **GOVERNANCE UPDATE:** Adopted 'Self-Contained Sovereign Services' structure for all backend applications.
|
|
35
|
-
- **VERSION BUMP:** Framework version updated to v0.9.1.
|
|
36
|
-
- **KNOWLEDGE REHABILITATION:** Inlined 13 stub files into agent definitions and added missing `documentation_ownership.md` to establish strict documentation boundaries.
|
|
37
|
-
- **DYNAMIC ORCHESTRATION TRANSITION:** Removed static template code generators, implemented dynamic Hermes Orchestrator Loop, and resolved critical CLI ReferenceError import bugs.
|
|
38
|
-
- **DYNAMIC PATH RESOLUTION ALIGNMENT:** Eliminated all hardcoded framework and application directories, introducing configuration-driven dynamic path mapping via `paths` inside `config.json`.
|
|
39
|
-
- **COMPILER & TYPE SAFETY REMEDIATION:** Fixed type-safety signature mismatches in `fs.ts` and const reassignment issues in `log.ts`, ensuring perfect TypeScript compiler build verification with zero errors.
|
|
40
|
-
- **ESLINT RUNTIME ALIGNMENT:** Patched ESLint to completely ignore hidden framework files, preventing EPERM scan crashes under sandboxed runtime restrictions.
|
|
41
|
-
- **VERSION BUMP:** Framework version updated to v0.9.2.
|
|
42
|
-
- **PACKAGING BUG FIX:** Included entire `framework-mcp` folder inside npm packaging files configuration, resolving compiler input errors during downstream workspace installations.
|
|
43
20
|
|
|
21
|
+
### 2026-05-30 — Framework Promotion to Stable v0.9.4
|
|
44
22
|
|
|
23
|
+
- **Agent:** @manager
|
|
24
|
+
- **Trace ID:** 01HGT8J5E2N0W0W0W0W0W0W0W5
|
|
25
|
+
- **Action:** Surgically aligned all directory conventions and MCP settings, then promoted the Agent Enderun framework to Stable Release v0.9.4 with comprehensive, high-quality documentation.
|
|
26
|
+
|
|
27
|
+
### 2026-05-30 — Aligned Agent Directories & Integrations
|
|
28
|
+
|
|
29
|
+
- **Agent:** @manager
|
|
30
|
+
- **Trace ID:** 01HGT8J5E2N0W0W0W0W0W0W0W5
|
|
31
|
+
- **Action:** Surgically updated framework initialization and resolution logic to adhere to official directory standards.
|
|
32
|
+
- Aligned Grok's directory from generic `.agent` to the standard `.grok` directory.
|
|
33
|
+
- Fixed macOS/Windows Claude Desktop configuration path to target `claude_desktop_config.json`.
|
|
34
|
+
- Added global Claude Code CLI (`~/.claude.json`) and project-local `.mcp.json` support.
|
|
35
|
+
- Cleaned up duplicated candidate directories and unified frameworkDir resolution logic.
|
|
36
|
+
|
|
37
|
+
### 2026-05-30 — Framework Promotion to Stable v0.9.3
|
|
38
|
+
|
|
39
|
+
- **Agent:** @manager
|
|
40
|
+
- **Trace ID:** 01HGT8J5E2N0W0W0W0W0W0W0W5
|
|
41
|
+
- **Action:** Promoted Agent Enderun framework to Stable Release v0.9.3. Successfully reset memory state and purged session logs.
|
|
@@ -205,6 +205,7 @@ Every "mutation" (CREATE, UPDATE, DELETE) MUST trigger an audit log entry.
|
|
|
205
205
|
- **Traceability:** Link every audit log to the active **Trace ID**.
|
|
206
206
|
- **State Capture:** For updates, capture both `previousState` and `newState`.
|
|
207
207
|
- **User Context:** Identify the `UserID` performing the action.
|
|
208
|
+
- **Audit Scan Compliance:** Mutation handlers are audited via AST scans or code analysis by @quality to ensure they contain an active `AuditService.log()` invocation. Any mutation handler missing this call will fail the verification gate.
|
|
208
209
|
|
|
209
210
|
---
|
|
210
211
|
|
|
@@ -185,7 +185,8 @@ const { data, loading, error, update, remove, refetch } = useDetailPage<User>({
|
|
|
185
185
|
**Agent Rule:**
|
|
186
186
|
- Never perform direct fetch on detail pages. Always use `useDetailPage`.
|
|
187
187
|
- Loading + error states must be managed for update and delete operations.
|
|
188
|
-
- If optimistic updates are
|
|
188
|
+
- **Rollback Discipline:** If optimistic updates are utilized, a strict rollback mechanism must be integrated. Save the previous state to a local reference before modifying UI state, and restore this exact state inside the `catch` block of the async operation, providing immediate visual feedback to the user on failure.
|
|
189
|
+
|
|
189
190
|
|
|
190
191
|
#### 3. useFormPage (For Form Pages)
|
|
191
192
|
Standard hook for form pages and modal forms.
|
|
@@ -91,7 +91,7 @@ description: "Orchestration & Governance (Team-Lead) Agent for Agent Enderun"
|
|
|
91
91
|
2. Read `.enderun/PROJECT_MEMORY.md` (via `read_project_memory` tool) and extract the following:
|
|
92
92
|
- **Legacy Onboarding Trigger:** If the memory file is missing or almost empty but codebase files exist, use `send_agent_message` to order `@explorer` to execute `bootstrap_legacy_memory`.
|
|
93
93
|
- `CURRENT STATUS` → Which phase are we in? Is there an active Trace ID?
|
|
94
|
-
- `CRITICAL DECISIONS` → What was decided in previous sessions? **MUST COMPLY.**
|
|
94
|
+
- `CRITICAL DECISIONS` → What was decided in previous sessions? **MUST COMPLY.** Verify type alignment and database schemas against these decisions at startup; log a "Decision Conflict Alert" if any drift or mismatch is detected.
|
|
95
95
|
- `ACTIVE TASKS` → Are there any ongoing tasks? Has agent assignment been made?
|
|
96
96
|
- `HISTORY` → Read the last 3 entries to understand previous work.
|
|
97
97
|
3. Check `.enderun/docs/api/README.md` → Which endpoints exist? Are there missing contracts?
|
|
@@ -84,6 +84,8 @@ Every action must be logged using `log_agent_action` to `.enderun/logs/quality.j
|
|
|
84
84
|
- Unit tests pass, Integration tests pass against real test DB.
|
|
85
85
|
- Coverage meets project threshold.
|
|
86
86
|
- No skipped tests without manager approval.
|
|
87
|
+
- **CI/CD Coverage Gate:** Strictly reject PR gate approval if the automated coverage report falls below the mandatory >80% threshold in core packages and domain logic.
|
|
88
|
+
|
|
87
89
|
|
|
88
90
|
## 🛡️ Security Audit Gate (Security)
|
|
89
91
|
- Zero CRITICAL/HIGH findings for deploy/merge.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timestamp": "2026-05-30T13:51:00Z",
|
|
3
|
+
"agent": "@manager",
|
|
4
|
+
"action": "MODIFY",
|
|
5
|
+
"requestId": "01HGT8J5E2N0W0W0W0W0W0W0W5",
|
|
6
|
+
"status": "SUCCESS",
|
|
7
|
+
"summary": "Aligned framework directory definitions and discovery paths with official ecosystem conventions for Gemini, Claude Desktop/Code, Grok, and Antigravity.",
|
|
8
|
+
"files": [
|
|
9
|
+
"src/cli/adapters.ts",
|
|
10
|
+
"src/cli/utils/claude.ts",
|
|
11
|
+
"src/cli/utils/app.ts",
|
|
12
|
+
"bin/init-check.js",
|
|
13
|
+
"bin/validate-agent-army.js",
|
|
14
|
+
"bin/update-contract.js",
|
|
15
|
+
"framework-mcp/src/index.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/.enderun/mcp_config.json
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"agent-enderun": {
|
|
4
4
|
"command": "node",
|
|
5
|
-
"args": ["framework-mcp/dist/index.js"],
|
|
6
|
-
"env": {
|
|
5
|
+
"args": ["/Users/ybekar/Desktop/Projeler/agent-enderun/framework-mcp/dist/index.js"],
|
|
6
|
+
"env": {
|
|
7
|
+
"ENDERUN_PROJECT_ROOT": "/Users/ybekar/Desktop/Projeler/agent-enderun"
|
|
8
|
+
}
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
11
|
}
|
package/README.md
CHANGED
|
@@ -1,47 +1,43 @@
|
|
|
1
1
|
# 🏛️ Agent Enderun — Enterprise AI Governance & Autonomous Orchestration Framework
|
|
2
2
|
|
|
3
|
-
> **Stable Release:** v0.9.
|
|
3
|
+
> **Stable Release:** v0.9.4
|
|
4
4
|
> **Author:** Yusuf BEKAR
|
|
5
|
-
> **Trace ID:** `
|
|
5
|
+
> **Trace ID:** `01HGT8J5E2N0W0W0W0W0W0W0W5`
|
|
6
6
|
> **System Status:** 🟢 All Systems Operational | Build Compile: Clean | Type-Safety: 100% Verified
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
## 🇹🇷 TÜRKÇE — Proje Tanıtımı &
|
|
10
|
+
## 🇹🇷 TÜRKÇE — Proje Tanıtımı & Detaylı Kullanım Kılavuzu
|
|
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 **v0.9.
|
|
14
|
+
Sürüm **v0.9.4** 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 **Claude Code / Desktop Sandbox kurallarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### ❓ Neden Agent Enderun?
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
* Artık `.enderun` klasörü sistemde katı olarak kodlanmış (hardcoded) tek dizin değildir.
|
|
22
|
-
* CLI aracı; çalışma anında projede aktif olan framework klasörünü `[.gemini, .claude, .agent, .enderun]` adayları arasından otomatik olarak keşfeder. Bu sayede her IDE veya yapay zeka ajanı (Claude Code, Gemini CLI, Grok) kendi izole klasöründe çakışma yaşamadan çalışabilir.
|
|
20
|
+
Yapay zeka kodlama yardımcıları (Claude Code, Gemini CLI, Grok Build vb.) geliştikçe, kurumsal projelerde kontrolü kaybetmek çok daha kolay hale gelmiştir. Agent Enderun, aşağıdaki kritik **kurumsal problemleri çözmek** amacıyla doğmuştur:
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"backend": "apps/backend",
|
|
30
|
-
"frontend": "apps/web",
|
|
31
|
-
"docs": "docs",
|
|
32
|
-
"tests": "tests"
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
* Tüm sözleşme doğrulama (`verify-contract`), sistem bütünlük denetimi (`check`) ve kod üreticileri bu yapılandırmayı tüketir.
|
|
22
|
+
1. **Kontrolsüz ve Hatalı Değişiklikler (Rogue AI):** Ajanların tüm kod dosyasını baştan yazmasını engelleyerek **milyonlarca satırlık kodları cerrahi hassasiyetle (`replace_text` / `patch_file` üzerinden)** değiştirmeye zorlar. Token tüketimini ve hata oranını %90 azaltır.
|
|
23
|
+
2. **Kayıp Hafıza ve Bağlam Drifti:** Ajanlar oturum değiştirdikçe projenin geçmişini ve mimari kararlarını unutur. Enderun, **`PROJECT_MEMORY.md`** dosyasını projenin değişmez tek doğruluk kaynağı (SSOT) haline getirerek, seanslar arası bağlam kaybını tamamen engeller.
|
|
24
|
+
3. **Frontend-Backend Tip Uyuşmazlığı:** Backend tip tanımlamalarında en ufak bir kayma olduğunda, otonom SHA-256 hash hesaplama ve kontrat denetleme motoru (`update-contract` / `verify-contract`) sayesinde arayüz kodları yazılmadan önce hatalar yakalanır.
|
|
25
|
+
4. **Çoklu Ajan Kaosu:** 10 farklı uzman yapay zeka ajanı, olay tabanlı asenkron bir haberleşme protokolü olan **Hermes Message Broker** üzerinden koordine edilir. Ajanlar birbirine rastgele müdahale edemez; tüm görevler bir İş Dağılım Grafiği (DAG) üzerinden komuta edilir.
|
|
26
|
+
5. **Sandbox ve Güvenlik Sınırlamaları:** Claude Code gibi modern araçların kernel düzeyindeki güvenlik yalıtımlarını (bubblewrap/seatbelt) ihlal etmemek adına, tüm bellek, kuyruk ve günlük mekanizmaları **proje kök klasöründeki lokal adaptör yollarında saklanır**; `/tmp` veya dış dizinleri kullanmayarak sıfır hata ile çalışır.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### 🚀 Sürüm v0.9.4 İle Gelen Devrimsel Yenilikler
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
* `
|
|
44
|
-
|
|
32
|
+
1. **🔒 Claude Code & Desktop Sandbox Uyumlu MCP Mimarisi:**
|
|
33
|
+
* Claude Desktop ve Claude Code CLI'ın güvenlik yalıtımlarına (sandbox) uyum sağlamak amacıyla, MCP sunucusunun otonom çalışacağı aktif proje dizinini dinamik çözümleyen `ENDERUN_PROJECT_ROOT` ortam değişkeni altyapısı sisteme entegre edildi.
|
|
34
|
+
* `claude` adaptörü kurulurken, Claude Code CLI'ın projeyi otomatik keşfetmesini sağlayan proje-seviyesi **`.mcp.json`** dosyası otomatik oluşturulur.
|
|
35
|
+
2. **📂 Claude Desktop & CLI Yapılandırma Düzeltmeleri:**
|
|
36
|
+
* Kod tabanında eskiden aranan yanlış `config.json` yolları temizlendi; yerine macOS ve Windows'taki gerçek Claude Desktop ayar dosyası olan **`claude_desktop_config.json`** ve küresel Claude Code CLI ayar dosyası olan **`~/.claude.json`** entegrasyonları getirildi.
|
|
37
|
+
3. **🛸 Grok Entegrasyonunun Sektör Standartlarına Uyumlanması:**
|
|
38
|
+
* Grok adaptörünün kullandığı varsayılan çalışma dizini jenerik `.agent` yerine, resmi ve topluluk standardı olan **`.grok/`** ve **`grok.md`** olarak güncellendi. Geriye dönük uyumluluk korunarak `.agent` aday dizin listesinde tutuldu.
|
|
39
|
+
4. **🧹 Kod Tekrarlarının Arındırılması ve SSOT Standardı:**
|
|
40
|
+
* `src/cli/utils/app.ts` içerisindeki mükerrer `getFrameworkDir` ve `getMemoryPath` fonksiyonları arındırılarak, `./memory.js` üzerindeki tekil doğruluk kaynağı ile birleştirildi.
|
|
45
41
|
|
|
46
42
|
---
|
|
47
43
|
|
|
@@ -51,7 +47,7 @@ Agent Enderun, sektörün öncüsü olan yapay zeka ekosistemlerini bir araya ge
|
|
|
51
47
|
* **🚀 Claude Code (Operasyonel Cerrahi):** **Saha Mühendisi**. Kod tabanındaki otonom ve milimetrik cerrahi düzenlemeleri (Surgical Edits) gerçekleştirir.
|
|
52
48
|
* **♊ Gemini & Vertex AI (Komuta İstihbaratı):** **Stratejik Karar Merkezi**. Proje geçmişini, mimari kararları analiz eder ve yüksek seviyeli stratejik yönlendirmeler yapar.
|
|
53
49
|
* **🛸 Antigravity (İç Disiplin & Akademi):** **Askeri Akademi**. İç standartları, anayasal uyumu korumak amacıyla izole edilmiş, yüksek disiplinli geliştirme ve test ortamı sağlar.
|
|
54
|
-
* **🤖 Grok / X.ai (Otonom Keşif Kanadı):** **Deneysel Keşif**. Gelecek vizyonlu otonom protokolleri test eder ve yapay zeka
|
|
50
|
+
* **🤖 Grok / X.ai (Otonom Keşif Kanadı):** **Deneysel Keşif**. Gelecek vizyonlu otonom protokolleri test eder ve yapay zeka gügümlü geliştirme sınırlarını zorlar.
|
|
55
51
|
|
|
56
52
|
---
|
|
57
53
|
|
|
@@ -62,10 +58,10 @@ Tüm operasyonlar, uzmanlık alanlarına göre ayrılmış ve Hermes protokolüy
|
|
|
62
58
|
| Ajan | Uzmanlık Rolü | Temel Sorumluluğu |
|
|
63
59
|
| :--- | :--- | :--- |
|
|
64
60
|
| **`@manager`** | Komuta & Strateji | Görev dağılımı (DAG), hafıza yönetimi (`PROJECT_MEMORY.md`), anayasa koruyuculuğu. |
|
|
65
|
-
| **`@quality`** | Kalite, Güvenlik & Analiz | AST zafiyet taramaları, anayasal uyum denetimi, kod inceleme checklistleri, test standartları kapıs
|
|
61
|
+
| **`@quality`** | Kalite, Güvenlik & Analiz | AST zafiyet taramaları, anayasal uyum denetimi, kod inceleme checklistleri, test standartları kapısı, CI/CD kapsam denetimi. |
|
|
66
62
|
| **`@database`** | Veritabanı Mimarisi | Veritabanı şemaları, migration kuralları, index optimizasyonları ve veri tohumlama (seeding). |
|
|
67
|
-
| **`@backend`** | İş Mantığı (Domain Logic) | API tasarımı, branded types, katmanlı mimari (Route -> Controller -> Service -> Repository)
|
|
68
|
-
| **`@frontend`** | Akıcı Responsive UI | Panda CSS tasarımı, responsive-first
|
|
63
|
+
| **`@backend`** | İş Mantığı (Domain Logic) | API tasarımı, branded types, katmanlı mimari (Route -> Controller -> Service -> Repository), audit günlüğü kontrolü. |
|
|
64
|
+
| **`@frontend`** | Akıcı Responsive UI | Panda CSS tasarımı, responsive-first arayüzler, custom React kancaları, rollback disiplini yönetimi. |
|
|
69
65
|
| **`@devops`** | Altyapı & Canlı Dağıtım | Native Node.js deploymentları, rollback planları, telemetri ve izleme (monitoring) kurulumları. |
|
|
70
66
|
| **`@explorer`** | Kod Analizi & Keşif | Kod tabanı analizi, bağımlılık grafikleri, legacy onboarding stratejileri. |
|
|
71
67
|
| **`@git`** | Sürüm Kontrolü | Trace ID uyumlu commit yönetimi, sürüm etiketleme ve dal (branch) hijyeni. |
|
|
@@ -74,92 +70,136 @@ Tüm operasyonlar, uzmanlık alanlarına göre ayrılmış ve Hermes protokolüy
|
|
|
74
70
|
|
|
75
71
|
---
|
|
76
72
|
|
|
77
|
-
###
|
|
73
|
+
### 🛠️ Kurulum & Adaptör Entegrasyon Kılavuzu
|
|
78
74
|
|
|
79
|
-
1.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
#### 1. Gemini Adaptörü Kurulumu
|
|
76
|
+
Gemini CLI veya Vertex AI entegrasyonu için proje dizininizde aşağıdaki komutu çalıştırın:
|
|
77
|
+
```bash
|
|
78
|
+
npx agent-enderun init gemini
|
|
79
|
+
```
|
|
80
|
+
* **Oluşturulan Yapı:** Proje kökünde `.gemini/` dizini ve `gemini.md` (SSOT şim dosyası) oluşturulur.
|
|
81
|
+
* **Aktivasyon:** Gemini CLI'a `.gemini/mcp_config.json` dosyasını tanıtın.
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
#### 2. Claude Adaptörü Kurulumu (Claude Code & Desktop)
|
|
84
|
+
Claude Desktop uygulamasında ve Claude Code CLI aracında otonom orduyu aktif etmek için:
|
|
85
|
+
```bash
|
|
86
|
+
npx agent-enderun init claude
|
|
87
|
+
```
|
|
88
|
+
* **Oluşturulan Yapı:** Proje kökünde `.claude/` dizini, `claude.md` ve en önemlisi proje-seviyesinde **`.mcp.json`** dosyası oluşturulur.
|
|
89
|
+
* **Küresel Kayıt:** Komut, sisteminizde kurulu olan Claude Desktop yapılandırmasını (`claude_desktop_config.json`) ve Claude Code küresel yapılandırmasını (`~/.claude.json`) tarayarak MCP sunucusunu otomatik olarak kaydeder.
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
#### 3. Grok Adaptörü Kurulumu
|
|
92
|
+
xAI Grok Build veya topluluk CLI araçları için:
|
|
93
|
+
```bash
|
|
94
|
+
npx agent-enderun init grok
|
|
95
|
+
```
|
|
96
|
+
* **Oluşturulan Yapı:** Proje kökünde **`.grok/`** dizini ve **`grok.md`** şim dosyası oluşturulur.
|
|
88
97
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
| `orchestrate` / `loop` | `@manager` | Canlı Hermes mesaj yönlendirici döngüsünü başlatarak asenkron ajan görevlerini yönlendirir. |
|
|
96
|
-
| `verify-contract` | `@backend` | Backend ile frontend arasındaki tip uyumluluğunu kilitler ve doğrular. |
|
|
97
|
-
| `create-app [idea]` | `@manager` | Doğal dildeki talep ve gereksinimlerden kurumsal monorepo uygulaması oluşturur. |
|
|
98
|
+
#### 4. Antigravity Adaptörü Kurulumu
|
|
99
|
+
Antigravity IDE ve CLI entegrasyonlarını etkinleştirmek için:
|
|
100
|
+
```bash
|
|
101
|
+
npx agent-enderun init antigravity
|
|
102
|
+
```
|
|
103
|
+
* **Oluşturulan Yapı:** `.gemini/antigravity/` veya `.gemini/antigravity-cli/` dizinleri altında yüksek disiplinli izole çalışma ortamları oluşturulur.
|
|
98
104
|
|
|
99
105
|
---
|
|
100
106
|
|
|
101
|
-
###
|
|
107
|
+
### 🕹️ CLI Komut Referansı ve Parametreleri
|
|
108
|
+
|
|
109
|
+
Enderun CLI, `agent-enderun` (veya `npx agent-enderun`) komutu ile yönetilir.
|
|
110
|
+
|
|
111
|
+
#### `init [adapter]`
|
|
112
|
+
Seçilen yapay zeka/IDE adaptörünü projeye kurar.
|
|
113
|
+
* **Kullanım:** `npx agent-enderun init [gemini | claude | grok | antigravity]`
|
|
114
|
+
* **Örnek:** `npx agent-enderun init claude`
|
|
115
|
+
|
|
116
|
+
#### `status`
|
|
117
|
+
Projenin aktif fazını (Phase 0 - 4), aktif Trace ID'sini ve uzman ajanların durum puanlarını listeler.
|
|
118
|
+
* **Kullanım:** `npx agent-enderun status`
|
|
119
|
+
|
|
120
|
+
#### `check`
|
|
121
|
+
Anayasal uyumluluk denetimlerini, kritik dosya bütünlüklerini ve dizin doğrulamalarını gerçekleştirir.
|
|
122
|
+
* **Kullanım:** `npx agent-enderun check`
|
|
102
123
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
124
|
+
#### `trace:new [description]`
|
|
125
|
+
Belirli bir geliştirme zinciri için yeni bir Trace ID (ULID) tetikler.
|
|
126
|
+
* **Kullanım:** `npx agent-enderun trace:new "Giriş modülü tasarımı" [agent-name] [priority]`
|
|
127
|
+
* **Örnek:** `npx agent-enderun trace:new "Auth module design" backend P1`
|
|
106
128
|
|
|
107
|
-
|
|
129
|
+
#### `orchestrate` / `loop`
|
|
130
|
+
Hermes Message Broker asenkron event-driven ajanlar arası iletişim döngüsünü canlı olarak başlatır.
|
|
131
|
+
* **Kullanım:** `npx agent-enderun orchestrate`
|
|
132
|
+
|
|
133
|
+
#### `verify-contract`
|
|
134
|
+
Frontend ve backend katmanları arasındaki tip bütünlüğünü ve `contract.version.json` uygunluğunu kontrol eder.
|
|
135
|
+
* **Kullanım:** `npx agent-enderun verify-contract`
|
|
136
|
+
|
|
137
|
+
#### `update-contract`
|
|
138
|
+
Backend tiplerinde yapılan değişiklikleri tarayarak `contract.version.json` üzerindeki SHA-256 hash imzalarını otonom olarak günceller.
|
|
139
|
+
* **Kullanım:** `npx agent-enderun update-contract`
|
|
140
|
+
|
|
141
|
+
#### `create-app [idea]`
|
|
142
|
+
Doğal dildeki açıklamalardan, kurumsal standartlarda kontrat-tabanlı monorepo uygulaması üretir.
|
|
143
|
+
* **Kullanım:** `npx agent-enderun create-app "Müşteri CRM Paneli"`
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### 📦 Geliştirici & npm Link Test Altyapısı
|
|
148
|
+
|
|
149
|
+
Paketi npm'de yayınlamadan önce yerelinizde derlemek ve test etmek için:
|
|
108
150
|
```bash
|
|
109
|
-
#
|
|
151
|
+
# Proje bağımlılıklarını yükleyin
|
|
110
152
|
npm install
|
|
153
|
+
|
|
154
|
+
# framework-mcp (MCP Sunucusu) ve CLI derlemelerini tetikleyin
|
|
111
155
|
npm run enderun:build
|
|
112
156
|
|
|
113
|
-
# Paketi
|
|
157
|
+
# Paketi global NPM havuzunuza bağlayın
|
|
114
158
|
npm link
|
|
115
159
|
|
|
116
|
-
#
|
|
117
|
-
mkdir test
|
|
160
|
+
# Boş bir test dizini açıp aracı bağlayın
|
|
161
|
+
mkdir enderun-test && cd enderun-test
|
|
118
162
|
npm init -y
|
|
119
163
|
npm link agent-enderun
|
|
120
164
|
|
|
121
|
-
#
|
|
165
|
+
# Herhangi bir adaptör kurulumunu başlatın
|
|
122
166
|
npx agent-enderun init gemini
|
|
123
167
|
```
|
|
124
168
|
|
|
125
169
|
---
|
|
126
170
|
---
|
|
127
171
|
|
|
128
|
-
## 🇺🇸 ENGLISH —
|
|
172
|
+
## 🇺🇸 ENGLISH — Detailed Product Guide & Documentation
|
|
129
173
|
|
|
130
|
-
**Agent Enderun** is not
|
|
174
|
+
**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.
|
|
131
175
|
|
|
132
|
-
As of **v0.9.
|
|
176
|
+
As of **v0.9.4**, 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 Claude Code & Desktop Sandbox standards**.
|
|
133
177
|
|
|
134
178
|
---
|
|
135
179
|
|
|
136
|
-
###
|
|
180
|
+
### ❓ Why Agent Enderun?
|
|
137
181
|
|
|
138
|
-
|
|
139
|
-
* The `.enderun` folder is no longer hardcoded as the sole runtime path.
|
|
140
|
-
* The CLI dynamically discovers the active framework folder from a candidate list `[.gemini, .claude, .agent, .enderun]`. This allows different AI agents or adapters (Claude Code, Gemini CLI, Grok) to operate in isolated workspaces without folder conflicts.
|
|
182
|
+
As AI coding assistants (Claude Code, Gemini CLI, Grok Build, etc.) become increasingly powerful, software projects are prone to rapid architectural drift and token wastage. Agent Enderun solves these critical **enterprise AI challenges**:
|
|
141
183
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"backend": "apps/backend",
|
|
148
|
-
"frontend": "apps/web",
|
|
149
|
-
"docs": "docs",
|
|
150
|
-
"tests": "tests"
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
* All validations (`verify-contract`), integrity checks (`check`), and scaffolding engines utilize this mapping.
|
|
184
|
+
1. **Rogue AI Prevention (Surgical Edits):** It strictly prohibits agents from rewriting entire files. Instead, it forces them to execute micro-targeted changes via **`replace_text` / `patch_file` tools**, reducing API token consumption by up to 90%.
|
|
185
|
+
2. **Context Loss Prevention (SSOT Memory):** AI agents naturally lose project history across chats. Enderun seals all project milestones, decisions, and tasks into a self-pruning **`PROJECT_MEMORY.md`** file, ensuring absolute context continuity.
|
|
186
|
+
3. **Contract-First Safety (Frontend-Backend Drift):** Before any user interface code is written, API models and branded types are sealed. The otonomous contract verification engine checks SHA-256 type definitions to prevent integration drifts.
|
|
187
|
+
4. **Symmetric Orchestration (Hermes Protocol):** 10 specialized expert agents communicate via an asynchronous, event-driven message broker (**Hermes**), preventing chaotic, uncoordinated AI behavior.
|
|
188
|
+
5. **Sandbox & Security Compliance:** Modern CLI agents (like Claude Code) restrict filesystem access. By keeping all configurations, task logs, and queues local (inside `.gemini/`, `.claude/`, `.grok/`, etc.) in the project workspace, Enderun runs with **zero sandbox violations**.
|
|
154
189
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### 🚀 Key Improvements in Version v0.9.4
|
|
158
193
|
|
|
159
|
-
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
|
|
194
|
+
1. **🔒 Claude Sandbox-Compliant MCP Architecture:**
|
|
195
|
+
* Integrated the `ENDERUN_PROJECT_ROOT` environment variable mapping, allowing the Model Context Protocol (MCP) server to dynamically resolve the target workspace root even when globally spawned by Claude Desktop.
|
|
196
|
+
* Added auto-generation of project-level **`.mcp.json`** files during Claude adapter initialization, enabling seamless project discovery for the Claude Code CLI.
|
|
197
|
+
2. **📂 Robust Claude Config Resolution:**
|
|
198
|
+
* Patched path resolution to look for macOS/Windows **`claude_desktop_config.json`** (instead of standard `config.json`) and Claude Code CLI global configuration **`~/.claude.json`**.
|
|
199
|
+
3. **🛸 Official Grok/xAI Directory Alignment:**
|
|
200
|
+
* Aligned Grok's default `frameworkDir` from the generic `.agent` directory to the standard **`.grok/`** folder and **`grok.md`** shim file.
|
|
201
|
+
4. **🧹 Refactoring and Code Compaction:**
|
|
202
|
+
* Removed duplicated local `getFrameworkDir` and `getMemoryPath` helpers in `src/cli/utils/app.ts`, merging them directly into `./memory.js` to respect the Single Source of Truth rule.
|
|
163
203
|
|
|
164
204
|
---
|
|
165
205
|
|
|
@@ -169,7 +209,7 @@ Agent Enderun coordinates industry-leading AI environments by assigning each a s
|
|
|
169
209
|
* **🚀 Claude Code (Operational Surgery):** The **Field Engineer**. Excels in executing precise, surgical, and autonomous codebase edits.
|
|
170
210
|
* **♊ Gemini & Vertex AI (Command Intelligence):** The **Command Center**. Analyzes project history, memory logs, and executes high-level strategic decisions.
|
|
171
211
|
* **🛸 Antigravity (Internal Discipline):** The **Military Academy**. Provides an isolated, high-discipline sandbox to preserve internal framework coding standards.
|
|
172
|
-
* **🤖 Grok / X.ai (
|
|
212
|
+
* **🤖 Grok / X.ai (Scouting Wing):** The **Scouting Specialist**. Explores futuristic agent behaviors and tests experimental protocols.
|
|
173
213
|
|
|
174
214
|
---
|
|
175
215
|
|
|
@@ -180,66 +220,88 @@ All workspace operations are divided among 10 specialized expert agents connecte
|
|
|
180
220
|
| Agent | Specialization Role | Core Responsibility |
|
|
181
221
|
| :--- | :--- | :--- |
|
|
182
222
|
| **`@manager`** | Command & Strategy | Task dependency graphs (DAG), memory pruning (`PROJECT_MEMORY.md`), constitution compliance. |
|
|
183
|
-
| **`@quality`** | Quality, Security & Analysis | AST vulnerability scanning, constitutional audits, code review checklists, test standard gates. |
|
|
223
|
+
| **`@quality`** | Quality, Security & Analysis | AST vulnerability scanning, constitutional audits, code review checklists, test standard gates, CI/CD coverage verification. |
|
|
184
224
|
| **`@database`** | Database Architecture | Database schemas, migration workflows, query optimization, and contract-aware seeding. |
|
|
185
|
-
| **`@backend`** | Domain Logic Specialist | API route design, branded types, layered architecture (Route -> Controller -> Service -> Repository). |
|
|
186
|
-
| **`@frontend`** | Fluid Responsive UI | Panda CSS design, responsive-first interfaces, customized React hooks. |
|
|
225
|
+
| **`@backend`** | Domain Logic Specialist | API route design, branded types, layered architecture (Route -> Controller -> Service -> Repository), audit logging scan. |
|
|
226
|
+
| **`@frontend`** | Fluid Responsive UI | Panda CSS design, responsive-first interfaces, customized React hooks, rollback discipline management. |
|
|
187
227
|
| **`@devops`** | Infrastructure Specialist | Native Node.js deployments, rollback plans, monitoring & logging setups. |
|
|
188
228
|
| **`@explorer`** | Codebase Intelligence | Project analysis, dependency graph generation, legacy conversion strategies. |
|
|
189
|
-
| **`@git`** | Version Control | Semantic Trace-ID-aligned commits,
|
|
229
|
+
| **`@git`** | Version Control | Semantic Trace-ID-aligned commits, branch hygiene. |
|
|
190
230
|
| **`@mobile`** | Mobile Development | React Native / Expo UI automation and native builds. |
|
|
191
231
|
| **`@native`** | Desktop Engineering | Tauri and Electron desktop app integrations. |
|
|
192
232
|
|
|
193
233
|
---
|
|
194
234
|
|
|
195
|
-
###
|
|
235
|
+
### 🛠️ Adapter Scaffolding & Setup Guide
|
|
196
236
|
|
|
197
|
-
1.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
237
|
+
#### 1. Gemini Adapter
|
|
238
|
+
Initialize the Gemini CLI / Vertex AI environment:
|
|
239
|
+
```bash
|
|
240
|
+
npx agent-enderun init gemini
|
|
241
|
+
```
|
|
242
|
+
* **Created Files:** `.gemini/` runtime folder, `gemini.md` (SSOT entrance), and `.gemini/mcp_config.json`.
|
|
202
243
|
|
|
203
|
-
|
|
244
|
+
#### 2. Claude Adapter (Claude Code CLI & Desktop App)
|
|
245
|
+
Bootstrap the framework for Anthropic's Claude:
|
|
246
|
+
```bash
|
|
247
|
+
npx agent-enderun init claude
|
|
248
|
+
```
|
|
249
|
+
* **Created Files:** `.claude/` folder, `claude.md` shim, and project-level **`.mcp.json`** for Claude Code.
|
|
250
|
+
* **Global Registration:** Automatically discovers and registers the MCP server in Claude Desktop's `claude_desktop_config.json` and Claude Code's `~/.claude.json`.
|
|
204
251
|
|
|
205
|
-
|
|
252
|
+
#### 3. Grok Adapter
|
|
253
|
+
Scaffold for xAI Grok Build:
|
|
254
|
+
```bash
|
|
255
|
+
npx agent-enderun init grok
|
|
256
|
+
```
|
|
257
|
+
* **Created Files:** **`.grok/`** folder and **`grok.md`** shim file.
|
|
206
258
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
| `orchestrate` / `loop` | `@manager` | Spin up the live Hermes message-broker loop to route asynchronous agent actions. |
|
|
214
|
-
| `verify-contract` | `@backend` | Verify and seal type alignment between backend and frontend contracts. |
|
|
215
|
-
| `create-app [idea]` | `@manager` | Generate a corporate monorepo application from natural language requirements. |
|
|
259
|
+
#### 4. Antigravity Adapter
|
|
260
|
+
Bootstrap the high-discipline sandbox for Antigravity IDE and CLI runtimes:
|
|
261
|
+
```bash
|
|
262
|
+
npx agent-enderun init antigravity
|
|
263
|
+
```
|
|
264
|
+
* **Created Files:** `.gemini/antigravity/` or `.gemini/antigravity-cli/` isolated paths.
|
|
216
265
|
|
|
217
266
|
---
|
|
218
267
|
|
|
219
|
-
###
|
|
268
|
+
### 🕹️ CLI Command Reference
|
|
220
269
|
|
|
221
|
-
|
|
222
|
-
* **Prepublish Build Automation Hook (`prepublishOnly`):** Triggers `npm run enderun:build` before publishing, ensuring compiled Model Context Protocol (MCP) server binaries are always built and up-to-date.
|
|
223
|
-
* **CLI Source Bundle Inclusion:** Bundles the `"src"` folder in the published package, preventing downstream execution crashes on typescript-enabled runtime environments.
|
|
270
|
+
Execute commands via `agent-enderun` (or `npx agent-enderun`):
|
|
224
271
|
|
|
225
|
-
|
|
272
|
+
* **`init [adapter]`**: Scaffold framework directories and register local/global MCP server instances.
|
|
273
|
+
* **`status`**: Output active Phase (0-4), current active Trace ID, and agent capability logs.
|
|
274
|
+
* **`check`**: Run a thorough framework integrity, folder alignment, and constitutional compliance check.
|
|
275
|
+
* **`trace:new [desc] [agent] [priority]`**: Launch a new traceable task chain stamped with a unique ULID.
|
|
276
|
+
* **`orchestrate` / `loop`**: Launch the Hermes live event-driven message-routing loop for asynchronous agent synchronization.
|
|
277
|
+
* **`verify-contract`**: Perform a contract audit to ensure frontend types match backend schemas.
|
|
278
|
+
* **`update-contract`**: Re-calculate type definitions and update `contract.version.json` with a new SHA-256 hash.
|
|
279
|
+
* **`create-app [idea]`**: Autonomously generate a full-stack monorepo project starter based on natural language inputs.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
### 📦 Local Package Testing & Development
|
|
284
|
+
|
|
285
|
+
To compile and link the package locally for development:
|
|
226
286
|
```bash
|
|
227
|
-
# Install
|
|
287
|
+
# Install package dependencies
|
|
228
288
|
npm install
|
|
289
|
+
|
|
290
|
+
# Compile the Model Context Protocol (MCP) server and build assets
|
|
229
291
|
npm run enderun:build
|
|
230
292
|
|
|
231
|
-
#
|
|
293
|
+
# Globally link package on your system
|
|
232
294
|
npm link
|
|
233
295
|
|
|
234
|
-
# Create a test folder and
|
|
235
|
-
mkdir test
|
|
296
|
+
# Create a test folder and mount package
|
|
297
|
+
mkdir enderun-test && cd enderun-test
|
|
236
298
|
npm init -y
|
|
237
299
|
npm link agent-enderun
|
|
238
300
|
|
|
239
|
-
#
|
|
301
|
+
# Bootstrap scaffolding
|
|
240
302
|
npx agent-enderun init gemini
|
|
241
303
|
```
|
|
242
304
|
|
|
243
305
|
---
|
|
244
306
|
|
|
245
|
-
Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v0.9.
|
|
307
|
+
Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v0.9.4**
|
package/bin/init-check.js
CHANGED
|
@@ -5,7 +5,15 @@ import path from "path";
|
|
|
5
5
|
|
|
6
6
|
const targetDir = process.cwd();
|
|
7
7
|
|
|
8
|
-
const candidates = [
|
|
8
|
+
const candidates = [
|
|
9
|
+
".gemini/antigravity",
|
|
10
|
+
".gemini/antigravity-cli",
|
|
11
|
+
".gemini",
|
|
12
|
+
".claude",
|
|
13
|
+
".grok",
|
|
14
|
+
".agent",
|
|
15
|
+
".enderun",
|
|
16
|
+
];
|
|
9
17
|
let frameworkDir = ".enderun";
|
|
10
18
|
for (const dir of candidates) {
|
|
11
19
|
if (fs.existsSync(path.join(targetDir, dir))) {
|
package/bin/update-contract.js
CHANGED
|
@@ -9,7 +9,15 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
9
9
|
const __dirname = path.dirname(__filename);
|
|
10
10
|
const projectRoot = path.join(__dirname, "..");
|
|
11
11
|
|
|
12
|
-
const candidates = [
|
|
12
|
+
const candidates = [
|
|
13
|
+
".gemini/antigravity",
|
|
14
|
+
".gemini/antigravity-cli",
|
|
15
|
+
".gemini",
|
|
16
|
+
".claude",
|
|
17
|
+
".grok",
|
|
18
|
+
".agent",
|
|
19
|
+
".enderun",
|
|
20
|
+
];
|
|
13
21
|
let frameworkDir = ".enderun";
|
|
14
22
|
for (const dir of candidates) {
|
|
15
23
|
if (fs.existsSync(path.join(projectRoot, dir))) {
|
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
|
|
6
|
-
const FRAMEWORK_CANDIDATES = [
|
|
6
|
+
const FRAMEWORK_CANDIDATES = [
|
|
7
|
+
".gemini/antigravity",
|
|
8
|
+
".gemini/antigravity-cli",
|
|
9
|
+
".gemini",
|
|
10
|
+
".claude",
|
|
11
|
+
".grok",
|
|
12
|
+
".agent",
|
|
13
|
+
".enderun",
|
|
14
|
+
];
|
|
7
15
|
|
|
8
16
|
function detectFrameworkDir() {
|
|
9
17
|
for (const dir of FRAMEWORK_CANDIDATES) {
|
|
@@ -6,7 +6,7 @@ import path from "path";
|
|
|
6
6
|
import { execSync } from "child_process";
|
|
7
7
|
const server = new Server({
|
|
8
8
|
name: "agent-enderun-mcp",
|
|
9
|
-
version: "0.9.
|
|
9
|
+
version: "0.9.4",
|
|
10
10
|
}, {
|
|
11
11
|
capabilities: {
|
|
12
12
|
tools: {},
|
|
@@ -99,6 +99,27 @@ const TOOLS = [
|
|
|
99
99
|
required: ["to", "category", "content", "traceId"],
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
|
+
{
|
|
103
|
+
name: "log_agent_action",
|
|
104
|
+
description: "Log an agent action to the framework logs.",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
agent: { type: "string", description: "The agent name (e.g., @manager, @backend)" },
|
|
109
|
+
action: { type: "string", description: "Action type or name" },
|
|
110
|
+
traceId: { type: "string", description: "The active Trace ID" },
|
|
111
|
+
status: { type: "string", enum: ["SUCCESS", "FAILURE"], description: "The status of the action" },
|
|
112
|
+
summary: { type: "string", description: "Brief description of the action taken" },
|
|
113
|
+
findings: { type: "array", items: { type: "string" }, description: "Optional findings or details" }
|
|
114
|
+
},
|
|
115
|
+
required: ["agent", "action", "traceId", "status", "summary"]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "update_contract_hash",
|
|
120
|
+
description: "Re-generate and synchronize the backend contract SHA-256 hash.",
|
|
121
|
+
inputSchema: { type: "object", properties: {} }
|
|
122
|
+
}
|
|
102
123
|
];
|
|
103
124
|
server.onRequest(ListToolsRequestSchema, async () => {
|
|
104
125
|
return { tools: TOOLS };
|
|
@@ -161,7 +182,22 @@ server.onRequest(CallToolRequestSchema, async (request) => {
|
|
|
161
182
|
}
|
|
162
183
|
case "send_agent_message": {
|
|
163
184
|
const { to, category, content, traceId } = args;
|
|
164
|
-
const
|
|
185
|
+
const candidates = [
|
|
186
|
+
".gemini/antigravity",
|
|
187
|
+
".gemini/antigravity-cli",
|
|
188
|
+
".gemini",
|
|
189
|
+
".claude",
|
|
190
|
+
".grok",
|
|
191
|
+
".agent",
|
|
192
|
+
".enderun",
|
|
193
|
+
];
|
|
194
|
+
let frameworkDir = ".gemini";
|
|
195
|
+
for (const c of candidates) {
|
|
196
|
+
if (fs.existsSync(path.join(projectRoot, c))) {
|
|
197
|
+
frameworkDir = c;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
165
201
|
const messagePath = path.join(projectRoot, frameworkDir, "messages", `${to.replace("@", "")}.json`);
|
|
166
202
|
const message = {
|
|
167
203
|
timestamp: new Date().toISOString(),
|
|
@@ -176,6 +212,43 @@ server.onRequest(CallToolRequestSchema, async (request) => {
|
|
|
176
212
|
fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
|
|
177
213
|
return { content: [{ type: "text", text: `✅ Message sent to ${to}` }] };
|
|
178
214
|
}
|
|
215
|
+
case "log_agent_action": {
|
|
216
|
+
const { agent, action, traceId, status, summary, findings } = args;
|
|
217
|
+
const candidates = [
|
|
218
|
+
".gemini/antigravity",
|
|
219
|
+
".gemini/antigravity-cli",
|
|
220
|
+
".gemini",
|
|
221
|
+
".claude",
|
|
222
|
+
".grok",
|
|
223
|
+
".agent",
|
|
224
|
+
".enderun",
|
|
225
|
+
];
|
|
226
|
+
let frameworkDir = ".enderun";
|
|
227
|
+
for (const c of candidates) {
|
|
228
|
+
if (fs.existsSync(path.join(projectRoot, c))) {
|
|
229
|
+
frameworkDir = c;
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const agentName = agent.replace("@", "");
|
|
234
|
+
const logPath = path.join(projectRoot, frameworkDir, "logs", `${agentName}.json`);
|
|
235
|
+
const logEntry = {
|
|
236
|
+
timestamp: new Date().toISOString(),
|
|
237
|
+
agent,
|
|
238
|
+
action,
|
|
239
|
+
requestId: traceId,
|
|
240
|
+
status,
|
|
241
|
+
summary,
|
|
242
|
+
findings: findings || []
|
|
243
|
+
};
|
|
244
|
+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
245
|
+
fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
|
|
246
|
+
return { content: [{ type: "text", text: `✅ Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
247
|
+
}
|
|
248
|
+
case "update_contract_hash": {
|
|
249
|
+
const output = execSync("npx agent-enderun update-contract").toString();
|
|
250
|
+
return { content: [{ type: "text", text: output }] };
|
|
251
|
+
}
|
|
179
252
|
default:
|
|
180
253
|
throw new Error(`Unknown tool: ${name}`);
|
|
181
254
|
}
|
|
@@ -11,7 +11,7 @@ import { execSync } from "child_process";
|
|
|
11
11
|
const server = new Server(
|
|
12
12
|
{
|
|
13
13
|
name: "agent-enderun-mcp",
|
|
14
|
-
version: "0.9.
|
|
14
|
+
version: "0.9.4",
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
capabilities: {
|
|
@@ -107,6 +107,27 @@ const TOOLS: any[] = [
|
|
|
107
107
|
required: ["to", "category", "content", "traceId"],
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
+
{
|
|
111
|
+
name: "log_agent_action",
|
|
112
|
+
description: "Log an agent action to the framework logs.",
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: {
|
|
116
|
+
agent: { type: "string", description: "The agent name (e.g., @manager, @backend)" },
|
|
117
|
+
action: { type: "string", description: "Action type or name" },
|
|
118
|
+
traceId: { type: "string", description: "The active Trace ID" },
|
|
119
|
+
status: { type: "string", enum: ["SUCCESS", "FAILURE"], description: "The status of the action" },
|
|
120
|
+
summary: { type: "string", description: "Brief description of the action taken" },
|
|
121
|
+
findings: { type: "array", items: { type: "string" }, description: "Optional findings or details" }
|
|
122
|
+
},
|
|
123
|
+
required: ["agent", "action", "traceId", "status", "summary"]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "update_contract_hash",
|
|
128
|
+
description: "Re-generate and synchronize the backend contract SHA-256 hash.",
|
|
129
|
+
inputSchema: { type: "object", properties: {} }
|
|
130
|
+
}
|
|
110
131
|
];
|
|
111
132
|
|
|
112
133
|
server.onRequest(ListToolsRequestSchema, async () => {
|
|
@@ -189,7 +210,22 @@ server.onRequest(CallToolRequestSchema, async (request: any) => {
|
|
|
189
210
|
traceId: string;
|
|
190
211
|
}
|
|
191
212
|
const { to, category, content, traceId } = args as any as SendAgentMessageArgs;
|
|
192
|
-
const
|
|
213
|
+
const candidates = [
|
|
214
|
+
".gemini/antigravity",
|
|
215
|
+
".gemini/antigravity-cli",
|
|
216
|
+
".gemini",
|
|
217
|
+
".claude",
|
|
218
|
+
".grok",
|
|
219
|
+
".agent",
|
|
220
|
+
".enderun",
|
|
221
|
+
];
|
|
222
|
+
let frameworkDir = ".gemini";
|
|
223
|
+
for (const c of candidates) {
|
|
224
|
+
if (fs.existsSync(path.join(projectRoot, c))) {
|
|
225
|
+
frameworkDir = c;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
193
229
|
const messagePath = path.join(projectRoot, frameworkDir, "messages", `${to.replace("@", "")}.json`);
|
|
194
230
|
|
|
195
231
|
const message = {
|
|
@@ -208,6 +244,58 @@ server.onRequest(CallToolRequestSchema, async (request: any) => {
|
|
|
208
244
|
return { content: [{ type: "text", text: `✅ Message sent to ${to}` }] };
|
|
209
245
|
}
|
|
210
246
|
|
|
247
|
+
case "log_agent_action": {
|
|
248
|
+
interface LogAgentActionArgs {
|
|
249
|
+
agent: string;
|
|
250
|
+
action: string;
|
|
251
|
+
traceId: string;
|
|
252
|
+
status: "SUCCESS" | "FAILURE";
|
|
253
|
+
summary: string;
|
|
254
|
+
findings?: string[];
|
|
255
|
+
}
|
|
256
|
+
const { agent, action, traceId, status, summary, findings } = args as any as LogAgentActionArgs;
|
|
257
|
+
|
|
258
|
+
const candidates = [
|
|
259
|
+
".gemini/antigravity",
|
|
260
|
+
".gemini/antigravity-cli",
|
|
261
|
+
".gemini",
|
|
262
|
+
".claude",
|
|
263
|
+
".grok",
|
|
264
|
+
".agent",
|
|
265
|
+
".enderun",
|
|
266
|
+
];
|
|
267
|
+
let frameworkDir = ".enderun";
|
|
268
|
+
for (const c of candidates) {
|
|
269
|
+
if (fs.existsSync(path.join(projectRoot, c))) {
|
|
270
|
+
frameworkDir = c;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const agentName = agent.replace("@", "");
|
|
276
|
+
const logPath = path.join(projectRoot, frameworkDir, "logs", `${agentName}.json`);
|
|
277
|
+
|
|
278
|
+
const logEntry = {
|
|
279
|
+
timestamp: new Date().toISOString(),
|
|
280
|
+
agent,
|
|
281
|
+
action,
|
|
282
|
+
requestId: traceId,
|
|
283
|
+
status,
|
|
284
|
+
summary,
|
|
285
|
+
findings: findings || []
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
289
|
+
fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
|
|
290
|
+
|
|
291
|
+
return { content: [{ type: "text", text: `✅ Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
case "update_contract_hash": {
|
|
295
|
+
const output = execSync("npx agent-enderun update-contract").toString();
|
|
296
|
+
return { content: [{ type: "text", text: output }] };
|
|
297
|
+
}
|
|
298
|
+
|
|
211
299
|
default:
|
|
212
300
|
throw new Error(`Unknown tool: ${name}`);
|
|
213
301
|
}
|
package/mcp.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-enderun",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"enderun:status": "agent-enderun status",
|
|
57
57
|
"enderun:trace": "agent-enderun trace:new",
|
|
58
58
|
"enderun:verify": "agent-enderun verify-contract",
|
|
59
|
+
"enderun:update-contract": "agent-enderun update-contract",
|
|
59
60
|
"enderun:check": "agent-enderun check",
|
|
60
61
|
"enderun:lint": "eslint .",
|
|
61
62
|
"lint": "eslint .",
|
package/src/cli/adapters.ts
CHANGED
|
@@ -35,7 +35,7 @@ export const ADAPTERS: Record<AdapterId, AdapterConfig> = {
|
|
|
35
35
|
},
|
|
36
36
|
grok: {
|
|
37
37
|
id: "grok",
|
|
38
|
-
frameworkDir: ".
|
|
38
|
+
frameworkDir: ".grok", // Standard config directory for Grok/X.ai agent
|
|
39
39
|
shimFile: "grok.md",
|
|
40
40
|
templateDir: ".enderun",
|
|
41
41
|
},
|
|
@@ -59,8 +59,11 @@ export const ADAPTERS: Record<AdapterId, AdapterConfig> = {
|
|
|
59
59
|
* and internal standards for Antigravity (.gemini/antigravity/).
|
|
60
60
|
*/
|
|
61
61
|
export const FRAMEWORK_DIR_CANDIDATES = [
|
|
62
|
+
".gemini/antigravity",
|
|
63
|
+
".gemini/antigravity-cli",
|
|
62
64
|
".gemini",
|
|
63
65
|
".claude",
|
|
66
|
+
".grok",
|
|
64
67
|
".agent",
|
|
65
68
|
".enderun",
|
|
66
69
|
] as const;
|
|
@@ -194,6 +197,8 @@ export function runAdapterPostInit(adapter: AdapterConfig, projectRoot: string):
|
|
|
194
197
|
console.warn("⚠️ Claude config not found. Add MCP manually (see README).");
|
|
195
198
|
}
|
|
196
199
|
writeJsonFile(path.join(projectRoot, adapter.frameworkDir, "mcp_config.json"), mcpBlock);
|
|
200
|
+
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
201
|
+
console.warn("✅ Claude Code Project MCP → .mcp.json");
|
|
197
202
|
break;
|
|
198
203
|
}
|
|
199
204
|
default:
|
|
@@ -43,3 +43,43 @@ export function verifyApiContractCommand() {
|
|
|
43
43
|
process.exit(1);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Update and synchronize type safety between backend and frontend contracts.
|
|
49
|
+
*/
|
|
50
|
+
export function updateApiContractCommand() {
|
|
51
|
+
const projectRoot = process.cwd();
|
|
52
|
+
const pathsMap = getConfiguredPaths();
|
|
53
|
+
const sharedDir = path.join(projectRoot, pathsMap.backend, "src/types");
|
|
54
|
+
const contractPath = path.join(projectRoot, pathsMap.backend, "contract.version.json");
|
|
55
|
+
|
|
56
|
+
if (!fs.existsSync(sharedDir)) {
|
|
57
|
+
console.error("❌ Error: API types directory missing.");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const walk = (d: string): string[] => fs.readdirSync(d, { withFileTypes: true }).flatMap((e) => {
|
|
62
|
+
const fullPath = path.join(d, e.name);
|
|
63
|
+
return e.isDirectory() ? walk(fullPath) : (e.name.endsWith(".ts") ? [fullPath] : []);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const hash = crypto.createHash("sha256");
|
|
67
|
+
for (const filePath of walk(sharedDir).sort()) {
|
|
68
|
+
hash.update(path.relative(projectRoot, filePath));
|
|
69
|
+
hash.update("\0");
|
|
70
|
+
hash.update(fs.readFileSync(filePath));
|
|
71
|
+
hash.update("\0");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const currentHash = hash.digest("hex");
|
|
75
|
+
|
|
76
|
+
const contractData = {
|
|
77
|
+
contract_hash: currentHash,
|
|
78
|
+
last_updated: new Date().toISOString()
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
fs.mkdirSync(path.dirname(contractPath), { recursive: true });
|
|
82
|
+
fs.writeFileSync(contractPath, JSON.stringify(contractData, null, 2));
|
|
83
|
+
console.warn(`✅ Contract successfully synchronized. New hash: ${currentHash}`);
|
|
84
|
+
}
|
|
85
|
+
|
package/src/cli/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { statusCommand } from "./commands/status.js";
|
|
|
7
7
|
import { traceNewCommand } from "./commands/trace.js";
|
|
8
8
|
import { updateProjectMemoryCommand } from "./commands/memory.js";
|
|
9
9
|
import { createAppCommand } from "./commands/app.js";
|
|
10
|
-
import { verifyApiContractCommand } from "./commands/contract.js";
|
|
10
|
+
import { verifyApiContractCommand, updateApiContractCommand } from "./commands/contract.js";
|
|
11
11
|
import { orchestrateCommand } from "./commands/orchestrate.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -62,6 +62,10 @@ async function main() {
|
|
|
62
62
|
verifyApiContractCommand();
|
|
63
63
|
break;
|
|
64
64
|
|
|
65
|
+
case "update-contract":
|
|
66
|
+
updateApiContractCommand();
|
|
67
|
+
break;
|
|
68
|
+
|
|
65
69
|
case "version":
|
|
66
70
|
case "-v":
|
|
67
71
|
case "--version":
|
|
@@ -86,6 +90,7 @@ Commands:
|
|
|
86
90
|
create-app <idea> Generate a new full-stack app from natural language
|
|
87
91
|
orchestrate Start the dynamic Hermes agent orchestration loop
|
|
88
92
|
verify-contract Validate type alignment between backend and frontend
|
|
93
|
+
update-contract Generate and synchronize a new contract hash
|
|
89
94
|
version Show version information
|
|
90
95
|
|
|
91
96
|
Supported adapters (one init per IDE — separate folder each):
|
package/src/cli/utils/app.ts
CHANGED
|
@@ -4,7 +4,7 @@ import crypto from "crypto";
|
|
|
4
4
|
import { ensureDir, writeTextFile, writeJsonFile } from "../utils/fs.js";
|
|
5
5
|
import { updateProjectMemoryCommand } from "../commands/memory.js";
|
|
6
6
|
import { slugifyName, titleCase } from "../utils/string.js";
|
|
7
|
-
import { getConfiguredPaths } from "./memory.js";
|
|
7
|
+
import { getConfiguredPaths, getFrameworkDir, getMemoryPath } from "./memory.js";
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
const targetDir = process.cwd(); // Assuming targetDir is process.cwd() in the CLI context
|
|
@@ -752,13 +752,4 @@ export async function collectCreateAppDescription(args: string[]) {
|
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
|
|
755
|
-
function getFrameworkDir(): string {
|
|
756
|
-
for (const dir of [".gemini", ".claude", ".agent", ".enderun"]) {
|
|
757
|
-
if (fs.existsSync(path.join(process.cwd(), dir))) return dir;
|
|
758
|
-
}
|
|
759
|
-
return ".gemini";
|
|
760
|
-
}
|
|
761
755
|
|
|
762
|
-
function getMemoryPath(): string {
|
|
763
|
-
return path.join(process.cwd(), getFrameworkDir(), "PROJECT_MEMORY.md");
|
|
764
|
-
}
|
package/src/cli/utils/claude.ts
CHANGED
|
@@ -9,11 +9,16 @@ export function findClaudeConfigPath(): string | null {
|
|
|
9
9
|
if (!home) return null;
|
|
10
10
|
|
|
11
11
|
const possiblePaths = [
|
|
12
|
+
// Claude Desktop
|
|
13
|
+
path.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json"), // macOS Claude Desktop
|
|
14
|
+
path.join(home, "AppData", "Roaming", "Claude", "claude_desktop_config.json"), // Windows Claude Desktop
|
|
15
|
+
// Claude Code CLI
|
|
16
|
+
path.join(home, ".claude.json"), // Global Claude Code CLI MCP config
|
|
17
|
+
// Legacy or system-specific paths
|
|
12
18
|
path.join(home, ".config", "claude", "config.json"),
|
|
13
19
|
path.join(home, ".claude", "config.json"),
|
|
14
|
-
path.join(home, "Library", "Application Support", "Claude", "config.json"),
|
|
15
|
-
path.join(home, "
|
|
16
|
-
path.join(home, ".config", "Claude", "config.json"), // some Linux setups
|
|
20
|
+
path.join(home, "Library", "Application Support", "Claude Code", "config.json"),
|
|
21
|
+
path.join(home, ".config", "Claude", "config.json"),
|
|
17
22
|
];
|
|
18
23
|
|
|
19
24
|
for (const p of possiblePaths) {
|