agent-enderun 0.5.7 → 0.5.9
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 +10 -97
- package/.enderun/agents/analyst.md +12 -6
- package/.enderun/agents/backend.md +47 -40
- package/.enderun/agents/explorer.md +15 -3
- package/.enderun/agents/frontend.md +42 -8
- package/.enderun/agents/git.md +2 -2
- package/.enderun/agents/manager.md +3 -3
- package/.enderun/agents/mobile.md +2 -2
- package/.enderun/agents/native.md +2 -2
- package/.enderun/blueprints/backend/errors/domain-error.ts +84 -0
- package/.enderun/blueprints/backend/middleware/error-handler.ts +24 -0
- package/.enderun/blueprints/frontend/ui/Button.tsx +60 -0
- package/.enderun/blueprints/frontend/ui/Input.tsx +43 -0
- package/.enderun/logs/manager.json +1 -0
- package/ENDERUN.md +25 -2
- package/README.md +9 -4
- package/bin/update-contract.js +3 -0
- package/claude.md +3 -3
- package/codex.md +3 -3
- package/cursor.md +3 -3
- package/gemini-extension.json +4 -2
- package/package.json +9 -7
- package/packages/framework-mcp/dist/index.js +0 -0
- package/packages/framework-mcp/dist/tools/contract.js +12 -6
- package/packages/framework-mcp/dist/tools/framework.js +2 -1
- package/packages/framework-mcp/dist/tools/knowledge.js +1 -1
- package/packages/framework-mcp/dist/utils.js +1 -1
- package/packages/framework-mcp/package.json +4 -1
- package/packages/framework-mcp/src/tools/contract.ts +18 -5
- package/packages/framework-mcp/src/tools/framework.ts +3 -2
- package/packages/framework-mcp/src/tools/knowledge.ts +6 -6
- package/packages/framework-mcp/src/utils.ts +1 -1
- package/packages/shared-types/dist/api.d.ts +18 -0
- package/packages/shared-types/dist/api.js +2 -0
- package/packages/shared-types/dist/api.js.map +1 -0
- package/packages/shared-types/dist/brands.d.ts +13 -0
- package/packages/shared-types/dist/brands.js +2 -0
- package/packages/shared-types/dist/brands.js.map +1 -0
- package/packages/shared-types/dist/constants.d.ts +27 -0
- package/packages/shared-types/dist/constants.js +22 -0
- package/packages/shared-types/dist/constants.js.map +1 -0
- package/packages/shared-types/dist/index.d.ts +7 -88
- package/packages/shared-types/dist/index.js +7 -3
- package/packages/shared-types/dist/index.js.map +1 -1
- package/packages/shared-types/dist/logs.d.ts +15 -0
- package/packages/shared-types/dist/logs.js +2 -0
- package/packages/shared-types/dist/logs.js.map +1 -0
- package/packages/shared-types/dist/models.d.ts +60 -0
- package/packages/shared-types/dist/models.js +2 -0
- package/packages/shared-types/dist/models.js.map +1 -0
- package/packages/shared-types/package.json +6 -3
- package/packages/shared-types/src/api.ts +20 -0
- package/packages/shared-types/src/brands.ts +12 -0
- package/packages/shared-types/src/constants.ts +34 -0
- package/packages/shared-types/src/index.ts +7 -97
- package/packages/shared-types/src/logs.ts +16 -0
- package/packages/shared-types/src/models.ts +66 -0
- package/panda.config.ts +79 -5
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { css, cx } from "../../../styled-system/css";
|
|
2
|
+
import { type HTMLPandaProps } from "../../../styled-system/types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* GOLDEN STANDARD: Button Component
|
|
6
|
+
* Uses Semantic Tokens for automatic theme support.
|
|
7
|
+
*/
|
|
8
|
+
export interface ButtonProps extends HTMLPandaProps<"button"> {
|
|
9
|
+
variant?: "primary" | "secondary" | "outline" | "ghost";
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Button = (props: ButtonProps) => {
|
|
14
|
+
const { variant = "primary", size = "md", className, ...rest } = props;
|
|
15
|
+
|
|
16
|
+
const buttonStyles = css({
|
|
17
|
+
display: "inline-flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
fontWeight: "600",
|
|
21
|
+
borderRadius: "md",
|
|
22
|
+
cursor: "pointer",
|
|
23
|
+
transition: "all 0.2s ease",
|
|
24
|
+
_disabled: { opacity: 0.5, cursor: "not-allowed" },
|
|
25
|
+
_active: { transform: "scale(0.98)" },
|
|
26
|
+
|
|
27
|
+
// Size variants
|
|
28
|
+
...(size === "sm" && { px: "3", py: "1.5", fontSize: "xs" }),
|
|
29
|
+
...(size === "md" && { px: "4", py: "2", fontSize: "sm" }),
|
|
30
|
+
...(size === "lg" && { px: "6", py: "3", fontSize: "md" }),
|
|
31
|
+
|
|
32
|
+
// Theme-aware Semantic Tokens
|
|
33
|
+
...(variant === "primary" && {
|
|
34
|
+
bg: "accent.default",
|
|
35
|
+
color: "accent.fg",
|
|
36
|
+
_hover: { bg: "accent.emphasis" },
|
|
37
|
+
}),
|
|
38
|
+
...(variant === "secondary" && {
|
|
39
|
+
bg: "bg.muted",
|
|
40
|
+
color: "text.default",
|
|
41
|
+
_hover: { bg: "border.default" },
|
|
42
|
+
}),
|
|
43
|
+
...(variant === "outline" && {
|
|
44
|
+
bg: "transparent",
|
|
45
|
+
border: "1px solid",
|
|
46
|
+
borderColor: "border.default",
|
|
47
|
+
color: "text.default",
|
|
48
|
+
_hover: { bg: "bg.muted" },
|
|
49
|
+
}),
|
|
50
|
+
...(variant === "ghost" && {
|
|
51
|
+
bg: "transparent",
|
|
52
|
+
color: "text.default",
|
|
53
|
+
_hover: { bg: "bg.muted" },
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<button className={cx(buttonStyles, className)} {...rest} />
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { css, cx } from "../../../styled-system/css";
|
|
2
|
+
import { type HTMLPandaProps } from "../../../styled-system/types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* GOLDEN STANDARD: Input Component
|
|
6
|
+
* Fully theme-aware using semantic border and background tokens.
|
|
7
|
+
*/
|
|
8
|
+
export interface InputProps extends HTMLPandaProps<"input"> {
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Input = (props: InputProps) => {
|
|
13
|
+
const { className, ...rest } = props;
|
|
14
|
+
|
|
15
|
+
const inputStyles = css({
|
|
16
|
+
width: "100%",
|
|
17
|
+
px: "4",
|
|
18
|
+
py: "2",
|
|
19
|
+
borderRadius: "md",
|
|
20
|
+
border: "1px solid",
|
|
21
|
+
borderColor: "border.default",
|
|
22
|
+
bg: "bg.canvas",
|
|
23
|
+
color: "text.default",
|
|
24
|
+
fontSize: "sm",
|
|
25
|
+
outline: "none",
|
|
26
|
+
transition: "all 0.2s ease",
|
|
27
|
+
_placeholder: { color: "text.muted" },
|
|
28
|
+
_focus: {
|
|
29
|
+
borderColor: "accent.default",
|
|
30
|
+
ring: "2px",
|
|
31
|
+
ringColor: "accent.default/20",
|
|
32
|
+
},
|
|
33
|
+
_disabled: {
|
|
34
|
+
opacity: 0.5,
|
|
35
|
+
cursor: "not-allowed",
|
|
36
|
+
bg: "bg.muted",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<input className={cx(inputStyles, className)} {...rest} />
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
package/ENDERUN.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Agent Enderun (v0.5.
|
|
1
|
+
# Agent Enderun (v0.5.9)
|
|
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)
|
|
@@ -11,6 +11,29 @@
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## 🧠 INTELLIGENCE & DISCOVERY PROTOCOLS
|
|
15
|
+
|
|
16
|
+
### 🔍 Architecture Discovery Protocol (ADP)
|
|
17
|
+
When encountering a project, agents must never assume a specific folder structure. Use the following algorithm:
|
|
18
|
+
1. **Entry Point Hunt:** Identify main entry points (`index.ts`, `main.ts`, `server.ts`) via `search_codebase`.
|
|
19
|
+
2. **Business Logic Mapping:** Search for core domain keywords (e.g. `service`, `repository`, `controller`) to find where logic resides, regardless of directory names.
|
|
20
|
+
3. **Contract Analysis:** Locate type definitions and API schemas to establish the "System Contract".
|
|
21
|
+
4. **Adaptive Scaffolding:** Always propose architectural improvements or scaffolding *before* writing code. Wait for explicit User consent.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🪙 TOKEN ECONOMY & CONTEXT MANAGEMENT
|
|
26
|
+
|
|
27
|
+
To minimize AI costs and maximize speed, all agents must adhere to the **Token Economy Protocol**:
|
|
28
|
+
|
|
29
|
+
1. **Search Before Reading (MANDATORY):** Never `read_file` an entire directory or large file without searching for specific points of interest first.
|
|
30
|
+
2. **Surgical Operations:** When editing, use the `replace` tool for targeted changes instead of overwriting entire files unless the file is very small (<50 lines).
|
|
31
|
+
3. **Output Conciseness:** MCP tools must return the minimum required data. Avoid verbose logs or redundant status messages in tool outputs.
|
|
32
|
+
4. **Context Compaction:** Before starting a new task, use `get_memory_insights` to retrieve only the relevant historical context.
|
|
33
|
+
5. **No Blind Coding:** Stop and ask if a task requires reading more than 5 large files without a clear search result.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
14
37
|
## Constitution Status
|
|
15
38
|
This file (`./{{ADAPTER}}.md`) and the `{{FRAMEWORK_DIR}}/docs/` folder represent the "Supreme Law" of the project. All agents must read this file first in every session and strictly comply with its rules 100%. All framework-specific documentation is stored within `{{FRAMEWORK_DIR}}/docs/`.
|
|
16
39
|
|
|
@@ -41,7 +64,7 @@ This file (`./{{ADAPTER}}.md`) and the `{{FRAMEWORK_DIR}}/docs/` folder represen
|
|
|
41
64
|
- **Team-Lead MANDATORY Orchestration:** Every user request MUST first be handled by the `@manager` (Team-Lead) agent. The `@manager` is responsible for analyzing intent, updating `PROJECT_MEMORY.md`, and delegating tasks to specialists. Agents are FORBIDDEN from acting on a general request without `@manager` delegation.
|
|
42
65
|
- **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.
|
|
43
66
|
- **Immediate Memory Sync:** Every state change, decision, or improved capability must be reflected in the memory files immediately.
|
|
44
|
-
- **Zero Temporary Storage & Single Source of Truth:** Storing, caching, or writing project details, logs, tasks, files, or agent planning documents (including implementation plans, scratch scripts, or intermediate tasks) in the operating system's temporary directory (`/tmp`, `/var/tmp`, `temp`, etc.) is strictly forbidden. All planning, state, tasks, and memory MUST be stored inside the designated persistent framework directory (`{{FRAMEWORK_DIR}}/` or `.
|
|
67
|
+
- **Zero Temporary Storage & Single Source of Truth:** Storing, caching, or writing project details, logs, tasks, files, or agent planning documents (including implementation plans, scratch scripts, or intermediate tasks) in the operating system's temporary directory (`/tmp`, `/var/tmp`, `temp`, etc.) is strictly forbidden. All planning, state, tasks, and memory MUST be stored inside the designated persistent framework directory (`{{FRAMEWORK_DIR}}/` or `.{{ADAPTER}}/` etc.) or the project workspace. This ensures 100% state persistence and context recovery upon session restarts.
|
|
45
68
|
- **Contract-First Agent Evolution:** Tools and SOPs used by agents must be defined via schemas and contracts first.
|
|
46
69
|
- **Zero Mock Policy:** The use of fake (mock) data or placeholders is strictly forbidden. Every line of code must connect to a real endpoint or a typed contract. (Exception: Controlled mock usage is allowed for external 3rd party services like Stripe, Twilio).
|
|
47
70
|
- **Branded Types Law:** All IDs (UserID, ProjectID, etc.) must be in the "Branded Types" format defined under `packages/shared-types`. Using plain strings or numbers is forbidden.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 🏛️ Agent Enderun (v0.5.
|
|
1
|
+
# 🏛️ Agent Enderun (v0.5.9) — The Supreme AI Governance Framework
|
|
2
2
|
|
|
3
3
|
**The Supreme AI Governance & Orchestration Framework for Enterprise Development**
|
|
4
4
|
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
Agent Enderun, yazılım ekipleri için tasarlanmış, **Anayasal Yönetişim (Constitutional Governance)** ve **Çoklu Ajan Orkestrasyonu (Multi-Agent Orchestration)** sağlayan kurumsal düzeyde bir framework'tür.
|
|
14
14
|
|
|
15
|
-
### 🚀 v0.5.
|
|
15
|
+
### 🚀 v0.5.9: Adaptive Discovery & Token Economy Protocol
|
|
16
|
+
|
|
17
|
+
- **Architecture Discovery Protocol (ADP):** Seamlessly ingest and adapt to existing (legacy) projects without rigid directory requirements.
|
|
18
|
+
- **Token Economy & Context Management:** Advanced rules to optimize AI context usage, reducing token costs by up to 40%.
|
|
19
|
+
- **Choice-Based Scaffolding:** Empowering users with consent-driven project setup and architectural blueprints.
|
|
20
|
+
- **Modular MCP Ecosystem:** 30+ enterprise-grade intelligence tools for AST-based analysis and security.
|
|
16
21
|
- **Zero Temporary Storage:** All task logs, plans, and state are strictly saved in persistent workspace directories; OS temp directories are completely forbidden.
|
|
17
22
|
- **Session Memory Recovery:** Non-negotiable automatic first-turn state restoration and role initialization across all adapters.
|
|
18
23
|
|
|
@@ -77,7 +82,7 @@ agent-enderun check
|
|
|
77
82
|
|
|
78
83
|
Expected output:
|
|
79
84
|
```
|
|
80
|
-
✅ Framework active (v0.5.
|
|
85
|
+
✅ Framework active (v0.5.8)
|
|
81
86
|
✅ MCP Server ready
|
|
82
87
|
✅ Shared types compiled
|
|
83
88
|
✅ Agent logs initialized
|
|
@@ -484,7 +489,7 @@ agent-enderun check
|
|
|
484
489
|
|
|
485
490
|
Beklenen çıktı:
|
|
486
491
|
```
|
|
487
|
-
✅ Framework aktif (v0.5.
|
|
492
|
+
✅ Framework aktif (v0.5.8)
|
|
488
493
|
✅ MCP Sunucu hazır
|
|
489
494
|
✅ Paylaşılan türler derlenmiş
|
|
490
495
|
✅ Agent logları başlatılmış
|
package/bin/update-contract.js
CHANGED
package/claude.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file is the entry point for Claude. The project's "Supreme Law" and all instructions are located in the following file:
|
|
4
4
|
|
|
5
|
-
👉 **[
|
|
5
|
+
👉 **[{{FRAMEWORK_DIR}}/ENDERUN.md]({{FRAMEWORK_DIR}}/ENDERUN.md)**
|
|
6
6
|
|
|
7
7
|
### 🤖 AGENT DIRECTIVE
|
|
8
8
|
You are ALWAYS operating as `@manager` (Team-Lead) by default — on every message, every turn. The user does NOT need to type `@manager`. Typing a specific agent (e.g. `@backend`) explicitly will override this and activate that specialist role directly. You are responsible for analysis and delegation.
|
|
9
9
|
|
|
10
10
|
⚠️ **CRITICAL STARTUP REQUIREMENT:**
|
|
11
11
|
At the start of every new session/conversation or first turn, before you perform any task or respond to the user:
|
|
12
|
-
1. You **MUST** read
|
|
13
|
-
2. You **MUST** read
|
|
12
|
+
1. You **MUST** read `{{FRAMEWORK_DIR}}/PROJECT_MEMORY.md` immediately (using the `read_project_memory` tool or the most specific file viewing tool) to restore the project's state, active phase, Trace ID, and recent history.
|
|
13
|
+
2. You **MUST** read `{{FRAMEWORK_DIR}}/agents/manager.md` (or the specialist's md file in `{{FRAMEWORK_DIR}}/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
|
|
14
14
|
|
|
15
15
|
Please read the Supreme Law thoroughly before taking any action.
|
package/codex.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file is the entry point for Codex. The project's "Supreme Law" and all instructions are located in the following file:
|
|
4
4
|
|
|
5
|
-
👉 **[
|
|
5
|
+
👉 **[{{FRAMEWORK_DIR}}/ENDERUN.md]({{FRAMEWORK_DIR}}/ENDERUN.md)**
|
|
6
6
|
|
|
7
7
|
### 🤖 AGENT DIRECTIVE
|
|
8
8
|
You are ALWAYS operating as `@manager` (Team-Lead) by default — on every message, every turn. The user does NOT need to type `@manager`. Typing a specific agent (e.g. `@backend`) explicitly will override this and activate that specialist role directly. You are responsible for analysis and delegation.
|
|
9
9
|
|
|
10
10
|
⚠️ **CRITICAL STARTUP REQUIREMENT:**
|
|
11
11
|
At the start of every new session/conversation or first turn, before you perform any task or respond to the user:
|
|
12
|
-
1. You **MUST** read
|
|
13
|
-
2. You **MUST** read
|
|
12
|
+
1. You **MUST** read `{{FRAMEWORK_DIR}}/PROJECT_MEMORY.md` immediately (using the `read_project_memory` tool or the most specific file viewing tool) to restore the project's state, active phase, Trace ID, and recent history.
|
|
13
|
+
2. You **MUST** read `{{FRAMEWORK_DIR}}/agents/manager.md` (or the specialist's md file in `{{FRAMEWORK_DIR}}/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
|
|
14
14
|
|
|
15
15
|
Please read the Supreme Law thoroughly before taking any action.
|
package/cursor.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file is the entry point for Cursor. The project's "Supreme Law" and all instructions are located in the following file:
|
|
4
4
|
|
|
5
|
-
👉 **[
|
|
5
|
+
👉 **[{{FRAMEWORK_DIR}}/ENDERUN.md]({{FRAMEWORK_DIR}}/ENDERUN.md)**
|
|
6
6
|
|
|
7
7
|
### 🤖 AGENT DIRECTIVE
|
|
8
8
|
You are ALWAYS operating as `@manager` (Team-Lead) by default — on every message, every turn. The user does NOT need to type `@manager`. Typing a specific agent (e.g. `@backend`) explicitly will override this and activate that specialist role directly. You are responsible for analysis and delegation.
|
|
9
9
|
|
|
10
10
|
⚠️ **CRITICAL STARTUP REQUIREMENT:**
|
|
11
11
|
At the start of every new session/conversation or first turn, before you perform any task or respond to the user:
|
|
12
|
-
1. You **MUST** read
|
|
13
|
-
2. You **MUST** read
|
|
12
|
+
1. You **MUST** read `{{FRAMEWORK_DIR}}/PROJECT_MEMORY.md` immediately (using the `read_project_memory` tool or the most specific file viewing tool) to restore the project's state, active phase, Trace ID, and recent history.
|
|
13
|
+
2. You **MUST** read `{{FRAMEWORK_DIR}}/agents/manager.md` (or the specialist's md file in `{{FRAMEWORK_DIR}}/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
|
|
14
14
|
|
|
15
15
|
Please read the Supreme Law thoroughly before taking any action.
|
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-enderun",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"docs"
|
|
56
56
|
],
|
|
57
57
|
"scripts": {
|
|
58
|
-
"enderun:build": "npm run build --
|
|
58
|
+
"enderun:build": "npm run build --prefix packages/shared-types && npm run build --prefix packages/framework-mcp",
|
|
59
59
|
"enderun:test": "vitest run",
|
|
60
60
|
"enderun:test:watch": "vitest",
|
|
61
61
|
"enderun:status": "agent-enderun status",
|
|
@@ -76,10 +76,12 @@
|
|
|
76
76
|
"tsx": "^4.19.4",
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
78
|
"typescript-eslint": "^8.59.3",
|
|
79
|
-
"vitest": "^3.0.5"
|
|
79
|
+
"vitest": "^3.0.5",
|
|
80
|
+
"@pandacss/dev": "^0.53.0"
|
|
80
81
|
},
|
|
81
82
|
"enderun": {
|
|
82
|
-
"version": "0.5.
|
|
83
|
-
"initializedAt": "2026-05-
|
|
84
|
-
}
|
|
85
|
-
}
|
|
83
|
+
"version": "0.5.9",
|
|
84
|
+
"initializedAt": "2026-05-19T14:23:38.760Z"
|
|
85
|
+
},
|
|
86
|
+
"dependencies": {}
|
|
87
|
+
}
|
|
File without changes
|
|
@@ -83,15 +83,21 @@ export const contractHandlers = {
|
|
|
83
83
|
try {
|
|
84
84
|
const frameworkDir = getFrameworkDir(projectRoot);
|
|
85
85
|
const apiDocPath = path.join(projectRoot, frameworkDir, "docs/api", `${parsed.data.domain}.md`);
|
|
86
|
-
const
|
|
86
|
+
const sharedTypesDir = path.join(projectRoot, "packages/shared-types/src");
|
|
87
87
|
if (!fs.existsSync(apiDocPath))
|
|
88
88
|
return { content: [{ type: "text", text: `API documentation not found for domain: ${parsed.data.domain}` }] };
|
|
89
|
-
if (!fs.existsSync(
|
|
90
|
-
return { content: [{ type: "text", text: "Shared types
|
|
91
|
-
const
|
|
92
|
-
|
|
89
|
+
if (!fs.existsSync(sharedTypesDir))
|
|
90
|
+
return { content: [{ type: "text", text: "Shared types directory not found." }] };
|
|
91
|
+
const project = new Project();
|
|
92
|
+
project.addSourceFilesAtPaths(path.join(sharedTypesDir, "**/*.ts"));
|
|
93
|
+
const mentionedTypes = Array.from(fs.readFileSync(apiDocPath, "utf-8").matchAll(/`([^`]+)`/g))
|
|
94
|
+
.map(m => m[1])
|
|
95
|
+
.filter(t => /^[A-Z][a-zA-Z0-9]+(DTO|Response|Request|Status|Type)?$/.test(t));
|
|
93
96
|
const uniqueTypes = Array.from(new Set(mentionedTypes));
|
|
94
|
-
const missingTypes = uniqueTypes.filter(t =>
|
|
97
|
+
const missingTypes = uniqueTypes.filter(t => {
|
|
98
|
+
const found = project.getSourceFiles().some(sf => sf.getInterface(t) || sf.getTypeAlias(t) || sf.getEnum(t) || sf.getClass(t));
|
|
99
|
+
return !found;
|
|
100
|
+
});
|
|
95
101
|
return { content: [{ type: "text", text: `### CONTRACT INTEGRITY SHIELD: ${parsed.data.domain.toUpperCase()}\n\n` + `- **Missing/Undefined Types:** ${missingTypes.length > 0 ? `⚠️ ${missingTypes.join(", ")}` : "✅ All types synchronized"}\n\n` + `**Result:** ${missingTypes.length === 0 ? "PASSED" : "FAILED"}` }] };
|
|
96
102
|
}
|
|
97
103
|
catch (error) {
|
|
@@ -180,7 +180,8 @@ export const frameworkHandlers = {
|
|
|
180
180
|
return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK\n\n${output}` }] };
|
|
181
181
|
}
|
|
182
182
|
catch (error) {
|
|
183
|
-
|
|
183
|
+
const err = error;
|
|
184
|
+
return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK (FAILED)\n\n${err.stdout || err.message}` }] };
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
};
|
|
@@ -118,7 +118,7 @@ export const knowledgeHandlers = {
|
|
|
118
118
|
const label = metadata.title || id;
|
|
119
119
|
mermaid += ` ${id}["${label}"]\n`;
|
|
120
120
|
if (metadata.related) {
|
|
121
|
-
const related = metadata.related.replace(/[
|
|
121
|
+
const related = metadata.related.replace(/[[\]]/g, "").split(",");
|
|
122
122
|
related.forEach((r) => {
|
|
123
123
|
mermaid += ` ${id} --> ${r.trim().replace(".md", "")}\n`;
|
|
124
124
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import fs from "fs";
|
|
3
|
-
export const FRAMEWORK_VERSION = "0.5.
|
|
3
|
+
export const FRAMEWORK_VERSION = "0.5.9";
|
|
4
4
|
export function getFrameworkDir(projectRoot) {
|
|
5
5
|
const adapters = [".gemini", ".claude", ".cursor", ".enderun", ".codex"];
|
|
6
6
|
for (const adp of adapters) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-enderun-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "Enterprise-grade MCP Server for AI Agent Framework",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"dist",
|
|
26
26
|
"README.md"
|
|
27
27
|
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"build": "tsc -p tsconfig.json",
|
|
30
33
|
"start": "node dist/index.js",
|
|
@@ -83,13 +83,26 @@ export const contractHandlers = {
|
|
|
83
83
|
try {
|
|
84
84
|
const frameworkDir = getFrameworkDir(projectRoot);
|
|
85
85
|
const apiDocPath = path.join(projectRoot, frameworkDir, "docs/api", `${parsed.data.domain}.md`);
|
|
86
|
-
const
|
|
86
|
+
const sharedTypesDir = path.join(projectRoot, "packages/shared-types/src");
|
|
87
|
+
|
|
87
88
|
if (!fs.existsSync(apiDocPath)) return { content: [{ type: "text", text: `API documentation not found for domain: ${parsed.data.domain}` }] };
|
|
88
|
-
if (!fs.existsSync(
|
|
89
|
-
|
|
90
|
-
const
|
|
89
|
+
if (!fs.existsSync(sharedTypesDir)) return { content: [{ type: "text", text: "Shared types directory not found." }] };
|
|
90
|
+
|
|
91
|
+
const project = new Project();
|
|
92
|
+
project.addSourceFilesAtPaths(path.join(sharedTypesDir, "**/*.ts"));
|
|
93
|
+
|
|
94
|
+
const mentionedTypes = Array.from(fs.readFileSync(apiDocPath, "utf-8").matchAll(/`([^`]+)`/g))
|
|
95
|
+
.map(m => m[1])
|
|
96
|
+
.filter(t => /^[A-Z][a-zA-Z0-9]+(DTO|Response|Request|Status|Type)?$/.test(t));
|
|
97
|
+
|
|
91
98
|
const uniqueTypes = Array.from(new Set(mentionedTypes));
|
|
92
|
-
const missingTypes = uniqueTypes.filter(t =>
|
|
99
|
+
const missingTypes = uniqueTypes.filter(t => {
|
|
100
|
+
const found = project.getSourceFiles().some(sf =>
|
|
101
|
+
sf.getInterface(t) || sf.getTypeAlias(t) || sf.getEnum(t) || sf.getClass(t)
|
|
102
|
+
);
|
|
103
|
+
return !found;
|
|
104
|
+
});
|
|
105
|
+
|
|
93
106
|
return { content: [{ type: "text", text: `### CONTRACT INTEGRITY SHIELD: ${parsed.data.domain.toUpperCase()}\n\n` + `- **Missing/Undefined Types:** ${missingTypes.length > 0 ? `⚠️ ${missingTypes.join(", ")}` : "✅ All types synchronized"}\n\n` + `**Result:** ${missingTypes.length === 0 ? "PASSED" : "FAILED"}` }] };
|
|
94
107
|
} catch (error) {
|
|
95
108
|
return { content: [{ type: "text", text: "Contract verification failed." }] };
|
|
@@ -174,8 +174,9 @@ export const frameworkHandlers = {
|
|
|
174
174
|
const cliPath = path.join(projectRoot, "bin/cli.js");
|
|
175
175
|
const output = execSync(`node ${cliPath} check`, { cwd: projectRoot, encoding: "utf-8", stdio: "pipe" });
|
|
176
176
|
return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK\n\n${output}` }] };
|
|
177
|
-
} catch (error:
|
|
178
|
-
|
|
177
|
+
} catch (error: unknown) {
|
|
178
|
+
const err = error as { stdout?: string; message?: string };
|
|
179
|
+
return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK (FAILED)\n\n${err.stdout || err.message}` }] };
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
};
|
|
@@ -48,15 +48,15 @@ function parseFrontmatter(content: string) {
|
|
|
48
48
|
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
49
49
|
if (!match) return { metadata: {}, body: content };
|
|
50
50
|
const yaml = match[1];
|
|
51
|
-
const metadata: Record<string,
|
|
51
|
+
const metadata: Record<string, string | undefined> = {};
|
|
52
52
|
yaml.split("\n").forEach(line => {
|
|
53
53
|
const [key, ...val] = line.split(":");
|
|
54
54
|
if (key && val.length > 0) metadata[key.trim()] = val.join(":").trim();
|
|
55
55
|
});
|
|
56
56
|
return { metadata, body: content.replace(match[0], "").trim() };
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
export const knowledgeHandlers = {
|
|
59
|
+
export const knowledgeHandlers = {
|
|
60
60
|
search_knowledge_base: async (args: unknown, projectRoot: string) => {
|
|
61
61
|
const parsed = SEARCH_KNOWLEDGE_BASE_ARGS_SCHEMA.safeParse(args ?? {});
|
|
62
62
|
if (!parsed.success) return { content: [{ type: "text", text: "Invalid search query." }] };
|
|
@@ -64,12 +64,12 @@ export const knowledgeHandlers = {
|
|
|
64
64
|
const frameworkDir = getFrameworkDir(projectRoot);
|
|
65
65
|
const kbDir = path.join(projectRoot, frameworkDir, "knowledge");
|
|
66
66
|
if (!fs.existsSync(kbDir)) return { content: [{ type: "text", text: "Knowledge base is empty." }] };
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
const query = parsed.data.query.toLowerCase();
|
|
69
69
|
const results = fs.readdirSync(kbDir).filter(f => f.endsWith(".md")).map(file => {
|
|
70
70
|
const content = fs.readFileSync(path.join(kbDir, file), "utf-8");
|
|
71
71
|
const { metadata, body } = parseFrontmatter(content);
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
const matchesQuery = body.toLowerCase().includes(query) ||
|
|
74
74
|
file.toLowerCase().includes(query) ||
|
|
75
75
|
(metadata.tags && metadata.tags.toLowerCase().includes(query)) ||
|
|
@@ -127,7 +127,7 @@ export const knowledgeHandlers = {
|
|
|
127
127
|
mermaid += ` ${id}["${label}"]\n`;
|
|
128
128
|
|
|
129
129
|
if (metadata.related) {
|
|
130
|
-
const related = metadata.related.replace(/[
|
|
130
|
+
const related = metadata.related.replace(/[[\]]/g, "").split(",");
|
|
131
131
|
related.forEach((r: string) => {
|
|
132
132
|
mermaid += ` ${id} --> ${r.trim().replace(".md", "")}\n`;
|
|
133
133
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
|
|
4
|
-
export const FRAMEWORK_VERSION = "0.5.
|
|
4
|
+
export const FRAMEWORK_VERSION = "0.5.9";
|
|
5
5
|
|
|
6
6
|
export function getFrameworkDir(projectRoot: string): string {
|
|
7
7
|
const adapters = [".gemini", ".claude", ".cursor", ".enderun", ".codex"];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TraceID } from "./brands.js";
|
|
2
|
+
/**
|
|
3
|
+
* API Response Wrappers
|
|
4
|
+
*/
|
|
5
|
+
export interface ApiResponse<T> {
|
|
6
|
+
data: T;
|
|
7
|
+
meta?: {
|
|
8
|
+
requestId: TraceID;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface ApiError {
|
|
13
|
+
error: {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
details?: unknown;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded Type Utility
|
|
3
|
+
*/
|
|
4
|
+
export type Brand<K, T> = K & {
|
|
5
|
+
__brand: T;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Entity IDs (Branded)
|
|
9
|
+
*/
|
|
10
|
+
export type TraceID = Brand<string, "TraceID">;
|
|
11
|
+
export type AgentID = Brand<string, "AgentID">;
|
|
12
|
+
export type ProjectID = Brand<string, "ProjectID">;
|
|
13
|
+
export type UserID = Brand<string, "UserID">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../src/brands.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Phases
|
|
3
|
+
*/
|
|
4
|
+
export declare const PROJECT_PHASES: readonly ["PHASE_0", "PHASE_1", "PHASE_2", "PHASE_3", "PHASE_4"];
|
|
5
|
+
export type ProjectPhase = (typeof PROJECT_PHASES)[number];
|
|
6
|
+
/**
|
|
7
|
+
* Execution Profiles
|
|
8
|
+
*/
|
|
9
|
+
export declare const EXECUTION_PROFILES: readonly ["Lightweight", "Full"];
|
|
10
|
+
export type ExecutionProfile = (typeof EXECUTION_PROFILES)[number];
|
|
11
|
+
/**
|
|
12
|
+
* Task Priorities
|
|
13
|
+
*/
|
|
14
|
+
export declare const TASK_PRIORITIES: readonly ["P0", "P1", "P2", "P3"];
|
|
15
|
+
export type TaskPriority = (typeof TASK_PRIORITIES)[number];
|
|
16
|
+
/**
|
|
17
|
+
* Task Statuses
|
|
18
|
+
*/
|
|
19
|
+
export declare const TASK_STATUSES: readonly ["PENDING", "IN_PROGRESS", "BLOCKED", "COMPLETED", "FAILED"];
|
|
20
|
+
export type TaskStatus = (typeof TASK_STATUSES)[number];
|
|
21
|
+
/**
|
|
22
|
+
* Action Types & Status
|
|
23
|
+
*/
|
|
24
|
+
export declare const ACTION_TYPES: readonly ["CREATE", "MODIFY", "DELETE", "RESEARCH", "ORCHESTRATE"];
|
|
25
|
+
export type ActionType = (typeof ACTION_TYPES)[number];
|
|
26
|
+
export declare const ACTION_STATUSES: readonly ["SUCCESS", "FAILURE", "WAITING"];
|
|
27
|
+
export type ActionStatus = (typeof ACTION_STATUSES)[number];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Phases
|
|
3
|
+
*/
|
|
4
|
+
export const PROJECT_PHASES = ["PHASE_0", "PHASE_1", "PHASE_2", "PHASE_3", "PHASE_4"];
|
|
5
|
+
/**
|
|
6
|
+
* Execution Profiles
|
|
7
|
+
*/
|
|
8
|
+
export const EXECUTION_PROFILES = ["Lightweight", "Full"];
|
|
9
|
+
/**
|
|
10
|
+
* Task Priorities
|
|
11
|
+
*/
|
|
12
|
+
export const TASK_PRIORITIES = ["P0", "P1", "P2", "P3"];
|
|
13
|
+
/**
|
|
14
|
+
* Task Statuses
|
|
15
|
+
*/
|
|
16
|
+
export const TASK_STATUSES = ["PENDING", "IN_PROGRESS", "BLOCKED", "COMPLETED", "FAILED"];
|
|
17
|
+
/**
|
|
18
|
+
* Action Types & Status
|
|
19
|
+
*/
|
|
20
|
+
export const ACTION_TYPES = ["CREATE", "MODIFY", "DELETE", "RESEARCH", "ORCHESTRATE"];
|
|
21
|
+
export const ACTION_STATUSES = ["SUCCESS", "FAILURE", "WAITING"];
|
|
22
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAG/F;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,aAAa,EAAE,MAAM,CAAU,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAGjE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAGnG;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAU,CAAC;AAG/F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC"}
|