agent-enderun 0.7.1 → 0.7.5
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 +47 -0
- package/.enderun/PROJECT_MEMORY.md +139 -0
- package/.enderun/STATUS.md +62 -0
- package/.enderun/agents/agent_army_schema.json +85 -0
- package/.enderun/agents/analyst/agent.json +23 -0
- package/.enderun/agents/analyst/prompt.md +225 -0
- package/.enderun/agents/backend/agent.json +24 -0
- package/.enderun/agents/backend/prompt.md +331 -0
- package/.enderun/agents/devops/agent.json +61 -0
- package/.enderun/agents/devops/prompt.md +127 -0
- package/.enderun/agents/explorer/agent.json +22 -0
- package/.enderun/agents/explorer/prompt.md +115 -0
- package/.enderun/agents/frontend/agent.json +24 -0
- package/.enderun/agents/frontend/prompt.md +313 -0
- package/.enderun/agents/git/agent.json +22 -0
- package/.enderun/agents/git/prompt.md +99 -0
- package/.enderun/agents/manager/agent.json +48 -0
- package/.enderun/agents/manager/prompt.md +231 -0
- package/.enderun/agents/mobile/agent.json +21 -0
- package/.enderun/agents/mobile/prompt.md +91 -0
- package/.enderun/agents/native/agent.json +21 -0
- package/.enderun/agents/native/prompt.md +96 -0
- package/.enderun/agents/orchestrator/agent.json +53 -0
- package/.enderun/agents/orchestrator/prompt.md +124 -0
- package/.enderun/agents/qa/agent.json +57 -0
- package/.enderun/agents/qa/prompt.md +69 -0
- package/.enderun/agents/schema/agent-lifecycle-schema.json +65 -0
- package/.enderun/agents/security/agent.json +54 -0
- package/.enderun/agents/security/prompt.md +154 -0
- package/.enderun/gemini.md +19 -0
- package/.enderun/knowledge/corporate-governance/analyst-contract-integrity-guide.md +92 -0
- package/.enderun/knowledge/corporate-governance/audit-logging-standard.md +59 -0
- package/.enderun/knowledge/corporate-governance/backend-high-risk-endpoint-guide.md +125 -0
- package/.enderun/knowledge/corporate-governance/branded-types-law.md +77 -0
- package/.enderun/knowledge/corporate-governance/contract-drift-detection-simulation.md +92 -0
- package/.enderun/knowledge/corporate-governance/corporate-governance-playbook.md +89 -0
- package/.enderun/knowledge/corporate-governance/corporate-project-kickoff-checklist.md +56 -0
- package/.enderun/knowledge/corporate-governance/corporate-project-kickoff-simulation.md +144 -0
- package/.enderun/knowledge/corporate-governance/corporate-project-scaffolding-sop.md +103 -0
- package/.enderun/knowledge/corporate-governance/domain-error-handling-standard.md +75 -0
- package/.enderun/knowledge/corporate-governance/frontend-high-risk-modal-guide.md +211 -0
- package/.enderun/knowledge/corporate-governance/governance-baseline-briefing-template.md +54 -0
- package/.enderun/knowledge/corporate-governance/high-risk-action-approval-flow-simulation.md +167 -0
- package/.enderun/knowledge/corporate-governance/high-risk-actions-managerapproval.md +76 -0
- package/.enderun/knowledge/corporate-governance/high-risk-security-modal-hermes-flow.md +49 -0
- package/.enderun/knowledge/corporate-governance/manager-first-30-days-guide.md +112 -0
- package/.enderun/knowledge/corporate-governance/manager-first-three-briefings.md +79 -0
- package/.enderun/knowledge/deployment_checklist.md +7 -0
- package/{.antigravitycli → .enderun}/knowledge/framework_vs_user_project_boundary.md +3 -3
- package/{.antigravitycli → .enderun}/knowledge/frontend_professionalization_guidelines.md +17 -20
- package/{.antigravitycli → .enderun}/knowledge/hermes_live_test_guidelines.md +9 -9
- package/{.antigravitycli → .enderun}/knowledge/hermes_protocol.md +2 -2
- package/.enderun/knowledge/kentim_constitution.md +34 -0
- package/{.antigravitycli → .enderun}/knowledge/manager_authority_audit_enforcement.md +11 -11
- package/{.antigravitycli → .enderun}/knowledge/project_scaffold_guidelines.md +8 -8
- package/{.antigravitycli → .enderun}/knowledge/reference_application_guidelines.md +7 -7
- package/.enderun/logs/analyst.json +1 -0
- package/.enderun/logs/backend.json +1 -0
- package/.enderun/logs/devops.json +1 -0
- package/.enderun/logs/explorer.json +1 -0
- package/.enderun/logs/frontend.json +1 -0
- package/.enderun/logs/git.json +1 -0
- package/.enderun/logs/manager.json +20 -0
- package/.enderun/logs/mobile.json +1 -0
- package/.enderun/logs/native.json +1 -0
- package/.enderun/logs/orchestrator.json +1 -0
- package/.enderun/logs/qa.json +1 -0
- package/.enderun/logs/security.json +1 -0
- package/.enderun/memory-graph/agent-contexts/analyst.json +1 -0
- package/.enderun/memory-graph/agent-contexts/backend.json +1 -0
- package/.enderun/memory-graph/agent-contexts/devops.json +1 -0
- package/.enderun/memory-graph/agent-contexts/explorer.json +1 -0
- package/.enderun/memory-graph/agent-contexts/frontend.json +1 -0
- package/.enderun/memory-graph/agent-contexts/git.json +1 -0
- package/.enderun/memory-graph/agent-contexts/manager.json +1 -0
- package/.enderun/memory-graph/agent-contexts/mobile.json +1 -0
- package/.enderun/memory-graph/agent-contexts/native.json +1 -0
- package/.enderun/memory-graph/agent-contexts/orchestrator.json +1 -0
- package/.enderun/memory-graph/agent-contexts/qa.json +1 -0
- package/.enderun/memory-graph/agent-contexts/security.json +1 -0
- package/.enderun/memory-graph/graph.json +26 -0
- package/.enderun/memory-graph/shared-facts.json +52 -0
- package/.enderun/monitoring/.gitkeep +0 -0
- package/.enderun/queue/README.md +36 -0
- package/ENDERUN.md +4 -4
- package/README.md +151 -89
- package/bin/cli.js +13 -2138
- package/bin/hermes-sandbox.js +0 -0
- package/bin/validate-agent-army.js +3 -3
- package/docs/architecture/approval-flows.md +2 -37
- package/docs/backend/error-handling.md +2 -51
- package/docs/frontend/component-patterns.md +2 -47
- package/docs/getting-started.md +7 -15
- package/docs/roadmap.md +2 -2
- package/framework-mcp/dist/index.js +0 -0
- package/framework-mcp/dist/schemas.js +3 -3
- package/framework-mcp/dist/tools/framework.js +17 -10
- package/framework-mcp/dist/tools/governance.js +696 -0
- package/framework-mcp/dist/tools/index.js +14 -12
- package/framework-mcp/dist/tools/memory.js +106 -0
- package/framework-mcp/dist/tools/monitoring.js +294 -0
- package/framework-mcp/dist/tools/orchestration.js +368 -0
- package/framework-mcp/dist/tools/pipeline.js +267 -0
- package/framework-mcp/dist/utils.js +25 -3
- package/framework-mcp/package.json +3 -3
- package/framework-mcp/src/schemas.ts +3 -3
- package/framework-mcp/src/tools/framework.ts +18 -10
- package/framework-mcp/src/tools/governance.ts +891 -0
- package/framework-mcp/src/tools/index.ts +14 -12
- package/framework-mcp/src/tools/memory.ts +103 -0
- package/framework-mcp/src/tools/monitoring.ts +351 -0
- package/framework-mcp/src/tools/orchestration.ts +439 -0
- package/framework-mcp/src/tools/pipeline.ts +353 -0
- package/framework-mcp/src/utils.ts +24 -3
- package/framework-mcp/tsconfig.json +2 -1
- package/gemini.md +19 -0
- package/package.json +14 -20
- package/.antigravitycli/BRAIN_DASHBOARD.md +0 -43
- package/.antigravitycli/ENDERUN.md +0 -253
- package/.antigravitycli/PROJECT_MEMORY.md +0 -78
- package/.antigravitycli/STATUS.md +0 -21
- package/.antigravitycli/agents/agent_army_schema.json +0 -79
- package/.antigravitycli/agents/analyst/agent.json +0 -55
- package/.antigravitycli/agents/backend/agent.json +0 -58
- package/.antigravitycli/agents/explorer/agent.json +0 -50
- package/.antigravitycli/agents/frontend/agent.json +0 -56
- package/.antigravitycli/agents/git/agent.json +0 -53
- package/.antigravitycli/agents/manager/agent.json +0 -82
- package/.antigravitycli/agents/mobile/agent.json +0 -52
- package/.antigravitycli/agents/native/agent.json +0 -56
- package/.antigravitycli/assets/manager.png +0 -0
- package/.antigravitycli/blueprints/README.md +0 -82
- package/.antigravitycli/blueprints/backend/errors/config/meta.json +0 -16
- package/.antigravitycli/blueprints/backend/errors/domain-error.ts +0 -64
- package/.antigravitycli/knowledge/README.md +0 -22
- package/.antigravitycli/knowledge/database_governance_guidelines.md +0 -118
- package/.antigravitycli/knowledge/deployment_checklist.md +0 -133
- package/.antigravitycli/knowledge/documentation_ownership.md +0 -122
- package/.antigravitycli/knowledge/documentation_ownership_status.md +0 -122
- package/.antigravitycli/knowledge/enterprise_capabilities_reference.md +0 -149
- package/.antigravitycli/knowledge/enterprise_frontend_adaptation.md +0 -232
- package/.antigravitycli/knowledge/enterprise_project_adaptation.md +0 -168
- package/.antigravitycli/knowledge/frontend_real_battle_test_protocol.md +0 -162
- package/antigravity.md +0 -15
- package/docs/architecture/decisions/README.md +0 -31
- package/docs/architecture/notification-strategy.md +0 -38
- package/docs/backend/audit-logging.md +0 -34
- package/docs/frontend/forms.md +0 -40
- package/docs/frontend/notifications.md +0 -37
- package/framework-mcp/dist/tools/academy.js +0 -182
- package/framework-mcp/dist/tools/database.js +0 -57
- package/framework-mcp/dist/tools/repository.js +0 -101
- package/framework-mcp/dist/tools/scaffold.js +0 -132
- package/framework-mcp/src/tools/academy.ts +0 -180
- package/framework-mcp/src/tools/database.ts +0 -54
- package/framework-mcp/src/tools/repository.ts +0 -101
- package/framework-mcp/src/tools/scaffold.ts +0 -150
- /package/{.antigravitycli/messages → .enderun/benchmarks}/.gitkeep +0 -0
- /package/{.antigravitycli → .enderun}/cli-commands.json +0 -0
- /package/{.antigravitycli → .enderun}/config.json +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/api_design_rules.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/async_error_handling.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/blueprint_driven_construction.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/branded_types_pattern.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/code_review_checklist.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/contract_versioning.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/database_migration.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/git_commit_strategy.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/legacy_onboarding.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/monitoring_setup.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/performance_guidelines.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/repository_patterns.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/responsive_design_standards.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/security_scanning.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/testing_standards.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/troubleshooting_guide.md +0 -0
- /package/{.antigravitycli → .enderun}/knowledge/zero_ui_library_policy.md +0 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { promises as fs } from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
// ─── Types ─────────────────────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
type PipelineStage = {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
agent: string;
|
|
11
|
+
status: "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "SKIPPED";
|
|
12
|
+
dependsOn: string[];
|
|
13
|
+
startedAt?: string;
|
|
14
|
+
completedAt?: string;
|
|
15
|
+
output?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type Pipeline = {
|
|
19
|
+
id: string;
|
|
20
|
+
traceId: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
status: "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "ROLLED_BACK";
|
|
26
|
+
currentStageId?: string;
|
|
27
|
+
stages: PipelineStage[];
|
|
28
|
+
rollbackStages?: PipelineStage[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// ─── Tool Definitions ─────────────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
export const pipelineTools: Tool[] = [
|
|
34
|
+
{
|
|
35
|
+
name: "create_execution_pipeline",
|
|
36
|
+
description:
|
|
37
|
+
"Creates a multi-stage execution pipeline for complex workflows (e.g., build → test → security audit → deploy). Each stage is assigned to a specific agent and has defined dependencies. The pipeline is persisted and can be advanced or rolled back.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
traceId: { type: "string", description: "Active Trace ID from @manager briefing" },
|
|
42
|
+
name: { type: "string", description: "Pipeline name (e.g. 'Production Deploy v1.2.0')" },
|
|
43
|
+
description: { type: "string", description: "What this pipeline accomplishes" },
|
|
44
|
+
stages: {
|
|
45
|
+
type: "array",
|
|
46
|
+
description: "Ordered pipeline stages",
|
|
47
|
+
items: {
|
|
48
|
+
type: "object",
|
|
49
|
+
required: ["id", "name", "agent"],
|
|
50
|
+
properties: {
|
|
51
|
+
id: { type: "string" },
|
|
52
|
+
name: { type: "string" },
|
|
53
|
+
agent: { type: "string" },
|
|
54
|
+
dependsOn: { type: "array", items: { type: "string" } },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
rollbackStages: {
|
|
59
|
+
type: "array",
|
|
60
|
+
description: "Optional rollback stages executed in reverse order on pipeline failure",
|
|
61
|
+
items: {
|
|
62
|
+
type: "object",
|
|
63
|
+
required: ["id", "name", "agent"],
|
|
64
|
+
properties: {
|
|
65
|
+
id: { type: "string" },
|
|
66
|
+
name: { type: "string" },
|
|
67
|
+
agent: { type: "string" },
|
|
68
|
+
dependsOn: { type: "array", items: { type: "string" } },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ["traceId", "name", "stages"],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "advance_pipeline_stage",
|
|
78
|
+
description:
|
|
79
|
+
"Advances a pipeline to the next eligible stage. Marks the current stage as COMPLETED and activates all dependent stages that now have their dependencies satisfied. Returns the new pipeline state.",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
pipelineId: { type: "string", description: "Pipeline ID" },
|
|
84
|
+
completedStageId: { type: "string", description: "The stage that just completed successfully" },
|
|
85
|
+
stageOutput: { type: "string", description: "Optional output/result from the completed stage" },
|
|
86
|
+
},
|
|
87
|
+
required: ["pipelineId", "completedStageId"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "rollback_pipeline",
|
|
92
|
+
description:
|
|
93
|
+
"Rolls back a pipeline to the last stable state by executing the defined rollback stages in reverse order. Updates the pipeline status to ROLLED_BACK.",
|
|
94
|
+
inputSchema: {
|
|
95
|
+
type: "object",
|
|
96
|
+
properties: {
|
|
97
|
+
pipelineId: { type: "string", description: "Pipeline ID to roll back" },
|
|
98
|
+
reason: { type: "string", description: "Reason for the rollback (mandatory for audit)" },
|
|
99
|
+
},
|
|
100
|
+
required: ["pipelineId", "reason"],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "get_pipeline_status",
|
|
105
|
+
description:
|
|
106
|
+
"Returns the full current status of a pipeline including all stage states, progress percentage, blocking stages, and estimated completion.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
pipelineId: { type: "string", description: "Pipeline ID" },
|
|
111
|
+
},
|
|
112
|
+
required: ["pipelineId"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
// ─── Handlers ─────────────────────────────────────────────────────────────────
|
|
118
|
+
|
|
119
|
+
export const pipelineHandlers: Record<
|
|
120
|
+
string,
|
|
121
|
+
(args: unknown, projectRoot: string) => Promise<{ content: Array<{ type: string; text: string }> }>
|
|
122
|
+
> = {
|
|
123
|
+
async create_execution_pipeline(args, projectRoot) {
|
|
124
|
+
const { traceId, name, description, stages, rollbackStages } = args as {
|
|
125
|
+
traceId: string;
|
|
126
|
+
name: string;
|
|
127
|
+
description?: string;
|
|
128
|
+
stages: Omit<PipelineStage, "status" | "startedAt" | "completedAt" | "output">[];
|
|
129
|
+
rollbackStages?: Omit<PipelineStage, "status" | "startedAt" | "completedAt" | "output">[];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const pipelineId = `PIPE-${traceId}-${Date.now()}`;
|
|
133
|
+
const now = new Date().toISOString();
|
|
134
|
+
|
|
135
|
+
const pipeline: Pipeline = {
|
|
136
|
+
id: pipelineId,
|
|
137
|
+
traceId,
|
|
138
|
+
name,
|
|
139
|
+
description: description ?? "",
|
|
140
|
+
createdAt: now,
|
|
141
|
+
updatedAt: now,
|
|
142
|
+
status: "PENDING",
|
|
143
|
+
stages: stages.map((s) => ({
|
|
144
|
+
...s,
|
|
145
|
+
dependsOn: s.dependsOn ?? [],
|
|
146
|
+
status: "PENDING" as const,
|
|
147
|
+
})),
|
|
148
|
+
rollbackStages: rollbackStages?.map((s) => ({
|
|
149
|
+
...s,
|
|
150
|
+
dependsOn: s.dependsOn ?? [],
|
|
151
|
+
status: "PENDING" as const,
|
|
152
|
+
})),
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// Activate stages with no dependencies
|
|
156
|
+
for (const stage of pipeline.stages) {
|
|
157
|
+
if (stage.dependsOn.length === 0) {
|
|
158
|
+
stage.status = "RUNNING";
|
|
159
|
+
stage.startedAt = now;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
pipeline.status = "RUNNING";
|
|
163
|
+
|
|
164
|
+
// Persist pipeline
|
|
165
|
+
const pipelineDir = path.join(projectRoot, ".enderun", "queue", "pipelines");
|
|
166
|
+
await fs.mkdir(pipelineDir, { recursive: true });
|
|
167
|
+
await fs.writeFile(
|
|
168
|
+
path.join(pipelineDir, `${pipelineId}.json`),
|
|
169
|
+
JSON.stringify(pipeline, null, 2),
|
|
170
|
+
"utf-8"
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
return { content: [{ type: "text", text: JSON.stringify(pipeline, null, 2) }] };
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
async advance_pipeline_stage(args, projectRoot) {
|
|
177
|
+
const { pipelineId, completedStageId, stageOutput } = args as {
|
|
178
|
+
pipelineId: string;
|
|
179
|
+
completedStageId: string;
|
|
180
|
+
stageOutput?: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const pipelineDir = path.join(projectRoot, ".enderun", "queue", "pipelines");
|
|
184
|
+
const pipelinePath = path.join(pipelineDir, `${pipelineId}.json`);
|
|
185
|
+
|
|
186
|
+
let pipeline: Pipeline;
|
|
187
|
+
try {
|
|
188
|
+
const content = await fs.readFile(pipelinePath, "utf-8");
|
|
189
|
+
pipeline = JSON.parse(content) as Pipeline;
|
|
190
|
+
} catch {
|
|
191
|
+
return {
|
|
192
|
+
content: [
|
|
193
|
+
{ type: "text", text: JSON.stringify({ error: "PIPELINE_NOT_FOUND", pipelineId }) },
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const now = new Date().toISOString();
|
|
199
|
+
|
|
200
|
+
// Mark completed stage
|
|
201
|
+
const completedStage = pipeline.stages.find((s) => s.id === completedStageId);
|
|
202
|
+
if (!completedStage) {
|
|
203
|
+
return {
|
|
204
|
+
content: [
|
|
205
|
+
{ type: "text", text: JSON.stringify({ error: "STAGE_NOT_FOUND", completedStageId }) },
|
|
206
|
+
],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
completedStage.status = "COMPLETED";
|
|
210
|
+
completedStage.completedAt = now;
|
|
211
|
+
if (stageOutput) completedStage.output = stageOutput;
|
|
212
|
+
|
|
213
|
+
// Activate newly unblocked stages
|
|
214
|
+
const completedIds = new Set(pipeline.stages.filter((s) => s.status === "COMPLETED").map((s) => s.id));
|
|
215
|
+
const newlyActivated: string[] = [];
|
|
216
|
+
|
|
217
|
+
for (const stage of pipeline.stages) {
|
|
218
|
+
if (stage.status === "PENDING" && stage.dependsOn.every((dep) => completedIds.has(dep))) {
|
|
219
|
+
stage.status = "RUNNING";
|
|
220
|
+
stage.startedAt = now;
|
|
221
|
+
newlyActivated.push(stage.id);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Check if pipeline is complete
|
|
226
|
+
const allDone = pipeline.stages.every((s) => s.status === "COMPLETED");
|
|
227
|
+
if (allDone) {
|
|
228
|
+
pipeline.status = "COMPLETED";
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
pipeline.updatedAt = now;
|
|
232
|
+
await fs.writeFile(pipelinePath, JSON.stringify(pipeline, null, 2), "utf-8");
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
content: [
|
|
236
|
+
{
|
|
237
|
+
type: "text",
|
|
238
|
+
text: JSON.stringify({ pipeline, newlyActivatedStages: newlyActivated }, null, 2),
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
async rollback_pipeline(args, projectRoot) {
|
|
245
|
+
const { pipelineId, reason } = args as { pipelineId: string; reason: string };
|
|
246
|
+
|
|
247
|
+
const pipelineDir = path.join(projectRoot, ".enderun", "queue", "pipelines");
|
|
248
|
+
const pipelinePath = path.join(pipelineDir, `${pipelineId}.json`);
|
|
249
|
+
|
|
250
|
+
let pipeline: Pipeline;
|
|
251
|
+
try {
|
|
252
|
+
const content = await fs.readFile(pipelinePath, "utf-8");
|
|
253
|
+
pipeline = JSON.parse(content) as Pipeline;
|
|
254
|
+
} catch {
|
|
255
|
+
return {
|
|
256
|
+
content: [
|
|
257
|
+
{ type: "text", text: JSON.stringify({ error: "PIPELINE_NOT_FOUND", pipelineId }) },
|
|
258
|
+
],
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const now = new Date().toISOString();
|
|
263
|
+
pipeline.status = "ROLLED_BACK";
|
|
264
|
+
pipeline.updatedAt = now;
|
|
265
|
+
|
|
266
|
+
// Mark all non-completed stages as SKIPPED
|
|
267
|
+
for (const stage of pipeline.stages) {
|
|
268
|
+
if (stage.status === "RUNNING" || stage.status === "PENDING") {
|
|
269
|
+
stage.status = "SKIPPED";
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Activate rollback stages if defined
|
|
274
|
+
if (pipeline.rollbackStages) {
|
|
275
|
+
for (const stage of pipeline.rollbackStages) {
|
|
276
|
+
stage.status = "RUNNING";
|
|
277
|
+
stage.startedAt = now;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
await fs.writeFile(pipelinePath, JSON.stringify(pipeline, null, 2), "utf-8");
|
|
282
|
+
|
|
283
|
+
// Write rollback event to devops log
|
|
284
|
+
const devopsLogPath = path.join(projectRoot, ".enderun", "logs", "devops.json");
|
|
285
|
+
let devopsLog: { rollbacks: unknown[] } = { rollbacks: [] };
|
|
286
|
+
try {
|
|
287
|
+
const existing = await fs.readFile(devopsLogPath, "utf-8");
|
|
288
|
+
devopsLog = JSON.parse(existing) as typeof devopsLog;
|
|
289
|
+
if (!devopsLog.rollbacks) devopsLog.rollbacks = [];
|
|
290
|
+
} catch {
|
|
291
|
+
// Start fresh
|
|
292
|
+
}
|
|
293
|
+
devopsLog.rollbacks.push({ pipelineId, reason, timestamp: now });
|
|
294
|
+
await fs.mkdir(path.dirname(devopsLogPath), { recursive: true });
|
|
295
|
+
await fs.writeFile(devopsLogPath, JSON.stringify(devopsLog, null, 2), "utf-8");
|
|
296
|
+
|
|
297
|
+
return { content: [{ type: "text", text: JSON.stringify({ pipeline, rollbackReason: reason }, null, 2) }] };
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
async get_pipeline_status(args, projectRoot) {
|
|
301
|
+
const { pipelineId } = args as { pipelineId: string };
|
|
302
|
+
const pipelinePath = path.join(
|
|
303
|
+
projectRoot,
|
|
304
|
+
".enderun",
|
|
305
|
+
"queue",
|
|
306
|
+
"pipelines",
|
|
307
|
+
`${pipelineId}.json`
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
try {
|
|
311
|
+
const content = await fs.readFile(pipelinePath, "utf-8");
|
|
312
|
+
const pipeline = JSON.parse(content) as Pipeline;
|
|
313
|
+
|
|
314
|
+
const total = pipeline.stages.length;
|
|
315
|
+
const completed = pipeline.stages.filter((s) => s.status === "COMPLETED").length;
|
|
316
|
+
const running = pipeline.stages.filter((s) => s.status === "RUNNING").map((s) => s.id);
|
|
317
|
+
const blocked = pipeline.stages.filter(
|
|
318
|
+
(s) => s.status === "PENDING" && s.dependsOn.some((dep) => {
|
|
319
|
+
const depStage = pipeline.stages.find((st) => st.id === dep);
|
|
320
|
+
return depStage && depStage.status !== "COMPLETED";
|
|
321
|
+
})
|
|
322
|
+
).map((s) => s.id);
|
|
323
|
+
|
|
324
|
+
return {
|
|
325
|
+
content: [
|
|
326
|
+
{
|
|
327
|
+
type: "text",
|
|
328
|
+
text: JSON.stringify(
|
|
329
|
+
{
|
|
330
|
+
pipelineId,
|
|
331
|
+
name: pipeline.name,
|
|
332
|
+
status: pipeline.status,
|
|
333
|
+
progress: `${completed}/${total} stages (${Math.round((completed / total) * 100)}%)`,
|
|
334
|
+
currentlyRunning: running,
|
|
335
|
+
waitingOn: blocked,
|
|
336
|
+
createdAt: pipeline.createdAt,
|
|
337
|
+
updatedAt: pipeline.updatedAt,
|
|
338
|
+
},
|
|
339
|
+
null,
|
|
340
|
+
2
|
|
341
|
+
),
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
};
|
|
345
|
+
} catch {
|
|
346
|
+
return {
|
|
347
|
+
content: [
|
|
348
|
+
{ type: "text", text: JSON.stringify({ error: "PIPELINE_NOT_FOUND", pipelineId }) },
|
|
349
|
+
],
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
};
|
|
@@ -10,7 +10,7 @@ const getPackageVersion = (): string => {
|
|
|
10
10
|
const pkgPath = path.join(__dirname, "../package.json");
|
|
11
11
|
if (fs.existsSync(pkgPath)) {
|
|
12
12
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
13
|
-
return pkg.version || "0.7.
|
|
13
|
+
return pkg.version || "0.7.5";
|
|
14
14
|
}
|
|
15
15
|
} catch {
|
|
16
16
|
// fallback
|
|
@@ -20,8 +20,29 @@ const getPackageVersion = (): string => {
|
|
|
20
20
|
|
|
21
21
|
export const FRAMEWORK_VERSION = getPackageVersion();
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Dynamically detects the framework directory for the current project.
|
|
25
|
+
* Checks in priority order: .enderun → .gemini → .cursor → fallback .gemini
|
|
26
|
+
* This resolves the adapter mismatch bug (KRITIK-1 in v0.7.5 analysis).
|
|
27
|
+
*/
|
|
28
|
+
export function getFrameworkDir(projectRoot: string): string {
|
|
29
|
+
const candidates = [".enderun", ".gemini", ".cursor"];
|
|
30
|
+
for (const dir of candidates) {
|
|
31
|
+
const dirPath = path.join(projectRoot, dir);
|
|
32
|
+
if (fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory()) {
|
|
33
|
+
// Verify it looks like a framework dir (has PROJECT_MEMORY.md or agents/ dir)
|
|
34
|
+
const hasMemory = fs.existsSync(path.join(dirPath, "PROJECT_MEMORY.md"));
|
|
35
|
+
const hasAgents = fs.existsSync(path.join(dirPath, "agents"));
|
|
36
|
+
if (hasMemory || hasAgents) {
|
|
37
|
+
return dir;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Ultimate fallback — return first existing dir or .gemini
|
|
42
|
+
for (const dir of candidates) {
|
|
43
|
+
if (fs.existsSync(path.join(projectRoot, dir))) return dir;
|
|
44
|
+
}
|
|
45
|
+
return ".gemini";
|
|
25
46
|
}
|
|
26
47
|
|
|
27
48
|
export function resolveSafePath(projectRoot: string, targetPath: string): string {
|
package/gemini.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Agent Enderun — Gemini CLI Adapter
|
|
2
|
+
|
|
3
|
+
This file is the entry point when using Agent Enderun with Gemini CLI.
|
|
4
|
+
|
|
5
|
+
The framework installs into the `.gemini/` folder for Gemini users.
|
|
6
|
+
|
|
7
|
+
### Primary Constitution
|
|
8
|
+
All governance rules, agent checklists, and project memory live here:
|
|
9
|
+
|
|
10
|
+
👉 **[.gemini/ENDERUN.md](.gemini/ENDERUN.md)**
|
|
11
|
+
|
|
12
|
+
### 🤖 Agent Directive (Gemini CLI users)
|
|
13
|
+
You are operating under the Agent Enderun governance framework.
|
|
14
|
+
|
|
15
|
+
At the **start of every session**, before any work:
|
|
16
|
+
1. Read `.gemini/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
|
|
17
|
+
2. Read the relevant agent definition under `.gemini/agents/{agent}/agent.json` (especially `@manager`).
|
|
18
|
+
|
|
19
|
+
All paths and references inside `.gemini/` use the Gemini adapter structure. No migration to other CLIs is required.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-enderun",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"framework-mcp/dist",
|
|
36
36
|
"framework-mcp/src",
|
|
37
37
|
"framework-mcp/package.json",
|
|
38
|
-
".
|
|
38
|
+
".enderun",
|
|
39
39
|
"ENDERUN.md",
|
|
40
40
|
"README.md",
|
|
41
41
|
"LICENSE",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
".env.example",
|
|
44
44
|
"tsconfig.json",
|
|
45
45
|
"panda.config.ts",
|
|
46
|
-
"
|
|
46
|
+
"gemini.md",
|
|
47
47
|
"docs"
|
|
48
48
|
],
|
|
49
49
|
"scripts": {
|
|
@@ -61,23 +61,17 @@
|
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@eslint/js": "^
|
|
64
|
+
"@eslint/js": "^10.0.1",
|
|
65
65
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
66
|
-
"@pandacss/dev": "^
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"concurrently": "^9.1
|
|
69
|
-
"eslint": "^
|
|
66
|
+
"@pandacss/dev": "^1.11.1",
|
|
67
|
+
"@types/node": "^25.9.1",
|
|
68
|
+
"concurrently": "^9.2.1",
|
|
69
|
+
"eslint": "^10.4.0",
|
|
70
70
|
"ts-morph": "^28.0.0",
|
|
71
|
-
"tsx": "^4.
|
|
72
|
-
"typescript": "^
|
|
73
|
-
"typescript-eslint": "^8.
|
|
74
|
-
"vitest": "^
|
|
75
|
-
"zod": "^3.24.2"
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
"enderun": {
|
|
79
|
-
"version": "0.6.8",
|
|
80
|
-
"initializedAt": "2026-05-24T12:00:52.687Z"
|
|
81
|
-
},
|
|
82
|
-
"dependencies": {}
|
|
71
|
+
"tsx": "^4.22.3",
|
|
72
|
+
"typescript": "^6.0.3",
|
|
73
|
+
"typescript-eslint": "^8.60.0",
|
|
74
|
+
"vitest": "^4.1.7",
|
|
75
|
+
"zod": "^3.24.2"
|
|
76
|
+
}
|
|
83
77
|
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# 🧠 Agent Academy Brain Dashboard
|
|
2
|
-
|
|
3
|
-
This dashboard provides a high-level overview of the Academy's performance, quality trends, and architectural health.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 📊 Performance Metrics
|
|
8
|
-
|
|
9
|
-
| Metric | Current Value | Status |
|
|
10
|
-
| :---------------------- | :------------ | :----------- |
|
|
11
|
-
| **Global Success Rate** | 0% | ⏳ Initializing |
|
|
12
|
-
| **Active Trace IDs** | 0 | ⚪ Idle |
|
|
13
|
-
| **Agent Velocity** | 0 tasks/day | ⚪ Idle |
|
|
14
|
-
| **Contract Integrity** | 100% | ✅ Valid |
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 🛡️ Quality & Security
|
|
19
|
-
|
|
20
|
-
- **Security Audit Status**: 🟢 Clean
|
|
21
|
-
- **Constitution Compliance**: 🔵 100%
|
|
22
|
-
- **Documentation Debt**: 🟠 Low
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 🏗️ Architectural Health
|
|
27
|
-
|
|
28
|
-
- **Dependency Cycles**: 0 detected.
|
|
29
|
-
- **Complexity Spikes**: 0 identified.
|
|
30
|
-
- **Database Migrations**: 0 pending.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## 📜 Contract Change Log
|
|
35
|
-
|
|
36
|
-
| Version | Date | Description | Hash |
|
|
37
|
-
| :------ | :--------- | :------------------- | :--- |
|
|
38
|
-
| v0.6.6 | 2026-05-24 | v0.6.6 Release Baseline | — |
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
> [!NOTE]
|
|
43
|
-
> This dashboard is automatically updated by the `@analyst` agent via the `update_brain_dashboard` tool (simulated).
|