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,42 +1,41 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
+
import { execFileSync } from "child_process";
|
|
3
4
|
import { logger } from "./logger.js";
|
|
4
|
-
|
|
5
|
-
export function ensureDir(dirPath: string, dryRun = false): void {
|
|
5
|
+
export function ensureDir(dirPath, dryRun = false) {
|
|
6
6
|
if (!fs.existsSync(dirPath)) {
|
|
7
7
|
if (dryRun) {
|
|
8
8
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
10
11
|
fs.mkdirSync(dirPath, { recursive: true });
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
|
|
15
15
|
/**
|
|
16
16
|
* Writes content to a file atomically by using a temporary file.
|
|
17
17
|
* This prevents data corruption during unexpected system failures.
|
|
18
18
|
*/
|
|
19
|
-
export function writeTextFile(filePath
|
|
19
|
+
export function writeTextFile(filePath, content, dryRun = false) {
|
|
20
20
|
if (dryRun) {
|
|
21
21
|
logger.info(`[DRY RUN] Would write file: ${filePath}`);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
const dir = path.dirname(filePath);
|
|
25
25
|
ensureDir(dir);
|
|
26
|
-
|
|
27
26
|
const tempPath = `${filePath}.${Math.random().toString(36).slice(2, 9)}.tmp`;
|
|
28
27
|
const finalContent = content.endsWith("\n") ? content : `${content}\n`;
|
|
29
|
-
|
|
30
28
|
try {
|
|
31
29
|
fs.writeFileSync(tempPath, finalContent, "utf8");
|
|
32
30
|
fs.renameSync(tempPath, filePath);
|
|
33
|
-
}
|
|
34
|
-
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (fs.existsSync(tempPath))
|
|
34
|
+
fs.unlinkSync(tempPath);
|
|
35
35
|
throw err;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
export function appendFile(filePath: string, content: string, dryRun = false): void {
|
|
38
|
+
export function appendFile(filePath, content, dryRun = false) {
|
|
40
39
|
if (dryRun) {
|
|
41
40
|
logger.info(`[DRY RUN] Would append to file: ${filePath}`);
|
|
42
41
|
return;
|
|
@@ -44,7 +43,9 @@ export function appendFile(filePath: string, content: string, dryRun = false): v
|
|
|
44
43
|
ensureDir(path.dirname(filePath));
|
|
45
44
|
fs.appendFileSync(filePath, content, "utf8");
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
export function writeJsonFile(filePath: string, value: unknown, dryRun = false): void {
|
|
46
|
+
export function writeJsonFile(filePath, value, dryRun = false) {
|
|
49
47
|
writeTextFile(filePath, JSON.stringify(value, null, 2), dryRun);
|
|
50
48
|
}
|
|
49
|
+
export function runCommandQuiet(command, args, cwd) {
|
|
50
|
+
execFileSync(command, args, { cwd, stdio: "ignore" });
|
|
51
|
+
}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { ensureDir, appendFile } from "./fs.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
DEBUG = 0
|
|
7
|
-
INFO = 1
|
|
8
|
-
WARN = 2
|
|
9
|
-
ERROR = 3
|
|
10
|
-
FATAL = 4
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface LoggerConfig {
|
|
14
|
-
minLevel: LogLevel;
|
|
15
|
-
enableColors: boolean;
|
|
16
|
-
jsonFormat: boolean;
|
|
17
|
-
logFile?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
4
|
+
export var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
7
|
+
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
8
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
9
|
+
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
10
|
+
LogLevel[LogLevel["FATAL"] = 4] = "FATAL";
|
|
11
|
+
})(LogLevel || (LogLevel = {}));
|
|
20
12
|
export class EnterpriseLogger {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
private constructor() {
|
|
13
|
+
config;
|
|
14
|
+
static instance;
|
|
15
|
+
constructor() {
|
|
25
16
|
const isProd = process.env.NODE_ENV === "production";
|
|
26
17
|
this.config = {
|
|
27
18
|
minLevel: isProd ? LogLevel.INFO : LogLevel.DEBUG,
|
|
@@ -29,31 +20,27 @@ export class EnterpriseLogger {
|
|
|
29
20
|
jsonFormat: isProd,
|
|
30
21
|
};
|
|
31
22
|
}
|
|
32
|
-
|
|
33
|
-
public static getInstance(): EnterpriseLogger {
|
|
23
|
+
static getInstance() {
|
|
34
24
|
if (!EnterpriseLogger.instance) {
|
|
35
25
|
EnterpriseLogger.instance = new EnterpriseLogger();
|
|
36
26
|
}
|
|
37
27
|
return EnterpriseLogger.instance;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
public configure(config: Partial<LoggerConfig>): void {
|
|
29
|
+
configure(config) {
|
|
41
30
|
this.config = { ...this.config, ...config };
|
|
42
|
-
|
|
43
31
|
if (this.config.logFile) {
|
|
44
32
|
try {
|
|
45
33
|
ensureDir(path.dirname(this.config.logFile));
|
|
46
|
-
}
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
47
36
|
// Directly write to stderr — using console here would be circular
|
|
48
37
|
process.stderr.write(`[Logger] Failed to create log directory: ${err}\n`);
|
|
49
38
|
}
|
|
50
39
|
}
|
|
51
40
|
}
|
|
52
|
-
|
|
53
|
-
private formatMessage(level: LogLevel, message: string, meta?: unknown): string {
|
|
41
|
+
formatMessage(level, message, meta) {
|
|
54
42
|
const timestamp = new Date().toISOString();
|
|
55
43
|
const pid = process.pid;
|
|
56
|
-
|
|
57
44
|
if (this.config.jsonFormat) {
|
|
58
45
|
return JSON.stringify({
|
|
59
46
|
timestamp,
|
|
@@ -63,10 +50,8 @@ export class EnterpriseLogger {
|
|
|
63
50
|
meta,
|
|
64
51
|
});
|
|
65
52
|
}
|
|
66
|
-
|
|
67
53
|
const levelName = LogLevel[level].padEnd(5);
|
|
68
54
|
let coloredLevel = levelName;
|
|
69
|
-
|
|
70
55
|
if (this.config.enableColors) {
|
|
71
56
|
switch (level) {
|
|
72
57
|
case LogLevel.DEBUG:
|
|
@@ -86,54 +71,46 @@ export class EnterpriseLogger {
|
|
|
86
71
|
break;
|
|
87
72
|
}
|
|
88
73
|
}
|
|
89
|
-
|
|
90
74
|
const metaStr = meta ? ` | Meta: ${JSON.stringify(meta)}` : "";
|
|
91
75
|
return `[${timestamp}] [PID:${pid}] [${coloredLevel}]: ${message}${metaStr}`;
|
|
92
76
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
77
|
+
log(level, message, meta) {
|
|
78
|
+
if (level < this.config.minLevel)
|
|
79
|
+
return;
|
|
97
80
|
const formatted = this.formatMessage(level, message, meta);
|
|
98
|
-
|
|
99
81
|
// Route to stderr for ERROR/FATAL, stdout otherwise.
|
|
100
82
|
// Using process.write directly here is intentional — this IS the logger.
|
|
101
83
|
if (level >= LogLevel.ERROR) {
|
|
102
84
|
process.stderr.write(formatted + "\n");
|
|
103
|
-
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
104
87
|
process.stdout.write(formatted + "\n");
|
|
105
88
|
}
|
|
106
|
-
|
|
107
89
|
// Output to file if configured
|
|
108
90
|
if (this.config.logFile) {
|
|
109
91
|
try {
|
|
110
92
|
appendFile(this.config.logFile, formatted + "\n");
|
|
111
|
-
}
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
112
95
|
// Directly write to stderr — using console here would be circular
|
|
113
96
|
process.stderr.write(`[Logger] Failed to write to log file: ${err}\n`);
|
|
114
97
|
}
|
|
115
98
|
}
|
|
116
99
|
}
|
|
117
|
-
|
|
118
|
-
public debug(message: string, meta?: unknown): void {
|
|
100
|
+
debug(message, meta) {
|
|
119
101
|
this.log(LogLevel.DEBUG, message, meta);
|
|
120
102
|
}
|
|
121
|
-
|
|
122
|
-
public info(message: string, meta?: unknown): void {
|
|
103
|
+
info(message, meta) {
|
|
123
104
|
this.log(LogLevel.INFO, message, meta);
|
|
124
105
|
}
|
|
125
|
-
|
|
126
|
-
public warn(message: string, meta?: unknown): void {
|
|
106
|
+
warn(message, meta) {
|
|
127
107
|
this.log(LogLevel.WARN, message, meta);
|
|
128
108
|
}
|
|
129
|
-
|
|
130
|
-
public error(message: string, meta?: unknown): void {
|
|
109
|
+
error(message, meta) {
|
|
131
110
|
this.log(LogLevel.ERROR, message, meta);
|
|
132
111
|
}
|
|
133
|
-
|
|
134
|
-
public fatal(message: string, meta?: unknown): void {
|
|
112
|
+
fatal(message, meta) {
|
|
135
113
|
this.log(LogLevel.FATAL, message, meta);
|
|
136
114
|
}
|
|
137
115
|
}
|
|
138
|
-
|
|
139
116
|
export const logger = EnterpriseLogger.getInstance();
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import { getFrameworkDir } from "../cli/utils/memory.js";
|
|
5
|
+
/**
|
|
6
|
+
* [DB] Atabey Storage Engine
|
|
7
|
+
* Central SQLite database for enterprise-scale agent state management.
|
|
8
|
+
*/
|
|
9
|
+
export class Storage {
|
|
10
|
+
static db = null;
|
|
11
|
+
static getDB() {
|
|
12
|
+
if (!this.db) {
|
|
13
|
+
const frameworkDir = getFrameworkDir();
|
|
14
|
+
if (!fs.existsSync(frameworkDir)) {
|
|
15
|
+
fs.mkdirSync(frameworkDir, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
const dbPath = path.join(frameworkDir, "atabey.db");
|
|
18
|
+
this.db = new Database(dbPath);
|
|
19
|
+
this.initializeSchema();
|
|
20
|
+
}
|
|
21
|
+
return this.db;
|
|
22
|
+
}
|
|
23
|
+
static initializeSchema() {
|
|
24
|
+
const db = this.db;
|
|
25
|
+
// Agents Table
|
|
26
|
+
db.exec(`
|
|
27
|
+
CREATE TABLE IF NOT EXISTS agents (
|
|
28
|
+
name TEXT PRIMARY KEY,
|
|
29
|
+
state TEXT DEFAULT 'READY',
|
|
30
|
+
task TEXT DEFAULT 'Idle',
|
|
31
|
+
last_updated DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
32
|
+
)
|
|
33
|
+
`);
|
|
34
|
+
// Messages (Hermes) Table
|
|
35
|
+
db.exec(`
|
|
36
|
+
CREATE TABLE IF NOT EXISTS messages (
|
|
37
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
38
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
39
|
+
sender TEXT,
|
|
40
|
+
receiver TEXT,
|
|
41
|
+
category TEXT,
|
|
42
|
+
content TEXT,
|
|
43
|
+
trace_id TEXT,
|
|
44
|
+
parent_id TEXT,
|
|
45
|
+
status TEXT DEFAULT 'PENDING',
|
|
46
|
+
priority TEXT DEFAULT 'NORMAL',
|
|
47
|
+
requires_approval BOOLEAN DEFAULT 0
|
|
48
|
+
)
|
|
49
|
+
`);
|
|
50
|
+
// Tasks Table
|
|
51
|
+
db.exec(`
|
|
52
|
+
CREATE TABLE IF NOT EXISTS tasks (
|
|
53
|
+
id TEXT PRIMARY KEY,
|
|
54
|
+
trace_id TEXT,
|
|
55
|
+
description TEXT,
|
|
56
|
+
agent TEXT,
|
|
57
|
+
status TEXT DEFAULT 'PENDING',
|
|
58
|
+
priority TEXT DEFAULT 'NORMAL',
|
|
59
|
+
dependencies TEXT, -- JSON Array
|
|
60
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
61
|
+
)
|
|
62
|
+
`);
|
|
63
|
+
// Logs Table
|
|
64
|
+
db.exec(`
|
|
65
|
+
CREATE TABLE IF NOT EXISTS logs (
|
|
66
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
67
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
68
|
+
agent TEXT,
|
|
69
|
+
action TEXT,
|
|
70
|
+
trace_id TEXT,
|
|
71
|
+
status TEXT,
|
|
72
|
+
summary TEXT,
|
|
73
|
+
findings TEXT
|
|
74
|
+
)
|
|
75
|
+
`);
|
|
76
|
+
// Metadata (State) Table
|
|
77
|
+
db.exec(`
|
|
78
|
+
CREATE TABLE IF NOT EXISTS metadata (
|
|
79
|
+
key TEXT PRIMARY KEY,
|
|
80
|
+
value TEXT
|
|
81
|
+
)
|
|
82
|
+
`);
|
|
83
|
+
}
|
|
84
|
+
// --- Agent Operations ---
|
|
85
|
+
static updateAgentStatus(name, state, task, lastUpdated) {
|
|
86
|
+
const db = this.getDB();
|
|
87
|
+
const cleanName = name.replace("@", "");
|
|
88
|
+
const timestamp = lastUpdated || new Date().toISOString();
|
|
89
|
+
db.prepare(`
|
|
90
|
+
INSERT INTO agents (name, state, task, last_updated)
|
|
91
|
+
VALUES (?, ?, ?, ?)
|
|
92
|
+
ON CONFLICT(name) DO UPDATE SET
|
|
93
|
+
state = excluded.state,
|
|
94
|
+
task = excluded.task,
|
|
95
|
+
last_updated = excluded.last_updated
|
|
96
|
+
`).run(cleanName, state, task, timestamp);
|
|
97
|
+
}
|
|
98
|
+
static getAllAgents() {
|
|
99
|
+
return this.getDB().prepare("SELECT * FROM agents").all();
|
|
100
|
+
}
|
|
101
|
+
// --- Message Operations ---
|
|
102
|
+
static saveMessage(msg) {
|
|
103
|
+
const db = this.getDB();
|
|
104
|
+
db.prepare(`
|
|
105
|
+
INSERT INTO messages (sender, receiver, category, content, trace_id, parent_id, status, priority, requires_approval)
|
|
106
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
107
|
+
`).run(msg.from, msg.to, msg.category, msg.content, msg.traceId, msg.parentId || null, msg.status || "PENDING", msg.priority || "NORMAL", msg.requiresApproval ? 1 : 0);
|
|
108
|
+
}
|
|
109
|
+
static getPendingMessages() {
|
|
110
|
+
const rows = this.getDB().prepare("SELECT * FROM messages WHERE status IN ('PENDING', 'APPROVED') ORDER BY priority DESC, timestamp ASC").all();
|
|
111
|
+
return rows.map(r => ({
|
|
112
|
+
id: r.id,
|
|
113
|
+
timestamp: r.timestamp,
|
|
114
|
+
from: r.sender,
|
|
115
|
+
to: r.receiver,
|
|
116
|
+
category: r.category,
|
|
117
|
+
content: r.content,
|
|
118
|
+
traceId: r.trace_id,
|
|
119
|
+
parentId: r.parent_id || undefined,
|
|
120
|
+
status: r.status,
|
|
121
|
+
priority: r.priority,
|
|
122
|
+
requiresApproval: r.requires_approval === 1
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
static updateMessageStatus(id, status) {
|
|
126
|
+
this.getDB().prepare("UPDATE messages SET status = ? WHERE id = ?").run(status, id);
|
|
127
|
+
}
|
|
128
|
+
// --- Task Operations ---
|
|
129
|
+
static saveTask(task) {
|
|
130
|
+
const db = this.getDB();
|
|
131
|
+
db.prepare(`
|
|
132
|
+
INSERT INTO tasks (id, trace_id, description, agent, status, priority, dependencies)
|
|
133
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
134
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
135
|
+
status = excluded.status,
|
|
136
|
+
description = excluded.description
|
|
137
|
+
`).run(task.id, task.traceId, task.description, task.agent, task.status, task.priority, JSON.stringify(task.dependencies || []));
|
|
138
|
+
}
|
|
139
|
+
static getTasks(traceId) {
|
|
140
|
+
const db = this.getDB();
|
|
141
|
+
let rows;
|
|
142
|
+
if (traceId) {
|
|
143
|
+
rows = db.prepare("SELECT * FROM tasks WHERE trace_id = ?").all(traceId);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
rows = db.prepare("SELECT * FROM tasks").all();
|
|
147
|
+
}
|
|
148
|
+
return rows.map(r => {
|
|
149
|
+
let deps = [];
|
|
150
|
+
try {
|
|
151
|
+
const parsed = JSON.parse(r.dependencies || "[]");
|
|
152
|
+
// Handle cases where dependencies might be double-stringified or are raw JSON strings
|
|
153
|
+
deps = Array.isArray(parsed) ? parsed : JSON.parse(parsed);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// Keep empty array
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
id: r.id,
|
|
160
|
+
traceId: r.trace_id,
|
|
161
|
+
description: r.description,
|
|
162
|
+
agent: r.agent,
|
|
163
|
+
status: r.status,
|
|
164
|
+
priority: r.priority,
|
|
165
|
+
dependencies: deps
|
|
166
|
+
};
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
static getLogs(agentName) {
|
|
170
|
+
const db = this.getDB();
|
|
171
|
+
let rows;
|
|
172
|
+
const cleanName = agentName ? agentName.replace("@", "") : undefined;
|
|
173
|
+
if (cleanName) {
|
|
174
|
+
rows = db.prepare("SELECT * FROM logs WHERE agent = ? ORDER BY timestamp DESC").all(cleanName);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
rows = db.prepare("SELECT * FROM logs ORDER BY timestamp DESC").all();
|
|
178
|
+
}
|
|
179
|
+
return rows.map(r => ({
|
|
180
|
+
id: r.id,
|
|
181
|
+
timestamp: r.timestamp,
|
|
182
|
+
agent: r.agent,
|
|
183
|
+
action: r.action,
|
|
184
|
+
trace_id: r.trace_id || undefined,
|
|
185
|
+
status: r.status,
|
|
186
|
+
summary: r.summary,
|
|
187
|
+
findings: r.findings || undefined
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
// --- Metadata Operations ---
|
|
191
|
+
static setMetadata(key, value) {
|
|
192
|
+
this.getDB().prepare(`
|
|
193
|
+
INSERT INTO metadata (key, value) VALUES (?, ?)
|
|
194
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value
|
|
195
|
+
`).run(key, value);
|
|
196
|
+
}
|
|
197
|
+
static getMetadata(key) {
|
|
198
|
+
const row = this.getDB().prepare("SELECT value FROM metadata WHERE key = ?").get(key);
|
|
199
|
+
return row ? row.value : null;
|
|
200
|
+
}
|
|
201
|
+
static reset() {
|
|
202
|
+
if (this.db) {
|
|
203
|
+
this.db.close();
|
|
204
|
+
this.db = null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Atabey Framework — Internal Branded Types
|
|
3
|
+
* Used to enforce absolute type safety within the core orchestration logic.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Casts a raw string to a Branded Type.
|
|
7
|
+
* Use this only at the boundaries of the system.
|
|
8
|
+
*/
|
|
9
|
+
export function asTraceID(val) { return val; }
|
|
10
|
+
export function asAgentID(val) { return val; }
|
|
11
|
+
export function asPhaseID(val) { return val; }
|
|
12
|
+
export function asProjectPath(val) { return val; }
|
|
@@ -38,7 +38,7 @@ export async function handleAcquireLock(projectRoot, args) {
|
|
|
38
38
|
const lockData = JSON.stringify({ agent, timestamp: new Date().toISOString() });
|
|
39
39
|
fs.writeFileSync(lockPath, lockData, { flag: "wx" });
|
|
40
40
|
return {
|
|
41
|
-
content: [{ type: "text", text:
|
|
41
|
+
content: [{ type: "text", text: `[OK] Lock acquired for resource '${resource}' by ${agent}.` }]
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
catch (e) {
|
|
@@ -70,11 +70,11 @@ export async function handleReleaseLock(projectRoot, args) {
|
|
|
70
70
|
if (lockData.agent !== agent) {
|
|
71
71
|
return {
|
|
72
72
|
isError: true,
|
|
73
|
-
content: [{ type: "text", text:
|
|
73
|
+
content: [{ type: "text", text: `[ERROR] Denied: You do not own the lock for '${resource}'. Owned by ${lockData.agent}.` }]
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
fs.unlinkSync(lockPath);
|
|
77
|
-
return { content: [{ type: "text", text:
|
|
77
|
+
return { content: [{ type: "text", text: `[OK] Lock released for resource '${resource}' by ${agent}.` }] };
|
|
78
78
|
}
|
|
79
79
|
catch (e) {
|
|
80
80
|
return { isError: true, content: [{ type: "text", text: `Failed to release lock: ${String(e)}` }] };
|
|
@@ -6,7 +6,7 @@ import { resolveFrameworkDir } from "../../utils/security.js";
|
|
|
6
6
|
* This can be used to validate permissions and active status.
|
|
7
7
|
*/
|
|
8
8
|
export async function handleRegisterAgent(projectRoot, args) {
|
|
9
|
-
const { agent, role, capability = 5 } = args;
|
|
9
|
+
const { agent, role, capability = 5, specialties } = args;
|
|
10
10
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
11
11
|
const registryDir = path.join(projectRoot, frameworkDir, "registry");
|
|
12
12
|
const agentFile = path.join(registryDir, `${agent.replace("@", "")}_active.json`);
|
|
@@ -17,12 +17,13 @@ export async function handleRegisterAgent(projectRoot, args) {
|
|
|
17
17
|
agent,
|
|
18
18
|
role,
|
|
19
19
|
capability,
|
|
20
|
+
specialties,
|
|
20
21
|
last_seen: new Date().toISOString(),
|
|
21
22
|
status: "ACTIVE"
|
|
22
23
|
};
|
|
23
24
|
fs.writeFileSync(agentFile, JSON.stringify(agentData, null, 2));
|
|
24
25
|
return {
|
|
25
|
-
content: [{ type: "text", text:
|
|
26
|
+
content: [{ type: "text", text: `[ATABEY] Agent ${agent} (${role}) registered successfully in the Atabey Control Plane.` }]
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
catch (e) {
|
|
@@ -232,7 +232,12 @@ export const TOOLS = [
|
|
|
232
232
|
properties: {
|
|
233
233
|
agent: { type: "string", description: "The agent name (e.g., '@backend')." },
|
|
234
234
|
role: { type: "string", description: "The role of the agent." },
|
|
235
|
-
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
|
+
}
|
|
236
241
|
},
|
|
237
242
|
required: ["agent", "role"]
|
|
238
243
|
}
|
|
@@ -274,6 +279,33 @@ export const TOOLS = [
|
|
|
274
279
|
description: "Run the project's linter (e.g., ESLint) to check for code quality and style issues.",
|
|
275
280
|
inputSchema: { type: "object", properties: {} },
|
|
276
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
|
+
},
|
|
277
309
|
{
|
|
278
310
|
name: "view_file",
|
|
279
311
|
description: "Alias for read_file. Reads the content of a file within the project.",
|
|
@@ -2,11 +2,12 @@ import fs from "fs";
|
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
3
|
import { writeTextFileAtomic } from "../../utils/fs.js";
|
|
4
4
|
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
-
import { verifyCorporateCompliance } from "../../utils/compliance.js";
|
|
5
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
6
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
6
7
|
/**
|
|
7
8
|
* Performs multiple surgical text replacements across multiple files in a single batch.
|
|
8
9
|
*/
|
|
9
|
-
export function handleBatchSurgicalEdit(projectRoot, args) {
|
|
10
|
+
export async function handleBatchSurgicalEdit(projectRoot, args) {
|
|
10
11
|
const edits = args.edits;
|
|
11
12
|
if (!Array.isArray(edits) || edits.length === 0) {
|
|
12
13
|
const err = "No edits provided in the batch request.";
|
|
@@ -17,6 +18,8 @@ export function handleBatchSurgicalEdit(projectRoot, args) {
|
|
|
17
18
|
let totalTokens = 0;
|
|
18
19
|
for (const edit of edits) {
|
|
19
20
|
const filePath = safePath(projectRoot, edit.path);
|
|
21
|
+
// ENFORCE PERMISSION MATRIX
|
|
22
|
+
verifyWritePermission(projectRoot, edit.path);
|
|
20
23
|
if (!fs.existsSync(filePath)) {
|
|
21
24
|
const err = `File not found: ${edit.path}`;
|
|
22
25
|
Metrics.logError(projectRoot, "@mcp", `batch_surgical_edit:${edit.path}`, err);
|
|
@@ -44,10 +47,12 @@ export function handleBatchSurgicalEdit(projectRoot, args) {
|
|
|
44
47
|
: content.replace(oldText, newText);
|
|
45
48
|
// ENFORCE CORPORATE COMPLIANCE
|
|
46
49
|
verifyCorporateCompliance(newContent, edit.path);
|
|
50
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
51
|
+
await verifyRiskAndAwaitApproval(projectRoot, newContent, edit.path);
|
|
47
52
|
writeTextFileAtomic(filePath, newContent);
|
|
48
53
|
const tokens = Metrics.estimateTokens(newText);
|
|
49
54
|
totalTokens += tokens;
|
|
50
|
-
results.push(
|
|
55
|
+
results.push(`[OK] Edited ${edit.path}`);
|
|
51
56
|
}
|
|
52
57
|
Metrics.logUsage(projectRoot, "@mcp", `batch_surgical_edit: ${edits.length} files`, totalTokens);
|
|
53
58
|
return {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
3
|
import { Metrics } from "../../utils/metrics.js";
|
|
4
|
-
import { verifyCorporateCompliance } from "../../utils/compliance.js";
|
|
5
|
-
|
|
4
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
5
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
6
|
+
export async function handlePatchFile(projectRoot, args) {
|
|
6
7
|
const filePath = safePath(projectRoot, args.path);
|
|
8
|
+
// ENFORCE PERMISSION MATRIX
|
|
9
|
+
verifyWritePermission(projectRoot, args.path);
|
|
7
10
|
const lines = fs.readFileSync(filePath, "utf8").split("\n");
|
|
8
11
|
const start = args.startLine - 1;
|
|
9
12
|
const end = args.endLine;
|
|
@@ -22,8 +25,10 @@ export function handlePatchFile(projectRoot, args) {
|
|
|
22
25
|
const patchedContent = lines.join("\n");
|
|
23
26
|
// ENFORCE CORPORATE COMPLIANCE
|
|
24
27
|
verifyCorporateCompliance(patchedContent, args.path);
|
|
28
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
29
|
+
await verifyRiskAndAwaitApproval(projectRoot, patchedContent, args.path);
|
|
25
30
|
fs.writeFileSync(filePath, patchedContent);
|
|
26
31
|
const tokens = Metrics.estimateTokens(args.newContent);
|
|
27
32
|
Metrics.logUsage(projectRoot, "@mcp", `patch_file: ${args.path}`, tokens);
|
|
28
|
-
return { content: [{ type: "text", text:
|
|
33
|
+
return { content: [{ type: "text", text: `[OK] File patched successfully: ${args.path}` }] };
|
|
29
34
|
}
|
|
@@ -5,14 +5,14 @@ export function handleReadFile(projectRoot, args) {
|
|
|
5
5
|
if (!args.path) {
|
|
6
6
|
const err = "Missing 'path' argument.";
|
|
7
7
|
Metrics.logError(projectRoot, "@mcp", "read_file", err);
|
|
8
|
-
return { isError: true, content: [{ type: "text", text:
|
|
8
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
9
9
|
}
|
|
10
10
|
try {
|
|
11
11
|
const filePath = safePath(projectRoot, args.path);
|
|
12
12
|
if (!fs.existsSync(filePath)) {
|
|
13
13
|
const err = `File not found: ${args.path}`;
|
|
14
14
|
Metrics.logError(projectRoot, "@mcp", "read_file", err);
|
|
15
|
-
return { isError: true, content: [{ type: "text", text:
|
|
15
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
16
16
|
}
|
|
17
17
|
const startLine = args.startLine;
|
|
18
18
|
const endLine = args.endLine;
|
|
@@ -46,6 +46,6 @@ export function handleReadFile(projectRoot, args) {
|
|
|
46
46
|
catch (e) {
|
|
47
47
|
const err = `Failed to read file: ${String(e)}`;
|
|
48
48
|
Metrics.logError(projectRoot, "@mcp", `read_file:${args.path}`, err);
|
|
49
|
-
return { isError: true, content: [{ type: "text", text:
|
|
49
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -2,9 +2,12 @@ import fs from "fs";
|
|
|
2
2
|
import { safePath } from "../../utils/security.js";
|
|
3
3
|
import { writeTextFileAtomic } from "../../utils/fs.js";
|
|
4
4
|
import { Metrics } from "../../utils/metrics.js";
|
|
5
|
-
import { verifyCorporateCompliance } from "../../utils/compliance.js";
|
|
6
|
-
|
|
5
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
6
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
7
|
+
export async function handleReplaceText(projectRoot, args) {
|
|
7
8
|
const filePath = safePath(projectRoot, args.path);
|
|
9
|
+
// ENFORCE PERMISSION MATRIX
|
|
10
|
+
verifyWritePermission(projectRoot, args.path);
|
|
8
11
|
const content = fs.readFileSync(filePath, "utf8");
|
|
9
12
|
const oldText = args.oldText;
|
|
10
13
|
const newText = args.newText;
|
|
@@ -38,8 +41,10 @@ export function handleReplaceText(projectRoot, args) {
|
|
|
38
41
|
}
|
|
39
42
|
// ENFORCE CORPORATE COMPLIANCE
|
|
40
43
|
verifyCorporateCompliance(newContent, args.path);
|
|
44
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
45
|
+
await verifyRiskAndAwaitApproval(projectRoot, newContent, args.path);
|
|
41
46
|
writeTextFileAtomic(filePath, newContent);
|
|
42
47
|
const tokens = Metrics.estimateTokens(newText);
|
|
43
48
|
Metrics.logUsage(projectRoot, "@mcp", `replace_text: ${args.path}`, tokens);
|
|
44
|
-
return { content: [{ type: "text", text:
|
|
49
|
+
return { content: [{ type: "text", text: `[OK] Surgical edit successful in ${args.path}` }] };
|
|
45
50
|
}
|