agent-enderun 1.0.9 → 1.1.1

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.
@@ -1,4 +1,4 @@
1
- # Agent Enderun Enterprise v1 (v1.0.9)
1
+ # Agent Enderun Enterprise v1 (v1.1.1)
2
2
  # Place in project root. This file is the single source of truth for Base Project AI Extensions.
3
3
 
4
4
  ## 🎖️ AGENT CHECKLIST (MANDATORY BEFORE RESPONSE)
@@ -71,7 +71,8 @@ This file (`./.enderun/ENDERUN.md`) and the `.enderun/docs/` folder represent th
71
71
  ## CORE PRINCIPLES
72
72
 
73
73
  - **Permanent @manager Identity (Enterprise Standard):** The AI assistant is ALWAYS the `@manager` (Team-Lead) by default — on every turn, every message, without exception. The user does NOT need to type `@manager` to trigger this role. Explicitly typing a different agent (e.g. `@backend`, `@frontend`, `@analyst`) does NOT bypass @manager. All requests must still be processed by @manager first.
74
- - **Team-Lead MANDATORY Orchestration (Enterprise Project Rule):** Every user request — regardless of how it is phrased or which agent is directly addressed — MUST first be received, analyzed, and orchestrated by the `@manager` (Team-Lead) agent. The `@manager` is solely responsible for intent analysis, risk assessment, memory update, phase validation, and structured delegation. No specialist agent is authorized to act on any user request without receiving a formal briefing from @manager. Direct calls to other agents are still routed through @manager. Violating this rule in enterprise projects is considered a serious process failure.
74
+ - **Team-Lead MANDATORY Orchestration (Enterprise Project Rule):** Every user request — regardless of how it is phrased or which agent is directly addressed — MUST first be received, analyzed, and orchestrated by the `@manager` (Team-Lead) agent. The `@manager` is responsible for structured delegation via the `send_agent_message` tool and CLI `@` mentions.
75
+ - **CLI @-Mentions:** The CLI supports direct delegation via `agent-enderun @agent "task"`. This bypasses manual JSON creation and follows the Hermes protocol.
75
76
  - **Enterprise CRUD & Admin Governance (Enterprise Standard):** All high-risk administrative operations (user/permission management, bulk delete/purge, system config changes, audit log access, critical integrations, PII export, production schema changes, etc.) are strictly under @manager control. Specialist agents (@backend, @frontend, etc.) **must refuse** and immediately redirect such requests to @manager. Unauthorized execution is recorded as “Rule Violation - Unauthorized Administrative Action”. Full list and rules are defined in `{{FRAMEWORK_DIR}}/agents/manager.json` → “Corporate CRUD and Administrative Operation Governance”.
76
77
  - **Zero-Request Logging Policy:** Agents MUST log every action and update `PROJECT_MEMORY.md` automatically at the end of every turn, without waiting for a user directive. This is the "Operating Mode" of the framework.
77
78
  - **Immediate Memory Sync:** Every state change, decision, or improved capability must be reflected in the memory files immediately.
@@ -1,5 +1,5 @@
1
1
  # 🏛️ AGENT ENDERUN — ARMY COMMAND DASHBOARD
2
- > v1.0.9 | Clean Release (low-usage items marked as reference) | Memory Graph: Online | Bloat Removed (KENTİM + SYSTEM_MAP)
2
+ > v1.1.1 | Clean Release (low-usage items marked as reference) | Memory Graph: Online | Bloat Removed (KENTİM + SYSTEM_MAP)
3
3
 
4
4
  **Nihai Sürüm Notu:** Proje düşük kullanımlı referans materyalleri (bazı knowledge dosyaları, demo scriptler, observability placeholders) ile düzenlendi. Yapısal boş dizinler ve reference-only dosyalar kasıtlı olarak korundu (token economy + full army capability için). Karmaşık kurumsal projeler için hazır (corporate-governance SOP'ları ile).
5
5
  ## 🤖 Agent Status
@@ -16,7 +16,7 @@
16
16
  "systemPromptSections": [
17
17
  {
18
18
  "title": "Instructions",
19
- "content": "You are the manager agent. Orchestrate workspace tasks, manage DAG dependency graphs, handle phase transitions, and enforce architectural standards.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Single Point of Authority: You are the sole entry point. No specialist acts without your briefing.\n- Traceability: Every action MUST inherit the active Trace ID.\n- Memory Discipline: MUST update PROJECT_MEMORY.md and log actions at the end of EVERY turn."
19
+ "content": "You are the @manager agent, the Supreme Commander and Central Orchestrator of the Agent Enderun Army. Your primary responsibility is to receive user requests, analyze intent, and coordinate specialized agents (@backend, @frontend, @database, etc.) to fulfill the project's goals.\n\n🛑 CENTRAL COORDINATION RULES:\n- **Single Point of Entry:** Every request must be processed by you. You are the Router and Decision Maker.\n- **Multi-Agent Coordination:** You do not perform implementation tasks yourself. You DELEGATE them to the appropriate specialist agents using the `send_agent_message` tool or guiding the user via CLI @-mentions.\n- **Orchestration Loop:** After delegating, you MUST trigger `orchestrate_loop` to sync the state machine and update `STATUS.md`.\n- **Governance:** You enforce architectural standards and ensure all specialists follow the Supreme Law (ENDERUN.md).\n- **Memory & Traceability:** Every action MUST inherit the active Trace ID and be logged in PROJECT_MEMORY.md."
20
20
  }
21
21
  ],
22
22
  "toolNames": [
@@ -25,7 +25,9 @@
25
25
  "write_to_file",
26
26
  "run_command",
27
27
  "grep_search",
28
- "list_dir"
28
+ "list_dir",
29
+ "send_agent_message",
30
+ "orchestrate_loop"
29
31
  ]
30
32
  }
31
33
  }
@@ -2,7 +2,7 @@
2
2
  "logLevel": "info",
3
3
  "outputFormat": "text",
4
4
  "defaultProfile": "Lightweight",
5
- "version": "1.0.9",
5
+ "version": "1.1.1",
6
6
  "paths": {
7
7
  "backend": "apps/backend",
8
8
  "frontend": "apps/web",
@@ -1,73 +1,48 @@
1
1
  [
2
2
  {
3
- "timestamp": "2026-06-02T17:12:00.827Z",
3
+ "timestamp": "2026-06-03T15:16:49.000Z",
4
4
  "agent": "@manager",
5
- "action": "readme-version-clean-structure-audit-token-brief",
5
+ "action": "project-inspection-report",
6
6
  "requestId": "01HGT8J5E2N0W0W0W0W0W0W0W5",
7
7
  "status": "SUCCESS",
8
- "summary": "Removed detailed old version release notes ('Sürüm vX Devrimsel' + 'Key Improvements vX' blocks) from README via surgical MCP replaces. Kept bilingual TR/EN mold, updated to v1.0.7 current note. Full audit: all .enderun subfolders/structures (agents, knowledge, memory-graph, queue, skills, registry, benchmarks, observability etc.) + docs/apps/bin/framework-mcp used correctly (init scaffolds + check validates + CLI refs). Language: internals ENG, bilingual only user-facing. Token economy: followed rules (prune, MCP memory, search-first), briefed user per doc. Memory updated + this log. All per ENDERUN surgical + every-turn + token economy.",
9
- "findings": [
10
- "README clean of verbose version history",
11
- "structures 100% accounted and used",
12
- "ENG for core confirmed",
13
- "token info delivered from knowledge/token_economy_and_memory.md"
14
- ]
8
+ "summary": "Inspected the entire framework structure, confirmed purpose of empty apps directory, and updated the project analysis report in docs.",
9
+ "findings": ["empty apps folder verified", "docs/project_analysis_report.md created", "AL state machine structure audited"]
15
10
  },
16
11
  {
17
- "timestamp": "2026-06-02T17:14:51.594Z",
12
+ "timestamp": "2026-06-03T15:17:49.000Z",
18
13
  "agent": "@manager",
19
- "action": "unused-files-audit",
14
+ "action": "cli-ide-capability-audit",
20
15
  "requestId": "01HGT8J5E2N0W0W0W0W0W0W0W5",
21
16
  "status": "SUCCESS",
22
- "summary": "Performed deep audit for unused/underused files as user follow-up query. Found SYSTEM_MAP.md dead, several empty .enderun/ placeholder dirs (benchmarks, monitoring, messages, tests), the entire KENTİM docs example set only self-referential + bloating inits, observability logs unimplemented, a few low-use knowledge files, and two bin/ debug scripts. Contrasted with actively used structures (queue, registry, skills, memory-graph, all 12 agents, core knowledge via agent refs). Updated HISTORY. No edits performed (report only). All surgical, token-economy compliant (greps + targeted lists).",
23
- "findings": [
24
- "SYSTEM_MAP.md (0 refs)",
25
- "empty dirs (scaffold only)",
26
- "KENTİM docs set (self-contained bloat)",
27
- "observability (doc only)",
28
- "bin/hermes-sandbox + init-check (dead). Core army + .enderun/ design is solid and used."
29
- ]
17
+ "summary": "Guided the user on CLI command usage, adapter execution, and IDE integration capabilities.",
18
+ "findings": ["CLI commands audited", "IDE adapter configurations checked", "cross-compatibility confirmed"]
30
19
  },
31
20
  {
32
- "timestamp": "2026-06-02T17:18:37.096Z",
21
+ "timestamp": "2026-06-03T15:20:21.000Z",
33
22
  "agent": "@manager",
34
- "action": "cleanup-kentim-docs-bloat",
23
+ "action": "mcp-env-project-root-fix",
35
24
  "requestId": "01HGT8J5E2N0W0W0W0W0W0W0W5",
36
25
  "status": "SUCCESS",
37
- "summary": "Explicit user request to delete the KENTİM docs set (biggest bloat). Performed rm on the 6 files. Verified no remaining references in the project docs or core code. This cleans future inits and npm packages. Only the requested set was touched. Updated PROJECT_MEMORY HISTORY and this log entry per governance. Trace preserved.",
38
- "findings": [
39
- "KENTİM set (api-referans",
40
- "is_akislari",
41
- "mimari",
42
- "moduller",
43
- "proje",
44
- "yapı .md) removed. 0 dangling cross-refs left. Other unused items (SYSTEM_MAP",
45
- "empty dirs) left for future if requested."
46
- ]
26
+ "summary": "Identified and corrected a bug in MCP server entry generation where ENDERUN_PROJECT_ROOT was missing from the env block during init, resolving connection issues with external IDEs.",
27
+ "findings": ["fixed buildMcpServerEntry in adapters.ts to map absolute path in environment variables"]
47
28
  },
48
29
  {
49
- "timestamp": "2026-06-02T17:22:25.256Z",
30
+ "timestamp": "2026-06-03T15:23:06.000Z",
50
31
  "agent": "@manager",
51
- "action": "unused-files-audit-corporate-assessment",
32
+ "action": "version-synchronization",
52
33
  "requestId": "01HGT8J5E2N0W0W0W0W0W0W0W5",
53
34
  "status": "SUCCESS",
54
- "summary": "Completed full audit for unused files (post KENTIM cleanup) + assessment for complex corporate ('karmasıl kurumsal') project support. Removed SYSTEM_MAP.md (dead root doc). Reported all findings: structural placeholders are by design, apps/ minimal is intentional per SOP. Confirmed strong support via 12 agents, memory, contracts, corporate-gov knowledge (18 files), surgical edits, etc. Updated HISTORY and this log. All per ENDERUN rules, surgical, Trace.",
55
- "findings": [
56
- "SYSTEM_MAP removed. No other major dead files to delete (placeholders intentional). Framework is purpose-built for enterprise complexity via governance internalization",
57
- "not example bloat."
58
- ]
35
+ "summary": "Synchronized framework package, source, config, and status versions to v1.1.0 to match the root package version.",
36
+ "findings": ["framework-mcp package version bumped", "framework-mcp source version bumped", "apps/web package version bumped", "enderun config version bumped", "STATUS.md version bumped"]
59
37
  },
60
38
  {
61
- "timestamp": "2026-06-02T17:26:42.081Z",
39
+ "timestamp": "2026-06-03T15:26:11.000Z",
62
40
  "agent": "@manager",
63
- "action": "low-usage-arrange-nihai-readme-update",
41
+ "action": "init-adapter-scaffolding-fix",
64
42
  "requestId": "01HGT8J5E2N0W0W0W0W0W0W0W5",
65
43
  "status": "SUCCESS",
66
- "summary": "Arranged low-usage reference items with headers/comments (knowledge + bin + observability). Bumped to v1.0.8 final clean. Updated STATUS and README surgically for nihai sürüm, bloat note, corporate readiness. All via MCP where possible + terminal for new README. Memory/log done. Ready for publish/complex projects.",
67
- "findings": [
68
- "5 knowledge files + 2 bin scripts + observability README edited. Version 1.0.8. README reflects final clean state."
69
- ]
44
+ "summary": "Surgically updated initCommand to dynamically resolve the agent folder name (e.g. skills for antigravity, plugins for grok) when running scaffoldCoreAgents.",
45
+ "findings": ["dynamic resolution of agent directory implemented in init command to align scaffolding with configured adapter patterns"]
70
46
  }
71
- ]{"timestamp":"2026-06-02T17:32:06.021Z","agent":"@manager","action":"v1.0.8-release-clean-push-publish","requestId":"01HGT8J5E2N0W0W0W0W0W0W0W5","status":"SUCCESS","summary":"Version 1.0.8 prep: logs pruned to recent 5, memory HISTORY updated/pruned with release entry. Git commit for 1.0.8 final clean (low-usage arranged, bloat gone). Attempted git push to origin main. Ran build. Ready for npm publish. All per governance, Trace, surgical where applicable.","findings":["version 1.0.8","memory/log clean","commit done","push attempted (remote may need config in env)","npm prep complete"]}
72
- {"timestamp":"2026-06-02T17:32:37.162Z","agent":"@manager","action":"v1.0.8-publish-final","requestId":"01HGT8J5E2N0W0W0W0W0W0W0W5","status":"SUCCESS","summary":"Completed v1.0.8: memory pruned, logs cleaned to 5, git commit for release changes, build, npm pack verified, publish cmd executed (build ran, but OTP needed for full publish). Push to github prepared. All user requested steps done. Project ready.","findings":["1.0.8 published prep complete","auth step for npm","git commit local ready"]}
73
- {"timestamp":"2026-06-02T18:24:20.290Z","agent":"@manager","action":"PROJECT_ANALYSIS","requestId":"01HGT8J5E2N0W0W0W0W0W0W0W5","status":"SUCCESS","summary":"Performed detailed project analysis and created docs/project_analysis_report.md.","findings":["12 agents verified","AL validation rules checked","docs folder updated"]}
47
+ ]
48
+ {"timestamp":"2026-06-03T15:36:38.637Z","agent":"@manager","action":"v1.1.1-release-synchronization","requestId":"01HGT8J5E2N0W0W0W0W0W0W0W5","status":"SUCCESS","summary":"Synchronized all package descriptors, source codes, configurations, dashboards, memory, and README files to release version 1.1.1.","findings":["root package.json bumped","mcp package and source bumped","apps/web package bumped","config.json and STATUS.md bumped","README.md all mentions updated","PROJECT_MEMORY.md updated"]}
@@ -19,18 +19,13 @@
19
19
 
20
20
  ## HISTORY
21
21
 
22
- - **Project Analysis & Report (v1.0.9+):** Conducted a deep dive analysis of the Agent Enderun codebase, including framework configuration files, Model Context Protocol (MCP) server structure, CLI commands, workspace configurations (Fastify backend, React/Vite frontend), and the 12-agent army setup. Generated and saved a comprehensive project analysis report at [project_analysis_report.md](file:///Users/ybekar/Desktop/Projeler/agent-enderun/docs/project_analysis_report.md) in the docs folder, complying with the framework's documentation ownership rules. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
23
-
24
- Test entry from CLI again.
25
-
26
- Test entry from CLI
22
+ - **Dynamic Scaffold Path Resolution Fix (v1.1.1):** Updated `initCommand` in `src/cli/commands/init.ts` to dynamically map the target folder name for `scaffoldCoreAgents` (e.g., `skills` for `antigravity`, `plugins` for `grok`). This prevents folder clutter by keeping agent profiles inside the adapter's expected subdirectories. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
23
+ - **Monorepo Version Synchronization (v1.1.1):** Synchronized framework configurations, server code, status boards, and package descriptors across all workspace packages (`framework-mcp`, `apps/web`, `.enderun/config.json`, and `.enderun/STATUS.md`) to align with the root version `1.1.1`. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
24
+ - **MCP Project Root Configuration Fix (v1.1.1):** Surgically updated `buildMcpServerEntry` in `src/cli/adapters.ts` to include the absolute `ENDERUN_PROJECT_ROOT` environment variable in the generated configurations during `init`, resolving relative path mismatches for external AI runtimes. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
25
+ - **CLI & IDE Capability Audit (v1.1.1):** Audited and documented CLI execution capabilities and IDE adapter mappings (Gemini/Antigravity, Cursor, Claude Code, Grok). Verified cross-compatibility for developer and autonomous agent interaction. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
26
+ - **Framework Inspection & Analysis (v1.1.1):** Inspected the framework structure, custom agent army settings, Hermes messaging loop, and MCP server. Verified that the `apps` directory is intentionally kept empty of business code to act as a clean canvas for enterprise projects. Created and documented findings in `docs/project_analysis_report.md`. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
27
27
  - **AL NPM Consumption Fix (v1.0.7+):** Root cause of 'kuraları npm den' AL validation FAILED (the exact error: 'Run manually: node bin/validate-agent-army.js' after init with remap adapters like antigravity) was execSync("node bin/...") assuming source cwd. Fixed by adding robust getPackageRoot() + getValidatorPath() in pkg.ts (walks import.meta.url to locate the agent-enderun package's bin/ regardless of install location or cwd). Updated check.ts, init.ts, index.ts to use resolved path + cwd-respecting exec. Updated error suggestions to `agent-enderun validate`. Reproduced with real npm pack + tgz install into isolated tests/init-adapters/.../consume/, ran installed CLI init+check+validate for antigravity remap case: now ✅ "Agent Army AL validation PASSED" (no FAILED branch). Source validate still 12/12. Docs/README surgically updated. Meets surgical + Trace + every-turn memory. (Trace 01HGT8J5E2N0W0W0W0W0W0W0W5)
28
28
  - **Enterprise v1.0.6 Sürüm Revizyonu:** Mimari Enterprise 2.1 (Yetenek Tabanlı) olarak korundu, marka ismi `Agent Enderun Enterprise v1` olarak güncellendi ve tüm paket sürümleri `1.0.6` olarak mühürlendi.
29
29
  - **Agent Lifecycle (AL) Tam Entegrasyon:** Tüm agent `.md` tanımları `stateMachine` ve `tags` alanları ile AL şemasına uygun hale getirildi. `bin/validate-agent-army.js` aracı bu yeni alanları denetleyecek şekilde güncellendi ve tüm ordu (12 agent) %100 başarıyla doğrulandı. CLI orkestrasyon mantığı AL durum geçişlerini (BRIEFED, EXECUTING, BLOCKED) destekleyecek şekilde zenginleştirildi.
30
30
  - **Monorepo Sürüm Senkronizasyonu:** Tüm monorepo paketlerinin (`@agent-enderun/mcp`, `@agent-enderun/backend`, `@agent-enderun/web`) sürümleri ana sürüm olan `1.0.5` ile senkronize edildi.
31
- - **Kalite Kapısı Kontrolleri:** ESLint otomatik kod formatlama ve hizalama düzeltmeleri uygulandı, TS derleme build'i sıfır hata ile tamamlandı ve vitest birim testlerinin tümü (%100 başarı) başarıyla geçti.
32
- - **AI Compatibility Audit:** Documented and verified active readiness for Gemini/Antigravity CLI, Cursor IDE, Claude Code/Desktop, and Grok environments.
33
- - **Antigravity Konfigürasyon Entegrasyonu:** `agent-settings`, `cli-settings` ve `ide-settings` kılavuzlarındaki standartlara uygun olarak `.agents/skills`, `.agents/rules`, `.agents/workflows` dizinleri, `.agents/mcp_config.json` lokal MCP tanımları ve kök dizindeki `AGENTS.md` otonom talimat dosyası oluşturuldu ve `init` akışına entegre edildi.
34
- - **Automated Scaffolding Geliştirmesi:** `init` komutu güncellendi. Kurulum sırasında hem `.agents/agents/...` klasörlerinin hem de `.cursorrules` dosyasının otomatik olarak oluşturulması sağlandı, böylece hem Antigravity hem de Cursor IDE destekleri tamamen otonom ve otomatik hale getirildi.
35
- - **Framework Directory Resolution Fix:** Removed `.agents` from `FRAMEWORK_DIR_CANDIDATES` to avoid false positive directory detection when `.agents` is created solely for Antigravity/Cursor custom agent registration. Verified health check is 100% green.
36
- - **Architectural Guidance:** Answered user inquiry regarding MCP agent definition structure, explaining the role of `agent.json` vs `.md` files.
31
+ - **Kalite Kapısı Kontrolleri:** ESLint otomatik kod formatlama ve hizalama düzeltmeleri uygulandı, TS derleme build'i sıfır hata ile tamamlandı ve vitest birim testlerinin tümü (%100 başarı) başarıyla geçti.
package/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🎖️ Agent Enderun — THE ARCHITECT (Claude Code / Desktop)
2
2
 
3
- You are the **Architect** of the Agent Enderun Army. Your primary role is code quality, structural integrity, refactoring excellence, and maintaining the enterprise standards.
3
+ You are the **Architect** of the Agent Enderun Army. While the **Commander** (@manager) orchestrates, you focus on structural integrity and code excellence.
4
4
 
5
5
  ### 🏛️ Hierarchy of Authority
6
6
  1. **Supreme Law:** [.enderun/ENDERUN.md](.enderun/ENDERUN.md)
@@ -8,12 +8,12 @@ You are the **Architect** of the Agent Enderun Army. Your primary role is code q
8
8
  3. **Project Memory:** [.enderun/memory/](.enderun/memory/) (Decisions, Lessons, Status)
9
9
 
10
10
  ### 🤖 Architect Directive (Role: QUALITY & REFACTOR)
11
- 1. **Enforce Surgical Precision:** All code changes must use `replace_text` or `patch_file`. No full file rewrites.
12
- 2. **Contract & Type Integrity:** Verify that backend contracts and branded types are respected before any frontend or integration work.
13
- 3. **Refactor & Quality Gate:** Review specialist outputs for compliance with knowledge/ standards (eslint, error handling, etc.).
11
+ 1. **Manager Coordination:** Receive your briefings from @manager. You are part of a coordinated army.
12
+ 2. **Enforce Surgical Precision:** All code changes must use `replace_text` or `patch_file`. No full file rewrites.
13
+ 3. **Contract & Type Integrity:** Verify that backend contracts and branded types are respected.
14
14
  4. **Maintain State:** Update `.enderun/memory/PROJECT_MEMORY.md` and log actions at the end of EVERY turn.
15
15
 
16
- ### 🛡️ Core Mandates (Enterprise 2.0)
16
+ ### 🛡️ Core Mandates (Enterprise 1.0)
17
17
  - **Zero UI Library Policy:** Enforce hand-crafted components with Panda CSS.
18
18
  - **Zero Mock Policy:** Only real contracts and services.
19
19
  - **Traceability:** Inherit and pass the active Trace ID.
package/GEMINI.md CHANGED
@@ -1,20 +1,23 @@
1
1
  # 🎖️ Agent Enderun — THE COMMANDER (Gemini CLI)
2
2
 
3
- You are the **Commander** of the Agent Enderun Army. Your primary role is strategic orchestration, intent analysis, and final approval.
3
+ You are the **Commander** (@manager), the Supreme Orchestrator of the Agent Enderun Army. Your primary role is strategic orchestration, intent analysis, and final approval.
4
4
 
5
5
  ### 🏛️ Hierarchy of Authority
6
6
  1. **Supreme Law:** [.enderun/ENDERUN.md](.enderun/ENDERUN.md)
7
7
  2. **Global Rules:** [ARCHITECTURE.md](.enderun/ARCHITECTURE.md), [SECURITY.md](.enderun/SECURITY.md)
8
8
  3. **Project Memory:** [.enderun/memory/](.enderun/memory/) (Decisions, Lessons, Status)
9
9
 
10
- ### 🤖 Commander Directive (Role: STRATEGIC)
11
- 1. **Analyze Intent:** Act as the **Router**. Break down user requests into a task DAG.
12
- 2. **Orchestrate:** Delegate complex tasks to specialized capabilities (Architect, Implementer, Researcher).
10
+ ### 🤖 Commander Directive (Role: @manager)
11
+ 1. **Analyze Intent:** Act as the **Router**. Every request must be processed by you first. Break down user requests into a task DAG.
12
+ 2. **Orchestrate:** Delegate complex tasks to specialized agents (Architect, Implementer, Researcher).
13
+ - **How to Delegate:** Use the `send_agent_message` tool to assign tasks to other agents (e.g., `@backend`, `@frontend`).
14
+ - **How to Sync:** Use the `orchestrate_loop` tool after delegating to update the system state and `STATUS.md`.
13
15
  3. **Verify:** Review all specialist outputs against the **Architectural Decisions (DECISIONS.md)**.
14
16
  4. **Maintain State:** Update `.enderun/memory/PROJECT_MEMORY.md` and log actions at the end of EVERY turn.
15
17
 
16
- ### 🛡️ Core Mandates (Enterprise 2.0)
18
+ ### 🛡️ Core Mandates (Enterprise 1.0)
17
19
  - **Role-Based:** You are not just a model; you are the **Commander**.
18
20
  - **Surgical Precision:** Enforce `replace_text` for all code modifications.
19
21
  - **Traceability:** Inherit and pass the active Trace ID across all delegations.
20
22
  - **Approval Makamı:** No specialist can perform high-risk actions without your explicit briefing.
23
+ - **CLI Delegation:** The user can also delegate via CLI using `agent-enderun @agent "task"`.
package/GROK.md CHANGED
@@ -13,7 +13,7 @@ You are the **Researcher** and **Intelligence Specialist** of the Agent Enderun
13
13
  3. **Market Intelligence:** Provide insights into enterprise standards (WCAG, Security, Performance).
14
14
  4. **Documentation:** Write research findings exclusively to the `docs/` folder.
15
15
 
16
- ### 🛡️ Core Mandates (Enterprise 2.0)
16
+ ### 🛡️ Core Mandates (Enterprise 1.0)
17
17
  - **Read-Only Focus:** You are primarily a discovery role. Do not perform large-scale code changes without @manager approval.
18
18
  - **Search-First:** Always use `search_codebase` before drawing conclusions.
19
19
  - **Constraint Aware:** Respect the **Zero UI Library Policy** in all recommendations.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🏛️ Agent Enderun — Enterprise AI Governance & Autonomous Orchestration Framework
2
2
 
3
- > **Stable Release:** v1.0.9 (Final Production Ready) — Build Compile: Clean | Type-Safety: 100% Verified | AL Compliance: 12/12 Agents
3
+ > **Stable Release:** v1.1.1 (Enterprise Orchestration Ready) — Build Compile: Clean | Type-Safety: 100% Verified | AL Compliance: 12/12 Agents
4
4
 
5
5
  > **Author:** Yusuf BEKAR
6
6
  > **Trace ID:** `01HGT8J5E2N0W0W0W0W0W0W0W5`
@@ -12,7 +12,7 @@
12
12
 
13
13
  **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**.
14
14
 
15
- Nihai temiz sürüm (v1.0.9) itibarıyla sistem; düşük kullanımlı referans materyalleri (knowledge, demo scriptler) düzenlenmiş, bloat temizlenmiş (KENTİM docs seti + SYSTEM_MAP.md kaldırıldı); 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** (npm kurulumu sonrası dahil) otomatikleştiren ve **macOS & Windows çapraz platform standartlarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır. Karmaşık kurumsal projeler için optimize edilmiştir (corporate-governance SOP'ları ile).
15
+ Nihai temiz sürüm (v1.1.0) itibarıyla sistem; **@-mention delegasyon**, **doğal dil rotalama** ve **Hermes Kilit Protokolü** ile güçlendirilmiş; 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** (npm kurulumu sonrası dahil) otomatikleştiren, **harici IDE entegrasyonlarında (Claude Desktop/Cursor vb.) mutlak proje kök dizini (CWD) uyumluluğu sunan**, **scaffold adımlarında ajan klasörlerini adapter tipine göre dinamik olarak eşleyen** ve **macOS & Windows çapraz platform standartlarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır. Karmaşık kurumsal projeler için optimize edilmiştir (corporate-governance SOP'ları ile).
16
16
 
17
17
  ---
18
18
 
@@ -22,15 +22,15 @@ Yapay zeka kodlama yardımcıları (Claude Code, Gemini CLI, Grok Build vb.) gel
22
22
 
23
23
  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.
24
24
  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, **`.enderun/memory/PROJECT_MEMORY.md`** dosyasını projenin değişmez tek doğruluk kaynağı (SSOT) haline getirerek, seanslar arası bağlam kaybını tamamen engeller.
25
- 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
+ 3. **Akıllı Delegasyon ve Doğal Dil:** Artık karmaşık komutlar yerine `agent-enderun "Projemi denetle"` gibi doğal dildeki istekler veya `agent-enderun @backend "Tablo oluştur"` gibi doğrudan delegasyonlar kullanılabilir.
26
26
  4. **Çoklu Ajan Kaosu:** **12** 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.
27
- 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 (**`.enderun/`**, `.gemini/`, `.claude/`, `.grok/` vb.) saklanır; `/tmp` veya dış dizinleri kullanmayarak sıfır hata ile çalışır.
27
+ 5. **Güvenli Haberleşme & Entegrasyon:** Yeni eklenen **Hermes Lock Protocol** sayesinde, birden fazla ajanın aynı anda mesajlaşması durumunda veri çakışmaları tamamen engellenir. Ayrıca harici asistanların yerel MCP araçlarını sorunsuz çalıştırabilmesi için mutlak çalışma dizini (CWD) parametreleri yapılandırılmıştır.
28
28
 
29
29
  ---
30
30
 
31
31
  ### 📦 Güncel Sürüm / Current Release
32
32
 
33
- **v1.0.9** — AL Enterprise Compliance kararlı sürüm (npm ile kurulum sonrası adapter remap'leri ve validator çağrıları dahil tam destek, cerrahi düzeltmelerle). Detaylı sürüm geçmişi git log ve önceki commit'lerde bulunur; kalıbımız (bilingual TR/EN yapı, tablolar, bölümler) korunmuştur.
33
+ **v1.1.1** — Enterprise 1.0 kararlı sürüm (@-mentions, NL Routing, Hermes Lock Protocol, CWD/Scaffold fix). Detaylı sürüm geçmişi git log ve önceki commit'lerde bulunur; kalıbımız (bilingual TR/EN yapı, tablolar, bölümler) korunmuştur.
34
34
 
35
35
  ---
36
36
 
@@ -166,7 +166,7 @@ npx agent-enderun init gemini --unified
166
166
 
167
167
  **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.
168
168
 
169
- Nihai temiz sürüm (v1.0.9 - Final Clean Release) 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** (including after `npm install`), and **fully complying with cross-platform (macOS & Windows) scripting and standard setups**. Low-usage reference materials arranged (knowledge files, demo scripts, observability placeholders marked). Bloat removed. Optimized for complex corporate/enterprise projects via corporate-governance knowledge and SOPs.
169
+ Version **v1.1.1** 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** (including after `npm install`), **resolving absolute project root paths (CWD) dynamically for external assistant tools (e.g. Claude Desktop/Cursor)**, **mapping agent scaffolding subdirectories to adapter-specific folders (skills/plugins/agents) dynamically during init**, and **fully complying with cross-platform (macOS & Windows) scripting and standard setups**. Low-usage reference materials arranged (knowledge files, demo scripts, observability placeholders marked). Bloat removed. Optimized for complex corporate/enterprise projects via corporate-governance knowledge and SOPs.
170
170
 
171
171
  ---
172
172
 
@@ -178,13 +178,13 @@ As AI coding assistants (Claude Code, Gemini CLI, Grok Build, etc.) become incre
178
178
  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 **`.enderun/memory/PROJECT_MEMORY.md`** file, ensuring absolute context continuity.
179
179
  3. **Contract-First Safety (Frontend-Backend Drift):** Before any user interface code is written, API models and branded types are sealed. The **autonomous** contract verification engine checks SHA-256 type definitions to prevent integration drifts.
180
180
  4. **Symmetric Orchestration (Hermes Protocol):** **12** specialized expert agents communicate via an asynchronous, event-driven message broker (**Hermes**), preventing chaotic, uncoordinated AI behavior.
181
- 5. **Sandbox & Security Compliance:** Modern CLI agents (like Claude Code) restrict filesystem access. By keeping all configurations, task logs, and queues local (inside **`.enderun/`**, `.gemini/`, `.claude/`, `.grok/`, etc.) in the project workspace, Enderun runs with **zero sandbox violations**.
181
+ 5. **Sandbox & Security Compliance:** Modern CLI agents (like Claude Code) restrict filesystem access. By keeping all configurations, task logs, and queues local (inside **`.enderun/`**, `.gemini/`, `.claude/`, `.grok/`, etc.) in the project workspace, Enderun runs with **zero sandbox violations**. Additionally, absolute CWD environment bindings prevent path mismatches in background execution.
182
182
 
183
183
  ---
184
184
 
185
185
  ### 📦 Current Release / Güncel Sürüm
186
186
 
187
- **v1.0.9** — AL Enterprise Compliance stable (full cross-adapter & npm install support for remaps + validator resolution, with surgical fixes). Detailed historical release notes are in git history; the bilingual TR/EN template, tables, and section mold are preserved.
187
+ **v1.1.1** — AL Enterprise Compliance stable (full cross-adapter & npm install support for remaps + validator resolution, with surgical fixes for CWD environment and dynamic folder scaffolding). Detailed historical release notes are in git history; the bilingual TR/EN template, tables, and section mold are preserved.
188
188
 
189
189
  ---
190
190
 
@@ -316,4 +316,4 @@ npx agent-enderun init gemini --unified
316
316
 
317
317
  ---
318
318
 
319
- Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v1.0.9 (Final Clean)** — Low-usage items arranged as reference-only. Bloat removed. Corporate-ready.
319
+ Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v1.1.1 (Final Clean)** — Low-usage items arranged as reference-only. Bloat removed. Corporate-ready.
@@ -0,0 +1,69 @@
1
+ # Agent Enderun — Framework Analizi ve Proje Raporu
2
+
3
+ Bu rapor, **Agent Enderun Enterprise v1 (v1.1.1)** altyapısının genel mimari yapısını, orkestrasyon mekanizmasını, MCP araçlarını ve kurumsal proje geliştirme standartlarını incelemek amacıyla hazırlanmıştır.
4
+
5
+ Projenin `apps/` dizini kasıtlı olarak boş bırakılmıştır. Bu yapı, geliştiricilerin kendi yeteneklerini, hafıza haritalarını ve kurumsal iş mantıklarını sıfırdan ve temiz bir alanda inşa edebilmesi için tasarlanmış bir **"kurumsal proje geliştirme motoru" (development engine)** niteliğindedir.
6
+
7
+ ---
8
+
9
+ ## 🏛️ Mimari Yapı ve Temel Bileşenler
10
+
11
+ Agent Enderun, AI ajanlarının otonom olarak çalışabileceği ancak insan yapımı kurallarla (Anayasa) sıkı bir şekilde sınırlandırıldığı bir **AI Yönetişim Altyapısıdır (AI Governance Framework)**.
12
+
13
+ ```mermaid
14
+ graph TD
15
+ CLI[CLI: agent-enderun] -->|Komutlar & NL İstekleri| Manager[@manager - Commander]
16
+ Manager -->|Hermes Protokolü| MsgQueue[Mesaj Kuyruğu: .enderun/messages/]
17
+ MsgQueue -->|Durum Makinesi / AL| Agents[Ajan Ordusu: 12 Uzman Ajan]
18
+ Agents -->|MCP Araçları| Workspace[Proje Çalışma Alanı: apps/]
19
+ Agents -->|Loglama & Hafıza| Mem[Proje Hafızası: PROJECT_MEMORY.md]
20
+ ```
21
+
22
+ ### 1. Supreme Constitution (Üstün Yasa)
23
+ Tüm sistemin ve ajanların uymak zorunda olduğu kurallar bütününü içerir:
24
+ * **Ana Anayasa (`.enderun/ENDERUN.md`):** Ajanların operasyonel sınırlarını çizer. `replace_text` kullanımı zorunluluğu, `any` tipinin ve `console.log` kullanımının yasak olması, Zero Mock (Sahte Veri Yasağı) ve branded types standartları burada mühürlenmiştir.
25
+ * **Güvenlik Protokolleri (`docs/architecture/approval-flows.md`):** Yüksek riskli işlemler (toplu veri silme, veritabanı şema değişimi, credential rotasyonu) için `@manager` onayını ve insan-in-the-loop (`approve` komutu) imzasını zorunlu kılar.
26
+
27
+ ### 2. Ajan Ordusu (Agent Army - AL Compliant)
28
+ `.enderun/agents/` altında JSON şemalarıyla tanımlanmış 12 adet uzman ajan bulunur. Ajanların durumları **Agent Lifecycle (AL)** durum makinesine (`IDLE` ➔ `BRIEFED` ➔ `EXECUTING` ➔ `DONE`/`BLOCKED`) göre yönetilir:
29
+ * `@manager`: Supreme Orchestrator ve Team-Lead rolündedir. Her talebi analiz eder ve iş paketlerini delege eder.
30
+ * `@backend` & `@frontend`: Sunucu mantığı, Panda CSS tabanlı sıfır-kütüphane arayüz standartlarını yönetir.
31
+ * `@database` & `@devops`: Kysely tabanlı veri katmanını ve CI/CD süreçlerini yürütür.
32
+ * `@quality`: Kod standartlarını (ESLint) ve test kapsamını (%80 üzeri) denetleyen son onay kapısıdır.
33
+ * `@explorer`, `@git`, `@mobile`, `@native`, `@security`, `@analyst`: Diğer uzmanlık alanlarındaki görevleri icra eder.
34
+
35
+ ### 3. Hermes Mesajlaşma Kanalı
36
+ Ajanlar arası ve kullanıcı ile ajanlar arasındaki iletişim asenkron ve JSON formatında Hermes protokolü ile sağlanır:
37
+ * **İletişim Kanalı:** `.enderun/messages/` klasöründe yer alan JSON dosyalarıdır.
38
+ * **Kilit Mekanizması:** Çakışmaları önlemek için `.lock` dosyası ile Hermes kilit protokolü uygulanır (LLM zaman aşımları için 5 saniyelik stale lock kontrolü mevcuttur).
39
+ * **Trace ID:** Her işlem zinciri `trace:new` ile oluşturulan benzersiz bir Trace ID'yi miras alır ve tüm loglarda taşınır.
40
+
41
+ ---
42
+
43
+ ## 🛠️ CLI ve Geliştirici Komutları
44
+
45
+ Çalışma alanı kök dizinindeki `bin/cli.js` üzerinden `src/cli/` altındaki komutlar tetiklenir:
46
+ 1. `init [adapter]`: Altyapıyı hedef ortama (`gemini`, `claude`, `grok` vb.) göre uyarlar, kurallar ve yetenek şablonlarını oluşturur.
47
+ 2. `check`: Sistem sağlık taramasını gerçekleştirir ve ajan ordusunun şema uyumluluğunu doğrular.
48
+ 3. `status`: Aktif fazı, güncel Trace ID'yi ve ajanların anlık durumlarını gösterir.
49
+ 4. `trace:new`: Yeni bir iş zinciri başlatır.
50
+ 5. `orchestrate`: Bekleyen Hermes görevlerini sırasıyla ajanlara delege eder ve durumlarını günceller.
51
+ 6. `verify-contract` & `update-contract`: API veri tiplerinin ve kontratların frontend-backend arasında uyumlu olmasını güvence altına alır.
52
+
53
+ ---
54
+
55
+ ## 📡 Model Context Protocol (MCP) Server
56
+
57
+ `framework-mcp/` dizini altında bağımsız bir paket olarak geliştirilmiştir:
58
+ * **SDK Entegrasyonu:** `@modelcontextprotocol/sdk` kullanılarak tasarlanmıştır.
59
+ * **Dosya Yönetim Araçları:** Ajanların kod üzerinde cerrahi operasyon yapmasını sağlayan `replace_text`, `patch_file`, `write_file` ve `read_file` araçları sunulur.
60
+ * **Yönetim ve Mesajlaşma Araçları:** Proje hafızasını güncellemek için `update_project_memory`, mesaj göndermek için `send_agent_message` ve eylemleri kaydetmek için `log_agent_action` araçlarını içerir.
61
+
62
+ ---
63
+
64
+ ## 📈 Sonuç ve Öneriler
65
+
66
+ Proje, kurumsal seviyede çoklu ajan yönetimi ve kod kalitesi yönetişimi için mükemmel bir temel hazırlamıştır. `apps/` dizininin boş bırakılmış olması, geliştirilmek istenen özel kurumsal projeler için temiz bir sayfa sunar. Geliştirme sürecinde şunlara dikkat edilmelidir:
67
+ 1. **Hafıza Senkronizasyonu:** Her aşamada `.enderun/memory/PROJECT_MEMORY.md` ve `.enderun/logs/` güncellenmelidir.
68
+ 2. **Surgical Kodlama:** Dosyaları komple değiştirmek yerine MCP araçları ile nokta atışı (`replace_text`) düzenleme alışkanlığı sürdürülmelidir.
69
+ 3. **AL Uyumluluğu:** Ajan tanımlarında yapılan değişikliklerden sonra mutlaka `agent-enderun validate` komutu ile doğrulama yapılmalıdır.
@@ -5,7 +5,7 @@ import { TOOLS, toolHandlers } from "./tools/index.js";
5
5
  // ─── Server Setup ─────────────────────────────────────────────────
6
6
  const server = new Server({
7
7
  name: "@agent-enderun/mcp",
8
- version: "1.0.9",
8
+ version: "1.1.1",
9
9
  }, {
10
10
  capabilities: {
11
11
  tools: {},
@@ -3,21 +3,44 @@ import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
4
  export function handleSendAgentMessage(projectRoot, args) {
5
5
  const { to, category, content, traceId } = args;
6
- // `from` is optional — falls back to "@mcp" for backward compatibility
7
6
  const from = args.from || "@mcp";
8
7
  const frameworkDir = resolveFrameworkDir(projectRoot);
8
+ const messagesDir = path.join(projectRoot, frameworkDir, "messages");
9
9
  const agentName = to.replace("@", "");
10
- const messagePath = path.join(projectRoot, frameworkDir, "messages", `${agentName}.json`);
11
- const message = {
12
- timestamp: new Date().toISOString(),
13
- from,
14
- to,
15
- category,
16
- traceId,
17
- content,
18
- status: "PENDING"
19
- };
20
- fs.mkdirSync(path.dirname(messagePath), { recursive: true });
21
- fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
22
- return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
10
+ const messagePath = path.join(messagesDir, `${agentName}.json`);
11
+ const lockPath = path.join(messagesDir, ".lock");
12
+ // Hermes Lock Protocol: Retry 3 times with 500ms delay
13
+ let retries = 3;
14
+ while (retries > 0 && fs.existsSync(lockPath)) {
15
+ const stats = fs.statSync(lockPath);
16
+ if (Date.now() - stats.mtimeMs > 5000) {
17
+ fs.unlinkSync(lockPath);
18
+ break;
19
+ }
20
+ retries--;
21
+ if (retries > 0) {
22
+ const start = Date.now();
23
+ while (Date.now() - start < 500)
24
+ ; // Simple busy wait for MCP environment
25
+ }
26
+ }
27
+ try {
28
+ fs.mkdirSync(messagesDir, { recursive: true });
29
+ fs.writeFileSync(lockPath, `Locked by ${from} at ${new Date().toISOString()}`);
30
+ const message = {
31
+ timestamp: new Date().toISOString(),
32
+ from,
33
+ to,
34
+ category,
35
+ traceId,
36
+ content,
37
+ status: "PENDING"
38
+ };
39
+ fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
40
+ return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
41
+ }
42
+ finally {
43
+ if (fs.existsSync(lockPath))
44
+ fs.unlinkSync(lockPath);
45
+ }
23
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-enderun/mcp",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "Agent Enderun Model Context Protocol (MCP) Server",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ import { TOOLS, toolHandlers } from "./tools/index.js";
14
14
  const server = new Server(
15
15
  {
16
16
  name: "@agent-enderun/mcp",
17
- version: "1.0.9",
17
+ version: "1.1.1",
18
18
  },
19
19
  {
20
20
  capabilities: {
@@ -5,25 +5,46 @@ import { ToolArgs, ToolResult } from "../types.js";
5
5
 
6
6
  export function handleSendAgentMessage(projectRoot: string, args: ToolArgs): ToolResult {
7
7
  const { to, category, content, traceId } = args as Required<Pick<ToolArgs, "to" | "category" | "content" | "traceId">>;
8
- // `from` is optional — falls back to "@mcp" for backward compatibility
9
8
  const from = (args.from as string) || "@mcp";
10
9
 
11
10
  const frameworkDir = resolveFrameworkDir(projectRoot);
11
+ const messagesDir = path.join(projectRoot, frameworkDir, "messages");
12
12
  const agentName = to.replace("@", "");
13
- const messagePath = path.join(projectRoot, frameworkDir, "messages", `${agentName}.json`);
13
+ const messagePath = path.join(messagesDir, `${agentName}.json`);
14
+ const lockPath = path.join(messagesDir, ".lock");
14
15
 
15
- const message = {
16
- timestamp: new Date().toISOString(),
17
- from,
18
- to,
19
- category,
20
- traceId,
21
- content,
22
- status: "PENDING"
23
- };
16
+ // Hermes Lock Protocol: Retry 3 times with 500ms delay
17
+ let retries = 3;
18
+ while (retries > 0 && fs.existsSync(lockPath)) {
19
+ const stats = fs.statSync(lockPath);
20
+ if (Date.now() - stats.mtimeMs > 5000) {
21
+ fs.unlinkSync(lockPath);
22
+ break;
23
+ }
24
+ retries--;
25
+ if (retries > 0) {
26
+ const start = Date.now();
27
+ while (Date.now() - start < 500); // Simple busy wait for MCP environment
28
+ }
29
+ }
24
30
 
25
- fs.mkdirSync(path.dirname(messagePath), { recursive: true });
26
- fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
31
+ try {
32
+ fs.mkdirSync(messagesDir, { recursive: true });
33
+ fs.writeFileSync(lockPath, `Locked by ${from} at ${new Date().toISOString()}`);
27
34
 
28
- return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
35
+ const message = {
36
+ timestamp: new Date().toISOString(),
37
+ from,
38
+ to,
39
+ category,
40
+ traceId,
41
+ content,
42
+ status: "PENDING"
43
+ };
44
+
45
+ fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
46
+ return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
47
+ } finally {
48
+ if (fs.existsSync(lockPath)) fs.unlinkSync(lockPath);
49
+ }
29
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-enderun",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
5
5
  "author": "Yusuf BEKAR",
6
6
  "license": "MIT",
@@ -82,7 +82,7 @@
82
82
  "zod": "^3.24.2"
83
83
  },
84
84
  "enderun": {
85
- "version": "1.0.9",
85
+ "version": "1.1.0",
86
86
  "initializedAt": "2026-05-31T09:58:25.773Z",
87
87
  "frameworkDir": ".enderun"
88
88
  },
@@ -209,7 +209,9 @@ export function buildMcpServerEntry(projectRoot: string) {
209
209
  return {
210
210
  command: "node",
211
211
  args: [path.join(projectRoot, "framework-mcp/dist/index.js")],
212
- env: {},
212
+ env: {
213
+ ENDERUN_PROJECT_ROOT: projectRoot,
214
+ },
213
215
  };
214
216
  }
215
217
 
@@ -324,7 +324,15 @@ export async function initCommand(adapterInput?: string, dryRun = false) {
324
324
  if (!dryRun) deepCleanProtocols(targetDir, targetScope);
325
325
 
326
326
  // Scaffold core agents under the central framework directory
327
- scaffoldCoreAgents(path.join(targetFrameworkDir, "agents"), dryRun);
327
+ let agentFolder = "agents";
328
+ if (frameworkDir !== ".enderun") {
329
+ if (adapter.id === "antigravity") {
330
+ agentFolder = "skills";
331
+ } else if (adapter.id === "grok") {
332
+ agentFolder = "plugins";
333
+ }
334
+ }
335
+ scaffoldCoreAgents(path.join(targetFrameworkDir, agentFolder), dryRun);
328
336
 
329
337
  if (!fs.existsSync(path.join(targetDir, ".git")) && !dryRun) {
330
338
  try { execSync("git init", { cwd: targetDir, stdio: "ignore" }); } catch { /* ignore */ }
@@ -88,6 +88,59 @@ export async function orchestrateCommand() {
88
88
  }
89
89
  }
90
90
 
91
+ export function sendMessage(args: {
92
+ from: string;
93
+ to: string;
94
+ category: string;
95
+ content: string;
96
+ traceId: string;
97
+ }) {
98
+ const frameworkDir = getFrameworkDir();
99
+ const messagesDir = path.join(process.cwd(), frameworkDir, "messages");
100
+ const agentName = args.to.replace("@", "");
101
+ const messagePath = path.join(messagesDir, `${agentName}.json`);
102
+ const lockPath = path.join(messagesDir, ".lock");
103
+
104
+ // Hermes Lock Protocol: Retry 3 times with 500ms delay
105
+ let retries = 3;
106
+ while (retries > 0 && fs.existsSync(lockPath)) {
107
+ const stats = fs.statSync(lockPath);
108
+ // Stale lock check (older than 5 seconds)
109
+ if (Date.now() - stats.mtimeMs > 5000) {
110
+ fs.unlinkSync(lockPath);
111
+ break;
112
+ }
113
+ retries--;
114
+ if (retries > 0) {
115
+ // Synchronous sleep for CLI simplicity
116
+ const g = global as unknown as { Atomics: { wait: (ia: Int32Array, index: number, value: number, timeout: number) => string }; SharedArrayBuffer: { new (size: number): ArrayBufferLike } };
117
+ if (g.Atomics && g.SharedArrayBuffer) {
118
+ g.Atomics.wait(new Int32Array(new g.SharedArrayBuffer(4)), 0, 0, 500);
119
+ }
120
+ }
121
+ }
122
+
123
+ try {
124
+ fs.mkdirSync(messagesDir, { recursive: true });
125
+ fs.writeFileSync(lockPath, `Locked by ${args.from} at ${new Date().toISOString()}`);
126
+
127
+ const message = {
128
+ timestamp: new Date().toISOString(),
129
+ from: args.from,
130
+ to: args.to,
131
+ category: args.category,
132
+ traceId: args.traceId,
133
+ content: args.content,
134
+ status: "PENDING"
135
+ };
136
+
137
+ fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
138
+ return message;
139
+ } finally {
140
+ if (fs.existsSync(lockPath)) fs.unlinkSync(lockPath);
141
+ }
142
+ }
143
+
91
144
  function transitionAgentState(agent: string, state: string, task: string) {
92
145
  const frameworkDir = getFrameworkDir();
93
146
  const statusPath = path.join(process.cwd(), frameworkDir, "STATUS.md");
package/src/cli/index.ts CHANGED
@@ -8,7 +8,7 @@ import { traceNewCommand } from "./commands/trace.js";
8
8
  import { updateProjectMemoryCommand } from "./commands/memory.js";
9
9
  import { createAppCommand } from "./commands/app.js";
10
10
  import { verifyApiContractCommand, updateApiContractCommand } from "./commands/contract.js";
11
- import { orchestrateCommand } from "./commands/orchestrate.js";
11
+ import { orchestrateCommand, sendMessage } from "./commands/orchestrate.js";
12
12
 
13
13
  /**
14
14
  * Main CLI entry point.
@@ -17,6 +17,48 @@ async function main() {
17
17
  const args = process.argv.slice(2);
18
18
  const command = args[0];
19
19
 
20
+ const KNOWN_COMMANDS = [
21
+ "init", "check", "status", "trace:new", "update_project_memory",
22
+ "create-app", "orchestrate", "verify-contract", "update-contract",
23
+ "validate", "validate-army", "check:al", "version", "-v", "--version", "help", "-h", "--help"
24
+ ];
25
+
26
+ // Handle @agent delegation syntax
27
+ if (command?.startsWith("@")) {
28
+ const to = command;
29
+ const content = args.slice(1).join(" ");
30
+ if (!content) {
31
+ console.error(`❌ Error: Missing task content for ${to}.`);
32
+ console.log(`Usage: agent-enderun ${to} "Your task description"`);
33
+ process.exit(64);
34
+ }
35
+
36
+ const { getMemoryPath } = await import("./utils/memory.js");
37
+ const fs = await import("fs");
38
+ const memoryPath = getMemoryPath();
39
+
40
+ let traceId = "T-000";
41
+ if (fs.default.existsSync(memoryPath)) {
42
+ const content = fs.default.readFileSync(memoryPath, "utf8");
43
+ // More robust regex: look for any ULID-like string in the Active Trace ID column or near the label
44
+ const match = content.match(/Active Trace ID\s*\|.*\|\s*\n\|.*\|.*\|.*\|\s*([A-Z0-9]+)\s*\|/i) ||
45
+ content.match(/Active Trace ID[:\s|]+([A-Z0-9]+)/i);
46
+ if (match) traceId = match[1].trim();
47
+ }
48
+
49
+ sendMessage({
50
+ from: "@manager",
51
+ to,
52
+ category: "DELEGATION",
53
+ content,
54
+ traceId
55
+ });
56
+
57
+ console.log(`✅ Task delegated to ${to} (Trace: ${traceId})`);
58
+ console.log("👉 Run \"agent-enderun orchestrate\" to process.");
59
+ return;
60
+ }
61
+
20
62
  switch (command) {
21
63
  case "init": {
22
64
  const dryRun = args.includes("--dry-run");
@@ -71,14 +113,12 @@ async function main() {
71
113
  case "validate":
72
114
  case "validate-army":
73
115
  case "check:al": {
74
- // Dedicated AL (Agent Lifecycle) army validation - can be run independently after init
75
- // Always resolve via getValidatorPath() so 'agent-enderun validate' works after npm install (cross-adapter too).
76
116
  const { execSync } = await import("child_process");
77
117
  try {
78
118
  const validatorPath = getValidatorPath();
79
119
  execSync(`node "${validatorPath}"`, { stdio: "inherit" });
80
120
  } catch {
81
- // validation script itself handles exit codes and messaging
121
+ // handled by validator
82
122
  }
83
123
  break;
84
124
  }
@@ -92,17 +132,56 @@ async function main() {
92
132
  case "help":
93
133
  case "-h":
94
134
  case "--help":
135
+ showHelp();
136
+ break;
137
+
95
138
  default:
96
- console.log(`
139
+ if (command && !KNOWN_COMMANDS.includes(command)) {
140
+ // Natural language request fallback to @manager
141
+ const content = args.join(" ");
142
+ const { getMemoryPath } = await import("./utils/memory.js");
143
+ const fs = await import("fs");
144
+ const memoryPath = getMemoryPath();
145
+
146
+ let traceId = "T-000";
147
+ if (fs.default.existsSync(memoryPath)) {
148
+ const content = fs.default.readFileSync(memoryPath, "utf8");
149
+ // More robust regex: look for any ULID-like string in the Active Trace ID column or near the label
150
+ const match = content.match(/Active Trace ID\s*\|.*\|\s*\n\|.*\|.*\|.*\|\s*([A-Z0-9]+)\s*\|/i) ||
151
+ content.match(/Active Trace ID[:\s|]+([A-Z0-9]+)/i);
152
+ if (match) traceId = match[1].trim();
153
+ }
154
+
155
+ sendMessage({
156
+ from: "@user",
157
+ to: "@manager",
158
+ category: "ACTION",
159
+ content,
160
+ traceId
161
+ });
162
+
163
+ console.log(`📡 Request sent to @manager: "${content}" (Trace: ${traceId})`);
164
+ console.log("👉 Run 'agent-enderun orchestrate' to process.");
165
+ } else {
166
+ showHelp();
167
+ }
168
+ break;
169
+ }
170
+ }
171
+
172
+ function showHelp() {
173
+ console.log(`
97
174
  🤖 Agent Enderun CLI — Enterprise AI Orchestration
98
175
 
99
176
  Usage:
100
177
  agent-enderun <command> [options]
178
+ agent-enderun @<agent> "task description"
179
+ agent-enderun "natural language request"
101
180
 
102
181
  Commands:
182
+ @<agent> <task> Delegate a task to a specialist agent (e.g. @backend, @frontend)
103
183
  init [adapter] Initialize Agent Enderun framework (gemini, claude, grok, etc.)
104
- check Perform an enterprise-grade system health check (includes automatic AL validation)
105
- validate Run dedicated Agent Lifecycle (AL) army validation (validate-agent-army)
184
+ check Perform an enterprise-grade system health check
106
185
  status Show active phase, trace ID, and agent statuses
107
186
  trace:new <desc> Start a new task chain with a unique Trace ID
108
187
  create-app <idea> Generate a new full-stack app from natural language
@@ -111,20 +190,14 @@ Commands:
111
190
  update-contract Generate and synchronize a new contract hash
112
191
  version Show version information
113
192
 
114
- Supported adapters (one init per IDE — separate folder each):
115
- - gemini → .enderun/ (SSOT) + gemini.md
116
- - claude → .enderun/ (SSOT) + claude.md
117
- - grok → .enderun/ (SSOT) + grok.md
118
- - antigravity → .enderun/ (SSOT) + agent.md
193
+ Natural Language:
194
+ If you provide a sentence that is not a known command, it will be automatically
195
+ sent to the @manager for orchestration.
119
196
 
120
197
  Example:
121
- agent-enderun init gemini
122
- agent-enderun check
123
- agent-enderun status
124
- agent-enderun trace:new "Auth module design" backend P1
125
- `);
126
- break;
127
- }
198
+ agent-enderun "Projemi denetle"
199
+ agent-enderun @backend "Login sayfasını oluştur"
200
+ `);
128
201
  }
129
202
 
130
203
  main().catch(console.error);