agent-enderun 0.6.1 → 0.6.6
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/BRAIN_DASHBOARD.md +12 -12
- package/.enderun/PROJECT_MEMORY.md +17 -17
- package/.enderun/STATUS.md +11 -11
- package/.enderun/agents/README.md +40 -0
- package/.enderun/agents/analyst.md +238 -31
- package/.enderun/agents/backend.md +428 -18
- package/.enderun/agents/explorer.md +169 -31
- package/.enderun/agents/frontend.md +604 -76
- package/.enderun/agents/git.md +153 -62
- package/.enderun/agents/manager.md +433 -46
- package/.enderun/agents/mobile.md +143 -29
- package/.enderun/agents/native.md +191 -28
- package/.enderun/blueprints/README.md +82 -0
- package/.enderun/blueprints/backend/errors/config/meta.json +11 -0
- package/.enderun/blueprints/backend/errors/domain-error.ts +34 -55
- package/.enderun/docs/README.md +50 -0
- package/.enderun/docs/phase1-reference-app-execution-plan.md +177 -0
- package/.enderun/docs/structure-audit-2026-05-24.md +72 -0
- package/.enderun/knowledge/README.md +22 -0
- package/.enderun/knowledge/database_governance_guidelines.md +118 -0
- package/.enderun/knowledge/deployment_checklist.md +132 -6
- package/.enderun/knowledge/documentation_ownership.md +122 -0
- package/.enderun/knowledge/documentation_ownership_status.md +122 -0
- package/.enderun/knowledge/enterprise_capabilities_reference.md +149 -0
- package/.enderun/knowledge/enterprise_frontend_adaptation.md +232 -0
- package/.enderun/knowledge/enterprise_project_adaptation.md +168 -0
- package/.enderun/knowledge/framework_vs_user_project_boundary.md +52 -0
- package/.enderun/knowledge/frontend_professionalization_guidelines.md +111 -0
- package/.enderun/knowledge/frontend_real_battle_test_protocol.md +162 -0
- package/.enderun/knowledge/hermes_live_test_guidelines.md +90 -0
- package/.enderun/knowledge/manager_authority_audit_enforcement.md +104 -0
- package/.enderun/knowledge/project_scaffold_guidelines.md +99 -0
- package/.enderun/knowledge/reference_application_guidelines.md +90 -0
- package/ENDERUN.md +19 -5
- package/README.md +132 -657
- package/antigravity.md +15 -0
- package/bin/cli.js +92 -27
- package/bin/hermes-sandbox.js +136 -0
- package/docs/README.md +33 -3
- package/docs/action-plan-2026.md +119 -0
- package/docs/getting-started.md +271 -0
- package/docs/roadmap.md +142 -0
- package/framework-mcp/README.md +1 -1
- package/framework-mcp/dist/index.js +0 -0
- package/framework-mcp/dist/schemas.js +6 -0
- package/framework-mcp/dist/tools/academy.js +6 -8
- package/framework-mcp/dist/tools/codebase.js +6 -6
- package/framework-mcp/dist/tools/contract.js +94 -4
- package/framework-mcp/dist/tools/database.js +8 -3
- package/framework-mcp/dist/tools/framework.js +7 -11
- package/framework-mcp/dist/tools/git.js +2 -2
- package/framework-mcp/dist/tools/knowledge.js +5 -5
- package/framework-mcp/dist/tools/memory.js +5 -7
- package/framework-mcp/dist/tools/messages.js +76 -16
- package/framework-mcp/dist/tools/repository.js +4 -4
- package/framework-mcp/dist/tools/scaffold.js +6 -3
- package/framework-mcp/dist/tools/security.js +4 -4
- package/framework-mcp/dist/utils.js +2 -2
- package/framework-mcp/package.json +1 -1
- package/framework-mcp/src/schemas.ts +7 -0
- package/framework-mcp/src/tools/academy.ts +5 -9
- package/framework-mcp/src/tools/codebase.ts +6 -6
- package/framework-mcp/src/tools/contract.ts +114 -4
- package/framework-mcp/src/tools/database.ts +8 -3
- package/framework-mcp/src/tools/framework.ts +8 -11
- package/framework-mcp/src/tools/git.ts +2 -2
- package/framework-mcp/src/tools/knowledge.ts +6 -7
- package/framework-mcp/src/tools/memory.ts +5 -6
- package/framework-mcp/src/tools/messages.ts +94 -28
- package/framework-mcp/src/tools/repository.ts +5 -6
- package/framework-mcp/src/tools/scaffold.ts +9 -6
- package/framework-mcp/src/tools/security.ts +4 -4
- package/framework-mcp/src/utils.ts +19 -2
- package/framework-mcp/tsconfig.json +1 -1
- package/gemini.md +4 -4
- package/package.json +11 -7
- package/panda.config.ts +3 -1
- package/.enderun/benchmarks/.gitkeep +0 -0
- package/.enderun/blueprints/backend/middleware/error-handler.ts +0 -24
- package/.enderun/blueprints/backend/types/api.ts +0 -20
- package/.enderun/blueprints/backend/types/brands.ts +0 -12
- package/.enderun/blueprints/backend/types/constants.ts +0 -34
- package/.enderun/blueprints/backend/types/index.ts +0 -49
- package/.enderun/blueprints/backend/types/logs.ts +0 -16
- package/.enderun/blueprints/backend/types/models.ts +0 -65
- package/.enderun/blueprints/frontend/ui/Button.tsx +0 -60
- package/.enderun/blueprints/frontend/ui/Input.tsx +0 -43
- package/.enderun/monitoring/.gitkeep +0 -0
- package/gemini-extension.json +0 -13
package/antigravity.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Agent Enderun — Antigravity Adapter
|
|
2
|
+
|
|
3
|
+
This file is the entry point for Antigravity CLI. The project's "Supreme Law" and all instructions are located in the following file:
|
|
4
|
+
|
|
5
|
+
👉 **[.antigravitycli/ENDERUN.md](.antigravitycli/ENDERUN.md)**
|
|
6
|
+
|
|
7
|
+
### 🤖 AGENT DIRECTIVE
|
|
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
|
+
|
|
10
|
+
⚠️ **CRITICAL STARTUP REQUIREMENT:**
|
|
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 `.antigravitycli/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 `.antigravitycli/agents/manager.md` (or the specialist's md file in `.antigravitycli/agents/` if explicitly overridden) to load your role-specific rules, workflows, and checklists.
|
|
14
|
+
|
|
15
|
+
Please read the Supreme Law thoroughly before taking any action.
|
package/bin/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ function getPackageVersion() {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function getFrameworkDir() {
|
|
25
|
-
const adapters = [".
|
|
25
|
+
const adapters = [".antigravitycli", ".claude", ".cursor", ".enderun", ".codex", ".gemini"];
|
|
26
26
|
for (const adp of adapters) {
|
|
27
27
|
const fullPath = path.join(targetDir, adp);
|
|
28
28
|
if (fs.existsSync(fullPath) && fs.lstatSync(fullPath).isDirectory()) {
|
|
@@ -225,6 +225,60 @@ function updateGitIgnore(targetPath, frameworkDir = ".enderun") {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Finds the Claude config file path (if it exists).
|
|
230
|
+
*/
|
|
231
|
+
function findClaudeConfigPath() {
|
|
232
|
+
const home = process.env.HOME || process.env.USERPROFILE;
|
|
233
|
+
if (!home) return null;
|
|
234
|
+
|
|
235
|
+
const possiblePaths = [
|
|
236
|
+
path.join(home, ".config", "claude", "config.json"),
|
|
237
|
+
path.join(home, ".claude", "config.json"),
|
|
238
|
+
path.join(home, "Library", "Application Support", "Claude", "config.json"), // macOS Claude Desktop
|
|
239
|
+
path.join(home, "Library", "Application Support", "Claude Code", "config.json"), // macOS Claude Code
|
|
240
|
+
path.join(home, ".config", "Claude", "config.json"), // some Linux setups
|
|
241
|
+
];
|
|
242
|
+
|
|
243
|
+
for (const p of possiblePaths) {
|
|
244
|
+
if (fs.existsSync(p)) {
|
|
245
|
+
return p;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Adds or updates an MCP server entry in Claude's config file.
|
|
253
|
+
*/
|
|
254
|
+
function addMcpServerToClaude(configPath, serverName, serverConfig) {
|
|
255
|
+
try {
|
|
256
|
+
let config = { mcpServers: {} };
|
|
257
|
+
|
|
258
|
+
if (fs.existsSync(configPath)) {
|
|
259
|
+
const content = fs.readFileSync(configPath, "utf8");
|
|
260
|
+
config = JSON.parse(content);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (!config.mcpServers) {
|
|
264
|
+
config.mcpServers = {};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
config.mcpServers[serverName] = serverConfig;
|
|
268
|
+
|
|
269
|
+
// Ensure parent directory exists
|
|
270
|
+
const dir = path.dirname(configPath);
|
|
271
|
+
if (!fs.existsSync(dir)) {
|
|
272
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
276
|
+
return true;
|
|
277
|
+
} catch (err) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
228
282
|
/**
|
|
229
283
|
* Create initial PROJECT_MEMORY.md if missing.
|
|
230
284
|
*/
|
|
@@ -318,13 +372,21 @@ function getPackageManager() {
|
|
|
318
372
|
*/
|
|
319
373
|
async function initCommand(selectedAdapter) {
|
|
320
374
|
const ADAPTERS = {
|
|
321
|
-
|
|
375
|
+
antigravity: ["antigravity.md"],
|
|
322
376
|
claude: ["claude.md"],
|
|
323
377
|
cursor: ["cursor.md"],
|
|
324
378
|
codex: ["codex.md"],
|
|
379
|
+
gemini: ["gemini.md"],
|
|
325
380
|
};
|
|
326
381
|
|
|
327
|
-
|
|
382
|
+
let targetBase;
|
|
383
|
+
if (selectedAdapter === "antigravity") {
|
|
384
|
+
targetBase = ".antigravitycli";
|
|
385
|
+
} else if (selectedAdapter && selectedAdapter !== "codex") {
|
|
386
|
+
targetBase = `.${selectedAdapter}`;
|
|
387
|
+
} else {
|
|
388
|
+
targetBase = ".enderun";
|
|
389
|
+
}
|
|
328
390
|
|
|
329
391
|
const targetFrameworkDir = path.join(targetDir, targetBase);
|
|
330
392
|
|
|
@@ -374,7 +436,7 @@ async function initCommand(selectedAdapter) {
|
|
|
374
436
|
let filesToProcess = [...CORE_FILES];
|
|
375
437
|
if (selectedAdapter) {
|
|
376
438
|
if (!ADAPTERS[selectedAdapter]) {
|
|
377
|
-
console.error(`❌ Invalid adapter: ${selectedAdapter}. Available:
|
|
439
|
+
console.error(`❌ Invalid adapter: ${selectedAdapter}. Available: antigravity, claude, cursor, codex, gemini`);
|
|
378
440
|
process.exit(1);
|
|
379
441
|
}
|
|
380
442
|
filesToProcess.push(...ADAPTERS[selectedAdapter]);
|
|
@@ -507,30 +569,33 @@ async function initCommand(selectedAdapter) {
|
|
|
507
569
|
console.log("\n🛠️ Running smart configuration for adapters...");
|
|
508
570
|
|
|
509
571
|
|
|
510
|
-
if (selectedAdapter === "
|
|
511
|
-
|
|
512
|
-
const geminiExtPath = path.join(targetDir, "gemini-extension.json");
|
|
513
|
-
try {
|
|
514
|
-
const ext = JSON.parse(fs.readFileSync(geminiExtPath, "utf8"));
|
|
515
|
-
ext.mcpServers = {
|
|
516
|
-
"agent-enderun": {
|
|
517
|
-
command: "node",
|
|
518
|
-
args: ["framework-mcp/dist/index.js"]
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
fs.writeFileSync(geminiExtPath, JSON.stringify(ext, null, 2) + "\n");
|
|
522
|
-
console.log("💎 Gemini: MCP server wired up in gemini-extension.json automatically.");
|
|
523
|
-
} catch (e) {
|
|
524
|
-
console.warn("⚠️ Gemini: Could not patch gemini-extension.json for MCP. Wire it up manually.");
|
|
525
|
-
}
|
|
526
|
-
console.log(`💎 Gemini: Adapter gemini.md and ${targetBase}/ folder are ready.`);
|
|
572
|
+
if (selectedAdapter === "antigravity") {
|
|
573
|
+
console.log(`🚀 Antigravity: Adapter antigravity.md and ${targetBase}/ folder are ready.`);
|
|
527
574
|
}
|
|
528
575
|
|
|
529
576
|
if (selectedAdapter === "claude") {
|
|
530
577
|
const mcpPath = path.join(targetDir, "framework-mcp/src/index.ts");
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
578
|
+
const mcpConfig = {
|
|
579
|
+
command: "npx",
|
|
580
|
+
args: ["tsx", mcpPath]
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
const claudeConfigPath = findClaudeConfigPath() || path.join(
|
|
584
|
+
process.env.HOME || process.env.USERPROFILE || "",
|
|
585
|
+
"Library", "Application Support", "Claude", "config.json"
|
|
586
|
+
); // default macOS path if nothing found
|
|
587
|
+
|
|
588
|
+
const success = addMcpServerToClaude(claudeConfigPath, "agent-enderun", mcpConfig);
|
|
589
|
+
|
|
590
|
+
if (success) {
|
|
591
|
+
console.log("✅ Claude: MCP server 'agent-enderun' automatically configured.");
|
|
592
|
+
console.log(` Config file: ${claudeConfigPath}`);
|
|
593
|
+
console.log(" (File was created if it did not exist)");
|
|
594
|
+
} else {
|
|
595
|
+
console.log("\n📝 Claude Code Setup (Automatic failed):");
|
|
596
|
+
console.log("Please run this command manually:");
|
|
597
|
+
console.log(`\x1b[36mclaude config add agent-enderun npx tsx ${mcpPath}\x1b[0m`);
|
|
598
|
+
}
|
|
534
599
|
}
|
|
535
600
|
|
|
536
601
|
if (selectedAdapter === "cursor") {
|
|
@@ -773,8 +838,8 @@ function copyDir(src, dest, skipSet = new Set(), nonDestructive = false, framewo
|
|
|
773
838
|
|
|
774
839
|
const frameworkBase = frameworkDir.startsWith(".") ? frameworkDir.slice(1) : frameworkDir;
|
|
775
840
|
let currentAdapter = frameworkBase;
|
|
776
|
-
if (entry.name.endsWith(".md") && [ "
|
|
777
|
-
currentAdapter = [ "
|
|
841
|
+
if (entry.name.endsWith(".md") && [ "antigravity", "claude", "cursor", "codex", "gemini" ].some(a => entry.name.startsWith(a))) {
|
|
842
|
+
currentAdapter = [ "antigravity", "claude", "cursor", "codex", "gemini" ].find(a => entry.name.startsWith(a));
|
|
778
843
|
}
|
|
779
844
|
|
|
780
845
|
content = content.replace(/\{\{FRAMEWORK_DIR\}\}/g, frameworkDir);
|
|
@@ -2069,7 +2134,7 @@ async function main() {
|
|
|
2069
2134
|
🤖 Agent Enderun CLI (v${FRAMEWORK_VERSION})
|
|
2070
2135
|
|
|
2071
2136
|
Available Commands:
|
|
2072
|
-
init [adapter] Initialize the framework (
|
|
2137
|
+
init [adapter] Initialize the framework (antigravity, claude, cursor, codex, gemini)
|
|
2073
2138
|
create-app <idea> Generate a full-stack starter from natural language
|
|
2074
2139
|
check Full health check
|
|
2075
2140
|
check:security Run security audit scan
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Agent Enderun — Hermes Protocol Stateful Simulation Sandbox
|
|
5
|
+
*
|
|
6
|
+
* Demonstrates:
|
|
7
|
+
* - Scenario 1: Autonomous task delegation.
|
|
8
|
+
* - Scenario 2: High-risk admin action block & managerApproval injection.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
import path from "path";
|
|
13
|
+
|
|
14
|
+
const MESSAGES_DIR = path.resolve("./.enderun/messages");
|
|
15
|
+
const TRACE_ID = "01H7K9P2Q3R4S5T6U7V8W9X0Z2";
|
|
16
|
+
|
|
17
|
+
console.log("🎬 STARTING HERMES PROTOCOL STATEFUL SANDBOX...");
|
|
18
|
+
console.log(`Trace ID: ${TRACE_ID}`);
|
|
19
|
+
console.log("--------------------------------------------------");
|
|
20
|
+
|
|
21
|
+
// Ensure messages directory exists
|
|
22
|
+
if (!fs.existsSync(MESSAGES_DIR)) {
|
|
23
|
+
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Clean up previous test messages
|
|
27
|
+
const cleanInbox = (agent) => {
|
|
28
|
+
const p = path.join(MESSAGES_DIR, `${agent}.json`);
|
|
29
|
+
if (fs.existsSync(p)) fs.unlinkSync(p);
|
|
30
|
+
};
|
|
31
|
+
cleanInbox("backend");
|
|
32
|
+
cleanInbox("manager");
|
|
33
|
+
|
|
34
|
+
function sendMessage(from, to, content, category = "INFO") {
|
|
35
|
+
const messagePath = path.join(MESSAGES_DIR, `${to}.json`);
|
|
36
|
+
const messages = fs.existsSync(messagePath) ? JSON.parse(fs.readFileSync(messagePath, "utf-8")) : [];
|
|
37
|
+
|
|
38
|
+
const msg = {
|
|
39
|
+
timestamp: new Date().toISOString(),
|
|
40
|
+
from,
|
|
41
|
+
to,
|
|
42
|
+
traceId: TRACE_ID,
|
|
43
|
+
category,
|
|
44
|
+
priority: "HIGH",
|
|
45
|
+
content,
|
|
46
|
+
status: "PENDING"
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
messages.push(msg);
|
|
50
|
+
fs.writeFileSync(messagePath, JSON.stringify(messages, null, 2));
|
|
51
|
+
console.log(`📡 [Hermes Msg] ${from} ➡️ ${to} [${category}]: "${content}"`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function readInbox(agent) {
|
|
55
|
+
const messagePath = path.join(MESSAGES_DIR, `${agent}.json`);
|
|
56
|
+
if (!fs.existsSync(messagePath)) return [];
|
|
57
|
+
|
|
58
|
+
const messages = JSON.parse(fs.readFileSync(messagePath, "utf-8"));
|
|
59
|
+
const pending = messages.filter(m => m.status === "PENDING" || m.status === "READ");
|
|
60
|
+
|
|
61
|
+
// Mark as read
|
|
62
|
+
const updated = messages.map(m => m.status === "PENDING" ? { ...m, status: "READ" } : m);
|
|
63
|
+
fs.writeFileSync(messagePath, JSON.stringify(updated, null, 2));
|
|
64
|
+
|
|
65
|
+
return pending;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function updateStatus(agent, traceId, status) {
|
|
69
|
+
const messagePath = path.join(MESSAGES_DIR, `${agent}.json`);
|
|
70
|
+
if (!fs.existsSync(messagePath)) return;
|
|
71
|
+
|
|
72
|
+
const messages = JSON.parse(fs.readFileSync(messagePath, "utf-8"));
|
|
73
|
+
const updated = messages.map(m => m.traceId === traceId ? { ...m, status } : m);
|
|
74
|
+
fs.writeFileSync(messagePath, JSON.stringify(updated, null, 2));
|
|
75
|
+
console.log(`🔒 [Hermes LifeCycle] Message on @${agent} marked as: ${status}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// --- STEP 1: @manager Delegates Task (Scenario 1) ---
|
|
79
|
+
console.log("\n[Step 1: Task Scaffolding & Briefing Delegation]");
|
|
80
|
+
sendMessage("manager", "backend", "Upgrade User 42 role to SuperAdmin inside target database.", "DELEGATION");
|
|
81
|
+
|
|
82
|
+
// --- STEP 2: @backend Reads & Detects High-Risk Action without approval (Scenario 2) ---
|
|
83
|
+
console.log("\n[Step 2: @backend Inbox Check & High-Risk Guard Trigger]");
|
|
84
|
+
const backendInbox1 = readInbox("backend");
|
|
85
|
+
const taskMsg = backendInbox1.find(m => m.category === "DELEGATION");
|
|
86
|
+
|
|
87
|
+
if (taskMsg) {
|
|
88
|
+
console.log(`⚙️ @backend is processing delegation trace: ${taskMsg.traceId}`);
|
|
89
|
+
console.log("⚠️ @backend security check: 'Upgrade User 42 role' detected as High-Risk Administrative Action!");
|
|
90
|
+
console.log("❌ @backend security block: Action rejected due to missing 'managerApproval' signature payload!");
|
|
91
|
+
|
|
92
|
+
sendMessage("backend", "manager", "ALERT: Cannot upgrade role for User 42. High-risk administrative action requires dynamic 'managerApproval' token.", "ALERT");
|
|
93
|
+
updateStatus("backend", TRACE_ID, "REJECTED");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// --- STEP 3: @manager Processes Block, Generates Approval Token, Re-sends msg ---
|
|
97
|
+
console.log("\n[Step 3: @manager Token Generation & Re-Delegation]");
|
|
98
|
+
const managerInbox = readInbox("manager");
|
|
99
|
+
const alertMsg = managerInbox.find(m => m.category === "ALERT");
|
|
100
|
+
|
|
101
|
+
if (alertMsg) {
|
|
102
|
+
console.log(`💡 @manager received alert: "${alertMsg.content}"`);
|
|
103
|
+
console.log("🔐 @manager Dynamic Key Signing active...");
|
|
104
|
+
|
|
105
|
+
const approvalToken = {
|
|
106
|
+
approved: true,
|
|
107
|
+
traceId: TRACE_ID,
|
|
108
|
+
approvedBy: "@manager",
|
|
109
|
+
approvedAt: new Date().toISOString(),
|
|
110
|
+
reason: "Authorized Role Upgrade for Enterprise Compliance",
|
|
111
|
+
riskLevel: "Critical",
|
|
112
|
+
rollbackPlan: "Demote role back to standard User via database rollback script."
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
console.log("✅ managerApproval Token generated successfully:", JSON.stringify(approvalToken, null, 2));
|
|
116
|
+
|
|
117
|
+
sendMessage("manager", "backend", `APPROVED: Here is the signed token: ${JSON.stringify(approvalToken)}`, "DELEGATION");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// --- STEP 4: @backend Receives Approval, Executes Simulated DDL/DML, Completes lifecycle ---
|
|
121
|
+
console.log("\n[Step 4: @backend final validation and execution]");
|
|
122
|
+
const backendInbox2 = readInbox("backend");
|
|
123
|
+
const approvedMsg = backendInbox2.find(m => m.category === "DELEGATION" && m.content.startsWith("APPROVED:"));
|
|
124
|
+
|
|
125
|
+
if (approvedMsg) {
|
|
126
|
+
console.log("📥 @backend received approval token.");
|
|
127
|
+
console.log("🛡️ @backend validation: managerApproval signature MATCHED.");
|
|
128
|
+
console.log("🚀 @backend execution: Running mock SQL transaction... 'UPDATE users SET role = 'SuperAdmin' WHERE id = 42;'");
|
|
129
|
+
console.log("📝 @backend logging: Audit log record generated with Trace ID.");
|
|
130
|
+
|
|
131
|
+
sendMessage("backend", "manager", "SUCCESS: User 42 successfully upgraded to SuperAdmin. Trace record finalized.", "INFO");
|
|
132
|
+
updateStatus("backend", TRACE_ID, "COMPLETED");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
console.log("\n--------------------------------------------------");
|
|
136
|
+
console.log("🎉 HERMES STATEFUL SIMULATION COMPLETED SUCCESSFULLY!");
|
package/docs/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
# Project Documentation
|
|
1
|
+
# Project Documentation / Proje Dokümantasyonu
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
English | [Türkçe](#türkçe)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# English
|
|
8
|
+
|
|
9
|
+
This folder is managed by **Agent Enderun agents** and contains documentation generated for **your project** — not the framework itself.
|
|
5
10
|
|
|
6
11
|
## What Goes Here
|
|
7
12
|
|
|
@@ -21,3 +26,28 @@ generated for **your project** — not the framework itself.
|
|
|
21
26
|
| `/.enderun/docs/` | **Framework** configuration — tech-stack, security policy, privacy policy |
|
|
22
27
|
|
|
23
28
|
> Agents will populate this folder automatically during **PHASE_2 (Core Development)**.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# Türkçe
|
|
33
|
+
|
|
34
|
+
Bu klasör **Agent Enderun ajanları** tarafından yönetilir ve framework'ün kendisi için değil, **sizin projeniz** için oluşturulan dokümanları içerir.
|
|
35
|
+
|
|
36
|
+
## Burada Neler Var?
|
|
37
|
+
|
|
38
|
+
| Dosya | Sahip Ajan | Açıklama |
|
|
39
|
+
| :--- | :--- | :--- |
|
|
40
|
+
| `architecture.md` | @backend | Sistem mimarisi ve veri akış diyagramları |
|
|
41
|
+
| `api-reference.md` | @backend | Genel API uç noktaları ve kullanım örnekleri |
|
|
42
|
+
| `components.md` | @frontend | UI bileşen kataloğu ve kullanım kılavuzları |
|
|
43
|
+
| `deployment.md` | @manager | Dağıtım adımları ve ortam kurulumu |
|
|
44
|
+
| `decisions.md` | @manager | Mimari Karar Kayıtları (ADRs) |
|
|
45
|
+
|
|
46
|
+
## `.enderun/docs/` Klasöründen Farkı
|
|
47
|
+
|
|
48
|
+
| Yol | Amaç |
|
|
49
|
+
| :--- | :--- |
|
|
50
|
+
| `/docs/` | **Sizin projenizin** dokümantasyonu — özellikler geliştirildikçe ajanlar tarafından yazılır |
|
|
51
|
+
| `/.enderun/docs/` | **Framework** konfigürasyonu — tech-stack, güvenlik politikası, gizlilik politikası |
|
|
52
|
+
|
|
53
|
+
> Ajanlar bu klasörü **PHASE_2 (Core Development)** sırasında otomatik olarak dolduracaktır.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Agent Enderun — Strategic Action Plan 2026 (v0.6.6+) / Stratejik Eylem Planı
|
|
2
|
+
|
|
3
|
+
**Owner / Sorumlu:** @manager
|
|
4
|
+
**Status / Durum:** APPROVED & ACTIVE
|
|
5
|
+
**Strategic Focus:** Moving from "Governance on Paper" to "Governance in Practice"
|
|
6
|
+
|
|
7
|
+
[English](#english) | [Türkçe](#türkçe)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# English
|
|
12
|
+
|
|
13
|
+
This strategic document defines the concrete, week-by-week implementation plan to address the critical gaps identified in the v0.6.6 Gap Analysis. It focuses on the three highest-priority phases: building the reference application, executing the Hermes protocol live tests, and professionalizing the frontend/backend engineering standards.
|
|
14
|
+
|
|
15
|
+
## Phase 1: Production-Grade Reference Application (`apps/`)
|
|
16
|
+
**Timeline:** Weeks 1–3
|
|
17
|
+
**Goal:** Prove the constitutional governance framework and kurumsal (enterprise) CRUD constraints in a functional full-stack monorepo application.
|
|
18
|
+
|
|
19
|
+
### 📂 Directory Architecture
|
|
20
|
+
```text
|
|
21
|
+
apps/
|
|
22
|
+
├── backend/ # Fastify API Server
|
|
23
|
+
│ ├── src/
|
|
24
|
+
│ │ ├── index.ts # App entry point
|
|
25
|
+
│ │ ├── types/ # Generated Type Contracts (Branded)
|
|
26
|
+
│ │ ├── db/ # Kysely Migrations & Schema
|
|
27
|
+
│ │ ├── routes/ # Normal CRUD & High-Risk Admin Routes
|
|
28
|
+
│ │ └── plugins/ # Auth & managerApproval Verification
|
|
29
|
+
│ └── contract.version.json # Generated contract hash & version
|
|
30
|
+
│
|
|
31
|
+
└── web/ # React + Vite Client (Zero UI Library)
|
|
32
|
+
├── src/
|
|
33
|
+
│ ├── main.tsx
|
|
34
|
+
│ ├── styled-system/ # Panda CSS zero-runtime styles
|
|
35
|
+
│ ├── types/ # Local copies of API Type Contracts
|
|
36
|
+
│ ├── components/ui/ # Resuable Panda CSS components (no external libs)
|
|
37
|
+
│ ├── hooks/ #useListPage, useDetailPage, useFormPage
|
|
38
|
+
│ └── pages/ # Layouts and logic
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 🛠️ Concrete Feature Scope
|
|
42
|
+
To keep the scope narrow but technically exhaustive, the reference application will implement a **User & Permissions Management Dashboard**:
|
|
43
|
+
|
|
44
|
+
1. **Normal CRUD (Standard Business Logic):**
|
|
45
|
+
- User profile update, view active tasks, and change preferences.
|
|
46
|
+
- Requires regular authentication token and standard agent checklists.
|
|
47
|
+
|
|
48
|
+
2. **High-Risk Administrative Action (Enforced Governance):**
|
|
49
|
+
- **Action:** Upgrading a user's system role to `SuperAdmin` or resetting the system configurations.
|
|
50
|
+
- **Enforcement:** The backend API **must** require:
|
|
51
|
+
- The `isHighRiskAdminAction: true` flag in the payload.
|
|
52
|
+
- A valid `managerApproval` object signed dynamically by `@manager` during the briefing.
|
|
53
|
+
- **UI Warning:** The frontend must render a prominent security modal, coordinate the briefing request via Hermes, and append the approval payload before dispatching the request.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Phase 2: Hermes Messaging Protocol Live Test Program
|
|
58
|
+
**Timeline:** Weeks 4–6
|
|
59
|
+
**Goal:** Battle-test multi-agent autonomous coordination across 4 mandatory scenarios in the local `messages/` sandbox.
|
|
60
|
+
|
|
61
|
+
```mermaid
|
|
62
|
+
sequenceDiagram
|
|
63
|
+
autonumber
|
|
64
|
+
actor Developer
|
|
65
|
+
participant Manager as @manager
|
|
66
|
+
participant Backend as @backend
|
|
67
|
+
participant Frontend as @frontend
|
|
68
|
+
|
|
69
|
+
Developer->>Manager: "Upgrade User 42 to Admin" (High-Risk)
|
|
70
|
+
activate Manager
|
|
71
|
+
Manager->>Backend: Hermes msg: Assess database schema & role payload
|
|
72
|
+
activate Backend
|
|
73
|
+
Backend-->>Manager: Hermes msg: Type contract generated & verified
|
|
74
|
+
deactivate Backend
|
|
75
|
+
Manager->>Frontend: Hermes msg: Dispatch UI component & slot specs
|
|
76
|
+
activate Frontend
|
|
77
|
+
Frontend-->>Manager: Hermes msg: Responsive layout & accessibility check complete
|
|
78
|
+
deactivate Frontend
|
|
79
|
+
Manager-->>Developer: Final Briefing + managerApproval signed token
|
|
80
|
+
deactivate Manager
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 🧪 The 4 Mandatory Scenarios
|
|
84
|
+
1. **Scenario 1: Autonomously Delegating Features**
|
|
85
|
+
- `@manager` receives a trace, generates the architectural plan, and dispatches precise, localized briefings to `@backend` and `@frontend` with zero manual intervention.
|
|
86
|
+
2. **Scenario 2: Coordinating High-Risk Operations**
|
|
87
|
+
- `@backend` refuses to write a delete endpoint until `@manager` explicitly logs the `managerApproval` briefing token in `PROJECT_MEMORY.md`.
|
|
88
|
+
3. **Scenario 3: Resolving API Contract Drift**
|
|
89
|
+
- `@backend` modifies a property in the API schema; `@analyst` detects the drift, notifies `@frontend` via Hermes, and `@frontend` surgically updates the local types to match.
|
|
90
|
+
4. **Scenario 4: Live Knowledge Sharing**
|
|
91
|
+
- `@explorer` discovers a performance bottleneck or accessibility violation in `apps/web/` and directly updates the agent knowledge base, which `@frontend` immediately adopts in the next turn.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Phase 3: `@frontend` & `@backend` Professionalization & Testing
|
|
96
|
+
**Timeline:** Weeks 7–9
|
|
97
|
+
**Goal:** Elevate engineering maturity levels from 6.5 to $\ge 9.0$ through mandatory quality gates.
|
|
98
|
+
|
|
99
|
+
### ♿ @frontend Standards Enforcement
|
|
100
|
+
- **Accessibility (WCAG 2.2 AA) Audit Gate:** All components must pass the visual focus rings, logical tab order, 44x44px touch targets, and semantic ARIA landmarks checks.
|
|
101
|
+
- **Performance Budgets Gate:** Verify that Largest Contentful Paint (LCP) is `< 2.5s`, Cumulative Layout Shift (CLS) is `< 0.1`, and initial gzipped bundle size remains `< 250KB`.
|
|
102
|
+
|
|
103
|
+
### 🧪 Test Coverage & Quality Gates
|
|
104
|
+
- **Shared Components Coverage:** Minimum **70%** code coverage using Vitest + React Testing Library.
|
|
105
|
+
- **Custom Business Hooks Coverage:** Minimum **85%** code coverage.
|
|
106
|
+
- **Contract Integration Tests:** Automated Vitest checks to verify that `apps/backend/contract.version.json` matches the hashes of frontend type copies on every PR.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
# Türkçe
|
|
111
|
+
|
|
112
|
+
Bu stratejik belge, v0.6.6 Gap Analizinde tespit edilen kritik eksiklikleri kapatmak üzere hazırlanmış haftalık somut eylem planıdır.
|
|
113
|
+
|
|
114
|
+
**Özet:**
|
|
115
|
+
- Faz 1: Referans uygulama + Kurumsal CRUD + Hermes kanıtı
|
|
116
|
+
- Faz 2: 4 zorunlu Hermes Live Test senaryosu
|
|
117
|
+
- Faz 3: @frontend ve @backend profesyonelleşme + kalite kapıları
|
|
118
|
+
|
|
119
|
+
Detaylı plan ve teknik kapsam İngilizce bölümde yer almaktadır.
|