agent-enderun 0.8.8 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.enderun/BRAIN_DASHBOARD.md +5 -5
- package/{ENDERUN.md → .enderun/ENDERUN.md} +4 -2
- package/.enderun/PROJECT_MEMORY.md +32 -43
- package/.enderun/STATUS.md +25 -28
- package/.enderun/agents/agent_army_schema.json +29 -7
- package/.enderun/agents/backend.md +48 -39
- package/.enderun/agents/database.md +55 -0
- package/.enderun/agents/devops.md +30 -17
- package/.enderun/agents/explorer.md +5 -5
- package/.enderun/agents/frontend.md +97 -76
- package/.enderun/agents/git.md +4 -4
- package/.enderun/agents/manager.md +68 -59
- package/.enderun/agents/mobile.md +4 -4
- package/.enderun/agents/native.md +106 -0
- package/.enderun/agents/quality.md +122 -0
- package/.enderun/agents/schema/agent-lifecycle-schema.json +29 -8
- package/.enderun/cli-commands.json +7 -3
- package/.enderun/config.json +8 -2
- package/.enderun/knowledge/SHIM_TEMPLATE.md +25 -0
- package/.enderun/knowledge/context_boundary_rules.md +57 -0
- package/.enderun/knowledge/corporate-governance/high-risk-action-approval-flow.md +29 -0
- package/.enderun/knowledge/documentation_ownership.md +53 -0
- package/.enderun/knowledge/eslint-standards.md +63 -0
- package/.enderun/knowledge/frontend_professionalization_guidelines.md +7 -7
- package/.enderun/knowledge/hermes_live_test_guidelines.md +5 -5
- package/.enderun/knowledge/hermes_protocol.md +1 -1
- package/.enderun/knowledge/lessons-learned.md +14 -0
- package/.enderun/knowledge/manager_authority_audit_enforcement.md +10 -10
- package/.enderun/knowledge/project_scaffold_guidelines.md +4 -4
- package/.enderun/knowledge/reference_application_guidelines.md +6 -6
- package/.enderun/mcp_config.json +9 -0
- package/.enderun/memory-graph/agent-contexts/backend.json +1 -1
- package/.enderun/memory-graph/agent-contexts/devops.json +1 -1
- package/.enderun/memory-graph/agent-contexts/explorer.json +1 -1
- package/.enderun/memory-graph/agent-contexts/frontend.json +1 -1
- package/.enderun/memory-graph/agent-contexts/git.json +1 -1
- package/.enderun/memory-graph/agent-contexts/manager.json +1 -1
- package/.enderun/memory-graph/agent-contexts/mobile.json +1 -1
- package/.enderun/memory-graph/agent-contexts/native.json +1 -0
- package/.enderun/memory-graph/agent-contexts/quality.json +1 -0
- package/.enderun/memory-graph/graph.json +123 -15
- package/.enderun/memory-graph/shared-facts.json +26 -31
- package/.enderun/queue/README.md +13 -13
- package/README.md +171 -393
- package/agent.md +25 -0
- package/bin/cli.js +10 -10
- package/bin/init-check.js +69 -0
- package/bin/update-contract.js +57 -38
- package/bin/validate-agent-army.js +38 -13
- package/claude.md +14 -8
- package/docs/README.md +24 -16
- package/docs/architecture/README.md +9 -0
- package/docs/architecture/standards/data-fetching-patterns.md +13 -0
- package/docs/architecture/standards/design-system.md +31 -0
- package/docs/architecture/standards/logging.md +7 -0
- package/docs/architecture/standards/tech-stack.md +9 -0
- package/docs/getting-started.md +9 -259
- package/docs/user/README.md +35 -0
- package/docs/user/action-plan-2026.md +9 -0
- package/docs/user/getting-started.md +13 -0
- package/docs/user/roadmap.md +13 -0
- package/eslint.config.js +68 -0
- package/framework-mcp/dist/index.js +178 -24
- package/framework-mcp/package.json +6 -33
- package/framework-mcp/tsconfig.json +3 -6
- package/gemini.md +12 -6
- package/grok.md +25 -0
- package/package.json +13 -5
- package/panda.config.ts +86 -86
- package/src/cli/adapters.ts +208 -0
- package/src/cli/commands/app.ts +38 -0
- package/src/cli/commands/check.ts +87 -0
- package/src/cli/commands/compliance.ts +55 -0
- package/src/cli/commands/contract.ts +45 -0
- package/src/cli/commands/explorer.ts +45 -0
- package/src/cli/commands/git.ts +39 -0
- package/src/cli/commands/init.ts +272 -0
- package/src/cli/commands/knowledge.ts +44 -0
- package/src/cli/commands/lint.ts +25 -0
- package/src/cli/commands/log.ts +37 -0
- package/src/cli/commands/memory.ts +78 -0
- package/src/cli/commands/orchestrate.ts +111 -0
- package/src/cli/commands/script.ts +20 -0
- package/src/cli/commands/security.ts +38 -0
- package/src/cli/commands/status.ts +59 -0
- package/src/cli/commands/trace.ts +46 -0
- package/src/cli/index.ts +74 -2155
- package/src/cli/utils/app.ts +764 -0
- package/src/cli/utils/claude.ts +56 -0
- package/src/cli/utils/fs.ts +139 -0
- package/src/cli/utils/memory.ts +141 -0
- package/src/cli/utils/pkg.ts +215 -0
- package/src/cli/utils/string.ts +48 -0
- package/src/cli/utils/time.ts +27 -0
- package/tsconfig.json +9 -0
- package/.enderun/agents/analyst.md +0 -238
- package/.enderun/agents/orchestrator.md +0 -172
- package/.enderun/agents/qa.md +0 -124
- package/.enderun/agents/security.md +0 -202
- package/.enderun/knowledge/api_design_rules.md +0 -6
- package/.enderun/knowledge/branded_types_pattern.md +0 -8
- package/.enderun/knowledge/code_review_checklist.md +0 -7
- package/.enderun/knowledge/contract_versioning.md +0 -7
- package/.enderun/knowledge/database_migration.md +0 -6
- package/.enderun/knowledge/deployment_checklist.md +0 -7
- package/.enderun/knowledge/git_commit_strategy.md +0 -10
- package/.enderun/knowledge/monitoring_setup.md +0 -5
- package/.enderun/knowledge/performance_guidelines.md +0 -11
- package/.enderun/knowledge/repository_patterns.md +0 -9
- package/.enderun/knowledge/security_scanning.md +0 -6
- package/.enderun/knowledge/testing_standards.md +0 -7
- package/.enderun/knowledge/troubleshooting_guide.md +0 -5
- package/.enderun/logs/analyst.json +0 -1
- package/.enderun/logs/backend.json +0 -1
- package/.enderun/logs/devops.json +0 -1
- package/.enderun/logs/explorer.json +0 -1
- package/.enderun/logs/frontend.json +0 -1
- package/.enderun/logs/git.json +0 -1
- package/.enderun/logs/manager.json +0 -1
- package/.enderun/logs/mobile.json +0 -1
- package/.enderun/logs/native.json +0 -1
- package/.enderun/logs/orchestrator.json +0 -1
- package/.enderun/logs/qa.json +0 -1
- package/.enderun/logs/security.json +0 -1
- package/.enderun/memory-graph/agent-contexts/analyst.json +0 -1
- package/.enderun/memory-graph/agent-contexts/orchestrator.json +0 -1
- package/.enderun/memory-graph/agent-contexts/qa.json +0 -1
- package/.enderun/memory-graph/agent-contexts/security.json +0 -1
- package/.env.example +0 -10
- package/cursor.md +0 -19
- package/docs/action-plan-2026.md +0 -119
- package/docs/roadmap.md +0 -142
- package/framework-mcp/README.md +0 -55
- package/framework-mcp/dist/schemas.js +0 -84
- package/framework-mcp/dist/tools/codebase.js +0 -294
- package/framework-mcp/dist/tools/contract.js +0 -197
- package/framework-mcp/dist/tools/framework.js +0 -225
- package/framework-mcp/dist/tools/git.js +0 -51
- package/framework-mcp/dist/tools/governance.js +0 -696
- package/framework-mcp/dist/tools/index.js +0 -47
- package/framework-mcp/dist/tools/knowledge.js +0 -133
- package/framework-mcp/dist/tools/memory.js +0 -217
- package/framework-mcp/dist/tools/messages.js +0 -193
- package/framework-mcp/dist/tools/monitoring.js +0 -294
- package/framework-mcp/dist/tools/orchestration.js +0 -369
- package/framework-mcp/dist/tools/pipeline.js +0 -267
- package/framework-mcp/dist/tools/security.js +0 -137
- package/framework-mcp/dist/utils.js +0 -121
- package/framework-mcp/src/index.ts +0 -49
- package/framework-mcp/src/schemas.ts +0 -106
- package/framework-mcp/src/tools/codebase.ts +0 -284
- package/framework-mcp/src/tools/contract.ts +0 -221
- package/framework-mcp/src/tools/framework.ts +0 -223
- package/framework-mcp/src/tools/git.ts +0 -42
- package/framework-mcp/src/tools/governance.ts +0 -891
- package/framework-mcp/src/tools/index.ts +0 -50
- package/framework-mcp/src/tools/knowledge.ts +0 -141
- package/framework-mcp/src/tools/memory.ts +0 -207
- package/framework-mcp/src/tools/messages.ts +0 -213
- package/framework-mcp/src/tools/monitoring.ts +0 -351
- package/framework-mcp/src/tools/orchestration.ts +0 -440
- package/framework-mcp/src/tools/pipeline.ts +0 -353
- package/framework-mcp/src/tools/security.ts +0 -143
- package/framework-mcp/src/utils.ts +0 -130
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import {
|
|
4
|
-
getFrameworkDir,
|
|
5
|
-
collectMarkdownArtifacts,
|
|
6
|
-
FRAMEWORK_VERSION
|
|
7
|
-
} from "../utils.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export const frameworkTools = [
|
|
11
|
-
{
|
|
12
|
-
name: "get_framework_status",
|
|
13
|
-
description: "Get the current status of the AI Agent Framework, including active phase and agent states.",
|
|
14
|
-
inputSchema: { type: "object", properties: {} },
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "get_project_gaps",
|
|
18
|
-
description: "Scans the project structure against the defined standards in ENDERUN.md and identifies missing files, folders, or documentation.",
|
|
19
|
-
inputSchema: { type: "object", properties: {} },
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "get_memory_insights",
|
|
23
|
-
description: "Analyze PROJECT_MEMORY.md and BRAIN_DASHBOARD.md to provide insights on what was done, what is being done, and the history.",
|
|
24
|
-
inputSchema: { type: "object", properties: {} },
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "codebase_context",
|
|
28
|
-
description: "Compatibility helper for non-code context discovery. Lists known markdown artifacts under docs/ and memory files.",
|
|
29
|
-
inputSchema: { type: "object", properties: {} },
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: "get_system_time",
|
|
33
|
-
description: "Get the current system time in ISO-8601 format (UTC). Use this instead of Shell 'date' commands.",
|
|
34
|
-
inputSchema: { type: "object", properties: {} },
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "bootstrap_legacy_memory",
|
|
38
|
-
description: "Analyzes a pre-existing codebase to automatically generate the initial project memory, learning its tech stack and architecture.",
|
|
39
|
-
inputSchema: { type: "object", properties: {} },
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "verify_framework_health",
|
|
43
|
-
description: "Runs the framework's internal 'check' command and reports system health status via MCP.",
|
|
44
|
-
inputSchema: {
|
|
45
|
-
type: "object",
|
|
46
|
-
properties: {
|
|
47
|
-
detailed: { type: "boolean", default: false, description: "Include detailed issues if any." },
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
export const frameworkHandlers = {
|
|
54
|
-
bootstrap_legacy_memory: async (args: unknown, projectRoot: string) => {
|
|
55
|
-
try {
|
|
56
|
-
const frameworkDir = getFrameworkDir(projectRoot);
|
|
57
|
-
const memoryPath = path.join(projectRoot, frameworkDir, "PROJECT_MEMORY.md");
|
|
58
|
-
const pkgPath = path.join(projectRoot, "package.json");
|
|
59
|
-
let techStack = "Unknown";
|
|
60
|
-
if (fs.existsSync(pkgPath)) {
|
|
61
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
62
|
-
const allDeps = Object.keys(pkg.dependencies || {}).concat(Object.keys(pkg.devDependencies || {}));
|
|
63
|
-
const detected = [];
|
|
64
|
-
if (allDeps.includes("react")) detected.push("React");
|
|
65
|
-
if (allDeps.includes("next")) detected.push("Next.js");
|
|
66
|
-
if (allDeps.includes("typescript")) detected.push("TypeScript");
|
|
67
|
-
if (detected.length > 0) techStack = detected.join(", ");
|
|
68
|
-
}
|
|
69
|
-
const date = new Date().toISOString().split("T")[0];
|
|
70
|
-
const bootstrapContent = `# PROJECT MEMORY — Legacy Onboarding\n\n## CURRENT STATUS\n\n| Active Phase | Profile | Last Update | Active Trace ID | Blockers |\n| PHASE_1 | Full | ${date} | — | Legacy Onboarding |`;
|
|
71
|
-
if (fs.existsSync(memoryPath)) fs.copyFileSync(memoryPath, memoryPath + ".bak");
|
|
72
|
-
fs.writeFileSync(memoryPath, bootstrapContent);
|
|
73
|
-
return { content: [{ type: "text", text: `Legacy Codebase Bootstrap complete. Detected Stack: ${techStack}.` }] };
|
|
74
|
-
} catch {
|
|
75
|
-
return { content: [{ type: "text", text: "Failed to bootstrap legacy memory." }] };
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
get_framework_status: async (args: unknown, projectRoot: string) => {
|
|
79
|
-
try {
|
|
80
|
-
const frameworkDir = getFrameworkDir(projectRoot);
|
|
81
|
-
const memoryPath = path.join(projectRoot, frameworkDir, "PROJECT_MEMORY.md");
|
|
82
|
-
const memoryContent = fs.readFileSync(memoryPath, "utf-8");
|
|
83
|
-
const statusRowMatch = memoryContent.match(/\| Active Phase \| Profile \| Last Update \| Active Trace ID \| Blockers \|\n\| :----------- \| :------ \| :---------- \| :-------------- \| :------- \|\n\| ([^|]+) \| ([^|]+) \| ([^|]+) \| ([^|]+) \| ([^|]+) \|/);
|
|
84
|
-
const phase = statusRowMatch?.[1]?.trim() ?? "UNKNOWN";
|
|
85
|
-
const profile = statusRowMatch?.[2]?.trim() ?? "UNKNOWN";
|
|
86
|
-
return {
|
|
87
|
-
content: [{ type: "text", text: `Framework active (v${FRAMEWORK_VERSION}). Phase: ${phase}. Profile: ${profile}.` }],
|
|
88
|
-
};
|
|
89
|
-
} catch {
|
|
90
|
-
return { content: [{ type: "text", text: "Failed to get framework status." }] };
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
get_project_gaps: async (args: unknown, projectRoot: string) => {
|
|
94
|
-
const missing: string[] = [];
|
|
95
|
-
const frameworkDir = getFrameworkDir(projectRoot);
|
|
96
|
-
const checkPaths = [
|
|
97
|
-
{ path: "apps/backend/src/types", type: "folder", optional: true },
|
|
98
|
-
{ path: "apps/web/src/types", type: "folder", optional: true },
|
|
99
|
-
{ path: "framework-mcp/src", type: "folder" },
|
|
100
|
-
{ path: ".env", type: "file", optional: true },
|
|
101
|
-
{ path: ".env.example", type: "file" },
|
|
102
|
-
{ path: path.join(frameworkDir, "PROJECT_MEMORY.md"), type: "file" },
|
|
103
|
-
{ path: path.join(frameworkDir, "BRAIN_DASHBOARD.md"), type: "file" },
|
|
104
|
-
{ path: "docs/README.md", type: "file" },
|
|
105
|
-
{ path: "docs/getting-started.md", type: "file" },
|
|
106
|
-
{ path: "docs/architecture/approval-flows.md", type: "file", optional: true },
|
|
107
|
-
{ path: "docs/backend/error-handling.md", type: "file", optional: true },
|
|
108
|
-
{ path: "docs/frontend/component-patterns.md", type: "file", optional: true },
|
|
109
|
-
];
|
|
110
|
-
for (const item of checkPaths) {
|
|
111
|
-
const fullPath = path.join(projectRoot, item.path);
|
|
112
|
-
if (!fs.existsSync(fullPath) && !item.optional) {
|
|
113
|
-
missing.push(`[MISSING ${item.type.toUpperCase()}] ${item.path}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const agentsDir = path.join(projectRoot, frameworkDir, "agents");
|
|
117
|
-
if (!fs.existsSync(agentsDir)) {
|
|
118
|
-
missing.push(`[MISSING FOLDER] ${frameworkDir}/agents`);
|
|
119
|
-
} else {
|
|
120
|
-
const agents = fs.readdirSync(agentsDir)
|
|
121
|
-
.filter((f) => f.endsWith(".md") && f !== "README.md")
|
|
122
|
-
.map((f) => f.replace(".md", ""));
|
|
123
|
-
const logsDir = path.join(projectRoot, frameworkDir, "logs");
|
|
124
|
-
for (const agentName of agents) {
|
|
125
|
-
const logFile = path.join(logsDir, `${agentName}.json`);
|
|
126
|
-
if (!fs.existsSync(logFile)) {
|
|
127
|
-
missing.push(`[MISSING LOG FILE] ${frameworkDir}/logs/${agentName}.json (Expected for agent ${agentName})`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// v1.0 Army infrastructure checks
|
|
132
|
-
const v1Dirs = [
|
|
133
|
-
path.join(projectRoot, frameworkDir, "memory-graph"),
|
|
134
|
-
path.join(projectRoot, frameworkDir, "memory-graph", "agent-contexts"),
|
|
135
|
-
path.join(projectRoot, frameworkDir, "queue"),
|
|
136
|
-
path.join(projectRoot, frameworkDir, "agents", "schema"),
|
|
137
|
-
];
|
|
138
|
-
for (const d of v1Dirs) {
|
|
139
|
-
if (!fs.existsSync(d)) {
|
|
140
|
-
missing.push(`[MISSING v1.0 DIR] ${path.relative(projectRoot, d)}`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return { content: [{ type: "text", text: missing.length > 0 ? `Detected Gaps:\n${missing.join("\n")}` : "No structural gaps detected based on core standards." }] };
|
|
145
|
-
},
|
|
146
|
-
get_memory_insights: async (args: unknown, projectRoot: string) => {
|
|
147
|
-
try {
|
|
148
|
-
const frameworkDir = getFrameworkDir(projectRoot);
|
|
149
|
-
const memoryPath = path.join(projectRoot, frameworkDir, "PROJECT_MEMORY.md");
|
|
150
|
-
const dashboardPath = path.join(projectRoot, frameworkDir, "BRAIN_DASHBOARD.md");
|
|
151
|
-
const memory = fs.existsSync(memoryPath) ? fs.readFileSync(memoryPath, "utf-8") : "Memory file missing.";
|
|
152
|
-
const dashboard = fs.existsSync(dashboardPath) ? fs.readFileSync(dashboardPath, "utf-8") : "Dashboard file missing.";
|
|
153
|
-
const history = memory.split("## HISTORY")[1] || "No history found.";
|
|
154
|
-
const activeTasks = memory.split("## ACTIVE TASKS")[1]?.split("##")[0] || "No active tasks.";
|
|
155
|
-
const dashboardAgents = dashboard.split("## 📈 Visualizations")[0] || dashboard;
|
|
156
|
-
return {
|
|
157
|
-
content: [{ type: "text", text: `### LIVE MEMORY INSIGHTS\n\n**Active Tasks:**\n${activeTasks.trim()}\n\n**Recent History:**\n${history.trim().substring(0, 1000)}...\n\n**Brain Snapshot:**\n${dashboardAgents.trim().substring(0, 500)}...` }],
|
|
158
|
-
};
|
|
159
|
-
} catch {
|
|
160
|
-
return { content: [{ type: "text", text: "Failed to get memory insights." }] };
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
codebase_context: async (args: unknown, projectRoot: string) => {
|
|
164
|
-
try {
|
|
165
|
-
const artifacts = collectMarkdownArtifacts(projectRoot);
|
|
166
|
-
const frameworkDir = getFrameworkDir(projectRoot);
|
|
167
|
-
const memoryPath = path.join(projectRoot, frameworkDir, "PROJECT_MEMORY.md");
|
|
168
|
-
const dashboardPath = path.join(projectRoot, frameworkDir, "BRAIN_DASHBOARD.md");
|
|
169
|
-
return {
|
|
170
|
-
content: [{ type: "text", text: "### CONTEXT ARTIFACTS\n\n" + `PROJECT_MEMORY: ${fs.existsSync(memoryPath) ? "present" : "missing"}\n` + `BRAIN_DASHBOARD: ${fs.existsSync(dashboardPath) ? "present" : "missing"}\n` + `Docs:\n${artifacts.length > 0 ? artifacts.join("\n") : "No markdown artifacts found."}` }],
|
|
171
|
-
};
|
|
172
|
-
} catch {
|
|
173
|
-
return { content: [{ type: "text", text: "Failed to gather codebase context." }] };
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
get_system_time: async () => {
|
|
177
|
-
return { content: [{ type: "text", text: new Date().toISOString() }] };
|
|
178
|
-
},
|
|
179
|
-
verify_framework_health: async (args: unknown, projectRoot: string) => {
|
|
180
|
-
try {
|
|
181
|
-
const frameworkDir = getFrameworkDir(projectRoot);
|
|
182
|
-
const requiredFiles = [
|
|
183
|
-
["Constitution", fs.existsSync(path.join(projectRoot, "ENDERUN.md")) ? "ENDERUN.md" : path.join(frameworkDir, "ENDERUN.md")],
|
|
184
|
-
["Memory", path.join(frameworkDir, "PROJECT_MEMORY.md")],
|
|
185
|
-
["Command Map", path.join(frameworkDir, "cli-commands.json")],
|
|
186
|
-
["Framework Config", path.join(frameworkDir, "config.json")],
|
|
187
|
-
["Agent Status", path.join(frameworkDir, "STATUS.md")],
|
|
188
|
-
["MCP Config", "mcp.json"],
|
|
189
|
-
["Backend Contract", "apps/backend/contract.version.json"],
|
|
190
|
-
["MCP Server", "framework-mcp/package.json"],
|
|
191
|
-
["Panda CSS Config", "panda.config.ts"],
|
|
192
|
-
["Brain Dashboard", path.join(frameworkDir, "BRAIN_DASHBOARD.md")],
|
|
193
|
-
["Docs Portal", "docs/README.md"],
|
|
194
|
-
["Getting Started", "docs/getting-started.md"],
|
|
195
|
-
] as const;
|
|
196
|
-
|
|
197
|
-
const lines: string[] = [];
|
|
198
|
-
let issues = 0;
|
|
199
|
-
for (const [name, relativePath] of requiredFiles) {
|
|
200
|
-
if (fs.existsSync(path.join(projectRoot, relativePath))) {
|
|
201
|
-
lines.push(`OK ${name}: ${relativePath}`);
|
|
202
|
-
} else {
|
|
203
|
-
issues += 1;
|
|
204
|
-
lines.push(`MISSING ${name}: ${relativePath}`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
const buildPath = path.join(projectRoot, "framework-mcp/dist/index.js");
|
|
209
|
-
if (fs.existsSync(buildPath)) {
|
|
210
|
-
lines.push("OK MCP Build: framework-mcp/dist/index.js");
|
|
211
|
-
} else {
|
|
212
|
-
issues += 1;
|
|
213
|
-
lines.push("MISSING MCP Build: framework-mcp/dist/index.js");
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
const status = issues === 0 ? "PASSED" : "FAILED";
|
|
217
|
-
return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK (${status})\n\n${lines.join("\n")}` }] };
|
|
218
|
-
} catch (error: unknown) {
|
|
219
|
-
const err = error as { message?: string };
|
|
220
|
-
return { content: [{ type: "text", text: `### FRAMEWORK HEALTH CHECK (FAILED)\n\n${err.message ?? "Unknown error"}` }] };
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { execSync } from "child_process";
|
|
3
|
-
import { GENERATE_SEMANTIC_COMMIT_MESSAGE_ARGS_SCHEMA } from "../schemas.js";
|
|
4
|
-
|
|
5
|
-
export const gitTools = [
|
|
6
|
-
{
|
|
7
|
-
name: "generate_semantic_commit_message",
|
|
8
|
-
description: "Analyzes staged git changes and generates a structured semantic commit message based on project standards.",
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: "object",
|
|
11
|
-
properties: {
|
|
12
|
-
traceId: { type: "string", description: "The active Trace ID (ULID)" },
|
|
13
|
-
},
|
|
14
|
-
required: ["traceId"],
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export const gitHandlers = {
|
|
20
|
-
generate_semantic_commit_message: async (args: unknown, projectRoot: string) => {
|
|
21
|
-
const parsed = GENERATE_SEMANTIC_COMMIT_MESSAGE_ARGS_SCHEMA.safeParse(args ?? {});
|
|
22
|
-
if (!parsed.success) return { content: [{ type: "text", text: "Invalid traceId argument." }] };
|
|
23
|
-
try {
|
|
24
|
-
const diff = execSync("git diff --staged", { encoding: "utf-8", cwd: projectRoot });
|
|
25
|
-
if (!diff) return { content: [{ type: "text", text: "No staged changes found." }] };
|
|
26
|
-
const files = execSync("git diff --staged --name-only", { encoding: "utf-8", cwd: projectRoot }).split("\n").filter(Boolean);
|
|
27
|
-
let type = "feat", scope = "code";
|
|
28
|
-
if (files.some(f => f.includes(".md"))) type = "docs";
|
|
29
|
-
else if (files.some(f => f.includes("apps/backend/src/types"))) type = "arch";
|
|
30
|
-
else if (files.some(f => f.includes("framework-mcp"))) type = "chore";
|
|
31
|
-
else if (files.some(f => f.includes("bin/cli.js"))) type = "fix";
|
|
32
|
-
else if (files.some(f => f.includes("test"))) type = "test";
|
|
33
|
-
if (files.some(f => f.includes("apps/web"))) scope = "web";
|
|
34
|
-
else if (files.some(f => f.includes("apps/backend"))) scope = "backend";
|
|
35
|
-
else if (files.some(f => f.includes("framework-mcp"))) scope = "mcp";
|
|
36
|
-
const summary = files.length === 1 ? `update ${path.basename(files[0])}` : `update ${files.length} files`;
|
|
37
|
-
return { content: [{ type: "text", text: `### SUGGESTED SEMANTIC COMMIT MESSAGE\n\n\`[${parsed.data.traceId}] ${type}(${scope}): ${summary}\`\n\n**Files Analyzed:**\n${files.map(f => `- ${f}`).join("\n")}` }] };
|
|
38
|
-
} catch {
|
|
39
|
-
return { content: [{ type: "text", text: "Failed to generate semantic commit message." }] };
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
};
|