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
|
@@ -3,18 +3,23 @@ import path from "path";
|
|
|
3
3
|
import { safePath, resolveFrameworkDir } from "../../utils/security.js";
|
|
4
4
|
import { writeTextFileAtomic, appendFileSafe } from "../../utils/fs.js";
|
|
5
5
|
import { Metrics } from "../../utils/metrics.js";
|
|
6
|
-
import { verifyCorporateCompliance } from "../../utils/compliance.js";
|
|
7
|
-
|
|
6
|
+
import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
|
|
7
|
+
import { verifyWritePermission } from "../../utils/permissions.js";
|
|
8
|
+
export async function handleWriteFile(projectRoot, args) {
|
|
8
9
|
if (!args.path || args.content === undefined) {
|
|
9
10
|
const err = "Missing 'path' or 'content' argument.";
|
|
10
11
|
Metrics.logError(projectRoot, "@mcp", "write_file", err);
|
|
11
|
-
return { isError: true, content: [{ type: "text", text:
|
|
12
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
12
13
|
}
|
|
13
14
|
try {
|
|
14
15
|
const filePath = safePath(projectRoot, args.path);
|
|
15
16
|
const content = args.content;
|
|
17
|
+
// ENFORCE PERMISSION MATRIX
|
|
18
|
+
verifyWritePermission(projectRoot, args.path);
|
|
16
19
|
// ENFORCE CORPORATE COMPLIANCE
|
|
17
20
|
verifyCorporateCompliance(content, args.path);
|
|
21
|
+
// ENFORCE RISK & HUMAN APPROVAL GATEWAY
|
|
22
|
+
await verifyRiskAndAwaitApproval(projectRoot, content, args.path);
|
|
18
23
|
writeTextFileAtomic(filePath, content);
|
|
19
24
|
// AUTO-LOGGING & METRICS
|
|
20
25
|
const tokens = Metrics.estimateTokens(content);
|
|
@@ -28,11 +33,11 @@ export function handleWriteFile(projectRoot, args) {
|
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
catch { /* ignore memory logging errors */ }
|
|
31
|
-
return { content: [{ type: "text", text:
|
|
36
|
+
return { content: [{ type: "text", text: `[OK] File written: ${args.path}` }] };
|
|
32
37
|
}
|
|
33
38
|
catch (e) {
|
|
34
39
|
const err = `Failed to write file: ${String(e)}`;
|
|
35
40
|
Metrics.logError(projectRoot, "@mcp", `write_file:${args.path}`, err);
|
|
36
|
-
return { isError: true, content: [{ type: "text", text:
|
|
41
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
37
42
|
}
|
|
38
43
|
}
|
|
@@ -22,7 +22,7 @@ export function handleAuditDependencies(projectRoot, _args) {
|
|
|
22
22
|
for (const [group, patterns] of Object.entries(similarityGroups)) {
|
|
23
23
|
const found = depNames.filter(d => patterns.some(p => d.includes(p)));
|
|
24
24
|
if (found.length > 1) {
|
|
25
|
-
results.push(
|
|
25
|
+
results.push(`[WARN] Potential redundancy in [${group}]: Found ${found.join(", ")}`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
// 2. Scan for "any" usage in package names (bad practice markers)
|
|
@@ -35,7 +35,7 @@ export function handleAuditDependencies(projectRoot, _args) {
|
|
|
35
35
|
type: "text",
|
|
36
36
|
text: results.length > 0
|
|
37
37
|
? `Dependency Audit Results:\n\n${results.join("\n")}`
|
|
38
|
-
: "
|
|
38
|
+
: "[OK] Dependencies look clean and consolidated."
|
|
39
39
|
}]
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -9,7 +9,7 @@ export function handleRunTests(projectRoot, args) {
|
|
|
9
9
|
try {
|
|
10
10
|
const output = execSync(testCommand, { cwd: projectRoot, encoding: "utf8", stdio: "pipe" });
|
|
11
11
|
return {
|
|
12
|
-
content: [{ type: "text", text:
|
|
12
|
+
content: [{ type: "text", text: `[OK] Tests passed successfully for ${language}!\n\n${output}` }]
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
catch (error) {
|
|
@@ -20,7 +20,7 @@ export function handleRunTests(projectRoot, args) {
|
|
|
20
20
|
isError: true,
|
|
21
21
|
content: [{
|
|
22
22
|
type: "text",
|
|
23
|
-
text:
|
|
23
|
+
text: `[ERROR] Tests FAILED for ${language}!\n\n--- STDOUT ---\n${stdout}\n\n--- STDERR ---\n${stderr}`
|
|
24
24
|
}]
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { safeExec } from "../../utils/cli.js";
|
|
2
|
+
export function handleSubmitPlan(projectRoot, args) {
|
|
3
|
+
if (!args.tasks || !Array.isArray(args.tasks)) {
|
|
4
|
+
return {
|
|
5
|
+
isError: true,
|
|
6
|
+
content: [{ type: "text", text: "[ERROR] Error: 'tasks' array is required for submit_plan." }]
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const planJson = JSON.stringify(args.tasks);
|
|
10
|
+
// Escape for shell if necessary, but safeExec handles arguments as an array
|
|
11
|
+
const output = safeExec("npx", ["atabey", "plan:submit", planJson], projectRoot);
|
|
12
|
+
return { content: [{ type: "text", text: output }] };
|
|
13
|
+
}
|
|
@@ -4,5 +4,5 @@ export function handleUpdateProjectMemory(projectRoot, args) {
|
|
|
4
4
|
const content = args.content;
|
|
5
5
|
// Using execFileSync with array args prevents command injection
|
|
6
6
|
safeExec("npx", ["atabey", "update_project_memory", section, content], projectRoot);
|
|
7
|
-
return { content: [{ type: "text", text:
|
|
7
|
+
return { content: [{ type: "text", text: `[OK] Section ${section} updated.` }] };
|
|
8
8
|
}
|
|
@@ -15,6 +15,7 @@ import { handleRunTests } from "./framework/run_tests.js";
|
|
|
15
15
|
import { handleGetSystemHealth } from "./observability/get_health.js";
|
|
16
16
|
import { handleCheckPorts } from "./observability/check_ports.js";
|
|
17
17
|
import { handleOrchestrateLoop } from "./framework/orchestrate.js";
|
|
18
|
+
import { handleSubmitPlan } from "./framework/submit_plan.js";
|
|
18
19
|
import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
|
|
19
20
|
import { handleReadProjectMemory } from "./memory/read_memory.js";
|
|
20
21
|
import { handleGetMemoryInsights } from "./memory/get_insights.js";
|
|
@@ -48,6 +49,7 @@ export const toolHandlers = {
|
|
|
48
49
|
get_system_health: bind(handleGetSystemHealth),
|
|
49
50
|
check_active_ports: bind(handleCheckPorts),
|
|
50
51
|
orchestrate_loop: bind(handleOrchestrateLoop),
|
|
52
|
+
submit_plan: bind(handleSubmitPlan),
|
|
51
53
|
send_agent_message: bind(handleSendAgentMessage),
|
|
52
54
|
log_agent_action: bind(handleLogAgentAction),
|
|
53
55
|
update_contract_hash: bind(handleUpdateContractHash),
|
|
@@ -25,7 +25,7 @@ export function handleGetMemoryInsights(projectRoot, _args) {
|
|
|
25
25
|
.slice(-5)
|
|
26
26
|
.join("\n");
|
|
27
27
|
}
|
|
28
|
-
const insights =
|
|
28
|
+
const insights = `[MEMORY] **Memory Insights**\n- **Phase:** ${activePhase}\n- **Trace:** ${activeTrace}\n\n**Recent Actions:**\n${recentHistory}`;
|
|
29
29
|
return { content: [{ type: "text", text: insights }] };
|
|
30
30
|
}
|
|
31
31
|
catch (e) {
|
|
@@ -18,5 +18,5 @@ export function handleLogAgentAction(projectRoot, args) {
|
|
|
18
18
|
};
|
|
19
19
|
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
20
20
|
fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
|
|
21
|
-
return { content: [{ type: "text", text:
|
|
21
|
+
return { content: [{ type: "text", text: `[OK] Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
22
22
|
}
|
|
@@ -8,7 +8,7 @@ export async function handleSendAgentMessage(projectRoot, args) {
|
|
|
8
8
|
if (!to || !category || !content || !traceId) {
|
|
9
9
|
const err = "Missing required messaging arguments (to, category, content, or traceId).";
|
|
10
10
|
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
11
|
-
return { isError: true, content: [{ type: "text", text:
|
|
11
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
12
12
|
}
|
|
13
13
|
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
14
14
|
const messagesDir = path.join(projectRoot, frameworkDir, "messages");
|
|
@@ -47,14 +47,14 @@ export async function handleSendAgentMessage(projectRoot, args) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
return { content: [{ type: "text", text:
|
|
50
|
+
return { content: [{ type: "text", text: `[ERROR] Unexpected lock acquisition error: ${error.message || String(err)}` }], isError: true };
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
if (!acquired) {
|
|
55
55
|
const err = `Could not send message to ${to}: Hermes lock is busy.`;
|
|
56
56
|
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
57
|
-
return { content: [{ type: "text", text:
|
|
57
|
+
return { content: [{ type: "text", text: `[ERROR] ${err}` }], isError: true };
|
|
58
58
|
}
|
|
59
59
|
try {
|
|
60
60
|
const defaultPriority = (category === "ALERT" || category === "ACTION") ? "HIGH" : "NORMAL";
|
|
@@ -74,12 +74,12 @@ export async function handleSendAgentMessage(projectRoot, args) {
|
|
|
74
74
|
requiresApproval: finalRequiresApproval
|
|
75
75
|
};
|
|
76
76
|
fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
|
|
77
|
-
return { content: [{ type: "text", text:
|
|
77
|
+
return { content: [{ type: "text", text: `[OK] Message sent to ${to} (from: ${from})` }] };
|
|
78
78
|
}
|
|
79
79
|
catch (e) {
|
|
80
80
|
const err = `Failed to write message: ${String(e)}`;
|
|
81
81
|
Metrics.logError(projectRoot, from, "send_agent_message", err);
|
|
82
|
-
return { isError: true, content: [{ type: "text", text:
|
|
82
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
83
83
|
}
|
|
84
84
|
finally {
|
|
85
85
|
if (acquired && fs.existsSync(lockPath)) {
|
|
@@ -14,7 +14,7 @@ export function handleCheckPorts(projectRoot, args) {
|
|
|
14
14
|
return {
|
|
15
15
|
content: [{
|
|
16
16
|
type: "text",
|
|
17
|
-
text:
|
|
17
|
+
text: `[SIGNAL] **Active Listening Ports:**\n\n${output || "No active listening ports found matching filter."}`
|
|
18
18
|
}]
|
|
19
19
|
};
|
|
20
20
|
}
|
|
@@ -17,13 +17,13 @@ export function handleCheckLint(projectRoot, _args) {
|
|
|
17
17
|
Metrics.logError(projectRoot, "@mcp", "check_lint", err);
|
|
18
18
|
resolve({
|
|
19
19
|
isError: true,
|
|
20
|
-
content: [{ type: "text", text:
|
|
20
|
+
content: [{ type: "text", text: `[ERROR] Lint Errors Found (${language}):\n\n${output}` }]
|
|
21
21
|
});
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
Metrics.logUsage(projectRoot, "@mcp", "check_lint", tokens);
|
|
25
25
|
resolve({
|
|
26
|
-
content: [{ type: "text", text:
|
|
26
|
+
content: [{ type: "text", text: `[OK] Lint check passed successfully for ${language}:\n\n${output}` }]
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
});
|
|
@@ -42,7 +42,7 @@ export function handleGetProjectGaps(projectRoot, args) {
|
|
|
42
42
|
type: "text",
|
|
43
43
|
text: results.length > 0
|
|
44
44
|
? `Found ${results.length} gaps/todos:\n\n${results.join("\n")}`
|
|
45
|
-
: "
|
|
45
|
+
: "[OK] No major gaps or TODOs found in the scanned directory."
|
|
46
46
|
}]
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -11,7 +11,7 @@ export function handleGrepSearch(projectRoot, args) {
|
|
|
11
11
|
if (!pattern) {
|
|
12
12
|
const err = "Search pattern is required.";
|
|
13
13
|
Metrics.logError(projectRoot, "@mcp", "grep_search", err);
|
|
14
|
-
return { isError: true, content: [{ type: "text", text:
|
|
14
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
15
15
|
}
|
|
16
16
|
const results = [];
|
|
17
17
|
try {
|
|
@@ -20,7 +20,7 @@ export function handleGrepSearch(projectRoot, args) {
|
|
|
20
20
|
catch (e) {
|
|
21
21
|
const err = `Invalid regex pattern: ${String(e)}`;
|
|
22
22
|
Metrics.logError(projectRoot, "@mcp", "grep_search", err);
|
|
23
|
-
return { isError: true, content: [{ type: "text", text:
|
|
23
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
24
24
|
}
|
|
25
25
|
const walk = (dir) => {
|
|
26
26
|
if (results.length > 100)
|
|
@@ -62,7 +62,7 @@ export function handleGrepSearch(projectRoot, args) {
|
|
|
62
62
|
catch (e) {
|
|
63
63
|
const err = `Search failed: ${String(e)}`;
|
|
64
64
|
Metrics.logError(projectRoot, "@mcp", "grep_search", err);
|
|
65
|
-
return { isError: true, content: [{ type: "text", text:
|
|
65
|
+
return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
68
|
content: [{
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { resolveFrameworkDir } from "./security.js";
|
|
2
5
|
/**
|
|
3
6
|
* Enterprise Compliance Guardrail
|
|
4
7
|
* Checks content against corporate standards using AST analysis before allowing file mutations.
|
|
@@ -22,7 +25,7 @@ export function verifyCorporateCompliance(content, filePath) {
|
|
|
22
25
|
if (["log", "warn", "error"].includes(name)) {
|
|
23
26
|
// Check if file is exempt
|
|
24
27
|
if (!filePath.includes("logger.ts") && !filePath.includes("check.ts") && !filePath.includes("cli.ts")) {
|
|
25
|
-
errors.push(
|
|
28
|
+
errors.push(`[ERROR] Corporate Compliance Breach: 'console.${name}' usage is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
}
|
|
@@ -31,7 +34,7 @@ export function verifyCorporateCompliance(content, filePath) {
|
|
|
31
34
|
if (ts.isTypeReferenceNode(node)) {
|
|
32
35
|
if (ts.isIdentifier(node.typeName) && node.typeName.text === "any") {
|
|
33
36
|
if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
|
|
34
|
-
errors.push(
|
|
37
|
+
errors.push(`[ERROR] Corporate Compliance Breach: 'any' type is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
@@ -42,14 +45,14 @@ export function verifyCorporateCompliance(content, filePath) {
|
|
|
42
45
|
const forbiddenLibs = ["@chakra-ui", "mui", "@shadcn", "antd", "bootstrap"];
|
|
43
46
|
const lib = forbiddenLibs.find(l => moduleSpecifier.text.includes(l));
|
|
44
47
|
if (lib) {
|
|
45
|
-
errors.push(
|
|
48
|
+
errors.push(`[ERROR] Corporate Compliance Breach: External UI library '${lib}' usage is FORBIDDEN at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}. Build atomic components manually instead.`);
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
// Handle 'any' as a keyword type (e.g., parameter: any)
|
|
50
53
|
if (node.kind === ts.SyntaxKind.AnyKeyword) {
|
|
51
54
|
if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
|
|
52
|
-
errors.push(
|
|
55
|
+
errors.push(`[ERROR] Corporate Compliance Breach: 'any' keyword is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
ts.forEachChild(node, visit);
|
|
@@ -69,10 +72,160 @@ export function verifyCorporateCompliance(content, filePath) {
|
|
|
69
72
|
if (msg.includes("Email") && (filePath.endsWith("README.md") || filePath.endsWith("package.json") || filePath.includes("CONTRIBUTING"))) {
|
|
70
73
|
continue;
|
|
71
74
|
}
|
|
72
|
-
errors.push(
|
|
75
|
+
errors.push(`[ERROR] Corporate Compliance Breach: ${msg} detected.`);
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
if (errors.length > 0) {
|
|
76
79
|
throw new Error(errors.join("\n"));
|
|
77
80
|
}
|
|
78
81
|
}
|
|
82
|
+
export function isHighRiskOperation(content, filePath) {
|
|
83
|
+
const fileName = filePath.toLowerCase();
|
|
84
|
+
// 1. Database Deletions / Table Drops
|
|
85
|
+
if (fileName.endsWith(".sql") || fileName.endsWith(".ts") || fileName.endsWith(".js") || fileName.endsWith(".go")) {
|
|
86
|
+
const dropRegex = /\b(DROP\s+(DATABASE|TABLE|SCHEMA|VIEW|INDEX)|TRUNCATE\s+TABLE)\b/i;
|
|
87
|
+
if (dropRegex.test(content)) {
|
|
88
|
+
return { isRisk: true, reason: "Database structural deletion detected (DROP/TRUNCATE)" };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// 2. Package Updates
|
|
92
|
+
if (fileName.endsWith("package.json")) {
|
|
93
|
+
return { isRisk: true, reason: "Dependency/package update operation detected" };
|
|
94
|
+
}
|
|
95
|
+
// 3. Deployment / Infrastructure Scripts
|
|
96
|
+
if (fileName.includes("deploy") ||
|
|
97
|
+
fileName.includes("dockerfile") ||
|
|
98
|
+
fileName.includes("docker-compose") ||
|
|
99
|
+
fileName.includes("k8s") ||
|
|
100
|
+
fileName.includes("kubernetes") ||
|
|
101
|
+
fileName.includes("github/workflows")) {
|
|
102
|
+
return { isRisk: true, reason: "Infrastructure or deployment script mutation detected" };
|
|
103
|
+
}
|
|
104
|
+
return { isRisk: false };
|
|
105
|
+
}
|
|
106
|
+
export async function verifyRiskAndAwaitApproval(projectRoot, content, filePath) {
|
|
107
|
+
const assessment = isHighRiskOperation(content, filePath);
|
|
108
|
+
if (!assessment.isRisk) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
112
|
+
const absoluteFrameworkPath = path.isAbsolute(frameworkDir)
|
|
113
|
+
? frameworkDir
|
|
114
|
+
: path.resolve(projectRoot, frameworkDir);
|
|
115
|
+
const statusPath = path.join(absoluteFrameworkPath, "memory", "status.json");
|
|
116
|
+
const statePath = path.join(absoluteFrameworkPath, "memory", "state.json");
|
|
117
|
+
const messagesDir = path.join(absoluteFrameworkPath, "messages");
|
|
118
|
+
const managerMsgPath = path.join(messagesDir, "manager.json");
|
|
119
|
+
let activeAgent = null;
|
|
120
|
+
let traceId = "UNKNOWN";
|
|
121
|
+
// 1. Resolve traceId from state.json
|
|
122
|
+
if (fs.existsSync(statePath)) {
|
|
123
|
+
try {
|
|
124
|
+
const state = JSON.parse(fs.readFileSync(statePath, "utf8"));
|
|
125
|
+
if (state && state.traceId) {
|
|
126
|
+
traceId = state.traceId;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch { /* ignore */ }
|
|
130
|
+
}
|
|
131
|
+
// 2. Resolve active agent from status.json
|
|
132
|
+
let statusData = {};
|
|
133
|
+
if (fs.existsSync(statusPath)) {
|
|
134
|
+
try {
|
|
135
|
+
statusData = JSON.parse(fs.readFileSync(statusPath, "utf8"));
|
|
136
|
+
for (const [agentName, info] of Object.entries(statusData)) {
|
|
137
|
+
if (info.state === "EXECUTING") {
|
|
138
|
+
activeAgent = agentName.startsWith("@") ? agentName : `@${agentName}`;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch { /* ignore */ }
|
|
144
|
+
}
|
|
145
|
+
if (!activeAgent) {
|
|
146
|
+
throw new Error(`Security Exception: High-risk operation blocked. ${assessment.reason}. (No active executing agent found)`);
|
|
147
|
+
}
|
|
148
|
+
// 3. Update active agent status to WAITING_FOR_APPROVAL
|
|
149
|
+
const originalTask = statusData[activeAgent.replace("@", "")]?.task || statusData[activeAgent]?.task || "Executing task";
|
|
150
|
+
const statusKey = activeAgent.replace("@", "");
|
|
151
|
+
statusData[statusKey] = {
|
|
152
|
+
state: "WAITING_FOR_APPROVAL",
|
|
153
|
+
task: `[PAUSED] Waiting for approval: ${assessment.reason} on ${filePath}`
|
|
154
|
+
};
|
|
155
|
+
try {
|
|
156
|
+
fs.writeFileSync(statusPath, JSON.stringify(statusData, null, 2));
|
|
157
|
+
}
|
|
158
|
+
catch { /* ignore */ }
|
|
159
|
+
// 4. Create and append ALERT message to messages/manager.json
|
|
160
|
+
if (!fs.existsSync(messagesDir)) {
|
|
161
|
+
fs.mkdirSync(messagesDir, { recursive: true });
|
|
162
|
+
}
|
|
163
|
+
const alertMsg = {
|
|
164
|
+
timestamp: new Date().toISOString(),
|
|
165
|
+
from: activeAgent,
|
|
166
|
+
to: "@manager",
|
|
167
|
+
category: "ALERT",
|
|
168
|
+
content: `High-risk operation: ${assessment.reason} on ${filePath}`,
|
|
169
|
+
traceId: traceId,
|
|
170
|
+
status: "PENDING",
|
|
171
|
+
priority: "HIGH",
|
|
172
|
+
requiresApproval: true,
|
|
173
|
+
action: `MUTATION:${filePath}`
|
|
174
|
+
};
|
|
175
|
+
try {
|
|
176
|
+
fs.appendFileSync(managerMsgPath, JSON.stringify(alertMsg) + "\n");
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
statusData[statusKey] = { state: "EXECUTING", task: originalTask };
|
|
180
|
+
fs.writeFileSync(statusPath, JSON.stringify(statusData, null, 2));
|
|
181
|
+
throw new Error(`Security Exception: Failed to queue approval request. ${String(err)}`, { cause: err });
|
|
182
|
+
}
|
|
183
|
+
// 5. Polling Loop: Wait for approval (up to 60 seconds)
|
|
184
|
+
const pollIntervalMs = 500;
|
|
185
|
+
const timeoutMs = 60000;
|
|
186
|
+
const start = Date.now();
|
|
187
|
+
while (Date.now() - start < timeoutMs) {
|
|
188
|
+
// Non-blocking wait
|
|
189
|
+
await new Promise(resolve => setTimeout(resolve, pollIntervalMs));
|
|
190
|
+
if (fs.existsSync(managerMsgPath)) {
|
|
191
|
+
try {
|
|
192
|
+
const contentStr = fs.readFileSync(managerMsgPath, "utf8").trim();
|
|
193
|
+
const lines = contentStr.split("\n");
|
|
194
|
+
let isApproved = false;
|
|
195
|
+
let isDenied = false;
|
|
196
|
+
for (const line of lines) {
|
|
197
|
+
if (!line.trim())
|
|
198
|
+
continue;
|
|
199
|
+
const parsed = JSON.parse(line);
|
|
200
|
+
if (parsed.traceId === traceId && parsed.category === "ALERT" && parsed.action === `MUTATION:${filePath}`) {
|
|
201
|
+
if (parsed.status === "APPROVED") {
|
|
202
|
+
isApproved = true;
|
|
203
|
+
}
|
|
204
|
+
else if (parsed.status === "PROCESSED" || parsed.status === "DENIED") {
|
|
205
|
+
isDenied = true;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (isApproved) {
|
|
210
|
+
statusData[statusKey] = { state: "EXECUTING", task: originalTask };
|
|
211
|
+
fs.writeFileSync(statusPath, JSON.stringify(statusData, null, 2));
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (isDenied) {
|
|
215
|
+
throw new Error("Security Exception: High-risk operation was explicitly DENIED by user.");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
catch (err) {
|
|
219
|
+
if (err.message.includes("explicitly DENIED")) {
|
|
220
|
+
throw err;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
statusData[statusKey] = { state: "EXECUTING", task: originalTask };
|
|
226
|
+
try {
|
|
227
|
+
fs.writeFileSync(statusPath, JSON.stringify(statusData, null, 2));
|
|
228
|
+
}
|
|
229
|
+
catch { /* ignore */ }
|
|
230
|
+
throw new Error(`Security Exception: High-risk operation timed out waiting for approval. (${assessment.reason})`);
|
|
231
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "./security.js";
|
|
4
|
+
function globToRegex(glob) {
|
|
5
|
+
const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
6
|
+
const step1 = escaped.replace(/\*\*/g, "__DBL_STR__");
|
|
7
|
+
const step2 = step1.replace(/\*/g, "[^/]*");
|
|
8
|
+
const regexStr = "^" + step2.replace(/__DBL_STR__/g, ".*") + "$";
|
|
9
|
+
return new RegExp(regexStr);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validates if the active agent has write permission for the target file.
|
|
13
|
+
* Automatically identifies the active agent by checking the status.json store
|
|
14
|
+
* for the agent in the "EXECUTING" state.
|
|
15
|
+
*/
|
|
16
|
+
export function verifyWritePermission(projectRoot, targetFilePath) {
|
|
17
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
18
|
+
const absoluteFrameworkPath = path.isAbsolute(frameworkDir)
|
|
19
|
+
? frameworkDir
|
|
20
|
+
: path.resolve(projectRoot, frameworkDir);
|
|
21
|
+
const matrixPath = path.join(absoluteFrameworkPath, "permission-matrix.json");
|
|
22
|
+
// If no permission matrix exists, skip enforcement (default allow)
|
|
23
|
+
if (!fs.existsSync(matrixPath)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let matrix;
|
|
27
|
+
try {
|
|
28
|
+
matrix = JSON.parse(fs.readFileSync(matrixPath, "utf8"));
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
throw new Error(`Failed to parse permission-matrix.json: ${String(e)}`, { cause: e });
|
|
32
|
+
}
|
|
33
|
+
// Determine the active agent from status.json
|
|
34
|
+
const statusPath = path.join(absoluteFrameworkPath, "memory", "status.json");
|
|
35
|
+
let activeAgent = null;
|
|
36
|
+
if (fs.existsSync(statusPath)) {
|
|
37
|
+
try {
|
|
38
|
+
const status = JSON.parse(fs.readFileSync(statusPath, "utf8"));
|
|
39
|
+
// Find an agent that is currently in the EXECUTING state
|
|
40
|
+
for (const [agentName, info] of Object.entries(status)) {
|
|
41
|
+
const data = info;
|
|
42
|
+
if (data.state === "EXECUTING") {
|
|
43
|
+
activeAgent = agentName.startsWith("@") ? agentName : `@${agentName}`;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
// Log warning but don't crash, default to allowing if status can't be parsed
|
|
50
|
+
process.stderr.write(`[Permissions] Warning: Failed to read status.json: ${String(e)}\n`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// If no active executing agent is found, default to allowing
|
|
54
|
+
if (!activeAgent) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const agentRules = matrix[activeAgent];
|
|
58
|
+
// If no rules defined for the agent, default to allowing
|
|
59
|
+
if (!agentRules || !agentRules.write) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Resolve target path relative to project root for glob matching
|
|
63
|
+
const relativeTargetPath = path.relative(projectRoot, path.resolve(projectRoot, targetFilePath));
|
|
64
|
+
const allowed = agentRules.write.some(glob => {
|
|
65
|
+
const regex = globToRegex(glob);
|
|
66
|
+
return regex.test(relativeTargetPath);
|
|
67
|
+
});
|
|
68
|
+
if (!allowed) {
|
|
69
|
+
throw new Error(`Permission Denied: Agent ${activeAgent} is not authorized to write to "${relativeTargetPath}". Matrix rules restrict writes to: [${agentRules.write.join(", ")}].`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atabey-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Agent Atabey Model Context Protocol (MCP) Server",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://github.com/ysf-bkr/atabey#readme",
|
|
12
12
|
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"package.json",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
13
19
|
"bin": {
|
|
14
20
|
"atabey-mcp": "dist/index.js"
|
|
15
21
|
},
|
package/mcp.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atabey",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "The Supreme AI Governance & Autonomous Orchestration Framework for Enterprise Development. Supports Polyglot Backends (Go, Java, Python, .NET, Node.js) and Multi-Language Communication (TR/EN).",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,19 +34,20 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"bin",
|
|
36
36
|
"dist",
|
|
37
|
-
"src",
|
|
38
37
|
"templates",
|
|
39
|
-
"framework-mcp",
|
|
40
38
|
"README.md",
|
|
41
39
|
"LICENSE",
|
|
42
40
|
"mcp.json",
|
|
43
|
-
"ATABEY.md"
|
|
41
|
+
"ATABEY.md",
|
|
42
|
+
"framework-mcp/dist",
|
|
43
|
+
"framework-mcp/package.json"
|
|
44
44
|
],
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=18.0.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "tsc && npm run build --prefix framework-mcp",
|
|
49
|
+
"build": "tsc && npm run build --prefix framework-mcp && npm run build:ui",
|
|
50
|
+
"build:ui": "npm run build --prefix src/dashboard",
|
|
50
51
|
"atabey:build": "npm run build --prefix framework-mcp",
|
|
51
52
|
"atabey:test": "vitest run",
|
|
52
53
|
"atabey:test:watch": "vitest",
|
|
@@ -65,6 +66,9 @@
|
|
|
65
66
|
"access": "public"
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
69
|
+
"atabey-mcp": "^0.0.8",
|
|
70
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
71
|
+
"better-sqlite3": "^12.10.1",
|
|
68
72
|
"chalk": "^5.6.2",
|
|
69
73
|
"js-yaml": "^4.2.0",
|
|
70
74
|
"typescript": "^5.9.3",
|
|
@@ -72,8 +76,8 @@
|
|
|
72
76
|
},
|
|
73
77
|
"devDependencies": {
|
|
74
78
|
"@eslint/js": "^10.0.1",
|
|
75
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
76
79
|
"@pandacss/dev": "^1.11.1",
|
|
80
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
77
81
|
"@types/node": "^25.9.1",
|
|
78
82
|
"eslint": "^10.4.0",
|
|
79
83
|
"globals": "^17.6.0",
|
|
@@ -16,6 +16,6 @@ This recipe governs the @architect agent's protocol for creating type-safe agree
|
|
|
16
16
|
2. **Commitment:** Run `atabey update-contract` to generate new SHA-256 signatures for the updated types.
|
|
17
17
|
3. **Audit:** Verify that `contract.version.json` accurately reflects the new architecture.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## [SIGNAL] Phase 4: Synchronization
|
|
20
20
|
1. **Distribution:** Ensure the updated `src/types` directory is correctly linked or copied to both Frontend and Backend projects.
|
|
21
21
|
2. **Verification:** Trigger @backend and @frontend agents to read the new contract and plan their implementations.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [DB] Engineering Recipe: Database Management & Migrations
|
|
2
2
|
|
|
3
3
|
This recipe governs the @database agent's protocol for schema creation, table modifications, and data integrity.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ This recipe governs the @database agent's protocol for schema creation, table mo
|
|
|
6
6
|
1. **Type Mapping:** Define the new table or column in `src/types/models.ts` using Branded Types for IDs.
|
|
7
7
|
2. **Validation:** Ensure the interface extends `BaseEntity` (id, createdAt, updatedAt).
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## [START] Phase 2: Migration Generation
|
|
10
10
|
1. **Scripting:** Write a reversible migration (up/down) using the project's migration tool (e.g., Kysely or SQL).
|
|
11
11
|
2. **Atomic Changes:** One migration per logical feature. Never bundle unrelated schema changes.
|
|
12
12
|
3. **Naming:** Use timestamp-prefixed naming (e.g., `20240101_add_customers_table.ts`).
|
|
@@ -19,7 +19,7 @@ This recipe governs the @database agent's protocol for schema creation, table mo
|
|
|
19
19
|
1. **Repo Layer:** Create or update the Repository class to include the new query logic.
|
|
20
20
|
2. **Strict Mode:** Ensure no raw SQL is used; leverage the query builder exclusively.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## [OK] Phase 5: Verification & Zero-Downtime Audit
|
|
23
23
|
1. **Dry Run:** If supported, dry-run the migration to check for locking issues.
|
|
24
24
|
2. **Validation:** Run `atabey verify-contract` to ensure code and schema are synced.
|
|
25
25
|
3. **Handoff:** Update `PROJECT_MEMORY.md` with the new schema version.
|