agent-enderun 1.1.10 โ 1.10.0
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/README.md +294 -19
- package/bin/cli.js +7 -0
- package/bin/enderun-dashboard.js +16 -857
- package/bin/validate-agent-army.js +12 -12
- package/dist/framework-mcp/src/index.js +14 -2
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +2 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +2 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.js +3 -3
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/utils/fs.d.ts +16 -0
- package/dist/framework-mcp/src/utils/fs.js +45 -0
- package/dist/framework-mcp/src/utils/fs.js.map +1 -0
- package/dist/framework-mcp/src/utils/metrics.js.map +1 -1
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.js +4 -3
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/app.js +20 -5
- package/dist/src/cli/commands/app.js.map +1 -1
- package/dist/src/cli/commands/approve.d.ts +1 -1
- package/dist/src/cli/commands/approve.js +7 -7
- package/dist/src/cli/commands/approve.js.map +1 -1
- package/dist/src/cli/commands/check.d.ts +1 -1
- package/dist/src/cli/commands/check.js +35 -4
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/compliance.d.ts +1 -1
- package/dist/src/cli/commands/compliance.js +1 -1
- package/dist/src/cli/commands/compliance.js.map +1 -1
- package/dist/src/cli/commands/contract.d.ts +2 -2
- package/dist/src/cli/commands/contract.js +8 -14
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/dashboard/data-service.d.ts +33 -0
- package/dist/src/cli/commands/dashboard/data-service.js +120 -0
- package/dist/src/cli/commands/dashboard/data-service.js.map +1 -0
- package/dist/src/cli/commands/dashboard/html-template.d.ts +4 -0
- package/dist/src/cli/commands/dashboard/html-template.js +697 -0
- package/dist/src/cli/commands/dashboard/html-template.js.map +1 -0
- package/dist/src/cli/commands/dashboard/server.d.ts +2 -0
- package/dist/src/cli/commands/dashboard/server.js +38 -0
- package/dist/src/cli/commands/dashboard/server.js.map +1 -0
- package/dist/src/cli/commands/dashboard.d.ts +4 -0
- package/dist/src/cli/commands/dashboard.js +10 -0
- package/dist/src/cli/commands/dashboard.js.map +1 -0
- package/dist/src/cli/commands/explorer.d.ts +2 -2
- package/dist/src/cli/commands/explorer.js +2 -2
- package/dist/src/cli/commands/explorer.js.map +1 -1
- package/dist/src/cli/commands/git.d.ts +2 -2
- package/dist/src/cli/commands/git.js +2 -2
- package/dist/src/cli/commands/git.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-core.d.ts +4 -0
- package/dist/src/cli/commands/init/scaffold-core.js +65 -0
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-ops.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-ops.js +83 -0
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-standards.d.ts +2 -0
- package/dist/src/cli/commands/init/scaffold-standards.js +58 -0
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -0
- package/dist/src/cli/commands/init.js +14 -275
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.d.ts +2 -2
- package/dist/src/cli/commands/knowledge.js +4 -3
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/lint.d.ts +1 -1
- package/dist/src/cli/commands/lint.js +2 -3
- package/dist/src/cli/commands/lint.js.map +1 -1
- package/dist/src/cli/commands/log.d.ts +1 -1
- package/dist/src/cli/commands/log.js +3 -2
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/memory.d.ts +1 -1
- package/dist/src/cli/commands/memory.js +1 -1
- package/dist/src/cli/commands/memory.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.js +169 -140
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +1 -1
- package/dist/src/cli/commands/plan.js +1 -1
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/script.d.ts +1 -1
- package/dist/src/cli/commands/script.js +1 -1
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/security.d.ts +1 -1
- package/dist/src/cli/commands/security.js +1 -1
- package/dist/src/cli/commands/security.js.map +1 -1
- package/dist/src/cli/commands/status.d.ts +1 -1
- package/dist/src/cli/commands/status.js +1 -1
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/trace.d.ts +1 -1
- package/dist/src/cli/commands/trace.js +1 -1
- package/dist/src/cli/commands/trace.js.map +1 -1
- package/dist/src/cli/index.js +36 -21
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +6 -6
- package/dist/src/cli/utils/app-backend.js +7 -0
- package/dist/src/cli/utils/app-backend.js.map +1 -1
- package/dist/src/cli/utils/app-docs.js +23 -5
- package/dist/src/cli/utils/app-docs.js.map +1 -1
- package/dist/src/cli/utils/app-frontend.js +5 -0
- package/dist/src/cli/utils/app-frontend.js.map +1 -1
- package/dist/src/cli/utils/app-inferrer.d.ts +1 -0
- package/dist/src/cli/utils/app-inferrer.js +12 -1
- package/dist/src/cli/utils/app-inferrer.js.map +1 -1
- package/dist/src/cli/utils/app-mobile.d.ts +2 -0
- package/dist/src/cli/utils/app-mobile.js +106 -0
- package/dist/src/cli/utils/app-mobile.js.map +1 -0
- package/dist/src/cli/utils/app-types.js +8 -4
- package/dist/src/cli/utils/app-types.js.map +1 -1
- package/dist/src/cli/utils/app.d.ts +1 -0
- package/dist/src/cli/utils/app.js +1 -0
- package/dist/src/cli/utils/app.js.map +1 -1
- package/dist/src/cli/utils/claude.js +2 -1
- package/dist/src/cli/utils/claude.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +37 -6
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/config-schema.d.ts +3 -3
- package/dist/src/cli/utils/config-schema.js +3 -3
- package/dist/src/cli/utils/config-schema.js.map +1 -1
- package/dist/src/cli/utils/fs.d.ts +2 -2
- package/dist/src/cli/utils/fs.js +9 -13
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +9 -2
- package/dist/src/cli/utils/memory.js +87 -16
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +14 -13
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/string.js +1 -1
- package/dist/src/cli/utils/string.js.map +1 -1
- package/dist/src/cli/utils/ui.d.ts +1 -1
- package/dist/src/cli/utils/ui.js +1 -1
- package/dist/src/modules/adapters/shared.js +7 -7
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +3 -34
- package/dist/src/modules/agents/definitions.js +35 -511
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.d.ts +2 -0
- package/dist/src/modules/agents/registry/analyst.js +36 -0
- package/dist/src/modules/agents/registry/analyst.js.map +1 -0
- package/dist/src/modules/agents/registry/architect.d.ts +2 -0
- package/dist/src/modules/agents/registry/architect.js +42 -0
- package/dist/src/modules/agents/registry/architect.js.map +1 -0
- package/dist/src/modules/agents/registry/backend.d.ts +2 -0
- package/dist/src/modules/agents/registry/backend.js +43 -0
- package/dist/src/modules/agents/registry/backend.js.map +1 -0
- package/dist/src/modules/agents/registry/database.d.ts +2 -0
- package/dist/src/modules/agents/registry/database.js +38 -0
- package/dist/src/modules/agents/registry/database.js.map +1 -0
- package/dist/src/modules/agents/registry/devops.d.ts +2 -0
- package/dist/src/modules/agents/registry/devops.js +38 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -0
- package/dist/src/modules/agents/registry/explorer.d.ts +2 -0
- package/dist/src/modules/agents/registry/explorer.js +36 -0
- package/dist/src/modules/agents/registry/explorer.js.map +1 -0
- package/dist/src/modules/agents/registry/frontend.d.ts +2 -0
- package/dist/src/modules/agents/registry/frontend.js +44 -0
- package/dist/src/modules/agents/registry/frontend.js.map +1 -0
- package/dist/src/modules/agents/registry/git.d.ts +2 -0
- package/dist/src/modules/agents/registry/git.js +35 -0
- package/dist/src/modules/agents/registry/git.js.map +1 -0
- package/dist/src/modules/agents/registry/manager.d.ts +2 -0
- package/dist/src/modules/agents/registry/manager.js +49 -0
- package/dist/src/modules/agents/registry/manager.js.map +1 -0
- package/dist/src/modules/agents/registry/mobile.d.ts +2 -0
- package/dist/src/modules/agents/registry/mobile.js +40 -0
- package/dist/src/modules/agents/registry/mobile.js.map +1 -0
- package/dist/src/modules/agents/registry/native.d.ts +2 -0
- package/dist/src/modules/agents/registry/native.js +36 -0
- package/dist/src/modules/agents/registry/native.js.map +1 -0
- package/dist/src/modules/agents/registry/quality.d.ts +2 -0
- package/dist/src/modules/agents/registry/quality.js +41 -0
- package/dist/src/modules/agents/registry/quality.js.map +1 -0
- package/dist/src/modules/agents/registry/security.d.ts +2 -0
- package/dist/src/modules/agents/registry/security.js +37 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -0
- package/dist/src/modules/agents/types.d.ts +31 -0
- package/dist/src/modules/agents/types.js +2 -0
- package/dist/src/modules/agents/types.js.map +1 -0
- package/dist/src/modules/skills/definitions.d.ts +1 -1
- package/dist/src/modules/skills/definitions.js +1 -1
- package/dist/src/shared/errors.d.ts +8 -6
- package/dist/src/shared/errors.js +13 -10
- package/dist/src/shared/errors.js.map +1 -1
- package/dist/src/shared/fs.d.ts +4 -0
- package/dist/src/shared/fs.js +17 -2
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/types.d.ts +19 -0
- package/dist/src/shared/types.js +13 -0
- package/dist/src/shared/types.js.map +1 -0
- package/package.json +3 -5
- package/src/cli/adapters/core.ts +0 -1
- package/src/cli/adapters/scaffold.ts +4 -3
- package/src/cli/commands/app.ts +23 -5
- package/src/cli/commands/approve.ts +15 -7
- package/src/cli/commands/check.ts +38 -5
- package/src/cli/commands/compliance.ts +1 -1
- package/src/cli/commands/contract.ts +20 -14
- package/src/cli/commands/dashboard/data-service.ts +119 -0
- package/src/cli/commands/dashboard/html-template.ts +696 -0
- package/src/cli/commands/dashboard/server.ts +43 -0
- package/src/cli/commands/dashboard.ts +11 -0
- package/src/cli/commands/explorer.ts +2 -2
- package/src/cli/commands/git.ts +2 -2
- package/src/cli/commands/init/scaffold-core.ts +71 -0
- package/src/cli/commands/init/scaffold-ops.ts +86 -0
- package/src/cli/commands/init/scaffold-standards.ts +59 -0
- package/src/cli/commands/init.ts +21 -292
- package/src/cli/commands/knowledge.ts +5 -3
- package/src/cli/commands/lint.ts +2 -4
- package/src/cli/commands/log.ts +4 -2
- package/src/cli/commands/memory.ts +1 -1
- package/src/cli/commands/orchestrate.ts +177 -142
- package/src/cli/commands/plan.ts +1 -1
- package/src/cli/commands/script.ts +1 -1
- package/src/cli/commands/security.ts +1 -1
- package/src/cli/commands/status.ts +1 -1
- package/src/cli/commands/trace.ts +1 -1
- package/src/cli/index.ts +37 -21
- package/src/cli/shims.ts +6 -6
- package/src/cli/utils/app-backend.ts +8 -0
- package/src/cli/utils/app-docs.ts +23 -5
- package/src/cli/utils/app-frontend.ts +6 -0
- package/src/cli/utils/app-inferrer.ts +11 -1
- package/src/cli/utils/app-mobile.ts +113 -0
- package/src/cli/utils/app-types.ts +9 -4
- package/src/cli/utils/app.ts +1 -0
- package/src/cli/utils/claude.ts +2 -1
- package/src/cli/utils/compliance.ts +38 -7
- package/src/cli/utils/config-schema.ts +4 -4
- package/src/cli/utils/fs.ts +9 -14
- package/src/cli/utils/memory.ts +103 -20
- package/src/cli/utils/pkg.ts +14 -13
- package/src/cli/utils/string.ts +1 -1
- package/src/cli/utils/ui.ts +1 -1
- package/src/modules/adapters/shared.ts +7 -7
- package/src/modules/agents/definitions.ts +39 -598
- package/src/modules/agents/registry/analyst.ts +40 -0
- package/src/modules/agents/registry/architect.ts +46 -0
- package/src/modules/agents/registry/backend.ts +47 -0
- package/src/modules/agents/registry/database.ts +42 -0
- package/src/modules/agents/registry/devops.ts +42 -0
- package/src/modules/agents/registry/explorer.ts +40 -0
- package/src/modules/agents/registry/frontend.ts +48 -0
- package/src/modules/agents/registry/git.ts +39 -0
- package/src/modules/agents/registry/manager.ts +53 -0
- package/src/modules/agents/registry/mobile.ts +44 -0
- package/src/modules/agents/registry/native.ts +40 -0
- package/src/modules/agents/registry/quality.ts +45 -0
- package/src/modules/agents/registry/security.ts +41 -0
- package/src/modules/agents/types.ts +37 -0
- package/src/modules/skills/definitions.ts +1 -1
- package/src/shared/errors.ts +13 -10
- package/src/shared/fs.ts +17 -2
- package/src/shared/types.ts +20 -0
- package/bin/utils/docgen.ts +0 -24
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import http from "http";
|
|
2
|
+
import { parseProjectMemory, readManagerLogs, listAgents } from "./data-service.js";
|
|
3
|
+
import { HTML_CONTENT } from "./html-template.js";
|
|
4
|
+
|
|
5
|
+
export function startDashboardServer(port: number = 5858) {
|
|
6
|
+
const server = http.createServer((req, res) => {
|
|
7
|
+
// API: Status
|
|
8
|
+
if (req.url === "/api/status") {
|
|
9
|
+
const mem = parseProjectMemory();
|
|
10
|
+
const logs = readManagerLogs();
|
|
11
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
12
|
+
res.end(JSON.stringify({ ...mem, logs }));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// API: Agents list
|
|
17
|
+
if (req.url === "/api/agents") {
|
|
18
|
+
const list = listAgents();
|
|
19
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
20
|
+
res.end(JSON.stringify(list));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Static HTML Serve
|
|
25
|
+
if (req.url === "/" || req.url === "/index.html") {
|
|
26
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=UTF-8" });
|
|
27
|
+
res.end(HTML_CONTENT);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Fallback 404
|
|
32
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
33
|
+
res.end("Not Found");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
server.listen(port, () => {
|
|
37
|
+
process.stdout.write("================================================================================\n");
|
|
38
|
+
process.stdout.write(`๐ฅ๏ธ AGENT ENDERUN LIVE MONITOR SERVED AT: http://localhost:${port}\n`);
|
|
39
|
+
process.stdout.write("================================================================================\n");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return server;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { startDashboardServer } from "./dashboard/server.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Launch the Agent Enderun Visual Monitor.
|
|
5
|
+
*/
|
|
6
|
+
export async function dashboardCommand(args: string[]) {
|
|
7
|
+
const portArg = args.find(a => a.startsWith("--port="));
|
|
8
|
+
const port = portArg ? parseInt(portArg.split("=")[1]) : 5858;
|
|
9
|
+
|
|
10
|
+
startDashboardServer(port);
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@ import { collectFiles } from "../utils/fs.js";
|
|
|
5
5
|
|
|
6
6
|
const targetDir = process.cwd();
|
|
7
7
|
|
|
8
|
-
export function explorerGraphCommand(targetPath: string) {
|
|
8
|
+
export async function explorerGraphCommand(targetPath: string) {
|
|
9
9
|
console.warn(`๐บ๏ธ Generating Dependency Graph for: ${targetPath}...`);
|
|
10
10
|
const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
|
|
11
11
|
const edges: string[] = [];
|
|
@@ -27,7 +27,7 @@ export function explorerGraphCommand(targetPath: string) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export function explorerAuditCommand(targetPath: string) {
|
|
30
|
+
export async function explorerAuditCommand(targetPath: string) {
|
|
31
31
|
console.warn(`๐ง Codebase Intelligence Scan: ${targetPath}...`);
|
|
32
32
|
const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
|
|
33
33
|
const complexity: string[] = [];
|
package/src/cli/commands/git.ts
CHANGED
|
@@ -2,7 +2,7 @@ import cp from "child_process";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { getConfiguredPaths } from "../utils/memory.js";
|
|
4
4
|
|
|
5
|
-
export function gitCommitCommand(traceId: string) {
|
|
5
|
+
export async function gitCommitCommand(traceId: string) {
|
|
6
6
|
try {
|
|
7
7
|
const diff = cp.execSync("git diff --staged", { encoding: "utf8" });
|
|
8
8
|
if (!diff) {
|
|
@@ -28,7 +28,7 @@ export function gitCommitCommand(traceId: string) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export function gitSyncCommand() {
|
|
31
|
+
export async function gitSyncCommand() {
|
|
32
32
|
console.warn("๐ Syncing with remote repository...");
|
|
33
33
|
try {
|
|
34
34
|
cp.execSync("git pull origin main --rebase", { stdio: "inherit" });
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import {
|
|
4
|
+
remapFrameworkContent,
|
|
5
|
+
type AdapterConfig,
|
|
6
|
+
type AdapterId
|
|
7
|
+
} from "../../adapters/index.js";
|
|
8
|
+
import { SHIM_TEMPLATES } from "../../shims.js";
|
|
9
|
+
import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
|
|
10
|
+
import { getPackageRoot, getPackageVersion } from "../../utils/pkg.js";
|
|
11
|
+
import { ALL_AGENTS } from "../../../modules/agents/definitions.js";
|
|
12
|
+
|
|
13
|
+
const FRAMEWORK_NAME = "Agent Enderun";
|
|
14
|
+
|
|
15
|
+
const COLOR_PALETTES = {
|
|
16
|
+
"Modern Blue": { primary: "#0ea5e9", secondary: "#64748b", accent: "#f43f5e" },
|
|
17
|
+
"Enterprise Slate": { primary: "#334155", secondary: "#94a3b8", accent: "#10b981" },
|
|
18
|
+
"Deep Purple": { primary: "#8b5cf6", secondary: "#d8b4fe", accent: "#f59e0b" }
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function scaffoldConstitution(targetDir: string, frameworkDir: string, adapterId: AdapterId, dryRun: boolean) {
|
|
22
|
+
if (dryRun) return;
|
|
23
|
+
let content = `# ๐๏ธ ${FRAMEWORK_NAME} โ Constitution (v${getPackageVersion()})\n\nDiscipline and Order.`;
|
|
24
|
+
let readSuccess = false;
|
|
25
|
+
try {
|
|
26
|
+
const templatePath = path.join(getPackageRoot(), "ENDERUN.md");
|
|
27
|
+
if (fs.existsSync(templatePath)) {
|
|
28
|
+
content = fs.readFileSync(templatePath, "utf8");
|
|
29
|
+
readSuccess = true;
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
console.warn(`โ ๏ธ Failed to read global constitution template: ${e}`);
|
|
33
|
+
}
|
|
34
|
+
content = remapFrameworkContent(content, frameworkDir, adapterId);
|
|
35
|
+
const destPath = path.join(targetDir, frameworkDir, "ENDERUN.md");
|
|
36
|
+
writeTextFile(destPath, content);
|
|
37
|
+
|
|
38
|
+
console.warn(`โ
Constitution file created inside: ${frameworkDir}/ENDERUN.md${readSuccess ? "" : " (default template)"}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function scaffoldFrameworkConfigs(targetDir: string, fDir: string, adapter: AdapterConfig, dryRun: boolean, selectedPalette: string) {
|
|
42
|
+
if (dryRun) return;
|
|
43
|
+
const frameworkDir = path.join(targetDir, fDir);
|
|
44
|
+
const palette = COLOR_PALETTES[selectedPalette as keyof typeof COLOR_PALETTES] || COLOR_PALETTES["Modern Blue"];
|
|
45
|
+
|
|
46
|
+
const config = {
|
|
47
|
+
name: FRAMEWORK_NAME,
|
|
48
|
+
version: getPackageVersion(),
|
|
49
|
+
theme: {
|
|
50
|
+
palette: selectedPalette,
|
|
51
|
+
colors: palette
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
writeJsonFile(path.join(frameworkDir, "config.json"), config, dryRun);
|
|
55
|
+
let statusContent = "# ๐๏ธ Status\n\n| Agent | State | Active Task | Last Updated | Notes | Extra | Backup |\n|---|---|---|---|---|---|---|\n";
|
|
56
|
+
for (const ag of ALL_AGENTS) {
|
|
57
|
+
statusContent += "| @" + ag.name + " | READY | Idle | - | - | - | - |\n";
|
|
58
|
+
}
|
|
59
|
+
writeTextFile(path.join(frameworkDir, "STATUS.md"), statusContent);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function scaffoldShims(projectRoot: string, coreDir: string, adapterId: AdapterId, adapter: AdapterConfig, dryRun: boolean) {
|
|
63
|
+
for (const [name, content] of Object.entries(SHIM_TEMPLATES)) {
|
|
64
|
+
if (name.toLowerCase() === adapterId.split("-")[0] || name === adapterId) {
|
|
65
|
+
const shimContent = remapFrameworkContent(content, coreDir, adapterId);
|
|
66
|
+
const shimFileName = adapter.shimFile || `${name.toUpperCase()}.md`;
|
|
67
|
+
if (!dryRun) writeTextFile(path.join(projectRoot, shimFileName), shimContent);
|
|
68
|
+
console.warn(`โ
Platform shim created: ${shimFileName}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
|
|
4
|
+
import { getPackageRoot } from "../../utils/pkg.js";
|
|
5
|
+
import { logger } from "../../../shared/logger.js";
|
|
6
|
+
|
|
7
|
+
export function scaffoldOps(frameworkDir: string, dryRun: boolean) {
|
|
8
|
+
if (dryRun) return;
|
|
9
|
+
|
|
10
|
+
// Scaffold Prompt Recipes
|
|
11
|
+
const promptsPath = path.join(frameworkDir, "prompts");
|
|
12
|
+
if (!fs.existsSync(promptsPath)) fs.mkdirSync(promptsPath, { recursive: true });
|
|
13
|
+
|
|
14
|
+
const recipes = [
|
|
15
|
+
{ file: "refactoring-recipe.md", template: "templates/prompts/refactoring-recipe.md" },
|
|
16
|
+
{ file: "bug-fix-recipe.md", template: "templates/prompts/bug-fix-recipe.md" },
|
|
17
|
+
{ file: "new-feature-recipe.md", template: "templates/prompts/new-feature-recipe.md" },
|
|
18
|
+
{ file: "security-audit-recipe.md", template: "templates/prompts/security-audit-recipe.md" },
|
|
19
|
+
{ file: "db-management-recipe.md", template: "templates/prompts/db-management-recipe.md" },
|
|
20
|
+
{ file: "performance-optimization-recipe.md", template: "templates/prompts/performance-optimization-recipe.md" },
|
|
21
|
+
{ file: "deployment-recipe.md", template: "templates/prompts/deployment-recipe.md" },
|
|
22
|
+
{ file: "contract-design-recipe.md", template: "templates/prompts/contract-design-recipe.md" }
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
for (const recipe of recipes) {
|
|
26
|
+
try {
|
|
27
|
+
const fullTemplatePath = path.join(getPackageRoot(), recipe.template);
|
|
28
|
+
if (fs.existsSync(fullTemplatePath)) {
|
|
29
|
+
const content = fs.readFileSync(fullTemplatePath, "utf8");
|
|
30
|
+
writeTextFile(path.join(promptsPath, recipe.file), content);
|
|
31
|
+
}
|
|
32
|
+
} catch (e) {
|
|
33
|
+
logger.debug(`Failed to scaffold prompt recipe: ${recipe.file}`, e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Scaffold cli-commands.json
|
|
38
|
+
const cliCommands = {
|
|
39
|
+
commands: {
|
|
40
|
+
init: { agent: "manager", description: "Initialize Agent Enderun structure and AI configuration." },
|
|
41
|
+
check: { agent: "quality", description: "Verify framework files and code quality discipline." },
|
|
42
|
+
status: { agent: "manager", description: "Show the current status of the active project phase." },
|
|
43
|
+
"trace:new": { agent: "manager", description: "Generate a new Trace ID to start a task sequence." },
|
|
44
|
+
orchestrate: { agent: "manager", description: "Execute the Hermes message broker loop." },
|
|
45
|
+
"verify-contract": { agent: "architect", description: "Validate type contracts between backend and frontend." },
|
|
46
|
+
"update-contract": { agent: "architect", description: "Update the contract signature hash." }
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
writeJsonFile(path.join(frameworkDir, "cli-commands.json"), cliCommands, dryRun);
|
|
50
|
+
|
|
51
|
+
// Scaffold BRAIN_DASHBOARD.md
|
|
52
|
+
writeTextFile(path.join(frameworkDir, "BRAIN_DASHBOARD.md"), "# ๐ง Brain Dashboard\n\nActive Trace: T-000\nActive Phase: PHASE_0 (Genesis)\n\n## Agent Statuses\n- @manager: READY\n- @architect: READY\n- @backend: READY\n- @frontend: READY\n- @quality: READY\n");
|
|
53
|
+
|
|
54
|
+
// Scaffold router/routing_rules.md
|
|
55
|
+
const routerDir = path.join(frameworkDir, "router");
|
|
56
|
+
if (!fs.existsSync(routerDir)) fs.mkdirSync(routerDir, { recursive: true });
|
|
57
|
+
writeTextFile(path.join(routerDir, "routing_rules.md"), "# ๐ก Agent Enderun โ Natural Language & Event Router\n\nRouting engine protocols defined here.");
|
|
58
|
+
|
|
59
|
+
// Scaffold registry/agent_registry.md
|
|
60
|
+
const registryDir = path.join(frameworkDir, "registry");
|
|
61
|
+
if (!fs.existsSync(registryDir)) fs.mkdirSync(registryDir, { recursive: true });
|
|
62
|
+
writeTextFile(path.join(registryDir, "agent_registry.md"), "# ๐๏ธ Agent Enderun โ Army Registry\n\nList of active agents.");
|
|
63
|
+
|
|
64
|
+
// Scaffold observability files
|
|
65
|
+
const obsDir = path.join(frameworkDir, "observability");
|
|
66
|
+
if (!fs.existsSync(obsDir)) fs.mkdirSync(obsDir, { recursive: true });
|
|
67
|
+
writeTextFile(path.join(obsDir, "audit_log.md"), "# ๐๏ธ Agent Enderun โ Audit Log\n\n| Timestamp | Agent | Action | Trace ID | Status |\n|---|---|---|---|---|\n");
|
|
68
|
+
writeJsonFile(path.join(obsDir, "metrics.json"), []);
|
|
69
|
+
|
|
70
|
+
// Scaffold .env.example
|
|
71
|
+
const envExamplePath = path.join(process.cwd(), ".env.example");
|
|
72
|
+
if (!fs.existsSync(envExamplePath)) {
|
|
73
|
+
writeTextFile(envExamplePath, "# Agent Enderun - Environment Variables\n\n# Core Settings\nPORT=5858\nNODE_ENV=development\n\n# AI Platform Keys (Fill these in your local .env)\nGEMINI_API_KEY=\nCLAUDE_API_KEY=\nGROK_API_KEY=\n");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Scaffold rules
|
|
77
|
+
const rulesDir = path.join(frameworkDir, "rules");
|
|
78
|
+
if (!fs.existsSync(rulesDir)) fs.mkdirSync(rulesDir, { recursive: true });
|
|
79
|
+
writeTextFile(path.join(rulesDir, "global_rules.mdc"), `---
|
|
80
|
+
description: Global Rules for Agent Enderun Army
|
|
81
|
+
globs: **/*
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
# ๐๏ธ Agent Enderun โ Global Army Rules
|
|
85
|
+
`);
|
|
86
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { ensureDir, writeTextFile } from "../../utils/fs.js";
|
|
4
|
+
import { getPackageRoot } from "../../utils/pkg.js";
|
|
5
|
+
import { CORE_SKILLS } from "../../../modules/skills/definitions.js";
|
|
6
|
+
|
|
7
|
+
const FRAMEWORK_NAME = "Agent Enderun";
|
|
8
|
+
|
|
9
|
+
export function scaffoldSkills(skillsBaseDir: string, dryRun: boolean) {
|
|
10
|
+
if (dryRun) return;
|
|
11
|
+
ensureDir(skillsBaseDir, dryRun);
|
|
12
|
+
for (const [key, skill] of Object.entries(CORE_SKILLS)) {
|
|
13
|
+
const mdContent = `# ๐ ๏ธ ${FRAMEWORK_NAME} Skill โ ${skill.name}\n\n${skill.description}\n\n## ๐ Associated Tools\n${skill.tools.map(t => `- \`${t}\``).join("\n")}\n\n## ๐ก๏ธ Core Mandates\n${skill.mandates.join("\n")}\n`;
|
|
14
|
+
writeTextFile(path.join(skillsBaseDir, `${key.toLowerCase()}.md`), mdContent);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function scaffoldStandards(frameworkDir: string, dryRun: boolean) {
|
|
19
|
+
if (dryRun) return;
|
|
20
|
+
const knowledgePath = path.join(frameworkDir, "knowledge");
|
|
21
|
+
if (!fs.existsSync(knowledgePath)) fs.mkdirSync(knowledgePath, { recursive: true });
|
|
22
|
+
|
|
23
|
+
const eslintStandardsContent = `# ๐๏ธ Agent Enderun โ ESLint Standards
|
|
24
|
+
|
|
25
|
+
This document outlines the strict ESLint coding standards for Agent Enderun projects.
|
|
26
|
+
|
|
27
|
+
## ๐ Core Rules
|
|
28
|
+
- **Indentation:** 4 spaces (strict).
|
|
29
|
+
- **Quotes:** Double quotes (\`"\`) for strings.
|
|
30
|
+
- **Semicolons:** Always terminate statements with a semicolon (\`;\`).
|
|
31
|
+
- **No Explicit Any:** Avoid using \`any\`. Use strongly typed interfaces, generics, or \`unknown\` with type assertions.
|
|
32
|
+
- **Unused Variables:** Warning on unused variables unless prefixed with an underscore (\`_\`).
|
|
33
|
+
`;
|
|
34
|
+
writeTextFile(path.join(knowledgePath, "eslint-standards.md"), eslintStandardsContent);
|
|
35
|
+
|
|
36
|
+
const standards = [
|
|
37
|
+
{ file: "crud-governance.md", template: "templates/standards/crud-governance.md", default: "# ๐๏ธ Corporate CRUD and Governance Standards" },
|
|
38
|
+
{ file: "architecture-standards.md", template: "templates/standards/architecture-standards.md", default: "# ๐ Corporate Architecture Standards" },
|
|
39
|
+
{ file: "frontend-standards.md", template: "templates/standards/frontend-standards.md", default: "# ๐จ Corporate Frontend Standards" },
|
|
40
|
+
{ file: "tailwind-standards.md", template: "templates/standards/tailwind-standards.md", default: "# ๐ Corporate Tailwind Standards" },
|
|
41
|
+
{ file: "mobile-standards.md", template: "templates/standards/mobile-standards.md", default: "# ๐ฑ Corporate Mobile Standards" },
|
|
42
|
+
{ file: "security-standards.md", template: "templates/standards/security-standards.md", default: "# ๐ก๏ธ Corporate Security Standards" },
|
|
43
|
+
{ file: "quality-standards.md", template: "templates/standards/quality-standards.md", default: "# โ๏ธ Corporate Code Quality Standards" },
|
|
44
|
+
{ file: "logging-and-secrets.md", template: "templates/standards/logging-and-secrets.md", default: "# ๐ชต Corporate Logging Standards" },
|
|
45
|
+
{ file: "testing-standards.md", template: "templates/standards/testing-standards.md", default: "# ๐งช Corporate Testing Standards" },
|
|
46
|
+
{ file: "i18n-standards.md", template: "templates/standards/i18n-standards.md", default: "# ๐ Corporate i18n Standards" }
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
for (const std of standards) {
|
|
50
|
+
let content = std.default;
|
|
51
|
+
try {
|
|
52
|
+
const fullTemplatePath = path.join(getPackageRoot(), std.template);
|
|
53
|
+
if (fs.existsSync(fullTemplatePath)) {
|
|
54
|
+
content = fs.readFileSync(fullTemplatePath, "utf8");
|
|
55
|
+
}
|
|
56
|
+
} catch { /* fallback to default */ }
|
|
57
|
+
writeTextFile(path.join(knowledgePath, std.file), content);
|
|
58
|
+
}
|
|
59
|
+
}
|