atabey 0.0.5 → 0.0.7
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/ATABEY.md +4 -4
- package/README.md +35 -33
- package/bin/cli.js +2 -2
- package/bin/validate-agent-army.js +6 -6
- package/dist/framework-mcp/src/constants.js +1 -1
- package/dist/framework-mcp/src/constants.js.map +1 -1
- package/dist/framework-mcp/src/index.d.ts +1 -0
- package/dist/framework-mcp/src/index.js +30 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/resources/index.d.ts +10 -0
- package/dist/framework-mcp/src/resources/index.js +59 -0
- package/dist/framework-mcp/src/resources/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +33 -1
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
- package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.js +2 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +1 -0
- package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
- package/dist/framework-mcp/src/utils/compliance.js +158 -5
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
- package/dist/framework-mcp/src/utils/permissions.js +72 -0
- package/dist/framework-mcp/src/utils/permissions.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js +84 -0
- package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +31 -31
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +92 -0
- package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/src/cli/adapters/core.js +1 -1
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.js +2 -2
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +5 -3
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/compliance.js +2 -2
- package/dist/src/cli/commands/compliance.js.map +1 -1
- package/dist/src/cli/commands/contract.js +2 -2
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/dashboard.d.ts +5 -0
- package/dist/src/cli/commands/dashboard.js +124 -0
- package/dist/src/cli/commands/dashboard.js.map +1 -0
- package/dist/src/cli/commands/explorer.js +3 -3
- package/dist/src/cli/commands/explorer.js.map +1 -1
- package/dist/src/cli/commands/git.js +3 -3
- package/dist/src/cli/commands/git.js.map +1 -1
- package/dist/src/cli/commands/init/create-agent.d.ts +4 -0
- package/dist/src/cli/commands/init/create-agent.js +59 -0
- package/dist/src/cli/commands/init/create-agent.js.map +1 -0
- package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-core.js +11 -7
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-docs.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-docs.js +4 -6
- package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +4 -4
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +10 -8
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +26 -10
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.js +3 -3
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/lint.js +2 -2
- package/dist/src/cli/commands/lint.js.map +1 -1
- package/dist/src/cli/commands/log.js +6 -28
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +10 -17
- package/dist/src/cli/commands/orchestrate.js +92 -341
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +5 -0
- package/dist/src/cli/commands/plan.js +80 -59
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/script.js +3 -3
- package/dist/src/cli/commands/script.js.map +1 -1
- package/dist/src/cli/commands/security.js +2 -2
- package/dist/src/cli/commands/security.js.map +1 -1
- package/dist/src/cli/commands/status.js +65 -8
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/trace.d.ts +4 -0
- package/dist/src/cli/commands/trace.js +83 -2
- package/dist/src/cli/commands/trace.js.map +1 -1
- package/dist/src/cli/index.js +68 -18
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +14 -14
- package/dist/src/cli/utils/claude.js +1 -1
- package/dist/src/cli/utils/claude.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +7 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/i18n.d.ts +1 -0
- package/dist/src/cli/utils/i18n.js +2 -0
- package/dist/src/cli/utils/i18n.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +12 -3
- package/dist/src/cli/utils/memory.js +39 -31
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +2 -2
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/schemas.d.ts +8 -8
- package/dist/src/cli/utils/ui.js +4 -4
- package/dist/src/cli/utils/ui.js.map +1 -1
- package/dist/src/contracts/tasks.d.ts +2 -2
- package/dist/src/dashboard/vite.config.d.ts +2 -0
- package/dist/src/dashboard/vite.config.js +16 -0
- package/dist/src/dashboard/vite.config.js.map +1 -0
- package/dist/src/modules/adapters/definitions.js +10 -10
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/shared.js +4 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +19 -0
- package/dist/src/modules/agents/definitions.js +74 -21
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +8 -0
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +7 -0
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +6 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/frontend.js +8 -0
- package/dist/src/modules/agents/registry/frontend.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +6 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/modules/agents/types.d.ts +2 -0
- package/dist/src/modules/engines/evaluation-engine.d.ts +11 -0
- package/dist/src/modules/engines/evaluation-engine.js +103 -0
- package/dist/src/modules/engines/evaluation-engine.js.map +1 -0
- package/dist/src/modules/engines/health-engine.d.ts +16 -0
- package/dist/src/modules/engines/health-engine.js +50 -0
- package/dist/src/modules/engines/health-engine.js.map +1 -0
- package/dist/src/modules/engines/planning-engine.d.ts +25 -0
- package/dist/src/modules/engines/planning-engine.js +79 -0
- package/dist/src/modules/engines/planning-engine.js.map +1 -0
- package/dist/src/modules/engines/risk-engine.d.ts +18 -0
- package/dist/src/modules/engines/risk-engine.js +106 -0
- package/dist/src/modules/engines/risk-engine.js.map +1 -0
- package/dist/src/modules/engines/routing-engine.d.ts +11 -0
- package/dist/src/modules/engines/routing-engine.js +74 -0
- package/dist/src/modules/engines/routing-engine.js.map +1 -0
- package/dist/src/modules/engines/types.d.ts +47 -0
- package/dist/src/modules/engines/types.js +2 -0
- package/dist/src/modules/engines/types.js.map +1 -0
- package/dist/src/shared/constants.d.ts +5 -2
- package/dist/src/shared/constants.js +4 -1
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/fs.d.ts +1 -0
- package/dist/src/shared/fs.js +4 -0
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/storage.d.ts +60 -0
- package/dist/src/shared/storage.js +208 -0
- package/dist/src/shared/storage.js.map +1 -0
- package/dist/tests/agent-memory-v2.test.d.ts +1 -0
- package/dist/tests/agent-memory-v2.test.js +68 -0
- package/dist/tests/agent-memory-v2.test.js.map +1 -0
- package/dist/tests/agents-definitions.test.js +42 -0
- package/dist/tests/agents-definitions.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.js +7 -10
- package/dist/tests/integration/hermes_locking.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +5 -1
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
- package/dist/tests/orchestrator-dependencies.test.js +52 -0
- package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
- package/dist/tests/plan.test.d.ts +1 -0
- package/dist/tests/plan.test.js +63 -0
- package/dist/tests/plan.test.js.map +1 -0
- package/dist/tests/planning-engine.test.d.ts +1 -0
- package/dist/tests/planning-engine.test.js +50 -0
- package/dist/tests/planning-engine.test.js.map +1 -0
- package/dist/tests/status-cost.test.d.ts +1 -0
- package/dist/tests/status-cost.test.js +54 -0
- package/dist/tests/status-cost.test.js.map +1 -0
- package/dist/tests/status.test.js +8 -7
- package/dist/tests/status.test.js.map +1 -1
- package/dist/tests/trace-replay.test.d.ts +1 -0
- package/dist/tests/trace-replay.test.js +65 -0
- package/dist/tests/trace-replay.test.js.map +1 -0
- package/dist/tests/trace.test.js +14 -7
- package/dist/tests/trace.test.js.map +1 -1
- package/dist/ui/assets/index-Bkt7APzu.css +1 -0
- package/dist/ui/assets/index-CeX-06mI.js +49 -0
- package/dist/ui/index.html +14 -0
- package/package.json +5 -4
- package/templates/prompts/contract-design-recipe.md +1 -1
- package/templates/prompts/db-management-recipe.md +3 -3
- package/templates/prompts/deployment-recipe.md +3 -3
- package/templates/prompts/performance-optimization-recipe.md +3 -3
- package/templates/prompts/pull-request-template.md +2 -2
- package/templates/prompts/security-audit-recipe.md +3 -3
- package/templates/standards/crud-governance.md +1 -1
- package/templates/standards/deployment-standards.md +1 -1
- package/templates/standards/governance-standards.md +1 -1
- package/templates/standards/llm-governance.md +1 -1
- package/templates/standards/nextjs-standards.md +13 -0
- package/templates/standards/observability-standards.md +1 -1
- package/templates/standards/security-audit-standards.md +1 -1
- package/templates/standards/security-standards.md +1 -1
- package/templates/standards/testing-standards.md +1 -1
- package/templates/standards/vite-standards.md +13 -0
- package/framework-mcp/dist/constants.js +0 -64
- package/framework-mcp/dist/index.js +0 -119
- package/framework-mcp/dist/tools/control_plane/locking.js +0 -82
- package/framework-mcp/dist/tools/control_plane/registry.js +0 -34
- package/framework-mcp/dist/tools/definitions.js +0 -290
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +0 -59
- package/framework-mcp/dist/tools/file_system/patch_file.js +0 -29
- package/framework-mcp/dist/tools/file_system/read_file.js +0 -51
- package/framework-mcp/dist/tools/file_system/replace_text.js +0 -45
- package/framework-mcp/dist/tools/file_system/write_file.js +0 -38
- package/framework-mcp/dist/tools/framework/audit_deps.js +0 -41
- package/framework-mcp/dist/tools/framework/get_status.js +0 -5
- package/framework-mcp/dist/tools/framework/orchestrate.js +0 -5
- package/framework-mcp/dist/tools/framework/run_tests.js +0 -27
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +0 -5
- package/framework-mcp/dist/tools/framework/update_memory.js +0 -8
- package/framework-mcp/dist/tools/index.js +0 -60
- package/framework-mcp/dist/tools/memory/get_insights.js +0 -34
- package/framework-mcp/dist/tools/memory/read_memory.js +0 -28
- package/framework-mcp/dist/tools/messaging/log_action.js +0 -22
- package/framework-mcp/dist/tools/messaging/send_message.js +0 -94
- package/framework-mcp/dist/tools/observability/check_ports.js +0 -26
- package/framework-mcp/dist/tools/observability/get_health.js +0 -19
- package/framework-mcp/dist/tools/quality/check_lint.js +0 -30
- package/framework-mcp/dist/tools/search/get_gaps.js +0 -48
- package/framework-mcp/dist/tools/search/get_map.js +0 -43
- package/framework-mcp/dist/tools/search/grep_search.js +0 -75
- package/framework-mcp/dist/tools/search/list_dir.js +0 -28
- package/framework-mcp/dist/tools/shell/run_command.js +0 -56
- package/framework-mcp/dist/utils/cli.js +0 -59
- package/framework-mcp/dist/utils/compliance.js +0 -78
- package/framework-mcp/dist/utils/fs.js +0 -44
- package/framework-mcp/dist/utils/metrics.js +0 -56
- package/framework-mcp/dist/utils/security.js +0 -60
- package/framework-mcp/package-lock.json +0 -1191
- package/framework-mcp/package.json +0 -26
- package/framework-mcp/src/constants.ts +0 -78
- package/framework-mcp/src/declarations.d.ts +0 -17
- package/framework-mcp/src/index.ts +0 -144
- package/framework-mcp/src/tools/control_plane/locking.ts +0 -89
- package/framework-mcp/src/tools/control_plane/registry.ts +0 -38
- package/framework-mcp/src/tools/definitions.ts +0 -292
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +0 -79
- package/framework-mcp/src/tools/file_system/patch_file.ts +0 -39
- package/framework-mcp/src/tools/file_system/read_file.ts +0 -58
- package/framework-mcp/src/tools/file_system/replace_text.ts +0 -54
- package/framework-mcp/src/tools/file_system/write_file.ts +0 -45
- package/framework-mcp/src/tools/framework/audit_deps.ts +0 -49
- package/framework-mcp/src/tools/framework/get_status.ts +0 -7
- package/framework-mcp/src/tools/framework/orchestrate.ts +0 -7
- package/framework-mcp/src/tools/framework/run_tests.ts +0 -30
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +0 -7
- package/framework-mcp/src/tools/framework/update_memory.ts +0 -10
- package/framework-mcp/src/tools/index.ts +0 -64
- package/framework-mcp/src/tools/memory/get_insights.ts +0 -41
- package/framework-mcp/src/tools/memory/read_memory.ts +0 -31
- package/framework-mcp/src/tools/messaging/log_action.ts +0 -28
- package/framework-mcp/src/tools/messaging/send_message.ts +0 -97
- package/framework-mcp/src/tools/observability/check_ports.ts +0 -30
- package/framework-mcp/src/tools/observability/get_health.ts +0 -24
- package/framework-mcp/src/tools/quality/check_lint.ts +0 -36
- package/framework-mcp/src/tools/search/get_gaps.ts +0 -54
- package/framework-mcp/src/tools/search/get_map.ts +0 -48
- package/framework-mcp/src/tools/search/grep_search.ts +0 -75
- package/framework-mcp/src/tools/search/list_dir.ts +0 -34
- package/framework-mcp/src/tools/shell/run_command.ts +0 -66
- package/framework-mcp/src/tools/types.ts +0 -89
- package/framework-mcp/src/utils/cli.ts +0 -53
- package/framework-mcp/src/utils/compliance.ts +0 -95
- package/framework-mcp/src/utils/fs.ts +0 -45
- package/framework-mcp/src/utils/metrics.ts +0 -73
- package/framework-mcp/src/utils/security.ts +0 -66
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
- package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
- package/framework-mcp/tsconfig.json +0 -14
- package/src/cli/adapters/core.ts +0 -91
- package/src/cli/adapters/index.ts +0 -5
- package/src/cli/adapters/paths.ts +0 -135
- package/src/cli/adapters/scaffold.ts +0 -95
- package/src/cli/adapters/utils.ts +0 -87
- package/src/cli/commands/approve.ts +0 -73
- package/src/cli/commands/check.ts +0 -188
- package/src/cli/commands/compliance.ts +0 -55
- package/src/cli/commands/contract.ts +0 -68
- package/src/cli/commands/explorer.ts +0 -45
- package/src/cli/commands/git.ts +0 -39
- package/src/cli/commands/init/scaffold-core.ts +0 -136
- package/src/cli/commands/init/scaffold-docs.ts +0 -44
- package/src/cli/commands/init/scaffold-ops.ts +0 -83
- package/src/cli/commands/init/scaffold-standards.ts +0 -67
- package/src/cli/commands/init.ts +0 -193
- package/src/cli/commands/knowledge.ts +0 -44
- package/src/cli/commands/lint.ts +0 -23
- package/src/cli/commands/log.ts +0 -37
- package/src/cli/commands/memory.ts +0 -6
- package/src/cli/commands/orchestrate.ts +0 -450
- package/src/cli/commands/plan.ts +0 -113
- package/src/cli/commands/script.ts +0 -20
- package/src/cli/commands/security.ts +0 -38
- package/src/cli/commands/status.ts +0 -44
- package/src/cli/commands/trace.ts +0 -31
- package/src/cli/index.ts +0 -322
- package/src/cli/shims.ts +0 -66
- package/src/cli/utils/claude.ts +0 -63
- package/src/cli/utils/compliance.ts +0 -191
- package/src/cli/utils/config-schema.ts +0 -48
- package/src/cli/utils/fs.ts +0 -170
- package/src/cli/utils/i18n.ts +0 -44
- package/src/cli/utils/memory.ts +0 -303
- package/src/cli/utils/pkg.ts +0 -317
- package/src/cli/utils/schemas.ts +0 -22
- package/src/cli/utils/string.ts +0 -55
- package/src/cli/utils/time.ts +0 -27
- package/src/cli/utils/ui.ts +0 -66
- package/src/contracts/index.ts +0 -1
- package/src/contracts/tasks.ts +0 -26
- package/src/modules/adapters/definitions.ts +0 -171
- package/src/modules/adapters/registry.ts +0 -27
- package/src/modules/adapters/shared.ts +0 -120
- package/src/modules/adapters/types.ts +0 -16
- package/src/modules/agents/definitions.ts +0 -460
- package/src/modules/agents/registry/analyst.ts +0 -44
- package/src/modules/agents/registry/architect.ts +0 -47
- package/src/modules/agents/registry/backend.ts +0 -46
- package/src/modules/agents/registry/database.ts +0 -43
- package/src/modules/agents/registry/devops.ts +0 -44
- package/src/modules/agents/registry/explorer.ts +0 -41
- package/src/modules/agents/registry/frontend.ts +0 -48
- package/src/modules/agents/registry/git.ts +0 -41
- package/src/modules/agents/registry/manager.ts +0 -58
- package/src/modules/agents/registry/mobile.ts +0 -44
- package/src/modules/agents/registry/native.ts +0 -44
- package/src/modules/agents/registry/quality.ts +0 -46
- package/src/modules/agents/registry/security.ts +0 -42
- package/src/modules/agents/types.ts +0 -37
- package/src/modules/skills/definitions.ts +0 -71
- package/src/schema/agent-lifecycle-schema.json +0 -59
- package/src/shared/constants.ts +0 -218
- package/src/shared/errors.ts +0 -75
- package/src/shared/fs.ts +0 -50
- package/src/shared/logger.ts +0 -139
- package/src/shared/types.ts +0 -20
- /package/{framework-mcp/dist/tools/types.js → dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atabey",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "The Supreme AI Governance & Autonomous Orchestration Framework for Enterprise Development. Supports Polyglot Backends (Go, Java, Python, .NET, Node.js) and Multi-Language Communication (TR/EN).",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"bin",
|
|
36
36
|
"dist",
|
|
37
|
-
"src",
|
|
38
37
|
"templates",
|
|
39
|
-
"framework-mcp",
|
|
40
38
|
"README.md",
|
|
41
39
|
"LICENSE",
|
|
42
40
|
"mcp.json",
|
|
@@ -46,7 +44,8 @@
|
|
|
46
44
|
"node": ">=18.0.0"
|
|
47
45
|
},
|
|
48
46
|
"scripts": {
|
|
49
|
-
"build": "tsc && npm run build --prefix framework-mcp",
|
|
47
|
+
"build": "tsc && npm run build --prefix framework-mcp && npm run build:ui",
|
|
48
|
+
"build:ui": "npm run build --prefix src/dashboard",
|
|
50
49
|
"atabey:build": "npm run build --prefix framework-mcp",
|
|
51
50
|
"atabey:test": "vitest run",
|
|
52
51
|
"atabey:test:watch": "vitest",
|
|
@@ -65,6 +64,7 @@
|
|
|
65
64
|
"access": "public"
|
|
66
65
|
},
|
|
67
66
|
"dependencies": {
|
|
67
|
+
"better-sqlite3": "^12.10.1",
|
|
68
68
|
"chalk": "^5.6.2",
|
|
69
69
|
"js-yaml": "^4.2.0",
|
|
70
70
|
"typescript": "^5.9.3",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@eslint/js": "^10.0.1",
|
|
75
75
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
76
76
|
"@pandacss/dev": "^1.11.1",
|
|
77
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
77
78
|
"@types/node": "^25.9.1",
|
|
78
79
|
"eslint": "^10.4.0",
|
|
79
80
|
"globals": "^17.6.0",
|
|
@@ -16,6 +16,6 @@ This recipe governs the @architect agent's protocol for creating type-safe agree
|
|
|
16
16
|
2. **Commitment:** Run `atabey update-contract` to generate new SHA-256 signatures for the updated types.
|
|
17
17
|
3. **Audit:** Verify that `contract.version.json` accurately reflects the new architecture.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## [SIGNAL] Phase 4: Synchronization
|
|
20
20
|
1. **Distribution:** Ensure the updated `src/types` directory is correctly linked or copied to both Frontend and Backend projects.
|
|
21
21
|
2. **Verification:** Trigger @backend and @frontend agents to read the new contract and plan their implementations.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [DB] Engineering Recipe: Database Management & Migrations
|
|
2
2
|
|
|
3
3
|
This recipe governs the @database agent's protocol for schema creation, table modifications, and data integrity.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ This recipe governs the @database agent's protocol for schema creation, table mo
|
|
|
6
6
|
1. **Type Mapping:** Define the new table or column in `src/types/models.ts` using Branded Types for IDs.
|
|
7
7
|
2. **Validation:** Ensure the interface extends `BaseEntity` (id, createdAt, updatedAt).
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## [START] Phase 2: Migration Generation
|
|
10
10
|
1. **Scripting:** Write a reversible migration (up/down) using the project's migration tool (e.g., Kysely or SQL).
|
|
11
11
|
2. **Atomic Changes:** One migration per logical feature. Never bundle unrelated schema changes.
|
|
12
12
|
3. **Naming:** Use timestamp-prefixed naming (e.g., `20240101_add_customers_table.ts`).
|
|
@@ -19,7 +19,7 @@ This recipe governs the @database agent's protocol for schema creation, table mo
|
|
|
19
19
|
1. **Repo Layer:** Create or update the Repository class to include the new query logic.
|
|
20
20
|
2. **Strict Mode:** Ensure no raw SQL is used; leverage the query builder exclusively.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## [OK] Phase 5: Verification & Zero-Downtime Audit
|
|
23
23
|
1. **Dry Run:** If supported, dry-run the migration to check for locking issues.
|
|
24
24
|
2. **Validation:** Run `atabey verify-contract` to ensure code and schema are synced.
|
|
25
25
|
3. **Handoff:** Update `PROJECT_MEMORY.md` with the new schema version.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [START] Engineering Recipe: Infrastructure Deployment
|
|
2
2
|
|
|
3
3
|
This recipe governs the @devops agent's protocol for safe, traceable, and reversible system rollouts.
|
|
4
4
|
|
|
@@ -12,12 +12,12 @@ This recipe governs the @devops agent's protocol for safe, traceable, and revers
|
|
|
12
12
|
2. **Contract Verify:** Run `atabey verify-contract` to ensure FE/BE synchronization.
|
|
13
13
|
3. **Test Suite:** Execute the full test battery. Failure in a single test blocks deployment.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## [SIGNAL] Phase 3: Controlled Rollout
|
|
16
16
|
1. **Atomic Swap:** Deploy the new bundle/service using the project's orchestration scripts.
|
|
17
17
|
2. **Database Sync:** If migrations are pending, follow the `db-management-recipe.md` first.
|
|
18
18
|
3. **Log Monitoring:** Tail `logs/manager.json` for immediate post-deploy spikes in errors.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## [OK] Phase 4: Post-Deploy & Rollback Readiness
|
|
21
21
|
1. **Observability:** Verify system metrics stabilize within 5 minutes.
|
|
22
22
|
2. **Traceability:** Record the deployment Trace ID and commit hash in `PROJECT_MEMORY.md`.
|
|
23
23
|
3. **Rollback Check:** Ensure the previous stable version is tagged and reachable in Git.
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This recipe governs the protocol for identifying and resolving system bottlenecks (Frontend, Backend, or Database).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## [DATA] Phase 1: Profiling & Bottleneck Identification
|
|
6
6
|
1. **Metric Collection:** Read `observability/metrics.json` or run `get_system_health`.
|
|
7
7
|
2. **Log Audit:** Scan `logs/manager.json` for slow actions or timeouts.
|
|
8
8
|
3. **Trace Analysis:** Use `TraceID` to follow a slow request through all layers.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## [MEMORY] Phase 2: Root Cause Analysis
|
|
11
11
|
1. **SQL Audit:** Check for N+1 query patterns or missing indexes in `repository/` files.
|
|
12
12
|
2. **Algorithm Audit:** Scan for O(n²) loops or heavy synchronous operations.
|
|
13
13
|
3. **Frontend Audit:** Check for unnecessary re-renders or massive bundle sizes.
|
|
@@ -17,7 +17,7 @@ This recipe governs the protocol for identifying and resolving system bottleneck
|
|
|
17
17
|
2. **Logic Level:** Implement caching (e.g., Redis or in-memory) for frequent read operations.
|
|
18
18
|
3. **UI Level:** Apply memoization, virtualization (FlashList), or code-splitting.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## [OK] Phase 4: Validation & Comparison
|
|
21
21
|
1. **Benchmarking:** Re-run the action and compare new metrics with the baseline.
|
|
22
22
|
2. **Regression Check:** Run `atabey check` and existing tests to ensure logic is intact.
|
|
23
23
|
3. **Knowledge Update:** Record the optimization strategy in `knowledge/performance-history.md`.
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
- **Trace ID:** [Link to Trace/Task or ID]
|
|
8
8
|
- **Issue:** [Link to issue if applicable]
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## [SECURITY] Governance & Compliance Checklist
|
|
11
11
|
- [ ] Code passes `npm run atabey:test`.
|
|
12
12
|
- [ ] Code passes `npm run atabey:check` (Compliance Scanner).
|
|
13
13
|
- [ ] No `any` type usage added.
|
|
14
14
|
- [ ] No secrets or hardcoded API keys.
|
|
15
15
|
- [ ] New functionality is registered in `src/modules/agents/definitions.ts` (if applicable).
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## [SKILL] Testing Notes
|
|
18
18
|
<!-- How did you verify the fix? -->
|
|
19
19
|
|
|
20
20
|
## 🛠️ Risk Assessment
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [SECURITY] Engineering Recipe: Advanced Security Audit
|
|
2
2
|
|
|
3
3
|
This recipe governs the @security agent's protocol for identifying and mitigating vulnerabilities within the Agent Atabey framework.
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ This recipe governs the @security agent's protocol for identifying and mitigatin
|
|
|
7
7
|
2. **SQL Injection Audit:** Scan for `raw SQL` or template literals bypassing the query builder.
|
|
8
8
|
3. **Auth Check:** Verify that all sensitive routes have active `auth` guards and Role-Based Access Control (RBAC).
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## [MEMORY] Phase 2: Contextual Analysis
|
|
11
11
|
1. **Impact Mapping:** For every identified risk, read the surrounding code to determine if it's exposed to the public internet.
|
|
12
12
|
2. **Configuration Check:** Verify `.env.example` contains all required keys and no real secrets are committed to Git.
|
|
13
13
|
|
|
@@ -15,6 +15,6 @@ This recipe governs the @security agent's protocol for identifying and mitigatin
|
|
|
15
15
|
1. **Fix:** Use `replace_text` to move hardcoded secrets to `.env` or refactor raw SQL to Kysely.
|
|
16
16
|
2. **Sanitization:** Apply input validation using Zod schemas for all external data.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## [OK] Phase 4: Verification & Logging
|
|
19
19
|
1. **Discipline Check:** Run `atabey check` to ensure no new violations were introduced.
|
|
20
20
|
2. **Action Log:** Execute `log_agent_action` with a summary of found vs. fixed vulnerabilities.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [AI] LLM Governance and Data Protection
|
|
2
2
|
|
|
3
3
|
This document outlines the security, safety, and discipline rules for interacting with Large Language Models within Atabey-managed projects. It aligns with the spirit of the EU AI Act, NIST AI RMF, and OWASP Top 10 for LLMs.
|
|
4
4
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ⚛️ Corporate Next.js Standards
|
|
2
|
+
|
|
3
|
+
This document defines the architectural and coding standards for Next.js (App Router) applications.
|
|
4
|
+
|
|
5
|
+
## 1. Architecture Standards
|
|
6
|
+
- **App Router First:** Use the App Router (`app/` directory) exclusively. Page router is deprecated.
|
|
7
|
+
- **Server Component Default:** All components are React Server Components (RSC) by default. Add `"use client"` only when client-side interactivity, state, or effects are strictly required.
|
|
8
|
+
- **Route Handlers:** Place API routes under `app/api/` and follow route handler signatures (`GET`, `POST`, etc.).
|
|
9
|
+
|
|
10
|
+
## 2. Performance & SEO
|
|
11
|
+
- **Metadata API:** Use the static or dynamic Metadata API for title/SEO tag definition.
|
|
12
|
+
- **Image Optimization:** Always use next/image `<Image>` with explicit width/height or fluid placeholders.
|
|
13
|
+
- **Layouts & Suspense:** Implement structured layouts and wrap slower fetching components in `<Suspense>` with skeleton UI fallbacks.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [DATA] Observability and Monitoring Standards
|
|
2
2
|
|
|
3
3
|
This document defines the requirements for logging, tracing, metrics, and alerting within Atabey-managed projects, following the "three pillars" model (logs, metrics, traces).
|
|
4
4
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ⚡ Corporate Vite Standards
|
|
2
|
+
|
|
3
|
+
This document defines the configuration and development standards for Vite-based frontend applications.
|
|
4
|
+
|
|
5
|
+
## 1. Core Config Rules
|
|
6
|
+
- **TypeScript Integration:** Always use `vite-tsconfig-paths` to resolve TS path aliases automatically.
|
|
7
|
+
- **Port Discipline:** Keep development ports standardized. Default frontend port is `5173`.
|
|
8
|
+
- **Environment Variables:** Environment variables must be prefixed with `VITE_` and fully typed in `vite-env.d.ts`.
|
|
9
|
+
|
|
10
|
+
## 2. Dev & Build Optimizations
|
|
11
|
+
- **Build Target:** Target modern browsers (`esnext` or minimum `es2022`).
|
|
12
|
+
- **Code Splitting:** Implement splitChunks (manualChunks) for vendor libraries (e.g. react, react-dom, react-router-dom) to keep bundle sizes under control.
|
|
13
|
+
- **Minification:** Use `esbuild` for maximum build speeds.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
/**
|
|
3
|
-
* Agent Atabey — Single Source of Truth for framework constants.
|
|
4
|
-
* Import from here instead of hardcoding paths, phases, or directory names.
|
|
5
|
-
*/
|
|
6
|
-
// ─── Framework identity ───────────────────────────────────────────────────
|
|
7
|
-
export const FRAMEWORK = {
|
|
8
|
-
NAME: "Agent Atabey",
|
|
9
|
-
CORE_DIR: ".atabey",
|
|
10
|
-
// This is the hub for unified adapter layouts (e.g. .agents/gemini, .agents/claude)
|
|
11
|
-
UNIFIED_HUB_DIR: ".agents",
|
|
12
|
-
// This is the default directory to scaffold new apps into
|
|
13
|
-
APPS_DIR: "apps",
|
|
14
|
-
// This is where all skills are stored
|
|
15
|
-
SKILLS_DIR: "skills",
|
|
16
|
-
};
|
|
17
|
-
export const FRAMEWORK_SUBDIRS = {
|
|
18
|
-
AGENTS: "agents",
|
|
19
|
-
SKILLS: "skills",
|
|
20
|
-
KNOWLEDGE: "knowledge",
|
|
21
|
-
MESSAGES: "messages",
|
|
22
|
-
MEMORY: "memory",
|
|
23
|
-
MEMORY_GRAPH: "memory-graph",
|
|
24
|
-
LOGS: "logs",
|
|
25
|
-
CONFIG: "config",
|
|
26
|
-
};
|
|
27
|
-
export const ROOT_CONFIG_FILES = {
|
|
28
|
-
MCP: "mcp.json",
|
|
29
|
-
NATIVE_MODULES: "native-modules.json",
|
|
30
|
-
TSCONFIG: "tsconfig.json",
|
|
31
|
-
ESLINT: "eslint.config.js",
|
|
32
|
-
};
|
|
33
|
-
export const MCP = {
|
|
34
|
-
// Environment variable used by MCP to identify project root
|
|
35
|
-
PROJECT_ROOT_ENV: "ATABEY_PROJECT_ROOT",
|
|
36
|
-
// Environment variable for test mode
|
|
37
|
-
TEST_DIR_ENV: "ATABEY_TEST_DIR",
|
|
38
|
-
};
|
|
39
|
-
export const MEMORY_FILES = {
|
|
40
|
-
STATE: "state.json",
|
|
41
|
-
SHARED_FACTS: "shared_facts.json",
|
|
42
|
-
};
|
|
43
|
-
export const NATIVE_AGENT_PATHS = {
|
|
44
|
-
gemini: ".gemini/agents",
|
|
45
|
-
claude: ".claude/agents",
|
|
46
|
-
cursor: ".cursor/rules",
|
|
47
|
-
codex: ".agents/instructions",
|
|
48
|
-
grok: ".grok",
|
|
49
|
-
"antigravity-cli": ".antigravity/agents",
|
|
50
|
-
};
|
|
51
|
-
// ─── Backward-compatible aliases ──────────────────────────────────────────
|
|
52
|
-
export const CORE_FRAMEWORK_DIR = FRAMEWORK.CORE_DIR;
|
|
53
|
-
export const UNIFIED_HUB_DIR = FRAMEWORK.UNIFIED_HUB_DIR;
|
|
54
|
-
export const SKILLS_HUB_PATH = pathJoin(UNIFIED_HUB_DIR, FRAMEWORK_SUBDIRS.SKILLS);
|
|
55
|
-
// ─── Path Helpers ─────────────────────────────────────────────────────────
|
|
56
|
-
function pathJoin(...args) {
|
|
57
|
-
return path.join(...args);
|
|
58
|
-
}
|
|
59
|
-
function corePath(subdir, filename) {
|
|
60
|
-
return pathJoin(FRAMEWORK.CORE_DIR, subdir, filename);
|
|
61
|
-
}
|
|
62
|
-
export function knowledgePath(filename) {
|
|
63
|
-
return corePath(FRAMEWORK_SUBDIRS.KNOWLEDGE, filename);
|
|
64
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
-
import { TOOLS, toolHandlers } from "./tools/index.js";
|
|
8
|
-
// ─── Server Setup ─────────────────────────────────────────────────
|
|
9
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
// Robustly find package.json by walking up from __dirname
|
|
11
|
-
function findPackageJson(startDir) {
|
|
12
|
-
let currentDir = startDir;
|
|
13
|
-
while (currentDir !== path.parse(currentDir).root) {
|
|
14
|
-
const pkgPath = path.join(currentDir, "package.json");
|
|
15
|
-
if (fs.existsSync(pkgPath))
|
|
16
|
-
return pkgPath;
|
|
17
|
-
currentDir = path.dirname(currentDir);
|
|
18
|
-
}
|
|
19
|
-
throw new Error("Could not find package.json for atabey-mcp");
|
|
20
|
-
}
|
|
21
|
-
const pkgPath = findPackageJson(__dirname);
|
|
22
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
23
|
-
const serverVersion = pkg.version;
|
|
24
|
-
const server = new Server({
|
|
25
|
-
name: "atabey-mcp",
|
|
26
|
-
version: serverVersion,
|
|
27
|
-
}, {
|
|
28
|
-
capabilities: {
|
|
29
|
-
tools: {},
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
// Basic Schema Validator for Required Fields
|
|
33
|
-
function validateArgs(toolName, args) {
|
|
34
|
-
const definition = TOOLS.find(t => t.name === toolName);
|
|
35
|
-
if (!definition)
|
|
36
|
-
return `Unknown tool: ${toolName}`;
|
|
37
|
-
const required = definition.inputSchema.required || [];
|
|
38
|
-
for (const field of required) {
|
|
39
|
-
if (args[field] === undefined || args[field] === null || args[field] === "") {
|
|
40
|
-
return `Missing required argument: '${field}' for tool '${toolName}'`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
server.setRequestHandler(ListToolsRequestSchema, async (request) => {
|
|
46
|
-
// 2026 Stateless Spec: Log client info from metadata if available
|
|
47
|
-
const meta = request._meta;
|
|
48
|
-
if (meta) {
|
|
49
|
-
process.stderr.write(`[MCP] Stateless ListTools from ${meta.client?.name || "unknown"} v${meta.client?.version || "?.?"}\n`);
|
|
50
|
-
}
|
|
51
|
-
return { tools: TOOLS };
|
|
52
|
-
});
|
|
53
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
54
|
-
const req = request;
|
|
55
|
-
const { name, arguments: args } = req.params;
|
|
56
|
-
const meta = request._meta;
|
|
57
|
-
// 2026 Stateless Spec: Prioritize metadata-driven context
|
|
58
|
-
if (meta) {
|
|
59
|
-
process.stderr.write(`[MCP] Stateless CallTool: ${name} (Client: ${meta.client?.name || "unknown"})\n`);
|
|
60
|
-
}
|
|
61
|
-
const projectRoot = process.env.ATABEY_PROJECT_ROOT || process.cwd();
|
|
62
|
-
try {
|
|
63
|
-
const handler = toolHandlers[name];
|
|
64
|
-
if (!handler) {
|
|
65
|
-
return {
|
|
66
|
-
isError: true,
|
|
67
|
-
content: [{ type: "text", text: `❌ Unknown tool: ${name}` }],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
// 🛡️ Runtime Validation
|
|
71
|
-
const validationError = validateArgs(name, args || {});
|
|
72
|
-
if (validationError) {
|
|
73
|
-
return {
|
|
74
|
-
isError: true,
|
|
75
|
-
content: [{ type: "text", text: `❌ Validation Error: ${validationError}` }],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return await handler(projectRoot, args || {});
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
const message = error instanceof Error ? error.message : "Unknown error occurred";
|
|
82
|
-
return {
|
|
83
|
-
isError: true,
|
|
84
|
-
content: [{ type: "text", text: `❌ Execution failed: ${message}` }],
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
// ─── Graceful Startup & Shutdown ──────────────────────────────────
|
|
89
|
-
async function run() {
|
|
90
|
-
const transport = new StdioServerTransport();
|
|
91
|
-
// Prevent unhandled errors from crashing the MCP stream
|
|
92
|
-
process.on("uncaughtException", (error) => {
|
|
93
|
-
process.stderr.write(`[atabey-mcp] Uncaught exception: ${error.message}
|
|
94
|
-
`);
|
|
95
|
-
});
|
|
96
|
-
process.on("unhandledRejection", (reason) => {
|
|
97
|
-
const message = reason instanceof Error ? reason.message : String(reason);
|
|
98
|
-
process.stderr.write(`[atabey-mcp] Unhandled rejection: ${message}
|
|
99
|
-
`);
|
|
100
|
-
});
|
|
101
|
-
// Graceful shutdown on SIGINT/SIGTERM
|
|
102
|
-
const shutdown = async () => {
|
|
103
|
-
try {
|
|
104
|
-
await server.close();
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
// Already closed or failed — safe to ignore
|
|
108
|
-
}
|
|
109
|
-
process.exit(0);
|
|
110
|
-
};
|
|
111
|
-
process.on("SIGINT", shutdown);
|
|
112
|
-
process.on("SIGTERM", shutdown);
|
|
113
|
-
await server.connect(transport);
|
|
114
|
-
}
|
|
115
|
-
run().catch((error) => {
|
|
116
|
-
process.stderr.write(`[atabey-mcp] Fatal startup error: ${error.message}
|
|
117
|
-
`);
|
|
118
|
-
process.exit(1);
|
|
119
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
-
/**
|
|
5
|
-
* Handles acquiring a stateful lock on a resource.
|
|
6
|
-
*/
|
|
7
|
-
export async function handleAcquireLock(projectRoot, args) {
|
|
8
|
-
const { resource, agent, ttl = 60 } = args;
|
|
9
|
-
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
10
|
-
const lockDir = path.join(projectRoot, frameworkDir, "locks");
|
|
11
|
-
const lockPath = path.join(lockDir, `${resource}.lock`);
|
|
12
|
-
try {
|
|
13
|
-
if (!fs.existsSync(lockDir))
|
|
14
|
-
fs.mkdirSync(lockDir, { recursive: true });
|
|
15
|
-
// Check for stale lock first
|
|
16
|
-
if (fs.existsSync(lockPath)) {
|
|
17
|
-
const stat = fs.statSync(lockPath);
|
|
18
|
-
const now = new Date().getTime();
|
|
19
|
-
const age = (now - stat.mtimeMs) / 1000;
|
|
20
|
-
if (age < ttl) {
|
|
21
|
-
return {
|
|
22
|
-
isError: true,
|
|
23
|
-
content: [{ type: "text", text: `Resource '${resource}' is currently locked by another agent.` }]
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// Lock expired, safe to override by renaming first (POSIX atomic operation)
|
|
27
|
-
const tempLockPath = `${lockPath}.${Math.random().toString(36).substring(2)}.old`;
|
|
28
|
-
try {
|
|
29
|
-
fs.renameSync(lockPath, tempLockPath);
|
|
30
|
-
fs.unlinkSync(tempLockPath);
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// If rename failed, it means another agent already evicting/deleting it.
|
|
34
|
-
// Do not delete anything else; proceed and let writeFileSync (wx flag) fail if a new lock exists.
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// Use 'wx' flag for atomic file creation
|
|
38
|
-
const lockData = JSON.stringify({ agent, timestamp: new Date().toISOString() });
|
|
39
|
-
fs.writeFileSync(lockPath, lockData, { flag: "wx" });
|
|
40
|
-
return {
|
|
41
|
-
content: [{ type: "text", text: `✅ Lock acquired for resource '${resource}' by ${agent}.` }]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
const error = e;
|
|
46
|
-
if (error.code === "EEXIST") {
|
|
47
|
-
return {
|
|
48
|
-
isError: true,
|
|
49
|
-
content: [{ type: "text", text: `Resource '${resource}' was just acquired by another agent.` }]
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
isError: true,
|
|
54
|
-
content: [{ type: "text", text: `Failed to acquire lock: ${String(e)}` }]
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Handles releasing a lock.
|
|
60
|
-
*/
|
|
61
|
-
export async function handleReleaseLock(projectRoot, args) {
|
|
62
|
-
const { resource, agent } = args;
|
|
63
|
-
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
64
|
-
const lockPath = path.join(projectRoot, frameworkDir, "locks", `${resource}.lock`);
|
|
65
|
-
try {
|
|
66
|
-
if (!fs.existsSync(lockPath)) {
|
|
67
|
-
return { content: [{ type: "text", text: `ℹ️ No lock found for resource '${resource}'.` }] };
|
|
68
|
-
}
|
|
69
|
-
const lockData = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
70
|
-
if (lockData.agent !== agent) {
|
|
71
|
-
return {
|
|
72
|
-
isError: true,
|
|
73
|
-
content: [{ type: "text", text: `❌ Denied: You do not own the lock for '${resource}'. Owned by ${lockData.agent}.` }]
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
fs.unlinkSync(lockPath);
|
|
77
|
-
return { content: [{ type: "text", text: `✅ Lock released for resource '${resource}' by ${agent}.` }] };
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
return { isError: true, content: [{ type: "text", text: `Failed to release lock: ${String(e)}` }] };
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
-
/**
|
|
5
|
-
* Handles agent registration with the Control Plane.
|
|
6
|
-
* This can be used to validate permissions and active status.
|
|
7
|
-
*/
|
|
8
|
-
export async function handleRegisterAgent(projectRoot, args) {
|
|
9
|
-
const { agent, role, capability = 5 } = args;
|
|
10
|
-
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
11
|
-
const registryDir = path.join(projectRoot, frameworkDir, "registry");
|
|
12
|
-
const agentFile = path.join(registryDir, `${agent.replace("@", "")}_active.json`);
|
|
13
|
-
try {
|
|
14
|
-
if (!fs.existsSync(registryDir))
|
|
15
|
-
fs.mkdirSync(registryDir, { recursive: true });
|
|
16
|
-
const agentData = {
|
|
17
|
-
agent,
|
|
18
|
-
role,
|
|
19
|
-
capability,
|
|
20
|
-
last_seen: new Date().toISOString(),
|
|
21
|
-
status: "ACTIVE"
|
|
22
|
-
};
|
|
23
|
-
fs.writeFileSync(agentFile, JSON.stringify(agentData, null, 2));
|
|
24
|
-
return {
|
|
25
|
-
content: [{ type: "text", text: `🎖️ Agent ${agent} (${role}) registered successfully in the Atabey Control Plane.` }]
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
return {
|
|
30
|
-
isError: true,
|
|
31
|
-
content: [{ type: "text", text: `Failed to register agent: ${String(e)}` }]
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|