atabey 0.0.9 → 0.0.11

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.
Files changed (163) hide show
  1. package/README.md +1 -1
  2. package/dist/framework-mcp/src/tools/file_system/read_file.js +7 -7
  3. package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
  4. package/dist/framework-mcp/src/tools/file_system/write_file.js +12 -0
  5. package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
  6. package/dist/framework-mcp/src/tools/memory/get_insights.d.ts +2 -2
  7. package/dist/framework-mcp/src/tools/memory/get_insights.js +9 -21
  8. package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
  9. package/dist/src/cli/commands/init.js +49 -0
  10. package/dist/src/cli/commands/init.js.map +1 -1
  11. package/dist/src/cli/utils/pkg.js +1 -1
  12. package/dist/src/cli/utils/pkg.js.map +1 -1
  13. package/dist/src/modules/agents/registry/analyst.js +0 -1
  14. package/dist/src/modules/agents/registry/analyst.js.map +1 -1
  15. package/dist/src/modules/agents/registry/architect.js +0 -1
  16. package/dist/src/modules/agents/registry/architect.js.map +1 -1
  17. package/dist/src/modules/agents/registry/backend.js +0 -1
  18. package/dist/src/modules/agents/registry/backend.js.map +1 -1
  19. package/dist/src/modules/agents/registry/database.js +1 -1
  20. package/dist/src/modules/agents/registry/database.js.map +1 -1
  21. package/dist/src/modules/agents/registry/devops.js +1 -1
  22. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  23. package/dist/src/modules/agents/registry/explorer.js +0 -1
  24. package/dist/src/modules/agents/registry/explorer.js.map +1 -1
  25. package/dist/src/modules/agents/registry/frontend.js +0 -1
  26. package/dist/src/modules/agents/registry/frontend.js.map +1 -1
  27. package/dist/src/modules/agents/registry/git.js +1 -1
  28. package/dist/src/modules/agents/registry/git.js.map +1 -1
  29. package/dist/src/modules/agents/registry/manager.js +0 -1
  30. package/dist/src/modules/agents/registry/manager.js.map +1 -1
  31. package/dist/src/modules/agents/registry/mobile.js +1 -1
  32. package/dist/src/modules/agents/registry/native.js +1 -1
  33. package/dist/src/modules/agents/registry/native.js.map +1 -1
  34. package/dist/src/modules/agents/registry/quality.js +0 -1
  35. package/dist/src/modules/agents/registry/quality.js.map +1 -1
  36. package/dist/src/modules/agents/registry/security.js +0 -1
  37. package/dist/src/modules/agents/registry/security.js.map +1 -1
  38. package/framework-mcp/README.md +48 -0
  39. package/framework-mcp/dist/index.js +0 -0
  40. package/framework-mcp/dist/resources/index.js +2 -2
  41. package/framework-mcp/dist/tools/file_system/read_file.js +7 -7
  42. package/framework-mcp/dist/tools/file_system/write_file.js +12 -0
  43. package/framework-mcp/dist/tools/memory/get_insights.js +9 -21
  44. package/framework-mcp/package.json +1 -1
  45. package/package.json +2 -2
  46. package/framework-mcp/dist/framework-mcp/src/constants.js +0 -64
  47. package/framework-mcp/dist/framework-mcp/src/index.js +0 -144
  48. package/framework-mcp/dist/framework-mcp/src/resources/index.js +0 -58
  49. package/framework-mcp/dist/framework-mcp/src/tools/control_plane/locking.js +0 -82
  50. package/framework-mcp/dist/framework-mcp/src/tools/control_plane/registry.js +0 -35
  51. package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +0 -322
  52. package/framework-mcp/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +0 -64
  53. package/framework-mcp/dist/framework-mcp/src/tools/file_system/patch_file.js +0 -34
  54. package/framework-mcp/dist/framework-mcp/src/tools/file_system/read_file.js +0 -51
  55. package/framework-mcp/dist/framework-mcp/src/tools/file_system/replace_text.js +0 -50
  56. package/framework-mcp/dist/framework-mcp/src/tools/file_system/write_file.js +0 -43
  57. package/framework-mcp/dist/framework-mcp/src/tools/framework/audit_deps.js +0 -41
  58. package/framework-mcp/dist/framework-mcp/src/tools/framework/get_status.js +0 -5
  59. package/framework-mcp/dist/framework-mcp/src/tools/framework/orchestrate.js +0 -5
  60. package/framework-mcp/dist/framework-mcp/src/tools/framework/run_tests.js +0 -27
  61. package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +0 -13
  62. package/framework-mcp/dist/framework-mcp/src/tools/framework/update_contract_hash.js +0 -5
  63. package/framework-mcp/dist/framework-mcp/src/tools/framework/update_memory.js +0 -8
  64. package/framework-mcp/dist/framework-mcp/src/tools/index.js +0 -62
  65. package/framework-mcp/dist/framework-mcp/src/tools/memory/get_insights.js +0 -34
  66. package/framework-mcp/dist/framework-mcp/src/tools/memory/read_memory.js +0 -28
  67. package/framework-mcp/dist/framework-mcp/src/tools/messaging/log_action.js +0 -22
  68. package/framework-mcp/dist/framework-mcp/src/tools/messaging/send_message.js +0 -94
  69. package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +0 -26
  70. package/framework-mcp/dist/framework-mcp/src/tools/observability/get_health.js +0 -19
  71. package/framework-mcp/dist/framework-mcp/src/tools/quality/check_lint.js +0 -30
  72. package/framework-mcp/dist/framework-mcp/src/tools/search/get_gaps.js +0 -48
  73. package/framework-mcp/dist/framework-mcp/src/tools/search/get_map.js +0 -43
  74. package/framework-mcp/dist/framework-mcp/src/tools/search/grep_search.js +0 -75
  75. package/framework-mcp/dist/framework-mcp/src/tools/search/list_dir.js +0 -28
  76. package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +0 -56
  77. package/framework-mcp/dist/framework-mcp/src/tools/types.js +0 -1
  78. package/framework-mcp/dist/framework-mcp/src/utils/cli.js +0 -59
  79. package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +0 -231
  80. package/framework-mcp/dist/framework-mcp/src/utils/fs.js +0 -44
  81. package/framework-mcp/dist/framework-mcp/src/utils/metrics.js +0 -56
  82. package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +0 -71
  83. package/framework-mcp/dist/framework-mcp/src/utils/security.js +0 -60
  84. package/framework-mcp/dist/src/cli/adapters/core.js +0 -71
  85. package/framework-mcp/dist/src/cli/adapters/index.js +0 -5
  86. package/framework-mcp/dist/src/cli/adapters/paths.js +0 -101
  87. package/framework-mcp/dist/src/cli/adapters/scaffold.js +0 -71
  88. package/framework-mcp/dist/src/cli/adapters/utils.js +0 -75
  89. package/framework-mcp/dist/src/cli/commands/approve.js +0 -63
  90. package/framework-mcp/dist/src/cli/commands/check.js +0 -181
  91. package/framework-mcp/dist/src/cli/commands/compliance.js +0 -50
  92. package/framework-mcp/dist/src/cli/commands/contract.js +0 -50
  93. package/framework-mcp/dist/src/cli/commands/dashboard.js +0 -123
  94. package/framework-mcp/dist/src/cli/commands/explorer.js +0 -42
  95. package/framework-mcp/dist/src/cli/commands/git.js +0 -40
  96. package/framework-mcp/dist/src/cli/commands/init/create-agent.js +0 -58
  97. package/framework-mcp/dist/src/cli/commands/init/scaffold-core.js +0 -112
  98. package/framework-mcp/dist/src/cli/commands/init/scaffold-docs.js +0 -34
  99. package/framework-mcp/dist/src/cli/commands/init/scaffold-ops.js +0 -80
  100. package/framework-mcp/dist/src/cli/commands/init/scaffold-standards.js +0 -67
  101. package/framework-mcp/dist/src/cli/commands/init.js +0 -167
  102. package/framework-mcp/dist/src/cli/commands/knowledge.js +0 -42
  103. package/framework-mcp/dist/src/cli/commands/lint.js +0 -22
  104. package/framework-mcp/dist/src/cli/commands/log.js +0 -10
  105. package/framework-mcp/dist/src/cli/commands/memory.js +0 -4
  106. package/framework-mcp/dist/src/cli/commands/orchestrate.js +0 -159
  107. package/framework-mcp/dist/src/cli/commands/plan.js +0 -117
  108. package/framework-mcp/dist/src/cli/commands/script.js +0 -19
  109. package/framework-mcp/dist/src/cli/commands/security.js +0 -36
  110. package/framework-mcp/dist/src/cli/commands/status.js +0 -97
  111. package/framework-mcp/dist/src/cli/commands/trace.js +0 -109
  112. package/framework-mcp/dist/src/cli/index.js +0 -338
  113. package/framework-mcp/dist/src/cli/shims.js +0 -66
  114. package/framework-mcp/dist/src/cli/utils/claude.js +0 -56
  115. package/framework-mcp/dist/src/cli/utils/compliance.js +0 -173
  116. package/framework-mcp/dist/src/cli/utils/config-schema.js +0 -42
  117. package/framework-mcp/dist/src/cli/utils/fs.js +0 -137
  118. package/framework-mcp/dist/src/cli/utils/i18n.js +0 -30
  119. package/framework-mcp/dist/src/cli/utils/memory.js +0 -276
  120. package/framework-mcp/dist/src/cli/utils/pkg.js +0 -282
  121. package/framework-mcp/dist/src/cli/utils/schemas.js +0 -19
  122. package/framework-mcp/dist/src/cli/utils/string.js +0 -49
  123. package/framework-mcp/dist/src/cli/utils/time.js +0 -27
  124. package/framework-mcp/dist/src/cli/utils/ui.js +0 -58
  125. package/framework-mcp/dist/src/contracts/index.js +0 -1
  126. package/framework-mcp/dist/src/contracts/tasks.js +0 -20
  127. package/framework-mcp/dist/src/dashboard/vite.config.js +0 -15
  128. package/framework-mcp/dist/src/modules/adapters/definitions.js +0 -140
  129. package/framework-mcp/dist/src/modules/adapters/registry.js +0 -18
  130. package/framework-mcp/dist/src/modules/adapters/shared.js +0 -104
  131. package/framework-mcp/dist/src/modules/adapters/types.js +0 -1
  132. package/framework-mcp/dist/src/modules/agents/definitions.js +0 -457
  133. package/framework-mcp/dist/src/modules/agents/registry/analyst.js +0 -39
  134. package/framework-mcp/dist/src/modules/agents/registry/architect.js +0 -42
  135. package/framework-mcp/dist/src/modules/agents/registry/backend.js +0 -49
  136. package/framework-mcp/dist/src/modules/agents/registry/database.js +0 -45
  137. package/framework-mcp/dist/src/modules/agents/registry/devops.js +0 -45
  138. package/framework-mcp/dist/src/modules/agents/registry/explorer.js +0 -36
  139. package/framework-mcp/dist/src/modules/agents/registry/frontend.js +0 -51
  140. package/framework-mcp/dist/src/modules/agents/registry/git.js +0 -36
  141. package/framework-mcp/dist/src/modules/agents/registry/manager.js +0 -53
  142. package/framework-mcp/dist/src/modules/agents/registry/mobile.js +0 -39
  143. package/framework-mcp/dist/src/modules/agents/registry/native.js +0 -39
  144. package/framework-mcp/dist/src/modules/agents/registry/quality.js +0 -41
  145. package/framework-mcp/dist/src/modules/agents/registry/security.js +0 -43
  146. package/framework-mcp/dist/src/modules/agents/types.js +0 -1
  147. package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +0 -102
  148. package/framework-mcp/dist/src/modules/engines/health-engine.js +0 -49
  149. package/framework-mcp/dist/src/modules/engines/planning-engine.js +0 -78
  150. package/framework-mcp/dist/src/modules/engines/risk-engine.js +0 -105
  151. package/framework-mcp/dist/src/modules/engines/routing-engine.js +0 -73
  152. package/framework-mcp/dist/src/modules/engines/types.js +0 -1
  153. package/framework-mcp/dist/src/modules/skills/definitions.js +0 -70
  154. package/framework-mcp/dist/src/shared/constants.js +0 -187
  155. package/framework-mcp/dist/src/shared/errors.js +0 -68
  156. package/framework-mcp/dist/src/shared/fs.js +0 -51
  157. package/framework-mcp/dist/src/shared/logger.js +0 -116
  158. package/framework-mcp/dist/src/shared/storage.js +0 -207
  159. package/framework-mcp/dist/src/shared/types.js +0 -12
  160. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/errors.js +0 -0
  161. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/memory.js +0 -0
  162. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/storage.js +0 -0
  163. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/types.js +0 -0
@@ -1,123 +0,0 @@
1
- import http from "http";
2
- import fs from "fs";
3
- import path from "path";
4
- import { fileURLToPath } from "url";
5
- import { getFrameworkDir } from "../utils/memory.js";
6
- import { UI } from "../utils/ui.js";
7
- import { FRAMEWORK } from "../../shared/constants.js";
8
- /**
9
- * Serves a JSON file.
10
- */
11
- function serveJson(res, filePath) {
12
- if (fs.existsSync(filePath)) {
13
- try {
14
- const content = fs.readFileSync(filePath, "utf8");
15
- res.writeHead(200, { "Content-Type": "application/json" });
16
- res.end(content);
17
- }
18
- catch (e) {
19
- res.writeHead(500);
20
- res.end(JSON.stringify({ error: "Read Error", message: e.message }));
21
- }
22
- }
23
- else {
24
- res.writeHead(404);
25
- res.end(JSON.stringify({ error: "Not Found", path: filePath }));
26
- }
27
- }
28
- /**
29
- * Serves a file with specific content type.
30
- */
31
- function serveFile(res, filePath, contentType) {
32
- if (fs.existsSync(filePath)) {
33
- try {
34
- const content = fs.readFileSync(filePath);
35
- res.writeHead(200, { "Content-Type": contentType });
36
- res.end(content);
37
- }
38
- catch (e) {
39
- res.writeHead(500);
40
- res.end(e.message);
41
- }
42
- }
43
- else {
44
- res.writeHead(404);
45
- res.end("Not Found");
46
- }
47
- }
48
- /**
49
- * 🖥️ Hermes Visual Control Plane (Dashboard Server)
50
- * Serves the framework state as a JSON API and the bundled Web UI.
51
- */
52
- export async function dashboardCommand(port = FRAMEWORK.DASHBOARD_PORT) {
53
- const frameworkDir = getFrameworkDir();
54
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
55
- const projectRoot = path.resolve(__dirname, "../../../");
56
- const uiDistPath = path.join(projectRoot, "dist/ui");
57
- const server = http.createServer((req, res) => {
58
- // CORS Headers
59
- res.setHeader("Access-Control-Allow-Origin", "*");
60
- res.setHeader("Access-Control-Allow-Methods", "GET, OPTIONS");
61
- res.setHeader("Access-Control-Allow-Headers", "Content-Type");
62
- if (req.method === "OPTIONS") {
63
- res.writeHead(204);
64
- res.end();
65
- return;
66
- }
67
- const url = req.url || "/";
68
- // API Routes
69
- if (url === "/api/status") {
70
- const statusPath = path.join(frameworkDir, "memory", "status.json");
71
- serveJson(res, statusPath);
72
- return;
73
- }
74
- if (url === "/api/memory") {
75
- const memoryPath = path.join(frameworkDir, "memory", "PROJECT_MEMORY.md");
76
- serveFile(res, memoryPath, "text/markdown");
77
- return;
78
- }
79
- if (url.startsWith("/api/logs/")) {
80
- const agent = url.replace("/api/logs/", "");
81
- const logPath = path.join(frameworkDir, "logs", `${agent}.json`);
82
- serveJson(res, logPath);
83
- return;
84
- }
85
- if (url === "/api/health") {
86
- res.writeHead(200, { "Content-Type": "application/json" });
87
- res.end(JSON.stringify({ status: "healthy", version: "0.0.6", frameworkDir }));
88
- return;
89
- }
90
- // Static UI Serving
91
- let filePath = path.join(uiDistPath, url === "/" ? "index.html" : url);
92
- // Fallback to index.html for SPA routing if file not found
93
- if (!fs.existsSync(filePath) && !url.startsWith("/api")) {
94
- filePath = path.join(uiDistPath, "index.html");
95
- }
96
- if (fs.existsSync(filePath) && !fs.statSync(filePath).isDirectory()) {
97
- const ext = path.extname(filePath).toLowerCase();
98
- const mimeTypes = {
99
- ".html": "text/html",
100
- ".js": "application/javascript",
101
- ".css": "text/css",
102
- ".json": "application/json",
103
- ".png": "image/png",
104
- ".jpg": "image/jpg",
105
- ".gif": "image/gif",
106
- ".svg": "image/svg+xml",
107
- ".ico": "image/x-icon",
108
- };
109
- const contentType = mimeTypes[ext] || "application/octet-stream";
110
- serveFile(res, filePath, contentType);
111
- }
112
- else {
113
- res.writeHead(404, { "Content-Type": "application/json" });
114
- res.end(JSON.stringify({ error: "Not Found", message: "Route not found" }));
115
- }
116
- });
117
- server.listen(port, () => {
118
- UI.success("\n[START] Hermes Visual Control Plane is running!");
119
- UI.success(`[INFO] Web UI: http://localhost:${port}`);
120
- UI.success(`[DATA] API Base: http://localhost:${port}/api`);
121
- UI.warning("\n(Press Ctrl+C to stop the server)\n");
122
- });
123
- }
@@ -1,42 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { collectFiles } from "../utils/fs.js";
4
- const targetDir = process.cwd();
5
- export async function explorerGraphCommand(targetPath) {
6
- console.warn(`🗺️ Generating Dependency Graph for: ${targetPath}...`);
7
- const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
8
- const edges = [];
9
- files.forEach((f) => {
10
- const content = fs.readFileSync(f, "utf8");
11
- const name = path.basename(f, path.extname(f));
12
- const imports = content.match(/from\s+['"]\.\.?\/[^'"]+['"]/g) || [];
13
- imports.forEach((imp) => {
14
- const target = path.basename(imp.split(/['"]/)[1]);
15
- edges.push(`${name} --> ${target}`);
16
- });
17
- });
18
- if (edges.length === 0) {
19
- console.warn("ℹ️ No internal dependencies found.");
20
- }
21
- else {
22
- console.warn("```mermaid\ngraph TD\n" + Array.from(new Set(edges)).join("\n") + "\n```");
23
- }
24
- }
25
- export async function explorerAuditCommand(targetPath) {
26
- console.warn(`[MEMORY] Codebase Intelligence Scan: ${targetPath}...`);
27
- const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
28
- const complexity = [];
29
- files.forEach((f) => {
30
- const content = fs.readFileSync(f, "utf8");
31
- const lines = content.split("\n").length;
32
- if (lines > 300)
33
- complexity.push(`${path.relative(targetDir, f)} (${lines} lines)`);
34
- });
35
- if (complexity.length > 0) {
36
- console.warn("\n[WARN] Complexity Spikes:");
37
- complexity.forEach((c) => console.warn(`- ${c}`));
38
- }
39
- else {
40
- console.warn("[OK] Codebase structure looks clean.");
41
- }
42
- }
@@ -1,40 +0,0 @@
1
- import cp from "child_process";
2
- import path from "path";
3
- import { getConfiguredPaths } from "../utils/memory.js";
4
- export async function gitCommitCommand(traceId) {
5
- try {
6
- const diff = cp.execSync("git diff --staged", { encoding: "utf8" });
7
- if (!diff) {
8
- console.warn("ℹ️ No staged changes found. Use 'git add' first.");
9
- return;
10
- }
11
- const files = cp.execSync("git diff --staged --name-only", { encoding: "utf8" })
12
- .split("\n")
13
- .filter(Boolean);
14
- const pathsMap = getConfiguredPaths();
15
- const backendTypesPath = path.join(pathsMap.backend, "src/types");
16
- let type = "feat";
17
- const scope = "code";
18
- if (files.some((f) => f.includes(".md")))
19
- type = "docs";
20
- else if (files.some((f) => f.includes(backendTypesPath)))
21
- type = "arch";
22
- else if (files.some((f) => f.includes("bin/cli.js")))
23
- type = "fix";
24
- const summary = files.length === 1 ? `update ${path.basename(files[0])}` : `update ${files.length} files`;
25
- console.warn(`\n### SUGGESTED COMMIT MESSAGE ###\n\n[${traceId}] ${type}(${scope}): ${summary}\n`);
26
- }
27
- catch {
28
- console.warn("[ERROR] Git command failed.");
29
- }
30
- }
31
- export async function gitSyncCommand() {
32
- console.warn("🔄 Syncing with remote repository...");
33
- try {
34
- cp.execSync("git pull origin main --rebase", { stdio: "inherit" });
35
- console.warn("[OK] Successfully synced and rebased.");
36
- }
37
- catch {
38
- console.warn("[ERROR] Sync failed. Please resolve conflicts manually.");
39
- }
40
- }
@@ -1,58 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { UI } from "../../utils/ui.js";
4
- import { writeTextFile } from "../../../shared/fs.js";
5
- /**
6
- * Plugin SDK: Creates a new custom agent template.
7
- */
8
- export async function createAgentCommand(name) {
9
- const projectRoot = process.cwd();
10
- const agentsDir = path.join(projectRoot, "src/modules/agents/registry");
11
- if (!fs.existsSync(agentsDir)) {
12
- UI.error("Ajan kayıt dizini bulunamadı. Lütfen Atabey geliştirme ortamında olduğunuzdan emin olun.");
13
- return;
14
- }
15
- const filePath = path.join(agentsDir, `${name}.ts`);
16
- if (fs.existsSync(filePath)) {
17
- UI.error(`Ajan '${name}' zaten mevcut.`);
18
- return;
19
- }
20
- const template = `import { AgentDefinition } from "../types.js";
21
-
22
- const STATE_MACHINE = "../schema/agent-lifecycle-schema.json" as const;
23
-
24
- export const ${name}: AgentDefinition = {
25
- name: "${name}",
26
- displayName: "${name.charAt(0).toUpperCase() + name.slice(1)} Specialist",
27
- role: "Custom Specialty",
28
- description: "Automatically generated custom agent for specific project needs.",
29
- capability: 7,
30
- tier: "core",
31
- tags: ["custom"],
32
- stateMachine: STATE_MACHINE,
33
- tools: [
34
- "read_file",
35
- "write_file",
36
- "replace_text",
37
- "grep_search",
38
- "send_agent_message",
39
- ],
40
- instructions: {
41
- identity: "${name.toUpperCase()} Domain Expert",
42
- mission: "Execute tasks related to ${name} with high precision and following Atabey standards.",
43
- chainOfThought: "1. Analyze Task\\n2. Plan Steps\\n3. Execute\\n4. Verify",
44
- rules: [
45
- "Always maintain type safety.",
46
- "Log all critical actions.",
47
- ],
48
- knowledgeFiles: [],
49
- },
50
- specialties: {
51
- ${name}: 10,
52
- },
53
- };
54
- `;
55
- writeTextFile(filePath, template);
56
- UI.success(`[OK] New agent '${name}' created at src/modules/agents/registry/${name}.ts`);
57
- UI.warning("[INFO] Don't forget to register the agent in src/modules/agents/definitions.ts");
58
- }
@@ -1,112 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { remapFrameworkContent, ADAPTERS } from "../../adapters/index.js";
4
- import { SHIM_TEMPLATES } from "../../shims.js";
5
- import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
6
- import { getPackageRoot, getPackageVersion } from "../../utils/pkg.js";
7
- import { ALL_AGENTS } from "../../../modules/agents/definitions.js";
8
- import { TRANSLATIONS } from "../../utils/i18n.js";
9
- const FRAMEWORK_NAME = "Agent Atabey";
10
- const COLOR_PALETTES = {
11
- "Modern Blue": { primary: "#0ea5e9", secondary: "#64748b", accent: "#f43f5e" },
12
- "Enterprise Slate": { primary: "#334155", secondary: "#94a3b8", accent: "#10b981" },
13
- "Deep Purple": { primary: "#8b5cf6", secondary: "#d8b4fe", accent: "#f59e0b" }
14
- };
15
- export function scaffoldConstitution(targetDir, frameworkDir, adapterId, dryRun, language = "tr") {
16
- if (dryRun)
17
- return;
18
- const t = TRANSLATIONS[language];
19
- let content = `# [ATABEY] ${t.constitution_title}\n\nDiscipline and Order.`;
20
- let readSuccess = false;
21
- try {
22
- const templatePath = path.join(getPackageRoot(), "ATABEY.md");
23
- if (fs.existsSync(templatePath)) {
24
- content = fs.readFileSync(templatePath, "utf8");
25
- readSuccess = true;
26
- }
27
- }
28
- catch (e) {
29
- console.warn(`[WARN] Failed to read global constitution template: ${e}`);
30
- }
31
- content = remapFrameworkContent(content, frameworkDir, adapterId);
32
- const destPath = path.join(targetDir, frameworkDir, "ATABEY.md");
33
- writeTextFile(destPath, content);
34
- console.warn(`[OK] Constitution file created inside: ${frameworkDir}/ATABEY.md${readSuccess ? "" : " (default template)"}`);
35
- }
36
- export function scaffoldFrameworkConfigs(targetDir, fDir, adapter, dryRun, selectedPalette, options) {
37
- if (dryRun)
38
- return;
39
- const frameworkDir = path.join(targetDir, fDir);
40
- const palette = COLOR_PALETTES[selectedPalette] || COLOR_PALETTES["Modern Blue"];
41
- const language = options?.language || "tr";
42
- const t = TRANSLATIONS[language];
43
- const config = {
44
- name: FRAMEWORK_NAME,
45
- version: getPackageVersion(),
46
- unified: options?.unified || false,
47
- adapters: options?.adapters || [adapter.id],
48
- backendLanguage: options?.backendLanguage || "Node.js (TypeScript)",
49
- frontendFramework: options?.frontendFramework || "Vite (React)",
50
- language: language,
51
- theme: {
52
- palette: selectedPalette,
53
- colors: palette
54
- }
55
- };
56
- writeJsonFile(path.join(frameworkDir, "config.json"), config, dryRun);
57
- // Scaffold shared-facts.json in memory-graph
58
- const graphDir = path.join(frameworkDir, "memory-graph");
59
- if (!fs.existsSync(graphDir))
60
- fs.mkdirSync(graphDir, { recursive: true });
61
- const sharedFactsPath = path.join(graphDir, "shared-facts.json");
62
- if (!fs.existsSync(sharedFactsPath)) {
63
- writeJsonFile(sharedFactsPath, {
64
- project: FRAMEWORK_NAME,
65
- initializedAt: new Date().toISOString(),
66
- stack: [
67
- options?.backendLanguage || "Node.js (TypeScript)",
68
- options?.frontendFramework || "Vite (React)"
69
- ],
70
- language: language,
71
- policies: []
72
- }, dryRun);
73
- }
74
- let statusContent = `# [ATABEY] ${t.status_title}\n\n| Agent | State | Active Task | Last Updated | Notes | Extra | Backup |\n|---|---|---|---|---|---|---|\n`;
75
- const activeAgents = ALL_AGENTS;
76
- const initialStatusJson = {};
77
- const now = new Date().toISOString();
78
- for (const ag of activeAgents) {
79
- statusContent += "| @" + ag.name + " | " + t.agent_ready + " | Idle | - | - | - | - |\n";
80
- initialStatusJson[ag.name] = { state: "READY", task: "Idle", lastUpdated: now };
81
- }
82
- writeTextFile(path.join(frameworkDir, "STATUS.md"), statusContent);
83
- // Populate initial status.json
84
- const statusJsonPath = path.join(frameworkDir, "memory", "status.json");
85
- if (!fs.existsSync(path.join(frameworkDir, "memory")))
86
- fs.mkdirSync(path.join(frameworkDir, "memory"), { recursive: true });
87
- writeJsonFile(statusJsonPath, initialStatusJson, dryRun);
88
- }
89
- export function scaffoldShims(projectRoot, coreDir, adapterId, adapter, dryRun, unified = false) {
90
- for (const [name, content] of Object.entries(SHIM_TEMPLATES)) {
91
- // Normalize: "antigravity-cli" template key needs exact match or prefix match
92
- const isSelectedAdapter = name === adapterId ||
93
- name.toLowerCase() === adapterId.split("-")[0].toLowerCase();
94
- if (unified || isSelectedAdapter) {
95
- const shimContent = remapFrameworkContent(content, coreDir, adapterId);
96
- // In unified mode, each adapter writes its OWN shimFile name.
97
- // In single-adapter mode, use selected adapter's shimFile.
98
- const shimAdapter = ADAPTERS[name] || adapter;
99
- const shimFileName = (unified && !isSelectedAdapter)
100
- ? (shimAdapter.shimFile || `${name.toUpperCase()}.md`) // each adapter's own file
101
- : (adapter.shimFile || `${name.toUpperCase()}.md`); // selected adapter's file
102
- if (!dryRun)
103
- writeTextFile(path.join(projectRoot, shimFileName), shimContent);
104
- if (isSelectedAdapter) {
105
- console.warn(`[OK] Platform shim created: ${shimFileName}`);
106
- }
107
- else if (unified) {
108
- console.warn(`[OK] Unified platform shim added: ${shimFileName}`);
109
- }
110
- }
111
- }
112
- }
@@ -1,34 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { writeTextFile } from "../../utils/fs.js";
4
- import { getPackageRoot } from "../../utils/pkg.js";
5
- import { logger } from "../../../shared/logger.js";
6
- export function scaffoldProjectDocs(projectRoot, options, dryRun) {
7
- if (dryRun)
8
- return;
9
- const docsDir = path.join(projectRoot, "docs");
10
- if (!fs.existsSync(docsDir))
11
- fs.mkdirSync(docsDir, { recursive: true });
12
- // Scaffold tech-stack.md with dynamic content
13
- const techStackPath = path.join(docsDir, "tech-stack.md");
14
- let techStackContent = "";
15
- try {
16
- const templatePath = path.join(getPackageRoot(), "docs/tech-stack.md");
17
- if (fs.existsSync(templatePath)) {
18
- techStackContent = fs.readFileSync(templatePath, "utf8");
19
- // Replace the backend language in the template
20
- const lang = options.backendLanguage;
21
- const frontend = options.frontendFramework || "Vite (React)";
22
- techStackContent = techStackContent.replace(/\| \*\*Geliştirme Ortamı\*\* \| .* \|/, `| **Geliştirme Ortamı** | ${lang} |`);
23
- techStackContent = techStackContent.replace(/\| \*\*Frontend Altyapısı\*\* \| .* \|/, `| **Frontend Altyapısı** | ${frontend} |`);
24
- }
25
- }
26
- catch (e) {
27
- logger.debug("Failed to read tech-stack.md template", e);
28
- }
29
- if (!techStackContent) {
30
- techStackContent = `# 🛠️ Project Tech Stack\n\n- **Backend Language:** ${options.backendLanguage}\n- **Frontend Framework:** ${options.frontendFramework || "Vite (React)"}\n`;
31
- }
32
- writeTextFile(techStackPath, techStackContent);
33
- console.warn(`[OK] Project documentation updated: docs/tech-stack.md (Backend: ${options.backendLanguage}, Frontend: ${options.frontendFramework || "Vite (React)"})`);
34
- }
@@ -1,80 +0,0 @@
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
- export function scaffoldOps(frameworkDir, dryRun) {
7
- if (dryRun)
8
- return;
9
- // Scaffold Prompt Recipes
10
- const promptsPath = path.join(frameworkDir, "prompts");
11
- if (!fs.existsSync(promptsPath))
12
- fs.mkdirSync(promptsPath, { recursive: true });
13
- const recipes = [
14
- { file: "refactoring-recipe.md", template: "templates/prompts/refactoring-recipe.md" },
15
- { file: "bug-fix-recipe.md", template: "templates/prompts/bug-fix-recipe.md" },
16
- { file: "new-feature-recipe.md", template: "templates/prompts/new-feature-recipe.md" },
17
- { file: "security-audit-recipe.md", template: "templates/prompts/security-audit-recipe.md" },
18
- { file: "db-management-recipe.md", template: "templates/prompts/db-management-recipe.md" },
19
- { file: "performance-optimization-recipe.md", template: "templates/prompts/performance-optimization-recipe.md" },
20
- { file: "deployment-recipe.md", template: "templates/prompts/deployment-recipe.md" },
21
- { file: "contract-design-recipe.md", template: "templates/prompts/contract-design-recipe.md" }
22
- ];
23
- for (const recipe of recipes) {
24
- try {
25
- const fullTemplatePath = path.join(getPackageRoot(), recipe.template);
26
- if (fs.existsSync(fullTemplatePath)) {
27
- const content = fs.readFileSync(fullTemplatePath, "utf8");
28
- writeTextFile(path.join(promptsPath, recipe.file), content);
29
- }
30
- }
31
- catch (e) {
32
- logger.debug(`Failed to scaffold prompt recipe: ${recipe.file}`, e);
33
- }
34
- }
35
- // Scaffold cli-commands.json
36
- const cliCommands = {
37
- commands: {
38
- init: { agent: "manager", description: "Initialize Agent Atabey structure and AI configuration." },
39
- check: { agent: "quality", description: "Verify framework files and code quality discipline." },
40
- status: { agent: "manager", description: "Show the current status of the active project phase." },
41
- "trace:new": { agent: "manager", description: "Generate a new Trace ID to start a task sequence." },
42
- orchestrate: { agent: "manager", description: "Execute the Hermes message broker loop." },
43
- "verify-contract": { agent: "architect", description: "Validate type contracts between backend and frontend." },
44
- "update-contract": { agent: "architect", description: "Update the contract signature hash." }
45
- }
46
- };
47
- writeJsonFile(path.join(frameworkDir, "cli-commands.json"), cliCommands, dryRun);
48
- // Scaffold router/routing_rules.md
49
- const routerDir = path.join(frameworkDir, "router");
50
- if (!fs.existsSync(routerDir))
51
- fs.mkdirSync(routerDir, { recursive: true });
52
- writeTextFile(path.join(routerDir, "routing_rules.md"), "# [SIGNAL] Agent Atabey — Natural Language & Event Router\n\nRouting engine protocols defined here.");
53
- // Scaffold registry/agent_registry.md
54
- const registryDir = path.join(frameworkDir, "registry");
55
- if (!fs.existsSync(registryDir))
56
- fs.mkdirSync(registryDir, { recursive: true });
57
- writeTextFile(path.join(registryDir, "agent_registry.md"), "# [ATABEY] Agent Atabey — Army Registry\n\nList of active agents.");
58
- // Scaffold observability files
59
- const obsDir = path.join(frameworkDir, "observability");
60
- if (!fs.existsSync(obsDir))
61
- fs.mkdirSync(obsDir, { recursive: true });
62
- writeTextFile(path.join(obsDir, "audit_log.md"), "# [ATABEY] Agent Atabey — Audit Log\n\n| Timestamp | Agent | Action | Trace ID | Status |\n|---|---|---|---|---|\n");
63
- writeJsonFile(path.join(obsDir, "metrics.json"), []);
64
- // Scaffold .env.example
65
- const envExamplePath = path.join(process.cwd(), ".env.example");
66
- if (!fs.existsSync(envExamplePath)) {
67
- writeTextFile(envExamplePath, "# Agent Atabey - 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");
68
- }
69
- // Scaffold rules
70
- const rulesDir = path.join(frameworkDir, "rules");
71
- if (!fs.existsSync(rulesDir))
72
- fs.mkdirSync(rulesDir, { recursive: true });
73
- writeTextFile(path.join(rulesDir, "global_rules.mdc"), `---
74
- description: Global Rules for Agent Atabey Army
75
- globs: **/*
76
- ---
77
-
78
- # [ATABEY] Agent Atabey — Global Army Rules
79
- `);
80
- }
@@ -1,67 +0,0 @@
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
- const FRAMEWORK_NAME = "Agent Atabey";
7
- export function scaffoldSkills(skillsBaseDir, dryRun) {
8
- if (dryRun)
9
- return;
10
- ensureDir(skillsBaseDir, dryRun);
11
- for (const [key, skill] of Object.entries(CORE_SKILLS)) {
12
- 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## [SECURITY] Core Mandates\n${skill.mandates.join("\n")}\n`;
13
- writeTextFile(path.join(skillsBaseDir, `${key.toLowerCase()}.md`), mdContent);
14
- }
15
- }
16
- export function scaffoldStandards(frameworkDir, dryRun) {
17
- if (dryRun)
18
- return;
19
- const knowledgePath = path.join(frameworkDir, "knowledge");
20
- if (!fs.existsSync(knowledgePath))
21
- fs.mkdirSync(knowledgePath, { recursive: true });
22
- const eslintStandardsContent = `# [ATABEY] Agent Atabey — ESLint Standards
23
-
24
- This document outlines the strict ESLint coding standards for Agent Atabey projects.
25
-
26
- ## 📏 Core Rules
27
- - **Indentation:** 4 spaces (strict).
28
- - **Quotes:** Double quotes (\`"\`) for strings.
29
- - **Semicolons:** Always terminate statements with a semicolon (\`;\`).
30
- - **No Explicit Any:** Avoid using \`any\`. Use strongly typed interfaces, generics, or \`unknown\` with type assertions.
31
- - **Unused Variables:** Warning on unused variables unless prefixed with an underscore (\`_\`).
32
- `;
33
- writeTextFile(path.join(knowledgePath, "eslint-standards.md"), eslintStandardsContent);
34
- const standards = [
35
- // ── Supreme Governance (required by @manager, @security, @architect) ──────
36
- { file: "governance-standards.md", template: "templates/standards/governance-standards.md", default: "# [ATABEY] Agent Atabey — Governance & Nizam Standards" },
37
- // ── Core Engineering Standards ────────────────────────────────────────────
38
- { file: "crud-governance.md", template: "templates/standards/crud-governance.md", default: "# [GOV] Corporate CRUD and Governance Standards" },
39
- { file: "architecture-standards.md", template: "templates/standards/architecture-standards.md", default: "# 📐 Corporate Architecture Standards" },
40
- { file: "frontend-standards.md", template: "templates/standards/frontend-standards.md", default: "# 🎨 Corporate Frontend Standards" },
41
- { file: "vite-standards.md", template: "templates/standards/vite-standards.md", default: "# ⚡ Corporate Vite Standards" },
42
- { file: "nextjs-standards.md", template: "templates/standards/nextjs-standards.md", default: "# ⚛️ Corporate Next.js Standards" },
43
- { file: "tailwind-standards.md", template: "templates/standards/tailwind-standards.md", default: "# 🌊 Corporate Tailwind Standards" },
44
- { file: "mobile-standards.md", template: "templates/standards/mobile-standards.md", default: "# 📱 Corporate Mobile Standards" },
45
- { file: "security-standards.md", template: "templates/standards/security-standards.md", default: "# [SECURITY] Corporate Security Standards" },
46
- { file: "quality-standards.md", template: "templates/standards/quality-standards.md", default: "# ⚖️ Corporate Code Quality Standards" },
47
- { file: "logging-and-secrets.md", template: "templates/standards/logging-and-secrets.md", default: "# 🪵 Corporate Logging Standards" },
48
- { file: "testing-standards.md", template: "templates/standards/testing-standards.md", default: "# [SKILL] Corporate Testing Standards" },
49
- { file: "i18n-standards.md", template: "templates/standards/i18n-standards.md", default: "# 🌐 Corporate i18n Standards" },
50
- { file: "llm-governance.md", template: "templates/standards/llm-governance.md", default: "# [AI] LLM Governance Standards" },
51
- { file: "observability-standards.md", template: "templates/standards/observability-standards.md", default: "# 📈 Corporate Observability Standards" },
52
- { file: "deployment-standards.md", template: "templates/standards/deployment-standards.md", default: "# [START] Corporate Deployment Standards" },
53
- { file: "performance-standards.md", template: "templates/standards/performance-standards.md", default: "# ⚡ Corporate Performance Standards" },
54
- { file: "security-audit-standards.md", template: "templates/standards/security-audit-standards.md", default: "# 🔍 Corporate Security Audit Standards" }
55
- ];
56
- for (const std of standards) {
57
- let content = std.default;
58
- try {
59
- const fullTemplatePath = path.join(getPackageRoot(), std.template);
60
- if (fs.existsSync(fullTemplatePath)) {
61
- content = fs.readFileSync(fullTemplatePath, "utf8");
62
- }
63
- }
64
- catch { /* fallback to default */ }
65
- writeTextFile(path.join(knowledgePath, std.file), content);
66
- }
67
- }