atabey 0.0.9 → 0.0.10

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 (125) hide show
  1. package/README.md +1 -1
  2. package/dist/src/cli/commands/init.js +49 -0
  3. package/dist/src/cli/commands/init.js.map +1 -1
  4. package/framework-mcp/README.md +48 -0
  5. package/framework-mcp/dist/resources/index.js +2 -2
  6. package/framework-mcp/package.json +1 -1
  7. package/package.json +2 -2
  8. package/framework-mcp/dist/framework-mcp/src/constants.js +0 -64
  9. package/framework-mcp/dist/framework-mcp/src/index.js +0 -144
  10. package/framework-mcp/dist/framework-mcp/src/resources/index.js +0 -58
  11. package/framework-mcp/dist/framework-mcp/src/tools/control_plane/locking.js +0 -82
  12. package/framework-mcp/dist/framework-mcp/src/tools/control_plane/registry.js +0 -35
  13. package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +0 -322
  14. package/framework-mcp/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +0 -64
  15. package/framework-mcp/dist/framework-mcp/src/tools/file_system/patch_file.js +0 -34
  16. package/framework-mcp/dist/framework-mcp/src/tools/file_system/read_file.js +0 -51
  17. package/framework-mcp/dist/framework-mcp/src/tools/file_system/replace_text.js +0 -50
  18. package/framework-mcp/dist/framework-mcp/src/tools/file_system/write_file.js +0 -43
  19. package/framework-mcp/dist/framework-mcp/src/tools/framework/audit_deps.js +0 -41
  20. package/framework-mcp/dist/framework-mcp/src/tools/framework/get_status.js +0 -5
  21. package/framework-mcp/dist/framework-mcp/src/tools/framework/orchestrate.js +0 -5
  22. package/framework-mcp/dist/framework-mcp/src/tools/framework/run_tests.js +0 -27
  23. package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +0 -13
  24. package/framework-mcp/dist/framework-mcp/src/tools/framework/update_contract_hash.js +0 -5
  25. package/framework-mcp/dist/framework-mcp/src/tools/framework/update_memory.js +0 -8
  26. package/framework-mcp/dist/framework-mcp/src/tools/index.js +0 -62
  27. package/framework-mcp/dist/framework-mcp/src/tools/memory/get_insights.js +0 -34
  28. package/framework-mcp/dist/framework-mcp/src/tools/memory/read_memory.js +0 -28
  29. package/framework-mcp/dist/framework-mcp/src/tools/messaging/log_action.js +0 -22
  30. package/framework-mcp/dist/framework-mcp/src/tools/messaging/send_message.js +0 -94
  31. package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +0 -26
  32. package/framework-mcp/dist/framework-mcp/src/tools/observability/get_health.js +0 -19
  33. package/framework-mcp/dist/framework-mcp/src/tools/quality/check_lint.js +0 -30
  34. package/framework-mcp/dist/framework-mcp/src/tools/search/get_gaps.js +0 -48
  35. package/framework-mcp/dist/framework-mcp/src/tools/search/get_map.js +0 -43
  36. package/framework-mcp/dist/framework-mcp/src/tools/search/grep_search.js +0 -75
  37. package/framework-mcp/dist/framework-mcp/src/tools/search/list_dir.js +0 -28
  38. package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +0 -56
  39. package/framework-mcp/dist/framework-mcp/src/tools/types.js +0 -1
  40. package/framework-mcp/dist/framework-mcp/src/utils/cli.js +0 -59
  41. package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +0 -231
  42. package/framework-mcp/dist/framework-mcp/src/utils/fs.js +0 -44
  43. package/framework-mcp/dist/framework-mcp/src/utils/metrics.js +0 -56
  44. package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +0 -71
  45. package/framework-mcp/dist/framework-mcp/src/utils/security.js +0 -60
  46. package/framework-mcp/dist/src/cli/adapters/core.js +0 -71
  47. package/framework-mcp/dist/src/cli/adapters/index.js +0 -5
  48. package/framework-mcp/dist/src/cli/adapters/paths.js +0 -101
  49. package/framework-mcp/dist/src/cli/adapters/scaffold.js +0 -71
  50. package/framework-mcp/dist/src/cli/adapters/utils.js +0 -75
  51. package/framework-mcp/dist/src/cli/commands/approve.js +0 -63
  52. package/framework-mcp/dist/src/cli/commands/check.js +0 -181
  53. package/framework-mcp/dist/src/cli/commands/compliance.js +0 -50
  54. package/framework-mcp/dist/src/cli/commands/contract.js +0 -50
  55. package/framework-mcp/dist/src/cli/commands/dashboard.js +0 -123
  56. package/framework-mcp/dist/src/cli/commands/explorer.js +0 -42
  57. package/framework-mcp/dist/src/cli/commands/git.js +0 -40
  58. package/framework-mcp/dist/src/cli/commands/init/create-agent.js +0 -58
  59. package/framework-mcp/dist/src/cli/commands/init/scaffold-core.js +0 -112
  60. package/framework-mcp/dist/src/cli/commands/init/scaffold-docs.js +0 -34
  61. package/framework-mcp/dist/src/cli/commands/init/scaffold-ops.js +0 -80
  62. package/framework-mcp/dist/src/cli/commands/init/scaffold-standards.js +0 -67
  63. package/framework-mcp/dist/src/cli/commands/init.js +0 -167
  64. package/framework-mcp/dist/src/cli/commands/knowledge.js +0 -42
  65. package/framework-mcp/dist/src/cli/commands/lint.js +0 -22
  66. package/framework-mcp/dist/src/cli/commands/log.js +0 -10
  67. package/framework-mcp/dist/src/cli/commands/memory.js +0 -4
  68. package/framework-mcp/dist/src/cli/commands/orchestrate.js +0 -159
  69. package/framework-mcp/dist/src/cli/commands/plan.js +0 -117
  70. package/framework-mcp/dist/src/cli/commands/script.js +0 -19
  71. package/framework-mcp/dist/src/cli/commands/security.js +0 -36
  72. package/framework-mcp/dist/src/cli/commands/status.js +0 -97
  73. package/framework-mcp/dist/src/cli/commands/trace.js +0 -109
  74. package/framework-mcp/dist/src/cli/index.js +0 -338
  75. package/framework-mcp/dist/src/cli/shims.js +0 -66
  76. package/framework-mcp/dist/src/cli/utils/claude.js +0 -56
  77. package/framework-mcp/dist/src/cli/utils/compliance.js +0 -173
  78. package/framework-mcp/dist/src/cli/utils/config-schema.js +0 -42
  79. package/framework-mcp/dist/src/cli/utils/fs.js +0 -137
  80. package/framework-mcp/dist/src/cli/utils/i18n.js +0 -30
  81. package/framework-mcp/dist/src/cli/utils/memory.js +0 -276
  82. package/framework-mcp/dist/src/cli/utils/pkg.js +0 -282
  83. package/framework-mcp/dist/src/cli/utils/schemas.js +0 -19
  84. package/framework-mcp/dist/src/cli/utils/string.js +0 -49
  85. package/framework-mcp/dist/src/cli/utils/time.js +0 -27
  86. package/framework-mcp/dist/src/cli/utils/ui.js +0 -58
  87. package/framework-mcp/dist/src/contracts/index.js +0 -1
  88. package/framework-mcp/dist/src/contracts/tasks.js +0 -20
  89. package/framework-mcp/dist/src/dashboard/vite.config.js +0 -15
  90. package/framework-mcp/dist/src/modules/adapters/definitions.js +0 -140
  91. package/framework-mcp/dist/src/modules/adapters/registry.js +0 -18
  92. package/framework-mcp/dist/src/modules/adapters/shared.js +0 -104
  93. package/framework-mcp/dist/src/modules/adapters/types.js +0 -1
  94. package/framework-mcp/dist/src/modules/agents/definitions.js +0 -457
  95. package/framework-mcp/dist/src/modules/agents/registry/analyst.js +0 -39
  96. package/framework-mcp/dist/src/modules/agents/registry/architect.js +0 -42
  97. package/framework-mcp/dist/src/modules/agents/registry/backend.js +0 -49
  98. package/framework-mcp/dist/src/modules/agents/registry/database.js +0 -45
  99. package/framework-mcp/dist/src/modules/agents/registry/devops.js +0 -45
  100. package/framework-mcp/dist/src/modules/agents/registry/explorer.js +0 -36
  101. package/framework-mcp/dist/src/modules/agents/registry/frontend.js +0 -51
  102. package/framework-mcp/dist/src/modules/agents/registry/git.js +0 -36
  103. package/framework-mcp/dist/src/modules/agents/registry/manager.js +0 -53
  104. package/framework-mcp/dist/src/modules/agents/registry/mobile.js +0 -39
  105. package/framework-mcp/dist/src/modules/agents/registry/native.js +0 -39
  106. package/framework-mcp/dist/src/modules/agents/registry/quality.js +0 -41
  107. package/framework-mcp/dist/src/modules/agents/registry/security.js +0 -43
  108. package/framework-mcp/dist/src/modules/agents/types.js +0 -1
  109. package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +0 -102
  110. package/framework-mcp/dist/src/modules/engines/health-engine.js +0 -49
  111. package/framework-mcp/dist/src/modules/engines/planning-engine.js +0 -78
  112. package/framework-mcp/dist/src/modules/engines/risk-engine.js +0 -105
  113. package/framework-mcp/dist/src/modules/engines/routing-engine.js +0 -73
  114. package/framework-mcp/dist/src/modules/engines/types.js +0 -1
  115. package/framework-mcp/dist/src/modules/skills/definitions.js +0 -70
  116. package/framework-mcp/dist/src/shared/constants.js +0 -187
  117. package/framework-mcp/dist/src/shared/errors.js +0 -68
  118. package/framework-mcp/dist/src/shared/fs.js +0 -51
  119. package/framework-mcp/dist/src/shared/logger.js +0 -116
  120. package/framework-mcp/dist/src/shared/storage.js +0 -207
  121. package/framework-mcp/dist/src/shared/types.js +0 -12
  122. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/errors.js +0 -0
  123. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/memory.js +0 -0
  124. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/storage.js +0 -0
  125. /package/framework-mcp/dist/{framework-mcp/src/utils → utils}/types.js +0 -0
@@ -1,116 +0,0 @@
1
- import chalk from "chalk";
2
- import path from "path";
3
- import { ensureDir, appendFile } from "./fs.js";
4
- export var LogLevel;
5
- (function (LogLevel) {
6
- LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
7
- LogLevel[LogLevel["INFO"] = 1] = "INFO";
8
- LogLevel[LogLevel["WARN"] = 2] = "WARN";
9
- LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
10
- LogLevel[LogLevel["FATAL"] = 4] = "FATAL";
11
- })(LogLevel || (LogLevel = {}));
12
- export class EnterpriseLogger {
13
- config;
14
- static instance;
15
- constructor() {
16
- const isProd = process.env.NODE_ENV === "production";
17
- this.config = {
18
- minLevel: isProd ? LogLevel.INFO : LogLevel.DEBUG,
19
- enableColors: !isProd,
20
- jsonFormat: isProd,
21
- };
22
- }
23
- static getInstance() {
24
- if (!EnterpriseLogger.instance) {
25
- EnterpriseLogger.instance = new EnterpriseLogger();
26
- }
27
- return EnterpriseLogger.instance;
28
- }
29
- configure(config) {
30
- this.config = { ...this.config, ...config };
31
- if (this.config.logFile) {
32
- try {
33
- ensureDir(path.dirname(this.config.logFile));
34
- }
35
- catch (err) {
36
- // Directly write to stderr — using console here would be circular
37
- process.stderr.write(`[Logger] Failed to create log directory: ${err}\n`);
38
- }
39
- }
40
- }
41
- formatMessage(level, message, meta) {
42
- const timestamp = new Date().toISOString();
43
- const pid = process.pid;
44
- if (this.config.jsonFormat) {
45
- return JSON.stringify({
46
- timestamp,
47
- level: LogLevel[level],
48
- pid,
49
- message,
50
- meta,
51
- });
52
- }
53
- const levelName = LogLevel[level].padEnd(5);
54
- let coloredLevel = levelName;
55
- if (this.config.enableColors) {
56
- switch (level) {
57
- case LogLevel.DEBUG:
58
- coloredLevel = chalk.blue(levelName);
59
- break;
60
- case LogLevel.INFO:
61
- coloredLevel = chalk.green(levelName);
62
- break;
63
- case LogLevel.WARN:
64
- coloredLevel = chalk.yellow(levelName);
65
- break;
66
- case LogLevel.ERROR:
67
- coloredLevel = chalk.red(levelName);
68
- break;
69
- case LogLevel.FATAL:
70
- coloredLevel = chalk.bgRed.white.bold(levelName);
71
- break;
72
- }
73
- }
74
- const metaStr = meta ? ` | Meta: ${JSON.stringify(meta)}` : "";
75
- return `[${timestamp}] [PID:${pid}] [${coloredLevel}]: ${message}${metaStr}`;
76
- }
77
- log(level, message, meta) {
78
- if (level < this.config.minLevel)
79
- return;
80
- const formatted = this.formatMessage(level, message, meta);
81
- // Route to stderr for ERROR/FATAL, stdout otherwise.
82
- // Using process.write directly here is intentional — this IS the logger.
83
- if (level >= LogLevel.ERROR) {
84
- process.stderr.write(formatted + "\n");
85
- }
86
- else {
87
- process.stdout.write(formatted + "\n");
88
- }
89
- // Output to file if configured
90
- if (this.config.logFile) {
91
- try {
92
- appendFile(this.config.logFile, formatted + "\n");
93
- }
94
- catch (err) {
95
- // Directly write to stderr — using console here would be circular
96
- process.stderr.write(`[Logger] Failed to write to log file: ${err}\n`);
97
- }
98
- }
99
- }
100
- debug(message, meta) {
101
- this.log(LogLevel.DEBUG, message, meta);
102
- }
103
- info(message, meta) {
104
- this.log(LogLevel.INFO, message, meta);
105
- }
106
- warn(message, meta) {
107
- this.log(LogLevel.WARN, message, meta);
108
- }
109
- error(message, meta) {
110
- this.log(LogLevel.ERROR, message, meta);
111
- }
112
- fatal(message, meta) {
113
- this.log(LogLevel.FATAL, message, meta);
114
- }
115
- }
116
- export const logger = EnterpriseLogger.getInstance();
@@ -1,207 +0,0 @@
1
- import Database from "better-sqlite3";
2
- import path from "path";
3
- import fs from "fs";
4
- import { getFrameworkDir } from "../cli/utils/memory.js";
5
- /**
6
- * [DB] Atabey Storage Engine
7
- * Central SQLite database for enterprise-scale agent state management.
8
- */
9
- export class Storage {
10
- static db = null;
11
- static getDB() {
12
- if (!this.db) {
13
- const frameworkDir = getFrameworkDir();
14
- if (!fs.existsSync(frameworkDir)) {
15
- fs.mkdirSync(frameworkDir, { recursive: true });
16
- }
17
- const dbPath = path.join(frameworkDir, "atabey.db");
18
- this.db = new Database(dbPath);
19
- this.initializeSchema();
20
- }
21
- return this.db;
22
- }
23
- static initializeSchema() {
24
- const db = this.db;
25
- // Agents Table
26
- db.exec(`
27
- CREATE TABLE IF NOT EXISTS agents (
28
- name TEXT PRIMARY KEY,
29
- state TEXT DEFAULT 'READY',
30
- task TEXT DEFAULT 'Idle',
31
- last_updated DATETIME DEFAULT CURRENT_TIMESTAMP
32
- )
33
- `);
34
- // Messages (Hermes) Table
35
- db.exec(`
36
- CREATE TABLE IF NOT EXISTS messages (
37
- id INTEGER PRIMARY KEY AUTOINCREMENT,
38
- timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
39
- sender TEXT,
40
- receiver TEXT,
41
- category TEXT,
42
- content TEXT,
43
- trace_id TEXT,
44
- parent_id TEXT,
45
- status TEXT DEFAULT 'PENDING',
46
- priority TEXT DEFAULT 'NORMAL',
47
- requires_approval BOOLEAN DEFAULT 0
48
- )
49
- `);
50
- // Tasks Table
51
- db.exec(`
52
- CREATE TABLE IF NOT EXISTS tasks (
53
- id TEXT PRIMARY KEY,
54
- trace_id TEXT,
55
- description TEXT,
56
- agent TEXT,
57
- status TEXT DEFAULT 'PENDING',
58
- priority TEXT DEFAULT 'NORMAL',
59
- dependencies TEXT, -- JSON Array
60
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
61
- )
62
- `);
63
- // Logs Table
64
- db.exec(`
65
- CREATE TABLE IF NOT EXISTS logs (
66
- id INTEGER PRIMARY KEY AUTOINCREMENT,
67
- timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
68
- agent TEXT,
69
- action TEXT,
70
- trace_id TEXT,
71
- status TEXT,
72
- summary TEXT,
73
- findings TEXT
74
- )
75
- `);
76
- // Metadata (State) Table
77
- db.exec(`
78
- CREATE TABLE IF NOT EXISTS metadata (
79
- key TEXT PRIMARY KEY,
80
- value TEXT
81
- )
82
- `);
83
- }
84
- // --- Agent Operations ---
85
- static updateAgentStatus(name, state, task, lastUpdated) {
86
- const db = this.getDB();
87
- const cleanName = name.replace("@", "");
88
- const timestamp = lastUpdated || new Date().toISOString();
89
- db.prepare(`
90
- INSERT INTO agents (name, state, task, last_updated)
91
- VALUES (?, ?, ?, ?)
92
- ON CONFLICT(name) DO UPDATE SET
93
- state = excluded.state,
94
- task = excluded.task,
95
- last_updated = excluded.last_updated
96
- `).run(cleanName, state, task, timestamp);
97
- }
98
- static getAllAgents() {
99
- return this.getDB().prepare("SELECT * FROM agents").all();
100
- }
101
- // --- Message Operations ---
102
- static saveMessage(msg) {
103
- const db = this.getDB();
104
- db.prepare(`
105
- INSERT INTO messages (sender, receiver, category, content, trace_id, parent_id, status, priority, requires_approval)
106
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
107
- `).run(msg.from, msg.to, msg.category, msg.content, msg.traceId, msg.parentId || null, msg.status || "PENDING", msg.priority || "NORMAL", msg.requiresApproval ? 1 : 0);
108
- }
109
- static getPendingMessages() {
110
- const rows = this.getDB().prepare("SELECT * FROM messages WHERE status IN ('PENDING', 'APPROVED') ORDER BY priority DESC, timestamp ASC").all();
111
- return rows.map(r => ({
112
- id: r.id,
113
- timestamp: r.timestamp,
114
- from: r.sender,
115
- to: r.receiver,
116
- category: r.category,
117
- content: r.content,
118
- traceId: r.trace_id,
119
- parentId: r.parent_id || undefined,
120
- status: r.status,
121
- priority: r.priority,
122
- requiresApproval: r.requires_approval === 1
123
- }));
124
- }
125
- static updateMessageStatus(id, status) {
126
- this.getDB().prepare("UPDATE messages SET status = ? WHERE id = ?").run(status, id);
127
- }
128
- // --- Task Operations ---
129
- static saveTask(task) {
130
- const db = this.getDB();
131
- db.prepare(`
132
- INSERT INTO tasks (id, trace_id, description, agent, status, priority, dependencies)
133
- VALUES (?, ?, ?, ?, ?, ?, ?)
134
- ON CONFLICT(id) DO UPDATE SET
135
- status = excluded.status,
136
- description = excluded.description
137
- `).run(task.id, task.traceId, task.description, task.agent, task.status, task.priority, JSON.stringify(task.dependencies || []));
138
- }
139
- static getTasks(traceId) {
140
- const db = this.getDB();
141
- let rows;
142
- if (traceId) {
143
- rows = db.prepare("SELECT * FROM tasks WHERE trace_id = ?").all(traceId);
144
- }
145
- else {
146
- rows = db.prepare("SELECT * FROM tasks").all();
147
- }
148
- return rows.map(r => {
149
- let deps = [];
150
- try {
151
- const parsed = JSON.parse(r.dependencies || "[]");
152
- // Handle cases where dependencies might be double-stringified or are raw JSON strings
153
- deps = Array.isArray(parsed) ? parsed : JSON.parse(parsed);
154
- }
155
- catch {
156
- // Keep empty array
157
- }
158
- return {
159
- id: r.id,
160
- traceId: r.trace_id,
161
- description: r.description,
162
- agent: r.agent,
163
- status: r.status,
164
- priority: r.priority,
165
- dependencies: deps
166
- };
167
- });
168
- }
169
- static getLogs(agentName) {
170
- const db = this.getDB();
171
- let rows;
172
- const cleanName = agentName ? agentName.replace("@", "") : undefined;
173
- if (cleanName) {
174
- rows = db.prepare("SELECT * FROM logs WHERE agent = ? ORDER BY timestamp DESC").all(cleanName);
175
- }
176
- else {
177
- rows = db.prepare("SELECT * FROM logs ORDER BY timestamp DESC").all();
178
- }
179
- return rows.map(r => ({
180
- id: r.id,
181
- timestamp: r.timestamp,
182
- agent: r.agent,
183
- action: r.action,
184
- trace_id: r.trace_id || undefined,
185
- status: r.status,
186
- summary: r.summary,
187
- findings: r.findings || undefined
188
- }));
189
- }
190
- // --- Metadata Operations ---
191
- static setMetadata(key, value) {
192
- this.getDB().prepare(`
193
- INSERT INTO metadata (key, value) VALUES (?, ?)
194
- ON CONFLICT(key) DO UPDATE SET value = excluded.value
195
- `).run(key, value);
196
- }
197
- static getMetadata(key) {
198
- const row = this.getDB().prepare("SELECT value FROM metadata WHERE key = ?").get(key);
199
- return row ? row.value : null;
200
- }
201
- static reset() {
202
- if (this.db) {
203
- this.db.close();
204
- this.db = null;
205
- }
206
- }
207
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Agent Atabey Framework — Internal Branded Types
3
- * Used to enforce absolute type safety within the core orchestration logic.
4
- */
5
- /**
6
- * Casts a raw string to a Branded Type.
7
- * Use this only at the boundaries of the system.
8
- */
9
- export function asTraceID(val) { return val; }
10
- export function asAgentID(val) { return val; }
11
- export function asPhaseID(val) { return val; }
12
- export function asProjectPath(val) { return val; }