atabey 0.0.14 → 0.0.16
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/LICENSE +672 -21
- package/PRIVACY.md +8 -14
- package/README.md +183 -25
- package/bin/cli.js +72 -5
- package/dist/framework-mcp/src/index.js +145 -13
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.d.ts +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.js +52 -4
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +5 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/approve_operation.d.ts +10 -8
- package/dist/framework-mcp/src/tools/messaging/approve_operation.js +12 -12
- package/dist/framework-mcp/src/tools/messaging/approve_operation.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/ask_human.d.ts +8 -8
- package/dist/framework-mcp/src/tools/messaging/ask_human.js +8 -8
- package/dist/framework-mcp/src/tools/messaging/send_message.js +19 -3
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.d.ts +1 -0
- package/dist/framework-mcp/src/tools/observability/check_ports.js +21 -7
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/schemas.d.ts +4 -4
- package/dist/framework-mcp/src/tools/search/grep_search.js +11 -4
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/list_dir.js +3 -0
- package/dist/framework-mcp/src/tools/search/list_dir.js.map +1 -1
- package/dist/framework-mcp/src/tools/shell/run_command.js +185 -93
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -1
- package/dist/framework-mcp/src/utils/auth.d.ts +26 -2
- package/dist/framework-mcp/src/utils/auth.js +74 -7
- package/dist/framework-mcp/src/utils/auth.js.map +1 -1
- package/dist/framework-mcp/src/utils/compliance.js +45 -13
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/discipline.d.ts +1 -0
- package/dist/framework-mcp/src/utils/discipline.js +42 -3
- package/dist/framework-mcp/src/utils/discipline.js.map +1 -1
- package/dist/framework-mcp/src/utils/human-in-loop.d.ts +35 -2
- package/dist/framework-mcp/src/utils/human-in-loop.js +114 -10
- package/dist/framework-mcp/src/utils/human-in-loop.js.map +1 -1
- package/dist/framework-mcp/src/utils/loop-detector.js +3 -3
- package/dist/framework-mcp/src/utils/loop-detector.js.map +1 -1
- package/dist/framework-mcp/src/utils/permissions.d.ts +67 -3
- package/dist/framework-mcp/src/utils/permissions.js +179 -43
- package/dist/framework-mcp/src/utils/permissions.js.map +1 -1
- package/dist/framework-mcp/src/utils/prompt-injection.d.ts +20 -0
- package/dist/framework-mcp/src/utils/prompt-injection.js +64 -0
- package/dist/framework-mcp/src/utils/prompt-injection.js.map +1 -0
- package/dist/framework-mcp/src/utils/quality.js +4 -3
- package/dist/framework-mcp/src/utils/quality.js.map +1 -1
- package/dist/framework-mcp/src/utils/silent-router.d.ts +4 -2
- package/dist/framework-mcp/src/utils/silent-router.js +35 -9
- package/dist/framework-mcp/src/utils/silent-router.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +174 -71
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +36 -30
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/observability/check_ports.test.js +26 -12
- package/dist/framework-mcp/tests/tools/observability/check_ports.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js +38 -15
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js.map +1 -1
- package/dist/framework-mcp/tests/utils/human-in-loop.test.js +152 -4
- package/dist/framework-mcp/tests/utils/human-in-loop.test.js.map +1 -1
- package/dist/framework-mcp/tests/utils/loop-detector.test.js +0 -2
- package/dist/framework-mcp/tests/utils/loop-detector.test.js.map +1 -1
- package/dist/framework-mcp/tests/utils/prompt-injection.test.d.ts +1 -0
- package/dist/framework-mcp/tests/utils/prompt-injection.test.js +43 -0
- package/dist/framework-mcp/tests/utils/prompt-injection.test.js.map +1 -0
- package/dist/src/cli/commands/dashboard.js +167 -2
- package/dist/src/cli/commands/dashboard.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +14 -7
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/log.js +8 -5
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/mcp.js +3 -1
- package/dist/src/cli/commands/mcp.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +4 -4
- package/dist/src/cli/commands/orchestrate.js +14 -2
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/script.js +8 -1
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/status.js +21 -1
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/utils/memory.js +6 -5
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/schemas.d.ts +2 -2
- package/dist/src/contracts/tasks.d.ts +4 -4
- package/dist/src/modules/contracts/api.d.ts +6 -6
- package/dist/src/modules/engines/agent-executor.js +41 -20
- package/dist/src/modules/engines/agent-executor.js.map +1 -1
- package/dist/src/modules/engines/agent-loop.d.ts +5 -5
- package/dist/src/modules/engines/agent-loop.js +5 -5
- package/dist/src/modules/engines/evaluation-engine.d.ts +9 -2
- package/dist/src/modules/engines/evaluation-engine.js +77 -9
- package/dist/src/modules/engines/evaluation-engine.js.map +1 -1
- package/dist/src/modules/engines/quality-gate.js +4 -2
- package/dist/src/modules/engines/quality-gate.js.map +1 -1
- package/dist/src/modules/engines/risk-engine.d.ts +17 -1
- package/dist/src/modules/engines/risk-engine.js +98 -3
- package/dist/src/modules/engines/risk-engine.js.map +1 -1
- package/dist/src/modules/engines/routing-engine.d.ts +26 -1
- package/dist/src/modules/engines/routing-engine.js +97 -1
- package/dist/src/modules/engines/routing-engine.js.map +1 -1
- package/dist/src/modules/providers/shared.js +2 -3
- package/dist/src/modules/providers/shared.js.map +1 -1
- package/dist/src/shared/pii.js +1 -1
- package/dist/src/shared/pii.js.map +1 -1
- package/dist/src/shared/storage.d.ts +60 -0
- package/dist/src/shared/storage.js +77 -3
- package/dist/src/shared/storage.js.map +1 -1
- package/dist/tests/cli/commands/dashboard-coverage.test.js +3 -1
- package/dist/tests/cli/commands/dashboard-coverage.test.js.map +1 -1
- package/dist/tests/modules/engines/agent-executor.test.js +1 -1
- package/dist/tests/modules/engines/agent-executor.test.js.map +1 -1
- package/dist/tests/modules/engines/evaluation-engine.test.js +2 -2
- package/dist/tests/modules/engines/evaluation-engine.test.js.map +1 -1
- package/dist/tests/status-cost.test.js +2 -0
- package/dist/tests/status-cost.test.js.map +1 -1
- package/dist/tests/storage-operations.test.js +31 -4
- package/dist/tests/storage-operations.test.js.map +1 -1
- package/dist/vitest.config.js +6 -4
- package/dist/vitest.config.js.map +1 -1
- package/framework-mcp/README.md +18 -32
- package/framework-mcp/dist/dashboard/assets/index-B-Eu7_J9.js +1260 -0
- package/framework-mcp/dist/dashboard/index.html +1 -1
- package/framework-mcp/dist/framework-mcp/src/index.js +145 -13
- package/framework-mcp/dist/framework-mcp/src/tools/control_plane/registry.js +52 -4
- package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +1 -1
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/read_file.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/approve_operation.js +12 -12
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/ask_human.js +8 -8
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/send_message.js +19 -3
- package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +21 -7
- package/framework-mcp/dist/framework-mcp/src/tools/search/grep_search.js +11 -4
- package/framework-mcp/dist/framework-mcp/src/tools/search/list_dir.js +3 -0
- package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +185 -93
- package/framework-mcp/dist/framework-mcp/src/utils/auth.js +74 -7
- package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +45 -13
- package/framework-mcp/dist/framework-mcp/src/utils/discipline.js +42 -3
- package/framework-mcp/dist/framework-mcp/src/utils/human-in-loop.js +114 -10
- package/framework-mcp/dist/framework-mcp/src/utils/loop-detector.js +3 -3
- package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +179 -43
- package/framework-mcp/dist/framework-mcp/src/utils/prompt-injection.js +63 -0
- package/framework-mcp/dist/framework-mcp/src/utils/quality.js +4 -3
- package/framework-mcp/dist/framework-mcp/src/utils/silent-router.js +35 -9
- package/framework-mcp/dist/src/cli/utils/memory.js +6 -5
- package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +170 -0
- package/framework-mcp/dist/src/modules/engines/quality-gate.js +4 -2
- package/framework-mcp/dist/src/modules/engines/risk-engine.js +98 -3
- package/framework-mcp/dist/src/modules/engines/routing-engine.js +97 -1
- package/framework-mcp/dist/src/modules/providers/shared.js +2 -3
- package/framework-mcp/dist/src/shared/pii.js +1 -1
- package/framework-mcp/dist/src/shared/storage.js +77 -3
- package/framework-mcp/package.json +21 -18
- package/mcp.json +3 -2
- package/package.json +4 -5
- package/framework-mcp/dist/dashboard/assets/index-B2mYld0c.js +0 -1221
package/PRIVACY.md
CHANGED
|
@@ -93,14 +93,14 @@ DataRetention.eraseAllData("KVKK-RIGHT-TO-ERASURE");
|
|
|
93
93
|
|
|
94
94
|
### 4. Data Portability (KVKK Art. 11 / GDPR Art. 20)
|
|
95
95
|
|
|
96
|
-
All stored data
|
|
96
|
+
All stored operational data and metrics are inspectable:
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
#
|
|
100
|
-
atabey
|
|
99
|
+
# View agent statuses, token usage, and cost distributions
|
|
100
|
+
atabey status
|
|
101
101
|
|
|
102
|
-
#
|
|
103
|
-
atabey
|
|
102
|
+
# Run full health and compliance checks
|
|
103
|
+
atabey check
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
### 5. Data Processing Records (KVKK Art. 4 / GDPR Art. 30)
|
|
@@ -129,16 +129,10 @@ Every data processing operation is logged in the audit trail:
|
|
|
129
129
|
## 📝 CLI Commands
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
|
-
#
|
|
133
|
-
atabey
|
|
134
|
-
|
|
135
|
-
# Export data inventory
|
|
136
|
-
atabey kvkk:export
|
|
137
|
-
|
|
138
|
-
# Erase all data (with confirmation)
|
|
139
|
-
atabey kvkk:erase-all
|
|
132
|
+
# View agent status, token usage, and cost distribution
|
|
133
|
+
atabey status
|
|
140
134
|
|
|
141
|
-
# Run compliance
|
|
135
|
+
# Run compliance, health, and security checks
|
|
142
136
|
atabey check
|
|
143
137
|
```
|
|
144
138
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# [GOV] Agent Atabey — MCP-Powered AI Governance &
|
|
1
|
+
# [GOV] Agent Atabey — MCP-Powered AI Governance & Multi-Agent Workflow Layer for AI Coding Assistants
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ysf-bkr/atabey)
|
|
4
4
|
[](https://www.npmjs.com/package/atabey)
|
|
5
5
|
[](https://www.npmjs.com/package/atabey-mcp)
|
|
6
6
|
[](https://modelcontextprotocol.io)
|
|
7
7
|
[](https://github.com/ysf-bkr/atabey)
|
|
8
|
-
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
9
9
|
[](https://github.com/ysf-bkr/atabey)
|
|
10
10
|
[](https://github.com/ysf-bkr/atabey)
|
|
11
11
|
[](https://github.com/ysf-bkr/atabey)
|
|
12
12
|
|
|
13
|
-
**Agent Atabey** is
|
|
13
|
+
**Agent Atabey** is an **MCP (Model Context Protocol) server** designed specifically for agentic developer workflows. It plugs directly into your AI coding interface — such as Claude Code, Gemini CLI, or Cursor — to govern, secure, and coordinate the terminal/CLI commands and file modification loops executed autonomously by these AI assistants.
|
|
14
14
|
|
|
15
15
|
> **Philosophy:** "Order from Chaos"
|
|
16
|
-
> **
|
|
16
|
+
> **Governance Context:** In an agentic workflow, the AI assistant runs the development tools, shell commands, and file edits. Atabey acts as the deterministic governance and safety layer over these AI execution loops.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
@@ -38,6 +38,9 @@ You (@backend): "Create a user login service with JWT authentication"
|
|
|
38
38
|
|
|
39
39
|
**No separate terminal needed. No CLI commands for daily use.** Just chat with your AI and use `@agent` syntax.
|
|
40
40
|
|
|
41
|
+
> [!NOTE]
|
|
42
|
+
> **Execution Context:** The LLM inference/execution is handled entirely inside the developer's active AI interface (such as Claude Code or Cursor). Atabey acts as the context injector and policy engine, silently evaluating prompts, routing instructions, and checking output code against quality guidelines.
|
|
43
|
+
|
|
41
44
|
---
|
|
42
45
|
|
|
43
46
|
## 📋 Table of Contents
|
|
@@ -77,6 +80,7 @@ Atabey generates an `mcp.json` config. Point your AI assistant to it:
|
|
|
77
80
|
"command": "npx",
|
|
78
81
|
"args": ["-y", "atabey-mcp"],
|
|
79
82
|
"env": {
|
|
83
|
+
"MCP_TRANSPORT": "stdio",
|
|
80
84
|
"ATABEY_PROJECT_ROOT": "/path/to/your/project"
|
|
81
85
|
}
|
|
82
86
|
}
|
|
@@ -86,8 +90,10 @@ Atabey generates an `mcp.json` config. Point your AI assistant to it:
|
|
|
86
90
|
|
|
87
91
|
**Gemini CLI:**
|
|
88
92
|
```bash
|
|
93
|
+
# Stdio mode (local, single user)
|
|
89
94
|
gemini config set mcpServers.atabey.command "npx"
|
|
90
95
|
gemini config set mcpServers.atabey.args "[\"-y\", \"atabey-mcp\"]"
|
|
96
|
+
gemini config set mcpServers.atabey.env "{\"MCP_TRANSPORT\": \"stdio\", \"ATABEY_PROJECT_ROOT\": \"/path/to/your/project\"}"
|
|
91
97
|
```
|
|
92
98
|
|
|
93
99
|
**Cursor:**
|
|
@@ -97,7 +103,10 @@ gemini config set mcpServers.atabey.args "[\"-y\", \"atabey-mcp\"]"
|
|
|
97
103
|
"mcpServers": {
|
|
98
104
|
"atabey": {
|
|
99
105
|
"command": "npx",
|
|
100
|
-
"args": ["-y", "atabey-mcp"]
|
|
106
|
+
"args": ["-y", "atabey-mcp"],
|
|
107
|
+
"env": {
|
|
108
|
+
"MCP_TRANSPORT": "stdio"
|
|
109
|
+
}
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
}
|
|
@@ -139,11 +148,11 @@ Open your AI interface and simply type:
|
|
|
139
148
|
└──────────────────────────────────────────────────────────────────┘
|
|
140
149
|
```
|
|
141
150
|
|
|
142
|
-
Atabey is **not a separate
|
|
143
|
-
- **13
|
|
144
|
-
- **Deterministic
|
|
145
|
-
- **Risk
|
|
146
|
-
- **Vector
|
|
151
|
+
Atabey is **not a separate execution engine**. It is a context-aware governance and policy middleware that intercepts, validates, and routes the actions of AI coding assistants using their own CLIs:
|
|
152
|
+
- **13 Specialized Agent Contexts** (injected templates to structure AI reasoning)
|
|
153
|
+
- **Deterministic Quality Gates** (AST analysis + lint + tests validating AI writes before commit)
|
|
154
|
+
- **Risk Gate & Heuristic Scanning** (blocking dangerous shell commands or edits and requiring human passcode confirmation)
|
|
155
|
+
- **Persistent Vector Memory** (allowing AIs to query project context locally)
|
|
147
156
|
- **Audit trails** (every action logged)
|
|
148
157
|
|
|
149
158
|
---
|
|
@@ -242,6 +251,9 @@ npx atabey init gemini
|
|
|
242
251
|
|
|
243
252
|
## 13 Specialized Agents
|
|
244
253
|
|
|
254
|
+
> [!NOTE]
|
|
255
|
+
> Each agent listed below represents a specialized prompt and rule-template context injected via the MCP server. The actual reasoning and file modification are performed by the developer's active client AI interface using the instructions supplied by these agents.
|
|
256
|
+
|
|
245
257
|
| Agent | Tier | Role | Freelancer | Team | Enterprise |
|
|
246
258
|
|-------|------|------|:----------:|:----:|:----------:|
|
|
247
259
|
| **@manager** | Supreme | Orchestration, governance, quality gate | ✅ | ✅ | ✅ |
|
|
@@ -265,7 +277,7 @@ npx atabey init gemini
|
|
|
265
277
|
### 1. Deterministic Quality Gate
|
|
266
278
|
No agent can push code directly to production. All outputs pass through AST analysis (compliance), linting, and unit tests. Failed code triggers an automatic 3-attempt retry loop.
|
|
267
279
|
|
|
268
|
-
### 2.
|
|
280
|
+
### 2. Persistent Vector Memory
|
|
269
281
|
Project context, contracts, and past tasks are stored locally via `better-sqlite3` using TF-IDF semantic search (cosine similarity). Agents search past architectural decisions.
|
|
270
282
|
|
|
271
283
|
### 3. Hermes Message Broker
|
|
@@ -274,6 +286,9 @@ Agents communicate asynchronously via a SQLite-backed message queue. A file-base
|
|
|
274
286
|
### 4. Risk Engine (Human-in-the-Loop — In-Chat Approval)
|
|
275
287
|
Operations containing `DROP`, `DELETE`, `TRUNCATE`, or secret manipulation are flagged. Execution is blocked until human approval.
|
|
276
288
|
|
|
289
|
+
> [!NOTE]
|
|
290
|
+
> **Heuristic Detection:** The Risk Engine relies on deterministic keyword and path-pattern heuristics (e.g., matching SQL command strings) rather than complex machine learning models to identify and block high-risk operations.
|
|
291
|
+
|
|
277
292
|
**In-Chat Approval (no terminal switch needed):**
|
|
278
293
|
When an operation is blocked, the AI is instructed to call the `approve_operation` MCP tool:
|
|
279
294
|
```
|
|
@@ -298,7 +313,7 @@ Claude Code, Gemini CLI, Cursor, Codex CLI, Antigravity CLI — automatic agent
|
|
|
298
313
|
Node.js, Go, Java, Python, .NET — automatic scaffolding based on backend language selection.
|
|
299
314
|
|
|
300
315
|
### 9. Multi-User Distributed Lock Registry
|
|
301
|
-
When multiple developers work on the same repository, their
|
|
316
|
+
When multiple developers work on the same repository, their contextual agents might attempt to modify the same files simultaneously. Atabey implements a Git-aware distributed locking mechanism (`DistributedLock`). It dynamically identifies the lock owner using `git config user.name` and blocks other processes from mutating the locked resources until released or expired, preventing merge conflicts and race conditions.
|
|
302
317
|
|
|
303
318
|
### 10. Multi-Client MCP Support (Stdio + HTTP/SSE)
|
|
304
319
|
Atabey supports two transport modes:
|
|
@@ -385,11 +400,11 @@ Atabey automatically classifies data into security levels:
|
|
|
385
400
|
|
|
386
401
|
Data portability (KVKK Art. 11 / GDPR Art. 20):
|
|
387
402
|
```bash
|
|
388
|
-
#
|
|
389
|
-
atabey
|
|
403
|
+
# View agent statuses, token usage, and cost distributions
|
|
404
|
+
atabey status
|
|
390
405
|
|
|
391
|
-
#
|
|
392
|
-
atabey
|
|
406
|
+
# Run full health and compliance checks
|
|
407
|
+
atabey check
|
|
393
408
|
```
|
|
394
409
|
|
|
395
410
|
### 15. Adapter-Skill System
|
|
@@ -499,12 +514,24 @@ atabey mcp install Generate mcp.json config for AI integration
|
|
|
499
514
|
atabey dashboard [port] Open web dashboard (default: 5858)
|
|
500
515
|
atabey status Show agent statuses and costs
|
|
501
516
|
atabey check Full health and compliance check
|
|
502
|
-
atabey orchestrate Start
|
|
517
|
+
atabey orchestrate Start orchestration workflow loop
|
|
503
518
|
atabey approve <traceId> Approve a blocked high-risk task (terminal alternative)
|
|
504
519
|
atabey hitl answer "<text>" Answer a pending ask_human question
|
|
505
520
|
atabey @agent "task" Send task directly to an agent
|
|
506
521
|
```
|
|
507
522
|
|
|
523
|
+
### `atabey init [adapter]` Options
|
|
524
|
+
|
|
525
|
+
| Option | Values | Description |
|
|
526
|
+
|---|---|---|
|
|
527
|
+
| `[adapter]` | `gemini`, `claude`, `cursor`, `grok`, `codex`, `local`, `antigravity-cli` | The target AI platform/client for initialization. |
|
|
528
|
+
| `--profile` | `freelancer`, `team`, `enterprise` | Preset agent group layout and governance complexity. |
|
|
529
|
+
| `--focus` | `fullstack`, `backend`, `frontend`, `mobile`, `mobile-fullstack` | Optimize active agents and templates for the project type. |
|
|
530
|
+
| `--lang` | `tr`, `en` | Set the language for constitution (`ATABEY.md`) and standard operating procedures. |
|
|
531
|
+
| `--unified` | *None (Flag)* | Place all agent instruction files under a single `.agents/` directory with native client links. |
|
|
532
|
+
| `--yes` | *None (Flag)* | Run in non-interactive mode using default or provided parameters. |
|
|
533
|
+
| `--dryRun` | *None (Flag)* | Simulate the initialization run without writing any files or folders to the workspace. |
|
|
534
|
+
|
|
508
535
|
> **In-chat alternative:** Use `approve_operation` MCP tool directly in your AI CLI chat — no terminal switch needed.
|
|
509
536
|
|
|
510
537
|
Full command list: see `atabey help` or [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
@@ -538,7 +565,6 @@ Full command list: see `atabey help` or [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
|
538
565
|
|
|
539
566
|
---
|
|
540
567
|
|
|
541
|
-
|
|
542
568
|
## ✅ Implemented Governance Features
|
|
543
569
|
|
|
544
570
|
> These features were previously listed as "Blind Spots" but are now fully implemented:
|
|
@@ -553,11 +579,131 @@ Full command list: see `atabey help` or [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
|
553
579
|
|
|
554
580
|
---
|
|
555
581
|
|
|
582
|
+
## 🔍 Detailed Feature Analysis
|
|
583
|
+
|
|
584
|
+
### Auto-Rollback & Rollback Mechanism
|
|
585
|
+
`framework-mcp/src/utils/auto-rollback.ts`
|
|
586
|
+
|
|
587
|
+
**How It Works:**
|
|
588
|
+
```
|
|
589
|
+
[AI write_file/replace_text/patch_file call]
|
|
590
|
+
│
|
|
591
|
+
├── 1. Pre-Write Snapshot → Original file content saved (SnapshotManager)
|
|
592
|
+
├── 2. Tool executes → File is written
|
|
593
|
+
├── 3. Post-Write Validation → rules-engine.ts GOV scan
|
|
594
|
+
│ ├── ✅ Clean → Allow, clear snapshot
|
|
595
|
+
│ └── ❌ Violation (any type, console.log, secret, copyleft) →
|
|
596
|
+
│ ├── Original file restored
|
|
597
|
+
│ ├── New file deleted
|
|
598
|
+
│ └── REGENERATE instruction sent to AI:
|
|
599
|
+
│ "⛔ AI Output Blocked – Governance Violation
|
|
600
|
+
│ 🔴 No `any` Type (file.ts:5)
|
|
601
|
+
│ Fix: Replace `any` with `unknown`"
|
|
602
|
+
└── Dashboard WS → rollback_violation event
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
**Detected Violations:**
|
|
606
|
+
| Violation | Severity | Detection |
|
|
607
|
+
|-----------|----------|-----------|
|
|
608
|
+
| `any` type usage | 🔴 CRITICAL | Regex: `: any\b` |
|
|
609
|
+
| `console.log`/`.error`/`.warn`/`.debug` | 🔴 CRITICAL | Regex (exempts logger.ts) |
|
|
610
|
+
| Hardcoded API Key (sk-, ghp_, AIza) | 🟠 HIGH | Regex pattern |
|
|
611
|
+
| Hardcoded GitHub Token | 🟠 HIGH | `ghp_` pattern |
|
|
612
|
+
| Copyleft license violation | 🔴 CRITICAL | `license-scanner.ts` |
|
|
613
|
+
|
|
614
|
+
**Test Status:** ✅ `auto-rollback.test.ts` — 14 tests, 228 lines, all scenarios covered.
|
|
615
|
+
|
|
616
|
+
**Critical Assessment:** Working. The `buildRegenerateInstruction()` method tells the AI exactly what it did wrong and how to fix it. This is far more valuable than simple blocking.
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
### Specialty Memory (Agent Learning Mechanism)
|
|
621
|
+
`src/modules/engines/evaluation-engine.ts`
|
|
622
|
+
|
|
623
|
+
| Status | Detail |
|
|
624
|
+
|--------|--------|
|
|
625
|
+
| ✅ **Error Learning** | Compliance/lint/test failure → `updateSpecialtyMemory()` writes to `.atabey/memory/specialties/<agent>.md` |
|
|
626
|
+
| ❌ **Success Learning** | No mechanism to extract lessons from successful tasks |
|
|
627
|
+
| ❌ **Auto-Injection** | `readLearnedConventions()` exists but is not automatically injected into AI context |
|
|
628
|
+
| ⚠️ **Learning Opportunity** | Agent never asked "What did I learn from this task?" on completion |
|
|
629
|
+
|
|
630
|
+
**Current Flow:**
|
|
631
|
+
```
|
|
632
|
+
Task → Evaluation → Any errors?
|
|
633
|
+
├── Yes → `updateSpecialtyMemory(agent, "Compliance Violations Detected...")`
|
|
634
|
+
└── No → Nothing saved (❌)
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
**Desired Flow:**
|
|
638
|
+
```
|
|
639
|
+
Task → Evaluation →
|
|
640
|
+
├── Error → Save error lesson
|
|
641
|
+
└── Success → Save success lesson: "agent/service pattern was used successfully"
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
---
|
|
645
|
+
|
|
646
|
+
### Token/Cost Tracking (FinOps)
|
|
647
|
+
`framework-mcp/src/utils/finops.ts`
|
|
648
|
+
|
|
649
|
+
| Feature | Status |
|
|
650
|
+
|---------|--------|
|
|
651
|
+
| ✅ Per-agent token tracking | Every MCP tool call logged via `Metrics.logUsage()` |
|
|
652
|
+
| ✅ Monthly budget | `ATABEY_BUDGET_MONTHLY` env for USD-based limit |
|
|
653
|
+
| ✅ Per-agent budget | `ATABEY_BUDGET_AGENT_MAX` for agent-based limit |
|
|
654
|
+
| ✅ Auto-shutdown | MCP middleware returns error when budget exceeded |
|
|
655
|
+
| ✅ Alert thresholds | 50/80/90/100% warning levels |
|
|
656
|
+
| ✅ Dashboard panel | FinOpsPanel.tsx with live visualization |
|
|
657
|
+
| ✅ API endpoint | `GET /api/metrics` — agent/action level detail |
|
|
658
|
+
| ❌ **Weekly Summary** | `atabey status` output does not provide a weekly rollup overview |
|
|
659
|
+
|
|
660
|
+
**Usage:** `framework-mcp/src/index.ts` (lines 150-153) calls `Metrics.logUsage()` on every tool call.
|
|
661
|
+
|
|
662
|
+
---
|
|
663
|
+
|
|
664
|
+
### KVKK/GDPR Data Privacy
|
|
665
|
+
`src/shared/pii.ts`
|
|
666
|
+
|
|
667
|
+
| Pattern | Mask | Test |
|
|
668
|
+
|---------|------|------|
|
|
669
|
+
| Email | `***@***` | ✅ |
|
|
670
|
+
| Phone (+90 TR, international) | `***-***-****` | ✅ |
|
|
671
|
+
| TC ID (11 digits) | `***********` | ✅ |
|
|
672
|
+
| API Key (OpenAI, GitHub, Google) | `***-REDACTED-***` | ✅ |
|
|
673
|
+
| JWT Token | `***-JWT-REDACTED-***` | ✅ |
|
|
674
|
+
| IP (IPv4, IPv6) | `***.***.***.***` | ✅ |
|
|
675
|
+
| Credit Card (AMEX included) | `****-****-****-****` | ✅ |
|
|
676
|
+
| IBAN | `****-IBAN-REDACTED-****` | ✅ |
|
|
677
|
+
| Date of Birth | `**/**/****` | ✅ |
|
|
678
|
+
| SSN (US) | `***-**-****` | ✅ |
|
|
679
|
+
| Password/Secret fields | `***-REDACTED-***` | ✅ |
|
|
680
|
+
|
|
681
|
+
**Layered Protection:**
|
|
682
|
+
1. **MCP Middleware** — `maskToolArgs()`: AI arguments masked before reaching handler
|
|
683
|
+
2. **MCP Middleware** — `maskToolResult()`: Handler result masked before returning to AI
|
|
684
|
+
3. **Logger** — All log entries scanned for PII
|
|
685
|
+
4. **Dashboard API** — All API responses masked
|
|
686
|
+
|
|
687
|
+
**Dashboard:** PrivacyPanel.tsx — PII masked/detected statistics, category distribution, Right to Erasure.
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
### 🐞 Detected Issues
|
|
692
|
+
|
|
693
|
+
| # | Issue | File | Fix |
|
|
694
|
+
|---|-------|------|-----|
|
|
695
|
+
| 1 | `MCP_TRANSPORT=stdio` env missing | `src/cli/commands/mcp.ts:66` | Added `MCP_TRANSPORT: "stdio"` |
|
|
696
|
+
| 2 | No success task learning | `src/modules/engines/evaluation-engine.ts` | `updateSpecialtyMemory()` should be called on success too |
|
|
697
|
+
| 3 | Specialty memory not auto-injected into AI | `silent-router.ts` / `discipline.ts` | `.atabey/memory/specialties/*.md` content should be injected on agent calls |
|
|
698
|
+
| 4 | No weekly cost summary | `finops.ts` | Add weekly rollup statistics to `atabey status` command |
|
|
699
|
+
|
|
700
|
+
---
|
|
701
|
+
|
|
556
702
|
## Strategic Roadmap
|
|
557
703
|
|
|
558
704
|
| # | Feature | Priority | Status |
|
|
559
705
|
|---|---------|----------|--------|
|
|
560
|
-
| 1 | Agent specialty memory → auto-sync to agent files | 🟠 High |
|
|
706
|
+
| 1 | Agent specialty memory → auto-sync to agent files | 🟠 High | 🟡 **Partial** (error learning only) |
|
|
561
707
|
| 2 | MCP `prompts/` endpoint for session-level governance injection | 🟠 High | Planned |
|
|
562
708
|
| 3 | Central Enterprise Server (telemetry ingest + org dashboard) | 🟡 Medium | Planned |
|
|
563
709
|
| 4 | Dynamic rule loading from `.atabey/rules/*.json` | 🟡 Medium | Planned |
|
|
@@ -566,14 +712,17 @@ Full command list: see `atabey help` or [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
|
566
712
|
|
|
567
713
|
## Security
|
|
568
714
|
|
|
715
|
+
### Enterprise-Grade Governance
|
|
716
|
+
Atabey defines "enterprise-grade" through deterministic rules: AST compliance parsing, strict TypeScript type validation (zero `any`), syntax/linter checks, and automated unit tests, rather than unpredictable probabilistic algorithms.
|
|
717
|
+
|
|
569
718
|
### Zero Type Hole Policy
|
|
570
719
|
- `any` type usage is **strictly forbidden**
|
|
571
720
|
- All function inputs validated with Zod schemas
|
|
572
721
|
- Type safety enforced in CI pipeline
|
|
573
722
|
|
|
574
|
-
###
|
|
575
|
-
-
|
|
576
|
-
-
|
|
723
|
+
### Prudent Mocking Policy
|
|
724
|
+
- Core governance logic, schemas, and rule engines are verified against real implementations without mock data.
|
|
725
|
+
- Unit and integration boundaries (such as remote Hermes polling loops, network calls, and LLM provider interfaces) utilize lightweight, standard mocks to ensure isolation and fast test execution.
|
|
577
726
|
|
|
578
727
|
### PII Masking (KVKK Compliant)
|
|
579
728
|
- All logs scanned for Personally Identifiable Information
|
|
@@ -613,9 +762,18 @@ npm run build
|
|
|
613
762
|
|
|
614
763
|
---
|
|
615
764
|
|
|
616
|
-
## License
|
|
765
|
+
## License & Business Model
|
|
766
|
+
|
|
767
|
+
**Code:** GNU Affero General Public License v3.0 — [Yusuf BEKAR](mailto:ybekar@msn.com)
|
|
768
|
+
|
|
769
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
770
|
+
|
|
771
|
+
**Network Use Clause (Section 13):** If you modify the Program and make it accessible over a network (e.g., as a SaaS service), you must provide the complete corresponding source code to all users who interact with it remotely. This prevents others from selling Atabey as a closed-source SaaS.
|
|
617
772
|
|
|
618
|
-
|
|
773
|
+
**Service Model (Support / SLA / Consulting):** The code is **100% free and open source**. Revenue comes from:
|
|
774
|
+
- **Enterprise Support & SLA** — Guaranteed response times, priority bug fixes, custom integrations
|
|
775
|
+
- **Consulting & Training** — Team onboarding, governance policy design, architecture review
|
|
776
|
+
- **Managed Enterprise Server** — Centralized telemetry, multi-team budget management, org-wide dashboard
|
|
619
777
|
|
|
620
778
|
Enterprise inquiries: **ybekar@msn.com**
|
|
621
779
|
|
package/bin/cli.js
CHANGED
|
@@ -1,26 +1,93 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
5
3
|
import fs from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = dirname(__filename);
|
|
9
9
|
|
|
10
|
+
// ─── Friendly Error Messages ──────────────────────────────────────
|
|
11
|
+
const ERRORS = {
|
|
12
|
+
BUILD_REQUIRED: `
|
|
13
|
+
╔══════════════════════════════════════════════════════════╗
|
|
14
|
+
║ 🚧 Atabey is not built yet ║
|
|
15
|
+
╠══════════════════════════════════════════════════════════╣
|
|
16
|
+
║ The compiled CLI was not found at: ║
|
|
17
|
+
║ dist/src/cli/index.js ║
|
|
18
|
+
║ ║
|
|
19
|
+
║ 📋 To fix this, run: ║
|
|
20
|
+
║ npm run build ║
|
|
21
|
+
║ ║
|
|
22
|
+
║ 💡 This compiles TypeScript source into JavaScript. ║
|
|
23
|
+
║ After build completes, run atabey again. ║
|
|
24
|
+
╚══════════════════════════════════════════════════════════╝
|
|
25
|
+
`,
|
|
26
|
+
NODE_VERSION: `
|
|
27
|
+
╔══════════════════════════════════════════════════════════╗
|
|
28
|
+
║ ⚠️ Unsupported Node.js version ║
|
|
29
|
+
╠══════════════════════════════════════════════════════════╣
|
|
30
|
+
║ Atabey requires Node.js >= 18.0.0 ║
|
|
31
|
+
║ ║
|
|
32
|
+
║ Current version: {version} ║
|
|
33
|
+
║ ║
|
|
34
|
+
║ 📋 To fix this: ║
|
|
35
|
+
║ • Install Node.js 18+ via: ║
|
|
36
|
+
║ nvm install 18 (if using nvm) ║
|
|
37
|
+
║ brew install node (if using Homebrew) ║
|
|
38
|
+
║ https://nodejs.org (official installer) ║
|
|
39
|
+
║ ║
|
|
40
|
+
║ • Then switch to it: ║
|
|
41
|
+
║ nvm use 18 (if using nvm) ║
|
|
42
|
+
╚══════════════════════════════════════════════════════════╝
|
|
43
|
+
`,
|
|
44
|
+
SPAWN_FAILED: `
|
|
45
|
+
╔══════════════════════════════════════════════════════════╗
|
|
46
|
+
║ ❌ Failed to start Atabey ║
|
|
47
|
+
╠══════════════════════════════════════════════════════════╣
|
|
48
|
+
║ Could not launch the CLI process. ║
|
|
49
|
+
║ ║
|
|
50
|
+
║ 📋 Common causes: ║
|
|
51
|
+
║ • Out of memory ║
|
|
52
|
+
║ • System resource limits ║
|
|
53
|
+
║ • Permission issues ║
|
|
54
|
+
║ ║
|
|
55
|
+
║ Try running again, or check logs for details. ║
|
|
56
|
+
╚══════════════════════════════════════════════════════════╝
|
|
57
|
+
`,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// ─── Node.js Version Check ────────────────────────────────────────
|
|
61
|
+
const nodeMajor = parseInt(process.versions.node.split(".")[0], 10);
|
|
62
|
+
if (nodeMajor < 18) {
|
|
63
|
+
process.stderr.write(ERRORS.NODE_VERSION.replace("{version}", process.versions.node));
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ─── Start CLI ────────────────────────────────────────────────────
|
|
10
68
|
const cliPath = join(__dirname, "../dist/src/cli/index.js");
|
|
11
69
|
|
|
12
70
|
if (!fs.existsSync(cliPath)) {
|
|
13
|
-
process.stderr.write(
|
|
14
|
-
process.stderr.write("[TIP] Solution Tip: Run 'npm run build' to compile the project first.\n\n");
|
|
71
|
+
process.stderr.write(ERRORS.BUILD_REQUIRED);
|
|
15
72
|
process.exit(1);
|
|
16
73
|
}
|
|
17
74
|
|
|
18
75
|
const cmd = "node";
|
|
19
76
|
const child = spawn(cmd, [cliPath, ...process.argv.slice(2)], {
|
|
20
77
|
stdio: "inherit",
|
|
21
|
-
shell: false
|
|
78
|
+
shell: false
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
child.on("error", (err) => {
|
|
82
|
+
process.stderr.write(ERRORS.SPAWN_FAILED);
|
|
83
|
+
process.stderr.write(`\n[DETAIL] ${err.message}\n\n`);
|
|
84
|
+
process.exit(1);
|
|
22
85
|
});
|
|
23
86
|
|
|
24
87
|
child.on("exit", (code) => {
|
|
88
|
+
if (code !== 0 && code !== null) {
|
|
89
|
+
// Non-zero exit — the CLI already printed the error
|
|
90
|
+
process.exit(code);
|
|
91
|
+
}
|
|
25
92
|
process.exit(code ?? 0);
|
|
26
93
|
});
|