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.
Files changed (58) hide show
  1. package/.enderun/PROJECT_MEMORY.md +10 -97
  2. package/.enderun/agents/analyst.md +12 -6
  3. package/.enderun/agents/backend.md +47 -40
  4. package/.enderun/agents/explorer.md +15 -3
  5. package/.enderun/agents/frontend.md +42 -8
  6. package/.enderun/agents/git.md +2 -2
  7. package/.enderun/agents/manager.md +3 -3
  8. package/.enderun/agents/mobile.md +2 -2
  9. package/.enderun/agents/native.md +2 -2
  10. package/.enderun/blueprints/backend/errors/domain-error.ts +84 -0
  11. package/.enderun/blueprints/backend/middleware/error-handler.ts +24 -0
  12. package/.enderun/blueprints/frontend/ui/Button.tsx +60 -0
  13. package/.enderun/blueprints/frontend/ui/Input.tsx +43 -0
  14. package/.enderun/logs/manager.json +1 -0
  15. package/ENDERUN.md +25 -2
  16. package/README.md +9 -4
  17. package/bin/update-contract.js +3 -0
  18. package/claude.md +3 -3
  19. package/codex.md +3 -3
  20. package/cursor.md +3 -3
  21. package/gemini-extension.json +4 -2
  22. package/package.json +9 -7
  23. package/packages/framework-mcp/dist/index.js +0 -0
  24. package/packages/framework-mcp/dist/tools/contract.js +12 -6
  25. package/packages/framework-mcp/dist/tools/framework.js +2 -1
  26. package/packages/framework-mcp/dist/tools/knowledge.js +1 -1
  27. package/packages/framework-mcp/dist/utils.js +1 -1
  28. package/packages/framework-mcp/package.json +4 -1
  29. package/packages/framework-mcp/src/tools/contract.ts +18 -5
  30. package/packages/framework-mcp/src/tools/framework.ts +3 -2
  31. package/packages/framework-mcp/src/tools/knowledge.ts +6 -6
  32. package/packages/framework-mcp/src/utils.ts +1 -1
  33. package/packages/shared-types/dist/api.d.ts +18 -0
  34. package/packages/shared-types/dist/api.js +2 -0
  35. package/packages/shared-types/dist/api.js.map +1 -0
  36. package/packages/shared-types/dist/brands.d.ts +13 -0
  37. package/packages/shared-types/dist/brands.js +2 -0
  38. package/packages/shared-types/dist/brands.js.map +1 -0
  39. package/packages/shared-types/dist/constants.d.ts +27 -0
  40. package/packages/shared-types/dist/constants.js +22 -0
  41. package/packages/shared-types/dist/constants.js.map +1 -0
  42. package/packages/shared-types/dist/index.d.ts +7 -88
  43. package/packages/shared-types/dist/index.js +7 -3
  44. package/packages/shared-types/dist/index.js.map +1 -1
  45. package/packages/shared-types/dist/logs.d.ts +15 -0
  46. package/packages/shared-types/dist/logs.js +2 -0
  47. package/packages/shared-types/dist/logs.js.map +1 -0
  48. package/packages/shared-types/dist/models.d.ts +60 -0
  49. package/packages/shared-types/dist/models.js +2 -0
  50. package/packages/shared-types/dist/models.js.map +1 -0
  51. package/packages/shared-types/package.json +6 -3
  52. package/packages/shared-types/src/api.ts +20 -0
  53. package/packages/shared-types/src/brands.ts +12 -0
  54. package/packages/shared-types/src/constants.ts +34 -0
  55. package/packages/shared-types/src/index.ts +7 -97
  56. package/packages/shared-types/src/logs.ts +16 -0
  57. package/packages/shared-types/src/models.ts +66 -0
  58. 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.7)
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 `.gemini/` etc.) or the project workspace. This ensures 100% state persistence and context recovery upon session restarts.
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.7) — The Supreme AI Governance Framework
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.7: Persistent Memory & Zero-Temp Governance
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.7)
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.7)
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ış
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ /* global console, process */
4
+ /* eslint-disable no-console */
5
+
3
6
  import fs from "fs";
4
7
  import path from "path";
5
8
  import crypto from "crypto";
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
- 👉 **[.claude/ENDERUN.md](.claude/ENDERUN.md)**
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 `.claude/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 `.claude/agents/manager.md` (or the specialist's md file in `.claude/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
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
- 👉 **[.enderun/ENDERUN.md](.enderun/ENDERUN.md)**
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 `.enderun/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 `.enderun/agents/manager.md` (or the specialist's md file in `.enderun/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
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
- 👉 **[.cursor/ENDERUN.md](.cursor/ENDERUN.md)**
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 `.cursor/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 `.cursor/agents/manager.md` (or the specialist's md file in `.cursor/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
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.
@@ -5,7 +5,9 @@
5
5
  "mcpServers": {
6
6
  "agent-enderun": {
7
7
  "command": "node",
8
- "args": ["packages/framework-mcp/dist/index.js"]
8
+ "args": [
9
+ "packages/framework-mcp/dist/index.js"
10
+ ]
9
11
  }
10
12
  }
11
- }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-enderun",
3
- "version": "0.5.7",
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 --workspaces --if-present",
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.7",
83
- "initializedAt": "2026-05-09T13:24:27.472Z"
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 sharedTypesPath = path.join(projectRoot, "packages/shared-types/src/index.ts");
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(sharedTypesPath))
90
- return { content: [{ type: "text", text: "Shared types index.ts not found." }] };
91
- const sourceFile = new Project().addSourceFileAtPath(sharedTypesPath);
92
- const mentionedTypes = Array.from(fs.readFileSync(apiDocPath, "utf-8").matchAll(/`([^`]+)`/g)).map(m => m[1]).filter(t => /^[A-Z][a-zA-Z0-9]+(DTO|Response|Request|Status|Type)?$/.test(t));
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 => !sourceFile.getInterface(t) && !sourceFile.getTypeAlias(t) && !sourceFile.getEnum(t) && !sourceFile.getClass(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
- return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK (FAILED)\n\n${error.stdout || error.message}` }] };
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(/[\[\]]/g, "").split(",");
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.7";
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.7",
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 sharedTypesPath = path.join(projectRoot, "packages/shared-types/src/index.ts");
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(sharedTypesPath)) return { content: [{ type: "text", text: "Shared types index.ts not found." }] };
89
- const sourceFile = new Project().addSourceFileAtPath(sharedTypesPath);
90
- const mentionedTypes = Array.from(fs.readFileSync(apiDocPath, "utf-8").matchAll(/`([^`]+)`/g)).map(m => m[1]).filter(t => /^[A-Z][a-zA-Z0-9]+(DTO|Response|Request|Status|Type)?$/.test(t));
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 => !sourceFile.getInterface(t) && !sourceFile.getTypeAlias(t) && !sourceFile.getEnum(t) && !sourceFile.getClass(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: any) {
178
- return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK (FAILED)\n\n${error.stdout || error.message}` }] };
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, any> = {};
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(/[\[\]]/g, "").split(",");
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.7";
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=api.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=brands.js.map
@@ -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"}