agent-enderun 0.5.8 → 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 -130
- package/.enderun/agents/analyst.md +11 -5
- package/.enderun/agents/backend.md +46 -39
- package/.enderun/agents/explorer.md +14 -2
- package/.enderun/agents/frontend.md +41 -7
- package/.enderun/agents/git.md +1 -1
- package/.enderun/agents/manager.md +1 -1
- package/.enderun/agents/mobile.md +1 -1
- package/.enderun/agents/native.md +1 -1
- 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 -18
- package/ENDERUN.md +24 -1
- package/README.md +7 -2
- package/bin/update-contract.js +3 -0
- package/package.json +2 -2
- 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 +4 -1
- 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,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
|
+
};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"timestamp": "2026-05-19T14:14:17.722Z",
|
|
4
|
-
"agent": "manager",
|
|
5
|
-
"action": "Fixing framework persistence and configuration",
|
|
6
|
-
"requestId": "01KR6EJA6GG3RPS849097KS37Q",
|
|
7
|
-
"status": "SUCCESS",
|
|
8
|
-
"summary": "Updated gemini-extension.json, gemini.md and resolved ENDERUN.md placeholders."
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"timestamp": "2026-05-19T14:46:49.828Z",
|
|
12
|
-
"agent": "manager",
|
|
13
|
-
"action": "Framework Restoration",
|
|
14
|
-
"requestId": "01KR6EJA6GG3RPS849097KS37Q",
|
|
15
|
-
"status": "SUCCESS",
|
|
16
|
-
"summary": "Restored framework-mcp and verified via link test."
|
|
17
|
-
}
|
|
18
|
-
]
|
|
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
|
|
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
|
|
package/bin/update-contract.js
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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@pandacss/dev": "^0.53.0"
|
|
81
81
|
},
|
|
82
82
|
"enderun": {
|
|
83
|
-
"version": "0.5.
|
|
83
|
+
"version": "0.5.9",
|
|
84
84
|
"initializedAt": "2026-05-19T14:23:38.760Z"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {}
|
|
@@ -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"}
|
|
@@ -1,92 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent Enderun — Shared Types
|
|
2
|
+
* Agent Enderun — Shared Types (Modular)
|
|
3
3
|
*
|
|
4
4
|
* This file is the Single Source of Truth for all Backend and Frontend communication.
|
|
5
|
-
* All
|
|
5
|
+
* All modules are exported from here for central access.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Entity IDs (Branded)
|
|
15
|
-
*/
|
|
16
|
-
export type TraceID = Brand<string, "TraceID">;
|
|
17
|
-
export type AgentID = Brand<string, "AgentID">;
|
|
18
|
-
export type ProjectID = Brand<string, "ProjectID">;
|
|
19
|
-
export type UserID = Brand<string, "UserID">;
|
|
20
|
-
/**
|
|
21
|
-
* Domain Models
|
|
22
|
-
*/
|
|
23
|
-
export interface User {
|
|
24
|
-
id: UserID;
|
|
25
|
-
email: string;
|
|
26
|
-
fullName: string;
|
|
27
|
-
role: "ADMIN" | "DEVELOPER" | "VIEWER";
|
|
28
|
-
createdAt: string;
|
|
29
|
-
}
|
|
30
|
-
export interface UserProfile extends User {
|
|
31
|
-
avatarUrl?: string;
|
|
32
|
-
bio?: string;
|
|
33
|
-
preferences: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Project Status Types
|
|
37
|
-
*/
|
|
38
|
-
export type ProjectPhase = "PHASE_0" | "PHASE_1" | "PHASE_2" | "PHASE_3" | "PHASE_4";
|
|
39
|
-
export type ExecutionProfile = "Lightweight" | "Full";
|
|
40
|
-
export interface ProjectStatus {
|
|
41
|
-
phase: ProjectPhase;
|
|
42
|
-
profile: ExecutionProfile;
|
|
43
|
-
lastUpdate: string;
|
|
44
|
-
activeTraceId: TraceID | null;
|
|
45
|
-
blockers: string[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Task Management Types
|
|
49
|
-
*/
|
|
50
|
-
export type TaskPriority = "P0" | "P1" | "P2" | "P3";
|
|
51
|
-
export type TaskStatus = "PENDING" | "IN_PROGRESS" | "BLOCKED" | "COMPLETED" | "FAILED";
|
|
52
|
-
export interface Task {
|
|
53
|
-
id: TraceID;
|
|
54
|
-
description: string;
|
|
55
|
-
agent: AgentID;
|
|
56
|
-
priority: TaskPriority;
|
|
57
|
-
status: TaskStatus;
|
|
58
|
-
createdAt: string;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Audit & Agent Logging Types
|
|
63
|
-
*/
|
|
64
|
-
export type ActionType = "CREATE" | "MODIFY" | "DELETE" | "RESEARCH" | "ORCHESTRATE";
|
|
65
|
-
export type ActionStatus = "SUCCESS" | "FAILURE" | "WAITING";
|
|
66
|
-
export interface AgentActionLog {
|
|
67
|
-
timestamp: string;
|
|
68
|
-
agent: AgentID;
|
|
69
|
-
action: ActionType;
|
|
70
|
-
requestId: TraceID | "—";
|
|
71
|
-
status: ActionStatus;
|
|
72
|
-
summary: string;
|
|
73
|
-
files?: string[];
|
|
74
|
-
details?: Record<string, unknown>;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* API Response Wrappers
|
|
78
|
-
*/
|
|
79
|
-
export interface ApiResponse<T> {
|
|
80
|
-
data: T;
|
|
81
|
-
meta?: {
|
|
82
|
-
requestId: TraceID;
|
|
83
|
-
timestamp: string;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export interface ApiError {
|
|
87
|
-
error: {
|
|
88
|
-
code: string;
|
|
89
|
-
message: string;
|
|
90
|
-
details?: unknown;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
7
|
+
export * from "./brands.js";
|
|
8
|
+
export * from "./constants.js";
|
|
9
|
+
export * from "./models.js";
|
|
10
|
+
export * from "./api.js";
|
|
11
|
+
export * from "./logs.js";
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent Enderun — Shared Types
|
|
2
|
+
* Agent Enderun — Shared Types (Modular)
|
|
3
3
|
*
|
|
4
4
|
* This file is the Single Source of Truth for all Backend and Frontend communication.
|
|
5
|
-
* All
|
|
5
|
+
* All modules are exported from here for central access.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export * from "./brands.js";
|
|
8
|
+
export * from "./constants.js";
|
|
9
|
+
export * from "./models.js";
|
|
10
|
+
export * from "./api.js";
|
|
11
|
+
export * from "./logs.js";
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TraceID, AgentID } from "./brands.js";
|
|
2
|
+
import { ActionType, ActionStatus } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* Audit & Agent Logging Types
|
|
5
|
+
*/
|
|
6
|
+
export interface AgentActionLog {
|
|
7
|
+
timestamp: string;
|
|
8
|
+
agent: AgentID;
|
|
9
|
+
action: ActionType;
|
|
10
|
+
requestId: TraceID | "—";
|
|
11
|
+
status: ActionStatus;
|
|
12
|
+
summary: string;
|
|
13
|
+
files?: string[];
|
|
14
|
+
details?: Record<string, unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { UserID, TraceID, AgentID } from "./brands.js";
|
|
2
|
+
import { ProjectPhase, ExecutionProfile, TaskPriority, TaskStatus } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* Base Entity Fields
|
|
5
|
+
* All domain entities should include these fields.
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseEntity {
|
|
8
|
+
id: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
deletedAt?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Audit Log Model
|
|
15
|
+
*/
|
|
16
|
+
export interface AuditLog extends BaseEntity {
|
|
17
|
+
entityName: string;
|
|
18
|
+
entityId: string;
|
|
19
|
+
action: "CREATE" | "UPDATE" | "DELETE" | "RESTORE";
|
|
20
|
+
userId: UserID;
|
|
21
|
+
previousState?: Record<string, unknown> | null;
|
|
22
|
+
newState?: Record<string, unknown> | null;
|
|
23
|
+
traceId: TraceID;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* User Model
|
|
27
|
+
*/
|
|
28
|
+
export interface User extends BaseEntity {
|
|
29
|
+
id: UserID;
|
|
30
|
+
email: string;
|
|
31
|
+
fullName: string;
|
|
32
|
+
role: "ADMIN" | "DEVELOPER" | "VIEWER";
|
|
33
|
+
}
|
|
34
|
+
export interface UserProfile extends User {
|
|
35
|
+
avatarUrl?: string;
|
|
36
|
+
bio?: string;
|
|
37
|
+
preferences: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Project Status
|
|
41
|
+
*/
|
|
42
|
+
export interface ProjectStatus {
|
|
43
|
+
phase: ProjectPhase;
|
|
44
|
+
profile: ExecutionProfile;
|
|
45
|
+
lastUpdate: string;
|
|
46
|
+
activeTraceId: TraceID | null;
|
|
47
|
+
blockers: string[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Task Model
|
|
51
|
+
*/
|
|
52
|
+
export interface Task {
|
|
53
|
+
id: TraceID;
|
|
54
|
+
description: string;
|
|
55
|
+
agent: AgentID;
|
|
56
|
+
priority: TaskPriority;
|
|
57
|
+
status: TaskStatus;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":""}
|