atabey 0.0.6 → 0.0.8
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.js +29 -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.d.ts +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 +13 -20
- 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 +6 -2
- package/dist/src/shared/constants.js +5 -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/adapter.test.js +3 -2
- package/dist/tests/adapter.test.js.map +1 -1
- 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/framework-mcp/dist/constants.js +1 -1
- package/framework-mcp/{src/constants.ts → dist/framework-mcp/src/constants.js} +4 -18
- package/framework-mcp/{src/index.ts → dist/framework-mcp/src/index.js} +52 -53
- package/framework-mcp/dist/framework-mcp/src/resources/index.js +58 -0
- package/framework-mcp/{src/tools/control_plane/locking.ts → dist/framework-mcp/src/tools/control_plane/locking.js} +14 -21
- package/framework-mcp/{src/tools/control_plane/registry.ts → dist/framework-mcp/src/tools/control_plane/registry.js} +8 -11
- package/framework-mcp/{src/tools/definitions.ts → dist/framework-mcp/src/tools/definitions.js} +35 -5
- package/framework-mcp/{src/tools/file_system/batch_surgical_edit.ts → dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js} +16 -31
- package/framework-mcp/{src/tools/file_system/patch_file.ts → dist/framework-mcp/src/tools/file_system/patch_file.js} +9 -14
- package/framework-mcp/{src/tools/file_system/read_file.ts → dist/framework-mcp/src/tools/file_system/read_file.js} +9 -16
- package/framework-mcp/{src/tools/file_system/replace_text.ts → dist/framework-mcp/src/tools/file_system/replace_text.js} +13 -17
- package/framework-mcp/{src/tools/file_system/write_file.ts → dist/framework-mcp/src/tools/file_system/write_file.js} +14 -16
- package/framework-mcp/{src/tools/framework/audit_deps.ts → dist/framework-mcp/src/tools/framework/audit_deps.js} +9 -17
- package/framework-mcp/{src/tools/framework/get_status.ts → dist/framework-mcp/src/tools/framework/get_status.js} +1 -3
- package/framework-mcp/{src/tools/framework/orchestrate.ts → dist/framework-mcp/src/tools/framework/orchestrate.js} +1 -3
- package/framework-mcp/{src/tools/framework/run_tests.ts → dist/framework-mcp/src/tools/framework/run_tests.js} +9 -12
- package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/{src/tools/framework/update_contract_hash.ts → dist/framework-mcp/src/tools/framework/update_contract_hash.js} +1 -3
- package/framework-mcp/{src/tools/framework/update_memory.ts → dist/framework-mcp/src/tools/framework/update_memory.js} +2 -4
- package/framework-mcp/{src/tools/index.ts → dist/framework-mcp/src/tools/index.js} +5 -7
- package/framework-mcp/{src/tools/memory/get_insights.ts → dist/framework-mcp/src/tools/memory/get_insights.js} +4 -11
- package/framework-mcp/{src/tools/memory/read_memory.ts → dist/framework-mcp/src/tools/memory/read_memory.js} +3 -6
- package/framework-mcp/{src/tools/messaging/log_action.ts → dist/framework-mcp/src/tools/messaging/log_action.js} +2 -8
- package/framework-mcp/{src/tools/messaging/send_message.ts → dist/framework-mcp/src/tools/messaging/send_message.js} +19 -22
- package/framework-mcp/{src/tools/observability/check_ports.ts → dist/framework-mcp/src/tools/observability/check_ports.js} +6 -10
- package/framework-mcp/{src/tools/observability/get_health.ts → dist/framework-mcp/src/tools/observability/get_health.js} +1 -6
- package/framework-mcp/{src/tools/quality/check_lint.ts → dist/framework-mcp/src/tools/quality/check_lint.js} +3 -9
- package/framework-mcp/{src/tools/search/get_gaps.ts → dist/framework-mcp/src/tools/search/get_gaps.js} +12 -18
- package/framework-mcp/{src/tools/search/get_map.ts → dist/framework-mcp/src/tools/search/get_map.js} +14 -19
- package/framework-mcp/{src/tools/search/grep_search.ts → dist/framework-mcp/src/tools/search/grep_search.js} +26 -26
- package/framework-mcp/{src/tools/search/list_dir.ts → dist/framework-mcp/src/tools/search/list_dir.js} +4 -10
- package/framework-mcp/{src/tools/shell/run_command.ts → dist/framework-mcp/src/tools/shell/run_command.js} +1 -11
- package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
- package/framework-mcp/{src/utils/cli.ts → dist/framework-mcp/src/utils/cli.js} +25 -19
- package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +231 -0
- package/framework-mcp/{src/utils/fs.ts → dist/framework-mcp/src/utils/fs.js} +9 -10
- package/framework-mcp/{src/utils/metrics.ts → dist/framework-mcp/src/utils/metrics.js} +11 -28
- package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +71 -0
- package/framework-mcp/{src/utils/security.ts → dist/framework-mcp/src/utils/security.js} +9 -15
- package/framework-mcp/dist/index.js +29 -5
- package/framework-mcp/dist/resources/index.js +58 -0
- package/{src/cli/adapters/core.ts → framework-mcp/dist/src/cli/adapters/core.js} +21 -41
- package/{src/cli/adapters/index.ts → framework-mcp/dist/src/cli/adapters/index.js} +1 -1
- package/{src/cli/adapters/paths.ts → framework-mcp/dist/src/cli/adapters/paths.js} +19 -53
- package/{src/cli/adapters/scaffold.ts → framework-mcp/dist/src/cli/adapters/scaffold.js} +18 -42
- package/{src/cli/adapters/utils.ts → framework-mcp/dist/src/cli/adapters/utils.js} +19 -31
- package/{src/cli/commands/approve.ts → framework-mcp/dist/src/cli/commands/approve.js} +15 -25
- package/{src/cli/commands/check.ts → framework-mcp/dist/src/cli/commands/check.js} +36 -43
- package/{src/cli/commands/compliance.ts → framework-mcp/dist/src/cli/commands/compliance.js} +10 -15
- package/{src/cli/commands/contract.ts → framework-mcp/dist/src/cli/commands/contract.js} +13 -31
- package/framework-mcp/dist/src/cli/commands/dashboard.js +123 -0
- package/{src/cli/commands/explorer.ts → framework-mcp/dist/src/cli/commands/explorer.js} +14 -17
- package/{src/cli/commands/git.ts → framework-mcp/dist/src/cli/commands/git.js} +15 -14
- package/framework-mcp/dist/src/cli/commands/init/create-agent.js +58 -0
- package/{src/cli/commands/init/scaffold-core.ts → framework-mcp/dist/src/cli/commands/init/scaffold-core.js} +35 -59
- package/framework-mcp/dist/src/cli/commands/init/scaffold-docs.js +34 -0
- package/{src/cli/commands/init/scaffold-ops.ts → framework-mcp/dist/src/cli/commands/init/scaffold-ops.js} +19 -22
- package/{src/cli/commands/init/scaffold-standards.ts → framework-mcp/dist/src/cli/commands/init/scaffold-standards.js} +20 -20
- package/{src/cli/commands/init.ts → framework-mcp/dist/src/cli/commands/init.js} +51 -77
- package/{src/cli/commands/knowledge.ts → framework-mcp/dist/src/cli/commands/knowledge.js} +9 -11
- package/{src/cli/commands/lint.ts → framework-mcp/dist/src/cli/commands/lint.js} +5 -6
- package/framework-mcp/dist/src/cli/commands/log.js +10 -0
- package/{src/cli/commands/memory.ts → framework-mcp/dist/src/cli/commands/memory.js} +1 -3
- package/framework-mcp/dist/src/cli/commands/orchestrate.js +159 -0
- package/framework-mcp/dist/src/cli/commands/plan.js +117 -0
- package/{src/cli/commands/script.ts → framework-mcp/dist/src/cli/commands/script.js} +6 -7
- package/{src/cli/commands/security.ts → framework-mcp/dist/src/cli/commands/security.js} +6 -8
- package/framework-mcp/dist/src/cli/commands/status.js +97 -0
- package/framework-mcp/dist/src/cli/commands/trace.js +109 -0
- package/{src/cli/index.ts → framework-mcp/dist/src/cli/index.js} +80 -64
- package/{src/cli/shims.ts → framework-mcp/dist/src/cli/shims.js} +15 -15
- package/{src/cli/utils/claude.ts → framework-mcp/dist/src/cli/utils/claude.js} +8 -15
- package/{src/cli/utils/compliance.ts → framework-mcp/dist/src/cli/utils/compliance.js} +18 -36
- package/{src/cli/utils/config-schema.ts → framework-mcp/dist/src/cli/utils/config-schema.js} +0 -6
- package/{src/cli/utils/fs.ts → framework-mcp/dist/src/cli/utils/fs.js} +34 -67
- package/{src/cli/utils/i18n.ts → framework-mcp/dist/src/cli/utils/i18n.js} +3 -17
- package/{src/cli/utils/memory.ts → framework-mcp/dist/src/cli/utils/memory.js} +87 -114
- package/{src/cli/utils/pkg.ts → framework-mcp/dist/src/cli/utils/pkg.js} +120 -155
- package/{src/cli/utils/schemas.ts → framework-mcp/dist/src/cli/utils/schemas.js} +0 -3
- package/{src/cli/utils/string.ts → framework-mcp/dist/src/cli/utils/string.js} +18 -24
- package/{src/cli/utils/time.ts → framework-mcp/dist/src/cli/utils/time.js} +4 -4
- package/{src/cli/utils/ui.ts → framework-mcp/dist/src/cli/utils/ui.js} +9 -17
- package/{src/contracts/tasks.ts → framework-mcp/dist/src/contracts/tasks.js} +0 -6
- package/framework-mcp/dist/src/dashboard/vite.config.js +15 -0
- package/framework-mcp/dist/src/modules/adapters/definitions.js +140 -0
- package/framework-mcp/dist/src/modules/adapters/registry.js +18 -0
- package/{src/modules/adapters/shared.ts → framework-mcp/dist/src/modules/adapters/shared.js} +9 -25
- package/framework-mcp/dist/src/modules/adapters/types.js +1 -0
- package/{src/modules/agents/definitions.ts → framework-mcp/dist/src/modules/agents/definitions.js} +158 -161
- package/{src/modules/agents/registry/analyst.ts → framework-mcp/dist/src/modules/agents/registry/analyst.js} +9 -14
- package/{src/modules/agents/registry/architect.ts → framework-mcp/dist/src/modules/agents/registry/architect.js} +9 -14
- package/{src/modules/agents/registry/backend.ts → framework-mcp/dist/src/modules/agents/registry/backend.js} +16 -13
- package/{src/modules/agents/registry/database.ts → framework-mcp/dist/src/modules/agents/registry/database.js} +16 -14
- package/{src/modules/agents/registry/devops.ts → framework-mcp/dist/src/modules/agents/registry/devops.js} +15 -14
- package/{src/modules/agents/registry/explorer.ts → framework-mcp/dist/src/modules/agents/registry/explorer.js} +9 -14
- package/{src/modules/agents/registry/frontend.ts → framework-mcp/dist/src/modules/agents/registry/frontend.js} +17 -14
- package/{src/modules/agents/registry/git.ts → framework-mcp/dist/src/modules/agents/registry/git.js} +9 -14
- package/{src/modules/agents/registry/manager.ts → framework-mcp/dist/src/modules/agents/registry/manager.js} +10 -15
- package/{src/modules/agents/registry/mobile.ts → framework-mcp/dist/src/modules/agents/registry/mobile.js} +9 -14
- package/{src/modules/agents/registry/native.ts → framework-mcp/dist/src/modules/agents/registry/native.js} +9 -14
- package/{src/modules/agents/registry/quality.ts → framework-mcp/dist/src/modules/agents/registry/quality.js} +9 -14
- package/{src/modules/agents/registry/security.ts → framework-mcp/dist/src/modules/agents/registry/security.js} +15 -14
- package/framework-mcp/dist/src/modules/agents/types.js +1 -0
- package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +102 -0
- package/framework-mcp/dist/src/modules/engines/health-engine.js +49 -0
- package/framework-mcp/dist/src/modules/engines/planning-engine.js +78 -0
- package/framework-mcp/dist/src/modules/engines/risk-engine.js +105 -0
- package/framework-mcp/dist/src/modules/engines/routing-engine.js +73 -0
- package/framework-mcp/dist/src/modules/engines/types.js +1 -0
- package/{src/modules/skills/definitions.ts → framework-mcp/dist/src/modules/skills/definitions.js} +0 -1
- package/{src/shared/constants.ts → framework-mcp/dist/src/shared/constants.js} +40 -71
- package/{src/shared/errors.ts → framework-mcp/dist/src/shared/errors.js} +10 -17
- package/{src/shared/fs.ts → framework-mcp/dist/src/shared/fs.js} +14 -13
- package/{src/shared/logger.ts → framework-mcp/dist/src/shared/logger.js} +28 -51
- package/framework-mcp/dist/src/shared/storage.js +207 -0
- package/framework-mcp/dist/src/shared/types.js +12 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +3 -3
- package/framework-mcp/dist/tools/control_plane/registry.js +3 -2
- package/framework-mcp/dist/tools/definitions.js +33 -1
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +8 -3
- package/framework-mcp/dist/tools/file_system/patch_file.js +8 -3
- package/framework-mcp/dist/tools/file_system/read_file.js +3 -3
- package/framework-mcp/dist/tools/file_system/replace_text.js +8 -3
- package/framework-mcp/dist/tools/file_system/write_file.js +10 -5
- package/framework-mcp/dist/tools/framework/audit_deps.js +2 -2
- package/framework-mcp/dist/tools/framework/run_tests.js +2 -2
- package/framework-mcp/dist/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/dist/tools/framework/update_memory.js +1 -1
- package/framework-mcp/dist/tools/index.js +2 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +1 -1
- package/framework-mcp/dist/tools/messaging/log_action.js +1 -1
- package/framework-mcp/dist/tools/messaging/send_message.js +5 -5
- package/framework-mcp/dist/tools/observability/check_ports.js +1 -1
- package/framework-mcp/dist/tools/quality/check_lint.js +2 -2
- package/framework-mcp/dist/tools/search/get_gaps.js +1 -1
- package/framework-mcp/dist/tools/search/grep_search.js +3 -3
- package/framework-mcp/dist/utils/compliance.js +158 -5
- package/framework-mcp/dist/utils/permissions.js +71 -0
- package/framework-mcp/package.json +7 -1
- package/mcp.json +1 -1
- package/package.json +10 -6
- 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/package-lock.json +0 -1191
- package/framework-mcp/src/declarations.d.ts +0 -17
- package/framework-mcp/src/tools/types.ts +0 -89
- package/framework-mcp/src/utils/compliance.ts +0 -95
- 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/commands/init/scaffold-docs.ts +0 -44
- package/src/cli/commands/log.ts +0 -37
- package/src/cli/commands/orchestrate.ts +0 -450
- package/src/cli/commands/plan.ts +0 -113
- package/src/cli/commands/status.ts +0 -44
- package/src/cli/commands/trace.ts +0 -31
- package/src/modules/adapters/definitions.ts +0 -171
- package/src/modules/adapters/registry.ts +0 -27
- package/src/modules/adapters/types.ts +0 -16
- package/src/modules/agents/types.ts +0 -37
- package/src/schema/agent-lifecycle-schema.json +0 -59
- package/src/shared/types.ts +0 -20
- /package/{src/contracts/index.ts → framework-mcp/dist/src/contracts/index.js} +0 -0
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Agent Atabey — Single Source of Truth for framework constants.
|
|
5
4
|
* Import from here instead of hardcoding paths, phases, or directory names.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
6
|
// ─── Framework identity ───────────────────────────────────────────────────
|
|
9
|
-
|
|
10
7
|
export const FRAMEWORK = {
|
|
11
8
|
NAME: "Agent Atabey",
|
|
12
9
|
CORE_DIR: ".atabey",
|
|
@@ -17,7 +14,6 @@ export const FRAMEWORK = {
|
|
|
17
14
|
// This is where all skills are stored
|
|
18
15
|
SKILLS_DIR: "skills",
|
|
19
16
|
};
|
|
20
|
-
|
|
21
17
|
export const FRAMEWORK_SUBDIRS = {
|
|
22
18
|
AGENTS: "agents",
|
|
23
19
|
SKILLS: "skills",
|
|
@@ -28,51 +24,41 @@ export const FRAMEWORK_SUBDIRS = {
|
|
|
28
24
|
LOGS: "logs",
|
|
29
25
|
CONFIG: "config",
|
|
30
26
|
};
|
|
31
|
-
|
|
32
27
|
export const ROOT_CONFIG_FILES = {
|
|
33
28
|
MCP: "mcp.json",
|
|
34
29
|
NATIVE_MODULES: "native-modules.json",
|
|
35
30
|
TSCONFIG: "tsconfig.json",
|
|
36
31
|
ESLINT: "eslint.config.js",
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
export const MCP = {
|
|
40
34
|
// Environment variable used by MCP to identify project root
|
|
41
35
|
PROJECT_ROOT_ENV: "ATABEY_PROJECT_ROOT",
|
|
42
36
|
// Environment variable for test mode
|
|
43
37
|
TEST_DIR_ENV: "ATABEY_TEST_DIR",
|
|
44
38
|
};
|
|
45
|
-
|
|
46
39
|
export const MEMORY_FILES = {
|
|
47
40
|
STATE: "state.json",
|
|
48
41
|
SHARED_FACTS: "shared_facts.json",
|
|
49
42
|
};
|
|
50
|
-
|
|
51
43
|
export const NATIVE_AGENT_PATHS = {
|
|
52
44
|
gemini: ".gemini/agents",
|
|
53
45
|
claude: ".claude/agents",
|
|
54
46
|
cursor: ".cursor/rules",
|
|
55
47
|
codex: ".agents/instructions",
|
|
56
48
|
grok: ".grok",
|
|
57
|
-
"antigravity-cli": ".
|
|
49
|
+
"antigravity-cli": ".agents/agents",
|
|
58
50
|
};
|
|
59
|
-
|
|
60
51
|
// ─── Backward-compatible aliases ──────────────────────────────────────────
|
|
61
|
-
|
|
62
52
|
export const CORE_FRAMEWORK_DIR = FRAMEWORK.CORE_DIR;
|
|
63
53
|
export const UNIFIED_HUB_DIR = FRAMEWORK.UNIFIED_HUB_DIR;
|
|
64
54
|
export const SKILLS_HUB_PATH = pathJoin(UNIFIED_HUB_DIR, FRAMEWORK_SUBDIRS.SKILLS);
|
|
65
|
-
|
|
66
55
|
// ─── Path Helpers ─────────────────────────────────────────────────────────
|
|
67
|
-
|
|
68
|
-
function pathJoin(...args: string[]): string {
|
|
56
|
+
function pathJoin(...args) {
|
|
69
57
|
return path.join(...args);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
|
-
function corePath(subdir: string, filename: string): string {
|
|
59
|
+
function corePath(subdir, filename) {
|
|
73
60
|
return pathJoin(FRAMEWORK.CORE_DIR, subdir, filename);
|
|
74
61
|
}
|
|
75
|
-
|
|
76
|
-
export function knowledgePath(filename: string): string {
|
|
62
|
+
export function knowledgePath(filename) {
|
|
77
63
|
return corePath(FRAMEWORK_SUBDIRS.KNOWLEDGE, filename);
|
|
78
64
|
}
|
|
@@ -4,51 +4,39 @@ import path from "path";
|
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
5
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
7
|
-
import {
|
|
8
|
-
CallToolRequestSchema,
|
|
9
|
-
ListToolsRequestSchema,
|
|
10
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
13
8
|
import { TOOLS, toolHandlers } from "./tools/index.js";
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import { RESOURCES, handleReadResource } from "./resources/index.js";
|
|
16
10
|
// ─── Server Setup ─────────────────────────────────────────────────
|
|
17
|
-
|
|
18
11
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
19
|
-
|
|
20
12
|
// Robustly find package.json by walking up from __dirname
|
|
21
|
-
function findPackageJson(startDir
|
|
13
|
+
function findPackageJson(startDir) {
|
|
22
14
|
let currentDir = startDir;
|
|
23
15
|
while (currentDir !== path.parse(currentDir).root) {
|
|
24
16
|
const pkgPath = path.join(currentDir, "package.json");
|
|
25
|
-
if (fs.existsSync(pkgPath))
|
|
17
|
+
if (fs.existsSync(pkgPath))
|
|
18
|
+
return pkgPath;
|
|
26
19
|
currentDir = path.dirname(currentDir);
|
|
27
20
|
}
|
|
28
21
|
throw new Error("Could not find package.json for atabey-mcp");
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
const pkgPath = findPackageJson(__dirname);
|
|
32
24
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
33
25
|
const serverVersion = pkg.version;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
const server = new Server({
|
|
27
|
+
name: "atabey-mcp",
|
|
28
|
+
version: serverVersion,
|
|
29
|
+
}, {
|
|
30
|
+
capabilities: {
|
|
31
|
+
tools: {},
|
|
32
|
+
resources: {},
|
|
39
33
|
},
|
|
40
|
-
|
|
41
|
-
capabilities: {
|
|
42
|
-
tools: {},
|
|
43
|
-
},
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
|
|
34
|
+
});
|
|
47
35
|
// Basic Schema Validator for Required Fields
|
|
48
|
-
function validateArgs(toolName
|
|
36
|
+
function validateArgs(toolName, args) {
|
|
49
37
|
const definition = TOOLS.find(t => t.name === toolName);
|
|
50
|
-
if (!definition)
|
|
51
|
-
|
|
38
|
+
if (!definition)
|
|
39
|
+
return `Unknown tool: ${toolName}`;
|
|
52
40
|
const required = definition.inputSchema.required || [];
|
|
53
41
|
for (const field of required) {
|
|
54
42
|
if (args[field] === undefined || args[field] === null || args[field] === "") {
|
|
@@ -57,88 +45,99 @@ function validateArgs(toolName: string, args: Record<string, unknown>): string |
|
|
|
57
45
|
}
|
|
58
46
|
return null;
|
|
59
47
|
}
|
|
60
|
-
|
|
61
48
|
server.setRequestHandler(ListToolsRequestSchema, async (request) => {
|
|
62
49
|
// 2026 Stateless Spec: Log client info from metadata if available
|
|
63
|
-
const meta =
|
|
50
|
+
const meta = request._meta;
|
|
64
51
|
if (meta) {
|
|
65
52
|
process.stderr.write(`[MCP] Stateless ListTools from ${meta.client?.name || "unknown"} v${meta.client?.version || "?.?"}\n`);
|
|
66
53
|
}
|
|
67
54
|
return { tools: TOOLS };
|
|
68
55
|
});
|
|
69
|
-
|
|
56
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
57
|
+
return { resources: RESOURCES };
|
|
58
|
+
});
|
|
59
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
60
|
+
const uri = request.params.uri;
|
|
61
|
+
try {
|
|
62
|
+
const content = await handleReadResource(uri);
|
|
63
|
+
return {
|
|
64
|
+
contents: [
|
|
65
|
+
{
|
|
66
|
+
uri,
|
|
67
|
+
mimeType: "text/markdown",
|
|
68
|
+
text: content,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
75
|
+
throw new Error(`Failed to read resource: ${message}`, { cause: error });
|
|
76
|
+
}
|
|
77
|
+
});
|
|
70
78
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
71
|
-
const req = request
|
|
79
|
+
const req = request;
|
|
72
80
|
const { name, arguments: args } = req.params;
|
|
73
|
-
const meta =
|
|
74
|
-
|
|
81
|
+
const meta = request._meta;
|
|
75
82
|
// 2026 Stateless Spec: Prioritize metadata-driven context
|
|
76
83
|
if (meta) {
|
|
77
84
|
process.stderr.write(`[MCP] Stateless CallTool: ${name} (Client: ${meta.client?.name || "unknown"})\n`);
|
|
78
85
|
}
|
|
79
|
-
|
|
80
86
|
const projectRoot = process.env.ATABEY_PROJECT_ROOT || process.cwd();
|
|
81
|
-
|
|
82
87
|
try {
|
|
83
88
|
const handler = toolHandlers[name];
|
|
84
89
|
if (!handler) {
|
|
85
90
|
return {
|
|
86
91
|
isError: true,
|
|
87
|
-
content: [{ type: "text"
|
|
92
|
+
content: [{ type: "text", text: `[ERROR] Unknown tool: ${name}` }],
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
|
-
|
|
91
|
-
// 🛡️ Runtime Validation
|
|
95
|
+
// [SECURITY] Runtime Validation
|
|
92
96
|
const validationError = validateArgs(name, args || {});
|
|
93
97
|
if (validationError) {
|
|
94
98
|
return {
|
|
95
99
|
isError: true,
|
|
96
|
-
content: [{ type: "text"
|
|
100
|
+
content: [{ type: "text", text: `[ERROR] Validation Error: ${validationError}` }],
|
|
97
101
|
};
|
|
98
102
|
}
|
|
99
|
-
|
|
100
103
|
return await handler(projectRoot, args || {});
|
|
101
|
-
}
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
102
106
|
const message = error instanceof Error ? error.message : "Unknown error occurred";
|
|
103
107
|
return {
|
|
104
108
|
isError: true,
|
|
105
|
-
content: [{ type: "text"
|
|
109
|
+
content: [{ type: "text", text: `[ERROR] Execution failed: ${message}` }],
|
|
106
110
|
};
|
|
107
111
|
}
|
|
108
112
|
});
|
|
109
|
-
|
|
110
113
|
// ─── Graceful Startup & Shutdown ──────────────────────────────────
|
|
111
|
-
|
|
112
114
|
async function run() {
|
|
113
115
|
const transport = new StdioServerTransport();
|
|
114
|
-
|
|
115
116
|
// Prevent unhandled errors from crashing the MCP stream
|
|
116
|
-
process.on("uncaughtException", (error
|
|
117
|
+
process.on("uncaughtException", (error) => {
|
|
117
118
|
process.stderr.write(`[atabey-mcp] Uncaught exception: ${error.message}
|
|
118
119
|
`);
|
|
119
120
|
});
|
|
120
|
-
process.on("unhandledRejection", (reason
|
|
121
|
+
process.on("unhandledRejection", (reason) => {
|
|
121
122
|
const message = reason instanceof Error ? reason.message : String(reason);
|
|
122
123
|
process.stderr.write(`[atabey-mcp] Unhandled rejection: ${message}
|
|
123
124
|
`);
|
|
124
125
|
});
|
|
125
|
-
|
|
126
126
|
// Graceful shutdown on SIGINT/SIGTERM
|
|
127
127
|
const shutdown = async () => {
|
|
128
128
|
try {
|
|
129
129
|
await server.close();
|
|
130
|
-
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
131
132
|
// Already closed or failed — safe to ignore
|
|
132
133
|
}
|
|
133
134
|
process.exit(0);
|
|
134
135
|
};
|
|
135
136
|
process.on("SIGINT", shutdown);
|
|
136
137
|
process.on("SIGTERM", shutdown);
|
|
137
|
-
|
|
138
138
|
await server.connect(transport);
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
run().catch((error: Error) => {
|
|
140
|
+
run().catch((error) => {
|
|
142
141
|
process.stderr.write(`[atabey-mcp] Fatal startup error: ${error.message}
|
|
143
142
|
`);
|
|
144
143
|
process.exit(1);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Storage } from "../../../src/shared/storage.js";
|
|
2
|
+
/**
|
|
3
|
+
* [DATA] MCP Resource Definitions
|
|
4
|
+
*/
|
|
5
|
+
export const RESOURCES = [
|
|
6
|
+
{
|
|
7
|
+
uri: "atabey://army/status",
|
|
8
|
+
name: "Agent Army Status",
|
|
9
|
+
description: "Real-time state and active tasks of all specialized agents.",
|
|
10
|
+
mimeType: "text/markdown"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
uri: "atabey://plan/active",
|
|
14
|
+
name: "Active Execution Plan",
|
|
15
|
+
description: "The current DAG of tasks and their completion status.",
|
|
16
|
+
mimeType: "text/markdown"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
uri: "atabey://memory/project",
|
|
20
|
+
name: "Project Memory",
|
|
21
|
+
description: "The central source of truth for project context (PROJECT_MEMORY.md).",
|
|
22
|
+
mimeType: "text/markdown"
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
export async function handleReadResource(uri) {
|
|
26
|
+
if (uri === "atabey://army/status") {
|
|
27
|
+
const agents = Storage.getAllAgents();
|
|
28
|
+
let md = "# [AI] Agent Army Status\n\n| Agent | State | Active Task | Last Updated |\n| :--- | :--- | :--- | :--- |\n";
|
|
29
|
+
agents.forEach((a) => {
|
|
30
|
+
md += `| @${a.name} | ${a.state} | ${a.task} | ${a.last_updated} |\n`;
|
|
31
|
+
});
|
|
32
|
+
return md;
|
|
33
|
+
}
|
|
34
|
+
if (uri === "atabey://plan/active") {
|
|
35
|
+
const tasks = Storage.getTasks();
|
|
36
|
+
let md = "# 📋 Active Execution Plan\n\n| ID | Task | Agent | Status | Dependencies |\n| :--- | :--- | :--- | :--- | :--- |\n";
|
|
37
|
+
tasks.forEach((t) => {
|
|
38
|
+
const deps = t.dependencies.join(", ") || "-";
|
|
39
|
+
md += `| ${t.id} | ${t.description} | ${t.agent} | ${t.status} | ${deps} |\n`;
|
|
40
|
+
});
|
|
41
|
+
return md;
|
|
42
|
+
}
|
|
43
|
+
if (uri === "atabey://memory/project") {
|
|
44
|
+
const fs = await import("fs");
|
|
45
|
+
const path = await import("path");
|
|
46
|
+
const { getFrameworkDir } = await import("../../../src/cli/utils/memory.js");
|
|
47
|
+
const projectRoot = process.env.ATABEY_PROJECT_ROOT || process.cwd();
|
|
48
|
+
const fwDir = getFrameworkDir();
|
|
49
|
+
const p = path.isAbsolute(fwDir)
|
|
50
|
+
? path.join(fwDir, "memory", "PROJECT_MEMORY.md")
|
|
51
|
+
: path.join(projectRoot, fwDir, "memory", "PROJECT_MEMORY.md");
|
|
52
|
+
if (fs.existsSync(p)) {
|
|
53
|
+
return fs.readFileSync(p, "utf8");
|
|
54
|
+
}
|
|
55
|
+
return "Project memory not found. Run 'atabey init' first.";
|
|
56
|
+
}
|
|
57
|
+
throw new Error(`Unknown resource URI: ${uri}`);
|
|
58
|
+
}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { ToolResult, AcquireLockArgs, ReleaseLockArgs } from "../types.js";
|
|
4
3
|
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Handles acquiring a stateful lock on a resource.
|
|
8
6
|
*/
|
|
9
|
-
export async function handleAcquireLock(projectRoot
|
|
7
|
+
export async function handleAcquireLock(projectRoot, args) {
|
|
10
8
|
const { resource, agent, ttl = 60 } = args;
|
|
11
9
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
12
10
|
const lockDir = path.join(projectRoot, frameworkDir, "locks");
|
|
13
11
|
const lockPath = path.join(lockDir, `${resource}.lock`);
|
|
14
|
-
|
|
15
12
|
try {
|
|
16
|
-
if (!fs.existsSync(lockDir))
|
|
17
|
-
|
|
13
|
+
if (!fs.existsSync(lockDir))
|
|
14
|
+
fs.mkdirSync(lockDir, { recursive: true });
|
|
18
15
|
// Check for stale lock first
|
|
19
16
|
if (fs.existsSync(lockPath)) {
|
|
20
17
|
const stat = fs.statSync(lockPath);
|
|
21
18
|
const now = new Date().getTime();
|
|
22
19
|
const age = (now - stat.mtimeMs) / 1000;
|
|
23
|
-
|
|
24
20
|
if (age < ttl) {
|
|
25
21
|
return {
|
|
26
22
|
isError: true,
|
|
@@ -32,21 +28,21 @@ export async function handleAcquireLock(projectRoot: string, args: AcquireLockAr
|
|
|
32
28
|
try {
|
|
33
29
|
fs.renameSync(lockPath, tempLockPath);
|
|
34
30
|
fs.unlinkSync(tempLockPath);
|
|
35
|
-
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
36
33
|
// If rename failed, it means another agent already evicting/deleting it.
|
|
37
34
|
// Do not delete anything else; proceed and let writeFileSync (wx flag) fail if a new lock exists.
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
|
-
|
|
41
37
|
// Use 'wx' flag for atomic file creation
|
|
42
38
|
const lockData = JSON.stringify({ agent, timestamp: new Date().toISOString() });
|
|
43
39
|
fs.writeFileSync(lockPath, lockData, { flag: "wx" });
|
|
44
|
-
|
|
45
40
|
return {
|
|
46
|
-
content: [{ type: "text", text:
|
|
41
|
+
content: [{ type: "text", text: `[OK] Lock acquired for resource '${resource}' by ${agent}.` }]
|
|
47
42
|
};
|
|
48
|
-
}
|
|
49
|
-
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
const error = e;
|
|
50
46
|
if (error.code === "EEXIST") {
|
|
51
47
|
return {
|
|
52
48
|
isError: true,
|
|
@@ -59,31 +55,28 @@ export async function handleAcquireLock(projectRoot: string, args: AcquireLockAr
|
|
|
59
55
|
};
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
|
-
|
|
63
58
|
/**
|
|
64
59
|
* Handles releasing a lock.
|
|
65
60
|
*/
|
|
66
|
-
export async function handleReleaseLock(projectRoot
|
|
61
|
+
export async function handleReleaseLock(projectRoot, args) {
|
|
67
62
|
const { resource, agent } = args;
|
|
68
63
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
69
64
|
const lockPath = path.join(projectRoot, frameworkDir, "locks", `${resource}.lock`);
|
|
70
|
-
|
|
71
65
|
try {
|
|
72
66
|
if (!fs.existsSync(lockPath)) {
|
|
73
67
|
return { content: [{ type: "text", text: `ℹ️ No lock found for resource '${resource}'.` }] };
|
|
74
68
|
}
|
|
75
|
-
|
|
76
69
|
const lockData = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
77
70
|
if (lockData.agent !== agent) {
|
|
78
71
|
return {
|
|
79
72
|
isError: true,
|
|
80
|
-
content: [{ type: "text", text:
|
|
73
|
+
content: [{ type: "text", text: `[ERROR] Denied: You do not own the lock for '${resource}'. Owned by ${lockData.agent}.` }]
|
|
81
74
|
};
|
|
82
75
|
}
|
|
83
|
-
|
|
84
76
|
fs.unlinkSync(lockPath);
|
|
85
|
-
return { content: [{ type: "text", text:
|
|
86
|
-
}
|
|
77
|
+
return { content: [{ type: "text", text: `[OK] Lock released for resource '${resource}' by ${agent}.` }] };
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
87
80
|
return { isError: true, content: [{ type: "text", text: `Failed to release lock: ${String(e)}` }] };
|
|
88
81
|
}
|
|
89
82
|
}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { ToolResult, RegisterAgentArgs } from "../types.js";
|
|
4
3
|
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Handles agent registration with the Control Plane.
|
|
8
6
|
* This can be used to validate permissions and active status.
|
|
9
7
|
*/
|
|
10
|
-
export async function handleRegisterAgent(projectRoot
|
|
11
|
-
const { agent, role, capability = 5 } = args;
|
|
8
|
+
export async function handleRegisterAgent(projectRoot, args) {
|
|
9
|
+
const { agent, role, capability = 5, specialties } = args;
|
|
12
10
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
13
11
|
const registryDir = path.join(projectRoot, frameworkDir, "registry");
|
|
14
12
|
const agentFile = path.join(registryDir, `${agent.replace("@", "")}_active.json`);
|
|
15
|
-
|
|
16
13
|
try {
|
|
17
|
-
if (!fs.existsSync(registryDir))
|
|
18
|
-
|
|
14
|
+
if (!fs.existsSync(registryDir))
|
|
15
|
+
fs.mkdirSync(registryDir, { recursive: true });
|
|
19
16
|
const agentData = {
|
|
20
17
|
agent,
|
|
21
18
|
role,
|
|
22
19
|
capability,
|
|
20
|
+
specialties,
|
|
23
21
|
last_seen: new Date().toISOString(),
|
|
24
22
|
status: "ACTIVE"
|
|
25
23
|
};
|
|
26
|
-
|
|
27
24
|
fs.writeFileSync(agentFile, JSON.stringify(agentData, null, 2));
|
|
28
|
-
|
|
29
25
|
return {
|
|
30
|
-
content: [{ type: "text", text:
|
|
26
|
+
content: [{ type: "text", text: `[ATABEY] Agent ${agent} (${role}) registered successfully in the Atabey Control Plane.` }]
|
|
31
27
|
};
|
|
32
|
-
}
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
33
30
|
return {
|
|
34
31
|
isError: true,
|
|
35
32
|
content: [{ type: "text", text: `Failed to register agent: ${String(e)}` }]
|
package/framework-mcp/{src/tools/definitions.ts → dist/framework-mcp/src/tools/definitions.js}
RENAMED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const TOOLS: ToolDefinition[] = [
|
|
1
|
+
export const TOOLS = [
|
|
4
2
|
{
|
|
5
3
|
name: "read_file",
|
|
6
4
|
description: "Read the content of a file within the project. Supports optional line range reading to prevent stream overload.",
|
|
@@ -234,7 +232,12 @@ export const TOOLS: ToolDefinition[] = [
|
|
|
234
232
|
properties: {
|
|
235
233
|
agent: { type: "string", description: "The agent name (e.g., '@backend')." },
|
|
236
234
|
role: { type: "string", description: "The role of the agent." },
|
|
237
|
-
capability: { type: "number", description: "The capability score (1-10)." }
|
|
235
|
+
capability: { type: "number", description: "The capability score (1-10)." },
|
|
236
|
+
specialties: {
|
|
237
|
+
type: "object",
|
|
238
|
+
additionalProperties: { type: "number" },
|
|
239
|
+
description: "Sub-specialty weights mapping (e.g. {\"postgres\": 10, \"redis\": 8})"
|
|
240
|
+
}
|
|
238
241
|
},
|
|
239
242
|
required: ["agent", "role"]
|
|
240
243
|
}
|
|
@@ -276,6 +279,33 @@ export const TOOLS: ToolDefinition[] = [
|
|
|
276
279
|
description: "Run the project's linter (e.g., ESLint) to check for code quality and style issues.",
|
|
277
280
|
inputSchema: { type: "object", properties: {} },
|
|
278
281
|
},
|
|
282
|
+
{
|
|
283
|
+
name: "submit_plan",
|
|
284
|
+
description: "Submit a structured DAG plan of tasks for the project. This will be decomposed and queued for execution.",
|
|
285
|
+
inputSchema: {
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
tasks: {
|
|
289
|
+
type: "array",
|
|
290
|
+
items: {
|
|
291
|
+
type: "object",
|
|
292
|
+
properties: {
|
|
293
|
+
id: { type: "string", description: "Unique task ID (e.g. TASK_01)" },
|
|
294
|
+
agent: { type: "string", description: "The agent responsible for the task (e.g. @backend)" },
|
|
295
|
+
task: { type: "string", description: "The task description" },
|
|
296
|
+
dependencies: {
|
|
297
|
+
type: "array",
|
|
298
|
+
items: { type: "string" },
|
|
299
|
+
description: "List of task IDs that must be completed before this task."
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
required: ["id", "agent", "task"]
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
required: ["tasks"],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
279
309
|
{
|
|
280
310
|
name: "view_file",
|
|
281
311
|
description: "Alias for read_file. Reads the content of a file within the project.",
|
|
@@ -289,4 +319,4 @@ export const TOOLS: ToolDefinition[] = [
|
|
|
289
319
|
required: ["path"],
|
|
290
320
|
},
|
|
291
321
|
}
|
|
292
|
-
];
|
|
322
|
+
];
|
|
@@ -1,48 +1,37 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
3
|
import { writeTextFileAtomic } from "../../utils/fs.js";
|
|
4
|
-
import { BatchSurgicalEditArgs, ToolResult } from "../types.js";
|
|
5
4
|
import { Metrics } from "../../utils/metrics.js";
|
|
6
|
-
import { verifyCorporateCompliance } from "../../utils/compliance.js";
|
|
7
|
-
|
|
8
|
-
interface SurgicalEdit {
|
|
9
|
-
path: string;
|
|
10
|
-
oldText: string;
|
|
11
|
-
newText: string;
|
|
12
|
-
allowMultiple?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
5
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
6
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
15
7
|
/**
|
|
16
8
|
* Performs multiple surgical text replacements across multiple files in a single batch.
|
|
17
9
|
*/
|
|
18
|
-
export function handleBatchSurgicalEdit(projectRoot
|
|
19
|
-
const edits = args.edits
|
|
10
|
+
export async function handleBatchSurgicalEdit(projectRoot, args) {
|
|
11
|
+
const edits = args.edits;
|
|
20
12
|
if (!Array.isArray(edits) || edits.length === 0) {
|
|
21
13
|
const err = "No edits provided in the batch request.";
|
|
22
14
|
Metrics.logError(projectRoot, "@mcp", "batch_surgical_edit", err);
|
|
23
15
|
throw new Error(err);
|
|
24
16
|
}
|
|
25
|
-
|
|
26
|
-
const results: string[] = [];
|
|
17
|
+
const results = [];
|
|
27
18
|
let totalTokens = 0;
|
|
28
|
-
|
|
29
19
|
for (const edit of edits) {
|
|
30
20
|
const filePath = safePath(projectRoot, edit.path);
|
|
21
|
+
// ENFORCE PERMISSION MATRIX
|
|
22
|
+
verifyWritePermission(projectRoot, edit.path);
|
|
31
23
|
if (!fs.existsSync(filePath)) {
|
|
32
24
|
const err = `File not found: ${edit.path}`;
|
|
33
25
|
Metrics.logError(projectRoot, "@mcp", `batch_surgical_edit:${edit.path}`, err);
|
|
34
26
|
throw new Error(err);
|
|
35
27
|
}
|
|
36
|
-
|
|
37
28
|
const content = fs.readFileSync(filePath, "utf8");
|
|
38
29
|
const { oldText, newText, allowMultiple = false } = edit;
|
|
39
|
-
|
|
40
30
|
if (!content.includes(oldText)) {
|
|
41
31
|
const err = `Text not found in file ${edit.path}`;
|
|
42
32
|
Metrics.logError(projectRoot, "@mcp", `batch_surgical_edit:${edit.path}`, err);
|
|
43
33
|
throw new Error(err);
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
// Surgical precision guard
|
|
47
36
|
if (!allowMultiple) {
|
|
48
37
|
const firstIndex = content.indexOf(oldText);
|
|
@@ -53,27 +42,23 @@ export function handleBatchSurgicalEdit(projectRoot: string, args: BatchSurgical
|
|
|
53
42
|
throw new Error(err);
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
|
-
|
|
57
|
-
const newContent = allowMultiple
|
|
45
|
+
const newContent = allowMultiple
|
|
58
46
|
? content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), newText)
|
|
59
47
|
: content.replace(oldText, newText);
|
|
60
|
-
|
|
61
48
|
// ENFORCE CORPORATE COMPLIANCE
|
|
62
49
|
verifyCorporateCompliance(newContent, edit.path);
|
|
63
|
-
|
|
50
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
51
|
+
await verifyRiskAndAwaitApproval(projectRoot, newContent, edit.path);
|
|
64
52
|
writeTextFileAtomic(filePath, newContent);
|
|
65
|
-
|
|
66
53
|
const tokens = Metrics.estimateTokens(newText);
|
|
67
54
|
totalTokens += tokens;
|
|
68
|
-
results.push(
|
|
55
|
+
results.push(`[OK] Edited ${edit.path}`);
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
Metrics.logUsage(projectRoot, "@mcp", `batch_surgical_edit: ${edits.length} files`, totalTokens);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}]
|
|
58
|
+
return {
|
|
59
|
+
content: [{
|
|
60
|
+
type: "text",
|
|
61
|
+
text: `Successfully performed ${edits.length} edits:\n${results.join("\n")}`
|
|
62
|
+
}]
|
|
78
63
|
};
|
|
79
64
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
|
-
import { PatchFileArgs, ToolResult } from "../types.js";
|
|
4
3
|
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
-
import { verifyCorporateCompliance } from "../../utils/compliance.js";
|
|
6
|
-
|
|
7
|
-
export function handlePatchFile(projectRoot
|
|
4
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
5
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
6
|
+
export async function handlePatchFile(projectRoot, args) {
|
|
8
7
|
const filePath = safePath(projectRoot, args.path);
|
|
8
|
+
// ENFORCE PERMISSION MATRIX
|
|
9
|
+
verifyWritePermission(projectRoot, args.path);
|
|
9
10
|
const lines = fs.readFileSync(filePath, "utf8").split("\n");
|
|
10
11
|
const start = args.startLine - 1;
|
|
11
12
|
const end = args.endLine;
|
|
12
13
|
const newContent = args.newContent.split("\n");
|
|
13
|
-
|
|
14
14
|
if (start < 0 || start > lines.length) {
|
|
15
15
|
const err = `Invalid start line: ${start + 1}. File has ${lines.length} lines.`;
|
|
16
16
|
Metrics.logError(projectRoot, "@mcp", `patch_file:${args.path}`, err);
|
|
@@ -21,19 +21,14 @@ export function handlePatchFile(projectRoot: string, args: PatchFileArgs): ToolR
|
|
|
21
21
|
Metrics.logError(projectRoot, "@mcp", `patch_file:${args.path}`, err);
|
|
22
22
|
throw new Error(err);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
24
|
lines.splice(start, end - start, ...newContent);
|
|
26
25
|
const patchedContent = lines.join("\n");
|
|
27
|
-
|
|
28
26
|
// ENFORCE CORPORATE COMPLIANCE
|
|
29
27
|
verifyCorporateCompliance(patchedContent, args.path);
|
|
30
|
-
|
|
28
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
29
|
+
await verifyRiskAndAwaitApproval(projectRoot, patchedContent, args.path);
|
|
31
30
|
fs.writeFileSync(filePath, patchedContent);
|
|
32
|
-
|
|
33
|
-
const tokens = Metrics.estimateTokens(args.newContent as string);
|
|
31
|
+
const tokens = Metrics.estimateTokens(args.newContent);
|
|
34
32
|
Metrics.logUsage(projectRoot, "@mcp", `patch_file: ${args.path}`, tokens);
|
|
35
|
-
|
|
36
|
-
return { content: [{ type: "text", text: `✅ File patched successfully: ${args.path}` }] };
|
|
33
|
+
return { content: [{ type: "text", text: `[OK] File patched successfully: ${args.path}` }] };
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|