agent-enderun 0.8.7 → 0.9.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.
- package/{ENDERUN.md → .enderun/ENDERUN.md} +5 -3
- package/.enderun/PROJECT_MEMORY.md +12 -53
- package/.enderun/STATUS.md +7 -8
- package/.enderun/agents/agent_army_schema.json +28 -6
- package/.enderun/agents/analyst.md +9 -18
- package/.enderun/agents/backend.md +22 -52
- package/.enderun/agents/devops.md +9 -19
- package/.enderun/agents/explorer.md +7 -16
- package/.enderun/agents/frontend.md +82 -84
- package/.enderun/agents/git.md +7 -16
- package/.enderun/agents/manager.md +34 -40
- package/.enderun/agents/mobile.md +7 -16
- package/.enderun/agents/native.md +7 -16
- package/.enderun/agents/orchestrator.md +16 -25
- package/.enderun/agents/qa.md +12 -24
- package/.enderun/agents/schema/agent-lifecycle-schema.json +29 -8
- package/.enderun/agents/security.md +9 -18
- package/.enderun/config.json +1 -1
- package/.enderun/knowledge/SHIM_TEMPLATE.md +25 -0
- package/.enderun/knowledge/eslint-standards.md +63 -0
- package/.enderun/knowledge/hermes_protocol.md +1 -1
- package/.enderun/knowledge/token_economy_and_memory.md +129 -0
- package/.enderun/mcp_config.json +9 -0
- package/.enderun/memory-graph/agent-contexts/analyst.json +1 -1
- package/.enderun/memory-graph/agent-contexts/backend.json +1 -1
- package/.enderun/memory-graph/agent-contexts/devops.json +1 -1
- package/.enderun/memory-graph/agent-contexts/explorer.json +1 -1
- package/.enderun/memory-graph/agent-contexts/frontend.json +1 -1
- package/.enderun/memory-graph/agent-contexts/git.json +1 -1
- package/.enderun/memory-graph/agent-contexts/manager.json +1 -1
- package/.enderun/memory-graph/agent-contexts/mobile.json +1 -1
- package/.enderun/memory-graph/agent-contexts/native.json +1 -1
- package/.enderun/memory-graph/agent-contexts/orchestrator.json +1 -1
- package/.enderun/memory-graph/agent-contexts/qa.json +1 -1
- package/.enderun/memory-graph/agent-contexts/security.json +1 -1
- package/.enderun/memory-graph/graph.json +123 -16
- package/.enderun/memory-graph/shared-facts.json +26 -32
- package/README.md +93 -295
- package/agent.md +25 -0
- package/bin/cli.js +9 -9
- package/bin/update-contract.js +34 -37
- package/bin/validate-agent-army.js +38 -13
- package/claude.md +14 -8
- package/docs/README.md +35 -16
- package/docs/roadmap.md +1 -1
- package/docs/tech-stack.md +30 -0
- package/eslint.config.js +68 -0
- package/framework-mcp/dist/index.js +184 -24
- package/framework-mcp/package.json +6 -33
- package/framework-mcp/tsconfig.json +3 -6
- package/gemini.md +12 -6
- package/grok.md +25 -0
- package/mcp.json +2 -2
- package/package.json +12 -6
- package/panda.config.ts +86 -86
- package/tsconfig.json +9 -0
- package/.enderun/claude.md +0 -19
- package/.enderun/cursor.md +0 -19
- package/.enderun/gemini.md +0 -19
- package/.enderun/logs/analyst.json +0 -1
- package/.enderun/logs/backend.json +0 -1
- package/.enderun/logs/devops.json +0 -1
- package/.enderun/logs/explorer.json +0 -1
- package/.enderun/logs/frontend.json +0 -1
- package/.enderun/logs/git.json +0 -1
- package/.enderun/logs/manager.json +0 -1
- package/.enderun/logs/mobile.json +0 -1
- package/.enderun/logs/native.json +0 -1
- package/.enderun/logs/orchestrator.json +0 -1
- package/.enderun/logs/qa.json +0 -1
- package/.enderun/logs/security.json +0 -1
- package/.env.example +0 -10
- package/cursor.md +0 -19
- package/framework-mcp/README.md +0 -55
- package/framework-mcp/dist/schemas.js +0 -118
- package/framework-mcp/dist/tools/codebase.js +0 -294
- package/framework-mcp/dist/tools/contract.js +0 -197
- package/framework-mcp/dist/tools/framework.js +0 -196
- package/framework-mcp/dist/tools/git.js +0 -51
- package/framework-mcp/dist/tools/governance.js +0 -696
- package/framework-mcp/dist/tools/index.js +0 -47
- package/framework-mcp/dist/tools/knowledge.js +0 -133
- package/framework-mcp/dist/tools/memory.js +0 -200
- package/framework-mcp/dist/tools/messages.js +0 -193
- package/framework-mcp/dist/tools/monitoring.js +0 -294
- package/framework-mcp/dist/tools/orchestration.js +0 -368
- package/framework-mcp/dist/tools/pipeline.js +0 -267
- package/framework-mcp/dist/tools/security.js +0 -137
- package/framework-mcp/dist/utils.js +0 -121
- package/framework-mcp/src/index.ts +0 -49
- package/framework-mcp/src/schemas.ts +0 -106
- package/framework-mcp/src/tools/codebase.ts +0 -284
- package/framework-mcp/src/tools/contract.ts +0 -221
- package/framework-mcp/src/tools/framework.ts +0 -192
- package/framework-mcp/src/tools/git.ts +0 -42
- package/framework-mcp/src/tools/governance.ts +0 -891
- package/framework-mcp/src/tools/index.ts +0 -50
- package/framework-mcp/src/tools/knowledge.ts +0 -141
- package/framework-mcp/src/tools/memory.ts +0 -207
- package/framework-mcp/src/tools/messages.ts +0 -213
- package/framework-mcp/src/tools/monitoring.ts +0 -351
- package/framework-mcp/src/tools/orchestration.ts +0 -440
- package/framework-mcp/src/tools/pipeline.ts +0 -353
- package/framework-mcp/src/tools/security.ts +0 -143
- package/framework-mcp/src/utils.ts +0 -130
- package/src/cli/index.ts +0 -2188
|
@@ -3,16 +3,39 @@
|
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const FRAMEWORK_CANDIDATES = [".gemini", ".claude", ".agent", ".enderun"];
|
|
7
|
+
|
|
8
|
+
function detectFrameworkDir() {
|
|
9
|
+
for (const dir of FRAMEWORK_CANDIDATES) {
|
|
10
|
+
const agentsPath = path.resolve(dir, "agents");
|
|
11
|
+
const schemaPath = path.resolve(dir, "agents/agent_army_schema.json");
|
|
12
|
+
if (fs.existsSync(agentsPath)) {
|
|
13
|
+
return { frameworkDir: dir, agentsDir: agentsPath, schemaPath };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const detected = detectFrameworkDir();
|
|
20
|
+
if (!detected) {
|
|
21
|
+
console.error("❌ No framework agents/ directory found. Run: agent-enderun init <adapter>");
|
|
22
|
+
console.error(` Looked for: ${FRAMEWORK_CANDIDATES.map((d) => `${d}/agents`).join(", ")}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const { frameworkDir, agentsDir, schemaPath } = detected;
|
|
9
27
|
|
|
10
28
|
console.log(`🛡️ STARTING AUTOMATED AGENT ARMY VALIDATION (${frameworkDir})...`);
|
|
11
29
|
|
|
12
30
|
try {
|
|
13
|
-
|
|
31
|
+
if (!fs.existsSync(schemaPath)) {
|
|
32
|
+
console.error(`❌ Schema missing: ${schemaPath}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const schema = JSON.parse(fs.readFileSync(schemaPath, "utf8"));
|
|
14
37
|
const requiredKeys = schema.required;
|
|
15
|
-
const files = fs.readdirSync(
|
|
38
|
+
const files = fs.readdirSync(agentsDir);
|
|
16
39
|
let totalFailed = 0;
|
|
17
40
|
|
|
18
41
|
console.log("--------------------------------------------------");
|
|
@@ -21,10 +44,9 @@ try {
|
|
|
21
44
|
|
|
22
45
|
for (const fileName of files) {
|
|
23
46
|
if (!fileName.endsWith(".md")) continue;
|
|
24
|
-
const filePath = path.join(
|
|
47
|
+
const filePath = path.join(agentsDir, fileName);
|
|
25
48
|
const content = fs.readFileSync(filePath, "utf8");
|
|
26
49
|
|
|
27
|
-
// Simple YAML frontmatter parser
|
|
28
50
|
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
29
51
|
if (!match) {
|
|
30
52
|
console.log(`| ${fileName.padEnd(9)} | ❌ NO YAML | ----- | ---------------- |`);
|
|
@@ -34,11 +56,10 @@ try {
|
|
|
34
56
|
|
|
35
57
|
const yamlContent = match[1];
|
|
36
58
|
const agent = {};
|
|
37
|
-
yamlContent.split("\n").forEach(line => {
|
|
59
|
+
yamlContent.split("\n").forEach((line) => {
|
|
38
60
|
const [key, ...valParts] = line.split(":");
|
|
39
61
|
if (key && valParts.length > 0) {
|
|
40
62
|
let val = valParts.join(":").trim();
|
|
41
|
-
// Clean quotes and handle numbers
|
|
42
63
|
val = val.replace(/^['"]|['"]$/g, "");
|
|
43
64
|
if (!isNaN(val) && val !== "") {
|
|
44
65
|
agent[key.trim()] = Number(val);
|
|
@@ -48,13 +69,17 @@ try {
|
|
|
48
69
|
}
|
|
49
70
|
});
|
|
50
71
|
|
|
51
|
-
const missing = requiredKeys.filter(k => agent[k] === undefined);
|
|
72
|
+
const missing = requiredKeys.filter((k) => agent[k] === undefined);
|
|
52
73
|
|
|
53
74
|
if (missing.length > 0) {
|
|
54
|
-
console.log(
|
|
75
|
+
console.log(
|
|
76
|
+
`| ${fileName.replace(".md", "").padEnd(9)} | ❌ FAILED | ----- | ${`Missing: ${missing.join(",")}`.slice(0, 16)} |`,
|
|
77
|
+
);
|
|
55
78
|
totalFailed++;
|
|
56
79
|
} else {
|
|
57
|
-
console.log(
|
|
80
|
+
console.log(
|
|
81
|
+
`| ${agent.name.padEnd(9)} | ✅ PASSED | ${String(agent.capability).padEnd(5)} | ${agent.role.substring(0, 14).padEnd(14)} |`,
|
|
82
|
+
);
|
|
58
83
|
}
|
|
59
84
|
}
|
|
60
85
|
|
|
@@ -63,7 +88,7 @@ try {
|
|
|
63
88
|
console.error(`❌ Validation failed! Detected ${totalFailed} invalid agent configurations.`);
|
|
64
89
|
process.exit(1);
|
|
65
90
|
} else {
|
|
66
|
-
console.log("🎉 SUCCESS: All
|
|
91
|
+
console.log("🎉 SUCCESS: All core agents comply with the Master Agent Army Schema!");
|
|
67
92
|
}
|
|
68
93
|
} catch (e) {
|
|
69
94
|
console.error("❌ Critical error during schema validation:", e);
|
package/claude.md
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
# Agent Enderun — Claude Code
|
|
1
|
+
# Agent Enderun — Claude Code Adapter
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is the primary entry point when using Agent Enderun within the Claude Code (CLI & Desktop) ecosystem.
|
|
4
4
|
|
|
5
|
-
The framework
|
|
5
|
+
The framework operates under a unified governance structure located in the `.enderun/` directory.
|
|
6
6
|
|
|
7
7
|
### Primary Constitution
|
|
8
8
|
All governance rules, agent checklists, and project memory live here:
|
|
9
9
|
|
|
10
|
-
👉 **[.
|
|
10
|
+
👉 **[.enderun/ENDERUN.md](.enderun/ENDERUN.md)**
|
|
11
11
|
|
|
12
|
-
### 🤖 Agent Directive
|
|
12
|
+
### 🤖 Agent Directive
|
|
13
13
|
You are operating under the Agent Enderun governance framework.
|
|
14
14
|
|
|
15
15
|
At the **start of every session**, before any work:
|
|
16
|
-
1. Read `.
|
|
17
|
-
2. Read the relevant agent definition under `.
|
|
16
|
+
1. **Restore Memory:** Read `.enderun/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
|
|
17
|
+
2. **Load Identity:** Read the relevant agent definition under `.enderun/agents/{agent}.md` (default to `@manager`).
|
|
18
|
+
3. **Internalize Knowledge:** Reference the `.enderun/knowledge/` base for architectural and coding standards.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
### 🛡️ Core Mandates
|
|
21
|
+
- **Surgical Edits:** Use `replace_text` or `patch_file` via MCP for precise changes.
|
|
22
|
+
- **Traceability:** Every action must inherit the active Trace ID from memory.
|
|
23
|
+
- **Contract First:** No implementation without verified types.
|
|
24
|
+
|
|
25
|
+
All paths and references inside the project must comply with the Supreme Constitution located at `.enderun/ENDERUN.md`.
|
package/docs/README.md
CHANGED
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
# Agent Enderun —
|
|
1
|
+
# 🏛️ Agent Enderun — Kurumsal Mimari ve Yönetişim Portalı
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Bu portal, Agent Enderun framework'ü altında geliştirilen kurumsal projelerin **Merkezi Bilgi Kaynağıdır**. Projenin mimari kararları, standartları ve yönetişim protokolleri burada mühürlenmiştir.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 🏗️ Mimari Felsefemiz: "Disiplinli Otonomi"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- **[Architecture Decisions (ADRs)](architecture/decisions/)**: Log of key architectural choices and design patterns.
|
|
11
|
-
- **[Approval & High-Risk Workflows](architecture/approval-flows.md)**: Detailed contracts and state machines for `managerApproval` tokens.
|
|
12
|
-
- **[Notification Strategy](architecture/notification-strategy.md)**: Dynamic notification patterns and toaster integrations.
|
|
9
|
+
Sıradan projelerin aksine, Agent Enderun projeleri yapay zeka ajanlarının otonom çalıştığı ancak insan eliyle yazılmış katı bir anayasaya bağlı kaldığı bir yapıdır. Bu dökümantasyon, hem AI ajanları (Army) hem de insan geliştiriciler için **Değişmez Rehberdir**.
|
|
13
10
|
|
|
14
|
-
###
|
|
15
|
-
- **[Component Patterns](frontend/component-patterns.md)**: Guidelines for custom, Zero-UI-Library React components styled with Panda CSS.
|
|
16
|
-
- **[Form Validations](frontend/forms.md)**: Type-safe form states using Zod and React hooks.
|
|
17
|
-
- **[Toaster Notifications](frontend/notifications.md)**: Integration guides for Sonner toast configurations.
|
|
11
|
+
### 📋 Dokümantasyon Rehberi
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
#### [1. Mimari ve Yönetişim (Architecture & Governance)](architecture/)
|
|
14
|
+
* **[Mimari Karar Kayıtları (ADRs)](architecture/decisions/)**: Projenin kritik dönüm noktalarında alınan kararların "Neden" ve "Nasıl" sorularına verilen cevaplardır.
|
|
15
|
+
* **[Onay ve Yüksek Riskli İş akışları](architecture/approval-flows.md)**: `managerApproval` token'larının nasıl üretildiği, denetlendiği ve yüksek riskli işlemlerin (örn: veritabanı silme, yetki yükseltme) nasıl mühürlendiği anlatılır.
|
|
16
|
+
* **[Bildirim Stratejisi](architecture/notification-strategy.md)**: Kullanıcı deneyimini kesintiye uğratmayan, dinamik ve kurumsal bildirim desenleri.
|
|
17
|
+
|
|
18
|
+
#### [2. Frontend Standartları (Frontend)](frontend/)
|
|
19
|
+
* **[Bileşen Desenleri (Component Patterns)](frontend/component-patterns.md)**: **Zero-UI-Library** politikamız gereği, tüm bileşenlerin Panda CSS ile nasıl "el yapımı" ve tip-güvenli olarak inşa edileceği rehberi.
|
|
20
|
+
* **[Form Doğrulamaları](frontend/forms.md)**: Zod ve React hooks ile yönetilen, hata payı sıfır form yönetim sistemleri.
|
|
21
|
+
* **[Toaster Yapılandırması](frontend/notifications.md)**: Sonner ve benzeri araçların kurumsal tema ile entegrasyonu.
|
|
22
|
+
|
|
23
|
+
#### [3. Backend Standartları (Backend)](backend/)
|
|
24
|
+
* **[Hata Yönetimi (Error Handling)](backend/error-handling.md)**: `DomainError` sınıfları üzerinden, front-end'e sızmayan ve loglarda izlenebilen profesyonel hata yönetim hiyerarşisi.
|
|
25
|
+
* **[Denetim Günlükleri (Audit Logging)](backend/audit-logging.md)**: Her işlemin bir `Trace ID` ile veritabanına kalıcı olarak nasıl işleneceğinin kontratları.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🛰️ Faz Bazlı Geliştirme Döngüsü (Life Cycle)
|
|
30
|
+
|
|
31
|
+
Tüm projeler aşağıdaki 5 fazı sırasıyla ve eksiksiz geçmek zorundadır:
|
|
32
|
+
|
|
33
|
+
1. **PHASE_0 (Keşif):** Teknoloji yığını (`tech-stack.md`) mühürlenir, risk analizi yapılır.
|
|
34
|
+
2. **PHASE_1 (Mimari & Kontrat):** Önce tipler ve API sözleşmeleri yazılır. Tek satır uygulama kodu yazılmadan kontratlar onaylanmalıdır.
|
|
35
|
+
3. **PHASE_2 (Çekirdek Geliştirme):** Backend ve Frontend paralel olarak inşa edilir. `Branded Types` kullanımı zorunludur.
|
|
36
|
+
4. **PHASE_3 (Entegrasyon & Test):** `@qa` ajanı devreye girer. **%80 Test Coverage** barajı geçilmeden bir sonraki faza geçilemez.
|
|
37
|
+
5. **PHASE_4 (Optimizasyon & Dağıtım):** Güvenlik taramaları (`check:security`) ve performans testleri tamamlanır.
|
|
22
38
|
|
|
23
39
|
---
|
|
24
40
|
|
|
25
|
-
> [!
|
|
26
|
-
> **
|
|
41
|
+
> [!IMPORTANT]
|
|
42
|
+
> **Ajan Talimatı:** Bu klasör altındaki dökümanlar, ajanların operasyonel sınırlarını çizer. Bir ajan, burada tanımlanan bir kuralın dışına çıkamaz. Eğer bir kuralın güncellenmesi gerekiyorsa, bu ancak `@manager` onayıyla ve ADR kaydıyla yapılabilir.
|
|
43
|
+
|
|
44
|
+
**Sürüm:** v0.8.8
|
|
45
|
+
**Durum:** Aktif Yönetişim
|
package/docs/roadmap.md
CHANGED
|
@@ -42,7 +42,7 @@ This program systematically audits current agent maturity levels and runs struct
|
|
|
42
42
|
| **@explorer** | 6.5 | 8.5 | High / Stable. Highly capable in dependency analysis and codebase intelligence. |
|
|
43
43
|
| **@analyst** | 6.5 | 8.5 | Medium / Stable. Handles system health metrics and compliance audits. |
|
|
44
44
|
| **@git** | 6.0 | 8.0 | Medium / Stable. Coordinates PRs, semantic commits, and version compliance. |
|
|
45
|
-
| **@mobile
|
|
45
|
+
| **@mobile** | 2.0 | 7.5 | Low / Dormant. Foundational blueprints and Hermes safety rules added. |
|
|
46
46
|
|
|
47
47
|
> **Note:** `@frontend` is currently the highest risk to enterprise onboarding and is the top priority.
|
|
48
48
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 🛠️ Agent Enderun — Technology Stack (v0.8.8)
|
|
2
|
+
|
|
3
|
+
This document defines the official, non-negotiable tech stack for the project. All agents must comply with these choices.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🏗️ Core Backend
|
|
8
|
+
- **Runtime:** Node.js 22+ (LTS)
|
|
9
|
+
- **Framework:** Fastify (RCSR Architecture)
|
|
10
|
+
- **Database:** PostgreSQL (with Multi-Tenant RLS & PostGIS)
|
|
11
|
+
- **ORM / Query Builder:** Kysely (Typed SQL)
|
|
12
|
+
- **Validation:** Zod (Contract-First)
|
|
13
|
+
- **Language:** TypeScript 6 (Strict Mode)
|
|
14
|
+
|
|
15
|
+
## 🎨 Core Frontend
|
|
16
|
+
- **Framework:** React 19
|
|
17
|
+
- **Build Tool:** Vite
|
|
18
|
+
- **Styling:** Panda CSS (Type-safe, Zero-Runtime CSS-in-JS)
|
|
19
|
+
- **State Management:** React Context / TanStack Query
|
|
20
|
+
- **Components:** Zero-UI-Library Policy (Handcrafted atomic components)
|
|
21
|
+
|
|
22
|
+
## 🧪 Quality & DevOps
|
|
23
|
+
- **Testing:** Vitest (80% Coverage Threshold)
|
|
24
|
+
- **CI/CD:** GitHub Actions
|
|
25
|
+
- **Monorepo:** npm Workspaces
|
|
26
|
+
- **Logging:** Structured JSON logging with Trace ID integrity
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
**Note:** Any deviation from this stack requires a formal ADR (Architecture Decision Record) approved by @manager.
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
|
|
5
|
+
const styleRules = {
|
|
6
|
+
indent: ["error", 4],
|
|
7
|
+
"linebreak-style": ["error", "unix"],
|
|
8
|
+
quotes: ["error", "double"],
|
|
9
|
+
semi: ["error", "always"],
|
|
10
|
+
"no-constant-condition": "warn",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default tseslint.config(
|
|
14
|
+
{
|
|
15
|
+
ignores: [
|
|
16
|
+
"**/node_modules/**",
|
|
17
|
+
"**/dist/**",
|
|
18
|
+
"framework-mcp/dist/**",
|
|
19
|
+
"apps/*/dist/**",
|
|
20
|
+
".agent/**",
|
|
21
|
+
".gemini/**",
|
|
22
|
+
".claude/**",
|
|
23
|
+
".cursor/**",
|
|
24
|
+
".enderun/logs/**",
|
|
25
|
+
"panda.config.ts",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
js.configs.recommended,
|
|
29
|
+
...tseslint.configs.recommended,
|
|
30
|
+
{
|
|
31
|
+
files: ["**/*.{ts,tsx}"],
|
|
32
|
+
languageOptions: {
|
|
33
|
+
ecmaVersion: 2022,
|
|
34
|
+
sourceType: "module",
|
|
35
|
+
globals: {
|
|
36
|
+
...globals.node,
|
|
37
|
+
...globals.es2021,
|
|
38
|
+
},
|
|
39
|
+
parserOptions: {
|
|
40
|
+
project: ["./tsconfig.json", "./apps/*/tsconfig.json", "./framework-mcp/tsconfig.json"],
|
|
41
|
+
tsconfigRootDir: import.meta.dirname,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
...styleRules,
|
|
47
|
+
"no-unused-vars": "off",
|
|
48
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
49
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
50
|
+
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
files: ["**/*.js"],
|
|
55
|
+
languageOptions: {
|
|
56
|
+
ecmaVersion: 2022,
|
|
57
|
+
sourceType: "module",
|
|
58
|
+
globals: {
|
|
59
|
+
...globals.node,
|
|
60
|
+
...globals.es2021,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
rules: {
|
|
64
|
+
...styleRules,
|
|
65
|
+
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
);
|
|
@@ -1,41 +1,201 @@
|
|
|
1
1
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
-
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { execSync } from "child_process";
|
|
6
7
|
const server = new Server({
|
|
7
|
-
name: "
|
|
8
|
-
version:
|
|
8
|
+
name: "agent-enderun-mcp",
|
|
9
|
+
version: "0.9.0",
|
|
9
10
|
}, {
|
|
10
11
|
capabilities: {
|
|
11
12
|
tools: {},
|
|
12
13
|
},
|
|
13
14
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const TOOLS = [
|
|
16
|
+
{
|
|
17
|
+
name: "read_file",
|
|
18
|
+
description: "Read the content of a file within the project.",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
path: { type: "string", description: "Path to the file relative to project root" },
|
|
23
|
+
},
|
|
24
|
+
required: ["path"],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "write_file",
|
|
29
|
+
description: "Write content to a file. Creates directories if missing.",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
path: { type: "string", description: "Path to the file relative to project root" },
|
|
34
|
+
content: { type: "string", description: "Complete content of the file" },
|
|
35
|
+
},
|
|
36
|
+
required: ["path", "content"],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "replace_text",
|
|
41
|
+
description: "Surgically replace a string in a file with another string.",
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
path: { type: "string", description: "Path to the file" },
|
|
46
|
+
oldText: { type: "string", description: "The exact text to find" },
|
|
47
|
+
newText: { type: "string", description: "The text to replace it with" },
|
|
48
|
+
},
|
|
49
|
+
required: ["path", "oldText", "newText"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "patch_file",
|
|
54
|
+
description: "Safely update a file by replacing a specific line range with new content.",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {
|
|
58
|
+
path: { type: "string", description: "Path to the file" },
|
|
59
|
+
startLine: { type: "number", description: "Starting line number (1-indexed)" },
|
|
60
|
+
endLine: { type: "number", description: "Ending line number (inclusive)" },
|
|
61
|
+
newContent: { type: "string", description: "The new lines to insert" },
|
|
62
|
+
},
|
|
63
|
+
required: ["path", "startLine", "endLine", "newContent"],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "get_framework_status",
|
|
68
|
+
description: "Get the current project phase, active traces, and agent states.",
|
|
69
|
+
inputSchema: { type: "object", properties: {} },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "update_project_memory",
|
|
73
|
+
description: "Update a specific section in PROJECT_MEMORY.md.",
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
section: { type: "string", description: "Section name (e.g., HISTORY, ACTIVE TASKS)" },
|
|
78
|
+
content: { type: "string", description: "Markdown content to append or set" },
|
|
79
|
+
},
|
|
80
|
+
required: ["section", "content"],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "create_app",
|
|
85
|
+
description: "Generate a new full-stack application from a natural language idea.",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
idea: { type: "string", description: "The application idea or requirements" },
|
|
90
|
+
},
|
|
91
|
+
required: ["idea"],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "send_agent_message",
|
|
96
|
+
description: "Send a Hermes protocol message to another agent.",
|
|
97
|
+
inputSchema: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: {
|
|
100
|
+
to: { type: "string", description: "Target agent (e.g., @backend, @qa)" },
|
|
101
|
+
category: { type: "string", enum: ["ACTION", "DELEGATION", "INFO", "ALERT"] },
|
|
102
|
+
content: { type: "string", description: "Message content" },
|
|
103
|
+
traceId: { type: "string", description: "Active Trace ID" },
|
|
104
|
+
},
|
|
105
|
+
required: ["to", "category", "content", "traceId"],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
server.onRequest(ListToolsRequestSchema, async () => {
|
|
110
|
+
return { tools: TOOLS };
|
|
18
111
|
});
|
|
19
|
-
server.
|
|
112
|
+
server.onRequest(CallToolRequestSchema, async (request) => {
|
|
20
113
|
const { name, arguments: args } = request.params;
|
|
21
114
|
const projectRoot = process.cwd();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
115
|
+
try {
|
|
116
|
+
switch (name) {
|
|
117
|
+
case "read_file": {
|
|
118
|
+
const filePath = path.join(projectRoot, args?.path);
|
|
119
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
120
|
+
return { content: [{ type: "text", text: content }] };
|
|
121
|
+
}
|
|
122
|
+
case "write_file": {
|
|
123
|
+
const filePath = path.join(projectRoot, args?.path);
|
|
124
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
125
|
+
fs.writeFileSync(filePath, args?.content);
|
|
126
|
+
return { content: [{ type: "text", text: `✅ File written: ${args?.path}` }] };
|
|
127
|
+
}
|
|
128
|
+
case "replace_text": {
|
|
129
|
+
const filePath = path.join(projectRoot, args?.path);
|
|
130
|
+
let content = fs.readFileSync(filePath, "utf8");
|
|
131
|
+
const oldText = args?.oldText;
|
|
132
|
+
const newText = args?.newText;
|
|
133
|
+
if (!content.includes(oldText)) {
|
|
134
|
+
throw new Error(`Text not found in file: ${oldText}`);
|
|
135
|
+
}
|
|
136
|
+
content = content.replace(oldText, newText);
|
|
137
|
+
fs.writeFileSync(filePath, content);
|
|
138
|
+
return { content: [{ type: "text", text: `✅ Surgical edit successful in ${args?.path}` }] };
|
|
139
|
+
}
|
|
140
|
+
case "patch_file": {
|
|
141
|
+
const filePath = path.join(projectRoot, args?.path);
|
|
142
|
+
const lines = fs.readFileSync(filePath, "utf8").split("\n");
|
|
143
|
+
const start = args?.startLine - 1;
|
|
144
|
+
const end = args?.endLine;
|
|
145
|
+
const newContent = (args?.newContent).split("\n");
|
|
146
|
+
if (start < 0 || start > lines.length)
|
|
147
|
+
throw new Error("Invalid start line.");
|
|
148
|
+
lines.splice(start, end - start, ...newContent);
|
|
149
|
+
fs.writeFileSync(filePath, lines.join("\n"));
|
|
150
|
+
return { content: [{ type: "text", text: `✅ File patched successfully: ${args?.path}` }] };
|
|
151
|
+
}
|
|
152
|
+
case "get_framework_status": {
|
|
153
|
+
const output = execSync("npx agent-enderun status").toString();
|
|
154
|
+
return { content: [{ type: "text", text: output }] };
|
|
155
|
+
}
|
|
156
|
+
case "update_project_memory": {
|
|
157
|
+
const section = args?.section;
|
|
158
|
+
const content = args?.content;
|
|
159
|
+
// Escape quotes for shell
|
|
160
|
+
const safeContent = content.replace(/"/g, "\\\"");
|
|
161
|
+
execSync(`npx agent-enderun update_project_memory "${section}" "${safeContent}"`);
|
|
162
|
+
return { content: [{ type: "text", text: `✅ Section ${section} updated.` }] };
|
|
163
|
+
}
|
|
164
|
+
case "create_app": {
|
|
165
|
+
const idea = args?.idea;
|
|
166
|
+
const output = execSync(`npx agent-enderun create-app "${idea.replace(/"/g, "\\\"")}"`).toString();
|
|
167
|
+
return { content: [{ type: "text", text: output }] };
|
|
168
|
+
}
|
|
169
|
+
case "send_agent_message": {
|
|
170
|
+
const { to, category, content, traceId } = args;
|
|
171
|
+
const frameworkDir = fs.existsSync(path.join(projectRoot, ".enderun")) ? ".enderun" : ".gemini";
|
|
172
|
+
const messagePath = path.join(projectRoot, frameworkDir, "messages", `${to.replace("@", "")}.json`);
|
|
173
|
+
const message = {
|
|
174
|
+
timestamp: new Date().toISOString(),
|
|
175
|
+
from: "@mcp",
|
|
176
|
+
to,
|
|
177
|
+
category,
|
|
178
|
+
traceId,
|
|
179
|
+
content,
|
|
180
|
+
status: "PENDING"
|
|
181
|
+
};
|
|
182
|
+
fs.mkdirSync(path.dirname(messagePath), { recursive: true });
|
|
183
|
+
fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
|
|
184
|
+
return { content: [{ type: "text", text: `✅ Message sent to ${to}` }] };
|
|
185
|
+
}
|
|
186
|
+
default:
|
|
187
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
188
|
+
}
|
|
26
189
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
190
|
+
catch (error) {
|
|
191
|
+
return {
|
|
192
|
+
isError: true,
|
|
193
|
+
content: [{ type: "text", text: error.message }],
|
|
194
|
+
};
|
|
30
195
|
}
|
|
31
|
-
throw new Error(`Tool not found: ${name}`);
|
|
32
196
|
});
|
|
33
|
-
async function
|
|
197
|
+
async function run() {
|
|
34
198
|
const transport = new StdioServerTransport();
|
|
35
199
|
await server.connect(transport);
|
|
36
|
-
console.error("Framework MCP Server running on stdio");
|
|
37
200
|
}
|
|
38
|
-
|
|
39
|
-
console.error("Fatal error in main():", error);
|
|
40
|
-
process.exit(1);
|
|
41
|
-
});
|
|
201
|
+
run().catch(console.error);
|
|
@@ -1,46 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "Yusuf BEKAR",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"readme": "README.md",
|
|
2
|
+
"name": "@agent-enderun/mcp",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Agent Enderun Model Context Protocol (MCP) Server",
|
|
8
5
|
"type": "module",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/ysf-bkr/Agent-Enderun.git"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/ysf-bkr/Agent-Enderun/issues"
|
|
15
|
-
},
|
|
16
|
-
"homepage": "https://github.com/ysf-bkr/Agent-Enderun#readme",
|
|
17
|
-
"main": "dist/index.js",
|
|
18
|
-
"module": "dist/index.js",
|
|
19
|
-
"types": "dist/index.js",
|
|
20
|
-
"bin": {
|
|
21
|
-
"framework-mcp": "dist/index.js"
|
|
22
|
-
},
|
|
23
|
-
"files": [
|
|
24
|
-
"src",
|
|
25
|
-
"dist",
|
|
26
|
-
"README.md"
|
|
27
|
-
],
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
|
-
},
|
|
31
6
|
"scripts": {
|
|
32
|
-
"build": "tsc
|
|
7
|
+
"build": "npx tsc",
|
|
33
8
|
"start": "node dist/index.js",
|
|
34
9
|
"dev": "tsx src/index.ts"
|
|
35
10
|
},
|
|
36
11
|
"dependencies": {
|
|
37
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
38
|
-
"ts-morph": "^28.0.0",
|
|
12
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
39
13
|
"zod": "^3.24.2"
|
|
40
14
|
},
|
|
41
15
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"tsx": "^4.19.4",
|
|
16
|
+
"@types/node": "^22.19.19",
|
|
44
17
|
"typescript": "^5.9.3"
|
|
45
18
|
}
|
|
46
19
|
}
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
"module": "NodeNext",
|
|
5
5
|
"moduleResolution": "NodeNext",
|
|
6
6
|
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
7
8
|
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
9
|
"skipLibCheck": true,
|
|
10
|
-
"
|
|
11
|
-
"allowJs": true,
|
|
12
|
-
"types": ["node"]
|
|
10
|
+
"esModuleInterop": true
|
|
13
11
|
},
|
|
14
|
-
"include": ["src
|
|
15
|
-
"exclude": ["node_modules", "dist"]
|
|
12
|
+
"include": ["src/**/*.ts"]
|
|
16
13
|
}
|
package/gemini.md
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
# Agent Enderun — Gemini CLI Adapter
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is the primary entry point when using Agent Enderun within the Gemini CLI ecosystem.
|
|
4
4
|
|
|
5
|
-
The framework
|
|
5
|
+
The framework operates under a unified governance structure located in the `.enderun/` directory.
|
|
6
6
|
|
|
7
7
|
### Primary Constitution
|
|
8
8
|
All governance rules, agent checklists, and project memory live here:
|
|
9
9
|
|
|
10
10
|
👉 **[.enderun/ENDERUN.md](.enderun/ENDERUN.md)**
|
|
11
11
|
|
|
12
|
-
### 🤖 Agent Directive
|
|
12
|
+
### 🤖 Agent Directive
|
|
13
13
|
You are operating under the Agent Enderun governance framework.
|
|
14
14
|
|
|
15
15
|
At the **start of every session**, before any work:
|
|
16
|
-
1. Read `.enderun/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
|
|
17
|
-
2. Read the relevant agent definition under `.enderun/agents/{agent}.md` (
|
|
16
|
+
1. **Restore Memory:** Read `.enderun/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
|
|
17
|
+
2. **Load Identity:** Read the relevant agent definition under `.enderun/agents/{agent}.md` (default to `@manager`).
|
|
18
|
+
3. **Internalize Knowledge:** Reference the `.enderun/knowledge/` base for architectural and coding standards.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
### 🛡️ Core Mandates
|
|
21
|
+
- **Surgical Edits:** Use `replace_text` or `patch_file` via MCP for precise changes.
|
|
22
|
+
- **Traceability:** Every action must inherit the active Trace ID from memory.
|
|
23
|
+
- **Contract First:** No implementation without verified types.
|
|
24
|
+
|
|
25
|
+
All paths and references inside the project must comply with the Supreme Constitution located at `.enderun/ENDERUN.md`.
|